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
fkolacek/ClapTrap
core/modules/mail.py
1
2391
#!/usr/bin/env python # -*- coding: utf-8 -*- import time import re class Mail(object): meta = { 'name': "Mail", 'description': "", 'author': "F. Kolacek <fkolacek@redhat.com>", 'version': "0.1", 'triggers': { '^!tell': "tell", '.*': "watch" }, 'usage': [ "!tell [nick]...
mit
Kongsea/tensorflow
tensorflow/python/kernel_tests/summary_audio_op_test.py
134
2594
# 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
zstars/weblabdeusto
server/launch/sample_balanced2_concurrent_experiments/main_machine/lab_and_experiment1/experiment30/server_config.py
968
1526
#!/usr/bin/env python #-*-*- encoding: utf-8 -*-*- weblab_xilinx_experiment_xilinx_device = 'FPGA' weblab_xilinx_experiment_port_number = 1 # This should be something like this: # import os as _os # xilinx_home = _os.getenv('XILINX_HOME') # if xilinx_home == None: # if _os.name == 'nt': # xilinx_home = r'C:...
bsd-2-clause
jalexvig/tensorflow
tensorflow/python/framework/device.py
23
9158
# 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
lokik/sfepy
tests/test_lcbc_3d.py
5
1935
# 05.10.2007, c # last revision: 25.02.2008 from __future__ import absolute_import from sfepy import data_dir from sfepy.mechanics.matcoefs import stiffness_from_lame filename_mesh = data_dir + '/meshes/3d/special/cube_sphere.mesh' # Whole domain $Y$. region_1000 = { 'name' : 'Y', 'select' : 'all', } # Domai...
bsd-3-clause
iansprice/wagtail
wagtail/wagtailcore/migrations/0039_collectionviewrestriction.py
1
1642
# -*- coding: utf-8 -*- # Generated by Django 1.10.4 on 2016-12-19 15:32 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('wagtailcore', '0038_make_first_published_at_editable'), ...
bsd-3-clause
lizhil/highlight.js
docs/conf.py
8
7771
# -*- coding: utf-8 -*- # # highlight.js documentation build configuration file, created by # sphinx-quickstart on Wed Sep 12 23:48:27 2012. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # ...
bsd-3-clause
blacktear23/django
django/contrib/gis/gdal/driver.py
411
2411
# prerequisites imports from ctypes import c_void_p from django.contrib.gis.gdal.base import GDALBase from django.contrib.gis.gdal.error import OGRException from django.contrib.gis.gdal.prototypes import ds as capi # For more information, see the OGR C API source code: # http://www.gdal.org/ogr/ogr__api_8h.html # # ...
bsd-3-clause
Duoxilian/home-assistant
homeassistant/components/device_tracker/unifi.py
8
3118
""" Support for Unifi WAP controllers. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/device_tracker.unifi/ """ import logging import urllib import voluptuous as vol import homeassistant.helpers.config_validation as cv import homeassistant.loader as loa...
mit
ZeitOnline/zeit.content.quiz
src/zeit/content/quiz/quiz.py
1
2644
import zeit.cms.type from zeit.cms.i18n import MessageFactory as _ import lxml.objectify import zeit.cms.connector import zeit.cms.content.adapter import zeit.cms.content.dav import zeit.cms.content.metadata import zeit.cms.interfaces import zeit.content.quiz.container import grokcore.component import zeit.content.quiz...
bsd-3-clause
yannrouillard/weboob
modules/americanexpress/pages.py
1
5610
# -*- coding: utf-8 -*- # Copyright(C) 2013 Romain Bignon # # This file is part of weboob. # # weboob 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 opti...
agpl-3.0
rahushen/ansible
test/units/module_utils/facts/hardware/test_linux.py
38
7736
# 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
ArvinPan/pyzmq
zmq/sugar/constants.py
31
2305
"""0MQ Constants.""" # Copyright (c) PyZMQ Developers. # Distributed under the terms of the Modified BSD License. from zmq.backend import constants from zmq.utils.constant_names import ( base_names, switched_sockopt_names, int_sockopt_names, int64_sockopt_names, bytes_sockopt_names, fd_sockopt...
bsd-3-clause
cholokei/Qualcomm_MSM_Android_Kernel
tools/perf/scripts/python/syscall-counts.py
11181
1522
# system call counts # (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 import sys sys.path.append(os.envir...
gpl-2.0
michaelneuder/image_quality_analysis
bin/calculations/scratch/SSIM_example.py
1
1756
#!/usr/bin/env python3 import numpy as np import scipy as sp def main(): orig = np.asarray( [[61,67,70,75,74,70,70,70,70,70,70], [73,69,68,65,71,72,72,72,72,72,72], [67,68,69,69,73,71,71,71,71,71,71], [68,68,70,76,81,82,82,82,82,82,82], [74,77,79,78,80,85,85,85,85,85,85]...
mit
tdr130/CapTipper
colorama/win32.py
446
5121
# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. # from winbase.h STDOUT = -11 STDERR = -12 try: import ctypes from ctypes import LibraryLoader windll = LibraryLoader(ctypes.WinDLL) from ctypes import wintypes except (AttributeError, ImportError): windll = None SetCon...
gpl-3.0
Annotald/annotald
nltk2-patched/nltk/corpus/reader/rte.py
17
4586
# Natural Language Toolkit: RTE Corpus Reader # # Copyright (C) 2001-2012 NLTK Project # Author: Ewan Klein <ewan@inf.ed.ac.uk> # URL: <http://www.nltk.org/> # For license information, see LICENSE.TXT """ Corpus reader for the Recognizing Textual Entailment (RTE) Challenge Corpora. The files were taken from the RTE1...
gpl-3.0
mdworks2016/work_development
Python/20_Third_Certification/venv/lib/python3.7/site-packages/urllib3/__init__.py
20
2683
""" urllib3 - Thread-safe connection pooling and re-using. """ from __future__ import absolute_import import warnings from .connectionpool import HTTPConnectionPool, HTTPSConnectionPool, connection_from_url from . import exceptions from .filepost import encode_multipart_formdata from .poolmanager import PoolManager, ...
apache-2.0
baloo/sbt-repo-buildpack
vendor/virtualenv-1.7.2/virtualenv.py
29
108233
#!/usr/bin/env python """Create a "virtual" Python installation """ # If you change the version here, change it in setup.py # and docs/conf.py as well. __version__ = "1.7.2" # following best practices virtualenv_version = __version__ # legacy, again import base64 import sys import os import codecs import optparse i...
mit
alu042/edx-platform
common/djangoapps/student/tests/test_reset_password.py
34
11864
""" Test the various password reset flows """ import json import re import unittest from django.core.cache import cache from django.conf import settings from django.test import TestCase from django.test.client import RequestFactory from django.contrib.auth.models import User from django.contrib.auth.hashers import UNU...
agpl-3.0
overtherain/scriptfile
software/googleAppEngine/lib/django_1_3/tests/regressiontests/bug639/tests.py
55
1346
""" Tests for file field behavior, and specifically #639, in which Model.save() gets called *again* for each FileField. This test will fail if calling a ModelForm's save() method causes Model.save() to be called more than once. """ import os import shutil from django.core.files.uploadedfile import SimpleUploadedFile ...
mit
hujiajie/pa-chromium
tools/python/google/gethash_timer.py
182
4366
#!/usr/bin/env python # 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. """Issue a series of GetHash requests to the SafeBrowsing servers and measure the response times. Usage: $ ./gethash_timer.py -...
bsd-3-clause
craynot/django
django/db/models/manager.py
301
10722
import copy import inspect from importlib import import_module from django.db import router from django.db.models.query import QuerySet from django.utils import six from django.utils.encoding import python_2_unicode_compatible def ensure_default_manager(cls): """ Ensures that a Model subclass contains a defa...
bsd-3-clause
ezeep/stackwalker
jsoncpp-src-0.5.0/test/rununittests.py
249
2507
import sys import os import os.path import subprocess from glob import glob import optparse VALGRIND_CMD = 'valgrind --tool=memcheck --leak-check=yes --undef-value-errors=yes' class TestProxy(object): def __init__( self, test_exe_path, use_valgrind=False ): self.test_exe_path = os.path.normpath( os.path.a...
mpl-2.0
slohse/ansible
lib/ansible/modules/network/netscaler/netscaler_service.py
67
31451
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2017 Citrix Systems # 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', ...
gpl-3.0
jing-bao/pa-chromium
build/android/adb_reverse_forwarder.py
14
2318
#!/usr/bin/env python # # Copyright (c) 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. """Command line tool for forwarding ports from a device to the host. Allows an Android device to connect to services running on ...
bsd-3-clause
6WIND/scapy
scapy/volatile.py
1
30290
# This file is part of Scapy # See http://www.secdev.org/projects/scapy for more information # Copyright (C) Philippe Biondi <phil@secdev.org> # Copyright (C) Michael Farrell <micolous+git@gmail.com> # Copyright (C) Gauthier Sebaux # This program is published under a GPLv2 license """ Fields that hold random numbers. ...
gpl-2.0
serialx/pexpect-u
pexpect/pxssh.py
1
14873
"""This class extends pexpect.spawn to specialize setting up SSH connections. This adds methods for login, logout, and expecting the shell prompt. $Id: pxssh.py 523 2010-10-17 11:01:22Z noah $ """ from pexpect import * import pexpect import time import os __all__ = ['ExceptionPxssh', 'pxssh'] # Exception classes us...
mit
glwu/python-for-android
python-build/python-libs/gdata/build/lib/atom/__init__.py
136
49199
#!/usr/bin/python # # Copyright (C) 2006 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 ...
apache-2.0
echanna/EdxNotAFork
common/djangoapps/terrain/steps.py
10
6709
# pylint: disable=C0111 # pylint: disable=W0621 # Disable the "wildcard import" warning so we can bring in all methods from # course helpers and ui helpers # pylint: disable=W0401 # Disable the "Unused import %s from wildcard import" warning # pylint: disable=W0614 # Disable the "unused argument" warning because let...
agpl-3.0
petecummings/django
tests/gis_tests/geoapp/models.py
96
2364
from django.utils.encoding import python_2_unicode_compatible from ..models import models from ..utils import gisfield_may_be_null @python_2_unicode_compatible class NamedModel(models.Model): name = models.CharField(max_length=30) objects = models.GeoManager() class Meta: abstract = True ...
bsd-3-clause
bowlofstew/Herd
herd/BitTornado/BT1/Uploader.py
2
4774
# Written by Bram Cohen # see LICENSE.txt for license information from herd.BitTornado.CurrentRateMeasure import Measure try: True except: True = 1 False = 0 class Upload: def __init__(self, connection, ratelimiter, totalup, choker, storage, picker, config): self.connection =...
mit
quadcores/linux
scripts/tracing/draw_functrace.py
14676
3560
#!/usr/bin/python """ Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com> Licensed under the terms of the GNU GPL License version 2 This script parses a trace provided by the function tracer in kernel/trace/trace_functions.c The resulted trace is processed into a tree to produce a more human view of the call ...
gpl-2.0
jelmer/dystros
travel.py
1
7230
#!/usr/bin/python3 # encoding: utf-8 # # Dystros # Copyright (C) 2016 Jelmer Vernooij <jelmer@jelmer.uk> # # 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; version 2 # of the License or (at your o...
gpl-3.0
queenp/wakatime
wakatime/packages/pygments_py2/pygments/lexers/robotframework.py
77
18633
# -*- coding: utf-8 -*- """ pygments.lexers.robotframework ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lexer for Robot Framework. :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ # Copyright 2012 Nokia Siemens Networks Oyj # # Licensed under the ...
bsd-3-clause
panchr/nums
nums/errors.py
1
1817
# nums.errors.py # written by Rushy Panchal # version 1.0 '''Errors library for the 'nums' package 'nums.errors.py' houses the NumericalError class, which is a custom Exception for the 'nums' package. It does not serve much purpose outside of the package itself. ''' ### Change Log: # v1.0: Initial release, after s...
gpl-3.0
bitoffdev/perkins-blues
interfaces/telegram/colorDict.py
2
14316
#! /usr/bin/env python # -*- coding: utf-8 -*- # vim:fenc=utf-8 """ Color dict """ # Dictionary of colornames indexed by key _Hex: # See https://bdhacker.wordpress.com/2010/02/27/python-tutorial-dictionaries-key-value-pair-maps-basics/ HexNameDict = { \ "black":"#000000" \ ,"gray0":"#000000" \ ,"navy":"#000080" \ ,"N...
mit
r03ert0/ldsc
ldscore/parse.py
1
10016
''' (c) 2014 Brendan Bulik-Sullivan and Hilary Finucane This module contains functions for parsing various ldsc-defined file formats. ''' from __future__ import division import numpy as np import pandas as pd import os def series_eq(x, y): '''Compare series, return False if lengths not equal.''' return len...
gpl-3.0
taedla01/ardupilot
Tools/autotest/apm_unit_tests/dev/arducopter_AP_Limits.py
227
2098
import arducopter import util, pexpect, sys, time, math, shutil, os from common import * import mavutil, mavwp, random def unit_test(mavproxy, mav): '''A scripted flight plan for testing AP_Limits''' time.sleep(5) print "# Setting AP_Limits parameters" mavproxy.send('param set LIM_ENABLED 1\n') ...
gpl-3.0
mluke93/osf.io
admin/pre_reg/forms.py
37
1405
from django import forms class DraftRegistrationForm(forms.Form): proof_of_publication = forms.ChoiceField( label='Proof of publication', choices=( ('not_submitted', 'Published Article Not Yet Submitted'), ('submitted', 'Published Article Submitted'), ('under_r...
apache-2.0
openstack/congress
congress/tests/db/test_db_policy_rules.py
2
5767
# Copyright (c) 2014 VMware, 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 la...
apache-2.0
fabianrost84/cython
Cython/Compiler/Naming.py
4
5823
# # C naming conventions # # # Prefixes for generating C names. # Collected here to facilitate ensuring uniqueness. # pyrex_prefix = "__pyx_" codewriter_temp_prefix = pyrex_prefix + "t_" temp_prefix = u"__cyt_" builtin_prefix = pyrex_prefix + "builtin_" arg_prefix = pyrex_prefix + "arg_" f...
apache-2.0
40223249-1/-w16b_test
static/Brython3.1.3-20150514-095342/Lib/site-packages/pygame/base.py
603
4652
#!/usr/bin/env python ## https://bitbucket.org/pygame/pygame/raw/2383b8ab0e2273bc83c545ab9c18fee1f3459c64/pygame/base.py '''Pygame core routines Contains the core routines that are used by the rest of the pygame modules. Its routines are merged directly into the pygame namespace. This mainly includes the auto-initia...
agpl-3.0
teeple/pns_server
work/install/Python-2.7.4/Lib/plat-irix6/WAIT.py
66
5559
# Generated by h2py from /usr/include/sys/wait.h from warnings import warnpy3k warnpy3k("the WAIT module has been removed in Python 3.0", stacklevel=2) del warnpy3k # Included from standards.h def _W_INT(i): return (i) WUNTRACED = 0004 WNOHANG = 0100 _WSTOPPED = 0177 def WIFEXITED(stat): return ((_W_INT(stat)&0377)==...
gpl-2.0
vadimtk/chrome4sdp
third_party/google_input_tools/update.py
37
10314
#!/usr/bin/python # 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. """Performs pull of google-input-tools from local clone of GitHub repository.""" import json import logging import optparse import os impo...
bsd-3-clause
barbour-em/osf.io
tests/test_models.py
1
138219
# -*- coding: utf-8 -*- '''Unit tests for models and their factories.''' import mock import unittest from nose.tools import * # noqa (PEP8 asserts) import pytz import datetime import urlparse import itsdangerous from dateutil import parser from modularodm import Q from modularodm.exceptions import ValidationError, ...
apache-2.0
levkar/odoo
odoo/addons/base/tests/test_menu.py
67
1338
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo.tests.common import TransactionCase class TestMenu(TransactionCase): def test_00_menu_deletion(self): """Verify that menu deletion works properly when there are child menus, and those ...
agpl-3.0
xin3liang/platform_external_chromium_org
tools/telemetry/telemetry/core/platform/cros_sysfs_platform.py
2
1857
# 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. from telemetry.core.platform import sysfs_platform class CrosSysfsPlatform(sysfs_platform.SysfsPlatform): """A SysfsPlatform implementation to be used fo...
bsd-3-clause
vishnu2kmohan/dcos
packages/adminrouter/extra/src/test-harness/tests/test_auth.py
2
9371
# Copyright (C) Mesosphere, Inc. See LICENSE file for details. import os import time import pytest import requests from generic_test_code.common import assert_endpoint_response from util import GuardedSubprocess, SearchCriteria, auth_type_str, jwt_type_str EXHIBITOR_PATH = "/exhibitor/foo/bar" class TestAuthnJWTV...
apache-2.0
Neamar/django
django/contrib/auth/hashers.py
211
17463
from __future__ import unicode_literals import base64 import binascii import hashlib import importlib from collections import OrderedDict from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.core.signals import setting_changed from django.dispatch import receiver from d...
bsd-3-clause
chadelofson/vbs2py3
venv/Lib/site-packages/pip/_vendor/requests/compat.py
114
2601
# -*- coding: utf-8 -*- """ pythoncompat """ from .packages import chardet import sys # ------- # Pythons # ------- # Syntax sugar. _ver = sys.version_info #: Python 2.x? is_py2 = (_ver[0] == 2) #: Python 3.x? is_py3 = (_ver[0] == 3) #: Python 3.0.x is_py30 = (is_py3 and _ver[1] == 0) #: Python 3.1.x is_py31 =...
gpl-3.0
tobikausk/nest-simulator
pynest/examples/brette_gerstner_fig_3d.py
17
2461
# -*- coding: utf-8 -*- # # brette_gerstner_fig_3d.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 ...
gpl-2.0
puttarajubr/commcare-hq
corehq/apps/api/es.py
1
26064
import logging import json import six import copy import datetime from django.http import HttpResponse from django.utils.decorators import method_decorator, classonlymethod from django.views.generic import View from corehq.pillows.mappings.case_mapping import CASE_INDEX from corehq.pillows.mappings.reportcase_mapping ...
bsd-3-clause
andresgz/django
django/contrib/admin/templatetags/admin_urls.py
553
1812
from django import template from django.contrib.admin.utils import quote from django.core.urlresolvers import Resolver404, get_script_prefix, resolve from django.utils.http import urlencode from django.utils.six.moves.urllib.parse import parse_qsl, urlparse, urlunparse register = template.Library() @register.filter ...
bsd-3-clause
yinquan529/pandaboard
Documentation/networking/cxacru-cf.py
14668
1626
#!/usr/bin/env python # Copyright 2009 Simon Arlott # # 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 i...
gpl-2.0
josephcslater/scipy
benchmarks/benchmarks/go_benchmark_functions/go_funcs_G.py
47
6555
# -*- coding: utf-8 -*- from __future__ import division, print_function, absolute_import import numpy as np from numpy import abs, sin, cos, exp, floor, log, arange, prod, sqrt, sum from .go_benchmark import Benchmark class Gear(Benchmark): r""" Gear objective function. This class defines the Gear [1]...
bsd-3-clause
wilebeast/FireFox-OS
B2G/gecko/media/webrtc/trunk/tools/gyp/test/mac/gyptest-loadable-module.py
103
1190
#!/usr/bin/env python # Copyright (c) 2012 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. """ Tests that a loadable_module target is built correctly. """ import TestGyp import os import sys if sys.platform == 'darwin': test =...
apache-2.0
40223231/w16b_test
static/Brython3.1.1-20150328-091302/Lib/logging/__init__.py
733
66279
# Copyright 2001-2013 by Vinay Sajip. All Rights Reserved. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, # provided that the above copyright notice appear in all copies and that # both that copyright notice and this permissio...
agpl-3.0
Salandora/OctoPrint
src/octoprint/util/pip.py
3
14310
# coding=utf-8 from __future__ import absolute_import, division, print_function __author__ = "Gina Häußge <osd@foosel.net>" __license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html' __copyright__ = "Copyright (C) 2015 The OctoPrint Project - Released under terms of the AGPLv3 License" i...
agpl-3.0
dims/glance
glance/db/sqlalchemy/migrate_repo/versions/006_key_to_name.py
19
5029
# Copyright 2011 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
apache-2.0
gmph/grahambot
requests/packages/urllib3/poolmanager.py
678
9406
import logging try: # Python 3 from urllib.parse import urljoin except ImportError: from urlparse import urljoin from ._collections import RecentlyUsedContainer from .connectionpool import HTTPConnectionPool, HTTPSConnectionPool from .connectionpool import port_by_scheme from .exceptions import LocationValue...
apache-2.0
OpenTreeOfLife/phylostylotastic
psmetadata.py
2
4288
# # Displays all the metadata contained in a NeXML file. # import dendropy from pprint import pprint from StringIO import StringIO import argparse import sys import os argparser = argparse.ArgumentParser( description='Display all the metadata contained in a file that PhyloStyloTastic can see or render' ) argpars...
mit
astropy/astropy
astropy/tests/disable_internet.py
8
1514
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This is retained only for backwards compatibility. Affiliated packages should no longer import ``disable_internet`` from ``astropy.tests``. It is now available from ``pytest_remotedata``. However, this is not the recommended mechanism for controlling a...
bsd-3-clause
goliate/sarakha63-persomov
couchpotato/core/media/movie/providers/trailer/youtube_dl/postprocessor/xattrpp.py
31
4212
from __future__ import unicode_literals import os import subprocess import sys from .common import PostProcessor from ..compat import ( subprocess_check_output ) from ..utils import ( check_executable, hyphenate_date, ) class XAttrMetadataPP(PostProcessor): # # More info about extended attribut...
gpl-3.0
wfgoh/wien2plot
wien2plot.py
1
4933
import numpy as np import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import ast from scipy import constants import argparse import os def readene(fermi,filename) : fermi=fermi f = open(filename,'r') f_inp = f.readlines() f.close() nbnd=maxbnd ib=maxkpt ene=np.zeros((maxbnd,maxkpt)) ik=0 ...
mit
MSeifert04/astropy
astropy/io/misc/asdf/tags/time/timedelta.py
3
1147
# Licensed under a 3-clause BSD style license - see LICENSE.rst # -*- coding: utf-8 -*- import functools from asdf.yamlutil import custom_tree_to_tagged_tree import numpy as np from astropy.time import TimeDelta from ...types import AstropyType __all__ = ['TimeDeltaType'] allclose_jd = functools.partial(np.allclos...
bsd-3-clause
ramcn/demo3
venv/lib/python3.4/site-packages/django/views/static.py
190
5142
""" Views and functions for serving static files. These are only to be used during development, and SHOULD NOT be used in a production setting. """ from __future__ import unicode_literals import mimetypes import os import posixpath import re import stat from django.http import ( FileResponse, Http404, HttpRespons...
mit
codasus/django-blogages
blogages/django/core/files/images.py
324
1733
""" Utility functions for handling images. Requires PIL, as you might imagine. """ from django.core.files import File class ImageFile(File): """ A mixin for use alongside django.core.files.base.File, which provides additional features for dealing with images. """ def _get_width(self): ret...
mit
partofthething/home-assistant
homeassistant/components/iss/binary_sensor.py
16
3948
"""Support for International Space Station data sensor.""" from datetime import timedelta import logging import pyiss import requests import voluptuous as vol from homeassistant.components.binary_sensor import PLATFORM_SCHEMA, BinarySensorEntity from homeassistant.const import ( ATTR_LATITUDE, ATTR_LONGITUDE,...
mit
CJ8664/servo
tests/wpt/web-platform-tests/tools/pytest/doc/en/example/multipython.py
171
1735
""" module containing a parametrized tests testing cross-python serialization via the pickle module. """ import py import pytest import _pytest._code pythonlist = ['python2.6', 'python2.7', 'python3.3'] @pytest.fixture(params=pythonlist) def python1(request, tmpdir): picklefile = tmpdir.join("data.pickle") ret...
mpl-2.0
thumbor-community/aws
tc_aws/loaders/presigning_loader.py
1
1674
# coding: utf-8 # Copyright (c) 2015, thumbor-community # Use of this source code is governed by the MIT license that can be # found in the LICENSE file. from tornado.concurrent import return_future import thumbor.loaders.http_loader as http_loader from . import * from ..aws.bucket import Bucket def validate(conte...
mit
dhyams/SALib
SALib/sample/sobol.py
2
4366
from __future__ import division import numpy as np from sys import exit import math import os #============================================================================== # The following code is based on the Sobol sequence generator by Frances # Y. Kuo and Stephen Joe. The license terms are provided below. ...
lgpl-3.0
eduNEXT/edunext-ecommerce
ecommerce/extensions/catalogue/migrations/0037_add_sec_disc_reward_coupon_category.py
1
1476
# -*- coding: utf-8 -*- """ Adds a new couple category that will be used to track rewards given to members of the community who make security disclosures. """ from __future__ import absolute_import, unicode_literals from django.db import migrations from oscar.apps.catalogue.categories import create_from_breadcrumbs ...
agpl-3.0
debugger87/spark
python/pyspark/ml/__init__.py
38
1470
# # 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
Xbalien/Mobile-Security-Framework-MobSF
StaticAnalyzer/models.py
33
2615
from django.db import models # Create your models here. class StaticAnalyzerAndroid(models.Model): TITLE=models.TextField() APP_NAME = models.TextField() SIZE = models.CharField(max_length=50) MD5 =models.CharField(max_length=30) SHA1 =models.TextField() SHA256 =models.TextField() PACKAGENAME=models.TextField() ...
gpl-3.0
pwyliu/cloud-init-0.6.3
cloud-init-cfg.py
2
3333
#!/usr/bin/python # vi: ts=4 expandtab # # Copyright (C) 2009-2010 Canonical Ltd. # Copyright (C) 2012 Hewlett-Packard Development Company, L.P. # # Author: Scott Moser <scott.moser@canonical.com> # Author: Juerg Haefliger <juerg.haefliger@hp.com> # # This program is free software: you can redistribute i...
gpl-3.0
Distrotech/gerrit
gerrit-pgm/src/main/resources/com/google/gerrit/pgm/Startup.py
21
1245
# Copyright (C) 2013 The Android Open Source Project # # 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 ag...
apache-2.0
wyc/django
django/conf/locale/it/formats.py
504
2079
# -*- 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 = 'd F Y' # 25 Ottobre 2006 TIME_FO...
bsd-3-clause
forpster/dotfiles
home/.emacs.d/.python-environments/default/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/contrib/appengine.py
154
7938
from __future__ import absolute_import import logging import os import warnings from ..exceptions import ( HTTPError, HTTPWarning, MaxRetryError, ProtocolError, TimeoutError, SSLError ) from ..packages.six import BytesIO from ..request import RequestMethods from ..response import HTTPResponse ...
mit
nirs/vdsm
lib/vdsm/network/tc/filter.py
2
9224
# Copyright 2014 Red Hat, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the ...
gpl-2.0
wadobo/winvo
winvo.py
1
11383
#!/usr/bin/env python2 # Copyright (C) 2013 Daniel Garcia <danigm@wadobo.com> # 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 v...
gpl-3.0
bbc/kamaelia
Code/Python/Kamaelia/Kamaelia/Codec/Speex.py
3
3368
# -*- coding: utf-8 -*- # Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1) # # (1) Kamaelia Contributors are listed in the AUTHORS file and at # http://www.kamaelia.org/AUTHORS - please extend this file, # not this notice. # # Licensed under the Apache License, Version 2.0 (the "Lic...
apache-2.0
crigroup/criros
src/criros/exploration.py
1
3214
#! /usr/bin/env python import itertools import numpy as np import openravepy as orpy # Image geometry from sensor_msgs.msg import CameraInfo from image_geometry import PinholeCameraModel # Transformations import tf.transformations as tr def camera_fov_corners(camera_info, zdist, Tcamera=np.eye(4)): """ Generates ...
bsd-3-clause
muminoff/Server-Inventory
inventory/inventory/wsgi.py
1
1566
""" WSGI config for inventory project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLICATION`...
apache-2.0
jcftang/ansible-modules-extras
monitoring/zabbix_host.py
21
21855
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013-2014, Epic Games, 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 # (...
gpl-3.0
gokulpch/OpenContrail-Kolla
kolla-ansible/doc/conf.py
1
2735
# -*- coding: utf-8 -*- # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software...
mit
sam-geek/mbed
workspace_tools/options.py
51
1606
""" mbed SDK Copyright (c) 2011-2013 ARM Limited 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 wr...
apache-2.0
gflegar/cryptography-studio
plugins/cipher/substitution_cipher/permutation_selector.py
1
7081
""" This module implements a PermutationSelector widget used as part of the plugin's user interface. """ from gi.repository import Gtk import math from plugins.cipher.substitution_cipher.permutation_bit import PermutationBit from plugins.utils.permutation import Permutation class PermutationSelector(Gtk.Box): ...
gpl-2.0
CMUSV-VisTrails/WorkflowRecommendation
vistrails/db/versions/v0_9_0/domain/workflow.py
1
6526
############################################################################### ## ## Copyright (C) 2006-2011, University of Utah. ## All rights reserved. ## Contact: contact@vistrails.org ## ## This file is part of VisTrails. ## ## "Redistribution and use in source and binary forms, with or without ## modification, ...
bsd-3-clause
marcwebbie/youtube-dl
youtube_dl/downloader/f4m.py
13
15618
from __future__ import division, unicode_literals import base64 import io import itertools import os import time from .fragment import FragmentFD from ..compat import ( compat_etree_fromstring, compat_urlparse, compat_urllib_error, compat_urllib_parse_urlparse, compat_struct_pack, compat_struc...
unlicense
hnakamur/ansible
lib/ansible/executor/task_executor.py
3
21127
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.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) an...
gpl-3.0
jaredivey/ns-3-sdn
src/dsdv/bindings/callbacks_list.py
151
1222
callback_classes = [ ['void', 'ns3::Ptr<ns3::Packet const>', 'ns3::Ipv4Header const&', 'ns3::Socket::SocketErrno', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], ['void', 'ns3::Ptr<ns3::Ipv4Route>', 'ns3::Ptr<ns3::Packet const>', 'ns3::Ipv4Header const&', 'ns3::empty', 'ns3...
gpl-2.0
krikru/tensorflow-opencl
tensorflow/g3doc/how_tos/adding_an_op/zero_out_3_test.py
56
1810
# 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
pgroudas/pants
src/python/pants/backend/project_info/tasks/depmap.py
1
14785
# 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 json import o...
apache-2.0
nhicher/ansible
lib/ansible/modules/network/nos/nos_command.py
73
7281
#!/usr/bin/python # Copyright: (c) 2018, Extreme Networks 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) ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
gpl-3.0
Jgarcia-IAS/Fidelizacion_odoo
openerp/addons/mail/tests/common.py
125
5720
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
agpl-3.0
Gillygilkim21/PyPakUtils
examples/Client/SensorClient.py
1
4416
from API import * import Queue import time import logging class SensorClient: '''An easy to use sensor client for OpenTSDB''' def pushToBuffer(self, timestamp, value, tags): if timestamp == None: timestamp = self.nowMS() self.__queue.put(PutData(timestamp, value, tags)) self.__queue.ta...
gpl-3.0
xujb/odoo
addons/hr_holidays/hr_holidays.py
159
33482
# -*- coding: utf-8 -*- ################################################################################## # # Copyright (c) 2005-2006 Axelor SARL. (http://www.axelor.com) # and 2004-2010 Tiny SPRL (<http://tiny.be>). # # $Id: hr.py 4656 2006-11-24 09:58:42Z Cyp $ # # This program is free software: you can redistri...
agpl-3.0
ygrass/handsome
payments/views.py
1
8035
# -*- coding: utf-8 -*- import json from datetime import datetime from django.conf import settings from django.contrib.sites.models import get_current_site from django.core.urlresolvers import reverse from django.http.response import Http404, HttpResponseForbidden, HttpResponse from django.views.generic.base import Re...
unlicense
yan12125/google-play-downloader
OperatorModel.py
1
13502
class Operator: OPERATORS = { "Brazil": {'TIM': '72402', 'Claro': '72405', 'Vivo': '72406', 'Oi': '72431'}, "Canada": {'MicroCell': '302370', 'Fido Canada': '30200001', 'Telus': '302220', 'Rogers A&T': '302720'}, "Guinea-Bissau": {'Orange': '63203', 'Arreba': '63202'}, "Kuwait": {'Vi...
gpl-3.0