code
stringlengths
3
1.05M
repo_name
stringlengths
5
104
path
stringlengths
4
251
language
stringclasses
1 value
license
stringclasses
15 values
size
int64
3
1.05M
#!/usr/bin/env python # -*- coding: utf-8 -*- """ ################################################################################ # # # tmux-control # # ...
wdbm/tmux-control
tmux-control.py
Python
gpl-3.0
26,871
# Staging environment settings for us_ignite import datetime import os import urlparse from us_ignite.settings.base import * DEBUG = True TEMPLATE_DEBUG = DEBUG # Sensitive values are saved as env variables: env = os.getenv PROJECT_ROOT = os.path.dirname(os.path.realpath(__file__)) # settings is one directory up now...
us-ignite/us_ignite
us_ignite/settings/staging.py
Python
bsd-3-clause
2,837
#!/usr/bin/env python # # Copyright 2009 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 your option) ...
GREO/GNU-Radio
gnuradio-core/src/python/gnuradio/blks2impl/pfb_decimator.py
Python
gpl-3.0
1,791
# -*- coding: utf-8 -*- class Solution: # @param dungeon, a list of lists of integers # @return a integer def calculateMinimumHP(self, map): dp = [ [0]*len(map[0]) for _ in xrange(len(map))] pre = [ [0]*len(map[0]) for _ in xrange(len(map))] def get(init): dp[0][0] = init+map[0][0] ...
atupal/oj
leetcode/174_hard_dungeon-game.py
Python
mit
1,426
########################################################################## # # Copyright (c) 2014, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistrib...
goddardl/gaffer
python/GafferUI/DotUI.py
Python
bsd-3-clause
4,789
{ 'name': 'To-Do Website', 'description': 'Manage your personal To-Do tasks.', 'author': 'Daniel Reis', 'depends': ['todo_stage', 'website_form'], 'data': [ 'views/todo_web.xml', 'views/todo_extend.xml', 'data/config_data.xml', ], }
dreispt/todo_app
todo_website/__manifest__.py
Python
agpl-3.0
281
from BaseController import BaseController import tornado.ioloop import tornado.web import dateutil.parser import datetime class TopCommandsController(BaseController): def get(self): return_data = dict(data=[], timestamp=datetime.datetime.now().isoformat()) server = sel...
udomsak/RedisLive
src/api/controller/TopCommandsController.py
Python
mit
971
# -*- coding: utf-8 -*- # # Copyright (C) 2007-2009 Andrew Resch <andrewresch@gmail.com> # # This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with # the additional special exception to link portions of this program with the OpenSSL library. # See LICENSE for more details. # # ...
Arzie/deluge
deluge/ui/gtkui/gtkui.py
Python
gpl-3.0
18,283
# coding: utf-8 import base64 import datetime import logging import time from hashlib import sha1 from pprint import pformat from unicodedata import normalize import requests from lxml import etree, objectify from werkzeug import urls, url_encode from odoo import api, fields, models, _ from odoo.addons.payment.models...
maxive/erp
addons/payment_ogone/models/payment.py
Python
agpl-3.0
25,633
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
apache/incubator-airflow
tests/providers/google/cloud/transfers/test_presto_to_gcs.py
Python
apache-2.0
12,057
# This file is part of BurnMan - a thermoelastic and thermodynamic toolkit for the Earth and Planetary Sciences # Copyright (C) 2012 - 2017 by the BurnMan team, released under the GNU # GPL v2 or later. from __future__ import absolute_import import warnings import numpy as np from . import equation_of_state as eos ...
sannecottaar/burnman
burnman/eos/modified_tait.py
Python
gpl-2.0
7,218
"""Test that anonymous structs/unions are transparent to member access""" import lldb from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil class AnonymousTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) @skipIf( compiler="ic...
endlessm/chromium-browser
third_party/llvm/lldb/test/API/lang/c/anonymous/TestAnonymous.py
Python
bsd-3-clause
6,073
#!/usr/bin/env python """ Part 3, doaj ============ We repeat the same steps for DOAJ. ---- To run: (vm) $ python scaffold3_doaj.py To clean output: (vm) $ make clean-3 """ from __future__ import print_function import os import luigi from gluish.task import BaseTask from gluish.utils import shellout ...
miku/siskin
docs/elag-2016/byoi/code/scaffold3_doaj.py
Python
gpl-3.0
1,281
import numpy as np import matplotlib.pyplot as plt import time from pylab import * from astropy import constants as cs from scipy import integrate UA=1.49597860*10**13 ##Pregunta 1 #Guardammos los datos según columna en variables longitud= np.loadtxt('sun_AM0.dat', usecols = [0]) flujo= np.loadtxt('sun_AM0.dat', usec...
alvarocesped/01Tarea
Tarea1.py
Python
mit
2,964
from django import forms from django.forms.util import flatatt from django.utils.encoding import smart_unicode from django.utils.html import escape from django.utils.safestring import mark_safe from django.utils.translation import ugettext as _ # From http://www.djangosnippets.org/snippets/200/ # widget for select wit...
polinom/djangopeople
djangopeople/djangopeople/groupedselect.py
Python
mit
3,218
#!/usr/bin/env python # Copyright (C) 2017 Daniel Asarnow # University of California, San Francisco # # Generate subparticles for "local reconstruction" methods. # See help text and README file for more information. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
asarnow/pyem
subparticles.py
Python
gpl-3.0
9,149
# -*- coding: utf-8 -*- """ Created on Wed Nov 16 11:44:25 2016 @author: steven """ import numpy as npy import math import scipy.linalg as linalg def CrossProductMatrix(u): L=npy.array([[0,-u[2],u[1]],[u[2],0,-u[0]],[-u[1],u[0],0]]) return L def Euler2TransferMatrix(psi,theta,phi): """ Give Trans...
masfaraud/genmechanics
genmechanics/geometry.py
Python
gpl-3.0
1,524
class Solution: # @param {integer} n # @return {boolean} def isHappy(self, n): nums = [] while n not in nums: nums.append(n) next_n = sum([int(d)*int(d) for d in str(n)]) if next_n == 1: return True n = next_n return Fal...
lutianming/leetcode
happy_number.py
Python
mit
323
from plotly.basedatatypes import BaseLayoutHierarchyType as _BaseLayoutHierarchyType import copy as _copy class Domain(_BaseLayoutHierarchyType): # class properties # -------------------- _parent_path_str = "layout.scene" _path_str = "layout.scene.domain" _valid_props = {"column", "row", "x", "y"...
plotly/python-api
packages/python/plotly/plotly/graph_objs/layout/scene/_domain.py
Python
mit
5,784
import pytest import numpy as np from instrument_models.mastcam import Mastcam from . import mastcam_label1, mastcam_label2, EMPTY_LABEL class TestMastcam(object): mastcam1 = Mastcam(mastcam_label1) mastcam2 = Mastcam(mastcam_label2) empty = Mastcam(EMPTY_LABEL) def test_group(self): asser...
planetarypy/pdsspect
tests/test_mastcam.py
Python
bsd-3-clause
954
# (c) Copyright 2015 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 re...
openstack/os-brick
os_brick/tests/test_utils.py
Python
apache-2.0
11,110
# 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. """TestEnvironment classes. These classes abstract away the various setups needed to run the WebDriver java tests in various environments. """ import loggi...
endlessm/chromium-browser
chrome/test/chromedriver/test/test_environment.py
Python
bsd-3-clause
3,734
from os.path import join from sys import exit from ..utils.text import mark_for_translation as _, red from ..utils.ui import io OPERATIONS = ( 'bytes', 'decrypt', 'encrypt', 'human', 'password', ) def get_operation(args): opcount = 0 selected_op = None for op in OPERATIONS: ...
bundlewrap/bundlewrap
bundlewrap/cmdline/pw.py
Python
gpl-3.0
2,296
''' Copyright (C) 2013 Travis DeWolf This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope t...
studywolf/blog
InvKin/Arm.py
Python
gpl-3.0
7,959
#!/usr/bin/env python # -*- coding: utf8 -*- # ***************************************************************** # ** PTS -- Python Toolkit for working with SKIRT ** # ** © Astronomical Observatory, Ghent University ** # ***************************************************************** ##...
SKIRT/PTS
do/magic/soften.py
Python
agpl-3.0
1,722
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2013 Radim Rehurek <radimrehurek@seznam.cz> # Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html """This module contains classes for analyzing the texts of a corpus to accumulate statistical information about word occurrences.""" im...
RaRe-Technologies/gensim
gensim/topic_coherence/text_analysis.py
Python
lgpl-2.1
24,505
default_app_config = 'django.contrib.contenttypes.apps.ContentTypesConfig'
diego-d5000/MisValesMd
env/lib/python2.7/site-packages/django/contrib/contenttypes/__init__.py
Python
mit
76
import tempfile import unittest from collections import namedtuple import six from conans.client.rest.file_uploader import FileUploader from conans.errors import AuthenticationException, ForbiddenException, InternalErrorException from conans.test.utils.mocks import TestBufferConanOutput from conans.util.files import ...
conan-io/conan
conans/test/unittests/client/rest/uploader_test.py
Python
mit
2,508
from a10sdk.common.A10BaseClass import A10BaseClass class Udp(A10BaseClass): """Class Description:: Set UDP STUN timeout. Class udp supports CRUD Operations and inherits from `common/A10BaseClass`. This class is the `"PARENT"` class for this module.` :param port_start: {"description": "Port...
amwelch/a10sdk-python
a10sdk/core/cgnv6/cgnv6_lsn_stun_timeout_udp.py
Python
apache-2.0
1,644
import os import unittest from application import create_app config_name = 'development' app = create_app(config_name) @app.cli.command() def test(): tests = unittest.TestLoader().discover('tests') unittest.TextTestRunner(verbosity=2).run(tests) if __name__ == '__main__': app.run()
mrpoor/heart_telehealth
run.py
Python
mit
300
#!/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 # ...
mbroadst/debian-qpid-python
qpid/reference.py
Python
apache-2.0
2,955
"""FimPolicy and FimBaseline classes""" import cloudpassage.sanity as sanity from .halo_endpoint import HaloEndpoint from .http_helper import HttpHelper class FimPolicy(HaloEndpoint): """FimPolicy class: The list_all() method allows filtering of results with keyword arguments. An exhaustive list of keyw...
cloudpassage/cloudpassage-halo-python-sdk
cloudpassage/fim_policy.py
Python
bsd-3-clause
5,464
__author__ = 'anthony <>' from collections import OrderedDict from django import forms class FormOrderMixin(object): def order_fields(self, field_order): """ Rearranges the fields according to field_order. field_order is a list of field names specifying the order. Fields not inclu...
unicefuganda/uSurvey
survey/forms/form_helper.py
Python
bsd-3-clause
1,258
#!/usr/bin/env python # -*- coding: utf-8 -*- import unittest class PyDashingUt(unittest.TestCase): def test_basic(self): print "Basic test"
bdastur/utils
testdash/tests/pydashingut.py
Python
apache-2.0
166
# -*- coding: utf-8 -*- from __future__ import print_function # # 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. # # Thi...
virt-who/virt-who
tests/test_config_section_global.py
Python
gpl-2.0
6,223
#---------------------------------------------------------------------- # This file was generated by D:\personal\src\airs\gui\images\anim\make_images.py # from wx import ImageFromStream, BitmapFromImage, EmptyIcon import cStringIO, zlib def getData(): return zlib.decompress( 'x\xda\x01\x9f\x03`\xfc\x89PN...
jorgb/airs
gui/images/anim/progress_1_04.py
Python
gpl-2.0
3,301
from django.contrib import admin class DvdCategoryAdmin(admin.ModelAdmin): pass class DvdAdmin(admin.ModelAdmin): pass class UserDvdAdmin(admin.ModelAdmin): def get_queryset(self, request): """ Show only current user's objects. """ qs = super(UserDvdAdmin, self).get_qu...
barszczmm/django-wpadmin
test_project/apps/dvds/admin.py
Python
mit
382
# -*- coding: utf-8 -*- """This file is part of the TPOT library. TPOT was primarily developed at the University of Pennsylvania by: - Randal S. Olson (rso@randalolson.com) - Weixuan Fu (weixuanf@upenn.edu) - Daniel Angell (dpa34@drexel.edu) - and many more generous open source contributors TPOT is f...
weixuanfu2016/tpot
tpot/config/regressor.py
Python
lgpl-3.0
5,792
"""Define tests for the GeoNet NZ Quakes general setup.""" from unittest.mock import patch from homeassistant.components.geonetnz_quakes import DOMAIN, FEED async def test_component_unload_config_entry(hass, config_entry): """Test that loading and unloading of a config entry works.""" config_entry.add_to_has...
jawilson/home-assistant
tests/components/geonetnz_quakes/test_init.py
Python
apache-2.0
953
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
lmazuel/azure-sdk-for-python
azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/upgrade_policy_py3.py
Python
mit
2,176
# disable missing docstring #pylint: disable=C0111 from lettuce import world from nose.tools import assert_equal from terrain.steps import reload_the_page @world.absorb def create_component_instance(step, component_button_css, category, expected_css, boilerplate=None, ...
rationalAgent/edx-platform-custom
cms/djangoapps/contentstore/features/component_settings_editor_helpers.py
Python
agpl-3.0
3,516
import zstackwoodpecker.test_state as ts_header import os TestAction = ts_header.TestAction def path(): return dict(initial_formation="template5", checking_point=1, faild_point=100000, path_list=[ [TestAction.create_mini_vm, 'vm1', 'cluster=cluster2'], [TestAction.destroy_vm, 'vm1'], [TestAction.create_mini_...
zstackio/zstack-woodpecker
integrationtest/vm/mini/multiclusters/paths/multi_path110.py
Python
apache-2.0
2,543
#! /usr/bin/python # -*- coding: utf8 -*- import numpy as np import tensorflow as tf import tensorlayer as tl from tensorlayer.layers import set_keep import time """Examples of Stacked Denoising Autoencoder, Dropout, Dropconnect and CNN. This tutorial uses placeholder to control all keeping probabilities, so we need...
emperrors/fetchLinuxIDC
tensor_layer/tutorial_mnist.py
Python
gpl-3.0
27,007
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2002-2006 Donald N. Allingham # # 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 you...
Forage/Gramps
gramps/gen/filters/rules/note/_noteprivate.py
Python
gpl-2.0
1,631
#------------------------------------------------------------------------------- # py3compat.py # # Some Python2&3 compatibility code #------------------------------------------------------------------------------- import sys PY3 = sys.version_info[0] == 3 try: from collections.abc import MutableMapping # python ...
pombredanne/pyelftools
elftools/construct/lib/py3compat.py
Python
unlicense
1,578
#!/usr/bin/env python """limiter.py Provides checking if something was called multiple times in a given timeframe. Usage: -h, --help -q, --quiet -f, --file -m, --max -t, --nseconds [-l, --logfile] Example: ./limiter.py -f /tmp/limit -l /tmp/limit.log -m 1 -t 10 -q "Comment" && echo "OK" Co...
zarath/python-utils
limiter.py
Python
lgpl-3.0
5,293
# -*- coding: utf-8 -*- import sys sys.path[0:0] = [""] import bson import os import pickle import unittest import uuid from datetime import datetime from bson import DBRef from tests.fixtures import (PickleEmbedded, PickleTest, PickleSignalsTest, PickleDyanmicEmbedded, PickleDynamicTest) ...
Multiposting/mongoengine
tests/document/instance.py
Python
mit
78,838
import numpy as np import mathpy.numtheory.primes from mathpy.numtheory import integers def test_numbertests(): a = 13 b = 20 np.testing.assert_equal(integers.iscomposite(a), False) np.testing.assert_equal(integers.iscomposite(b), True) np.testing.assert_equal(integers.isodd(a)...
aschleg/mathpy
mathpy/numtheory/tests/test_integers.py
Python
mit
735
# Copyright (c) 2016-2017, troposphere project # All rights reserved. # # See LICENSE file for full license. from . import AWSObject, AWSProperty from .validators import boolean, integer, positive_integer def processor_type_validator(x): valid_types = ["Lambda"] if x not in valid_types: raise ValueEr...
ikben/troposphere
troposphere/firehose.py
Python
bsd-2-clause
9,684
#!/usr/bin/env python # -*- coding: utf-8 -*- from os import system, environ try: from setuptools import setup except ImportError: from distutils.core import setup with open('README.rst', 'r') as f: readme = f.read() if system('curl --version | grep NSS 2>/dev/null') != 0: environ['PYCURL_SSL_LIBRARY'...
lpramuk/automation-tools
setup.py
Python
gpl-3.0
1,663
from django.conf.urls import url from oioioi.testrun import views app_name = 'testrun' contest_patterns = [ url(r'^testrun_submit/$', views.testrun_submit_view, name='testrun_submit'), url( r'^s/(?P<submission_id>\d+)/tr/input/$', views.show_input_file_view, name='get_testrun_input', ...
sio2project/oioioi
oioioi/testrun/urls.py
Python
gpl-3.0
1,154
#!/usr/bin/env python import logging import sys import time import rtmidi from rtmidi.midiutil import open_midiport log = logging.getLogger('test_midiin_callback') logging.basicConfig(level=logging.DEBUG) class MidiInputHandler(object): def __init__(self, port): self.port = port self._wallclock...
schef/midiplay
source/poc/midiin2stdout.py
Python
gpl-3.0
1,224
from __future__ import unicode_literals from django.db import models from django.utils.translation import ugettext_lazy as _ IMPORTANT_FIELD_GUESSES = ['id', 'pk', 'name', 'last', 'first', 'full_name', 'summary', 'description', 'user', 'person'] def representation(model, field_names=[], max_fields=None): """Uni...
totalgood/twote
twote/model_utils.py
Python
mit
2,398
from setuptools import setup, find_packages from setuptools.command.test import test as TestCommand import sys class PyTest(TestCommand): def finalize_options(self): TestCommand.finalize_options(self) self.test_args = [] self.test_suite = True def run_tests(self): #import here...
mokkeee/python_tddbc4th
setup.py
Python
mit
1,323
#!/usr/bin/python __author__ = 'Alexandre Menai' import unittest from bin.math_utilities import * class TestPolygon(unittest.TestCase): def setUp(self): self.mysquare=Polygon((0,0),(0,1),(1,1),(1,0)) self.point=(0.25,0.25) def test_init(self): self.assertEqual(self.mysquare.points,((0,...
amenai1979/pylot
test/test_math_utilities.py
Python
gpl-2.0
495
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2014, Timothy Vandenbrande <timothy.vandenbrande@gmail.com> # Copyright: (c) 2017, Artem Zinenko <zinenkoartem@gmail.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = {'metadata_version': '1.1...
roadmapper/ansible
lib/ansible/modules/windows/win_firewall_rule.py
Python
gpl-3.0
5,309
import pytest from mitmproxy.addons import intercept from mitmproxy import exceptions from mitmproxy.proxy import layers from mitmproxy.test import taddons from mitmproxy.test import tflow def test_simple(): r = intercept.Intercept() with taddons.context(r) as tctx: assert not r.filt tctx.con...
Kriechi/mitmproxy
test/mitmproxy/addons/test_intercept.py
Python
mit
1,963
#!/usr/bin/env python # Copyright 2016 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. """ If should_use_hermetic_xcode.py emits "1", and the current toolchain is out of date: * Downloads the hermetic mac toolchain *...
chrisdickinson/nojs
build/mac_toolchain.py
Python
bsd-3-clause
9,424
#!/usr/bin/env python """ Copyright (C) 2012 Roman Mohr <roman@fenkhuber.at> """ """static - A stupidly simple WSGI way to serve static (or mixed) content. (See the docstrings of the various functions and classes.) Copyright (C) 2006-2009 Luke Arno - http://lukearno.com/ This library is free software; you can redis...
ramcn/demo3
venv/lib/python3.4/site-packages/static.py
Python
mit
16,038
from datetime import datetime import tornado.ioloop import yaml, json, glob import os import sys import time import argparse import subprocess import distutils import traceback import functools import imp from va_master.handlers.datastore_handler import DatastoreHandler from va_master.api import login from va_master.va...
VapourApps/va_master
va_master/cli/cli.py
Python
gpl-3.0
14,600
import bpy from mathutils import Vector from ...utils import copy_bone, flip_bone, put_bone, org from ...utils import strip_org, make_deformer_name, connected_children_names from ...utils import create_circle_widget, create_sphere_widget, create_widget from ...utils import MetarigError, make_mechanism_name, create_cub...
Passtechsoft/TPEAlpGen
blender/release/scripts/addons/rigify/rigs/pitchipoy/super_torso_turbo.py
Python
gpl-3.0
29,912
import unittest import urlparse class URLTestCase(unittest.TestCase): def assertQueryStringArgsEqual(self, querystring1, querystring2): # clean-up '?' if isinstance(querystring1, basestring) and querystring1.startswith('?'): querystring1 = querystring1[1:] if isinstance(querys...
bmentges/brainiak_api
tests/utils.py
Python
gpl-2.0
754
import numpy as np x = np.random.normal(size=[10,10]) y = np.random.normal(size=[10,10]) z = np.dot(x,y) # print(z) import tensorflow as tf #Example 1 x = tf.random_normal([10,10]) y = tf.random_normal([10,10]) z = tf.matmul(x,y) sess = tf.Session() z_val = sess.run(z) print(z_val) #Example 2 # placeholders ...
karanchawla/100DaysofCode
day19/tensorflow_basics.py
Python
mit
8,939
# Copyright (c) 2013 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...
shakamunyi/neutron-dvr
neutron/services/l3_router/l3_router_plugin.py
Python
apache-2.0
3,884
#!/user/bin/env python 'makeTextFile.py -- create text file' import os ls = os.linesep #第一个函数 while True: fname = raw_input("The File name will be(remember the '.'):") if os.path.exists(fname):#第二个函数 print "ERROR: '%s' already exists" % fname else: break all = [] print "\nEnter lines ('.' by itself to qui...
chidaobanjiu/My_python_scripts
makeTextFile.py
Python
cc0-1.0
556
from django import forms from django.contrib.auth import get_user_model from django.utils.translation import ugettext_lazy as _ from django.contrib.auth.models import Group, Permission from django.forms.models import inlineformset_factory from wagtail.wagtailcore import hooks from wagtail.wagtailadmin.widgets import A...
Klaudit/wagtail
wagtail/wagtailusers/forms.py
Python
bsd-3-clause
10,300
""" These meta-datasources operate on :class:`revscoring.Datasource`'s that returns a list of strings (i.e. "tokens") and produces a list of ngram/skipgram sequences. .. autoclass:: revscoring.datasources.meta.hashing.hash """ import json import mmh3 from ..datasource import Datasource class hash(Datasource): ...
yafeunteun/wikipedia-spam-classifier
revscoring/revscoring/datasources/meta/hashing.py
Python
mit
1,189
try: from xml.etree import cElementTree as ElementTree except ImportError: from xml.etree import ElementTree import types ##################### # String operations # ##################### def normalize_value(val): """ Normalize strings with booleans into Python types. """ if val is not N...
funkbit/pypayex
payex/utils.py
Python
bsd-2-clause
4,857
# Copyright 2018 TVB-HPC contributors # # 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...
the-virtual-brain/tvb-hpc
tvb_hpc/metric.py
Python
apache-2.0
3,683
# -*- coding: utf-8 -*- from django.conf.urls import patterns, url from website.views import IndexView urlpatterns = patterns('', url(r'^$', IndexView.as_view(), name='website-index'), url(r'^contact/$', 'website.views.contact', name='website-contact'), # --------------------------------...
IL2HorusTeam/il2ds-events-commander
il2ec/apps/website/urls.py
Python
gpl-2.0
948
#!/usr/bin/python import picamera import time import pygame import tty import sys import os from PIL import Image from PIL import ImageOps cam = picamera.PiCamera() cam.hflip = True cam.vflip=True #cam.start_preview() #orig_settings = termios.tcgetattr(sys.stdin) tty.setraw(sys.stdin) x = 0 i=0 while x != chr(27...
qdm8t2/capstone-autonomous-car
Data_Capture_Mode.py
Python
mit
1,087
### BEGIN LICENSE # Copyright (C) 2012 Owais Lone <hello@owaislone.org> # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License version 3, as published # by the Free Software Foundation. # # This program is distributed in the hope that it will be use...
andrenam/Fogger
fogger_lib/Bridge.py
Python
gpl-3.0
8,215
# coding: utf-8 # # Copyright 2018 The Oppia Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requi...
prasanna08/oppia
core/domain/classroom_domain.py
Python
apache-2.0
1,646
# -*- coding: utf-8 -*- # Licensed under the Apache-2.0 License, see LICENSE for details. import logging logger = logging.getLogger(__name__) logger.addHandler(logging.NullHandler()) import six import ctypes import numpy as np from numpy.ctypeslib import ndpointer from .constants import RS_API_VERSION, rs_stream, ...
toinsson/pyrealsense
pyrealsense/core.py
Python
apache-2.0
22,079
''' Created on Oct 27, 2010 Logistic Regression Working Module @author: Peter ''' from numpy import * def loadDataSet(): dataMat = []; labelMat = [] fr = open('testSet.txt') for line in fr.readlines(): lineArr = line.strip().split() dataMat.append([1.0, float(lineArr[0]), float(...
loganlinn/mlia
resources/Ch05/logRegres.py
Python
epl-1.0
4,099
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "ed_reviews.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
davejlin/treehouse
python/django/ed_reviews_REST/manage.py
Python
unlicense
253
# coding: latin-1 import os import re s = r"D:\Dupre\_data\informatique\support\vba\image/vbatd1_4.png" print re.compile ("[\\\\/]image[\\\\/].*[.]png").search(s) print re.compile ("[\\\\/]image[\\\\/].*[.]png").match(s) def liste_fichier_repertoire (folder) : file, rep = [], [] for r, d, f in os.walk (folde...
sdpython/teachpyx
_todo/programme/filelist3.py
Python
mit
722
#!/usr/bin/python # -*- coding: utf-8 -*- # # # Copyright 2015 Nandaja Varma <nvarma@redhat.com> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your ...
nandajavarma/gluster-deploy
glusterlib/playbook_gen.py
Python
gpl-2.0
6,565
from django.conf import settings from django.core.urlresolvers import reverse from django.http import HttpResponseRedirect from django.shortcuts import render_to_response from django.template import RequestContext from django.utils.translation import ugettext from django.contrib import messages from django.contrib.adm...
jhaus/pinax
pinax/apps/signup_codes/views.py
Python
mit
4,511
from django.db import models from django.conf import settings from django.contrib.auth.models import User from django.db.models.signals import post_save from django.dispatch import receiver from colorful.fields import RGBColorField # Create your models here. class Reservation(models.Model): time_slot = models.D...
djb1815/Essex-MuSoc
musoc_web/schedule/models.py
Python
mit
1,281
# 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...
tqchen/tvm
tests/python/relay/test_pass_dynamic_to_static.py
Python
apache-2.0
19,598
# 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...
Bismarrck/tensorflow
tensorflow/contrib/distribute/python/mirrored_strategy.py
Python
apache-2.0
6,670
# 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. from code import Code from model import PropertyType, Property, Type import cpp_util import schema_util import util_cc_helper from cpp_namespace_environm...
ric2b/Vivaldi-browser
chromium/tools/json_schema_compiler/cc_generator.py
Python
bsd-3-clause
51,753
#!/usr/bin/env python from flask_rest_1 import app app.run(debug=True)
bable5/Backbone-Playground
runserver.py
Python
mit
74
# -*- coding: utf-8 -*- # Copyright 2018 Therp BV <https://therp.nl> # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). from base64 import b64encode from openerp.tests.common import TransactionCase from openerp.exceptions import AccessError, ValidationError class TestAttachmentLock(TransactionCase)...
acsone/knowledge
attachment_lock/tests/test_attachment_lock.py
Python
agpl-3.0
1,537
""" Admonition extension for Python-Markdown ======================================== Adds rST-style admonitions. Inspired by [rST][] feature with the same name. [rST]: http://docutils.sourceforge.net/docs/ref/rst/directives.html#specific-admonitions # noqa See <https://pythonhosted.org/Markdown/extensions/admoniti...
unnikrishnankgs/va
venv/lib/python3.5/site-packages/markdown/extensions/admonition.py
Python
bsd-2-clause
3,158
#!/usr/bin/env python # -*- coding: utf-8 -*- # # setup.py import sys from cx_Freeze import setup, Executable executables = [Executable("TRGUI.py", icon="exe.ico", base="Win32GUI", appendScriptToExe=True, appendScriptToLibrary=False)] setup( name = "Travian Raider", version = "2.1", description = "A toolset for ...
Elkasitu/bearded-octo-bear
src/setup.py
Python
gpl-3.0
375
#!/usr/bin/env python # 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. # # This program is distributed in the hope that ...
vrbagalkote/avocado-misc-tests-1
generic/ras.py
Python
gpl-2.0
11,208
# (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...
rmfitzpatrick/ansible
lib/ansible/executor/task_queue_manager.py
Python
gpl-3.0
15,133
import sys from vacs.models import Command, Experiment, Vac, Evaluation,\ Assignment, Participant, Score, ValAssignment, Validation from django.contrib.auth import get_user_model import csv import numpy as np # Get all the Scores for the experiment experiment_id = 77 scores = Score.objects.filter(experiment__...
glebysg/GC_server
gestureclean/score_analysis.py
Python
mit
2,491
# This file is distributed under the terms of the GNU General Public # license. #Copyright (C) 2012 Anthony Pesce <timetopat@gmail.com> (See # the file COPYING for details). from atlas import * from physics import * # class Pioneeringconstruction(server.Task): # """A task for creating a Wooden structures such as ...
olekw/cyphesis
data/rulesets/deeds/scripts/world/tasks/Pioneeringconstruction.py
Python
gpl-2.0
5,158
"""Fetch and edit raster dataset metadata from the command line.""" from __future__ import absolute_import import code import logging import sys import collections import warnings import numpy as np import click from . import options import rasterio from rasterio.plot import show, show_hist try: import matplotl...
brendan-ward/rasterio
rasterio/rio/insp.py
Python
bsd-3-clause
2,830
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 Rackspace # 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-...
xushiwei/nova
nova/tests/test_network.py
Python
apache-2.0
30,254
# Copyright 2017 The Tangram Developers. See the AUTHORS file at the # top-level directory of this distribution and at # https://github.com/renatoGarcia/tangram/blob/master/AUTHORS. # # This file is part of Tangram. # # Tangram is free software: you can redistribute it and/or modify # it under the terms of the GNU Less...
renatoGarcia/tangram
test/test_image_viewer.py
Python
lgpl-3.0
1,079
import _plotly_utils.basevalidators class LineValidator(_plotly_utils.basevalidators.CompoundValidator): def __init__(self, plotly_name="line", parent_name="funnelarea.marker", **kwargs): super(LineValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, ...
plotly/plotly.py
packages/python/plotly/plotly/validators/funnelarea/marker/_line.py
Python
mit
987
import time from datetime import date, timedelta, datetime from sqlalchemy import Column, Integer, String, Enum, ForeignKey, DateTime, \ Date, Text, Boolean from sqlalchemy.dialects import postgresql from conditional import db attendance_enum = Enum('Attended', 'Excused', 'Absent', name='attendance_enum') class ...
ComputerScienceHouse/conditional
conditional/models/models.py
Python
mit
10,287
#!/usr/bin/env python import sys import json for i in sys.argv[1:]: with open(i) as infile: data = json.load(infile) cleaned = json.dumps(data, sort_keys=False, indent=2) with open(i, "w") as output: for line in cleaned.split('\n'): output.write(line.rstrip() + '\n')
simonsonc/mn-glo-mosaic
reformat-json.py
Python
mit
312
# 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 import datetime from frappe import _, msgprint, scrub from frappe.defaults import get_user_permissions from frappe.utils import add_days,...
hatwar/Das_erpnext
erpnext/accounts/party.py
Python
agpl-3.0
8,025
# -*- coding: utf8 -*- import json from utils.es_manager import ES_Manager from permission_admin.models import Dataset class ActiveDataset: """ Dataset class """ def __init__(self, id, dataset): self.id = id self.index = dataset['index'] self.mapping = dataset['mapping'] class Datasets: """ Datasets cla...
texta-tk/texta
utils/datasets.py
Python
gpl-3.0
2,551
#!/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. """Unittest for js_map_format.py. """ import os import re import sys if __name__ == '__main__': sys.path.append(os.path.join(os....
JoKaWare/WTL-DUI
tools/grit/grit/format/js_map_format_unittest.py
Python
bsd-3-clause
2,917