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
qxsch/QXSConsolas
examples/CopyThat/copyThat/requests/packages/chardet/constants.py
3008
1335
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
gpl-3.0
uclouvain/OSIS-Louvain
base/forms/utils/emptyfield.py
2
1459
############################################################################## # # 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
adrian-ionescu/apache-spark
python/pyspark/streaming/flume.py
8
6479
# # 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
adam111316/SickGear
sickbeard/name_parser/regexes.py
3
17598
# Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/sickbeard/ # # This file is part of SickGear. # # SickGear 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,...
gpl-3.0
gjreda/pelican-plugins
rmd_reader/test_rmd_reader.py
21
5842
''' Created on Jan 25, 2016 @author: Aaron Kitzmiller <aaron_kitzmiller@harvard.edu? ''' import unittest, os, sys import shutil import logging import glob from pelican import Pelican from pelican.settings import read_settings logging.basicConfig(stream=sys.stderr, level=logging.DEBUG) class Test(unittest.TestCase): ...
agpl-3.0
magicrub/MissionPlanner
Lib/site-packages/numpy/fft/tests/test_helper.py
51
1817
#!"C:\Users\hog\Documents\Visual Studio 2010\Projects\ArdupilotMega\ArdupilotMega\bin\Debug\ipy.exe" # Copied from fftpack.helper by Pearu Peterson, October 2005 """ Test functions for fftpack.helper module """ from numpy.testing import * from numpy.fft import fftshift,ifftshift,fftfreq from numpy import pi def rand...
gpl-3.0
gkunter/coquery
coquery/functionlist.py
1
4999
# -*- coding: utf-8 -*- """ functionlist.py is part of Coquery. Copyright (c) 2016-2018 Gero Kunter (gero.kunter@coquery.org) Coquery is released under the terms of the GNU General Public License (v3). For details, see the file LICENSE that you should have received along with Coquery. If not, see <http://www.gnu.org/...
gpl-3.0
whn09/tensorflow
tensorflow/contrib/factorization/python/ops/gmm_ops_test.py
53
7705
# 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
DaveTCode/PlatoonNiNoKuni
house_ai.py
1
3684
import random from campaign import HANDS_IN_CAMPAIGN from ai import GameAI class HouseAI(GameAI): def __init__(self): GameAI.__init__(self, "Implementation of the house AI") def distribute_hands(self, campaign): ''' Replicate the game AI method of allocating out cards to hands. ...
mit
menardorama/ReadyNAS-Add-ons
headphones-1.0.0/files/apps/headphones/headphones/db.py
12
3820
# This file is part of Headphones. # # Headphones 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. # # Headphones is distributed i...
gpl-2.0
bygreencn/DIGITS
plugins/data/imageGradients/digitsDataPluginImageGradients/data.py
3
3492
# Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. from __future__ import absolute_import from digits.utils import subclass, override, constants from digits.extensions.data.interface import DataIngestionInterface from .forms import DatasetForm, InferenceForm import numpy as np import os TEMPLATE = "temp...
bsd-3-clause
denisov-vlad/redash
tests/test_models.py
3
27473
import calendar import datetime from unittest import TestCase import pytz from dateutil.parser import parse as date_parse from tests import BaseTestCase from redash import models, redis_connection from redash.models import db, types from redash.utils import gen_query_hash, utcnow class DashboardTest(BaseTestCase):...
bsd-2-clause
Mozhuowen/brython
www/src/Lib/test/test_asynchat.py
89
9302
# test asynchat from test import support # If this fails, the test will be skipped. thread = support.import_module('_thread') import asyncore, asynchat, socket, time import unittest import sys try: import threading except ImportError: threading = None HOST = support.HOST SERVER_QUIT = b'QUIT\n' if threadin...
bsd-3-clause
tsdmgz/ansible
lib/ansible/modules/system/lvol.py
13
17067
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2013, Jeroen Hoekx <jeroen.hoekx@dsquare.be>, Alexander Bulimov <lazywolf0@gmail.com> # 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__ =...
gpl-3.0
hendawy/drchrono-patient-education
pshare/sharebackend/models.py
1
3848
# std lib imports import datetime import md5 # django imports from django.db import models from django.utils.translation import ugettext_lazy as _ from django.contrib.auth.models import User from django.db.models.signals import post_save from django.conf import settings # third-party app imports # app imports from .t...
mit
bitifirefly/edx-platform
common/djangoapps/track/views/__init__.py
74
6212
import datetime import json import pytz from django.contrib.auth.decorators import login_required from django.http import HttpResponse from django.shortcuts import redirect from django.views.decorators.csrf import ensure_csrf_cookie from edxmako.shortcuts import render_to_response from track import tracker from tr...
agpl-3.0
webdev1001/ansible
v2/ansible/utils/vault.py
8
2127
# (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
chinmaygarde/CoreLib
Test/GoogleTest/test/gtest_test_utils.py
674
10826
#!/usr/bin/env python # # Copyright 2006, 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...
mit
surgebiswas/poker
PokerBots_2017/Johnny/scipy/optimize/_lsq/dogbox.py
40
11699
""" dogleg algorithm with rectangular trust regions for least-squares minimization. The description of the algorithm can be found in [Voglis]_. The algorithm does trust-region iterations, but the shape of trust regions is rectangular as opposed to conventional elliptical. The intersection of a trust region and an init...
mit
GertBurger/pygame_cffi
benchmarks/profiling.py
3
1895
import os import time class StopProfiling(Exception): pass class Profile(object): class NoopTimer(object): def __enter__(self): pass def __exit__(self, *args): pass class Timer(object): def __init__(self, profile, identifier): self.profile = ...
lgpl-2.1
mystique1029/namebench
libnamebench/better_webbrowser.py
175
4191
#!/usr/bin/env python # Copyright 2009 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...
apache-2.0
shinglyu/servo
tests/wpt/web-platform-tests/tools/pywebsocket/src/test/test_endtoend.py
449
26811
#!/usr/bin/env python # # Copyright 2012, 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...
mpl-2.0
dhorelik/django-cms
cms/tests/test_signals.py
23
4283
# -*- coding: utf-8 -*- from __future__ import with_statement from contextlib import contextmanager from django.conf import settings from django.contrib.auth import get_user_model from django.test import TestCase from django.test.utils import override_settings from cms.api import create_page from cms.models import ...
bsd-3-clause
rhyolight/nupic
examples/opf/experiments/anomaly/spatial/2field_few_skewed/description.py
50
15806
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
agpl-3.0
nkgilley/home-assistant
homeassistant/components/lyft/sensor.py
16
8962
"""Support for the Lyft API.""" from datetime import timedelta import logging from lyft_rides.auth import ClientCredentialGrant from lyft_rides.client import LyftRidesClient from lyft_rides.errors import APIError import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.c...
apache-2.0
kenshay/ImageScripter
ProgramData/SystemFiles/Python/Lib/site-packages/OpenGL/GL/ARB/instanced_arrays.py
9
2044
'''OpenGL extension ARB.instanced_arrays This module customises the behaviour of the OpenGL.raw.GL.ARB.instanced_arrays to provide a more Python-friendly API Overview (from the spec) A common use case in GL for some applications is to be able to draw the same object, or groups of similar objects that share ver...
gpl-3.0
lasersonlab/pepsyn
setup.py
1
1298
# Copyright 2016 Uri Laserson # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
apache-2.0
tudorvio/tempest
tempest/api/identity/admin/v2/test_endpoints.py
10
4128
# Copyright 2013 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
xindus40223115/w16b_test
static/Brython3.1.1-20150328-091302/Lib/optparse.py
728
60616
"""A powerful, extensible, and easy-to-use option parser. By Greg Ward <gward@python.net> Originally distributed as Optik. For support, use the optik-users@lists.sourceforge.net mailing list (http://lists.sourceforge.net/lists/listinfo/optik-users). Simple usage example: from optparse import OptionParser pa...
gpl-3.0
elbeardmorez/quodlibet
quodlibet/quodlibet/ext/events/mpdserver/__init__.py
1
6272
# -*- coding: utf-8 -*- # Copyright 2014 Christoph Reiter <reiter.christoph@gmail.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 2 of the License, or # (at your option) an...
gpl-2.0
pierreberthet/local-scripts
dyndopa.py
1
3674
import numpy as np import json import matplotlib #matplotlib.use('Agg') import pylab as pl import pprint as pp import sys # Plot the different figures for the merged spikes and voltages recordings. # This file, as the MergeSpikefiles.py should be one level up than Test/..., the output of a simulation. path = sys.argv...
gpl-2.0
supersven/intellij-community
python/lib/Lib/site-packages/django/contrib/admin/__init__.py
246
1608
# ACTION_CHECKBOX_NAME is unused, but should stay since its import from here # has been referenced in documentation. from django.contrib.admin.helpers import ACTION_CHECKBOX_NAME from django.contrib.admin.options import ModelAdmin, HORIZONTAL, VERTICAL from django.contrib.admin.options import StackedInline, TabularInli...
apache-2.0
stefanvanwouw/puppet-spark
files/spark/python/examples/kmeans.py
10
2247
# # 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...
mit
HeadCow/ARPS
report_spider/report_spider/spiders/THU004.py
3
2439
# -*- coding:utf-8 -*- import sys reload(sys) sys.setdefaultencoding('utf-8') import time import scrapy from Global_function import get_localtime, print_new_number, save_messages now_time = get_localtime(time.strftime("%Y-%m-%d", time.localtime())) # now_time = 20170401 class THU004_Spider(scrapy.Spider): name = '...
mit
darkleons/BE
addons/account_voucher/report/account_voucher_sales_receipt.py
326
5808
############################################################################## # # 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 GNU Affero General Public L...
agpl-3.0
Zanzibar82/streamondemand.test
core/update_servers.py
1
2438
# -*- coding: utf-8 -*- # ------------------------------------------------------------ # pelisalacarta - XBMC Plugin # update_servers.py # http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/ # ------------------------------------------------------------ import os import re from threading import Thread from core imp...
gpl-3.0
ThinkOpen-Solutions/odoo
addons/l10n_ae/__openerp__.py
337
1579
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2014 Tech Receptives (<http://techreceptives.com>). # # This program is free software: you can redistribute it and/or modify # it under the te...
agpl-3.0
vivyly/terralope
terralope/urls.py
11
1024
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.conf import settings from django.conf.urls import patterns, include, url from django.conf.urls.static import static from django.views.generic import TemplateView # Uncomment the next two lines to enable the admin: from django.contrib import a...
bsd-3-clause
WindCanDie/spark
python/pyspark/mllib/tests/test_linalg.py
7
25780
# # 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
nesterione/scikit-learn
benchmarks/bench_plot_fastkmeans.py
294
4676
from __future__ import print_function from collections import defaultdict from time import time import numpy as np from numpy import random as nr from sklearn.cluster.k_means_ import KMeans, MiniBatchKMeans def compute_bench(samples_range, features_range): it = 0 results = defaultdict(lambda: []) chun...
bsd-3-clause
thaim/ansible
lib/ansible/modules/network/f5/bigip_firewall_rule.py
21
43698
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright: (c) 2018, F5 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 __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
mit
mrquim/repository.mrquim
repo/script.module.youtube.dl/lib/youtube_dl/extractor/teletask.py
215
1739
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import unified_strdate class TeleTaskIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?tele-task\.de/archive/video/html5/(?P<id>[0-9]+)' _TEST = { 'url': 'http://www.tele-task.de/archive/video/html5/2...
gpl-2.0
highweb-project/highweb-webcl-html5spec
third_party/WebKit/Source/devtools/scripts/generate_supported_css.py
37
2811
#!/usr/bin/env python # Copyright (c) 2014 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
pozetroninc/micropython
tests/float/float2int_fp30_intbig.py
30
2629
# check cases converting float to int, relying only on single precision float try: import ustruct as struct except: import struct import sys maxsize_bits = 0 maxsize = sys.maxsize while maxsize: maxsize >>= 1 maxsize_bits += 1 # work out configuration values is_64bit = maxsize_bits > 32 # 0 = none, 1...
mit
koltegirish/Arduino
arduino-core/src/processing/app/i18n/python/requests/packages/charade/langhebrewmodel.py
168
11343
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Simon Montagu # Portions created by the Initial Developer are Copyright (C) 2005 # the Initial Developer. All Rights Reserved...
lgpl-2.1
nurav/balrog
auslib/util/comparison.py
2
1171
import operator import re from auslib.util.versions import MozillaVersion operators = { '>=': operator.ge, '>': operator.gt, '<': operator.lt, '<=': operator.le, } def get_op(pattern): # only alphanumeric characters means no operator if re.match('\w+', pattern): return operator.eq, p...
mpl-2.0
ptomasroos/vitess
test/automation_horizontal_resharding.py
8
5585
#!/usr/bin/env python # # Copyright 2015, 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. """End-to-end test for horizontal resharding automation.""" import environment import utils import worker def setUpModule(): worker.setUpM...
bsd-3-clause
lscheinkman/nupic
examples/opf/clients/hotgym/anomaly/one_gym/model_params/rec_center_hourly_model_params.py
12
5565
MODEL_PARAMS = \ { 'aggregationInfo': { 'days': 0, 'fields': [], 'hours': 0, 'microseconds': 0, 'milliseconds': 0, 'minutes': 0, 'months': 0, 'seconds': 0, ...
agpl-3.0
macNtoucs/MIT_Moblie
Modules/Campus Map/Utilities/DownloadTiles.py
2
1834
# This python script will download the map tiles from MIT's Map Server # and name them with a column/row convention tile_extents = [ # [13, [2476,3029], [2479,3030]], # [14, [4953,6058], [4959,6060]], [15, [9911,12118], [9915,12121]], [16, [19822,24237], [19830,24243]], [17, [39645,48475],[39659,48487]], [18, ...
lgpl-2.1
weimingtom/python-for-android
python3-alpha/python3-src/Tools/demo/vector.py
110
1452
#!/usr/bin/env python3 """ A demonstration of classes and their special methods in Python. """ class Vec: """A simple vector class. Instances of the Vec class can be constructed from numbers >>> a = Vec(1, 2, 3) >>> b = Vec(3, 2, 1) added >>> a + b Vec(4, 4, 4) subtracted >>> a...
apache-2.0
sonaht/ansible
lib/ansible/playbook/loop_control.py
66
1328
# (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
tempbottle/rethinkdb
test/interface/shard_balancing.py
25
4831
#!/usr/bin/env python # Copyright 2014 RethinkDB, all rights reserved. """The `interface.shard_balancing` test checks that RethinkDB generates balanced shards in a variety of scenarios.""" from __future__ import print_function import pprint, os, sys, time startTime = time.time() sys.path.append(os.path.abspath(os....
agpl-3.0
dstftw/youtube-dl
youtube_dl/extractor/pornotube.py
64
3154
from __future__ import unicode_literals import json from .common import InfoExtractor from ..utils import int_or_none class PornotubeIE(InfoExtractor): _VALID_URL = r'https?://(?:\w+\.)?pornotube\.com/(?:[^?#]*?)/video/(?P<id>[0-9]+)' _TEST = { 'url': 'http://www.pornotube.com/orientation/straight/v...
unlicense
marcsans/cnn-physics-perception
phy/lib/python2.7/site-packages/sklearn/datasets/olivetti_faces.py
13
4720
"""Modified Olivetti faces dataset. The original database was available from http://www.cl.cam.ac.uk/research/dtg/attarchive/facedatabase.html The version retrieved here comes in MATLAB format from the personal web page of Sam Roweis: http://www.cs.nyu.edu/~roweis/ There are ten different images of each of...
mit
RO-ny9/python-for-android
python3-alpha/python3-src/Lib/test/test_zipimport.py
55
17221
import sys import os import marshal import imp import struct import time import unittest from test import support from test.test_importhooks import ImportHooksBaseTestCase, test_src, test_co # some tests can be ran even without zlib try: import zlib except ImportError: zlib = None from zipfile import ZipFile...
apache-2.0
mmpagani/oq-hazardlib
openquake/hazardlib/gsim/geomatrix_1993.py
4
4554
# The Hazard Library # Copyright (C) 2014, GEM Foundation # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later version. # # T...
agpl-3.0
foresterh/slackbot
slackbot/utils.py
1
2511
#coding: UTF-8 import os import json import logging import tempfile import requests from contextlib import contextmanager from six.moves import _thread, range, queue import six logger = logging.getLogger(__name__) def download_file(url, fpath): logger.debug('starting to fetch %s', url) r = requests.get(url...
mit
abo-abo/edx-platform
common/lib/capa/capa/checker.py
123
5899
#!/usr/bin/env python """ Commandline tool for doing operations on Problems """ from __future__ import unicode_literals import argparse import logging import sys from path import path from cStringIO import StringIO from calc import UndefinedVariable from capa.capa_problem import LoncapaProblem from mako.lookup impor...
agpl-3.0
jblackburne/scikit-learn
benchmarks/bench_random_projections.py
397
8900
""" =========================== Random projection benchmark =========================== Benchmarks for random projections. """ from __future__ import division from __future__ import print_function import gc import sys import optparse from datetime import datetime import collections import numpy as np import scipy.s...
bsd-3-clause
alanjw/GreenOpenERP-Win-X86
python/Lib/site-packages/pythonwin/pywin/idle/AutoIndent.py
4
21162
import sys import string, tokenize import PyParse from pywin import default_scintilla_encoding if sys.version_info < (3,): # in py2k, tokenize() takes a 'token eater' callback, while # generate_tokens is a generator that works with str objects. token_generator = tokenize.generate_tokens else: ...
agpl-3.0
pgermain/pbda
pbda_learn.py
1
4558
#!/usr/bin/env python #-*- coding:utf-8 -*- ''' PAC-BAYESIAN DOMAIN ADAPTATION (aka PBDA) Executable script to launch the learning algorithm @author: Pascal Germain -- http://researchers.lille.inria.fr/pgermain/ ''' import common from pbda import * from dataset import * from kernel import * import sys import pickle i...
bsd-2-clause
patrickwind/My_Blog
venv/lib/python2.7/site-packages/werkzeug/formparser.py
295
21205
# -*- coding: utf-8 -*- """ werkzeug.formparser ~~~~~~~~~~~~~~~~~~~ This module implements the form parsing. It supports url-encoded forms as well as non-nested multipart uploads. :copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details. :license: BSD, see LICENSE for more deta...
gpl-2.0
iut-ibk/DynaMind-UrbanSim
3rdparty/opus/src/urbansim/zone/buildings_SSS_space.py
2
1489
# Opus/UrbanSim urban simulation software. # Copyright (C) 2005-2009 University of Washington # See opus_core/LICENSE from urbansim.gridcell.buildings_SSS_space import buildings_SSS_space as gridcell_buildings_SSS_space class buildings_SSS_space(gridcell_buildings_SSS_space): """Sum of building space of gi...
gpl-2.0
Nikoli/youtube-dl
youtube_dl/extractor/spiegel.py
30
5415
# encoding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import compat_urlparse from .spiegeltv import SpiegeltvIE class SpiegelIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?spiegel\.de/video/[^/]*-(?P<id>[0-9]+)(?:-embed)?(?:\.html)?(?:#.*)?$' ...
unlicense
Lujeni/ansible
lib/ansible/modules/network/f5/bigip_monitor_tcp_half_open.py
38
19942
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright: (c) 2017, F5 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 __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
boneyao/sentry
src/sentry/migrations/0172_auto__del_field_team_owner.py
34
38017
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Deleting field 'Team.owner' db.delete_column(u'sentry_team', 'owner_id'...
bsd-3-clause
B-MOOC/edx-platform
common/djangoapps/util/sandboxing.py
162
1617
import re from django.conf import settings # We'll make assets named this be importable by Python code in the sandbox. PYTHON_LIB_ZIP = "python_lib.zip" def can_execute_unsafe_code(course_id): """ Determine if this course is allowed to run unsafe code. For use from the ModuleStore. Checks the `course_i...
agpl-3.0
necula01/bond
pybond/tutorials/binary_search_tree/bst.py
1
3646
# A tutorial on binary-search-trees, by Laurent Luce <http://www.laurentluce.com/> # Code from: http://www.laurentluce.com/posts/binary-search-tree-library-in-python/ # # We use this code as the system-under-test class Node: """ Tree node: left and right child + data which can be any object """ def __...
bsd-2-clause
Sbalbp/DIRAC
DataManagementSystem/Agent/RequestOperations/RegisterFile.py
2
3590
######################################################################## # File: RegisterOperation.py # Author: Krzysztof.Ciba@NOSPAMgmail.com # Date: 2013/03/19 13:55:14 ######################################################################## """ :mod: RegisterFile ================== .. module: RegisterFile ...
gpl-3.0
google/google-ctf
third_party/edk2/BaseTools/Source/Python/GenFds/Ffs.py
2
2328
## @file # process FFS generation # # Copyright (c) 2007-2018, Intel Corporation. All rights reserved.<BR> # # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License # which accompanies this distribution. The full text of the license m...
apache-2.0
zero-rp/miniblink49
third_party/jinja2/sandbox.py
637
13445
# -*- coding: utf-8 -*- """ jinja2.sandbox ~~~~~~~~~~~~~~ Adds a sandbox layer to Jinja as it was the default behavior in the old Jinja 1 releases. This sandbox is slightly different from Jinja 1 as the default behavior is easier to use. The behavior can be changed by subclassing the environm...
apache-2.0
mgraupe/acq4
acq4/pyqtgraph/graphicsItems/ScatterPlotItem.py
12
37649
from itertools import starmap, repeat try: from itertools import imap except ImportError: imap = map import numpy as np import weakref from ..Qt import QtGui, QtCore, USE_PYSIDE, USE_PYQT5 from ..Point import Point from .. import functions as fn from .GraphicsItem import GraphicsItem from .GraphicsObject import...
mit
velorientc/git_test8
git_remote_helpers/git/git.py
44
24712
#!/usr/bin/env python """Functionality for interacting with Git repositories. This module provides classes for interfacing with a Git repository. """ import os import re import time from binascii import hexlify from cStringIO import StringIO import unittest from git_remote_helpers.util import debug, error, die, sta...
gpl-2.0
KerkhoffTechnologies/django-connectwise
djconnectwise/tests/test_commands.py
1
24129
import io from django.core.management import call_command from django.test import TestCase from djconnectwise import models from . import mocks from . import fixtures from . import fixture_utils from .. import sync def sync_summary(class_name, created_count): return '{} Sync Summary - Created: {}, Updated: 0, ...
mit
yqm/sl4a
python/src/Lib/test/test_hmac.py
58
13069
import hmac import hashlib import unittest import warnings from test import test_support class TestVectorsTestCase(unittest.TestCase): def test_md5_vectors(self): # Test the HMAC module against test vectors from the RFC. def md5test(key, data, digest): h = hmac.HMAC(key, data) ...
apache-2.0
Code-In-Action/python-in-action
flask/todo-api/flask/lib/python3.6/site-packages/setuptools/archive_util.py
95
6592
"""Utilities for extracting common archive formats""" import zipfile import tarfile import os import shutil import posixpath import contextlib from distutils.errors import DistutilsError from pkg_resources import ensure_directory __all__ = [ "unpack_archive", "unpack_zipfile", "unpack_tarfile", "default_filter",...
mit
Samsung/skia
third_party/externals/gyp/test/no-cpp/gyptest-no-cpp.py
7
1393
#!/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. """ Checks that C-only targets aren't linked against libstdc++. """ import TestGyp import re import subprocess import sys # set |match| t...
bsd-3-clause
x684867/nemesis
src/node/tools/closure_linter/closure_linter/fixjsstyle.py
13
1338
#!/usr/bin/env python # # Copyright 2007 The Closure Linter 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 #...
mit
alejob/mdanalysis
testsuite/MDAnalysisTests/topology/test_dlpoly.py
1
3036
# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*- # vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 fileencoding=utf-8 # # MDAnalysis --- http://www.mdanalysis.org # Copyright (c) 2006-2016 The MDAnalysis Development Team and contributors # (see the file AUTHORS for the full list of names) # ...
gpl-2.0
flt/FitFinder
test/lib/jinja2/meta.py
336
4198
# -*- coding: utf-8 -*- """ jinja2.meta ~~~~~~~~~~~ This module implements various functions that exposes information about templates that might be interesting for various kinds of applications. :copyright: (c) 2010 by the Jinja Team, see AUTHORS for more details. :license: BSD, see LICENSE fo...
apache-2.0
V11/volcano
server/sqlmap/lib/parse/banner.py
6
3551
#!/usr/bin/env python """ Copyright (c) 2006-2015 sqlmap developers (http://sqlmap.org/) See the file 'doc/COPYING' for copying permission """ import re from xml.sax.handler import ContentHandler from lib.core.common import Backend from lib.core.common import parseXmlFile from lib.core.common import sanitizeStr fro...
mit
liyu1990/tensorflow
tensorflow/python/ops/parsing_ops.py
3
14601
"""Parsing Ops.""" from tensorflow.python.framework import ops from tensorflow.python.framework import tensor_shape from tensorflow.python.framework import tensor_util from tensorflow.python.ops import array_ops from tensorflow.python.ops import common_shapes from tensorflow.python.ops import constant_op from tensorfl...
apache-2.0
deployed/django
django/db/models/fields/related.py
3
97755
from operator import attrgetter from django.apps import apps from django.core import checks from django.db import connection, connections, router, transaction from django.db.backends import utils from django.db.models import signals, Q from django.db.models.deletion import SET_NULL, SET_DEFAULT, CASCADE from django.db...
bsd-3-clause
b1-systems/kiwi
kiwi/boot/image/dracut.py
1
6648
# Copyright (c) 2015 SUSE Linux GmbH. All rights reserved. # # This file is part of kiwi. # # kiwi 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 la...
gpl-3.0
damdam-s/OpenUpgrade
addons/hw_posbox_homepage/controllers/main.py
99
2009
# -*- coding: utf-8 -*- import logging import os import time from os import listdir import openerp from openerp import http from openerp.http import request from openerp.tools.translate import _ _logger = logging.getLogger(__name__) index_template = """ <!DOCTYPE HTML> <html> <head> <title>Odoo's PosBox<...
agpl-3.0
moto-timo/ironpython3
Src/StdLib/Lib/tkinter/font.py
75
6611
# Tkinter font wrapper # # written by Fredrik Lundh, February 1998 # __version__ = "0.9" import itertools import tkinter # weight/slant NORMAL = "normal" ROMAN = "roman" BOLD = "bold" ITALIC = "italic" def nametofont(name): """Given the name of a tk named font, returns a Font representation. """ ret...
apache-2.0
andyraib/data-storage
python_scripts/env/lib/python3.6/site-packages/numpy/f2py/tests/test_callback.py
145
3040
from __future__ import division, absolute_import, print_function import math import textwrap from numpy import array from numpy.testing import run_module_suite, assert_, assert_equal, dec import util class TestF77Callback(util.F2PyTest): code = """ subroutine t(fun,a) integer a cf2py intent(out) ...
apache-2.0
JohanComparat/pyEmerge
python/remap.py
1
8482
#!/usr/bin/python # # remap.py import sys from math import * verbose = False # Use fast vec3 implementation if Numpy is available import numpy as N class vec3(N.ndarray): """A simple 3D vector class, using Numpy for fast array operations.""" def __new__(cls, *args): a = N.ndarray.__new__(vec3, (3,), float) ...
unlicense
hazelnusse/robot.bicycle
gui/rbgui.py
1
1626
#!/usr/bin/env python3 """ Robot Bicycle GUI. Barebones GUI allows user to run common shell commands with buttons. Oliver Lee (oliverzlee@gmail.com) 5 December 2012 """ import sys from PyQt4 import QtGui, QtCore from rbg_shell import * from rbg_widgets import * from rbg_button_page import ButtonPage from rbg_plo...
bsd-2-clause
kou998/openclas
cpp/script/bom.py
2
1696
#!/usr/bin/env python2.5 """ Strip or append leading byte-order-mark from utf-8 files. """ import sys import os def usage(prog): print >>sys.stderr, 'usage: %s <option>' % prog print >>sys.stderr, '-a, --append : Append UTF-8 BOM as the prefix of all C/C++ files recursivly from current directory' print >>sys....
bsd-2-clause
ryanmockabee/golfr
flask/lib/python3.6/site-packages/sqlalchemy/orm/collections.py
32
52410
# orm/collections.py # Copyright (C) 2005-2017 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 """Support for collections of mapped entities. The collections package supplies ...
mit
jd/hyde
hyde/tests/test_initialize.py
6
3678
# -*- coding: utf-8 -*- """ Use nose `$ pip install nose` `$ nosetests` """ from hyde.engine import Engine from hyde.exceptions import HydeException from hyde.layout import Layout from fswrap import File, Folder from nose.tools import raises, with_setup, nottest TEST_SITE = File(__file__).parent.child_folder('_test...
mit
kg-bot/SupyBot
plugins/IMDb/__init__.py
1
1149
### # Copyright (c) 2012, Dan # All rights reserved. # # ### """ Add a description of the plugin (to be presented to the user inside the wizard) here. This should describe *what* the plugin does. """ import supybot import supybot.world as world # Use this for the version of this plugin. You may wish to put a CVS k...
gpl-3.0
ulope/django
tests/get_or_create/tests.py
19
13380
from __future__ import unicode_literals from datetime import date import traceback import warnings from django.db import IntegrityError, DatabaseError from django.utils.encoding import DjangoUnicodeDecodeError from django.test import TestCase, TransactionTestCase from .models import (DefaultPerson, Person, ManualPri...
bsd-3-clause
rjshade/grpc
src/python/grpcio/grpc/framework/foundation/logging_pool.py
19
3126
# Copyright 2015, 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...
bsd-3-clause
Eksmo/calibre
src/calibre/gui2/convert/xpath_wizard_ui.py
1
4063
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file '/home/gugu/w/calibre/src/calibre/gui2/convert/xpath_wizard.ui' # # Created: Thu Jul 19 23:32:30 2012 # by: PyQt4 UI code generator 4.9.1 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: ...
gpl-3.0
abought/osf.io
api/base/views.py
2
20637
import weakref from django.http import JsonResponse from rest_framework.decorators import api_view from rest_framework.response import Response from rest_framework import generics # from rest_framework.serializers from rest_framework.mixins import ListModelMixin from api.users.serializers import UserSerializer from d...
apache-2.0
UOMx/edx-platform
lms/djangoapps/courseware/migrations/0001_initial.py
46
7819
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models import model_utils.fields import xmodule_django.models import django.utils.timezone from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_depen...
agpl-3.0
domob1812/i0coin
qa/rpc-tests/getblocktemplate_longpoll.py
13
3618
#!/usr/bin/env python2 # Copyright (c) 2014 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 test_framework.test_framework import BitcoinTestFramework from test_framework.util import * def check_a...
mit
MickaelBergem/django-allauth
allauth/socialaccount/providers/coinbase/views.py
60
1110
import requests from allauth.socialaccount.providers.oauth2.views import (OAuth2Adapter, OAuth2LoginView, OAuth2CallbackView) from .provider import CoinbaseProvider class CoinbaseOAuth2Adapter(OAuth2Ada...
mit