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 |
|---|---|---|---|---|---|
DobbinFox/emacs.d | elpa/elpy-20161125.56/elpy/tests/test_jedibackend.py | 13 | 10253 | """Tests for the elpy.jedibackend module."""
import sys
import unittest
import jedi
import mock
from elpy import jedibackend
from elpy import rpc
from elpy.tests import compat
from elpy.tests.support import BackendTestCase
from elpy.tests.support import RPCGetCompletionsTests
from elpy.tests.support import RPCGetCom... | mit |
dronefly/dronefly.github.io | flask/lib/python2.7/site-packages/jinja2/meta.py | 336 | 4198 | # -*- coding: utf-8 -*-
"""
jinja2.meta
~~~~~~~~~~~
This module implements various functions that exposes information about
templates that might be interesting for various kinds of applications.
:copyright: (c) 2010 by the Jinja Team, see AUTHORS for more details.
:license: BSD, see LICENSE fo... | apache-2.0 |
aimanaiman/supernomadfriendsquad | node_modules/node-gyp/gyp/pylib/gyp/ninja_syntax.py | 2485 | 5536 | # This file comes from
# https://github.com/martine/ninja/blob/master/misc/ninja_syntax.py
# Do not edit! Edit the upstream one instead.
"""Python module for generating .ninja files.
Note that this is emphatically not a required piece of Ninja; it's
just a helpful utility for build-file-generation systems that alr... | mit |
huaweiswitch/neutron | neutron/plugins/cisco/cfg_agent/device_drivers/driver_mgr.py | 7 | 4410 | # Copyright 2014 Cisco Systems, 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 requir... | apache-2.0 |
RebeccaWPerry/vispy | vispy/visuals/polygon.py | 20 | 3795 | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Vispy Development Team.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
"""
Simple polygon visual based on MeshVisual and LineVisual
"""
from __future__ import division
import numpy as np
from .visual import CompoundVisual
from .mesh import Me... | bsd-3-clause |
rooshilp/CMPUT410W15-project | testenv/lib/python2.7/site-packages/django/db/backends/mysql/schema.py | 53 | 2192 | from django.db.backends.schema import BaseDatabaseSchemaEditor
from django.db.models import NOT_PROVIDED
class DatabaseSchemaEditor(BaseDatabaseSchemaEditor):
sql_rename_table = "RENAME TABLE %(old_table)s TO %(new_table)s"
sql_alter_column_null = "MODIFY %(column)s %(type)s NULL"
sql_alter_column_not_n... | gpl-2.0 |
AIFDR/inasafe-django | django_project/realtime/migrations/0050_reporttemplate.py | 2 | 1641 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('realtime', '0049_auto_20180320_0406'),
]
operations = [
migrations.CreateModel(
name='ReportTemplate',
... | bsd-2-clause |
Fireblend/chromium-crosswalk | tools/win/split_link/graph_dependencies.py | 145 | 2291 | # 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 shutil
import subprocess
import sys
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
def main():
if len(sys.argv) != 2:
print... | bsd-3-clause |
supernifty/mgsa | mgsa/analyze_bam.py | 1 | 2071 |
import argparse
import collections
import numpy
import sys
import bio
import config
parser = argparse.ArgumentParser(description='Analyze BAM')
parser.add_argument('bam', metavar='bam', help='bam file to analyze')
parser.add_argument('--buckets', metavar='buckets', type=int, default=10, help='number of buckets')
par... | mit |
kenshay/ImageScripter | ProgramData/SystemFiles/Python/Lib/site-packages/urllib3/contrib/ntlmpool.py | 63 | 4459 | """
NTLM authenticating pool, contributed by erikcederstran
Issue #10, see: http://code.google.com/p/urllib3/issues/detail?id=10
"""
from __future__ import absolute_import
from logging import getLogger
from ntlm import ntlm
from .. import HTTPSConnectionPool
from ..packages.six.moves.http_client import HTTPSConnecti... | gpl-3.0 |
Venturi/cms | env/lib/python2.7/site-packages/cms/test_utils/project/customuserapp/south_migrations/0001_initial.py | 35 | 5693 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'User'
db.create_table(u'customuserapp_user', (
... | gpl-2.0 |
cirrusone/phantom2 | src/qt/qtwebkit/Tools/CygwinDownloader/cygwin-downloader.py | 120 | 5513 | #!/usr/bin/env python
import os, random, sys, time, urllib
#
# Options
#
dry_run = len(sys.argv) > 1 and "--dry-run" in set(sys.argv[1:])
quiet = len(sys.argv) > 1 and "--quiet" in set(sys.argv[1:])
#
# Functions and constants
#
def download_progress_hook(block_count, block_size, total_blocks):
if quiet or... | bsd-3-clause |
minlexx/pyevemon | esi_client/models/get_characters_character_id_mail_labels_forbidden.py | 1 | 3097 | # coding: utf-8
"""
EVE Swagger Interface
An OpenAPI for EVE Online
OpenAPI spec version: 0.4.6
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
class GetCharactersCharacterIdMailLabelsForbidden(object):
"... | gpl-3.0 |
jwlawson/tensorflow | tensorflow/python/saved_model/utils_impl.py | 48 | 3249 | # 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 |
jortel/gofer | test/unit/messaging/adapter/amqp/test_model.py | 1 | 5194 | # Copyright (c) 2014 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public
# License as published by the Free Software Foundation; either version
# 2 of the License (GPLv2) or (at your option) any later version.
# There is NO WARRANTY for this software, express or implied,
# including the impl... | lgpl-2.1 |
zayneanderson/aima-python | submissions/LaMartina/puzzles.py | 18 | 8106 | import search
import math
from copy import deepcopy
from math import(cos, pi)
# A sample map problem
sumner_map = search.UndirectedGraph(dict(
Portland=dict(Mitchellville=7, Fairfield=17, Cottontown=18),
Cottontown=dict(Portland=18),
Fairfield=dict(Mitchellville=21, Portland=17),
Mitchellville=dict(Por... | mit |
dafrito/trac-mirror | trac/ticket/default_workflow.py | 1 | 21721 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2006-2009 Edgewall Software
# Copyright (C) 2006 Alec Thomas
# Copyright (C) 2007 Eli Carter
# Copyright (C) 2007 Christian Boos <cboos@edgewall.org>
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part ... | bsd-3-clause |
pombredanne/commons | src/python/twitter/common/http/diagnostics.py | 14 | 2595 | # ==================================================================================================
# Copyright 2011 Twitter, Inc.
# --------------------------------------------------------------------------------------------------
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use thi... | apache-2.0 |
cs207-project/TimeSeries | procs/_corr.py | 1 | 4794 | import numpy.fft as nfft
import numpy as np
import timeseries as ts
from scipy.stats import norm
# import pyfftw
import sys
#sys.path.append("/Users/yuhantang/CS207/TimeSeries/procs")
from .interface import *
def createfromlist(l):
d = new_darray(len(l))
for i in range(0,len(l)):
darray_set(d,i,l[i])
... | mit |
gkoelln/youtube-dl | youtube_dl/extractor/arkena.py | 41 | 5331 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import compat_urlparse
from ..utils import (
determine_ext,
ExtractorError,
float_or_none,
int_or_none,
mimetype2ext,
parse_iso8601,
strip_jsonp,
)
class ArkenaIE(InfoExtract... | unlicense |
benjaminoh1/tensorflowcookbook | Chapter 07/bag_of_words.py | 1 | 6082 | # Working with Bag of Words
#---------------------------------------
#
# In this example, we will download and preprocess the ham/spam
# text data. We will then use a one-hot-encoding to make a
# bag of words set of features to use in logistic regression.
#
# We will use these one-hot-vectors for logistic regression... | mit |
jcpowermac/ansible | lib/ansible/plugins/lookup/dict.py | 31 | 1955 | # (c) 2014, Kent R. Spillner <kspillner@acm.org>
# (c) 2017 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
DOCUMENTATION = """
lookup: dict
version_added: "1.5"
... | gpl-3.0 |
itskewpie/tempest | tempest/services/identity/v3/json/policy_client.py | 6 | 3011 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apach... | apache-2.0 |
antiface/ThinkBayes2 | code/cookie3.py | 1 | 1095 | """This file contains code for use with "Think Bayes",
by Allen B. Downey, available from greenteapress.com
Copyright 2014 Allen B. Downey
License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html
"""
from __future__ import print_function, division
import thinkbayes2
class Cookie(thinkbayes2.Suite):
"""A map fro... | gpl-2.0 |
michaelgugino/turbo-lister | sqlalchemy/engine/interfaces.py | 2 | 26596 | # engine/interfaces.py
# Copyright (C) 2005-2013 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
"""Define core interfaces used by the engine system."""
from .. import util, eve... | gpl-3.0 |
dvro/scikit-protopy | protopy/base.py | 1 | 4528 | """Base and mixin classes for instance reduction techniques"""
# Author: Dayvid Victor <dvro@cin.ufpe.br>
# License: BSD Style
import warnings
from abc import ABCMeta, abstractmethod
from sklearn.base import BaseEstimator, ClassifierMixin
from sklearn.neighbors.classification import KNeighborsClassifier
from sklearn... | bsd-2-clause |
a-nai/django-wiki | wiki/plugins/attachments/markdown_extensions.py | 10 | 3417 | from __future__ import unicode_literals
from __future__ import absolute_import
import markdown
import re
from django.core.urlresolvers import reverse
from django.template.context import Context
from django.template.loader import render_to_string
from django.contrib.auth.models import AnonymousUser
from wiki.core.permi... | gpl-3.0 |
AnthonyCAS/code-for-blog | 2009/pygame_creeps_game/pathfinder.py | 12 | 5242 | from priorityqueueset import PriorityQueueSet
class PathFinder(object):
""" Computes a path in a graph using the A* algorithm.
Initialize the object and then repeatedly compute_path to
get the path between a start point and an end point.
The points on a graph are required to... | unlicense |
ddurdle/OneDrive-for-KODI | resources/lib/cache.py | 3 | 6344 | '''
Copyright (C) 2014-2015 ddurdle
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 di... | gpl-2.0 |
xiaotdl/ansible | lib/ansible/parsing/utils/addresses.py | 56 | 7976 | # Copyright 2015 Abhijit Menon-Sen <ams@2ndQuadrant.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 ... | gpl-3.0 |
vguzmanp/cloud-in-one | main_crypto.py | 1 | 1392 | #!/usr/bin/env python3
import getpass
import argparse
import shutil
from core.databaseManager import DatabaseManager
from core.securityModule import SecurityModule
def processFile(file_in_name, file_out_name, encrypt_flag):
user = input("CLOUD-IN-ONE Username: ")
password = getpass.getpass()
databaseMa... | mit |
bufferapp/buffer-django-nonrel | django/contrib/gis/db/backends/mysql/operations.py | 312 | 2418 | from django.db.backends.mysql.base import DatabaseOperations
from django.contrib.gis.db.backends.adapter import WKTAdapter
from django.contrib.gis.db.backends.base import BaseSpatialOperations
class MySQLOperations(DatabaseOperations, BaseSpatialOperations):
compiler_module = 'django.contrib.gis.db.models.sql.co... | bsd-3-clause |
josesanch/django-oscar | sites/us/apps/shipping/south_migrations/0002_auto__del_orderanditemlevelchargemethod__add_orderanditemcharges__add_.py | 23 | 4591 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting model 'OrderAndItemLevelChargeMethod'
db.delete_table('shipping_orderanditemlevelchargemethod')... | bsd-3-clause |
aospx-kitkat/platform_external_chromium_org | third_party/pexpect/ANSI.py | 171 | 12646 | """This implements an ANSI (VT100) terminal emulator as a subclass of screen.
PEXPECT LICENSE
This license is approved by the OSI and FSF as GPL-compatible.
http://opensource.org/licenses/isc-license.txt
Copyright (c) 2012, Noah Spurrier <noah@noah.org>
PERMISSION TO USE, COPY, MODIFY, AND/OR DIS... | bsd-3-clause |
pepsipepsi/nodebox_opengl_python3 | nodebox/ext/psyco/src/test/pystone.py | 4 | 9251 | #! /usr/bin/env python
"""
"PYSTONE" Benchmark Program
Version: Python/1.1 (corresponds to C/1.1 plus 2 Pystone fixes)
Author: Reinhold P. Weicker, CACM Vol 27, No 10, 10/84 pg. 1013.
Translated from ADA to C by Rick Richardson.
Every method to preserve ADA-likeness h... | bsd-3-clause |
dcowden/cadquery-freecad-module | CadQuery/Libs/pygments/lexers/dalvik.py | 72 | 4420 | # -*- coding: utf-8 -*-
"""
pygments.lexers.dalvik
~~~~~~~~~~~~~~~~~~~~~~
Pygments lexers for Dalvik VM-related languages.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, include, bygr... | lgpl-3.0 |
hamiltont/CouchPotatoServer | libs/html5lib/trie/datrie.py | 785 | 1166 | from __future__ import absolute_import, division, unicode_literals
from datrie import Trie as DATrie
from six import text_type
from ._base import Trie as ABCTrie
class Trie(ABCTrie):
def __init__(self, data):
chars = set()
for key in data.keys():
if not isinstance(key, text_type):
... | gpl-3.0 |
PaesslerAG/django-performance-testing | settings.py | 1 | 1267 | # Django settings for autodata project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
# Insert your TEMPLATE_CONTEXT_PR... | bsd-3-clause |
puckipedia/youtube-dl | youtube_dl/extractor/musicvault.py | 73 | 2511 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
class MusicVaultIE(InfoExtractor):
_VALID_URL = r'https?://www\.musicvault\.com/(?P<uploader_id>[^/?#]*)/video/(?P<display_id>[^/?#]*)_(?P<id>[0-9]+)\.html'
_TEST = {
'url': 'http://www.musicvault.com/the-allman-brot... | unlicense |
mvaled/sentry | src/sentry/runner/commands/permissions.py | 3 | 2488 | from __future__ import absolute_import, print_function
import click
from sentry.runner.decorators import configuration
def user_param_to_user(value):
from sentry.utils.auth import find_users
users = find_users(value)
if not users:
raise click.ClickException(u"No user matching `{}`".format(value... | bsd-3-clause |
peterfpeterson/mantid | scripts/Muon/GUI/MuonAnalysis/dock/dock_widget.py | 3 | 2880 | # Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source,
# Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
# SPDX - License - Identifier: GPL - 3.0 +
from... | gpl-3.0 |
minghuascode/pyj | examples/gwtcanvas/ParticleDemo.py | 8 | 5449 | """
* Copyright 2008 Google Inc.
* Copyright (C) 2009 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
*
* 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.... | apache-2.0 |
nichung/wwwflaskBlogrevA | env/lib/python2.7/site-packages/chardet/langhebrewmodel.py | 269 | 11345 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Simon Montagu
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved... | mit |
nesdis/djongo | tests/django_tests/tests/v21/tests/forms_tests/widget_tests/test_timeinput.py | 84 | 1721 | from datetime import time
from django.forms import TimeInput
from django.test import override_settings
from django.utils import translation
from .base import WidgetTest
class TimeInputTest(WidgetTest):
widget = TimeInput()
def test_render_none(self):
self.check_html(self.widget, 'time', None, html=... | agpl-3.0 |
TestInABox/openstackinabox | openstackinabox/tests/services/cinder/v1/volumes/test_retrieve.py | 1 | 1154 | """
"""
import unittest
import requests
import stackinabox.util.requests_mock.core
from stackinabox.stack import StackInABox
from openstackinabox.services.cinder import CinderV1Service
from openstackinabox.services.keystone import KeystoneV2Service
class TestCinderV1Retrieve(unittest.TestCase):
def setUp(self)... | apache-2.0 |
xuegang/gpdb | src/test/tinc/ext/pexpect.py | 21 | 62613 | """Pexpect is a Python module for spawning child applications and controlling
them automatically. Pexpect can be used for automating interactive applications
such as ssh, ftp, passwd, telnet, etc. It can be used to a automate setup
scripts for duplicating software package installations on different servers. It
can be u... | apache-2.0 |
gspeedtech/Audacity-2 | lib-src/lv2/suil/waflib/Tools/gnu_dirs.py | 329 | 2796 | #! /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
from waflib import Utils,Options,Context
_options=[x.split(', ')for x in'''
bindir, user executables, ${EXEC_PREFIX}/bin
sbindir, system admin executables, ${EXEC_PR... | gpl-2.0 |
plypaul/airflow | airflow/contrib/operators/bigquery_to_gcs.py | 20 | 4137 | # -*- coding: utf-8 -*-
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
... | apache-2.0 |
seanli9jan/tensorflow | tensorflow/python/keras/engine/training_arrays.py | 2 | 15971 | # Copyright 2018 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 |
urrego093/proyecto_mv | extras/build_web2py/setup_app.py | 15 | 5218 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This is a setup.py script generated by py2applet
Usage:
python setup.py py2app
"""
copy_apps = False
copy_scripts = True
copy_site_packages = True
remove_build_files = True
make_zip = True
zip_filename = "web2py_osx"
from setuptools import setup
from gluon.impor... | gpl-3.0 |
owlabs/incubator-airflow | airflow/models/taskreschedule.py | 1 | 3374 | # -*- coding: utf-8 -*-
#
# 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
#... | apache-2.0 |
cykerway/wmwm | setup.py | 1 | 7315 | #!/usr/bin/env python3
'''
setuptools based setup module;
see <https://packaging.python.org/en/latest/distributing.html>;
'''
from os import path
from setuptools import find_packages
from setuptools import setup
here = path.abspath(path.dirname(__file__))
## get long description from readme file;
with open(path.j... | gpl-3.0 |
0k/odoo | addons/auth_oauth/__openerp__.py | 20 | 1628 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010-2012 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | agpl-3.0 |
newerthcom/savagerebirth | libs/python-2.72/Mac/Modules/ctl/ctlsupport.py | 39 | 27042 | # This script generates a Python interface for an Apple Macintosh Manager.
# It uses the "bgen" package to generate C code.
# The function specifications are generated by scanning the mamager's header file,
# using the "scantools" package (customized for this particular manager).
import string
# Declarations that cha... | gpl-2.0 |
nicko96/Chrome-Infra | glyco/glucose/install.py | 1 | 8024 | # Copyright 2015 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 hashlib
import httplib2
import logging
import os
import sys
import urllib
from glucose import util
LOGGER = logging.getLogger(__name__)
DEFAULT_CAC... | bsd-3-clause |
gymnasium/edx-platform | openedx/core/djangoapps/monitoring_utils/middleware.py | 12 | 6146 | """
Middleware for handling the storage, aggregation, and reporting of custom
metrics for monitoring.
At this time, the custom metrics can only be reported to New Relic.
This middleware will only call on the newrelic agent if there are any metrics
to report for this request, so it will not incur any processing overhe... | agpl-3.0 |
apporc/nova | nova/tests/unit/api/openstack/compute/test_services.py | 17 | 39103 | # 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 |
gpndata/grpc | src/python/grpcio/grpc/framework/core/__init__.py | 1496 | 1530 | # Copyright 2015, 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 f... | bsd-3-clause |
google-research/google-research | fairness_teaching/baseline/all_real.py | 1 | 5585 | # coding=utf-8
# Copyright 2021 The Google Research Authors.
#
# 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 applicab... | apache-2.0 |
MCMic/Sick-Beard | lib/unidecode/x0c6.py | 253 | 4490 | data = (
'yeoss', # 0x00
'yeong', # 0x01
'yeoj', # 0x02
'yeoc', # 0x03
'yeok', # 0x04
'yeot', # 0x05
'yeop', # 0x06
'yeoh', # 0x07
'ye', # 0x08
'yeg', # 0x09
'yegg', # 0x0a
'yegs', # 0x0b
'yen', # 0x0c
'yenj', # 0x0d
'yenh', # 0x0e
'yed', # 0x0f
'yel', # 0x10
'yelg', ... | gpl-3.0 |
tuhangdi/django | tests/model_regress/tests.py | 326 | 8962 | from __future__ import unicode_literals
import datetime
from operator import attrgetter
from django.core.exceptions import ValidationError
from django.db import router
from django.db.models.sql import InsertQuery
from django.test import TestCase, skipUnlessDBFeature
from django.utils import six
from django.utils.time... | bsd-3-clause |
laumann/servo | components/script/dom/bindings/codegen/CodegenRust.py | 1 | 243619 | # 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/.
# Common codegen classes.
from collections import defaultdict
import operator
import re
import string
import textwrap
... | mpl-2.0 |
City-of-Bloomington/green-rental | geopy/units.py | 24 | 2985 | """
Convert units.
"""
import math
# Angles
def degrees(radians=0, arcminutes=0, arcseconds=0): # pylint: disable=W0621
"""
TODO docs.
"""
deg = 0.
if radians:
deg = math.degrees(radians)
if arcminutes:
deg += arcminutes / arcmin(degrees=1.)
if arcseconds:
deg += ... | agpl-3.0 |
devs1991/test_edx_docmode | venv/lib/python2.7/site-packages/Crypto/SelfTest/Cipher/__init__.py | 117 | 2401 | # -*- coding: utf-8 -*-
#
# SelfTest/Cipher/__init__.py: Self-test for cipher modules
#
# Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net>
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedication ... | agpl-3.0 |
rwl/puddle | puddle/resource/action/properties_action.py | 1 | 3749 | #------------------------------------------------------------------------------
# Copyright (C) 2009 Richard W. Lincoln
#
# 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 restrictio... | mit |
zenmanenergy/Arduino | arduino-core/src/processing/app/i18n/python/requests/packages/charade/sbcsgroupprober.py | 2936 | 3291 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | lgpl-2.1 |
yanheven/nova | nova/api/openstack/compute/schemas/v3/create_backup.py | 59 | 1321 | # Copyright 2014 NEC Corporation. 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 ... | apache-2.0 |
nsteinme/phy | phy/detect/store.py | 2 | 7064 | # -*- coding: utf-8 -*-
"""Spike detection store."""
#------------------------------------------------------------------------------
# Imports
#------------------------------------------------------------------------------
import os
import os.path as op
from collections import defaultdict
import numpy as np
from si... | bsd-3-clause |
endlessm/endless-ndn | eos_data_distribution/parallel.py | 1 | 2456 | # -*- Mode:python; coding: utf-8; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
#
# Copyright (C) 2016 Endless Mobile, Inc.
# Author: Niv Sardi <xaiki@endlessm.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# ... | lgpl-3.0 |
Monoide/vim_conf | autoload/conque_term/conque_sole_subprocess.py | 13 | 21952 | # FILE: autoload/conque_term/conque_sole_subprocess.py
# AUTHOR: Nico Raffo <nicoraffo@gmail.com>
# WEBSITE: http://conque.googlecode.com
# MODIFIED: 2011-08-12
# VERSION: 2.2, for Vim 7.0
# LICENSE:
# Conque - Vim terminal/console emulator
# Copyright (C) 2009-__YEAR__ Nico Raffo
#
# MIT License
#
# Permission... | gpl-3.0 |
geffzhang/grpc | tools/run_tests/python_utils/watch_dirs.py | 11 | 2159 | # Copyright 2015 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | apache-2.0 |
maestrano/odoo | addons/sale/edi/__init__.py | 454 | 1065 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2011 OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GN... | agpl-3.0 |
Noviat/odoo | addons/warning/__openerp__.py | 261 | 1603 | # -*- 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 |
RenaudParis/servo | tests/wpt/css-tests/tools/webdriver/webdriver/command.py | 258 | 3985 | """Dispatches requests to remote WebDriver endpoint."""
import exceptions
import httplib
import json
import urlparse
import webelement
class CommandExecutor(object):
"""Dispatches requests to remote WebDriver endpoint."""
_HEADERS = {
"User-Agent": "Python WebDriver Local End",
"Content-Type... | mpl-2.0 |
amurzeau/streamlink-debian | tests/plugin/testplugin.py | 2 | 2509 | from io import BytesIO
from streamlink import NoStreamsError
from streamlink.options import Options
from streamlink.plugin import PluginArgument, PluginArguments
from streamlink.plugins import Plugin
from streamlink.stream import AkamaiHDStream, HLSStream, HTTPStream, RTMPStream, Stream
class TestStream(Stream):
... | bsd-2-clause |
ZenDevelopmentSystems/scikit-learn | sklearn/linear_model/tests/test_sgd.py | 68 | 43439 | import pickle
import unittest
import numpy as np
import scipy.sparse as sp
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_greater
from sklearn.utils.testing ... | bsd-3-clause |
SP2RC-Coding-Club/Codes | 13_07_2017/3D_slab_modes.py | 1 | 35096 |
#import pdb # pause code for debugging at pdb.set_trace()
import numpy as np
import toolbox as tool
import slab_functions as sf
from pysac.plot.mayavi_seed_streamlines import SeedStreamline
import matplotlib.pyplot as plt
from mayavi import mlab
import gc
#import move_seed_points as msp
import mayavi_plotting_function... | mit |
39dotyt/closure-linter-now | closure_linter/strict_test.py | 125 | 1964 | #!/usr/bin/env python
# Copyright 2013 The Closure Linter 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 |
cvium/Flexget | flexget/plugins/input/input_csv.py | 13 | 2386 | from __future__ import unicode_literals, division, absolute_import
import logging
import csv
from requests import RequestException
from flexget import plugin
from flexget.entry import Entry
from flexget.event import event
from flexget.utils.cached_input import cached
log = logging.getLogger('csv')
class InputCSV(o... | mit |
muffl0n/ansible | lib/ansible/plugins/callback/__init__.py | 2 | 10965 | # (c) 2012-2014, 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) an... | gpl-3.0 |
bundgus/python-playground | ssh-playground/demo_sftp.py | 1 | 2786 | #!/usr/bin/env python
# Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com>
#
# This file is part of paramiko.
#
# Paramiko 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 2.... | mit |
hungtt57/matchmaker | lib/python2.7/site-packages/django/utils/tzinfo.py | 82 | 3932 | "Implementation of tzinfo classes for use with datetime.datetime."
from __future__ import unicode_literals
import time
import warnings
from datetime import timedelta, tzinfo
from django.utils.deprecation import RemovedInDjango19Warning
from django.utils.encoding import (
DEFAULT_LOCALE_ENCODING, force_str, force... | mit |
yunikkk/omim | 3party/freetype/src/tools/docmaker/docmaker.py | 165 | 3183 | #!/usr/bin/env python
#
# docmaker.py
#
# Convert source code markup to HTML documentation.
#
# Copyright 2002-2015 by
# David Turner.
#
# This file is part of the FreeType project, and may only be used,
# modified, and distributed under the terms of the FreeType project
# license, LICENSE.TXT. By continuing ... | apache-2.0 |
zhaodelong/django | django/conf/locale/sk/formats.py | 504 | 1173 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j. F Y'
TIME_FORMAT = 'G:i'
DATET... | bsd-3-clause |
joanneko/goodbooks | goodbooks/lib/python2.7/site-packages/requests/packages/chardet/chardetect.py | 1786 | 2504 | #!/usr/bin/env python
"""
Script which takes one or more file paths and reports on their detected
encodings
Example::
% chardetect somefile someotherfile
somefile: windows-1252 with confidence 0.5
someotherfile: ascii with confidence 1.0
If no paths are provided, it takes its input from stdin.
"""
from... | bsd-3-clause |
kmaglione/olympia | apps/addons/tests/test_helpers.py | 14 | 4888 | from mock import Mock
from nose.tools import eq_
from pyquery import PyQuery
import amo
import amo.tests
from addons.helpers import (statusflags, flag, contribution, performance_note,
mobile_persona_preview, mobile_persona_confirm)
from addons.models import Addon
class TestHelpers(amo.tes... | bsd-3-clause |
eeshangarg/oh-mainline | vendor/packages/twisted/twisted/scripts/tap2deb.py | 17 | 7376 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
import sys, os, string, shutil
from twisted.python import usage
class MyOptions(usage.Options):
optFlags = [["unsigned", "u"]]
optParameters = [["tapfile", "t", "twistd.tap"],
["maintainer", "m", "", "The maintainer's... | agpl-3.0 |
tomlof/scikit-learn | doc/sphinxext/numpy_ext/numpydoc.py | 413 | 6182 | """
========
numpydoc
========
Sphinx extension that handles docstrings in the Numpy standard format. [1]
It will:
- Convert Parameters etc. sections to field lists.
- Convert See Also section to a See also entry.
- Renumber references.
- Extract the signature from the docstring, if it can't be determined
otherwis... | bsd-3-clause |
FFMG/myoddweb.piger | myodd/boost/libs/python/pyste/src/Pyste/Exporter.py | 54 | 2680 | # Copyright Bruno da Silva de Oliveira 2003. Use, modification and
# distribution is subject to the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
import os.path
#=======================================================================... | gpl-2.0 |
zgchizi/oppia-uc | core/domain/value_generators_domain_test.py | 23 | 1202 | # coding: utf-8
#
# Copyright 2014 The Oppia 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 requi... | apache-2.0 |
htc-mirror/primou-ics-3.0.16-d5b834a | tools/perf/scripts/python/check-perf-trace.py | 11214 | 2503 | # perf script event handlers, generated by perf script -g python
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# This script tests basic functionality such as flag and symbol
# strings, common_xxx() calls back into perf, begin, end, unhandled
# events, etc. ... | gpl-2.0 |
BeATz-UnKNoWN/python-for-android | python3-alpha/python3-src/Tools/scripts/make_ctype.py | 116 | 2280 | #!/usr/bin/env python3
"""Script that generates the ctype.h-replacement in stringobject.c."""
NAMES = ("LOWER", "UPPER", "ALPHA", "DIGIT", "XDIGIT", "ALNUM", "SPACE")
print("""
#define FLAG_LOWER 0x01
#define FLAG_UPPER 0x02
#define FLAG_ALPHA (FLAG_LOWER|FLAG_UPPER)
#define FLAG_DIGIT 0x04
#define FLAG_ALNUM (F... | apache-2.0 |
agentr13/python-phonenumbers | python/phonenumbers/data/region_US.py | 5 | 3252 | """Auto-generated file, do not edit by hand. US metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_US = PhoneMetadata(id='US', country_code=1, international_prefix='011',
general_desc=PhoneNumberDesc(national_number_pattern='[2-9]\\d{9}', possible_number_pattern='\\... | apache-2.0 |
Yannig/ansible | test/units/modules/remote_management/oneview/test_oneview_ethernet_network.py | 78 | 14524 | # -*- coding: utf-8 -*-
#
# Copyright (2016-2017) Hewlett Packard Enterprise Development LP
#
# 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 optio... | gpl-3.0 |
garg10may/youtube-dl | youtube_dl/extractor/orf.py | 111 | 10125 | # coding: utf-8
from __future__ import unicode_literals
import json
import re
import calendar
import datetime
from .common import InfoExtractor
from ..utils import (
HEADRequest,
unified_strdate,
ExtractorError,
strip_jsonp,
int_or_none,
float_or_none,
determine_ext,
remove_end,
)
cl... | unlicense |
gregswift/ansible | lib/ansible/utils/module_docs_fragments/aws.py | 232 | 3156 | # (c) 2014, Will Thames <will@thames.id.au>
#
# 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... | gpl-3.0 |
EnviroCentre/jython-upgrade | jython/lib/test/test_telnetlib.py | 41 | 15781 | import socket
import telnetlib
import time
import Queue
import unittest
from unittest import TestCase
from test import test_support
threading = test_support.import_module('threading')
HOST = test_support.HOST
EOF_sigil = object()
def server(evt, serv, dataq=None):
""" Open a tcp server in three steps
1) ... | mit |
atlassian/dd-agent | checks.d/jenkins.py | 31 | 7720 | # stdlib
from collections import defaultdict
from glob import glob
import os
import time
from xml.etree.ElementTree import ElementTree
# project
from checks import AgentCheck
from util import get_hostname
class Skip(Exception):
"""
Raised by :class:`Jenkins` when it comes across
a build or job that shoul... | bsd-3-clause |
JioCloud/cinder | cinder/api/contrib/scheduler_hints.py | 28 | 1924 | # Copyright 2013 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | apache-2.0 |
snakeleon/YouCompleteMe-x86 | python/ycm/diagnostic_interface.py | 2 | 10173 | # Copyright (C) 2013 Google Inc.
#
# This file is part of YouCompleteMe.
#
# YouCompleteMe is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later vers... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.