repo_name
stringlengths
6
100
path
stringlengths
4
294
copies
stringlengths
1
5
size
stringlengths
4
6
content
stringlengths
606
896k
license
stringclasses
15 values
heracek/django-nonrel
tests/regressiontests/requests/tests.py
26
8301
import time from datetime import datetime, timedelta from StringIO import StringIO from django.core.handlers.modpython import ModPythonRequest from django.core.handlers.wsgi import WSGIRequest, LimitedStream from django.http import HttpRequest, HttpResponse, parse_cookie from django.utils import unittest from django.u...
bsd-3-clause
frtmelody/tornado
demos/helloworld/helloworld.py
100
1222
#!/usr/bin/env python # # Copyright 2009 Facebook # # 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
datamade/yournextmp-popit
candidates/tests/test_person_view.py
1
2933
# Smoke tests for viewing a candidate's page from datetime import date, timedelta import re from django.conf import settings from django.test.utils import override_settings from django_webtest import WebTest from .factories import ( AreaTypeFactory, ElectionFactory, CandidacyExtraFactory, ParliamentaryChambe...
agpl-3.0
gminds/rapidnewsng
django/contrib/gis/geos/tests/test_geos_mutation.py
198
5424
# Copyright (c) 2008-2009 Aryeh Leib Taurog, all rights reserved. # Modified from original contribution by Aryeh Leib Taurog, which was # released under the New BSD license. from django.contrib.gis.geos import * from django.contrib.gis.geos.error import GEOSIndexError from django.utils import unittest def getItem(o,i...
bsd-3-clause
gohin/django
tests/middleware/tests.py
47
32427
# -*- coding: utf-8 -*- from __future__ import unicode_literals import gzip import random import re from io import BytesIO from unittest import skipIf from django.conf import settings from django.core import mail from django.core.exceptions import PermissionDenied from django.http import ( FileResponse, HttpReque...
bsd-3-clause
chemelnucfin/tensorflow
tensorflow/python/framework/smart_cond.py
5
4497
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
nlloyd/SubliminalCollaborator
libs/twisted/test/stdio_test_producer.py
40
1497
# -*- test-case-name: twisted.test.test_stdio.StandardInputOutputTestCase.test_producer -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Main program for the child process run by L{twisted.test.test_stdio.StandardInputOutputTestCase.test_producer} to test that process transports implemen...
apache-2.0
antoinecarme/pyaf
setup.py
1
1126
from setuptools import setup from setuptools import find_packages with open("README.md", "r") as fh: pyaf_long_description = fh.read() setup(name='pyaf', version='3.0-RC1', description='Python Automatic Forecasting', long_description=pyaf_long_description, long_description_content_type...
bsd-3-clause
vinegret/youtube-dl
youtube_dl/extractor/vshare.py
20
2281
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import compat_chr from ..utils import ( decode_packed_codes, ExtractorError, ) class VShareIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?vshare\.io/[dv]/(?P<id>[^/?#&]+)' _TESTS =...
unlicense
vlegoff/tsunami
src/primaires/pnj/contextes/__init__.py
1
1640
# -*-coding:Utf-8 -* # Copyright (c) 2010-2017 LE GOFF Vincent # 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 ...
bsd-3-clause
MoKee/android_kernel_samsung_aries
tools/perf/scripts/python/sched-migration.py
11215
11670
#!/usr/bin/python # # Cpu task migration overview toy # # Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com> # # perf script event handlers have been generated by perf script -g python # # This software is distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Fre...
gpl-2.0
miguelalonso/pywws
src/doc/conf.py
1
9030
# -*- coding: utf-8 -*- # # pywws - Python software for USB Wireless Weather Stations # http://github.com/jim-easterbrook/pywws # Copyright (C) 2008-15 pywws contributors # 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...
gpl-2.0
nevins-b/lemur
lemur/tests/test_validators.py
2
1122
import pytest from datetime import datetime from .vectors import PRIVATE_KEY_STR from marshmallow.exceptions import ValidationError def test_private_key(session): from lemur.common.validators import private_key private_key(PRIVATE_KEY_STR) with pytest.raises(ValidationError): private_key('invali...
apache-2.0
PaddlePaddle/Paddle
python/paddle/fluid/incubate/fleet/parameter_server/ir/public.py
1
50054
# Copyright (c) 2020 PaddlePaddle 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 appli...
apache-2.0
animekita/selvbetjening
selvbetjening/frontend/userportal/views.py
1
7865
# coding=UTF-8 from django.shortcuts import render from django.contrib.auth.decorators import login_required from django.contrib.auth.models import AnonymousUser from django.http import HttpResponseRedirect from django.core.urlresolvers import reverse from django.utils.translation import ugettext as _ from django.shor...
mit
shuhaida6704/account-financial-reporting
account_tax_report_no_zeroes/report/report_vat.py
14
1098
# -*- encoding: utf-8 -*- ############################################################################## # For copyright and license notices, see __openerp__.py file in root directory ############################################################################## from openerp import models from openerp.addons.account.re...
agpl-3.0
rdhyee/osf.io
api/institutions/serializers.py
4
3075
from rest_framework import serializers as ser from rest_framework import exceptions from modularodm import Q from website.models import Node from website.util import permissions as osf_permissions from api.base.serializers import JSONAPISerializer, RelationshipField, LinksField, JSONAPIRelationshipSerializer from ap...
apache-2.0
choderalab/ensembler
ensembler/pdb.py
1
4246
import sys if sys.version_info > (3, 0): from urllib.request import urlopen from urllib.error import URLError from io import StringIO else: from urllib2 import urlopen, URLError from StringIO import StringIO import gzip import re import six def extract_residues_by_resnum(output_file, pdb_input_file...
gpl-2.0
fefifofum/android_kernel_bq_maxwell2plus_3.0.8
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
yaroslavvb/tensorflow
tensorflow/python/training/server_lib_same_variables_clear_container_test.py
134
3129
# 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
0dataloss/ansible-modules-core
files/xattr.py
60
6186
#!/usr/bin/python # 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...
gpl-3.0
yfried/ansible
test/units/module_utils/basic/test_tmpdir.py
78
4159
# -*- coding: utf-8 -*- # Copyright (c) 2018 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Make coding more python3-ish from __future__ import (absolute_import, division) __metaclass__ = type import json import os import shutil import tempfile import p...
gpl-3.0
edxnercel/edx-platform
common/test/acceptance/pages/studio/index.py
102
4852
""" Studio Home page """ from bok_choy.page_object import PageObject from . import BASE_URL class DashboardPage(PageObject): """ Studio Home page """ url = BASE_URL + "/course/" def is_browser_on_page(self): return self.q(css='body.view-dashboard').present @property def course_...
agpl-3.0
AlexandreProenca/django-rest-framework
tests/test_validators.py
65
12626
import datetime from django.db import models from django.test import TestCase from rest_framework import serializers def dedent(blocktext): return '\n'.join([line[12:] for line in blocktext.splitlines()[1:-1]]) # Tests for `UniqueValidator` # --------------------------- class UniquenessModel(models.Model): ...
bsd-2-clause
adamwwt/chvac
venv/lib/python2.7/site-packages/setuptools/command/test.py
285
5932
from setuptools import Command from distutils.errors import DistutilsOptionError import sys from pkg_resources import * from pkg_resources import _namespace_packages from unittest import TestLoader, main class ScanningLoader(TestLoader): def loadTestsFromModule(self, module): """Return a suite of all test...
mit
3dfxsoftware/cbss-addons
hr_gamification/__openerp__.py
62
1622
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013 OpenERP SA (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
gpl-2.0
varunarya10/python-cinderclient
cinderclient/tests/v2/test_qos.py
6
2975
# Copyright (C) 2013 eBay 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...
apache-2.0
Abi1ity/uniclust2.0
flask/lib/python2.7/site-packages/django/contrib/gis/utils/ogrinfo.py
564
1984
""" This module includes some utility functions for inspecting the layout of a GDAL data source -- the functionality is analogous to the output produced by the `ogrinfo` utility. """ from django.contrib.gis.gdal import DataSource from django.contrib.gis.gdal.geometries import GEO_CLASSES def ogrinfo(data_source, num...
bsd-3-clause
wweiradio/django
django/contrib/sessions/backends/signed_cookies.py
383
2895
from django.conf import settings from django.contrib.sessions.backends.base import SessionBase from django.core import signing class SessionStore(SessionBase): def load(self): """ We load the data from the key itself instead of fetching from some external data store. Opposite of _get_sess...
bsd-3-clause
sdbondi/Arduino-Talk
Comet/python/ArduinoServer.py
1
6552
#!/usr/bin/python import human_curl as requests import serial import platform import sys import getopt import socket import json import time _WINDOWS = (platform.system() == 'Windows') _AJAXURL = 'http://localhost/arduino/comet-router.php?action=%(action)s' #_AJAXURL = 'http://themousepotatowebsite.co.za/experiments/...
mit
roadmapper/ansible
lib/ansible/modules/cloud/amazon/aws_acm_info.py
9
9958
#!/usr/bin/python # Copyright (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['pre...
gpl-3.0
spektom/incubator-airflow
airflow/contrib/hooks/aws_lambda_hook.py
12
1180
# # 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...
apache-2.0
halleyzhao/libyami
testscripts/yamilib.py
5
8617
import os import sys import hashlib import string import shutil import time class libyami: decodepsnr = 40 encodepsnr = 33 decodefiltes = ['h264','264','26l','jsv','jvt','avc','ivf','jpeg','mjpg','jpg'] encodefiltes = ['I420','NV12','yuv'] def __init__(self, decode, encode, psnr): self.decod...
lgpl-2.1
UnknownzD/I9103_ICS_Kernel
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...
gpl-2.0
thaumos/ansible
test/sanity/pylint/plugins/blacklist.py
46
8168
"""A plugin for pylint to identify imports and functions which should not be used.""" from __future__ import (absolute_import, division, print_function) __metaclass__ = type import astroid from pylint.checkers import BaseChecker from pylint.interfaces import IAstroidChecker class BlacklistEntry(object): """Def...
gpl-3.0
paterson/servo
tests/wpt/css-tests/tools/pywebsocket/src/mod_pywebsocket/http_header_util.py
694
6905
# Copyright 2011, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
mpl-2.0
sureshthalamati/spark
python/pyspark/rddsampler.py
157
4250
# # 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
lookout/dd-agent
win32/gui.py
4
28641
# -*- coding: utf-8 -*- # # Copyright © 2009-2010 CEA # Pierre Raybaut # Licensed under the terms of the CECILL License # Modified for Datadog # stdlib import logging import os import os.path as osp import platform # To manage the agent on OSX from subprocess import ( CalledProcessError, check_call, check_...
bsd-3-clause
jomauricio/abgthe
abgthe/contrib/sites/migrations/0001_initial.py
7
1024
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django.contrib.sites.models class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Site', fields=[ ...
bsd-3-clause
mkhsueh/python_koans
python2/koans/about_proxy_object_project.py
78
4194
#!/usr/bin/env python # -*- coding: utf-8 -*- # Project: Create a Proxy Class # # In this assignment, create a proxy class (one is started for you # below). You should be able to initialize the proxy object with any # object. Any attributes called on the proxy object should be forwarded # to the target object. As e...
mit
thorwhalen/ut
ml/sk/transformers.py
1
4610
__author__ = 'thor' from sklearn.base import TransformerMixin, BaseEstimator from sklearn.neighbors import KNeighborsRegressor from pandas import DataFrame import numpy as np from nltk import word_tokenize from functools import reduce class HourOfDayTransformer(TransformerMixin): def __init__(self, date_field=...
mit
RealImpactAnalytics/airflow
tests/dags/test_no_impersonation.py
15
1386
# -*- coding: utf-8 -*- # # 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 #...
apache-2.0
ahewer/ematoblender
ematoblender/scripts/ema_blender/ema_bge/bge_standard_gamefns.py
3
2836
__author__ = 'Kristy' import bge from collections import defaultdict def get_scene_info(): """Typical functions run every tick to access scene objects. Returns scene object, list of objects in scene, controller object, owner of the controller, actuators of this object.""" scn = bge.logic.getCurrentSc...
gpl-3.0
mwmuni/LIGGGHTS_GUI
networkx/tests/test_convert_scipy.py
31
9362
from nose import SkipTest from nose.tools import assert_raises, assert_true, assert_equal, raises import networkx as nx from networkx.testing import assert_graphs_equal from networkx.generators.classic import barbell_graph,cycle_graph,path_graph from networkx.testing.utils import assert_graphs_equal class TestConver...
gpl-3.0
LucasFerreiraDaSilva/ScrapingINMET
geraBase.py
1
3704
""" Autor: Lucas Ferreira da Silva Email: lferreira@inf.ufsm.br Descricao: Script para download dos dados referentes a cada estacao metereologica e criacao de uma pequena "base de dados" em formato JSON referente a todas as estacoes Execucao (comando): python3 geraBase.py Saida: Arquivo JSON (e...
mit
BlackHole/enigma2-1
lib/python/Components/Converter/TemplatedMultiContent.py
2
2918
from Components.Converter.StringList import StringList class TemplatedMultiContent(StringList): """Turns a python tuple list into a multi-content list which can be used in a listbox renderer.""" def __init__(self, args): StringList.__init__(self, args) from enigma import eListboxPythonMultiContent, gFont, RT_HAL...
gpl-2.0
kobolabs/calibre
recipes/sltrib.py
27
2617
from calibre.web.feeds.news import BasicNewsRecipe class AdvancedUserRecipe1278347258(BasicNewsRecipe): title = u'Salt Lake City Tribune' __author__ = 'Charles Holbert' oldest_article = 7 max_articles_per_feed = 100 description = '''Utah's independent news source since 1871''' ...
gpl-3.0
40223135/40223135-
static/Brython3.1.1-20150328-091302/Lib/xml/sax/xmlreader.py
824
12612
"""An XML Reader is the SAX 2 name for an XML parser. XML Parsers should be based on this code. """ from . import handler from ._exceptions import SAXNotSupportedException, SAXNotRecognizedException # ===== XMLREADER ===== class XMLReader: """Interface for reading an XML document using callbacks. XMLReade...
gpl-3.0
Neetuj/softlayer-python
SoftLayer/CLI/hardware/create.py
3
4947
"""Order/create a dedicated server.""" # :license: MIT, see LICENSE for more details. import click import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import exceptions from SoftLayer.CLI import formatting from SoftLayer.CLI import helpers from SoftLayer.CLI import template @click.command(epil...
mit
Grumblesaur/quickgen
quickgen.py
1
3966
#!/usr/local/bin/python -tt # -*- coding: utf-8 -*- import os, sys, random #supply input as raw_input if running Python 3 or higher if sys.version_info >= (3,0): raw_input = input def parse(structure, part, phonemes): #grab a random phoneme from the relevant category and return it #structure can be O, N, or C, pas...
gpl-2.0
trondhindenes/ansible-modules-core
cloud/google/gc_storage.py
41
16706
#!/usr/bin/python # 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...
gpl-3.0
donkirkby/live-py-plugin
setup.py
1
1353
import setuptools with open("space_tracer.md") as f: long_description = f.read() about = {} with open("plugin/PySrc/space_tracer/about.py") as f: exec(f.read(), about) # noinspection PyUnresolvedReferences setuptools.setup( name=about['__title__'], version=about['__version__'], author=about['__aut...
mit
suqinhuang/virt-test
virttest/cartesian_config_unittest.py
1
2937
#!/usr/bin/python import unittest, logging, os import gzip import cartesian_config mydir = os.path.dirname(__file__) testdatadir = os.path.join(mydir, 'unittest_data') class CartesianConfigTest(unittest.TestCase): def _checkDictionaries(self, parser, reference): result = list(parser.get_dicts()) #...
gpl-2.0
kyuridenamida/ToolsForAtCoder
tests/utils/gzip_controller.py
2
1295
import os import shutil import tarfile class GZipController: def __init__(self, target_dir, gzip_file_path, main_dirname): self.target_dir = target_dir self.gzip_file_path = gzip_file_path self.main_dirname = main_dirname def create_dir(self): tf = tarfile.open(self.gzip_file...
mit
irblsensitivity/irblsensitivity
scripts/features/MethodFeatures.py
1
6286
#-*- coding: utf-8 -*- ''' Created on 2016. 11. 19 Updated on 2016. 01. 09 ''' from __future__ import print_function import os import re from utils import PrettyStringBuilder from utils import Progress import javalang class Resource(object): Stopwords = None EngDictionary = None @staticmethod d...
apache-2.0
hanks-zyh/Flask-blog
app/auth/views.py
2
4914
#!/usr/bin/env python3 # -*- coding:utf-8 -*- __author__ = 'Hanks' from flask import render_template, redirect, request, url_for, flash from flask.ext.login import login_user, logout_user, login_required from flask.ext.login import current_user from . import auth from ..models import User from ..email import send_ema...
apache-2.0
aplicatii-romanesti/allinclusive-kodi-pi
.kodi/addons/plugin.video.kidsplace/brightcovePlayer.py
1
1587
import httplib from pyamf import AMF0, AMF3 from pyamf import remoting from pyamf.remoting.client import RemotingService height = 1080 def build_amf_request(const, playerID, videoPlayer, publisherID): env = remoting.Envelope(amfVersion=3) env.bodies.append( ( "/1", remotin...
apache-2.0
iamantony/PythonNotes
src/objects/matrix.py
1
5188
__author__ = 'Antony Cherepanov' from exceptions import Exception class MatrixException(Exception): pass class Matrix(object): def __init__(self, t_rowNum=0, t_colNum=0, t_values=None): if not self.__checkDimensionType(t_rowNum) or\ not self.__checkDimensionType(t_colNum...
mit
valexandersaulys/airbnb_kaggle_contest
venv/lib/python3.4/site-packages/scipy/optimize/minpack.py
3
25892
from __future__ import division, print_function, absolute_import import warnings from . import _minpack import numpy as np from numpy import (atleast_1d, dot, take, triu, shape, eye, transpose, zeros, product, greater, array, all, where, isscalar, asarray, inf, abs, ...
gpl-2.0
sugartom/tensorflow-alien
tensorflow/python/kernel_tests/qr_op_test.py
84
5376
# 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
SteveXiSong/UW-Madison-ECE757-S15-MulticastSnooping
ext/ply/test/lex_object.py
174
1141
# ----------------------------------------------------------------------------- # lex_object.py # ----------------------------------------------------------------------------- import sys if ".." not in sys.path: sys.path.insert(0,"..") import ply.lex as lex class CalcLexer: tokens = ( 'NAME','NUMBER', ...
bsd-3-clause
KostasLifeboy/RyzomCore
ryzom/tools/build_gamedata/workspace/ecosystems/jungle/process.py
3
3618
#!/usr/bin/python # # ################################################################# # ## WARNING : this is a generated file, don't change it ! # ################################################################# # # \file config.py # \brief Process configuration # \date 2010-09-19-14-19-GMT # \author Jan Boon (Kae...
agpl-3.0
912/M-new
virtualenvironment/experimental/lib/python2.7/site-packages/django/contrib/gis/geos/tests/test_mutable_list.py
92
14950
# Copyright (c) 2008-2009 Aryeh Leib Taurog, http://www.aryehleib.com # All rights reserved. # # Modified from original contribution by Aryeh Leib Taurog, which was # released under the New BSD license. import unittest from django.contrib.gis.geos.mutable_list import ListMixin from django.utils import six class Use...
gpl-2.0
jhermann/kunstkopf
src/kunstkopf/__init__.py
1
1258
# -*- coding: utf-8 -*- # pylint: disable=bad-whitespace """ kunstkopf [ˈkʊnstkɔp͜f] is a set of tools that handle audio (meta-)data and control hi-fi gear. Copyright © 2015 Jürgen Hermann <jh@web.de> Licensed under the GNU General Public License, Version 3.0 """ # Copyright © 2015 Jürgen Hermann <jh@we...
gpl-3.0
wkhtmltopdf/qtwebkit
Tools/Scripts/webkitpy/common/thread/messagepump.py
151
2482
# Copyright (c) 2010 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 ...
gpl-2.0
kmod/icbd
stdlib/python2.5/codeop.py
306
5999
r"""Utilities to compile possibly incomplete Python source code. This module provides two interfaces, broadly similar to the builtin function compile(), which take program text, a filename and a 'mode' and: - Return code object if the command is complete and valid - Return None if the command is incomplete - Raise Sy...
mit
smallyear/linuxLearn
salt/salt/auth/rest.py
3
1679
# -*- coding: utf-8 -*- ''' Provide authentication using a REST call Django auth can be defined like any other eauth module: .. code-block:: yaml external_auth: rest: ^url: https://url/for/rest/call fred: - .* - '@runner' If there are entries underneath the ^url entry t...
apache-2.0
arteria/django-hijack-admin
hijack_admin/tests/test_settings.py
1
3172
"""Settings that need to be set in order to run the tests.""" import os DEBUG = True SITE_ID = 1 APP_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) DATABASES = { 'default': {'ENGINE': 'django.db.backends.sqlite3', 'NAME': ':memory:', } } LOGIN_REDIRECT_URL = '/hello' HIJA...
mit
avb76/Nova
hubblestack_nova/openssl.py
2
11609
# -*- encoding: utf-8 -*- ''' HubbleStack Nova module for auditing SSL certificates. :maintainer: HubbleStack / avb76 :maturity: 2016.7.0 :platform: Linux :requires: SaltStack, python-OpenSSL This audit module requires YAML data to execute. It will search the yaml data received for the topkey 'openssl'. Sample YAML ...
apache-2.0
michaelld/gnuradio
gr-blocks/python/blocks/qa_vector_sink_source.py
6
5178
#!/usr/bin/env python # # Copyright 2008,2010,2013 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
miguelgrinberg/heat
heat/db/sqlalchemy/migrate_repo/versions/044_snapshots.py
13
1757
# # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # ...
apache-2.0
Kazade/NeHe-Website
django/db/models/__init__.py
248
1500
from django.conf import settings from django.core.exceptions import ObjectDoesNotExist, ImproperlyConfigured from django.db import connection from django.db.models.loading import get_apps, get_app, get_models, get_model, register_models from django.db.models.query import Q from django.db.models.expressions import F fro...
bsd-3-clause
Freeseer/freeseer
src/freeseer/framework/config/exceptions.py
1
1601
#!/usr/bin/env python # -*- coding: utf-8 -*- # freeseer - vga/presentation capture software # # Copyright (C) 2011, 2013 Free and Open Source Software Learning Centre # http://fosslc.org # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public Licens...
gpl-3.0
Nesiehr/osf.io
scripts/migration/migrate_primary_institutions.py
21
1725
import sys import logging from modularodm import Q from framework.transactions.context import TokuTransaction from scripts import utils from website.app import init_app from website.models import Node, NodeLog logger = logging.getLogger(__name__) logging.basicConfig() PRIMARY_INSTITUTION_CHANGED = 'primary_institu...
apache-2.0
ShineFan/odoo
addons/crm/wizard/__init__.py
377
1169
# -*- 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
jorik041/pyspider
tests/data_handler.py
2
1175
#!/usr/bin/env python # -*- encoding: utf-8 -*- # vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8: # Author: Binux<i@binux.me> # http://binux.me # Created on 2014-02-22 14:02:21 from libs.base_handler import BaseHandler, catch_status_code_error, every class TestHandler(BaseHandler): def hello(self): ...
apache-2.0
davidzchen/tensorflow
tensorflow/python/ops/ragged/ragged_placeholder_op_test.py
14
3545
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
HBNLdev/DataStore
db/sas_tools.py
1
2566
''' tools for working with .sas7bdat files ''' import os from collections import OrderedDict import pandas as pd from sas7bdat import SAS7BDAT from .knowledge.questionnaires import map_ph4, map_ph4_ssaga map_subject = {'core': {'file_pfixes': []}} parent_dir = '/processed_data/zork/zork-phase4-69/sessi...
gpl-3.0
CristinaCristescu/root
tutorials/pyroot/DynamicSlice.py
7
3847
## \file ## \ingroup tutorial_pyroot ## Example of function called when a mouse event occurs in a pad. ## When moving the mouse in the canvas, a second canvas shows the ## projection along X of the bin corresponding to the Y position ## of the mouse. The resulting histogram is fitted with a gaussian. ## A "dynamic" lin...
lgpl-2.1
tenable/Tenable.io-SDK-for-Python
tenable_io/api/target_groups.py
2
2571
from tenable_io.api.base import BaseApi, BaseRequest from tenable_io.api.models import TargetGroup, TargetGroupList class TargetGroupsApi(BaseApi): def create(self, target_group_create): """Create a new target group. :param target_group_create: An instance of :class:`TargetGroupCreateRequest`. ...
mit
qrkourier/ansible
lib/ansible/modules/storage/netapp/na_cdot_user_role.py
72
6983
#!/usr/bin/python # (c) 2017, NetApp, 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 __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
gpl-3.0
asadziach/tensorflow
tensorflow/python/ops/string_ops.py
63
5194
# 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
vasiliykochergin/euca2ools
euca2ools/commands/bundle/__init__.py
12
1346
# Copyright 2013-2014 Eucalyptus Systems, Inc. # # Redistribution and use of this software 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 ...
bsd-2-clause
JingJunYin/tensorflow
tensorflow/python/kernel_tests/sparse_concat_op_test.py
138
13011
# 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
RichardLuo/rowboat-external-gtest
test/gtest_nc_test.py
57
3600
#!/usr/bin/env python # # Copyright 2007, 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...
bsd-3-clause
superdesk/superdesk-core
tests/io/feed_parsers/dpa_test.py
2
3251
# -*- coding: utf-8; -*- # # This file is part of Superdesk. # # Copyright 2013, 2014 Sourcefabric z.u. and contributors. # # For the full copyright and license information, please see the # AUTHORS and LICENSE files distributed with this source code, or # at https://www.sourcefabric.org/superdesk/license import os ...
agpl-3.0
ahmedhamdy90/CV_Action_Recognition_2015
code/libsvm-3.12/python/svm.py
14
8702
#!/usr/bin/env python from ctypes import * from ctypes.util import find_library import sys import os # For unix the prefix 'lib' is not considered. if find_library('svm'): libsvm = CDLL(find_library('svm')) elif find_library('libsvm'): libsvm = CDLL(find_library('libsvm')) else: if sys.platform == 'win32': libsv...
mit
saimn/astropy
astropy/visualization/wcsaxes/frame.py
8
10649
# Licensed under a 3-clause BSD style license - see LICENSE.rst import abc from collections import OrderedDict import numpy as np from matplotlib import rcParams from matplotlib.lines import Line2D, Path from matplotlib.patches import PathPatch __all__ = ['RectangularFrame1D', 'Spine', 'BaseFrame', 'RectangularFr...
bsd-3-clause
OpenTreeOfLife/gcmdr
run_synth_studies_mono.py
1
1437
import load_synth_extract from plants import studytreelist as plantslist from metazoa import studytreelist as metalist from fungi import studytreelist as fungilist from microbes import studytreelist as microbelist studytreelist = [] studytreelist.extend(metalist) studytreelist.extend(fungilist) studytreelist.extend(m...
bsd-2-clause
xu-cheng/youtube-dl
youtube_dl/extractor/ivi.py
4
7258
# encoding: utf-8 from __future__ import unicode_literals import re import json from .common import InfoExtractor from ..utils import ( compat_urllib_request, ExtractorError, ) class IviIE(InfoExtractor): IE_DESC = 'ivi.ru' IE_NAME = 'ivi' _VALID_URL = r'https?://(?:www\.)?ivi\.ru/(?:watch/(?:[^...
unlicense
JeremyRubin/bitcoin
share/rpcauth/rpcauth.py
61
1575
#!/usr/bin/env python3 # Copyright (c) 2015-2018 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. from argparse import ArgumentParser from base64 import urlsafe_b64encode from binascii import hexlify fro...
mit
mne-tools/mne-tools.github.io
0.11/_downloads/plot_evoked_topomap.py
18
1498
""" ======================================== Plotting topographic maps of evoked data ======================================== Load evoked data and plot topomaps for selected time points. """ # Authors: Christian Brodbeck <christianbrodbeck@nyu.edu> # Tal Linzen <linzen@nyu.edu> # Denis A. Engeman <...
bsd-3-clause
alexandreleroux/mayavi
mayavi/sources/array_source.py
3
10789
"""A simple source that allows one to view a suitably shaped numpy array as ImageData. This supports both scalar and vector data. """ # Author: Prabhu Ramachandran <prabhu_r@users.sf.net> # Copyright (c) 2005, Enthought, Inc. # License: BSD Style. # Standard library imports. import numpy from vtk.util import vtkConst...
bsd-3-clause
nikolas/mezzanine
mezzanine/accounts/urls.py
5
2374
from __future__ import unicode_literals from django.conf.urls import patterns, url from mezzanine.conf import settings ACCOUNT_URL = getattr(settings, "ACCOUNT_URL", "/accounts/") SIGNUP_URL = getattr(settings, "SIGNUP_URL", "/%s/signup/" % ACCOUNT_URL.strip("/")) SIGNUP_VERIFY_URL = getattr(se...
bsd-2-clause
badloop/SickRage
lib/sqlalchemy/testing/suite/test_select.py
75
2493
from .. import fixtures, config from ..assertions import eq_ from sqlalchemy import util from sqlalchemy import Integer, String, select, func from ..schema import Table, Column class OrderByLabelTest(fixtures.TablesTest): """Test the dialect sends appropriate ORDER BY expressions when labels are used. ...
gpl-3.0
ammarkhann/FinalSeniorCode
lib/python2.7/site-packages/sympy/functions/special/elliptic_integrals.py
75
11975
""" Elliptic integrals. """ from __future__ import print_function, division from sympy.core import S, pi, I from sympy.core.function import Function, ArgumentIndexError from sympy.functions.elementary.hyperbolic import atanh from sympy.functions.elementary.trigonometric import sin, tan from sympy.functions.elementary...
mit
tiagofrepereira2012/examples.tensorflow
bootstrap-buildout.py
120
7458
############################################################################## # # Copyright (c) 2006 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOF...
gpl-3.0
lxsmnv/spark
examples/src/main/python/mllib/stratified_sampling_example.py
128
1368
# # 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
HonzaKral/django
django/contrib/gis/feeds.py
336
5978
from __future__ import unicode_literals from django.contrib.syndication.views import Feed as BaseFeed from django.utils.feedgenerator import Atom1Feed, Rss201rev2Feed class GeoFeedMixin(object): """ This mixin provides the necessary routines for SyndicationFeed subclasses to produce simple GeoRSS or W3C ...
bsd-3-clause
dfang/odoo
addons/website_links/controller/main.py
61
1768
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import werkzeug from odoo import http from odoo.http import request class WebsiteUrl(http.Controller): @http.route('/website_links/new', type='json', auth='user', methods=['POST']) def create_shorten_url(self,...
agpl-3.0