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 |
|---|---|---|---|---|---|
PaytonShaw/shadowsocks1 | shadowsocks/lru_cache.py | 30 | 1920 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import collections
import logging
import heapq
import time
class LRUCache(collections.MutableMapping):
"""This class is not thread safe"""
def __init__(self, timeout=60, close_callback=None, *args, **kwargs):
self.timeout = timeout
self.close_callbac... | mit |
lionleaf/dwitter | dwitter/settings/base.py | 1 | 6241 | """
Django settings for dwitter project.
Generated by 'django-admin startproject' using Django 1.9.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/settings/
"""
import os
# B... | apache-2.0 |
prmtl/fuel-web | fuel_agent_ci/fuel_agent_ci/tests/base.py | 4 | 3839 | # Copyright 2014 Mirantis, 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 writing... | apache-2.0 |
rex-xxx/mt6572_x201 | external/clang/utils/analyzer/SumTimerInfo.py | 48 | 3110 | #!/usr/bin/env python
"""
Script to Summarize statistics in the scan-build output.
Statistics are enabled by passing '-internal-stats' option to scan-build
(or '-analyzer-stats' to the analyzer).
"""
import string
from operator import itemgetter
import sys
if __name__ == '__main__':
if len(sys.argv) < 2:
... | gpl-2.0 |
mfherbst/spack | lib/spack/spack/test/cmd/flake8.py | 4 | 3469 | ##############################################################################
# Copyright (c) 2013-2018, 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 |
Francis-Liu/animated-broccoli | nova/tests/unit/api/ec2/test_middleware.py | 19 | 8419 | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# 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 ... | apache-2.0 |
styk-tv/offlineimap | offlineimap/ui/Noninteractive.py | 18 | 1248 | # Noninteractive UI
# Copyright (C) 2002-2012 John Goerzen & contributors
#
# 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... | gpl-2.0 |
magnastrazh/NEUCOGAR | nest/serotonin/research/C/nest-2.10.0/doc/nest_by_example/scripts/brunel2000_interactive.py | 13 | 3535 | # -*- coding: utf-8 -*-
#
# brunel2000_interactive.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST 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 ... | gpl-2.0 |
hilaskis/UAV_MissionPlanner | Lib/pipes.py | 82 | 9647 | """Conversion pipeline templates.
The problem:
------------
Suppose you have some data that you want to convert to another format,
such as from GIF image format to PPM image format. Maybe the
conversion involves several steps (e.g. piping it through compress or
uuencode). Some of the conversion steps may require th... | gpl-2.0 |
unicefuganda/uSurvey | survey/tests/views/test_question_template.py | 1 | 3669 | from model_mommy import mommy
from django.test.client import Client
from django.contrib.auth.models import User
from survey.models.batch import Batch
from django.core.urlresolvers import reverse
from survey.models import (QuestionModule, Interviewer, EnumerationArea, QuestionTemplate, NumericalAnswer,
... | bsd-3-clause |
gaddman/ansible | test/units/modules/network/cloudvision/test_cv_server_provision.py | 15 | 46159 | # 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.
#
# Ansible is distributed in the hope that ... | gpl-3.0 |
phobson/pycvc | pycvc/validate.py | 2 | 1090 |
def groupby_col(groupby_col):
valid_groups = ['season', 'grouped_season', 'year', 'storm_bin', 'samplestart']
if groupby_col is None:
return groupby_col
elif groupby_col.lower() in valid_groups:
return groupby_col.lower()
else:
raise ValueError("{} is not a valid time group ({})... | bsd-3-clause |
MayB/zulip | zerver/forms.py | 97 | 3911 | from __future__ import absolute_import
from django import forms
from django.core.exceptions import ValidationError
from django.utils.safestring import mark_safe
from django.contrib.auth.forms import SetPasswordForm, AuthenticationForm
from django.conf import settings
from zerver.models import Realm, get_user_profile_... | apache-2.0 |
jaimahajan1997/sympy | sympy/physics/tests/test_hydrogen.py | 83 | 4122 | from sympy import exp, integrate, oo, S, simplify, sqrt, symbols
from sympy.core.compatibility import range
from sympy.physics.hydrogen import R_nl, E_nl, E_nl_dirac
from sympy.utilities.pytest import raises
n, r, Z = symbols('n r Z')
def feq(a, b, max_relative_error=1e-12, max_absolute_error=1e-12):
a = float(a... | bsd-3-clause |
Lh4cKg/kivy | kivy/lib/osc/oscAPI.py | 3 | 9354 | # pylint: disable=W0611
''' simpleOSC 0.2
ixi software - July, 2006
www.ixi-software.net
simple API for the Open SoundControl for Python (by Daniel Holth, Clinton
McChesney --> pyKit.tar.gz file at http://wiretap.stetson.edu)
Documentation at http://wiretap.stetson.edu/docs/pyKit/
The main... | lgpl-3.0 |
jbzdak/edx-platform | common/djangoapps/enrollment/errors.py | 84 | 1396 | """All Error Types pertaining to Enrollment."""
class CourseEnrollmentError(Exception):
"""Generic Course Enrollment Error.
Describes any error that may occur when reading or updating enrollment information for a user or a course.
"""
def __init__(self, msg, data=None):
super(CourseEnrollmen... | agpl-3.0 |
israelbenatar/boto | tests/integration/sdb/test_cert_verification.py | 126 | 1544 | # Copyright (c) 2012 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2012 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 withou... | mit |
endticket/uwsgi | tests/signals.py | 21 | 1027 | import uwsgi
def hello_signal(num, payload):
print "i am the signal %d" % num
def hello_signal2(num, payload):
print "i am the signal %d with payload: %s" % (num, payload)
def hello_file(num, filename):
print "file %s has been modified !!!" % filename
def hello_timer(num, secs):
print "%s second... | gpl-2.0 |
nikitasingh981/scikit-learn | sklearn/externals/joblib/pool.py | 13 | 25147 | """Custom implementation of multiprocessing.Pool with custom pickler.
This module provides efficient ways of working with data stored in
shared memory with numpy.memmap arrays without inducing any memory
copy between the parent and child processes.
This module should not be imported if multiprocessing is not
availabl... | bsd-3-clause |
sekikn/incubator-airflow | airflow/providers/google/suite/operators/sheets.py | 7 | 3600 | # 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 |
nojhan/weboob-devel | modules/trictractv/video.py | 7 | 1032 | # -*- coding: utf-8 -*-
# Copyright(C) 2011 Romain Bignon
#
# This file is part of weboob.
#
# weboob is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your opt... | agpl-3.0 |
LeeEunhyeong/test_camera | cameratest01.py | 1 | 2279 | import sys, time, traceback
# Simple audio encoder
def recodeAudio( fName, fOutput, type, bitrate= None ):
# ------------------------------------
import pymedia.audio.acodec as acodec
import pymedia.muxer as muxer
# Open demuxer
dm= muxer.Demuxer( fName.split( '.' )[ -1 ].lower() )
f= open( fName, 'rb'... | mit |
ewpatton/appinventor-sources | appinventor/misc/emulator-support/aiStarter.py | 8 | 5821 | #!/usr/bin/python
# -*- coding: utf-8; fill-column: 120 -*-
import os
import platform
import re
import subprocess
import sys
import config
from bottle import run, route, response
VERSION = '%d.%d.%d%s' % (config.ANDROID_PLATFORM, config.COMPANION_VERSION, config.MINOR_VERSION, config.BUILD_EXTRAS)
PLATDIR = os.path.... | apache-2.0 |
kuke/models | fluid/PaddleCV/face_detection/image_util.py | 1 | 19212 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from PIL import Image, ImageEnhance, ImageDraw
from PIL import ImageFile
import numpy as np
import random
import math
import cv2
ImageFile.LOAD_TRUNCATED_IMAGES = True #otherwise IOError raised image file is ... | apache-2.0 |
Eduardo2505/Ave | subir/server/gae-python/main.py | 77 | 7577 | # -*- coding: utf-8 -*-
#
# jQuery File Upload Plugin GAE Python Example
# https://github.com/blueimp/jQuery-File-Upload
#
# Copyright 2011, Sebastian Tschan
# https://blueimp.net
#
# Licensed under the MIT license:
# http://www.opensource.org/licenses/MIT
#
from google.appengine.api import memcache, images
import jso... | mit |
dragondjf/cqssl | handlers/yunpian_sms.py | 1 | 2967 | #!/usr/local/bin/python
#-*- coding:utf-8 -*-
# Author: jacky
# Time: 14-2-22 下午11:48
# Desc: 短信http接口的python代码调用示例
import httplib
import urllib
import logging
#服务地址
host = "yunpian.com"
#端口号
port = 80
#版本号
version = "v1"
#查账户信息的URI
user_get_uri = "/" + version + "/user/get.json"
#智能匹配模版短信接口的URI
sms_send_uri = "/" + v... | apache-2.0 |
ryepdx/readable_superuser | __openerp__.py | 1 | 1568 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 NovaPoint Group LLC (<http://www.novapointgroup.com>)
# Copyright (C) 2004-2010 OpenERP SA (<http://www.openerp.com>)
#
# This program is f... | agpl-3.0 |
owlabs/incubator-airflow | airflow/operators/branch_operator.py | 1 | 2027 | # -*- coding: utf-8 -*-
#
# 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
#... | apache-2.0 |
detrout/telepathy-qt | tools/libtpcodegen.py | 28 | 6610 | """Library code for language-independent D-Bus-related code generation.
The master copy of this library is in the telepathy-glib repository -
please make any changes there.
"""
# Copyright (C) 2006-2008 Collabora Limited
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of ... | lgpl-2.1 |
linas/blender_api_msgs | test/test_blender_api.py | 1 | 8165 | #!/usr/bin/env python
import unittest
import os
import sys
import time
import glob
import rospkg
import roslaunch
import rostopic
import rosbag
import rosnode
from roslaunch import core
from testing_tools.misc import (wait_for, startxvfb, stopxvfb, capture_screen,
run_shell_cmd, add_text_to_video, concatenate... | bsd-3-clause |
nickabattista/IB2d | pyIB2d/IBM_Blackbox/Supp.py | 1 | 23320 | '''-------------------------------------------------------------------------
IB2d is an Immersed Boundary Code (IB) for solving fully coupled non-linear
fluid-structure interaction models. This version of the code is based off of
Peskin's Immersed Boundary Method Paper in Acta Numerica, 2002.
Author: Nicholas A... | gpl-3.0 |
benob/icsisumm | icsisumm-primary-sys34_v1/nltk/nltk-0.9.2/nltk/corpus/reader/chunked.py | 9 | 8055 | # Natural Language Toolkit: Chunked Corpus Reader
#
# Copyright (C) 2001-2008 University of Pennsylvania
# Author: Steven Bird <sb@ldc.upenn.edu>
# Edward Loper <edloper@gradient.cis.upenn.edu>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
"""
A reader for corpora that contain chunked ... | gpl-3.0 |
limingzhou/aliyun-cli | aliyuncli/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 ... | apache-2.0 |
openstack/manila | manila/tests/share/drivers/hpe/test_hpe_3par_constants.py | 1 | 7527 | # Copyright 2015 Hewlett Packard Enterprise Development LP
#
# 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 requir... | apache-2.0 |
nke001/attention-lvcsr | libs/blocks/tests/test_variable_filter.py | 2 | 3988 | from nose.tools import raises
from blocks.bricks import Bias, Linear, Logistic
from blocks.bricks.parallel import Merge
from blocks.filter import VariableFilter
from blocks.graph import ComputationGraph
from blocks.roles import BIAS, FILTER, PARAMETER, OUTPUT
from theano import tensor
def test_variable_filter():
... | mit |
jpfeil/toil-scripts | src/toil_scripts/gatk_germline/hard_filter.py | 2 | 6773 | #!/usr/bin/env python2.7
import os
from toil.job import PromisedRequirement
from toil_lib.tools.variant_manipulation import gatk_select_variants, \
gatk_variant_filtration, gatk_combine_variants
from toil_scripts.gatk_germline.common import output_file_job
def hard_filter_pipeline(job, uuid, vcf_id, config):
... | apache-2.0 |
djr7C4/aenea | client/aenea/dragonfly_mock.py | 6 | 1679 | # This file is part of Aenea
#
# Aenea is free software: you can redistribute it and/or modify it under
# the terms of version 3 of the GNU Lesser General Public License as
# published by the Free Software Foundation.
#
# Aenea is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even ... | lgpl-3.0 |
yoelk/kivy | kivy/tools/gles_compat/subset_gles.py | 54 | 4832 | '''
Common GLES Subset Extraction Script
====================================
In Kivy, our goal is to use OpenGL ES 2.0 (GLES2) for all drawing on all
platforms. The problem is that GLES2 is not a proper subset of any OpenGL
Desktop (GL) version prior to version 4.1.
However, to keep all our dr... | mit |
wsmith323/django | django/http/__init__.py | 341 | 1103 | from django.http.cookie import SimpleCookie, parse_cookie
from django.http.request import (
HttpRequest, QueryDict, RawPostDataException, UnreadablePostError,
)
from django.http.response import (
BadHeaderError, FileResponse, Http404, HttpResponse,
HttpResponseBadRequest, HttpResponseForbidden, HttpResponse... | bsd-3-clause |
leiferikb/bitpop | src/third_party/webpagereplay/third_party/ipaddr/ipaddr_test.py | 46 | 50368 | #!/usr/bin/python
#
# Copyright 2007 Google Inc.
# Licensed to PSF under a Contributor Agreement.
#
# 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/LICE... | gpl-3.0 |
zaragoza-sedeelectronica/hackathon-co.sa | node_modules/cordova/node_modules/cordova-lib/node_modules/npm/node_modules/node-gyp/gyp/PRESUBMIT.py | 82 | 3232 | # Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Top-level presubmit script for GYP.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the presubmit API built... | apache-2.0 |
yuanagain/seniorthesis | venv/lib/python2.7/site-packages/scipy/linalg/tests/test_decomp_polar.py | 126 | 2797 | from __future__ import division, print_function, absolute_import
import numpy as np
from numpy.linalg import norm
from numpy.testing import (assert_, assert_allclose, assert_equal,
run_module_suite)
from scipy.linalg import polar, eigh
diag2 = np.array([[2, 0], [0, 3]])
a13 = np.array([[1, 2, 2]])
precomputed_c... | mit |
kxliugang/edx-platform | common/djangoapps/track/views/__init__.py | 74 | 6212 | import datetime
import json
import pytz
from django.contrib.auth.decorators import login_required
from django.http import HttpResponse
from django.shortcuts import redirect
from django.views.decorators.csrf import ensure_csrf_cookie
from edxmako.shortcuts import render_to_response
from track import tracker
from tr... | agpl-3.0 |
proversity-org/edx-platform | common/test/acceptance/fixtures/xqueue.py | 24 | 1434 | """
Fixture to configure XQueue response.
"""
import json
import requests
from common.test.acceptance.fixtures import XQUEUE_STUB_URL
class XQueueResponseFixtureError(Exception):
"""
Error occurred while configuring the stub XQueue.
"""
pass
class XQueueResponseFixture(object):
"""
Config... | agpl-3.0 |
salceson/android-copernicus | server/server.py | 1 | 3360 | # coding=utf-8
import json
import socket
import struct
import thread
from flask import Flask, jsonify, request, abort
from gcm import *
from gcm.gcm import GCMException
app = Flask('Android-Copernicus-Server')
MCAST_GRP = '234.6.6.6'
MCAST_PORT = 3666
DEBUG = True
SERVER_IP = ''
PORT = 20666
ALARM_MODE = False
DEVI... | mit |
rupesh1mb/linux | Documentation/target/tcm_mod_builder.py | 337 | 24391 | #!/usr/bin/python
# The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD
#
# Copyright (c) 2010 Rising Tide Systems
# Copyright (c) 2010 Linux-iSCSI.org
#
# Author: nab@kernel.org
#
import os, sys
import subprocess as sub
import string
import re
import optparse
tcm_dir = ""
fabric_ops... | gpl-2.0 |
srblum/hackathon-server | tests/utils.py | 4 | 3974 | """
Functions and utility classes for testing.
"""
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import StringIO
import functools
import humanize
import itertools
import os
import signal
import sys
import time
packageName = 'ga4gh'
def captureOutput(f... | apache-2.0 |
iceman126/strophejs_iceman126 | examples/attach/settings.py | 56 | 2916 | # Django settings for attach project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
('Some Body', 'romeo@example.com'),
)
MANAGERS = ADMINS
DATABASE_ENGINE = 'sqlite3' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
DATABASE_NAME = '/path/to/attach.db' # Or path to ... | mit |
linvictor88/vse-lbaas-driver | quantum/openstack/common/notifier/rpc_notifier.py | 7 | 1697 | # Copyright 2011 OpenStack Foundation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | apache-2.0 |
Distrotech/intellij-community | python/lib/Lib/site-packages/django/contrib/messages/storage/cookie.py | 89 | 5873 | from django.conf import settings
from django.contrib.messages import constants
from django.contrib.messages.storage.base import BaseStorage, Message
from django.http import CompatCookie
from django.utils import simplejson as json
from django.utils.crypto import salted_hmac, constant_time_compare
class MessageEncoder(... | apache-2.0 |
tmenjo/cinder-2015.1.1 | cinder/tests/test_api_urlmap.py | 27 | 12302 | # 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 required by applicab... | apache-2.0 |
Samael500/flask-security | flask_security/core.py | 1 | 16227 | # -*- coding: utf-8 -*-
"""
flask.ext.security.core
~~~~~~~~~~~~~~~~~~~~~~~
Flask-Security core module
:copyright: (c) 2012 by Matt Wright.
:license: MIT, see LICENSE for more details.
"""
from flask import current_app, render_template
from flask.ext.login import AnonymousUserMixin, UserMixin as ... | mit |
yawnosnorous/python-for-android | python3-alpha/extra_modules/gdata/calendar/data.py | 121 | 9852 | #!/usr/bin/python
#
# Copyright (C) 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 required by applicable law ... | apache-2.0 |
xpavlus/domaintests | domtests.py | 1 | 4740 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
module: domaintests
Module's basic class.
author: Pavlovskiy Pavel
email: xpavlus@yandex.ru
"""
try:
from HostClass import Host
from dnstestClass import dnsTest
except ImportError, err:
raise ImportError("Error importing DnsTests modules. Please check wh... | gpl-2.0 |
toringe/cc2asn | cc2asn-server.py | 1 | 11091 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
CC2ASN Server
Basic query-response server listen on a tcp-port (default 43) for
incoming requests. The only valid and required request is an
ISO-3166-1 alpha-2 country code (e.g. NO for Norway). The server
will respond back with the list of registered AS-numbers.
Optio... | mit |
kenshay/ImageScript | ProgramData/SystemFiles/Python/Lib/site-packages/django/contrib/gis/db/backends/mysql/operations.py | 31 | 4263 | from django.contrib.gis.db.backends.base.adapter import WKTAdapter
from django.contrib.gis.db.backends.base.operations import \
BaseSpatialOperations
from django.contrib.gis.db.backends.utils import SpatialOperator
from django.contrib.gis.db.models import GeometryField, aggregates
from django.db.backends.mysql.oper... | gpl-3.0 |
LoHChina/nova | nova/virt/hyperv/migrationops.py | 25 | 13148 | # Copyright 2013 Cloudbase Solutions Srl
# 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 r... | apache-2.0 |
platformio/platformio | platformio/commands/settings.py | 1 | 2481 | # Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# 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 appli... | apache-2.0 |
unaizalakain/django | django/contrib/messages/api.py | 512 | 3202 | from django.contrib.messages import constants
from django.contrib.messages.storage import default_storage
from django.http import HttpRequest
__all__ = (
'add_message', 'get_messages',
'get_level', 'set_level',
'debug', 'info', 'success', 'warning', 'error',
'MessageFailure',
)
class MessageFailure(E... | bsd-3-clause |
alertby/mbed | workspace_tools/patch.py | 142 | 1934 | """
mbed SDK
Copyright (c) 2011-2013 ARM Limited
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in wr... | apache-2.0 |
miky-kr5/Super-HUGS-Revolution-98 | game.py | 2 | 2943 | ###########################################
# Created on 1-7-2013. Miguel Angel Astor #
###########################################
import pygame
try:
import android
except ImportError:
android = None
import player
from state import VALID_STATES
from intro import IntroState
from menu import MenuState
from ingam... | bsd-2-clause |
jledet/linux-xlnx | tools/perf/scripts/python/stat-cpi.py | 404 | 2391 | #!/usr/bin/env python
data = {}
times = []
threads = []
cpus = []
def get_key(time, event, cpu, thread):
return "%d-%s-%d-%d" % (time, event, cpu, thread)
def store_key(time, cpu, thread):
if (time not in times):
times.append(time)
if (cpu not in cpus):
cpus.append(cpu)
if (... | gpl-2.0 |
toshywoshy/ansible | lib/ansible/modules/network/netscaler/netscaler_save_config.py | 21 | 4892 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2017 Citrix Systems
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
ryfeus/lambda-packs | Tensorflow/source/google/protobuf/internal/service_reflection_test.py | 75 | 5170 | #! /usr/bin/env python
#
# Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# https://developers.google.com/protocol-buffers/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions ... | mit |
TheWardoctor/Wardoctors-repo | plugin.video.metalliq/resources/lib/meta/gui/dialogs.py | 1 | 9044 | import time
from threading import Thread, RLock
from xbmcswift2 import xbmc, xbmcgui, xbmcaddon
from meta import plugin
from settings import *
from language import get_string as _
def wait_for_dialog(dialog_id, timeout=None, interval=500):
start = time.time()
while not xbmc.getCondVisibility("Window.IsActive(... | apache-2.0 |
vefimova/rally | rally/plugins/openstack/context/cleanup/resources.py | 2 | 15782 | # Copyright 2014: Mirantis 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 b... | apache-2.0 |
mhbu50/erpnext | erpnext/stock/doctype/material_request/material_request.py | 2 | 19170 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
# ERPNext - web based ERP (http://erpnext.com)
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
import json
from frappe.utils import cs... | gpl-3.0 |
hanvo/MusicCloud | Crawler/Install Files/pygame/msysio.py | 2 | 1422 | # module msysio.py
# Requires Python 2.2 or better.
"""Provide helpful routines for interactive IO on the MSYS console"""
# Output needs to be flushed to be seen. It is especially important
# when prompting for user input.
import sys
import os
__all__ = ['raw_input_', 'print_', 'is_msys']
# 2.x/3.x compatibility s... | bsd-3-clause |
jskew/gnuradio | gr-analog/python/analog/qa_quadrature_demod.py | 47 | 1844 | #!/usr/bin/env python
#
# Copyright 2012,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 your optio... | gpl-3.0 |
kyoren/https-github.com-h2oai-h2o-3 | py2/testdir_rapids/test_rapids_builtin.py | 21 | 7544 | import unittest, random, sys, time
sys.path.extend(['.','..','../..','py'])
import h2o2 as h2o
import h2o_browse as h2b, h2o_exec as h2e, h2o_import as h2i
initList = [
'(#(1))', # why isn't this illegal?
'(#1)',
'((#1))',
'(((#1)))',
'(= !x #1)',
'((= !x #1))',
... | apache-2.0 |
mschwerin/linux-3.0.35-qmx6 | tools/perf/scripts/python/sched-migration.py | 11215 | 11670 | #!/usr/bin/python
#
# Cpu task migration overview toy
#
# Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com>
#
# perf script event handlers have been generated by perf script -g python
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Fre... | gpl-2.0 |
rancher/cattle | tests/integration/cattletest/core/test_user_preferences.py | 7 | 3604 | from common_fixtures import * # NOQA
from gdapi import ApiError
@pytest.fixture(scope='module')
def user_client(context):
return context.user_client
def _user_preference(client, name=None):
if name is None:
name = random_str()
preference = client.wait_success(client.create_user_preference(
... | apache-2.0 |
Eric-Zhong/odoo | addons/sale_order_dates/__init__.py | 441 | 1071 | # -*- 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 |
KAsante95/osf.io | website/identifiers/model.py | 58 | 1631 | # -*- coding: utf-8 -*-
from bson import ObjectId
from modularodm import Q
from modularodm import fields
from modularodm.storage.base import KeyExistsException
from framework.mongo import StoredObject
from framework.mongo.utils import unique_on
@unique_on(['referent.0', 'referent.1', 'category'])
class Identifier(... | apache-2.0 |
ressu/SickGear | lib/requests/packages/chardet/gb2312freq.py | 3132 | 36011 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client 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 R... | gpl-3.0 |
b-me/django | tests/urlpatterns_reverse/middleware.py | 386 | 1050 | from django.core.urlresolvers import reverse
from django.http import HttpResponse, StreamingHttpResponse
from . import urlconf_inner
class ChangeURLconfMiddleware(object):
def process_request(self, request):
request.urlconf = urlconf_inner.__name__
class NullChangeURLconfMiddleware(object):
def pro... | bsd-3-clause |
MarkWh1te/xueqiu_predict | python3_env/lib/python3.4/site-packages/pygments/lexers/esoteric.py | 23 | 7083 | # -*- coding: utf-8 -*-
"""
pygments.lexers.esoteric
~~~~~~~~~~~~~~~~~~~~~~~~
Lexers for esoteric languages.
:copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.lexer import RegexLexer, include, words
from pygments.token imp... | mit |
kevinlee12/oppia | core/storage/activity/gae_models_test.py | 2 | 2748 | # coding: utf-8
#
# Copyright 2016 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... | apache-2.0 |
comodit/demos | ceph-cluster/downscale_osds.py | 1 | 1977 | #!/usr/bin/env python
import time, config
from optparse import OptionParser
from comodit_client.api import Client
from comodit_client.api.exceptions import PythonApiException
from comodit_client.api.host import Host
from helper import get_latest_id, get_short_hostname, create_host
def downscale_osds(count):
#... | mit |
darktears/chromium-crosswalk | third_party/cython/src/Cython/Build/Cythonize.py | 90 | 6864 | #!/usr/bin/env python
import os
import shutil
import tempfile
from distutils.core import setup
from Cython.Build.Dependencies import cythonize, extended_iglob
from Cython.Utils import is_package_dir
from Cython.Compiler import Options
try:
import multiprocessing
parallel_compiles = int(multiprocessing.cpu_co... | bsd-3-clause |
wolf29/games | py-proj-building-blocks/pygame-1.9.1release/test/run_tests__tests/incomplete/fake_2_test.py | 5 | 1238 | if __name__ == '__main__':
import sys
import os
pkg_dir = (os.path.split(
os.path.split(
os.path.split(
os.path.abspath(__file__))[0])[0])[0])
parent_dir, pkg_name = os.path.split(pkg_dir)
is_pygame_pkg = (pkg_name == 'test... | gpl-3.0 |
ContinuumIO/watchdog | tests/__init__.py | 7 | 1387 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2014 Thomas Amland <thomas.amland@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses... | apache-2.0 |
kennedyshead/home-assistant | homeassistant/components/wirelesstag/sensor.py | 5 | 3620 | """Sensor support for Wireless Sensor Tags platform."""
import logging
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorEntity
from homeassistant.const import CONF_MONITORED_CONDITIONS
from homeassistant.core import callback
import homeassistant.helpers.config_validation as ... | apache-2.0 |
hnakamur/django-rest-framework-json-api | example/tests/utils.py | 3 | 1101 | import json
from django.utils.encoding import force_bytes, force_text
def dump_json(data):
'''
Converts a Python object to a JSON formatted string.
'''
json_kwargs = {
'sort_keys': True,
'indent': 4,
'separators': (', ', ': ')
}
return force_bytes(json.dumps(data, **... | bsd-2-clause |
gitaarik/django | django/contrib/postgres/fields/array.py | 59 | 9933 | import json
from django.contrib.postgres import lookups
from django.contrib.postgres.forms import SimpleArrayField
from django.contrib.postgres.validators import ArrayMaxLengthValidator
from django.core import checks, exceptions
from django.db.models import Field, IntegerField, Transform
from django.db.models.lookups ... | bsd-3-clause |
Yannig/ansible | lib/ansible/modules/network/avi/avi_sslkeyandcertificate.py | 27 | 5751 | #!/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 |
makfire/gstudio | gnowsys-ndf/gnowsys_ndf/ndf/views/imageDashboard.py | 1 | 13026 | ''' -- imports from installed packages -- '''
from django.http import HttpResponseRedirect
from django.http import HttpResponse
from django.core.urlresolvers import reverse
from django.shortcuts import render_to_response, render
from django.template import RequestContext
try:
from bson import ObjectId
except Impor... | agpl-3.0 |
UManPychron/pychron | pychron/pipeline/save_figure.py | 2 | 3467 | # ===============================================================================
# Copyright 2015 Jake Ross
#
# 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... | apache-2.0 |
mmauroy/SickRage | tornado/test/websocket_test.py | 19 | 14504 | from __future__ import absolute_import, division, print_function, with_statement
import traceback
from tornado.concurrent import Future
from tornado import gen
from tornado.httpclient import HTTPError, HTTPRequest
from tornado.log import gen_log, app_log
from tornado.testing import AsyncHTTPTestCase, gen_test, bind_u... | gpl-3.0 |
grlee77/scipy | scipy/cluster/tests/test_vq.py | 1 | 12393 |
import warnings
import sys
import numpy as np
from numpy.testing import (assert_array_equal, assert_array_almost_equal,
assert_allclose, assert_equal, assert_,
suppress_warnings)
import pytest
from pytest import raises as assert_raises
from scipy.cluster.vq impor... | bsd-3-clause |
dgjustice/ansible | lib/ansible/modules/cloud/amazon/ec2_vpc_net.py | 15 | 10252 | #!/usr/bin/python
# 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.
#
# Ansible is distributed... | gpl-3.0 |
cmauec/Cloud-Vision-Api | cloudstorage/rest_api.py | 9 | 9146 | # Copyright 2012 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | gpl-2.0 |
cntnboys/410Lab4 | env-lab4/lib/python2.7/site-packages/markupsafe/tests.py | 674 | 6107 | # -*- coding: utf-8 -*-
import gc
import sys
import unittest
from markupsafe import Markup, escape, escape_silent
from markupsafe._compat import text_type
class MarkupTestCase(unittest.TestCase):
def test_adding(self):
# adding two strings should escape the unsafe one
unsafe = '<script type="appl... | apache-2.0 |
PrincetonUniversity/AdvNet-OF_Scripts | evaluation/switch/flowmod_test/pox/pox/misc/packet_dump.py | 26 | 2913 | # Copyright 2012 James McCauley
#
# This file is part of POX.
#
# POX 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.
#
# POX is distri... | apache-2.0 |
SujaySKumar/django | tests/forms_tests/field_tests/test_datefield.py | 156 | 4346 | from datetime import date
from django.forms import DateField, Form, HiddenInput, SelectDateWidget
from django.test import SimpleTestCase, override_settings
from django.utils import translation
class GetDate(Form):
mydate = DateField(widget=SelectDateWidget)
class DateFieldTest(SimpleTestCase):
def test_fo... | bsd-3-clause |
drwyrm/Flexget | flexget/plugins/output/sabnzbd.py | 7 | 3554 | from __future__ import unicode_literals, division, absolute_import
from builtins import * # noqa pylint: disable=unused-import, redefined-builtin
from future.moves.urllib.parse import urlencode
import logging
from flexget import plugin
from flexget.event import event
from requests import RequestException
log = logg... | mit |
ferriman/SSandSP | pythonscripts/eliza.py | 2 | 7991 | import re
responseStarts = []
responseCurrentIndices = []
responseEnds = []
previousInput = ""
userInput = ""
CONVERSATION_KEYWORDS = ["CAN YOU", "CAN I", "YOU ARE", "YOURE", "I DONT", "I FEEL", "WHY DONT YOU", "WHY CANT I","ARE YOU", "I CANT", "I AM", " IM ", "YOU", "I WANT", "WHAT", "HOW", "WHO", "WHERE","WHEN", "WHY... | gpl-3.0 |
StuartLittlefair/astropy | astropy/modeling/tests/test_constraints.py | 1 | 22843 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# pylint: disable=invalid-name
import types
import pytest
import numpy as np
from numpy.testing import assert_allclose
from numpy.random import RandomState
from astropy.modeling.core import Fittable1DModel
from astropy.modeling.parameters import Paramet... | bsd-3-clause |
luniv/servo | python/mach/mach/base.py | 22 | 3492 | # 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 __future__ import unicode_literals
class CommandContext(object):
"""Holds run-time state so it can easily be ... | mpl-2.0 |
gojira/tensorflow | tensorflow/contrib/tpu/python/tpu/session_support.py | 16 | 12608 | # 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.