repo_name stringlengths 5 100 | path stringlengths 4 375 | copies stringclasses 991
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
partofthething/home-assistant | homeassistant/components/progettihwsw/config_flow.py | 11 | 3383 | """Config flow for ProgettiHWSW Automation integration."""
from ProgettiHWSW.ProgettiHWSWAPI import ProgettiHWSWAPI
import voluptuous as vol
from homeassistant import config_entries, core, exceptions
from .const import DOMAIN
DATA_SCHEMA = vol.Schema(
{vol.Required("host"): str, vol.Required("port", default=80)... | mit |
2014c2g2/2015cdag2_test | static/Brython3.1.1-20150328-091302/Lib/random.py | 518 | 26080 | """Random variable generators.
integers
--------
uniform within range
sequences
---------
pick random element
pick random sample
generate random permutation
distributions on the real line:
------------------------------
uniform
... | gpl-3.0 |
PYPIT/PYPIT | pypeit/scripts/lowrdx_pixflat.py | 1 | 1101 | #!/usr/bin/env python
#
# See top-level LICENSE file for Copyright information
#
# -*- coding: utf-8 -*-
"""
This script converts a LowRedux pixel flat into a PYPIT ready one
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_... | gpl-3.0 |
StackStorm/mistral | mistral/engine/utils.py | 1 | 3037 | # Copyright 2014 - Mirantis, Inc.
# Copyright 2015 - Huawei Technologies Co. Ltd
#
# 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 |
nik3daz/chrome-app-samples | push-guestbook/guestbook-srv/third_party/oauth2client/appengine.py | 26 | 22703 | # Copyright (C) 2010 Google 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 agreed to in writ... | apache-2.0 |
tv42/camlistore | lib/python/fusepy/fuse.py | 23 | 22799 | # Copyright (c) 2008 Giorgos Verigakis <verigak@gmail.com>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE... | apache-2.0 |
icaoberg/cellorganizer-galaxy-tools | datatypes/dataproviders/base.py | 1 | 12481 | """
Base class(es) for all DataProviders.
"""
# there's a blurry line between functionality here and functionality in datatypes module
# attempting to keep parsing to a minimum here and focus on chopping/pagination/reformat(/filtering-maybe?)
# and using as much pre-computed info/metadata from the datatypes module as... | gpl-3.0 |
mcalhoun/ansible | lib/ansible/compat/__init__.py | 332 | 1088 | # (c) 2014, Toshio Kuratomi <tkuratomi@ansible.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later... | gpl-3.0 |
rockyzhang/zhangyanhit-python-for-android-mips | python3-alpha/python3-src/Lib/test/test_math.py | 55 | 46049 | # Python test set -- math module
# XXXX Should not do tests around zero only
from test.support import run_unittest, verbose, requires_IEEE_754
import unittest
import math
import os
import sys
import random
import struct
import sysconfig
eps = 1E-05
NAN = float('nan')
INF = float('inf')
NINF = float('-inf')
# detect ... | apache-2.0 |
carvalhomb/tsmells | fetch/scripts/postprocessing/aggregateVersionMetricData.py | 1 | 8766 | # !/usr/bin/python
# This file is part of snavtofamix (Source Navigator to FAMIX).
#
# snavtofamix is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of the License, or (at your
# option) any ... | gpl-2.0 |
chainer/chainer | chainer/functions/activation/softmax.py | 8 | 3591 | import chainer
from chainer import backend
from chainer.backends import cuda
from chainer import function_node
import chainer.functions
from chainer.utils import type_check
if cuda.cudnn_enabled:
cudnn = cuda.cudnn
_algorithm = cuda.libcudnn.CUDNN_SOFTMAX_ACCURATE
class Softmax(function_node.FunctionNode):
... | mit |
clemux/debsources | debsources/plugins/hook_hello.py | 6 | 1244 | # Copyright (C) 2013-2014 The Debsources developers <info@sources.debian.net>.
# See the AUTHORS file at the top-level directory of this distribution and at
# https://anonscm.debian.org/gitweb/?p=qa/debsources.git;a=blob;f=AUTHORS;hb=HEAD
#
# This file is part of Debsources. Debsources is free software: you can
# redi... | agpl-3.0 |
biddisco/VTK | Filters/General/Testing/Python/spatialRepAll.py | 21 | 3220 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
=========================================================================
Program: Visualization Toolkit
Module: TestNamedColorsIntegration.py
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.... | bsd-3-clause |
openstates/openstates.org | graphapi/middleware.py | 1 | 1898 | import logging
from graphql.language.ast import FragmentSpread, Variable
class QueryCostException(Exception):
pass
log = logging.getLogger("graphapi")
def _get_counts(info, fragments, variable_values):
multiplier = 1
inner_multiplier = 0
if isinstance(info, FragmentSpread):
for selection ... | mit |
dbckz/ansible | lib/ansible/modules/cloud/amazon/ec2_vpc_nat_gateway.py | 33 | 34892 | #!/usr/bin/python
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed... | gpl-3.0 |
kevinmel2000/EmeraldBox | emerald/model_generator.py | 2 | 5245 | import os.path
import sys
from config import BASEDIR
from config import WHITE_SPACE
from config import SQLALCHEMY_MIGRATE_REPO
from database_operations import db_create, db_migrate
from controller_generator import generate_controller
from template_generator import generate_index_template
from template_generator impor... | mit |
openvapour/ryu | ryu/lib/packet/packet.py | 9 | 4718 | # Copyright (C) 2012 Nippon Telegraph and Telephone Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | apache-2.0 |
valintinr/opennode-knot | opennode/knot/model/machines.py | 2 | 2123 | from __future__ import absolute_import
from grokcore.component import context
from zope import schema
from zope.component import provideSubscriptionAdapter
from zope.interface import Interface, implements
from opennode.knot.model.compute import Compute
from opennode.knot.model.hangar import Hangar
from opennode.oms.m... | gpl-3.0 |
466152112/scikit-learn | sklearn/utils/tests/test_sparsefuncs.py | 57 | 13752 | import numpy as np
import scipy.sparse as sp
from scipy import linalg
from numpy.testing import assert_array_almost_equal, assert_array_equal
from sklearn.datasets import make_classification
from sklearn.utils.sparsefuncs import (mean_variance_axis,
inplace_column_scale,
... | bsd-3-clause |
vsoch/myconnectome | myconnectome/rsfmri/mk_parcellation_boundaries.py | 2 | 1478 | """
make file showing boundaries from parcellation
"""
import numpy,nibabel
import nibabel.gifti.giftiio
import os
from myconnectome.utils import set_structure
basedir=os.environ['MYCONNECTOME_DIR']
def mk_parcellation_boundaries():
lh=os.path.join(basedir,'parcellation/all_selected_L_new_parcel_renumbered.func... | mit |
snnn/tensorflow | tensorflow/python/framework/device_test.py | 71 | 6791 | # 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 |
albertshift/omim | 3party/protobuf/python/google/protobuf/internal/text_encoding_test.py | 74 | 2858 | #! /usr/bin/python
#
# Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# https://developers.google.com/protocol-buffers/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
... | apache-2.0 |
robwebset/script.tvtunes | plugin.py | 1 | 17633 | # -*- coding: utf-8 -*-
import sys
import os
import re
import urllib
import urlparse
import xbmc
import xbmcgui
import xbmcplugin
import xbmcaddon
import xbmcvfs
if sys.version_info < (2, 7):
import simplejson
else:
import json as simplejson
# Import the common settings
from resources.lib.settings import Sett... | gpl-2.0 |
HKUST-SING/tensorflow | tensorflow/contrib/distributions/python/kernel_tests/quantized_distribution_test.py | 32 | 17752 | # 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 |
Karel-van-de-Plassche/bokeh | bokeh/command/subcommands/tests/test_json.py | 13 | 3465 | from __future__ import absolute_import
import argparse
import pytest
import os
import sys
is_python2 = sys.version_info[0] == 2
import bokeh.command.subcommands.json as scjson
from bokeh.command.bootstrap import main
from bokeh.util.testing import TmpDir, WorkingDir, with_directory_contents
from . import basic_scat... | bsd-3-clause |
brandjon/simplestruct | examples/abstract.py | 1 | 1261 | """Demonstrates how to combine Struct with abstract base classes."""
from abc import ABCMeta, abstractmethod
from simplestruct import Struct, Field, MetaStruct
# A simple ABC. Subclasses must provide an override for foo().
class Abstract(metaclass=ABCMeta):
@abstractmethod
def foo(self):
pass
# ABCs... | mit |
aravindvenkatesan/AgroLD-scripts | AgroLD_ETL/riceKB/TropgeneModel.py | 1 | 8886 | import pprint
import re
import os
from globalVars import base_vocab_ns
from TropgeneParser import *
__author__ = 'elhassouni'
def tropGeneToRDF(tropGene_map, output_file):
# The differentes variable declaration
tropGene_buffer = '' # initilised the buffer at zero
population_counter, mapefeature_counter, s... | cc0-1.0 |
mvidalgarcia/indico | indico/modules/events/persons/util.py | 2 | 2965 | # This file is part of Indico.
# Copyright (C) 2002 - 2019 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from __future__ import unicode_literals
from indico.modules.events.models.persons import EventPerson
from... | mit |
ds-hwang/chromium-crosswalk | third_party/protobuf/python/google/protobuf/internal/text_format_test.py | 162 | 23727 | #! /usr/bin/python
#
# Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# ... | bsd-3-clause |
ItsAdventureTime/fail2ban | fail2ban/server/faildata.py | 5 | 1896 | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: t -*-
# vi: set ft=python sts=4 ts=4 sw=4 noet :
# This file is part of Fail2Ban.
#
# Fail2Ban 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;... | gpl-2.0 |
felliott/scrapi | tasks.py | 1 | 8712 | import os
import base64
import logging
import platform
from datetime import date, timedelta
from invoke import run, task
# from elasticsearch import helpers
# from dateutil.parser import parse
# from six.moves.urllib import parse as urllib_parse
# import scrapi.harvesters # noqa
# from scrapi import linter
# from sc... | apache-2.0 |
2014cdag7/2014cdag7 | wsgi/static/Brython2.1.0-20140419-113919/Lib/unittest/test/test_suite.py | 791 | 12066 | import unittest
import sys
from .support import LoggingResult, TestEquality
### Support code for Test_TestSuite
################################################################
class Test(object):
class Foo(unittest.TestCase):
def test_1(self): pass
def test_2(self): pass
def test_3(self... | gpl-2.0 |
KrzysztofStachanczyk/Sensors-WWW-website | www/env/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/__init__.py | 1730 | 3405 | """A collection of modules for building different kinds of tree from
HTML documents.
To create a treebuilder for a new type of tree, you need to do
implement several things:
1) A set of classes for various types of elements: Document, Doctype,
Comment, Element. These must implement the interface of
_base.treebuilders... | gpl-3.0 |
scenarios/tensorflow | tensorflow/contrib/bayesflow/python/kernel_tests/variational_inference_test.py | 7 | 5651 | # 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 |
40223149/2015springfinal | static/Brython3.1.1-20150328-091302/Lib/reprlib.py | 923 | 5110 | """Redo the builtin repr() (representation) but with limits on most sizes."""
__all__ = ["Repr", "repr", "recursive_repr"]
import builtins
from itertools import islice
try:
from _thread import get_ident
except ImportError:
from _dummy_thread import get_ident
def recursive_repr(fillvalue='...'):
'Decorato... | gpl-3.0 |
Kast0rTr0y/ansible | lib/ansible/modules/inventory/group_by.py | 50 | 1473 | # -*- mode: python -*-
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distr... | gpl-3.0 |
ericchaves/faker | faker/providers/python/__init__.py | 8 | 4613 | # coding=utf-8
from __future__ import unicode_literals
from decimal import Decimal
import sys
from faker.providers.lorem.la import Provider as Lorem
from .. import BaseProvider
if sys.version_info[0] == 2:
string_types = (basestring,)
elif sys.version_info[0] == 3:
string_types = (str, bytes)
else:
ra... | mit |
p4datasystems/CarnotKE | jyhton/Lib/test/test_sort.py | 10 | 10661 | from test import test_support
import random
import sys
import unittest
try:
import java
except ImportError:
pass
verbose = test_support.verbose
nerrors = 0
def check(tag, expected, raw, compare=None):
global nerrors
if verbose:
print " checking", tag
orig = raw[:] # save input in ca... | apache-2.0 |
ltilve/ChromiumGStreamerBackend | chrome/common/extensions/docs/server2/rietveld_patcher_test.py | 36 | 2773 | #!/usr/bin/env python
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import posixpath
import sys
import unittest
from environment_wrappers import CreateUrlFetcher
from extensions_paths import (
... | bsd-3-clause |
sillydan1/WhatEverEngine | openglcsharp/Lib/os.py | 109 | 26300 | r"""OS routines for Mac, NT, or Posix depending on what system we're on.
This exports:
- all functions from posix, nt, os2, or ce, e.g. unlink, stat, etc.
- os.path is one of the modules posixpath, or ntpath
- os.name is 'posix', 'nt', 'os2', 'ce' or 'riscos'
- os.curdir is a string representing the current di... | apache-2.0 |
40223250/40223250 | wsgi/application_orig.py | 135 | 4562 | ################################# 1. 宣告原始碼 coding, 導入必要模組
#coding=utf-8
import cherrypy
import random
# for path setup
import os
# for mako
from mako.lookup import TemplateLookup
################################# 2. 全域變數設定, 近端與遠端目錄設定
cwd = os.getcwd()
if 'OPENSHIFT_REPO_DIR' in os.environ.keys():
# 表示程式在雲端執行
... | gpl-3.0 |
bdoner/SickRage | lib/hachoir_core/field/string_field.py | 86 | 14829 | """
String field classes:
- String: Fixed length string (no prefix/no suffix) ;
- CString: String which ends with nul byte ("\0") ;
- UnixLine: Unix line of text, string which ends with "\n" ;
- PascalString8, PascalString16, PascalString32: String prefixed with
length written in a 8, 16, 32-bit integer (use parent e... | gpl-3.0 |
marcelomiky/PythonCodes | Intro ML Semcomp/semcomp17_ml/venv/lib/python3.5/site-packages/wheel/signatures/keys.py | 471 | 3320 | """Store and retrieve wheel signing / verifying keys.
Given a scope (a package name, + meaning "all packages", or - meaning
"no packages"), return a list of verifying keys that are trusted for that
scope.
Given a package name, return a list of (scope, key) suggested keys to sign
that package (only the verifying key... | mit |
a-tal/pypicloud | pypicloud/access/base.py | 2 | 19245 | """ The access backend object base class """
from collections import defaultdict
from passlib.apps import custom_app_context as pwd_context
from pyramid.security import (Authenticated, Everyone,
effective_principals, Allow, Deny,
ALL_PERMISSIONS)
from pyramid.... | mit |
DavidAndreev/indico | migrations/versions/201604211656_258db7e5a3e5_sync_contribution_abstract_friendly_ids.py | 2 | 4927 | """Sync contribution/abstract friendly ids
Revision ID: 258db7e5a3e5
Revises: 3ca8e62e6c36
Create Date: 2016-04-21 16:56:20.113767
"""
import sqlalchemy as sa
from alembic import context, op
# revision identifiers, used by Alembic.
revision = '258db7e5a3e5'
down_revision = '3ca8e62e6c36'
def _sync_last_contrib_id... | gpl-3.0 |
pravsripad/jumeg | pipelines/chop_and_apply_ica.py | 3 | 18052 | import os.path as op
import numpy as np
from utils import set_directory
import mne
from jumeg.decompose.ica_replace_mean_std import ICA, read_ica, apply_ica_replace_mean_std
from jumeg.jumeg_preprocessing import get_ics_cardiac, get_ics_ocular
from jumeg.jumeg_plot import plot_performance_artifact_rejection # , plot_... | bsd-3-clause |
patdoyle1/FastMath | lib/python2.7/site-packages/pip/_vendor/distlib/_backport/sysconfig.py | 168 | 26964 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012 The Python Software Foundation.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
"""Access to Python's configuration information."""
import codecs
import os
import re
import sys
from os.path import pardir, realpath
try:
import configparser
except ImportError:
import Conf... | gpl-2.0 |
mmakmo/python | crawling_scraping/chapter05/word_frequency.py | 1 | 1475 | import sys
import os
from glob import glob
from collections import Counter
import MeCab
def main():
"""
"""
input_dir = sys.argv[1]
tagger = MeCab.Tagger('')
tagger.parse('')
frequency = Counter()
count_processed = 0
for path in glob(os.path.join(input_dir, '*', 'wiki_*')):
p... | mit |
xsynergy510x/android_external_chromium_org | remoting/host/installer/build-installer-archive.py | 163 | 9195 | #!/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.
"""Creates a zip archive for the Chrome Remote Desktop Host installer.
This script builds a zip file that contains all the files n... | bsd-3-clause |
abandons/jieba | test/extract_topic.py | 65 | 1463 | import sys
sys.path.append("../")
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.feature_extraction.text import TfidfTransformer
from sklearn import decomposition
import jieba
import time
import glob
import sys
import os
import random
if len(sys.argv)<2:
print("usage: extract_topic.py di... | mit |
BenLand100/rat-pac | python/SCons/cpp.py | 19 | 20097 | #
# 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 |
alfanugraha/LUMENS-repo | processing/gdal/pct2rgb.py | 4 | 2876 | # -*- coding: utf-8 -*-
"""
***************************************************************************
pct2rgb.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
*******************************... | gpl-2.0 |
zearom32/SmartBooks | books/migrations/0005_auto_20150413_2112.py | 1 | 1457 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('books', '0004_goodsinfo'),
]
operations = [
migrations.AddField(
model_name='bookinfo',
name='author... | mit |
flgiordano/netcash | +/google-cloud-sdk/lib/googlecloudsdk/core/document_renderers/renderer.py | 1 | 2678 | # 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 ag... | bsd-3-clause |
amith01994/intellij-community | python/lib/Lib/encodings/cp500.py | 593 | 13377 | """ Python Character Mapping Codec cp500 generated from 'MAPPINGS/VENDORS/MICSFT/EBCDIC/CP500.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... | apache-2.0 |
montefra/pyds9 | pyds9/tests/test_pyds9.py | 1 | 8747 | from collections import Counter
import contextlib
import random
import subprocess as sp
import time
from astropy.io import fits
import numpy as np
import pytest
from pyds9 import pyds9
parametrize = pytest.mark.parametrize
type_mapping = parametrize('bitpix, dtype ',
[(8, np.dtype(np.uint... | lgpl-2.1 |
kimw/shadowsocks | shadowsocks/crypto/util.py | 16 | 5004 | #!/usr/bin/env python
#
# Copyright 2015 clowwindy
#
# 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 |
danluu/BitFunnel | NativeJIT/googletest/googletest/test/gtest_output_test.py | 363 | 12259 | #!/usr/bin/env python
#
# Copyright 2008, 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... | mit |
markrawlingson/SickRage | lib/chardet/utf8prober.py | 52 | 2709 | ######################## 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... | gpl-3.0 |
crysthianophp/el-shaddai | vendor/doctrine/orm/docs/en/_exts/configurationblock.py | 2577 | 3506 | #Copyright (c) 2010 Fabien Potencier
#
#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 limitation the rights
#to use, copy, modify, merge, publish, distrib... | bsd-3-clause |
madazone/fabric-bolt | src/fabric_bolt/core/settings/base.py | 14 | 6914 | # Global settings for core project.
import os
########## PATH CONFIGURATION
PROJECT_DIR = os.path.dirname(os.path.dirname(__file__))
PUBLIC_DIR = os.path.join(PROJECT_DIR, 'public')
# Python dotted path to the WSGI application used by Django's runserver.
WSGI_APPLICATION = 'fabric_bolt.core.wsgi.application'
########... | mit |
korobool/nlp4go | test_data/prepare_data.py | 2 | 1589 | import json
from nltk.tokenize import TreebankWordTokenizer
def read_referrence_data(filename):
with open(filename, "r") as f:
lines = f.readlines()
return [l.strip('\n\r') for l in lines]
def span_tokenize(text):
tokens = TreebankWordTokenizer().tokenize(text)
dt = 0
end = 0
... | mit |
zang-cloud/zang-python | zang/connectors/carrier_services_connector.py | 2 | 5234 | # -*- coding: utf-8 -*-
"""
zang.connectors.carrier_services_connector
~~~~~~~~~~~~~~~~~~~
Module for communication with `Carrier` endpoint
"""
from zang.connectors.base_connector import BaseConnector
from zang.helpers.helpers import flatDict
from zang.domain.carrier_lookup import CarrierLookup
from zang.domain.list... | mit |
uci-cbcl/tree-hmm | setup.py | 2 | 4290 | import sys
from distutils.core import setup
from distutils.extension import Extension
try:
from Cython.Distutils import build_ext
except ImportError:
sys.stderr.write("""
==================================================
Please install Cython (http://cython.org/),
which is required to build tre... | bsd-3-clause |
K-Carrington/ardupilot | Tools/scripts/frame_sizes.py | 351 | 1117 | #!/usr/bin/env python
import re, sys, operator, os
code_line = re.compile("^\s*\d+:/")
frame_line = re.compile("^\s*\d+\s+/\* frame size = (\d+) \*/")
class frame(object):
def __init__(self, code, frame_size):
self.code = code
self.frame_size = int(frame_size)
frames = []
def process_lst(filena... | gpl-3.0 |
tanmaykm/edx-platform | common/djangoapps/dark_lang/views.py | 6 | 6175 | """
Views file for the Darklang Django App
"""
from django.contrib.auth.decorators import login_required
from django.utils.decorators import method_decorator
from django.utils.translation import LANGUAGE_SESSION_KEY
from django.utils.translation import ugettext as _
from django.views.generic.base import View
from opene... | agpl-3.0 |
LegitInc/legitapi | tests/live_tests/live_test.py | 1 | 3234 | # Copyright (C) 2013 Rob Boyle / Legit Inc
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is dist... | gpl-3.0 |
ChrisAntaki/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py | 113 | 18377 | # Copyright (C) 2010 Google Inc. All rights reserved.
# Copyright (C) 2010 Gabor Rapcsanyi (rgabor@inf.u-szeged.hu), University of Szeged
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of so... | bsd-3-clause |
ds-hwang/chromium-crosswalk | tools/valgrind/drmemory/PRESUBMIT.py | 61 | 1175 | # 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.
"""
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details on the presubmit API built into depot_tools.
"""
def Ch... | bsd-3-clause |
abdulbaqi/quranf | venv/lib/python2.7/site-packages/pip/_vendor/requests/utils.py | 222 | 19653 | # -*- coding: utf-8 -*-
"""
requests.utils
~~~~~~~~~~~~~~
This module provides utility functions that are used within Requests
that are also useful for external consumption.
"""
import cgi
import codecs
import collections
import io
import os
import platform
import re
import sys
import socket
import struct
from . i... | mit |
ChrisLR/Python-Roguelike-Template | scenes/character_creation/scene.py | 1 | 9203 | from bearlibterminal import terminal
from clubsandwich.ui import (
UIScene,
SingleLineTextInputView,
LabelView,
CyclingButtonView,
ButtonView,
LayoutOptions,
WindowView,
)
from components.needs import Needs
from data.python_templates.classes import character_class_templates
from data.python... | mit |
holm/suds | suds/umx/core.py | 199 | 7575 | # 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 ... | lgpl-3.0 |
pair-code/lit | lit_nlp/examples/coref/datasets/winogender.py | 2 | 6390 | """Coreference version of the Winogender dataset.
Each instance has two edges, one between the pronoun and the occupation and one
between the pronoun and the participant. The pronoun is always span1.
There are 120 templates in the Winogender set, 60 coreferent with the
occupation, and 60 coreferent with the participa... | apache-2.0 |
mapr/sahara | sahara/plugins/vanilla/hadoop2/validation.py | 2 | 5127 | # Copyright (c) 2014 Mirantis 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 agreed to in writ... | apache-2.0 |
christophlsa/odoo | addons/mrp/report/mrp_report.py | 341 | 3839 | # -*- 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 |
snnn/tensorflow | tensorflow/python/framework/random_seed_test.py | 58 | 2522 | # 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 |
LecomteEmerick/Essentia-build | src/examples/python/streaming_extractor/tuningfrequency.py | 10 | 3771 | # Copyright (C) 2006-2013 Music Technology Group - Universitat Pompeu Fabra
#
# This file is part of Essentia
#
# Essentia 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 (FSF), either version 3 of the ... | agpl-3.0 |
elkaneb/QCM | vendor/doctrine/orm/docs/en/conf.py | 2448 | 6497 | # -*- coding: utf-8 -*-
#
# Doctrine 2 ORM documentation build configuration file, created by
# sphinx-quickstart on Fri Dec 3 18:10:24 2010.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
... | mit |
merutak/python-social-auth | social/backends/steam.py | 83 | 1553 | """
Steam OpenId backend, docs at:
http://psa.matiasaguirre.net/docs/backends/steam.html
"""
from social.backends.open_id import OpenIdAuth
from social.exceptions import AuthFailed
USER_INFO = 'http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?'
class SteamOpenId(OpenIdAuth):
name = 'steam'
... | bsd-3-clause |
Diegojnb/JdeRobot | src/types/python/jderobotTypes/pose3d.py | 8 | 1480 | #
# Copyright (C) 1997-2017 JDE Developers Team
#
# 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... | gpl-3.0 |
creativcoder/servo | tests/wpt/css-tests/tools/html5lib/html5lib/trie/py.py | 817 | 1763 | from __future__ import absolute_import, division, unicode_literals
from six import text_type
from bisect import bisect_left
from ._base import Trie as ABCTrie
class Trie(ABCTrie):
def __init__(self, data):
if not all(isinstance(x, text_type) for x in data.keys()):
raise TypeError("All keys m... | mpl-2.0 |
rschnapka/hr | __unported__/hr_schedule/wizard/validate_schedule.py | 28 | 2415 | # -*- coding:utf-8 -*-
#
#
# Copyright (C) 2013 Michael Telahun Makonnen <mmakonnen@gmail.com>.
# All Rights Reserved.
#
# 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, eit... | agpl-3.0 |
landonb/hamster-applet | wafadmin/Tools/config_c.py | 6 | 15279 | #! /usr/bin/env python
# encoding: utf-8
import sys
if sys.hexversion < 0x020400f0: from sets import Set as set
import os,imp,sys,shlex,shutil
from Utils import md5
import Build,Utils,Configure,Task,Options,Logs,TaskGen
from Constants import*
from Configure import conf,conftest
cfg_ver={'atleast-version':'>=','exact-ve... | gpl-3.0 |
lukeiwanski/tensorflow-opencl | tensorflow/python/kernel_tests/topk_op_test.py | 58 | 3911 | # 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 |
timj/scons | src/engine/SCons/Tool/cyglink.py | 6 | 8493 | """SCons.Tool.cyglink
Customization of gnulink for Cygwin (http://www.cygwin.com/)
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.
"""
from __future__ import absolute_import, print_function
import re
import os
... | mit |
jeyraof/python-social-auth | social/apps/django_app/middleware.py | 70 | 2285 | # -*- coding: utf-8 -*-
import six
from django.conf import settings
from django.contrib import messages
from django.contrib.messages.api import MessageFailure
from django.shortcuts import redirect
from django.utils.http import urlquote
from social.exceptions import SocialAuthBaseException
from social.utils import soc... | bsd-3-clause |
rubikloud/scikit-learn | sklearn/datasets/california_housing.py | 3 | 3926 | """California housing dataset.
The original database is available from StatLib
http://lib.stat.cmu.edu/
The data contains 20,640 observations on 9 variables.
This dataset contains the average house value as target variable
and the following input variables (features): average income,
housing average age, averag... | bsd-3-clause |
benjello/openfisca-france | openfisca_france/scripts/calculateur_impots/extraction_champs_impots.py | 3 | 3057 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
"""Use finances.gouv.fr web simulator as an API to compute income taxes."""
import argparse
import collections
import logging
import os
import sys
import urllib2
from lxml import etree
app_name = os.path.splitext(os.path.basename(__file__))[0]
log = logging.getLogger... | agpl-3.0 |
4rado/RepositoryForProject | Lib/site-packages/scipy/fftpack/setup.py | 51 | 1461 | #!"C:\Users\hog\Documents\Visual Studio 2010\Projects\ArdupilotMega\ArdupilotMega\bin\Debug\ipy.exe"
# Created by Pearu Peterson, August 2002
from os.path import join
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('fftpack',paren... | gpl-3.0 |
greg17477/kernel_franco_mako | Documentation/networking/cxacru-cf.py | 14668 | 1626 | #!/usr/bin/env python
# Copyright 2009 Simon Arlott
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 2 of the License, or (at your option)
# any later version.
#
# This program i... | gpl-2.0 |
tic-ull/ufc | ufc.py | 1 | 12807 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Este script hace accounting de todos los correos que mueve postfix.
#
# Con esta información se pretende poder controlar el flujo de mensajes
# salientes de postfix.
#
#
# TODO
# - Implementar un decorador needs_root que verifique si el usuario que ejecuta
# el scri... | gpl-3.0 |
areski/django | django/templatetags/cache.py | 471 | 3389 | from __future__ import unicode_literals
from django.core.cache import InvalidCacheBackendError, caches
from django.core.cache.utils import make_template_fragment_key
from django.template import (
Library, Node, TemplateSyntaxError, VariableDoesNotExist,
)
register = Library()
class CacheNode(Node):
def __in... | bsd-3-clause |
civisanalytics/ansible | test/units/modules/network/eos/test_eos_banner.py | 15 | 2312 | # This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that ... | gpl-3.0 |
mhrivnak/pulp | server/test/unit/server/webservices/views/test_search.py | 1 | 11706 | """
This module contains tests for the pulp.server.webservices.views.search module.
"""
import unittest
import mock
from django import http
from base import assert_auth_READ
from pulp.server import exceptions
from pulp.server.webservices.views import search
class TestSearchView(unittest.TestCase):
"""
Test ... | gpl-2.0 |
MinimalOS/external_skia | platform_tools/android/bin/download_utils.py | 149 | 8464 | #!/usr/bin/python
# Copyright (c) 2012 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""A library to assist automatically downloading files.
This library is used by scripts that download tarballs, zipfiles, etc. as... | bsd-3-clause |
mfherbst/spack | lib/spack/spack/test/packaging.py | 4 | 14935 | ##############################################################################
# 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 |
teeple/pns_server | work/install/Python-2.7.4/Lib/bsddb/test/test_dbobj.py | 114 | 2407 |
import os, string
import unittest
from test_all import db, dbobj, test_support, get_new_environment_path, \
get_new_database_path
#----------------------------------------------------------------------
class dbobjTestCase(unittest.TestCase):
"""Verify that dbobj.DB and dbobj.DBEnv work properly"""
d... | gpl-2.0 |
fajoy/nova | nova/scheduler/weights/least_cost.py | 3 | 4693 | # Copyright (c) 2011-2012 OpenStack, LLC.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | apache-2.0 |
HousekeepLtd/django | django/template/smartif.py | 275 | 6643 | """
Parser and utilities for the smart 'if' tag
"""
import warnings
from django.utils.deprecation import RemovedInDjango110Warning
# Using a simple top down parser, as described here:
# http://effbot.org/zone/simple-top-down-parsing.htm.
# 'led' = left denotation
# 'nud' = null denotation
# 'bp' = binding power (... | bsd-3-clause |
alexanderfefelov/nav | python/nav/topology/analyze.py | 1 | 11281 | #
# Copyright (C) 2011,2012 UNINETT AS
#
# This file is part of Network Administration Visualized (NAV).
#
# NAV 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... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.