repo_name stringlengths 5 100 | path stringlengths 4 294 | copies stringclasses 990
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
rlugojr/django | django/db/migrations/executor.py | 9 | 17416 | from django.apps.registry import apps as global_apps
from django.db import migrations, router
from .exceptions import InvalidMigrationPlan
from .loader import MigrationLoader
from .recorder import MigrationRecorder
from .state import ProjectState
class MigrationExecutor:
"""
End-to-end migration execution - ... | bsd-3-clause |
my7seven/ansible | test/units/executor/test_task_executor.py | 15 | 9940 | # (c) 2012-2014, 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) an... | gpl-3.0 |
dancingdan/tensorflow | tensorflow/python/training/evaluation.py | 8 | 11047 | # 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 applicable ... | apache-2.0 |
Shaffi08/yowsup | yowsup/layers/auth/layer_crypt.py | 24 | 2105 | from yowsup.layers import YowLayer
from yowsup.layers.network import YowNetworkLayer
class YowCryptLayer(YowLayer):
'''
send: bytearray -> bytearray
receive: bytearray -> bytearray
'''
EVENT_KEYS_READY = "org.openwhatsapp.yowsup.crypt.keys"
def __init__(self):
super(Yo... | gpl-3.0 |
muffinresearch/addons-server | apps/translations/tests/test_helpers.py | 11 | 5859 | from django.conf import settings
from django.utils import translation
import jingo
import pytest
from mock import Mock, patch
from nose.tools import eq_
import amo
import amo.tests
from addons.models import Addon
from translations import helpers
from translations.fields import save_signal
from translations.models imp... | bsd-3-clause |
SoreGums/bitcoinxt | qa/rpc-tests/test_framework/mininode.py | 126 | 36289 | # mininode.py - Bitcoin P2P network half-a-node
#
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# This python code was modified from ArtForz' public domain half-a-node, as
# found in the mini-node branch of http://github.c... | mit |
emk/pyjamas | examples/jsonrpc/public/services/jsonrpc/apacheServiceHandler.py | 10 | 1976 | """
Copyright (c) 2006 Jan-Klaas Kollhof
This file is part of jsonrpc.
jsonrpc 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 2.1 of the License, or
(at your option) any later ... | apache-2.0 |
kosz85/django | django/template/backends/django.py | 91 | 4186 | from importlib import import_module
from pkgutil import walk_packages
from django.apps import apps
from django.conf import settings
from django.template import TemplateDoesNotExist
from django.template.context import make_context
from django.template.engine import Engine
from django.template.library import InvalidTemp... | bsd-3-clause |
saatvikshah1994/SmartMM | KeywordExtraction/utilities.py | 1 | 7986 | from sklearn.cross_validation import KFold
import csv
import numpy as np
from bs4 import BeautifulSoup
import re
from nltk.corpus import stopwords
import os
from nltk.stem import PorterStemmer
class DataClean:
"""Cleans data by inputting list of regex to search and substitute
Need to add stopword elimination s... | mit |
hbrunn/OCB | addons/hr_contract/base_action_rule.py | 389 | 2646 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2013 OpenERP S.A. <http://www.openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of th... | agpl-3.0 |
digital-abyss/ansible-modules-extras | notification/mqtt.py | 101 | 4848 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, 2014, Jan-Piet Mens <jpmens () 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... | gpl-3.0 |
rfguri/vimfiles | bundle/ycm/third_party/ycmd/third_party/bottle/setup.py | 32 | 1578 | #!/usr/bin/env python
import sys
import os
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
if sys.version_info < (2,5):
raise NotImplementedError("Sorry, you need at least Python 2.5 or Python 3.x to use bottle.")
import bottle
setup(name='bottle',
version=bo... | mit |
sushramesh/lwc | lib/python2.7/site-packages/setuptools/depends.py | 462 | 6370 | import sys
import imp
import marshal
from imp import PKG_DIRECTORY, PY_COMPILED, PY_SOURCE, PY_FROZEN
from distutils.version import StrictVersion
from setuptools import compat
__all__ = [
'Require', 'find_module', 'get_module_constant', 'extract_constant'
]
class Require:
"""A prerequisite to building or inst... | mit |
mpdehaan/ansible | plugins/inventory/jail.py | 132 | 1288 | #!/usr/bin/env python
# (c) 2013, Michael Scherer <misc@zarb.org>
#
# This file is part of Ansible,
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your o... | gpl-3.0 |
crazy-cat/incubator-mxnet | python/mxnet/contrib/tensorboard.py | 34 | 3192 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | apache-2.0 |
RockySteveJobs/python-for-android | python3-alpha/python3-src/Lib/msilib/schema.py | 48 | 81587 | from . import Table
_Validation = Table('_Validation')
_Validation.add_field(1,'Table',11552)
_Validation.add_field(2,'Column',11552)
_Validation.add_field(3,'Nullable',3332)
_Validation.add_field(4,'MinValue',4356)
_Validation.add_field(5,'MaxValue',4356)
_Validation.add_field(6,'KeyTable',7679)
_Validation.add_field... | apache-2.0 |
zedr/django | django/contrib/auth/management/commands/createsuperuser.py | 63 | 7419 | """
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... | bsd-3-clause |
ivandevp/django | django/templatetags/future.py | 129 | 2039 | import warnings
from django.template import Library, defaulttags
from django.utils.deprecation import RemovedInDjango110Warning
register = Library()
@register.tag
def cycle(parser, token):
"""
This is the future version of `cycle` with auto-escaping.
The deprecation is now complete and this version is n... | bsd-3-clause |
praekelt/vumi-go | go/apps/tests/helpers.py | 1 | 7668 | from twisted.internet.defer import inlineCallbacks, returnValue
from zope.interface import implements
from vumi.tests.helpers import (
MessageDispatchHelper, proxyable, generate_proxies, maybe_async, IHelper)
from go.vumitools.api import VumiApiCommand, VumiApiEvent
from go.vumitools.tests.helpers import GoMessa... | bsd-3-clause |
infoxchange/lettuce | tests/integration/lib/Django-1.3/django/contrib/messages/tests/fallback.py | 311 | 6978 | from django.contrib.messages import constants
from django.contrib.messages.storage.fallback import FallbackStorage, \
CookieStorage
from django.contrib.messages.tests.base import BaseTest
from django.contrib.messages.tests.cookie import set_cookie_data, \
stored_cookie_messages_count
from django.contrib.message... | gpl-3.0 |
tvenkat/askbot-devel | askbot/utils/forms.py | 2 | 8178 | import re
from django import forms
from django.http import str_to_unicode
from django.contrib.auth.models import User
from django.conf import settings
from django.utils.translation import ugettext as _
from django.utils.safestring import mark_safe
from askbot.conf import settings as askbot_settings
from askbot.utils.sl... | gpl-3.0 |
kaarolch/ansible | lib/ansible/modules/packaging/dpkg_selections.py | 23 | 2578 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# 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.
... | gpl-3.0 |
vitan/hue | desktop/core/ext-py/django-extensions-1.5.0/django_extensions/mongodb/fields/__init__.py | 65 | 8837 | """
MongoDB model fields emulating Django Extensions' additional model fields
These fields are essentially identical to existing Extensions fields, but South hooks have been removed (since mongo requires no schema migration)
"""
import re
import six
import datetime
from django import forms
from django.template.defau... | apache-2.0 |
VielSoft/odoo | addons/fetchmail/fetchmail.py | 167 | 15870 | # -*- 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 |
nacc/autotest | frontend/afe/management.py | 3 | 2035 | # use some undocumented Django tricks to execute custom logic after syncdb
from django.db.models import signals
from django.contrib import auth
# In this file, it is critical that we import models *just like this*. In
# particular, we *cannot* do import common; from autotest... import models.
# This is because when w... | gpl-2.0 |
lmprice/ansible | lib/ansible/modules/cloud/openstack/os_keystone_role.py | 20 | 3233 | #!/usr/bin/python
# Copyright (c) 2016 IBM
# 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': ['preview'],
... | gpl-3.0 |
M0ses/ansible | lib/ansible/runner/shell_plugins/powershell.py | 11 | 5296 | # (c) 2014, Chris Church <chris@ninemoreminutes.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 |
flyfei/python-for-android | python-modules/twisted/twisted/conch/test/test_userauth.py | 59 | 39075 | # -*- test-case-name: twisted.conch.test.test_userauth -*-
# Copyright (c) 2007-2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for the implementation of the ssh-userauth service.
Maintainer: Paul Swartz
"""
from zope.interface import implements
from twisted.cred.checkers import ICredentialsC... | apache-2.0 |
santisiri/popego | envs/ALPHA-POPEGO/lib/python2.5/site-packages/SQLAlchemy-0.4.0-py2.5.egg/sqlalchemy/databases/sqlite.py | 1 | 15211 | # sqlite.py
# Copyright (C) 2005, 2006, 2007 Michael Bayer mike_mp@zzzcomputing.com
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
import re
from sqlalchemy import schema, exceptions, pool, PassiveDefault
from sqlalchemy.engine import... | bsd-3-clause |
sunnyzwh/readthedocs.org | readthedocs/redirects/utils.py | 39 | 1316 | from django.conf import settings
from django.core.urlresolvers import reverse
def redirect_filename(project, filename=None):
"""
Return a url for a page. Always use http for now,
to avoid content warnings.
"""
protocol = "http"
# Handle explicit http redirects
if filename.startswith(protoc... | mit |
kevroy314/msl-iposition-pipeline | cogrecon/core/data_flexing/category_data_flexor.py | 1 | 5232 | import easygui
import os
if __name__ == '__main__':
# noinspection PyUnresolvedReferences
from cogrecon.core.file_io import match_file_prefixes, find_data_files_in_directory, \
extract_prefixes_from_file_list_via_suffix, get_coordinates_from_file
from cogrecon.core.cogrecon_globals import data_coor... | gpl-3.0 |
hastexo/edx-platform | common/test/acceptance/tests/lms/test_bookmarks.py | 5 | 23481 | # -*- coding: utf-8 -*-
"""
End-to-end tests for the courseware unit bookmarks.
"""
import json
from unittest import skip
import requests
from nose.plugins.attrib import attr
from common.test.acceptance.fixtures.course import CourseFixture, XBlockFixtureDesc
from common.test.acceptance.pages.common import BASE_URL
fr... | agpl-3.0 |
espadrine/opera | chromium/src/third_party/python_26/Tools/scripts/redemo.py | 63 | 5769 | """Basic regular expression demostration facility (Perl style syntax)."""
from Tkinter import *
import re
class ReDemo:
def __init__(self, master):
self.master = master
self.promptdisplay = Label(self.master, anchor=W,
text="Enter a Perl-style regular expression:")
self.p... | bsd-3-clause |
dyoung418/tensorflow | tensorflow/contrib/quantize/python/fold_batch_norms.py | 9 | 20981 | # 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 |
hlzz/dotfiles | graphics/VTK-7.0.0/ThirdParty/Twisted/twisted/web/_responses.py | 2 | 3726 | # -*- test-case-name: twisted.web.test.test_http -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
HTTP response code definitions.
"""
from __future__ import division, absolute_import
_CONTINUE = 100
SWITCHING = 101
OK = 200
CREATED ... | bsd-3-clause |
arcean/telepathy-sunshine | debian/telepathy-sunshine/usr/lib/python2.6/dist-packages/sunshine/lqsoft/gaduapi.py | 4 | 14686 | from twisted.internet import reactor
from pprint import pformat
from twisted.internet.defer import Deferred
from twisted.internet.protocol import Protocol
from twisted.web.http_headers import Headers
from twisted.internet.defer import succeed
#from twisted.python import log
from twisted.internet import task
from tw... | gpl-3.0 |
arduino-org/brackets-shell | gyp/PRESUBMIT.py | 127 | 2919 | # 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.
"""Top-level presubmit script for GYP.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the presubmit API built... | mit |
persandstrom/home-assistant | homeassistant/components/sensor/tesla.py | 5 | 3707 | """
Sensors for the Tesla sensors.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.tesla/
"""
from datetime import timedelta
import logging
from homeassistant.components.sensor import ENTITY_ID_FORMAT
from homeassistant.components.tesla import DOM... | apache-2.0 |
andfoy/margffoy-tuay-server | env/lib/python2.7/site-packages/Mezzanine-3.1.10-py2.7.egg/mezzanine/forms/page_processors.py | 54 | 2568 | from __future__ import unicode_literals
from django.shortcuts import redirect
from django.template import RequestContext
from mezzanine.conf import settings
from mezzanine.forms.forms import FormForForm
from mezzanine.forms.models import Form
from mezzanine.forms.signals import form_invalid, form_valid
from mezzanine... | gpl-2.0 |
guillaume-philippon/aquilon | tests/broker/test_add_host.py | 1 | 41015 | #!/usr/bin/env python
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2008,2009,2010,2011,2012,2013,2014,2015,2016 Contributor
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with... | apache-2.0 |
sgraham/nope | third_party/webpagereplay/cachemissarchive.py | 9 | 8478 | #!/usr/bin/env python
# Copyright 2011 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... | bsd-3-clause |
chromium/chromium | third_party/blink/tools/blinkpy/web_tests/views/printing.py | 5 | 16341 | # Copyright (C) 2010, 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 of conditions an... | bsd-3-clause |
garyjyao1/ansible | lib/ansible/modules/extras/cloud/vmware/vmware_vmkernel_ip_config.py | 45 | 4192 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Joseph Callen <jcallen () csc.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 Li... | gpl-3.0 |
2ndy/RaspIM | usr/share/doc/git/contrib/ciabot/ciabot.py | 33 | 6810 | #!/usr/bin/env python
# Copyright (c) 2010 Eric S. Raymond <esr@thyrsus.com>
# Distributed under BSD terms.
#
# This script contains porcelain and porcelain byproducts.
# It's Python because the Python standard libraries avoid portability/security
# issues raised by callouts in the ancestral Perl and sh scripts. It sh... | gpl-2.0 |
godfather1103/WeiboRobot | python27/1.0/lib/test/test_codecencodings_cn.py | 41 | 3135 | #
# test_codecencodings_cn.py
# Codec encoding tests for PRC encodings.
#
from test import test_support
from test import test_multibytecodec_support
import unittest
class Test_GB2312(test_multibytecodec_support.TestBase, unittest.TestCase):
encoding = 'gb2312'
tstring = test_multibytecodec_support.load_test... | gpl-3.0 |
ravindrapanda/tensorflow | tensorflow/contrib/learn/python/learn/estimators/kmeans.py | 15 | 10904 | # 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 |
konieboy/Seng_403 | Gender Computer/unidecode/x022.py | 165 | 4329 | data = (
'[?]', # 0x00
'[?]', # 0x01
'[?]', # 0x02
'[?]', # 0x03
'[?]', # 0x04
'[?]', # 0x05
'[?]', # 0x06
'[?]', # 0x07
'[?]', # 0x08
'[?]', # 0x09
'[?]', # 0x0a
'[?]', # 0x0b
'[?]', # 0x0c
'[?]', # 0x0d
'[?]', # 0x0e
'[?]', # 0x0f
'[?]', # 0x10
'[?]', # 0x11
'-', ... | gpl-3.0 |
creasyw/IMTAphy | documentation/doctools/branches/0.4.x/utils/check_sources.py | 9 | 7380 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Checker for file headers
~~~~~~~~~~~~~~~~~~~~~~~~
Make sure each Python file has a correct file header
including copyright and license information.
:copyright: 2006-2008 by Georg Brandl.
:license: GNU GPL, see LICENSE for more details.
"""
imp... | gpl-2.0 |
wemanuel/smry | server-auth/ls/google-cloud-sdk/platform/gsutil/third_party/boto/tests/unit/glacier/test_layer2.py | 114 | 14402 | # -*- coding: utf-8 -*-
# Copyright (c) 2012 Thomas Parslow http://almostobsolete.net/
#
# 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 th... | apache-2.0 |
termie/nova-migration-demo | contrib/boto_v6/__init__.py | 52 | 1693 | # Copyright (c) 2006-2010 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2010, Eucalyptus Systems, Inc.
# 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 res... | apache-2.0 |
kalfasyan/DA224x | code/eigens/params001.py | 1 | 6162 | import random
import numpy as np
import itertools
import decimal
import math
nrn_type = "iaf_neuron"
exc_nrns_mc = 64
inh_nrns_mc = 16
lr_mc = 3
mc_hc = 4
hc = 3
nrns = (exc_nrns_mc+inh_nrns_mc)*hc*mc_hc*lr_mc
q = 1
sigma = math.sqrt(q/decimal.Decimal(nrns))
sigma2 = math.sqrt(1/decimal.Decimal(nrns))
mu = 0
nrns_hc ... | gpl-2.0 |
team-xue/xue | xue/cms/plugins/twitter/models.py | 15 | 1168 | from django.db import models
from django.utils.translation import ugettext_lazy as _
from cms.models.pluginmodel import CMSPlugin
class TwitterRecentEntries(CMSPlugin):
title = models.CharField(_('title'), max_length=75, blank=True)
twitter_user = models.CharField(_('twitter user'), max_length=75)
count = ... | bsd-3-clause |
kolypto/py-overc | overcli/monitor.py | 1 | 5985 | import logging
import subprocess, shlex
import threading
from datetime import datetime
logger = logging.getLogger(__name__)
class Service(object):
def __init__(self, period, name, cwd, command, max_lag=None):
""" Define a service to be monitored
:param period: Test period, seconds
:type p... | bsd-2-clause |
liqd/a4-meinberlin | meinberlin/apps/bplan/views.py | 1 | 2231 | from django.utils.translation import ugettext_lazy as _
from django.views import generic
from django.views.generic import TemplateView
from adhocracy4.dashboard.blueprints import ProjectBlueprint
from adhocracy4.dashboard.components.forms.views import \
ProjectComponentFormView
from adhocracy4.dashboard.mixins imp... | agpl-3.0 |
mrkm4ntr/incubator-airflow | airflow/contrib/utils/weekday.py | 7 | 1074 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | apache-2.0 |
samuelmanzer/interpolation | chebyshev_nodes.py | 1 | 3491 | #!/usr/bin/env python
###############################################################################
# Interpolation
# Copyright (C) Samuel F. Manzer. All rights reserved.
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as publishe... | lgpl-3.0 |
NunoEdgarGub1/nupic | examples/tp/tp_constant_test.py | 8 | 5022 | #!/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 ... | gpl-3.0 |
tempbottle/h-store | third_party/python/boto/ec2/autoscale/activity.py | 57 | 3059 | # Copyright (c) 2009-2011 Reza Lotun http://reza.lotun.name/
#
# 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, mod... | gpl-3.0 |
ehashman/oh-mainline | mysite/search/view_helpers.py | 15 | 18666 | # This file is part of OpenHatch.
# Copyright (C) 2010 Parker Phinney
# Copyright (C) 2009, 2010 OpenHatch, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the ... | agpl-3.0 |
Mistobaan/tensorflow | tensorflow/contrib/quantization/python/array_ops.py | 178 | 1156 | # 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 |
Santhosh114/Hadoop-Fundamentals-for-Data-Scientists-Oreilly | mllib/collaborative_filtering/als/matchmaker.py | 2 | 4452 | #!/usr/bin/env python
import sys
import random
from math import sqrt
from operator import add
from pyspark import SparkConf, SparkContext
from pyspark.mllib.recommendation import ALS
##########################################################################
# Helpers
################################################... | mit |
okuta/chainer | tests/chainer_tests/functions_tests/activation_tests/test_softmax.py | 8 | 3610 | import unittest
import numpy
import chainer
from chainer.backends import cuda
from chainer import functions
from chainer import testing
from chainer.testing import attr
@testing.parameterize(*testing.product_dict(
[
{'shape': None, 'axis': 1},
{'shape': (5,), 'axis': 0},
{'shape': (2, 3)... | mit |
xaviercobain88/framework-python | openerp/addons/point_of_sale/wizard/pos_details.py | 55 | 2439 | # -*- 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 |
Midrya/chromium | third_party/logilab/common/compat.py | 93 | 2593 | # pylint: disable=E0601,W0622,W0611
# copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# This file is part of logilab-common.
#
# logilab-common is free software: you can redistribute it and/or modify it under
# the terms of the GNU L... | bsd-3-clause |
jordanemedlock/psychtruths | temboo/core/Library/Google/Spreadsheets/DeleteListRow.py | 4 | 6613 | # -*- coding: utf-8 -*-
###############################################################################
#
# DeleteListRow
# Deletes a specified worksheet row from a Google spreadsheet.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
... | apache-2.0 |
varunchitre15/android_kernel_mediatek_sprout | tools/perf/scripts/python/syscall-counts-by-pid.py | 11180 | 1927 | # system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os, sys
sys.path.append(os.env... | gpl-2.0 |
0x46616c6b/ansible | lib/ansible/modules/cloud/amazon/ec2_asg_facts.py | 25 | 11800 | #!/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 |
CourseTalk/edx-platform | lms/djangoapps/survey/tests/test_utils.py | 102 | 3969 | """
Python tests for the Survey models
"""
from collections import OrderedDict
from django.test.client import Client
from django.contrib.auth.models import User
from survey.models import SurveyForm
from xmodule.modulestore.tests.factories import CourseFactory
from xmodule.modulestore.tests.django_utils import Modul... | agpl-3.0 |
with-git/tensorflow | tensorflow/contrib/keras/api/keras/layers/__init__.py | 11 | 8528 | # 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 |
servo/servo | tests/wpt/web-platform-tests/webdriver/tests/take_screenshot/iframe.py | 16 | 2692 | import pytest
from tests.support.asserts import assert_success
from tests.support.image import png_dimensions
from . import viewport_dimensions
DEFAULT_CONTENT = "<div id='content'>Lorem ipsum dolor sit amet.</div>"
REFERENCE_CONTENT = "<div id='outer'>{}</div>".format(DEFAULT_CONTENT)
REFERENCE_STYLE = """
<st... | mpl-2.0 |
calpeyser/google-cloud-python | datastore/tests/unit/test_transaction.py | 4 | 9736 | # Copyright 2014 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | apache-2.0 |
festovalros/Examine_odoo8_accounting | account_analytic_plans/report/__init__.py | 445 | 1084 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... | agpl-3.0 |
willbarton/observation-conditions | tests/test_forecast.py | 1 | 1969 | import unittest
import os
import datetime
from dateutil import tz
from dateutil.relativedelta import *
from observation.conditions.map import ForecastMap
from observation.conditions.map import ForecastMap
from observation.conditions.map import ForecastMapSet
from observation.conditions.map import ForecastMapSeries
f... | bsd-3-clause |
guptaankita/python-novaclient | novaclient/tests/unit/v2/test_limits.py | 4 | 3160 | #
# 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
# ... | apache-2.0 |
ssanderson/dask | dask/multiprocessing.py | 11 | 2328 | from __future__ import absolute_import, division, print_function
from toolz import curry, pipe, partial
from .optimize import fuse, cull
import multiprocessing
import dill
import pickle
from .async import get_async # TODO: get better get
from .context import _globals
def _process_get_id():
return multiprocessing... | bsd-3-clause |
rob-smallshire/trailer | trailer/readers/gpx_1_0/parser.py | 1 | 7330 | from lxml import etree
from trailer.readers.common import optional_text, determine_gpx_namespace
from trailer.model.bounds import Bounds
from trailer.model.fieldtools import nullable
from trailer.model.gpx_model import GpxModel
from trailer.model.link import Link
from trailer.model.metadata import Metadata
from trail... | mit |
joopert/home-assistant | tests/components/api/test_init.py | 5 | 18376 | """The tests for the Home Assistant API component."""
# pylint: disable=protected-access
import asyncio
import json
from unittest.mock import patch
from aiohttp import web
import pytest
import voluptuous as vol
from homeassistant import const
from homeassistant.bootstrap import DATA_LOGGING
import homeassistant.core ... | apache-2.0 |
aequitas/home-assistant | homeassistant/components/tahoma/sensor.py | 7 | 3687 | """Support for Tahoma sensors."""
from datetime import timedelta
import logging
from homeassistant.const import ATTR_BATTERY_LEVEL
from homeassistant.helpers.entity import Entity
from . import DOMAIN as TAHOMA_DOMAIN, TahomaDevice
_LOGGER = logging.getLogger(__name__)
SCAN_INTERVAL = timedelta(seconds=60)
ATTR_RSS... | apache-2.0 |
glaubitz/fs-uae-debian | arcade/OpenGL/arrays/formathandler.py | 9 | 3836 | """Base class for the various Python data-format storage type APIs
Data-type handlers are specified using OpenGL.plugins module
"""
import ctypes
from OpenGL import plugins
class FormatHandler( object ):
"""Abstract class describing the handler interface
Each data-type handler is responsible for providin... | gpl-2.0 |
aesteve/vertx-web | vertx-web/src/test/sockjs-protocol/unittest2/signals.py | 17 | 2417 | import signal
import weakref
from unittest2.compatibility import wraps
__unittest = True
class _InterruptHandler(object):
def __init__(self, default_handler):
self.called = False
self.original_handler = default_handler
if isinstance(default_handler, int):
if default_handler =... | apache-2.0 |
fxstein/cement | cement/core/log.py | 4 | 2956 | """
Cement core log module.
"""
from ..core import exc, interface, handler
def log_validator(klass, obj):
"""Validates an handler implementation against the ILog interface."""
members = [
'_setup',
'set_level',
'get_level',
'info',
'warn',
'error',
'f... | bsd-3-clause |
peterm-itr/edx-platform | common/lib/xmodule/xmodule/foldit_module.py | 56 | 6913 | import logging
from lxml import etree
from pkg_resources import resource_string
from xmodule.editing_module import EditingDescriptor
from xmodule.x_module import XModule
from xmodule.xml_module import XmlDescriptor
from xblock.fields import Scope, Integer, String
from .fields import Date
from .util.duedate import get... | agpl-3.0 |
balister/GNU-Radio | gr-digital/python/digital/ofdm_sync_fixed.py | 58 | 1964 | #!/usr/bin/env python
#
# Copyright 2007,2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your opt... | gpl-3.0 |
garbersc/keras-galaxies | extract_pysex_params_gen2.py | 8 | 3889 | import load_data
import pysex
import numpy as np
import multiprocessing as mp
import cPickle as pickle
"""
Extract a bunch of extra info to get a better idea of the size of objects
"""
SUBSETS = ['train', 'test']
TARGET_PATTERN = "data/pysex_params_gen2_%s.npy.gz"
SIGMA2 = 5000 # 5000 # std of the centrality weig... | bsd-3-clause |
wuhengzhi/chromium-crosswalk | third_party/cython/src/Cython/Compiler/Symtab.py | 87 | 96295 | #
# Symbol Table
#
import copy
import re
from Errors import warning, error, InternalError
from StringEncoding import EncodedString
import Options, Naming
import PyrexTypes
from PyrexTypes import py_object_type, unspecified_type
from TypeSlots import \
pyfunction_signature, pymethod_signature, \
get_special_m... | bsd-3-clause |
viger/docker | proxy/proxy/code/default/x_tunnel/local/base_container.py | 2 | 23086 | import threading
import time
import socket
import struct
import select
import utils
from xlog import getLogger
xlog = getLogger("x_tunnel")
class WriteBuffer(object):
def __init__(self, s=None):
if isinstance(s, str):
self.string_len = len(s)
self.buffer_list = [s]
else:
... | mit |
g8os/grid | pyclient/zeroos/orchestrator/client/HealthCheck.py | 2 | 5193 | """
Auto-generated class for HealthCheck
"""
from .Message import Message
from . import client_support
class HealthCheck(object):
"""
auto-generated. don't touch.
"""
@staticmethod
def create(category, id, interval, lasttime, messages, name, resource, stacktrace):
"""
:type categ... | apache-2.0 |
yamila-moreno/django | django/core/serializers/pyyaml.py | 439 | 2843 | """
YAML serializer.
Requires PyYaml (http://pyyaml.org/), but that's checked for in __init__.
"""
import collections
import decimal
import sys
from io import StringIO
import yaml
from django.core.serializers.base import DeserializationError
from django.core.serializers.python import (
Deserializer as PythonDes... | bsd-3-clause |
jonathanstrong/tmetrics | tmetrics/classification.py | 1 | 14853 | import theano, theano.tensor as T
import numpy as np
import pandas as pd
import lasagne
"""
note: we are following the sklearn api for metrics/loss functions,
where the first arg for a function is y true, and second value is
y predicted. this is the opposite of the theano functions, so just
keep in mind.
"""
#copy ... | mit |
BenLubar/valis | valis/resources/abstract.py | 2 | 1223 |
from collections import namedtuple
from datetime import datetime
from flask import request
from flask.ext.restful import Resource
Collection = namedtuple("Collection", ["items", "count", "updated_at"])
class AbstractCollectionResource(Resource):
COLLECTION_LIMIT_MAX = 100
COLLECTION_LIMIT_DEFAULT = 20
... | gpl-3.0 |
laslabs/vertical-medical | sale_crm_medical_prescription/tests/test_crm_lead.py | 1 | 1492 | # -*- coding: utf-8 -*-
# Copyright 2016 LasLabs Inc.
# License GPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
from odoo.tests.common import TransactionCase
class TestCrmLead(TransactionCase):
def setUp(self):
super(TestCrmLead, self).setUp()
self.crm_lead_1 = self.env.ref(
... | agpl-3.0 |
mdietrichc2c/OCB | addons/crm/crm_phonecall.py | 255 | 14844 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | agpl-3.0 |
12AngryMen/votca-scripts | xtp/check_distances.py | 2 | 1617 | #!usr/bin/python
import numpy as np
import sqlite3
import argparse
import sys
parser=argparse.ArgumentParser(description="Checks pairs for dR diferrences")
parser.add_argument("-f","--file", default="system.sql",type=str,help="Statefile,default:system.sql")
args=parser.parse_args()
def readSqlall(sqlname):
sqlstat... | apache-2.0 |
ingolemo/cmd-utils | backup.py | 1 | 6424 | #!/usr/bin/env python
# see `backup --help` for full options
"""
Make a backup of the source directory to the destination using
rsync. Creates a directory in the destination with the date that the
backup was made. If the destination contains previous backups then the
new backup will be done incrementally using the --li... | gpl-3.0 |
Bindupriya/nuxeo-drive | setup.py | 2 | 19023 | #! /usr/bin/env python
#
# Copyright (C) 2012 Nuxeo
#
import os
import sys
from datetime import datetime
import nx_esky
from esky.bdist_esky import Executable as es_Executable
OUTPUT_DIR = 'dist'
SERVER_MIN_VERSION = '5.6'
def read_version(init_file):
if 'DRIVE_VERSION' in os.environ:
return os.environ... | lgpl-2.1 |
eXistenZNL/SickRage | lib/github/tests/NamedUser.py | 39 | 9973 | # -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2012 Zearin <zearin@gonk.net> ... | gpl-3.0 |
suyashphadtare/sajil-frappe | frappe/tasks.py | 27 | 3079 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils.scheduler import enqueue_events
from frappe.celery_app import get_celery, celery_task, task_logger, LONGJOBS_PREFIX
from frappe.cli import get_s... | mit |
clstl/servo | tests/wpt/web-platform-tests/tools/py/testing/root/test_py_imports.py | 163 | 1983 | import py
import types
import sys
def checksubpackage(name):
obj = getattr(py, name)
if hasattr(obj, '__map__'): # isinstance(obj, Module):
keys = dir(obj)
assert len(keys) > 0
print (obj.__map__)
for name in list(obj.__map__):
assert hasattr(obj, name), (obj, name)
... | mpl-2.0 |
sloria/osf.io | addons/dataverse/serializer.py | 32 | 3736 | from addons.base.serializer import OAuthAddonSerializer
from addons.dataverse import client
from addons.dataverse.settings import DEFAULT_HOSTS
from website.util import api_url_for, web_url_for
class DataverseSerializer(OAuthAddonSerializer):
addon_short_name = 'dataverse'
REQUIRED_URLS = []
# Include ... | apache-2.0 |
h3biomed/luigi | test/instance_wrap_test.py | 37 | 3012 | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.