repo_name stringlengths 5 100 | path stringlengths 4 294 | copies stringclasses 990
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
jonyroda97/redbot-amigosprovaveis | lib/numpy/ma/mrecords.py | 16 | 27418 | """:mod:`numpy.ma..mrecords`
Defines the equivalent of :class:`numpy.recarrays` for masked arrays,
where fields can be accessed as attributes.
Note that :class:`numpy.ma.MaskedArray` already supports structured datatypes
and the masking of individual fields.
.. moduleauthor:: Pierre Gerard-Marchant
"""
from __future... | gpl-3.0 |
nhorelik/openmc | tests/test_statepoint_restart/results.py | 3 | 1045 | #!/usr/bin/env python
import sys
import numpy as np
# import statepoint
sys.path.insert(0, '../../src/utils')
import statepoint
# read in statepoint file
if len(sys.argv) > 1:
sp = statepoint.StatePoint(sys.argv[1])
else:
sp = statepoint.StatePoint('statepoint.07.binary')
sp.read_results()
# extract tally r... | mit |
abhinavp13/IITBX-edx-platform-dev | common/lib/xmodule/xmodule/tests/test_html_module.py | 6 | 1232 | import unittest
from mock import Mock
from xmodule.html_module import HtmlModule
from . import get_test_system
class HtmlModuleSubstitutionTestCase(unittest.TestCase):
descriptor = Mock()
def test_substitution_works(self):
sample_xml = '''%%USER_ID%%'''
module_data = {'data': sample_xml}
... | agpl-3.0 |
dymkowsk/mantid | docs/sphinxext/mantiddoc/directives/properties.py | 3 | 10231 | #pylint: disable=invalid-name,deprecated-module
from __future__ import (absolute_import, division, print_function)
from mantiddoc.directives.base import AlgorithmBaseDirective #pylint: disable=unused-import
import re
from string import punctuation
from six.moves import range
SUBSTITUTE_REF_RE = re.compile(r'\|(.+?)\|'... | gpl-3.0 |
rvykydal/anaconda | pyanaconda/modules/boss/module_manager/start_modules.py | 3 | 6918 | #
# Support for object containers
#
# Copyright (C) 2019 Red Hat, Inc. All rights reserved.
#
# 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 opt... | gpl-2.0 |
scipy/scipy | scipy/stats/setup.py | 1 | 3148 | import os
from os.path import join
from numpy.distutils.misc_util import get_info
def pre_build_hook(build_ext, ext):
from scipy._build_utils.compiler_helper import get_cxx_std_flag
std_flag = get_cxx_std_flag(build_ext._cxx_compiler)
if std_flag is not None:
ext.extra_compile_args.append(std_fla... | bsd-3-clause |
kchristidis/fabric | bddtests/peer/events_pb2.py | 17 | 21087 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: peer/events.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protobuf import message a... | apache-2.0 |
watspidererik/testenv | flask/lib/python2.7/site-packages/migrate/versioning/version.py | 32 | 8389 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import re
import shutil
import logging
from migrate import exceptions
from migrate.versioning import pathed, script
from datetime import datetime
import six
log = logging.getLogger(__name__)
class VerNum(object):
"""A version number that behaves like a st... | mit |
korbenzhang/vim-ycm-win | python/ycm/tests/syntax_parse_test.py | 37 | 13259 | #!/usr/bin/env python
#
# Copyright (C) 2013 Google Inc.
#
# This file is part of YouCompleteMe.
#
# YouCompleteMe 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 you... | apache-2.0 |
jhprinz/openpathsampling | openpathsampling/netcdfplus/stores/indexed.py | 4 | 3288 | from .object import ObjectStore
import logging
logger = logging.getLogger(__name__)
init_log = logging.getLogger('openpathsampling.initialization')
class IndexedObjectStore(ObjectStore):
"""
ObjectStore storing objects in arbitrary order
This has a prefilled .index which knows at which position a certa... | lgpl-2.1 |
anthonypdawson/LazyLibrarian | cherrypy/process/win32.py | 93 | 5870 | """Windows service. Requires pywin32."""
import os
import win32api
import win32con
import win32event
import win32service
import win32serviceutil
from cherrypy.process import wspbus, plugins
class ConsoleCtrlHandler(plugins.SimplePlugin):
"""A WSPBus plugin for handling Win32 console events (like Ctrl-C)."""
... | gpl-3.0 |
nitinitprof/odoo | addons/mrp_operations/mrp_operations.py | 193 | 27173 | # -*- 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 |
captnjohnny1618/Pichat | client.py | 1 | 2913 | import sys
import socket
import select
import cPickle as pickle
import lib_pichat as lp
def help_string():
f=open('help_message.txt','r')
help_message=f.read();
return help_message
class client():
#SERVER_IP='192.168.2.5'
#SERVER_IP='127.0.0.1'
SERVER_IP='aurora.rip.ucla.edu'
PORT=8000
... | gpl-2.0 |
endlessm/chromium-browser | third_party/mako/mako/cache.py | 8 | 7736 | # mako/cache.py
# Copyright 2006-2019 the Mako authors and contributors <see AUTHORS file>
#
# This module is part of Mako and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
from mako import compat
from mako import util
_cache_plugins = util.PluginLoader("mako.cache")
registe... | bsd-3-clause |
sunils34/buffer-django-nonrel | django/contrib/gis/gdal/prototypes/srs.py | 321 | 3378 | from ctypes import c_char_p, c_int, c_void_p, POINTER
from django.contrib.gis.gdal.libgdal import lgdal, std_call
from django.contrib.gis.gdal.prototypes.generation import \
const_string_output, double_output, int_output, \
srs_output, string_output, void_output
## Shortcut generation for routines with known p... | bsd-3-clause |
kernevil/samba | python/samba/tests/getdcname.py | 2 | 18962 | # Unix SMB/CIFS implementation.
# Copyright (C) Andrew Bartlett <abartlet@samba.org> 2018
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option)... | gpl-3.0 |
nhicher/ansible | lib/ansible/modules/web_infrastructure/ansible_tower/tower_project.py | 27 | 5886 | #!/usr/bin/python
# coding: utf-8 -*-
# (c) 2017, Wayne Witzel III <wayne@riotousliving.com>
# 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 |
MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-2.3/Lib/test/test_shelve.py | 9 | 3720 | import os
import unittest
import shelve
import glob
from test import test_support
class TestCase(unittest.TestCase):
fn = "shelftemp" + os.extsep + "db"
def test_ascii_file_shelf(self):
try:
s = shelve.open(self.fn, binary=False)
s['key1'] = (1,2,3,4)
self.assertEq... | mit |
pravinas/et-maslab-2016 | modules/follow.py | 1 | 1959 | # follow.py
from module import Module
import sys, os
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
from constants import *
class FollowModule(Module):
def __init__(self, timer, leftMotor, rightMotor, intakeMotor, wallFollow, forwardSpeed, blockSwitch):
self.timer = t... | mit |
rynomster/django | tests/forms_tests/tests/test_media.py | 76 | 23851 | # -*- coding: utf-8 -*-
from django.forms import CharField, Form, Media, MultiWidget, TextInput
from django.template import Context, Template
from django.test import SimpleTestCase, override_settings
from django.utils.encoding import force_text
@override_settings(
STATIC_URL='http://media.example.com/static/',
)
... | bsd-3-clause |
yudingding6197/fin_script | internal/update_tday_db.py | 1 | 1212 | #!/usr/bin/env python
# -*- coding:utf8 -*-
import os
import urllib2,time
from internal.url_163.service_163 import *
DB_PATH = './internal/db'
def update_latest_trade(latest_day):
if latest_day=='':
print "Invalid day", latest_day
return -1
#print(latest_day)
filenm = 'sh000001'
if not os.path.exists(DB_PA... | gpl-2.0 |
GauravSahu/odoo | addons/analytic_user_function/analytic_user_function.py | 174 | 7775 | # -*- 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 |
uros-sipetic/PyLOH | pyloh/constants.py | 2 | 1116 | '''
Created on 2013-07-20
@author: Yi Li
'''
import numpy as np
BAF_N_MIN = 0.4
BAF_N_MAX = 0.6
BAF_T_MIN = 0.35
BAF_T_MAX = 0.65
BAF_COUNTS_MIN = 10
BAF_COUNTS_MAX = 95
BAF_BINS = np.array(range(0, 100 + 1))/100.0
LOH_FREC_MAX = 0.25
LOH_FREC_MIN = 0.16
SITES_NUM_MIN_WGS = 100
SITES_NUM_MIN_WES = 20
PHI_INIT = [0.2,... | gpl-2.0 |
greg-hellings/ansible-modules-extras | database/misc/riak.py | 67 | 8061 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, James Martin <jmartin@basho.com>, Drew Kerrigan <dkerrigan@basho.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Fou... | gpl-3.0 |
nanditav/15712-TensorFlow | tensorflow/python/kernel_tests/bitcast_op_test.py | 29 | 2317 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
YosefLab/scVI | scvi/_settings.py | 1 | 3583 | import logging
from typing import Union
import numpy as np
import torch
from rich.console import Console
from rich.logging import RichHandler
from ._compat import Literal
logger = logging.getLogger(__name__)
scvi_logger = logging.getLogger("scvi")
class ScviConfig:
"""
Config manager for scvi-tools.
E... | bsd-3-clause |
gerald-yang/ubuntu-iotivity-demo | snappy/grovepi/python-env/lib/python2.7/encodings/iso8859_13.py | 593 | 13527 | """ Python Character Mapping Codec iso8859_13 generated from 'MAPPINGS/ISO8859/8859-13.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,input,errors... | apache-2.0 |
blueboxgroup/keystone | keystone/trust/schema.py | 5 | 1571 | # 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
# distributed under the Li... | apache-2.0 |
ksmaheshkumar/grr | client/vfs_handlers/sleuthkit.py | 2 | 11988 | #!/usr/bin/env python
"""Implement low level disk access using the sleuthkit."""
import stat
import pytsk3
from grr.client import client_utils
from grr.client import vfs
from grr.lib import rdfvalue
from grr.lib import utils
class CachedFilesystem(object):
"""A container for the filesystem and image."""
def... | apache-2.0 |
M4573R/BerkeleyX-CS188.1x-Artificial-Intelligence | reinforcement/mdp.py | 4 | 2214 | # mdp.py
# ------
# Licensing Information: You are free to use or extend these projects for
# educational purposes provided that (1) you do not distribute or publish
# solutions, (2) you retain this notice, and (3) you provide clear
# attribution to UC Berkeley, including a link to
# http://inst.eecs.berkeley.edu/... | mit |
KhronosGroup/COLLADA-CTS | StandardDataSets/collada/library_visual_scenes/visual_scene/node/instance_controller/same_material_different_skeletons/same_material_different_skeletons.py | 2 | 4045 |
# Copyright (c) 2012 The Khronos Group Inc.
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and /or associated documentation files (the "Materials "), to deal in the Materials without restriction, including without limitation the rights to use, copy, modify, merge, publ... | mit |
bdrillard/spark | examples/src/main/python/ml/power_iteration_clustering_example.py | 54 | 1604 | #
# 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 |
tchernomax/ansible | test/units/modules/network/f5/test_bigip_gtm_monitor_http.py | 23 | 4752 | # -*- coding: utf-8 -*-
#
# Copyright: (c) 2017, F5 Networks Inc.
# 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
import os
import json
import pytest
import sys
from nose.plugins.skip i... | gpl-3.0 |
jhg/django | tests/admin_docs/models.py | 82 | 1592 | """
Models for testing various aspects of the djang.contrib.admindocs app
"""
from django.db import models
class Company(models.Model):
name = models.CharField(max_length=200)
class Group(models.Model):
name = models.CharField(max_length=200)
class Family(models.Model):
last_name = models.CharField(m... | bsd-3-clause |
zero-ui/miniblink49 | third_party/jinja2/utils.py | 598 | 16165 | # -*- coding: utf-8 -*-
"""
jinja2.utils
~~~~~~~~~~~~
Utility functions.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import re
import errno
from collections import deque
from jinja2._compat import text_type, string_types, implements_iterator, \
all... | gpl-3.0 |
talha81/TACTIC-DEV | src/pyasm/widget/error_wdg.py | 5 | 7309 | ###########################################################
#
# Copyright (c) 2005, Southpaw Technology
# All Rights Reserved
#
# PROPRIETARY INFORMATION. This software is proprietary to
# Southpaw Technology, and is not to be reproduced, transmitted,
# or disclosed in any way without written permi... | epl-1.0 |
chen0031/nupic | nupic/regions/ImageSensorFilters/AddBackgroundImage.py | 17 | 5218 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | agpl-3.0 |
crosswalk-project/chromium-crosswalk-efl | chrome/test/mini_installer/test_installer.py | 27 | 14437 | # 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.
"""This script tests the installer with test cases specified in the config file.
For each test case, it checks that the machine states after the execution o... | bsd-3-clause |
aronsky/home-assistant | tests/components/auth/test_login_flow.py | 13 | 3388 | """Tests for the login flow."""
from unittest.mock import patch
from . import async_setup_auth
from tests.common import CLIENT_ID, CLIENT_REDIRECT_URI
async def test_fetch_auth_providers(hass, aiohttp_client):
"""Test fetching auth providers."""
client = await async_setup_auth(hass, aiohttp_client)
resp... | apache-2.0 |
Endika/sale-workflow | sale_stock_global_delivery_lead_time/sale_stock.py | 37 | 4849 | # -*- coding: utf-8 -*-
#
#
# Author: Alexandre Fayolle
# Copyright 2013 Camptocamp SA
#
# 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 Foundation, either version 3 of the
# Licens... | agpl-3.0 |
sarvex/tensorflow | tensorflow/python/ops/distributions/distribution.py | 9 | 46676 | # Copyright 2016 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 |
Jorge-Rodriguez/ansible | test/units/modules/network/f5/test_bigip_firewall_dos_profile.py | 21 | 3389 | # -*- coding: utf-8 -*-
#
# Copyright: (c) 2018, F5 Networks Inc.
# 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
import os
import json
import pytest
import sys
if sys.version_info < (2... | gpl-3.0 |
skidzo/sympy | sympy/concrete/expr_with_limits.py | 9 | 15677 | from __future__ import print_function, division
from sympy.core.add import Add
from sympy.core.expr import Expr
from sympy.core.mul import Mul
from sympy.core.relational import Equality
from sympy.sets.sets import Interval
from sympy.core.singleton import S
from sympy.core.symbol import Symbol
from sympy.core.sympify ... | bsd-3-clause |
newlawrence/poliastro | src/poliastro/twobody/orbit.py | 1 | 20464 | from warnings import warn
import numpy as np
from astropy import units as u
from astropy import time
from astropy.coordinates import (
Angle,
CartesianRepresentation, CartesianDifferential,
get_body_barycentric_posvel,
ICRS, GCRS
)
from poliastro.constants import J2000
from poliastro.twobody.angles ... | mit |
benoitsteiner/tensorflow-xsmm | tensorflow/contrib/cloud/python/ops/bigquery_reader_ops_test.py | 75 | 9668 | # Copyright 2016 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 |
ImageEngine/gaffer | python/GafferSceneUI/PointConstraintUI.py | 13 | 2564 | ##########################################################################
#
# Copyright (c) 2015, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistrib... | bsd-3-clause |
veger/ansible | lib/ansible/modules/cloud/rackspace/rax.py | 39 | 33459 | #!/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 |
maheshakya/scikit-learn | sklearn/datasets/svmlight_format.py | 6 | 14944 | """This module implements a loader and dumper for the svmlight format
This format is a text-based format, with one sample per line. It does
not store zero valued features hence is suitable for sparse dataset.
The first element of each line can be used to store a target variable to
predict.
This format is used as the... | bsd-3-clause |
dimara/synnefo | snf-admin-app/synnefo_admin/admin/tables.py | 8 | 1393 | # Copyright (C) 2010-2014 GRNET S.A.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed i... | gpl-3.0 |
afrolov1/nova | nova/tests/virt/libvirt/fakelibvirt.py | 1 | 30826 | # Copyright 2010 OpenStack Foundation
#
# 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 l... | apache-2.0 |
kenshay/ImageScripter | ProgramData/SystemFiles/Python/Lib/site-packages/pip/_vendor/urllib3/connection.py | 24 | 14485 | from __future__ import absolute_import
import datetime
import logging
import os
import sys
import socket
from socket import error as SocketError, timeout as SocketTimeout
import warnings
from .packages import six
from .packages.six.moves.http_client import HTTPConnection as _HTTPConnection
from .packages.six.moves.http... | gpl-3.0 |
837468220/python-for-android | python3-alpha/extra_modules/pyxmpp2/clientstream.py | 46 | 3571 | #
# (C) Copyright 2003-2011 Jacek Konieczny <jajcus@jajcus.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License Version
# 2.1 as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be u... | apache-2.0 |
TeddyDesTodes/aubio | waflib/Tools/g95.py | 316 | 1495 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
import re
from waflib import Utils
from waflib.Tools import fc,fc_config,fc_scan,ar
from waflib.Configure import conf
@conf
def find_g95(conf):
fc=conf.find_program('g95',var... | gpl-3.0 |
bak1an/django | tests/template_tests/syntax_tests/test_named_endblock.py | 521 | 2312 | from django.template import TemplateSyntaxError
from django.test import SimpleTestCase
from ..utils import setup
class NamedEndblockTests(SimpleTestCase):
@setup({'namedendblocks01': '1{% block first %}_{% block second %}'
'2{% endblock second %}_{% endblock first %}3'})
def ... | bsd-3-clause |
pgielda/vybrid-linux | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py | 11088 | 3246 | # Core.py - Python extension for perf script, core functions
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
from collections import defaultdict
def aut... | gpl-2.0 |
mattesno1/Sick-Beard | lib/requests/packages/charade/big5prober.py | 206 | 1726 | ######################## 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 Ri... | gpl-3.0 |
romanoff/google-closure-library | closure/bin/build/depstree.py | 39 | 6152 | # Copyright 2009 The Closure Library 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 a... | apache-2.0 |
Mappy/mapnik | scons/scons-local-2.3.0/SCons/Tool/sgilink.py | 11 | 2192 | """SCons.Tool.sgilink
Tool-specific initialization for the SGI MIPSPro linker on SGI.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2... | lgpl-2.1 |
j5shi/Thruster | pylibs/test/test_aifc.py | 1 | 14103 | from test.test_support import (findfile, TESTFN, unlink, captured_stdout,
run_unittest)
import unittest
from test import audiotests
import os
import io
import sys
import struct
import aifc
class AifcTest(audiotests.AudioWriteTests,
audiotests.AudioTestsWithSou... | gpl-2.0 |
pzajda/eloquence | scons-local-2.5.0/SCons/Tool/icc.py | 3 | 2170 | """engine.SCons.Tool.icc
Tool-specific initialization for the OS/2 icc compiler.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001 - 2016 The SCons Foundation
#
# Permission is hereby gr... | mit |
stutivarshney/Bal-Aveksha | WebServer/BalAvekshaEnv/lib/python3.5/site-packages/django/core/management/commands/sqlmigrate.py | 115 | 2847 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.core.management.base import BaseCommand, CommandError
from django.db import DEFAULT_DB_ALIAS, connections
from django.db.migrations.executor import MigrationExecutor
from django.db.migrations.loader import AmbiguityError
class Command(BaseCo... | gpl-3.0 |
Eric-Zhong/odoo | addons/procurement_jit/__init__.py | 374 | 1078 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... | agpl-3.0 |
kenshay/ImageScripter | ProgramData/SystemFiles/Python/Lib/site-packages/tests/test__pkce.py | 15 | 1954 | # Copyright 2016 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 ... | gpl-3.0 |
zsiki/ulyxes | camera/gen_template.py | 1 | 3861 | #! /usr/bin/env python3
# -*- coding: utf-8 -*-
"""
generate template for template matching from the first frame with aruco
video file name can contain date and time like: pi1_YYYYmmdd_HHMMSS.h264
output sent to standard output in the form:
line,date/time,column,row,statistic
use video_arucoco.py -... | gpl-2.0 |
onceuponatimeforever/oh-mainline | vendor/packages/django-celery/djcelery/backends/cache.py | 30 | 2240 | """celery.backends.cache"""
from __future__ import absolute_import
from datetime import timedelta
import django
from django.utils.encoding import smart_str
from django.core.cache import cache, get_cache
from celery import current_app
from celery.utils.timeutils import timedelta_seconds
from celery.backends.base impo... | agpl-3.0 |
ELSUru/ADL_LRS | lrs/util/jws.py | 4 | 6963 | import base64
import json
from binascii import a2b_base64
from Crypto.Hash import SHA256, SHA384, SHA512
from Crypto.PublicKey import RSA
from Crypto.Signature import PKCS1_v1_5, PKCS1_PSS
from Crypto.Util.asn1 import DerSequence
# https://www.dlitz.net/software/pycrypto/api/current/
fixb64padding = lambda s: s if l... | apache-2.0 |
gcblue/gcblue | bin/Lib/test/test_signal.py | 87 | 18905 | import unittest
from test import test_support
from contextlib import closing
import gc
import pickle
import select
import signal
import subprocess
import traceback
import sys, os, time, errno
if sys.platform in ('os2', 'riscos'):
raise unittest.SkipTest("Can't test signal on %s" % sys.platform)
class HandlerBCal... | bsd-3-clause |
LucaVazz/DualisWatcher | notification_services/mail/mail_service.py | 1 | 4662 | import logging
import traceback
from getpass import getpass
from notification_services.mail.mail_formater import create_full_welcome_mail, create_full_dualis_diff_mail, \
create_full_error_mail, create_full_schedule_diff_mail
from notification_services.mail.mail_shooter import MailShooter
from notification_service... | gpl-3.0 |
uglyboxer/linear_neuron | net-p3/lib/python3.5/site-packages/matplotlib/backends/qt_compat.py | 10 | 4816 | """ A Qt API selector that can be used to switch between PyQt and PySide.
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
import os
from matplotlib import rcParams, verbose
# Available APIs.
QT_API_PYQT = 'PyQt4' # API is not set here;... | mit |
skrueger111/zazzie | src/sassie/test_sassie/interface/density_plot/test_smaller1.py | 2 | 3869 | '''
SASSIE: Copyright (C) 2011 Joseph E. Curtis, Ph.D.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
... | gpl-3.0 |
escalator2015/linux | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/EventClass.py | 4653 | 3596 | # EventClass.py
#
# This is a library defining some events types classes, which could
# be used by other scripts to analyzing the perf samples.
#
# Currently there are just a few classes defined for examples,
# PerfEvent is the base class for all perf event sample, PebsEvent
# is a HW base Intel x86 PEBS event, and use... | gpl-2.0 |
grnet/synnefo | snf-cyclades-app/synnefo/app_settings/default/api.py | 1 | 8466 | # -*- coding: utf-8 -*-
#
# API configuration
#####################
DEBUG = False
# Top-level URL for deployment. Numerous other URLs depend on this.
CYCLADES_BASE_URL = "https://compute.example.synnefo.org/compute/"
# The API will return HTTP Bad Request if the ?changes-since
# parameter refers to a point in time ... | gpl-3.0 |
jnerin/ansible | lib/ansible/plugins/lookup/mongodb.py | 34 | 8869 | # (c) 2016, Marcos Diez <marcos@unitron.com.br>
# https://github.com/marcosdiez/
#
# 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... | gpl-3.0 |
UXE/local-edx | lms/djangoapps/instructor/tests/test_legacy_xss.py | 10 | 2344 | """
Tests of various instructor dashboard features that include lists of students
"""
from django.conf import settings
from django.test.client import RequestFactory
from django.test.utils import override_settings
from markupsafe import escape
from xmodule.modulestore.tests.django_utils import TEST_DATA_MOCK_MODULESTO... | agpl-3.0 |
DJMedhaug/BizSprint | bizsprint/users/views.py | 1 | 3347 | # -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import absolute_import, unicode_literals
from django.core.urlresolvers import reverse
from django.views.generic import DetailView, ListView, RedirectView, UpdateView
from django.contrib.auth.mixins import LoginRequiredMixin
from bizsprint.use... | bsd-3-clause |
chrippa/blues | blues/wowza.py | 5 | 1394 | """
Wowza Blueprint
===============
**Fabric environment:**
.. code-block:: yaml
blueprints:
- blues.wowza
"""
from fabric.decorators import task
from refabric.api import run, info
from refabric.context_managers import sudo
from refabric.contrib import blueprints
from . import debian
__all__ = ['start'... | mit |
pim89/youtube-dl | test/test_utils.py | 4 | 49253 | #!/usr/bin/env python
# coding: utf-8
from __future__ import unicode_literals
# Allow direct execution
import os
import sys
import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
# Various small unit tests
import io
import json
import xml.etree.ElementTree
from youtube_dl.u... | unlicense |
mattseymour/django | tests/test_client/views.py | 26 | 10894 | from urllib.parse import urlencode
from xml.dom.minidom import parseString
from django.contrib.auth.decorators import login_required, permission_required
from django.core import mail
from django.forms import fields
from django.forms.forms import Form, ValidationError
from django.forms.formsets import BaseFormSet, form... | bsd-3-clause |
ammarkhann/FinalSeniorCode | lib/python2.7/site-packages/requests/packages/chardet/big5prober.py | 2931 | 1684 | ######################## 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... | mit |
ticosax/django | django/core/checks/model_checks.py | 525 | 2390 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import inspect
import types
from django.apps import apps
from django.core.checks import Error, Tags, register
@register(Tags.models)
def check_all_models(app_configs=None, **kwargs):
errors = []
for model in apps.get_models():
if app_co... | bsd-3-clause |
benthomasson/ansible | lib/ansible/modules/notification/nexmo.py | 8 | 3589 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Matt Martz <matt@sivel.net>
# 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.0',
... | gpl-3.0 |
mpasternak/pyglet-fix-issue-552 | examples/tablet.py | 29 | 1403 | #!/usr/bin/python
# $Id:$
import pyglet
window = pyglet.window.Window()
tablets = pyglet.input.get_tablets()
canvases = []
if tablets:
print 'Tablets:'
for i, tablet in enumerate(tablets):
print ' (%d) %s' % (i + 1, tablet.name)
print 'Press number key to open corresponding tablet d... | bsd-3-clause |
Kongsea/tensorflow | tensorflow/tools/docs/generate_1_0.py | 55 | 3183 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-3.2/Lib/test/test_http_cookiejar.py | 3 | 69589 | """Tests for http/cookiejar.py."""
import os
import re
import test.support
import time
import unittest
import urllib.request
from http.cookiejar import (time2isoz, http2time, time2netscape,
parse_ns_headers, join_header_words, split_header_words, Cookie,
CookieJar, DefaultCookiePolicy, LWPCookieJar, Mozilla... | mit |
fzalkow/scikit-learn | sklearn/linear_model/randomized_l1.py | 95 | 23365 | """
Randomized Lasso/Logistic: feature selection based on Lasso and
sparse Logistic Regression
"""
# Author: Gael Varoquaux, Alexandre Gramfort
#
# License: BSD 3 clause
import itertools
from abc import ABCMeta, abstractmethod
import warnings
import numpy as np
from scipy.sparse import issparse
from scipy import spar... | bsd-3-clause |
wdurhamh/statsmodels | statsmodels/tsa/mlemodel.py | 36 | 2101 | """Base Classes for Likelihood Models in time series analysis
Warning: imports numdifftools
Created on Sun Oct 10 15:00:47 2010
Author: josef-pktd
License: BSD
"""
import numpy as np
try:
import numdifftools as ndt
except ImportError:
pass
from statsmodels.base.model import LikelihoodModel
#copied fro... | bsd-3-clause |
levilucio/SyVOLT | UMLRT2Kiltera_MM/Properties/from_thesis/HMM6_then_CompleteLHS.py | 1 | 8761 | from core.himesis import Himesis, HimesisPreConditionPatternLHS
import uuid
class HMM6_then_CompleteLHS(HimesisPreConditionPatternLHS):
def __init__(self):
"""
Creates the himesis graph representing the AToM3 model HMM6_then_CompleteLHS.
"""
# Fla... | mit |
Acidburn0zzz/webm.webm-tools | .ycm_extra_conf.py | 18 | 5012 | import os
import ycm_core
# These are the compilation flags that will be used in case there's no
# compilation database set (by default, one is not set).
# CHANGE THIS LIST OF FLAGS. YES, THIS IS THE DROID YOU HAVE BEEN LOOKING FOR.
flags = [
'-Wall',
'-Wextra',
'-Werror',
'-Wc++98-compat',
'-Wno-long-long',
'-Wno-var... | bsd-3-clause |
BrunoCaimar/ArcREST | src/arcrest/_abstract/abstract.py | 3 | 10254 | from __future__ import absolute_import
import zipfile
import datetime
import calendar
import glob
import mimetypes
import os
from ..packages.six.moves import http_client as httplib
from ..web._base import BaseWebOperations
###########################################################################
class BaseCMP(BaseWe... | apache-2.0 |
SebastianDeiss/django-auth-qr2auth | django_auth_qr2auth/core.py | 1 | 10436 | #
# Copyright (C) 2014-2015 Sebastian Deiss, all rights reserved.
#
# This file is a part of QR2Auth.
#
# QR2Auth is free software; you can redistribute it and/or modify it under the
# terms of the MIT licensee. For further information see LICENSE.txt in the
# parent folder.
#
# This file contains the QR2Auth core impl... | mit |
amyvmiwei/kbengine | kbe/res/scripts/common/Lib/idlelib/PyShell.py | 6 | 58202 | #! /usr/bin/env python3
import getopt
import os
import os.path
import re
import socket
import subprocess
import sys
import threading
import time
import tokenize
import traceback
import types
import io
import linecache
from code import InteractiveInterpreter
from platform import python_version, system
try:
from t... | lgpl-3.0 |
ctxis/canape | CANAPE.Scripting/Lib/encodings/utf_32.py | 375 | 5127 | """
Python 'utf-32' Codec
"""
import codecs, sys
### Codec APIs
encode = codecs.utf_32_encode
def decode(input, errors='strict'):
return codecs.utf_32_decode(input, errors, True)
class IncrementalEncoder(codecs.IncrementalEncoder):
def __init__(self, errors='strict'):
codecs.IncrementalEncoder.__ini... | gpl-3.0 |
openiitbombayx/edx-platform | common/djangoapps/third_party_auth/settings.py | 76 | 3717 | """Settings for the third-party auth module.
The flow for settings registration is:
The base settings file contains a boolean, ENABLE_THIRD_PARTY_AUTH, indicating
whether this module is enabled. startup.py probes the ENABLE_THIRD_PARTY_AUTH.
If true, it:
a) loads this module.
b) calls apply_settings(), passi... | agpl-3.0 |
j-carpentier/nova | nova/tests/unit/objects/test_instance_pci_requests.py | 32 | 7584 | # 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 |
tjyang/vitess | test/python_client_test.py | 1 | 13676 | #!/usr/bin/env python
#
# Copyright 2015 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 test uses vtgateclienttest to test the vtdb python vtgate client.
"""
import logging
import struct
import unittest
import environment
... | bsd-3-clause |
GaetanCambier/CouchPotatoServer | libs/suds/sudsobject.py | 201 | 11165 | # This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) GNU Lesser General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will ... | gpl-3.0 |
ibc/MediaSoup | worker/deps/gyp/test/small/gyptest-small.py | 12 | 1496 | #!/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.
"""
Runs small tests.
"""
import imp
import os
import platform
import sys
import unittest
import TestGyp
test = TestGyp.TestGyp()
# Add... | isc |
SravanthiSinha/edx-platform | openedx/core/djangoapps/credit/urls.py | 54 | 1261 | """
URLs for the credit app.
"""
from django.conf.urls import patterns, url, include
from openedx.core.djangoapps.credit import views, routers
from openedx.core.djangoapps.credit.api.provider import get_credit_provider_info
PROVIDER_ID_PATTERN = r'(?P<provider_id>[^/]+)'
V1_URLS = patterns(
'',
url(
... | agpl-3.0 |
tdhopper/scikit-learn | sklearn/linear_model/passive_aggressive.py | 97 | 10879 | # Authors: Rob Zinkov, Mathieu Blondel
# License: BSD 3 clause
from .stochastic_gradient import BaseSGDClassifier
from .stochastic_gradient import BaseSGDRegressor
from .stochastic_gradient import DEFAULT_EPSILON
class PassiveAggressiveClassifier(BaseSGDClassifier):
"""Passive Aggressive Classifier
Read mor... | bsd-3-clause |
jofusa/datadogpy | tests/unit/api/test_api.py | 3 | 9607 | # stdlib
from copy import deepcopy
from functools import wraps
import os
import tempfile
from time import time
# 3p
import mock
from nose.tools import assert_raises, assert_true, assert_false
# datadog
from datadog import initialize, api
from datadog.api import Metric
from datadog.api.exceptions import ApiNotInitiali... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.