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
nicolargo/intellij-community
python/lib/Lib/site-packages/django/contrib/comments/views/utils.py
161
1777
""" A few bits of helper functions for comment views. """ import urllib import textwrap from django.http import HttpResponseRedirect from django.core import urlresolvers from django.shortcuts import render_to_response from django.template import RequestContext from django.core.exceptions import ObjectDoesNotExist from...
apache-2.0
waynenilsen/statsmodels
examples/python/robust_models_0.py
33
2992
## Robust Linear Models from __future__ import print_function import numpy as np import statsmodels.api as sm import matplotlib.pyplot as plt from statsmodels.sandbox.regression.predstd import wls_prediction_std # ## Estimation # # Load data: data = sm.datasets.stackloss.load() data.exog = sm.add_constant(data.ex...
bsd-3-clause
Azure/azure-sdk-for-python
sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_ddos_custom_policies_operations.py
1
20462
# 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 may ...
mit
florentx/OpenUpgrade
addons/stock_dropshipping/__init__.py
61
1045
# -*- 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...
agpl-3.0
gloaec/bamboo
bamboo/alembic/ddl/postgresql.py
18
1442
import re from sqlalchemy import types as sqltypes from .base import compiles, alter_table, format_table_name, RenameTable from .impl import DefaultImpl class PostgresqlImpl(DefaultImpl): __dialect__ = 'postgresql' transactional_ddl = True def compare_server_default(self, inspector_column, ...
gpl-3.0
NaohiroTamura/ironic
ironic/tests/unit/db/test_chassis.py
11
3335
# Copyright 2013 Hewlett-Packard Development Company, L.P. # 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...
apache-2.0
Haynie-Research-and-Development/jarvis
deps/lib/python3.4/site-packages/oauth2client/_pkce.py
10
2119
# Copyright 2016 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
gpl-2.0
taichatha/youtube-dl
youtube_dl/extractor/xtube.py
87
4621
from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import ( compat_urllib_request, compat_urllib_parse_unquote, ) from ..utils import ( parse_duration, str_to_int, ) class XTubeIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?(?P<url>xtube\.com/...
unlicense
theyaa/Impala
tests/query_test/test_insert_permutation.py
15
1597
# Copyright (c) 2012 Cloudera, Inc. All rights reserved. # Targeted Impala insert tests # import logging import pytest from tests.common.test_vector import * from tests.common.impala_test_suite import * from tests.common.test_dimensions import create_exec_option_dimension class TestInsertQueriesWithPermutation(ImpalaT...
apache-2.0
kjagoo/wger_stark
wger/__init__.py
1
1027
#!/usr/bin/env python # -*- coding: utf-8 -*- """ :copyright: 2011, 2012 by OpenSlides team, see AUTHORS. :license: GNU GPL, see LICENSE for more details. """ VERSION = (1, 8, 0, 'alpha', 3) RELEASE = False def get_version(version=None, release=None): """Derives a PEP386-compliant version number from VER...
agpl-3.0
ChrisAntaki/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/layout_tests/models/test_failures_unittest.py
124
3148
# Copyright (C) 2010 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
bsd-3-clause
jonathan-beard/edx-platform
cms/djangoapps/contentstore/views/entrance_exam.py
77
10703
""" Entrance Exams view module -- handles all requests related to entrance exam management via Studio Intended to be utilized as an AJAX callback handler, versus a proper view/screen """ from functools import wraps import json import logging from django.contrib.auth.decorators import login_required from django.views.d...
agpl-3.0
philippze/django-cms
cms/management/commands/subcommands/copy_lang.py
48
3158
# -*- coding: utf-8 -*- from django.conf import settings from django.core.management.base import BaseCommand, CommandError from cms.api import copy_plugins_to_language from cms.models import Page, StaticPlaceholder, EmptyTitle from cms.utils.copy_plugins import copy_plugins_to from cms.utils.i18n import get_language_...
bsd-3-clause
wang1352083/pythontool
python-2.7.12-lib/test/test_tempfile.py
6
35623
# tempfile.py unit tests. import tempfile import errno import io import os import signal import shutil import sys import re import warnings import contextlib import unittest from test import test_support as support warnings.filterwarnings("ignore", category=RuntimeWarning, ...
mit
irmen/Pyro5
tests/test_echoserver.py
1
2734
""" Tests for the built-in test echo server. Pyro - Python Remote Objects. Copyright by Irmen de Jong (irmen@razorvine.net). """ import time import pytest from threading import Thread, Event import Pyro5.client import Pyro5.errors import Pyro5.utils.echoserver as echoserver from Pyro5 import config class EchoServe...
mit
CunningLogic/vivo-2.6.35
scripts/tracing/draw_functrace.py
14676
3560
#!/usr/bin/python """ Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com> Licensed under the terms of the GNU GPL License version 2 This script parses a trace provided by the function tracer in kernel/trace/trace_functions.c The resulted trace is processed into a tree to produce a more human view of the call ...
gpl-2.0
normanmaurer/autobahntestsuite-maven-plugin
src/main/resources/twisted/trial/runner.py
1
26192
# -*- test-case-name: twisted.trial.test.test_runner -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ A miscellany of code used to run Trial tests. Maintainer: Jonathan Lange """ __all__ = [ 'TestSuite', 'DestructiveTestSuite', 'DryRunVisitor', 'ErrorHolder', 'LoggedSuite', ...
apache-2.0
akatsoulas/feedthefox
feedthefox/devices/models.py
2
2447
import os import uuid from django.db import models from django.conf import settings from django.core.exceptions import ValidationError from django.utils.encoding import python_2_unicode_compatible from stdnum import imei DEFAULT_DEVICE_TYPE = 'smartphone' def _get_upload_file_name(instance, filename): return ...
mpl-2.0
SNAPPETITE/backend
flask/lib/python2.7/site-packages/coverage/report.py
27
2872
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt """Reporter foundation for coverage.py.""" import os from coverage.files import prep_patterns, FnmatchMatcher from coverage.misc import CoverageException, NoSourc...
mit
colinligertwood/odoo
addons/website_certification/__init__.py
385
1030
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-TODAY OpenERP S.A. <http://www.openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms...
agpl-3.0
rvbelefonte/Rockfish2
rockfish2/extensions/cps/model.py
1
3390
""" Tools for working with Computer Programs in Seismology velocity models """ import os import numpy as np import datetime import pandas as pd from scipy.interpolate import interp1d import matplotlib.pyplot as plt from rockfish2 import logging from rockfish2.models.profile import Profile class CPSModel1d(Profile): ...
gpl-2.0
drjova/zenodo
zenodo/modules/accessrequests/receivers.py
2
4872
# -*- coding: utf-8 -*- # # This file is part of Zenodo. # Copyright (C) 2015 CERN. # # Zenodo 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...
gpl-3.0
40423127/2017springcd_hw
plugin/liquid_tags/youtube.py
284
1674
""" Youtube Tag --------- This implements a Liquid-style youtube tag for Pelican, based on the jekyll / octopress youtube tag [1]_ Syntax ------ {% youtube id [width height] %} Example ------- {% youtube dQw4w9WgXcQ 640 480 %} Output ------ <iframe width="640" height="480" src="https://www.youtube.com/embed/dQw4...
agpl-3.0
anbangleo/NlsdeWeb
Python-3.6.0/Lib/test/list_tests.py
2
18761
""" Tests common to list and UserList.UserList """ import sys import os from functools import cmp_to_key from test import support, seq_tests class CommonTest(seq_tests.CommonTest): def test_init(self): # Iterable arg is optional self.assertEqual(self.type2test([]), self.type2test()) # ...
mit
Metronote/metronotesd-alpha
lib/api.py
1
26200
#! /usr/bin/python3 import sys import os import threading import decimal import time import json import re import requests import collections import logging from logging import handlers as logging_handlers D = decimal.Decimal import apsw import flask from flask.ext.httpauth import HTTPBasicAuth from tornado.wsgi impo...
mit
PawarPawan/h2o-v3
py2/testdir_rapids/test_xl_seq.py
21
5328
import unittest, random, sys, time sys.path.extend(['.','..','../..','py']) import h2o2 as h2o import h2o_cmd, h2o_import as h2i, h2o_xl from h2o_xl import DF, Xbase, Key, KeyIndexed, Assign, Fcn from h2o_test import dump_json, verboseprint def checkAst(expected): ast = h2o_xl.Xbase.lastExecResult['ast'] asse...
apache-2.0
smart-developerr/my-first-blog
Lib/site-packages/django/contrib/gis/db/backends/spatialite/schema.py
518
6882
from django.db.backends.sqlite3.schema import DatabaseSchemaEditor from django.db.utils import DatabaseError class SpatialiteSchemaEditor(DatabaseSchemaEditor): sql_add_geometry_column = ( "SELECT AddGeometryColumn(%(table)s, %(column)s, %(srid)s, " "%(geom_type)s, %(dim)s, %(null)s)" ) sq...
gpl-3.0
madirish/hector
app/scripts/screenshot_scan/screenshot_scan.py
1
4015
#!/usr/bin/python """ This script is part of HECTOR. by Josh Bauer <joshbauer3@gmail.com> Modified by: Justin C. Klein Keane <jukeane@sas.upenn.edu> Last modified: 31 July, 2014 This script requires python 2.5 or higher. This script is a threaded screenshot scan using phantomjs to render screenshots for urls in Hecto...
gpl-3.0
hhstore/learning-notes
python/src/exercise/py27/ex03_callable_usage.py
2
1777
#!/usr/bin/env python # -*- coding: utf-8 -*- """ 可调用对象: - 魔法方法: __call__(self, [args...]) - 允许类的一个实例, 像函数那样被调用 - 允许你自己类的对象, 表现得像是函数,然后你就可以“调用”它们,把它们传递到使用函数做参数的函数中 - 本质上这代表了 x() 和 x.__call__() 是相同的 - 注意 __call__ 可以有多个参数,可以像定义其他任何函数一样,定义 __call__ ,喜欢用多少参数就用多少. - __call__ 在某些需要经常改变状态的类的实例中显得特别有用....
mit
StanfordBioinformatics/xppf
client/loomengine/template_tag.py
2
7550
#!/usr/bin/env python import argparse import os import sys from loomengine import server from loomengine import verify_has_connection_settings, \ get_server_url, verify_server_is_running, get_token from loomengine_utils.connection import Connection from loomengine_utils.exceptions import LoomengineUtilsError cla...
agpl-3.0
burdell/CS4464-Final-Project
django/db/utils.py
151
6225
import inspect import os from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.utils.importlib import import_module DEFAULT_DB_ALIAS = 'default' # Define some exceptions that mirror the PEP249 interface. # We will rethrow any backend-specific errors using these # commo...
bsd-3-clause
bjolivot/ansible
lib/ansible/modules/packaging/os/homebrew_tap.py
42
7344
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Daniel Jaouen <dcj24@cornell.edu> # (c) 2016, Indrajit Raychaudhuri <irc+code@indrajit.com> # # Based on homebrew (Andrew Dunham <andrew@du.nham.ca>) # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the...
gpl-3.0
sssemil/cjdns
node_build/dependencies/libuv/build/gyp/test/win/gyptest-command-quote.py
296
1282
#!/usr/bin/env python # 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. """ Make sure the program in a command can be a called batch file, or an application in the path. Specifically, this means not quoting some...
gpl-3.0
neeasade/qutebrowser
tests/unit/completion/test_models.py
1
15355
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2016 Ryan Roden-Corrent (rcorre) <ryan@rcorre.net> # # This file is part of qutebrowser. # # qutebrowser 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 Foun...
gpl-3.0
ecino/compassion-modules
partner_communication/__manifest__.py
2
2656
# -*- coding: utf-8 -*- ############################################################################## # # ______ Releasing children from poverty _ # / ____/___ ____ ___ ____ ____ ___________(_)___ ____ # / / / __ \/ __ `__ \/ __ \/ __ `/ ___/ ___/ / __ \/ __ \ # / /___/ /_/ / / / / / / /_/...
agpl-3.0
TeamTwisted/leanKernel-shamu
tools/perf/scripts/python/failed-syscalls-by-pid.py
11180
2058
# failed system call counts, by pid # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide failed system call totals, broken down by pid. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.pa...
gpl-2.0
benfinke/ns_python
build/lib/nssrc/com/citrix/netscaler/nitro/resource/config/ssl/sslservice_args.py
3
1205
# # Copyright (c) 2008-2015 Citrix Systems, Inc. # # Licensed under the Apache License, Version 2.0 (the "License") # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
apache-2.0
deeplook/bokeh
examples/glyphs/widgets_server.py
42
2426
from __future__ import print_function from datetime import date from random import randint from bokeh.browserlib import view from bokeh.document import Document from bokeh.models.glyphs import Line, Circle from bokeh.models import ( Plot, ColumnDataSource, DataRange1d, LinearAxis, DatetimeAxis, Grid, HoverToo...
bsd-3-clause
mariodebian/jclic-browser
jclic_downloader.py
1
14268
#!/usr/bin/python # -*- coding: UTF-8 -*- # # Por Mario Izquierdo Rodríguez # # JclicDownloader descarga las actividades que se le pasen como filtro # import sgmllib import sys import urllib import os from time import sleep import getopt import zipfile from xml.dom import minidom # si test es True se usan archiv...
gpl-2.0
lscheinkman/nupic.core
bindings/py/tests/connections_test.py
9
18655
#!/usr/bin/env python # ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2017, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions ...
agpl-3.0
ultilix/catawampus
tr/cwmpbool.py
6
1433
# Copyright 2011 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
apache-2.0
adamnew123456/myweb
myweb/frontend/cli.py
1
9534
""" A command-line based frontend for interacting with myweb. """ from myweb.backend import config, db, query, utils import argparse import os import re import sys import tempfile HELP = """myweb-cli - A command-line interface to myweb. Usage: myweb-cli <command> <args> Commands: search QUERY Search...
bsd-2-clause
Foxfanmedium/python_training
OnlineCoursera/mail_ru/Python_1/env/Lib/site-packages/prompt_toolkit/renderer.py
7
19732
""" Renders the command line on the console. (Redraws parts of the input line that were changed.) """ from __future__ import unicode_literals from prompt_toolkit.filters import to_cli_filter from prompt_toolkit.layout.mouse_handlers import MouseHandlers from prompt_toolkit.layout.screen import Point, Screen, WritePosi...
apache-2.0
Billups/TileStache
TileStache/Goodies/VecTiles/topojson.py
4
8259
from shapely.wkb import loads import json from ... import getTile from ...Core import KnownUnknown def get_tiles(names, config, coord): ''' Retrieve a list of named TopoJSON layer tiles from a TileStache config. Check integrity and compatibility of each, looking at known layers, correct JSON ...
bsd-3-clause
szymex/xbmc-finnish-tv
plugin.video.yleareena/win32/Crypto/SelfTest/__init__.py
111
3418
# -*- coding: utf-8 -*- # # SelfTest/__init__.py: Self-test for PyCrypto # # Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net> # # =================================================================== # The contents of this file are dedicated to the public domain. To # the extent that dedication to the public...
gpl-3.0
reingart/vb2py
vb2py/vb/test3/test/frmImage.rsrc.py
2
3258
{'stack': {'backgrounds': [{'components': [{'label': 'Set Strech', 'name': 'Command1', 'position': (248, 48), 'size': (89, 25), 'type': 'VBB...
gpl-3.0
qiwsir/vincent
examples/map_examples.py
11
6721
# -*- coding: utf-8 -*- """ Vincent Map Examples """ #Build a map from scratch from vincent import * world_topo = r'world-countries.topo.json' state_topo = r'us_states.topo.json' lake_topo = r'lakes_50m.topo.json' county_geo = r'us_counties.geo.json' county_topo = r'us_counties.topo.json' or_topo = r'or_counties.t...
mit
F5Networks/f5-common-python
f5/bigip/tm/util/clientssl_ciphers.py
1
1459
# coding=utf-8 # # Copyright 2016 F5 Networks 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 a...
apache-2.0
8u1a/plaso
tests/multi_processing/process_info.py
3
1024
#!/usr/bin/python # -*- coding: utf-8 -*- """Tests the class to get process information.""" import os import unittest from plaso.multi_processing import process_info class ProcessInfoTest(unittest.TestCase): """Tests the process information object.""" def testInitialization(self): """Tests the initializati...
apache-2.0
Lamaw/Newzer
lemonde_extractor.py
1
6762
# -*- coding: utf-8 -*- """ This page defines the Implementation of an analyzer for "www.lemonde.fr" """ from HTMLParser import HTMLParser from Isite_extractor import ISiteExtractor class LeMondeExtractor(ISiteExtractor): """ This class implements the Page analyzer interface for "lemonde.fr" website """ ...
mit
jalexvig/tensorflow
tensorflow/contrib/data/python/kernel_tests/serialization/unbatch_dataset_serialization_test.py
14
1952
# Copyright 2018 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
hhstore/learning-notes
python/src/exercise/py27/03_Network/RPC/XMLRPC/02_rpc_serv_cli/rpc_server.py
2
1201
# -*- coding:utf8 -*- ''' 功能: XML-RPC 服务端实现 依赖: SimpleXMLRPCServer 说明: 1. 命令行,先运行服务器端,再运行客户端. 2. ctrl+c, 退出服务器端服务. ''' __author__ = 'hhstore' from SimpleXMLRPCServer import SimpleXMLRPCServer # 自定义的类,待注册 class StringFunction(object): def __init__(self): import string self.python_stri...
mit
chenbaihu/grpc
tools/buildgen/mako_renderer.py
12
3800
#!/usr/bin/python2.7 # Copyright 2015, 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...
bsd-3-clause
Dandandan/wikiprogramming
jsrepl/extern/python/closured/lib/python2.7/htmllib.py
312
12869
"""HTML 2.0 parser. See the HTML 2.0 specification: http://www.w3.org/hypertext/WWW/MarkUp/html-spec/html-spec_toc.html """ from warnings import warnpy3k warnpy3k("the htmllib module has been removed in Python 3.0", stacklevel=2) del warnpy3k import sgmllib from formatter import AS_IS __all__ = ["HTMLPars...
mit
rdoh/pixelated-user-agent
service/test/functional/features/environment.py
5
2804
# # Copyright (c) 2014 ThoughtWorks, Inc. # # Pixelated 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 later version. # # Pixelated is distrib...
agpl-3.0
zhangg/trove
trove/tests/unittests/api/test_versions.py
3
8368
# Copyright 2013 OpenStack Foundation # Copyright 2013 Hewlett-Packard Development Company, L.P. # # 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/lic...
apache-2.0
murat1985/bagpipe-bgp
bagpipe/bgp/engine/worker.py
2
5205
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # encoding: utf-8 # Copyright 2014 Orange # # 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 # # Un...
apache-2.0
olapaola/olapaola-android-scripting
python/src/Lib/distutils/command/register.py
49
11509
"""distutils.command.register Implements the Distutils 'register' command (register with the repository). """ # created 2002/10/21, Richard Jones __revision__ = "$Id: register.py 67944 2008-12-27 13:28:42Z tarek.ziade $" import os, string, urllib2, getpass, urlparse import StringIO from distutils.core import PyPIR...
apache-2.0
heartherumble/django-tinymce
testtinymce/settings.py
5
3360
# Django settings for testtinymce project. import os ROOT_PATH = os.path.dirname(os.path.realpath(__file__)) DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@domain.com'), ) MANAGERS = ADMINS DATABASE_ENGINE = 'sqlite3' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or ...
mit
spirrello/spirrello-pynet-work
applied_python/lib/python2.7/site-packages/pysnmp/proto/secmod/rfc3414/priv/des.py
4
4328
# # This file is part of pysnmp software. # # Copyright (c) 2005-2016, Ilya Etingof <ilya@glas.net> # License: http://pysnmp.sf.net/license.html # import random from pysnmp.proto.secmod.rfc3414.priv import base from pysnmp.proto.secmod.rfc3414.auth import hmacmd5, hmacsha from pysnmp.proto.secmod.rfc3414 import localke...
gpl-3.0
shubhdev/edx-platform
common/test/acceptance/tests/lms/test_lms_problems.py
21
3301
# -*- coding: utf-8 -*- """ Bok choy acceptance tests for problems in the LMS See also old lettuce tests in lms/djangoapps/courseware/features/problems.feature """ from ..helpers import UniqueCourseTest from ...pages.studio.auto_auth import AutoAuthPage from ...pages.lms.courseware import CoursewarePage from ...pages....
agpl-3.0
julianwachholz/praw
tests/test_config.py
7
1353
"""Tests for Config class.""" from __future__ import print_function, unicode_literals import unittest from praw import Config from praw.errors import ClientException try: import ConfigParser as configparser except ImportError: import configparser # NOQA pylint: disable=F0401 class ConfigTest(unittest.Test...
gpl-3.0
Balannen/LSMASOMM
atom3/Kernel/Layout/RandomLayout.py
1
2169
""" RandomLayout.py Generates a random layout by moving all the nodes positions randomly in a 640x480 pixel box. The connections are then optimized for the new layout. Guaranteed to hit an aesthetic layout at infinity, not recognize it, and keep on going for another infinity :p Created Summer 2004, Denis...
gpl-3.0
FireWRT/OpenWrt-Firefly-Libraries
staging_dir/host/lib/python2.7/test/test_codecmaps_jp.py
32
1857
# # test_codecmaps_jp.py # Codec mapping tests for Japanese encodings # from test import test_support from test import test_multibytecodec_support import unittest class TestCP932Map(test_multibytecodec_support.TestBase_Mapping, unittest.TestCase): encoding = 'cp932' mapfileurl = 'http://w...
gpl-2.0
thaumos/ansible
lib/ansible/modules/network/fortios/fortios_router_multicast6.py
21
10553
#!/usr/bin/python from __future__ import (absolute_import, division, print_function) # 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 Lic...
gpl-3.0
DazWorrall/ansible-modules-extras
windows/win_unzip.py
98
3637
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Phil Schwartz <schwartzmx@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 ...
gpl-3.0
bbiiggppiigg/PokemonGo-Bot
pokemongo_bot/api_wrapper.py
3
11695
import time import logging import random, base64, struct import hashlib import os import json from pgoapi.exceptions import (ServerSideRequestThrottlingException, NotLoggedInException, ServerBusyOrOfflineException, NoPlayerPositionSetException, EmptySubreque...
mit
aam-at/tensorflow
tensorflow/python/ops/linalg/inverse_registrations.py
18
9206
# Copyright 2018 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
HiroIshikawa/21playground
flask-sample/hello/venv/lib/python3.5/site-packages/pkg_resources/__init__.py
211
106670
""" Package resource API -------------------- A resource is a logical file contained within a package, or a logical subdirectory thereof. The package resource API expects resource names to have their path parts separated with ``/``, *not* whatever the local path separator is. Do not use os.path operations to manipul...
mit
Ell/goonauth
profiles/migrations/0012_auto__add_oauthapplication.py
1
12056
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'OAuthApplication' db.create_table(u'profiles_oauthapplica...
mit
BorgERP/borg-erp-6of3
verticals/garage61/acy_mrp_operator/mrp_operator.py
1
10435
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (c) 2011 Acysos S.L. (http://acysos.com) All Rights Reserved. # Ignacio Ibeas <ignacio@acysos.com> # $Id$ # # This program i...
agpl-3.0
dstrockis/outlook-autocategories
lib/flask/testsuite/testing.py
561
7411
# -*- coding: utf-8 -*- """ flask.testsuite.testing ~~~~~~~~~~~~~~~~~~~~~~~ Test client and more. :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import flask import unittest from flask.testsuite import FlaskTestCase from flask._compat import text_type c...
apache-2.0
dokterbob/satchmo
docs/conf.py
5
6694
# -*- coding: utf-8 -*- # # Satchmo Project documentation build configuration file, created by # sphinx-quickstart on Tue Jul 8 21:21:45 2008. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file....
bsd-3-clause
tealover/nova
nova/virt/ironic/driver.py
9
48340
# coding=utf-8 # # Copyright 2014 Red Hat, Inc. # Copyright 2013 Hewlett-Packard Development Company, L.P. # 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 # # ...
apache-2.0
arborh/tensorflow
tensorflow/python/ops/ragged/ragged_from_sparse_op_test.py
9
4604
# Copyright 2018 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
wxiang7/airflow
airflow/operators/mssql_operator.py
5
1087
import logging from airflow.hooks import MsSqlHook from airflow.models import BaseOperator from airflow.utils.decorators import apply_defaults class MsSqlOperator(BaseOperator): """ Executes sql code in a specific Microsoft SQL database :param mssql_conn_id: reference to a specific mssql database :ty...
apache-2.0
moto-timo/ironpython3
Src/StdLib/Lib/encodings/cp273.py
212
14132
""" Python Character Mapping Codec cp273 generated from 'python-mappings/CP273.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='strict...
apache-2.0
Samuel789/MediPi
MedManagementWeb/env/lib/python3.5/site-packages/setuptools/command/build_clib.py
314
4484
import distutils.command.build_clib as orig from distutils.errors import DistutilsSetupError from distutils import log from setuptools.dep_util import newer_pairwise_group class build_clib(orig.build_clib): """ Override the default build_clib behaviour to do the following: 1. Implement a rudimentary time...
apache-2.0
buntyke/Flask
microblog/flask/lib/python2.7/site-packages/pip/_vendor/distlib/version.py
426
23711
# -*- coding: utf-8 -*- # # Copyright (C) 2012-2014 The Python Software Foundation. # See LICENSE.txt and CONTRIBUTORS.txt. # """ Implementation of a flexible versioning scheme providing support for PEP-386, distribute-compatible and semantic versioning. """ import logging import re from .compat import string_types ...
mit
merlinmarek/ICTScan
Python/perspective_transformation/perspective_transformation.py
1
2001
#!/usr/bin/env python import sys import cv2 import numpy as np point_count = 0; y = []; x = []; def run_prespective_transform(): global src src_quad = np.array([(x[0], y[0]), (x[1], y[1]), (x[2], y[2]), (x[3], y[3])], np.float32); dst_quad = np.array([(0.0, 0.0), (1032.0, 0.0), (1032.0, 581.0), (0.0, 581.0)], np.f...
bsd-2-clause
scode/pants
src/python/pants/backend/codegen/tasks/antlr_gen.py
3
5069
# 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 logging impor...
apache-2.0
t-abe/chainer
cupy/testing/array.py
15
1595
import numpy.testing import cupy # NumPy-like assertion functions that accept both NumPy and CuPy arrays def assert_allclose(actual, desired, rtol=1e-7, atol=0, err_msg='', verbose=True): numpy.testing.assert_allclose( cupy.asnumpy(actual), cupy.asnumpy(desired), rtol=rtol, a...
mit
ticosax/django
django/db/backends/dummy/base.py
429
2570
""" Dummy database backend for Django. Django uses this if the database ENGINE setting is empty (None or empty string). Each of these API functions, except connection.close(), raises ImproperlyConfigured. """ from django.core.exceptions import ImproperlyConfigured from django.db.backends.base.base import BaseDatabas...
bsd-3-clause
ff94315/hiwifi-openwrt-HC5661-HC5761
staging_dir/target-mipsel_r2_uClibc-0.9.33.2/usr/lib/python2.7/io.py
191
3624
"""The io module provides the Python interfaces to stream handling. The builtin open function is defined in this module. At the top of the I/O hierarchy is the abstract base class IOBase. It defines the basic interface to a stream. Note, however, that there is no separation between reading and writing to streams; impl...
gpl-2.0
maciejkula/scipy
scipy/sparse/linalg/isolve/minres.py
128
9207
from __future__ import division, print_function, absolute_import from numpy import sqrt, inner, finfo, zeros from numpy.linalg import norm from .utils import make_system from .iterative import set_docstring __all__ = ['minres'] header = \ """Use MINimum RESidual iteration to solve Ax=b MINRES minimizes norm(A*x -...
bsd-3-clause
Jonnymcc/ansible
lib/ansible/module_utils/shell.py
7
6101
# # (c) 2015 Peter Sprygada, <psprygada@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 late...
gpl-3.0
ayan-usgs/PubsWarehouse_UI
server/pubs_ui/pubswh/tests/test_utils.py
4
27699
""" Tests for pubswh blueprint's utility functions """ import unittest from unittest.mock import MagicMock, patch import arrow import requests as r import requests_mock from .test_data import ( crossref_200_ok, crossref_200_not_ok, crossref_200_ok_2_date_parts, crossref_200_ok_1_date_part, crossref_200_ok_mes...
unlicense
EBI-Metagenomics/emgapi
emgcli/routers.py
1
1165
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2017 EMBL - European Bioinformatics Institute # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICEN...
apache-2.0
KnCMiner/bitcoin
qa/rpc-tests/getblocktemplate_proposals.py
145
6328
#!/usr/bin/env python2 # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. from test_framework.test_framework import BitcoinTestFramework from test_framework.util import * from binasci...
mit
rzr/synapse
synapse/handlers/__init__.py
1
2767
# -*- coding: utf-8 -*- # Copyright 2014, 2015 OpenMarket Ltd # # 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
carlye566/IoT-POX
pox/lib/recoco/consumer.py
46
2959
# Copyright 2013 James McCauley # # 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...
apache-2.0
smesdaghi/geonode
geonode/upload/utils.py
31
2890
######################################################################### # # Copyright (C) 2012 OpenPlans # # 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 #...
gpl-3.0
ramondelafuente/ansible-modules-extras
system/sefcontext.py
42
8030
#!/usr/bin/python # (c) 2016, Dag Wieers <dag@wieers.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
YangSongzhou/django
django/contrib/gis/geos/libgeos.py
345
6218
""" This module houses the ctypes initialization procedures, as well as the notice and error handler function callbacks (get called when an error occurs in GEOS). This module also houses GEOS Pointer utilities, including get_pointer_arr(), and GEOM_PTR. """ import logging import os import re from ctypes import CD...
bsd-3-clause
oktools/coypu
quokka/modules/comments/views.py
10
1313
#!/usr/bin/env python # -*- coding: utf-8 -*- from flask import request from flask.views import MethodView from flask.ext.mongoengine.wtf import model_form from flask.ext.security import current_user from quokka.core.templates import render_template from .models import Comment class CommentView(MethodView): for...
mit
profglavcho/mt6577-kernel-3.10.65
tools/perf/scripts/python/sched-migration.py
11215
11670
#!/usr/bin/python # # Cpu task migration overview toy # # Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com> # # perf script event handlers have been generated by perf script -g python # # This software is distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Fre...
gpl-2.0
CapOM/ChromiumGStreamerBackend
third_party/cython/src/Cython/Compiler/ParseTreeTransforms.py
86
115877
import cython cython.declare(PyrexTypes=object, Naming=object, ExprNodes=object, Nodes=object, Options=object, UtilNodes=object, LetNode=object, LetRefNode=object, TreeFragment=object, EncodedString=object, error=object, warning=object, copy=object) import PyrexTypes import...
bsd-3-clause
Senseg/Py4A
python-modules/twisted/twisted/protocols/sip.py
59
41755
# -*- test-case-name: twisted.test.test_sip -*- # Copyright (c) 2001-2009 Twisted Matrix Laboratories. # See LICENSE for details. """Session Initialization Protocol. Documented in RFC 2543. [Superceded by 3261] This module contains a deprecated implementation of HTTP Digest authentication. See L{twisted.cred.cred...
apache-2.0
pgmillon/ansible
test/units/modules/storage/netapp/test_netapp_e_auditlog.py
68
10758
# (c) 2018, NetApp Inc. # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from ansible.modules.storage.netapp.netapp_e_auditlog import AuditLog from units.modules.utils import AnsibleFailJson, ModuleTestCase, set_module_args __metaclass__ = type from units.compat import mock...
gpl-3.0
AntonChankin/thefuck
tests/test_conf.py
13
4054
import pytest import six from mock import Mock from thefuck import conf @pytest.fixture def load_source(mocker): return mocker.patch('thefuck.conf.load_source') @pytest.fixture def environ(monkeypatch): data = {} monkeypatch.setattr('thefuck.conf.os.environ', data) return data @pytest.mark.usefixt...
mit