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 |
|---|---|---|---|---|---|
krafczyk/spack | var/spack/repos/builtin/packages/cp2k/package.py | 2 | 12803 | ##############################################################################
# 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 |
zubair-arbi/edx-platform | common/lib/xmodule/xmodule/video_module/video_module.py | 6 | 39115 |
# -*- coding: utf-8 -*-
# pylint: disable=abstract-method
"""Video is ungraded Xmodule for support video content.
It's new improved video module, which support additional feature:
- Can play non-YouTube video sources via in-browser HTML5 video player.
- YouTube defaults to HTML5 mode from the start.
- Speed changes in... | agpl-3.0 |
hisaharu/ryu | ryu/log.py | 36 | 3413 | # Copyright (C) 2011 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2011 Isaku Yamahata <yamahata at valinux co jp>
#
# 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://... | apache-2.0 |
whn09/tensorflow | tensorflow/python/util/keyword_args_test.py | 163 | 1804 | # 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 |
enzochiau/tablib | tablib/packages/yaml/tokens.py | 985 | 2573 |
class Token(object):
def __init__(self, start_mark, end_mark):
self.start_mark = start_mark
self.end_mark = end_mark
def __repr__(self):
attributes = [key for key in self.__dict__
if not key.endswith('_mark')]
attributes.sort()
arguments = ', '.join(['%s=... | mit |
frappe/erpnext | erpnext/setup/install.py | 2 | 7819 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import print_function, unicode_literals
import frappe
from erpnext.accounts.doctype.cash_flow_mapper.default_cash_flow_mapper import DEFAULT_MAPPERS
from .default_success_acti... | gpl-3.0 |
vponomaryov/manila | manila/share/drivers/glusterfs/glusterfs_native.py | 3 | 9092 | # Copyright (c) 2014 Red Hat, 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 require... | apache-2.0 |
GNOME/kupfer | waflib/Build.py | 5 | 36386 | #!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2005-2010 (ita)
"""
Classes related to the build phase (build, clean, install, step, etc)
The inheritance tree is the following:
"""
import os, sys, errno, re, shutil
try: import cPickle
except: import pickle as cPickle
from waflib import Runner, TaskGen, Utils... | gpl-3.0 |
Azure/azure-sdk-for-python | sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/operations/_disaster_recovery_configs_operations.py | 1 | 37401 | # 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 may ... | mit |
mstriemer/olympia | src/olympia/lib/queryset_transform.py | 6 | 2337 | from django.db import models
"""
Copyright (c) 2010, Simon Willison.
All rights reserved.
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,
... | bsd-3-clause |
keyurpatel076/MissionPlannerGit | packages/IronPython.StdLib.2.7.4/content/Lib/email/iterators.py | 415 | 2202 | # Copyright (C) 2001-2006 Python Software Foundation
# Author: Barry Warsaw
# Contact: email-sig@python.org
"""Various types of useful iterators and generators."""
__all__ = [
'body_line_iterator',
'typed_subpart_iterator',
'walk',
# Do not include _structure() since it's part of the debugging API.
... | gpl-3.0 |
ShownX/incubator-mxnet | example/ssd/dataset/testdb.py | 29 | 2409 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | apache-2.0 |
edx/edx-platform | lms/djangoapps/program_enrollments/api/__init__.py | 4 | 1514 | """
Python API exposed by the program_enrollments app to other in-process apps.
The functions are split into separate files for code organization, but they
are imported into here so they can be imported directly from
`lms.djangoapps.program_enrollments.api`.
When adding new functions to this API, add them to the appr... | agpl-3.0 |
xuweiliang/Codelibrary | nova/cache_utils.py | 6 | 4337 | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a ... | apache-2.0 |
sujitbehera27/MyRoboticsProjects-Arduino | src/resource/Python/examples/InMoov2.wvantoorn.py | 5 | 4561 | # this script is provided as a basic guide
# most parts can be run by uncommenting them
# InMoov now can be started in modular pieces
leftPort = "COM7"
rightPort = "COM9"
i01 = Runtime.createAndStart("i01", "InMoov")
rightArm = i01.startRightArm(rightPort)
mouth = i01.startMouth()
ear = i01.startEar()
# i01.systemC... | apache-2.0 |
jhuapl-marti/marti | env-crits/lib/python2.7/site-packages/pip/_vendor/six.py | 878 | 29664 | """Utilities for writing code that runs on Python 2 and 3"""
# Copyright (c) 2010-2015 Benjamin Peterson
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including with... | mit |
JohnMnemonick/UralsCoin | contrib/devtools/check-doc.py | 4 | 1825 | #!/usr/bin/env python
# Copyright (c) 2015-2016 The Bitsend Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
This checks if all command line args are documented.
Return value is 0 to indicate no error.
Author: ... | mit |
valentin-krasontovitsch/ansible | test/units/modules/network/enos/enos_module.py | 31 | 3229 | # Copyright (C) 2017 Lenovo, Inc.
#
# 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.
#
# Ansi... | gpl-3.0 |
teslaji/homebase | venv/HomeBase/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/contrib/ntlmpool.py | 1010 | 4507 | """
NTLM authenticating pool, contributed by erikcederstran
Issue #10, see: http://code.google.com/p/urllib3/issues/detail?id=10
"""
try:
from http.client import HTTPSConnection
except ImportError:
from httplib import HTTPSConnection
from logging import getLogger
from ntlm import ntlm
from urllib3 import HTT... | gpl-3.0 |
yongshengwang/builthue | desktop/core/ext-py/Paste-1.7.2/paste/auth/multi.py | 78 | 3042 | # (c) 2005 Clark C. Evans
# This module is part of the Python Paste Project and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
# This code was written with funding by http://prometheusresearch.com
"""
Authentication via Multiple Methods
In some environments, the choice of authe... | apache-2.0 |
sandeepgupta2k4/tensorflow | tensorflow/python/ops/linalg_grad.py | 61 | 8371 | # 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 |
mne-tools/mne-tools.github.io | 0.21/_downloads/16e013a9723e79ad270873c47053f4b5/plot_source_space_snr.py | 1 | 3009 | # -*- coding: utf-8 -*-
"""
===============================
Computing source space SNR
===============================
This example shows how to compute and plot source space SNR as in [1]_.
"""
# Author: Padma Sundaram <tottochan@gmail.com>
# Kaisu Lankinen <klankinen@mgh.harvard.edu>
#
# License: BSD (3-clau... | bsd-3-clause |
weiHelloWorld/accelerated_sampling_with_autoencoder | MD_simulation_on_alanine_dipeptide/current_work/src/coordinates_data_files_list.py | 1 | 5212 | from config import *
from helper_func import *
class coordinates_data_files_list(object):
def __init__(self,
list_of_dir_of_coor_data_files = CONFIG_1, # this is the directory that holds corrdinates data files
):
assert (isinstance(list_of_dir_of_coor_data_files, list)) #... | mit |
PrashntS/scikit-learn | sklearn/linear_model/randomized_l1.py | 68 | 23405 | """
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 |
fzalkow/scikit-learn | sklearn/cluster/tests/test_dbscan.py | 114 | 11393 | """
Tests for DBSCAN clustering algorithm
"""
import pickle
import numpy as np
from scipy.spatial import distance
from scipy import sparse
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_raises
from sklearn.utils.testing im... | bsd-3-clause |
GNOME/chronojump-server | email_error_log.py | 1 | 2145 | import ConfigParser
import smtplib, email, email.encoders, email.mime.text, email.mime.base
import string
config = ConfigParser.ConfigParser()
config.read('/etc/chronojump.conf')
def user_comments_from_log(log):
user_comment_separator = "----------"
if log.startswith(user_comment_separator):
text = l... | agpl-3.0 |
mrry/tensorflow | tensorflow/contrib/opt/python/training/external_optimizer.py | 14 | 13356 | # 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 |
atsuyim/readthedocs.org | readthedocs/rtd_tests/tests/test_api_version_compare.py | 34 | 1173 | from django.test import TestCase
from readthedocs.builds.constants import LATEST
from readthedocs.projects.models import Project
from readthedocs.restapi.views.footer_views import get_version_compare_data
class VersionCompareTests(TestCase):
fixtures = ['eric.json', 'test_data.json']
def test_not_highest(se... | mit |
ghislainp/iris | lib/iris/tests/unit/fileformats/name_loaders/test__build_cell_methods.py | 16 | 5112 | # (C) British Crown Copyright 2013 - 2015, Met Office
#
# This file is part of Iris.
#
# Iris is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation, either version 3 of the License, or
# (at your option) any l... | gpl-3.0 |
iulian787/spack | var/spack/repos/builtin/packages/lua-luajit/package.py | 2 | 1734 | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os
from spack import *
class LuaLuajit(MakefilePackage):
"""Flast flexible JITed lua"""
homepage = "http:... | lgpl-2.1 |
Jgarcia-IAS/localizacion | openerp/addons/base_gengo/controller/gengo_callback.py | 362 | 2326 | # -*- coding: utf-8 -*-
import openerp
from openerp import SUPERUSER_ID
from openerp.addons.web import http
from openerp.addons.web.http import request
from werkzeug.wrappers import BaseResponse as Response
import json
class website_gengo(http.Controller):
def get_gengo_key(self, cr):
icp = request.re... | agpl-3.0 |
wangcan04/chatbot | model.py | 1 | 6097 | import cPickle as pickle
import numpy as np
import argparse
# sys.path.append(os.path.join(os.path.dirname(__file__), '../../build/python'))
from singa import layer
from singa import loss
from singa import device
from singa import tensor
from singa import optimizer
from singa import initializer
from singa.proto import... | apache-2.0 |
twobraids/configman_orginal | demo/dyn_app.py | 1 | 4329 | #!/usr/bin/env python
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (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.mozil... | bsd-3-clause |
vuteam/BlackHole-New | lib/python/Screens/HarddiskSetup.py | 49 | 3036 | from Screen import Screen
from Components.ActionMap import ActionMap
from Components.Harddisk import harddiskmanager
from Components.MenuList import MenuList
from Components.Label import Label
from Components.Pixmap import Pixmap
from Screens.MessageBox import MessageBox
class HarddiskSetup(Screen):
def __init__(self... | gpl-2.0 |
unindented/streamcode | client/static/jsrepl/extern/python/reloop-closured/lib/python2.7/encodings/gb2312.py | 816 | 1027 | #
# gb2312.py: Python Unicode Codec for GB2312
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
import _codecs_cn, codecs
import _multibytecodec as mbc
codec = _codecs_cn.getcodec('gb2312')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class IncrementalEncoder(mbc.MultibyteIncrem... | mit |
hxddh/thefuck | tests/functional/test_fish.py | 16 | 1747 | import pytest
from tests.functional.plots import with_confirmation, without_confirmation, \
refuse_with_confirmation, select_command_with_arrows
containers = (('thefuck/ubuntu-python3-fish',
u'''FROM ubuntu:latest
RUN apt-get update
RUN apt-get install -yy pytho... | mit |
akiss77/servo | tests/wpt/update/tree.py | 24 | 7715 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from distutils.spawn import find_executable
import re
import subprocess
import sys
import tempfile
from wptrunner impor... | mpl-2.0 |
splunk/splunk-demo-yelp-search-command | bin/requests/packages/chardet/escsm.py | 2930 | 7839 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org 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 Reserved.
#
# Con... | apache-2.0 |
kevinpdavies/pycsw | pycsw/formats/__init__.py | 63 | 1317 | # -*- coding: ISO-8859-15 -*-
# =================================================================
#
# Authors: Tom Kralidis <tomkralidis@gmail.com>
#
# Copyright (c) 2015 Tom Kralidis
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
# files... | mit |
igemsoftware/SYSU-Software2013 | project/Python27_32/Lib/xml/sax/_exceptions.py | 250 | 4785 | """Different kinds of SAX Exceptions"""
import sys
if sys.platform[:4] == "java":
from java.lang import Exception
del sys
# ===== SAXEXCEPTION =====
class SAXException(Exception):
"""Encapsulate an XML error or warning. This class can contain
basic error or warning information from either the XML parser o... | mit |
encukou/freeipa | ipaserver/install/odsexporterinstance.py | 1 | 6442 | #
# Copyright (C) 2014 FreeIPA Contributors see COPYING for license
#
from __future__ import absolute_import
import logging
import os
import pwd
import grp
import ldap
from ipaserver.install import service
from ipaserver.install import installutils
from ipapython.dn import DN
from ipapython import directivesetter
... | gpl-3.0 |
DamnWidget/anaconda_go | lib/__init__.py | 1 | 5932 |
# Copyright (C) 2014 - Oscar Campos <oscar.campos@member.fsf.org>
# This program is Free Software see LICENSE file for details
import os
import time
import sublime
from subprocess import PIPE
from Default.exec import ExecCommand
from anaconda_go.lib.helpers import project_name
from anaconda_go.lib.detector import Go... | gpl-3.0 |
a-parhom/edx-platform | common/djangoapps/entitlements/models.py | 4 | 20920 | """Entitlement Models"""
import logging
import uuid as uuid_tools
from datetime import timedelta
from django.conf import settings
from django.contrib.sites.models import Site
from django.db import IntegrityError, models, transaction
from django.utils.timezone import now
from model_utils import Choices
from model_util... | agpl-3.0 |
aranjan7/contrail-controller-aranjan | src/opserver/opserver_client.py | 9 | 8696 | #
# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
#
#
# Opserver Client
#
# Client of Operational State Server for VNC
#
import readline
import code
import urllib2
import time
import json
import datetime
import pdb
import argparse
import socket
import struct
from prettytable import PrettyTable
from c... | apache-2.0 |
luotao19861229/pyspider | pyspider/webui/task.py | 73 | 2599 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8:
# Author: Binux<i@binux.me>
# http://binux.me
# Created on 2014-07-16 15:30:57
import socket
from flask import abort, render_template, request, json
from pyspider.libs import utils
from .app import app
@app.rout... | apache-2.0 |
seem-sky/kbengine | kbe/res/scripts/common/Lib/json/__init__.py | 83 | 13246 | r"""JSON (JavaScript Object Notation) <http://json.org> is a subset of
JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data
interchange format.
:mod:`json` exposes an API familiar to users of the standard library
:mod:`marshal` and :mod:`pickle` modules. It is derived from a
version of the externally m... | lgpl-3.0 |
cheddarfinancial/quarry-platform | lego/main.py | 1 | 11162 | #!/usr/bin/python
# Standard Library
import argparse
import json
import logging
import os
import subprocess
# Third Party
import requests
import mixingboard
from chassis.database import db_session
from chassis.models import Workflow
from flask import Flask, jsonify, request
# Local
from lib.runner import runWorkflow... | bsd-3-clause |
mishbahr/djangocms-forms | djangocms_forms/views.py | 1 | 3114 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib import messages
from django.shortcuts import get_object_or_404, redirect
from django.http import Http404
from django.utils.http import is_safe_url
from django.utils.html import strip_tags
from django.utils.translation import ugettext_... | bsd-3-clause |
wwj718/murp-edx | common/djangoapps/student/tests/tests.py | 2 | 26683 | """
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
Replace this with more appropriate tests for your application.
"""
import logging
import unittest
from datetime import datetime, timedelta
import pytz
from django.conf import settings
from django.test im... | agpl-3.0 |
angad/libjingle-mac | talk/third_party/gtest/test/gtest_list_tests_unittest.py | 1068 | 5415 | #!/usr/bin/env python
#
# Copyright 2006, 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... | bsd-3-clause |
hbrunn/OpenUpgrade | openerp/tools/pdf_utils.py | 456 | 3659 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 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 |
ivanhorvath/openshift-tools | openshift/installer/vendored/openshift-ansible-3.10.0-0.29.0/roles/lib_openshift/src/class/oc_adm_ca_server_cert.py | 13 | 6061 | # pylint: skip-file
# flake8: noqa
class CAServerCertConfig(OpenShiftCLIConfig):
''' CAServerCertConfig is a DTO for the oc adm ca command '''
def __init__(self, kubeconfig, verbose, ca_options):
super(CAServerCertConfig, self).__init__('ca', None, kubeconfig, ca_options)
self.kubeconfig = kube... | apache-2.0 |
h3biomed/ansible | lib/ansible/modules/cloud/amazon/elb_instance.py | 54 | 13700 | #!/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 |
leopardhs/ns3_sdn | src/tap-bridge/examples/tap-csma-virtual-machine.py | 157 | 3012 | # -*- Mode: Python; -*-
#
# Copyright 2010 University of Washington
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation;
#
# This program is distributed in the hope that it will be usefu... | gpl-2.0 |
hendradarwin/VTK | ThirdParty/Twisted/twisted/mail/mail.py | 36 | 22889 | # -*- test-case-name: twisted.mail.test.test_mail -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Mail service support.
"""
# Twisted imports
from twisted.internet import defer
from twisted.application import service, internet
from twisted.python import util
from twisted.python import... | bsd-3-clause |
jumpstarter-io/glance | glance/tests/unit/test_domain_proxy.py | 15 | 11529 | # Copyright 2013 OpenStack Foundation.
# Copyright 2013 IBM Corp.
# 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/LI... | apache-2.0 |
js0701/chromium-crosswalk | tools/perf/page_sets/maps.py | 25 | 1336 | # 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.
from telemetry.page import page as page_module
from telemetry import story
from page_sets import webgl_supported_shared_state
class MapsPage(page_module.P... | bsd-3-clause |
voutilad/courtlistener | cl/donate/forms.py | 3 | 3957 | from cl.donate.models import Donation
from cl.users.models import UserProfile
from django import forms
from django.contrib.auth.models import User
from django.forms import ModelForm
from localflavor.us.forms import USStateField, USZipCodeField
from localflavor.us.us_states import STATE_CHOICES
AMOUNTS = (
('5000'... | agpl-3.0 |
marcsans/cnn-physics-perception | phy/lib/python2.7/site-packages/sklearn/metrics/tests/test_regression.py | 18 | 6065 | from __future__ import division, print_function
import numpy as np
from itertools import product
from sklearn.utils.testing import assert_raises
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.... | mit |
briancline/softlayer-python | SoftLayer/managers/firewall.py | 2 | 10874 | """
SoftLayer.firewall
~~~~~~~~~~~~~~~~~~
Firewall Manager/helpers
:license: MIT, see LICENSE for more details.
"""
from SoftLayer import utils
RULE_MASK = ('mask[orderValue,action,destinationIpAddress,'
'destinationIpSubnetMask,protocol,destinationPortRangeStart,'
'destinati... | mit |
nvoron23/arangodb | 3rdParty/V8-4.3.61/third_party/python_26/Lib/test/test_pprint.py | 55 | 24560 | import pprint
import test.test_support
import unittest
import test.test_set
try:
uni = unicode
except NameError:
def uni(x):
return x
# list, tuple and dict subclasses that do or don't overwrite __repr__
class list2(list):
pass
class list3(list):
def __repr__(self):
return list.__repr... | apache-2.0 |
hgl888/chromium-crosswalk-efl | media/tools/layout_tests/test_expectations_unittest.py | 165 | 1697 | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest
from test_expectations import TestExpectations
class TestTestExpectations(unittest.TestCase):
def testParseLi... | bsd-3-clause |
pachi/eppy | p3/eppy/tests/atest_simplesurface.py | 1 | 14006 | """py.test for simplesurface.py"""
# =======================================================================
# Distributed under the MIT License.
# (See accompanying file LICENSE or copy at
# http://opensource.org/licenses/MIT)
# =======================================================================
from eppy... | mit |
ortylp/scipy | scipy/linalg/tests/test_build.py | 78 | 1776 | from __future__ import division, print_function, absolute_import
from subprocess import call, PIPE, Popen
import sys
import re
from numpy.testing import TestCase, dec
from numpy.compat import asbytes
from scipy.linalg import _flapack as flapack
# XXX: this is copied from numpy trunk. Can be removed when we will dep... | bsd-3-clause |
dgsantana/arsenalsuite | cpp/lib/PyQt4/examples/tutorial/t10.py | 11 | 4041 | #!/usr/bin/env python
# PyQt tutorial 10
import sys
from PyQt4 import QtCore, QtGui
class LCDRange(QtGui.QWidget):
valueChanged = QtCore.pyqtSignal(int)
def __init__(self, parent=None):
super(LCDRange, self).__init__(parent)
lcd = QtGui.QLCDNumber(2)
lcd.setSegmentStyle(QtGui.Q... | gpl-2.0 |
gardner/youtube-dl | youtube_dl/extractor/adultswim.py | 70 | 8085 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
ExtractorError,
float_or_none,
xpath_text,
)
class AdultSwimIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?adultswim\.com/videos/(?P<is_playlist>playlists/)?(?P<show_path>[... | unlicense |
jxta/cc | vendor/redis-py/tests/pipeline.py | 7 | 2205 | import redis
import unittest
class PipelineTestCase(unittest.TestCase):
def setUp(self):
self.client = redis.Redis(host='localhost', port=6379, db=9)
self.client.flushdb()
def tearDown(self):
self.client.flushdb()
def test_pipeline(self):
pipe = self.client.pipeline()
... | apache-2.0 |
iulian787/spack | var/spack/repos/builtin/packages/qnnpack/package.py | 5 | 2889 | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Qnnpack(CMakePackage):
"""QNNPACK (Quantized Neural Networks PACKage) is a mobile-optimize... | lgpl-2.1 |
minesense/VisTrails | vistrails/core/log/__init__.py | 24 | 1951 | ###############################################################################
##
## Copyright (C) 2014-2016, New York University.
## Copyright (C) 2011-2014, NYU-Poly.
## Copyright (C) 2006-2011, University of Utah.
## All rights reserved.
## Contact: contact@vistrails.org
##
## This file is part of VisTrails.
##
## ... | bsd-3-clause |
rosarior/rua | rua/dashboard.py | 2 | 2719 | """
This file was generated with the customdashboard management command and
contains the class for the main dashboard.
To activate your index dashboard add the following to your settings.py::
GRAPPELLI_INDEX_DASHBOARD = 'rua.dashboard.CustomIndexDashboard'
"""
from django.utils.translation import ugettext_lazy as... | gpl-3.0 |
babywolfh/iris-panel | iris/etl/check.py | 7 | 4663 | # This file is part of IRIS: Infrastructure and Release Information System
#
# Copyright (C) 2013-2015 Intel Corporation
#
# IRIS is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# version 2.0 as published by the Free Software Foundation.
"""
Module for chec... | gpl-2.0 |
pybrain2/pybrain2 | pybrain/tests/unittests/structure/networks/test_nested_network.py | 31 | 1114 | """
Build a nested network:
>>> n = buildNestedNetwork()
Check its gradient:
>>> from pybrain.tests import gradientCheck
>>> gradientCheck(n)
Perfect gradient
True
Try writing it to an xml file, reread it and determine if it looks the same:
>>> from pybrain.tests import xmlInvariance
>... | bsd-3-clause |
tensorflow/examples | tensorflow_examples/lite/model_maker/third_party/recommendation/ml/model/recommendation_model_test.py | 1 | 5706 | # Lint as: python3
# Copyright 2021 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... | apache-2.0 |
40223136/w17test1 | static/Brython3.1.1-20150328-091302/Lib/unittest/mock.py | 739 | 71473 | # mock.py
# Test tools for mocking and patching.
# Maintained by Michael Foord
# Backport for other versions of Python available from
# http://pypi.python.org/pypi/mock
__all__ = (
'Mock',
'MagicMock',
'patch',
'sentinel',
'DEFAULT',
'ANY',
'call',
'create_autospec',
'FILTER_DIR',
... | gpl-3.0 |
BenLand100/rat-pac | python/SCons/Warnings.py | 19 | 5878 | #
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitati... | bsd-3-clause |
augustozuniga/arisgames | zxing-master/cpp/scons/scons-local-2.0.0.final.0/SCons/Options/BoolOption.py | 34 | 2001 | #
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without li... | mit |
KWARC/mwetoolkit | bin/old/candidates_old.py | 2 | 15119 | #!/usr/bin/python
# -*- coding:UTF-8 -*-
################################################################################
#
# Copyright 2010-2012 Carlos Ramisch, Vitor De Araujo
#
# candidates.py is part of mwetoolkit
#
# mwetoolkit is free software: you can redistribute it and/or modify
# it under the terms of the GN... | gpl-3.0 |
sungkim11/mhargadh | django/conf/locale/ml/formats.py | 341 | 1635 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'N j, Y'
TIME_FORMAT = 'P'
DATETIME_FORMAT = 'N j, Y, P'
YEAR_MONTH_FORMAT... | bsd-3-clause |
naemono/pyrax | samples/cloud_dns/add_ptr_records.py | 13 | 1496 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c)2012 Rackspace US, 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.ap... | apache-2.0 |
scholer/cadnano2.5 | cadnano/gui/dialogs/ui_latticetype.py | 2 | 1925 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'latticetype.ui'
#
# Created: Sun Oct 12 21:39:15 2014
# by: PyQt5 UI code generator 5.3.2
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_LatticeType(object):
def setup... | mit |
ZefQ/Flexget | tests/test_whatcd.py | 13 | 1146 | from __future__ import unicode_literals, division, absolute_import
from tests import FlexGetBase, use_vcr
class TestInputWhatCD(FlexGetBase):
__yaml__ = """
tasks:
no_fields:
whatcd:
no_user:
whatcd:
password: test
no_pass:
... | mit |
dkubiak789/OpenUpgrade | addons/purchase_requisition/purchase_requisition.py | 22 | 23812 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... | agpl-3.0 |
MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-3.1/Lib/test/test_string.py | 3 | 4135 | import unittest, string
from test import support
class ModuleTest(unittest.TestCase):
def test_attrs(self):
string.whitespace
string.ascii_lowercase
string.ascii_uppercase
string.ascii_letters
string.digits
string.hexdigits
string.octdigits
string.p... | mit |
liyichao/spark | examples/src/main/python/ml/kmeans_example.py | 69 | 1828 | #
# 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 |
philanthropy-u/edx-platform | common/djangoapps/terrain/stubs/catalog.py | 4 | 1872 | """
Stub implementation of catalog service for acceptance tests
"""
# pylint: disable=invalid-name, missing-docstring
import re
import urlparse
from .http import StubHttpRequestHandler, StubHttpService
class StubCatalogServiceHandler(StubHttpRequestHandler):
def do_GET(self):
pattern_handlers = {
... | agpl-3.0 |
mollstam/UnrealPy | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Python-2.7.10/Lib/ntpath.py | 50 | 19431 | # Module 'ntpath' -- common operations on WinNT/Win95 pathnames
"""Common pathname manipulations, WindowsNT/95 version.
Instead of importing this module directly, import os and refer to this
module as os.path.
"""
import os
import sys
import stat
import genericpath
import warnings
from genericpath import *
from gene... | mit |
aagusti/e-gaji | egaji/models/base_model.py | 1 | 1689 | from datetime import datetime
from sqlalchemy import (
Column,
Integer,
SmallInteger,
Text,
DateTime,
String,
)
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm.exc import NoResultFound
from sqlalchemy.orm import (
scoped_session,
sessionmaker,... | gpl-2.0 |
stacywsmith/ansible | lib/ansible/plugins/action/template.py | 26 | 8270 | # (c) 2015, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any lat... | gpl-3.0 |
SylvainA/os-event-catcher | openstack/common/report/views/text/generic.py | 50 | 7088 | # Copyright 2013 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | apache-2.0 |
utkbansal/kuma | kuma/contentflagging/models.py | 16 | 7036 | """Models for content moderation flagging"""
from django.conf import settings
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.core import urlresolvers
from django.core.mail import send_mail
from django.db import models
from django.t... | mpl-2.0 |
indextbag/arsenalsuite | cpp/lib/PyQt4/examples/tools/codecs/codecs.py | 20 | 8774 | #!/usr/bin/env python
#############################################################################
##
## Copyright (C) 2010 Riverbank Computing Limited.
## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
## All rights reserved.
##
## This file is part of the examples of PyQt.
##
## $QT_BEGIN_LICENS... | gpl-2.0 |
ProfessionalIT/professionalit-webiste | src/web/python23.py | 75 | 1266 | """Python 2.3 compatabilty"""
import threading
class threadlocal(object):
"""Implementation of threading.local for python2.3.
"""
def __getattribute__(self, name):
if name == "__dict__":
return threadlocal._getd(self)
else:
try:
return object.__getatt... | lgpl-3.0 |
OpenPymeMx/OCB | addons/hr_expense/__openerp__.py | 47 | 2927 | # -*- 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 |
Denisolt/IEEE-NYIT-MA | local/lib/python2.7/site-packages/django/db/backends/sqlite3/operations.py | 106 | 10799 | from __future__ import unicode_literals
import datetime
import uuid
from django.conf import settings
from django.core.exceptions import FieldError, ImproperlyConfigured
from django.db import utils
from django.db.backends import utils as backend_utils
from django.db.backends.base.operations import BaseDatabaseOperatio... | gpl-3.0 |
mozilla/stoneridge | python/src/Lib/test/test_xml_etree_c.py | 113 | 1523 | # xml.etree test for cElementTree
from test import test_support
from test.test_support import precisionbigmemtest, _2G
import unittest
cET = test_support.import_module('xml.etree.cElementTree')
# cElementTree specific tests
def sanity():
"""
Import sanity.
>>> from xml.etree import cElementTree
""... | mpl-2.0 |
tosakanth/pybluez | examples/advanced/l2-unreliable-client.py | 13 | 2572 | import sys
import fcntl
import struct
import array
import bluetooth
import bluetooth._bluetooth as bt # low level bluetooth wrappers.
def __get_acl_conn_handle(sock, addr):
hci_fd = sock.fileno()
reqstr = struct.pack( "6sB17s", bt.str2ba(addr), bt.ACL_LINK, "\0" * 17)
request = array.array( "c", reqstr )... | gpl-2.0 |
saurabh6790/test-erp | erpnext/hooks.py | 3 | 4170 | from __future__ import unicode_literals
app_name = "erpnext"
app_title = "ERPNext"
app_publisher = "Frappe Technologies Pvt. Ltd. and Contributors"
app_description = "Open Source Enterprise Resource Planning for Small and Midsized Organizations"
app_icon = "icon-th"
app_color = "#e74c3c"
app_version = "5.2.1"
error_re... | agpl-3.0 |
fr3akout/flask_ember | flask_ember/util/string.py | 1 | 1658 | import re
from .cache import Cache
CAMELIZE_REGEXP_1 = re.compile(r'(\-|_|\.|\s)+(.)?')
CAMELIZE_REGEXP_2 = re.compile(r'(^|/)([A-Z])')
def do_camelize(s):
s = CAMELIZE_REGEXP_1.sub(lambda m: m.group(2).upper(), s)
s = CAMELIZE_REGEXP_2.sub(lambda m: m.group(0).lower(), s)
return s
CAPITALIZE_REGEXP ... | bsd-3-clause |
sjaa/scheduler | pythonkc_meetups/types.py | 2 | 2328 | # -*- coding: utf-8 -*-
"""
Overview
========
Defines the types and structures returned from the PythonKC Meetup.com API
client.
Types
=====
MeetupEvent
-----------
id
Meetup.com ID for the event.
name
Name of the event.
description
Description of the event. May include markup.
time
Date & time (``dat... | gpl-3.0 |
rxuriguera/bibtexIndexMaker | src/bibim/__init__.py | 1 | 1262 |
# Copyright 2010 Ramon Xuriguera
#
# This file is part of BibtexIndexMaker.
#
# BibtexIndexMaker 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 lat... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.