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 |
|---|---|---|---|---|---|
seanbell/opensurfaces | server/normals/views.py | 1 | 9087 | import json
from django.shortcuts import render, get_object_or_404
from django.db.models import F
from django.http import HttpResponse
from django.views.decorators.http import require_POST
from django.core.urlresolvers import reverse
from django.contrib.admin.views.decorators import staff_member_required
from django.v... | mit |
steedos/odoo7 | openerp/addons/l10n_be/__init__.py | 430 | 1060 | # -*- 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 |
mayblue9/scikit-learn | sklearn/decomposition/tests/test_online_lda.py | 21 | 13171 | import numpy as np
from scipy.linalg import block_diag
from scipy.sparse import csr_matrix
from scipy.special import psi
from sklearn.decomposition import LatentDirichletAllocation
from sklearn.decomposition._online_lda import (_dirichlet_expectation_1d,
_dirichlet_expect... | bsd-3-clause |
Crossy147/java-design-patterns | _scripts/postPumlsToServer.py | 10 | 2865 | #
# The MIT License
# Copyright (c) 2014-2016 Ilkka Seppälä
#
# 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... | mit |
iradul/qtwebkit | Tools/Scripts/webkitpy/tool/bot/earlywarningsystemtask.py | 127 | 2759 | # Copyright (c) 2011 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 ... | gpl-2.0 |
deandunbar/html2bwml | venv/lib/python2.7/site-packages/django/contrib/gis/sitemaps/views.py | 52 | 4914 | from __future__ import unicode_literals
import warnings
from django.apps import apps
from django.http import HttpResponse, Http404
from django.template import loader
from django.contrib.sites.shortcuts import get_current_site
from django.core import urlresolvers
from django.core.paginator import EmptyPage, PageNotAnI... | mit |
Coaxis-ASP/open-printing-tunnel | backend/api/tests/test_container_services.py | 2 | 15694 | import uuid
import docker
import docker.errors
from django.conf import settings
from rest_framework.test import APITestCase
from api import container_services
from api.tests import factories
from api.tests import mock
class ContainersTestCase(APITestCase):
def setUp(self):
self.docker_api = docker.Clien... | gpl-3.0 |
2hf/redis-in-action | python/ch07_listing_source.py | 5 | 36913 |
import math
import re
import unittest
import uuid
import redis
AVERAGE_PER_1K = {}
# <start id="tokenize-and-index"/>
STOP_WORDS = set('''able about across after all almost also am among
an and any are as at be because been but by can cannot could dear did
do does either else ever every for from get got had has hav... | mit |
amazuelos/BitacleSymfony3 | 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... | mit |
ericpp/hippyvm | testing/test_var_funcs.py | 1 | 1346 | import py.test
from hippy.objects.floatobject import W_FloatObject
from testing.test_interpreter import BaseTestInterpreter
class TestVarFuncs(BaseTestInterpreter):
def test_print_r(self):
output = self.run('''
class A {
private $y = 5;
}
$a = new A;
$a->x = arra... | mit |
SravanthiSinha/edx-platform | openedx/core/djangoapps/user_api/accounts/tests/test_views.py | 37 | 33316 | # -*- coding: utf-8 -*-
import datetime
from copy import deepcopy
import ddt
import hashlib
import json
from mock import patch
from pytz import UTC
import unittest
from django.conf import settings
from django.core.urlresolvers import reverse
from django.test.testcases import TransactionTestCase
from django.test.utils ... | agpl-3.0 |
lduarte1991/edx-platform | lms/djangoapps/django_comment_client/permissions.py | 5 | 9254 | """
Module for checking permissions with the comment_client backend
"""
import logging
from types import NoneType
from opaque_keys.edx.keys import CourseKey
from django_comment_common.models import CourseDiscussionSettings, all_permissions_for_user_in_course
from django_comment_common.utils import get_course_discuss... | agpl-3.0 |
a25kk/bfa | src/bfa.sitecontent/bfa/sitecontent/widgets/content/video.py | 1 | 4222 | # -*- coding: utf-8 -*-
"""Module providing event filter widget"""
import uuid as uuid_tool
from Acquisition import aq_inner
from Products.Five import BrowserView
from plone import api
from plone.i18n.normalizer import IIDNormalizer
from wildcard.media.behavior import IVideo
from zope.component import queryUtility
cl... | mit |
damomeen/pox-datapath | pox/messenger/__init__.py | 25 | 19645 | # Copyright 2011,2012 James McCauley
#
# This file is part of POX.
#
# POX is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# POX is d... | apache-2.0 |
lgarren/spack | var/spack/repos/builtin/packages/r-affycomp/package.py | 1 | 1773 | ##############################################################################
# Copyright (c) 2013-2017, 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 |
lostdj/Jaklin-OpenJFX | modules/web/src/main/native/Tools/Scripts/webkitpy/tool/commands/newcommitbot.py | 119 | 7612 | # Copyright (c) 2012 Google Inc. All rights reserved.
# Copyright (c) 2013 Apple 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... | gpl-2.0 |
edx/edx-platform | openedx/core/djangoapps/enrollments/tests/fake_data_api.py | 9 | 4333 | """
A Fake Data API for testing purposes.
"""
import copy
import datetime
_DEFAULT_FAKE_MODE = {
"slug": "honor",
"name": "Honor Code Certificate",
"min_price": 0,
"suggested_prices": "",
"currency": "usd",
"expiration_datetime": None,
"description": None
}
_ENROLLMENTS = []
_COURSES = ... | agpl-3.0 |
JohnGriffiths/nipype | nipype/utils/misc.py | 9 | 7047 | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""Miscellaneous utility functions
"""
from cPickle import dumps, loads
import inspect
from distutils.version import LooseVersion
import numpy as np
from textwrap import dedent
import sys
import re
from ni... | bsd-3-clause |
analogue/mythbox | resources/lib/twisted/twisted/python/test/test_release.py | 56 | 95755 | # Copyright (c) 2007-2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.python.release} and L{twisted.python._release}.
All of these tests are skipped on platforms other than Linux, as the release is
only ever performed on Linux.
"""
import warnings
import operator
import os, sys, ... | gpl-2.0 |
robinro/ansible | contrib/inventory/libvirt_lxc.py | 196 | 1357 | #!/usr/bin/env python
# (c) 2013, Michael Scherer <misc@zarb.org>
#
# 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 o... | gpl-3.0 |
simonemurzilli/geonode | geonode/contrib/slack/utils.py | 10 | 7977 | # -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2012 OpenPlans
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either versio... | gpl-3.0 |
redshiftzero/pgpbuddy | tests/test_crypto.py | 1 | 10432 | from unittest.mock import patch
from unittest import TestCase
from nose.tools import assert_list_equal
from pgpbuddy.crypto import *
from tests.mock_gpg import *
class TestCheckEncryptionAndSignature(TestCase):
@patch('gnupg.GPG', decrypt=mock_decrypt(Encryption.missing, Signature.missing))
def test_plain... | gpl-2.0 |
ProfessionalIT/professionalit-webiste | sdk/google_appengine/lib/django-1.4/django/contrib/gis/gdal/srs.py | 80 | 11683 | """
The Spatial Reference class, represensents OGR Spatial Reference objects.
Example:
>>> from django.contrib.gis.gdal import SpatialReference
>>> srs = SpatialReference('WGS84')
>>> print srs
GEOGCS["WGS 84",
DATUM["WGS_1984",
SPHEROID["WGS 84",6378137,298.257223563,
AUTHORI... | lgpl-3.0 |
CoderDuan/mantaflow | scenes/simpleplume.py | 2 | 1414 | #
# Simple example scene (hello world)
# Simulation of a buoyant smoke density plume (with noise texture as smoke source)
#
#import pdb; pdb.set_trace()
from manta import *
# solver params
res = 64
gs = vec3(res, int(1.5*res), res)
s = FluidSolver(name='main', gridSize = gs)
# prepare grids
flags = s.create(F... | gpl-3.0 |
ramanajee/phantomjs | src/qt/qtwebkit/Source/WebCore/inspector/CodeGeneratorInspector.py | 117 | 97853 | #!/usr/bin/env python
# Copyright (c) 2011 Google Inc. All rights reserved.
# Copyright (c) 2012 Intel Corporation. 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 sou... | bsd-3-clause |
jorge-marques/shoop | shoop_tests/core/test_product_caching_object.py | 7 | 2090 | # -*- coding: utf-8 -*-
# This file is part of Shoop.
#
# Copyright (c) 2012-2015, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
import pytest
from shoop.core.models import Product
from shoop.core.utils.p... | agpl-3.0 |
BaseBot/Triangula | src/python/setup.py | 1 | 1035 | __author__ = 'tom'
from setuptools import setup
# Makes use of the sphinx and sphinx-pypi-upload packages. To build for local development
# use 'python setup.py develop'. To upload a version to pypi use 'python setup.py clean sdist upload'.
# To build docs use 'python setup.py build_sphinx' and to upload docs to pytho... | apache-2.0 |
eyohansa/django | tests/gis_tests/geoapp/test_regress.py | 318 | 3857 | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals
from datetime import datetime
from django.contrib.gis.db.models import Extent
from django.contrib.gis.shortcuts import render_to_kmz
from django.db.models import Count, Min
from django.test import TestCase, skipUnlessDBFeature
from ..utils import no_o... | bsd-3-clause |
dariemp/odoo | addons/hr_payroll_account/wizard/__init__.py | 433 | 1116 | #-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# d$
#
# This program is free software: you can redistribute it and/or modify
# ... | agpl-3.0 |
libAtoms/matscipy | scripts/fracture_mechanics/run_crack_thin_strip.py | 1 | 4618 | #! /usr/bin/env python
# ======================================================================
# matscipy - Python materials science tools
# https://github.com/libAtoms/matscipy
#
# Copyright (2014) James Kermode, King's College London
# Lars Pastewka, Karlsruhe Institute of Technology
#
# This progr... | gpl-2.0 |
tdtrask/ansible | test/units/modules/network/onyx/onyx_module.py | 66 | 2691 | # (c) 2016 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is dis... | gpl-3.0 |
qedi-r/home-assistant | tests/components/ring/test_switch.py | 4 | 2734 | """The tests for the Ring switch platform."""
from homeassistant.components.switch import DOMAIN as SWITCH_DOMAIN
from tests.common import load_fixture
from .common import setup_platform
async def test_entity_registry(hass, requests_mock):
"""Tests that the devices are registed in the entity registry."""
awai... | apache-2.0 |
Zerknechterer/pyload | module/setup.py | 35 | 18929 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
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 prog... | gpl-3.0 |
Vixionar/django | tests/gis_tests/geo3d/models.py | 302 | 1294 | from django.utils.encoding import python_2_unicode_compatible
from ..models import models
@python_2_unicode_compatible
class NamedModel(models.Model):
name = models.CharField(max_length=30)
objects = models.GeoManager()
class Meta:
abstract = True
required_db_features = ['gis_enabled']
... | bsd-3-clause |
msiedlarek/qtwebkit | Source/WebCore/inspector/CodeGeneratorInspectorStrings.py | 119 | 29621 | # Copyright (c) 2013 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... | lgpl-3.0 |
fener06/pyload | module/plugins/accounts/HotfileCom.py | 2 | 3111 | # -*- coding: utf-8 -*-
"""
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 distributed in... | gpl-3.0 |
pymedusa/Medusa | ext/boto/elasticache/__init__.py | 22 | 1753 | # Copyright (c) 2013 Amazon.com, Inc. or its affiliates.
# All Rights Reserved
#
# 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... | gpl-3.0 |
mvaled/sentry | src/sentry/api/endpoints/group_integration_details.py | 1 | 11884 | from __future__ import absolute_import
from django.db import IntegrityError, transaction
from rest_framework.response import Response
from sentry import features
from sentry.api.bases import GroupEndpoint
from sentry.api.serializers import serialize
from sentry.api.serializers.models.integration import IntegrationIs... | bsd-3-clause |
sophiavanvalkenburg/coala | tests/misc/DictUtilitiesTest.py | 28 | 2055 | import unittest
from collections import OrderedDict
from coalib.misc.DictUtilities import inverse_dicts, update_ordered_dict_key
class DictUtilitiesTest(unittest.TestCase):
def test_inverse_dicts(self):
self.dict1 = {1: [1, 2, 3], 2: [3, 4, 5]}
self.dict2 = {2: [1], 3: [2], 4: [3, 4]}
se... | agpl-3.0 |
disqus/django-old | django/middleware/csrf.py | 5 | 8962 | """
Cross Site Request Forgery Middleware.
This module provides a middleware that implements protection
against request forgeries from other sites.
"""
import hashlib
import re
import random
from django.conf import settings
from django.core.urlresolvers import get_callable
from django.utils.cache import patch_vary_h... | bsd-3-clause |
madmatah/lapurge | lapurge/types.py | 1 | 3448 | # Copyright (c) 2013 Matthieu Huguet
# 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, dist... | mit |
jmwright/cadquery-x | gui/libs/pyqode/qt/QtCore.py | 2 | 1137 | """
Provides QtCore classes and functions.
"""
import os
from pyqode.qt import QT_API
from pyqode.qt import PYQT5_API
from pyqode.qt import PYQT4_API
from pyqode.qt import PYSIDE_API
if os.environ[QT_API] == PYQT5_API:
from PyQt5.QtCore import *
# compatibility with pyside
from PyQt5.QtCore import pyqtSig... | lgpl-3.0 |
Krossom/python-for-android | python-modules/twisted/twisted/lore/docbook.py | 53 | 2418 | # Copyright (c) 2001-2009 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
DocBook output support for Lore.
"""
import os, cgi
from xml.dom import minidom as dom
from twisted.lore import latex
class DocbookSpitter(latex.BaseLatexSpitter):
currentLevel = 1
def writeNodeData(self, node):
... | apache-2.0 |
ftkghost/SuperSaver | supersaver/core/decorator.py | 1 | 1206 | from functools import wraps
from .exception import UnauthorizedUser, UnsupportedHttpMethod
ß
def login_required(func):
@wraps(func)
def check_user_login(request, *args, **kwargs):
if not request.user.is_authenticated():
raise UnauthorizedUser()
return func(request, *args, **kwargs)... | bsd-2-clause |
wjchen84/baxter_examples | scripts/joint_position_waypoints.py | 6 | 6819 | #!/usr/bin/env python
# Copyright (c) 2013-2015, Rethink Robotics
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# ... | bsd-3-clause |
cogeorg/black_rhino | examples/firesales_SA/networkx/algorithms/centrality/tests/test_load_centrality.py | 72 | 8408 | #!/usr/bin/env python
from nose.tools import *
import networkx as nx
class TestLoadCentrality:
def setUp(self):
G=nx.Graph();
G.add_edge(0,1,weight=3)
G.add_edge(0,2,weight=2)
G.add_edge(0,3,weight=6)
G.add_edge(0,4,weight=4)
G.add_edge(1,3,weight=5)
G.add... | gpl-3.0 |
martinbuc/missionplanner | packages/IronPython.StdLib.2.7.4/content/Lib/encodings/mac_greek.py | 93 | 14284 | """ Python Character Mapping Codec mac_greek generated from 'MAPPINGS/VENDORS/APPLE/GREEK.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(s... | gpl-3.0 |
nwalters512/the-blue-alliance | tests/test_usfirst_event_awards_parser_03_04.py | 7 | 5085 | import unittest2
import json
from consts.award_type import AwardType
from datafeeds.usfirst_event_awards_parser_03_04 import UsfirstEventAwardsParser_03_04
def convert_to_comparable(data):
"""
Converts jsons to dicts so that elements can be more easily compared
"""
if type(data) == list:
retu... | mit |
joshbohde/scikit-learn | sklearn/linear_model/sparse/logistic.py | 2 | 3922 | """
Sparse Logistic Regression module
This module has the same API as sklearn.linear_model.logistic, but is
designed to handle efficiently data in sparse matrix format.
"""
import numpy as np
import scipy.sparse as sp
from ...base import ClassifierMixin
from ...svm.sparse.base import SparseBaseLibLinear
from ...line... | bsd-3-clause |
goodfeli/pylearn2 | pylearn2/scripts/summarize_model.py | 44 | 2999 | #!/usr/bin/env python
"""
This script summarizes a model by showing some statistics about
the parameters and checking whether the model completed
training succesfully
"""
from __future__ import print_function
__authors__ = "Ian Goodfellow"
__copyright__ = "Copyright 2010-2012, Universite de Montreal"
__credits__ = ["I... | bsd-3-clause |
eBusLabs/reboot2 | src/profiles/views.py | 58 | 2467 | from __future__ import unicode_literals
from django.views import generic
from django.shortcuts import get_object_or_404, redirect
from django.contrib import messages
from braces.views import LoginRequiredMixin
from . import forms
from . import models
class ShowProfile(LoginRequiredMixin, generic.TemplateView):
te... | mit |
collects/VTK | Examples/VisualizationAlgorithms/Python/officeTubes.py | 17 | 12565 | #!/usr/bin/env python
# This example demonstrates the use of streamlines generated from seeds,
# combined with a tube filter to create several streamtubes.
import vtk
from vtk.util.misc import vtkGetDataRoot
from vtk.util.colors import *
VTK_DATA_ROOT = vtkGetDataRoot()
# We read a data file the is a CFD analysis of... | bsd-3-clause |
silvau/Addons_Odoo | hr_bulk_period/__openerp__.py | 1 | 1643 | # -*- encoding: utf-8 -*-
############################################################################
# Module for OpenERP, Open Source Management Solution
#
# Copyright (c) 2013 Zenpar - http://www.zeval.com.mx/
# All Rights Reserved.
##########################################################################... | gpl-2.0 |
svn2github/vbox | src/VBox/ValidationKit/testmanager/batch/add_build.py | 4 | 5758 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# $Id$
# pylint: disable=C0301
"""
Interface used by the tinderbox server side software to add a fresh build.
"""
__copyright__ = \
"""
Copyright (C) 2012-2014 Oracle Corporation
This file is part of VirtualBox Open Source Edition (OSE), as
available from http://www.virt... | gpl-2.0 |
pombredanne/MOG | nova/virt/baremetal/driver.py | 7 | 21022 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# coding=utf-8
#
# Copyright (c) 2012 NTT DOCOMO, INC
# Copyright (c) 2011 University of Southern California / ISI
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the Licens... | apache-2.0 |
QGB/shadowsocks | shadowsocks/encrypt.py | 990 | 5180 | #!/usr/bin/env python
#
# Copyright 2012-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 la... | apache-2.0 |
Silmathoron/nest-simulator | pynest/nest/tests/test_json.py | 7 | 2151 | # -*- coding: utf-8 -*-
#
# test_json.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST 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 |
GaussDing/django | tests/template_tests/filter_tests/test_floatformat.py | 345 | 4480 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from decimal import Decimal, localcontext
from unittest import expectedFailure
from django.template.defaultfilters import floatformat
from django.test import SimpleTestCase
from django.utils import six
from django.utils.safestring import mark_safe
from ... | bsd-3-clause |
isandlaTech/cohorte-demos | led/dump/led-demo-yun/cohorte/dist/cohorte-1.0.0-20141216.234517-57-python-distribution/repo/cohorte/forker/__init__.py | 4 | 4326 | #!/usr/bin/env python
# -- Content-Encoding: UTF-8 --
"""
COHORTE Forker package
Contains all modules and packages specific to the forker
:author: Thomas Calmant
:license: Apache Software License 2.0
..
Copyright 2014 isandlaTech
Licensed under the Apache License, Version 2.0 (the "License");
you may n... | apache-2.0 |
DataDog/wal-e | tests/blackbox.py | 5 | 6326 | import os
import pytest
import s3_integration_help
import sys
from wal_e import cmd
_PREFIX_VARS = ['WALE_S3_PREFIX', 'WALE_WABS_PREFIX', 'WALE_SWIFT_PREFIX']
_AWS_CRED_ENV_VARS = ['AWS_ACCESS_KEY_ID', 'AWS_SECRET_ACCESS_KEY',
'AWS_SECURITY_TOKEN']
class AwsTestConfig(object):
name = 'aws... | bsd-3-clause |
bkrukowski/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/steps/applywatchlist_unittest.py | 124 | 2302 | # Copyright (C) 2011 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 |
Jgarcia-IAS/SAT | openerp/addons-extra/odoo-pruebas/odoo-server/addons-extra/hr_payroll_co_planning/warning.py | 6 | 3356 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2013 Interconsulting S.A. e Innovatecsa SAS. (http://interconsulting.com.co).
#
# WARNING: This program as such is intended to be used by professional... | agpl-3.0 |
NMGRL/pychron | pychron/ml/tasks/actions.py | 1 | 1114 | # ===============================================================================
# Copyright 2019 Jake Ross
#
# 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... | apache-2.0 |
nathania/networkx | networkx/algorithms/__init__.py | 21 | 3095 | from networkx.algorithms.assortativity import *
from networkx.algorithms.block import *
from networkx.algorithms.boundary import *
from networkx.algorithms.centrality import *
from networkx.algorithms.cluster import *
from networkx.algorithms.clique import *
from networkx.algorithms.community import *
from networkx.alg... | bsd-3-clause |
Dandandan/wikiprogramming | jsrepl/extern/python/reloop-closured/lib/python2.7/encodings/palmos.py | 647 | 2936 | """ Python Character Mapping Codec for PalmOS 3.5.
Written by Sjoerd Mullender (sjoerd@acm.org); based on iso8859_15.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_map)
def decode(self,inp... | mit |
rlutz/xorn | src/backend/gnet_bae.py | 1 | 1626 | # gaf.netlist - gEDA Netlist Extraction and Generation
# Copyright (C) 1998-2010 Ales Hvezda
# Copyright (C) 1998-2010 gEDA Contributors (see ChangeLog for details)
# Copyright (C) 2013-2019 Roland Lutz
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Publ... | gpl-2.0 |
marcoarruda/MissionPlanner | Lib/smtpd.py | 50 | 19098 | #! /usr/bin/env python
"""An RFC 2821 smtp proxy.
Usage: %(program)s [options] [localhost:localport [remotehost:remoteport]]
Options:
--nosetuid
-n
This program generally tries to setuid `nobody', unless this flag is
set. The setuid call will fail if this program is not run as root... | gpl-3.0 |
mne-tools/mne-python | examples/preprocessing/fnirs_artifact_removal.py | 18 | 3643 | """
.. _ex-fnirs-artifacts:
==========================================
Visualise NIRS artifact correction methods
==========================================
Here we artificially introduce several fNIRS artifacts and observe
how artifact correction techniques attempt to correct the data.
"""
# Authors: Robert Luke <m... | bsd-3-clause |
837278709/metro-openerp | metro_accounts/wizard/rpt_account_partner.py | 2 | 25342 | # -*- 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 |
EvilCult/Video-Downloader | Library/toolClass.py | 1 | 3025 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import pycurl
import StringIO
import random
class Tools :
def __init__ (self) :
pass
def getPage (self, url, requestHeader = []) :
resultFormate = StringIO.StringIO()
fakeIp = self.fakeIp()
requestHeader.append('CLIENT-IP:' + fakeIp)
requestHeader.append('X... | gpl-2.0 |
munyirik/python | cpython/Lib/distutils/cmd.py | 97 | 19147 | """distutils.cmd
Provides the Command class, the base class for the command classes
in the distutils.command package.
"""
import sys, os, re
from distutils.errors import DistutilsOptionError
from distutils import util, dir_util, file_util, archive_util, dep_util
from distutils import log
class Command:
"""Abstra... | bsd-3-clause |
drawquest/drawquest-web | common/boto/gs/resumable_upload_handler.py | 2 | 26230 | # Copyright 2010 Google Inc.
#
# 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, dis-
# trib... | bsd-3-clause |
bpetering/python-pattern-recognition | pattern_recognition.py | 1 | 2300 | def constant(diffs):
val = diffs.pop()
for d in diffs:
if d != val:
return False
return val
def pat1(seq): # consider two elements at a time
diffs = []
for i in xrange(1, len(seq)):
diffs.append( seq[i] - seq[i-1] ) # implicit directionality - factor... | mit |
SteveHNH/ansible | lib/ansible/modules/notification/typetalk.py | 78 | 3392 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
realsobek/freeipa | ipatests/test_integration/test_kerberos_flags.py | 3 | 7164 | # Authors:
# Ana Krivokapic <akrivoka@redhat.com>
#
# Copyright (C) 2013 Red Hat
# see file 'COPYING' for use and warranty information
#
# 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... | gpl-3.0 |
cogstat/cogstat | cogstat/test/test_stat.py | 1 | 22429 | # -*- coding: utf-8 -*-
import unittest
import os
import sys
sys.path.insert(0, os.path.abspath('../..'))
print(sys.path)
from pathlib import Path
import numpy as np
import pandas as pd
from cogstat import cogstat as cs
print(cs.__file__)
print(cs.__version__)
print(os.path.abspath(cs.__file__))
"""
- All statistica... | gpl-3.0 |
kochbeck/icsisumm | icsisumm-primary-sys34_v1/nltk/nltk-0.9.2/nltk/draw/plot.py | 9 | 28788 | # Natural Language Toolkit: Simple Plotting
#
# Copyright (C) 2001-2008 University of Pennsylvania
# Author: Edward Loper <edloper@gradient.cis.upenn.edu>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
#
# $Id: plot.py 5609 2007-12-31 03:02:41Z stevenbird $
"""
A simple tool for plotting functi... | gpl-3.0 |
jansel/loxodo | src/frontends/wx/mergeframe.py | 4 | 2907 | #
# Loxodo -- Password Safe V3 compatible Password Vault
# Copyright (C) 2008 Christoph Sommer <mail@christoph-sommer.de>
#
# 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 ... | gpl-2.0 |
rodrigc/buildbot | worker/buildbot_worker/pbutil.py | 6 | 4551 | # This file is part of Buildbot. Buildbot 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, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | gpl-2.0 |
maxoflow/MaXoFloW-Repo | plugin.video.MaXoFloWCinEsteno/youtubedl.py | 255 | 1840 | # -*- coding: utf-8 -*-
import xbmc,xbmcgui
try:
from YDStreamExtractor import getVideoInfo
from YDStreamExtractor import handleDownload
except Exception:
print 'importing Error. You need youtubedl module which is in official xbmc.org'
xbmc.executebuiltin("XBMC.Notification(LiveStreamsPro,Please [C... | gpl-2.0 |
mancoast/CPythonPyc_test | cpython/200_test_b2.py | 6 | 10123 | # Python test set -- part 4b, built-in functions n-z
from test_support import *
print 'oct'
if oct(100) != '0144': raise TestFailed, 'oct(100)'
if oct(100L) != '0144L': raise TestFailed, 'oct(100L)'
if oct(-100) not in ('037777777634', '01777777777777777777634'):
raise TestFailed, 'oct(-100)'
if oct(-100L) != '-0144... | gpl-3.0 |
netsamir/dotfiles | files/vim/bundle/YouCompleteMe/third_party/ycmd/third_party/requests/requests/status_codes.py | 202 | 3280 | # -*- coding: utf-8 -*-
from .structures import LookupDict
_codes = {
# Informational.
100: ('continue',),
101: ('switching_protocols',),
102: ('processing',),
103: ('checkpoint',),
122: ('uri_too_long', 'request_uri_too_long'),
200: ('ok', 'okay', 'all_ok', 'all_okay', 'all_good', '\\o/'... | unlicense |
xyuanmu/XX-Net | python3.8.2/Lib/site-packages/pip/_internal/pyproject.py | 13 | 6464 | from __future__ import absolute_import
import io
import os
import sys
from pip._vendor import pytoml, six
from pip._internal.exceptions import InstallationError
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
if MYPY_CHECK_RUNNING:
from typing import Any, Tuple, Optional, List
def _is_list_of_str(ob... | bsd-2-clause |
mikebrevard/UnixAdministration | vagrant/etc/data/genData/venv/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/hebrewprober.py | 2929 | 13359 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Shy Shalom
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved.
#... | mit |
jymannob/CouchPotatoServer | libs/requests/packages/charade/sbcharsetprober.py | 2927 | 4793 | ######################## 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... | gpl-3.0 |
inspirehep/invenio | modules/bibcatalog/lib/bibcatalog_unit_tests.py | 16 | 3943 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2013 CERN.
##
## Invenio 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) a... | gpl-2.0 |
JazzeYoung/VeryDeepAutoEncoder | pylearn2/models/tests/test_vae.py | 44 | 20236 | from nose.tools import raises
import os
import numpy
import theano
import theano.tensor as T
from pylearn2.compat import OrderedDict
from pylearn2.config import yaml_parse
from pylearn2.models.mlp import (
MLP, Linear, CompositeLayer, ConvRectifiedLinear, SpaceConverter
)
from pylearn2.models.vae import VAE
from p... | bsd-3-clause |
ShinyROM/android_external_chromium_org | tools/perf/record_android_profile.py | 42 | 1209 | #!/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 sys
import tempfile
sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir, 'telemetry'))
from telemetry.... | bsd-3-clause |
hnakamur/saklient.python | saklient/cloud/models/model_iface.py | 1 | 3605 | # -*- coding:utf-8 -*-
from ..client import Client
from .model import Model
from ..resources.resource import Resource
from ..resources.iface import Iface
from ...util import Util
import saklient
# module saklient.cloud.models.model_iface
class Model_Iface(Model):
## インタフェースを検索・作成するための機能を備えたクラス。
## @priv... | mit |
krytarowski/coreclr | src/ToolBox/SOS/tests/t_cmd_histroot.py | 43 | 1757 | import lldb
import re
import testutils as test
def runScenario(assembly, debugger, target):
process = target.GetProcess()
res = lldb.SBCommandReturnObject()
ci = debugger.GetCommandInterpreter()
# Run debugger, wait until libcoreclr is loaded,
# set breakpoint at Test.Main and stop there
test... | mit |
okuraoy/mywork | mtlearn/datasets.py | 1 | 2037 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import numpy as np
import pandas as pd
from sklearn.datasets.base import Bunch
from os.path import join
PATH = "d:\\data"
# class Bunch(dict):
# """Container object for datasets
# Dictionary-like object that exposes its keys as attributes.
#
# See... | apache-2.0 |
adrienbrault/home-assistant | tests/components/gios/test_init.py | 6 | 1617 | """Test init of GIOS integration."""
from unittest.mock import patch
from homeassistant.components.gios.const import DOMAIN
from homeassistant.config_entries import (
ENTRY_STATE_LOADED,
ENTRY_STATE_NOT_LOADED,
ENTRY_STATE_SETUP_RETRY,
)
from homeassistant.const import STATE_UNAVAILABLE
from tests.common ... | mit |
relic7/prodimages | python/jbmodules/cacheclear_tools/add_colorstyle_cache_clear_queue.py | 2 | 1825 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
def post_or_put_style_to_api(colorstyle, api_url=None, AuthToken=None):
import requests, json
import http.client, urllib.parse
if not api_url:
api_url = 'http://prodimages.ny.bluefly.com/image-update/'
update_styles = list(set(sorted(update_styles))... | mit |
hopshadoop/hops-hadoop-chef | files/default/hadoop_logs_mgm.py | 5 | 9009 | # This file is part of Hopsworks
# Copyright (C) 2018, Logical Clocks AB. All rights reserved
# Hopsworks 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 License, or (at your op... | agpl-3.0 |
chelsea1620/google-belay | station/openid/extensions/draft/pape2.py | 156 | 9330 | """An implementation of the OpenID Provider Authentication Policy
Extension 1.0
@see: http://openid.net/developers/specs/
@since: 2.1.0
"""
__all__ = [
'Request',
'Response',
'ns_uri',
'AUTH_PHISHING_RESISTANT',
'AUTH_MULTI_FACTOR',
'AUTH_MULTI_FACTOR_PHYSICAL',
]
from openid.extension i... | apache-2.0 |
ahlfors/omaha | site_scons/site_tools/wix.py | 63 | 5679 | """SCons.Tool.wix
Tool-specific initialization for wix, the Windows Installer XML Tool.
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.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 T... | apache-2.0 |
emilio/servo | tests/wpt/web-platform-tests/tools/third_party/html5lib/parse.py | 26 | 9201 | #!/usr/bin/env python
"""usage: %prog [options] filename
Parse a document to a tree, with optional profiling
"""
import sys
import traceback
from optparse import OptionParser
from html5lib import html5parser
from html5lib import treebuilders, serializer, treewalkers
from html5lib import constants
from html5lib impor... | mpl-2.0 |
FelixZYY/gyp | test/rules-rebuild/gyptest-all.py | 351 | 1662 | #!/usr/bin/env python
# Copyright (c) 2009 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 that a rule that generates multiple outputs rebuilds
correctly when the inputs change.
"""
import TestGyp
test = TestGyp.Test... | bsd-3-clause |
jemmyw/ansible | v1/ansible/runner/action_plugins/patch.py | 93 | 2501 | # (c) 2015, Brian Coca <briancoca+dev@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 later v... | gpl-3.0 |
michaelkirk/QGIS | python/plugins/MetaSearch/dialogs/manageconnectionsdialog.py | 13 | 6638 | # -*- coding: utf-8 -*-
###############################################################################
#
# CSW Client
# ---------------------------------------------------------
# QGIS Catalogue Service client.
#
# Copyright (C) 2010 NextGIS (http://nextgis.org),
# Alexander Bruy (alexander.bruy@gma... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.