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
KitKatXperience/platform_external_chromium_org
tools/deep_memory_profiler/subcommands/expand.py
47
3836
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import logging import sys from lib.bucket import BUCKET_ID, COMMITTED, ALLOC_COUNT, FREE_COUNT from lib.policy import PolicySet from lib.subcommand import S...
bsd-3-clause
bzloink/psi4
psi4/driver/procrouting/mcscf/augmented_hessian.py
2
5838
# # @BEGIN LICENSE # # Psi4: an open-source quantum chemistry software package # # Copyright (c) 2007-2017 The Psi4 Developers. # # The copyrights for code used from other parties are included in # the corresponding files. # # This file is part of Psi4. # # Psi4 is free software; you can redistribute it and/or modify #...
lgpl-3.0
wehkamp/ansible-modules-core
windows/win_ping.py
68
1363
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>, and others # # 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 ...
gpl-3.0
sajeeshcs/nested_quota
nova/virt/baremetal/db/sqlalchemy/migrate_repo/versions/007_drop_prov_mac_address.py
29
1203
# Copyright (c) 2013 NTT DOCOMO, 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 ...
apache-2.0
epitron/youtube-dl
youtube_dl/extractor/minhateca.py
53
2467
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( int_or_none, parse_duration, parse_filesize, sanitized_Request, urlencode_postdata, ) class MinhatecaIE(InfoExtractor): _VALID_URL = r'https?://minhateca\.com\.br/[^?#]+,(?P<id>[0-9...
unlicense
Murodese/pynab
scripts/stats.py
3
3618
import os import sys import time from imp import reload import colorama sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '..')) from pynab.db import Part, Binary, Release, db_session import config from pynab import log, log_init def get_config_changes(): """ Check if config has cha...
gpl-2.0
aitjcize/PyTox
setup.py
1
1268
from distutils.core import setup, Extension from subprocess import Popen, PIPE def supports_av(): h = Popen("ld $LDFLAGS -ltoxav", shell=True, stderr=PIPE) out, err = h.communicate() return 'toxav' not in str(err) sources = ["pytox/pytox.c", "pytox/core.c", "pytox/util.c"] libraries = [ "opus", "sodi...
gpl-3.0
rsampaio/cobbler
cobbler/modules/sync_post_restart_services.py
6
2445
import distutils.sysconfig import sys import os import traceback import cexceptions import os import sys import xmlrpclib import cobbler.module_loader as module_loader import cobbler.utils as utils plib = distutils.sysconfig.get_python_lib() mod_path="%s/cobbler" % plib sys.path.insert(0, mod_path) def register(): ...
gpl-2.0
mensler/ansible
test/utils/shippable/download.py
25
9220
#!/usr/bin/env python # PYTHON_ARGCOMPLETE_OK # (c) 2016 Red Hat, Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at yo...
gpl-3.0
WaveBlocks/WaveBlocks
src/WaveBlocks/TimeManager.py
1
7218
"""The WaveBlocks Project Provides several computation routines for handling time and timesteps. @author: R. Bourquin @copyright: Copyright (C) 2010, 2011 R. Bourquin @license: Modified BSD License """ from scipy import floor class TimeManager: r""" This class performs several computation with time, timest...
bsd-3-clause
simonemainardi/LSHash
tests/test_lsh.py
1
4542
import random import string from unittest import TestCase from redis import StrictRedis from pprint import pprint import sys import os # add the LSHash package to the current python path sys.path.insert(0, os.path.abspath('../')) # now we can use our lshash package and not the standard one from lshash import LSHash ...
mit
FreeScienceCommunity/pyctp
example/pyctp/base.py
8
11512
#-*- coding:utf-8 -*- IDATE,ITIME,IOPEN,ICLOSE,IHIGH,ILOW,IVOL,IHOLDING,IORDER = 0,1,2,3,4,5,6,7,8 #多空标志 LONG,SHORT,EMPTY = -1,1,0 #多仓出钱,淡仓收钱 #开平仓的标志 XOPEN,XCLOSE = -1,1 #开仓,平仓 XBASE = 100 #用于一般化的除数基数 import sys import functools import logging from .lib import decorator from inspect import ( ...
mit
LettError/designSpaceRoboFontExtension
DesignSpaceEditor.roboFontExt/lib/designSpaceEditorSettings.py
2
3279
from defconAppKit.windows.baseWindow import BaseWindowController from mojo.extensions import getExtensionDefault, setExtensionDefault, ExtensionBundle from vanilla import * defaultOptions = { "instanceFolderName": "instances", } settingsIdentifier = "com.letterror.designspaceeditor" def updateWithDefaultValues(d...
mit
uffejakobsen/libsigrokdecode
decoders/graycode/pd.py
3
6899
## ## This file is part of the libsigrokdecode project. ## ## Copyright (C) 2017 Christoph Rackwitz <christoph.rackwitz@rwth-aachen.de> ## ## 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; eith...
gpl-3.0
stevshil/PiMediaPlayer
PiGUI/example.py
1
1068
#move the GUI-window from its initial position to see how it stays there only with the new version #note also the flickering happens only in the old version # comment out and in as necessary ################################# easygui with callback import easygui_callback def controller(user_input): print "controller...
apache-2.0
JarbasAI/JarbasAI
mycroft/stt/__init__.py
1
4937
# Copyright 2016 Mycroft AI, Inc. # # This file is part of Mycroft Core. # # Mycroft Core 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 versio...
gpl-3.0
xiandiancloud/edx-platform
common/djangoapps/util/tests/test_request.py
50
2295
"""Tests for util.request module.""" import unittest from django.conf import settings from django.core.exceptions import SuspiciousOperation from django.test.client import RequestFactory from util.request import course_id_from_url, safe_get_host class ResponseTestCase(unittest.TestCase): """ Tests for response...
agpl-3.0
Zlash65/erpnext
erpnext/hr/doctype/employee_benefit_application/employee_benefit_application.py
6
11163
# -*- coding: utf-8 -*- # Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe import _ from frappe.utils import date_diff, getdate, rounded, add_days, cstr, cint, flt from frappe.model.doc...
gpl-3.0
bikong2/django
tests/urlpatterns_reverse/middleware.py
386
1050
from django.core.urlresolvers import reverse from django.http import HttpResponse, StreamingHttpResponse from . import urlconf_inner class ChangeURLconfMiddleware(object): def process_request(self, request): request.urlconf = urlconf_inner.__name__ class NullChangeURLconfMiddleware(object): def pro...
bsd-3-clause
rhelmer/socorro
socorro/unittest/external/postgresql/test_gccrashes.py
9
5307
# 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/. import datetime from nose.plugins.attrib import attr from nose.tools import eq_, assert_raises from socorro.external im...
mpl-2.0
CyanogenMod/android_external_chromium_org
chrome/tools/build/win/create_installer_archive.py
45
24930
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Script to create Chrome Installer archive. This script is used to create an archive of all the files required for a Chrome ...
bsd-3-clause
gkc1000/pyscf
pyscf/fci/direct_uhf.py
1
14649
#!/usr/bin/env python # 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 # # U...
apache-2.0
hsiaoyi0504/scikit-learn
sklearn/manifold/t_sne.py
106
20057
# Author: Alexander Fabisch -- <afabisch@informatik.uni-bremen.de> # License: BSD 3 clause (C) 2014 # This is the standard t-SNE implementation. There are faster modifications of # the algorithm: # * Barnes-Hut-SNE: reduces the complexity of the gradient computation from # N^2 to N log N (http://arxiv.org/abs/1301....
bsd-3-clause
shaz13/oppia
core/controllers/learner_playlist.py
1
2096
# Copyright 2017 The Oppia Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
apache-2.0
blaze225/zulip
zerver/tests/test_decorators.py
8
41624
# -*- coding: utf-8 -*- import mock from typing import Any, Dict, Iterable, List, Optional, Text, Tuple from django.test import TestCase from django.http import HttpResponse, HttpRequest from django.test.client import RequestFactory from django.conf import settings from zerver.lib.actions import do_deactivate_realm, ...
apache-2.0
bop/rango
lib/python2.7/site-packages/django/core/management/commands/loaddata.py
103
12165
from __future__ import unicode_literals import sys import os import gzip import zipfile from optparse import make_option import traceback from django.conf import settings from django.core import serializers from django.core.management.base import BaseCommand, CommandError from django.core.management.color import no_s...
gpl-2.0
Maspear/odoo
addons/stock_picking_wave/__init__.py
374
1105
# -*- 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
canast02/csci544_fall2016_project
yelp-sentiment/experiments/sentiment_stochasticGradientDescent.py
1
2641
import numpy as np from nltk import TweetTokenizer, accuracy from nltk.stem.snowball import EnglishStemmer from sklearn import svm, linear_model from sklearn.cross_validation import StratifiedKFold from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.metrics import accuracy_score from sklearn.metric...
gpl-3.0
MissionCriticalCloud/marvin
marvin/cloudstackAPI/stopVirtualMachine.py
1
24289
"""Stops a virtual machine.""" from baseCmd import * from baseResponse import * class stopVirtualMachineCmd (baseCmd): typeInfo = {} def __init__(self): self.isAsync = "true" """The ID of the virtual machine""" """Required""" self.id = None self.typeInfo['id'] = 'uuid'...
apache-2.0
akhilari7/pa-dude
lib/python2.7/site-packages/django/middleware/common.py
7
7447
import logging import re from django import http from django.conf import settings from django.core import urlresolvers from django.core.exceptions import PermissionDenied from django.core.mail import mail_managers from django.utils.cache import get_conditional_response, set_response_etag from django.utils.encoding imp...
mit
salamer/django
django/contrib/gis/maps/google/zoom.py
527
6676
from __future__ import unicode_literals from math import atan, exp, log, pi, sin from django.contrib.gis.geos import GEOSGeometry, LinearRing, Point, Polygon from django.contrib.gis.maps.google.gmap import GoogleMapException from django.utils.six.moves import range # Constants used for degree to radian conversion, a...
bsd-3-clause
Mutiny-Games/unicorn-hat-hd
examples/snake.py
1
5313
#!/usr/bin/env python import curses import os import random import time import unicornhathd CONTROLS = { ord('w'): 'up', ord('s'): 'down', ord('a'): 'left', ord('d'): 'right', curses.KEY_UP: 'up', curses.KEY_DOWN: 'down', curses.KEY_LEFT: 'left', curses.KEY_RIGHT: 'right' } class Sn...
mit
Chilledheart/chromium
tools/telemetry/third_party/gsutilz/third_party/pyasn1-modules/pyasn1_modules/rfc4210.py
37
26208
# # Certificate Management Protocol structures as per RFC4210 # # Based on Alex Railean's work # from pyasn1.type import tag,namedtype,namedval,univ,constraint,char,useful from pyasn1_modules import rfc2459, rfc2511, rfc2314 MAX = 64 class KeyIdentifier(univ.OctetString): pass class CMPCertificate(rfc2459.Certificat...
bsd-3-clause
GreatEmerald/geoscripting
Assignment1/Complete.py
1
3661
import os os.chdir('/home/tim/geoscripting/lesson11') print os.getcwd() os.chdir('data') ## Loading osgeo try: from osgeo import ogr, osr print 'Import of ogr and osr from osgeo worked. Hurray!\n' except: print 'Import of ogr and osr from osgeo failed\n\n' ## Is the ESRI Shapefile driver available? driverName...
apache-2.0
jarrodmcc/OpenFermion
src/openfermion/tests/_lih_integration_test.py
1
6229
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distribu...
apache-2.0
joaoventura/pylibui
pylibui/libui/button.py
2
1752
""" Python wrapper for libui. """ import ctypes from . import clibui class uiButton(ctypes.Structure): """Wrapper for the uiButton C struct.""" pass def uiButtonPointer(obj): """ Casts an object to uiButton pointer type. :param obj: a generic object :return: uiButton """ return...
mit
globau/servo
etc/ci/performance/test_differ.py
77
1744
#!/usr/bin/env python3 # 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/. import argparse import json parser = argparse.ArgumentParser(description="Diff between two run...
mpl-2.0
40223137/w1717
static/Brython3.1.3-20150514-095342/Lib/errno.py
624
4096
""" This module makes available standard errno system symbols. The value of each symbol is the corresponding integer value, e.g., on most systems, errno.ENOENT equals the integer 2. The dictionary errno.errorcode maps numeric codes to symbol names, e.g., errno.errorcode[2] could be the string 'ENOENT'. Symbols that ar...
gpl-3.0
scottdangelo/RemoveVolumeMangerLocks
cinder/tests/unit/windows/test_windows_remotefs.py
35
6904
# Copyright 2014 Cloudbase Solutions Srl # # 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 ...
apache-2.0
hefen1/chromium
third_party/typ/setup.py
25
1787
# Copyright 2014 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 ag...
bsd-3-clause
endolith/scikit-image
skimage/data/__init__.py
2
6559
"""Standard test images. For more images, see - http://sipi.usc.edu/database/database.php """ import os as _os from .. import data_dir from ..io import imread, use_plugin from .._shared.utils import deprecated from ._binary_blobs import binary_blobs __all__ = ['load', 'camera', 'lena', ...
bsd-3-clause
blubber/gaclient
docs/_themes/flask_theme_support.py
2228
4875
# flasky extensions. flasky pygments style based on tango style from pygments.style import Style from pygments.token import Keyword, Name, Comment, String, Error, \ Number, Operator, Generic, Whitespace, Punctuation, Other, Literal class FlaskyStyle(Style): background_color = "#f8f8f8" default_style = "...
apache-2.0
junalmeida/Sick-Beard
lib/guessit/language.py
8
13739
#!/usr/bin/env python # -*- coding: utf-8 -*- # # GuessIt - A library for guessing information from filenames # Copyright (c) 2013 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
direvus/ansible
lib/ansible/plugins/callback/foreman.py
27
8807
# -*- coding: utf-8 -*- # (c) 2015, 2016 Daniel Lobato <elobatocs@gmail.com> # (c) 2016 Guido Günther <agx@sigxcpu.org> # (c) 2017 Ansible Project # 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_...
gpl-3.0
Lyleo/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/numerix/__init__.py
69
5473
""" numerix imports either Numeric or numarray based on various selectors. 0. If the value "--numpy","--numarray" or "--Numeric" is specified on the command line, then numerix imports the specified array package. 1. The value of numerix in matplotlibrc: either Numeric or numarray 2. If none of the above is...
gpl-3.0
MycChiu/tensorflow
tensorflow/contrib/tensor_forest/hybrid/python/models/decisions_to_data_then_nn.py
190
1889
# 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
abo-abo/edx-platform
lms/djangoapps/django_comment_client/tests/mock_cs_server/test_mock_cs_server.py
72
2193
import unittest import threading import json import urllib2 from mock_cs_server import MockCommentServiceServer from nose.plugins.skip import SkipTest class MockCommentServiceServerTest(unittest.TestCase): ''' A mock version of the Comment Service server that listens on a local port and responds with pre-...
agpl-3.0
pli3/e2-openwbif
plugin/controllers/views/web/parentcontrollist.py
1
5525
#!/usr/bin/env python ################################################## ## DEPENDENCIES import sys import os import os.path try: import builtins as builtin except ImportError: import __builtin__ as builtin from os.path import getmtime, exists import time import types from Cheetah.Version import MinCompatib...
gpl-2.0
saurabh6790/test_final_med_app
setup/doctype/authorization_rule/authorization_rule.py
30
4209
# 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 webnotes from webnotes.utils import cint, cstr, flt, has_common from webnotes.model import db_exists from webnotes.model.bean import copy_doc...
agpl-3.0
throwable-one/lettuce
tests/integration/lib/Django-1.2.5/tests/regressiontests/forms/tests/formsets.py
38
35474
# -*- coding: utf-8 -*- from unittest import TestCase from django.forms import Form, CharField, IntegerField, ValidationError from django.forms.formsets import formset_factory, BaseFormSet class Choice(Form): choice = CharField() votes = IntegerField() # FormSet allows us to use multiple instance of the sam...
gpl-3.0
andymitchhank/bessie
bessie/base.py
1
2160
from functools import partial import requests try: import urlparse as parse except: from urllib import parse class InvalidEndpointException(Exception): pass class BaseClient(object): endpoints = [] separator = '/' base_url = '' def __init__(self, path='', path_params=None, **kwargs): self.path = path ...
mit
x10an14/Programming_Practice
project_euler/9/python/solution.py
1
1427
#!/usr/bin/env python3.7 from math import floor from typing import Tuple from functools import reduce from itertools import combinations_with_replacement def factors( n: int # Number to factorize ) -> Tuple[int]: return tuple( reduce( list.__add__, ( [i, f...
mit
cranes-bill/cedit
tools/generate-plugin.py
1
5946
#!/usr/bin/env python # -*- coding: utf-8 -*- # generate-plugin.py - cedit plugin skeletton generator # This file is part of cedit # # Copyright (C) 2006 - Steve Frécinaux # # cedit 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...
gpl-2.0
mlcommons/inference
loadgen/docs/src/doxygen_html_generator.py
5
1378
# Copyright 2019 The MLPerf Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
apache-2.0
Triv90/Nova
nova/tests/test_versions.py
14
2111
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 Ken Pepple # # 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 # #...
apache-2.0
jdepoix/goto_cloud
goto_cloud/migration_commander/device_identification.py
1
4673
from command.public import SourceCommand from .mountpoint_mapping import MountpointMapper class DeviceIdentificationCommand(SourceCommand): """ takes care of identifying, which of the targets devices, should replicated, which device of the source system """ class NoMatchingDevicesException(SourceComm...
mit
gengue/django
tests/multiple_database/routers.py
379
1927
from __future__ import unicode_literals from django.db import DEFAULT_DB_ALIAS class TestRouter(object): """ Vaguely behave like primary/replica, but the databases aren't assumed to propagate changes. """ def db_for_read(self, model, instance=None, **hints): if instance: retu...
bsd-3-clause
bradleyayers/suds-htj
suds/xsd/query.py
202
6451
# This program is free software; you can redistribute it and/or modify # it under the terms of the (LGPL) GNU Lesser General Public License as # published by the Free Software Foundation; either version 3 of the # License, or (at your option) any later version. # # This program is distributed in the hope that it will ...
lgpl-3.0
rocktavious/pyul
pyul/xmlUtils.py
1
7272
from xml.parsers import expat from xml.sax.saxutils import XMLGenerator from xml.sax.xmlreader import AttributesImpl from xml.dom.minidom import parseString try: from cStringIO import StringIO except ImportError: try: from StringIO import StringIO except ImportError: from io import StringIO ...
mit
todaychi/hue
desktop/core/ext-py/South-1.0.2/south/tests/brokenapp/models.py
198
1626
# -*- coding: UTF-8 -*- from django.db import models from django.contrib.auth.models import User as UserAlias def default_func(): return "yays" # An empty case. class Other1(models.Model): pass # Nastiness. class HorribleModel(models.Model): "A model to test the edge cases of model parsing" ZERO, O...
apache-2.0
amwelch/a10sdk-python
a10sdk/core/router/router_bgp_neighbor_ipv4_neighbor.py
2
17506
from a10sdk.common.A10BaseClass import A10BaseClass class DistributeLists(A10BaseClass): """This class does not support CRUD Operations please use parent. :param distribute_list_direction: {"enum": ["in", "out"], "type": "string", "description": "'in': in; 'out': out; ", "format": "enum"} :param dis...
apache-2.0
sanket4373/keystone
keystone/tests/test_backend_rules.py
13
2250
# Copyright 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 agreed to in...
apache-2.0
devs1991/test_edx_docmode
venv/lib/python2.7/site-packages/boto/file/simpleresultset.py
264
1321
# Copyright 2010 Google Inc. # # 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, modify, merge, publish, dis- # trib...
agpl-3.0
tornadozou/tensorflow
tensorflow/contrib/learn/python/learn/experiment_test.py
18
34939
# 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 appl...
apache-2.0
lociii/django-simple-menu
setup.py
4
1159
#!/usr/bin/env python import re from setuptools import setup # load our version from our init file init_data = open('menu/__init__.py').read() matches = re.search(r"__version__ = '([^']+)'", init_data, re.M) if matches: version = matches.group(1) else: raise RuntimeError("Unable to load version") requiremen...
bsd-3-clause
benosteen/mypaint
lib/brush.py
1
14425
# This file is part of MyPaint. # Copyright (C) 2007 by Martin Renold <martinxyz@gmx.ch> # # 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) ...
gpl-2.0
Deepakkothandan/ansible
lib/ansible/modules/network/netvisor/pn_ospfarea.py
29
6377
#!/usr/bin/python """ PN-CLI vrouter-ospf-add/remove """ # # 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...
gpl-3.0
eduble/pyc2py
decompile/branches_ender.py
2
1372
# pyc2py - The smart python decompiler. # Copyright (C) 2012 Centre National de la Recherche Scientifique # # 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,...
gpl-3.0
zephyrplugins/zephyr
zephyr.plugin.jython/jython2.5.2rc3/Lib/textwrap.py
85
14867
"""Text wrapping and filling. """ # Copyright (C) 1999-2001 Gregory P. Ward. # Copyright (C) 2002, 2003 Python Software Foundation. # Written by Greg Ward <gward@python.net> __revision__ = "$Id: textwrap.py 46863 2006-06-11 19:42:51Z tim.peters $" import string, re # Do the right thing with boolean values for all k...
epl-1.0
drzoidberg33/plexpy
lib/cherrypy/__init__.py
4
21717
"""CherryPy is a pythonic, object-oriented HTTP framework. CherryPy consists of not one, but four separate API layers. The APPLICATION LAYER is the simplest. CherryPy applications are written as a tree of classes and methods, where each branch in the tree corresponds to a branch in the URL path. Each method is a 'pa...
gpl-3.0
ArnossArnossi/django
django/core/mail/__init__.py
347
4697
""" Tools for sending email. """ from __future__ import unicode_literals from django.conf import settings # Imported for backwards compatibility and for the sake # of a cleaner namespace. These symbols used to be in # django/core/mail.py before the introduction of email # backends and the subsequent reorganization (Se...
bsd-3-clause
decodio/pos_box
openerp/report/interface.py
380
9868
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 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
Semi-global/edx-platform
common/djangoapps/student/tests/test_password_policy.py
113
12723
# -*- coding: utf-8 -*- """ This test file will verify proper password policy enforcement, which is an option feature """ import json from django.test import TestCase from django.test.client import RequestFactory from django.core.urlresolvers import reverse from django.contrib.auth.models import AnonymousUser from djan...
agpl-3.0
akosyakov/intellij-community
python/testData/inspections/PyCompatibilityInspection/stringLiteralExpression.py
45
2349
a = <warning descr="Python version 3.0, 3.1, 3.2 do not support a 'U' prefix">u</warning>"String" # python 3.3 a = <warning descr="Python version 3.0, 3.1, 3.2 do not support a 'U' prefix">u</warning>"" a = r"" a = <warning descr="Python version 2.4, 2.5 do not support a 'B' prefix">b</warning>"" a = <error descr="Py...
apache-2.0
Musaka96/FB-Chat-Toolkit
chat.py
1
2494
import fbchat def login(): username = input("Enter your id --> ") password = input("Enter your password --> ") try: client = fbchat.Client(username, password) except: print("id or password is wrong") login() menu(client) def menu(client): print("1.Messenger") print("2.Spammer") print("3.Log out") c...
gpl-3.0
endlessm/chromium-browser
third_party/swiftshader/third_party/llvm-7.0/llvm/utils/update_mir_test_checks.py
5
15760
#!/usr/bin/env python """Updates FileCheck checks in MIR tests. This script is a utility to update MIR based tests with new FileCheck patterns. The checks added by this script will cover the entire body of each function it handles. Virtual registers used are given names via FileCheck patterns, so if you do want to c...
bsd-3-clause
pk-sam/crosswalk-test-suite
webapi/tct-gumallow-w3c-tests/inst.wgt.py
294
6758
#!/usr/bin/env python import os import shutil import glob import time import sys import subprocess import string from optparse import OptionParser, make_option SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) PKG_NAME = os.path.basename(SCRIPT_DIR) PARAMETERS = None #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=...
bsd-3-clause
haeusser/tensorflow
tensorflow/python/ops/resources.py
45
4158
# 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
simontakite/sysadmin
pythonscripts/learningPython/argtest.py
1
5114
""" File argtest.py: (3.X + 2.X) function decorator that performs arbitrary passed-in validations for arguments passed to any function method. Range and type tests are two example uses; valuetest handles more arbitrary tests on a argument's value. Arguments are specified by keyword to the decorator. In the act...
gpl-2.0
DIRACGrid/DIRAC
src/DIRAC/Core/Utilities/PrettyPrint.py
2
8636
""" Utilities for pretty printing table data and more Author: A.Tsaregorodtsev """ from __future__ import print_function from __future__ import absolute_import from __future__ import division __RCSID__ = '$Id$' import six from six import StringIO def int_with_commas(inputValue): """ Utility to make a string o...
gpl-3.0
cpdean/sqlalchemy-bigquery
sqlalchemy_bigquery/base.py
1
2701
""" Support for Google BigQuery. Does not support actually connecting to BQ. Directly derived from the mssql dialect with minor modifications """ import sqlalchemy.dialects.mssql.base as mssql_base from sqlalchemy.dialects.mssql.base import MSDialect from sqlalchemy.sql import compiler from sqlalchemy.sql import sql...
mit
ghmajx/asuswrt-merlin
release/src/router/samba-3.6.13/lib/dnspython/dns/rdtypes/ANY/CNAME.py
248
1092
# Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED ...
gpl-2.0
nickmeharry/django-mysql
django_mysql/models/fields/lists.py
1
7795
# -*- coding:utf-8 -*- from __future__ import ( absolute_import, division, print_function, unicode_literals ) from django.core import checks from django.db.models import CharField, IntegerField, Lookup, TextField from django.utils import six from django.utils.translation import ugettext_lazy as _ from django_mysq...
bsd-3-clause
Endika/django
django/utils/timesince.py
409
2671
from __future__ import unicode_literals import calendar import datetime from django.utils.html import avoid_wrapping from django.utils.timezone import is_aware, utc from django.utils.translation import ugettext, ungettext_lazy TIMESINCE_CHUNKS = ( (60 * 60 * 24 * 365, ungettext_lazy('%d year', '%d years')), ...
bsd-3-clause
kkreis/espressopp
src/analysis/Observable.py
5
1939
# Copyright (C) 2012,2013,2017 # Max Planck Institute for Polymer Research # Copyright (C) 2008,2009,2010,2011 # Max-Planck-Institute for Polymer Research & Fraunhofer SCAI # # This file is part of ESPResSo++. # # ESPResSo++ is free software: you can redistribute it and/or modify # it under the terms of ...
gpl-3.0
mavit/ansible
lib/ansible/plugins/lookup/fileglob.py
34
2027
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # (c) 2017 Ansible Project # 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 DOCUMENTATION = """ lookup: fileglob author: Mich...
gpl-3.0
c4sc/arividam
arividam/djangocms_news/migrations/0003_auto_20170218_2159.py
1
1393
# -*- coding: utf-8 -*- # Generated by Django 1.9.12 on 2017-02-18 16:29 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion import djangocms_text_ckeditor.fields import filer.fields.image class Migration(migrations.Migration): dependencies = [ ...
mit
dyoung418/tensorflow
tensorflow/contrib/framework/python/ops/audio_ops.py
80
1186
# 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
guyemerson/pyphon
src/pyphon.py
1
3033
#!/usr/bin/env python2 import wx, os, sqlite3 import wxGUI wx.USE_UNICODE = 1 SRC_DIR = os.getcwd() DATA_DIR = os.path.join(os.path.split(SRC_DIR)[0], 'data') def filepath(text): """ If text contains no slashes, add the default data directory """ directory, filename = os.path.split(text) if director...
gpl-3.0
umass-forensics/Yapr-forensics
yapr/yapr_scan.py
1
6163
""" This script attempts to determine important characteristics of a Yaffs phone image. Ideally, this functionality will be incorporated into a new version of the Yaffs parser. """ __author__ = 'wallsr' import argparse import os from . import utilities from .YaffsClasses.YaffsChunk import YaffsHeader from .YaffsCla...
gpl-2.0
sergelhomme/Network_Analysis
Network_Analysis_1_4/network_analysis/tools/ui_teststat2.py
2
2797
# -*- coding: utf-8 -*- from PyQt4 import QtCore, QtGui class Ui_Dialogstat2(object): def setupUi(self, Dialog): Dialog.setObjectName("Dialog") Dialog.resize(320, 250) font = QtGui.QFont() font.setWeight(75) font.setBold(True) Dialog.setFont(font) ...
gpl-2.0
onceuponatimeforever/oh-mainline
vendor/packages/html5lib/html5lib/tokenizer.py
100
75949
try: frozenset except NameError: # Import from the sets module for python 2.3 from sets import Set as set from sets import ImmutableSet as frozenset try: from collections import deque except ImportError: from utils import deque from constants import spaceCharacters from constants import ent...
agpl-3.0
renzhn/Wox
PythonHome/Lib/site-packages/pip/_vendor/html5lib/treeadapters/sax.py
1835
1661
from __future__ import absolute_import, division, unicode_literals from xml.sax.xmlreader import AttributesNSImpl from ..constants import adjustForeignAttributes, unadjustForeignAttributes prefix_mapping = {} for prefix, localName, namespace in adjustForeignAttributes.values(): if prefix is not None: pre...
mit
hybrideagle/django
tests/gis_tests/rasterapp/test_rasterfield.py
241
3424
import json from unittest import skipIf from django.contrib.gis.gdal import HAS_GDAL from django.contrib.gis.shortcuts import numpy from django.core.exceptions import ImproperlyConfigured from django.test import TestCase, TransactionTestCase, skipUnlessDBFeature from ..data.rasters.textrasters import JSON_RASTER from...
bsd-3-clause
erjohnso/ansible
lib/ansible/plugins/lookup/etcd.py
6
5594
# (c) 2013, Jan-Piet Mens <jpmens(at)gmail.com> # (m) 2016, Mihai Moldovanu <mihaim@tfm.ro> # (m) 2017, Juan Manuel Parrilla <jparrill@redhat.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 #...
gpl-3.0
teddym6/qualitybots
src/appengine/filters/filters.py
26
1777
#!/usr/bin/python2.4 # # Copyright 2010 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
pkoutsias/SickRage
lib/sqlalchemy/interfaces.py
79
10918
# sqlalchemy/interfaces.py # Copyright (C) 2007-2014 the SQLAlchemy authors and contributors <see AUTHORS file> # Copyright (C) 2007 Jason Kirtland jek@discorporate.us # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """Deprecated core ev...
gpl-3.0
prakashmishra1598/gdeploy
gdeploylib/setup_parser.py
2
1964
# -*- coding: utf-8 -*- # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope th...
gpl-2.0
michaelpacer/scikit-image
skimage/exposure/tests/test_exposure.py
11
17103
import warnings import numpy as np from numpy.testing import assert_array_almost_equal as assert_close from numpy.testing import (assert_array_equal, assert_raises, assert_almost_equal) import skimage from skimage import data from skimage import exposure from skimage.exposure.exposure impor...
bsd-3-clause
braydonf/bitcoin
contrib/devtools/check-doc.py
19
1727
#!/usr/bin/env python # Copyright (c) 2015 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. ''' This checks if all command line args are documented. Return value is 0 to indicate no error. Author: @Marc...
mit