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 |
|---|---|---|---|---|---|
felix-d/boto | boto/dynamodb/exceptions.py | 185 | 1687 | """
Exceptions that are specific to the dynamodb module.
"""
from boto.exception import BotoServerError, BotoClientError
from boto.exception import DynamoDBResponseError
class DynamoDBExpiredTokenError(BotoServerError):
"""
Raised when a DynamoDB security token expires. This is generally boto's
(or the us... | mit |
richardliaw/ray | rllib/examples/env/multi_agent.py | 2 | 6055 | import gym
from ray.rllib.env.multi_agent_env import MultiAgentEnv
from ray.rllib.examples.env.stateless_cartpole import StatelessCartPole
from ray.rllib.tests.test_rollout_worker import MockEnv, MockEnv2
def make_multiagent(env_name_or_creator):
class MultiEnv(MultiAgentEnv):
def __init__(self, config):... | apache-2.0 |
PeterWangIntel/chromium-crosswalk | build/mac/find_sdk.py | 77 | 3340 | #!/usr/bin/env python
# Copyright (c) 2012 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.
"""Prints the lowest locally available SDK version greater than or equal to a
given minimum sdk version to standard output.
Usage:... | bsd-3-clause |
scVENUS/PeekabooAV | peekaboo/config.py | 1 | 21034 | ###############################################################################
# #
# Peekaboo Extended Email Attachment Behavior Observation Owl #
# #
... | gpl-3.0 |
hgomersall/myhdl | myhdl/_Cosimulation.py | 2 | 6543 | # This file is part of the myhdl library, a Python package for using
# Python as a Hardware Description Language.
#
# Copyright (C) 2003-2008 Jan Decaluwe
#
# The myhdl 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 t... | lgpl-2.1 |
lacava/few | setup.py | 1 | 3433 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
from setuptools.extension import Extension
from Cython.Build import cythonize
# the setup file relies on eigency to import its include paths for the
# extension modules. however eigency isn't known as a dependency until after
# s... | gpl-3.0 |
whinedo/sdnlb | clb.py | 2 | 2240 | #!/usr/env/python
import multiprocessing
import socket
import logging
import sys,re
import commands
import psutil
def getConnections(port,data):
cmd = "netstat -anp | grep %s | grep ESTABLISHED | wc -l"%port
connRe = re.compile('\d+$')
status,output = commands.getstatusoutput(cmd)
res = 0
for line in output:
... | gpl-3.0 |
fumanne/miscellaneous | miscellaneous/MisIP2Country.py | 1 | 11505 | #! -*- coding: utf-8 -*-
import os, sys
import socket
import struct
import re
import sqlite3
from collections import namedtuple
from miscellaneous.MisExceptions import FileNotFoundError
from miscellaneous.MisExceptions import IP2CountryStatusError
from urllib.request import urlopen
from binascii import hexlify
import ... | gpl-3.0 |
VoiDeD/Sick-Beard | cherrypy/lib/httputil.py | 35 | 15926 | """HTTP library functions."""
# This module contains functions for building an HTTP application
# framework: any one, not just one whose name starts with "Ch". ;) If you
# reference any modules from some popular framework inside *this* module,
# FuManChu will personally hang you up by your thumbs and submit you
... | gpl-3.0 |
Chilledheart/chromium | tools/telemetry/third_party/gsutilz/third_party/apitools/samples/storage_sample/storage/storage_v1.py | 12 | 114656 | #!/usr/bin/env python
"""CLI for storage, version v1."""
import code
import platform
import sys
import protorpc
from protorpc import message_types
from protorpc import messages
from google.apputils import appcommands
import gflags as flags
import apitools.base.py as apitools_base
from apitools.base.py import cli as... | bsd-3-clause |
luser/socorro | socorro/processor/processor_app.py | 2 | 7734 | #! /usr/bin/env python
# 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/.
"""the processor_app converts raw_crashes into processed_crashes"""
import os
from configman im... | mpl-2.0 |
solring/TWCompanyTree | TWCTenv/lib/python2.7/site-packages/pip/vendor/html5lib/treewalkers/lxmletree.py | 80 | 6214 | from __future__ import absolute_import, division, unicode_literals
from pip.vendor.six import text_type
from lxml import etree
from ..treebuilders.etree import tag_regexp
from gettext import gettext
_ = gettext
from . import _base
from .. import ihatexml
def ensure_str(s):
if s is None:
return None
... | unlicense |
sugartom/tensorflow-alien | tensorflow/python/ops/nn.py | 21 | 4024 | # 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 |
highweb-project/highweb-webcl-html5spec | third_party/WebKit/LayoutTests/http/tests/websocket/unicode_wsh.py | 42 | 2082 | # Copyright (C) 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 ... | bsd-3-clause |
bobcyw/py2app | py2app/bootstrap/virtualenv.py | 10 | 1299 | def _fixup_virtualenv(real_prefix):
import sys, os
sys.real_prefix = real_prefix
# NOTE: The adjustment code is based from logic in the site.py
# installed by virtualenv 1.8.2 (but simplified by removing support
# for platforms that aren't supported by py2app)
paths = [os.path.join(sys.real_pr... | mit |
jlegendary/Dato-Core | src/unity/python/graphlab/data_structures/sketch.py | 13 | 28042 | """
Efficiently compute the approximate statistics over an SArray.
"""
'''
Copyright (C) 2015 Dato, Inc.
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the DATO-PYTHON-LICENSE file for details.
'''
import operator
import graphlab.connect as _mt
import graphl... | agpl-3.0 |
mitaka/fun | core/views.py | 1 | 3777 | from django.views.generic.edit import CreateView, UpdateView
from django.views.generic.list import ListView
from django.views.generic.detail import DetailView
from django.shortcuts import get_object_or_404
from django.core.urlresolvers import reverse
from django.db import IntegrityError
from django.http import HttpRes... | gpl-2.0 |
RESTfactory/presence | presence/urls.py | 1 | 1334 | """presence URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-b... | gpl-3.0 |
sinkuri256/python-for-android | python3-alpha/python3-src/Lib/encodings/utf_16_le.py | 860 | 1037 | """ Python 'utf-16-le' Codec
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""
import codecs
### Codec APIs
encode = codecs.utf_16_le_encode
def decode(input, errors='strict'):
return codecs.utf_16_le_decode(input, errors, True)
class IncrementalEncod... | apache-2.0 |
Serg09/socorro | webapp-django/crashstats/base/helpers.py | 11 | 1502 | import cgi
import urllib
import jinja2
from jingo import register
@register.function
@jinja2.contextfunction
def change_query_string(context, **kwargs):
"""
Template function for modifying the current URL by parameters.
You use it like this in a template:
<a href={{ change_query_string(foo='bar'... | mpl-2.0 |
RENCI/xDCIShare | hs_collection_resource/receivers.py | 4 | 1303 | from django.dispatch import receiver
from hs_core.signals import pre_add_files_to_resource, pre_check_bag_flag, pre_download_file
from hs_core.hydroshare.utils import set_dirty_bag_flag
from hs_collection_resource.models import CollectionResource
from hs_collection_resource.utils import update_collection_list_csv
@... | bsd-3-clause |
lnls-fac/sirius_wiki | read_parameters.py | 1 | 1507 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Read pages from Parameter namespace in old wiki and save in new wiki."""
import requests
import pywikibot
import pywikibot.pagegenerators
import config
PARAMETER_NS = 104
old_site = pywikibot.Site('en', 'siriuswiki')
g = pywikibot.pagegenerators.AllpagesPageGenerat... | mit |
lasalesi/erpnext | erpnext/hr/doctype/leave_allocation/leave_allocation.py | 33 | 5531 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import flt, date_diff, formatdate
from frappe import _
from frappe.model.document import Document
from erpnext.hr.utils ... | gpl-3.0 |
begoldsm/autorest | src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyByte/autorestswaggerbatbyteservice/models/error.py | 432 | 1285 | # 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 |
keedio/hue | desktop/core/ext-py/django-openid-auth-0.5/django_openid_auth/tests/test_auth.py | 42 | 7714 | # django-openid-auth - OpenID integration for django.contrib.auth
#
# Copyright (C) 2010-2013 Canonical Ltd.
#
# 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 ... | apache-2.0 |
ifdog/SIASUNRobotController | parawriter.py | 1 | 1233 | # -*- coding: gbk -*-
__author__ = 'ifdog'
"""
V2,"参数在./pos.txt"
"""
def getpos():
a=open("./pos.txt")
b=a.readlines()
i,j,k=b[0:3]
return float(i),float(j),float(k)
def writepos(aa,bb,cc):
a=open("./pos.txt","w")
a.write(str(aa))
a.write('\n')
a.write(str(bb))
a.write('\n')
a.w... | gpl-3.0 |
agrc/bb-econ | scripts/geocoding.py | 1 | 2734 | #!/usr/bin/env python
# * coding: utf8 *
'''
geocoding.py
A module for geocoding addresses via AGRC's web api
'''
import requests
import time
import random
import json
from os.path import abspath, dirname, join, exists
def api_retry(api_call):
"""Retry and api call if calling method returns None."""
def ret... | mit |
swarlesbarkely/PyCharm | CountingBytes/CountingBytes.py | 1 | 2084 | ##############################################################################
# Counts the number of programming bytes in a hex or s19 file
# Inputs: File, Size Limit (optional)
# Outputs: Byte count, % used of size limit (if given)
##############################################################################
import... | gpl-2.0 |
Java1Guy/ansible-modules-extras | database/vertica/vertica_facts.py | 148 | 9176 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#... | gpl-3.0 |
linnnh/Tenkiba | weatherbot-2.py | 1 | 4094 | #!/usr/bin/env python
import sys, re
import getopt, os
import json
import nltk
from weathercom import get_weathercom
def usage():
print "weatherbot.py [-u \"Celsius\"] [-c \"San Francisco\"]"
if __name__=="__main__":
# set user model defaults
default_unit = "Celsius"
default_city = "San Francisco"... | mit |
shermanng10/superathletebuilder | env/lib/python2.7/site-packages/django/conf/locale/nb/formats.py | 197 | 1766 | # -*- 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 = 'j. F Y'
TIME_FORMAT = 'H:i'
DATET... | mit |
abhishekarora12/ansible | test/units/plugins/connections/test_connection.py | 86 | 3988 | # (c) 2015, Toshio Kuratomi <tkuratomi@ansible.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later... | gpl-3.0 |
houseind/robothon | kerningSeperator.py | 1 | 1281 | # Separate out kerning by unicode script value
import os
from defcon import Font
def separate(fontPath, unicodeScript, DELETE=False):
""" Takes a font and removes any kerning that isn't either a group kern or
a kern with a glyph from the specified unicode script category. See
http://www.unicode.or... | mit |
soldag/home-assistant | homeassistant/components/tile/device_tracker.py | 13 | 4003 | """Support for Tile device trackers."""
import logging
from homeassistant.components.device_tracker.config_entry import TrackerEntity
from homeassistant.components.device_tracker.const import SOURCE_TYPE_GPS
from homeassistant.config_entries import SOURCE_IMPORT
from homeassistant.const import CONF_PASSWORD, CONF_USER... | apache-2.0 |
inspyration/odoo | addons/mrp/wizard/__init__.py | 374 | 1199 | # -*- 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 |
JanetteA/dsmsales | sites/all/libraries/openlayers/tests/selenium/remotecontrol/selenium.py | 254 | 69389 |
"""
Copyright 2006 ThoughtWorks, 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, sof... | gpl-2.0 |
Spiderlover/Toontown | toontown/coghq/GoonClipPlane.py | 5 | 1282 | from pandac.PandaModules import *
from direct.interval.IntervalGlobal import *
from otp.level import BasicEntities
class GoonClipPlane(BasicEntities.NodePathEntity):
def __init__(self, level, entId):
BasicEntities.NodePathEntity.__init__(self, level, entId)
self.zoneNum = self.getZoneEntity().getZ... | mit |
dbentley/pants | src/python/pants/option/options.py | 1 | 13830 | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import copy
import s... | apache-2.0 |
vaginessa/pyload | pyLoadCore.py | 34 | 22485 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
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 prog... | gpl-3.0 |
paolodedios/tensorflow | tensorflow/python/kernel_tests/signal/reconstruction_ops_test.py | 23 | 8957 | # 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 |
tima/ansible-modules-core | commands/script.py | 35 | 2631 | # This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that ... | gpl-3.0 |
brmson/label-lookup | liblookup/ntfile.py | 1 | 1770 | """
Utilities for loading .nt RDF triple files.
"""
def load_literals(nt_filename, first=0):
"""
From an .nt file, produce a dict mapping between the first and last
elements.
We make some strong assumptions:
* the first element is DBpedia resource
* the middle element is always the same predic... | apache-2.0 |
povilasb/pycollection-pipelines | collection_pipelines/core.py | 1 | 2314 | import functools
from typing import Callable
def coroutine(fn: Callable):
def wrapper(*args, **kwargs):
generator = fn(*args, **kwargs)
next(generator)
return generator
return wrapper
class CollectionPipelineProcessor:
sink = None
start_source = None
receiver = None
... | mit |
manuelmagix/kernel_bq_piccolo | arch/ia64/scripts/unwcheck.py | 13143 | 1714 | #!/usr/bin/python
#
# Usage: unwcheck.py FILE
#
# This script checks the unwind info of each function in file FILE
# and verifies that the sum of the region-lengths matches the total
# length of the function.
#
# Based on a shell/awk script originally written by Harish Patil,
# which was converted to Perl by Matthew Ch... | apache-2.0 |
openshift/openshift-tools | openshift/installer/vendored/openshift-ansible-3.9.40/roles/lib_openshift/library/oc_serviceaccount_secret.py | 4 | 60381 | #!/usr/bin/env python
# pylint: disable=missing-docstring
# flake8: noqa: T001
# ___ ___ _ _ ___ ___ _ _____ ___ ___
# / __| __| \| | __| _ \ /_\_ _| __| \
# | (_ | _|| .` | _|| / / _ \| | | _|| |) |
# \___|___|_|\_|___|_|_\/_/_\_\_|_|___|___/_ _____
# | \ / _ \ | \| |/ _ \_ _| | __| \_ ... | apache-2.0 |
GaZ3ll3/numba | numba/cuda/tests/cudapy/test_gufunc_scheduling.py | 7 | 2777 | from __future__ import absolute_import, print_function, division
from numba.npyufunc.deviceufunc import GUFuncEngine
from numba import unittest_support as unittest
def template(signature, shapes, expects):
gufb = GUFuncEngine.from_signature(signature)
sch = gufb.schedule(shapes)
for k, v in expects.items(... | bsd-2-clause |
candy7393/VTK | Utilities/vtkTclTest2Py/vtkTclToPyConvertor.py | 24 | 18789 | # This is the translator that converts Tcl test to python.
# Not all Tcl test are translatable.
# To ensure that a test can be translated :
# 1) do not use Tcl arrays
# 2) do not use string substitution except in variable names
# eg. obj${i} GetOutput is okay
# obj12 GetOutputAs${i} is not okay.
# 3) do not u... | bsd-3-clause |
abdulhaq-e/django-rest-framework-jwt | tests/test_views.py | 14 | 12321 | from calendar import timegm
from datetime import datetime, timedelta
from django import get_version
from django.test import TestCase
from django.test.utils import override_settings
from django.utils import unittest
from django.conf.urls import patterns
from freezegun import freeze_time
from rest_framework import statu... | mit |
kaiserroll14/301finalproject | main/numpy/distutils/command/__init__.py | 264 | 1098 | """distutils.command
Package containing implementation of all the standard Distutils
commands.
"""
from __future__ import division, absolute_import, print_function
def test_na_writable_attributes_deletion():
a = np.NA(2)
attr = ['payload', 'dtype']
for s in attr:
assert_raises(AttributeError, de... | gpl-3.0 |
KrzyHonk/bpmn-python | bpmn_python/bpmn_diagram_layouter.py | 1 | 20968 | # coding=utf-8
"""
Package with BPMNDiagramGraph - graph representation of BPMN diagram
"""
import copy
import bpmn_python.bpmn_python_consts as consts
import bpmn_python.grid_cell_class as cell_class
def generate_layout(bpmn_graph):
"""
:param bpmn_graph: an instance of BPMNDiagramGraph class.
"""
c... | gpl-3.0 |
RafaelTorrealba/odoo | addons/l10n_us/__init__.py | 893 | 1045 | # -*- 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 |
betoesquivel/fil2014 | build/django/django/contrib/gis/admin/widgets.py | 111 | 4809 | import logging
from django.forms.widgets import Textarea
from django.template import loader, Context
from django.utils import six
from django.utils import translation
from django.contrib.gis.gdal import OGRException
from django.contrib.gis.geos import GEOSGeometry, GEOSException
# Creating a template context that co... | mit |
rm-hull/luma.core | luma/core/legacy/__init__.py | 1 | 3138 | # -*- coding: utf-8 -*-
# Copyright (c) 2017-18 Richard Hull and contributors
# See LICENSE.rst for details.
"""
These methods were originally present in the old MAX7219 driver, and are
preserved here only to aid migration away from that library. The functions are
denoted 'legacy' to discourage use - you are encourage... | mit |
highweb-project/highweb-webcl-html5spec | net/data/websocket/header-continuation_wsh.py | 47 | 1102 | # 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.
#
# The purpose of this test is to verify that WebSocket supports header
# continuations, as deprecated in RFC7230 section 3.2.4.
# It is used by test case We... | bsd-3-clause |
butchman0922/gourmet | gourmet/plugins/browse_recipes/browser.py | 6 | 9268 | import gtk, gobject, os.path
from gourmet.gglobals import DEFAULT_ATTR_ORDER, REC_ATTR_DIC
from gourmet.ImageExtras import get_pixbuf_from_jpg
import gourmet.convert as convert
from gourmet.gtk_extras.ratingWidget import star_generator
from sqlalchemy.sql import and_, or_, not_
from sqlalchemy import func
from gettext ... | gpl-2.0 |
sirex/Misago | misago/acl/providers.py | 9 | 2069 | from importlib import import_module
from django.conf import settings
__ALL__ = ['providers']
# Manager for permission providers
class PermissionProviders(object):
def __init__(self):
self._initialized = False
self._providers = []
self._providers_dict = {}
self._annotators = {}
... | gpl-2.0 |
hopeall/odoo | openerp/tools/misc.py | 62 | 45907 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2014 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you ca... | agpl-3.0 |
eadgarchen/tensorflow | tensorflow/python/ops/nn_impl.py | 8 | 53908 | # 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 |
geduino-foundation/kernel-unico | 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 |
fyfcauc/android_external_chromium-org | build/android/gyp/util/build_device.py | 52 | 2894 | # Copyright 2013 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.
""" A simple device interface for build steps.
"""
import logging
import os
import re
import sys
import build_utils
BUILD_ANDROID_DIR = os.path.join(os.p... | bsd-3-clause |
kongscn/pyctp | example/pyctp2/testbed/tqueue.py | 7 | 6474 | # -*- coding:utf-8 -*-
'''
同步排序队列的测试:
实际上, PriorityQueue就是用heapq实现的阻塞式队列
'''
import time
import bisect
from heapq import *
import threading
import queue
from collections import deque
"""
在满足功能要求的情况下, heapq的方式最快也最简洁效率最稳定
均为 100次循环,每次循环先插入1000个,然后弹出所有 #这个不是使用环境
在正式使用环境下,因为排序方式不需要全部检查,所以开销会比测试的要... | mit |
ares/robottelo | robottelo/cli/location.py | 16 | 5994 | # -*- encoding: utf-8 -*-
# (Too many public methods) pylint: disable=R0904
"""
Usage::
hammer location [OPTIONS] SUBCOMMAND [ARG] ...
Parameters::
SUBCOMMAND subcommand
[ARG] ... subcommand arguments
Subcommands::
add-compute-resource Associate a com... | gpl-3.0 |
patrickwind/My_Blog | venv/lib/python2.7/site-packages/pip/_vendor/html5lib/treewalkers/__init__.py | 1229 | 2323 | """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-2.0 |
mixturemodel-flow/tensorflow | tensorflow/contrib/training/python/training/sampling_ops.py | 39 | 17187 | # 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 |
tangi75/expfactory-python | expfactory/survey.py | 2 | 29281 | '''
survey.py: part of expfactory package
Functions to work with javascript surveys
'''
from expfactory.experiment import get_experiments
from exceptions import ValueError
from glob import glob
import pandas
import json
import uuid
import re
import os
def get_surveys(survey_repo=None,load=False,warning=True,repo_typ... | mit |
jwomeara/mapnik | scons/scons-local-2.3.4/SCons/Tool/aixc++.py | 9 | 2383 | """SCons.Tool.aixc++
Tool-specific initialization for IBM xlC / Visual Age C++ compiler.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001 - 2014 The SCons Foundation
#
# Permission is h... | lgpl-2.1 |
allynt/tings | T/tings/templatetags/t_tags.py | 1 | 2025 | from django import template
from django.db.models.query import QuerySet
from django.core.serializers import serialize
from django.utils.safestring import mark_safe
import json
from T.tings import get_version
from T.tings.t_constants import *
register = template.Library()
#####################
# get static things #
... | mit |
pwong-mapr/private-hue | desktop/core/ext-py/django-extensions-0.5/django_extensions/management/commands/graph_models.py | 15 | 2759 | from django.core.management.base import BaseCommand, CommandError
from optparse import make_option
from django_extensions.management.modelviz import generate_dot
class Command(BaseCommand):
option_list = BaseCommand.option_list + (
make_option('--disable-fields', '-d', action='store_true', dest='disable_fi... | apache-2.0 |
digitalocean/netbox | netbox/dcim/api/urls.py | 1 | 2680 | from netbox.api import OrderedDefaultRouter
from . import views
router = OrderedDefaultRouter()
router.APIRootView = views.DCIMRootView
# Sites
router.register('regions', views.RegionViewSet)
router.register('sites', views.SiteViewSet)
# Racks
router.register('rack-groups', views.RackGroupViewSet)
router.register('... | apache-2.0 |
xzturn/tensorflow | tensorflow/examples/speech_commands/label_wav_dir.py | 17 | 4773 | # 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 |
pybrain2/pybrain2 | pybrain/rl/environments/serverinterface.py | 25 | 1092 | __author__ = 'Frank Sehnke, sehnke@in.tum.de'
from .environment import Environment
class GraphicalEnvironment(Environment):
""" Special type of environment that has graphical output and therefore needs a renderer.
"""
def __init__(self):
self.renderInterface = None
def setRenderInterface(sel... | bsd-3-clause |
n0trax/ansible | lib/ansible/modules/packaging/os/slackpkg.py | 24 | 6129 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Kim Nørgaard
# Written by Kim Nørgaard <jasen@jasen.dk>
# Based on pkgng module written by bleader <bleader@ratonland.org>
# that was based on pkgin module written by Shaun Zinck <shaun.zinck at gmail.com>
# that was based on pacman module written by Afterburn <htt... | gpl-3.0 |
yfried/ansible | lib/ansible/modules/cloud/google/gcp_pubsub_subscription.py | 8 | 12693 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Google
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
... | gpl-3.0 |
jasper1918/bioconda-recipes | recipes/wtforms-components/setup.py | 63 | 2635 | """
WTForms-Components
------------------
Additional fields, validators and widgets for WTForms.
"""
from setuptools import setup
import os
import re
import sys
HERE = os.path.dirname(os.path.abspath(__file__))
PY3 = sys.version_info[0] == 3
def get_version():
filename = os.path.join(HERE, 'wtforms_components... | mit |
mjirayu/sit_academy | openedx/core/lib/api/authentication.py | 87 | 3391 | """ Common Authentication Handlers used across projects. """
from rest_framework import authentication
from rest_framework.exceptions import AuthenticationFailed
from rest_framework.compat import oauth2_provider, provider_now
class SessionAuthenticationAllowInactiveUser(authentication.SessionAuthentication):
"""E... | agpl-3.0 |
kenshay/ImageScripter | ProgramData/SystemFiles/Python/Lib/site-packages/elan/Pools/AddRemove/5_Count_Video_Communication_Devices.py | 2 | 1266 |
from ImageScripter import *
from elan.functions import Get_Device_List_Simple,Diff
from elan import *
Past_List = ['AvioSys IP Video 9100B', 'Generic Serial', 'IC Realtime DVR-FLEX16E', 'IC Realtime DVR-FLEX4E', 'IC Realtime DVR-FLEX8E', 'SnapAV Luma 500 DVR 16CH', 'SnapAV Luma 500 DVR 4CH', 'SnapAV Luma 500 DVR 8CH... | gpl-3.0 |
shashisp/blumix-webpy | app/gluon/contrib/fpdf/html.py | 41 | 14522 | # -*- coding: latin-1 -*-
"HTML Renderer for FPDF.py"
__author__ = "Mariano Reingart <reingart@gmail.com>"
__copyright__ = "Copyright (C) 2010 Mariano Reingart"
__license__ = "LGPL 3.0"
# Inspired by tuto5.py and several examples from fpdf.org, html2fpdf, etc.
from fpdf import FPDF
from HTMLParser import HTMLParser... | mit |
masierra/ardupilot | mk/PX4/Tools/genmsg/src/genmsg/srvs.py | 216 | 3017 | # Software License Agreement (BSD License)
#
# Copyright (c) 2008, Willow Garage, 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... | gpl-3.0 |
tfrdidi/PhiDi | libs/werkzeug/exceptions.py | 316 | 17799 | # -*- coding: utf-8 -*-
"""
werkzeug.exceptions
~~~~~~~~~~~~~~~~~~~
This module implements a number of Python exceptions you can raise from
within your views to trigger a standard non-200 response.
Usage Example
-------------
::
from werkzeug.wrappers import BaseRequest
... | apache-2.0 |
ceci/pygments-hack | pygments/lexers/asm.py | 72 | 11831 | # -*- coding: utf-8 -*-
"""
pygments.lexers.asm
~~~~~~~~~~~~~~~~~~~
Lexers for assembly languages.
:copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, include, bygroups, using, DelegatingL... | bsd-2-clause |
khalibartan/Antidote-DM | Antidotes DM/youtube_dl/extractor/historicfilms.py | 142 | 1580 | from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import parse_duration
class HistoricFilmsIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?historicfilms\.com/(?:tapes/|play)(?P<id>\d+)'
_TEST = {
'url': 'http://www.historicfilms.com/tapes/4728',
'md5'... | gpl-2.0 |
johnkit/vtk-dev | Accelerators/Piston/Testing/Python/TestConversion.py | 21 | 3049 | #!/usr/bin/env python
"""
This tests the ability to send data back and forth between the CPU and GPU.
"""
import sys
import vtk
from vtk.test import Testing
from PistonTestCommon import *
class TestConversion(Testing.vtkTest):
def testConversion(self):
global args
writefiles = "SaveData" in args
src ... | bsd-3-clause |
buborh/grakernel-n1 | 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 |
RJ/otp | lib/asn1/test/asn1_SUITE_data/Set.py | 94 | 1732 | Set DEFINITIONS IMPLICIT TAGS ::=
BEGIN
IMPORTS Seq1 FROM SeqSetLib;
Set ::= SET
{
bool BOOLEAN,
boolCon [20] BOOLEAN,
boolPri [PRIVATE 21] BOOLEAN,
boolApp [APPLICATION 22] BOOLEAN,
boolExpCon [30] EXPLICIT BOOLEAN,
boolExpPri [PRIVATE 31] EXPLICIT BOOLEAN,
boolExpApp [APPLICATION 32] EXPLICIT B... | apache-2.0 |
carlgao/lenga | images/lenny64-peon/usr/share/python-support/python-django/django/utils/html.py | 116 | 7418 | """HTML utilities suitable for global use."""
import re
import string
from django.utils.safestring import SafeData, mark_safe
from django.utils.encoding import force_unicode
from django.utils.functional import allow_lazy
from django.utils.http import urlquote
# Configuration for urlize() function.
LEADING_PUNCTUATIO... | mit |
Lab603/PicEncyclopedias | jni-build/jni/include/tensorflow/examples/how_tos/reading_data/fully_connected_preloaded.py | 9 | 5407 | # 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... | mit |
cuboxi/android_external_chromium_org | third_party/tlslite/tlslite/SessionCache.py | 358 | 3470 | """Class for caching TLS sessions."""
import thread
import time
class SessionCache:
"""This class is used by the server to cache TLS sessions.
Caching sessions allows the client to use TLS session resumption
and avoid the expense of a full handshake. To use this class,
simply pass a SessionCache ins... | bsd-3-clause |
Astyan-42/skepticalscience | skepticalsciencewebsite/custompayment/tests/test_models.py | 1 | 3922 | import mock
from io import BytesIO
from django.test import TestCase
from django.utils import timezone
from django.contrib.auth import get_user_model
from django_countries.fields import CountryField
from custompayment.models import Address, CountryPayment, Item, Discount, Price, Payment, Order
from custompayment.constan... | agpl-3.0 |
goodwillcoding/RIDE | src/robotide/ui/review.py | 1 | 20691 | # Copyright 2008-2015 Nokia Solutions and Networks
#
# 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 l... | apache-2.0 |
alikins/ansible | lib/ansible/plugins/action/dellos6_config.py | 111 | 4194 | # Copyright 2015 Peter Sprygada <psprygada@ansible.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any l... | gpl-3.0 |
tophatmonocle/django-impersonate | impersonate/helpers.py | 2 | 4325 | import re
from django.conf import settings
from django.contrib.auth.models import User
from django.core.paginator import Paginator, EmptyPage
from django.utils.safestring import mark_safe
def get_redir_path(request=None):
next = None
redirect_field_name = getattr(settings,
'I... | bsd-3-clause |
jessegeerts/neural-nets | examples/deep_mnist.py | 1 | 3086 | from tensorflow.examples.tutorials.mnist import input_data
import tensorflow as tf
mnist = input_data.read_data_sets('data', one_hot=True)
sess = tf.InteractiveSession()
x = tf.placeholder(tf.float32, shape=[None, 784])
y_ = tf.placeholder(tf.float32, shape=[None, 10])
W = tf.Variable(tf.zeros([784, 10]))
b = tf.Va... | mit |
deepsrijit1105/edx-platform | lms/djangoapps/ccx/api/v0/serializers.py | 33 | 1588 | """ CCX API v0 Serializers. """
from rest_framework import serializers
from lms.djangoapps.ccx.models import CustomCourseForEdX
from ccx_keys.locator import CCXLocator
class CCXCourseSerializer(serializers.ModelSerializer):
"""
Serializer for CCX courses
"""
ccx_course_id = serializers.SerializerMet... | agpl-3.0 |
hostmaster/ansible-modules-core | cloud/openstack/_quantum_floating_ip.py | 146 | 10536 | #!/usr/bin/python
#coding: utf-8 -*-
# (c) 2013, Benno Joy <benno@ansible.com>
#
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later ... | gpl-3.0 |
jbedorf/tensorflow | tensorflow/python/ops/raw_ops_test.py | 1 | 1649 | # Copyright 2019 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 |
enisoc/vitess | py/vtdb/grpc_vtgate_client.py | 4 | 14190 | # Copyright 2017 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 |
AtomisCZ/chilligolf | node_modules/node-gyp/gyp/pylib/gyp/ordered_dict.py | 2354 | 10366 | # Unmodified from http://code.activestate.com/recipes/576693/
# other than to add MIT license header (as specified on page, but not in code).
# Linked from Python documentation here:
# http://docs.python.org/2/library/collections.html#collections.OrderedDict
#
# This should be deleted once Py2.7 is available on all bot... | mit |
larsbergstrom/servo | tests/wpt/web-platform-tests/webdriver/tests/set_window_rect/set.py | 6 | 11063 | # META: timeout=long
import pytest
from webdriver.transport import Response
from tests.support.asserts import assert_error, assert_success
from tests.support.helpers import (available_screen_size, document_hidden,
is_fullscreen, screen_size)
def set_window_rect(session, rect):
... | mpl-2.0 |
alejandrorosas/ardupilot | mk/PX4/Tools/genmsg/src/genmsg/__init__.py | 215 | 2116 | # Software License Agreement (BSD License)
#
# Copyright (c) 2011, Willow Garage, 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 ... | gpl-3.0 |
gouxiayibu/rcnn | external/liblinear-1.94/python/liblinear.py | 37 | 8400 | #!/usr/bin/env python
from ctypes import *
from ctypes.util import find_library
from os import path
import sys
try:
dirname = path.dirname(path.abspath(__file__))
if sys.platform == 'win32':
liblinear = CDLL(path.join(dirname, r'..\windows\liblinear.dll'))
else:
liblinear = CDLL(path.join(dirname, '../liblinea... | bsd-2-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.