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 |
|---|---|---|---|---|---|
Y3K/django | django/contrib/messages/storage/cookie.py | 471 | 6545 | import json
from django.conf import settings
from django.contrib.messages.storage.base import BaseStorage, Message
from django.http import SimpleCookie
from django.utils import six
from django.utils.crypto import constant_time_compare, salted_hmac
from django.utils.safestring import SafeData, mark_safe
class Message... | bsd-3-clause |
vgrem/Office365-REST-Python-Client | office365/runtime/queries/client_query.py | 1 | 1772 | class ClientQuery(object):
"""Client query"""
def __init__(self, context, binding_type=None, parameter_type=None, parameter_name=None, return_type=None):
"""
Base query
:type context: office365.runtime.client_runtime_context.ClientRuntimeContext
:type binding_type: office365.ru... | mit |
hbrunn/OpenUpgrade | addons/sale_margin/sale_margin.py | 65 | 4085 | ##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public L... | agpl-3.0 |
morissette/devopsdays-hackathon-2016 | venv/lib/python2.7/site-packages/pymysql/cursors.py | 3 | 9441 | # -*- coding: utf-8 -*-
import struct
import re
try:
import io as StringIO
except ImportError:
import io
from .err import Warning, Error, InterfaceError, DataError, \
DatabaseError, OperationalError, IntegrityError, InternalError, \
NotSupportedError, ProgrammingError
insert_values =... | gpl-3.0 |
arifsetiawan/edx-platform | common/static/js/vendor/mathjax-MathJax-c9db6ac/docs/source/conf.py | 104 | 6453 | # -*- coding: utf-8 -*-
#
# MathJax documentation build configuration file, created by
# sphinx-quickstart on Sun May 16 23:18:19 2010.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All... | agpl-3.0 |
kevinyu98/spark | python/pyspark/mllib/tests/test_linalg.py | 20 | 27083 | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | apache-2.0 |
fintech-circle/edx-platform | lms/djangoapps/teams/tests/test_models.py | 9 | 8004 | # -*- coding: utf-8 -*-
# pylint: disable=no-member
"""Tests for the teams API at the HTTP request level."""
from contextlib import contextmanager
from datetime import datetime
import ddt
import itertools
from mock import Mock
import pytz
from django_comment_common.signals import (
thread_created,
thread_edite... | agpl-3.0 |
mago1chi/cTPR | parse_proc.py | 1 | 3278 | import os
import re
import cTPR
class Parser():
def __init__(self, fileName="tweet.txt"):
self.fileName = fileName
self.parsed_list = []
self.count_dic = {}
self.raw_list = []
def parse(self, tweet):
self.parsed_list = []
self.count_dic = {}
self.raw_list = []
filtered_tweet... | gpl-2.0 |
fedora-infra/fmn | fmn/fasjson_client.py | 1 | 2072 | import logging
import requests
import requests.exceptions
from gssapi import Credentials, exceptions
from requests.compat import urlencode, urljoin
from requests_gssapi import HTTPSPNEGOAuth
log = logging.getLogger(__name__)
class Client(object):
"""
A fasjson client to make very specific requests to fasjs... | lgpl-2.1 |
htzy/bigfour | lms/djangoapps/lms_xblock/test/test_runtime.py | 92 | 6099 | """
Tests of the LMS XBlock Runtime and associated utilities
"""
from django.contrib.auth.models import User
from django.conf import settings
from ddt import ddt, data
from mock import Mock
from unittest import TestCase
from urlparse import urlparse
from opaque_keys.edx.locations import SlashSeparatedCourseKey
from lm... | agpl-3.0 |
dorianamouroux/snak | snak/commands/init.py | 1 | 1780 | import os
from collections import namedtuple
import click
from ..config import GlobalConfig
_, current_folder = os.path.split(os.getcwd())
UserInput = namedtuple('UserInput', ['name', 'version', 'author', 'description'])
class Init(object):
def __init__(self, filename=None):
self.config = GlobalConfi... | mit |
vinchoi/fishplay | flask/lib/python2.7/site-packages/setuptools/command/setopt.py | 156 | 5086 | from distutils.util import convert_path
from distutils import log
from distutils.errors import DistutilsOptionError
import distutils
import os
from setuptools.extern.six.moves import configparser
from setuptools import Command
__all__ = ['config_file', 'edit_config', 'option_base', 'setopt']
def config_file(kind=... | gpl-3.0 |
nylas/sync-engine | inbox/test/api/test_auth.py | 3 | 1866 | import json
from base64 import b64encode
from inbox.test.util.base import generic_account, db # noqa
from inbox.test.api.base import new_api_client # noqa
def test_no_auth(db, generic_account): # noqa
# Because we're using the generic_account namespace
api_client = new_api_client(db, generic_account.nam... | agpl-3.0 |
sinkuri256/python-for-android | python-modules/twisted/twisted/lore/test/test_man2lore.py | 53 | 5770 | # Copyright (c) 2008-2009 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.lore.man2lore}.
"""
from StringIO import StringIO
from twisted.trial.unittest import TestCase
from twisted.lore.man2lore import ManConverter
_TRANSITIONAL_XHTML_DTD = ("""\
<?xml version="1.0"?>
<!DOCTYPE ht... | apache-2.0 |
alimony/django | tests/generic_views/test_dates.py | 26 | 34915 | import datetime
from django.core.exceptions import ImproperlyConfigured
from django.test import TestCase, override_settings, skipUnlessDBFeature
from django.test.utils import requires_tz_support
from django.utils import timezone
from .models import Artist, Author, Book, BookSigning, Page
def _make_books(n, base_dat... | bsd-3-clause |
blorgon9000/pyopus | demo/optimizer/de.py | 1 | 1232 | # Optimize SchwefelA function with differential evolution
# Collect cost function and plot progress
from pyopus.optimizer.de import DifferentialEvolution
from pyopus.problems import glbc
from pyopus.optimizer.base import Reporter, CostCollector, RandomDelay
import pyopus.wxmplplot as pyopl
from numpy import array, zer... | gpl-3.0 |
bhargav2408/python-for-android | python3-alpha/python3-src/Lib/test/test_array.py | 50 | 43475 | #! /usr/bin/env python3
"""Test the arraymodule.
Roger E. Masse
"""
import unittest
from test import support
import weakref
import pickle
import operator
import io
import math
import struct
import warnings
import array
from array import _array_reconstructor as array_reconstructor
class ArraySubclass(array.array)... | apache-2.0 |
juliusbierk/scikit-image | skimage/feature/orb.py | 36 | 12696 | import numpy as np
from ..feature.util import (FeatureDetector, DescriptorExtractor,
_mask_border_keypoints,
_prepare_grayscale_input_2D)
from ..feature import (corner_fast, corner_orientations, corner_peaks,
corner_harris)
from ..tr... | bsd-3-clause |
eilbecklab/phenotipsbot | uou/import-mcad.py | 2 | 5990 | #!/usr/bin/python3
#
# Program for importing patient records from CSV files into PhenoTips
#
# Copyright 2016 University of Utah
#
# This library 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
#... | lgpl-2.1 |
shujaatak/UAV_MissionPlanner | Lib/shelve.py | 225 | 8078 | """Manage shelves of pickled objects.
A "shelf" is a persistent, dictionary-like object. The difference
with dbm databases is that the values (not the keys!) in a shelf can
be essentially arbitrary Python objects -- anything that the "pickle"
module can handle. This includes most class instances, recursive data
type... | gpl-2.0 |
kdwink/intellij-community | python/lib/Lib/subprocess.py | 80 | 60033 | # subprocess - Subprocesses with accessible I/O streams
#
# For more information about this module, see PEP 324.
#
# This module should remain compatible with Python 2.2, see PEP 291.
#
# Copyright (c) 2003-2005 by Peter Astrand <astrand@lysator.liu.se>
#
# Licensed to PSF under a Contributor Agreement.
# See http://ww... | apache-2.0 |
richardliaw/cs286A | dataMover/kafka/system_test/utils/replication_utils.py | 114 | 2968 | # 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... | bsd-2-clause |
edcast-inc/edx-platform-edcast | common/lib/xmodule/xmodule/tests/test_word_cloud.py | 166 | 1792 | # -*- coding: utf-8 -*-
"""Test for Word cloud Xmodule functional logic."""
from webob.multidict import MultiDict
from xmodule.word_cloud_module import WordCloudDescriptor
from . import LogicTest
class WordCloudModuleTest(LogicTest):
"""Logic tests for Word Cloud Xmodule."""
descriptor_class = WordCloudDescr... | agpl-3.0 |
ybellavance/python-for-android | python-modules/twisted/twisted/python/runtime.py | 56 | 2925 | # -*- test-case-name: twisted.python.test.test_runtime -*-
# Copyright (c) 2001-2008 Twisted Matrix Laboratories.
# See LICENSE for details.
# System imports
import os
import sys
import time
import imp
def shortPythonVersion():
hv = sys.hexversion
major = (hv & 0xff000000L) >> 24
minor = (hv & 0x00ff000... | apache-2.0 |
pazeshun/jsk_apc | demos/instance_occlsegm/instance_occlsegm_lib/contrib/instance_occlsegm/extensions/occlusion_segmentation_vis_report.py | 2 | 2791 | import copy
import os
import os.path as osp
import shutil
import chainer
from chainer import training
import numpy as np
import skimage.io
import instance_occlsegm_lib
from ..datasets import visualize_occlusion_segmentation
class OcclusionSegmentationVisReport(training.Extension):
def __init__(self, iterator,... | bsd-3-clause |
kchodorow/tensorflow | tensorflow/contrib/cudnn_rnn/python/kernel_tests/cudnn_rnn_ops_benchmark.py | 45 | 6944 | # 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 |
vabue/RatticWeb | cred/migrations/0018_fix_unicode_filename.py | 7 | 6419 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
"Write your forwards methods here."
# Note: Remember to use orm['appname.ModelName'] rather than "from appname.mo... | gpl-2.0 |
baslr/ArangoDB | 3rdParty/V8/V8-5.0.71.39/tools/swarming_client/third_party/requests/packages/urllib3/contrib/ntlmpool.py | 714 | 4741 | # urllib3/contrib/ntlmpool.py
# Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt)
#
# This module is part of urllib3 and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
NTLM authenticating pool, contributed by erikcederstran
Issue #10, see: http://co... | apache-2.0 |
SysCompass/compass | compass/actions/trigger_install.py | 4 | 1822 | """Module to deploy a given cluster
.. moduleauthor:: Xiaodong Wang <xiaodongwang@huawei.com>
"""
import logging
from compass.db import database
from compass.db.model import Cluster, ClusterState, HostState
from compass.config_management.utils.config_manager import ConfigManager
def trigger_install(clusterid):
... | apache-2.0 |
JioCloud/cinder | cinder/volume/drivers/netapp/dataontap/fc_7mode.py | 3 | 3395 | # Copyright (c) - 2014, Clinton Knight. 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 req... | apache-2.0 |
cwilhelm/django-teams | teams/admin.py | 1 | 5240 | from django.contrib import admin
from django.utils.translation import ugettext_lazy as _
from models import *
class PersonAttributeInline(admin.TabularInline):
model = PersonAttribute
list_display = ('email', 'birthdate', 'height', 'weight')
class PlayerInline(admin.TabularInline):
model = Player
e... | bsd-3-clause |
eleonrk/SickRage | lib/rtorrent/compat.py | 180 | 1258 | # Copyright (c) 2013 Chris Lucas, <chris@chrisjlucas.com>
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, ... | gpl-3.0 |
vaporry/pyethereum | setup.py | 3 | 1786 | import sys
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
class PyTest(TestCommand):
user_options = [('pytest-args=', 'a', "Arguments to pass to py.test")]
def initialize_options(self):
TestCommand.initialize_options(self)
self.pytest_args ... | mit |
kiszk/spark | python/pyspark/tests/test_util.py | 20 | 3065 | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | apache-2.0 |
defance/edx-platform | common/djangoapps/xmodule_django/models.py | 46 | 6250 | """
Useful django models for implementing XBlock infrastructure in django.
"""
import warnings
from django.db import models
from django.core.exceptions import ValidationError
from opaque_keys.edx.keys import CourseKey, UsageKey, BlockTypeKey
class NoneToEmptyManager(models.Manager):
"""
A :class:`django.db.m... | agpl-3.0 |
nooperpudd/pulsar | pulsar/apps/wsgi/html.py | 5 | 2345 | from collections import Mapping
from pulsar.utils.structures import recursive_update
HTML_VISITORS = {}
__all__ = ['HtmlVisitor']
newline = frozenset(('meta', 'link', 'script', 'head', 'body', 'title'))
def html_visitor(tag):
return HTML_VISITORS.get(tag, base)
class HtmlType(type):
def __new__(cls, ... | bsd-3-clause |
fentas/phantomjs | src/breakpad/src/tools/gyp/pylib/gyp/SCons.py | 137 | 5886 | #!/usr/bin/env python
# Copyright (c) 2009 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.
"""
SCons generator.
This contains class definitions and supporting functions for generating
pieces of SCons files for the different types ... | bsd-3-clause |
ryfeus/lambda-packs | Pdf_docx_pptx_xlsx_epub_png/source/pip/_vendor/progress/helpers.py | 404 | 2894 | # Copyright (c) 2012 Giorgos Verigakis <verigak@gmail.com>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE A... | mit |
elimence/edx-platform | common/lib/capa/capa/util.py | 1 | 3147 | from calc import evaluator, UndefinedVariable
from cmath import isinf
#-----------------------------------------------------------------------------
#
# Utility functions used in CAPA responsetypes
def compare_with_tolerance(v1, v2, tol):
''' Compare v1 to v2 with maximum tolerance tol
tol is relative if it ... | agpl-3.0 |
kntem/webdeposit | modules/miscutil/lib/upgrades/invenio_2012_11_21_aiduserinputlog_userid_check.py | 25 | 1738 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2012 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at your option) a... | gpl-2.0 |
lociii/googleads-python-lib | examples/adspygoogle/dfa/v1_19/create_mobile_asset.py | 3 | 2166 | #!/usr/bin/python
#
# Copyright 2012 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 b... | apache-2.0 |
kanagasabapathi/python-for-android | python3-alpha/python3-src/Tools/scripts/pickle2db.py | 116 | 4021 | #!/usr/bin/env python3
"""
Synopsis: %(prog)s [-h|-b|-g|-r|-a|-d] [ picklefile ] dbfile
Read the given picklefile as a series of key/value pairs and write to a new
database. If the database already exists, any contents are deleted. The
optional flags indicate the type of the output database:
-a - open using db... | apache-2.0 |
bohanapp/gaoyuan.org | node_modules/hexo-renderer-scss/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/generator/gypd.py | 1824 | 3474 | # 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.
"""gypd output module
This module produces gyp input as its output. Output files are given the
.gypd extension to avoid overwriting the .gyp files that they are ... | mit |
landism/pants | contrib/findbugs/tests/python/pants_test/contrib/findbugs/tasks/test_findbugs_integration.py | 8 | 6077 | # coding=utf-8
# Copyright 2016 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)
from textwrap import... | apache-2.0 |
ryfeus/lambda-packs | Tensorflow/source/tensorflow/python/data/util/nest.py | 9 | 19296 | # 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... | mit |
david4096/ga4gh-server | ez_setup.py | 30 | 10476 | #!/usr/bin/env python
"""Bootstrap setuptools installation
To use setuptools in your package's setup.py, include this
file in the same directory and add this to the top of your setup.py::
from ez_setup import use_setuptools
use_setuptools()
To require a specific version of setuptools, set a download
mirror, ... | apache-2.0 |
lumig242/Hue-Integration-with-CDAP | desktop/core/ext-py/Pygments-1.3.1/pygments/formatters/latex.py | 59 | 12866 | # -*- coding: utf-8 -*-
"""
pygments.formatters.latex
~~~~~~~~~~~~~~~~~~~~~~~~~
Formatter for LaTeX fancyvrb output.
:copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.formatter import Formatter
from pygments.token import T... | apache-2.0 |
zero-rp/miniblink49 | v8_7_5/tools/adb-d8.py | 6 | 7595 | #!/usr/bin/env python
# Copyright 2017 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Runs an android build of d8 over adb, with any given arguments. Files
# requested by d8 are transferred on-demand from the caller,... | apache-2.0 |
puglia/PMFS-atomic-patch | tools/perf/scripts/python/sched-migration.py | 11215 | 11670 | #!/usr/bin/python
#
# Cpu task migration overview toy
#
# Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com>
#
# perf script event handlers have been generated by perf script -g python
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Fre... | gpl-2.0 |
raybesiga/Spirit | spirit/comment/views.py | 7 | 4116 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib.auth.decorators import login_required
from django.shortcuts import render, redirect, get_object_or_404
from django.views.decorators.http import require_POST
from django.contrib import messages
from django.http import Http404
from djc... | mit |
dawnpower/nova | nova/tests/unit/virt/xenapi/test_volumeops.py | 65 | 24052 | # Copyright (c) 2012 Citrix Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | apache-2.0 |
PaulKinlan/cli-caniuse | site/app/scripts/bower_components/jsrepl-build/extern/python/unclosured/lib/python2.7/imputil.py | 228 | 25764 | """
Import utilities
Exported classes:
ImportManager Manage the import process
Importer Base class for replacing standard import functions
BuiltinImporter Emulate the import mechanism for builtin and frozen modules
DynLoadSuffixImporter
"""
from warnings import warnpy3k
warnpy3k("the imputil... | apache-2.0 |
renanrodm/namebench | nb_third_party/jinja2/filters.py | 199 | 22056 | # -*- coding: utf-8 -*-
"""
jinja2.filters
~~~~~~~~~~~~~~
Bundled jinja filters.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import re
import math
from random import choice
from operator import itemgetter
from itertools import imap, groupby
from jinja2.... | apache-2.0 |
cysuncn/python | spark/crm/PROC_O_CEN_CBOD_REACCACC.py | 1 | 8459 | #coding=UTF-8
from pyspark import SparkContext, SparkConf, SQLContext, Row, HiveContext
from pyspark.sql.types import *
from datetime import date, datetime, timedelta
import sys, re, os
st = datetime.now()
conf = SparkConf().setAppName('PROC_O_CEN_CBOD_REACCACC').setMaster(sys.argv[2])
sc = SparkContext(conf = conf)
s... | gpl-3.0 |
BackupGGCode/python-for-android | python3-alpha/python3-src/Lib/runpy.py | 46 | 11101 | """runpy.py - locating and running Python code using the module namespace
Provides support for locating and running Python scripts using the Python
module namespace instead of the native filesystem.
This allows Python code to play nicely with non-filesystem based PEP 302
importers when locating support scripts as wel... | apache-2.0 |
wonder-sk/QGIS | python/plugins/processing/modeler/CreateNewModelAction.py | 2 | 1855 | # -*- coding: utf-8 -*-
"""
***************************************************************************
CreateNewModelAction.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
******************... | gpl-2.0 |
stevelle/glance | glance/common/exception.py | 1 | 17727 | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# 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 ... | apache-2.0 |
alajara/servo | tests/wpt/css-tests/css-fonts-3_dev/html/reference/support/fonts/makegsubfonts.py | 1616 | 14125 |
import os
import textwrap
from xml.etree import ElementTree
from fontTools.ttLib import TTFont, newTable
from fontTools.misc.psCharStrings import T2CharString
from fontTools.ttLib.tables.otTables import GSUB,\
ScriptList, ScriptRecord, Script, DefaultLangSys,\
FeatureList, FeatureRecord, Feature,\
LookupLi... | mpl-2.0 |
chrisrico/python-trezor | trezorlib/transport_hid.py | 3 | 4787 | '''USB HID implementation of Transport.'''
import hid
import time
import platform
from transport import Transport, ConnectionError, NotImplementedException
DEVICE_IDS = [
(0x10c4, 0xea80), # Shield
(0x534c, 0x0001), # Trezor
]
class FakeRead(object):
# Let's pretend we have a file-like interface
de... | lgpl-3.0 |
jaywink/shoop | shoop/admin/modules/contacts/views/detail.py | 2 | 3333 | # -*- coding: utf-8 -*-
# This file is part of Shoop.
#
# Copyright (c) 2012-2015, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import unicode_literals
from django.conf import settings
fro... | agpl-3.0 |
calebtrahan/KujiIn_Python | backup/guitemplates/setgoaldialog.py | 1 | 5432 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'setgoaldialog.ui'
#
# Created: Tue Dec 23 18:15:13 2014
# by: PyQt4 UI code generator 4.11.3
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except ... | mit |
tzewangdorje/SIPserv | Twisted-13.1.0/twisted/test/test_text.py | 39 | 6494 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.python.text}.
"""
from cStringIO import StringIO
from twisted.trial import unittest
from twisted.python import text
sampleText = \
"""Every attempt to employ mathematical methods in the study of chemical
questions must ... | gpl-3.0 |
aminghadersohi/airflow | airflow/ti_deps/dep_context.py | 32 | 5015 | # -*- coding: utf-8 -*-
#
# 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 |
rikadederika/pychess | lib/pychess/Utils/lutils/leval.py | 20 | 21422 | from __future__ import absolute_import
################################################################################
# The purpose of this module, is to give a certain position a score. The #
# greater the score, the better the position #
#####################################... | gpl-3.0 |
preprocessed-connectomes-project/quality-assessment-protocol | scripts/qap_check_output_csv.py | 1 | 1302 | #!/usr/bin/env python
def main():
import os
import argparse
from qap.script_utils import check_csv_missing_subs, csv_to_pandas_df, \
write_inputs_dict_to_yaml_file, read_yml_file
from qap.qap_utils import raise_smart_exception
parser = argparse.ArgumentParser()
parser.add_argument("o... | bsd-3-clause |
etiennesky/gridoverlay | gridpropertiesdialog.py | 2 | 9510 | """
/***************************************************************************
GridProperties - GUI for setting grid overlay properties.
A QGIS plugin
Overlays a user-definable grid on the map.
-------------------
begin : 2012-05-1... | gpl-2.0 |
rthallisey/kolla-kubernetes-personal | kolla/kolla/tests/base.py | 4 | 1581 | # 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 th... | apache-2.0 |
ageron/tensorflow | tensorflow/lite/python/convert_saved_model.py | 9 | 10002 | # Copyright 2018 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 |
anistark/mozillians | vendor-local/lib/python/celery/db/models.py | 14 | 2231 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from datetime import datetime
import sqlalchemy as sa
from .. import states
from .session import ResultModelBase
# See docstring of a805d4bd for an explanation for this workaround ;)
if sa.__version__.startswith('0.5'):
from .dfd042c7 import Pickle... | bsd-3-clause |
yugang/web-testing-service | wts/tests/csp/csp_connect-src_asterisk.py | 30 | 2912 | def main(request, response):
response.headers.set("Content-Security-Policy", "connect-src *")
response.headers.set("X-Content-Security-Policy", "connect-src *")
response.headers.set("X-WebKit-CSP", "connect-src *")
return """<!DOCTYPE html>
<!--
Copyright (c) 2013 Intel Corporation.
Redistribution and ... | bsd-3-clause |
felipesanches/linux-sunxi | 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 |
asimshankar/tensorflow | tensorflow/contrib/layers/python/layers/rev_block_lib.py | 25 | 24630 | # 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 |
fuzan/rietveld | codereview/patching.py | 23 | 8327 | # Copyright 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 or agreed to in writing, ... | apache-2.0 |
DazWorrall/zulip | zerver/management/commands/rate_limit.py | 115 | 2756 | from __future__ import absolute_import
from zerver.models import UserProfile, get_user_profile_by_email
from zerver.lib.rate_limiter import block_user, unblock_user
from django.core.management.base import BaseCommand
from optparse import make_option
class Command(BaseCommand):
help = """Manually block or unblock... | apache-2.0 |
lyft/incubator-airflow | airflow/providers/amazon/aws/hooks/datasync.py | 2 | 13333 | # 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 |
postvakje/sympy | sympy/polys/benchmarks/bench_solvers.py | 118 | 446839 | from __future__ import print_function, division
from sympy.polys.rings import ring
from sympy.polys.fields import field
from sympy.polys.domains import ZZ, QQ
from sympy.polys.solvers import solve_lin_sys
# Expected times on 3.4 GHz i7:
# In [1]: %timeit time_solve_lin_sys_189x49()
# 1 loops, best of 3: 864 ms per l... | bsd-3-clause |
ksachs/invenio | modules/miscutil/lib/solrutils_bibindex_indexer.py | 21 | 2419 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2011 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at your option) a... | gpl-2.0 |
lscheinkman/nupic | src/nupic/frameworks/opf/exp_description_helpers.py | 10 | 14463 | # ----------------------------------------------------------------------
# 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 |
euklyd/PenguinBot3K | core/Webhook.py | 1 | 3305 | """
Class Name : Webhook
Description:
Contributors:
- Patrick Hennessy
License:
Arcbot is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License v3; as published
by the Free Software Foundation
@webhook... | gpl-3.0 |
ClinicalGraphics/scikit-image | skimage/segmentation/tests/test_join.py | 38 | 2983 | import numpy as np
from numpy.testing import assert_array_equal, assert_raises
from skimage.segmentation import join_segmentations, relabel_sequential
def test_join_segmentations():
s1 = np.array([[0, 0, 1, 1],
[0, 2, 1, 1],
[2, 2, 2, 1]])
s2 = np.array([[0, 1, 1, 0],
... | bsd-3-clause |
dlespiau/checkmate-test-linux | tools/perf/scripts/python/sched-migration.py | 1910 | 11965 | #!/usr/bin/python
#
# Cpu task migration overview toy
#
# Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com>
#
# perf script event handlers have been generated by perf script -g python
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Fre... | gpl-2.0 |
xiandiancloud/edx-platform-Y | lms/djangoapps/courseware/migrations/0007_allow_null_version_in_history.py | 80 | 7637 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'StudentModuleHistory.version'
db.alter_column('courseware_studentmodulehistory', 'version... | agpl-3.0 |
epssy/hue | apps/beeswax/src/beeswax/server/hive_server2_lib.py | 1 | 34891 | #!/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 |
scorphus/django | tests/flatpages_tests/test_templatetags.py | 309 | 7111 | from django.contrib.auth.models import AnonymousUser, User
from django.contrib.flatpages.models import FlatPage
from django.contrib.sites.models import Site
from django.template import Context, Template, TemplateSyntaxError
from django.test import TestCase, modify_settings, override_settings
from .settings import FLAT... | bsd-3-clause |
qstokkink/py-ipv8 | ipv8/keyvault/keys.py | 1 | 1041 | import abc
from hashlib import sha1
class Key(metaclass=abc.ABCMeta):
"""
Interface for a public or private key.
"""
@abc.abstractmethod
def pub(self):
pass
@abc.abstractmethod
def has_secret_key(self):
pass
@abc.abstractmethod
def key_to_bin(self):
pass
... | lgpl-3.0 |
jonge-democraten/zues | appolo/models.py | 1 | 1227 | from django.db import models
class Locatie(models.Model):
def __str__(self):
return self.naam
naam = models.CharField(max_length=200)
lat = models.FloatField()
long = models.FloatField()
class Meta:
verbose_name_plural = 'locaties'
class Dag(models.Model):
def __str__(self):
... | mit |
jdugge/QGIS | python/plugins/db_manager/dlg_add_geometry_column.py | 62 | 2760 | # -*- coding: utf-8 -*-
"""
/***************************************************************************
Name : DB Manager
Description : Database manager plugin for QGIS
Date : Oct 13, 2011
copyright : (C) 2011 by Giuseppe Sucameli
email : brush.tyler@... | gpl-2.0 |
abdhaleegit/avocado-misc-tests | toolchain/power_time_base_bug.py | 4 | 2699 | #!/usr/bin/env python
# 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
# (at your option) any later version.
#
# This program is distributed in the hope that i... | gpl-2.0 |
diagramsoftware/odoo | openerp/addons/base/res/res_font.py | 322 | 7559 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013 OpenERP SA (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
mitdrc/director | src/python/director/bihandeddemo.py | 5 | 26351 | import os
import sys
import vtkAll as vtk
import math
import time
import types
import functools
import numpy as np
from director import transformUtils
from director import lcmUtils
from director.timercallback import TimerCallback
from director.asynctaskqueue import AsyncTaskQueue
from director import objectmodel as om... | bsd-3-clause |
maxmalysh/congenial-octo-adventure | report2/task2_compact.py | 1 | 2980 | import numpy as np
ITERATION_LIMIT = 1000
# initialize the matrix
A = np.array([[10., -1., 2., 0.],
[-1., 11., -1., 3.],
[2., -1., 10., -1.],
[0., 3., -1., 8.]])
A2 = np.array(
[[ 77., -23., -32., 0., 0.],
[-23., 53., 0., 0., -18.],
[-32.,... | unlicense |
2014c2g2/2014c2 | exts/w2/static/Brython2.0.0-20140209-164925/Lib/unittest/util.py | 794 | 4157 | """Various utility functions."""
from collections import namedtuple, OrderedDict
__unittest = True
_MAX_LENGTH = 80
def safe_repr(obj, short=False):
try:
result = repr(obj)
except Exception:
result = object.__repr__(obj)
if not short or len(result) < _MAX_LENGTH:
return result
... | gpl-2.0 |
ffu/DSA-3.2.2 | gr-cvsd-vocoder/src/python/encdec.py | 10 | 2354 | #!/usr/bin/env python
#
# Copyright 2007 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 option)
... | gpl-3.0 |
wagtail/wagtail | wagtail/admin/tests/test_account_management.py | 4 | 33999 | import unittest
import pytz
from django.conf import settings
from django.contrib.auth import get_user_model
from django.contrib.auth import views as auth_views
from django.contrib.auth.models import Group, Permission
from django.contrib.auth.tokens import PasswordResetTokenGenerator
from django.core import mail
from ... | bsd-3-clause |
alsoicode/django-maintenancemode | maintenancemode/middleware.py | 1 | 2247 | import re
from django.conf import settings
from django.contrib.sites.models import Site
from django.core import urlresolvers
from django.db.utils import DatabaseError
import django.conf.urls as urls
from maintenancemode.models import Maintenance, IgnoredURL
urls.handler503 = 'maintenancemode.views.defaults... | bsd-3-clause |
chajadan/dragonfly | dragonfly/engines/backend_sapi5/__init__.py | 5 | 2129 | #
# This file is part of Dragonfly.
# (c) Copyright 2007, 2008 by Christo Butcher
# Licensed under the LGPL.
#
# Dragonfly is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3... | lgpl-3.0 |
grnet/synnefo | snf-cyclades-app/synnefo/logic/management/commands/queue-inspect.py | 10 | 2679 | # Copyright (C) 2010-2014 GRNET S.A.
#
# 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 program is distributed i... | gpl-3.0 |
jocelynmass/nrf51 | toolchain/arm_cm0_deprecated/arm-none-eabi/share/gdb/python/gdb/command/xmethods.py | 47 | 10191 | # Xmethod commands.
# Copyright 2013-2015 Free Software Foundation, 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 License, or
# (at your option) any later version... | gpl-2.0 |
abetkin/app-units | examples/dj/dj/settings.py | 1 | 2088 | """
Django settings for dj project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import ... | mit |
nhuntwalker/astroML | astroML/dimensionality/iterative_pca.py | 3 | 4926 | import sys
import numpy as np
from scipy.linalg import solve
def iterative_pca(X, M, n_ev=5, n_iter=15, norm=None, full_output=False):
"""
Parameters
----------
X: ndarray, shape = (n_samples, n_features)
input data
M: ndarray, bool, shape = (n_samples, n_features)
mask for input... | bsd-2-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.