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 |
|---|---|---|---|---|---|
gunan/tensorflow | tensorflow/python/ops/linalg/adjoint_registrations.py | 25 | 5320 | # Copyright 2019 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 |
DiegoTaka/ellipsoid-magnetic | code/ellipsoid_triaxial2.py | 1 | 23755 | """
The potential fields of a triaxial ellipsoid.
"""
from __future__ import division
import numpy as np
from scipy import linalg
from ..constants import SI2MGAL, G, CM, T2NT, SI2EOTVOS, PERM_FREE_SPACE
from .. import utils
import scipy.special
def bx_c(xp,yp,zp,inten,inc,dec,ellipsoids):
'''
Calculates the... | bsd-3-clause |
martinlschumann/mal | rpython/step6_file.py | 47 | 4495 | import sys, traceback
import mal_readline
import mal_types as types
from mal_types import (MalSym, MalInt, MalStr,
nil, true, false, _symbol, _keywordu,
MalList, _list, MalVector, MalHashMap, MalFunc)
import reader, printer
from env import Env
import core
# read
def READ(s... | mpl-2.0 |
fangxingli/hue | desktop/core/ext-py/Django-1.6.10/django/contrib/auth/management/commands/createsuperuser.py | 130 | 6690 | """
Management utility to create superusers.
"""
from __future__ import unicode_literals
import getpass
import sys
from optparse import make_option
from django.contrib.auth import get_user_model
from django.contrib.auth.management import get_default_username
from django.core import exceptions
from django.core.managem... | apache-2.0 |
gujiawen/flask_web | venv/lib/python2.7/site-packages/wheel/signatures/keys.py | 471 | 3320 | """Store and retrieve wheel signing / verifying keys.
Given a scope (a package name, + meaning "all packages", or - meaning
"no packages"), return a list of verifying keys that are trusted for that
scope.
Given a package name, return a list of (scope, key) suggested keys to sign
that package (only the verifying key... | mit |
rismalrv/edx-platform | common/lib/xmodule/xmodule/exceptions.py | 171 | 1339 | class InvalidDefinitionError(Exception):
pass
class NotFoundError(Exception):
pass
class ProcessingError(Exception):
'''
An error occurred while processing a request to the XModule.
For example: if an exception occurs while checking a capa problem.
'''
pass
class InvalidVersionError(Ex... | agpl-3.0 |
wroberts/cribbage | cribbage/simpleplayer.py | 1 | 4882 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
simpleplayer.py
(c) Will Roberts 13 January, 2017
Simple AI cribbage player. This player uses Monte Carlo simulation to
try to pick the best cards to discard and play.
'''
from __future__ import absolute_import, print_function
import random
import numpy as np
from ... | mit |
stevenmjo/cloud-custodian | tests/test_elasticache.py | 2 | 8513 | # Copyright 2016 Capital One Services, LLC
#
# 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... | apache-2.0 |
KyleJamesWalker/ansible | lib/ansible/modules/packaging/language/bundler.py | 70 | 7587 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Tim Hoiberg <tim.hoiberg@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 L... | gpl-3.0 |
emersonsoftware/ansiblefork | lib/ansible/plugins/terminal/nxos.py | 22 | 2025 | #
# (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 d... | gpl-3.0 |
isvilen/otp | lib/asn1/test/asn1_SUITE_data/Constraints.py | 92 | 4620 | Constraints DEFINITIONS ::=
BEGIN
-- Single Value
SingleValue ::= INTEGER (1)
SingleValue2 ::= INTEGER (1..20)
predefined INTEGER ::= 1
SingleValue3 ::= INTEGER (predefined | 5 | 10)
Range2to19 ::= INTEGER (1<..<20)
Range10to20 ::= INTEGER (10..20)
ContainedSubtype ::= INTEGER (INCLUDES Range10to20)
-- Some ranges for... | apache-2.0 |
bootandy/sqlalchemy | test/orm/test_versioning.py | 21 | 31479 | import datetime
import sqlalchemy as sa
from sqlalchemy.testing import engines, config
from sqlalchemy import testing
from sqlalchemy.testing.mock import patch
from sqlalchemy import (
Integer, String, Date, ForeignKey, orm, exc, select, TypeDecorator)
from sqlalchemy.testing.schema import Table, Column
from sqlalc... | mit |
MattsFleaMarket/python-for-android | python-modules/twisted/twisted/python/rebuild.py | 49 | 8313 | # -*- test-case-name: twisted.test.test_rebuild -*-
# Copyright (c) 2001-2009 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
*Real* reloading support for Python.
"""
# System Imports
import sys
import types
import time
import linecache
# Sibling Imports
from twisted.python import log, reflect
lastRebu... | apache-2.0 |
jakobworldpeace/scikit-learn | sklearn/cluster/setup.py | 79 | 1855 | # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# License: BSD 3 clause
import os
from os.path import join
import numpy
from sklearn._build_utils import get_blas_info
def configuration(parent_package='', top_path=None):
from numpy.distutils.misc_util import Configuration
cblas_libs, blas_info = ... | bsd-3-clause |
indictranstech/tele-erpnext | erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.py | 7 | 4610 |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import flt, getdate, add_days, formatdate
from frappe.model.document import Document
from datetime... | agpl-3.0 |
ryancanhelpyou/servo | components/script/dom/bindings/codegen/parser/tests/test_extended_attributes.py | 106 | 2831 | import WebIDL
def WebIDLTest(parser, harness):
parser.parse("""
[Flippety]
interface TestExtendedAttr {
[Foopy] attribute byte b;
};
""")
results = parser.finish()
parser = parser.reset()
parser.parse("""
[Flippety="foo.bar",Floppety=flop]
interfa... | mpl-2.0 |
gnieboer/tensorflow | tensorflow/contrib/tensor_forest/python/tensor_forest.py | 46 | 40039 | # 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 |
google-research/rigl | rigl/imagenet_resnet/imagenet_train_eval.py | 1 | 34374 | # coding=utf-8
# Copyright 2021 RigL Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | apache-2.0 |
Marcusz97/CILP_Facilitatore_Audacity | lib-src/lv2/sord/waflib/Tools/winres.py | 331 | 2807 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
import re,traceback
from waflib import Task,Logs,Utils
from waflib.TaskGen import extension
from waflib.Tools import c_preproc
@extension('.rc')
def rc_file(self,node):
obj_e... | gpl-2.0 |
j-lord/beefy_bash | colors.py | 1 | 1110 | from __future__ import division
import matplotlib.pyplot as plt
from matplotlib import colors as mcolors
colors = dict(mcolors.BASE_COLORS, **mcolors.CSS4_COLORS)
# Sort colors by hue, saturation, value and name.
by_hsv = sorted((tuple(mcolors.rgb_to_hsv(mcolors.to_rgba(color)[:3])), name)
for name, color in colo... | mit |
ar7z1/ansible | lib/ansible/modules/notification/cisco_spark.py | 15 | 5643 | #!/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 |
AnonymousBee/anonymousbee.github.io | libs/pusherclient/__init__.py | 9 | 3534 | from channel import Channel
from connection import Connection
import hashlib
import thread
import hmac
import logging
try:
import simplejson as json
except:
import json
VERSION = "0.2.0"
class Pusher(object):
host = "ws.pusherapp.com"
client_id = 'PythonPusherClient'
protocol = 6
def __init__(self, ke... | gpl-3.0 |
AnshulYADAV007/Lean | Algorithm.Framework/Risk/NullRiskManagementModel.py | 2 | 1034 | # QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the Lice... | apache-2.0 |
Diegojnb/JdeRobot | src/tools/uav_viewer_py/gui/ui_gui.py | 3 | 6044 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'ui_gui.ui'
#
# Created by: PyQt5 UI code generator 5.5.1
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow... | gpl-3.0 |
upibhalla/moose-core | python/moose/fixXreacs.py | 1 | 7129 | # -*- coding: utf-8 -*-
from __future__ import print_function, division, absolute_import
####################################################################
# fixXreacs.py
# The program is meant to take a model and reconfigure any cross-compartment
# reactions so that they are split into portions on either side coupl... | gpl-3.0 |
santis19/fatiando | cookbook/seismic_profile_vertical_smooth.py | 7 | 1629 | """
Seismic: Invert vertical seismic profile (VSP) traveltimes using smoothness
regularization and unknown layer thicknesses
"""
import numpy
from fatiando import utils
from fatiando.seismic.profile import layered_straight_ray, LayeredStraight
from fatiando.inversion import Smoothness1D
from fatiando.vis import mpl
# ... | bsd-3-clause |
mttr/django | django/contrib/gis/geos/prototypes/topology.py | 338 | 2145 | """
This module houses the GEOS ctypes prototype functions for the
topological operations on geometries.
"""
from ctypes import c_double, c_int
from django.contrib.gis.geos.libgeos import GEOM_PTR, GEOSFuncFactory
from django.contrib.gis.geos.prototypes.errcheck import (
check_geom, check_minus_one, check_string... | bsd-3-clause |
kawamon/hue | desktop/core/ext-py/Django-1.11.29/django/contrib/gis/serializers/geojson.py | 36 | 2813 | from __future__ import unicode_literals
from django.contrib.gis.gdal import CoordTransform, SpatialReference
from django.core.serializers.base import SerializerDoesNotExist
from django.core.serializers.json import Serializer as JSONSerializer
class Serializer(JSONSerializer):
"""
Convert a queryset to GeoJSO... | apache-2.0 |
cloverstd/wechatpy | wechatpy/enterprise/client/api/tag.py | 12 | 1361 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from wechatpy.client.api.base import BaseWeChatAPI
class WeChatTag(BaseWeChatAPI):
def create(self, name):
return self._post(
'tag/create',
data={
'tagname': name
}
... | mit |
awkspace/ansible | lib/ansible/modules/network/fortios/fortios_webfilter_content_header.py | 24 | 9059 | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2018 Fortinet, Inc.
#
# 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 Lic... | gpl-3.0 |
sparkslabs/kamaelia_ | Sketches/MPS/BugReports/FixTests/Kamaelia/Kamaelia/Apps/Grey/Support.py | 6 | 2773 | # -*- coding: utf-8 -*-
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache License, Version 2.0 (the "Lic... | apache-2.0 |
GeraldLoeffler/nupic | nupic/swarming/modelchooser.py | 49 | 5505 | # ----------------------------------------------------------------------
# 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 apply:
#
# This progra... | agpl-3.0 |
dubourg/openturns | python/test/t_Trapezoidal_std.py | 1 | 6561 | #! /usr/bin/env python
from __future__ import print_function
from openturns import *
TESTPREAMBLE()
RandomGenerator.SetSeed(0)
try:
# Instanciate one distribution object
distribution = Trapezoidal(1.0, 1.2, 3.0, 14.0)
print("Distribution ", repr(distribution))
print("Distribution ", distribution)
... | gpl-3.0 |
rduivenvoorde/QGIS | python/custom_widgets/qgis_customwidgets.py | 30 | 2020 | # -*- coding: utf-8 -*-
"""
***************************************************************************
customwidgets.py
---------------------
Date : May 2014
Copyright : (C) 2014 by Denis Rouzaud
Email : denis.rouzaud@gmail.com
****************************... | gpl-2.0 |
caesar2164/edx-platform | common/djangoapps/terrain/stubs/tests/test_edxnotes.py | 33 | 12523 | """
Unit tests for stub EdxNotes implementation.
"""
import ddt
import urlparse
import json
import unittest
import requests
from uuid import uuid4
from ..edxnotes import StubEdxNotesService
@ddt.ddt
class StubEdxNotesServiceTest(unittest.TestCase):
"""
Test cases for the stub EdxNotes service.
"""
def... | agpl-3.0 |
briancurtin/libcloud | contrib/scrape-ec2-prices.py | 24 | 5367 | #!/usr/bin/env python
#
# 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 (th... | apache-2.0 |
ganeti/ganeti | test/py/ganeti.utils.storage_unittest.py | 1 | 7340 | #!/usr/bin/python3
#
# 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:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list o... | bsd-2-clause |
landerqi/learningTest | python/Python-1/check_file.py | 1 | 1311 | # Script Name : check_file.py
# Author : Craig Richards
# Created : 20 May 2013
# Last Modified :
# Version : 1.0
# Modifications : with statement added to ensure correct file closure
# Description : Check a file exists and that we can read the file
import sys # Import the Modules
import os # Import the Modules... | mit |
frank10704/DF_GCS_W | MissionPlanner-master/Lib/site-packages/scipy/special/tests/test_specfun.py | 53 | 3683 | # Corresponds to a small subset of scipy.special.specfun
# that has features that were ported manually from fwrap
# to f2py.
# It was assumed that SciPy 0.7.0 shipped with Ubuntu Lucid
# (using f2py) returned the correct values.
#
import numpy as np
from numpy import array, isnan, r_, arange, finfo, pi, sin, cos, ta... | gpl-3.0 |
google/digitalbuildings | tools/rdf_generator/rdfformat/tests/rdflib_function_handler_test.py | 1 | 7834 | # Copyright 2020 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, sof... | apache-2.0 |
saitodisse/cloudtunes | cloudtunes-server/cloudtunes/services/dropbox/client.py | 14 | 2345 | from __future__ import absolute_import
import json
import logging
import requests
from dropbox.session import DropboxSession
from dropbox.client import DropboxClient
from tornado.httpclient import AsyncHTTPClient, HTTPRequest
from cloudtunes import settings
from cloudtunes.utils import cached_property
class Session... | bsd-3-clause |
praekelt/vumi-go | go/billing/tests/test_views.py | 1 | 13254 | """ Tests for PDF billing statement generation """
from decimal import Decimal
import mock
from go.vumitools.tests.helpers import djangotest_imports
with djangotest_imports(globals()):
from django.core.urlresolvers import reverse
from go.base.tests.helpers import DjangoVumiApiHelper, GoDjangoTestCase
fr... | bsd-3-clause |
GreenLunar/searx | searx/tests/engines/test_stackoverflow.py | 13 | 4235 | from collections import defaultdict
import mock
from searx.engines import stackoverflow
from searx.testing import SearxTestCase
class TestStackoverflowEngine(SearxTestCase):
def test_request(self):
query = 'test_query'
dicto = defaultdict(dict)
dicto['pageno'] = 0
params = stackov... | agpl-3.0 |
alazaro/tennis_tournament | django/contrib/gis/db/models/sql/aggregates.py | 309 | 1804 | from django.db.models.sql.aggregates import *
from django.contrib.gis.db.models.fields import GeometryField
from django.contrib.gis.db.models.sql.conversion import GeomField
class GeoAggregate(Aggregate):
# Default SQL template for spatial aggregates.
sql_template = '%(function)s(%(field)s)'
# Conversion ... | gpl-3.0 |
Tatsh-ansible/ansible | lib/ansible/utils/shlex.py | 267 | 1279 | # (c) 2015, Marius Gedminas <marius@gedmin.as>
#
# 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 vers... | gpl-3.0 |
silkyar/570_Big_Little | src/arch/x86/isa/insts/general_purpose/data_transfer/__init__.py | 91 | 2348 | # Copyright (c) 2007 The Hewlett-Packard Development Company
# 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 implemen... | bsd-3-clause |
mioann47/mobile-app-privacy-analyzer | mypythonscripts/literadar.py | 1 | 10067 | # -*- coding: utf-8 -*-
# Copyright 2017 Zachary Marv (马子昂)
#
# 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... | gpl-3.0 |
M3nin0/supreme-broccoli | Web/Flask/site_/lib/python3.5/site-packages/pip/commands/install.py | 18 | 15628 | from __future__ import absolute_import
import logging
import operator
import os
import tempfile
import shutil
import warnings
try:
import wheel
except ImportError:
wheel = None
from pip.req import RequirementSet
from pip.basecommand import RequirementCommand
from pip.locations import virtualenv_no_global, dis... | apache-2.0 |
aljscott/phantomjs | src/breakpad/src/third_party/protobuf/protobuf/examples/list_people.py | 429 | 1135 | #! /usr/bin/python
# See README.txt for information and build instructions.
import addressbook_pb2
import sys
# Iterates though all people in the AddressBook and prints info about them.
def ListPeople(address_book):
for person in address_book.person:
print "Person ID:", person.id
print " Name:", person.na... | bsd-3-clause |
Cynerva/pyipmi | pyipmi/pef.py | 2 | 1882 | # Copyright (c) 2012, Calxeda 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 th... | bsd-3-clause |
yorvic/.vim | bundle/python-mode/pylibs/rope/refactor/wildcards.py | 91 | 5836 | from rope.base import ast, evaluate, builtins, pyobjects
from rope.refactor import patchedast, occurrences
class Wildcard(object):
def get_name(self):
"""Return the name of this wildcard"""
def matches(self, suspect, arg):
"""Return `True` if `suspect` matches this wildcard"""
class Suspec... | gpl-3.0 |
liesbethvanherpe/NeuroM | neurom/exceptions.py | 3 | 2439 | # Copyright (c) 2015, Ecole Polytechnique Federale de Lausanne, Blue Brain Project
# All rights reserved.
#
# This file is part of NeuroM <https://github.com/BlueBrain/NeuroM>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are ... | bsd-3-clause |
watspidererik/testenv | flask/lib/python2.7/site-packages/pip/exceptions.py | 123 | 1125 | """Exceptions used throughout package"""
from __future__ import absolute_import
class PipError(Exception):
"""Base pip exception"""
class InstallationError(PipError):
"""General exception during installation"""
class UninstallationError(PipError):
"""General exception during uninstallation"""
class ... | mit |
blakesmith/djmpc | djmpclib/gui.py | 1 | 5144 | # djmpc (ncurses mpd client)
# (c) Blake Smith
# Project homepage: http://github.com/blakesmith/djmpc/tree/master
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License... | gpl-2.0 |
AndroidOpenDevelopment/android_external_chromium_org | gpu/gles2_conform_support/generate_gles2_conform_tests.py | 139 | 1430 | #!/usr/bin/env python
# Copyright (c) 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.
"""code generator for OpenGL ES 2.0 conformance tests."""
import os
import re
import sys
def ReadFileAsLines(filename):
"""Read... | bsd-3-clause |
google-code-export/pyglet | pyglet/libs/win32/libwintab.py | 37 | 7211 | #!/usr/bin/python
# $Id:$
import ctypes
lib = ctypes.windll.wintab32
LONG = ctypes.c_long
BOOL = ctypes.c_int
UINT = ctypes.c_uint
WORD = ctypes.c_uint16
DWORD = ctypes.c_uint32
WCHAR = ctypes.c_wchar
FIX32 = DWORD
WTPKT = DWORD
LCNAMELEN = 40
class AXIS(ctypes.Structure):
_fields_ = (
... | bsd-3-clause |
krikru/tensorflow-opencl | tensorflow/python/ops/io_ops.py | 15 | 17298 | # 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 |
pyro-ppl/numpyro | examples/hmm_enum.py | 1 | 14211 | # Copyright Contributors to the Pyro project.
# SPDX-License-Identifier: Apache-2.0
"""
Example: Enumerate Hidden Markov Model
======================================
This example is ported from [1], which shows how to marginalize out
discrete model variables in Pyro.
This combines MCMC with a variable elimination al... | apache-2.0 |
cryptobanana/ansible | lib/ansible/plugins/action/normal.py | 7 | 2119 | # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any lat... | gpl-3.0 |
gangadhar-kadam/verve_live_frappe | frappe/core/doctype/user/user.py | 3 | 15848 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import cint, now, get_gravatar, format_datetime, now_datetime
from frappe import throw, msgprint, _
from frappe.auth import _update_password
from f... | mit |
eyohansa/django | tests/test_client/views.py | 109 | 10961 | from xml.dom.minidom import parseString
from django.contrib.auth.decorators import login_required, permission_required
from django.core import mail
from django.forms import fields
from django.forms.forms import Form, ValidationError
from django.forms.formsets import BaseFormSet, formset_factory
from django.http import... | bsd-3-clause |
fhe-odoo/odoo | addons/hw_proxy/controllers/main.py | 71 | 7232 | # -*- coding: utf-8 -*-
import logging
import commands
import simplejson
import os
import os.path
import openerp
import time
import random
import subprocess
import simplejson
import werkzeug
import werkzeug.wrappers
_logger = logging.getLogger(__name__)
from openerp import http
from openerp.http import request
# dr... | agpl-3.0 |
lbartoletti/QGIS | python/processing/algfactory.py | 22 | 23174 | # -*- coding: utf-8 -*-
"""
***************************************************************************
algfactory.py
---------------------
Date : November 2018
Copyright : (C) 2018 by Nathan Woodrow
Email : woodrow dot nathan at gmail dot com
*************... | gpl-2.0 |
damonkohler/sl4a | python/gdata/tests/atom_tests/core_test.py | 87 | 16382 | #!/usr/bin/env 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 ... | apache-2.0 |
gdit-cnd/RAPID | monitors/migrations/0003_create_subscriptions.py | 2 | 2300 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.db.models.deletion
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('monitors... | mit |
conejoninja/pelisalacarta | python/main-classic/lib/gdata/tlslite/TLSConnection.py | 278 | 70347 | """
MAIN CLASS FOR TLS LITE (START HERE!).
"""
from __future__ import generators
import socket
from utils.compat import formatExceptionTrace
from TLSRecordLayer import TLSRecordLayer
from Session import Session
from constants import *
from utils.cryptomath import getRandomBytes
from errors import *
from messages impor... | gpl-3.0 |
fangxingli/hue | desktop/core/ext-py/Django-1.6.10/tests/admin_views/tests.py | 39 | 207997 | # coding: utf-8
from __future__ import absolute_import, unicode_literals
import os
import re
import datetime
from django.conf import settings, global_settings
from django.core import mail
from django.core.exceptions import ImproperlyConfigured
from django.core.files import temp as tempfile
from django.core.urlresolve... | apache-2.0 |
benfinkelcbt/CPD200 | CPD200-Lab11-Python/oauth2client/contrib/django_util/__init__.py | 16 | 11098 | # Copyright 2015 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 agre... | gpl-3.0 |
NASA-Tournament-Lab/CoECI-CMS-Healthcare-Fraud-Prevention | study/hfppnetwork/hfppnetwork/sms/externals.py | 3 | 3690 | # -*- coding: utf-8 -*-
"""
Copyright (C) 2013 TopCoder Inc., All Rights Reserved.
This is module that represents all the externals.
Currently it is mock implementation.
@author: TCSASSEMBLER
@version: 1.0
"""
from hfppnetwork.sms.models import BeneficiaryClaimData, CarrierClaimData,\
InpatientClaimData, Outpati... | apache-2.0 |
Becksteinlab/SPIDAL-MDAnalysis-Midas-tutorial | rp/mdanalysis_psa_partial.py | 1 | 6248 | #!/usr/bin/env python
# Perform Path Similarity Analysis on a submatrix
"""Perform Path Similarity Analysis (PSA) using MDAnalysis.analysis.psa.
Provide all trajectories and topology files in a JSON input file (two
lists, one with topology files, the other with trajectory files) or on
the command line. There *must* b... | bsd-3-clause |
spradeepv/dive-into-python | hackerrank/domain/python/sets/mutation.py | 1 | 1753 | """
TASK
You are given a set A and N numbers of other sets. These N sets have to perform some specific mutation operations to set A.
Your task is to execute those operations and print the sum of elements of set A.
Input Format
First line contains, number of elements in set A.
Second line contains, space separated li... | mit |
obfuscurity/carbon | lib/carbon/conf.py | 1 | 23134 | """Copyright 2009 Chris Davis
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
dist... | apache-2.0 |
agreen/scrapy | scrapy/http/response/__init__.py | 109 | 2515 | """
This module implements the Response class which is used to represent HTTP
responses in Scrapy.
See documentation in docs/topics/request-response.rst
"""
from six.moves.urllib.parse import urljoin
from scrapy.http.headers import Headers
from scrapy.utils.trackref import object_ref
from scrapy.http.common import ob... | bsd-3-clause |
boyuegame/kbengine | kbe/src/lib/python/Lib/ctypes/test/test_stringptr.py | 114 | 2536 | import unittest
from test import support
from ctypes import *
import _ctypes_test
lib = CDLL(_ctypes_test.__file__)
class StringPtrTestCase(unittest.TestCase):
@support.refcount_test
def test__POINTER_c_char(self):
class X(Structure):
_fields_ = [("str", POINTER(c_char))]
x = X()... | lgpl-3.0 |
chintak/scikit-image | skimage/segmentation/tests/test_boundaries.py | 3 | 2329 | import numpy as np
from numpy.testing import assert_array_equal
from skimage.segmentation import find_boundaries, mark_boundaries
def test_find_boundaries():
image = np.zeros((10, 10))
image[2:7, 2:7] = 1
ref = np.array([[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
... | bsd-3-clause |
Dandandan/wikiprogramming | jsrepl/extern/python/reloop-closured/lib/python2.7/textwrap.py | 110 | 16848 | """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>
__revision__ = "$Id$"
import string, re
# Do the right thing with boolean values for all known Python versions
# (so this module can be copied... | mit |
duramato/CouchPotatoServer | libs/suds/metrics.py | 211 | 2004 | # This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) GNU Lesser General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will ... | gpl-3.0 |
mheap/ansible | lib/ansible/modules/network/nxos/nxos_pim_interface.py | 16 | 18888 | #!/usr/bin/python
#
# 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 distribut... | gpl-3.0 |
kantlove/flask-simple-page | Lib/encodings/idna.py | 540 | 8474 | # This module implements the RFCs 3490 (IDNA) and 3491 (Nameprep)
import stringprep, re, codecs
from unicodedata import ucd_3_2_0 as unicodedata
# IDNA section 3.1
dots = re.compile(u"[\u002E\u3002\uFF0E\uFF61]")
# IDNA section 5
ace_prefix = "xn--"
uace_prefix = unicode(ace_prefix, "ascii")
# This assumes query st... | mit |
mojeto/django | tests/urlpatterns_reverse/tests.py | 23 | 53069 | """
Unit tests for reverse URL lookups.
"""
import sys
import threading
from admin_scripts.tests import AdminScriptTestCase
from django.conf import settings
from django.conf.urls import include, url
from django.contrib.auth.models import User
from django.core.exceptions import ImproperlyConfigured, ViewDoesNotExist
f... | bsd-3-clause |
jiachenning/odoo | openerp/addons/base/ir/ir_model.py | 6 | 61606 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (C) 2004-2014 OpenERP S.A. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | agpl-3.0 |
guiniol/py3status | py3status/modules/bitcoin_price.py | 2 | 6046 | # -*- coding: utf-8 -*-
# FIXME color_index param
"""
Display bitcoin using bitcoincharts.com.
Configuration parameters:
cache_timeout: refresh interval for this module. A message from
the site: Don't query more often than once every 15 minutes
(default 900)
color_index: Index of the market res... | bsd-3-clause |
ashhher3/invenio | modules/bibformat/lib/elements/bfe_webauthorpage_data.py | 18 | 1333 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2011 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 |
fail2ban/fail2ban | fail2ban/server/datetemplate.py | 3 | 12392 | # emacs: -*- mode: python; coding: utf-8; py-indent-offset: 4; indent-tabs-mode: t -*-
# vi: set ft=python sts=4 ts=4 sw=4 noet :
# This file is part of Fail2Ban.
#
# Fail2Ban 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 Softw... | gpl-2.0 |
brandond/ansible | lib/ansible/plugins/doc_fragments/vyos.py | 44 | 2716 | # -*- coding: utf-8 -*-
# Copyright: (c) 2015, Peter Sprygada <psprygada@ansible.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
class ModuleDocFragment(object):
# Standard files documentation fragment
DOCUMENTATION = r'''
options:
provider:
descriptio... | gpl-3.0 |
jhoenicke/python-trezor | trezorlib/tests/device_tests/test_msg_verifymessage.py | 2 | 8390 | # This file is part of the Trezor project.
#
# Copyright (C) 2012-2018 SatoshiLabs and contributors
#
# This library is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License version 3
# as published by the Free Software Foundation.
#
# This library is distrib... | lgpl-3.0 |
Dubniak/SafeDroid | FeatureExtractionServer/androguard/core/bytecodes/jvm_generate.py | 10 | 3707 | # This file is part of Androguard.
#
# Copyright (C) 2012 Anthony Desnos <desnos at t0t0.fr>
# All rights reserved.
#
# Androguard is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the... | gpl-3.0 |
kawalpemilu/kawalpemilu2014 | internal-backend/http-server/gyp/pylib/gyp/MSVSSettings_test.py | 778 | 65880 | #!/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.
"""Unit tests for the MSVSSettings.py file."""
import StringIO
import unittest
import gyp.MSVSSettings as MSVSSettings
class TestSequence... | agpl-3.0 |
sudaning/PytLab-Neko | neko/redisCluterBee.py | 1 | 4089 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from colorstr import color_str
# redis包要先安装
try:
import redis
except ImportError as err:
if "No module named" in str(err):
print(color_str("this script base on redis, I will install it first, please wait a moment...", "purple"))
import os
result = os.system("yum... | mit |
PhilLidar-DAD/geonode | geonode/catalogue/backends/generic.py | 25 | 16396 | #########################################################################
#
# 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 version 3 of the License, or
#... | gpl-3.0 |
c-wilson/klustaviewa | klustaviewa/views/featureprojview.py | 2 | 4989 | """Feature View: show spikes as 2D points in feature space."""
# -----------------------------------------------------------------------------
# Imports
# -----------------------------------------------------------------------------
import time
import numpy as np
import numpy.random as rdn
from qtools import QtGui, ... | bsd-3-clause |
mscherer/ansible-modules-extras | messaging/rabbitmq_plugin.py | 63 | 3937 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Chatham Financial <oss@chathamfinancial.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... | gpl-3.0 |
2013Commons/hue | desktop/core/src/desktop/lib/test_export_csvxls.py | 2 | 2014 | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | apache-2.0 |
auvhah/ga-bitbot | encrypt_aws_key.py | 18 | 2856 |
"""
encrypt_aws_key v0.01
genetic trade simulator
Copyright 2011 Brian Monkaba
This file is part of ga-bitbot.
ga-bitbot 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 Lic... | gpl-3.0 |
XeCycle/indico | indico/MaKaC/common/mail.py | 2 | 6707 | # This file is part of Indico.
# Copyright (C) 2002 - 2015 European Organization for Nuclear Research (CERN).
#
# Indico 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 (a... | gpl-3.0 |
Distrotech/qtjsbackend | src/3rdparty/v8/tools/presubmit.py | 14 | 11514 | #!/usr/bin/env python
#
# Copyright 2012 the V8 project 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:
#
# * Redistributions of source code must retain the above copyright
# noti... | gpl-3.0 |
RRShieldsCutler/clusterpluck | clusterpluck/scripts/blastp_to_matrix.py | 1 | 6813 | #!/usr/bin/env python
#
# Robin Shields-Cutler
# August 2016
# takes standard blast output TSV (outfmt 6-- *.b6 or *.txt, etc) and stores entries in dictionary,
# then writes to dataframe and exports as CSV
usage = 'blastp_to_matrix.py -i BLASTOUT.b6 -s SCORE_METHOD -t THRESHOLD -o OUTFILE.csv'
import argparse
import... | mit |
varunarya10/python-openstackclient | doc/source/conf.py | 2 | 8310 | # -*- coding: utf-8 -*-
#
# OpenStack Command Line Client documentation build configuration file, created
# by sphinx-quickstart on Wed May 16 12:05:58 2012.
#
# This file is execfile()d with the current directory set to its containing
# dir.
#
# Note that not all possible configuration values are present in this
# aut... | apache-2.0 |
saurabh6790/-aimobilize-lib | conf/conf.py | 33 | 1034 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
# app configuration
# database config
db_name = '%(db_name)s'
db_password = '%(db_password)s'
# user attachments stored in
files_path = 'public/files'
public_path = 'public'
... | mit |
TheTypoMaster/tosback2 | web-frontend/beautifulsoup4/build/lib/bs4/tests/test_lxml.py | 7 | 1775 | """Tests to ensure that the lxml tree builder generates good trees."""
import re
import warnings
try:
from bs4.builder import LXMLTreeBuilder, LXMLTreeBuilderForXML
LXML_PRESENT = True
except ImportError, e:
LXML_PRESENT = False
from bs4 import (
BeautifulSoup,
BeautifulStoneSoup,
)
from bs4.... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.