repo_name
stringlengths
5
100
path
stringlengths
4
375
copies
stringclasses
991 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
PennartLoettring/Poettrix
rootfs/usr/lib/python3.4/test/test_threadedtempfile.py
171
2192
""" Create and delete FILES_PER_THREAD temp files (via tempfile.TemporaryFile) in each of NUM_THREADS threads, recording the number of successes and failures. A failure is a bug in tempfile, and may be due to: + Trying to create more than one tempfile with the same name. + Trying to delete a tempfile that doesn't sti...
gpl-2.0
eeshangarg/oh-mainline
vendor/packages/python-social-auth/social/tests/backends/test_twitch.py
87
1050
import json from social.tests.backends.oauth import OAuth2Test class TwitchOAuth2Test(OAuth2Test): backend_path = 'social.backends.twitch.TwitchOAuth2' user_data_url = 'https://api.twitch.tv/kraken/user/' expected_username = 'test_user1' access_token_body = json.dumps({ 'access_token': 'foobar...
agpl-3.0
leafclick/intellij-community
python/testData/inspections/PyTypeCheckerInspection/Generator.py
30
3112
def test(): def gen(n): for x in xrange(n): yield str(x) def f_1(xs): """ :type xs: list of int """ return xs def f_2(xs): """ :type xs: collections.Sequence of int """ return xs def f_3(xs): """ :type xs...
apache-2.0
sigma/vmw.vco
src/vmw/vco/types.py
1
1824
# Copyright (c) 2009-2010 VMware, Inc. All Rights Reserved. # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modif...
mit
cloudera/zookeeper
src/contrib/zkpython/src/test/close_deadlock_test.py
164
1574
#!/usr/bin/python # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "Lic...
apache-2.0
smarinac/root
interpreter/llvm/src/utils/DSAclean.py
147
1187
#! /usr/bin/python #changelog: #10/13/2005b: replaced the # in tmp(.#*)* with alphanumeric and _, this will then remove #nodes such as %tmp.1.i and %tmp._i.3 #10/13/2005: exntended to remove variables of the form %tmp(.#)* rather than just #%tmp.#, i.e. it now will remove %tmp.12.3.15 etc, additionally fixed a spell...
lgpl-2.1
4Quant/tensorflow
tensorflow/python/ops/seq2seq.py
2
48249
# Copyright 2015 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...
apache-2.0
LennonChin/Django-Practices
MxOnline/extra_apps/xadmin/plugins/auth.py
1
9482
# coding=utf-8 from django import forms from django.contrib.auth.forms import (UserCreationForm, UserChangeForm, AdminPasswordChangeForm, PasswordChangeForm) from django.contrib.auth.models import Group, Permission from django.core.exceptions import PermissionDenied from dja...
apache-2.0
clbarnes/bctpy
bct/algorithms/modularity.py
1
58844
from __future__ import division, print_function import numpy as np from bct.utils import BCTParamError, normalize, get_rng def ci2ls(ci): ''' Convert from a community index vector to a 2D python list of modules The list is a pure python list, not requiring numpy. Parameters ---------- ci : Nx...
gpl-3.0
jburns12/stixproject.github.io
documentation/idioms/snort-test-mechanism/snort-test-mechanism-consumer.py
1
1373
#!/usr/bin/env python # Copyright (c) 2014, The MITRE Corporation. All rights reserved. # See LICENSE.txt for complete terms. ''' The following code requires python-stix v1.1.1.0 or greater installed. For installation instructions, please refer to https://github.com/STIXProject/python-stix. ''' import sys from stix.c...
bsd-3-clause
TurboTurtle/sos
sos/report/plugins/openshift.py
5
15114
# This file is part of the sos project: https://github.com/sosreport/sos # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions of # version 2 of the GNU General Public License. # # See the LICENSE file in the source distribution ...
gpl-2.0
krieger-od/nwjs_chromium.src
chrome/test/ispy/server/update_mask_handler.py
100
2252
# 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. """Request Handler to allow test mask updates.""" import webapp2 import re import sys import os from common import constants from common import image_tools...
bsd-3-clause
pawelkondraciuk/mopidy-chomikuj
mopidy_chomikuj/__init__.py
1
1699
from __future__ import unicode_literals import logging import os # TODO: Remove entirely if you don't register GStreamer elements below import pygst pygst.require('0.10') import gst import gobject from mopidy import config, ext __version__ = '0.1.0' # TODO: If you need to log, use loggers named after the current ...
apache-2.0
liangwang/m5
ext/ply/test/lex_hedit.py
174
1141
# ----------------------------------------------------------------------------- # hedit.py # # Paring of Fortran H Edit descriptions (Contributed by Pearu Peterson) # # These tokens can't be easily tokenized because they are of the following # form: # # nHc1...cn # # where n is a positive integer and c1 ... cn are ch...
bsd-3-clause
kaulkie/keyczar
cpp/src/tools/scons/scons-local-1.2.0.d20090223/SCons/Tool/packaging/zip.py
19
1767
"""SCons.Tool.Packaging.zip The zip SRC packager. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the S...
apache-2.0
nooperpudd/pulsar
pulsar/apps/wsgi/utils.py
5
10984
''' The :mod:`pulsar.apps.wsgi.utils` module include several utilities used by various components in the :ref:`wsgi application <apps-wsgi>` ''' import time import re import textwrap import logging from datetime import datetime, timedelta from email.utils import formatdate from urllib.parse import parse_qsl from pulsa...
bsd-3-clause
JioCloud/nova_test_latest
nova/api/openstack/compute/contrib/server_group_quotas.py
79
1848
# Copyright 2012 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
apache-2.0
JPGlaser/Tycho
src/tycho/read.py
1
5586
# Python Classes/Functions used to Import Tycho Datasets # ------------------------------------- # # Python Package Importing # # ------------------------------------- # # TO-DO: Add time back to the read state function for Tyler's code # Importing Necessary System Packages import math import io import ...
mit
marcoantoniooliveira/labweb
oscar/lib/python2.7/site-packages/pygments/lexers/sql.py
70
23461
# -*- coding: utf-8 -*- """ pygments.lexers.sql ~~~~~~~~~~~~~~~~~~~ Lexers for various SQL dialects and related interactive sessions. Postgres specific lexers: `PostgresLexer` A SQL lexer for the PostgreSQL dialect. Differences w.r.t. the SQL lexer are: - keywords and dat...
bsd-3-clause
sparkslabs/kamaelia_
Sketches/TG/shard/PygameComponentShard.py
12
5183
# -*- coding: utf-8 -*- # Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1) # # (1) Kamaelia Contributors are listed in the AUTHORS file and at # http://www.kamaelia.org/AUTHORS - please extend this file, # not this notice. # # Licensed under the Apache License, Version 2.0 (the "Lic...
apache-2.0
rickhurst/Django-non-rel-blog
django/conf/locale/pl/formats.py
238
1288
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j E Y' TIME_FORMAT = 'H:i:s' DATETIME_FORMAT = 'j E Y H:i:s' YEAR_MONTH_F...
bsd-3-clause
jazkarta/edx-platform-for-isc
common/lib/xmodule/xmodule/annotator_token.py
211
1542
""" This file contains a function used to retrieve the token for the annotation backend without having to create a view, but just returning a string instead. It can be called from other files by using the following: from xmodule.annotator_token import retrieve_token """ import datetime from firebase_token_generator im...
agpl-3.0
puckipedia/youtube-dl
youtube_dl/extractor/restudy.py
146
1155
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor class RestudyIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?restudy\.dk/video/play/id/(?P<id>[0-9]+)' _TEST = { 'url': 'https://www.restudy.dk/video/play/id/1637', 'info_dict': { 'id': ...
unlicense
appleseedhq/cortex
python/IECoreNuke/Menus.py
5
2131
########################################################################## # # Copyright (c) 2011, 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: # # * Redistribu...
bsd-3-clause
hdinsight/hue
desktop/core/ext-py/Paste-2.0.1/paste/auth/cookie.py
50
16379
# (c) 2005 Clark C. Evans # This module is part of the Python Paste Project and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php # This code was written with funding by http://prometheusresearch.com """ Cookie "Saved" Authentication This authentication middleware saves the curren...
apache-2.0
gcarranza/couchdb-python
couchdb/design.py
7
8182
# -*- coding: utf-8 -*- # # Copyright (C) 2008-2009 Christopher Lenz # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. """Utility code for managing design documents.""" from copy import deepcopy from inspect import get...
bsd-3-clause
thor27/multimonitor-browser
detect_monitors.py
1
5052
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Detect Screens Copyright (C) 2016 Thomaz de Oliveira dos Reis <thor27@gmail.com> This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, ...
gpl-3.0
sdu-cfei/modest-py
modestpy/estim/ga/individual.py
1
6300
""" Copyright (c) 2017, University of Southern Denmark All rights reserved. This code is licensed under BSD 2-clause license. See LICENSE file in the project root for license terms. """ import logging import random import pandas as pd import numpy as np import copy from modestpy.estim.error import calc_err class Indi...
bsd-2-clause
tklengyel/dionaea
modules/python/scripts/smb/include/asn1/mib.py
11
5595
#******************************************************************************** #* Dionaea #* - catches bugs - #* #* #* #* Copyright (C) 2010 Markus Koetter #* #* This program is free software; you can redistribute it and/or #* modify it under the terms of the...
gpl-2.0
glenn-edgar/local_controller_3
__backup__/flask_web/werkzeug/local.py
84
13416
# -*- coding: utf-8 -*- """ werkzeug.local ~~~~~~~~~~~~~~ This module implements context-local objects. :copyright: (c) 2011 by the Werkzeug Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from werkzeug.wsgi import ClosingIterator from werkzeug._internal import...
mit
timzhangau/ml_nano
ud120/tools/parse_out_email_text.py
15
1277
#!/usr/bin/python from nltk.stem.snowball import SnowballStemmer import string def parseOutText(f): """ given an opened email file f, parse out all text below the metadata block at the top (in Part 2, you will also add stemming capabilities) and return a string that contains all the words ...
mit
AsherBond/MondocosmOS
grass_trunk/scripts/m.proj/m.proj.py
2
8042
#!/usr/bin/env python ############################################################################ # # MODULE: m.proj # AUTHOR: M. Hamish Bowman, Dept. Marine Science, Otago Univeristy, # New Zealand # Converted to Python by Glynn Clements # PURPOSE: cs2cs reprojection frontend for a list of coor...
agpl-3.0
nathanielvarona/airflow
airflow/providers/google/cloud/hooks/gcs.py
1
50042
# # 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...
apache-2.0
debugger22/sympy
sympy/matrices/expressions/tests/test_transpose.py
71
1194
from sympy.functions import adjoint, conjugate, transpose from sympy.matrices.expressions import MatrixSymbol, Adjoint, trace, Transpose from sympy.matrices import eye, Matrix from sympy import symbols, S from sympy import refine, Q n, m, l, k, p = symbols('n m l k p', integer=True) A = MatrixSymbol('A', n, m) B = Mat...
bsd-3-clause
lupyuen/RaspberryPiImage
home/pi/GrovePi/Software/Python/others/temboo/Library/LittleSis/Relationship/GetBatchRelationships.py
5
4101
# -*- coding: utf-8 -*- ############################################################################### # # GetBatchRelationships # Retrieves information about a batch of relationships in LittleSis according to the relationship IDs provided. # # Python versions 2.6, 2.7, 3.x # # Copyright 2014, Temboo Inc. # # License...
apache-2.0
hugegreenbug/libgestures
include/build/android/gyp/jar_toc.py
25
3110
#!/usr/bin/env python # # 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. """Creates a TOC file from a Java jar. The TOC file contains the non-package API of the jar. This includes all public/protected clas...
bsd-3-clause
squarenomad/historia
backend/manage.py
1
1531
#!/usr/bin/env python3 from app import create_app, db, graph, forge from app.email import send_email from app.models import Person, Link from app.faker import fake from flask_script import Manager, Shell from flask_migrate import Migrate, MigrateCommand import os app = create_app(os.getenv('HISTORIA_CONFIG') or 'defa...
mit
kdwink/intellij-community
python/lib/Lib/mailbox.py
80
74677
#! /usr/bin/env python """Read/write support for Maildir, mbox, MH, Babyl, and MMDF mailboxes.""" # Notes for authors of new mailbox subclasses: # # Remember to fsync() changes to disk before closing a modified file # or returning from a flush() method. See functions _sync_flush() and # _sync_close(). import sys im...
apache-2.0
tuxfux-hlp-notes/python-batches
archieves/batch-62/files/myenv/lib/python2.7/site-packages/pip/commands/completion.py
343
2453
from __future__ import absolute_import import sys from pip.basecommand import Command BASE_COMPLETION = """ # pip %(shell)s completion start%(script)s# pip %(shell)s completion end """ COMPLETION_SCRIPTS = { 'bash': """ _pip_completion() { COMPREPLY=( $( COMP_WORDS="${COMP_WORDS[*]}" \\ CO...
gpl-3.0
dudepare/django
django/conf/project_template/project_name/settings.py
271
3288
""" Django settings for {{ project_name }} project. Generated by 'django-admin startproject' using Django {{ django_version }}. For more information on this file, see https://docs.djangoproject.com/en/{{ docs_version }}/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.c...
bsd-3-clause
caneruguz/osf.io
api_tests/base/test_utils.py
12
3700
# -*- coding: utf-8 -*- from nose.tools import * # flake8: noqa import mock # noqa import unittest from rest_framework import fields from rest_framework.exceptions import ValidationError from api.base import utils as api_utils from tests.base import ApiTestCase from framework.status import push_status_message clas...
apache-2.0
thomasyu888/synapsePythonClient
tests/integration/synapseclient/core/upload/test_multipart_upload.py
1
7776
import filecmp import hashlib import os import random import requests import string import tempfile import traceback import uuid from io import open from unittest import mock, skip from synapseclient import File import synapseclient.core.config import synapseclient.core.utils as utils from synapseclient.core.upload.m...
apache-2.0
bplancher/odoo
openerp/addons/base/ir/ir_sequence.py
22
18267
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import logging import pytz import time from datetime import datetime, timedelta from openerp import _, api, fields, models from openerp.exceptions import UserError _logger = logging.getLogger(__name__) def _create_seq...
agpl-3.0
endlessm/chromium-browser
third_party/llvm/lldb/test/API/lang/objc/modules/TestObjCModules.py
1
2652
"""Test that importing modules in Objective-C works as expected.""" import unittest2 import lldb from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil class ObjCModulesTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) def setUp(self)...
bsd-3-clause
jetty840/ReplicatorG
skein_engines/skeinforge-35/fabmetheus_utilities/geometry/creation/line.py
6
5010
""" Square path. """ from __future__ import absolute_import #Init has to be imported first because it has code to workaround the python bug where relative imports don't work if the module is imported as a main module. import __init__ from fabmetheus_utilities.geometry.creation import lineation from fabmetheus_utilit...
gpl-2.0
omtinez/micropython
examples/pyb.py
99
1502
# pyboard testing functions for CPython import time def delay(n): #time.sleep(float(n) / 1000) pass rand_seed = 1 def rng(): global rand_seed # for these choice of numbers, see P L'Ecuyer, "Tables of linear congruential generators of different sizes and good lattice structure" rand_seed = (rand_se...
mit
CyanideL/android_kernel_samsung_klte
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
DreamStar001/Vegito_vibe_k5
tools/perf/scripts/python/net_dropmonitor.py
2669
1738
# Monitor the system for dropped packets and proudce a report of drop locations and counts import os import sys sys.path.append(os.environ['PERF_EXEC_PATH'] + \ '/scripts/python/Perf-Trace-Util/lib/Perf/Trace') from perf_trace_context import * from Core import * from Util import * drop_log = {} kallsyms = [] def...
gpl-2.0
Distrotech/intellij-community
python/lib/Lib/encodings/cp424.py
593
12311
""" Python Character Mapping Codec cp424 generated from 'MAPPINGS/VENDORS/MISC/CP424.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='...
apache-2.0
shitolepriya/test-frappe
frappe/share.py
5
3602
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe from frappe.utils import cint @frappe.whitelist() def add(doctype, name, user=None, read=1, write=0, share=0, everyone=0, flags=None): """Share the given document ...
mit
kramble/FPGA-Litecoin-Miner
ICARUS-LX150/MiningSoftware/pyserial-2.6/test/test.py
17
7824
#! /usr/bin/env python # Python Serial Port Extension for Win32, Linux, BSD, Jython # see __init__.py # # (C) 2001-2008 Chris Liechti <cliechti@gmx.net> # this is distributed under a free software license, see license.txt """\ Some tests for the serial module. Part of pyserial (http://pyserial.sf.net) (C)2001-2009 cl...
gpl-3.0
heemanshu/swift_juno
swift/cli/form_signature.py
17
5260
# Copyright (c) 2010-2012 OpenStack Foundation # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed ...
apache-2.0
nikhilsaraf/Twitter-Analytics
venv/lib/python2.7/site-packages/pip/utils/__init__.py
124
27531
from __future__ import absolute_import from collections import deque import contextlib import errno import io import locale # we have a submodule named 'logging' which would shadow this if we used the # regular name: import logging as std_logging import re import os import posixpath import shutil import stat import su...
gpl-3.0
PrashntS/scikit-learn
examples/applications/plot_model_complexity_influence.py
323
6372
""" ========================== Model Complexity Influence ========================== Demonstrate how model complexity influences both prediction accuracy and computational performance. The dataset is the Boston Housing dataset (resp. 20 Newsgroups) for regression (resp. classification). For each class of models we m...
bsd-3-clause
swinman/pyusb
tests/test_util.py
8
8744
# Copyright (C) 2009-2014 Wander Lairson Costa # # The following terms apply to all files associated # with the software unless explicitly disclaimed in individual files. # # The authors hereby grant permission to use, copy, modify, distribute, # and license this software and its documentation for any purpose, provided...
bsd-3-clause
kouk/boto
boto/glacier/job.py
153
7999
# -*- coding: utf-8 -*- # Copyright (c) 2012 Thomas Parslow http://almostobsolete.net/ # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation th...
mit
marc-sensenich/ansible
lib/ansible/modules/monitoring/sensu_check.py
46
12707
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2014, Anders Ingemann <aim@secoya.dk> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
dogecoin/dogecoin
src/test/bitcoin-util-test.py
51
1534
#!/usr/bin/env python # Copyright 2014 BitPay Inc. # Copyright 2016 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 __future__ import division,print_function,unicode_literals import os import bctest...
mit
danielfrg/s3contents
s3contents/genericfs.py
1
1876
""" Generic FileSystem class to be used by the Content Manager """ from s3contents.ipycompat import HasTraits class GenericFS(HasTraits): def ls(self, path=""): raise NotImplementedError( "Should be implemented by the file system abstraction" ) def isfile(self, path): rai...
apache-2.0
DevinDewitt/pyqt5
pyuic/uic/widget-plugins/qtdeclarative.py
2
1565
############################################################################# ## ## Copyright (c) 2014 Riverbank Computing Limited <info@riverbankcomputing.com> ## ## This file is part of PyQt5. ## ## This file may be used under the terms of the GNU General Public License ## version 3.0 as published by the Free Softw...
gpl-3.0
halfak/mwxml
mwxml/utilities/inflate.py
2
1818
r""" ``$ mwxml inflate -h`` :: Converts a stream of flat RevisionDocument JSON blobs into hierarchical JSON RevisionDocument JSON blobs. Usage: inflate (-h|--help) inflate [<input-file>...] [--threads=<num>] [--output=<path>] [--compress=<type>] [--verbose] [--debug] O...
mit
saleeh93/buck-cutom
third-party/py/twitter-commons/src/python/twitter/common/python/package.py
23
9291
import contextlib import os import tarfile import zipfile from .base import maybe_requirement from .common import safe_mkdtemp from .http.link import Link from .interpreter import PythonInterpreter from .pep425 import PEP425, PEP425Extras from .platforms import Platform from pkg_resources import ( EGG_NAME, p...
apache-2.0
gao-wei/qualitybots
src/appengine/common/useragent_parser_test.py
26
8267
#!/usr/bin/python2.4 # # 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...
apache-2.0
terranodo/geonode
geonode/base/management/commands/fixsitename.py
22
1462
# -*- coding: utf-8 -*- ######################################################################### # # Copyright (C) 2016 OSGeo # # 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 ...
gpl-3.0
graysonc/vim
autoload/conque_term/conque_sole_communicator.py
30
5055
# FILE: autoload/conque_term/conque_sole_communicator.py # AUTHOR: Nico Raffo <nicoraffo@gmail.com> # WEBSITE: http://conque.googlecode.com # MODIFIED: 2011-09-02 # VERSION: 2.3, for Vim 7.0 # LICENSE: # Conque - Vim terminal/console emulator # Copyright (C) 2009-2011 Nico Raffo # # MIT License # # Permission i...
mit
larsbutler/swift
swift/common/middleware/ratelimit.py
42
13190
# Copyright (c) 2010-2013 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
apache-2.0
ErikTromm1/Erik
py/openage/convert/mediafile.py
46
10925
# media files conversion stuff from .colortable import ColorTable, PlayerColorTable from collections import defaultdict from . import dataformat from .drs import DRS from . import filelist from .hardcoded import termcolors import os import os.path import pickle from string import Template import subprocess from .textu...
gpl-3.0
thomdixon/elasticsearch-py
docs/conf.py
9
8459
# -*- coding: utf-8 -*- # # Elasticsearch documentation build configuration file, created by # sphinx-quickstart on Mon May 6 15:38:41 2013. # # 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. #...
apache-2.0
kenxwagner/PythonPlay
Project/webscrap/websc/Lib/site-packages/setuptools/command/install_egg_info.py
412
2203
from distutils import log, dir_util import os from setuptools import Command from setuptools import namespaces from setuptools.archive_util import unpack_archive import pkg_resources class install_egg_info(namespaces.Installer, Command): """Install an .egg-info directory for the package""" description = "In...
mit
danicampora/micropython
tests/micropython/viper_misc.py
37
2637
import micropython # viper function taking and returning ints @micropython.viper def viper_int(x:int, y:int) -> int: return x + y + 3 print(viper_int(1, 2)) # viper function taking and returning objects @micropython.viper def viper_object(x:object, y:object) -> object: return x + y print(viper_object(1, 2)) ...
mit
hchen1202/django-react
virtualenv/lib/python3.6/site-packages/django/contrib/sessions/backends/cached_db.py
118
2813
""" Cached, database-backed sessions. """ import logging from django.conf import settings from django.contrib.sessions.backends.db import SessionStore as DBStore from django.core.cache import caches from django.core.exceptions import SuspiciousOperation from django.utils import timezone from django.utils.encoding imp...
mit
krux/adspygoogle
examples/adspygoogle/dfp/v201204/create_teams.py
2
1659
#!/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...
apache-2.0
monikasulik/django-oscar
tests/integration/address/form_tests.py
39
1320
from django.test import TestCase from oscar.apps.address import models, forms from oscar.core.compat import get_user_model from oscar.test.factories import UserFactory class TestUserAddressForm(TestCase): def setUp(self): self.user = UserFactory() self.country = models.Country.objects.create( ...
bsd-3-clause
dweinstein/finsky
finsky/protos/play_survey_pb2.py
2
8956
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: play_survey.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _r...
mit
evgchz/scikit-learn
doc/tutorial/text_analytics/solutions/exercise_01_language_train_model.py
254
2253
"""Build a language detector model The goal of this exercise is to train a linear classifier on text features that represent sequences of up to 3 consecutive characters so as to be recognize natural languages by using the frequencies of short character sequences as 'fingerprints'. """ # Author: Olivier Grisel <olivie...
bsd-3-clause
wolfmanstout/dragonfly
dragonfly/actions/keyboard/_pynput.py
2
8733
# # This file is part of Dragonfly. # (c) Copyright 2007, 2008 by Christo Butcher # Licensed under the LGPL. # # Dragonfly 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 3 of the L...
lgpl-3.0
blacktear23/django
django/conf/project_template/settings.py
150
5005
# Django settings for {{ project_name }} project. DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@example.com'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. ...
bsd-3-clause
ElijahCaine/GrindStone
grindstone/tests.py
1
6880
#!/usr/bin/env python """ File: test.py Package: grindstone Author: Elijah Caine Description: Test GrindStone lib functionality """ from lib import GrindStone import unittest import shutil import os class TestGrindStoneLibrary(unittest.TestCase): def setUp(self): # We're testing everything in a /tmp/*...
mit
pozdnyakov/chromium-crosswalk
third_party/mesa/MesaLib/src/mapi/glapi/gen/gl_XML.py
33
24745
#!/usr/bin/env python # (C) Copyright IBM Corporation 2004, 2005 # All Rights Reserved. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), # to deal in the Software without restriction, including without limitation # ...
bsd-3-clause
yrizk/django-blog
blogvenv/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/packages/ordered_dict.py
2040
8935
# Backport of OrderedDict() class that runs on Python 2.4, 2.5, 2.6, 2.7 and pypy. # Passes Python2.7's test suite and incorporates all the latest updates. # Copyright 2009 Raymond Hettinger, released under the MIT License. # http://code.activestate.com/recipes/576693/ try: from thread import get_ident as _get_iden...
apache-2.0
Tuxemon/Tuxemon-Server
tuxemon_server/core/game/event/actions/core.py
3
9876
#!/usr/bin/python # -*- coding: utf-8 -*- # # Tuxemon # Copyright (C) 2014, William Edwards <shadowapex@gmail.com> # # This file is part of Tuxemon. # # Tuxemon 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-3.0
jrief/django-filer
filer/models/clipboardmodels.py
22
1562
#-*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models from django.utils.translation import ugettext_lazy as _ from django.conf import settings from filer.models import filemodels from filer.utils.compatibility import python_2_unicode_compatible @python_2_unicode_compatible class...
bsd-3-clause
dongjoon-hyun/tensorflow
tensorflow/contrib/timeseries/python/timeseries/ar_model_test.py
25
15933
# 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
AnonymFx/scripts
ios-to-android-strings.py
5
2531
#!/usr/bin/python import argparse import os import re def main(): # def arguments argparser = argparse.ArgumentParser() argparser.add_argument("input") argparser.add_argument("target") args = argparser.parse_args() # get input file if not os.path.isfile(args.input): raise Exceptio...
gpl-3.0
eamuntz/Django-Tut
env/lib/python2.7/site-packages/django/core/mail/backends/base.py
660
1164
"""Base email backend class.""" class BaseEmailBackend(object): """ Base class for email backend implementations. Subclasses must at least overwrite send_messages(). """ def __init__(self, fail_silently=False, **kwargs): self.fail_silently = fail_silently def open(self): """Op...
mit
justasabc/kubernetes-ubuntu
ke/images/python/setting.py
1
1316
#/usr/bin/python # -*- coding:utf-8 -*- # base/apache/var/www/region_load/ # region related INTERNAL_ADDRESS = "0.0.0.0" EXTERNAL_HOSTNAME = "162.105.17.48" ALLOW_ALTERNATE_PORTS = False MAX_AGENTS = 100 MAX_PRIMS = 15000 GLOBAL_REGION_DATA2 = { "huyu": {"orig":(1000,1000), "startPort":9000, "wh":(2,2)}, "xwd": {"o...
apache-2.0
BurntSushi/docopt
test_docopt.py
13
25889
from __future__ import with_statement from docopt import (docopt, DocoptExit, DocoptLanguageError, Option, Argument, Command, OptionsShortcut, Required, Optional, Either, OneOrMore, parse_argv, parse_pattern, parse_section, parse_defaults, ...
mit
jchrismer/PiQuad
Calibration/adjusted_least_squars.py
1
4915
''' ===================================================================================== Python implementation of the ALS (Adujusted Least Square) ellipsoid fitting algorithm ===================================================================================== Sources: "Consistent least squares fitting of ellipsoids"...
gpl-3.0
lmazuel/azure-sdk-for-python
azure-mgmt-relay/azure/mgmt/relay/models/authorization_rule.py
2
1513
# 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 ...
mit
scorphus/scrapy
setup.py
15
1521
from os.path import dirname, join from setuptools import setup, find_packages with open(join(dirname(__file__), 'scrapy/VERSION'), 'rb') as f: version = f.read().decode('ascii').strip() setup( name='Scrapy', version=version, url='http://scrapy.org', description='A high-level Web Crawling and Web...
bsd-3-clause
bmotlaghFLT/FLT_PhantomJS
src/qt/qtwebkit/Source/JavaScriptCore/KeywordLookupGenerator.py
117
11965
# Copyright (C) 2011 Apple Inc. All rights reserved. # Copyright (C) 2012 Sony Network Entertainment. 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 retai...
bsd-3-clause
google-code/android-scripting
python/gdata/samples/oauth/oauth_on_appengine/appengine_utilities/rotmodel.py
131
2149
""" Copyright (c) 2008, appengine-utilities project 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 ...
apache-2.0
DazWorrall/ansible
lib/ansible/modules/network/avi/avi_api_session.py
27
8381
#!/usr/bin/python """ # Created on Aug 12, 2016 # # @author: Gaurav Rastogi (grastogi@avinetworks.com) GitHub ID: grastogi23 # # module_check: not supported # # 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 publ...
gpl-3.0
architecture-building-systems/CityEnergyAnalyst
cea/technologies/thermal_network/simplified_thermal_network.py
2
29336
import math import time import geopandas as gpd import numpy as np import pandas as pd import wntr import cea.config import cea.inputlocator import cea.technologies.substation as substation from cea.constants import P_WATER_KGPERM3, FT_WATER_TO_PA, FT_TO_M, M_WATER_TO_PA, HEAT_CAPACITY_OF_WATER_JPERKGK, SHAPEFILE...
mit
wgapl/moose
gui/utils/YamlData.py
34
1524
#!/usr/bin/python import sys, os, commands, time, re, copy try: from PyQt4 import QtCore, QtGui QtCore.Signal = QtCore.pyqtSignal QtCore.Slot = QtCore.pyqtSlot except ImportError: try: from PySide import QtCore, QtGui QtCore.QString = str except ImportError: raise ImportErro...
lgpl-2.1
0k/odoo
addons/stock_account/stock.py
6
13101
# -*- 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
sakuramilk/sc02c_kernel_gb
tools/perf/scripts/python/check-perf-trace.py
948
2501
# perf trace event handlers, generated by perf trace -g python # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # This script tests basic functionality such as flag and symbol # strings, common_xxx() calls back into perf, begin, end, unhandled # events, etc. Ba...
gpl-2.0
daviddupont69/CouchPotatoServer
couchpotato/core/downloaders/base.py
3
6076
from base64 import b32decode, b16encode from couchpotato.core.event import addEvent from couchpotato.core.helpers.variable import mergeDicts from couchpotato.core.logger import CPLog from couchpotato.core.providers.base import Provider import random import re log = CPLog(__name__) class Downloader(Provider): pr...
gpl-3.0
rolandwz/pymisc
ustrader/strategy/oneTrader.py
2
7496
# -*- coding: utf-8 -*- import datetime, time, csv, os import numpy as np from utils.db import SqliteDB from utils.rwlogging import log from utils.rwlogging import strategyLogger as logs from utils.rwlogging import balLogger as logb from trader import Trader from indicator import ma, macd, bolling, rsi, kdj from strate...
mit
quiqueporta/django-admin-dialog
django_admin_dialog/migrations/0001_initial.py
1
1234
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='DjangoAdminDialog', fields=[ ('id', models.Auto...
gpl-2.0