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 |
|---|---|---|---|---|---|
aevri/phabricator-tools | py/phl/phlsys_string.py | 4 | 1853 | """String utility functions."""
# =============================================================================
# CONTENTS
# -----------------------------------------------------------------------------
# phlsys_string
#
# Public Functions:
# after_prefix
#
# ----------------------------------------------------------... | apache-2.0 |
MiLk/ansible | lib/ansible/plugins/lookup/password.py | 36 | 9261 | # (c) 2012, Daniel Hokka Zakrisson <daniel@hozac.com>
# (c) 2013, Javier Candeira <javier@candeira.com>
# (c) 2013, Maykel Moya <mmoya@speedyrails.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... | gpl-3.0 |
karllessard/tensorflow | tensorflow/python/grappler/graph_analyzer.py | 14 | 1604 | # 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 |
diego-d5000/MisValesMd | env/lib/python2.7/site-packages/django/middleware/common.py | 1 | 7336 | import hashlib
import logging
import re
from django import http
from django.conf import settings
from django.core import urlresolvers
from django.core.mail import mail_managers
from django.utils import six
from django.utils.encoding import force_text
from django.utils.http import urlquote
logger = logging... | mit |
Limags/MissionPlanner | Lib/site-packages/scipy/ndimage/tests/test_filters.py | 55 | 1118 | ''' Some tests for filters '''
import numpy as np
from numpy.testing import assert_equal, assert_raises
import scipy.ndimage as sndi
def test_ticket_701():
# Test generic filter sizes
arr = np.arange(4).reshape((2,2))
func = lambda x: np.min(x)
res = sndi.generic_filter(arr, func, size=(1,1))
#... | gpl-3.0 |
pwhelan/djshouts | django/conf/locale/__init__.py | 157 | 9257 | LANG_INFO = {
'ar': {
'bidi': True,
'code': 'ar',
'name': 'Arabic',
'name_local': u'\u0627\u0644\u0639\u0631\u0628\u064a\u0651\u0629',
},
'az': {
'bidi': True,
'code': 'az',
'name': 'Azerbaijani',
'name_local': u'az\u0259rbaycan dili',
},
... | bsd-3-clause |
gptech/ansible | lib/ansible/utils/cmd_functions.py | 34 | 2792 | # (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 |
bank-netforce/netforce | netforce_stock_cost/setup.py | 4 | 1254 | #!/usr/bin/env python3
# Copyright (c) 2012-2015 Netforce Co. Ltd.
#
# 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, co... | mit |
leifdenby/numpy | numpy/lib/user_array.py | 111 | 7764 | """
Standard container-class for easy multiple-inheritance.
Try to inherit from the ndarray instead of using this class as this is not
complete.
"""
from __future__ import division, absolute_import, print_function
from numpy.core import (
array, asarray, absolute, add, subtract, multiply, divide,
remainder, p... | bsd-3-clause |
schlueter/ansible | lib/ansible/modules/network/f5/bigip_monitor_udp.py | 20 | 18015 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2017, F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
facebookexperimental/eden | eden/integration/hg/debug_get_parents.py | 1 | 2078 | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2.
from pathlib import Path
from eden.integration.lib import hgrepo
from facebook.eden.ttypes import WorkingDirectoryParents
from ... | gpl-2.0 |
bobobox/ansible | contrib/inventory/azure_rm.py | 20 | 32631 | #!/usr/bin/env python
#
# Copyright (c) 2016 Matt Davis, <mdavis@ansible.com>
# Chris Houseknecht, <house@redhat.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 ... | gpl-3.0 |
murphy-wang/aws-ec2 | lib/boto-2.34.0/boto/rds/dbsnapshot.py | 167 | 6398 | # Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.org/
#
# 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, modi... | apache-2.0 |
alex/bagel | bagel/ast.py | 1 | 3066 | class Module(object):
def __init__(self, declarations):
self._declarations = declarations
def visit(self, visitor, arg):
return visitor.visit_module(self, arg)
class Class(object):
def __init__(self, name, declarations):
self._name = name
self._declarations = declarations
... | bsd-3-clause |
Emilgardis/falloutsnip | Vendor/IronPython/Lib/json/encoder.py | 103 | 16014 | """Implementation of JSONEncoder
"""
import re
try:
from _json import encode_basestring_ascii as c_encode_basestring_ascii
except ImportError:
c_encode_basestring_ascii = None
try:
from _json import make_encoder as c_make_encoder
except ImportError:
c_make_encoder = None
ESCAPE = re.compile(r'[\x00-\x... | gpl-3.0 |
0111001101111010/open-health-inspection-api | venv/lib/python2.7/site-packages/pip/cmdoptions.py | 361 | 9507 | """
shared options and groups
The principle here is to define options once, but *not* instantiate them globally.
One reason being that options with action='append' can carry state between parses.
pip parse's general options twice internally, and shouldn't pass on state.
To be consistent, all options will follow this d... | gpl-2.0 |
nixonpjoshua/JNixonHelloContigsFilter | test/JNixonHelloContigsFilter_server_test.py | 1 | 5275 | # -*- coding: utf-8 -*-
import unittest
import os # noqa: F401
import json # noqa: F401
import time
import requests
from os import environ
try:
from ConfigParser import ConfigParser # py2
except:
from configparser import ConfigParser # py3
from pprint import pprint # noqa: F401
from JNixonHelloContigsFil... | mit |
zahanm/foodpedia | django/views/decorators/csrf.py | 227 | 2240 | from django.middleware.csrf import CsrfViewMiddleware
from django.utils.decorators import decorator_from_middleware, available_attrs
try:
from functools import wraps
except ImportError:
from django.utils.functional import wraps # Python 2.4 fallback.
csrf_protect = decorator_from_middleware(CsrfViewMiddlewar... | bsd-3-clause |
captainpete/rethinkdb | external/v8_3.30.33.16/build/gyp/test/cxxflags/gyptest-cxxflags.py | 142 | 1551 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies build of an executable with C++ define specified by a gyp define, and
the use of the environment during regeneration when the g... | agpl-3.0 |
aeneby/RIOT | tests/od/tests/02-run.py | 25 | 2054 | #!/usr/bin/env python3
# Copyright (C) 2017 Hamburg University of Applied Sciences
#
# This file is subject to the terms and conditions of the GNU Lesser
# General Public License v2.1. See the file LICENSE in the top level
# directory for more details.
import sys
from testrunner import run
def testfunc(child):
... | lgpl-2.1 |
gonboy/sl4a | python-build/python-libs/gdata/tests/gdata_tests/youtube_test.py | 128 | 25507 | #!/usr/bin/python
#
# Copyright (C) 2006 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 ... | apache-2.0 |
kustodian/ansible | lib/ansible/modules/source_control/bzr.py | 52 | 6098 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2013, André Paramés <git@andreparames.com>
# Based on the Git module by Michael DeHaan <michael.dehaan@gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, pr... | gpl-3.0 |
double-y/django | django/conf/locale/sv/formats.py | 504 | 1569 | # -*- 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 = 'H:i'
DATETI... | bsd-3-clause |
imatge-upc/saliency-salgan-2017 | scripts/models/discriminator.py | 1 | 2187 | from lasagne.layers import Conv2DLayer as ConvLayer
from lasagne.layers import Pool2DLayer as PoolLayer
from lasagne.layers import DenseLayer, InputLayer
from lasagne.nonlinearities import tanh, sigmoid
import nn
def build(input_height, input_width, concat_var):
"""
Build the discriminator, all weights initi... | mit |
DCSaunders/tensorflow | tensorflow/python/ops/variable_scope.py | 11 | 61935 | # 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 |
olivierdalang/stdm | third_party/geoalchemy2/types.py | 1 | 7517 | """ This module defines the :class:`geoalchemy2.types.Geometry`,
:class:`geoalchemy2.types.Geography`, and :class:`geoalchemy2.types.Raster`
classes, that are used when defining geometry, geography and raster
columns/properties in models.
Reference
---------
"""
from sqlalchemy.types import UserDefinedType, ... | gpl-2.0 |
abhisg/scikit-learn | sklearn/cluster/tests/test_affinity_propagation.py | 341 | 2620 | """
Testing for Clustering methods
"""
import numpy as np
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_raises
from sklearn.cluster.affinity_propagation_ import AffinityPropagation
from sklearn.cluster.affinity_propagatio... | bsd-3-clause |
haoxli/crosswalk-test-suite | wrt/wrt-packagemgt-windows-tests/pmwindows/Crosswalk_WebApp_Update.py | 14 | 1973 | #!/bin/bash
#Copyright (c) 2015 Intel Corporation.
#
#Redistribution and use in source and binary forms, with or without modification,
#are permitted provided that the following conditions are met:
#
#* Redistributions of works must retain the original copyright notice, this list
# of conditions and the following disc... | bsd-3-clause |
yanheven/ceilometer | ceilometer/event/storage/impl_elasticsearch.py | 1 | 11633 | #
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under... | apache-2.0 |
leopittelli/Django-on-App-Engine-Example | django/core/management/commands/inspectdb.py | 47 | 10340 | from __future__ import unicode_literals
import keyword
import re
from optparse import make_option
from django.core.management.base import NoArgsCommand, CommandError
from django.db import connections, DEFAULT_DB_ALIAS
from django.utils.datastructures import SortedDict
class Command(NoArgsCommand):
help = "Intro... | mit |
Project-DeLorean/delorean_postgresql_importer | setup.py | 1 | 1181 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
from setuptools import setup, Command
except ImportError:
from distutils.core import setup, Command
from version import __version__
dependencies = ['click']
setup(
name='delorean_postgresql_importer',
version=__version__,
description='Library t... | agpl-3.0 |
Natim/sentry | tests/sentry/api/endpoints/test_group_tags.py | 3 | 1307 | from __future__ import absolute_import
from django.core.urlresolvers import reverse
from sentry.models import GroupTagKey, GroupTagValue, TagKey, TagValue
from sentry.testutils import APITestCase
class GroupTagsTest(APITestCase):
def test_simple(self):
group = self.create_group()
group.data['tag... | bsd-3-clause |
uclouvain/osis | education_group/tests/ddd/factories/domain/diploma.py | 1 | 2262 | ##############################################################################
#
# OSIS stands for Open Student Information System. It's an application
# designed to manage the core business of higher education institutions,
# such as universities, faculties, institutes and professional schools.
# The core ... | agpl-3.0 |
wanzifa/flasky | app/api_1_0/authentication.py | 35 | 1258 | from flask import g, jsonify
from flask.ext.httpauth import HTTPBasicAuth
from ..models import User, AnonymousUser
from . import api
from .errors import unauthorized, forbidden
auth = HTTPBasicAuth()
@auth.verify_password
def verify_password(email_or_token, password):
if email_or_token == '':
g.current_u... | mit |
ArcticWarriors/scouting-app | ScoutingWebsite/Scouting2017/api_scraper/fake_data_scripts/create_fake_official_matches_json.py | 2 | 4353 | '''
Created on Feb 7, 2017
@author: PJ
'''
import json
from BaseScouting.load_django import load_django
from BaseScouting.api_scraper.fake_data_scripts.CreateFakeJson_OfficialFirst import CreateFakeJson_OfficialFirst
from Scouting2017.api_scraper.fake_data_scripts.Robot import Robot
from Scouting2017.api_scraper.fake_... | mit |
caseyrygt/osf.io | website/archiver/model.py | 38 | 5944 | import datetime
from modularodm import fields
from framework.mongo import ObjectId
from framework.mongo import StoredObject
from website.archiver import (
ARCHIVER_INITIATED,
ARCHIVER_SUCCESS,
ARCHIVER_FAILURE,
ARCHIVER_FAILURE_STATUSES
)
from website.addons.base import StorageAddonBase
from website... | apache-2.0 |
stormi/tsunami | src/primaires/information/commandes/roadmap/editer.py | 1 | 4184 | # -*-coding:Utf-8 -*
# Copyright (c) 2015 LE GOFF Vincent
# 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
# lis... | bsd-3-clause |
lcreyes/PULearningSelfTutorial | LogRClassification.py | 1 | 1356 | import numpy as np
import matplotlib.pyplot as plt
from sklearn import linear_model
#define constants
n_p = 500 #number of positive points
n_n = 1000 # number of negative points
#define Gaussians mean and covariance matrices
mean1 = [0,0]
mean2 = [4,3]
cov1 = [[1, 0.5], [0.5, 1]]
cov2 = [[1, -0.5], [-0.5, 1]]
#r... | mit |
DONIKAN/django | django/contrib/admin/widgets.py | 345 | 14769 | """
Form Widget classes specific to the Django admin site.
"""
from __future__ import unicode_literals
import copy
from django import forms
from django.contrib.admin.templatetags.admin_static import static
from django.core.urlresolvers import reverse
from django.db.models.deletion import CASCADE
from django.forms.uti... | bsd-3-clause |
ettm2012/MissionPlanner | Lib/site-packages/numpy/distutils/tests/gen_ext/setup.py | 51 | 1178 | #!"C:\Users\hog\Documents\Visual Studio 2010\Projects\ArdupilotMega\ArdupilotMega\bin\Debug\ipy.exe"
fib3_f = '''
C FILE: FIB3.F
SUBROUTINE FIB(A,N)
C
C CALCULATE FIRST N FIBONACCI NUMBERS
C
INTEGER N
REAL*8 A(N)
Cf2py intent(in) n
Cf2py intent(out) a
Cf2py depend(n) a
DO I=1,N
IF ... | gpl-3.0 |
rapilabs/django | django/contrib/staticfiles/utils.py | 335 | 1976 | import fnmatch
import os
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
def matches_patterns(path, patterns=None):
"""
Return True or False depending on whether the ``path`` should be
ignored (if it matches any pattern in ``ignore_patterns``).
"""
if patt... | bsd-3-clause |
simone-campagna/daikon | tests/integration/test_config_schema_formats.py | 2 | 6327 | # -*- coding: utf-8 -*-
#
# Copyright 2013 Simone Campagna
#
# 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... | apache-2.0 |
remynguyen96/webpack-layout | Son/node_modules/node-gyp/gyp/pylib/gyp/mac_tool.py | 1569 | 23354 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Utility functions to perform Xcode-style build steps.
These functions are executed via gyp-mac-tool when using the Makefile generator.
""... | mit |
e-schumann/proxy_doodle | external/boost/tools/build/test/make_rule.py | 44 | 1323 | #!/usr/bin/python
# Copyright 2003 Dave Abrahams
# Copyright 2003, 2006 Vladimir Prus
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
# Test the 'make' rule.
import BoostBuild
import string
t = BoostBuild.Tester(pass_tool... | mit |
liaorubei/depot_tools | third_party/logilab/common/testlib.py | 64 | 52619 | # -*- coding: utf-8 -*-
# copyright 2003-2012 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# This file is part of logilab-common.
#
# logilab-common is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser Genera... | bsd-3-clause |
2014cdbg2/cdbg2 | wsgi/static/Brython2.1.0-20140419-113919/Lib/pyre.py | 115 | 15252 | #
# Secret Labs' Regular Expression Engine
#
# re-compatible interface for the sre matching engine
#
# Copyright (c) 1998-2001 by Secret Labs AB. All rights reserved.
#
# This version of the SRE library can be redistributed under CNRI's
# Python 1.6 license. For any other use, please contact Secret Labs
# AB (info@py... | gpl-2.0 |
dinhoabreu/yowsup | yowsup/layers/protocol_notifications/protocolentities/notification_picture_set.py | 70 | 1405 | from yowsup.structs import ProtocolEntity, ProtocolTreeNode
from .notification_picture import PictureNotificationProtocolEntity
class SetPictureNotificationProtocolEntity(PictureNotificationProtocolEntity):
'''
<notification offline="0" id="{{NOTIFICATION_ID}}" notify="{{NOTIFY_NAME}}" type="picture"
... | gpl-3.0 |
NL66278/odoo | addons/warning/__openerp__.py | 113 | 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 |
killpanda/Ailurus | ailurus/support/term.py | 1 | 4412 | #coding: utf-8
#
# Ailurus - a simple application installer and GNOME tweaker
#
# Copyright (C) 2009-2010, Ailurus developers and Ailurus contributors
# Copyright (C) 2007-2010, Trusted Digital Technology Laboratory, Shanghai Jiao Tong University, China.
#
# Ailurus is free software; you can redistribute it and/or modi... | gpl-2.0 |
AutorestCI/azure-sdk-for-python | azure-cognitiveservices-vision-computervision/azure/cognitiveservices/vision/computervision/models/color_info.py | 2 | 1975 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | mit |
ferriman/SSandSP | python-rtmidi/midiout.py | 1 | 1521 | import time
import rtmidi # sudo apt-get install python3-rtmidi not pip3 install rtmidi
import random
def majorChordGenerator():
startValue = random.randint(50,60)
return ([startValue,startValue+4,startValue+7])
def minorChordGenerator():
startValue = random.randint(50,60)
return ([startValue,startVal... | gpl-3.0 |
adrianschlatter/python-ivi | ivi/agilent/agilentBaseScope.py | 6 | 66906 | """
Python Interchangeable Virtual Instrument Library
Copyright (c) 2012-2014 Alex Forencich
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... | mit |
NeuralEnsemble/neuroConstruct | lib/jython/Lib/test/double_const.py | 237 | 1217 | from test.test_support import TestFailed
# A test for SF bug 422177: manifest float constants varied way too much in
# precision depending on whether Python was loading a module for the first
# time, or reloading it from a precompiled .pyc. The "expected" failure
# mode is that when test_import imports this after al... | gpl-2.0 |
joakim-hove/ert | python/python/ert_gui/ertwidgets/analysismodulevariablespanel.py | 1 | 6794 | # Copyright (C) 2013 Statoil ASA, Norway.
#
# The file 'analysismodulevariablespanel.py' is part of ERT - Ensemble based Reservoir Tool.
#
# ERT 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 ver... | gpl-3.0 |
qiqi/fds | apps/fun3d.py | 1 | 6199 | import os
import sys
import time
import shutil
import tempfile
import argparse
from subprocess import *
from numpy import *
my_path = os.path.dirname(os.path.abspath(__file__))
sys.path.append(os.path.join(my_path, '..'))
from fds import *
from fds.checkpoint import *
ALPHA = 20 # nominal angle of att... | gpl-3.0 |
harshilasu/GraphicMelon | y/google-cloud-sdk/platform/gcutil/lib/google_compute_engine/gcutil_lib/mock_api_types_test.py | 4 | 16739 | """Tests for mock_api_types."""
import path_initializer
path_initializer.InitSysPath()
import base64
import unittest
from gcutil_lib import mock_api_types
class TypeTest(unittest.TestCase):
def testObjectTypeStr(self):
properties = [
mock_api_types.Property('name', mock_api_types.StringType(None)),
... | gpl-3.0 |
UrusTeam/android_ndk_toolchain_cross | lib/python2.7/email/feedparser.py | 91 | 20606 | # Copyright (C) 2004-2006 Python Software Foundation
# Authors: Baxter, Wouters and Warsaw
# Contact: email-sig@python.org
"""FeedParser - An email feed parser.
The feed parser implements an interface for incrementally parsing an email
message, line by line. This has advantages for certain applications, such as
thos... | gpl-2.0 |
gavinp/chromium | third_party/python_gflags/gflags2man.py | 407 | 18864 | #!/usr/bin/env python
# Copyright (c) 2006, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this l... | bsd-3-clause |
peerster/CouchPotatoServer | libs/suds/transport/http.py | 195 | 6132 | # This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) GNU Lesser General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will ... | gpl-3.0 |
fracting/winpty | misc/DebugServer.py | 42 | 2396 | #!python
#
# Run with native CPython. Needs pywin32 extensions.
# Copyright (c) 2011-2012 Ryan Prichard
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including with... | mit |
kehao95/Wechat_LearnHelper | src/spider_loop.py | 1 | 5892 | __author__ = "kehao"
__email__ = "kehao95@gmail.com"
import sys
sys.path += ["./lib/aiolearn"]
from aiolearn import *
import db
import json
import asyncio
import logging
import requests
database = None
logging.basicConfig(level=logging.DEBUG)
__logger = logging.getLogger(__name__)
def push_new_items(items_dict, e... | gpl-3.0 |
duducosmos/pgs4a | python-install/lib/python2.7/distutils/tests/test_dist.py | 14 | 15357 | # -*- coding: utf8 -*-
"""Tests for distutils.dist."""
import os
import StringIO
import sys
import unittest
import warnings
import textwrap
from distutils.dist import Distribution, fix_help_options, DistributionMetadata
from distutils.cmd import Command
import distutils.dist
from test.test_support import TESTFN, capt... | lgpl-2.1 |
SNoiraud/gramps | gramps/gui/widgets/multitreeview.py | 7 | 3629 | #
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2010 Doug Blank <doug.blank@gmail.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 of the License, or
... | gpl-2.0 |
yp/Schema-Integration | schemaintegration/solver.py | 1 | 3591 | ##########
#
# SCHEMA-INTEGRATION
# A clustering approach to guide DB schema integration processes
#
# Copyright (C) 2012 Yuri Pirola, Riccardo Dondi
#
# Distributed under the terms of the GNU General Public License (GPL)
#
# This file is part of SCHEMA-INTEGRATION.
#
# SCHEMA-INTEGRATION... | gpl-3.0 |
eufarn7sp/egads-eufar | egads/input/nasa_ames_io.py | 2 | 49276 | __author__ = "ohenry"
__date__ = "2016-11-29 15:38"
__version__ = "1.7"
__all__ = ["NasaAmes"]
import logging
import datetime
import egads
import copy
import re
import os
from egads.input import FileCore
try:
import nappy
logging.info('egads - nasa_ames_io.py - nappy has been imported')
if 'egads' not in n... | bsd-3-clause |
mmiklavc/incubator-metron | metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/scripts/metron_client.py | 4 | 2499 | """
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 use this ... | apache-2.0 |
mattdangerw/inkscape | share/extensions/text_extract.py | 3 | 6056 | #!/usr/bin/env python
"""
Copyright (C) 2011 Nicolas Dufour (jazzynico)
Direction code from the Restack extension, by Rob Antonishen
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 restric... | gpl-2.0 |
imaculate/scikit-learn | examples/linear_model/plot_ols_3d.py | 350 | 2040 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
Sparsity Example: Fitting only features 1 and 2
=========================================================
Features 1 and 2 of the diabetes-dataset are fitted and
plotted below. It illustrates that although feature... | bsd-3-clause |
r3tard/BartusBot | lib/Crypto/PublicKey/_slowmath.py | 124 | 6421 | # -*- coding: utf-8 -*-
#
# PubKey/RSA/_slowmath.py : Pure Python implementation of the RSA portions of _fastmath
#
# Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net>
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
#... | apache-2.0 |
Jgarcia-IAS/localizacion | openerp/addons-extra/odoo-pruebas/odoo-server/addons/hr_timesheet_sheet/__openerp__.py | 52 | 3055 | # -*- 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 |
wenhulove333/ScutServer | Sample/Koudai/Server/release/Script/PyScript/Action/action12053.py | 2 | 21300 | import clr, sys
import random
import time
import datetime
clr.AddReference('ZyGames.Framework.Common');
clr.AddReference('ZyGames.Framework');
clr.AddReference('ZyGames.Framework.Game');
clr.AddReference('ZyGames.Tianjiexing.Model');
clr.AddReference('ZyGames.Tianjiexing.BLL');
clr.AddReference('ZyGames.Tianj... | mit |
rveciana/introduccion-python-geoespacial | gdal_ejemplos.py | 1 | 4686 | # -*- coding: utf-8 -*-
"""
8as Jornadas Sig Libre
26 de Marzo de 2014
Introducción a Python para usos geoespaciales
Ejemplos para trabajar con GDAL/python
"""
#Para este ejemplo, necesitaremos los siguientes módulos:
from osgeo import gdal
from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt
... | gpl-2.0 |
nvlsianpu/mbed | tools/build_everything.py | 47 | 10738 | #! /usr/bin/env python
"""
mbed SDK
Copyright (c) 2011-2013 ARM Limited
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... | apache-2.0 |
xkcd1253/Mimi | flask/lib/python2.7/site-packages/pytz/exceptions.py | 657 | 1333 | '''
Custom exceptions raised by pytz.
'''
__all__ = [
'UnknownTimeZoneError', 'InvalidTimeError', 'AmbiguousTimeError',
'NonExistentTimeError',
]
class UnknownTimeZoneError(KeyError):
'''Exception raised when pytz is passed an unknown timezone.
>>> isinstance(UnknownTimeZoneError(), LookupError)... | gpl-2.0 |
nijel/translate | translate/convert/web2py2po.py | 2 | 2746 | #
# Copyright 2009-2010 Zuza Software Foundation
#
# This file is part of translate.
#
# 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 ... | gpl-2.0 |
SteveViss/readthedocs.org | readthedocs/projects/version_handling.py | 24 | 5671 | """Project version handling"""
from collections import defaultdict
from packaging.version import Version
from packaging.version import InvalidVersion
from readthedocs.builds.constants import LATEST_VERBOSE_NAME
from readthedocs.builds.constants import STABLE_VERBOSE_NAME
def get_major(version):
# pylint: disabl... | mit |
louispotok/pandas | pandas/tests/reshape/test_reshape.py | 3 | 21360 | # -*- coding: utf-8 -*-
# pylint: disable-msg=W0612,E1101
from warnings import catch_warnings
import pytest
from collections import OrderedDict
from pandas import DataFrame, Series
import pandas as pd
from numpy import nan
import numpy as np
from pandas.util.testing import assert_frame_equal
from pandas import get... | bsd-3-clause |
evanscottgray/ryu | ryu/services/protocols/bgp/api/import_map.py | 52 | 2700 | # Copyright (C) 2014 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 |
xianggong/m2c_unit_test | test/operator/remainder_ushort8ushort8/compile.py | 1861 | 4430 | #!/usr/bin/python
import os
import subprocess
import re
def runCommand(command):
p = subprocess.Popen(command,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
p.wait()
return iter(p.stdout.readline, b'')
def dumpRunCommand(command,... | gpl-2.0 |
rgerkin/neuroConstruct | lib/jython/Lib/test/test_gettext.py | 108 | 18378 | import os
import base64
import shutil
import gettext
import unittest
from test import test_support
# TODO:
# - Add new tests, for example for "dgettext"
# - Remove dummy tests, for example testing for single and double quotes
# has no sense, it would have if we were testing a parser (i.e. pygettext)
# - Tests ... | gpl-2.0 |
cernops/cloudbase-init | cloudbaseinit/openstack/common/rpc/impl_kombu.py | 5 | 33722 | # Copyright 2011 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | apache-2.0 |
Grirrane/odoo | addons/stock/stock.py | 2 | 266010 | # -*- 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 |
gem/oq-hazardlib | openquake/hazardlib/tests/gsim/akkar_cagnan_2010_test.py | 1 | 1464 | # -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (C) 2012-2017 GEM Foundation
#
# OpenQuake is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the Licen... | agpl-3.0 |
Jackeagle/htc_butterfly_asia_india_4.4.2_kernel | scripts/tracing/draw_functrace.py | 14676 | 3560 | #!/usr/bin/python
"""
Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com>
Licensed under the terms of the GNU GPL License version 2
This script parses a trace provided by the function tracer in
kernel/trace/trace_functions.c
The resulted trace is processed into a tree to produce a more human
view of the call ... | gpl-2.0 |
konopski/httpie | httpie/cli.py | 41 | 15596 | """CLI arguments definition.
NOTE: the CLI interface may change before reaching v1.0.
"""
from textwrap import dedent, wrap
#noinspection PyCompatibility
from argparse import (RawDescriptionHelpFormatter, FileType,
OPTIONAL, ZERO_OR_MORE, SUPPRESS)
from httpie import __doc__, __version__
from h... | bsd-3-clause |
Omegaphora/external_chromium_org | chrome/test/chromedriver/embed_js_in_cpp.py | 165 | 1485 | #!/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.
"""Embeds standalone JavaScript snippets in C++ code.
Each argument to the script must be a file containing an associated JavaScri... | bsd-3-clause |
mil3na/GenderStudyStackExchange | dependent_factors.py | 1 | 5724 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
from __future__ import division
import pymongo, time, getopt, sys, numpy, datetime
def lifetime(row):
if len(row["dates"]) > 0:
row["dates"].sort()
#min == oldest
first = max(row["joined"], row["dates"][0])
difference = row["dates"][-1] - first
d... | mit |
bmstu-iu9/mill-db | pymilldb/lexer.py | 1 | 7271 | import logging
import re
from copy import copy
logger = logging.getLogger('lexer')
END_CHAR = '\000'
SYMBOLS = {
"(": "LPARENT",
")": "RPARENT",
";": "SEMICOLON",
",": "COMMA",
"=": "EQ",
"<": "LESS",
">": "MORE",
"<>": "NOT_EQ",
"<=": "LESS_OR_EQ",
">=": "MORE_OR_EQ",
}
KEYW... | mit |
Petr-Kovalev/nupic-win32 | py/nupic/support/feature_groups.py | 2 | 3273 | #! /usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have purchased from
# Numenta, Inc. a separate commercial license for this software code, the
# following terms and conditi... | gpl-3.0 |
MLnick/spark | examples/src/main/python/sql/streaming/structured_network_wordcount_windowed.py | 76 | 4081 | #
# 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 |
nir0s/python-packer | docs/conf.py | 2 | 9398 | # flake8: NOQA
# -*- coding: utf-8 -*-
#
# python-packer documentation build configuration file, created by
# sphinx-quickstart on Thu Apr 3 23:59:36 2014.
#
# 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
# auto... | apache-2.0 |
xmementoit/practiseSamples | python/stringExcercises.py | 1 | 1106 | #! /usr/bin/env python3
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2016 Damian Ziobro <damian@xmementoit.com>
import unittest
import datetime
class TestFunctoolsMethods(unittest.TestCase):
def setUp(self):
self.array = [1,2,3,4,5,6,7,8,9]
self.arrayShort = [1,2,3,4,5]
s... | apache-2.0 |
btat/Booktype | tests/selenium_settings.py | 1 | 6940 | import os
import django
from unipath import Path
BASE_DIR = Path(os.path.abspath(__file__))
# PROFILE
PROFILE_ACTIVE = 'test'
if django.VERSION[:2] < (1, 6):
TEST_RUNNER = 'discover_runner.DiscoverRunner'
TEST_DISCOVER_TOP_LEVEL = BASE_DIR.parent.parent.child('lib')
TEST_DISCOVER_PATTERN = 'seltest*.py'
... | agpl-3.0 |
jkonecny12/anaconda | pyanaconda/network.py | 3 | 22327 | #
# network.py - network configuration install data
#
# Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 Red Hat, Inc.
# 2008, 2009, 2017
#
# 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 Softwa... | gpl-2.0 |
GTmmiller/TurkeyVulture | tests/data/start_999.py | 1 | 8043 | JSON = {
"id": "999",
"to": {
"data": [
{
"id": "1",
"name": "Person One"
},
{
"id": "2",
"name": "Person Two"
},
{
"id": "3",
"name": "Person Three"
},
{
"id": ... | apache-2.0 |
alianmohammad/dpdk | app/cmdline_test/cmdline_test_data.py | 40 | 10086 | #!/usr/bin/python
# BSD LICENSE
#
# Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
# 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 sourc... | lgpl-2.1 |
sparkslabs/kamaelia | Sketches/MPS/BugReports/FixTests/Kamaelia/Kamaelia/Protocol/RTP/__init__.py | 6 | 1261 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache License... | apache-2.0 |
eyalfa/spark | examples/src/main/python/mllib/multi_class_metrics_example.py | 98 | 2827 | #
# 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 |
swcloud/api-client-staging | generated/python/proto-google-cloud-monitoring-v3/google/cloud/proto/monitoring/v3/common_pb2.py | 7 | 16737 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/cloud/proto/monitoring/v3/common.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.prot... | bsd-3-clause |
igorgai/django-allauth | allauth/socialaccount/providers/github/views.py | 67 | 1028 | import requests
from allauth.socialaccount.providers.oauth2.views import (OAuth2Adapter,
OAuth2LoginView,
OAuth2CallbackView)
from .provider import GitHubProvider
class GitHubOAuth2Adapter(OAuth2Adapte... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.