repo_name
stringlengths
6
100
path
stringlengths
4
294
copies
stringlengths
1
5
size
stringlengths
4
6
content
stringlengths
606
896k
license
stringclasses
15 values
RyanSkraba/beam
sdks/python/apache_beam/coders/typecoders.py
1
8078
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
apache-2.0
arnaud-morvan/QGIS
python/plugins/processing/algs/qgis/HypsometricCurves.py
4
9490
# -*- coding: utf-8 -*- """ *************************************************************************** HypsometricCurves.py --------------------- Date : November 2014 Copyright : (C) 2014 by Alexander Bruy Email : alexander dot bruy at gmail dot com ******...
gpl-2.0
rsvip/Django
tests/migrations/test_executor.py
202
24097
from django.apps.registry import apps as global_apps from django.db import connection from django.db.migrations.executor import MigrationExecutor from django.db.migrations.graph import MigrationGraph from django.db.migrations.recorder import MigrationRecorder from django.db.utils import DatabaseError from django.test i...
bsd-3-clause
NetDBNCKU/GAE-Conference-Web-App
django/contrib/admin/views/decorators.py
100
1285
from functools import wraps from django.utils.translation import ugettext as _ from django.contrib.admin.forms import AdminAuthenticationForm from django.contrib.auth.views import login from django.contrib.auth import REDIRECT_FIELD_NAME def staff_member_required(view_func): """ Decorator for views that checks...
bsd-3-clause
sunshinelover/chanlun
vn.trader/ctaAlgo/uiChanlunWidget.py
1
68647
# encoding: UTF-8 """ 缠论模块相关的GUI控制组件 """ from vtGateway import VtSubscribeReq from uiBasicWidget import QtGui, QtCore, BasicCell,BasicMonitor,TradingWidget from eventEngine import * from ctaBase import * import pyqtgraph as pg import numpy as np import pymongo from pymongo.errors import * from datetime import datetime...
mit
dracos/django
tests/gis_tests/gdal_tests/test_srs.py
80
12842
import unittest from django.contrib.gis.gdal import ( CoordTransform, GDALException, SpatialReference, SRSException, ) class TestSRS: def __init__(self, wkt, **kwargs): self.wkt = wkt for key, value in kwargs.items(): setattr(self, key, value) WGS84_proj = '+proj=longlat +ellps=...
bsd-3-clause
blsmit5728/PokeAlarm
PokeAlarm/Events/MonEvent.py
1
13089
# Standard Library Imports from datetime import datetime # 3rd Party Imports # Local Imports from PokeAlarm import Unknown from PokeAlarm.Utilities import MonUtils from PokeAlarm.Utils import ( get_gmaps_link, get_move_type, get_move_damage, get_move_dps, get_move_duration, get_move_energy, get_pokemon_size, ...
agpl-3.0
robbymeals/scikit-learn
sklearn/externals/joblib/numpy_pickle.py
194
19716
""" Utilities for fast persistence of big data, with optional compression. """ # Author: Gael Varoquaux <gael dot varoquaux at normalesup dot org> # Copyright (c) 2009 Gael Varoquaux # License: BSD Style, 3 clauses. import pickle import traceback import sys import os import zlib import warnings import struct import c...
bsd-3-clause
rahushen/ansible
lib/ansible/modules/windows/win_user.py
52
5133
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2014, Matt Martz <matt@sivel.net>, and others # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # this is a windows documentation stub. actual code lives in the .ps1 # file of the same name ANSIBLE_METADATA = {'met...
gpl-3.0
fiunchinho/ansible-modules-extras
system/open_iscsi.py
89
11683
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Serge van Ginderachter <serge@vanginderachter.be> # # 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 vers...
gpl-3.0
ryanGT/sympy
sympy/thirdparty/pyglet/pyglet/image/codecs/pypng.py
5
41165
# ---------------------------------------------------------------------------- # pyglet # Copyright (c) 2006-2007 Alex Holkner # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistribu...
bsd-3-clause
PLyczkowski/Sticky-Keymap
2.74/scripts/addons/io_anim_bvh/__init__.py
1
8032
# ##### BEGIN GPL LICENSE BLOCK ##### # # 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 distrib...
gpl-2.0
desihub/desimodel
py/desimodel/weather.py
1
15591
# See LICENSE.rst for BSD 3-clause license info # -*- coding: utf-8 -*- """ desimodel.weather ================= Model of the expected weather conditions at KPNO during the DESI survey. To generate a random time series of expected FWHM seeing in arcsecs and atmospheric transparency, use, for example:: n = 10000 ...
bsd-3-clause
robbiet480/home-assistant
homeassistant/components/agent_dvr/__init__.py
5
2201
"""Support for Agent.""" import asyncio import logging from agent import AgentError from agent.a import Agent from homeassistant.exceptions import ConfigEntryNotReady from homeassistant.helpers import device_registry as dr from homeassistant.helpers.aiohttp_client import async_get_clientsession from .const import CO...
apache-2.0
dh4nav/lammps
tools/moltemplate/examples/coarse_grained_examples/chromosome_metaphase_Naumova2013/moltemplate_files/interpolate_coords.py
22
1934
#!/usr/bin/env python err_msg = """ Usage: interpolate_coords.py Ndesired [scale] < coords_orig.raw > coords.raw Example: interpolate_coords.py 30118 3.0 < coords_orig.raw > coords.raw # (Note: 30117 ~= 128000/4.25, but using 30118 makes interpolation cleaner. # See the supplemental section of ...
gpl-2.0
grevutiu-gabriel/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/style/checkers/common.py
203
3229
# Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org) # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and...
bsd-3-clause
MartinEnder/erpnext-de
erpnext/accounts/party.py
4
11993
# 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,...
agpl-3.0
bgreenlee/sublime-github
lib/requests/packages/urllib3/connectionpool.py
57
21510
# urllib3/connectionpool.py # Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt) # # This module is part of urllib3 and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php import logging import socket import errno from socket import error as SocketError, time...
mit
dfalt974/SickRage
lib/chardet/gb2312freq.py
343
20715
######################## 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
Hellowlol/PyTunes
libs/simplejson/tests/test_namedtuple.py
147
4004
from __future__ import absolute_import import unittest import simplejson as json from simplejson.compat import StringIO try: from collections import namedtuple except ImportError: class Value(tuple): def __new__(cls, *args): return tuple.__new__(cls, args) def _asdict(self): ...
gpl-3.0
taoliu/taolib
Scripts/kmeans2image.py
1
1598
#!/usr/bin/env python # Time-stamp: <2009-04-14 14:07:21 Tao Liu> import os import sys import re from PIL import Image, ImageDraw # ------------------------------------ # Main function # ------------------------------------ help_message = """ Draw the K-means clustering result. need 6 parameter: %s <kmeans_file> <li...
bsd-3-clause
inspyration/odoo
addons/l10n_ch/__init__.py
424
1212
# -*- coding: utf-8 -*- ############################################################################## # # Author: Nicolas Bessi. Copyright Camptocamp SA # Financial contributors: Hasa SA, Open Net SA, # Prisme Solutions Informatique SA, Quod SA # # Translation contributors: brain-te...
agpl-3.0
nzavagli/UnrealPy
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/django-1.8.2/django/contrib/gis/geos/prepared.py
137
2437
from .base import GEOSBase from .error import GEOSException from .geometry import GEOSGeometry from .libgeos import geos_version_info from .prototypes import prepared as capi class PreparedGeometry(GEOSBase): """ A geometry that is prepared for performing certain operations. At the moment this includes th...
mit
vipullakhani/mi-instrument
mi/instrument/kml/cam/camds/test/test_driver.py
6
32447
""" @package mi.instrument.kml.cam.camds.driver @file marine-integrations/mi/instrument/kml/cam/camds/test/test_driver.py @author Sung Ahn @brief Test Driver for CAMDS Release notes: """ __author__ = 'Sung Ahn' __license__ = 'Apache 2.0' import copy import time from nose.plugins.attrib import attr from mock import ...
bsd-2-clause
TripleSnail/blender-zombie
python/text.py
1
1754
# ##### BEGIN GPL LICENSE BLOCK ##### # # 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 distrib...
gpl-2.0
salguarnieri/intellij-community
python/helpers/pydev/pydev_run_in_console.py
8
2131
''' Entry point module to run a file in the interactive console. ''' from pydevconsole import * from _pydev_bundle import pydev_imports from _pydevd_bundle.pydevd_utils import save_main_module def run_file(file, globals=None, locals=None): if os.path.isdir(file): new_target = os.path.join(file, '__main__...
apache-2.0
renyi/drum
drum/links/templatetags/drum_tags.py
1
1472
from __future__ import unicode_literals from collections import defaultdict from django.template.defaultfilters import timesince from mezzanine import template from mezzanine.generic.models import ThreadedComment from drum.links.utils import order_by_score from drum.links.models import LinkCategory from drum.links.v...
bsd-2-clause
vabue/RatticWeb
staff/importloaders.py
8
1208
from keepassdb import Database from django.utils.encoding import smart_text def keepass(filep, password): groups = [] entries = [] groupstack = [] db = Database(filep, password) _walkkeepass(groups, entries, groupstack, db.root) return {'tags': groups, 'entries': entries} def _walkkeepass...
gpl-2.0
piotroxp/scibibscan
scib/lib/python3.6/site-packages/setuptools/dist.py
45
37129
__all__ = ['Distribution'] import re import os import warnings import numbers import distutils.log import distutils.core import distutils.cmd import distutils.dist from distutils.errors import (DistutilsOptionError, DistutilsPlatformError, DistutilsSetupError) from distutils.util import rfc822_escape from setupto...
mit
Alberto-Beralix/Beralix
i386-squashfs-root/usr/lib/python2.7/Queue.py
188
8561
"""A multi-producer, multi-consumer queue.""" from time import time as _time try: import threading as _threading except ImportError: import dummy_threading as _threading from collections import deque import heapq __all__ = ['Empty', 'Full', 'Queue', 'PriorityQueue', 'LifoQueue'] class Empty(Exception): "...
gpl-3.0
meghana1995/sympy
sympy/physics/quantum/tests/test_gate.py
88
11664
from sympy import exp, symbols, sqrt, I, pi, Mul, Integer, Wild from sympy.core.compatibility import range from sympy.matrices import Matrix from sympy.physics.quantum.gate import (XGate, YGate, ZGate, random_circuit, CNOT, IdentityGate, H, X, Y, S, T, Z, SwapGate, gate_simp, gate_sort, CNotGate, TGate...
bsd-3-clause
grantsewell/nzbToMedia
libs/xdg/RecentFiles.py
17
6137
""" Implementation of the XDG Recent File Storage Specification Version 0.2 http://standards.freedesktop.org/recent-file-spec """ import xml.dom.minidom, xml.sax.saxutils import os, time, fcntl from xdg.Exceptions import ParsingError class RecentFiles: def __init__(self): self.RecentFiles = [] sel...
gpl-3.0
sugarguo/Flask_Blog
ext_lib/pip/_vendor/requests/packages/urllib3/contrib/pyopenssl.py
216
13871
'''SSL with SNI_-support for Python 2. This needs the following packages installed: * pyOpenSSL (tested with 0.13) * ndg-httpsclient (tested with 0.3.2) * pyasn1 (tested with 0.1.6) To activate it call :func:`~urllib3.contrib.pyopenssl.inject_into_urllib3`. This can be done in a ``sitecustomize`` module, or at any o...
gpl-3.0
liaoqingwei/flask
setup.py
141
2096
""" Flask ----- Flask is a microframework for Python based on Werkzeug, Jinja 2 and good intentions. And before you ask: It's BSD licensed! Flask is Fun ```````````` Save in a hello.py: .. code:: python from flask import Flask app = Flask(__name__) @app.route("/") def hello(): return "Hell...
bsd-3-clause
gdsfactory/gdsfactory
pp/layers.py
1
9564
"""A GDS layer is a tuple of two integers. You can: - Define your layers in a dataclass - Load it from Klayout XML file (.lyp) LayerSet adapted from phidl.device_layout load_lyp, name_to_description, name_to_short_name adapted from phidl.utilities preview_layerset adapted from phidl.geometry """ import pathlib from ...
mit
n4hy/gnuradio
gr-shd/grc/gen_shd_smini_blocks.py
17
8247
""" Copyright 2011 Free Software Foundation, Inc. This file is part of GNU Radio GNU Radio Companion is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later...
gpl-3.0
labordoc/labordoc-next
modules/bibformat/lib/bibformat_xslt_engine.py
7
23437
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2007, 2008, 2009, 2010, 2011 CERN. ## ## Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## Licens...
gpl-2.0
mensler/ansible
lib/ansible/modules/cloud/azure/azure_rm_publicipaddress_facts.py
68
6200
#!/usr/bin/python # # Copyright (c) 2016 Matt Davis, <mdavis@ansible.com> # Chris Houseknecht, <house@redhat.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 Soft...
gpl-3.0
ddico/project
project_baseuser/project.py
28
1678
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2013 Daniel Reis # # This program 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...
agpl-3.0
alissonperez/django-onmydesk
onmydesk/utils.py
1
1501
"""Module with common utilities to this package""" import re from datetime import timedelta import importlib def my_import(class_name): """ Usage example:: Report = my_import('myclass.models.Report') model_instance = Report() model_instance.name = 'Test' model_instance.save()...
mit
yfried/ansible
lib/ansible/modules/network/iosxr/iosxr_command.py
40
6710
#!/usr/bin/python # # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'],...
gpl-3.0
CasataliaLabs/biscuit_drishtiman
Pmw-2.0.0/Pmw/Pmw_2_0_0/demos/Args.py
2
6332
"""Handle command line arguments. This module contains functions to parse and access the arguments given to the program on the command line. """ import types import string import sys # Symbolic constants for the indexes into an argument specifier tuple. NAME = 0 MANDATORY = 1 TYPE = 2 H...
gpl-3.0
jtorrents/networkx
networkx/algorithms/richclub.py
47
3516
# -*- coding: utf-8 -*- import networkx as nx __author__ = """\n""".join(['Ben Edwards', 'Aric Hagberg <hagberg@lanl.gov>']) __all__ = ['rich_club_coefficient'] def rich_club_coefficient(G, normalized=True, Q=100): """Return the rich-club coefficient of the graph G. The rich-club ...
bsd-3-clause
bradallred/gemrb
gemrb/GUIScripts/iwd2/Abilities.py
1
7433
# GemRB - Infinity Engine Emulator # Copyright (C) 2003 The GemRB Project # # 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 versi...
gpl-2.0
Southpaw-TACTIC/Team
src/python/Lib/site-packages/pythonwin/pywin/tools/browseProjects.py
1
8295
import hierlist, string, regutil, os import win32con, win32ui, win32api import commctrl from pywin.mfc import dialog import glob import pyclbr import pywin.framework.scriptutils import afxres class HLIErrorItem(hierlist.HierListItem): def __init__(self, text): self.text = text hierlist.HierListItem.__...
epl-1.0
markmichaelrichter/Heroku_Buildpack
test/django-1.3-skeleton/haystack/settings.py
81
5035
# Django settings for haystack project. DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@example.com'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. 'NAME':...
mit
qrkourier/ansible
lib/ansible/plugins/strategy/debug.py
20
5917
# 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
thoughtpalette/thoughts.thoughtpalette.com
node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-2.7/pygments/styles/friendly.py
364
2515
# -*- coding: utf-8 -*- """ pygments.styles.friendly ~~~~~~~~~~~~~~~~~~~~~~~~ A modern style based on the VIM pyte theme. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.style import Style from pygments.token import Keyw...
mit
Commonists/SurfaceImageContentGap
surfaceimagecontentgap/rc.py
1
2812
from argparse import ArgumentParser import datetime import time from surfaceimagecontentgap.imagegap import isthereanimage from surfaceimagecontentgap.bot import SurfaceContentGapBot def last_rc_time(site): """Datetime of last change.""" rc = site.recentchanges() last_rev = rc.next() return datetime...
mit
vitalyvolkov/fontbakery
bakery/project/views.py
1
16523
# coding: utf-8 # Copyright 2013 The Font Bakery 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 re...
apache-2.0
WildfireDEV/android_kernel_samsung_s6
tools/perf/scripts/python/check-perf-trace.py
11214
2503
# perf script event handlers, generated by perf script -g python # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # This script tests basic functionality such as flag and symbol # strings, common_xxx() calls back into perf, begin, end, unhandled # events, etc. ...
gpl-2.0
robbiet480/home-assistant
homeassistant/components/input_select/reproduce_state.py
16
2636
"""Reproduce an Input select state.""" import asyncio import logging from types import MappingProxyType from typing import Any, Dict, Iterable, Optional from homeassistant.const import ATTR_ENTITY_ID from homeassistant.core import Context, State from homeassistant.helpers.typing import HomeAssistantType from . import...
apache-2.0
crosswalk-project/crosswalk-test-suite
misc/sampleapp-android-tests/sampleapp/spacedodgegame_manifestorientationscale.py
14
4198
#!/usr/bin/env python # # Copyright (c) 2015 Intel Corporation. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of works must retain the original copyright notice, this # list of conditions and t...
bsd-3-clause
BonexGu/Blik2D-SDK
Blik2D/addon/tensorflow-1.2.1_for_blik/tensorflow/contrib/keras/__init__.py
60
1261
# -*- coding: utf-8 -*- # 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 # # Un...
mit
AutorestCI/azure-sdk-for-python
azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_regenerate_key_parameters.py
4
1068
# 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 ...
mit
ehsan/airmozilla
airmozilla/manage/views/locations.py
9
5376
import collections from django import http from django.contrib import messages from django.shortcuts import render, redirect, get_object_or_404 from django.db import transaction from jsonview.decorators import json_view from airmozilla.main.models import ( Event, Location, SuggestedEvent, LocationDef...
bsd-3-clause
mskrzypkows/servo
tests/wpt/web-platform-tests/referrer-policy/generic/tools/spec_validator.py
326
6673
#!/usr/bin/env python import json, sys from common_paths import * def assert_non_empty_string(obj, field): assert field in obj, 'Missing field "%s"' % field assert isinstance(obj[field], basestring), \ 'Field "%s" must be a string' % field assert len(obj[field]) > 0, 'Field "%s" must not be empty'...
mpl-2.0
creasyw/IMTAphy
documentation/doctools/tags/0.3/sphinx/web/markup.py
4
7490
# -*- coding: utf-8 -*- """ sphinx.web.markup ~~~~~~~~~~~~~~~~~ Awfully simple markup used in comments. Syntax: `this is some <code>` like <tt> in HTML ``this is like ` just that i can contain backticks`` like <tt> in HTML *emphasized* translates to <em class="importa...
gpl-2.0
Purg/SMQTK
python/smqtk/bin/classifyFiles.py
1
5843
""" Based on an input, trained classifier configuration, classify a number of media files, whose descriptor is computed by the configured descriptor generator. Input files that classify as the given label are then output to standard out. Thus, this script acts like a filter. """ import glob import json import logging i...
bsd-3-clause
tumbl3w33d/ansible
lib/ansible/modules/network/onyx/onyx_buffer_pool.py
37
4908
#!/usr/bin/python # # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
gpl-3.0
bgris/ODL_bgris
lib/python3.5/site-packages/odl/util/graphics.py
1
15419
# Copyright 2014-2016 The ODL development group # # This file is part of ODL. # # ODL is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. #...
gpl-3.0
kylejusticemagnuson/pyti
tests/test_stochastic.py
1
15612
from __future__ import absolute_import import unittest import numpy as np from tests.sample_data import SampleData from pyti import stochastic class TestStochastic(unittest.TestCase): def setUp(self): """Create data to use for testing.""" self.data = SampleData().get_sample_close_data() ...
mit
kenshay/ImageScripter
Script_Runner/PYTHON/Lib/site-packages/setuptools/command/install_lib.py
431
3840
import os import imp from itertools import product, starmap import distutils.command.install_lib as orig class install_lib(orig.install_lib): """Don't add compiled flags to filenames of non-Python files""" def run(self): self.build() outfiles = self.install() if outfiles is not None: ...
gpl-3.0
edcast-inc/edx-platform-edcast
common/djangoapps/student/tests/test_login.py
1
25194
''' Tests for student activation and login ''' import json import unittest from unittest import skip from django.test import TestCase from django.test.client import Client from django.test.utils import override_settings from django.conf import settings from django.core.cache import cache from django.core.urlresolvers i...
agpl-3.0
endlessm/chromium-browser
net/tools/build_hpack_constants.py
43
18730
#!/usr/bin/env python # Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """This script builds a table that has to be manully inserted into net/spdy/hpack/hpack_constants.cc. It also contains data that poten...
bsd-3-clause
yantrabuddhi/blocos
tabs/UploadTab.py
1
13455
# -*- coding: utf-8 -*- # Este arquivo é parte do programa Monitor # Monitor é um software livre; você pode redistribui-lo e/ou # modifica-lo dentro dos termos da Licença Pública Geral GNU como # publicada pela Fundação do Software Livre (FSF); na versão 3 da # Licença, ou (na sua opinião) qualquer versão. # # Este...
gpl-3.0
thaumos/ansible
test/integration/targets/module_precedence/multiple_roles/foo/library/ping.py
480
2146
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # (c) 2016, Toshio Kuratomi <tkuratomi@ansible.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...
gpl-3.0
Spiderlover/Toontown
toontown/cogdominium/DistCogdoMazeGameAI.py
4
1117
from direct.directnotify import DirectNotifyGlobal from toontown.cogdominium.DistCogdoGameAI import DistCogdoGameAI class DistCogdoMazeGameAI(DistCogdoGameAI): notify = DirectNotifyGlobal.directNotify.newCategory("DistCogdoMazeGameAI") def requestAction(self, todo0, todo1): pass def doAction(self...
mit
fureszpeter/a2billing
CallBack/callback-daemon-py/setup.py
6
2172
# This file is part of A2Billing (http://www.a2billing.net/) # # A2Billing, Commercial Open Source Telecom Billing platform, # powered by Star2billing S.L. <http://www.star2billing.com/> # # @copyright Copyright (C) 2004-2015 - Star2billing S.L. # @author Belaid Arezqui <areski@gmail.com> # @license http://w...
agpl-3.0
liquidg3/altair
node_modules/npm/node_modules/node-gyp/gyp/tools/pretty_sln.py
1831
5099
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Prints the information in a sln file in a diffable way. It first outputs each projects in alphabetical order with their dependenci...
mit
edcast-inc/edx-platform-edcast
docs/en_us/platform_api/source/conf.py
23
6203
# -*- coding: utf-8 -*- # pylint: disable=invalid-name # pylint: disable=redefined-builtin # pylint: disable=protected-access # pylint: disable=unused-argument import os from path import path import sys import mock MOCK_MODULES = [ 'lxml', 'requests', 'xblock', 'fields', 'xblock.fields', 'fram...
agpl-3.0
vanng822/cssutils
src/cssutils/tests/test_mediaquery.py
3
3579
# -*- coding: iso-8859-1 -*- """Testcases for cssutils.stylesheets.MediaQuery""" import xml.dom import basetest import cssutils.stylesheets class MediaQueryTestCase(basetest.BaseTestCase): def setUp(self): super(MediaQueryTestCase, self).setUp() self.r = cssutils.stylesheets.MediaQuery...
gpl-3.0
AnumSheraz/IP-Controlled-Robotic-Car
Manual-IP-Controlled-Robotic-Car/Code.py
1
1696
import sys from PyQt4 import QtGui, QtCore import time, socket, json from main import Ui_MainWindow s=socket.socket(socket.AF_INET,socket.SOCK_DGRAM) IP = "localhost" PORT = 8001 class main_menu(QtGui.QMainWindow): def __init__(self): super(main_menu, self).__init__() self.ui=Ui_MainWindow() ...
gpl-2.0
DanielNeugebauer/adhocracy
src/adhocracy/lib/util.py
4
4767
import collections import logging import os import os.path import shutil import time import uuid from pylons import config from pylons.i18n import _ log = logging.getLogger(__name__) def timedelta2seconds(delta): """ Convert a given timedelta to a number of seconds """ return ((delta.microseconds / 1000000....
agpl-3.0
gooddata/openstack-nova
nova/pci/whitelist.py
5
3433
# Copyright (c) 2013 Intel, Inc. # 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/li...
apache-2.0
yongshengwang/hue
build/env/lib/python2.7/site-packages/Django-1.6.10-py2.7.egg/django/contrib/staticfiles/management/commands/findstatic.py
123
1282
from __future__ import unicode_literals import os from optparse import make_option from django.core.management.base import LabelCommand from django.utils.encoding import force_text from django.contrib.staticfiles import finders class Command(LabelCommand): help = "Finds the absolute paths for the given static fi...
apache-2.0
robinro/ansible
test/units/parsing/utils/test_addresses.py
135
3742
# -*- coding: utf-8 -*- import unittest from ansible.parsing.utils.addresses import parse_address class TestParseAddress(unittest.TestCase): tests = { # IPv4 addresses '192.0.2.3': ['192.0.2.3', None], '192.0.2.3:23': ['192.0.2.3', 23], # IPv6 addresses '::': ['::', Non...
gpl-3.0
Yuriy-Leonov/nova
nova/tests/virt/libvirt/test_designer.py
12
1298
# Copyright (C) 2013 eNovance SAS <licensing@enovance.com> # # Author: Cyril Roelandt <cyril.roelandt@enovance.com> # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache....
apache-2.0
robjohnson189/home-assistant
homeassistant/components/sensor/tellstick.py
19
3900
""" Support for Tellstick sensors. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.tellstick/ """ import logging from collections import namedtuple import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassi...
mit
abdellatifkarroum/odoo
addons/calendar/contacts.py
389
1414
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2011 OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GN...
agpl-3.0
hongtoushizi/kids
test/funcational/qps.py
6
1847
#! /usr/bin/env python # coding=utf-8 import redis from multiprocessing import Process, Queue from time import sleep KIDS_HOST = {'host': 't-infra', 'port': 3389} def publisher(topics): red = redis.StrictRedis(**KIDS_HOST) i = 0 while True: for topic in topics: red.publish(topic, topic...
bsd-3-clause
mkaluza/external_chromium_org
tools/perf/metrics/io.py
24
2489
# 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. from metrics import Metric class IOMetric(Metric): """IO-related metrics, obtained via telemetry.core.Browser.""" @classmethod def CustomizeBrowserOp...
bsd-3-clause
SeanCameronConklin/aima-python
submissions/Porter/vacuum2Runner.py
18
6343
import agents as ag import envgui as gui # change this line ONLY to refer to your project import submissions.Porter.vacuum2 as v2 # ______________________________________________________________________________ # Vacuum environmenty class Dirt(ag.Thing): pass class VacuumEnvironment(ag.XYEnvironment): """Th...
mit
be-cloud-be/horizon-addons
horizon/school_evaluations/wizard/evaluation_summary.py
1
3973
# -*- encoding: utf-8 -*- ############################################################################## # # Copyright (c) 2015 be-cloud.be # Jerome Sonnet <jerome.sonnet@be-cloud.be> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU ...
agpl-3.0
chen2aaron/SnirteneCodes
JustForFUN/v2ex_mission.py
1
1598
# -*- coding: utf-8 -*- import re USE_SOCKS_PROXY = 0 if USE_SOCKS_PROXY: import requesocks as requests else: import requests # import socks, socket # socks.set_default_proxy(socks.SOCKS5, "127.0.0.1", 1080) # socket.socket = socks.socksocket username = 'x@gmail.com' password = 'xyz' host = 'http://www.v2ex....
gpl-2.0
HLFH/CouchPotatoServer
libs/CodernityDB/database_safe_shared.py
44
8158
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2011-2013 Codernity (http://codernity.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/L...
gpl-3.0
rubikloud/gpdb
gpMgmt/bin/gppylib/programs/gppkg.py
19
11246
# Line too long - pylint: disable=C0301 # Copyright (c) Greenplum Inc 2011. All Rights Reserved. from optparse import OptionGroup import os import sys import tarfile try: from gppylib import gplog, pgconf from gppylib.commands import gp from gppylib.commands.base import Command, ExecutionError from gp...
apache-2.0
migihajami/memin
memin/frontend.py
1
10715
__author__ = 'algol' import cherrypy from jinja2 import Environment, PackageLoader import memin.core as mc from configparser import ConfigParser class Menu: def __init__(self): self.menu = [ {'name': 'Главная', 'link': '/'}, {'name': 'Персоны', 'link': '/persons'}, {'n...
bsd-3-clause
eXistenZNL/SickRage
lib/unidecode/x0c1.py
253
4765
data = ( 'syae', # 0x00 'syaeg', # 0x01 'syaegg', # 0x02 'syaegs', # 0x03 'syaen', # 0x04 'syaenj', # 0x05 'syaenh', # 0x06 'syaed', # 0x07 'syael', # 0x08 'syaelg', # 0x09 'syaelm', # 0x0a 'syaelb', # 0x0b 'syaels', # 0x0c 'syaelt', # 0x0d 'syaelp', # 0x0e 'syaelh', # 0x...
gpl-3.0
eckucukoglu/arm-linux-gnueabihf
lib/python2.7/site-packages/sepolicy/templates/network.py
5
13603
# Copyright (C) 2007-2012 Red Hat # see file 'COPYING' for use and warranty information # # policygentool is a tool for the initial generation of SELinux policy # # 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 ...
gpl-2.0
Klaudit/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/steps/runtests_unittest.py
123
3157
# Copyright (C) 2011 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 f...
bsd-3-clause
YZHANGFPE/baxter_pykdl
src/urdf_parser_py/xml_reflection/basics.py
19
2400
import string import yaml import collections from lxml import etree # Different implementations mix well it seems # @todo Do not use this? from xml.etree.ElementTree import ElementTree def xml_string(rootXml, addHeader = True): # Meh xmlString = etree.tostring(rootXml, pretty_print = True) if addHeader: ...
bsd-3-clause
pepetreshere/odoo
addons/point_of_sale/models/pos_payment_method.py
4
4154
from odoo import api, fields, models, _ from odoo.exceptions import UserError class PosPaymentMethod(models.Model): """ Used to classify pos.payment. Generic characteristics of a pos.payment is described in this model. E.g. A cash payment can be described by a pos.payment.method with fields: is_cash_...
agpl-3.0
Roshan2017/spinnaker
testing/citest/tests/openstack_smoke_test.py
1
9447
# Copyright 2017 Veritas Technologies, LLC 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 appli...
apache-2.0
raintank/graphite-api
setup.py
1
2147
# coding: utf-8 import sys from setuptools import setup, find_packages install_requires = [ 'Flask', 'PyYAML', 'cairocffi', 'pyparsing>=1.5.7', 'pytz', 'six', 'tzlocal', ] if sys.version_info < (2, 7): install_requires.append('importlib') install_requires.append('logutils') in...
apache-2.0
freekh/three.js
utils/exporters/blender/addons/io_three/exporter/api/__init__.py
124
1502
import os import bpy from . import object as object_, mesh, material, camera, light from .. import logger def active_object(): """ :return: The actively selected object """ return bpy.context.scene.objects.active def batch_mode(): """ :return: Whether or not the session is interactive ...
mit
ThatRfernand/or-tools
examples/python/knapsack_cp.py
5
2364
# Copyright 2010 Hakan Kjellerstrand hakank@bonetmail.com # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
apache-2.0
chrplr/AIP2015
resources/python-scripts/icons.py
1
9336
goicon=[ "32 32 5 1", ". c None", "b c #008000", "a c #00c000", "# c #00ff00", "c c #ffffc0", "................................", "................................", "................................", "................................", "................................", "..........#.....................", "............
gpl-2.0
Fale/ansible
test/lib/ansible_test/_internal/encoding.py
51
1484
"""Functions for encoding and decoding strings.""" from __future__ import (absolute_import, division, print_function) __metaclass__ = type from . import types as t ENCODING = 'utf-8' Text = type(u'') def to_optional_bytes(value, errors='strict'): # type: (t.Optional[t.AnyStr], str) -> t.Optional[bytes] """Ret...
gpl-3.0
woobe/h2o
py/testdir_hosts/test_parse_summary_zip_s3_fvec.py
2
2594
import unittest, time, sys, random sys.path.extend(['.','..','py']) import h2o, h2o_cmd, h2o_hosts, h2o_glm, h2o_browse as h2b, h2o_import as h2i class Basic(unittest.TestCase): def tearDown(self): h2o.check_sandbox_for_errors() @classmethod def setUpClass(cls): global localhost lo...
apache-2.0