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 |
|---|---|---|---|---|---|
v-iam/azure-sdk-for-python | azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/virtual_network_gateways_operations.py | 2 | 36131 | # 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 |
TOC-Shard/moul-scripts | Python/codWeather.py | 1 | 1388 | # -*- coding: utf-8 -*-
from Plasma import *
from PlasmaTypes import *
import time
WeatherSDL = 'Event13' # 1 = Snow, 2 = Rain
class codWeather(ptResponder):
def __init__(self):
ptResponder.__init__(self)
self.id = 8501009
self.version = 1
def OnServerInitComplete(self):
sel... | gpl-3.0 |
jrising/research-common | python/feature.py | 1 | 16306 | ## MODIFIED from agmodels
import csv, os, math
class StaticFeature:
def feature_set_country(self, country_name):
pass
# Calls callback with (latitude, longitude, feature, weight, cb_extra)
def getll_features(self, latitude, longitude, callback, cb_extra=None):
pass
def getrect_featur... | mit |
BartoszCichecki/onlinepython | onlinepython/pypy-2.4.0-win32/lib-python/2.7/test/test_curses.py | 44 | 9518 | #
# Test script for the curses module
#
# This script doesn't actually display anything very coherent. but it
# does call every method and function.
#
# Functions not tested: {def,reset}_{shell,prog}_mode, getch(), getstr(),
# init_color()
# Only called, not tested: getmouse(), ungetmouse()
#
import sys, tempfile, os
... | gpl-2.0 |
pvtodorov/indra | indra/assemblers/graph/assembler.py | 2 | 10590 | from __future__ import absolute_import, print_function, unicode_literals
from builtins import dict, str
import logging
import itertools
from indra.statements import *
logger = logging.getLogger(__name__)
try:
import pygraphviz
except ImportError:
logger.warning('Cannot use graph assembler because '
... | bsd-2-clause |
Jandersolutions/jander777-ghost | node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/pygments/formatters/rtf.py | 364 | 4536 | # -*- coding: utf-8 -*-
"""
pygments.formatters.rtf
~~~~~~~~~~~~~~~~~~~~~~~
A formatter that generates RTF files.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.formatter import Formatter
__all__ = ['RtfFormatter']
... | mit |
anoopcs9/samba | source4/dsdb/tests/python/linked_attributes.py | 2 | 26228 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Originally based on ./sam.py
import optparse
import sys
import os
import itertools
sys.path.insert(0, "bin/python")
import samba
from samba.tests.subunitrun import SubunitOptions, TestProgram
import samba.getopt as options
from samba.auth import system_session
import l... | gpl-3.0 |
luckylavish/zamboni | mkt/api/tests/test_fields.py | 9 | 15385 | # -*- coding: utf-8 -*-
from django.core.exceptions import ValidationError
from django.test.client import RequestFactory
from mock import Mock
from nose.tools import eq_, ok_
from rest_framework.request import Request
from rest_framework.serializers import CharField, Serializer
from rest_framework.test import APIReque... | bsd-3-clause |
osstech-jp/samba | python/samba/tests/docs.py | 15 | 15827 | # Unix SMB/CIFS implementation.
# Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2007-2012
#
# Tests for documentation.
#
# 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 th... | gpl-3.0 |
Edraak/circleci-edx-platform | common/lib/xmodule/xmodule/modulestore/tests/test_split_modulestore.py | 23 | 108271 | """
Test split modulestore w/o using any django stuff.
"""
from mock import patch
import datetime
from importlib import import_module
from path import Path as path
import random
import re
import unittest
import uuid
import ddt
from contracts import contract
from nose.plugins.attrib import attr
from django.core.cac... | agpl-3.0 |
1000Springs/web-app | hotspringsapp/models.py | 1 | 10858 | from hotspringsapp import app,db
from werkzeug.security import generate_password_hash, check_password_hash
from sqlalchemy.sql import text
from sqlalchemy.ext.associationproxy import association_proxy
from sqlalchemy.orm import sessionmaker
class Location(db.Model):
__tablename__ = 'public_location'
id = d... | mit |
choard1895/monolith_lamp | convert_image.py | 1 | 14461 | import logging
import math
import sys
import zlib
from PIL import Image, ImageStat
import scipy.stats
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
# Types of images this can handle
# * Alpha-encoded monochrome
# * RGB monochrome w/o cast
# * RGB monochrome w/ cast
# * Full RGBW
# * Full RGB
... | gpl-3.0 |
jalexvig/tensorflow | tensorflow/python/kernel_tests/summary_tensor_op_test.py | 43 | 5972 | # 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 |
Tejal011089/osmosis_erpnext | erpnext/utilities/doctype/contact/contact.py | 8 | 2420 | # 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 cstr, extract_email_id
from erpnext.controllers.status_updater import StatusUpdater
class Contact(StatusUpdater... | agpl-3.0 |
siemens/django-mantis-authoring | mantis_authoring/cybox_object_transformers/emailmessage.py | 1 | 6163 | import json
from cybox.objects import email_message_object, address_object
from cybox.common import String
from .__object_base__ import transformer_object, ObjectFormTemplate
from django import forms
from django.utils.dateparse import parse_datetime
import mantis_authoring.EmailObjectFunctions as EOF
class Base(t... | gpl-2.0 |
jayceyxc/hue | desktop/core/ext-py/lxml-3.3.6/benchmark/bench_etree.py | 17 | 12154 | import sys, copy
from itertools import *
import benchbase
from benchbase import (with_attributes, with_text, onlylib,
serialized, children, nochange, BytesIO)
TEXT = "some ASCII text"
UTEXT = u"some klingon: \F8D2"
############################################################
# Benchmarks
####... | apache-2.0 |
n0max/servo | tests/wpt/web-platform-tests/tools/pytest/testing/test_pytester.py | 203 | 3498 | import pytest
import os
from _pytest.pytester import HookRecorder
from _pytest.config import PytestPluginManager
from _pytest.main import EXIT_OK, EXIT_TESTSFAILED
def test_make_hook_recorder(testdir):
item = testdir.getitem("def test_func(): pass")
recorder = testdir.make_hook_recorder(item.config.pluginmana... | mpl-2.0 |
LockScreen/Backend | venv/lib/python2.7/site-packages/jinja2/loaders.py | 333 | 17380 | # -*- coding: utf-8 -*-
"""
jinja2.loaders
~~~~~~~~~~~~~~
Jinja loader classes.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import os
import sys
import weakref
from types import ModuleType
from os import path
from hashlib import sha1
from jinja2.excepti... | mit |
opensourcechipspark/platform_external_chromium_org | third_party/PRESUBMIT.py | 47 | 3817 | # Copyright (c) 2011 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.
def _CheckThirdPartyReadmesUpdated(input_api, output_api):
"""
Checks to make sure that README.chromium files are properly updated
when dependancie... | bsd-3-clause |
awesomest/text-checker | appengine/text-checker/node_modules/zlibjs/closure-primitives/depswriter.py | 247 | 6208 | #!/usr/bin/env python
#
# Copyright 2009 The Closure Library 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
... | apache-2.0 |
wackymaster/QTClock | Libraries/matplotlib/projections/geo.py | 8 | 21976 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
from matplotlib.externals import six
import math
import numpy as np
import numpy.ma as ma
import matplotlib
rcParams = matplotlib.rcParams
from matplotlib.axes import Axes
from matplotlib import cbook
from m... | mit |
isb-cgc/ISB-CGC-data-proc | data_upload/util/bq_wrapper.py | 1 | 1985 | '''
Created on Jan 22, 2017
Copyright 2017, Institute for Systems Biology.
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... | apache-2.0 |
BeATz-UnKNoWN/python-for-android | python3-alpha/python3-src/Lib/plistlib.py | 50 | 14616 | r"""plistlib.py -- a tool to generate and parse MacOSX .plist files.
The property list (.plist) file format is a simple XML pickle supporting
basic object types, like dictionaries, lists, numbers and strings.
Usually the top level object is a dictionary.
To write out a plist file, use the writePlist(rootObject, pathO... | apache-2.0 |
emilio/servo | tests/wpt/web-platform-tests/tools/third_party/hyper/hyper/packages/hyperframe/flags.py | 41 | 1028 | # -*- coding: utf-8 -*-
"""
hyperframe/flags
~~~~~~~~~~~~~~~~
Defines basic Flag and Flags data structures.
"""
import collections
Flag = collections.namedtuple("Flag", ["name", "bit"])
class Flags(collections.MutableSet):
"""
A simple MutableSet implementation that will only accept known flags as elements... | mpl-2.0 |
tecan/xchat-rt | plugins/scripts/encryption/supybot-code-6361b1e856ebbc8e14d399019e2c53a35f4e0063/plugins/Games/config.py | 15 | 2149 | ###
# Copyright (c) 2003-2005, Jeremiah Fincher
# 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 co... | gpl-2.0 |
uclouvain/OSIS-Louvain | base/tests/factories/education_group_year.py | 1 | 7357 | ##############################################################################
#
# OSIS stands for Open Student Information System. It's an application
# designed to manage the core business of higher education institutions,
# such as universities, faculties, institutes and professional schools.
# The core ... | agpl-3.0 |
huguesv/PTVS | Python/Tests/TestData/VirtualEnv/env/Lib/encodings/mac_cyrillic.py | 593 | 13710 | """ Python Character Mapping Codec mac_cyrillic generated from 'MAPPINGS/VENDORS/APPLE/CYRILLIC.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_table)
def decode(self,inp... | apache-2.0 |
knittledan/solr_lxml_Example | thirdParty/requests/packages/urllib3/poolmanager.py | 550 | 8977 | # urllib3/poolmanager.py
# Copyright 2008-2014 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
import logging
try: # Python 3
from urllib.parse import urljoin
except ImportError:
... | mit |
int19h/PTVS | Python/Product/Miniconda/Miniconda3-x64/Lib/site-packages/win32/scripts/regsetup.py | 7 | 20020 | # A tool to setup the Python registry.
class error(Exception):
pass
import sys # at least we can count on this!
def FileExists(fname):
"""Check if a file exists. Returns true or false.
"""
import os
try:
os.stat(fname)
return 1
except os.error as details:
return 0
de... | apache-2.0 |
yasir1brahim/OLiMS | lims/utils/samplepartition.py | 2 | 3119 | from lims.utils import tmpID
from dependencies.dependency import _createObjectByType
from magnitude import mg
def compare_containers(a, b):
a_capacity = a.getCapacity().lower().split(" ", 1)
b_capacity = b.getCapacity().lower().split(" ", 1)
a_magnitude = mg(float(a_capacity[0]), a_capacity[1])
b_magn... | agpl-3.0 |
antoviaque/edx-platform | common/djangoapps/course_action_state/migrations/0001_initial.py | 50 | 1808 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
from django.conf import settings
import xmodule_django.models
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_US... | agpl-3.0 |
c3m3gyanesh/RouteFlow-OpenConfig | pox/pox/log/color.py | 26 | 5403 | # Copyright 2011 James McCauley
#
# This file is part of POX.
#
# POX 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.
#
# POX is distri... | apache-2.0 |
yoer/hue | desktop/core/ext-py/tablib-0.10.0/tablib/packages/xlrd/formula.py | 64 | 89648 | # -*- coding: cp1252 -*-
##
# Module for parsing/evaluating Microsoft Excel formulas.
#
# <p>Copyright © 2005-2009 Stephen John Machin, Lingfo Pty Ltd</p>
# <p>This module is part of the xlrd package, which is released under
# a BSD-style licence.</p>
##
# No part of the content of this file was derived from the work... | apache-2.0 |
sepehr125/pybrain | pybrain/tools/plotting/multiline.py | 25 | 7884 | # $Id$
__author__ = 'Martin Felder and Frank Sehnke'
import math, imp
from matplotlib.lines import Line2D
from pylab import clf, plot, axes, show, xlabel, ylabel, savefig, ioff, draw_if_interactive
class MultilinePlotter:
""" Basic plotting class build on pylab
Implementing by instancing the class with the nu... | bsd-3-clause |
dscdac/Proyecto-IV-modulo2 | lib/python2.7/site-packages/setuptools/tests/doctest.py | 332 | 99828 | # Module doctest.
# Released to the public domain 16-Jan-2001, by Tim Peters (tim@python.org).
# Major enhancements and refactoring by:
# Jim Fulton
# Edward Loper
# Provided as-is; use at your own risk; no warranty; no promises; enjoy!
try:
basestring
except NameError:
basestring = str
try:
enum... | gpl-2.0 |
TalShafir/ansible | lib/ansible/modules/database/mongodb/mongodb_user.py | 18 | 15461 | #!/usr/bin/python
# (c) 2012, Elliott Foster <elliott@fourkitchens.com>
# Sponsored by Four Kitchens http://fourkitchens.com.
# (c) 2014, Epic Games, Inc.
#
# 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
__m... | gpl-3.0 |
codeforamerica/skillcamp | ENV/lib/python2.7/site-packages/werkzeug/datastructures.py | 314 | 86050 | # -*- coding: utf-8 -*-
"""
werkzeug.datastructures
~~~~~~~~~~~~~~~~~~~~~~~
This module provides mixins and classes with an immutable interface.
:copyright: (c) 2013 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import re
import sys
import cod... | mit |
xydinesh/flask-restful | werkzeug/testsuite/contrib/securecookie.py | 66 | 1764 | # -*- coding: utf-8 -*-
"""
werkzeug.testsuite.securecookie
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tests the secure cookie.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import unittest
from werkzeug.testsuite import WerkzeugTestCase
from werkzeug.utils import... | apache-2.0 |
disruptek/boto | tests/unit/glacier/test_vault.py | 114 | 7480 | #!/usr/bin/env python
# Copyright (c) 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without ... | mit |
chuckinator0/Projects | scripts/log_practice.py | 1 | 1730 | """
Parse a log file! See log_practice.log.
The log is a schedule of classes on different days.
Each line has the form:
HH:MM Topic
Days are separated by blank lines.
"""
def hours(string):
return int(string[0:2])
def minutes(string):
return int(string[3:5])
def duration(string1, string2):
minutes1 ... | gpl-3.0 |
iohannez/gnuradio | gr-qtgui/examples/pyqt_time_raster_f.py | 7 | 2823 | #!/usr/bin/env python
#
# Copyright 2012,2013,2015 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 ... | gpl-3.0 |
Sheeprider/BitBucket-api | bitbucket/bitbucket.py | 1 | 9361 | # -*- coding: utf-8 -*-
# git+git://github.com/Sheeprider/BitBucket-api.git
__all__ = ['Bitbucket', ]
try:
from urlparse import parse_qs
except ImportError:
from urllib.parse import parse_qs
import json
import re
from requests import Request, Session
from requests_oauthlib import OAuth1
import requests
fro... | isc |
noba3/KoTos | addons/script.module.turtlex/lib/snapvideo/StageVU.py | 3 | 1285 | '''
Created on Jan 3, 2012
@author: ajju
'''
from common import HttpUtils
from common.DataObjects import VideoHostingInfo, VideoInfo, VIDEO_QUAL_SD
import re
def getVideoHostingInfo():
video_hosting_info = VideoHostingInfo()
video_hosting_info.set_video_hosting_image('http://userlogos.org/files/logos/jumpordi... | gpl-2.0 |
chokepoint/Ataraxpy | plugins/commands.py | 1 | 2504 | #!/usr/bin/env python
from plugins import ValidationError
class CommandTemplate:
def __init__(self, name, conn=None):
self.name = name
self.conn = conn
self.cmds = {
"help": {"args": [], "func": self.help},
"die": {"args": [], "func": self.die}
... | mit |
mdavid/horizon | tools/install_venv_common.py | 166 | 5958 | # Copyright 2013 OpenStack Foundation
# Copyright 2013 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | apache-2.0 |
xiangel/hue | desktop/core/ext-py/boto-2.38.0/boto/sdb/db/blob.py | 153 | 2437 | # Copyright (c) 2006,2007,2008 Mitch Garnaat http://garnaat.org/
#
# 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,... | apache-2.0 |
dmeulen/home-assistant | homeassistant/components/http/auth.py | 17 | 1998 | """Authentication for HTTP component."""
import asyncio
import hmac
import logging
from homeassistant.const import HTTP_HEADER_HA_AUTH
from .util import get_real_ip
from .const import KEY_TRUSTED_NETWORKS, KEY_AUTHENTICATED
DATA_API_PASSWORD = 'api_password'
_LOGGER = logging.getLogger(__name__)
@asyncio.coroutine... | mit |
ingokegel/intellij-community | python/testData/highlighting/declarations.py | 22 | 1221 | # bg is always black.
# effect is white
# func decl: red bold
# class decl: blue bold
# predefined decl: green bold
def <info descr="PY.FUNC_DEFINITION" type="INFORMATION" foreground="0xff0000" background="0x000000" effectcolor="0xffffff" effecttype="BOXED" fonttype="1">foo</info>():
pass
class <info descr="PY.CLASS... | apache-2.0 |
CoDEmanX/ArangoDB | 3rdParty/V8-4.3.61/third_party/python_26/Lib/user.py | 313 | 1627 | """Hook to allow user-specified customization code to run.
As a policy, Python doesn't run user-specified code on startup of
Python programs (interactive sessions execute the script specified in
the PYTHONSTARTUP environment variable if it exists).
However, some programs or sites may find it convenient to allow users... | apache-2.0 |
ntuecon/server | pyenv/Lib/site-packages/django/template/loaders/filesystem.py | 418 | 2158 | """
Wrapper for loading templates from the filesystem.
"""
import errno
import io
import warnings
from django.core.exceptions import SuspiciousFileOperation
from django.template import Origin, TemplateDoesNotExist
from django.utils._os import safe_join
from django.utils.deprecation import RemovedInDjango20Warning
fr... | bsd-3-clause |
pjsports/kernel-2.6.39.4-A500-OC1.5G | tools/perf/scripts/python/futex-contention.py | 11261 | 1486 | # futex contention
# (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Translation of:
#
# http://sourceware.org/systemtap/wiki/WSFutexContention
#
# to perf python scripting.
#
# Measures futex contention
import os, sys
sys.path.append(os.environ['PER... | gpl-2.0 |
sudheesh001/oh-mainline | vendor/packages/kombu/kombu/tests/transport/virtual/test_exchange.py | 24 | 4859 | from __future__ import absolute_import
from kombu import Connection
from kombu.transport.virtual import exchange
from kombu.tests.case import Case, Mock
from kombu.tests.mocks import Transport
class ExchangeCase(Case):
type = None
def setUp(self):
if self.type:
self.e = self.type(Connec... | agpl-3.0 |
saukrIppl/seahub | thirdpart/django_constance-1.0.1-py2.6.egg/constance/admin.py | 6 | 6854 | from datetime import datetime, date, time
from decimal import Decimal
import hashlib
from operator import itemgetter
from django import forms
from django.contrib import admin, messages
from django.contrib.admin import widgets
from django.contrib.admin.options import csrf_protect_m
from django.core.exceptions import Pe... | apache-2.0 |
ecolitan/fatics | test/variant/test_chess960.py | 1 | 9385 | # Copyright (C) 2010 Wil Mahan <wmahan+fatics@gmail.com>
#
# This file is part of FatICS.
#
# FatICS is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your optio... | agpl-3.0 |
ClearCorp/odoo-clearcorp | TODO-9.0/product_invoice_report/wizard/product_invoice_wizard.py | 3 | 3713 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Addons modules by CLEARCORP S.A.
# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
#
# This program is free software: you can redistribute... | agpl-3.0 |
spxtr/bazel | tools/build_defs/docker/rewrite_json.py | 22 | 9758 | # Copyright 2015 The Bazel 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 la... | apache-2.0 |
annarev/tensorflow | tensorflow/python/saved_model/utils_impl.py | 7 | 10433 | # 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 |
savanu/servo | tests/wpt/web-platform-tests/websockets/handlers/stash_responder_wsh.py | 206 | 1673 | #!/usr/bin/python
import urlparse, json
from mod_pywebsocket import common, msgutil, util
from mod_pywebsocket.handshake import hybi
from wptserve import stash
address, authkey = stash.load_env_config()
stash = stash.Stash("/stash_responder", address=address, authkey=authkey)
def web_socket_do_extra_handshake(request... | mpl-2.0 |
swarna-k/MyDiary | flask/lib/python2.7/site-packages/sqlalchemy/util/__init__.py | 47 | 2514 | # util/__init__.py
# Copyright (C) 2005-2015 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
from .compat import callable, cmp, reduce, \
threading, py3k, py33, py2k, jyth... | bsd-3-clause |
adlnet-archive/edx-platform | common/lib/xmodule/xmodule/split_test_module.py | 6 | 28192 | """
Module for running content split tests
"""
import logging
import json
from webob import Response
from uuid import uuid4
from operator import itemgetter
from xmodule.progress import Progress
from xmodule.seq_module import SequenceDescriptor
from xmodule.studio_editable import StudioEditableModule, StudioEditableDe... | agpl-3.0 |
mkhutornenko/incubator-aurora | src/test/python/apache/thermos/monitoring/test_disk.py | 1 | 2175 | #
# 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 ... | apache-2.0 |
wetneb/django | tests/forms_tests/tests/test_regressions.py | 14 | 8031 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.forms import (
CharField, ChoiceField, Form, HiddenInput, IntegerField, ModelForm,
ModelMultipleChoiceField, MultipleChoiceField, RadioSelect, Select,
TextInput,
)
from django.test import TestCase, ignore_warnings
from django.utils... | bsd-3-clause |
stanxii/wr1004sjl | linux-3.4.6/tools/perf/scripts/python/failed-syscalls-by-pid.py | 11180 | 2058 | # failed 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 failed system call totals, broken down by pid.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.pa... | lgpl-2.1 |
wakatime/sketch-wakatime | WakaTime.sketchplugin/Contents/Resources/wakatime/packages/pygments/filters/__init__.py | 31 | 11573 | # -*- coding: utf-8 -*-
"""
pygments.filters
~~~~~~~~~~~~~~~~
Module containing filter lookup functions and default
filters.
:copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.token import String, Comment, Ke... | bsd-3-clause |
inspirehep/harvesting-kit | harvestingkit/tests/elsevier_package_tests.py | 1 | 11162 | # -*- coding: utf-8 -*-
#
# This file is part of Harvesting Kit.
# Copyright (C) 2014, 2015 CERN.
#
# Harvesting Kit 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 yo... | gpl-2.0 |
ivano666/tensorflow | tensorflow/python/kernel_tests/gradient_correctness_test.py | 15 | 1413 | # 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... | apache-2.0 |
orgito/ansible | lib/ansible/modules/database/misc/kibana_plugin.py | 52 | 7252 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2016, Thierno IB. BARRY @barryib
# Sponsored by Polyconseil http://polyconseil.fr.
#
# 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__ = t... | gpl-3.0 |
guorendong/iridium-browser-ubuntu | tools/telemetry/telemetry/unittest_util/gtest_progress_reporter.py | 20 | 3115 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import logging
import time
import unittest
from telemetry.unittest_util import progress_reporter
from telemetry.util import exception_formatter
def _Forma... | bsd-3-clause |
mbatchkarov/dc_evaluation | eval/pipeline/feature_handlers.py | 1 | 6374 | from discoutils.tokens import DocumentFeature
from discoutils.thesaurus_loader import Thesaurus
from eval.pipeline.thesauri import DummyThesaurus
from eval.utils.reflection_utils import get_named_object
def get_token_handler(handler_name, k, transformer_name, thesaurus):
"""
:param handler_name: fully qualif... | bsd-3-clause |
talon-one/talon_one.py | test/test_application_session_entity.py | 1 | 2063 | # coding: utf-8
"""
Talon.One API
The Talon.One API is used to manage applications and campaigns, as well as to integrate with your application. The operations in the _Integration API_ section are used to integrate with our platform, while the other operations are used to manage applications and campaigns. #... | mit |
pkoutsias/SickRage | lib/feedparser/namespaces/mediarss.py | 43 | 5377 | # Support for the Media RSS format
# Copyright 2010-2015 Kurt McKee <contactme@kurtmckee.org>
# Copyright 2002-2008 Mark Pilgrim
# All rights reserved.
#
# This file is a part of feedparser.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following ... | gpl-3.0 |
rosudrag/Freemium-winner | VirtualEnvironment/Lib/site-packages/pip-7.1.0-py3.4.egg/pip/_vendor/requests/packages/urllib3/packages/ordered_dict.py | 2040 | 8935 | # Backport of OrderedDict() class that runs on Python 2.4, 2.5, 2.6, 2.7 and pypy.
# Passes Python2.7's test suite and incorporates all the latest updates.
# Copyright 2009 Raymond Hettinger, released under the MIT License.
# http://code.activestate.com/recipes/576693/
try:
from thread import get_ident as _get_iden... | mit |
erinn/ansible | v1/ansible/module_utils/openstack.py | 198 | 4502 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | gpl-3.0 |
hassoon3/odoo | openerp/tools/win32.py | 457 | 1993 | # -*- coding: utf-8 -*-
##############################################################################
#
# 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... | agpl-3.0 |
thruflo/pyramid_basemodel | src/pyramid_basemodel/root.py | 2 | 1206 | # -*- coding: utf-8 -*-
"""Provides a base traversal root and a mixin class for objects in the
Pyramid traversal hierarchy.
http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/traversal.html
"""
__all__ = [
'BaseRoot',
]
import logging
logger = logging.getLogger(__name__)
from zope.interface im... | unlicense |
stevenzhang18/Indeed-Flask | lib/pandas/tests/test_panel.py | 9 | 92205 | # -*- coding: utf-8 -*-
# pylint: disable=W0612,E1101
from datetime import datetime
from inspect import getargspec
import operator
import nose
from functools import wraps
import numpy as np
import pandas as pd
from pandas import Series, DataFrame, Index, isnull, notnull, pivot, MultiIndex
from pandas.core.datetools ... | apache-2.0 |
movmov/cc | vendor/Twisted-10.0.0/twisted/test/test_strports.py | 12 | 3002 | # Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
#
from twisted.application import strports
from twisted.trial import unittest
class ParserTestCase(unittest.TestCase):
f = "Factory"
def testSimpleNumeric(self):
self.assertEqual(strports.parse('80', self.f),
... | apache-2.0 |
jhperales/gumpswd | filelock.py | 2 | 2500 | import os
import time
import errno
class FileLockException(Exception):
pass
class FileLock(object):
""" A file locking mechanism that has context-manager support so
you can use it in a with statement. This should be relatively cross
compatible as it doesn't rely on msvcrt or fcntl for the lock... | mit |
duanhjlt/gyp | test/win/gyptest-macro-targetfilename.py | 61 | 1172 | #!/usr/bin/env python
# Copyright (c) 2014 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.
"""
Make sure macro expansion of $(TargetFileName) is handled.
"""
import TestGyp
import os
import sys
if sys.platform == 'win32':
test... | bsd-3-clause |
pythonvietnam/scikit-learn | examples/cluster/plot_mini_batch_kmeans.py | 265 | 4081 | """
====================================================================
Comparison of the K-Means and MiniBatchKMeans clustering algorithms
====================================================================
We want to compare the performance of the MiniBatchKMeans and KMeans:
the MiniBatchKMeans is faster, but give... | bsd-3-clause |
flowersteam/explauto | explauto/sensorimotor_model/inverse/cmamodel.py | 2 | 2682 |
from .optimize import OptimizedInverseModel
from . import cma
class CMAESInverseModel(OptimizedInverseModel):
"""
An inverse model class using CMA-ES optimization routine,
on an error function computed from the forward model.
"""
name = 'CMAES'
desc = 'CMA-ES, Covariance Matrix Adaptation Ev... | gpl-3.0 |
MjAbuz/foundation | foundation/organisation/search_indexes.py | 1 | 1662 | from haystack import indexes
from .models import Person, Project, WorkingGroup, NetworkGroup
class PersonIndex(indexes.SearchIndex, indexes.Indexable):
text = indexes.CharField(document=True, use_template=True)
twitter = indexes.CharField(model_attr='twitter')
url = indexes.CharField(model_attr='url')
... | mit |
bobobox/ansible | lib/ansible/modules/cloud/cloudstack/cs_role.py | 38 | 6359 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2016, René Moser <mail@renemoser.net>
#
# 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 Lice... | gpl-3.0 |
saukrIppl/seahub | thirdpart/registration/tests/models.py | 7 | 9730 | import datetime
import hashlib
import re
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.sites.models import Site
from django.core import mail
from django.core import management
from django.test import TestCase
from registration.models import RegistrationProfile
clas... | apache-2.0 |
therandomcode/Fanalytics | lib/werkzeug/posixemulation.py | 364 | 3519 | # -*- coding: utf-8 -*-
r"""
werkzeug.posixemulation
~~~~~~~~~~~~~~~~~~~~~~~
Provides a POSIX emulation for some features that are relevant to
web applications. The main purpose is to simplify support for
systems such as Windows NT that are not 100% POSIX compatible.
Currently this only imple... | apache-2.0 |
terhorstd/nest-simulator | pynest/nest/tests/test_create.py | 2 | 3250 | # -*- coding: utf-8 -*-
#
# test_create.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST 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... | gpl-2.0 |
PLyczkowski/Sticky-Keymap | 2.74/python/lib/site-packages/numpy/doc/broadcasting.py | 231 | 5565 | """
========================
Broadcasting over arrays
========================
The term broadcasting describes how numpy treats arrays with different
shapes during arithmetic operations. Subject to certain constraints,
the smaller array is "broadcast" across the larger array so that they
have compatible shapes. Broadc... | gpl-2.0 |
nikitabrazhnik/flask2 | Module 3/Chapter09/chapter_9/webapp/controllers/rest/parsers.py | 11 | 1408 | from flask.ext.restful import reqparse
user_post_parser = reqparse.RequestParser()
user_post_parser.add_argument('username', type=str, required=True)
user_post_parser.add_argument('password', type=str, required=True)
post_get_parser = reqparse.RequestParser()
post_get_parser.add_argument('page', type=int, location=['... | mit |
nortikin/sverchok | nodes/surface/gordon_surface.py | 1 | 5334 | # This file is part of project Sverchok. It's copyrighted by the contributors
# recorded in the version control history of the file, available from
# its original location https://github.com/nortikin/sverchok/commit/master
#
# SPDX-License-Identifier: GPL3
# License-Filename: LICENSE
import numpy as np
import bpy
from... | gpl-3.0 |
cython-testbed/pandas | pandas/tseries/offsets.py | 1 | 81716 | # -*- coding: utf-8 -*-
from datetime import date, datetime, timedelta
import functools
import operator
from pandas.compat import range
from pandas import compat
import numpy as np
from pandas.core.dtypes.generic import ABCPeriod
from pandas.core.tools.datetimes import to_datetime
import pandas.core.common as com
# ... | bsd-3-clause |
persandstrom/home-assistant | homeassistant/components/switch/zha.py | 3 | 3400 | """
Switches on Zigbee Home Automation networks.
For more details on this platform, please refer to the documentation
at https://home-assistant.io/components/switch.zha/
"""
import logging
from homeassistant.components.switch import DOMAIN, SwitchDevice
from homeassistant.components import zha
_LOGGER = logging.getL... | apache-2.0 |
1st1/uvloop | examples/bench/echoserver.py | 1 | 6229 | import argparse
import asyncio
import gc
import os.path
import pathlib
import socket
import ssl
PRINT = 0
async def echo_server(loop, address, unix):
if unix:
sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
else:
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.... | mit |
djsedulous/namecoind | libs/boost_1_50_0/tools/quickbook/test/python/output-deps.py | 6 | 4511 | #!/usr/bin/env python
import sys, os, subprocess, tempfile, re
def main(args, directory):
if len(args) != 1:
print "Usage: output-deps.py quickbook-command"
exit(1)
quickbook_command = args[0]
failures = 0
failures += run_quickbook(quickbook_command, 'svg_missing.qbk',
dep... | mit |
mmcauliffe/python-acoustic-similarity | tests/test_main_func_threading.py | 1 | 4393 | import pytest
from conch import (acoustic_similarity_mapping,
acoustic_similarity_directories,
analyze_segments,
acoustic_similarity_directory, analyze_long_file,
)
from conch.main import axb_mapping
from conch.io import load_path_mapping
fro... | mit |
marcosmodesto/django-testapp | django/django/contrib/contenttypes/tests.py | 40 | 7048 | from __future__ import with_statement
import urllib
from django.db import models
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes.views import shortcut
from django.contrib.sites.models import Site
from django.http import HttpRequest, Http404
from django.test import TestCase
... | bsd-3-clause |
delmic/odemis | src/odemis/gui/comp/foldpanelbar.py | 2 | 14600 | # -*- coding: utf-8 -*-
"""
:author: Rinze de Laat
:copyright: © 2012 Rinze de Laat, Delmic
.. license::
This file is part of Odemis.
Odemis is free software: you can redistribute it and/or modify it under the terms
of the GNU General Public License version 2 as published by the Free Software
Founda... | gpl-2.0 |
oilshell/blog-code | fd-passing/server.py | 1 | 2964 | #!/usr/bin/env python3
"""
server.py
https://pymotw.com/2/socket/uds.html
"""
from __future__ import print_function
import errno
import optparse
import os
import socket
import sys
import subprocess
import py_fanos
from py_fanos import log
def main(argv):
p = optparse.OptionParser(__doc__)
p.add_option(
'... | apache-2.0 |
S2R2/viper | viper/modules/rats/pandora.py | 6 | 3215 | # Originally written by Kevin Breen (@KevTheHermit):
# https://github.com/kevthehermit/RATDecoders/blob/master/Pandora.py
import pefile
def version_21(raw_config):
if raw_config != None:
conf_dict = {}
conf_dict['Version'] = '2.1'
conf_dict['Domain'] = raw_config[0]
conf_dict['Port... | bsd-3-clause |
Livit/Livit.Learn.EdX | lms/djangoapps/courseware/tests/test_view_authentication.py | 23 | 17100 | import datetime
import pytz
from django.core.urlresolvers import reverse
from mock import patch
from nose.plugins.attrib import attr
from courseware.access import has_access
from courseware.tests.helpers import CourseAccessTestMixin, LoginEnrollmentTestCase
from courseware.tests.factories import (
BetaTesterFacto... | agpl-3.0 |
AndrewGrossman/django | tests/template_backends/test_django.py | 199 | 4793 | from template_tests.test_response import test_processor_name
from django.template import RequestContext
from django.template.backends.django import DjangoTemplates
from django.template.library import InvalidTemplateLibrary
from django.test import RequestFactory, ignore_warnings, override_settings
from django.utils.dep... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.