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 |
|---|---|---|---|---|---|
dendisuhubdy/tensorflow | tensorflow/python/platform/resource_loader.py | 23 | 4143 | # 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 |
shaufi10/odoo | addons/base_import/tests/test_cases.py | 189 | 15021 | # -*- encoding: utf-8 -*-
import unittest2
from openerp.tests.common import TransactionCase
from .. import models
ID_FIELD = {
'id': 'id',
'name': 'id',
'string': "External ID",
'required': False,
'fields': [],
}
def make_field(name='value', string='unknown', required=False, fields=[]):
retur... | agpl-3.0 |
johndpope/tensorflow | tensorflow/python/debug/cli/debugger_cli_common_test.py | 101 | 45452 | # 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 |
Frankenmint/p2pool | p2pool/test/util/test_forest.py | 283 | 6804 | import random
import unittest
from p2pool.util import forest, math
class DumbTracker(object):
def __init__(self, items=[]):
self.items = {} # hash -> item
self.reverse = {} # previous_hash -> set of item_hashes
for item in items:
self.add(item)
def add(self, i... | gpl-3.0 |
40223143/2015cd_midterm | static/Brython3.1.1-20150328-091302/Lib/copyreg.py | 749 | 6611 | """Helper to provide extensibility for pickle.
This is only useful to add pickle support for extension types defined in
C, not for instances of user-defined classes.
"""
__all__ = ["pickle", "constructor",
"add_extension", "remove_extension", "clear_extension_cache"]
dispatch_table = {}
def pickle(ob_typ... | gpl-3.0 |
kchodorow/tensorflow | tensorflow/contrib/learn/python/learn/estimators/dnn.py | 9 | 31036 | # 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 |
cmelange/ansible | lib/ansible/modules/cloud/webfaction/webfaction_site.py | 6 | 7096 | #!/usr/bin/python
#
# Create Webfaction website using Ansible and the Webfaction API
#
# ------------------------------------------
#
# (c) Quentin Stafford-Fraser 2015
#
# 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 Lic... | gpl-3.0 |
d2emon/generator-pack | src/genesys/generator/generator/name.py | 1 | 2378 | import random
from fixtures import generator_data
GENDER_NEUTRAL = 0
GENDER_MALE = 1
GENDER_FEMALE = 2
def random_generator(selector, generator_id=None, max_value=10):
if generator_id is None:
generator_id = random.randrange(max_value)
return selector(generator_id)
class Name:
glue = ""
d... | gpl-3.0 |
Avsecz/concise | concise/legacy/models.py | 2 | 4949 | """Template for models
"""
from keras.models import Model
from keras.optimizers import Adam
import keras.layers as kl
import keras.initializers as ki
import keras.regularizers as kr
# concise modules
from concise import initializers as ci
from concise import layers as cl
from concise.utils import PWM
# ### 'First' ... | mit |
Weihonghao/ECM | Vpy34/lib/python3.5/site-packages/google/protobuf/internal/service_reflection_test.py | 75 | 5170 | #! /usr/bin/env python
#
# Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# https://developers.google.com/protocol-buffers/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions ... | agpl-3.0 |
blueburningcoder/nupic | ci/travis/deploy-wheel-to-s3.py | 34 | 1809 | #!/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 |
tquizzle/Sick-Beard | sickbeard/clients/requests/utils.py | 204 | 17497 | # -*- coding: utf-8 -*-
"""
requests.utils
~~~~~~~~~~~~~~
This module provides utility functions that are used within Requests
that are also useful for external consumption.
"""
import cgi
import codecs
import os
import platform
import re
import sys
import zlib
from netrc import netrc, NetrcParseError
from . impor... | gpl-3.0 |
skuicloud/chef-openstack-cookbooks | cookbooks/openstack-image/files/default/glance_plugin.py | 10 | 4858 | from glance.client import V1Client
from glance.common import exception
import collectd
global NAME, OS_USERNAME, OS_PASSWORD, OS_TENANT_NAME, OS_AUTH_URL, OS_AUTH_STRATEGY, VERBOSE_LOGGING
NAME = "glance_plugin"
OS_USERNAME = "username"
OS_PASSWORD = "password"
OS_TENANT_NAME = "tenantname"
OS_AUTH_URL = "http://loc... | apache-2.0 |
40223243/40223243w17 | static/Brython3.1.1-20150328-091302/Lib/_dummy_thread.py | 742 | 4769 | """Drop-in replacement for the thread module.
Meant to be used as a brain-dead substitute so that threaded code does
not need to be rewritten for when the thread module is not present.
Suggested usage is::
try:
import _thread
except ImportError:
import _dummy_thread as _thread
"""
# Exports ... | gpl-3.0 |
BeATz-UnKNoWN/python-for-android | python-modules/twisted/twisted/mail/topfiles/setup.py | 54 | 1918 | # Copyright (c) 2008 Twisted Matrix Laboratories.
# See LICENSE for details.
import sys
try:
from twisted.python import dist
except ImportError:
raise SystemExit("twisted.python.dist module not found. Make sure you "
"have installed the Twisted core package before "
... | apache-2.0 |
dingocuster/scikit-learn | examples/semi_supervised/plot_label_propagation_structure.py | 247 | 2432 | """
==============================================
Label Propagation learning a complex structure
==============================================
Example of LabelPropagation learning a complex internal structure
to demonstrate "manifold learning". The outer circle should be
labeled "red" and the inner circle "blue". Be... | bsd-3-clause |
vitaly-krugl/nupic | src/nupic/data/generators/data_generator.py | 10 | 16250 | # ----------------------------------------------------------------------
# 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 |
campbe13/openhatch | vendor/packages/kombu/kombu/transport/virtual/exchange.py | 33 | 4580 | """
kombu.transport.virtual.exchange
================================
Implementations of the standard exchanges defined
by the AMQ protocol (excluding the `headers` exchange).
"""
from __future__ import absolute_import
from kombu.utils import escape_regex
import re
class ExchangeType(object):
"""Implements t... | agpl-3.0 |
umlaeute/tto-oracle | OracleClient.py | 1 | 1756 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright © 2015, IOhannes m zmölnig, forum::für::umläute
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
#... | gpl-2.0 |
kseistrup/qtile | test/scripts/window.py | 16 | 3845 | # Copyright (c) 2011 Florian Mounier
# Copyright (c) 2014 Sean Vig
#
# 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, cop... | mit |
KyoungRan/Django_React_ex | Django_React_Workshop-mbrochh/django/myvenv/lib/python3.4/site-packages/pip/_vendor/lockfile/pidlockfile.py | 536 | 6090 | # -*- coding: utf-8 -*-
# pidlockfile.py
#
# Copyright © 2008–2009 Ben Finney <ben+python@benfinney.id.au>
#
# This is free software: you may copy, modify, and/or distribute this work
# under the terms of the Python Software Foundation License, version 2 or
# later as published by the Python Software Foundation.
# No ... | mit |
Elandril/SickRage | lib/synchronousdeluge/rencode.py | 156 | 12982 |
"""
rencode -- Web safe object pickling/unpickling.
Public domain, Connelly Barnes 2006-2007.
The rencode module is a modified version of bencode from the
BitTorrent project. For complex, heterogeneous data structures with
many small elements, r-encodings take up significantly less space than
b-encodings:
>>> len... | gpl-3.0 |
dongjoon-hyun/tensorflow | tensorflow/contrib/framework/python/framework/tensor_util.py | 25 | 11885 | # 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 |
aitjcize/PyTox | tools/apicomplete.py | 2 | 1029 | # simple script to test the completeness of the python bindings:
from sys import version_info
if version_info[0] < 3:
from urllib import urlopen
else:
from urllib.request import urlopen
import re
TOXURL =\
"https://raw.githubusercontent.com/irungentoo/toxcore/master/toxcore/tox.h"
PYTOXURL =\
"http... | gpl-3.0 |
pierreg/tensorflow | tensorflow/contrib/tensor_forest/hybrid/python/models/nn.py | 190 | 1567 | # 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 |
mxOBS/deb-pkg_trusty_chromium-browser | third_party/pycoverage/coverage/execfile.py | 209 | 5865 | """Execute files of Python code."""
import imp, marshal, os, sys
from coverage.backward import exec_code_object, open_source
from coverage.misc import ExceptionDuringRun, NoCode, NoSource
try:
# In Py 2.x, the builtins were in __builtin__
BUILTINS = sys.modules['__builtin__']
except KeyError:
# In Py 3.... | bsd-3-clause |
mrquim/mrquimrepo | repo/script.module.kodi65/lib/kodi65/youtube.py | 4 | 9607 | # -*- coding: utf8 -*-
# Copyright (C) 2015 - Philipp Temminghoff <phil65@kodi.tv>
# This program is Free Software see LICENSE file for details
import urllib
import itertools
from kodi65 import utils
from kodi65 import VideoItem
from kodi65 import ItemList
YT_KEY = 'AIzaSyB-BOZ_o09NLVwq_lMskvvj1olDkFI4JK0'
BASE_URL... | gpl-2.0 |
ShineFan/odoo | addons/sale_order_dates/sale_order_dates.py | 223 | 5308 | # -*- 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 |
0xffea/keystone | keystone/common/openssl.py | 2 | 8439 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 OpenStack 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 requ... | apache-2.0 |
pombredanne/pants | src/python/pants/backend/codegen/wire/java/java_wire_library.py | 9 | 2834 | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import logging
from... | apache-2.0 |
graphite-server/carbon | lib/carbon/conf.py | 4 | 19985 | """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 |
einstein95/crunchy-xml-decoder | crunchy-xml-decoder/unidecode/x0fd.py | 252 | 3764 | data = (
'', # 0x00
'', # 0x01
'', # 0x02
'', # 0x03
'', # 0x04
'', # 0x05
'', # 0x06
'', # 0x07
'', # 0x08
'', # 0x09
'', # 0x0a
'', # 0x0b
'', # 0x0c
'', # 0x0d
'', # 0x0e
'', # 0x0f
'', # 0x10
'', # 0x11
'', # 0x12
'', # 0x13
'', # 0x14
'', # 0x15
'',... | gpl-2.0 |
beiko-lab/gengis | bin/Lib/test/test_tuple.py | 13 | 5569 | from test import test_support, seq_tests
import gc
class TupleTest(seq_tests.CommonTest):
type2test = tuple
def test_constructors(self):
super(TupleTest, self).test_constructors()
# calling built-in types without argument must return empty
self.assertEqual(tuple(), ())
... | gpl-3.0 |
lcy-seso/models | globally_normalized_reader/model.py | 4 | 14339 | #!/usr/bin/env python
#coding=utf-8
import paddle.v2 as paddle
from paddle.v2.layer import parse_network
import basic_modules
from config import ModelConfig
__all__ = ["GNR"]
def build_pretrained_embedding(name, data_type, emb_dim, emb_drop=0.):
"""create word a embedding layer which loads pre-trained embedding... | apache-2.0 |
lostdj/Jaklin-OpenJFX | modules/web/src/main/native/Tools/Scripts/webkitpy/tool/bot/ircbot_unittest.py | 2 | 9887 | # Copyright (c) 2010 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... | gpl-2.0 |
bud4/samba | third_party/waf/wafadmin/Runner.py | 32 | 5555 | #!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2005-2008 (ita)
"Execute the tasks"
import os, sys, random, time, threading, traceback
try: from Queue import Queue
except ImportError: from queue import Queue
import Build, Utils, Logs, Options
from Logs import debug, error
from Constants import *
GAP = 15
run... | gpl-3.0 |
erinspace/osf.io | api/wb/serializers.py | 1 | 2711 | from django.db import IntegrityError
from rest_framework import serializers as ser
from rest_framework import exceptions
from website.files import exceptions as file_exceptions
from api.base.serializers import IDField, ShowIfVersion
class DestinationSerializer(ser.Serializer):
parent = ser.CharField(write_only=... | apache-2.0 |
amghost/myblog | node_modules/pygmentize-bundled/vendor/pygments/build-3.3/pygments/formatters/latex.py | 96 | 13931 | # -*- coding: utf-8 -*-
"""
pygments.formatters.latex
~~~~~~~~~~~~~~~~~~~~~~~~~
Formatter for LaTeX fancyvrb output.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.formatter import Formatter
from pygments.token import T... | mit |
ashvina/heron | heron/tools/tracker/src/python/handlers/runtimestatehandler.py | 4 | 4623 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# 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... | apache-2.0 |
JohnOmernik/pimeup | throne/throne.py | 1 | 11168 | #!/usr/bin/python
#Gateway
import time
import random
import sys
import cwiid
import json
import gevent
from collections import OrderedDict
import cStringIO
import alsaaudio
import wave
import requests
import os
import struct
import math
from dotstar import Adafruit_DotStar
import socket
WHATAMI = os.path.basename(__fi... | apache-2.0 |
andresriancho/w3af-webui | src/w3af_webui/migrations/0006_auto__add_field_scan_show_report_time.py | 1 | 10565 | # encoding: 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 'Scan.show_report_time'
db.add_column(u'scans', 'show_report_time', self.gf('django.db.mod... | gpl-2.0 |
Microsoft/ChakraCore | test/native-tests/test-python/helloWorld.py | 3 | 2388 | #-------------------------------------------------------------------------------------------------------
# Copyright (C) Microsoft. All rights reserved.
# Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
#-------------------------------------------------------------... | mit |
edxnercel/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 |
yograterol/django | tests/template_tests/filter_tests/test_length_is.py | 360 | 3204 | from django.template.defaultfilters import length_is
from django.test import SimpleTestCase
from ..utils import setup
class LengthIsTests(SimpleTestCase):
@setup({'length_is01': '{% if some_list|length_is:"4" %}Four{% endif %}'})
def test_length_is01(self):
output = self.engine.render_to_string('len... | bsd-3-clause |
MebiusHKU/flask-web | flask/lib/python2.7/site-packages/sqlalchemy/sql/annotation.py | 60 | 6136 | # sql/annotation.py
# Copyright (C) 2005-2015 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""The :class:`.Annotated` class and related routines; creates hash-equivalent
cop... | bsd-3-clause |
jakevdp/networkx | examples/algorithms/davis_club.py | 44 | 1064 | #!/usr/bin/env python
"""
Davis Southern Club Women
Shows how to make unipartite projections of the graph and compute the
properties of those graphs.
These data were collected by Davis et al. in the 1930s.
They represent observed attendance at 14 social events by 18 Southern women.
The graph is bipartite (clubs, ... | bsd-3-clause |
MadDogTechnology/kops | vendor/github.com/ugorji/go/codec/test.py | 1516 | 4019 | #!/usr/bin/env python
# This will create golden files in a directory passed to it.
# A Test calls this internally to create the golden files
# So it can process them (so we don't have to checkin the files).
# Ensure msgpack-python and cbor are installed first, using:
# sudo apt-get install python-dev
# sudo apt-g... | apache-2.0 |
KenkoGeek/2book | tobook/tobook/settings.py | 1 | 3747 | """
Django settings for tobook project.
Generated by 'django-admin startproject' using Django 1.11.3.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
import os
... | mit |
abhijeet9920/python_project | develop/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/euckrfreq.py | 3121 | 45978 | ######################## 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... | mit |
ekasitk/sahara | sahara/conductor/api.py | 1 | 17877 | # Copyright (c) 2013 Mirantis 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 writ... | apache-2.0 |
sdague/home-assistant | homeassistant/components/canary/config_flow.py | 9 | 3968 | """Config flow for Canary."""
import logging
from typing import Any, Dict, Optional
from canary.api import Api
from requests import ConnectTimeout, HTTPError
import voluptuous as vol
from homeassistant.config_entries import CONN_CLASS_CLOUD_POLL, ConfigFlow, OptionsFlow
from homeassistant.const import CONF_PASSWORD, ... | apache-2.0 |
marcosfede/algorithms | adventofcode/2018/21/d21.py | 1 | 2031 |
def addr(r, a, b):
return r[a]+r[b]
def addi(r, a, b):
return r[a]+b
def mulr(r, a, b):
return r[a]*r[b]
def muli(r, a, b):
return r[a] * b
def banr(r, a, b):
return r[a] & r[b]
def bani(r, a, b):
return r[a] & b
def borr(r, a, b):
return r[a] | r[b]
def bori(r, a, b):
ret... | gpl-3.0 |
espadrine/opera | chromium/src/third_party/python_26/Lib/site-packages/win32/Demos/rastest.py | 17 | 4789 | # rastest.py - test/demonstrate the win32ras module.
# Much of the code here contributed by Jethro Wright.
import sys
import string
import os
import win32ras
# Build a little dictionary of RAS states to decent strings.
# eg win32ras.RASCS_OpenPort -> "OpenPort"
stateMap = {}
for name, val in win32ras.__dict__.items()... | bsd-3-clause |
MER-GROUP/intellij-community | python/lib/Lib/site-packages/django/contrib/messages/tests/user_messages.py | 241 | 2619 | from django import http
from django.contrib.auth.models import User
from django.contrib.messages.storage.user_messages import UserMessagesStorage,\
LegacyFallbackStorage
from django.contrib.messages.tests.base import skipUnlessAuthIsInstalled
from django.contrib.messages.tests.cookie import set_cookie_data
from dja... | apache-2.0 |
imtapps/django-imt-fork | tests/regressiontests/string_lookup/models.py | 113 | 1457 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Foo(models.Model):
name = models.CharField(max_length=50)
friend = models.CharField(max_length=50, blank=True)
def... | bsd-3-clause |
Phoenix1369/site | judge/models/interface.py | 1 | 3940 | import re
from django.core.exceptions import ValidationError
from django.core.urlresolvers import reverse
from django.db import models
from django.utils.translation import ugettext_lazy as _
from mptt.fields import TreeForeignKey
from mptt.models import MPTTModel
from judge.models.problem import Problem
from judge.mo... | agpl-3.0 |
bccp/nbodykit | nbodykit/tutorials/halos.py | 2 | 4020 | from nbodykit.source.catalog import HaloCatalog, HDFCatalog
from nbodykit import CurrentMPIComm, transform
from nbodykit.cosmology import Cosmology
class DemoHaloCatalog(HaloCatalog):
"""
Create a demo catalog of halos using one of the built-in :mod:`halotools`
catalogs.
.. note::
The first re... | gpl-3.0 |
stef1927/cassandra-dtest | thrift_test.py | 5 | 148047 | import re
import struct
import time
import uuid
import pytest
import logging
import codecs
from thrift.protocol import TBinaryProtocol
from thrift.Thrift import TApplicationException
from thrift.transport import TSocket, TTransport
from tools.assertions import assert_length_equal
from tools.misc import ImmutableMappi... | apache-2.0 |
raychorn/knowu | django/djangononrelsample2/django/core/management/templates.py | 102 | 12715 | import cgi
import errno
import mimetypes
import os
import posixpath
import re
import shutil
import stat
import sys
import tempfile
try:
from urllib.request import urlretrieve
except ImportError: # Python 2
from urllib import urlretrieve
from optparse import make_option
from os import path
import django
fr... | lgpl-3.0 |
guru-digital/CouchPotatoServer | libs/suds/client.py | 150 | 25971 | # 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 |
highweb-project/highweb-webcl-html5spec | third_party/pycoverage/coverage/report.py | 214 | 3031 | """Reporter foundation for Coverage."""
import fnmatch, os
from coverage.codeunit import code_unit_factory
from coverage.files import prep_patterns
from coverage.misc import CoverageException, NoSource, NotPython
class Reporter(object):
"""A base class for all reporters."""
def __init__(self, coverage, confi... | bsd-3-clause |
google/carfac | python/tf/car_saveload_test.py | 1 | 1728 | # Lint as: python3
#!/usr/bin/env python
# Copyright 2021 The CARFAC Authors. All Rights Reserved.
#
# This file is part of an implementation of Lyon's cochlear model:
# "Cascade of Asymmetric Resonators with Fast-Acting Compression"
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use... | apache-2.0 |
thaim/ansible | lib/ansible/modules/network/f5/bigip_gtm_datacenter.py | 38 | 14466 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2017, F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | mit |
secynic/ipwhois | ipwhois/tests/online/test_rdap.py | 1 | 1923 | import json
import io
from os import path
import logging
from ipwhois.tests import TestCommon
from ipwhois.exceptions import (HTTPLookupError, HTTPRateLimitError)
from ipwhois.rdap import (RDAP, Net)
LOG_FORMAT = ('[%(asctime)s] [%(levelname)s] [%(filename)s:%(lineno)s] '
'[%(funcName)s()] %(message)s')
... | bsd-2-clause |
gdimitris/ChessPuzzler | Virtual_Environment/lib/python2.7/site-packages/migrate/tests/changeset/test_changeset.py | 66 | 36587 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sqlalchemy
import warnings
from sqlalchemy import *
from migrate import changeset, exceptions
from migrate.changeset import *
from migrate.changeset import constraint
from migrate.changeset.schema import ColumnDelta
from migrate.tests import fixture
from migrate.te... | mit |
ilay09/keystone | keystone/common/cache/_context_cache.py | 5 | 3758 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | apache-2.0 |
0xCCD/mitro | browser-ext/third_party/firefox-addon-sdk/python-lib/plural-rules-generator.py | 36 | 6116 | # 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/.
# Program used to generate /packages/api-utils/lib/l10n/plural-rules.js
# Fetch unicode.org data in order to build funct... | gpl-3.0 |
akretion/odoo | odoo/addons/base/models/ir_module.py | 4 | 42225 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import base64
from collections import defaultdict
from decorator import decorator
from operator import attrgetter
import importlib
import io
import logging
import os
import shutil
import tempfile
import zipfile
import re... | agpl-3.0 |
sergg75/dataModels | Environment/AirQualityObserved/harvest/madrid_air_quality_harvest.py | 1 | 10084 | #!../bin/python
# -*- coding: utf-8 -*-
from __future__ import with_statement
import csv
import datetime
import json
import urllib2
import StringIO
import logging
import logging.handlers
import re
from pytz import timezone
import contextlib
import copy
# Entity type
AMBIENT_TYPE_NAME = 'AirQualityObserved'
# List o... | mit |
tudorvio/nova | nova/virt/disk/mount/loop.py | 64 | 2270 | # Copyright 2011 Red Hat, 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 writing, so... | apache-2.0 |
kushG/osf.io | tests/test_rubeus.py | 2 | 19647 | #!/usr/bin/env python
# encoding: utf-8
import os
from types import NoneType
from xmlrpclib import DateTime
import mock
from nose.tools import *
from webtest_plus import TestApp
from tests.base import OsfTestCase
from tests.factories import (UserFactory, ProjectFactory, NodeFactory,
AuthFactory, PointerFactory, ... | apache-2.0 |
nhuntwalker/astroML | book_figures/chapter5/fig_likelihood_cauchy.py | 3 | 3219 | """
Log-likelihood for Cauchy Distribution
--------------------------------------
Figure 5.10
An illustration of the logarithm of posterior probability distribution for
:math:`\mu` and :math:`\gamma`, :math:`L(\mu,\gamma)` (see eq. 5.75) for
N = 10 (the sample is generated using the Cauchy distribution with
:math:`\mu... | bsd-2-clause |
nhomar/odoo-mirror | addons/mail/__openerp__.py | 41 | 3832 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010-Today OpenERP S.A. (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the term... | agpl-3.0 |
pombredanne/bitmath | tests/test_properties.py | 2 | 2080 | # -*- coding: utf-8 -*-
# The MIT License (MIT)
#
# Copyright © 2014 Tim Bielawa <timbielawa@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 with... | mit |
denovator/myfriki | lib/jinja2/jinja2/_compat.py | 638 | 4042 | # -*- coding: utf-8 -*-
"""
jinja2._compat
~~~~~~~~~~~~~~
Some py2/py3 compatibility support based on a stripped down
version of six so we don't have to depend on a specific version
of it.
:copyright: Copyright 2013 by the Jinja team, see AUTHORS.
:license: BSD, see LICENSE for details.
""... | apache-2.0 |
MichaelHills/seizure-detection | common/data.py | 1 | 1254 | import io
import os
import os.path
def makedirs(dir):
try:
os.makedirs(dir)
except:
pass
class jsdict(dict):
def __init__(self, data):
self.__dict__ = data
class CachedDataLoader:
def __init__(self, dir):
self.dir = dir
makedirs(dir)
# try to load data ... | mit |
GranPC/linux-asus-flo | scripts/build-all.py | 1182 | 9486 | #! /usr/bin/env python
# Copyright (c) 2009-2011, The Linux Foundation. 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
# ... | gpl-2.0 |
ritzk/ansible-modules-core | cloud/openstack/_nova_compute.py | 66 | 22440 | #!/usr/bin/python
#coding: utf-8 -*-
# (c) 2013, Benno Joy <benno@ansible.com>
# (c) 2013, John Dewey <john@dewey.ws>
#
# 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 Li... | gpl-3.0 |
amosonn/distributed | distributed/diagnostics/plugin.py | 2 | 1779 | from __future__ import print_function, division, absolute_import
import logging
logger = logging.getLogger(__name__)
class SchedulerPlugin(object):
""" Interface to extend the Scheduler
The scheduler operates by triggering and responding to events like
``task_finished``, ``update_graph``, ``task_erred`... | bsd-3-clause |
andrewklau/openshift-tools | openshift/installer/vendored/openshift-ansible-git-2016-04-27/playbooks/common/openshift-cluster/upgrades/library/openshift_upgrade_config.py | 91 | 5294 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# vim: expandtab:tabstop=4:shiftwidth=4
"""Ansible module for modifying OpenShift configs during an upgrade"""
import os
import yaml
DOCUMENTATION = '''
---
module: openshift_upgrade_config
short_description: OpenShift Upgrade Config
author: Jason DeTiberus
requirements: [ ]... | apache-2.0 |
ddasilva/numpy | numpy/distutils/command/build_scripts.py | 264 | 1731 | """ Modified version of build_scripts that handles building scripts from functions.
"""
from __future__ import division, absolute_import, print_function
from distutils.command.build_scripts import build_scripts as old_build_scripts
from numpy.distutils import log
from numpy.distutils.misc_util import is_string
class... | bsd-3-clause |
LockScreen/Backend | venv/lib/python2.7/site-packages/boto/codedeploy/layer1.py | 135 | 40600 | # Copyright (c) 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights ... | mit |
Bauble/bauble.api | bauble/routes/auth.py | 1 | 4072 | """
All routes in Bauble use HTTP basic auth.
"""
from datetime import datetime, timedelta
import os
import smtplib
import bottle
from bottle import request
import sqlalchemy as sa
import bauble
import bauble.config as config
import bauble.db as db
import bauble.email as email
from bauble import app, API_ROOT
from b... | bsd-3-clause |
lepture/terminal | setup.py | 1 | 1369 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
kwargs = {}
if sys.platform == 'win32':
kwargs['install_requires'] = ['colorama']
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
import terminal
from email.utils import parseaddr
author, author_email = parsea... | bsd-3-clause |
masayukig/tempest | tempest/lib/services/volume/v3/backups_client.py | 2 | 5348 | # Copyright 2017 FiberHome Telecommunication Technologies CO.,LTD
# 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/LI... | apache-2.0 |
AllenDowney/SoftwareSystems | hw04/wave3/thinkdsp.py | 23 | 31996 | """This file contains code used in "Think DSP",
by Allen B. Downey, available from greenteapress.com
Copyright 2013 Allen B. Downey
License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html
"""
import array
import math
import numpy
import random
import scipy
import scipy.stats
import struct
import subprocess
import thi... | gpl-3.0 |
magfest/mivs | mivs/models.py | 1 | 16621 | from mivs import *
def href(url):
return ('http://' + url) if url and not url.startswith('http') else url
class ReviewMixin:
@property
def video_reviews(self):
return [r for r in self.reviews if r.video_status != c.PENDING]
@property
def game_reviews(self):
return [r for r in se... | agpl-3.0 |
SQbQxeKd3JHD8/simple_ConTeXt | scripts/log.py | 2 | 1073 | from typing import Any, Dict, List, Optional
from . import cite
from . import utilities
def parse(
text: str, script: str, opts: Dict[str, Any], timeout: float = 5,
) -> Dict[str, List[str]]:
result = cite.parse_common_luatex(
text, script, opts, input_as_stdin=True, timeout=timeout,
)
return... | mit |
ValFadeev/ansible-modules-core | cloud/linode/linode.py | 142 | 18004 | #!/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 distributed... | gpl-3.0 |
sjsrey/pysal_core | pysal_core/io/IOHandlers/mtx.py | 2 | 6874 | import os.path
import scipy.io as sio
from .. import FileIO
from ...weights.weights import W, WSP
from ...weights.util import full, full2W
from warnings import warn
__author__ = "Myunghwa Hwang <mhwang4@gmail.com>"
__all__ = ["MtxIO"]
class MtxIO(FileIO.FileIO):
"""
Opens, reads, and writes weights file obje... | bsd-3-clause |
sahmed95/sympy | sympy/simplify/ratsimp.py | 49 | 7542 | from __future__ import print_function, division
from sympy.core import symbols, Add, Dummy
from sympy.core.compatibility import combinations_with_replacement
from sympy.core.numbers import Rational
from sympy.polys import cancel, ComputationFailed, parallel_poly_from_expr, reduced, Poly
from sympy.polys.monomials impo... | bsd-3-clause |
studio666/cjdns | node_build/dependencies/libuv/build/gyp/pylib/gyp/xml_fix.py | 2767 | 2174 | # Copyright (c) 2011 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.
"""Applies a fix to CR LF TAB handling in xml.dom.
Fixes this: http://code.google.com/p/chromium/issues/detail?id=76293
Working around this: http://bugs.python.or... | gpl-3.0 |
allisony/pyspeckit | pyspeckit/spectrum/models/utils/ammonia_offset_calculation.py | 7 | 2955 | from __future__ import print_function
import re
import numpy as np
from astropy import units as u
from astropy import constants
from astroquery.splatalogue import Splatalogue, utils
# Query splatalogue, keeping all of the line strength columns
# Both Lovas and CDMS/JPL can be used
nh3 = Splatalogue.query_lines(20*u.GH... | mit |
dusenberrymw/systemml | src/main/python/systemml/converters.py | 8 | 12296 | #-------------------------------------------------------------
#
# 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... | apache-2.0 |
jcass77/mopidy | mopidy/mpd/protocol/music_db.py | 2 | 17104 | from __future__ import absolute_import, unicode_literals
import functools
import itertools
from mopidy.models import Track
from mopidy.mpd import exceptions, protocol, translator
_SEARCH_MAPPING = {
'album': 'album',
'albumartist': 'albumartist',
'any': 'any',
'artist': 'artist',
'comment': 'comm... | apache-2.0 |
nicolasnoble/grpc | examples/python/interceptors/default_value/default_value_client_interceptor.py | 18 | 2058 | # Copyright 2017 gRPC 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 agreed to in writing... | apache-2.0 |
takeshineshiro/heat | heat/objects/event.py | 7 | 3074 | # Copyright 2014 Intel Corp.
#
# 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, soft... | apache-2.0 |
capone212/crashtec | src/crashtec/symbolsmngr/bindownloader.py | 1 | 6478 | '''
Created on 27.03.2013
HB! :)
@author: capone
'''
# TODO: Style!!! rewrite it all
import urllib
import os
import socket
import urlparse
import logging
from crashtec.db.provider import routines as dbroutines
from crashtec.db.provider import filter
from crashtec.config import symbolsmngrconfig
from crashtec.utils... | gpl-3.0 |
kinverarity1/pyexperiment | tests/test_logger.py | 3 | 5395 | """Tests the state module of pyexperiment
Written by Peter Duerr
"""
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
import unittest
import io
import logging
import tempfile
import os
import time
import re
from pyex... | mit |
piiswrong/mxnet | cpp-package/scripts/lint.py | 41 | 7350 | #!/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 (the
# "L... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.