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 |
|---|---|---|---|---|---|
django-json-api/django-rest-framework-json-api | example/api/resources/identity.py | 2 | 2016 | from django.contrib.auth import models as auth_models
from django.utils import encoding
from rest_framework import generics, parsers, renderers, serializers, viewsets
from rest_framework.decorators import action
from rest_framework.response import Response
from rest_framework_json_api import utils
from example.api.se... | bsd-2-clause |
linuxmcu/ardupilot | mk/PX4/Tools/genmsg/test/test_genmsg_msg_loader.py | 215 | 29225 | # Software License Agreement (BSD License)
#
# Copyright (c) 2009, Willow Garage, 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-3.0 |
jcoady9/python-for-android | python3-alpha/python3-src/Lib/base64.py | 51 | 14091 | #! /usr/bin/env python3
"""RFC 3548: Base16, Base32, Base64 Data Encodings"""
# Modified 04-Oct-1995 by Jack Jansen to use binascii module
# Modified 30-Dec-2003 by Barry Warsaw to add full RFC 3548 support
# Modified 22-May-2007 by Guido van Rossum to use bytes everywhere
import re
import struct
import binascii
_... | apache-2.0 |
aplanas/rally | tests/unit/verification/test_diff.py | 20 | 4951 | # 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
# d... | apache-2.0 |
NL66278/OCB | addons/l10n_fr_hr_payroll/l10n_fr_hr_payroll.py | 340 | 2012 | #-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 OpenERP SA (<http://openerp.com>). All Rights Reserved
#
# This program is free software: you can redistribute it and/or modify
# it under th... | agpl-3.0 |
fusionbox/mezzanine | mezzanine/pages/migrations/south/0014_auto__add_field_page_created__add_field_page_updated.py | 8 | 6156 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Page.created'
db.add_column(u'pages_page', 'created',
self.gf('django.... | bsd-2-clause |
vicky2135/lucious | oscar/lib/python2.7/site-packages/pip/_vendor/cachecontrol/serialize.py | 326 | 6536 | import base64
import io
import json
import zlib
from pip._vendor.requests.structures import CaseInsensitiveDict
from .compat import HTTPResponse, pickle, text_type
def _b64_encode_bytes(b):
return base64.b64encode(b).decode("ascii")
def _b64_encode_str(s):
return _b64_encode_bytes(s.encode("utf8"))
def ... | bsd-3-clause |
clebergnu/autotest | client/tests/aio_dio_bugs/aio_dio_bugs.py | 6 | 1345 | import os
from autotest_lib.client.bin import test, utils
# tests is a simple array of "cmd" "arguments"
tests = [["aio-dio-invalidate-failure", "poo"],
["aio-dio-subblock-eof-read", "eoftest"],
["aio-free-ring-with-bogus-nr-pages", ""],
["aio-io-setup-with-nonwritable-context-pointer", ""]... | gpl-2.0 |
nurmd2/nurmd | addons/google_spreadsheet/google_spreadsheet.py | 41 | 4717 | # Part of Odoo. See LICENSE file for full copyright and licensing details.
import cgi
import json
import logging
from lxml import etree
import re
import werkzeug.urls
import urllib2
from openerp.osv import osv
from openerp.addons.google_account import TIMEOUT
_logger = logging.getLogger(__name__)
class config(osv.o... | gpl-3.0 |
Fireblend/chromium-crosswalk | tools/telemetry/telemetry/util/find_dependencies.py | 5 | 9310 | # Copyright 2014 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 fnmatch
import imp
import logging
import modulefinder
import optparse
import os
import sys
import zipfile
from telemetry import benchmark
from teleme... | bsd-3-clause |
DrMeers/django | tests/order_with_respect_to/tests.py | 21 | 2849 | from __future__ import unicode_literals
from operator import attrgetter
from django.test import TestCase
from .models import Post, Question, Answer
class OrderWithRespectToTests(TestCase):
def test_basic(self):
q1 = Question.objects.create(text="Which Beatle starts with the letter 'R'?")
q2 = Q... | bsd-3-clause |
hackerbot/DjangoDev | tests/postgres_tests/test_hstore.py | 5 | 7364 | import json
from django.core import exceptions, serializers
from . import PostgresSQLTestCase
from .models import HStoreModel
try:
from django.contrib.postgres import forms
from django.contrib.postgres.fields import HStoreField
from django.contrib.postgres.validators import KeysValidator
except ImportErr... | bsd-3-clause |
decebel/dataAtom_alpha | bin/plug/py/external/pattern/vector/svm/svm.py | 1 | 9178 | #!/usr/bin/env python
from ctypes import *
from ctypes.util import find_library
import sys
import os
# For unix the prefix 'lib' is not considered.
if find_library('svm'):
libsvm = CDLL(find_library('svm'))
elif find_library('libsvm'):
libsvm = CDLL(find_library('libsvm'))
else:
for i, binary in enumerate((
# I... | apache-2.0 |
Tokyo-Buffalo/tokyosouth | env/lib/python3.6/site-packages/pyasn1_modules/rfc2459.py | 72 | 44828 | #
# X.509 message syntax
#
# ASN.1 source from:
# http://www.trl.ibm.com/projects/xml/xss4j/data/asn1/grammars/x509.asn
# http://www.ietf.org/rfc/rfc2459.txt
#
# Sample captures from:
# http://wiki.wireshark.org/SampleCaptures/
#
from pyasn1.type import tag,namedtype,namedval,univ,constraint,char,useful
MAX = 64 # XX... | mit |
anorfleet/turntable | test/lib/python2.7/site-packages/scipy/interpolate/tests/test_fitpack2.py | 7 | 18719 | #!/usr/bin/env python
# Created by Pearu Peterson, June 2003
from __future__ import division, print_function, absolute_import
import warnings
import numpy as np
from numpy.testing import (assert_equal, assert_almost_equal, assert_array_equal,
assert_array_almost_equal, assert_allclose, assert_raises, TestCase... | mit |
B-MOOC/edx-platform | cms/djangoapps/contentstore/views/certificates.py | 3 | 19144 | """
Certificates Data Model:
course.certificates: {
'certificates': [
{
'version': 1, // data contract version
'id': 12345, // autogenerated identifier
'name': 'Certificate 1',
'description': 'Certificate 1 Description',
'course_title': 'course ti... | agpl-3.0 |
audiolion/django-shibauth-rit | tests/test_backends.py | 1 | 6303 | # -*- coding: utf-8 -*-
# Third Party Library Imports
from django.conf import settings
from django.contrib import auth
from django.contrib.auth.models import User
from django.test import RequestFactory, TestCase, override_settings
# First Party Library Imports
from shibauth_rit.compat import reverse
from shibauth_rit... | mit |
bd339/servo | tests/dromaeo/run_dromaeo.py | 111 | 2507 | #!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import os
import subprocess
import sys
import BaseHTTPServer
import SimpleHTTPServer
import urlpa... | mpl-2.0 |
charlesccychen/beam | sdks/python/apache_beam/utils/retry_test.py | 5 | 7723 | #
# 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 |
vebin/Wox | PythonHome/Lib/site-packages/setuptools/command/bdist_egg.py | 155 | 17606 | """setuptools.command.bdist_egg
Build .egg distributions"""
# This module should be kept compatible with Python 2.3
from distutils.errors import DistutilsSetupError
from distutils.dir_util import remove_tree, mkpath
from distutils import log
from types import CodeType
import sys
import os
import marshal
import textwr... | mit |
40223202/test | static/Brython3.1.3-20150514-095342/Lib/textwrap.py | 745 | 16488 | """Text wrapping and filling.
"""
# Copyright (C) 1999-2001 Gregory P. Ward.
# Copyright (C) 2002, 2003 Python Software Foundation.
# Written by Greg Ward <gward@python.net>
import re
__all__ = ['TextWrapper', 'wrap', 'fill', 'dedent', 'indent']
# Hardcode the recognized whitespace characters to the US-ASCII
# whit... | agpl-3.0 |
ESS-LLP/erpnext | erpnext/healthcare/doctype/fee_validity/fee_validity.py | 13 | 1166 | # -*- coding: utf-8 -*-
# Copyright (c) 2015, ESS LLP and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
from frappe.model.document import Document
import frappe
from frappe.utils import getdate
import datetime
class FeeValidity(Document):
pass
def update_fee_... | gpl-3.0 |
anyonedev/anyonedev-monitor-agent | monitor/metrics/Cpu.py | 1 | 1893 | '''
Created on 2014-11-12
@author: hongye
'''
import psutil
from core import regist_monitor_source
from core.MetricValue import MultiMetricValue, SingleMetricValue
from core.MonitorSource import SampleMonitorSource
class CpuTimesMonitorSource(SampleMonitorSource):
def sample(self, parms):
cpu = psutil.c... | gpl-2.0 |
lzw120/django | build/lib/django/utils/datastructures.py | 12 | 16025 | import copy
from types import GeneratorType
class MergeDict(object):
"""
A simple class for creating new "virtual" dictionaries that actually look
up values in more than one dictionary, passed in the constructor.
If a key appears in more than one of the given dictionaries, only the
first occurrenc... | bsd-3-clause |
windyuuy/opera | chromium/src/third_party/python_26/Lib/test/test_xrange.py | 53 | 2512 | # Python test set -- built-in functions
import test.test_support, unittest
import sys
import pickle
import warnings
warnings.filterwarnings("ignore", "integer argument expected",
DeprecationWarning, "unittest")
class XrangeTest(unittest.TestCase):
def test_xrange(self):
self.asser... | bsd-3-clause |
jart/tensorflow | tensorflow/contrib/kfac/examples/tests/convnet_test.py | 14 | 6264 | # Copyright 2017 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 |
Orochimarufan/youtube-dl | youtube_dl/extractor/theintercept.py | 71 | 1801 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import compat_str
from ..utils import (
parse_iso8601,
int_or_none,
ExtractorError,
)
class TheInterceptIE(InfoExtractor):
_VALID_URL = r'https?://theintercept\.com/fieldofvision/(?P<id>[^/?#]+)'
... | unlicense |
telefonicaid/fiware-pep-steelskin | test/acceptance/integration/headers/steps.py | 32 | 1455 | # -*- coding: utf-8 -*-
"""
Copyright 2014 Telefonica Investigación y Desarrollo, S.A.U
This file is part of fiware-pep-steelskin
fiware-pep-steelskin 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, eithe... | agpl-3.0 |
Anonymous-X6/django | django/template/loaders/filesystem.py | 418 | 2158 | """
Wrapper for loading templates from the filesystem.
"""
import errno
import io
import warnings
from django.core.exceptions import SuspiciousFileOperation
from django.template import Origin, TemplateDoesNotExist
from django.utils._os import safe_join
from django.utils.deprecation import RemovedInDjango20Warning
fr... | bsd-3-clause |
proversity-org/edx-platform | openedx/core/lib/edx_api_utils.py | 18 | 3689 | """Helper functions to get data from APIs"""
from __future__ import unicode_literals
import logging
from django.core.cache import cache
from openedx.core.lib.cache_utils import zpickle, zunpickle
log = logging.getLogger(__name__)
def get_fields(fields, response):
"""Extracts desired fields from the API respon... | agpl-3.0 |
kgullikson88/General | Feiden.py | 2 | 4640 | from __future__ import division, print_function
import os
import os.path
import pickle
import numpy as np
from pkg_resources import resource_filename
from scipy.interpolate import LinearNDInterpolator as interpnd
try:
import pandas as pd
except ImportError:
pd = None
from isochrones.isochrone import Isochro... | gpl-3.0 |
cmcantalupo/geopm | integration/experiment/power_sweep/gen_plot_power_limit.py | 1 | 5090 | #!/usr/bin/env python
#
# Copyright (c) 2015 - 2021, 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 source code must retain the above copyright
# notice, thi... | bsd-3-clause |
mkwm/casia | casia/cas/urls.py | 1 | 1180 | # -*- coding: utf-8 -*-
# This file is part of Casia - CAS server based on Django
# Copyright (C) 2013 Mateusz Małek
# Casia 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 |
LingxiaoJIA/gem5 | configs/common/Caches.py | 20 | 3170 | # Copyright (c) 2012 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the functionality ... | bsd-3-clause |
jagguli/intellij-community | python/lib/Lib/site-packages/django/contrib/gis/geos/prototypes/prepared.py | 623 | 1032 | from ctypes import c_char
from django.contrib.gis.geos.libgeos import GEOM_PTR, PREPGEOM_PTR
from django.contrib.gis.geos.prototypes.errcheck import check_predicate
from django.contrib.gis.geos.prototypes.threadsafe import GEOSFunc
# Prepared geometry constructor and destructors.
geos_prepare = GEOSFunc('GEOSPrepare')... | apache-2.0 |
enStratus/unix-agent | extensions/docker/dcmdocker/start_container.py | 3 | 2556 | #
# Copyright (C) 2014 Dell, 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 wri... | apache-2.0 |
MTASZTAKI/ApertusVR | plugins/languageAPI/jsAPI/3rdParty/nodejs/10.1.0/source/deps/v8/third_party/jinja2/constants.py | 1169 | 1626 | # -*- coding: utf-8 -*-
"""
jinja.constants
~~~~~~~~~~~~~~~
Various constants.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
#: list of lorem ipsum words used by the lipsum() helper function
LOREM_IPSUM_WORDS = u'''\
a ac accumsan ad adipiscing aenean a... | mit |
callidus/playbot | playbot/bot.py | 1 | 3336 |
from __future__ import absolute_import
from __future__ import print_function
import irc.bot
import logging
import re
import ssl
import time
logger = logging.getLogger(__name__)
class PlayBot(irc.bot.SingleServerIRCBot):
def __init__(self, channels, nickname, password, server, port=6667,
force... | mit |
beni55/olympia | apps/api/views.py | 13 | 18404 | """
API views
"""
import hashlib
import itertools
import json
import random
import urllib
from datetime import date, timedelta
from django.core.cache import cache
from django.http import HttpResponse, HttpResponsePermanentRedirect
from django.shortcuts import render
from django.template.context import get_standard_pro... | bsd-3-clause |
fgesora/odoo | addons/l10n_co/__openerp__.py | 256 | 1794 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) David Arnold (devCO).
# Author David Arnold (devCO), dar@devco.co
# Co-Authors Juan Pablo Aries (devCO), jpa@devco.co
# Hector Ivan ... | agpl-3.0 |
xuyuan/openni.pyx | demo.py | 1 | 1589 | #!/usr/bin/env python
from openni import xn
import cv
cvimage = cv.CreateImageHeader( (640, 480), cv.IPL_DEPTH_8U, 3 )
cvdepth = cv.CreateImageHeader( (640, 480), cv.IPL_DEPTH_16U, 1 )
cvlabel = cv.CreateImageHeader( (640, 480), cv.IPL_DEPTH_16U, 1 )
# v1 = xn.Version(0, 1, 1, 1)
# v2 = xn.Version(0, 1, 1, 1)
# pri... | mit |
rcbops/python-quantumclient-buildpackage | quantum/client/cli_lib.py | 2 | 12654 | #!/usr/bin/env python
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 Nicira Networks, Inc.
# Copyright 2011 Citrix Systems
#
# 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... | apache-2.0 |
zhjunlang/kbengine | kbe/src/lib/python/Doc/includes/mp_workers.py | 52 | 1586 | import time
import random
from multiprocessing import Process, Queue, current_process, freeze_support
#
# Function run by worker processes
#
def worker(input, output):
for func, args in iter(input.get, 'STOP'):
result = calculate(func, args)
output.put(result)
#
# Function used to calculate resu... | lgpl-3.0 |
ingadhoc/odoo | addons/base_gengo/wizard/__init__.py | 434 | 1077 | # -*- 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 |
MarkTheF4rth/youtube-dl | youtube_dl/extractor/freesound.py | 192 | 1392 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
class FreesoundIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?freesound\.org/people/([^/]+)/sounds/(?P<id>[^/]+)'
_TEST = {
'url': 'http://www.freesound.org/people/miklovan/sounds/194503/',
'md5': '1228... | unlicense |
girving/tensorflow | tensorflow/python/ops/inplace_ops.py | 36 | 6296 | # 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 |
fevxie/connector-magento | __unported__/magentoerpconnect_options_active/__openerp__.py | 11 | 1420 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Markus Schneider
# Copyright 2014 initOS GmbH & Co. KG
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
... | agpl-3.0 |
candy7393/VTK | ThirdParty/Twisted/twisted/python/roots.py | 68 | 7311 | # -*- test-case-name: twisted.test.test_roots -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Twisted Python Roots: an abstract hierarchy representation for Twisted.
Maintainer: Glyph Lefkowitz
"""
# System imports
import types
from twisted.python import reflect
class NotSupportedErr... | bsd-3-clause |
amenonsen/ansible | lib/ansible/modules/cloud/openstack/os_coe_cluster.py | 31 | 8797 | #!/usr/bin/python
# Copyright (c) 2018 Catalyst IT Ltd.
# 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',
'status': ['pr... | gpl-3.0 |
laijingtao/landlab | landlab/components/flexure/funcs.py | 6 | 7655 | #!/usr/bin/env python
import numpy as np
import scipy.special
from multiprocessing import Pool
_POISSON = .25
_N_PROCS = 4
def get_flexure_parameter(h, E, n_dim, gamma_mantle=33000.):
"""
Calculate the flexure parameter based on some physical constants. *h* is
the Effective elastic thickness of Earth's... | mit |
numenta-ci/nupic | scripts/run_opf_experiment.py | 37 | 1210 | #!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions ... | agpl-3.0 |
mateon1/servo | tests/wpt/css-tests/tools/pywebsocket/src/test/client_for_testing.py | 451 | 39706 | #!/usr/bin/env python
#
# Copyright 2012, 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 |
jolevq/odoopub | addons/account/wizard/account_period_close.py | 341 | 2646 | # -*- 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 |
Jackysonglanlan/devops | IDEs/sublime/shared-pkgs/Packages/pygments/all/pygments/lexers/ml.py | 47 | 27891 | # -*- coding: utf-8 -*-
"""
pygments.lexers.ml
~~~~~~~~~~~~~~~~~~
Lexers for ML family languages.
:copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, include, bygroups, default, words
from... | mit |
hanlind/nova | nova/policies/evacuate.py | 5 | 1069 | # Copyright 2016 Cloudbase Solutions Srl
# 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 r... | apache-2.0 |
GirlsCodePy/girlscode-coursebuilder | modules/dashboard/dashboard_tests.py | 3 | 34294 | # 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 ... | gpl-3.0 |
vitorio/hold-the-line | holdtheline.py | 1 | 7034 | ## hold-the-line - Simple Python voicemail and SMS/MMS receiver
## for holding onto phone numbers in Twilio
##
## Written in 2015 and 2016 and 2017 by Vitorio Miliano <http://vitor.io/>
##
## To the extent possible under law, the author has dedicated all
## copyright and related and neighboring rights... | cc0-1.0 |
nburn42/tensorflow | tensorflow/contrib/legacy_seq2seq/python/ops/seq2seq.py | 32 | 56938 | # 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 |
Fale/ansible | lib/ansible/module_utils/connection.py | 35 | 8113 | #
# This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete ... | gpl-3.0 |
alvin319/CarnotKE | jyhton/lib-python/2.7/os.py | 147 | 25769 | r"""OS routines for Mac, NT, or Posix depending on what system we're on.
This exports:
- all functions from posix, nt, os2, or ce, e.g. unlink, stat, etc.
- os.path is one of the modules posixpath, or ntpath
- os.name is 'posix', 'nt', 'os2', 'ce' or 'riscos'
- os.curdir is a string representing the current di... | apache-2.0 |
CryptArc/bitcoinxt | contrib/devtools/symbol-check.py | 172 | 4344 | #!/usr/bin/python
# Copyright (c) 2014 Wladimir J. van der Laan
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
A script to check that the (Linux) executables produced by gitian only contain
allowed gcc, glibc and libstdc++ ver... | mit |
rynomad/CCNx-Federated-Wiki-Prototype | server/express/node_modules/npm/node_modules/node-gyp/gyp/test/cflags/gyptest-cflags.py | 74 | 1559 | #!/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... | mit |
TrondKjeldas/knxmonitor | knxmonitor/Knx/KnxParser.py | 1 | 5381 | from time import time, mktime, strptime
try:
import Gnuplot
except:
print "Warning: gnuplot not available"
from knxmonitor.Knx.KnxPdu import KnxPdu
from knxmonitor.Knx.KnxAddressStream import KnxAddressStream
from knxmonitor.Knx.KnxAddressCollection import KnxAddressCollection
verbose = True
def printVerbose(str... | gpl-2.0 |
rrrene/django | tests/forms_tests/widget_tests/test_nullbooleanselect.py | 179 | 2142 | from django.forms import NullBooleanSelect
from django.test import override_settings
from django.utils import translation
from .base import WidgetTest
class NullBooleanSelectTest(WidgetTest):
widget = NullBooleanSelect()
def test_render_true(self):
self.check_html(self.widget, 'is_cool', True, html=... | bsd-3-clause |
ValvePython/steam | steam/protobufs/steammessages_credentials_pb2.py | 1 | 50779 | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: steammessages_credentials.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 g... | mit |
palerdot/calibre | src/calibre/gui2/store/stores/waterstones_uk_plugin.py | 7 | 3469 | # -*- coding: utf-8 -*-
from __future__ import (unicode_literals, division, absolute_import, print_function)
store_version = 2 # Needed for dynamic plugin loading
__license__ = 'GPL 3'
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
__docformat__ = 'restructuredtext en'
import urllib2
from contextlib im... | gpl-3.0 |
mikkokeskinen/tunnistamo | auth_backends/adfs/helsinki_library_asko.py | 1 | 3123 | import uuid
from auth_backends.adfs.base import BaseADFS
class HelsinkiLibraryAskoADFS(BaseADFS):
"""Helsinki Libraries' ASKO ADFS authentication backend"""
name = 'helsinki_library_asko_adfs'
AUTHORIZATION_URL = 'https://askofs.lib.hel.fi/adfs/oauth2/authorize'
ACCESS_TOKEN_URL = 'https://askofs.lib... | mit |
n0max/servo | tests/wpt/css-tests/tools/pywebsocket/src/test/mock.py | 465 | 6715 | # 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 of conditions and the f... | mpl-2.0 |
dennisobrien/bokeh | bokeh/models/tests/test_tools.py | 3 | 1491 | from __future__ import absolute_import
import mock
from bokeh.core.validation import check_integrity
from bokeh.models.layouts import LayoutDOM
from bokeh.models.tools import Toolbar, ToolbarBox
# TODO (bev) validate entire list of props
def test_Toolbar():
tb = Toolbar()
assert tb.active_drag == 'auto'
... | bsd-3-clause |
mdanielwork/intellij-community | python/helpers/pydev/tests_pydevd_mainloop/gui-qt.py | 100 | 1074 | #!/usr/bin/env python
"""Simple Qt4 example to manually test event loop integration.
To run this:
1) Enable the PyDev GUI event loop integration for qt
2) do an execfile on this script
3) ensure you have a working GUI simultaneously with an
interactive console
Ref: Modified from http://zetcode.com/tutorials/pyqt4/... | apache-2.0 |
espadrine/opera | chromium/src/tools/diagnose-me.py | 50 | 3016 | #!/usr/bin/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.
"""Diagnose some common system configuration problems on Linux, and
suggest fixes."""
import os
import subprocess
import sys
all_chec... | bsd-3-clause |
SebastianoF/LabelsManager | tests/tools/test_aux_methods_utils_rotations.py | 1 | 25701 | import os
import numpy as np
from numpy.testing import assert_array_equal, assert_raises, assert_array_almost_equal
from nilabels.tools.aux_methods.utils_rotations import get_small_orthogonal_rotation, get_roto_translation_matrix, \
basic_90_rot_ax, axial_90_rotations, flip_data, symmetrise_data, reorient_b_vect, ... | mit |
andmos/ansible | test/units/modules/source_control/gitlab.py | 21 | 29411 | # -*- coding: utf-8 -*-
# Copyright: (c) 2019, Guillaume Martinez (lunik@tiwabbit.fr)
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import
import sys
from httmock import response # noqa
from httmock import urlmatch # noqa
from units.c... | gpl-3.0 |
n0m4dz/odoo | addons/account/wizard/account_period_close.py | 341 | 2646 | # -*- 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 |
vinicius-carvalho/fatec-prog-script | backend/appengine/routes/comportamentos/rest.py | 1 | 1233 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from gaebusiness.business import CommandExecutionException
from tekton.gae.middleware.json_middleware import JsonResponse
from comportamento_app import facade
def index():
cmd = facade.list_comportamentos_cmd()
comportamento_list... | mit |
mexeniz/django-oscar | src/oscar/apps/dashboard/shipping/views.py | 23 | 5163 | from django import shortcuts
from django.contrib import messages
from django.core.urlresolvers import reverse
from django.template.loader import render_to_string
from django.views import generic
from oscar.core.loading import get_model, get_classes
WeightBandForm, WeightBasedForm = get_classes(
'dashboard.shippin... | bsd-3-clause |
olesk75/SparkLED | Tools/logserver.py | 1 | 3236 | #!/usr/bin/env python3
""" Python3 program which listens to sensor information over the network as port 2208.
The purpose of this server is to collect data and serve queries from other clients.
In the SuperLED project, this acts as a "syslog" server, listening for and recording
data from sensors (access cont... | gpl-3.0 |
zrax/moul-scripts | Python/system/encodings/cp1026.py | 593 | 13369 | """ Python Character Mapping Codec cp1026 generated from 'MAPPINGS/VENDORS/MICSFT/EBCDIC/CP1026.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,inp... | gpl-3.0 |
eramirem/astroML | book_figures/chapter8/fig_huber_loss.py | 3 | 2933 | """
Huber Loss Function
-------------------
Figure 8.8
An example of fitting a simple linear model to data which includes outliers
(data is from table 1 of Hogg et al 2010). A comparison of linear regression
using the squared-loss function (equivalent to ordinary least-squares
regression) and the Huber loss function, ... | bsd-2-clause |
yvaucher/stock-logistics-transport | transport_information/__openerp__.py | 3 | 1365 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright 2014 Camptocamp SA
# Author: Leonardo Pistone
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# pu... | agpl-3.0 |
pkainz/pylearn2 | pylearn2/models/model.py | 44 | 24339 | """Generic "model" class."""
__authors__ = "Ian Goodfellow"
__copyright__ = "Copyright 2010-2012, Universite de Montreal"
__credits__ = ["Ian Goodfellow"]
__license__ = "3-clause BSD"
__maintainer__ = "LISA Lab"
__email__ = "pylearn-dev@googlegroups"
from collections import defaultdict
from theano.compat.six.moves imp... | bsd-3-clause |
shakamunyi/tensorflow | tensorflow/contrib/keras/api/keras/losses/__init__.py | 75 | 2203 | # 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 |
simone-f/qat_script | tools/data/Osmose/Osmose_prefs_gui.py | 1 | 2151 | #! /usr/bin/env jython
# -*- coding: utf-8 -*-
"""Preferences for Osmose tool
"""
from javax.swing import JPanel, JLabel, JTextField, JComboBox
from java.awt import GridLayout
from java.lang import Integer, NumberFormatException
class PrefsPanel(JPanel):
"""JPanle with gui for tool preferences
"""
def _... | gpl-2.0 |
guillermo-sentinella/jaeger-client-python | jaeger_client/local_agent_net.py | 1 | 3685 | # Copyright (c) 2016 Uber Technologies, 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, publ... | mit |
Tejas-Khot/deep-learning | test/nnet/fflayers.py | 7 | 2390 | """Feed-forward Layers (not includeing ConvNet Layer)
This module contains feedforward layers for
+ Identity layer
+ Tanh layer
+ Sigmoid layer
+ ReLU layer
+ Softmax layer
"""
import theano.tensor as T;
import telaugesa.nnfuns as nnfuns;
from telaugesa.layer import Layer;
class IdentityLayer(Layer):
"""Ident... | gpl-2.0 |
eayunstack/python-cinderclient | cinderclient/extension.py | 10 | 1409 | # Copyright (c) 2011 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | apache-2.0 |
sai16vicky/deepdive | examples/test/test_smoke.py | 17 | 1907 | import os
import getpass
import psycopg2
from sets import Set
# Error threshold
eps = 0.5
# Get the environment variables
DBNAME = os.environ['DBNAME']
PGUSER = os.environ['PGUSER']
PGPASSWORD = os.environ['PGPASSWORD']
PGHOST = os.environ['PGHOST']
PGPORT = os.environ['PGPORT']
# Stanfard status
std = dict([])
st... | apache-2.0 |
atosatto/ansible | lib/ansible/modules/cloud/azure/azure_rm_virtualmachineimage_facts.py | 68 | 7702 | #!/usr/bin/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 Soft... | gpl-3.0 |
a-doumoulakis/tensorflow | tensorflow/contrib/layers/python/layers/regularizers_test.py | 73 | 6622 | # 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 |
MIGreenberg/NFLPredict | scripts/correlation.py | 1 | 1485 | import nflgame
import math
import operator
from classes.league import *
from scipy.stats.stats import pearsonr
def statistical_correlation(statistics, performances):
stats_a = []
stats_b = []
for performance in performances:
stats_a.append(performance.statistics[statistics[0]])
stats_b.append(performance.statis... | mit |
sarvex/depot-tools | third_party/boto/services/bs.py | 115 | 8115 | #!/usr/bin/env python
# Copyright (c) 2006-2008 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 rig... | bsd-3-clause |
marco-lancini/Showcase | django/contrib/localflavor/jp/forms.py | 333 | 1211 | """
JP-specific Form helpers
"""
from django.forms import ValidationError
from django.utils.translation import ugettext_lazy as _
from django.forms.fields import RegexField, Select
class JPPostalCodeField(RegexField):
"""
A form field that validates its input is a Japanese postcode.
Accepts 7 digits, wit... | mit |
Athrun29/horizon | openstack_dashboard/contrib/trove/content/database_backups/views.py | 19 | 4383 | # Copyright 2013 Rackspace Hosting
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | apache-2.0 |
JioCloud/horizon | openstack_dashboard/dashboards/admin/flavors/panel.py | 46 | 1059 | # Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the... | apache-2.0 |
croxis/SpaceDrive | spacedrive/renderpipeline/rpcore/render_target.py | 1 | 14841 | """
RenderTarget
Copyright (c) 2015 tobspr <tobias.springer1@gmail.com>
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 u... | mit |
catapult-project/catapult | third_party/gsutil/gslib/__main__.py | 4 | 33440 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2013 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-... | bsd-3-clause |
hovsepm/AutoRest | src/generator/AutoRest.Python.Azure.Tests/Expected/AcceptanceTests/StorageManagementClient/storagemanagementclient/models/usage_name.py | 16 | 1055 | # 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 |
partofthething/home-assistant | homeassistant/components/freebox/device_tracker.py | 15 | 4452 | """Support for Freebox devices (Freebox v6 and Freebox mini 4K)."""
from datetime import datetime
from typing import Dict
from homeassistant.components.device_tracker import SOURCE_TYPE_ROUTER
from homeassistant.components.device_tracker.config_entry import ScannerEntity
from homeassistant.config_entries import Config... | mit |
Lilykos/invenio | invenio/ext/elasticsearch/tasks.py | 13 | 1428 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2014 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) any later... | gpl-2.0 |
jaywreddy/django | django/contrib/gis/db/backends/spatialite/operations.py | 257 | 11441 | """
SQL functions reference lists:
http://www.gaia-gis.it/spatialite-2.4.0/spatialite-sql-2.4.html
http://www.gaia-gis.it/spatialite-3.0.0-BETA/spatialite-sql-3.0.0.html
http://www.gaia-gis.it/gaia-sins/spatialite-sql-4.2.1.html
"""
import re
import sys
from django.contrib.gis.db.backends.base.operations import \
... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.