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 |
|---|---|---|---|---|---|
bkolowitz/IADSS | ml/receive_logs_direct.py | 2 | 1050 | __author__ = 'parallels'
import logging
logging.basicConfig(format='%(levelname)s:%(message)s', level=logging.CRITICAL)
import pika
import sys
connection = pika.BlockingConnection(pika.ConnectionParameters(
host='localhost'))
channel = connection.channel()
channel.exchange_declare(exchange='direct_logs',
... | apache-2.0 |
uwcirg/true_nth_usa_portal | portal/models/qbd.py | 1 | 2760 | """QBD (Questionnaire Bank Details) Module"""
from ..date_tools import FHIR_datetime
class QBD(object):
"""Details needed to define a QB"""
def __init__(
self, relative_start, iteration, recur=None, recur_id=None,
questionnaire_bank=None, qb_id=None):
"""Hold details needed to... | bsd-3-clause |
piquadrat/mygit2 | pygit2/_build.py | 2 | 2071 | # -*- coding: utf-8 -*-
#
# Copyright 2010-2015 The pygit2 contributors
#
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 2,
# as published by the Free Software Foundation.
#
# In addition to the permissions in the GNU General Public Li... | gpl-2.0 |
jaruba/chromium.src | build/android/pylib/utils/json_results_generator_unittest.py | 87 | 7184 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
# Most of this file was ported over from Blink's
# webkitpy/layout_tests/layout_package/json_results_generator_unittest.py
#
import unittest
import json
... | bsd-3-clause |
Aurous/Magic-Discord-Bot | discord/ext/commands/converter.py | 1 | 5485 | # -*- coding: utf-8 -*-
"""
The MIT License (MIT)
Copyright (c) 2015-2016 Rapptz
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to u... | gpl-3.0 |
gregmuellegger/django-superform | setup.py | 1 | 1935 | # -*- coding: utf-8 -*-
import codecs
import re
from os import path
from distutils.core import setup
from setuptools import find_packages
def read(*parts):
return codecs.open(path.join(path.dirname(__file__), *parts),
encoding='utf-8').read()
def find_version(*file_paths):
version_fil... | bsd-3-clause |
xgcm/xgcm | xgcm/duck_array_ops.py | 1 | 5381 | """Compatibility module defining operations on duck numpy-arrays.
Shamelessly copied from xarray."""
import numpy as np
try:
import dask.array as dsa
has_dask = True
except ImportError:
has_dask = False
def _dask_or_eager_func(name, eager_module=np, list_of_args=False, n_array_args=1):
"""Create a... | mit |
agiliq/django-graphos | demo_project/static/admin/js/compress.py | 784 | 1896 | #!/usr/bin/env python
import os
import optparse
import subprocess
import sys
here = os.path.dirname(__file__)
def main():
usage = "usage: %prog [file1..fileN]"
description = """With no file paths given this script will automatically
compress all jQuery-based files of the admin app. Requires the Google Closure... | bsd-2-clause |
weisongchen/flaskapp | venv/lib/python2.7/site-packages/mako/ast.py | 61 | 6635 | # mako/ast.py
# Copyright (C) 2006-2016 the Mako authors and contributors <see AUTHORS file>
#
# This module is part of Mako and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""utilities for analyzing expressions and blocks of Python
code, as well as generating Python from AS... | mit |
Linktime/Aike | Aike/wsgi.py | 1 | 1158 | """
WSGI config for Aike project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION... | apache-2.0 |
agconti/njode | env/lib/python2.7/site-packages/docutils/parsers/rst/languages/ru.py | 128 | 3306 | # -*- coding: utf-8 -*-
# $Id: ru.py 7123 2011-09-12 08:28:31Z milde $
# Author: Roman Suzi <rnd@onego.ru>
# Copyright: This module has been placed in the public domain.
# New language mappings are welcome. Before doing a new translation, please
# read <http://docutils.sf.net/docs/howto/i18n.html>. Two files must be... | bsd-3-clause |
netgroup/dreamer-ryu | ryu/app/rest_quantum.py | 22 | 4625 | # Copyright (C) 2012 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2012 Isaku Yamahata <yamahata at private email ne jp>
#
# 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
#
# h... | apache-2.0 |
buskjan/inetradio | lib/python3.5/site-packages/pip/_vendor/html5lib/treewalkers/__init__.py | 354 | 5544 | """A collection of modules for iterating through different kinds of
tree, generating tokens identical to those produced by the tokenizer
module.
To create a tree walker for a new type of tree, you need to do
implement a tree walker object (called TreeWalker by convention) that
implements a 'serialize' method taking a ... | gpl-3.0 |
aikramer2/spaCy | spacy/tests/test_underscore.py | 2 | 3265 | # coding: utf-8
from __future__ import unicode_literals
import pytest
from mock import Mock
from ..vocab import Vocab
from ..tokens import Doc, Span, Token
from ..tokens.underscore import Underscore
def test_create_doc_underscore():
doc = Mock()
doc.doc = doc
uscore = Underscore(Underscore.doc_extension... | mit |
BT-csanchez/account-financial-reporting | account_export_csv/wizard/account_export_csv.py | 29 | 16458 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author Joel Grand-Guillaume and Vincent Renaville Copyright 2013
# Camptocamp SA
# CSV data formating inspired from
# http://docs.python.org/2.7/library/csv.html?highlight=csv#examples
#
# This program... | agpl-3.0 |
ybenitezf/miner | core/pydal/adapters/mysql.py | 11 | 5041 | # -*- coding: utf-8 -*-
import re
from .._globals import IDENTITY
from ..helpers.methods import varquote_aux
from .base import BaseAdapter
class MySQLAdapter(BaseAdapter):
drivers = ('MySQLdb','pymysql', 'mysqlconnector')
commit_on_alter_table = True
support_distributed_transaction = True
types = {
... | gpl-2.0 |
ondra-novak/chromium.src | tools/memory_inspector/memory_inspector/data/file_storage.py | 54 | 6131 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""This module handles file-backed storage of the core classes.
The storage is logically organized as follows:
Storage -> N Archives -> 1 Symbol index
... | bsd-3-clause |
Adamtaranto/Corset-tools | crossClustCount.py | 1 | 6705 | #!/usr/bin/env python
#python 2.7.5 requires biopython
#crossClustCount.py
#Version 1. Adam Taranto, April 2015
#Contact, Adam Taranto, adam.taranto@anu.edu.au
#Take two transcriptomes and a Corset cluster map.
#Determine number of member transcripts in each cluster that belong to each of the input transcriptomes.
im... | gpl-2.0 |
tudorvio/tempest | tempest/api_schema/response/compute/v2_1/flavors_access.py | 38 | 1305 | # Copyright 2014 NEC Corporation. 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 ... | apache-2.0 |
pbrod/scipy | benchmarks/benchmarks/go_benchmark_functions/go_benchmark.py | 36 | 6173 | # -*- coding: utf-8 -*-
from __future__ import division, print_function, absolute_import
import numpy as np
from numpy import (abs, arctan2, asarray, cos, exp, floor, log, log10,
arange, pi, prod, roll, seterr, sign, sin, sqrt, sum, where,
zeros, tan, tanh, dot)
try:
from sci... | bsd-3-clause |
gtko/CouchPotatoServer | couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/ninegag.py | 2 | 2542 | from __future__ import unicode_literals
import re
import json
from .common import InfoExtractor
from ..utils import str_to_int
class NineGagIE(InfoExtractor):
IE_NAME = '9gag'
_VALID_URL = r'''(?x)^https?://(?:www\.)?9gag\.tv/
(?:
v/(?P<numid>[0-9]+)|
p/(?P<id>[a-zA-Z0-9]+)/(... | gpl-3.0 |
Puppet-Finland/trac | files/xmlrpcplugin/trunk/tracrpc/tests/api.py | 1 | 5895 | # -*- coding: utf-8 -*-
"""
License: BSD
(c) 2009 ::: www.CodeResort.com - BV Network AS (simon-code@bvnetwork.no)
"""
import os
import unittest
import urllib2
from tracrpc.tests import rpc_testenv, TracRpcTestCase
from tracrpc.api import IRPCProtocol
from trac.core import *
from trac.test import Mock
class ... | bsd-2-clause |
Timmenem/micropython | tests/basics/gen_yield_from_ducktype.py | 107 | 1034 | class MyGen:
def __init__(self):
self.v = 0
def __iter__(self):
return self
def __next__(self):
self.v += 1
if self.v > 5:
raise StopIteration
return self.v
def gen():
yield from MyGen()
def gen2():
yield from gen()
print(list(gen()))
print(l... | mit |
chemelnucfin/tensorflow | tensorflow/python/util/decorator_utils.py | 32 | 4132 | # 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 |
scenarios/tensorflow | tensorflow/python/debug/examples/debug_tflearn_iris.py | 23 | 6482 | # 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 |
JakeBrand/CMPUT410-E6 | v1/lib/python2.7/site-packages/django/forms/formsets.py | 49 | 17531 | from __future__ import unicode_literals
from django.core.exceptions import ValidationError
from django.forms import Form
from django.forms.fields import IntegerField, BooleanField
from django.forms.utils import ErrorList
from django.forms.widgets import HiddenInput
from django.utils.encoding import python_2_unicode_co... | apache-2.0 |
bgxavier/nova | nova/tests/unit/test_matchers.py | 66 | 14015 | # Copyright 2012 Hewlett-Packard Development Company, L.P.
#
# 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 applicabl... | apache-2.0 |
urisimchoni/samba | python/samba/netcmd/nettime.py | 51 | 2007 | # time
#
# Copyright Jelmer Vernooij 2010 <jelmer@samba.org>
#
# 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
# (at your option) any later version.
#
# This ... | gpl-3.0 |
Endika/omim | 3party/protobuf/gtest/scripts/gen_gtest_pred_impl.py | 2538 | 21986 | #!/usr/bin/env python
#
# Copyright 2006, 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... | apache-2.0 |
Kazade/NeHe-Website | google_appengine/lib/django_1_2/tests/modeltests/m2m_intermediary/models.py | 92 | 1086 | """
9. Many-to-many relationships via an intermediary table
For many-to-many relationships that need extra fields on the intermediary
table, use an intermediary model.
In this example, an ``Article`` can have multiple ``Reporter`` objects, and
each ``Article``-``Reporter`` combination (a ``Writer``) has a ``position`... | bsd-3-clause |
zyq001/ryu | ryu/tests/unit/ofproto/test_inet.py | 63 | 1254 | # Copyright (C) 2012 Nippon Telegraph and Telephone 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 License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | apache-2.0 |
sorenk/ansible | lib/ansible/modules/cloud/digital_ocean/digital_ocean_floating_ip.py | 23 | 9251 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2015, Patrick F. Marques <patrickfmarques@gmail.com>
# 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_versi... | gpl-3.0 |
vmp32k/litecoin | test/functional/p2p_feefilter.py | 23 | 3614 | #!/usr/bin/env python3
# Copyright (c) 2016-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test processing of feefilter messages."""
from decimal import Decimal
import time
from test_framework... | mit |
orekyuu/intellij-community | python/testData/types/NumpyArrayType/numpy/core/multiarray.py | 79 | 7955 | def array(p_object, dtype=None, copy=True, order=None, subok=False, ndmin=0): # real signature unknown; restored from __doc__
"""
array(object, dtype=None, copy=True, order=None, subok=False, ndmin=0)
Create an array.
Parameters
----------
object : array_like
An arr... | apache-2.0 |
alx-eu/django | django/utils/unittest/loader.py | 109 | 13441 | """Loading unittests."""
import os
import re
import sys
import traceback
import types
import unittest
from fnmatch import fnmatch
from django.utils.unittest import case, suite
try:
from os.path import relpath
except ImportError:
from django.utils.unittest.compatibility import relpath
__unittest = True
de... | bsd-3-clause |
prathapsridharan/health_project | health_project/questions/forms.py | 1 | 2744 | """Contains form class defintions for form for the questions app.
Classes: [
SurveyQuestionForm
]
"""
from django import forms
from django.core.urlresolvers import reverse
from crispy_forms.bootstrap import FormActions
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Submit, Layout
fro... | bsd-3-clause |
christofferpettersson/Aftermath | Code/External/googletest/test/gtest_test_utils.py | 674 | 10826 | #!/usr/bin/env python
#
# Copyright 2006, 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... | mit |
Edraak/edraak-platform | lms/djangoapps/courseware/tests/test_video_mongo.py | 8 | 91387 | # -*- coding: utf-8 -*-
"""
Video xmodule tests in mongo.
"""
import json
from collections import OrderedDict
from uuid import uuid4
from tempfile import mkdtemp
import shutil
import ddt
from django.conf import settings
from django.core.files import File
from django.core.files.base import ContentFile
from django.test... | agpl-3.0 |
gis4dis/poster | apps/processing/pmo/tasks.py | 1 | 3380 | from __future__ import absolute_import, unicode_literals
import os
from datetime import timedelta, datetime
from celery.task import task, group
from celery.utils.log import get_task_logger
from django.conf import settings
from django.core.files.storage import default_storage
from django.core.management import call_co... | bsd-3-clause |
Teagan42/home-assistant | homeassistant/components/vera/scene.py | 7 | 1421 | """Support for Vera scenes."""
import logging
from homeassistant.components.scene import Scene
from homeassistant.util import slugify
from . import VERA_CONTROLLER, VERA_ID_FORMAT, VERA_SCENES
_LOGGER = logging.getLogger(__name__)
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up t... | apache-2.0 |
Johnetordoff/osf.io | addons/gitlab/tests/test_views.py | 6 | 24875 | # -*- coding: utf-8 -*-
from rest_framework import status as http_status
import mock
import datetime
import pytest
import unittest
from json import dumps
from nose.tools import * # noqa (PEP8 asserts)
from tests.base import OsfTestCase, get_default_metaschema
from osf_tests.factories import ProjectFactory, UserFacto... | apache-2.0 |
mjharriso/ConDistAreas | ConDistAreas.py | 1 | 4102 | #Coded by Matthew Harrison, July, 2015.
#Read ESRI shapefiles and calculate district areas
#Using Albers Equal Area Projection for North America
#Including Alaska and Hawaii
from mpl_toolkits.basemap import Basemap
from pyproj import Proj
from shapely.geometry import LineString, Point, shape
import fiona
from fiona im... | gpl-2.0 |
kuba1/qtcreator | tests/system/suite_editors/tst_basic_cpp_support/test.py | 6 | 6126 | #############################################################################
##
## Copyright (C) 2015 The Qt Company Ltd.
## Contact: http://www.qt.io/licensing
##
## This file is part of Qt Creator.
##
## Commercial License Usage
## Licensees holding valid commercial Qt licenses may use this file in
## accordance wit... | lgpl-2.1 |
MumbleFysh/vinty | packages/pki/util.py | 3 | 6819 | #!/usr/bin/python
## Revision history ############################################################
__author__ = 'Wouter Eerdekens <info@fks.be>'
__date__ = '2011-08-12'
__version__ = 0.1
__history__ = """
2011-08-12 - Prepare for initial release <jeroen.hooyberghs@fks.be>
2006-07-26 - initial version.
"""
########... | gpl-2.0 |
clintecker/django-google-analytics | google_analytics/templatetags/analytics.py | 3 | 2204 | from django import template
from django.conf import settings
from django.db import models
from django.contrib.sites.models import Site
from django.template import Context, loader
register = template.Library()
Analytics = models.get_model('googleanalytics', 'analytics')
def do_get_analytics(parser, token):
conte... | mit |
DevOps4Networks/iox-utils | fog-director-utils/src/iox_fog_dir_rest/functions.py | 1 | 2610 | #! /usr/bin/env python
# encoding: utf-8
"""
Copyright 2016 Nathan John Sowatskey
These are sample functions for the Cisco Fog Director REST API.
See:
http://www.cisco.com/c/en/us/td/docs/routers/access/800/software/guides/iox/fog-director/reference-guide/1-0/fog_director_ref_guide.html
Licensed under the Apache L... | apache-2.0 |
simonkuang/grpc | src/python/grpcio_tests/tests/interop/_intraop_test_case.py | 27 | 1865 | # Copyright 2015 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 |
akamajoris/webshell | php/php-sh/client.py | 26 | 1279 | #!/usr/bin/python
# Client for the backdoor which
# uses HTTP CODE header for inserting code
# Got the idea after seeing this sort of payload
# dropped by a phpmyadmin exploit on rdot :)
# Is also good to learn how to use urllib
# and not be lazy arse with requests all of time!
# Insecurety Research (2013) - insecurety... | gpl-3.0 |
vismantic-ohtuprojekti/qualipy | qualipy/filters/svm_filter.py | 2 | 2714 | import os.path
import numpy
from filter import Filter
from ..utils.svm import SVM
class SVMFilter(Filter):
"""An abstract class representing a filter that uses SVM"""
def __init__(self, threshold, invert_threshold, svm_file):
super(SVMFilter, self).__init__(threshold, invert_threshold)
if... | mit |
tuxfux-hlp-notes/python-batches | archieves/batch-59/files/myvenv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/langcyrillicmodel.py | 2762 | 17725 | ######################## 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... | gpl-3.0 |
Contraz/demosys-py | demosys/loaders/scene/gltf.py | 1 | 24715 | # Spec: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#asset
import base64
import io
import json
import os
import struct
from collections import namedtuple
import numpy
from PIL import Image
from pyrr import Matrix44, matrix44, quaternion
import moderngl
from demosys import context
from ... | isc |
tanglei528/nova | nova/api/openstack/compute/plugins/v3/hosts.py | 13 | 13924 | # Copyright (c) 2011 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | apache-2.0 |
ringo-framework/ringo | ringo/views/home.py | 3 | 1347 | import pkg_resources
from pyramid.view import view_config
from ringo.lib.helpers import (
get_ringo_version,
get_app_version,
get_app_name,
get_app_title
)
from ringo.lib.renderer import (
DTListRenderer
)
@view_config(route_name='home', renderer='/index.mako')
def index_view(request):
value... | gpl-2.0 |
mottosso/be | be/vendor/requests/packages/chardet/big5freq.py | 3133 | 82594 | ######################## 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... | lgpl-2.1 |
sagangwee/sagangwee.github.io | build/pygments/build/lib.linux-i686-2.7/pygments/lexers/python.py | 43 | 36222 | # -*- coding: utf-8 -*-
"""
pygments.lexers.python
~~~~~~~~~~~~~~~~~~~~~~
Lexers for Python and related languages.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import Lexer, RegexLexer, include, bygro... | mit |
mahabuber/erpnext | erpnext/accounts/doctype/period_closing_voucher/test_period_closing_voucher.py | 13 | 3362 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import unittest
import frappe
from frappe.utils import flt, today
from erpnext.accounts.utils import get_fiscal_year
from erpnext.accounts.doctype.jour... | agpl-3.0 |
ComputationalPhysics/atomify-lammps | libs/lammps/tools/moltemplate/moltemplate/ttree_matrix_stack.py | 8 | 36977 | # Author: Andrew Jewett (jewett.aij@gmail.com)
# http://www.chem.ucsb.edu/~sheagroup
# License: 3-clause BSD License (See LICENSE.TXT)
# Copyright (c) 2012, Regents of the University of California
# All rights reserved.
import random, math
from collections import deque
from array import array
try:
from .... | gpl-3.0 |
ehashman/oh-mainline | vendor/packages/gdata/src/gdata/apps/emailsettings/service.py | 95 | 8939 | #!/usr/bin/python
#
# Copyright (C) 2008 Google, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | agpl-3.0 |
HKUST-SING/tensorflow | tensorflow/examples/learn/mnist.py | 45 | 3999 | # 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 appl... | apache-2.0 |
shiblon/pytour | static/js/pypyjs/pypy-nojit.js-0.3.1/lib/modules/tabnanny.py | 394 | 11336 | #! /usr/bin/env python
"""The Tab Nanny despises ambiguous indentation. She knows no mercy.
tabnanny -- Detection of ambiguous indentation
For the time being this module is intended to be called as a script.
However it is possible to import it into an IDE and use the function
check() described below.
Warning: The ... | apache-2.0 |
mvdbeek/tools-iuc | tools/gemini/test-data/util/shrink_simple_tab.py | 20 | 1807 | from __future__ import print_function
import argparse
from functools import partial
def keep_line(line, pos_cols, region):
fields = line.rstrip().split(b'\t')
if fields[pos_cols[0]] == region[0]: # same chromosome
if (
region[1] < int(fields[pos_cols[1]]) < region[2]
) or (
... | mit |
pselle/calibre | src/calibre/gui2/dbus_export/menu2.py | 14 | 2317 | #!/usr/bin/env python2
# vim:fileencoding=utf-8
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2014, Kovid Goyal <kovid at kovidgoyal.net>'
# A implementation of the GMenuModel export of menus/actions on DBus.
# GMen... | gpl-3.0 |
lmyrefelt/CouchPotatoServer | couchpotato/core/providers/torrent/iptorrents/main.py | 9 | 4032 | from bs4 import BeautifulSoup
from couchpotato.core.helpers.encoding import tryUrlencode
from couchpotato.core.helpers.variable import tryInt
from couchpotato.core.logger import CPLog
from couchpotato.core.providers.torrent.base import TorrentProvider
import traceback
log = CPLog(__name__)
class IPTorrents(TorrentPr... | gpl-3.0 |
miipl-naveen/optibizz | addons/account_check_writing/__openerp__.py | 313 | 1808 | # -*- 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 |
hdinsight/hue | desktop/libs/libsaml/src/libsaml/conf.py | 25 | 4857 | #!/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 |
jeffreyliu3230/osf.io | scripts/migrate_piwik_base_nodes.py | 49 | 1670 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Update Piwik for nodes that were forked, registered or templated prior to
October 2014.
"""
import datetime
import logging
import sys
import time
from modularodm import Q
from framework.analytics.piwik import _update_node_object
from scripts import utils as scripts_ut... | apache-2.0 |
simonz05/django-notice | notice/views.py | 1 | 1542 | try:
import uwsgi
except ImportError:
pass
# raise ImportError('uWSGI is required to run this package')
from django.contrib.auth.decorators import login_required, user_passes_test
from django.http import HttpResponse
from django.template import RequestContext
from django.utils.functional import Promise
from... | bsd-3-clause |
dirkx/AccesSystem | lib-python/AlertEmail.py | 1 | 2771 | #!/usr/bin/env python3.4
#
import sys
import uuid
import smtplib
import time
import logging
from email.mime.text import MIMEText
from ACNode import ACNode
class AlertEmail(ACNode):
default_smtphost = 'localhost'
default_smtpport = 25
default_alertsubject = "[Node alert]"
default_alertfrom = 'acnode@unknown'
... | apache-2.0 |
sss-freshbyte/blog | node_modules/node-gyp/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... | mit |
ChrisAntaki/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/common/newstringio.py | 132 | 1757 | # 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 ... | bsd-3-clause |
aperigault/ansible | lib/ansible/modules/network/fortios/fortios_wireless_controller_utm_profile.py | 19 | 10162 | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 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 |
rbaumg/trac | trac/wiki/admin.py | 1 | 12181 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2008-2019 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://trac.edgewall.com/license.html.
#
# This software consists ... | bsd-3-clause |
mdshuai/kubernetes | 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 |
divio/django | django/contrib/contenttypes/fields.py | 73 | 22873 | from __future__ import unicode_literals
from collections import defaultdict
from django.contrib.contenttypes.models import ContentType
from django.core import checks
from django.core.exceptions import FieldDoesNotExist, ObjectDoesNotExist
from django.db import DEFAULT_DB_ALIAS, connection, models, router, transaction... | bsd-3-clause |
pratikmallya/hue | desktop/core/ext-py/boto-2.38.0/boto/cloudsearch2/document.py | 136 | 11630 | # Copyright (c) 2012 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2014 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 r... | apache-2.0 |
NewpTone/stacklab-nova | debian/python-nova/usr/share/pyshared/nova/api/openstack/volume/contrib/__init__.py | 8 | 1284 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 Justin Santa Barbara
# 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.apach... | apache-2.0 |
dracos/QGIS | python/plugins/processing/algs/lidar/lastools/lasmerge.py | 2 | 3710 | # -*- coding: utf-8 -*-
"""
***************************************************************************
lasmerge.py
---------------------
Date : September 2013
Copyright : (C) 2013 by Martin Isenburg
Email : martin near rapidlasso point com
****************... | gpl-2.0 |
chazy/reviewboard | reviewboard/diffviewer/models.py | 1 | 3892 | from datetime import datetime
from django.db import models
from django.utils.translation import ugettext_lazy as _
from djblets.util.fields import Base64Field
from reviewboard.scmtools.models import Repository
class FileDiff(models.Model):
"""
A diff of a single file.
This contains the patch and inform... | mit |
tpodowd/boto | boto/kms/__init__.py | 113 | 1640 | # Copyright (c) 2014 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 |
sarahgrogan/scikit-learn | doc/tutorial/text_analytics/skeletons/exercise_01_language_train_model.py | 254 | 2005 | """Build a language detector model
The goal of this exercise is to train a linear classifier on text features
that represent sequences of up to 3 consecutive characters so as to be
recognize natural languages by using the frequencies of short character
sequences as 'fingerprints'.
"""
# Author: Olivier Grisel <olivie... | bsd-3-clause |
windelbouwman/ppci-mirror | ppci/arch/avr/arch.py | 1 | 11632 | """ AVR architecture.
See for good documentation about AVR ABI:
- https://gcc.gnu.org/wiki/avr-gcc
The stack grows downwards in AVR. The stack pointer points to the current
empty stack slot. This is somewhat confusing, because on other machines
the stack pointer points to the latests pushed byte.
The stack frame is... | bsd-2-clause |
potatolondon/django-nonrel-1-4 | tests/regressiontests/utils/simplelazyobject.py | 33 | 3440 | import copy
import pickle
from django.utils.unittest import TestCase
from django.utils.functional import SimpleLazyObject, empty
class _ComplexObject(object):
def __init__(self, name):
self.name = name
def __eq__(self, other):
return self.name == other.name
def __hash__(self):
r... | bsd-3-clause |
ClovisIRex/Snake-django | env/lib/python3.6/site-packages/django/db/models/functions/base.py | 44 | 8087 | """
Classes that represent database functions.
"""
from django.db.models import Func, Transform, Value, fields
class Cast(Func):
"""
Coerce an expression to a new field type.
"""
function = 'CAST'
template = '%(function)s(%(expressions)s AS %(db_type)s)'
mysql_types = {
fields.CharFie... | mit |
wallnerryan/quantum_migrate | quantum/plugins/plumgrid/plumgrid_nos_plugin/rest_connection.py | 2 | 3469 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 PLUMgrid, 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/lic... | apache-2.0 |
rackerlabs/deuce | deuce/tests/test_openstack_swift_hook.py | 1 | 10337 | import falcon
import mock
import binascii
import base64
import json
import deuce
from deuce.transport.wsgi import hooks
from deuce.drivers import swift
from deuce.tests import HookTest
def before_hooks_swift(req, resp, params):
return [
hooks.OpenstackSwiftHook(req, resp, params)
]
class DummyClassO... | apache-2.0 |
leeseulstack/openstack | neutron/tests/unit/ml2/test_ml2_plugin.py | 5 | 52265 | # Copyright (c) 2013 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | apache-2.0 |
leekchan/tornado_test | tornado/tcpserver.py | 74 | 10693 | #!/usr/bin/env python
#
# Copyright 2011 Facebook
#
# 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 a... | apache-2.0 |
alexlo03/ansible | lib/ansible/modules/windows/win_route.py | 21 | 1660 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Daniele Lazzari <lazzari@mailup.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# This is a windows documentation stub. Actual code lives in the .ps1
# file of the same name.
ANSIBLE_METADATA = {'metad... | gpl-3.0 |
kellyschrock/ardupilot | Tools/scripts/configure_all.py | 4 | 2215 | #!/usr/bin/env python
"""
script to run configre for all hwdef.dat, to check for syntax errors
"""
import os
import shutil
import subprocess
import sys
import fnmatch
import argparse
parser = argparse.ArgumentParser(description='configure all ChibiOS boards')
parser.add_argument('--build', action='store_true', defa... | gpl-3.0 |
kenshay/ImageScript | ProgramData/SystemFiles/Python/Lib/site-packages/pytz/lazy.py | 514 | 5263 | from threading import RLock
try:
from UserDict import DictMixin
except ImportError:
from collections import Mapping as DictMixin
# With lazy loading, we might end up with multiple threads triggering
# it at the same time. We need a lock.
_fill_lock = RLock()
class LazyDict(DictMixin):
"""Dictionary popu... | gpl-3.0 |
lynndotconfig/server-tools | language_path_mixin/__openerp__.py | 13 | 1370 | # -*- coding: utf-8 -*-
##############################################################################
#
# Odoo, an open source suite of business apps
# This module copyright (C) 2015 Therp BV (<http://therp.nl>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | agpl-3.0 |
Teamxrtc/webrtc-streaming-node | third_party/webrtc/src/chromium/src/tools/findit/match_set.py | 48 | 4429 | # Copyright (c) 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import re
from threading import Lock
import crash_utils
REVIEW_URL_PATTERN = re.compile(r'Review URL:( *)(.*?)/(\d+)')
class Match(object):
"""Re... | mit |
dongjoon-hyun/electron | script/update.py | 18 | 3148 | #!/usr/bin/env python
import argparse
import os
import platform
import subprocess
import sys
from lib.config import get_target_arch, PLATFORM
from lib.util import get_host_arch, import_vs_env
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
def main():
os.chdir(SOURCE_ROOT)
if PLATFO... | mit |
superdesk/superdesk-content-api | content_api/tests/packages_init_app_test.py | 13 | 2280 | # -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014, 2015 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license
from u... | agpl-3.0 |
jahrome/viper | modules/rats/unrecom.py | 6 | 2755 | # Originally written by Kevin Breen (@KevTheHermit):
# https://github.com/kevthehermit/RATDecoders/blob/master/unrecom.py
import string
from zipfile import ZipFile
from cStringIO import StringIO
from Crypto.Cipher import ARC4
import xml.etree.ElementTree as ET
from viper.common.out import *
def extract_embedded(zip_... | bsd-3-clause |
kirca/odoo | addons/point_of_sale/wizard/pos_box.py | 381 | 2211 |
from openerp.osv import osv
from openerp.tools.translate import _
from openerp.addons.account.wizard.pos_box import CashBox
class PosBox(CashBox):
_register = False
def run(self, cr, uid, ids, context=None):
if not context:
context = dict()
active_model = context.get('active_mod... | agpl-3.0 |
srm912/servo | tests/wpt/css-tests/tools/pywebsocket/src/test/set_sys_path.py | 496 | 1815 | # Copyright 2009, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | mpl-2.0 |
CUFCTL/DLBD | Spring2018/src/utils.py | 1 | 16622 | ### Import necessary packages
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from xml.etree import ElementTree as et
import cv2, os, sys, shutil, glob, argparse, re, io
import numpy as np
import tensorflow as tf
import PIL, hashlib, logging
from PIL import ... | mit |
SpaceGroupUCL/qgisSpaceSyntaxToolkit | esstoolkit/external/networkx/drawing/tests/test_layout.py | 1 | 15534 | """Unit tests for layout functions."""
import networkx as nx
from networkx.testing import almost_equal
import pytest
numpy = pytest.importorskip("numpy")
test_smoke_empty_graphscipy = pytest.importorskip("scipy")
class TestLayout:
@classmethod
def setup_class(cls):
cls.Gi = nx.grid_2d_graph(5, 5)
... | gpl-3.0 |
vivianli32/TravelConnect | flask/lib/python3.4/site-packages/setuptools/tests/test_upload_docs.py | 522 | 2139 | """build_ext tests
"""
import sys, os, shutil, tempfile, unittest, site, zipfile
from setuptools.command.upload_docs import upload_docs
from setuptools.dist import Distribution
SETUP_PY = """\
from setuptools import setup
setup(name='foo')
"""
class TestUploadDocsTest(unittest.TestCase):
def setUp(self):
... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.