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
gangadhar-kadam/prjlib
core/doctype/file_data/file_data.py
2
1992
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals from webnotes.model.doc import make_autoname from webnotes.utils import cstr, cint, get_site_path,now import datetime """ record of files naming for same name files: file.gif...
mit
cuboxi/android_external_chromium_org
build/protoc_java.py
90
1317
#!/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. """Generate java source files from protobufs Usage: protoc_java.py {protoc} {proto_path} {java_out} {stamp_file} {proto_files}...
bsd-3-clause
jdfekete/progressivis
tests/test_00_storageengine.py
1
2494
from . import ProgressiveTest, skip from progressivis.storage.base import StorageEngine, Group, Dataset #, Attribute from progressivis.table.table import Table import numpy as np @skip class TestStorageEngine(ProgressiveTest): def test_storage_engine(self): e = StorageEngine.default self.assertIs...
bsd-2-clause
droter/trading-with-python
spreadApp/makeDist.py
77
1720
from distutils.core import setup import py2exe manifest_template = ''' <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> <assemblyIdentity version="5.0.0.0" processorArchitecture="x86" name="%(prog)s" type="win32"...
bsd-3-clause
omprakasha/odoo
addons/mrp_operations/__init__.py
443
1091
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the...
agpl-3.0
lgscofield/odoo
addons/sale/wizard/sale_line_invoice.py
222
6126
# -*- 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
wangxiangyu/horizon
openstack_dashboard/api/swift.py
14
12399
# Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the...
apache-2.0
ocsbrandon/kubernetes
cluster/juju/charms/trusty/kubernetes-master/unit_tests/kubernetes_installer_test.py
213
4910
#!/usr/bin/env python # Copyright 2015 The Kubernetes 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 # # Unle...
apache-2.0
pilou-/ansible
lib/ansible/plugins/callback/timer.py
143
1529
# (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Make coding more python3-ish from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = ''' callback: timer callback_type: aggregate requir...
gpl-3.0
lama7/blogtool
blogtool/__init__.py
1
1531
#!/usr/bin/env python """ blogtool.py The entry module for the blogtool command line utility. Program initialization, option and file processing are all started from here. """ from __version__ import __version__ from options import OptionProcessor from headerparse import Header import sys import u...
mit
dotsdl/PyTables
tables/link.py
2
13567
# -*- coding: utf-8 -*- ######################################################################## # # License: BSD # Created: November 25, 2009 # Author: Francesc Alted - faltet@pytables.com # # $Id$ # ######################################################################## """Create links in the HDF5 file. This modu...
bsd-3-clause
Dino0631/RedRain-Bot
cogs/lib/pip/_vendor/progress/helpers.py
521
2854
# Copyright (c) 2012 Giorgos Verigakis <verigak@gmail.com> # # Permission to use, copy, modify, and distribute this software 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 "AS IS" AND THE A...
gpl-3.0
alshedivat/tensorflow
tensorflow/contrib/boosted_trees/estimator_batch/distillation_loss.py
33
2952
# 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
psav/cfme_tests
scripts/sync_template_tracker.py
6
6818
#!/usr/bin/env python """Populate template tracker with information based on cfme_data""" import sys import traceback from collections import defaultdict from threading import Lock, Thread from slumber.exceptions import SlumberHttpBaseException from cfme.utils import trackerbot, net from cfme.utils.conf import cfme_d...
gpl-2.0
lightmare/mapnik
scons/scons-local-4.1.0/SCons/Variables/BoolVariable.py
4
2855
# MIT License # # Copyright 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 Software without restriction, including # without limitation the rights to use, copy, modify, merge, ...
lgpl-2.1
odooindia/odoo
openerp/addons/base/tests/test_xmlrpc.py
48
1169
# -*- coding: utf-8 -*- import time import unittest2 import xmlrpclib import openerp.tests.common DB = openerp.tests.common.DB class test_xmlrpc(openerp.tests.common.HttpCase): def test_01_xmlrpc_login(self): """ Try to login on the common service. """ uid = self.xmlrpc_common.login(DB, 'admin',...
agpl-3.0
TinnedTuna/speakeasyspeeches
wsgi/db_repository/versions/007_migration.py
1
1080
from sqlalchemy import * from migrate import * from migrate.changeset import schema pre_meta = MetaData() post_meta = MetaData() config = Table('config', post_meta, Column('id', Integer, primary_key=True, nullable=False), Column('site_title', Text, nullable=False), Column('site_display_name', Text, nullab...
bsd-2-clause
iivic/BoiseStateX
lms/djangoapps/verify_student/migrations/0011_add_verification_deadline.py
61
12462
# -*- 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 'HistoricalVerificationDeadline' db.create_table('verify_s...
agpl-3.0
lovetox/gajim
src/gui_interface.py
1
139778
# -*- coding:utf-8 -*- ## src/gajim.py ## ## Copyright (C) 2003-2014 Yann Leboulanger <asterix AT lagaule.org> ## Copyright (C) 2004-2005 Vincent Hanquez <tab AT snarc.org> ## Copyright (C) 2005 Alex Podaras <bigpod AT gmail.com> ## Norman Rasmussen <norman AT rasmussen.co.za> ## S...
gpl-3.0
kyanyoga/iot_kafka_datagen
bin/dgen_a.py
1
3057
#!/usr/bin/env python """ Created on Sun Feb 21 14:45:34 2016 @author: Gus Segura """ # imports import time import random import base64 import os import sys import math import json from collections import OrderedDict # from kafka import SimpleProducer, KafkaClient # kafka server info # kafka = KafkaClient("localhost"...
mit
brianmay/django-guardian
docs/conf.py
43
7214
# -*- coding: utf-8 -*- # # django-guardian documentation build configuration file, created by # sphinx-quickstart on Thu Feb 18 23:18:28 2010. # # 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-2-clause
machinecoin-project/machinecoin
test/functional/p2p_invalid_locator.py
2
1994
#!/usr/bin/env python3 # Copyright (c) 2015-2017 The Machinecoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test node responses to invalid locators. """ from test_framework.messages import msg_getheaders, m...
mit
burzillibus/RobHome
venv/lib/python2.7/site-packages/django/contrib/gis/gdal/__init__.py
50
1822
""" This module houses ctypes interfaces for GDAL objects. The following GDAL objects are supported: CoordTransform: Used for coordinate transformations from one spatial reference system to another. Driver: Wraps an OGR data source driver. DataSource: Wrapper for the OGR data source object, supports OGR-su...
mit
mlavin/django
tests/admin_utils/models.py
84
1840
from django.db import models from django.utils.translation import gettext_lazy as _ class Site(models.Model): domain = models.CharField(max_length=100) def __str__(self): return self.domain class Article(models.Model): """ A simple Article model for testing """ site = models.Foreign...
bsd-3-clause
openstack/poppy
scripts/providers/akamai/purge.py
3
2197
# Copyright (c) 2015 Rackspace, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wr...
apache-2.0
sanbornhnewyyz/shaka-player
third_party/gjslint/closure_linter-2.3.13/closure_linter/indentation.py
106
20998
#!/usr/bin/env python # Copyright 2010 The Closure Linter 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 # #...
apache-2.0
elpaso/QGIS
tests/src/python/test_qgsfilterlineedit.py
45
4559
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsFilterLineEdit .. note:: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. """ ...
gpl-2.0
2014c2g3/2015cd_midterm
static/Brython3.1.1-20150328-091302/Lib/http/cookies.py
735
20810
#!/usr/bin/env python3 # #### # Copyright 2000 by Timothy O'Malley <timo@alum.mit.edu> # # All Rights Reserved # # Permission to use, copy, modify, and distribute this software # and its documentation for any purpose and without fee is hereby # granted, provided that the above copyright notice appear in...
gpl-3.0
rabipanda/tensorflow
tensorflow/python/kernel_tests/parse_single_example_op_test.py
24
34244
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
TomAugspurger/pandas
asv_bench/benchmarks/period.py
4
2889
""" Period benchmarks with non-tslibs dependencies. See benchmarks.tslibs.period for benchmarks that rely only on tslibs. """ from pandas import DataFrame, Period, PeriodIndex, Series, date_range, period_range from pandas.tseries.frequencies import to_offset class PeriodIndexConstructor: params = [["D"], [True...
bsd-3-clause
WANdisco/hive
service/lib/py/fb303_scripts/fb303_simple_mgmt.py
171
5961
#!/usr/bin/env 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 # "L...
apache-2.0
martinbuc/missionplanner
packages/IronPython.StdLib.2.7.4/content/Lib/stringold.py
67
12881
# module 'string' -- A collection of string operations # Warning: most of the code you see here isn't normally used nowadays. With # Python 1.6, many of these functions are implemented as methods on the # standard string object. They used to be implemented by a built-in module # called strop, but strop is now ob...
gpl-3.0
aaronpoweruser/android_kernel_oppo_find5
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/SchedGui.py
12980
5411
# SchedGui.py - Python extension for perf script, basic GUI code for # traces drawing and overview. # # Copyright (C) 2010 by Frederic Weisbecker <fweisbec@gmail.com> # # This software is distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. ...
gpl-2.0
miles0411/pm
venv/lib/python2.7/site-packages/pip/_vendor/html5lib/serializer/htmlserializer.py
436
12855
from __future__ import absolute_import, division, unicode_literals from pip._vendor.six import text_type try: from functools import reduce except ImportError: pass from ..constants import voidElements, booleanAttributes, spaceCharacters from ..constants import rcdataElements, entities, xmlEntities from .. imp...
apache-2.0
martinfischer/webpystunden
stunden/api.py
1
1782
# -*- coding: utf-8 -*- from .models import StundenAufzeichnung, Firma, Arbeitnehmer from tastypie.resources import ModelResource from tastypie import fields from tastypie.authentication import ApiKeyAuthentication from tastypie.authorization import DjangoAuthorization from tastypie.throttle import BaseThrottle from ta...
mit
arnavd96/Cinemiezer
myvenv/lib/python3.4/site-packages/django/core/cache/backends/locmem.py
586
4287
"Thread-safe in-memory cache backend." import time from contextlib import contextmanager from django.core.cache.backends.base import DEFAULT_TIMEOUT, BaseCache from django.utils.synch import RWLock try: from django.utils.six.moves import cPickle as pickle except ImportError: import pickle # Global in-memor...
mit
pombreda/swarming
appengine/isolate/tests/stats_test.py
2
3366
#!/usr/bin/env python # Copyright 2014 The Swarming Authors. All rights reserved. # Use of this source code is governed by the Apache v2.0 license that can be # found in the LICENSE file. import datetime import sys import unittest import test_env test_env.setup_test_env() # From components/third_party/ import webtes...
apache-2.0
harri88/harri88.github.io
node_modules/pygmentize-bundled/vendor/pygments/build-3.3/pygments/lexers/hdl.py
363
16209
# -*- coding: utf-8 -*- """ pygments.lexers.hdl ~~~~~~~~~~~~~~~~~~~ Lexers for hardware descriptor languages. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, bygroups, include, using, t...
mit
t0mk/ansible
lib/ansible/modules/monitoring/datadog_event.py
21
5397
#!/usr/bin/python # -*- coding: utf-8 -*- # # Author: Artūras 'arturaz' Šlajus <x11@arturaz.net> # Author: Naoya Nakazawa <naoya.n@gmail.com> # # This module is proudly sponsored by iGeolise (www.igeolise.com) and # Tiny Lab Productions (www.tinylabproductions.com). # # This file is part of Ansible # # Ansible is free ...
gpl-3.0
MatthewWilkes/mw4068-packaging
src/melange/src/soc/modules/gsoc/logic/models/student_proposal.py
1
5973
#!/usr/bin/env python2.5 # # Copyright 2009 the Melange authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
apache-2.0
2014c2g3/0623exam
static/Brython3.1.0-20150301-090019/Lib/difflib.py
737
82544
#! /usr/bin/env python3 """ Module difflib -- helpers for computing deltas between objects. Function get_close_matches(word, possibilities, n=3, cutoff=0.6): Use SequenceMatcher to return list of the best "good enough" matches. Function context_diff(a, b): For two lists of strings, return a delta in context ...
gpl-3.0
nomadcube/scikit-learn
sklearn/feature_selection/from_model.py
224
4316
# Authors: Gilles Louppe, Mathieu Blondel # License: BSD 3 clause import numpy as np from ..base import TransformerMixin from ..externals import six from ..utils import safe_mask, check_array from ..utils.validation import NotFittedError, check_is_fitted class _LearntSelectorMixin(TransformerMixin): # Note beca...
bsd-3-clause
amyvmiwei/kbengine
kbe/res/scripts/common/Lib/test/test_shutil.py
9
68872
# Copyright (C) 2003 Python Software Foundation import unittest import shutil import tempfile import sys import stat import os import os.path import errno import functools import subprocess from test import support from test.support import TESTFN from os.path import splitdrive from distutils.spawn import find_executab...
lgpl-3.0
cea-sec/miasm
miasm/core/ctypesmngr.py
5
23630
import re from pycparser import c_parser, c_ast RE_HASH_CMT = re.compile(r'^#\s*\d+.*$', flags=re.MULTILINE) # Ref: ISO/IEC 9899:TC2 # http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1124.pdf def c_to_ast(parser, c_str): """Transform a @c_str into a C ast Note: will ignore lines containing code refs ie: ...
gpl-2.0
chafique-delli/OpenUpgrade
addons/account/report/__init__.py
381
1513
# -*- 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
bolshoibooze/hone
Controller/hone_exeModule.py
2
6233
# Copyright (c) 2011-2013 Peng Sun. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the COPYRIGHT file. # hone_exeModule.py # Execution module on the controller import sys import traceback import logging import time from threading import Thread from hone_util ...
bsd-3-clause
ojengwa/oh-mainline
vendor/packages/mock/tests/support_with.py
18
2971
from __future__ import with_statement import sys __all__ = ['nested', 'catch_warnings', 'examine_warnings'] try: from contextlib import nested except ImportError: from contextlib import contextmanager @contextmanager def nested(*managers): exits = [] vars = [] exc = (None, No...
agpl-3.0
r8b7xy/qutebrowser
scripts/link_pyqt.py
8
7047
#!/usr/bin/env python3 # vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2014-2015 Florian Bruhin (The Compiler) <mail@qutebrowser.org> # 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 pub...
gpl-3.0
EvanK/ansible
lib/ansible/parsing/yaml/constructor.py
28
6151
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) an...
gpl-3.0
Kevin-Dunlap/d7-platform
sites/all/themes/esdsite/node_modules/node-gyp/gyp/pylib/gyp/generator/gypd.py
1824
3474
# Copyright (c) 2011 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """gypd output module This module produces gyp input as its output. Output files are given the .gypd extension to avoid overwriting the .gyp files that they are ...
gpl-2.0
drawks/ansible
lib/ansible/plugins/doc_fragments/aireos.py
44
2241
# -*- coding: utf-8 -*- # Copyright: (c) 2017, James Mighion <@jmighion> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) class ModuleDocFragment(object): # Standard files documentation fragment DOCUMENTATION = r''' options: provider: description: - A ...
gpl-3.0
mathslinux/ceilometer
ceilometer/tests/unit/test_novaclient.py
11
9653
#!/usr/bin/env python # # Copyright 2013-2014 eNovance <licensing@enovance.com> # # 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 ...
apache-2.0
shssoichiro/servo
tests/wpt/css-tests/tools/pytest/testing/code/test_code.py
169
4762
import sys import _pytest._code import py import pytest def test_ne(): code1 = _pytest._code.Code(compile('foo = "bar"', '', 'exec')) assert code1 == code1 code2 = _pytest._code.Code(compile('foo = "baz"', '', 'exec')) assert code2 != code1 def test_code_gives_back_name_for_not_existing_file(): ...
mpl-2.0
graphite/TeX4Web-INVENIO
modules/webstyle/lib/webdoc_tests.py
16
6229
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2008, 2009, 2010, 2011 CERN. ## ## Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or ...
gpl-2.0
secdev/scapy
scapy/contrib/rpl.py
3
11327
# This file is part of Scapy. # See http://www.secdev.org/projects/scapy for more information. # # Scapy is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 2 of the License, or # (at your option) a...
gpl-2.0
direvus/ansible
lib/ansible/modules/monitoring/sensu_client.py
27
8980
#!/usr/bin/python # (c) 2017, Red Hat Inc. # 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', 'status': ['preview'], ...
gpl-3.0
sbalde/edxplatform
openedx/core/djangoapps/course_groups/migrations/0002_add_model_CourseUserGroupPartitionGroup.py
112
5804
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'CourseUserGroupPartitionGroup' db.create_table('course_groups_courseusergrouppartitiongroup'...
agpl-3.0
google/hypebot
hypebot/proxies/requests_proxy.py
1
1488
# Copyright 2018 The Hypebot 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
qPCR4vir/orange3
Orange/widgets/classify/owtreeviewer2d.py
3
18887
from itertools import chain from PyQt4.QtCore import * from PyQt4.QtGui import * from Orange.widgets import gui from Orange.widgets.widget import OWWidget from Orange.widgets.settings import Setting from Orange.widgets.utils.saveplot import save_plot from Orange.widgets.io import FileFormat DefDroppletBrush = QBrush...
bsd-2-clause
arvinsingla/CouchPotatoServer
libs/requests/models.py
161
28111
# -*- coding: utf-8 -*- """ requests.models ~~~~~~~~~~~~~~~ This module contains the primary objects that power Requests. """ import collections import datetime from io import BytesIO, UnsupportedOperation from .hooks import default_hooks from .structures import CaseInsensitiveDict from .auth import HTTPBasicAuth ...
gpl-3.0
nebulans/testfixtures
testfixtures/tests/test_stringcomparison.py
1
1289
from testfixtures import StringComparison as S, compare from testfixtures.compat import PY2 from unittest import TestCase class Tests(TestCase): def test_equal_yes(self): self.failUnless('on 40220' == S('on \d+')) def test_equal_no(self): self.failIf('on xxx' == S('on \d+')) def test_no...
mit
nwalters512/the-blue-alliance
controllers/insights_controller.py
4
2851
import datetime import os from google.appengine.ext import ndb from base_controller import CacheableHandler from models.insight import Insight from template_engine import jinja2_engine MAX_YEAR = 2017 VALID_YEARS = list(reversed(range(1992, MAX_YEAR + 1))) class InsightsOverview(CacheableHandler): """ Sh...
mit
VanirAOSP/external_chromium_org
tools/telemetry/telemetry/core/platform/profiler/sample_profiler.py
27
2883
# Copyright (c) 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 signal import subprocess import sys import tempfile from telemetry.core import exceptions from telemetry.core import util from telemetry.core.pla...
bsd-3-clause
allen-fdes/python_demo
venv/Lib/site-packages/pip/utils/appdirs.py
311
9173
""" This code was taken from https://github.com/ActiveState/appdirs and modified to suite our purposes. """ from __future__ import absolute_import import os import sys from pip.compat import WINDOWS def user_cache_dir(appname): r""" Return full path to the user-specific cache dir for this application. ...
mit
alexlo03/ansible
lib/ansible/modules/clustering/k8s/k8s_facts.py
46
4809
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2018, Will Thames <@willthames> # 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
ageron/tensorflow
tensorflow/python/kernel_tests/unicode_script_op_test.py
10
2073
# 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 applicab...
apache-2.0
smileboywtu/mraa
examples/python/bmp85.py
42
1840
#!/usr/bin/env python # Author: Brendan Le Foll <brendan.le.foll@intel.com> # Copyright (c) 2014 Intel Corporation. # # 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, inc...
mit
Yexiaoxing/shadowsocks
tests/coverage_server.py
1072
1655
#!/usr/bin/env python # # Copyright 2015 clowwindy # # 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 ...
apache-2.0
PimentNoir/xbmc
tools/EventClients/Clients/Kodi Send/kodi-send.py
10
2592
#!/usr/bin/python # # XBMC Media Center # XBMC Send # Copyright (c) 2009 team-xbmc # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any la...
gpl-2.0
douglaswei/stock
fxcm/crawl/test.py
1
1783
# -*- coding: utf-8 -*- __author__ = 'wgz' from StringIO import StringIO import gzip import urllib2 import datetime url = 'https://tickdata.fxcorporate.com/' ##This is the base url url_suffix = '.csv.gz' ##Extension of the file name symbol = 'EURUSD' ##symbol we want to get tick data for ##Available Currencies ##A...
gpl-2.0
thehyve/variant
eggs/django-1.3.1-py2.7.egg/django/template/defaulttags.py
151
47838
"""Default tags used by the template system, available to all templates.""" import sys import re from itertools import groupby, cycle as itertools_cycle from django.template.base import Node, NodeList, Template, Context, Variable from django.template.base import TemplateSyntaxError, VariableDoesNotExist, BLOCK_TAG_ST...
apache-2.0
CoderDuan/mantaflow
scenes/waveletTurbulenceObs.py
1
6668
# # Complexer smoke simulation with wavlet turbulence plus # - obstacle handling # - and uv coordinates # from manta import * import os, shutil, math, sys # how much to upres the XL sim? # set to zero to disable the second one completely upres = 4 # overall wavelet noise strength wltStrength = 0.3 # how many gri...
gpl-3.0
normanmaurer/autobahntestsuite-maven-plugin
src/main/resources/werkzeug/_internal.py
301
13713
# -*- coding: utf-8 -*- """ werkzeug._internal ~~~~~~~~~~~~~~~~~~ This module provides internally used helpers and constants. :copyright: (c) 2013 by the Werkzeug Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import re import string import inspect from weakre...
apache-2.0
blaze33/django
tests/regressiontests/templates/parser.py
58
3218
""" Testing some internals of the template processing. These are *not* examples to be copied in user code. """ from __future__ import unicode_literals from django.template import (TokenParser, FilterExpression, Parser, Variable, TemplateSyntaxError) from django.utils.unittest import TestCase class ParserTests(Te...
bsd-3-clause
h3/django-gestio
gestio/__init__.py
1
1787
import os # Use 'final' as the 4th element to indicate # a full release VERSION = (0, 0, 1, 'alpha', 0) def get_short_version(): return '%s.%s' % (VERSION[0], VERSION[1]) def get_version(): version = '%s.%s' % (VERSION[0], VERSION[1]) if VERSION[2]: # Append 3rd digit if > 0 version = ...
bsd-3-clause
uni2u/neutron
tools/install_venv_common.py
63
5944
# Copyright 2013 OpenStack Foundation # Copyright 2013 IBM Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
apache-2.0
maestrano/odoo
addons/website/models/test_models.py
335
1386
# -*- coding: utf-8 -*- from openerp.osv import orm, fields class test_converter(orm.Model): _name = 'website.converter.test' # disable translation export for those brilliant field labels and values _translate = False _columns = { 'char': fields.char(), 'integer': fields.integer(), ...
agpl-3.0
jaimahajan1997/sympy
sympy/functions/special/spherical_harmonics.py
86
10370
from __future__ import print_function, division from sympy import pi, I from sympy.core.singleton import S from sympy.core import Dummy, sympify from sympy.core.function import Function, ArgumentIndexError from sympy.functions import assoc_legendre from sympy.functions.elementary.trigonometric import sin, cos, cot fro...
bsd-3-clause
rhythmsosad/numpy
benchmarks/benchmarks/bench_ufunc.py
29
3320
from __future__ import absolute_import, division, print_function from .common import Benchmark, squares_ import numpy as np ufuncs = ['abs', 'absolute', 'add', 'arccos', 'arccosh', 'arcsin', 'arcsinh', 'arctan', 'arctan2', 'arctanh', 'bitwise_and', 'bitwise_not', 'bitwise_or', 'bitwise_xor', 'cb...
bsd-3-clause
nicolasmoreau/NodeSoftware
nodes/hitran/node/queryfunc.py
4
15645
# -*- coding: utf-8 -*- from django.db.models import Q from django.conf import settings from dictionaries import * from models import * from vamdctap import sqlparse from itertools import chain from HITRANfuncsenvs import * import formula_parser import sys import time # YYY XXX class Bunch(object): def __init__(...
gpl-3.0
CXQERP/ODOOERP
openerp/addons/base/ir/ir_model.py
148
62274
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (C) 2004-2014 OpenERP S.A. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
agpl-3.0
olsaki/ansible-modules-core
files/synchronize.py
43
14681
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012-2013, Timothy Appnel <tim@appnel.com> # # 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
mscuthbert/abjad
abjad/tools/indicatortools/StringContactPoint.py
2
4370
# -*- encoding: utf-8 -*- from abjad.tools.abctools import AbjadValueObject class StringContactPoint(AbjadValueObject): r'''String contact point indicator. .. container:: example **Example 1.** Sul ponticello: :: >>> indicator = indicatortools.StringContactPoint('sul ponticell...
gpl-3.0
killbug2004/volatility
volatility/win32/rawreg.py
10
6225
# Volatility # Copyright (c) 2008-2013 Volatility Foundation # Copyright (c) 2008 Brendan Dolan-Gavitt <bdolangavitt@wesleyan.edu> # # This file is part of Volatility. # # Volatility 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
shurihell/testasia
common/djangoapps/util/memcache.py
251
1344
""" This module provides a KEY_FUNCTION suitable for use with a memcache backend so that we can cache any keys, not just ones that memcache would ordinarily accept """ from django.utils.encoding import smart_str import hashlib import urllib def fasthash(string): """ Hashes `string` into a string representatio...
agpl-3.0
sarahgrogan/scikit-learn
sklearn/neighbors/tests/test_kde.py
208
5556
import numpy as np from sklearn.utils.testing import (assert_allclose, assert_raises, assert_equal) from sklearn.neighbors import KernelDensity, KDTree, NearestNeighbors from sklearn.neighbors.ball_tree import kernel_norm from sklearn.pipeline import make_pipeline from sklearn.dataset...
bsd-3-clause
nicolargo/intellij-community
python/lib/Lib/site-packages/django/contrib/formtools/preview.py
229
6829
""" Formtools Preview application. """ import cPickle as pickle from django.conf import settings from django.http import Http404 from django.shortcuts import render_to_response from django.template.context import RequestContext from django.utils.hashcompat import md5_constructor from django.utils.crypto import consta...
apache-2.0
ddaze/cds
cds/modules/personal_collection/boxes/record_list.py
2
2487
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2015 CERN. # # Invenio is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # License, or (at your option) any later...
gpl-2.0
SM-G920P/S6-MM
scripts/rt-tester/rt-tester.py
11005
5307
#!/usr/bin/python # # rt-mutex tester # # (C) 2006 Thomas Gleixner <tglx@linutronix.de> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # import os import sys import getopt import sh...
gpl-2.0
JasonMillward/photography-statistics
photostats.py
1
2331
""" Released under the MIT license Copyright (c) 2014, Jason Millward @category misc @author Jason Millward <jason@jcode.me> @license http://opensource.org/licenses/MIT Usage: stats.py <EXIF Attr>... [--dir=<dir>] """ import exifread import docopt import unicodedata from os import listdir from os.pat...
mit
jayeshIT/AlloyTwitterLogin_old
plugins/ti.alloy/plugin.py
1729
5251
import os, sys, subprocess, hashlib import subprocess def check_output(*popenargs, **kwargs): r"""Run command with arguments and return its output as a byte string. Backported from Python 2.7 as it's implemented as pure python on stdlib. >>> check_output(['/usr/bin/python', '--version']) Python 2.6....
apache-2.0
kriskowal/npm
node_modules/node-gyp/gyp/buildbot/buildbot_run.py
88
4706
#!/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. """Argument-less script to select what to run on the buildbots.""" import os import shutil import subprocess import sys if sys.platform ...
artistic-2.0
ckc6cz/osf.io
framework/mongo/__init__.py
43
1181
# -*- coding: utf-8 -*- from flask import request from modularodm.storedobject import StoredObject as GenericStoredObject from modularodm.ext.concurrency import with_proxies, proxied_members from bson import ObjectId from .handlers import client, database, set_up_storage from api.base.api_globals import api_globals...
apache-2.0
guorendong/iridium-browser-ubuntu
tools/telemetry/telemetry/core/forwarders/cros_forwarder.py
8
2050
# Copyright 2014 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 subprocess from telemetry.core import forwarders from telemetry.core.forwarders import do_nothing_forwarder from telemetry.core import...
bsd-3-clause
patrickm/chromium.src
tools/cr/cr/loader.py
1
4014
# 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. """Module scan and load system. The main interface to this module is the Scan function, which triggers a recursive scan of all packages and modules below cr...
bsd-3-clause
zzzirk/boto
boto/pyami/__init__.py
396
1107
# Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/ # # 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, modi...
mit
initNirvana/Easyphotos
env/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...
mit
projectcalico/calico-nova
nova/api/openstack/compute/plugins/v3/hosts.py
4
12730
# Copyright (c) 2011 OpenStack Foundation # 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 ...
apache-2.0
openstack/python-aodhclient
aodhclient/noauth.py
2
2567
# # 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 # ...
apache-2.0
GalenMa/kolla
kolla/tests/base.py
8
1583
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under th...
apache-2.0