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 |
|---|---|---|---|---|---|
cysnake4713/wechatpy | wechatpy/client/api/material.py | 3 | 6144 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import requests
from wechatpy._compat import json
from wechatpy.client.api.base import BaseWeChatAPI
class WeChatMaterial(BaseWeChatAPI):
def add_articles(self, articles):
"""
新增永久图文素材
详情请参考
http://m... | mit |
RebuiltBits/django-paypal | paypal/pro/helpers.py | 4 | 13557 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
import logging
import pprint
import time
import requests
from django.conf import settings
from django.forms.models import fields_for_model
from django.http import QueryDict
from django.utils import timezone
from djan... | mit |
wangyao1052/PyLitMath | LitMath/Quaternion.py | 1 | 7864 | import math
import Util
class Quaternion(object):
__slots__ = ['x', 'y', 'z', 'w']
__hash__ = None
def __init__(self, x=0.0, y=0.0, z=0.0, w=1.0):
self.x = float(x)
self.y = float(y)
self.z = float(z)
self.w = float(w)
def set(self, x, y, z, w):
sel... | mit |
jumpstarter-io/cinder | cinder/flow_utils.py | 4 | 5897 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | apache-2.0 |
nvoron23/POSTMan-Chrome-Extension | tests/selenium/pmtests/postman_tests_header_presets.py | 104 | 4445 | from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support.select import Select
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.keys import Keys
import selenium.webdriver.chrome.service as service
import inspect
... | apache-2.0 |
Microvellum/Fluid-Designer | win64-vc/2.78/python/lib/site-packages/numpy/distutils/cpuinfo.py | 173 | 22970 | #!/usr/bin/env python
"""
cpuinfo
Copyright 2002 Pearu Peterson all rights reserved,
Pearu Peterson <pearu@cens.ioc.ee>
Permission to use, modify, and distribute this software is given under the
terms of the NumPy (BSD style) license. See LICENSE.txt that came with
this distribution for specifics.
NO WARRANTY IS EXP... | gpl-3.0 |
xuyuhan/depot_tools | third_party/pylint/config.py | 67 | 5782 | # Copyright (c) 2003-2013 LOGILAB S.A. (Paris, FRANCE).
# 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... | bsd-3-clause |
christophlsa/odoo | addons/hw_escpos/escpos/exceptions.py | 170 | 2884 | """ ESC/POS Exceptions classes """
import os
class Error(Exception):
""" Base class for ESC/POS errors """
def __init__(self, msg, status=None):
Exception.__init__(self)
self.msg = msg
self.resultcode = 1
if status is not None:
self.resultcode = status
def __st... | agpl-3.0 |
cwu2011/scikit-learn | examples/linear_model/plot_lasso_coordinate_descent_path.py | 254 | 2639 | """
=====================
Lasso and Elastic Net
=====================
Lasso and elastic net (L1 and L2 penalisation) implemented using a
coordinate descent.
The coefficients can be forced to be positive.
"""
print(__doc__)
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# License: BSD 3 clause
import num... | bsd-3-clause |
PlanTool/plantool | GUI/plantool/ipp.py | 3 | 2579 | # This file was automatically generated by SWIG (http://www.swig.org).
# Version 3.0.8
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info
if version_info >= (2, 6, 0):
def swig_import_helper():
from os.path imp... | gpl-2.0 |
beiko-lab/gengis | bin/Lib/traceback.py | 53 | 11574 | """Extract, format and print information about Python stack traces."""
import linecache
import sys
import types
__all__ = ['extract_stack', 'extract_tb', 'format_exception',
'format_exception_only', 'format_list', 'format_stack',
'format_tb', 'print_exc', 'format_exc', 'print_exception',... | gpl-3.0 |
lhl/pensieve | js/node_modules/prosemirror/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py | 1407 | 47697 | # 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.
"""
This module helps emulate Visual Studio 2008 behavior on top of other
build systems, primarily ninja.
"""
import os
import re
import subprocess
import sys
fr... | gpl-3.0 |
craynot/django | tests/apps/tests.py | 54 | 16296 | from __future__ import unicode_literals
import os
import warnings
from unittest import skipUnless
from django.apps import AppConfig, apps
from django.apps.registry import Apps
from django.contrib.admin.models import LogEntry
from django.core.exceptions import AppRegistryNotReady, ImproperlyConfigured
from django.db i... | bsd-3-clause |
dga4654dan/UTM-Demo | V_1_0_2_1/UtmDemo_Sfs_2.9.0/UtmDemo_Sfs_2.9.0_Server/lib/Lib/xml/dom/pulldom.py | 8 | 11891 | import xml.sax
import xml.sax.handler
import types
try:
_StringTypes = [types.StringType, types.UnicodeType]
except AttributeError:
_StringTypes = [types.StringType]
START_ELEMENT = "START_ELEMENT"
END_ELEMENT = "END_ELEMENT"
COMMENT = "COMMENT"
START_DOCUMENT = "START_DOCUMENT"
END_DOCUMENT = "END_DOCUMENT"
... | gpl-2.0 |
avaitla/Haskell-to-C---Bridge | pygccxml-1.0.0/unittests/has_binary_operator_traits_tester.py | 1 | 1826 | # Copyright 2004-2008 Roman Yakovenko.
# Distributed under the Boost Software License, Version 1.0. (See
# accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
import unittest
import autoconfig
import parser_test_case
from pygccxml import utils
from pygccxml import parser
fr... | bsd-3-clause |
karlnapf/shogun | examples/undocumented/python/transfer_multitask_clustered_logistic_regression.py | 4 | 1634 | #!/usr/bin/env python
from numpy import array,hstack,sin,cos
from numpy.random import seed, rand
from tools.load import LoadMatrix
lm=LoadMatrix()
traindat = lm.load_numbers('../data/fm_train_real.dat')
testdat = lm.load_numbers('../data/fm_test_real.dat')
label_traindat = lm.load_labels('../data/label_train_twoclass.... | bsd-3-clause |
blkFinch/hutch-val-pair-project | AdventureGameMain.py | 1 | 6122 | '''
This is our main file
'''
import random
from Player import Player
def intro(): #intro to the GAME
print('Good morning')
input('What a weird dream you woke from, huh? PRESS ENTER')
input('Maybe once you open your eyes ... PRESS ENTER')
input('You will see something IS a little off ... PRESS ENTER')... | mit |
HerlanAssis/Django-AulaOsvandoSantana | lib/python2.7/site-packages/setuptools/command/install.py | 206 | 4052 | import setuptools
import sys
import glob
from distutils.command.install import install as _install
from distutils.errors import DistutilsArgError
class install(_install):
"""Use easy_install to install the package, w/dependencies"""
user_options = _install.user_options + [
('old-and-unmanageable', Non... | mit |
hynnet/hiwifi-openwrt-HC5661-HC5761 | staging_dir/target-mipsel_r2_uClibc-0.9.33.2/usr/lib/python2.7/unittest/test/test_functiontestcase.py | 115 | 5534 | import unittest
from .support import LoggingResult
class Test_FunctionTestCase(unittest.TestCase):
# "Return the number of tests represented by the this test object. For
# TestCase instances, this will always be 1"
def test_countTestCases(self):
test = unittest.FunctionTestCase(lambda: None)
... | gpl-2.0 |
opendreambox/python-coherence | coherence/json.py | 5 | 3334 | # -*- coding: utf-8 -*-
# Licensed under the MIT license
# http://opensource.org/licenses/mit-license.php
import simplejson as json
from twisted.web import resource,static
from twisted.internet import defer
from coherence import log
class JsonInterface(resource.Resource,log.Loggable):
logCategory = 'json'
#... | mit |
BehavioralInsightsTeam/edx-platform | cms/djangoapps/contentstore/views/tests/test_access.py | 21 | 1669 | """
Tests access.py
"""
from django.contrib.auth.models import User
from django.test import TestCase
from opaque_keys.edx.locator import CourseLocator
from contentstore.views.access import get_user_role
from student.auth import add_users
from student.roles import CourseInstructorRole, CourseStaffRole
from student.test... | agpl-3.0 |
alaski/nova | nova/tests/unit/compute/test_compute_xen.py | 4 | 3115 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | apache-2.0 |
takeshineshiro/nova | nova/network/security_group/security_group_base.py | 60 | 9049 | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2011 Piston Cloud Computing, Inc.
# Copyright 2012 Red Hat, Inc.
# Copyright 2013 Nicira, Inc.
# All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (th... | apache-2.0 |
pramasoul/micropython | tests/extmod/framebuf1.py | 15 | 2168 | try:
import framebuf
except ImportError:
print("SKIP")
raise SystemExit
w = 5
h = 16
size = w * h // 8
buf = bytearray(size)
maps = {
framebuf.MONO_VLSB: "MONO_VLSB",
framebuf.MONO_HLSB: "MONO_HLSB",
framebuf.MONO_HMSB: "MONO_HMSB",
}
for mapping in maps.keys():
for x in range(size):
... | mit |
anthonybishopric/pyboxfs | setup.py | 1 | 2401 | #!/usr/bin/env python
#from distribute_setup import use_setuptools
#use_setuptools()
from setuptools import setup
import sys
PY3 = sys.version_info >= (3,)
VERSION = "0.4.1"
COMMANDS = ['fscat',
'fscp',
'fsinfo',
'fsls',
'fsmv',
'fscp',
'fsrm',... | bsd-3-clause |
modsy/incubator-airflow | airflow/operators/check_operator.py | 5 | 8837 | from builtins import zip
from builtins import str
import logging
from airflow.exceptions import AirflowException
from airflow.hooks import BaseHook
from airflow.models import BaseOperator
from airflow.utils.decorators import apply_defaults
class CheckOperator(BaseOperator):
"""
Performs checks against a db. ... | apache-2.0 |
wolverineav/horizon | openstack_dashboard/test/integration_tests/tests/test_volumes.py | 5 | 16332 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | apache-2.0 |
CapeSepias/owning-a-home | test/browser_testing/features/steps/steps_navigation.py | 8 | 4553 | # coding: utf-8
from behave import given, when, then
from hamcrest.core import assert_that, equal_to
from hamcrest.library.text.stringcontains import contains_string
from decorators import *
from pages.home import Home
from pages.base import Base
from pages.utils import Utils
# XPATH LOCATORS
# RELATIVE URL'S
HOME =... | cc0-1.0 |
konstruktoid/ansible-upstream | lib/ansible/module_utils/infinibox.py | 135 | 3673 | # -*- coding: utf-8 -*-
# This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own lic... | gpl-3.0 |
cloudera/hue | desktop/core/ext-py/Django-1.11.29/django/core/management/commands/dumpdata.py | 72 | 8692 | import warnings
from collections import OrderedDict
from django.apps import apps
from django.core import serializers
from django.core.management.base import BaseCommand, CommandError
from django.core.management.utils import parse_apps_and_model_labels
from django.db import DEFAULT_DB_ALIAS, router
class ProxyModelWa... | apache-2.0 |
intelligenia/django-cmsutils | cmsutils/search.py | 3 | 2049 | import re
from django.db.models import Q
def normalize_query(query_string,
findterms=re.compile(r'"([^"]+)"|(\S+)').findall,
normspace=re.compile(r'\s{2,}').sub):
''' Splits the query string in invidual keywords, getting rid of unecessary spaces
and grouping quoted ... | lgpl-3.0 |
jkyeung/XlsxWriter | xlsxwriter/test/comparison/test_autofilter07.py | 1 | 2715 | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2016, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparsion_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""... | bsd-2-clause |
AICP/external_chromium_org | tools/telemetry/telemetry/timeline/counter.py | 8 | 2400 | # 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.
import telemetry.timeline.event_container as event_container
# Doesn't inherit from TimelineEvent because its only a temporary wrapper of a
# counter sample... | bsd-3-clause |
popazerty/beyonwiz-4.1 | lib/python/Components/Renderer/PositionGauge.py | 132 | 1892 | from Renderer import Renderer
from enigma import ePositionGauge
class PositionGauge(Renderer):
def __init__(self):
Renderer.__init__(self)
self.__position = 0
self.__seek_position = 0
self.__length = 0
self.__seek_enable = 0
self.__cutlist = [ ]
GUI_WIDGET = ePositionGauge
def postWidgetCreate(self, i... | gpl-2.0 |
krafczyk/spack | var/spack/repos/builtin/packages/r-prodlim/package.py | 5 | 2024 | ##############################################################################
# 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 |
protagora/device_network_protocol | middleware/config/config.py | 1 | 8717 | import os
from dna.middleware.util.format import ConfigurationFormatFactory
class ConfigurationException(Exception):
pass
class Configuration(object):
# file write formats: json, yaml, xml...
FORMAT_JSON = ConfigurationFormatFactory.FORMAT_JSON
ERROR_READING_CONFIG = "Error reading configuration"
... | mit |
goldeneye-source/ges-python | lib/msilib/schema.py | 90 | 81583 | from . import Table
_Validation = Table('_Validation')
_Validation.add_field(1,'Table',11552)
_Validation.add_field(2,'Column',11552)
_Validation.add_field(3,'Nullable',3332)
_Validation.add_field(4,'MinValue',4356)
_Validation.add_field(5,'MaxValue',4356)
_Validation.add_field(6,'KeyTable',7679)
_Validation.add_field... | gpl-3.0 |
Xarenn/Clint | check_exercise.py | 1 | 1492 | from sys import platform
import subprocess
from web_utils import get_text
import psutil
application_code = get_text()
ClintC = ["system" , "cmd" , "fstream"]
ClintJava = ["cmd" , "Runtime" , "Process" , "InputStream" ]
ClintPython = ["popen" , "getopt" , "sys" , "cmd"]
def kill(pid):
process = psutil.Process(pi... | gpl-3.0 |
riteshshrv/django | tests/i18n/sampleproject/update_catalogs.py | 344 | 1780 | #!/usr/bin/env python
"""
Helper script to update sampleproject's translation catalogs.
When a bug has been identified related to i18n, this helps capture the issue
by using catalogs created from management commands.
Example:
The string "Two %% Three %%%" renders differently using trans and blocktrans.
This issue i... | bsd-3-clause |
Universal-Model-Converter/UMC3.0a | data/Python/x86/Lib/site-packages/OpenGL/raw/GL/SGIX/polynomial_ffd.py | 3 | 2987 | '''OpenGL extension SGIX.polynomial_ffd
Automatically generated by the get_gl_extensions script, do not edit!
'''
from OpenGL import platform, constants, constant, arrays
from OpenGL import extensions
from OpenGL.GL import glget
import ctypes
EXTENSION_NAME = 'GL_SGIX_polynomial_ffd'
_DEPRECATED = False
GL_GEOMETRY_DE... | mit |
xiaohan2012/twitter-sent-dnn | test_rntn_layer.py | 4 | 1452 | import numpy as np
from recnn_train import RNTNLayer as TheanoRNTNLayer
import theano
from test_util import assert_matrix_eq
V_val = np.asarray((np.arange(3*6*6) / 100).reshape((3,6,6)), dtype=theano.config.floatX)
W_val = np.asarray((np.arange(3*6) / 100).reshape((3,6)), dtype=theano.config.floatX)
theano_l = Theano... | mit |
akiss77/servo | tests/wpt/css-tests/tools/html5lib/html5lib/tests/tokenizertotree.py | 483 | 1965 | from __future__ import absolute_import, division, unicode_literals
import sys
import os
import json
import re
import html5lib
from . import support
from . import test_tokenizer
p = html5lib.HTMLParser()
unnamespaceExpected = re.compile(r"^(\|\s*)<html ([^>]+)>", re.M).sub
def main(out_path):
if not os.path.ex... | mpl-2.0 |
vks/servo | tests/wpt/update/updatecommandline.py | 210 | 1736 | # 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/.
def create_parser():
from wptrunner import wptcommandline
parser = wptcommandline.create_parser_update()
pa... | mpl-2.0 |
upconsulting/IsisCB | isiscb/isisdata/migrations/0024_auto_20160623_2302.py | 1 | 2305 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-06-23 23:02
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('isisdata', '0023_auto_20160621_1726'),
]
operations... | mit |
UniMOOC/gcb-new-module | modules/dashboard/peer_review.py | 8 | 12409 | # 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 ... | apache-2.0 |
tiwillia/openshift-tools | openshift/installer/vendored/openshift-ansible-3.4.40/roles/openshift_cli/library/openshift_container_binary_sync.py | 27 | 4858 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# vim: expandtab:tabstop=4:shiftwidth=4
# pylint: disable=missing-docstring,invalid-name
#
import random
import tempfile
import shutil
import os.path
# pylint: disable=redefined-builtin,wildcard-import,unused-wildcard-import
from ansible.module_utils.basic import *
DOCUMENT... | apache-2.0 |
Sweet-Peas/mbed | workspace_tools/test_mysql.py | 51 | 12049 | """
mbed SDK
Copyright (c) 2011-2014 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 |
alexus37/AugmentedRealityChess | pythonAnimations/pyOpenGLChess/engineDirectory/oglc-env/lib/python2.7/site-packages/OpenGL/GL/APPLE/specular_vector.py | 9 | 2009 | '''OpenGL extension APPLE.specular_vector
This module customises the behaviour of the
OpenGL.raw.GL.APPLE.specular_vector to provide a more
Python-friendly API
Overview (from the spec)
An alternative specular lighting model is enabled by passing
the LIGHT_MODEL_SPECULAR_VECTOR token as the <pname> parameter
to... | mit |
andante20/volatility | volatility/plugins/mac/psaux.py | 45 | 1804 | # Volatility
# Copyright (C) 2007-2013 Volatility Foundation
#
# This file is part of Volatility.
#
# Volatility 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 o... | gpl-2.0 |
yigitguler/django | django/conf/locale/cs/formats.py | 115 | 1702 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j. E Y'
TIME_FORMAT = 'G:i'
DATET... | bsd-3-clause |
jazzk/I9505GUEUDNL3 | tools/perf/scripts/python/failed-syscalls-by-pid.py | 11180 | 2058 | # failed system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide failed system call totals, broken down by pid.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.pa... | gpl-2.0 |
minatorii/loan-and-debt-management-system | node_modules/node-gyp/gyp/pylib/gyp/generator/cmake.py | 1355 | 44604 | # Copyright (c) 2013 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.
"""cmake output module
This module is under development and should be considered experimental.
This module produces cmake (2.8.8+) input as its output. One CMake... | mit |
vivilyu/android_kernel_huawei_c8813 | 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 |
fzadow/CATMAID | django/applications/catmaid/control/flytem/models.py | 2 | 3183 | import json
import urllib2
from django.conf import settings
class FlyTEMDimension:
def __init__(self, x, y, z):
self.x = x
self.y = y
self.z = z
class FlyTEMProject:
def __init__(self, id):
self.id = id
self.title = id
class FlyTEMStack:
def __init__(self, project... | agpl-3.0 |
trnewman/VT-USRP-daughterboard-drivers | gr-atsc/src/python/fpll.py | 15 | 2452 | #!/usr/bin/env python
#
# Copyright 2004,2005 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 opt... | gpl-3.0 |
dhenrygithub/QGIS | python/plugins/processing/algs/grass7/ext/r_li_edgedensity.py | 2 | 1289 | # -*- coding: utf-8 -*-
"""
***************************************************************************
r_li_edgedensity.py
-------------------
Date : February 2016
Copyright : (C) 2016 by Médéric Ribreux
Email : medspx at medspx dot fr
********************... | gpl-2.0 |
WindCanDie/spark | examples/src/main/python/ml/imputer_example.py | 79 | 1513 | #
# 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 |
stuckj/dupeguru | cocoa/base/ui/main_menu.py | 1 | 4535 | ownerclass = 'AppDelegateBase'
ownerimport = 'AppDelegateBase.h'
edition = args.get('edition', 'se')
result = Menu("")
appMenu = result.addMenu("dupeGuru")
fileMenu = result.addMenu("File")
editMenu = result.addMenu("Edit")
actionMenu = result.addMenu("Actions")
owner.columnsMenu = result.addMenu("Columns")
modeMenu =... | gpl-3.0 |
Smart-Torvy/torvy-home-assistant | homeassistant/components/switch/modbus.py | 6 | 2349 | """
Support for Modbus switches.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/switch.modbus/
"""
import logging
import voluptuous as vol
import homeassistant.components.modbus as modbus
from homeassistant.const import CONF_NAME
from homeassistant.help... | mit |
cancro7/gem5 | ext/ply/test/lex_object.py | 174 | 1141 | # -----------------------------------------------------------------------------
# lex_object.py
# -----------------------------------------------------------------------------
import sys
if ".." not in sys.path: sys.path.insert(0,"..")
import ply.lex as lex
class CalcLexer:
tokens = (
'NAME','NUMBER',
... | bsd-3-clause |
ee08b397/schematics | tests/test_functional.py | 10 | 2051 | from schematics.models import Model
from schematics.types import IntType, StringType
from schematics.validate import validate
from schematics.exceptions import ValidationError
def test_validate_simple_dict():
class Player(Model):
id = IntType()
validate(Player, {'id': 4})
def test_validate_keep_con... | bsd-3-clause |
alex/changes | changes/jobs/sync_build.py | 1 | 3768 | from datetime import datetime
from flask import current_app
from sqlalchemy.sql import func
from changes.config import db, queue
from changes.constants import Result, Status
from changes.db.utils import try_create
from changes.jobs.signals import fire_signal
from changes.models import Build, ItemStat, Job
from changes... | apache-2.0 |
Jusedawg/SickRage | lib/github/StatsPunchCard.py | 74 | 2341 | # -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2013 Vincent Jacques <vincent@vincent-jacques.net> #
# ... | gpl-3.0 |
xiafan68/socialtsquery | script/transform/mergetransform.py | 1 | 6150 | # encoding:utf8
import sys
import os
import json
from optparse import OptionParser
class Transformer(object):
def __init__(self, idir, prefixs, start):
self.idir = idir.decode("utf8")
self.prefixs = prefixs
self.start = start
def loadRecs(self, xaxis, yaxis):
self.xaxis = xaxis... | apache-2.0 |
df-a/par-cw | node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/generator/dump_dependency_json.py | 1534 | 3426 | # 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.
import collections
import os
import gyp
import gyp.common
import gyp.msvs_emulation
import json
import sys
generator_supports_multiple_toolsets = True
generator_... | mpl-2.0 |
mayqueenEMBEDDED/mq-kernel | tools/perf/util/setup.py | 320 | 1689 | #!/usr/bin/python2
from distutils.core import setup, Extension
from os import getenv
from distutils.command.build_ext import build_ext as _build_ext
from distutils.command.install_lib import install_lib as _install_lib
class build_ext(_build_ext):
def finalize_options(self):
_build_ext.finalize_optio... | gpl-2.0 |
glouppe/scikit-learn | benchmarks/bench_lasso.py | 297 | 3305 | """
Benchmarks of Lasso vs LassoLars
First, we fix a training set and increase the number of
samples. Then we plot the computation time as function of
the number of samples.
In the second benchmark, we increase the number of dimensions of the
training set. Then we plot the computation time as function of
the number o... | bsd-3-clause |
be-cloud-be/horizon-addons | server/openerp/addons/test_inherit/tests/test_inherit.py | 44 | 4554 | # -*- coding: utf-8 -*-
from openerp.tests import common
class test_inherits(common.TransactionCase):
def test_00_inherits(self):
""" Check that a many2one field with delegate=True adds an entry in _inherits """
daughter = self.env['test.inherit.daughter']
self.assertEqual(daughter._inher... | agpl-3.0 |
gx1997/chrome-loongson | build/extract_from_cab.py | 10 | 1750 | #!/usr/bin/env python
# Copyright (c) 2011 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.
"""Extracts a single file from a CAB archive."""
import os
import shutil
import subprocess
import sys
import tempfile
def main()... | bsd-3-clause |
spirrello/spirrello-pynet-work | applied_python/lib/python2.7/site-packages/ansible/modules/core/files/unarchive.py | 6 | 10956 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2013, Dylan Martin <dmartin@seattlecentral.edu>
#
# 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 ... | gpl-3.0 |
factorlibre/l10n-spain | l10n_es/migrations/8.0.4.1/pre-rename.py | 52 | 1556 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2014 Domatix (http://www.domatix.com)
# Angel Moya <angel.moya@domatix.com>
#
# This program is free software: you can redist... | agpl-3.0 |
sysbot/CouchPotatoServer | libs/rsa/varblock.py | 216 | 4360 | # -*- coding: utf-8 -*-
#
# Copyright 2011 Sybren A. Stüvel <sybren@stuvel.eu>
#
# 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
#
# Unl... | gpl-3.0 |
cyberden/CouchPotatoServer | couchpotato/core/_base/scheduler.py | 73 | 2528 | from apscheduler.scheduler import Scheduler as Sched
from couchpotato.core.event import addEvent
from couchpotato.core.logger import CPLog
from couchpotato.core.plugins.base import Plugin
log = CPLog(__name__)
autoload = 'Scheduler'
class Scheduler(Plugin):
crons = {}
intervals = {}
started = False
... | gpl-3.0 |
odinho/medlemssys | medlemssys/config/settings/common.py | 2 | 9613 | # -*- coding: utf-8 -*-
"""
Django settings for Medlemssys project.
For more information on this file, see
https://docs.djangoproject.com/en/dev/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/dev/ref/settings/
"""
from __future__ import absolute_import, unicode_... | agpl-3.0 |
gotomypc/bigcouch | couchjs/scons/scons-local-2.0.1/SCons/compat/_scons_subprocess.py | 183 | 44500 | # subprocess - Subprocesses with accessible I/O streams
#
# For more information about this module, see PEP 324.
#
# This module should remain compatible with Python 2.2, see PEP 291.
#
# Copyright (c) 2003-2005 by Peter Astrand <astrand@lysator.liu.se>
#
# Licensed to PSF under a Contributor Agreement.
# See http://ww... | apache-2.0 |
pcabido/socorro | socorro/lib/httpclient.py | 11 | 2346 | # 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/.
import httplib
class HttpClient(object):
"""Class for doing HTTP requests to any server. Encapsulate python's http... | mpl-2.0 |
EdDev/vdsm | tests/throttledlog_test.py | 1 | 3208 | #
# Copyright 2016 Red Hat, Inc.
#
# 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 th... | gpl-2.0 |
js0701/chromium-crosswalk | chrome/test/data/safe_browsing/safe_browsing_testserver.py | 50 | 1495 | #!/usr/bin/env python
# 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.
"""Wraps the upstream safebrowsing_test_server.py to run in Chrome tests."""
import os
import sys
BASE_DIR = os.path.dirname(os.path.... | bsd-3-clause |
Glasgow2015/team-10 | env/lib/python2.7/site-packages/django/core/management/commands/createcachetable.py | 96 | 3927 | from django.conf import settings
from django.core.cache import caches
from django.core.cache.backends.db import BaseDatabaseCache
from django.core.management.base import BaseCommand, CommandError
from django.db import (
DEFAULT_DB_ALIAS, connections, models, router, transaction,
)
from django.db.utils import Databa... | apache-2.0 |
akaariai/django | tests/view_tests/tests/test_csrf.py | 23 | 3190 | from django.test import Client, TestCase, override_settings
from django.utils.translation import override
@override_settings(ROOT_URLCONF="view_tests.urls")
class CsrfViewTests(TestCase):
def setUp(self):
super(CsrfViewTests, self).setUp()
self.client = Client(enforce_csrf_checks=True)
@over... | bsd-3-clause |
zerkrx/zerkbox | lib/youtube_dl/extractor/niconico.py | 17 | 10092 | # coding: utf-8
from __future__ import unicode_literals
import re
import json
import datetime
from .common import InfoExtractor
from ..compat import (
compat_urlparse,
)
from ..utils import (
ExtractorError,
int_or_none,
parse_duration,
parse_iso8601,
sanitized_Request,
xpath_text,
det... | gpl-3.0 |
ravibhure/ansible | lib/ansible/modules/remote_management/ucs/ucs_vhba_template.py | 50 | 11155 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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 |
chuckfairy/three.js | utils/exporters/blender/addons/io_three/exporter/_json.py | 296 | 6976 | import json
from .. import constants
ROUND = constants.DEFAULT_PRECISION
## THREE override function
def _json_floatstr(o):
if ROUND is not None:
o = round(o, ROUND)
return '%g' % o
def _make_iterencode(markers, _default, _encoder, _indent, _floatstr,
_key_separator, _item_separator,... | mit |
dlazz/ansible | lib/ansible/module_utils/memset.py | 64 | 5156 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | gpl-3.0 |
RBE-Avionik/skylines | config/default.py | 3 | 1670 | # -*- coding: utf-8 -*-
import os.path
here = os.path.abspath(os.path.dirname(__file__))
base = os.path.abspath(os.path.join(here, '..'))
DEBUG_TB_INTERCEPT_REDIRECTS = False
DEBUG = True
SECRET_KEY = 'skylines'
SMTP_SERVER = 'localhost'
EMAIL_FROM = 'SkyLines <no-reply@skylines.aero>'
"""
# Logging handlers (dis... | agpl-3.0 |
tectronics/chimerascan | chimerascan/deprecated/generate_transcript_reads.py | 6 | 3842 | '''
Created on Jul 14, 2011
@author: mkiyer
'''
import os
import subprocess
import chimerascan.lib.config as config
from chimerascan.lib.feature import GeneFeature
from chimerascan.lib.seq import DNA_reverse_complement
from chimerascan import pysam
BASES_PER_LINE = 50
def split_seq(seq, chars_per_line):
pos = 0... | gpl-3.0 |
Signbank/BSL-signbank | signbank/registration/migrations/0006_existing_users_must_agree_to_data_protection.py | 1 | 5683 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
"Write your forwards methods here."
# Note: Don't use "from appname.models imp... | bsd-3-clause |
FuzzJunket/pelican-plugins | simple_footnotes/simple_footnotes.py | 30 | 4327 | from pelican import signals
import re
import html5lib
RAW_FOOTNOTE_CONTAINERS = ["code"]
def getText(node, recursive = False):
"""Get all the text associated with this node.
With recursive == True, all text from child nodes is retrieved."""
L = ['']
for n in node.childNodes:
if n.nodeType i... | agpl-3.0 |
TNT-Samuel/Coding-Projects | DNS Server/Source/Lib/ctypes/test/test_byteswap.py | 32 | 11411 | import sys, unittest, struct, math, ctypes
from binascii import hexlify
from ctypes import *
def bin(s):
return hexlify(memoryview(s)).decode().upper()
# Each *simple* type that supports different byte orders has an
# __ctype_be__ attribute that specifies the same type in BIG ENDIAN
# byte order, and a __ctype_l... | gpl-3.0 |
rdhyee/osf.io | admin_tests/nodes/test_views.py | 18 | 5243 | from django.test import RequestFactory
from nose import tools as nt
import mock
from admin.common_auth.logs import OSFLogEntry
from tests.base import AdminTestCase
from tests.factories import ProjectFactory, AuthUserFactory
from admin_tests.utilities import setup_view, setup_log_view
from admin.nodes.views import (
... | apache-2.0 |
chisimba/modules | geonames/resources/loadgeodata.py | 1 | 8244 |
import fileinput
import time
import base64
import xmlrpclib
import os
import random
import sys
import zipfile
import os.path
#Define some variables (Change these to suit your circumstances!)
SERV = 'http://127.0.0.1/'
UNAME = 'admin'
PWORD = 'a'
APIENDPOINT = '/app/index.php?module=api'
# -- END EDITABLE REGION -- Pl... | gpl-2.0 |
domenicosolazzo/philocademy | venv/src/node-v0.10.36/tools/gyp/pylib/gyp/generator/gypsh.py | 2779 | 1665 | # Copyright (c) 2011 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.
"""gypsh output module
gypsh is a GYP shell. It's not really a generator per se. All it does is
fire up an interactive Python session with a few local variables... | mit |
theguardian/JIRA-APPy | lib/tlslite/errors.py | 2 | 6688 | # Authors:
# Trevor Perrin
# Dave Baggett (Arcode Corporation) - Added TLSUnsupportedError.
#
# See the LICENSE file for legal information regarding use of this file.
"""Exception classes.
@sort: TLSError, TLSAbruptCloseError, TLSAlert, TLSLocalAlert, TLSRemoteAlert,
TLSAuthenticationError, TLSNoAuthenticationErr... | gpl-2.0 |
h2oai/h2o-dev | h2o-py/tests/testdir_parser/pyunit_NOFEATURE_orc_parser_prostate.py | 6 | 1291 | from builtins import str
import sys
sys.path.insert(1,"../../")
import h2o
from tests import pyunit_utils
def orc_parser_timestamp_date():
"""
To verify that the orc parser is parsing correctly, we want to take a file we know (prostate_NA.csv), convert
it to an Orc file (prostate_NA.orc) and build two H2O ... | apache-2.0 |
sridevikoushik31/nova | nova/api/openstack/compute/server_metadata.py | 10 | 6813 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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.apach... | apache-2.0 |
orekyuu/intellij-community | python/helpers/pydev/third_party/pep8/lib2to3/lib2to3/pgen2/tokenize.py | 115 | 19125 | # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006 Python Software Foundation.
# All rights reserved.
"""Tokenization help for Python programs.
generate_tokens(readline) is a generator that breaks a stream of
text into Python tokens. It accepts a readline-like method which is called
repeatedly to get the next line o... | apache-2.0 |
addition-it-solutions/project-all | addons/stock_picking_wave/__init__.py | 8 | 1038 | # -*- 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 |
Imlunar/DJStew | launcher.py | 28 | 17847 | from __future__ import print_function
import os
import sys
import subprocess
try: # Older Pythons lack this
import urllib.request # We'll let them reach the Python
from importlib.util import find_spec # check anyway
except ImportError:
pass
import ... | gpl-3.0 |
cswiercz/sympy | doc/src/conf.py | 54 | 6371 | # -*- coding: utf-8 -*-
#
# SymPy documentation build configuration file, created by
# sphinx-quickstart.py on Sat Mar 22 19:34:32 2008.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# The contents of this file are pickled, so don't put values in the namespace
# that aren't pickle... | bsd-3-clause |
nagyistoce/edx-analytics-dashboard | analytics_dashboard/help/utils.py | 4 | 1292 | import ConfigParser
import logging
from django.conf import settings
log = logging.getLogger(__name__)
def _get_config_value_with_default(section_name, option, default_option="default"):
"""
Args:
section_name: name of the section in the configuration from which the option should be found
op... | agpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.