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
talishte/ctigre
env/lib/python2.7/site-packages/django/views/generic/detail.py
77
6558
from __future__ import unicode_literals from django.core.exceptions import ImproperlyConfigured, ObjectDoesNotExist from django.db import models from django.http import Http404 from django.utils.translation import ugettext as _ from django.views.generic.base import TemplateResponseMixin, ContextMixin, View class Sin...
bsd-2-clause
onlynight/wechat-dump
wechat/smiley.py
1
4076
#!/usr/bin/env python2 # -*- coding: UTF-8 -*- # File: smiley.py # Date: Thu Jun 18 00:02:43 2015 +0800 # Author: Yuxin Wu <ppwwyyxxc@gmail.com> import os import re import json import struct from common.textutil import get_file_b64 STATIC_PATH = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'static') UNI...
gpl-3.0
wscullin/spack
var/spack/repos/builtin/packages/py-jedi/package.py
3
1784
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
llhe/tensorflow
tensorflow/compiler/tests/lstm_test.py
130
12982
# 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
molpopgen/fwdpy11
examples/discrete_demography/localadaptation.py
1
7832
# # Copyright (C) 2019 Kevin Thornton <krthornt@uci.edu> # # This file is part of fwdpy11. # # fwdpy11 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
kastman/lyman
lyman/tests/test_surface.py
1
1392
import pytest from .. import surface class TestSurfaceMeasure(object): def test_surface_measure_neighbors(self, meshdata): sm = surface.SurfaceMeasure(meshdata["verts"], meshdata["faces"]) for v, v_n in sm.neighbors.items(): assert v_n == pytest.approx(meshdata["neighbors"][v]) ...
bsd-3-clause
pymedusa/Medusa
ext/boto/elastictranscoder/exceptions.py
184
1595
# Copyright (c) 2013 Amazon.com, Inc. or its affiliates. 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 ...
gpl-3.0
bgris/ODL_bgris
odl/tomo/util/utility.py
2
8598
# Copyright 2014-2016 The ODL development group # # This file is part of ODL. # # ODL 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. #...
gpl-3.0
stanzhai/spark
examples/src/main/python/mllib/random_forest_classification_example.py
106
2572
# # 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 us...
apache-2.0
tuxfux-hlp-notes/python-batches
archieves/batch-64/09-modules/myenv/lib/python2.7/site-packages/django/conf/locale/az/formats.py
1059
1267
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # 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 = 'G:i' DAT...
gpl-3.0
ArcherSys/ArcherSys
Lib/site-packages/django/core/exceptions.py
486
5276
""" Global Django exception and warning classes. """ from django.utils import six from django.utils.encoding import force_text class FieldDoesNotExist(Exception): """The requested model field does not exist""" pass class DjangoRuntimeWarning(RuntimeWarning): pass class AppRegistryNotReady(Exception): ...
mit
GbalsaC/bitnamiP
django-wiki/wiki/plugins/links/wiki_plugin.py
1
1271
# -*- coding: utf-8 -*- from django.conf.urls.defaults import patterns, url from django.utils.translation import ugettext_lazy as _ from wiki.conf import settings from wiki.core.plugins import registry from wiki.core.plugins.base import BasePlugin from wiki.plugins.links import views from wiki.plugins.links.mdx.urlize...
agpl-3.0
daineseh/kodi-plugin.video.ted-talks-chinese
youtube_dl/extractor/vimeo.py
3
33290
# encoding: utf-8 from __future__ import unicode_literals import json import re import itertools from .common import InfoExtractor from ..compat import ( compat_HTTPError, compat_urlparse, ) from ..utils import ( determine_ext, ExtractorError, InAdvancePagedList, int_or_none, RegexNotFound...
gpl-2.0
damoti/pyjx-gwt
gwt/pyjamas/Canvas/JSOStack.mshtml.py
14
1891
""" * Copyright 2008 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use self 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, s...
apache-2.0
OpenPymeMx/OCB
addons/sale_journal/__openerp__.py
119
2670
# -*- 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
OPU-Surveillance-System/monitoring
master/scripts/planner/solvers/test_penalization_plot.py
1
1040
import matplotlib.pyplot as plt with open("test_pen", "r") as f: data = f.read() data = data.split("\n")[:-1] data = [data[i].split(" ") for i in range(0, len(data))] pen = [float(data[i][0]) for i in range(len(data))] u = [float(data[i][1]) for i in range(len(data))] d = [float(data[i][2]) for i in range(len(data...
mit
steveandroulakis/mytardis
tardis/tardis_portal/search_indexes.py
2
12816
# -*- coding: utf-8 -*- # # Copyright (c) 2010-2011, Monash e-Research Centre # (Monash University, Australia) # Copyright (c) 2010-2011, VeRSI Consortium # (Victorian eResearch Strategic Initiative, Australia) # All rights reserved. # Redistribution and use in source and binary forms, with or without # modificati...
bsd-3-clause
Silvian/samaritan
emailservice/views.py
1
2372
""" @author: Silvian Dragan @Date: 17/06/2016 @Copyright: Copyright 2016, Samaritan CMA - Published under GNU General Public Licence v3 @Details: https://github.com/Silvian/samaritan """ import json from django.contrib.auth import get_user from django.contrib.auth.decorators import login_required from django.http impo...
gpl-3.0
flycoin/flycoin
share/qt/make_spinner.py
4415
1035
#!/usr/bin/env python # W.J. van der Laan, 2011 # Make spinning .mng animation from a .png # Requires imagemagick 6.7+ from __future__ import division from os import path from PIL import Image from subprocess import Popen SRC='img/reload_scaled.png' DST='../../src/qt/res/movies/update_spinner.mng' TMPDIR='/tmp' TMPNAM...
mit
watspidererik/testenv
flask/lib/python2.7/site-packages/sqlalchemy/event/base.py
33
7248
# event/base.py # Copyright (C) 2005-2014 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """Base implementation classes. The public-facing ``Events`` serves as the base class...
mit
ruziniu/v2ex
html5lib/treewalkers/pulldom.py
101
2220
from xml.dom.pulldom import START_ELEMENT, END_ELEMENT, \ COMMENT, IGNORABLE_WHITESPACE, CHARACTERS import _base from html5lib.constants import voidElements class TreeWalker(_base.TreeWalker): def __iter__(self): ignore_until = None previous = None for event in self.tree: ...
bsd-3-clause
galtys/odoo
addons/portal_project_issue/__openerp__.py
375
1713
# -*- 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
wfxiang08/sqlalchemy
examples/elementtree/pickle.py
34
1821
"""illustrates a quick and dirty way to persist an XML document expressed using ElementTree and pickle. This is a trivial example using PickleType to marshal/unmarshal the ElementTree document into a binary column. Compare to explicit.py which stores the individual components of the ElementTree structure in distinct ...
mit
JakeBrand/CMPUT410-E6
v1/lib/python2.7/site-packages/django/contrib/auth/tests/test_management.py
12
20001
from __future__ import unicode_literals from datetime import date import locale import sys from django.apps import apps from django.contrib.auth import models, management from django.contrib.auth.checks import check_user_model from django.contrib.auth.management import create_permissions from django.contrib.auth.mana...
apache-2.0
applicationdevm/XlsxWriter
xlsxwriter/test/worksheet/test_cond_format19.py
8
4906
############################################################################### # # Tests for XlsxWriter. # # Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org # import unittest from ...compatibility import StringIO from ..helperfunctions import _xml_to_list from ...worksheet import Worksheet class TestAss...
bsd-2-clause
marianotepper/dask
dask/store/core.py
15
2780
from collections import defaultdict, MutableMapping from operator import getitem, add from datetime import datetime from time import time from ..core import istask, ishashable class Store(MutableMapping): """ Store - A storage of data and computation Example ------- Store data like a dictionary ...
bsd-3-clause
ChawalitK/odoo
openerp/report/render/rml2pdf/utils.py
48
6141
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import copy import locale import logging import re import reportlab import openerp.tools as tools from openerp.tools.safe_eval import safe_eval as eval from openerp.tools.misc import ustr _logger = logging.getLogger(_...
gpl-3.0
fredkingham/blog-of-fred
django/contrib/localflavor/si/si_postalcodes.py
89
13570
# *-* coding: utf-8 *-* SI_POSTALCODES = [ (1000, u'Ljubljana'), (1215, u'Medvode'), (1216, u'Smlednik'), (1217, u'Vodice'), (1218, u'Komenda'), (1219, u'Laze v Tuhinju'), (1221, u'Motnik'), (1222, u'Trojane'), (1223, u'Blagovica'), (1225, u'Lukovica'), (1230, u'Dom\u017eale...
bsd-3-clause
kyubifire/softlayer-python
SoftLayer/fixtures/SoftLayer_Virtual_Guest.py
1
19232
getObject = { 'id': 100, 'hostname': 'vs-test1', 'domain': 'test.sftlyr.ws', 'fullyQualifiedDomainName': 'vs-test1.test.sftlyr.ws', 'status': {'keyName': 'ACTIVE', 'name': 'Active'}, 'billingItem': { 'id': 6327, 'nextInvoiceTotalRecurringAmount': 1.54, 'children': [ ...
mit
d120/pyfeedback
src/feedback/models/fragebogen2016.py
1
14676
# coding=utf-8 from django.db import models from feedback.models import Fragebogen, Ergebnis class Fragebogen2016(Fragebogen): fach = models.CharField(max_length=5, choices=Fragebogen.FACH_CHOICES, blank=True) abschluss = models.CharField(max_length=5, choices=Fragebogen.ABSCHLUSS_CHOICES, blank=True) sem...
agpl-3.0
littley/network_cjl
network_cjl/ReceiveRequest.py
1
1833
import time class ReceiveRequest(object): """ A ReceiveRequest is generated every time the first packet from a message is received. The ReceiveRequest then keeps track of all of the message's packets that have already ben received. """ def __init__(self, inital_packet, (host, port)): s...
apache-2.0
mhrivnak/pulp
nodes/common/pulp_node/config.py
8
1421
from pulp.common.config import ANY, BOOL, Config, REQUIRED NODE_CONFIGURATION_PATH = '/etc/pulp/nodes.conf' DEFAULT = { 'main': { 'ca_path': '/etc/pki/tls/certs/ca-bundle.crt', 'node_certificate': '/etc/pki/pulp/nodes/node.crt', 'verify_ssl': 'true', }, 'oauth': { 'user_id...
gpl-2.0
pabloborrego93/edx-platform
common/djangoapps/student/middleware.py
172
1450
""" Middleware that checks user standing for the purpose of keeping users with disabled accounts from accessing the site. """ from django.http import HttpResponseForbidden from django.utils.translation import ugettext as _ from django.conf import settings from student.models import UserStanding class UserStandingMidd...
agpl-3.0
huyphan/pyyawhois
test/record/parser/test_response_kero_yachay_pe_status_suspended.py
1
1499
# This file is autogenerated. Do not edit it manually. # If you want change the content of this file, edit # # spec/fixtures/responses/kero.yachay.pe/status_suspended # # and regenerate the tests with the following script # # $ scripts/generate_tests.py # from nose.tools import * from dateutil.parser import parse...
mit
htc-msm8960/android_kernel_htc_m7
scripts/build-all.py
1250
9474
#! /usr/bin/env python # Copyright (c) 2009-2011, Code Aurora Forum. 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 # n...
gpl-2.0
janocat/odoo
addons/hw_escpos/escpos/exceptions.py
170
2884
""" ESC/POS Exceptions classes """ import os class Error(Exception): """ Base class for ESC/POS errors """ def __init__(self, msg, status=None): Exception.__init__(self) self.msg = msg self.resultcode = 1 if status is not None: self.resultcode = status def __st...
agpl-3.0
PennyQ/glue-3d-viewer
glue_vispy_viewers/extern/vispy/visuals/text/_sdf.py
13
10545
# -*- coding: utf-8 -*- """ Jump flooding algoritm for EDT using GLSL code: Author: Stefan Gustavson (stefan.gustavson@gmail.com) 2010-08-24. This code is in the public domain. Adapted to `vispy` by Eric Larson <larson.eric.d@gmail.com>. """ import numpy as np from os import path as op from ...gloo import (Program, F...
bsd-2-clause
was4444/chromium.src
tools/grit/grit/format/chrome_messages_json.py
24
1809
#!/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. """Formats as a .json file that can be used to localize Google Chrome extensions.""" from json import JSONEncoder import re import...
bsd-3-clause
vitan/hue
desktop/core/ext-py/tablib-develop/tablib/packages/openpyxl3/writer/theme.py
116
10933
# -*- coding: utf-8 -*- # file openpyxl/writer/theme.py # Copyright (c) 2010 openpyxl # # 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 ...
apache-2.0
DedMemez/ODS-August-2017
golf/GolfGlobals.py
1
13007
# Fuck you Disyer. Stealing my fucking paypal. GET FUCKED: toontown.golf.GolfGlobals from direct.directnotify import DirectNotifyGlobal import random MAX_PLAYERS_PER_HOLE = 4 GOLF_BALL_RADIUS = 0.25 GOLF_BALL_VOLUME = 4.0 / 3.0 * 3.14159 * GOLF_BALL_RADIUS ** 3 GOLF_BALL_MASS = 0.5 GOLF_BALL_DENSITY = GOLF_BALL_...
apache-2.0
VisheshHanda/production_backup
erpnext/schools/report/absent_student_report/absent_student_report.py
38
3002
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe.utils import cstr, cint, getdate from frappe import msgprint, _ def execute(filters=None): if not filters: filters = {} if...
gpl-3.0
NDManh/numbbo
code-postprocessing/bbob_pproc/pptex.py
4
14442
#! /usr/bin/env python # -*- coding: utf-8 -*- """Routines for writing TeX for tables.""" from __future__ import absolute_import import os import sys import string import numpy from . import toolsstats from pdb import set_trace #GLOBAL VARIABLES DEFINITION alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuv...
bsd-3-clause
fluxer/spm
nuitka/nuitka/Builtins.py
1
6584
# Copyright 2016, Kay Hayen, mailto:kay.hayen@gmail.com # # Part of "Nuitka", an optimizing Python compiler that is compatible and # integrates with CPython, but also works on its own. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in complianc...
gpl-2.0
kennedyshead/home-assistant
tests/components/nws/test_init.py
7
1297
"""Tests for init module.""" from homeassistant.components.nws.const import DOMAIN from homeassistant.components.weather import DOMAIN as WEATHER_DOMAIN from homeassistant.const import STATE_UNAVAILABLE from tests.common import MockConfigEntry from tests.components.nws.const import NWS_CONFIG async def test_unload_e...
apache-2.0
odubno/microblog
flask/lib/python2.7/site-packages/pip/_vendor/distlib/locators.py
191
46946
# -*- coding: utf-8 -*- # # Copyright (C) 2012-2013 Vinay Sajip. # Licensed to the Python Software Foundation under a contributor agreement. # See LICENSE.txt and CONTRIBUTORS.txt. # import gzip from io import BytesIO import json import logging import os import posixpath import re try: import threading except Impo...
bsd-3-clause
s40523133/2016fallcp_hw
plugin/liquid_tags/diag.py
270
4096
""" Blockdiag Tag --------- This tag implements a liquid style tag for blockdiag [1]. You can use different diagram types like blockdiag, seqdiag, packetdiag etc. [1] [1] http://blockdiag.com/en/blockdiag/ Syntax ------ {% blockdiag { <diagramm type> { <CODE> } } %} Examples -------...
agpl-3.0
SamStudio8/scikit-bio
skbio/diversity/alpha/_ace.py
6
4722
# ---------------------------------------------------------------------------- # Copyright (c) 2013--, scikit-bio development team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed with this software. # --------------------------------------------...
bsd-3-clause
prathik/thrift
lib/py/src/transport/TSSLSocket.py
55
8258
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
apache-2.0
meabsence/python-for-android
python3-alpha/python3-src/Lib/multiprocessing/connection.py
46
14017
# # A higher level module for using sockets (or Windows named pipes) # # multiprocessing/connection.py # # Copyright (c) 2006-2008, R Oudkerk # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # ...
apache-2.0
kxliugang/edx-platform
common/djangoapps/terrain/ui_helpers.py
110
21609
# pylint: disable=missing-docstring # pylint: disable=redefined-outer-name from lettuce import world import time import json import re import platform # django_url is assigned late in the process of loading lettuce, # so we import this as a module, and then read django_url from # it to get the correct value import l...
agpl-3.0
microcom/odoo
addons/mail/models/mail_shortcode.py
37
2692
# -*- coding: utf-8 -*- import cgi import re from openerp import api, fields, models class MailShortcode(models.Model): """ Shortcode Canned Responses, allowing the user to defined shortcuts in its message. Should be applied before storing message in database. Emoji allowing replacing text with i...
agpl-3.0
hbrunn/OpenUpgrade
addons/email_template/wizard/mail_compose_message.py
38
11212
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2010-Today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
CorySpitzer/ansible
lib/ansible/plugins/shell/sh.py
20
6337
# (c) 2014, Chris Church <chris@ninemoreminutes.com> # # This file is part of Ansible. # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any lat...
gpl-3.0
eddyst/Arduino-SourceCode
arduino-core/src/processing/app/i18n/python/requests/packages/charade/sbcsgroupprober.py
2936
3291
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
lgpl-2.1
noisymime/zookeepr
zkpylons/tests/model/core/domain/test_person.py
3
1529
import datetime import md5 from zkpylons.tests.model import * class TestPerson(CRUDModelTest): domain = model.core.Person samples = [dict(handle='testguy', email_address='testguy@example.org', password='p4ssw0rd', firstname='Testguy', ...
gpl-2.0
antonve/s4-project-mooc
common/lib/capa/capa/tests/test_answer_pool.py
196
27058
""" Tests the logic of the "answer-pool" attribute, e.g. <choicegroup answer-pool="4"> """ import unittest import textwrap from . import test_capa_system, new_loncapa_problem from capa.responsetypes import LoncapaProblemError class CapaAnswerPoolTest(unittest.TestCase): """Capa Answer Pool Test""" def setU...
agpl-3.0
ujenmr/ansible
lib/ansible/modules/packaging/os/urpmi.py
43
6462
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2013, Philippe Makowski # Written by Philippe Makowski <philippem@mageia.org> # Based on apt module written by Matthew Williams <matthew@flowroute.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future...
gpl-3.0
Kazade/NeHe-Website
google_appengine/lib/django-1.4/tests/modeltests/m2m_through/models.py
43
2236
from datetime import datetime from django.db import models # M2M described on one of the models class Person(models.Model): name = models.CharField(max_length=128) class Meta: ordering = ('name',) def __unicode__(self): return self.name class Group(models.Model): name = models.Char...
bsd-3-clause
adamnovak/client
command/biicommand.py
5
19402
import argparse from biicode.common.exception import BiiException, InvalidNameException from biicode.common.model.brl.block_name import BlockName from biicode.common.model.symbolic.block_version import (BlockVersion, parse_block_version_expression) from biicode.c...
mit
thruflo/dogpile.cache
dogpile/cache/backends/memcached.py
13
10219
""" Memcached Backends ------------------ Provides backends for talking to `memcached <http://memcached.org>`_. """ from dogpile.cache.api import CacheBackend, NO_VALUE from dogpile.cache import compat from dogpile.cache import util import random import time __all__ = 'GenericMemcachedBackend', 'MemcachedBackend',\...
bsd-3-clause
seanbell/opensurfaces
server/intrinsic/algorithm/grosse2009/intrinsic.py
1
10552
import itertools import numpy as np import os import png import sys import poisson ############################### Data ########################################### def load_png(fname): reader = png.Reader(fname) w, h, pngdata, params = reader.read() image = np.vstack(itertools.imap(np.uint16, pngdata)) ...
mit
drpngx/tensorflow
tensorflow/contrib/batching/python/ops/batch_ops.py
5
8241
# 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
openstack/heat
heat/common/profiler.py
2
1712
# # 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
sigurdga/samklang-blog
samklang_blog/views.py
1
2247
from django.http import HttpResponseRedirect from django.views.generic.edit import CreateView, UpdateView from django.views.generic.dates import ArchiveIndexView, YearArchiveView, MonthArchiveView, DateDetailView from django.contrib.auth.decorators import login_required from django.utils.decorators import method_decora...
agpl-3.0
x303597316/hue
desktop/libs/libopenid/src/libopenid/openid_settings.py
33
1432
# Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file ex...
apache-2.0
DMSC-Instrument-Data/lewis
src/lewis/devices/__init__.py
2
8047
# -*- coding: utf-8 -*- # ********************************************************************* # lewis - a library for creating hardware device simulators # Copyright (C) 2016-2017 European Spallation Source ERIC # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU G...
gpl-3.0
yize/grunt-tps
tasks/lib/python/Lib/python2.7/plat-mac/bundlebuilder.py
40
33754
#! /usr/bin/env python """\ bundlebuilder.py -- Tools to assemble MacOS X (application) bundles. This module contains two classes to build so called "bundles" for MacOS X. BundleBuilder is a general tool, AppBuilder is a subclass specialized in building application bundles. [Bundle|App]Builder objects are instantiat...
mit
aaltay/beam
sdks/python/apache_beam/transforms/sideinputs.py
3
3803
# # 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 us...
apache-2.0
czpython/django-cms
cms/page_rendering.py
1
2938
# -*- coding: utf-8 -*- from django.conf import settings from django.core.urlresolvers import resolve, Resolver404, reverse from django.http import Http404 from django.shortcuts import render from django.template.response import TemplateResponse from cms import __version__ from cms.cache.page import set_page_cache fro...
bsd-3-clause
pratikmallya/heat
heat/tests/engine/service/test_software_config.py
8
34346
# # 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
shubhdev/edx-platform
pavelib/utils/test/bokchoy_utils.py
63
4808
""" Helper functions for bok_choy test tasks """ import sys import os import time import httplib import subprocess from paver.easy import sh from pavelib.utils.envs import Env from pavelib.utils.process import run_background_process try: from pygments.console import colorize except ImportError: colorize = lamb...
agpl-3.0
louisLouL/pair_trading
capstone_env/lib/python3.6/site-packages/chardet/codingstatemachine.py
289
3590
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Con...
mit
rivasd/djPsych
djreceive/migrations/0019_singleaudiotrial.py
1
1328
# -*- coding: utf-8 -*- # Generated by Django 1.9 on 2017-01-04 19:35 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion import jsonfield.fields class Migration(migrations.Migration): dependencies = [ ('djreceive', '0018_auto_20170104_1418')...
gpl-3.0
rbaindourov/v8-inspector
Source/build/scripts/in_file.py
39
6696
# Copyright (C) 2013 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the ...
bsd-3-clause
lrocheWB/navitia
source/jormungandr/jormungandr/scenarios/helpers.py
1
8430
# Copyright (c) 2001-2014, Canal TP and/or its affiliates. All rights reserved. # # This file is part of Navitia, # the software to build cool stuff with public transport. # # Hope you'll enjoy and contribute to this project, # powered by Canal TP (www.canaltp.fr). # Help us simplify mobility and open public tr...
agpl-3.0
mjsottile/PyOpinionGame
opiniongame/coupling.py
2
1098
import numpy as np def weights_no_coupling(pop_size, ntopics): """ Weights with no coupling: zeros for all off diagonal elements of the matrix for each individual. """ return np.tile(np.eye(ntopics, ntopics), (pop_size, 1, 1)) def weights_coupling_same(pop_size, ntopics): """ Weights with ...
gpl-3.0
tengyifei/grpc
tools/distrib/python/check_grpcio_tools.py
40
2027
#!/usr/bin/env python # Copyright 2015, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list ...
bsd-3-clause
code-google-com/oyprojectmanager
tests/environments/mayaEnv.py
3
28405
# -*- coding: utf-8 -*- # Copyright (c) 2009-2012, Erkan Ozgur Yilmaz # # This module is part of oyProjectManager and is released under the BSD 2 # License: http://www.opensource.org/licenses/BSD-2-Clause """These tests should run with Maya's own ptyhon interpreter """ import os import shutil import tempfile import u...
bsd-2-clause
Aryan-Barbarian/bigbang
bin/collect_mail.py
3
1072
import sys import getopt import bigbang.mailman as mailman from pprint import pprint as pp import logging logging.basicConfig(level=logging.DEBUG) def main(argv): inputfile = '' outputfile = '' try: opts, args = getopt.getopt(argv, "u:f:") except getopt.GetoptError as e: print 'Getopt...
gpl-2.0
misttechnologies/selenium
py/test/selenium/webdriver/firefox/__init__.py
57
1247
# Copyright 2008-2009 WebDriver committers # Copyright 2008-2009 Google 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 requ...
apache-2.0
blazek/QGIS
python/plugins/processing/algs/qgis/RandomExtractWithinSubsets.py
15
5739
# -*- coding: utf-8 -*- """ *************************************************************************** RandomSelectionWithinSubsets.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com **********...
gpl-2.0
ubear/Pyspider
pyspider/webui/debug.py
4
6276
#!/usr/bin/env python # -*- encoding: utf-8 -*- # vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8: # Author: Binux<i@binux.me> # http://binux.me # Created on 2014-02-23 00:19:06 import re import sys import time import socket import inspect import datetime import traceback from flask import render_template, requ...
apache-2.0
iPlantCollaborativeOpenSource/libcloud
libcloud/compute/drivers/ntta.py
30
2011
# 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 use ...
apache-2.0
RedhawkSDR/integration-gnuhawk
gnuradio/gnuradio-core/src/python/bin/microtune.py
18
1516
#!/usr/bin/env python # -*- Python -*- from gnuradio import gr from gnuradio.eng_option import eng_option from gnuradio.wxgui import stdgui, fftsink from optparse import OptionParser from gnuradio import eng_notation def main (): parser = OptionParser (option_class=eng_option) parser.add_option ("-g", "--gai...
gpl-3.0
trishnaguha/ansible
lib/ansible/modules/network/netvisor/pn_dscp_map.py
14
4171
#!/usr/bin/python # Copyright: (c) 2018, Pluribus Networks # 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': ['...
gpl-3.0
lduarte1991/edx-platform
lms/djangoapps/course_blocks/transformers/visibility.py
23
2384
""" Visibility Transformer implementation. """ from openedx.core.djangoapps.content.block_structure.transformer import ( BlockStructureTransformer, FilteringTransformerMixin ) from .utils import collect_merged_boolean_field class VisibilityTransformer(FilteringTransformerMixin, BlockStructureTransformer): ...
agpl-3.0
hale36/SRTV
lib/mako/filters.py
39
6003
# mako/filters.py # Copyright (C) 2006-2015 the Mako authors and contributors <see AUTHORS file> # # This module is part of Mako and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php import re import codecs from mako.compat import quote_plus, unquote_plus, codepoint2name, \ ...
gpl-3.0
ruhan/django-silk-mongoengine
setup.py
1
1322
import os from setuptools import setup with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme_file: README = readme_file.read() # allow setup.py to be run from any path os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) setup( name='django-silk', version='0...
mit
chubiei/ycmd
cpp/ycm/.ycm_extra_conf.py
45
6368
# This file is NOT licensed under the GPLv3, which is the license for the rest # of YouCompleteMe. # # Here's the license text for this file: # # This is free and unencumbered software released into the public domain. # # Anyone is free to copy, modify, publish, use, compile, sell, or # distribute this software, either...
gpl-3.0
iut-ibk/Calimero
site-packages/pybrain/tests/helpers.py
2
4395
__author__ = 'Tom Schaul, tom@idsia.ch' import profile import pstats import tempfile from scipy import randn, zeros from pybrain.structure.networks.network import Network from pybrain.datasets import SequentialDataSet, SupervisedDataSet from pybrain.supervised import BackpropTrainer from pybrain.tools.xm...
gpl-2.0
UstadMobile/exelearning-ustadmobile-work
testing/runtests.py
1
3225
#!/usr/bin/python # =========================================================================== # config unittest # Copyright 2004, University of Auckland # # 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 F...
gpl-2.0
abusse/cinder
cinder/openstack/common/imageutils.py
5
6351
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # Copyright (c) 2010 Citrix Systems, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in complianc...
apache-2.0
zerc/django-sirtrevor
sirtrevor/views.py
3
2071
import importlib import json import os from django.conf import settings from django.core.files.storage import default_storage from django.http import HttpResponse from django.utils.text import slugify from django.views.decorators.csrf import csrf_exempt from django.views.decorators.http import require_POST from django....
mit
Amechi101/concepteur-market-app
venv/lib/python2.7/site-packages/pystache/tests/test_renderengine.py
32
26581
# coding: utf-8 """ Unit tests of renderengine.py. """ import sys import unittest from pystache.context import ContextStack, KeyNotFoundError from pystache import defaults from pystache.parser import ParsingError from pystache.renderer import Renderer from pystache.renderengine import context_get, RenderEngine from...
mit
VisionSystemsInc/voxel_globe
voxel_globe/ingest/migrations/0001_initial.py
2
1587
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.Create...
mit
springheeledjak/thrift
tutorial/py.tornado/PythonServer.py
42
2980
#!/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
apache/incubator-eagle
eagle-external/hadoop_jmx_collector/lib/kafka-python/test/test_context.py
38
3996
""" OffsetCommitContext tests. """ from . import unittest from mock import MagicMock, patch from kafka.common import OffsetOutOfRangeError from kafka.context import OffsetCommitContext class TestOffsetCommitContext(unittest.TestCase): """ OffsetCommitContext tests. """ def setUp(self): self...
apache-2.0
chand3040/sree_odoo
openerp/addons/l10n_fr_rib/__openerp__.py
425
2754
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011 Numérigraphe SARL. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero Genera...
agpl-3.0
makmanalp/ansible-modules-extras
database/postgresql/postgresql_ext.py
81
5801
#!/usr/bin/python # -*- coding: utf-8 -*- # 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 later version. #...
gpl-3.0
seem-sky/kbengine
kbe/src/lib/python/Lib/encodings/gb2312.py
816
1027
# # gb2312.py: Python Unicode Codec for GB2312 # # Written by Hye-Shik Chang <perky@FreeBSD.org> # import _codecs_cn, codecs import _multibytecodec as mbc codec = _codecs_cn.getcodec('gb2312') class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class IncrementalEncoder(mbc.MultibyteIncrem...
lgpl-3.0