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
penguinscontrol/Spinal-Cord-Modeling
ClarkesNetwork/test2_dend.py
1
6524
# -*- coding: utf-8 -*- """ Created on Thu Jan 07 11:08:41 2016 @author: Radu """ import numpy import simrun import time from ballandstick_clarke_new import ClarkeRelay #from neuron import h,gui from neuron import h h.load_file('stdgui.hoc') #h.load_file("stdrun.hoc") from math import sin, cos, pi from matplotlib im...
gpl-2.0
keaneokelley/home
home/iot/nextbus.py
1
1576
import datetime import requests from flask_socketio import emit from home.core.models import get_device from home.web.utils import ws_login_required from home.web.web import socketio NEXTBUS_URL = 'http://webservices.nextbus.com/service/publicJSONFeed?a=cyride&command=predictions&stopId={}' class NextBus: def _...
mit
JeyZeta/Dangerous
Dangerous/Golismero/thirdparty_libs/django/http/response.py
98
16141
from __future__ import absolute_import, unicode_literals import datetime import time import warnings from email.header import Header try: from urllib.parse import urlparse except ImportError: from urlparse import urlparse from django.conf import settings from django.core import signals from django.core import...
mit
zhixuanc/Volcano_Plume_SPH
bin/post_show_Vz.py
1
1106
###import the simple module from the paraview from paraview.simple import * #### disable automatic camera reset on 'Show' paraview.simple._DisableFirstRenderCameraReset() total_proc=2 #Render={} #Disp={} #get active source. #ActiveReader= GetActiveSource() # get active view #renderView1 = GetActiveViewOrCreate('Rende...
gpl-3.0
kevinwilde/WildeBot
src/mybot/Lib/site-packages/pip/_vendor/ipaddress.py
170
79904
# Copyright 2007 Google Inc. # Licensed to PSF under a Contributor Agreement. """A fast, lightweight IPv4/IPv6 manipulation library in Python. This library is used to create/poke/manipulate IPv4 and IPv6 addresses and networks. """ from __future__ import unicode_literals import itertools import struct __version...
mit
jagg81/translate-toolkit
translate/convert/po2txt.py
3
4208
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2004-2006 Zuza Software Foundation # # This file is part of translate. # # translate 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...
gpl-2.0
Smiter/voodoo
voodoo/mainsite/basket/views.py
1
2735
#coding=utf-8 from cart import Cart from django.shortcuts import render_to_response from django.template import RequestContext from django.http import * from voodoo.admin_center.models import Product from voodoo.admin_center.models import Order, OrderStatus from django.utils.simplejson import dumps def add_to_cart(r...
gpl-2.0
milkpku/BetaElephant
train_policy/trainer.py
13
2636
#!/usr/bin/python3 #-*-coding:utf-8-*- #$File: trainer.py #$Date: Sat May 7 11:00:10 2016 #$Author: Like Ma <milkpku[at]gmail[dot]com> from config import Config from dataset import load_data from model import get_model import tensorflow as tf import argparse import logging def train(args): device = args.devic...
mit
aatchison/mycroft-core
mycroft/skills/container.py
1
3332
# Copyright 2017 Mycroft AI 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 writin...
apache-2.0
jmcarp/django
tests/forms_tests/tests/test_forms.py
46
148965
# -*- coding: utf-8 -*- from __future__ import unicode_literals import copy import datetime import json import uuid from django.core.exceptions import NON_FIELD_ERRORS from django.core.files.uploadedfile import SimpleUploadedFile from django.core.validators import RegexValidator from django.forms import ( Boolean...
bsd-3-clause
g-rauhoeft/scrap-cap
motioncapture/camera/Calibrator.py
1
2645
import numpy as np import cv2 from motioncapture.tracking import ObjectDetection class Calibrator: def __init__(self, gridDimensions, camera): self.gridDimensions = gridDimensions self.camera = camera self.reset() self.point = np.zeros((self.gridDimensions[0] * self.gridDimensions[1...
mit
eaplatanios/tensorflow
tensorflow/python/summary/writer/writer_test.py
18
23327
# 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
d3trax/asuswrt-merlin
release/src/router/samba-3.0.25b/source/stf/sambalib.py
55
1312
#! /usr/bin/python # Comfychair test cases for Samba string functions. # Copyright (C) 2003 by Martin Pool <mbp@samba.org> # # 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 versio...
gpl-2.0
OpenUpgrade-dev/OpenUpgrade
addons/account_analytic_analysis/__init__.py
425
1107
# -*- 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
pschmitt/home-assistant
tests/components/cloud/test_utils.py
28
1640
"""Test aiohttp request helper.""" from aiohttp import web from homeassistant.components.cloud import utils def test_serialize_text(): """Test serializing a text response.""" response = web.Response(status=201, text="Hello") assert utils.aiohttp_serialize_response(response) == { "status": 201, ...
apache-2.0
miguelparaiso/OdooAccessible
addons/account/project/project.py
273
2423
# -*- 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
mmbtba/odoo
addons/l10n_br/__init__.py
430
1403
# -*- encoding: utf-8 -*- ############################################################################### # # # Copyright (C) 2009 Renato Lima - Akretion # # ...
agpl-3.0
shiblon/pytour
tutorials/exercise_forloops1.py
1
1460
# vim:tw=50 """Exercise: For Loops (1) For loops are pretty handy and compactly defined. They fit the way that people think when they want to "do something to everything in this list". They're also good for making one list from another one. We'll do that, here. Sometimes you have a list, and you realy just want to ...
apache-2.0
jgoclawski/django
tests/template_tests/test_engine.py
199
3971
import os from django.template import Context from django.template.engine import Engine from django.test import SimpleTestCase, ignore_warnings from django.utils.deprecation import RemovedInDjango110Warning from .utils import ROOT, TEMPLATE_DIR OTHER_DIR = os.path.join(ROOT, 'other_templates') @ignore_warnings(cat...
bsd-3-clause
DazWorrall/ansible
lib/ansible/modules/network/avi/avi_cloud.py
27
9205
#!/usr/bin/python # # Created on Aug 25, 2016 # @author: Gaurav Rastogi (grastogi@avinetworks.com) # Eric Anderson (eanderson@avinetworks.com) # module_check: supported # Avi Version: 17.1.1 # # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the te...
gpl-3.0
xBoye/xHome
cipher/views.py
1
11050
# -*- coding: utf-8 -*- from django.shortcuts import render from django.http import HttpResponseRedirect from django.core.urlresolvers import reverse import sys, hashlib, random DEFAULT_BLOCK_SIZE = 128 # 128 bytes BYTE_SIZE = 256 # One byte has 256 different values. def cipher(request): """密码学""" return render(r...
gpl-3.0
iphanzeke/support-tools
wiki_to_md/impl/pragma_handler.py
126
2468
# 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 a...
apache-2.0
jenniferliddle/hydranet
test/db_test.py
1
1891
import sys sys.path.insert(0, '.') sys.path.insert(0, '..') from Hydranet.db import DB, User, Customer, Graph, Data, Sensor, Alert import ConfigParser from os.path import expanduser def openDatabase(): config = ConfigParser.ConfigParser() config.read(expanduser('~/hydranetrc')) dbname = 'Database_test' ...
gpl-3.0
likaiwalkman/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/common/net/unittestresults.py
155
2347
# Copyright (c) 2012, 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
privacyidea/privacyidea
tests/test_lib_tokens_u2f.py
1
22556
""" This test file tests the lib.tokens.u2ftoken This depends on lib.tokenclass """ from .base import MyTestCase from privacyidea.lib.tokens.u2ftoken import U2fTokenClass from privacyidea.lib.tokens.u2f import (check_registration_data, parse_registration_data, url_decode, ...
agpl-3.0
sajeeshcs/nested_quota_latest
nova/api/openstack/compute/contrib/server_password.py
10
2496
# Copyright (c) 2012 Nebula, 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
ProfessionalIT/professionalit-webiste
sdk/google_appengine/lib/django-1.3/django/contrib/localflavor/cz/forms.py
157
4929
""" Czech-specific form helpers """ from django.core.validators import EMPTY_VALUES from django.forms import ValidationError from django.forms.fields import Select, RegexField, Field from django.utils.translation import ugettext_lazy as _ import re birth_number = re.compile(r'^(?P<birth>\d{6})/?(?P<id>\d{3,4})$') ic_...
lgpl-3.0
salguarnieri/intellij-community
python/helpers/py2only/docutils/utils/error_reporting.py
104
7765
#!/usr/bin/env python # -*- coding: utf-8 -*- # :Id: $Id: error_reporting.py 7668 2013-06-04 12:46:30Z milde $ # :Copyright: © 2011 Günter Milde. # :License: Released under the terms of the `2-Clause BSD license`_, in short: # # Copying and distribution of this file, with or without modification, # are permitted...
apache-2.0
odicraig/kodi2odi
addons/plugin.video.hubmaintenance/navix.py
1
1959
import xbmc import xbmcgui import os import re import urllib2 def getPath(): path = xbmc.translatePath('special://home/addons') path = os.path.join(path, 'Navi-X') return path def installed(): return os.path.exists(getPath()) def getVersion(): path = getPath() file = os....
gpl-3.0
RvdE/pdns
regression-tests.recursor-dnssec/test_Flags.py
10
31606
import os import socket import dns from recursortests import RecursorTest class TestFlags(RecursorTest): _confdir = 'Flags' _config_template = """dnssec=%s""" _config_params = ['_dnssec_setting'] _dnssec_setting = None _recursors = {} _dnssec_setting_ports = {'off': 5300, ...
gpl-2.0
pklfz/fold
tensorflow_fold/loom/loom.py
2
47808
# Copyright 2017 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
apache-2.0
kevinwilde/WildeBot
src/mybot/Lib/site-packages/pip/_vendor/packaging/markers.py
75
7921
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function import operator import os import platform import sys from pip._vendor.pyp...
mit
nabsboss/CouchPotatoServer
couchpotato/core/providers/nzb/newznab/main.py
3
5170
from couchpotato.core.helpers.encoding import tryUrlencode from couchpotato.core.helpers.rss import RSS from couchpotato.core.helpers.variable import cleanHost, splitString, tryInt from couchpotato.core.logger import CPLog from couchpotato.core.providers.base import ResultList from couchpotato.core.providers.nzb.base i...
gpl-3.0
nhejazi/scikit-learn
sklearn/utils/tests/test_linear_assignment.py
421
1349
# Author: Brian M. Clapper, G Varoquaux # License: BSD import numpy as np # XXX we should be testing the public API here from sklearn.utils.linear_assignment_ import _hungarian def test_hungarian(): matrices = [ # Square ([[400, 150, 400], [400, 450, 600], [300, 225, 300]], ...
bsd-3-clause
undoware/neutron-drive
google_appengine/google/appengine/_internal/django/core/management/commands/reset.py
23
2408
from optparse import make_option from google.appengine._internal.django.conf import settings from google.appengine._internal.django.core.management.base import AppCommand, CommandError from google.appengine._internal.django.core.management.color import no_style from google.appengine._internal.django.core.management.sq...
bsd-3-clause
telefonicaid/fiware-cosmos-ambari
ambari-client/src/main/python/ambari_client/resources/hosts.py
1
3840
# # 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 m...
apache-2.0
sikmir/QGIS
tests/src/python/test_qgsserver_wms_getlegendgraphic.py
3
31514
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsServer WMS GetLegendGraphic. From build dir, run: ctest -R PyQgsServerWMSGetLegendGraphic -V .. 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 Foundati...
gpl-2.0
savoirfairelinux/OpenUpgrade
addons/product/__openerp__.py
26
2594
# -*- 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
EsriOceans/marine-threats
code/threat_model_arcgis.py
1
9002
#!/usr/bin/python """ Threat Matrix Model Original Author: Matthew Perry and Shaun Walbirdge ArcGIS port: Shaun Walbridge python $PROJECT_DIR/code/threats/threat_model_arcgis.py $PROJECT_DIR/data/matrices/generated/all_med_annual_sst.csv model_all_med_annual_sst """ # ArcGIS implementation import arcpy from...
apache-2.0
orsenthil/coursedocs
gatech/cs8803-O01/multivariate_kalman_filter.py
1
6004
# Write a function 'kalman_filter' that implements a multi- # dimensional Kalman Filter for the example given from math import * class matrix: # implements basic operations of a matrix class def __init__(self, value): self.value = value self.dimx = len(value) self.dimy = len(value[0...
apache-2.0
hfp/tensorflow-xsmm
tensorflow/python/training/checkpointable/util_with_v1_optimizers_test.py
1
41930
# 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
yelongyu/chihu
venv/lib/python2.7/site-packages/flask/debughelpers.py
777
3508
# -*- coding: utf-8 -*- """ flask.debughelpers ~~~~~~~~~~~~~~~~~~ Various helpers to make the development experience better. :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ from ._compat import implements_to_string class UnexpectedUnicodeError(AssertionEr...
gpl-3.0
marratj/ansible
test/runner/lib/executor.py
16
43616
"""Execute Ansible tests.""" from __future__ import absolute_import, print_function import json import os import collections import datetime import re import tempfile import time import textwrap import functools import shutil import stat import random import string import atexit import hashlib import lib.pytar impor...
gpl-3.0
bubbalinear/smartmeshsdk
dustUI/dustFrameSensorData.py
2
4088
#!/usr/bin/python #============================ adjust path ===================================== import sys import os if __name__ == '__main__': here = sys.path[0] sys.path.insert(0, os.path.join(here, '..')) #============================ imports ========================================= import...
bsd-3-clause
andreshp/Algoritmica
Practica4/Code/Algorithms/fourth_algorithm.py
1
1739
#!/usr/bin/python import sys from time import time # Parametros: # - k : indice del trabajo a asignar. # - tiempos : vector con los tiempos de los m trabajos. # - solucion_actual : vector con el tiempo de trabajo # asignado a cada maquina. # - max_tiempo : Maximo de solucion_actual # - maquina...
gpl-2.0
praekelt/ummeli
ummeli/base/migrations/0025_auto__add_field_userban_is_unbanned.py
1
23640
# encoding: 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 field 'UserBan.is_unbanned' db.add_column('base_userban', 'is_unbanned', self.gf('django.db.model...
bsd-3-clause
odubno/microblog
venv/lib/python2.7/site-packages/pbr/extra_files.py
145
1096
# Copyright (c) 2013 Hewlett-Packard Development Company, L.P. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
bsd-3-clause
newerthcom/savagerebirth
libs/python-2.72/Lib/test/test_kqueue.py
52
6949
""" Tests for kqueue wrapper. """ import socket import errno import time import select import sys import unittest from test import test_support if not hasattr(select, "kqueue"): raise unittest.SkipTest("test works only on BSD") class TestKQueue(unittest.TestCase): def test_create_queue(self): kq = sel...
gpl-2.0
genialis/resolwe-bio
resolwe_bio/tests/processes/test_import.py
1
6014
import os from resolwe.flow.models import Data, Secret from resolwe.test import tag_process from resolwe_bio.utils.test import BioProcessTestCase class ImportProcessorTestCase(BioProcessTestCase): @tag_process("import-sra", "import-sra-single", "import-sra-paired") def external_test_sra(self): # sin...
apache-2.0
dongjoon-hyun/tensorflow
tensorflow/python/keras/optimizer_v2/gradient_descent_test.py
2
12387
# 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
dscorbett/pygments
pygments/lexers/usd.py
4
3487
# -*- coding: utf-8 -*- """ pygments.lexers.usd ~~~~~~~~~~~~~~~~~~~ The module that parses Pixar's Universal Scene Description file format. :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.lexer import RegexLexer, bygroup...
bsd-2-clause
dasbruns/PrismaIO
CopyRule.py
1
2003
#!/usr/bin/env python from .Rule import Rule class CopyRule(Rule): def __init__(self, hist, ruleHist, srcID, srcField, dstID, dstField, typ, ptype, content): Rule.__init__(self, hist, ruleHist, srcID, srcField, dstID, dstField) self.typ = typ self.ptype = ptype if 'Comp' in self.t...
gpl-2.0
t0mk/ansible
test/units/errors/test_errors.py
60
4290
# (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
sushramesh/lwc
lib/python2.7/site-packages/django/core/mail/message.py
82
16647
from __future__ import unicode_literals import mimetypes import os import random import sys import time from email import ( charset as Charset, encoders as Encoders, generator, message_from_string, ) from email.header import Header from email.message import Message from email.mime.base import MIMEBase from email.m...
mit
nzinfo/mmseg
script/char_table_build.py
8
4727
#/usr/bin/python # -*- coding: utf-8 -*- import sys import unicodedata import re import codecs import os # tag set #tag-set: #m: number #e: non CJK char, e.g. English pinyin #[unuse] t: time. 年号 干支等(此处识别出后,仅加入 oov ,不参与实际分词) #c: CJK char. #s: Symbol e.g. @ #w: Sentence seperator. #x: unknown char. ...
gpl-2.0
cruzegoodin/TSC-ShippingDetails
venv/lib/python2.7/site-packages/pip/_vendor/colorama/ansi.py
442
2304
# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. ''' This module generates ANSI character codes to printing colors to terminals. See: http://en.wikipedia.org/wiki/ANSI_escape_code ''' CSI = '\033[' OSC = '\033]' BEL = '\007' def code_to_chars(code): return CSI + str(code) + 'm' class ...
bsd-3-clause
jfhumann/servo
tests/wpt/css-tests/tools/wptserve/wptserve/ranges.py
329
3003
from utils import HTTPException class RangeParser(object): def __call__(self, header, file_size): prefix = "bytes=" if not header.startswith(prefix): raise HTTPException(416, message="Unrecognised range type %s" % (header,)) parts = header[len(prefix):].split(",") rang...
mpl-2.0
tsl143/addons-server
src/olympia/amo/tests/test_models.py
1
5773
import mock import pytest from mock import Mock from olympia import amo from olympia.amo import models as amo_models from olympia.amo.tests import TestCase from olympia.amo import models as context from olympia.addons.models import Addon from olympia.users.models import UserProfile pytestmark = pytest.mark.django_db...
bsd-3-clause
xxshutong/openerp-7.0
openerp/addons/document_webdav/webdav_server.py
15
24472
# -*- encoding: utf-8 -*- ############################################################################9 # # Copyright P. Christeas <p_christ@hol.gr> 2008-2010 # Copyright OpenERP SA, 2010 (http://www.openerp.com ) # # Disclaimer: Many of the functions below borrow code from the # python-webdav library (http://code.go...
agpl-3.0
belleten/projecte_final
client.py
2
2903
""" NFCBeer Usage: nfcbeer.py client <id> nfcbeer.py server nfcbeer.py [-h | --help] Options: -h --help Shows help """ from docopt import docopt import time import RPi.GPIO as GPIO import random import MFRC522 import sys import zmq context = zmq.Context() sock = context.socket(zmq.REQ) sock...
gpl-3.0
turnkeylinux/tklbam-duplicity
duplicity/urlparse_2_5.py
8
12539
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- """Parse (absolute and relative) URLs. See RFC 1808: "Relative Uniform Resource Locators", by R. Fielding, UC Irvine, June 1995. """ __all__ = ["urlparse", "urlunparse", "urljoin", "urldefrag", "urlsplit", "urlunsplit"] # A classification of scheme...
gpl-2.0
mirzawaqasahmed/avocado-vt
virttest/libvirt_xml/nwfilter_protocols/all_ipv6.py
26
5861
""" all-ipv6 protocl support class(es) http://libvirt.org/formatnwfilter.html#nwfelemsRulesProtoMiscv6 """ from virttest.libvirt_xml import accessors, xcepts from virttest.libvirt_xml.nwfilter_protocols import base class All_ipv6(base.TypedDeviceBase): """ Create new All_ipv6 xml instances Properties:...
gpl-2.0
onecloud/neutron
neutron/tests/unit/test_linux_daemon.py
11
7624
# # Copyright 2012 New Dream Network, LLC (DreamHost) # # 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...
apache-2.0
mpharrigan/msmbuilder
tests/test_tpt.py
2
5760
from __future__ import print_function from __future__ import division from __future__ import absolute_import import sys import os import numpy as np import numpy.testing as npt import scipy.sparse import scipy.io from mdtraj import io from msmbuilder import tpt from msmbuilder.scripts import FindPaths from msmbuilder...
gpl-2.0
petry/django-pressroom-googlecode
src/pressroom/migrations/0002_add_enable_comments.py
2
2788
from south.db import db from django.db import models from pressroom.models import * class Migration: def forwards(self, orm): # Adding field 'Article.enable_comments' db.add_column('pressroom_article', 'enable_comments', models.BooleanField(default=True)) def b...
bsd-3-clause
suyashphadtare/sajil-frappe
frappe/model/db_schema.py
15
12290
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals """ Syncs a database table to the `DocType` (metadata) .. note:: This module is only used internally """ import os import frappe from frappe import _ from frappe.utils import...
mit
ANR-DIADEMS/timeside-diadems
timeside/plugins/diadems/irit_noise_startSilences.py
1
7140
# -*- coding: utf-8 -*- # # Copyright (c) 2013-2014 Maxime Le Coz <lecoz@irit.fr> # This file is part of TimeSide. # TimeSide 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, ...
gpl-2.0
MyAOSP/external_chromium_org_third_party_skia
tools/svndiff.py
113
13567
#!/usr/bin/python ''' Copyright 2012 Google Inc. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. ''' ''' Generates a visual diff of all pending changes in the local SVN (or git!) checkout. Launch with --help to see more information. TODO(epoger): Now that this tool ...
bsd-3-clause
YYMo/sdn_project
pox/lib/threadpool.py
46
2860
# Copyright 2012 James McCauley # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writi...
apache-2.0
rbuffat/pyidf
tests/test_thermostatsetpointsingleheating.py
1
1330
import os import tempfile import unittest import logging from pyidf import ValidationLevel import pyidf from pyidf.idf import IDF from pyidf.zone_hvac_controls_and_thermostats import ThermostatSetpointSingleHeating log = logging.getLogger(__name__) class TestThermostatSetpointSingleHeating(unittest.TestCase): de...
apache-2.0
homeworkprod/better-bomb-defusal-manual
bombdefusalmanual/subjects/keypads.py
1
6469
# -*- coding: utf-8 -*- """ On the Subject of Keypads :Copyright: 2015 Jochen Kupperschmidt :License: MIT, see LICENSE for details. """ from collections import Counter from itertools import chain, zip_longest from tkinter import ttk from tkinter import E, N, S, W COPYRIGHT_SIGN = ...
mit
kalxas/QGIS
python/plugins/processing/algs/gdal/viewshed.py
15
7223
# -*- coding: utf-8 -*- """ *************************************************************************** viewshed.py --------------------- Date : October 2019 Copyright : (C) 2019 by Alexander Bruy Email : alexander dot bruy at gmail dot com ****************...
gpl-2.0
Rav3nPL/PLNcoin
qa/rpc-tests/preciousblock.py
42
5059
#!/usr/bin/env python3 # Copyright (c) 2015-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Test PreciousBlock code # from test_framework.test_framework import BitcoinTestFramework from test_f...
mit
seryl/Nodetraq
nodetraq/controllers/users.py
1
17718
import logging import re import json from pylons import request, response, session, tmpl_context as c, url from pylons.controllers.util import abort, redirect from pylons.decorators import jsonify from nodetraq.model.meta import Session from nodetraq.lib.base import BaseController, render, user_level from nodetraq.l...
mit
Badadroid/android_kernel_samsung_wave
tools/perf/scripts/python/netdev-times.py
11271
15048
# Display a process of packets and processed time. # It helps us to investigate networking or network device. # # options # tx: show only tx chart # rx: show only rx chart # dev=: show only thing related to specified device # debug: work with debug mode. It shows buffer status. import os import sys sys.path.append(os...
gpl-2.0
inflector/opencog
opencog/python/pln_old/agents.py
32
7642
from opencog.cogserver import MindAgent from opencog.atomspace import types from pln.chainers import Chainer from pln.rules import * class InferenceAgent(MindAgent): def __init__(self): self.chainer = None self.num_steps_per_cycle = 100 def create_chainer(self, atomspace): # Note: usi...
agpl-3.0
cloudera/hue
desktop/core/ext-py/urllib3-1.25.8/src/urllib3/connection.py
10
14026
from __future__ import absolute_import import datetime import logging import os import socket from socket import error as SocketError, timeout as SocketTimeout import warnings from .packages import six from .packages.six.moves.http_client import HTTPConnection as _HTTPConnection from .packages.six.moves.http_client imp...
apache-2.0
cworth-gh/stony
plugins/one_two_three/one_two_three.py
1
8742
### # Imports ### from __future__ import unicode_literals from slackclient import SlackClient import yaml ### # Classes ### class Command: def __init__(self, name, function, num_args=0): self.name = name self.function = function self.num_args = num_args class Player: def __init__(se...
mit
nmarley/dash
share/rpcuser/rpcuser.py
4
1108
#!/usr/bin/env python3 # 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. import hashlib import sys import os from random import SystemRandom import base64 import hmac if len(sys.arg...
mit
KupHackathon/vinge
lib/flask/json.py
348
7530
# -*- coding: utf-8 -*- """ flask.jsonimpl ~~~~~~~~~~~~~~ Implementation helpers for the JSON support in Flask. :copyright: (c) 2012 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import io import uuid from datetime import datetime from .globals import current_app, request fro...
gpl-2.0
XiaodunServerGroup/xiaodun-platform
cms/djangoapps/contentstore/views/tests/test_tabs.py
15
1770
""" Tests for tab functions (just primitive). """ from contentstore.views import tabs from django.test import TestCase from xmodule.modulestore.tests.factories import CourseFactory from courseware.courses import get_course_by_id class PrimitiveTabEdit(TestCase): """Tests for the primitive tab edit data manipulat...
agpl-3.0
lgbouma/astrobase
astrobase/hatsurveys/k2hat.py
1
25449
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # k2hat.py - Waqas Bhatti (wbhatti@astro.princeton.edu) - 07/15 # License: MIT. See the LICENCE file for license text. ''' This contains functions for reading K2 CSV light-curves produced by the HAT Project into a Python dictionary. Requires numpy. The only external func...
mit
jamesc/structures
ds/heap.py
1
3929
# # Copyrigh Platform14, 2010. # # 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 (...
apache-2.0
elbeanio/contented
contented/app.py
1
2297
from __future__ import absolute_import from werkzeug.wrappers import Request from werkzeug.exceptions import NotFound from .settings import get_settings from .content_map import ContentMap class Application(object): """ The main WSGI application, __init__ runs on app start so we do everything here that does...
mit
asdacap/iiumschedule
server/lib/werkzeug/contrib/limiter.py
319
1333
# -*- coding: utf-8 -*- """ werkzeug.contrib.limiter ~~~~~~~~~~~~~~~~~~~~~~~~ A middleware that limits incoming data. This works around problems with Trac_ or Django_ because those directly stream into the memory. .. _Trac: http://trac.edgewall.org/ .. _Django: http://www.djangoproject.com/ ...
gpl-3.0
agincel/AdamTestBot
future/backports/email/mime/audio.py
2
2889
# Copyright (C) 2001-2007 Python Software Foundation # Author: Anthony Baxter # Contact: email-sig@python.org """Class representing audio/* type MIME documents.""" from __future__ import unicode_literals from __future__ import division from __future__ import absolute_import __all__ = ['MIMEAudio'] import ...
mit
porcobosso/spark-ec2
lib/boto-2.34.0/boto/support/layer1.py
151
29434
# Copyright (c) 2014 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 ...
apache-2.0
w1ll1am23/home-assistant
tests/components/config/test_automation.py
5
5052
"""Test Automation config panel.""" import json from unittest.mock import patch from homeassistant.bootstrap import async_setup_component from homeassistant.components import config from homeassistant.helpers import entity_registry as er from tests.components.blueprint.conftest import stub_blueprint_populate # noqa:...
apache-2.0
flwh/KK_mt6589_iq451
prebuilts/python/darwin-x86/2.7.5/lib/python2.7/lib-tk/Canvas.py
187
7463
# This module exports classes for the various canvas item types # NOTE: This module was an experiment and is now obsolete. # It's best to use the Tkinter.Canvas class directly. from warnings import warnpy3k warnpy3k("the Canvas module has been removed in Python 3.0", stacklevel=2) del warnpy3k from Tkinter import Ca...
gpl-2.0
SaikWolf/gnuradio
gr-uhd/examples/python/usrp_tv_rcv_nogui.py
2
9333
#!/usr/bin/env python # # Copyright 2005-2007,2011,2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at ...
gpl-3.0
lissyx/build-mozharness
mozprocess/qijo.py
26
5285
# 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/. from ctypes import c_void_p, POINTER, sizeof, Structure, windll, WinError, WINFUNCTYPE, addressof, c_size_t, c_ulong fro...
mpl-2.0
dgwakeman/mne-python
mne/realtime/epochs.py
2
16811
# Authors: Christoph Dinh <chdinh@nmr.mgh.harvard.edu> # Martin Luessi <mluessi@nmr.mgh.harvard.edu> # Matti Hamalainen <msh@nmr.mgh.harvard.edu> # Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # Denis Engemann <denis.engemann@gmail.com> # # License: BSD (3-clause) imp...
bsd-3-clause
gcd0318/django
django/utils/timezone.py
338
11027
""" Timezone-related classes and functions. This module uses pytz when it's available and fallbacks when it isn't. """ import sys import time as _time from datetime import datetime, timedelta, tzinfo from threading import local from django.conf import settings from django.utils import lru_cache, six from django.util...
bsd-3-clause
lightningkay/NoahGameFrame
Dependencies/googletest-release-1.8.0/googletest/scripts/fuse_gtest_files.py
346
8884
#!/usr/bin/env python # # Copyright 2009, 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...
apache-2.0
KanoComputing/kano-burners
src/osx/disk.py
2
4204
#!/usr/bin/env python # disk.py # # Copyright (C) 2014,2015 Kano Computing Ltd. # License: http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License v2 # # # OSX - Disk related operations # # There are two main operations here. # # 1. Providing a list of disks Kano OS can be burned to. We will exclude # an...
gpl-2.0
guorendong/iridium-browser-ubuntu
chrome/test/chromedriver/server/server.py
121
2131
# 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 atexit import os import socket import subprocess import time import urllib2 class Server(object): """A running ChromeDriver server.""" def __in...
bsd-3-clause
atsuyim/uBlock
tools/make-firefox-meta.py
15
3386
#!/usr/bin/env python3 import os import json import sys from io import open from shutil import rmtree from collections import OrderedDict if len(sys.argv) == 1 or not sys.argv[1]: raise SystemExit('Build dir missing.') def mkdirs(path): try: os.makedirs(path) finally: return os.path.exis...
gpl-3.0
magyarm/periphondemand-code
src/bin/define.py
1
1265
""" Peripheral On Demand global define """ import periphondemand #global POD_CONFIG="~/.podrc" POD_PATH = periphondemand.__path__[0] PLATFORMPATH = "/platforms" BUSPATH = "/busses/" TEMPLATESPATH = "/templates" TOOLCHAINPATH = "/toolchains" SIMULATIONPATH = "/simulation" SYNTHESISPATH = "/synthesis" DRIVERSPATH = "/...
lgpl-2.1
odubno/microblog
venv/lib/python2.7/site-packages/pbr/hooks/commands.py
12
2391
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2013 Hewlett-Packard Development Company, L.P. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://...
bsd-3-clause
SpaceGroupUCL/qgisSpaceSyntaxToolkit
esstoolkit/external/pyqtgraph/imageview/ImageViewTemplate_pyqt5.py
3
8280
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file './pyqtgraph/imageview/ImageViewTemplate.ui' # # Created: Wed Mar 26 15:09:28 2014 # by: PyQt5 UI code generator 5.0.1 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_Form(ob...
gpl-3.0