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 |
|---|---|---|---|---|---|
deepesch/scikit-learn | sklearn/datasets/lfw.py | 141 | 19372 | """Loader for the Labeled Faces in the Wild (LFW) dataset
This dataset is a collection of JPEG pictures of famous people collected
over the internet, all details are available on the official website:
http://vis-www.cs.umass.edu/lfw/
Each picture is centered on a single face. The typical task is called
Face Veri... | bsd-3-clause |
jfunction/capetown_loadshedding_map | convert_json.py | 1 | 1792 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# convert_json.py
#
# Copyright 2014 Jared <jarednorman@hotmail.com>
#
# 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 o... | gpl-2.0 |
kirca/odoo | addons/auth_oauth/controllers/main.py | 30 | 7624 | import functools
import logging
import simplejson
import urlparse
import werkzeug.utils
from werkzeug.exceptions import BadRequest
import openerp
from openerp import SUPERUSER_ID
from openerp import http
from openerp.http import request
from openerp.addons.web.controllers.main import db_monodb, ensure_db, set_cookie_... | agpl-3.0 |
felixma/nova | nova/db/sqlalchemy/migrate_repo/versions/247_nullable_mismatch.py | 48 | 1692 | # Copyright 2014 OpenStack Foundation
# All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | apache-2.0 |
enthought/traitsgui | enthought/pyface/workbench/i_view.py | 1 | 4139 | #------------------------------------------------------------------------------
# Copyright (c) 2005, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in enthought/LICENSE.txt and may be redistributed only
# under the conditions describe... | bsd-3-clause |
gyllstar/appleseed | pox/openflow/libopenflow_01.py | 1 | 126928 | # Copyright 2011 James McCauley
#
# This file is part of POX.
#
# POX is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# POX is distri... | gpl-3.0 |
HolgerPeters/scikit-learn | sklearn/ensemble/gradient_boosting.py | 5 | 73159 | """Gradient Boosted Regression Trees
This module contains methods for fitting gradient boosted regression trees for
both classification and regression.
The module structure is the following:
- The ``BaseGradientBoosting`` base class implements a common ``fit`` method
for all the estimators in the module. Regressio... | bsd-3-clause |
timothyparez/PyBitmessage | src/bitmessageqt/support.py | 4 | 4943 | import ctypes
from PyQt4 import QtCore, QtGui
import ssl
import sys
import time
import account
from debug import logger
from foldertree import AccountMixin
from helper_sql import *
from l10n import getTranslationLanguage
from openclpow import has_opencl
from proofofwork import bmpow
from pyelliptic.openssl import Open... | mit |
Lektorium-LLC/edx-platform | cms/djangoapps/contentstore/views/tests/test_item.py | 3 | 148881 | """Tests for items views."""
import json
from datetime import datetime, timedelta
import ddt
from django.conf import settings
from django.core.urlresolvers import reverse
from django.http import Http404
from django.test import TestCase
from django.test.client import RequestFactory
from mock import Mock, PropertyMock, ... | agpl-3.0 |
michaelld/gnuradio | gr-qtgui/examples/pyqt_time_c.py | 7 | 6860 | #!/usr/bin/env python
#
# Copyright 2011,2012,2015 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 ... | gpl-3.0 |
mateon1/servo | tests/wpt/web-platform-tests/tools/gitignore/tests/test_gitignore.py | 98 | 2034 | import pytest
from ..gitignore import fnmatch_translate, PathFilter
match_data = [
("foo", False, ["a/foo", "foo"]),
("*.a", False, ["foo.a", "a/foo.a", "a/b/foo.a", "a.a/foo.a"]),
("*.py[co]", False, ["a.pyc", "a.pyo", "a/b/c.pyc"]),
("\\#*", False, ["#a", "a/#b"]),
("*#", False, ["a#", "a/b#", "... | mpl-2.0 |
caldwell/servo | tests/wpt/web-platform-tests/webdriver/javascript/execute_script_test.py | 65 | 5664 | import os
import sys
import unittest
sys.path.insert(1, os.path.abspath(os.path.join(__file__, "../..")))
import base_test
class ExecuteScriptTest(base_test.WebDriverBaseTest):
def test_ecmascript_translates_null_return_to_none(self):
self.driver.get(self.webserver.where_is("javascript/res/execute_script... | mpl-2.0 |
0x0all/scikit-learn | examples/covariance/plot_covariance_estimation.py | 250 | 5070 | """
=======================================================================
Shrinkage covariance estimation: LedoitWolf vs OAS and max-likelihood
=======================================================================
When working with covariance estimation, the usual approach is to use
a maximum likelihood estimator,... | bsd-3-clause |
abimannans/scikit-learn | sklearn/mixture/tests/test_gmm.py | 200 | 17427 | import unittest
import copy
import sys
from nose.tools import assert_true
import numpy as np
from numpy.testing import (assert_array_equal, assert_array_almost_equal,
assert_raises)
from scipy import stats
from sklearn import mixture
from sklearn.datasets.samples_generator import make_spd_ma... | bsd-3-clause |
alvarop/silta | sw/examples/drivers/max31855.py | 1 | 1403 | #!/usr/bin/env python
#
# SPI example (using the STM32F407 discovery board)
#
import sys
import time
import ctypes
from silta import stm32f407
def bytes_to_int(byte_list):
num = 0
for byte in range(len(byte_list)):
num += byte_list[byte] << ((len(byte_list) - 1 - byte) * 8)
return num
class MA... | bsd-2-clause |
eternalthinker/flask-server-rq-example | venv/lib/python2.7/site-packages/setuptools/package_index.py | 84 | 38798 | """PyPI and direct package downloading"""
import sys
import os
import re
import shutil
import socket
import base64
import hashlib
from functools import wraps
from pkg_resources import (
CHECKOUT_DIST, Distribution, BINARY_DIST, normalize_path, SOURCE_DIST,
require, Environment, find_distributions, safe_name, s... | apache-2.0 |
Lujeni/ansible | lib/ansible/modules/cloud/xenserver/xenserver_guest_info.py | 11 | 7874 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2018, Bojan Vitnik <bvitnik@mainstream.rs>
# 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_versi... | gpl-3.0 |
funkring/fdoo | addons/l10n_ar/__init__.py | 2120 | 1456 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2011 Cubic ERP - Teradata SAC. (http://cubicerp.com).
#
# WARNING: This program as such is intended to be used by professional
# programmers who take t... | agpl-3.0 |
dcastro9/patternrec_ps2 | code/alcohol_script.py | 1 | 5623 | from Dataset import Dataset
from WTA_Hasher import WTAHasher
from kNN_Classifier import kNNClassifier
import numpy as np
import matplotlib.pyplot as plt
import copy
ds_train_dir = "../datasets/alcohol/alcoholism_training.csv"
ds_test_dir = "../datasets/alcohol/alcoholism_test.csv"
results_dir = "../final_results/alcoh... | mit |
GaussDing/django | tests/test_runner/test_discover_runner.py | 97 | 6079 | import os
from contextlib import contextmanager
from unittest import TestSuite, TextTestRunner, defaultTestLoader
from django.test import TestCase
from django.test.runner import DiscoverRunner
@contextmanager
def change_cwd(directory):
current_dir = os.path.abspath(os.path.dirname(__file__))
new_dir = os.pat... | bsd-3-clause |
2014c2g2/2015cdag2_0421 | static/Brython3.1.1-20150328-091302/Lib/xml/sax/__init__.py | 637 | 3505 | """Simple API for XML (SAX) implementation for Python.
This module provides an implementation of the SAX 2 interface;
information about the Java version of the interface can be found at
http://www.megginson.com/SAX/. The Python version of the interface is
documented at <...>.
This package contains the following modu... | agpl-3.0 |
thaumos/ansible | lib/ansible/modules/network/aci/aci_interface_policy_fc.py | 27 | 6184 | #!/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 |
yencarnacion/jaikuengine | .google_appengine/lib/django-1.2/django/db/backends/postgresql/creation.py | 51 | 3650 | from django.db.backends.creation import BaseDatabaseCreation
class DatabaseCreation(BaseDatabaseCreation):
# This dictionary maps Field objects to their associated PostgreSQL column
# types, as strings. Column-type strings can contain format strings; they'll
# be interpolated against the values of Field.__... | apache-2.0 |
icexelloss/spark | sql/hive/src/test/resources/data/scripts/input20_script.py | 131 | 1028 | #
# 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 |
OpusVL/odoo-trading-as | trading_as/res_partner.py | 1 | 1361 | # -*- coding: utf-8 -*-
##############################################################################
#
# Trading As Brands
# Copyright (C) 2015 OpusVL (<http://opusvl.com/>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# pub... | agpl-3.0 |
dhruv13J/scikit-learn | sklearn/tests/test_naive_bayes.py | 142 | 17496 | import pickle
from io import BytesIO
import numpy as np
import scipy.sparse
from sklearn.datasets import load_digits, load_iris
from sklearn.cross_validation import cross_val_score, train_test_split
from sklearn.externals.six.moves import zip
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.te... | bsd-3-clause |
pkappesser/youtube-dl | youtube_dl/extractor/anysex.py | 224 | 2085 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
parse_duration,
int_or_none,
)
class AnySexIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?anysex\.com/(?P<id>\d+)'
_TEST = {
'url': 'http://anysex.com/156592/',
'md5': '023... | unlicense |
Edraak/edraak-platform | lms/djangoapps/courseware/tests/test_view_authentication.py | 9 | 17630 | import datetime
import pytz
from django.urls import reverse
from mock import patch
from nose.plugins.attrib import attr
from six import text_type
from courseware.access import has_access
from courseware.tests.factories import (
BetaTesterFactory,
GlobalStaffFactory,
InstructorFactory,
OrgInstructorFac... | agpl-3.0 |
goyalankit/po-compiler | object_files/networkx-1.8.1/networkx/algorithms/centrality/tests/test_current_flow_betweenness_centrality.py | 89 | 7721 | #!/usr/bin/env python
from nose.tools import *
from nose import SkipTest
import networkx
from nose.plugins.attrib import attr
from networkx import edge_current_flow_betweenness_centrality \
as edge_current_flow
from networkx import approximate_current_flow_betweenness_centrality \
as approximate_cfbc
class T... | apache-2.0 |
fedebell/Laboratorio3 | Laboratorio2/GraficiBestFit/fitAnalistico.py | 1 | 1562 | import numpy
import pylab
from scipy.optimize import curve_fit
import math
import scipy.stats
V, dV, I, dI = pylab.loadtxt("data00.txt", unpack="True")
#Best fit analitico
#Dy e Dx sono le colonne di errori
x = V
Dx = dV
y = I
Dy = dI
#set error an statistical weight
sigma = Dy
w = 1/(sigma**2)
#determine the coeff... | gpl-3.0 |
jorsea/odoo-addons | purchase_line_defaults/purchase.py | 8 | 1104 | # -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in module root
# directory
##############################################################################
from openerp import models, api
class purchase_o... | agpl-3.0 |
claudep/translate | translate/tools/pydiff.py | 1 | 12227 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2005, 2006 Zuza Software Foundation
#
# This file is part of translate.
#
# translate 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 ... | gpl-2.0 |
marcore/edx-platform | lms/djangoapps/lms_migration/management/commands/manage_course_groups.py | 250 | 2091 | #!/usr/bin/python
#
# File: manage_course_groups
#
# interactively list and edit membership in course staff and instructor groups
import re
from django.core.management.base import BaseCommand
from django.contrib.auth.models import User, Group
#-----------------------------------------------------------------------... | agpl-3.0 |
swiharta/radres | polls/pygooglechart.py | 1 | 22228 | """
PyGoogleChart - A complete Python wrapper for the Google Chart API
http://pygooglechart.slowchop.com/
Copyright 2007 Gerald Kaszuba
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 versio... | mit |
wasidennis/ObjectFlow | caffe-cedn-dev/src/caffe/test/test_data/generate_sample_data.py | 4 | 1152 | """
Generate data used in the HDF5DataLayer test.
"""
import os
import numpy as np
import h5py
num_cols = 8
num_rows = 10
height = 6
width = 5
total_size = num_cols * num_rows * height * width
data = np.arange(total_size)
data = data.reshape(num_rows, num_cols, height, width)
data = data.astype('float32')
# We had a... | mit |
mrnamingo/vix4-34-enigma2-bcm | lib/python/Plugins/Plugin.py | 5 | 4041 | from Components.config import ConfigSubsection, config
import os
config.plugins = ConfigSubsection()
class PluginDescriptor:
"""An object to describe a plugin."""
# where to list the plugin. Note that there are different call arguments,
# so you might not be able to combine them.
# supported arguments are:
# ... | gpl-2.0 |
turtleloveshoes/kitsune | kitsune/search/tests/test_api.py | 11 | 10186 | import json
import time
from nose.tools import eq_
from rest_framework.test import APIClient
from django.conf import settings
from kitsune.search.tests.test_es import ElasticTestCase
from kitsune.sumo.urlresolvers import reverse
from kitsune.questions.tests import question, answer
from kitsune.products.tests import ... | bsd-3-clause |
marvin-jens/fast_ska | setup.py | 1 | 2027 | from setuptools import setup
from setuptools.extension import Extension
try:
from Cython.Distutils import build_ext
from Cython.Build import cythonize
except ImportError:
use_cython = False
else:
use_cython = True
cmdclass = { }
ext_modules = [ ]
if use_cython:
ext_modules += [
#Extension... | mit |
ImageEngine/gaffer | startup/gui/layouts.py | 8 | 8208 | ##########################################################################
#
# Copyright (c) 2011-2012, John Haddon. All rights reserved.
# Copyright (c) 2011-2013, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted prov... | bsd-3-clause |
machtfit/django-oscar-accounts | accounts/views.py | 6 | 1083 | from django.views import generic
from accounts.forms import AccountForm
from accounts import security
class AccountBalanceView(generic.FormView):
form_class = AccountForm
template_name = 'accounts/balance_check.html'
def get_context_data(self, **kwargs):
ctx = super(AccountBalanceView, self).get... | bsd-3-clause |
the-virtual-brain/tvb-hpc | examples/btest.py | 1 | 1617 | import numpy as np
import loopy as lp
target = lp.CudaTarget()
kernel = lp.make_kernel(
"{ [i_node,j_node]: 0<=i_node,j_node<n_node}",
"""
<float32> coupling_value = params(1)
<float32> speed_value = params(0)
<float32> dt=0.1
<float32> M_PI_F = 2.0
<float32> rec_n = 1.0f / n_node
<float32> rec_speed_dt = 1... | apache-2.0 |
hagabbar/pycbc_copy | examples/distributions/spin_spatial_distr_example.py | 14 | 1973 | import numpy
import matplotlib.pyplot as plt
import pycbc.coordinates as co
from mpl_toolkits.mplot3d import Axes3D
from pycbc import distributions
# We can choose any bounds between 0 and pi for this distribution but in units
# of pi so we use between 0 and 1.
theta_low = 0.
theta_high = 1.
# Units of pi for the bou... | gpl-3.0 |
shitolepriya/Saloon_erp | erpnext/accounts/report/budget_variance_report/budget_variance_report.py | 63 | 4771 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _, msgprint
from frappe.utils import flt
from frappe.utils import formatdate
import time
from erpnext.accounts.utils im... | agpl-3.0 |
mmazanec22/too-windy | env/lib/python3.5/site-packages/pip/_vendor/packaging/requirements.py | 448 | 4327 | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
import string
import re
from pip._vendor.pyparsing import (
stringSta... | gpl-3.0 |
wtgme/labeldoc2vec | gensim/summarization/textcleaner.py | 53 | 3647 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
from gensim.summarization.syntactic_unit import SyntacticUnit
from gensim.parsing.preprocessing import preprocess_documents
from gensim.utils import tokenize
from six.moves import xrange
import re... | lgpl-2.1 |
guerrerocarlos/odoo | addons/portal_project/__openerp__.py | 380 | 1686 | # -*- 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 |
jorik041/the-backdoor-factory | backdoor.py | 3 | 26910 | #!/usr/bin/env python
'''
BackdoorFactory (BDF) v2 - Tertium Quid
Many thanks to Ryan O'Neill --ryan 'at' codeslum <d ot> org--
Without him, I would still be trying to do stupid things
with the elf format.
Also thanks to Silvio Cesare with his 1998 paper
(http://vxheaven.org/lib/vsc01.html) which these ELF patching
t... | bsd-3-clause |
ashishnitinpatil/django_appengine_project_template | django/contrib/gis/db/backends/postgis/operations.py | 108 | 24998 | import re
from decimal import Decimal
from django.conf import settings
from django.contrib.gis.db.backends.base import BaseSpatialOperations
from django.contrib.gis.db.backends.util import SpatialOperation, SpatialFunction
from django.contrib.gis.db.backends.postgis.adapter import PostGISAdapter
from django.contrib.gi... | bsd-2-clause |
dbaxa/django | tests/gis_tests/gis_migrations/test_commands.py | 276 | 2723 | from __future__ import unicode_literals
from django.core.management import call_command
from django.db import connection
from django.test import TransactionTestCase, skipUnlessDBFeature
@skipUnlessDBFeature("gis_enabled")
class MigrateTests(TransactionTestCase):
"""
Tests running the migrate command in Geodj... | bsd-3-clause |
lecaoquochung/ddnb.django | tests/delete/models.py | 148 | 3676 | from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class R(models.Model):
is_default = models.BooleanField(default=False)
def __str__(self):
return "%s" % self.pk
get_default_r = lambda: R.... | bsd-3-clause |
eepalms/gem5-newcache | tests/configs/realview-simple-timing-dual.py | 6 | 2272 | # Copyright (c) 2012 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the functionality ... | bsd-3-clause |
dionyziz/ting | API/chat/tests/message/test_post_view.py | 3 | 6826 | from chat.tests.message.common import *
from django.utils.dateformat import format
class MessageViewPOSTTests(ChatTests):
def post_and_get_response(self, message_content, timestamp, username, typing, message_type):
"""
Posts a message on chat:message and returns the response
"""
re... | mit |
mywaiting/LifeLogger | tornado/options.py | 58 | 19182 | #!/usr/bin/env python
#
# Copyright 2009 Facebook
#
# 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 a... | mit |
ampax/edx-platform | lms/djangoapps/course_api/blocks/transformers/navigation.py | 35 | 3103 | """
TODO
"""
from openedx.core.lib.block_structure.transformer import BlockStructureTransformer
from .block_depth import BlockDepthTransformer
class DescendantList(object):
"""
Contain
"""
def __init__(self):
self.items = []
class BlockNavigationTransformer(BlockStructureTransformer):
""... | agpl-3.0 |
creativewild/ansible | v1/ansible/runner/lookup_plugins/nested.py | 174 | 2285 | # (c) 2012, 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 |
fossoult/odoo | addons/hr_evaluation/__init__.py | 432 | 1084 | # -*- encoding: 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 G... | agpl-3.0 |
zaxliu/deepnap | experiments/kdd-exps/experiment_DynaQNN_130_Feb10_2317.py | 1 | 5180 | # System built-in modules
import time
from datetime import datetime
import sys
import os
from multiprocessing import Pool
# Project dependency modules
import pandas as pd
pd.set_option('mode.chained_assignment', None) # block warnings due to DataFrame value assignment
import lasagne
# Project modules
sys.path.append('... | bsd-3-clause |
ebeshero/Pittsburgh_Frankenstein | collateXPrep/svg_tester_collation.py | 1 | 6475 | from typing import Pattern
from collatex import *
from xml.dom import pulldom
import string
import re
import json
import glob
regexWhitespace = re.compile(r'\s+')
regexNonWhitespace = re.compile(r'\S+')
regexEmptyTag = re.compile(r'/>$')
regexBlankLine = re.compile(r'\n{2,}')
regexLeadingBlankLine = re.compile(r'^\n'... | agpl-3.0 |
simartin/servo | components/script/dom/bindings/codegen/ply/ply/lex.py | 4 | 35150 | # -----------------------------------------------------------------------------
# ply: lex.py
#
# Copyright (C) 2001-2020
# David M. Beazley (Dabeaz LLC)
# All rights reserved.
#
# Latest version: https://github.com/dabeaz/ply
#
# Redistribution and use in source and binary forms, with or without
# modification, are pe... | mpl-2.0 |
binhqnguyen/lena | .waf-1.7.13-5a064c2686fe54de4e11018d22148cfc/waflib/Tools/kde4.py | 275 | 2007 | #! /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 os,sys,re
from waflib import Options,TaskGen,Task,Utils
from waflib.TaskGen import feature,after_method
@feature('msgfmt')
def apply_msgfmt(self):
for lang in self.to_... | gpl-2.0 |
Imaginashion/cloud-vision | .fr-d0BNfn/django-jquery-file-upload/venv/lib/python3.5/site-packages/django/conf/locale/de_CH/formats.py | 504 | 1445 | # -*- 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
from __future__ import unicode_literals
DATE_FORMAT = 'j. F Y'
TIME_FORMAT = 'H:i'
DATE... | mit |
mcus/SickRage | lib/feedparser/namespaces/dc.py | 43 | 4477 | # Support for the Dublin Core metadata extensions
# Copyright 2010-2015 Kurt McKee <contactme@kurtmckee.org>
# Copyright 2002-2008 Mark Pilgrim
# All rights reserved.
#
# This file is a part of feedparser.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that... | gpl-3.0 |
sqlalchemy/sqlalchemy | examples/asyncio/basic.py | 3 | 2210 | """Illustrates the asyncio engine / connection interface.
In this example, we have an async engine created by
:func:`_engine.create_async_engine`. We then use it using await
within a coroutine.
"""
import asyncio
from sqlalchemy import Column
from sqlalchemy import Integer
from sqlalchemy import MetaData
from sq... | mit |
randynobx/ansible | lib/ansible/modules/cloud/openstack/os_zone.py | 29 | 7527 | #!/usr/bin/python
# Copyright (c) 2016 Hewlett-Packard Enterprise
#
# This module 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.
#
# T... | gpl-3.0 |
gadomski/cpd | vendor/googletest-release-1.10.0/googletest/scripts/common.py | 1180 | 2919 | # Copyright 2013 Google Inc. All Rights Reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the foll... | gpl-2.0 |
tylertian/Openstack | openstack F/horizon/horizon/tests/test_data/exceptions.py | 3 | 2423 | # Copyright 2012 Nebula, 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 agree... | apache-2.0 |
mapr/hue | desktop/core/ext-py/Paste-2.0.1/paste/exceptions/reporter.py | 50 | 4576 | # (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org)
# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
import smtplib
import time
try:
from socket import sslerror
ex... | apache-2.0 |
kedz/sumpy | sumpy/io.py | 1 | 4037 | import os
import re
import pandas as pd
def load_duc_docset(input_source):
docs = DucSgmlReader().read(input_source)
return docs
def load_duc_abstractive_summaries(input_source):
models = DucAbstractSgmlReader().read(input_source)
return models
class FileInput(object):
def gather_paths(self, sou... | apache-2.0 |
luhanhan/horizon | horizon/templatetags/branding.py | 88 | 2028 | # Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the... | apache-2.0 |
lyft/incubator-airflow | airflow/example_dags/example_passing_params_via_test_command.py | 4 | 2352 | #
# 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... | apache-2.0 |
jgoclawski/django | tests/validation/tests.py | 301 | 8536 | from __future__ import unicode_literals
from django import forms
from django.core.exceptions import NON_FIELD_ERRORS
from django.test import TestCase
from django.utils.functional import lazy
from . import ValidationTestCase
from .models import (
Article, Author, GenericIPAddressTestModel, GenericIPAddrUnpackUniqu... | bsd-3-clause |
fabianekc/n7 | n7.py | 1 | 2906 | #!/usr/bin/python
import urllib, inflect, string, json, sys, Algorithmia
# tests
# python n7.py '{"h2t":"http://slashdot.org", "auth":"API_KEY"}'
# python n7.py '{"url":"http://derstandard.at"}'
# python n7.py '{"text":"life is a miracle"}'
# initialize
p = inflect.engine()
text = ""
offset = 7
start_line = -1
... | mit |
mathiasertl/django-ca | ca/django_ca/management/commands/init_ca.py | 1 | 10835 | # This file is part of django-ca (https://github.com/mathiasertl/django-ca).
#
# django-ca 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 |
hipikat/django-revkom | revkom/utils/mixins.py | 1 | 4147 | """
Generic mixins for classes.
"""
from functools import partial
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
class GetSettingsMixin(object):
"""
A generic class mixin which adds a _get_settings() method, which will
return a tuple of settings or throw appropri... | bsd-2-clause |
JimCircadian/ansible | lib/ansible/modules/remote_management/ipmi/ipmi_boot.py | 23 | 5576 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# 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',
... | gpl-3.0 |
mgagne/nova | nova/tests/unit/api/openstack/compute/contrib/test_cloudpipe_update.py | 38 | 3994 | # Copyright 2012 IBM Corp.
#
# 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 t... | apache-2.0 |
RapidApplicationDevelopment/tensorflow | tensorflow/contrib/stat_summarizer/__init__.py | 17 | 1284 | # 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 |
djw8605/condor | src/condor_contrib/mgmt/qmf/test/jobcontrol.py | 9 | 1434 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2009-2011 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
#
# Unle... | apache-2.0 |
anryko/ansible | lib/ansible/modules/net_tools/hetzner_failover_ip.py | 30 | 3706 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2019 Felix Fontein <felix@fontein.de>
# 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 |
StephenWeber/ansible | lib/ansible/modules/network/panos/panos_cert_gen_ssh.py | 19 | 6384 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Ansible module to manage PaloAltoNetworks Firewall
# (c) 2016, techbizdev <techbizdev@paloaltonetworks.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 publish... | gpl-3.0 |
sunlianqiang/kbengine | kbe/res/scripts/common/Lib/lib2to3/patcomp.py | 93 | 7075 | # Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Pattern compiler.
The grammer is taken from PatternGrammar.txt.
The compiler compiles a pattern to a pytree.*Pattern instance.
"""
__author__ = "Guido van Rossum <guido@python.org>"
# Python imports
import io
imp... | lgpl-3.0 |
csuttles/utils | python/todo-api/flask/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/connection.py | 679 | 3293 | import socket
try:
from select import poll, POLLIN
except ImportError: # `poll` doesn't exist on OSX and other platforms
poll = False
try:
from select import select
except ImportError: # `select` doesn't exist on AppEngine.
select = False
def is_connection_dropped(conn): # Platform-... | apache-2.0 |
puzan/ansible | lib/ansible/modules/cloud/openstack/os_keypair.py | 3 | 5344 | #!/usr/bin/python
# Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
# Copyright (c) 2013, Benno Joy <benno@ansible.com>
# Copyright (c) 2013, John Dewey <john@dewey.ws>
#
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publish... | gpl-3.0 |
mskrzypkows/servo | tests/wpt/web-platform-tests/tools/html5lib/html5lib/treewalkers/pulldom.py | 1729 | 2302 | from __future__ import absolute_import, division, unicode_literals
from xml.dom.pulldom import START_ELEMENT, END_ELEMENT, \
COMMENT, IGNORABLE_WHITESPACE, CHARACTERS
from . import _base
from ..constants import voidElements
class TreeWalker(_base.TreeWalker):
def __iter__(self):
ignore_until = None... | mpl-2.0 |
dannybrowne86/django-timepiece | timepiece/tests/test_utils.py | 3 | 2189 | import datetime
from django.test import TestCase
from timepiece.utils import get_active_entry, ActiveEntryError
from timepiece import utils
from . import factories
class UtilityFunctionsTest(TestCase):
def setUp(self):
# Setup last billable days
self.last_billable = [
utils.add_tim... | mit |
alaw1290/CS591B1 | analysis/test_data_weighted_sums.py | 1 | 2907 | import pickle
import numpy as np
import cf_recommender as cf
import similarity_functions as sf
import movie_reviews_compiler as mrc
path = '../data/'
def run_test_weighted_sums(cosine=True):
'''compute the predictions for masked values in the testing set (user review vectors) using the training set (critic review ma... | mit |
ddayguerrero/blogme | flask/lib/python3.4/site-packages/sqlalchemy/dialects/sqlite/pysqlcipher.py | 80 | 4129 | # sqlite/pysqlcipher.py
# Copyright (C) 2005-2015 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
.. dialect:: sqlite+pysqlcipher
:name: pysqlcipher
:dbapi: pysqlci... | mit |
anthgur/servo | tests/wpt/web-platform-tests/tools/third_party/pytest/_pytest/assertion/__init__.py | 15 | 5166 | """
support for presenting detailed information in failing assertions.
"""
from __future__ import absolute_import, division, print_function
import sys
import six
from _pytest.assertion import util
from _pytest.assertion import rewrite
from _pytest.assertion import truncate
def pytest_addoption(parser):
group = p... | mpl-2.0 |
clk8908/pymc3 | pymc3/tests/test_ndarray_backend.py | 13 | 2679 | import unittest
import numpy as np
import numpy.testing as npt
from pymc3.tests import backend_fixtures as bf
from pymc3.backends import base, ndarray
class TestNDArray0dSampling(bf.SamplingTestCase):
backend = ndarray.NDArray
name = None
shape = ()
class TestNDArray1dSampling(bf.SamplingTestCase):
... | apache-2.0 |
youfoh/webkit-efl | Tools/Scripts/webkitpy/layout_tests/models/test_results_unittest.py | 5 | 2293 | # Copyright (C) 2010 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... | lgpl-2.1 |
csirtgadgets/bearded-avenger | test/zsqlite/test_store_sqlite_tokens.py | 1 | 5082 | import logging
import os
import tempfile
from argparse import Namespace
import pytest
from cif.store import Store
from cifsdk.utils import setup_logging
import arrow
from datetime import datetime
from pprint import pprint
from cifsdk.exceptions import AuthError
args = Namespace(debug=True, verbose=None)
setup_logging(... | mpl-2.0 |
MarcBS/Motion_Video_Segmentation | SIFT/vlfeat-0.9.16/docsrc/mdoc.py | 11 | 16193 | #!/usr/bin/python
# file: mdoc.py
# author: Brian Fulkerson and Andrea Vedaldi
# description: MDoc main
# Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson.
# All rights reserved.
#
# This file is part of the VLFeat library and is made available under
# the terms of the BSD license (see the COPYING ... | gpl-2.0 |
tbenthompson/taskloaf | taskloaf/promise.py | 1 | 5194 | import asyncio
import taskloaf
from .refcounting import Ref
from .object_ref import put, is_ref, ObjectRef
import logging
logger = logging.getLogger(__name__)
def await_handler(args):
req_addr = args[0]
pr = args[1]
async def await_wrapper():
result_ref = await pr._get_future()
taskloa... | mit |
valkjsaaa/sl4a | python/src/Tools/framer/framer/slots.py | 50 | 2245 | """Descriptions of all the slots in Python's type objects."""
class Slot(object):
def __init__(self, name, cast=None, special=None, default="0"):
self.name = name
self.cast = cast
self.special = special
self.default = default
Slots = (Slot("ob_size"),
Slot("tp_name"),
... | apache-2.0 |
sagangwee/sagangwee.github.io | build/pygments/pygments/lexers/testing.py | 72 | 8704 | # -*- coding: utf-8 -*-
"""
pygments.lexers.testing
~~~~~~~~~~~~~~~~~~~~~~~
Lexers for testing languages.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.lexer import RegexLexer, include, bygroups
from pygments.token imp... | mit |
ferabra/edx-platform | common/test/acceptance/fixtures/edxnotes.py | 14 | 1841 | """
Tools for creating edxnotes content fixture data.
"""
import json
import factory
import requests
from . import EDXNOTES_STUB_URL
class Range(factory.Factory):
class Meta(object): # pylint: disable=missing-docstring
model = dict
start = "/div[1]/p[1]"
end = "/div[1]/p[1]"
startOffset = 0... | agpl-3.0 |
gimite/personfinder | app/vendors/oauth2client/_helpers.py | 39 | 10852 | # Copyright 2015 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 |
MridulS/sympy | sympy/physics/quantum/shor.py | 17 | 5901 | """Shor's algorithm and helper functions.
Todo:
* Get the CMod gate working again using the new Gate API.
* Fix everything.
* Update docstrings and reformat.
* Remove print statements. We may want to think about a better API for this.
"""
from __future__ import print_function, division
import math
import random
fro... | bsd-3-clause |
xodus7/tensorflow | tensorflow/contrib/slim/python/slim/nets/vgg_test.py | 25 | 17465 | # 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 |
zzcclp/spark | python/pyspark/pandas/tests/test_groupby.py | 14 | 118068 | #
# 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.