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
aloeffler/linux308
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/SchedGui.py
12980
5411
# SchedGui.py - Python extension for perf script, basic GUI code for # traces drawing and overview. # # Copyright (C) 2010 by Frederic Weisbecker <fweisbec@gmail.com> # # This software is distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. ...
gpl-2.0
mibanescu/pulp
server/test/unit/server/agent/test_connector.py
15
1197
from unittest import TestCase from mock import patch from pulp.server.agent.connector import get_url, add_connector messaging = { 'url': 'atlantis', 'cacert': '/path/ca', 'clientcert': '/path/cert', 'transport': 'monkey' } conf = { 'messaging': messaging } class Config(object): @staticme...
gpl-2.0
adaptivelogic/django-cms
cms/test_utils/project/placeholderapp/admin.py
5
2712
from cms.admin.placeholderadmin import PlaceholderAdmin from cms.test_utils.project.placeholderapp.models import (Example1, Example2, Example3, Example4, Example5) from django.contrib import admin class MixinAdmin(admin.ModelAdmin): def formfield_for_dbfield(self, db_field, **kwargs): """ Hoo...
bsd-3-clause
idrogeno/FusionOE
lib/python/Components/Renderer/FrontpanelLed.py
51
1163
from Components.Element import Element from os import path # this is not a GUI renderer. class FrontpanelLed(Element): def __init__(self, which=0, patterns=None, boolean=True): if not patterns: patterns = [(20, 0, 0xffffffff), (20, 0x55555555, 0x84fc8c04)] self.which = which self.boolean = boolean self.pattern...
gpl-2.0
uchuugaka/anaconda
anaconda_lib/ioloop.py
5
9224
# -*- coding: utf8 -*- # Copyright (C) 2013 - Oscar Campos <oscar.campos@member.fsf.org> # This program is Free Software see LICENSE file for details """ Minimalist asynchronous network library just to fit Anaconda's needs and replace the horrible asyncore/asynchat Example of usage: import ioloop class TestClient(...
gpl-3.0
guptaankita/python-novaclient
novaclient/v2/contrib/host_evacuate_live.py
2
2475
# Copyright 2014 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
Bysmyyr/chromium-crosswalk
tools/telemetry/third_party/gsutilz/third_party/boto/setup.py
93
4874
#!/usr/bin/env python # Copyright (c) 2006-2010 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2010, Eucalyptus Systems, Inc. # All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in t...
bsd-3-clause
antb/TPT----My-old-mod
src/python/stdlib/io.py
191
3624
"""The io module provides the Python interfaces to stream handling. The builtin open function is defined in this module. At the top of the I/O hierarchy is the abstract base class IOBase. It defines the basic interface to a stream. Note, however, that there is no separation between reading and writing to streams; impl...
gpl-2.0
FranMachio/Plugin.Video.Fran.machio
servers/filebox.py
35
3840
# -*- coding: utf-8 -*- #------------------------------------------------------------ # pelisalacarta - XBMC Plugin # Conector para filebox # http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/ #------------------------------------------------------------ import urlparse,urllib2,urllib,re import os from core impo...
gpl-2.0
shishaochen/TensorFlow-0.8-Win
tensorflow/contrib/distributions/python/kernel_tests/gaussian_test.py
3
4995
# Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
apache-2.0
rrrene/django
tests/gis_tests/test_geoforms.py
292
14830
from unittest import skipUnless from django.contrib.gis import forms from django.contrib.gis.gdal import HAS_GDAL from django.contrib.gis.geos import GEOSGeometry from django.forms import ValidationError from django.test import SimpleTestCase, skipUnlessDBFeature from django.utils import six from django.utils.html imp...
bsd-3-clause
hugovk/pylast
tests/test_librefm.py
1
1213
#!/usr/bin/env python """ Integration (not unit) tests for pylast.py """ import unittest from flaky import flaky import pylast from .test_pylast import PyLastTestCase, load_secrets @flaky(max_runs=3, min_passes=1) class TestPyLastWithLibreFm(PyLastTestCase): """Own class for Libre.fm because we don't need the ...
apache-2.0
darith27/wagtail
wagtail/wagtailadmin/utils.py
11
4020
from django.template.loader import render_to_string from django.core.mail import send_mail as django_send_mail from django.conf import settings from django.contrib.auth import get_user_model from django.db.models import Q from modelcluster.fields import ParentalKey from wagtail.wagtailcore.models import Page, PageRev...
bsd-3-clause
Cindicator/CindicatorArbitrageBot
notify_users.py
1
2662
""" Copyright 2017 Evgeniy Koltsov, Sergey Zhirnov. This file is part of CindicatorArbitrageBot. CindicatorArbitrageBot 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 you...
gpl-3.0
back-to/streamlink
src/streamlink/plugins/zengatv.py
5
1456
import re from streamlink.plugin import Plugin from streamlink.plugin.api import useragents from streamlink.stream import HLSStream class ZengaTV(Plugin): """Streamlink Plugin for livestreams on zengatv.com""" _url_re = re.compile(r"https?://(www\.)?zengatv\.com/\w+") _id_re = re.compile(r"""id=(?P<q>["...
bsd-2-clause
adsworth/ldp3
ldp/trip/views.py
1
6387
from datetime import datetime, date, time from django.conf import settings from django.core.exceptions import PermissionDenied from django.contrib.auth import get_user_model from django.contrib.auth.decorators import login_required from django.shortcuts import get_object_or_404 from django.utils.decorators import meth...
mit
drexly/openhgsenti
lib/django/contrib/gis/db/backends/mysql/operations.py
328
2746
from django.contrib.gis.db.backends.base.adapter import WKTAdapter from django.contrib.gis.db.backends.base.operations import \ BaseSpatialOperations from django.contrib.gis.db.backends.utils import SpatialOperator from django.contrib.gis.db.models import aggregates from django.db.backends.mysql.operations import D...
apache-2.0
sbellem/django
tests/model_inheritance_regress/models.py
243
5863
from __future__ import unicode_literals import datetime from django.db import models from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class Place(models.Model): name = models.CharField(max_length=50) address = models.CharField(max_length=80) class Meta: ...
bsd-3-clause
wpoa/wiki-imports
lib/python2.7/site-packages/pip/commands/zip.py
393
14821
import sys import re import fnmatch import os import shutil import zipfile from pip.util import display_path, backup_dir, rmtree from pip.log import logger from pip.exceptions import InstallationError from pip.basecommand import Command class ZipCommand(Command): """Zip individual packages.""" name = 'zip' ...
gpl-3.0
XiaominZhang/Impala
tests/metadata/test_recover_partitions.py
13
15294
# Copyright (c) 2015 Cloudera, Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
apache-2.0
trentinfrederick/name-panel
addon/function/preferences/options.py
3
12582
# imports from . import generate from ...defaults import defaults # main def main(context): # panel panel(context) # properties properties(context) # shared shared(context) # auto auto(context) # batch batch(context) # copy copy(context) # generate genera...
gpl-3.0
hjanime/VisTrails
contrib/TetGenBridge/__init__.py
6
3057
############################################################################ ## ## Copyright (C) 2006-2007 University of Utah. All rights reserved. ## ## This file is part of VisTrails. ## ## This file may be used under the terms of the GNU General Public ## License version 2.0 as published by the Free Software Foundat...
bsd-3-clause
oldmantaiter/disco
tests/test_pipe.py
11
1829
from disco.test import TestCase, TestPipe from disco.compat import bytes_to_str from disco.worker.pipeline.worker import Stage def reduce_init(interface, params): return [] def reduce_done(interface, state): out = interface.output(0) for k, v in sorted(state): out.add(k, v) def map(interface, sta...
bsd-3-clause
marckuz/django
tests/staticfiles_tests/test_views.py
279
1312
from __future__ import unicode_literals import posixpath from django.conf import settings from django.test import override_settings from .cases import StaticFilesTestCase, TestDefaults @override_settings(ROOT_URLCONF='staticfiles_tests.urls.default') class TestServeStatic(StaticFilesTestCase): """ Test sta...
bsd-3-clause
int19h/PTVS
Python/Product/Miniconda/Miniconda3-x64/Lib/site-packages/cryptography/hazmat/primitives/asymmetric/x448.py
13
2249
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function import abc import six from cryptography.exceptions import UnsupportedAl...
apache-2.0
bhgv/bCNC
Pendant.py
1
6650
# -*- coding: ascii -*- # $Id$ # # Author: vvlachoudis@gmail.com # Date: 24-Aug-2014 __author__ = "Vasilis Vlachoudis" __email__ = "Vasilis.Vlachoudis@cern.ch" import os import re import sys #import cgi import json import urllib import threading from CNC import CNC try: import urlparse except ImportError: import...
gpl-2.0
lucasmoura/personfinder
tools/babel/core.py
54
26152
# -*- coding: utf-8 -*- # # Copyright (C) 2007 Edgewall Software # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://babel.edgewall.org/wiki/License. # # This software consists of v...
apache-2.0
quarckster/cfme_tests
cfme/tests/infrastructure/test_vm_rest.py
2
2531
# -*- coding: utf-8 -*- import fauxfactory import pytest from cfme import test_requirements from cfme.rest.gen_data import a_provider as _a_provider from cfme.rest.gen_data import vm as _vm from cfme.utils import error from cfme.utils.rest import assert_response, delete_resources_from_collection from cfme.utils.wait i...
gpl-2.0
openpolis/politikos
project/politikos/views.py
1
2982
from django.conf import settings from django.http import HttpResponseRedirect from django.views.generic import TemplateView from django.contrib import messages from geopy.geocoders import Nominatim from pci import Mapit, Popit import tortilla class RepresentativesSearchView(TemplateView): template_name = 'explore...
bsd-3-clause
dbmi-pitt/DIKB-Micropublication
scripts/mp-scripts/Bio/dbdefs/pdb.py
1
1473
# Copyright 2002 by Jeffrey Chang. All rights reserved. # This code is part of the Biopython distribution and governed by its # license. Please see the LICENSE file that should have been included # as part of this package. from Bio.config.DBRegistry import CGIDB, DBGroup from _support import * from Martel import * ...
apache-2.0
cstan11/Sick-Beard
lib/chardet/langgreekmodel.py
2763
12628
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights R...
gpl-3.0
appurify/appurify-python
tests/test_client.py
2
31230
""" Copyright 2013 Appurify, Inc All rights reserved Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing per...
apache-2.0
mdesco/dipy
dipy/core/sphere.py
6
19979
from __future__ import division, print_function, absolute_import __all__ = ['Sphere', 'HemiSphere', 'faces_from_sphere_vertices', 'unique_edges'] import numpy as np import warnings from ..utils.six.moves import xrange from dipy.core.geometry import cart2sphere, sphere2cart, vector_norm from dipy.core.onetime import...
bsd-3-clause
RanadeepPolavarapu/kuma
vendor/packages/nose/plugins/skip.py
80
2142
""" This plugin installs a SKIP error class for the SkipTest exception. When SkipTest is raised, the exception will be logged in the skipped attribute of the result, 'S' or 'SKIP' (verbose) will be output, and the exception will not be counted as an error or failure. This plugin is enabled by default but may be disable...
mpl-2.0
arizona-phonological-imaging-lab/Autotrace
matlab-version/fixImages.py
3
2423
import os, sys, subprocess import Image import pygtk pygtk.require('2.0') import gtk, gobject import gtk.glade class ImageFixer: def __init__(self, filenames): self.gladefile = "LinguaViewer.glade" self.wTree = gtk.glade.XML(self.gladefile, "resize") self.window = self.wTree.get_widget("res...
mit
pacoqueen/bbinn
formularios/transferencias.py
1
25006
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### # Copyright (C) 2005-2008 Francisco José Rodríguez Bogado, # # Diego Muñoz Escalante. # # (pacoqueen@users.sourceforge.ne...
gpl-2.0
dchouzer/GamifyLyfe
mysite/settings.py
2
4217
""" Django settings for mysite project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) imp...
apache-2.0
gusDuarte/software-center-5.2
utils/piston-helpers/piston_generic_helper.py
4
8562
#!/usr/bin/python # Copyright (C) 2011 Canonical # # Authors: # Michael Vogt # # 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 3. # # This program is distributed in the hope that it wil...
lgpl-3.0
NexusIS/tempest
tempest/common/credentials.py
25
3882
# Copyright (c) 2014 Hewlett-Packard Development Company, L.P. # 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 requi...
apache-2.0
nagyistoce/edx-platform
cms/djangoapps/contentstore/views/component.py
57
17109
from __future__ import absolute_import import json import logging from django.http import HttpResponseBadRequest, Http404 from django.contrib.auth.decorators import login_required from django.views.decorators.http import require_GET from django.core.exceptions import PermissionDenied from django.conf import settings ...
agpl-3.0
koyuawsmbrtn/eclock
windows/Python27/Lib/logging/__init__.py
9
60284
# Copyright 2001-2012 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...
gpl-2.0
Eseoghene/bite-project
deps/gdata-python-client/samples/apps/marketplace_sample/gdata/service.py
78
69609
#!/usr/bin/python # # Copyright (C) 2006,2008 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...
apache-2.0
arnondora/wordpress-paper-theme
PaperTheme/node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/generator/cmake.py
1355
44604
# Copyright (c) 2013 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. """cmake output module This module is under development and should be considered experimental. This module produces cmake (2.8.8+) input as its output. One CMake...
mit
google/joint_vae
datasets/mnist_attributes/perturb_images.py
1
3457
# # Copyright 2017 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
apache-2.0
heracek/django-nonrel
tests/regressiontests/admin_validation/models.py
43
1108
""" Tests of ModelAdmin validation logic. """ from django.db import models class Album(models.Model): title = models.CharField(max_length=150) class Song(models.Model): title = models.CharField(max_length=150) album = models.ForeignKey(Album) original_release = models.DateField(editable=False) ...
bsd-3-clause
Midnighter/pymetabolism
pymetabolism/metabolism/nullmodels.py
1
9566
#!/usr/bin/env python # -*- coding: utf-8 -*- """ ===================== Metabolic Null Models ===================== :Authors: Moritz Emanuel Beber :Date: 2011-07-01 :Copyright: Copyright(c) 2011 Jacobs University of Bremen. All rights reserved. :File: nullmodels.py """ import logging import itertoo...
bsd-3-clause
lucychambers/pepperrage
.bundle/ruby/2.0.0/gems/pygments.rb-0.6.0/vendor/pygments-main/external/moin-parser.py
42
3600
# -*- coding: utf-8 -*- """ The Pygments MoinMoin Parser ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This is a MoinMoin parser plugin that renders source code to HTML via Pygments; you need Pygments 0.7 or newer for this parser to work. To use it, set the options below to match your setup and put this file in ...
mit
SiCKRAGETV/SickRage
sickrage/core/databases/__init__.py
2
16768
# Author: echel0n <echel0n@sickrage.ca> # URL: https://sickrage.ca # # This file is part of SickRage. # # SickRage 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...
gpl-3.0
mbayon/TFG-MachineLearning
venv/lib/python3.6/site-packages/sklearn/neighbors/lof.py
3
12184
# Authors: Nicolas Goix <nicolas.goix@telecom-paristech.fr> # Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # License: BSD 3 clause import numpy as np from warnings import warn from scipy.stats import scoreatpercentile from .base import NeighborsBase from .base import KNeighborsMixin from .bas...
mit
edowson/director
src/python/ddapp/transformUtils.py
1
5794
import vtkAll as vtk #from ddapp import botpy import math import numpy as np #import drc as lcmdrc def getTransformFromNumpy(mat): ''' Given a numpy 4x4 array, return a vtkTransform. ''' m = vtk.vtkMatrix4x4() for r in xrange(4): for c in xrange(4): m.SetElement(r, c, mat[r][c]...
bsd-3-clause
fnordjes/mimic_hue
hue.py
1
4037
def todict(obj, classkey=None): ''' Helper function to recursively transform custom classes to python dictionaries. Taken from here: http://stackoverflow.com/questions/1036409/recursively-convert-python-object-graph-to-dictionary ''' if isinstance(obj, dict): for k in obj.keys(): ...
gpl-2.0
Bachmann1234/pytest
doc/en/example/nonpython/conftest.py
202
1337
# content of conftest.py import pytest def pytest_collect_file(parent, path): if path.ext == ".yml" and path.basename.startswith("test"): return YamlFile(path, parent) class YamlFile(pytest.File): def collect(self): import yaml # we need a yaml parser, e.g. PyYAML raw = yaml.safe_load...
mit
si3792/icough
server/project/icough/migrations/0001_initial.py
1
1210
# -*- coding: utf-8 -*- # Generated by Django 1.10.3 on 2016-11-25 15:17 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migratio...
gpl-3.0
firzhugh/photography-feeds
node_modules/grunt-jasmine-runner/node_modules/grunt/node_modules/gzip-js/test/runner.py
182
1600
#!/usr/bin/env python import os import sys import shutil from colorama import Fore import argparse import zipTest import unzipTest parser = argparse.ArgumentParser(description='Process command-line arguments') parser.add_argument('--file', '-f', metavar='path/to/file', type=str, nargs='?', help='Path to file to use f...
mit
birdland/dlkit-doc
dlkit/proxy/rules.py
1
10099
from ..osid import rules as osid_rules class Proxy(osid_rules.OsidResult): """A ``Proxy`` is used to transfer external information from an application server into an OSID Provider.""" def has_authentication(self): """Tests if an authentication is available. :return: ``true`` if an ``Authent...
mit
cing/ChannelAnalysis
ChannelAnalysis/PoreAnalysis/Histograms.py
1
6160
#!/usr/bin/python ############################################################################### # # Prepares histograms for individual rings of channel atoms based on a user- # -defined column of the channel atom datafiles. # # Example: For 14-column data with this type (described elsewhere): # # 1 7.0 0.413 0.373 0....
mit
rjschwei/azure-sdk-for-python
azure-mgmt-commerce/azure/mgmt/commerce/models/__init__.py
1
1427
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
dongjoon-hyun/tensorflow
tensorflow/python/autograph/pyct/ast_util.py
9
9284
# 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
crazyAxe/tp-libvirt
provider/libvirt_version.py
7
1753
""" Shared code for tests that need to get the libvirt version """ import re import logging from virttest import virsh LIBVIRT_LIB_VERSION = 0 def version_compare(major, minor, update): """ Determine/use the current libvirt library version on the system and compare input major, minor, and update values...
gpl-2.0
BackupGGCode/python-for-android
python3-alpha/python3-src/Lib/test/test_sunau.py
66
2139
from test.support import run_unittest, TESTFN import unittest import os import sunau nchannels = 2 sampwidth = 2 framerate = 8000 nframes = 100 class SunAUTest(unittest.TestCase): def setUp(self): self.f = None def tearDown(self): if self.f is not None: self.f.close() tr...
apache-2.0
vponomaryov/manila
manila/exception.py
1
25195
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # 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 ...
apache-2.0
nhicher/ansible
lib/ansible/utils/module_docs_fragments/k8s_name_options.py
80
2450
# # Copyright 2018 Red Hat | Ansible # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # ...
gpl-3.0
lshain-android-source/external-chromium_org
remoting/tools/verify_resources.py
23
5013
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Verifies that GRD resource files define all the strings used by a given set of source files. For file formats where it is not po...
bsd-3-clause
aeph6Ee0/youtube-dl
youtube_dl/extractor/iconosquare.py
110
2981
from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( int_or_none, get_element_by_id, remove_end, ) class IconosquareIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?(?:iconosquare\.com|statigr\.am)/p/(?P<id>[^/]+)' _TEST = { 'url': 'http://st...
unlicense
anirudhvenkats/clowdflows
workflows/migrations/0033_auto__add_field_input_order__add_field_output_order.py
6
16613
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Input.order' db.add_column('workflows_input', 'order', sel...
gpl-3.0
thuswa/subdms
subdms/frontend.py
1
17223
#!/usr/bin/env python # -*- coding: utf-8 -*- # $Id$ # Last modified Wed Jul 7 20:47:07 2010 on stalker # update count: 1192 # # subdms - A document management system based on subversion. # Copyright (C) 2009 Albert Thuswaldner # # This program is free software: you can redistribute it and/or modify # it under the t...
gpl-3.0
mhamed/wordtosay
sites/all/libraries/fckeditor/editor/filemanager/connectors/py/config.py
3
7087
#!/usr/bin/env python """ * FCKeditor - The text editor for Internet - http://www.fckeditor.net * Copyright (C) 2003-2010 Frederico Caldeira Knabben * * == BEGIN LICENSE == * * Licensed under the terms of any of the following licenses at your * choice: * * - GNU General Public License Version 2 or later (the ...
gpl-2.0
adrian-ionescu/apache-spark
examples/src/main/python/mllib/multi_label_metrics_example.py
158
2277
# # 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
steigr/redisrpc
python/examples/client.py
2
1175
#!/usr/bin/env python import argparse import logging import traceback import sys import redis # Allow this script to run without installing redisrpc. sys.path.append('..') import redisrpc import calc # Direct all RedisPRC logging messages to stderr. logging.basicConfig(stream=sys.stderr, level=logging.DEBUG) par...
gpl-3.0
sql-machine-learning/sqlflow
python/runtime/dbapi/pyalisa/config.py
1
4854
# Copyright 2020 The SQLFlow Authors. All rights reserved. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
apache-2.0
mbareta/edx-platform-ft
cms/djangoapps/contentstore/features/upload.py
60
7456
# pylint: disable=missing-docstring # pylint: disable=redefined-outer-name from lettuce import world, step from lettuce.django import django_url from django.conf import settings import requests import string import random import os from django.contrib.auth.models import User from student.models import CourseEnrollment...
agpl-3.0
vrenaville/ngo-addons-backport
addons/sale_order_dates/__openerp__.py
69
1812
# -*- 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
jmanuel1/GitSavvy
core/commands/custom.py
3
1592
import sublime import threading from sublime_plugin import WindowCommand from ..git_command import GitCommand from ...common import util ALL_REMOTES = "All remotes." class CustomCommandThread(threading.Thread): def __init__(self, func, *args, **kwargs): super(CustomCommandThread, self).__init__(**kwarg...
mit
orbitfp7/nova
nova/db/sqlalchemy/migrate_repo/versions/275_add_keypair_type.py
8
1932
# Copyright (c) 2015 Cloudbase Solutions SRL # 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 # # Unles...
apache-2.0
spthaolt/curtsies
curtsies/escseqparse.py
1
3273
r""" Parses ascii escape sequences into marked up strings >>> r = peel_off_esc_code('Amore') >>> r == ('', {'csi': '\x1b', 'command': 'A', 'seq': '\x1bA'}, 'more') True >>> r = peel_off_esc_code('stuff') >>> r == ('', {'csi': '\x1b[', 'seq': '\x1b[2A', 'intermed': '', 'private': '', 'command': 'A', 'numbers': [2]...
mit
ngoix/OCRF
examples/cluster/plot_dict_face_patches.py
337
2747
""" Online learning of a dictionary of parts of faces ================================================== This example uses a large dataset of faces to learn a set of 20 x 20 images patches that constitute faces. From the programming standpoint, it is interesting because it shows how to use the online API of the sciki...
bsd-3-clause
LiaoPan/Probabilistic-Programming-and-Bayesian-Methods-for-Hackers
Chapter5_LossFunctions/DarkWorldsMetric.py
92
20375
""" DarkWorldsMetricMountianOsteric.py Custom evaluation metric for the 'Observing Dark Worlds' competition. [Description of metric, or reference to documentation.] Update: Made for the training set only so users can check there results from the training c @Author: David Harvey Created: 22 August 2012 """ import nu...
mit
johnuseast/hyde
templates/simple/settings.py
40
3451
import os here = lambda *x: os.path.join(os.path.abspath(os.path.dirname(__file__)), *x) #Directories LAYOUT_DIR = here('layout') CONTENT_DIR = here('content') MEDIA_DIR = here('media') DEPLOY_DIR = here('deploy') TMP_DIR = here('deploy_tmp') BACKUPS_DIR = here('backups') BACKUP = False SITE_ROOT = "/" SITE_WWW_URL ...
mit
brandonPurvis/osf.io
website/addons/badges/tests/test_views.py
33
14279
import mock import random import string from nose.tools import * import website.app from webtest_plus import TestApp from website.util import api_url_for, web_url_for from website.addons.base.testing import AddonTestCase from tests.factories import AuthUserFactory from utils import create_mock_badger, create_badge_di...
apache-2.0
tbeadle/django
django/db/migrations/serializer.py
49
14738
from __future__ import unicode_literals import collections import datetime import decimal import functools import math import types from importlib import import_module from django.db import models from django.db.migrations.operations.base import Operation from django.db.migrations.utils import COMPILED_REGEX_TYPE, Re...
bsd-3-clause
KaranToor/MA450
google-cloud-sdk/.install/.backup/lib/surface/debug/snapshots/delete.py
6
3109
# Copyright 2016 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
apache-2.0
gcoop-libre/ansible-lookup-plugin-pass
lookup_plugins/pass.py
1
5820
# # This script comes with ABSOLUTELY NO WARRANTY, use at own risk # Copyright (C) 2017 mpv <ariel@gcoop.coop> # # 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, ...
gpl-3.0
suyashphadtare/vestasi-erp-final
erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py
25
8458
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import unittest import frappe import frappe.model import json from frappe.utils import cint import frappe.defaults from erpnext.stock.doctype.purcha...
agpl-3.0
collbb/ThinkStats2
code/first.py
79
4169
"""This file contains code used in "Think Stats", by Allen B. Downey, available from greenteapress.com Copyright 2014 Allen B. Downey License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html """ from __future__ import print_function import math import numpy as np import nsfg import thinkstats2 import thinkplot def...
gpl-3.0
shams169/pythonProject
env/lib/python3.6/site-packages/pip/_vendor/requests/packages/chardet/codingstatemachine.py
2931
2318
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Con...
mit
vitan/hue
desktop/core/ext-py/Django-1.6.10/tests/null_fk/models.py
115
1316
""" Regression tests for proper working of ForeignKey(null=True). """ from django.db import models from django.utils.encoding import python_2_unicode_compatible class SystemDetails(models.Model): details = models.TextField() class SystemInfo(models.Model): system_details = models.ForeignKey(SystemDetails) ...
apache-2.0
abloomston/sympy
sympy/polys/tests/test_polyoptions.py
59
11994
"""Tests for options manager for :class:`Poly` and public API functions. """ from sympy.polys.polyoptions import ( Options, Expand, Gens, Wrt, Sort, Order, Field, Greedy, Domain, Split, Gaussian, Extension, Modulus, Symmetric, Strict, Auto, Frac, Formal, Polys, Include, All, Gen, Symbols, Method) from sym...
bsd-3-clause
4eek/edx-platform
common/djangoapps/student/migrations/0002_text_to_varchar_and_indexes.py
188
9581
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Changing field 'UserProfile.name' db.alter_column('auth_userprofile', 'name', self.gf('django.db.models.fields....
agpl-3.0
Kamik423/uni_plan
plan/plan/lib64/python3.4/site-packages/setuptools/dist.py
4
39660
__all__ = ['Distribution'] import re import os import warnings import numbers import distutils.log import distutils.core import distutils.cmd import distutils.dist import itertools from collections import defaultdict from distutils.errors import ( DistutilsOptionError, DistutilsPlatformError, DistutilsSetupError, ...
apache-2.0
40223144/w16b_test
static/Brython3.1.3-20150514-095342/Lib/_markupbase.py
891
14598
"""Shared support for scanning document type declarations in HTML and XHTML. This module is used as a foundation for the html.parser module. It has no documented public API and should not be used directly. """ import re _declname_match = re.compile(r'[a-zA-Z][-_.a-zA-Z0-9]*\s*').match _declstringlit_match = re.com...
agpl-3.0
Stadslab/SpiderBotMarlin
Marlin/create_speed_lookuptable.py
333
1382
#!/usr/bin/env python """ Generate the stepper delay lookup table for Marlin firmware. """ import argparse __author__ = "Ben Gamari <bgamari@gmail.com>" __copyright__ = "Copyright 2012, Ben Gamari" __license__ = "GPL" parser = argparse.ArgumentParser(description=__doc__) parser.add_argument('-f', '--cpu-freq', type...
gpl-2.0
weaselkeeper/ansible
lib/ansible/inventory/script.py
19
6511
# (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
aprefontaine/TMScheduler
tests/regressiontests/utils/module_loading.py
10
4553
import os import sys from unittest import TestCase from zipimport import zipimporter from django.utils.importlib import import_module from django.utils.module_loading import module_has_submodule class DefaultLoader(TestCase): def test_loader(self): "Normal module existence can be tested" test_modu...
bsd-3-clause
shadmanj/college-code
BME301-Bioelectricity/hodgkin-huxley-solver-PYTHON/3rd-order-DE-solver.py
1
4453
# Shadman Jubaer #BME 301 #These functions will solve any nth order differential equation using #the 4th Order Runge-Kutta Method of numerically solving differntial #equations import numpy as np import matplotlib.pyplot as plt #Generates interval over which to solve numerically def irange(start, stop, step)...
mit
ricknoelle/todo-craft
palette.py
1
9392
#!/usr/bin/env python3 # # Urwid Palette Test. Showing off highcolor support # Copyright (C) 2004-2009 Ian Ward # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # ...
mit
Lektorium-LLC/edx-platform
common/djangoapps/third_party_auth/settings.py
3
4344
"""Settings for the third-party auth module. The flow for settings registration is: The base settings file contains a boolean, ENABLE_THIRD_PARTY_AUTH, indicating whether this module is enabled. startup.py probes the ENABLE_THIRD_PARTY_AUTH. If true, it: a) loads this module. b) calls apply_settings(), passi...
agpl-3.0
srjoglekar246/sympy
sympy/logic/tests/test_inference.py
2
6293
"""For more tests on satisfiability, see test_dimacs""" from sympy import symbols from sympy.logic.boolalg import Equivalent, Implies from sympy.logic.inference import pl_true, satisfiable, PropKB from sympy.logic.algorithms.dpll import dpll, dpll_satisfiable, \ find_pure_symbol, find_unit_clause, unit_propagate, ...
bsd-3-clause
michaelchu/kaleidoscope
kaleidoscope/options/option_series.py
1
3755
import matplotlib.pyplot as plt import numpy as np import pandas as pd from matplotlib import cm from kaleidoscope.options.iterator.option_chain import OptionChainIterator pd.set_option('display.expand_frame_repr', False) pd.set_option('display.max_rows', None) class OptionSeries(object): """ This class cont...
mit
craig8196/ai
bzagents/craig_dumb_agent.py
1
6429
#!/usr/bin/python -tt # An incredibly simple agent. All we do is find the closest enemy tank, drive # towards it, and shoot. Note that if friendly fire is allowed, you will very # often kill your own tanks with this code. ################################################################# # NOTE TO STUDENTS # This is...
gpl-3.0
xflows/clowdflows
tweepy2/cursor.py
2
4028
# Tweepy # Copyright 2009-2010 Joshua Roesslein # See LICENSE for details. from tweepy2.error import TweepError class Cursor(object): """Pagination helper class""" def __init__(self, method, *args, **kargs): if hasattr(method, 'pagination_mode'): if method.pagination_mode == 'cursor': ...
mit