repo_name stringlengths 5 100 | path stringlengths 4 375 | copies stringclasses 991
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
kxliugang/edx-platform | common/lib/capa/capa/tests/test_hint_functionality.py | 41 | 34139 | # -*- coding: utf-8 -*-
"""
Tests of extended hints
"""
import unittest
from ddt import ddt, data, unpack
# With the use of ddt, some of the data expected_string cases below are naturally long stretches
# of text text without whitespace. I think it's best to leave such lines intact
# in the test code. Therefore:
# ... | agpl-3.0 |
metabolite-atlas/metatlas | metatlas/kbase/handle_service.py | 2 | 27122 | ############################################################
#
# Autogenerated by the KBase type compiler -
# any changes made here will be overwritten
#
# Passes on URLError, timeout, and BadStatusLine exceptions.
# See:
# http://docs.python.org/2/library/urllib2.html
# http://docs.python.org/2/library/htt... | bsd-3-clause |
Esri/executive-dashboard | ExecutiveReportingScript/arcrest/webmap/renderer.py | 6 | 5241 | from __future__ import absolute_import
from __future__ import print_function
from .._abstract.abstract import BaseRenderer
import json
########################################################################
class SimpleRenderer(BaseRenderer):
""" A simple renderer is a renderer that uses one symbol only. The type... | apache-2.0 |
jhaux/tensorflow | tensorflow/python/client/client_lib.py | 111 | 1698 | # 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 |
itai12312/workspaces | hellodjango/venv/lib/python2.7/site-packages/django/utils/http.py | 35 | 8435 | from __future__ import unicode_literals
import calendar
import datetime
import re
import sys
try:
from urllib import parse as urllib_parse
except ImportError: # Python 2
import urllib as urllib_parse
import urlparse
urllib_parse.urlparse = urlparse.urlparse
from email.utils import formatdate
fro... | gpl-2.0 |
zjutjsj1004/third | boost/tools/build/src/util/set.py | 1 | 1486 | # (C) Copyright David Abrahams 2001. Permission to copy, use, modify, sell and
# distribute this software is granted provided this copyright notice appears in
# all copies. This software is provided "as is" without express or implied
# warranty, and with no claim as to its suitability for any purpose.
from b2... | mit |
krattai/noo-ebs | docs/zeroMQ-guide2/examples/Python/kvmsg.py | 1 | 4388 | """
=====================================================================
kvmsg - key-value message class for example applications
Author: Min RK <benjaminrk@gmail.com>
"""
import struct # for packing integers
import sys
from uuid import uuid4
import zmq
# zmq.jsonapi ensures bytes, instead of unicode:
import zmq.u... | bsd-2-clause |
bkrukowski/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/common/find_files.py | 181 | 3872 | # Copyright (C) 2011 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 |
ToonTownInfiniteRepo/ToontownInfinite | Panda3D-1.9.0/python/Tools/Scripts/pathfix.py | 66 | 4329 | #! /usr/bin/env python
# Change the #! line occurring in Python scripts. The new interpreter
# pathname must be given with a -i option.
#
# Command line arguments are files or directories to be processed.
# Directories are searched recursively for files whose name looks
# like a python module.
# Symbolic links are al... | mit |
MaxPoint/bayes_logistic | bayes_logistic/bayes_logistic.py | 2 | 19650 | # Copyright (c) 2015 MaxPoint Interactive, Inc.
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
# following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this list of conditi... | bsd-3-clause |
Cinntax/home-assistant | homeassistant/components/stream/hls.py | 1 | 3398 | """Provide functionality to stream HLS."""
from aiohttp import web
from homeassistant.core import callback
from homeassistant.util.dt import utcnow
from .const import FORMAT_CONTENT_TYPE
from .core import StreamView, StreamOutput, PROVIDERS
@callback
def async_setup_hls(hass):
"""Set up api endpoints."""
ha... | apache-2.0 |
hcsturix74/django | tests/gis_tests/geos_tests/test_io.py | 282 | 3918 | from __future__ import unicode_literals
import binascii
import unittest
from unittest import skipUnless
from django.contrib.gis.geos import (
HAS_GEOS, GEOSGeometry, WKBReader, WKBWriter, WKTReader, WKTWriter,
)
from django.utils.six import memoryview
@skipUnless(HAS_GEOS, "Geos is required.")
class GEOSIOTest(... | bsd-3-clause |
rjschwei/azure-sdk-for-python | azure-mgmt-compute/azure/mgmt/compute/models/win_rm_listener.py | 1 | 1321 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | mit |
mferenca/HMS-ecommerce | ecommerce/extensions/dashboard/orders/views.py | 1 | 3461 | from django.contrib import messages
from django.core.urlresolvers import reverse
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext_lazy as _
from oscar.apps.dashboard.orders.views import (
OrderListView as CoreOrderListView, OrderDetailView as CoreOrderDetailView
)
from osc... | agpl-3.0 |
rosswhitfield/mantid | Framework/PythonInterface/mantid/plots/resampling_image/samplingimage.py | 3 | 10843 | # Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2020 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source,
# Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
# SPDX - License - Identifier: GPL - 3.0 +
impo... | gpl-3.0 |
mrquim/repository.mrquim | script.module.schism.common/lib/requests/packages/urllib3/contrib/appengine.py | 224 | 10865 | """
This module provides a pool manager that uses Google App Engine's
`URLFetch Service <https://cloud.google.com/appengine/docs/python/urlfetch>`_.
Example usage::
from urllib3 import PoolManager
from urllib3.contrib.appengine import AppEngineManager, is_appengine_sandbox
if is_appengine_sandbox():
... | gpl-2.0 |
vuchau/ansible | lib/ansible/inventory/vars_plugins/noop.py | 317 | 1632 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2014, Serge van Ginderachter <serge@vanginderachter.be>
#
# 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 Foundat... | gpl-3.0 |
BrianQMclaren/brianqmclaren.github.io | node_modules/node-gyp/gyp/pylib/gyp/MSVSUtil.py | 1812 | 9537 | # Copyright (c) 2013 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.
"""Utility functions shared amongst the Windows generators."""
import copy
import os
# A dictionary mapping supported target types to extensions.
TARGET_TYPE_EX... | mit |
nhenezi/kuma | vendor/packages/pyparsing/examples/sparser.py | 16 | 13196 | #!/usr/bin/env python
"""
NAME:
sparser.py
SYNOPSIS:
sparser.py [options] filename
DESCRIPTION:
The sparser.py script is a Specified PARSER. It is unique (as far as I can
tell) because it doesn't care about the delimiter(s). The user specifies
what is expected, and the order, for ... | mpl-2.0 |
dbfr3qs/moto | tests/test_ec2/test_spot_instances.py | 11 | 9152 | from __future__ import unicode_literals
from nose.tools import assert_raises
import datetime
import boto
import boto3
from boto.exception import EC2ResponseError
from botocore.exceptions import ClientError
import pytz
import sure # noqa
from moto import mock_ec2, mock_ec2_deprecated
from moto.backends import get_mod... | apache-2.0 |
LLNL/spack | var/spack/repos/builtin/packages/py-csvkit/package.py | 5 | 1739 | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PyCsvkit(PythonPackage):
"""A library of utilities for working with CSV, the king of tabul... | lgpl-2.1 |
yiakwy/numpy | tools/swig/test/testSuperTensor.py | 100 | 16492 | #! /usr/bin/env python
from __future__ import division
# System imports
from distutils.util import get_platform
from math import sqrt
import os
import sys
import unittest
# Import NumPy
import numpy as np
major, minor = [ int(d) for d in np.__version__.split(".")[:2] ]
if major == 0: BadListError = Type... | bsd-3-clause |
cala/portaltbc | dep/libmpq/bindings/python/mpq.py | 501 | 10430 | """wrapper for libmpq"""
# 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 th... | gpl-2.0 |
lampwins/netbox | netbox/ipam/api/views.py | 1 | 11245 | from django.conf import settings
from django.db.models import Count
from django.shortcuts import get_object_or_404
from rest_framework import status
from rest_framework.decorators import action
from rest_framework.exceptions import PermissionDenied
from rest_framework.response import Response
from extras.api.views imp... | apache-2.0 |
kit-cel/wt | nt2/modulation_pulsformung/Spektren_digitale_Modulation.py | 1 | 2940 | # -*- coding: utf-8 -*-
"""
Created on Wed Aug 13 10:31:13 2014
NTII Demo - Quellencodierung - Auswirkungen auf Spektrum des Sendesignals
Systemmodell: Quelle --> QPSK --> Pulsformung
@author: Michael Schwall
"""
from __future__ import division
import numpy as np
import matplotlib.pylab as plt
import scipy.signal a... | gpl-2.0 |
314ish/StudbookToolkit | GTT/SPARKS.py | 1 | 1270 | from dbfread import DBF
class SPARKSReader:
"""These objects can be used to read SPARKS formatted files. SPARKS uses
the dBase format for data storage
For more information on SPARKS see
http://www2.isis.org/support/SPARKS/Pages/home.aspx
For more information on dBase see https://en.wikipedia.org... | mit |
pombredanne/1trillioneuros | libs/relevance/__init__.py | 3 | 1449 | #!/usr/bin/env python
# Encoding: utf-8
# -----------------------------------------------------------------------------
# Project : OKF - Spending Stories
# -----------------------------------------------------------------------------
# Author : Edouard Richard <edou4rd@gmail.com>
# ---... | gpl-3.0 |
pauloricardomg/cassandra-dtest | fqltool_test.py | 6 | 6364 | import pytest
import logging
import os
import subprocess
import tempfile
from dtest import Tester
from shutil import rmtree
since = pytest.mark.since
logger = logging.getLogger(__name__)
@since('4.0')
class TestFQLTool(Tester):
"""
Makes sure fqltool replay and fqltool compare work
@jira_ticket CASSANDR... | apache-2.0 |
rooi/CouchPotatoServer | libs/pyutil/test/out_of_shape/test_strutil.py | 106 | 1713 | #!/usr/bin/env python
# Copyright (c) 2004-2009 Zooko "Zooko" Wilcox-O'Hearn
# This file is part of pyutil; see README.rst for licensing terms.
import unittest
from pyutil.assertutil import _assert
from pyutil import strutil
class Teststrutil(unittest.TestCase):
def test_short_input(self):
self.failUnl... | gpl-3.0 |
sirex/Misago | misago/core/tests/test_migrationutils.py | 8 | 1103 | from django.apps import apps
from django.test import TestCase
from misago.core import migrationutils
from misago.core.models import CacheVersion
class CacheBusterUtilsTests(TestCase):
def test_cachebuster_register_cache(self):
"""
cachebuster_register_cache registers cache on migration successful... | gpl-2.0 |
luuvish/libvio | script/test/model/__init__.py | 1 | 6065 | # -*- coding: utf-8 -*-
'''
================================================================================
This confidential and proprietary software may be used only
as authorized by a licensing agreement from Thumb o'Cat Inc.
In the event of publication, the following notice is applicable:
Copyright (C... | mit |
yavalvas/yav_com | build/matplotlib/doc/mpl_examples/pylab_examples/toggle_images.py | 12 | 1277 | #!/usr/bin/env python
""" toggle between two images by pressing "t"
The basic idea is to load two images (they can be different shapes) and plot
them to the same axes with hold "on". Then, toggle the visible property of
them using keypress event handling
If you want two images with different shapes to be plotted wit... | mit |
marratj/ansible | lib/ansible/plugins/terminal/dellos6.py | 18 | 2789 | # 2016 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distri... | gpl-3.0 |
wangcy6/storm_app | frame/c++/grpc-master/tools/distrib/python/grpcio_tools/protoc_lib_deps.py | 7 | 9700 |
# Copyright 2017 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | apache-2.0 |
2014c2g12/c2g12 | c2wp/wsgi/static/Brython2.1.0-20140419-113919/Lib/re.py | 54 | 11411 | #
# Copyright (c) 2014 Olemis Lang. All rights reserved.
#
# Choose either Javascript (faster) or Python engine based on regex complexity
# with a noticeable preference for the former.
#
r"""Support for regular expressions (RE).
This module provides regular expression matching operations similar to
those found in Pe... | gpl-2.0 |
LingxiaoShawn/Shawn-fusion2017 | lib/werkzeug/contrib/fixers.py | 464 | 9949 | # -*- coding: utf-8 -*-
"""
werkzeug.contrib.fixers
~~~~~~~~~~~~~~~~~~~~~~~
.. versionadded:: 0.5
This module includes various helpers that fix bugs in web servers. They may
be necessary for some versions of a buggy web server but not others. We try
to stay updated with the status of the bug... | apache-2.0 |
nvoron23/socialite | jython/Lib/test/test_closuregen.py | 24 | 1235 | """Jython bug with cell variables and yield"""
from __future__ import generators
def single_closure_single_value():
value = 0
a_closure = lambda : value
yield a_closure()
yield a_closure()
def single_closure_multiple_values():
value = 0
a_closure = lambda : value
yield a_closure()
valu... | apache-2.0 |
variablehair/Eggplantato | cogs/productivity.py | 1 | 14184 | import discord
from discord.ext import commands
import sqlite3
from cogs.utils import errors
from ast import literal_eval
import re
import datetime
import aiohttp
from urllib.parse import parse_qs
from lxml import etree
# Google functions are copied from RoboDanny, accessed on April 6, 2017. https://github.... | mit |
bob-white/UnityIronPythonConsole | Assets/IronPythonConsole/Plugins/Lib/zipfile.py | 81 | 54020 | """
Read and write ZIP files.
"""
import struct, os, time, sys, shutil
import binascii, cStringIO, stat
import io
import re
try:
import zlib # We may need its compression method
crc32 = zlib.crc32
except ImportError:
zlib = None
crc32 = binascii.crc32
__all__ = ["BadZipfile", "error", "ZIP_STORED", "Z... | mpl-2.0 |
gioman/QGIS | python/plugins/processing/algs/saga/SagaAlgorithmProvider.py | 2 | 5490 | # -*- coding: utf-8 -*-
"""
***************************************************************************
SagaAlgorithmProvider.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
*****************... | gpl-2.0 |
sidhujag/devcoin093 | share/qt/extract_strings_qt.py | 321 | 1873 | #!/usr/bin/python
'''
Extract _("...") strings for translation and convert to Qt4 stringdefs so that
they can be picked up by Qt linguist.
'''
from subprocess import Popen, PIPE
import glob
import operator
import os
import sys
OUT_CPP="qt/bitcoinstrings.cpp"
EMPTY=['""']
def parse_po(text):
"""
Parse 'po' for... | mit |
feigames/Odoo | openerp/addons/base/module/wizard/base_import_language.py | 337 | 2644 | # -*- 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 |
asimshankar/tensorflow | tensorflow/contrib/cluster_resolver/cluster_resolver_initialization_test.py | 14 | 2135 | # 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 applicable ... | apache-2.0 |
rlefevre1/hpp-rbprm-corba | script/scenarios/demos/siggraph_asia/plan_execute.py | 10 | 2981 | from hpp.corbaserver.rbprm.rbprmbuilder import Builder
from hpp.corbaserver.rbprm.rbprmfullbody import FullBody
from hpp.gepetto import Viewer
import time
from hpp.corbaserver.rbprm.tools.cwc_trajectory_helper import step, clean,stats, saveAllData, play_traj
from hpp.gepetto import PathPlayer
def act(i, numOptim = 0... | lgpl-3.0 |
fermuch/PokemonGo-Bot | pokemongo_bot/metrics.py | 10 | 4952 | import time
from datetime import timedelta
class Metrics(object):
def __init__(self, bot):
self.bot = bot
self.start_time = time.time()
self.dust = {'start': None, 'latest': None}
self.xp = {'start': None, 'latest': None}
self.distance = {'start': None, 'latest': None}
... | gpl-3.0 |
Liyier/learning_log | env/Lib/site-packages/django/conf/locale/pt_BR/formats.py | 504 | 1434 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = r'j \d\e F \d\e Y'
TIME_FORMAT = '... | mit |
chongtianfeiyu/kbengine | kbe/res/scripts/common/Lib/test/test_getpass.py | 97 | 6437 | import getpass
import os
import unittest
from io import BytesIO, StringIO, TextIOWrapper
from unittest import mock
from test import support
try:
import termios
except ImportError:
termios = None
try:
import pwd
except ImportError:
pwd = None
@mock.patch('os.environ')
class GetpassGetuserTest(unittest.... | lgpl-3.0 |
denik/vwoptimize | vwoptimizelib/third_party/networkx/algorithms/bipartite/basic.py | 32 | 6070 | # -*- coding: utf-8 -*-
"""
==========================
Bipartite Graph Algorithms
==========================
"""
# Copyright (C) 2013-2015 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
import networkx as nx... | mit |
curbthepain/NuK3rn3l_m7_sense_lollipop | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py | 12527 | 1935 | # Util.py - Python extension for perf script, miscellaneous utility code
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
import errno, os
FUTEX_WAIT = 0... | gpl-2.0 |
Matty-Downing2169/opencamlib | scripts/voronoi/voronoi_8_scale-test.py | 7 | 6627 | import ocl
import camvtk
import time
import vtk
import datetime
import math
import random
import numpy as np
import gc
def drawVertex(myscreen, p, vertexColor, rad=1):
myscreen.addActor( camvtk.Sphere( center=(p.x,p.y,p.z), radius=rad, color=vertexColor ) )
def drawEdge(myscreen, e, edgeColor=camvtk.yellow):
... | gpl-3.0 |
paulhayes/fofix | src/Svg.py | 2 | 6963 | #####################################################################
# -*- coding: iso-8859-1 -*- #
# #
# Frets on Fire X #
# Copyright (C) 2006 Sami Kyöstilä ... | gpl-2.0 |
badlogicmanpreet/nupic | examples/opf/experiments/anomaly/spatial/2field_many_novelAtEnd/description.py | 30 | 15834 | # ----------------------------------------------------------------------
# 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 |
KaranToor/MA450 | google-cloud-sdk/.install/.backup/platform/gsutil/third_party/boto/tests/unit/vpc/test_routetable.py | 48 | 20511 | from tests.unit import unittest
from tests.unit import AWSMockServiceTestCase
from boto.vpc import VPCConnection, RouteTable
class TestDescribeRouteTables(AWSMockServiceTestCase):
connection_class = VPCConnection
def default_body(self):
return b"""
<DescribeRouteTablesResponse xmlns="ht... | apache-2.0 |
esc/pybuilder | src/unittest/python/plugins/python/sonarqube_plugin_tests.py | 1 | 3670 | # -*- coding: utf-8 -*-
#
# This file is part of PyBuilder
#
# Copyright 2011-2015 PyBuilder Team
#
# 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/l... | apache-2.0 |
hydroshare/hydroshare | hs_core/views/serializers.py | 1 | 15076 | import json
from collections import namedtuple
from django.core.urlresolvers import reverse
from django.contrib.auth.models import Group, User
from rest_framework import serializers
from hs_core.hydroshare import utils
from hs_core import hydroshare
from .utils import validate_json, validate_user, validate_group
from ... | bsd-3-clause |
jhawkesworth/ansible | lib/ansible/modules/network/netvisor/pn_role.py | 35 | 6334 | #!/usr/bin/python
# Copyright: (c) 2018, Pluribus Networks
# 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': ['... | gpl-3.0 |
surfnzdotcom/cvsnt-fork | libxml/python/tests/compareNodes.py | 87 | 1507 | #!/usr/bin/python -u
import sys
import libxml2
# Memory debug specific
libxml2.debugMemory(1)
#
# Testing XML Node comparison and Node hash-value
#
doc = libxml2.parseDoc("""<root><foo/></root>""")
root = doc.getRootElement()
# Create two different objects which point to foo
foonode1 = root.children
foonode2 = root.... | gpl-2.0 |
SivilTaram/edx-platform | common/djangoapps/third_party_auth/models.py | 7 | 19981 | # -*- coding: utf-8 -*-
"""
Models used to implement SAML SSO support in third_party_auth
(inlcuding Shibboleth support)
"""
from config_models.models import ConfigurationModel, cache
from django.conf import settings
from django.core.exceptions import ValidationError
from django.db import models
from django.utils impor... | agpl-3.0 |
ericmjl/bokeh | sphinx/source/docs/user_guide/examples/interaction_callbacks_for_range_update.py | 1 | 1632 | import numpy as np
from bokeh.layouts import row
from bokeh.models import ColumnDataSource, CustomJS, Rect
from bokeh.plotting import figure, output_file, show
output_file('range_update_callback.html')
N = 4000
x = np.random.random(size=N) * 100
y = np.random.random(size=N) * 100
radii = np.random.random(size=N) * ... | bsd-3-clause |
xujun10110/golismero | thirdparty_libs/django/utils/html.py | 78 | 11180 | """HTML utilities suitable for global use."""
from __future__ import unicode_literals
import re
import string
try:
from urllib.parse import quote, unquote, urlsplit, urlunsplit
except ImportError: # Python 2
from urllib import quote, unquote
from urlparse import urlsplit, urlunsplit
from django.utils... | gpl-2.0 |
chaluemwut/fbserver | venv/lib/python2.7/site-packages/jinja2/testsuite/ext.py | 402 | 18086 | # -*- coding: utf-8 -*-
"""
jinja2.testsuite.ext
~~~~~~~~~~~~~~~~~~~~
Tests for the extensions.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import re
import unittest
from jinja2.testsuite import JinjaTestCase
from jinja2 import Environment, DictLoader... | apache-2.0 |
matthewelse/british-informatics-olympiad | 2011/q3-upsidedown.py | 1 | 1050 | # A solution to the British Informatics Olympiad 2011 Question 3
# Scores 24/24
from __future__ import print_function
try:
input = raw_input
except:
pass
def number_with_n_digits(n):
return 9**(n//2)
def nth_with_n_digits(number_of_digits, n):
if number_of_digits == 0:
return ""
if number_of_digits % 2 == 1:
... | mit |
myjang0507/slte | tools/perf/scripts/python/event_analyzing_sample.py | 4719 | 7393 | # event_analyzing_sample.py: general event handler in python
#
# Current perf report is already very powerful with the annotation integrated,
# and this script is not trying to be as powerful as perf report, but
# providing end user/developer a flexible way to analyze the events other
# than trace points.
#
# The 2 dat... | gpl-2.0 |
remik/django-page-cms | pages/testproj/test_settings.py | 1 | 5420 | # -*- coding: utf-8 -*-
# Django test settings for cms project.
import os
PROJECT_DIR = os.path.dirname(__file__)
TEST_PROJ = 'pages.testproj'
DEBUG = True
USE_TZ = True
ADMINS = (
# ('Your Name', 'your_email@domain.com'),
)
CACHE_BACKEND = 'locmem:///'
MANAGERS = ADMINS
DATABASES = {
'default': {
... | bsd-3-clause |
HaebinShin/tensorflow | tensorflow/python/kernel_tests/clip_ops_test.py | 6 | 9754 | # 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 |
glensc/owncloud-client | admin/win/nsi/l10n/bin/build_locale_nsi.py | 12 | 6085 | ##############################################################################
#
# PROJECT: ownCloud v1.0
# LICENSE: See LICENSE in the top level directory
#
##############################################################################
import collections
import os
import polib
from optparse import OptionPars... | gpl-2.0 |
atiqueahmedziad/addons-server | src/olympia/accounts/urls.py | 3 | 1619 | from django.conf.urls import include, url
from rest_framework.routers import SimpleRouter
from rest_framework_nested.routers import NestedSimpleRouter
from olympia.bandwagon.views import CollectionAddonViewSet, CollectionViewSet
from . import views
accounts = SimpleRouter()
accounts.register(r'account', views.Acco... | bsd-3-clause |
ol-loginov/intellij-community | python/lib/Lib/site-packages/django/contrib/syndication/feeds.py | 245 | 1367 | from django.contrib.syndication import views
from django.core.exceptions import ObjectDoesNotExist
import warnings
# This is part of the deprecated API
from django.contrib.syndication.views import FeedDoesNotExist, add_domain
class Feed(views.Feed):
"""Provided for backwards compatibility."""
def __init__(sel... | apache-2.0 |
DailyActie/Surrogate-Model | 01-codes/tensorflow-master/tensorflow/python/framework/dtypes_test.py | 1 | 10625 | # Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | mit |
eunchong/build | scripts/slave/recipe_modules/cipd/example.py | 1 | 3427 | # Copyright 2015 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.
DEPS = [
'file',
'recipe_engine/path',
'recipe_engine/platform',
'recipe_engine/properties',
'recipe_engine/step',
'cipd',
]
def RunSteps(api):
... | bsd-3-clause |
nathanielvarona/airflow | tests/providers/google/ads/transfers/test_ads_to_gcs.py | 3 | 2455 | # 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 |
dpac-vlsi/SynchroTrace | src/arch/x86/isa/insts/simd128/integer/data_transfer/__init__.py | 91 | 2388 | # Copyright (c) 2007 The Hewlett-Packard Development Company
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implemen... | bsd-3-clause |
goldmedal/spark | examples/src/main/python/ml/one_vs_rest_example.py | 52 | 2236 | #
# 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 |
GenericStudent/home-assistant | homeassistant/components/nws/config_flow.py | 10 | 2946 | """Config flow for National Weather Service (NWS) integration."""
import logging
import aiohttp
from pynws import SimpleNWS
import voluptuous as vol
from homeassistant import config_entries, core, exceptions
from homeassistant.const import CONF_API_KEY, CONF_LATITUDE, CONF_LONGITUDE
from homeassistant.helpers import ... | apache-2.0 |
mhrivnak/pulp | server/test/unit/server/db/model/test_criteria.py | 1 | 8977 | """
Test the pulp.server.db.model.criteria module.
"""
import unittest
from pulp.server import exceptions
from pulp.server.db.model import criteria
FIELDS = set(('sort', 'skip', 'limit', 'filters', 'fields'))
class TestAsDict(unittest.TestCase):
def test_empty(self):
c = criteria.Criteria()
re... | gpl-2.0 |
jyejare/robottelo | tests/foreman/cli/test_puppet.py | 1 | 4056 | """End to end test for Puppet funcionality
:Requirement: Puppet
:CaseAutomation: Automated
:CaseLevel: Acceptance
:CaseComponent: Puppet
:TestType: Functional
:CaseImportance: High
:Upstream: No
"""
import pytest
from robottelo.config import settings
from robottelo.decorators import run_in_one_thread
from robot... | gpl-3.0 |
jolevq/odoopub | addons/l10n_br/__openerp__.py | 430 | 3125 | # -*- encoding: utf-8 -*-
###############################################################################
#
# Copyright (C) 2009 Renato Lima - Akretion
#
# 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 th... | agpl-3.0 |
kallewoof/bitcoin | test/lint/lint-files.py | 13 | 8367 | #!/usr/bin/env python3
# Copyright (c) 2021 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""
This checks that all files in the repository have correct filenames and permissions
"""
import os
import ... | mit |
groschovskiy/lerigos_music | Server/API/lib/pkg_resources/_vendor/packaging/_compat.py | 901 | 1253 | # Copyright 2014 Donald Stufft
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... | apache-2.0 |
mcking49/apache-flask | Python/Lib/ctypes/test/test_parameters.py | 31 | 6432 | import unittest, sys
from ctypes.test import need_symbol
class SimpleTypesTestCase(unittest.TestCase):
def setUp(self):
import ctypes
try:
from _ctypes import set_conversion_mode
except ImportError:
pass
else:
self.prev_conv_mode = set_conversion... | mit |
olasitarska/django | tests/unmanaged_models/tests.py | 49 | 2183 | from __future__ import unicode_literals
from django.db import connection
from django.test import TestCase
from .models import A01, A02, B01, B02, C01, C02, Unmanaged2, Managed1
class SimpleTests(TestCase):
def test_simple(self):
"""
The main test here is that the all the models can be created w... | bsd-3-clause |
ressu/SickGear | lib/hachoir_parser/container/swf.py | 90 | 15001 | """
SWF (Macromedia/Adobe Flash) file parser.
Documentation:
- Alexis' SWF Reference:
http://www.m2osw.com/swf_alexref.html
- http://www.half-serious.com/swf/format/
- http://www.anotherbigidea.com/javaswf/
- http://www.gnu.org/software/gnash/
Author: Victor Stinner
Creation date: 29 october 2006
"""
from li... | gpl-3.0 |
portableant/open-context-py | opencontext_py/apps/ldata/linkannotations/models.py | 1 | 3000 | import hashlib
from django.db import models
from opencontext_py.apps.ldata.linkentities.models import LinkEntityGeneration
# This class stores linked data annotations made on the data contributed to open context
class LinkAnnotation(models.Model):
# predicates indicating that a subject has an object that is a bro... | gpl-3.0 |
futursolo/FurtherLand | foundation/__init__.py | 1 | 4159 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright 2015 Futur Solo
#
# 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
#
# ... | apache-2.0 |
ryuunosukeyoshi/PartnerPoi-Bot | lib/youtube_dl/extractor/facebook.py | 17 | 17957 | # coding: utf-8
from __future__ import unicode_literals
import re
import socket
from .common import InfoExtractor
from ..compat import (
compat_etree_fromstring,
compat_http_client,
compat_urllib_error,
compat_urllib_parse_unquote,
compat_urllib_parse_unquote_plus,
)
from ..utils import (
clea... | gpl-3.0 |
sauloal/cnidaria | scripts/venv/lib/python2.7/encodings/cp864.py | 593 | 33919 | """ Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP864.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_map)
def decode(self,input,errors='strict'):
... | mit |
ESS-LLP/erpnext-medical | erpnext/hotels/doctype/hotel_room_reservation/hotel_room_reservation.py | 7 | 3513 | # -*- coding: utf-8 -*-
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe, json
from frappe.model.document import Document
from frappe import _
from frappe.utils import date_diff, add_days, flt
c... | gpl-3.0 |
panaviatornado/hfhom | corrterm/dehn_homology/grid.py | 2 | 7708 | # Caltech SURF 2013
# FILE: grid.py
# 07.17.13
'''
do stuff with grid diagrams to prepare for CFK^\infty
'''
# winding matrix done by rows (consistent with gridlink)
# TODO bottom row first???
# TODO only knots no links...
from fractions import Fraction
import itertools # list(itertools.permutations([1,2,3]))
# TOD... | gpl-2.0 |
wangxuan007/flasky | venv/lib/python2.7/site-packages/mako/lookup.py | 22 | 12847 | # mako/lookup.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
import os
import stat
import posixpath
import re
from mako import exceptions, util
from mako.templa... | gpl-3.0 |
thomashaw/SecGen | modules/utilities/unix/labtainers/files/Labtainers-master/scripts/gns3/showNet.py | 2 | 1582 | #!/usr/bin/env python
import sys
import os
import argparse
import json
from netaddr import IPNetwork
labtainer_dir = os.getenv('LABTAINER_DIR')
if labtainer_dir is None:
print('Must define LABTAINER_DIR environment variable')
exit(1)
sys.path.append(os.path.join(labtainer_dir, 'scripts', 'labtainer-student','bi... | gpl-3.0 |
zardav/FaceDetection | FaceDetection/temp.py | 1 | 3849 | import numpy as np
from scipy import ndimage, misc
from matplotlib import pyplot as plt
import glob
from MyViola import MyViolaClassifier
from Svm import Svm
import funcs
def find_face(img, shape, mv):
res_i = (0, 0)
res_j = (0, 0)
res_scl = 1
max_ = 0
scales = np.arange(.2, .35, .025)
m, n = ... | gpl-3.0 |
krunal3103/servo | tests/wpt/harness/wptrunner/manifestinclude.py | 118 | 5056 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
"""Manifest structure used to store paths that should be included in a test run.
The manifest is represented by a tree ... | mpl-2.0 |
lapsed/whatbot | requestfinder.py | 1 | 2742 | # Request finder
import time
from mediamonkey import MediaMonkey
from what import WhatCD
from whatdao import WhatDAO
from whatconfig import WhatConfigParser
from whatparser import Parser
class RequestFinder():
def dump_page(self, filename, page):
f = open(filename, 'w')
f.write(page)
f.close()
def find_req... | unlicense |
jriguera/Diamond | src/collectors/portstat/tests/test_portstat.py | 33 | 2035 | from test import CollectorTestCase
from test import get_collector_config
from mock import call, Mock, patch
from unittest import TestCase
from diamond.collector import Collector
from portstat import get_port_stats, PortStatCollector
class PortStatCollectorTestCase(CollectorTestCase):
TEST_CONFIG = {
'... | mit |
hgl888/linux | scripts/gdb/linux/utils.py | 509 | 4833 | #
# gdb helper commands and functions for Linux kernel debugging
#
# common utilities
#
# Copyright (c) Siemens AG, 2011-2013
#
# Authors:
# Jan Kiszka <jan.kiszka@siemens.com>
#
# This work is licensed under the terms of the GNU GPL version 2.
#
import gdb
class CachedType:
def __init__(self, name):
s... | gpl-2.0 |
hehongliang/tensorflow | tensorflow/python/data/experimental/kernel_tests/function_buffering_resource_test.py | 4 | 9699 | # 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 |
yotchang4s/cafebabepy | src/main/python/json/scanner.py | 106 | 2416 | """JSON token scanner
"""
import re
try:
from _json import make_scanner as c_make_scanner
except ImportError:
c_make_scanner = None
__all__ = ['make_scanner']
NUMBER_RE = re.compile(
r'(-?(?:0|[1-9]\d*))(\.\d+)?([eE][-+]?\d+)?',
(re.VERBOSE | re.MULTILINE | re.DOTALL))
def py_make_scanner(context):
... | bsd-3-clause |
easyw/kicad-3d-models-in-freecad | cadquery/FCAD_script_generator/jst/main_generator.py | 1 | 13014 | # -*- coding: utf8 -*-
#!/usr/bin/python
#
# This was originaly derived from a cadquery script for generating PDIP models in X3D format
# from https://bitbucket.org/hyOzd/freecad-macros
# author hyOzd
#
# Adapted by easyw for step and vrlm export
# See https://github.com/easyw/kicad-3d-models-in-freecad
## requirement... | gpl-2.0 |
nvertigo/AK-OnePone | scripts/gcc-wrapper.py | 1276 | 3382 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2011-2012, The Linux Foundation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain th... | gpl-2.0 |
guru-digital/CouchPotatoServer | libs/requests/packages/urllib3/packages/six.py | 2375 | 11628 | """Utilities for writing code that runs on Python 2 and 3"""
#Copyright (c) 2010-2011 Benjamin Peterson
#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 l... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.