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 |
|---|---|---|---|---|---|
sendwithus/sendwithus_python | setup.py | 1 | 1233 | from distutils.core import setup
from setuptools import find_packages
from io import open
with open('README.md', encoding="utf-8") as fp:
long_description = fp.read()
setup(
name='sendwithus',
version='5.2.2',
author='sendwithus',
author_email='us@sendwithus.com',
packages=find_packages(),
... | apache-2.0 |
OptimusGitEtna/RestSymf | Python-3.4.2/Lib/idlelib/CallTips.py | 97 | 5932 | """CallTips.py - An IDLE Extension to Jog Your Memory
Call Tips are floating windows which display function, class, and method
parameter and docstring information when you type an opening parenthesis, and
which disappear when you type a closing parenthesis.
"""
import __main__
import inspect
import re
import sys
impo... | mit |
probcomp/cgpm | tests/disabled_test_render_utils.py | 1 | 5792 | # -*- coding: utf-8 -*-
# Copyright (c) 2015-2016 MIT Probabilistic Computing Project
# 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
# Unles... | apache-2.0 |
google-research/realworldrl_suite | examples/run_ppo.py | 1 | 3367 | # coding=utf-8
# Copyright 2020 The Real-World RL Suite 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 appl... | apache-2.0 |
pkreissl/espresso | testsuite/python/lb_thermostat.py | 3 | 2652 | # Copyright (C) 2010-2019 The ESPResSo project
#
# This file is part of ESPResSo.
#
# ESPResSo 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 |
CSD-Public/stonix | src/tests/rules/unit_tests/zzzTestRuleDisableInteractiveStartup.py | 1 | 4581 | #!/usr/bin/env python3
###############################################################################
# #
# Copyright 2019. Triad National Security, LLC. All rights reserved. #
# This program was produced under U.S. Government contrac... | gpl-2.0 |
nexiles/pyshop | pyshop/views/repository.py | 6 | 2042 | # -*- coding: utf-8 -*-
"""
PyShop Release File Download View.
"""
from pyramid.settings import asbool
from pyshop.models import DBSession, Release, ReleaseFile
def show_release_file(root, request):
"""
Download a release file.
Must be used with :func:`pyshop.helpers.download.renderer_factory`
to dow... | bsd-3-clause |
leighpauls/k2cro4 | third_party/python_26/Lib/test/test_cProfile.py | 51 | 7028 | """Test suite for the cProfile module."""
import sys
from test.test_support import run_unittest, TESTFN, unlink
# rip off all interesting stuff from test_profile
import cProfile
from test.test_profile import ProfileTest, regenerate_expected_output
class CProfileTest(ProfileTest):
profilerclass = cProfile.Profile... | bsd-3-clause |
codefisher/web_games | million/views.py | 1 | 5027 | import random
from django.shortcuts import render, get_object_or_404, redirect
from django.urls import reverse
from .models import Game, Question
# Create your views here.
def index(request):
games = Game.objects.all()
return render(request, "million/index.html", {
"games": games,
})
def game(requ... | mit |
espadrine/opera | chromium/src/tools/playback_benchmark/run.py | 51 | 1164 | #!/usr/bin/env python
# Copyright (c) 2011 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.
"""Tests playback.
Prerequisites:
1. OpenSSL library - http://www.openssl.org/
2. Python interface to the OpenSSL library - https:... | bsd-3-clause |
chidea/GoPythonDLLWrapper | bin/lib/test/pydocfodder.py | 203 | 6332 | """Something just to look at via pydoc."""
import types
class A_classic:
"A classic class."
def A_method(self):
"Method defined in A."
def AB_method(self):
"Method defined in A and B."
def AC_method(self):
"Method defined in A and C."
def AD_method(self):
"Method de... | mit |
Zopieux/py3status | py3status/modules/xrandr.py | 8 | 13786 | # -*- coding: utf-8 -*-
"""
Control your screen(s) layout easily.
This modules allows you to handle your screens outputs directly from your bar!
- Detect and propose every possible screen combinations
- Switch between combinations using click events and mouse scroll
- Activate the screen or screen combinat... | bsd-3-clause |
HonzaKral/django | django/contrib/sessions/backends/cached_db.py | 24 | 2865 | """
Cached, database-backed sessions.
"""
import logging
from django.conf import settings
from django.contrib.sessions.backends.db import SessionStore as DBStore
from django.core.cache import caches
from django.core.exceptions import SuspiciousOperation
from django.utils import timezone
from django.utils.encoding imp... | bsd-3-clause |
samba-team/samba | python/samba/tests/smb.py | 2 | 9701 | # -*- coding: utf-8 -*-
# Unix SMB/CIFS implementation. Tests for smb manipulation
# Copyright (C) David Mulder <dmulder@suse.com> 2018
#
# 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 v... | gpl-3.0 |
hellhovnd/tennisranking | tennisranking/project/wsgi.py | 1 | 1449 | # -*- coding:utf-8 -*-
'''
WSGI config for tennisranking project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application ... | bsd-2-clause |
NLHEALTHCARE/PYELT | tests/old/unit_tests_rob/test03r_domain.py | 1 | 1900 | import unittest
from tests.unit_tests_rob import _domain_rob, _domain_rob_unittest
from tests.unit_tests_rob.global_test_suite import get_global_test_pipeline, execute_sql, init_db
class TestCase_Domain(unittest.TestCase):
def setUp(self):
self.pipeline = get_global_test_pipeline()
self.pipe = s... | gpl-3.0 |
loopCM/chromium | chrome/test/functional/special_tabs.py | 59 | 13394 | #!/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.
import logging
import os
import pyauto_functional # Must be imported before pyauto
import pyauto
import test_utils
class Special... | bsd-3-clause |
emory-libraries/ddi-search | ddisearch/ddi/tests.py | 1 | 27334 | # file ddisearch/ddi/tests.py
#
# Copyright 2014 Emory University
#
# 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 appl... | apache-2.0 |
shtouff/django | tests/template_tests/filter_tests/test_rjust.py | 521 | 1030 | from django.template.defaultfilters import rjust
from django.test import SimpleTestCase
from django.utils.safestring import mark_safe
from ..utils import setup
class RjustTests(SimpleTestCase):
@setup({'rjust01': '{% autoescape off %}.{{ a|rjust:"5" }}. .{{ b|rjust:"5" }}.{% endautoescape %}'})
def test_rju... | bsd-3-clause |
jjlee3/openthread | tests/scripts/thread-cert/Cert_6_5_02_ChildResetReattach.py | 5 | 3332 | #!/usr/bin/python
#
# Copyright (c) 2016, The OpenThread Authors.
# 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
# not... | bsd-3-clause |
txenoo/django-radio | tasks/utils.py | 1 | 2468 | import tempfile
from contextlib import contextmanager
from invoke import UnexpectedExit
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
HOME_DIR = os.path.expanduser('~')
def run_ignoring_failure(method, command):
try:
method(command)
except UnexpectedExit:
... | gpl-3.0 |
haowu4682/gem5 | configs/ruby/MI_example.py | 6 | 6628 | # Copyright (c) 2006-2007 The Regents of The University of Michigan
# Copyright (c) 2009 Advanced Micro Devices, 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 co... | bsd-3-clause |
MrLoick/python-for-android | python-build/python-libs/gdata/samples/oauth/2_legged_oauth.py | 128 | 2463 | #!/usr/bin/python
#
# Copyright (C) 2009 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 |
thurt/arangodb | 3rdParty/V8-4.3.61/third_party/python_26/Lib/idlelib/EditorWindow.py | 47 | 58813 | import sys
import os
import re
import imp
from itertools import count
from Tkinter import *
import tkSimpleDialog
import tkMessageBox
from MultiCall import MultiCallCreator
import webbrowser
import idlever
import WindowList
import SearchDialog
import GrepDialog
import ReplaceDialog
import PyParse
from configHandler im... | apache-2.0 |
minhphung171093/GreenERP_V8 | openerp/addons/purchase_double_validation/purchase_double_validation_installer.py | 432 | 2315 | # -*- 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 |
Dawny33/luigi | luigi/contrib/sge.py | 29 | 11318 | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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 |
srsman/odoo | addons/stock/tests/test_resupply.py | 214 | 2457 | # -*- coding: utf-8 -*-
from openerp.addons.stock.tests.common import TestStockCommon
from openerp.tools import mute_logger, float_round
class TestResupply(TestStockCommon):
def setUp(self):
super(TestResupply, self).setUp()
self.Warehouse = self.env['stock.warehouse']
# create 2 WH, BIG ... | agpl-3.0 |
draperjames/qtpandas | qtpandas/ui/fallback/easygui/boxes/updatable_text_box.py | 1 | 8791 | """
.. moduleauthor:: Stephen Raymond Ferg and Robert Lugg (active)
.. default-domain:: py
.. highlight:: python
Version |release|
"""
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
from __future__ import absolute_import
from builtins import str
from bui... | mit |
zploskey/servo | tests/wpt/css-tests/tools/html5lib/html5lib/treewalkers/etree.py | 658 | 4613 | from __future__ import absolute_import, division, unicode_literals
try:
from collections import OrderedDict
except ImportError:
try:
from ordereddict import OrderedDict
except ImportError:
OrderedDict = dict
import gettext
_ = gettext.gettext
import re
from six import text_type
from . im... | mpl-2.0 |
andela-bojengwa/talk | venv/lib/python2.7/site-packages/django/contrib/gis/geos/factory.py | 293 | 1033 | from django.contrib.gis import memoryview
from django.contrib.gis.geos.geometry import GEOSGeometry, wkt_regex, hex_regex
from django.utils import six
def fromfile(file_h):
"""
Given a string file name, returns a GEOSGeometry. The file may contain WKB,
WKT, or HEX.
"""
# If given a file name, get... | mit |
mikedchavez1010/XX-Net | python27/1.0/lib/win32/gevent/lock.py | 22 | 3074 | # Copyright (c) 2009-2012 Denis Bilenko. See LICENSE for details.
"""Locking primitives"""
from gevent.hub import getcurrent
from gevent._semaphore import Semaphore
__all__ = ['Semaphore', 'DummySemaphore', 'BoundedSemaphore', 'RLock']
class DummySemaphore(object):
# XXX what is this used for?
"""A Semapho... | bsd-2-clause |
apophys/err | errbot/storage/base.py | 8 | 2062 | from abc import abstractmethod
from typing import Any, Iterable
class StorageBase(object):
"""
Contract to implemement a storage.
"""
@abstractmethod
def set(self, key: str, value: Any) -> None:
"""
Atomically set the key to the given value.
The caller of set will protect a... | gpl-3.0 |
stansonhealth/ansible-modules-core | packaging/os/package.py | 36 | 2098 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Ansible, 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 o... | gpl-3.0 |
born2net/componentSample | node_modules/browser-sync/node_modules/socket.io/node_modules/engine.io/node_modules/engine.io-parser/node_modules/utf8/tests/generate-test-data.py | 2214 | 1347 | #!/usr/bin/env python
import re
import json
# http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
# http://stackoverflow.com/a/13436167/96656
def unisymbol(codePoint):
if codePoint >= 0x0000 and codePoint <= 0xFFFF:
return unichr(codePoint)
elif codePoint >= 0x010000 and codePoint <= 0x10FFFF:
... | mit |
noba3/KoTos | addons/plugin.video.tvondesizonexl/xoze/snapvideo/Movshare.py | 3 | 1782 | '''
Created on Dec 22, 2011
@author: ajju
'''
from xoze.snapvideo import VideoHost, Video, STREAM_QUAL_SD
from xoze.utils import http
import re
def getVideoHost():
video_host = VideoHost()
video_host.set_icon('http://www.movshare.net/images/logo.png')
video_host.set_name('Movshare')
return video_host
... | gpl-2.0 |
azurewraith/django-storages | storages/backends/gs.py | 19 | 4060 | try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO # noqa
from django.core.exceptions import ImproperlyConfigured
from storages.backends.s3boto import S3BotoStorage, S3BotoStorageFile
from storages.utils import setting
try:
from boto.gs.connection import GSConnection, ... | bsd-3-clause |
MatthieuBizien/scikit-learn | sklearn/manifold/setup.py | 24 | 1279 | import os
from os.path import join
import numpy
from numpy.distutils.misc_util import Configuration
from sklearn._build_utils import get_blas_info
def configuration(parent_package="", top_path=None):
config = Configuration("manifold", parent_package, top_path)
libraries = []
if os.name == 'posix':
... | bsd-3-clause |
Cojacfar/Maker | comm/lib/python2.7/site-packages/django/contrib/messages/tests/test_cookie.py | 37 | 6167 | import json
from django.contrib.messages import constants
from django.contrib.messages.tests.base import BaseTests
from django.contrib.messages.storage.cookie import (CookieStorage,
MessageEncoder, MessageDecoder)
from django.contrib.messages.storage.base import Message
from django.test import TestCase
from django... | gpl-2.0 |
jarus/django-registration | setup.py | 32 | 1911 | from distutils.core import setup
import os
from registration import get_version
# Compile the list of packages available, because distutils doesn't have
# an easy way to do this.
packages, data_files = [], []
root_dir = os.path.dirname(__file__)
if root_dir:
os.chdir(root_dir)
for dirpath, dirnames, filenames i... | bsd-3-clause |
nwjs/chromium.src | third_party/mako/test/test_tgplugin.py | 13 | 1544 | from mako import compat
from mako.ext.turbogears import TGPlugin
from test import template_base
from test import TemplateTest
from test.util import result_lines
tl = TGPlugin(options=dict(directories=[template_base]), extension="html")
class TestTGPlugin(TemplateTest):
def test_basic(self):
t = tl.load_t... | bsd-3-clause |
slabanja/ase | ase/cluster/factory.py | 1 | 6685 | import numpy as np
from ase import Atoms
from ase.data import atomic_numbers
from ase.lattice.spacegroup import Spacegroup
from ase.cluster.base import ClusterBase
from ase.cluster.cluster import Cluster
class ClusterFactory(ClusterBase):
directions = [[1, 0, 0],
[0, 1, 0],
[0,... | gpl-2.0 |
pllim/ginga | ginga/rv/plugins/Preferences.py | 1 | 63607 | # This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
"""
Make changes to channel settings graphically in the UI.
**Plugin Type: Local**
``Preferences`` is a local plugin, which means it is associated with a
channel. An instance can be opened for each channel.
*... | bsd-3-clause |
yavalvas/yav_com | build/matplotlib/doc/mpl_examples/event_handling/viewlims.py | 6 | 2880 | # Creates two identical panels. Zooming in on the right panel will show
# a rectangle in the first panel, denoting the zoomed region.
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.patches import Rectangle
# We just subclass Rectangle so that it can be called with an Axes
# instance, causing the r... | mit |
fabiansinz/attorch | attorch/constraints.py | 3 | 1058 | from torch import nn
def constrain_all(self):
if hasattr(self, 'constrain'):
self.constrain()
for c in self.children():
c.constrain_all()
# extend torch nn.Module to have constrain_all function
nn.Module.constrain_all = constrain_all
# all constrain function takes an optional cache argumen... | mit |
junhuac/MQUIC | depot_tools/external_bin/gsutil/gsutil_4.15/gsutil/third_party/oauth2client/oauth2client/django_orm.py | 70 | 4125 | # Copyright 2014 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | mit |
huntxu/neutron | neutron/tests/functional/scheduler/test_dhcp_agent_scheduler.py | 2 | 26352 | # Copyright (c) 2015 Red Hat, 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 require... | apache-2.0 |
guewen/OpenUpgrade | addons/stock_account/stock.py | 33 | 11505 | # -*- 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 |
petrus-v/odoo | addons/mrp/report/mrp_report.py | 341 | 3839 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... | agpl-3.0 |
TUW-GEO/SMDC-performance | tests/test_test_cases.py | 1 | 11151 | # Copyright (c) 2013,Vienna University of Technology,
# Department of Geodesy and Geoinformation
# 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... | bsd-3-clause |
mnuthan1/workflow | lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/jisfreq.py | 3131 | 47315 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | apache-2.0 |
Tithen-Firion/youtube-dl | youtube_dl/extractor/europa.py | 58 | 3417 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import compat_urlparse
from ..utils import (
int_or_none,
orderedSet,
parse_duration,
qualities,
unified_strdate,
xpath_text
)
class EuropaIE(InfoExtractor):
_VALID_URL = r'https?://ec\... | unlicense |
qedi-r/home-assistant | homeassistant/components/opentherm_gw/sensor.py | 1 | 2793 | """Support for OpenTherm Gateway sensors."""
import logging
from homeassistant.components.sensor import ENTITY_ID_FORMAT
from homeassistant.const import CONF_ID
from homeassistant.core import callback
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from homeassistant.helpers.entity import Entity,... | apache-2.0 |
jobiols/odoomrp-wip | mrp_production_add_middle_stuff/__openerp__.py | 6 | 1542 | # -*- coding: utf-8 -*-
##############################################################################
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the L... | agpl-3.0 |
eyohansa/django | tests/order_with_respect_to/tests.py | 137 | 4286 | from __future__ import unicode_literals
from operator import attrgetter
from django.db import models
from django.test import TestCase
from .models import Answer, Post, Question
class OrderWithRespectToTests(TestCase):
# Hook to allow subclasses to run these tests with alternate models.
Answer = Answer
... | bsd-3-clause |
Moriadry/tensorflow | tensorflow/python/kernel_tests/atrous_conv2d_test.py | 139 | 9770 | # 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 |
ethereum/pyrlp | tests/test_benchmark.py | 1 | 2832 | from itertools import repeat, chain
import sys
import pytest
import rlp
from rlp.sedes import binary, CountableList
from rlp.exceptions import DecodingError, DeserializationError
try:
import pytest_benchmark # noqa: F401
except ImportError:
do_benchmark = False
else:
do_benchmark = True
# speed up setu... | mit |
prakritish/ansible | lib/ansible/modules/cloud/openstack/os_client_config.py | 77 | 2503 | #!/usr/bin/python
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
#
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any late... | gpl-3.0 |
sqall01/lightweight-push | lightweight_push.py | 1 | 11821 | #!/usr/bin/python
# written by sqall
# twitter: https://twitter.com/sqall01
# blog: https://h4des.org
# github: https://github.com/sqall01
#
# Licensed under the MIT License.
import time
import logging
import optparse
import sys
from lightweightpush import LightweightPush, ErrorCodes
################ GLOBAL CONFIGUR... | mit |
thjashin/tensorflow | tensorflow/python/client/client_lib.py | 111 | 1698 | # 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 |
krahman/BuildingMachineLearningSystemsWithPython | ch02/seeds_knn.py | 1 | 1114 | # This code is supporting material for the book
# Building Machine Learning Systems with Python
# by Willi Richert and Luis Pedro Coelho
# published by PACKT Publishing
#
# It is made available under the MIT License
from load import load_dataset
import numpy as np
from knn import learn_model, apply_model, accuracy
fe... | mit |
egoid/baytree | lib/python2.7/site-packages/django/contrib/gis/db/backends/postgis/operations.py | 33 | 18888 | import re
from django.conf import settings
from django.contrib.gis.db.backends.base.operations import \
BaseSpatialOperations
from django.contrib.gis.db.backends.utils import SpatialOperator
from django.contrib.gis.gdal import GDALRaster
from django.contrib.gis.geometry.backend import Geometry
from django.contrib.... | mit |
mrquim/repository.mrquim | repo/script.module.pycryptodome/lib/Crypto/Signature/__init__.py | 19 | 1686 | # ===================================================================
#
# Copyright (c) 2014, Legrandin <helderijs@gmail.com>
# 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. Redistributio... | gpl-2.0 |
jeenalee/servo | tests/wpt/web-platform-tests/tools/pywebsocket/src/test/test_handshake_hybi.py | 413 | 22552 | #!/usr/bin/env python
#
# Copyright 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... | mpl-2.0 |
jwlawson/tensorflow | tensorflow/contrib/linear_optimizer/__init__.py | 158 | 1308 | # 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 |
paynejd/ocl_web | ocl_web/apps/collections/test_forms.py | 7 | 4902 | import mock
from libs.ocl import OclApi
from django.test import TestCase
from requests.exceptions import HTTPError
from forms import CollectionCreateForm, CollectionEditForm, CollectionVersionAddForm
from requests.models import Response
class FakeResponse(object):
""" FakeRequest class """
def __init__(self,d... | mpl-2.0 |
KSanthanam/rethinkdb | external/v8_3.30.33.16/build/gyp/buildbot/buildbot_run.py | 497 | 5998 | #!/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.
"""Argument-less script to select what to run on the buildbots."""
import os
import shutil
import subprocess
import sys
if sys.platform ... | agpl-3.0 |
chris-allan/openmicroscopy | examples/ScreenPlateWell/imagesperwell.py | 4 | 1627 | import sys
import omero
from omero.rtypes import *
from omero_sys_ParametersI import ParametersI # Temporary
c = omero.client();
s = c.createSession();
q = s.getQueryService();
LOAD_WELLS = """select w from Well w join fetch w.wellSamples ws
join fetch ws.image i join fetch i.pixels p where w.plate.id... | gpl-2.0 |
DARKPOP/external_chromium_org | tools/cygprofile/symbolize.py | 43 | 8785 | #!/usr/bin/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.
"""Symbolize log file produced by cypgofile instrumentation.
Given a log file and the binary being profiled (e.g. executable, shared
libra... | bsd-3-clause |
ZachGoldberg/python-quickbooks | quickbooks/objects/tax.py | 3 | 1164 | from six import python_2_unicode_compatible
from .base import QuickbooksBaseObject, Ref, QuickbooksManagedObject
@python_2_unicode_compatible
class TaxLineDetail(QuickbooksBaseObject):
class_dict = {
"TaxRateRef": Ref
}
def __init__(self):
super(TaxLineDetail, self).__init__()
sel... | mit |
premanandchandrasekar/boto | boto/dynamodb/table.py | 31 | 21808 | # Copyright (c) 2012 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2012 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 ... | mit |
minsis/hashgen | libs/hashinglib.py | 1 | 1157 | import hashlib
def read_file(file_path, hashed_file):
with open(file_path, "rb") as open_file:
read_byte = open_file.read(1048576)
while read_byte:
hashed_file.update(read_byte)
read_byte = open_file.read(1048576)
return hashed_file.hexdigest()
def run_hash(file_path, ... | gpl-3.0 |
sYnfo/samba-1 | third_party/waf/wafadmin/Tools/ccroot.py | 12 | 19214 | #!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2005-2008 (ita)
"base for all c/c++ programs and libraries"
import os, sys, re
import TaskGen, Task, Utils, preproc, Logs, Build, Options
from Logs import error, debug, warn
from Utils import md5
from TaskGen import taskgen, after, before, feature
from Constants ... | gpl-3.0 |
geodrinx/gearthview | ext-libs/twisted/runner/test/test_procmon.py | 49 | 16794 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.runner.procmon}.
"""
from twisted.trial import unittest
from twisted.runner.procmon import LoggingProtocol, ProcessMonitor
from twisted.internet.error import (ProcessDone, ProcessTerminated,
... | gpl-3.0 |
strint/tensorflow | tensorflow/python/user_ops/user_ops.py | 123 | 1138 | # 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 |
ujjvala-addsol/addsol_hr | openerp/addons/mrp/product.py | 131 | 4440 | # -*- 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 |
forslund/mycroft-core | mycroft/client/speech/listener.py | 2 | 16442 | # Copyright 2017 Mycroft AI Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | apache-2.0 |
rahlk/CSC579__Computer_Performance_Modeling | simulation/proj2/Utils/SimUtil.py | 1 | 5781 | from __future__ import print_function
from __future__ import division
from RndUtil import Random
from pdb import set_trace
from MscUtil import Params, Customer
rand = Random()
rand.set_seed(seed_val=1729)
"""
Why 1729?
Well, it is a very interesting number.
It is the smallest number expressible as the sum of two posi... | mit |
pitrou/numba | numba/tests/test_closure.py | 4 | 2890 | from __future__ import print_function
import sys
import numba.unittest_support as unittest
from numba import jit, testing
from .support import TestCase
class TestClosure(TestCase):
def run_jit_closure_variable(self, **jitargs):
Y = 10
def add_Y(x):
return x + Y
c_add_Y = j... | bsd-2-clause |
wkschwartz/django | tests/one_to_one/tests.py | 19 | 22386 | from django.db import IntegrityError, connection, transaction
from django.test import TestCase
from .models import (
Bar, Director, Favorites, HiddenPointer, ManualPrimaryKey, MultiModel,
Place, Pointer, RelatedModel, Restaurant, School, Target, ToFieldPointer,
UndergroundBar, Waiter,
)
class OneToOneTes... | bsd-3-clause |
flwh/KK_mt6589_iq451 | prebuilts/python/darwin-x86/2.7.5/lib/python2.7/test/test_copy_reg.py | 129 | 4256 | import copy_reg
import unittest
from test import test_support
from test.pickletester import ExtensionSaver
class C:
pass
class WithoutSlots(object):
pass
class WithWeakref(object):
__slots__ = ('__weakref__',)
class WithPrivate(object):
__slots__ = ('__spam',)
class WithSingleString(object):
... | gpl-2.0 |
ABaldwinHunter/django-clone-classic | django/views/decorators/cache.py | 586 | 2304 | from functools import wraps
from django.middleware.cache import CacheMiddleware
from django.utils.cache import add_never_cache_headers, patch_cache_control
from django.utils.decorators import (
available_attrs, decorator_from_middleware_with_args,
)
def cache_page(*args, **kwargs):
"""
Decorator for view... | bsd-3-clause |
pybquillast/xkAddonIDE | toRecycle/CodigoEncodedURL.py | 1 | 16126 | '''
Created on 13/07/2014
@author: Alex Montes Barrios
'''
import math
class gledajfilmDecrypter:
def __init__(self, param1, param2):
_loc3_ = False;
_loc4_ = True;
self.Rcon = [1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145];
... | gpl-3.0 |
wolffcm/voltdb | tools/getgitinfo.py | 26 | 3846 | #!/usr/bin/python
from subprocess import Popen, PIPE
import sys
import re
def getSvnInfo():
"""Make a build string for svn
Returns a string or None, of not in an svn repository"""
(urlbase, gitHash, dirty) = ("","","")
(svnStatus,stderr) = Popen("svn status", shell=True,stdout=PIPE, stderr=P... | agpl-3.0 |
vv1133/home_web | django/contrib/auth/tokens.py | 296 | 2631 | from datetime import date
from django.conf import settings
from django.utils.http import int_to_base36, base36_to_int
from django.utils.crypto import constant_time_compare, salted_hmac
from django.utils import six
class PasswordResetTokenGenerator(object):
"""
Strategy object used to generate and check tokens... | bsd-3-clause |
accomac/namebench | nb_third_party/dns/rdtypes/IN/PX.py | 248 | 3792 | # Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED ... | apache-2.0 |
markeTIC/OCB | addons/hr_payroll/report/report_payslip.py | 377 | 1982 | #-*- 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
# it... | agpl-3.0 |
sylarcp/anita | venv/lib/python2.7/site-packages/pip/_vendor/requests/api.py | 188 | 5419 | # -*- coding: utf-8 -*-
"""
requests.api
~~~~~~~~~~~~
This module implements the Requests API.
:copyright: (c) 2012 by Kenneth Reitz.
:license: Apache2, see LICENSE for more details.
"""
from . import sessions
def request(method, url, **kwargs):
"""Constructs and sends a :class:`Request <Request>`.
:par... | mit |
eduNEXT/edunext-platform | common/test/acceptance/tests/lms/test_lms_index.py | 4 | 2263 | # -*- coding: utf-8 -*-
"""
End-to-end tests for the LMS Index page (aka, Home page). Note that this is different than
what students see @ edx.org because we redirect requests to a separate web application.
"""
import datetime
from common.test.acceptance.pages.lms.index import IndexPage
from common.test.acceptance.... | agpl-3.0 |
maxsocl/django | django/contrib/flatpages/forms.py | 143 | 2036 | from django import forms
from django.conf import settings
from django.contrib.flatpages.models import FlatPage
from django.utils.translation import ugettext, ugettext_lazy as _
class FlatpageForm(forms.ModelForm):
url = forms.RegexField(label=_("URL"), max_length=100, regex=r'^[-\w/\.~]+$',
help_text=_("E... | bsd-3-clause |
leezu/mxnet | tests/python/gpu/test_device.py | 7 | 2564 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | apache-2.0 |
abhiver222/perkt | face_recognition.py | 2 | 5724 | import cv2
import sys
#import matplotlib.pyplot as pt
import numpy as np
import numpy.linalg as la
import math as mt
#Content of out eigens
<<<<<<< HEAD:face_recognition.py
# there would be five images of each person
# the collumns would be the frob norm of each type
# 4 rows for each person
# 1)Smiling
# 2)Sad
# 3)Se... | mit |
SatoshiNXSimudrone/sl4a-damon-clone | python-build/python-libs/gdata/src/atom/mock_http.py | 278 | 4474 | #!/usr/bin/python
#
# Copyright (C) 2008 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 |
Endika/odoo | addons/website_forum_doc/__openerp__.py | 322 | 1508 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2014-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | agpl-3.0 |
JJediny/python-social-auth | social/apps/pyramid_app/views.py | 75 | 1091 | from pyramid.view import view_config
from social.utils import module_member
from social.actions import do_auth, do_complete, do_disconnect
from social.apps.pyramid_app.utils import psa, login_required
@view_config(route_name='social.auth', request_method='GET')
@psa('social.complete')
def auth(request):
return d... | bsd-3-clause |
envoyproxy/envoy | tools/code_format/header_order.py | 1 | 4254 | #!/usr/bin/env python3
# Enforce header order in a given file. This will only reorder in the first sequence of contiguous
# #include statements, so it will not play well with #ifdef.
#
# This attempts to enforce the guidelines at
# https://google.github.io/styleguide/cppguide.html#Names_and_Order_of_Includes
# with so... | apache-2.0 |
2013Commons/hue | desktop/core/ext-py/python-openid-2.2.5/openid/urinorm.py | 159 | 5230 | import re
# from appendix B of rfc 3986 (http://www.ietf.org/rfc/rfc3986.txt)
uri_pattern = r'^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?'
uri_re = re.compile(uri_pattern)
# gen-delims = ":" / "/" / "?" / "#" / "[" / "]" / "@"
#
# sub-delims = "!" / "$" / "&" / "'" / "(" / ")"
# / "*"... | apache-2.0 |
pokowaka/googletest | test/gtest_shuffle_test.py | 3023 | 12549 | #!/usr/bin/env python
#
# Copyright 2009 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... | bsd-3-clause |
shipci/sympy | sympy/polys/dispersion.py | 20 | 5810 | from __future__ import print_function, division
from sympy.core import S
from sympy.polys import Poly
from sympy.polys.polytools import factor_list
def dispersionset(p, q=None, *gens, **args):
r"""Compute the *dispersion set* of two polynomials.
For two polynomials `f(x)` and `g(x)` with `\deg f > 0`
an... | bsd-3-clause |
cfg2015/EPT-2015-2 | addons/board/__init__.py | 439 | 1144 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2012 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you ca... | agpl-3.0 |
joopert/home-assistant | homeassistant/components/wink/sensor.py | 5 | 3228 | """Support for Wink sensors."""
import logging
import pywink
from homeassistant.const import TEMP_CELSIUS
from . import DOMAIN, WinkDevice
_LOGGER = logging.getLogger(__name__)
SENSOR_TYPES = ["temperature", "humidity", "balance", "proximity"]
def setup_platform(hass, config, add_entities, discovery_info=None):
... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.