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
chrisndodge/edx-platform
openedx/core/djangoapps/credit/api/provider.py
25
16211
""" API for initiating and tracking requests for credit from a provider. """ import datetime import logging import uuid import pytz from django.db import transaction from lms.djangoapps.django_comment_client.utils import JsonResponse from edx_proctoring.api import get_last_exam_completion_date from openedx.core.djan...
agpl-3.0
takis/django
django/contrib/auth/admin.py
28
8624
from django.conf import settings from django.conf.urls import url from django.contrib import admin, messages from django.contrib.admin.options import IS_POPUP_VAR from django.contrib.admin.utils import unquote from django.contrib.auth import update_session_auth_hash from django.contrib.auth.forms import ( AdminPass...
bsd-3-clause
monkeysecurity/security_monkey
manage.py
1
4070
# Copyright 2014 Netflix, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
apache-2.0
tahmid-tanzim/youtube-dl
youtube_dl/extractor/ro220.py
176
1451
from __future__ import unicode_literals from .common import InfoExtractor from ..compat import compat_urllib_parse_unquote class Ro220IE(InfoExtractor): IE_NAME = '220.ro' _VALID_URL = r'(?x)(?:https?://)?(?:www\.)?220\.ro/(?P<category>[^/]+)/(?P<shorttitle>[^/]+)/(?P<id>[^/]+)' _TEST = { 'url': ...
unlicense
wkritzinger/asuswrt-merlin
release/src/router/samba-3.5.8/source4/scripting/python/samba/tests/dcerpc/unix.py
24
1336
#!/usr/bin/python # Unix SMB/CIFS implementation. # Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2008 # # 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, o...
gpl-2.0
yatish27/mase
python101/code/anagram_db.py
14
1134
"""This module contains code from Think Python by Allen B. Downey http://thinkpython.com Copyright 2012 Allen B. Downey License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html """ import shelve import sys from anagram_sets import * def store_anagrams(filename, ad): """Stores the anagrams in ad in a shelf. ...
unlicense
robin900/gspread-dataframe
setup.py
1
1661
try: from setuptools import setup except ImportError: from distutils.core import setup import os.path import sys PY3 = sys.version_info >= (3, 0) with open(os.path.join(os.path.dirname(__file__), 'VERSION'), 'rb') as f: VERSION = f.read() if PY3: VERSION = VERSION.decode('utf8') VERSION =...
mit
ehenneken/adsws
adsws/modules/oauth2server/testsuite/test_provider.py
4
21833
# -*- coding: utf-8 -*- from __future__ import absolute_import, print_function import os import logging from unittest import skip from flask import url_for from adsws.testsuite import FlaskAppTestCase, make_test_suite, \ run_test_suite from adsws.core import db from mock import MagicMock from flask_oauthlib.cl...
gpl-2.0
todaychi/hue
desktop/core/ext-py/django-extensions-1.5.0/django_extensions/management/commands/set_fake_passwords.py
35
1846
""" set_fake_passwords.py Reset all user passwords to a common value. Useful for testing in a development environment. As such, this command is only available when setting.DEBUG is True. """ from optparse import make_option from django.conf import settings from django.core.management.base import NoArgsCo...
apache-2.0
Glasgow2015/team-10
env/lib/python2.7/site-packages/treebeard/tests/conftest.py
4
2640
import os import sys import time os.environ['DJANGO_SETTINGS_MODULE'] = 'treebeard.tests.settings' import django from django.conf import settings from django.test.utils import (setup_test_environment, teardown_test_environment) from django.test.client import Client from django.core.man...
apache-2.0
prabhu-k/three.js
utils/converters/obj/convert_obj_three.py
160
48659
"""Convert Wavefront OBJ / MTL files into Three.js (JSON model version, to be used with ascii / binary loader) ------------------------- How to use this converter ------------------------- python convert_obj_three.py -i infile.obj -o outfile.js [-m "morphfiles*.obj"] [-c "morphcolors*.obj"] [-a center|centerxz|top|bo...
mit
2014c2g19/2014c2g19
exts/wsgi/static/Brython2.1.0-20140419-113919/Lib/_threading_local.py
923
7410
"""Thread-local objects. (Note that this module provides a Python version of the threading.local class. Depending on the version of Python you're using, there may be a faster one available. You should always import the `local` class from `threading`.) Thread-local objects support the management of thread-local d...
gpl-2.0
mudithkr/zamboni
mkt/api/authentication.py
19
1218
from django.contrib.auth.models import AnonymousUser import commonware.log from rest_framework.authentication import BaseAuthentication log = commonware.log.getLogger('z.api') class OAuthError(RuntimeError): def __init__(self, message='OAuth error occured.'): self.message = message class RestOAuthAut...
bsd-3-clause
dscorbett/pygments
pygments/lexers/apl.py
1
3238
# -*- coding: utf-8 -*- """ pygments.lexers.apl ~~~~~~~~~~~~~~~~~~~ Lexers for APL. :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.lexer import RegexLexer from pygments.token import Text, Comment, Operator, Keyword, Nam...
bsd-2-clause
mglukhikh/intellij-community
python/helpers/py2only/docutils/transforms/misc.py
183
4882
# $Id: misc.py 6314 2010-04-26 10:04:17Z milde $ # Author: David Goodger <goodger@python.org> # Copyright: This module has been placed in the public domain. """ Miscellaneous transforms. """ __docformat__ = 'reStructuredText' from docutils import nodes from docutils.transforms import Transform, TransformError clas...
apache-2.0
postlund/home-assistant
homeassistant/components/ambient_station/sensor.py
2
2630
"""Support for Ambient Weather Station sensors.""" import logging from homeassistant.const import ATTR_NAME from . import ( SENSOR_TYPES, TYPE_SOLARRADIATION, TYPE_SOLARRADIATION_LX, AmbientWeatherEntity, ) from .const import ( ATTR_LAST_DATA, ATTR_MONITORED_CONDITIONS, DATA_CLIENT, DO...
apache-2.0
christydennison/ResumeStripClub
convert.py
1
3312
#!/usr/bin/env python import sys import os import pdf2txt import re REDACTED_TEXT = 'REDACTED' LINK_REGEX = re.compile('(https?:\/\/)?([a-zA-Z0-9]{2,4}\.)?(linkedin.com|lnkd\.in|github.com)\/.+') EMAIL_REGEX = re.compile('([\w\.]+@(?:[\w]+\.)+[a-zA-Z]{2,})') BLACKLIST_FILE = "bad_words.txt" def get_blacklist_words()...
mit
javiergarridomellado/Empresa_django
devcodela/lib/python2.7/site-packages/django/db/backends/__init__.py
52
38612
from django.db.utils import DatabaseError try: from django.utils.six.moves import _thread as thread except ImportError: from django.utils.six.moves import _dummy_thread as thread from contextlib import contextmanager from django.conf import settings from django.db import DEFAULT_DB_ALIAS from django.db.backen...
gpl-2.0
aglitke/vdsm
doc/conf.py
2
6556
# -*- coding: utf-8 -*- # # VDSM documentation build configuration file, created by # sphinx-quickstart on Thu Dec 24 14:07:47 2009. # # This file is execfile()d with the current directory set to its containing dir # # Note that not all possible configuration values are present in this # autogenerated file. # # All con...
gpl-2.0
hsum/sqlalchemy
examples/performance/bulk_updates.py
27
1445
"""This series of tests illustrates different ways to UPDATE a large number of rows in bulk. """ from . import Profiler from sqlalchemy.ext.declarative import declarative_base from sqlalchemy import Column, Integer, String, create_engine, bindparam from sqlalchemy.orm import Session Base = declarative_base() engine...
mit
murali-munna/scikit-learn
sklearn/externals/joblib/_multiprocessing_helpers.py
326
1214
"""Helper module to factorize the conditional multiprocessing import logic We use a distinct module to simplify import statements and avoid introducing circular dependencies (for instance for the assert_spawning name). """ import os import warnings # Obtain possible configuration from the environment, assuming 1 (on...
bsd-3-clause
larrybradley/astropy
astropy/extern/_strptime.py
12
22516
"""Strptime-related classes and functions. CLASSES: LocaleTime -- Discovers and stores locale-specific time information TimeRE -- Creates regexes for pattern matching a string of text containing time information FUNCTIONS: _getlang -- Figure out what language is being used for the locale ...
bsd-3-clause
atsolakid/edx-platform
lms/djangoapps/mobile_api/social_facebook/friends/tests.py
128
14336
# pylint: disable=E1101 """ Tests for friends """ import json import httpretty from django.core.urlresolvers import reverse from xmodule.modulestore.tests.factories import CourseFactory from ..test_utils import SocialFacebookTestCase class TestFriends(SocialFacebookTestCase): """ Tests for /api/mobile/v0.5/fr...
agpl-3.0
agreen757/adriangetsawesome
node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/pygments/styles/autumn.py
364
2144
# -*- coding: utf-8 -*- """ pygments.styles.autumn ~~~~~~~~~~~~~~~~~~~~~~ A colorful style, inspired by the terminal highlighting style. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.style import Style from pygments.to...
mit
zverevalexei/trex-http-proxy
trex_client/external_libs/pyyaml-3.11/python3/yaml/error.py
294
2533
__all__ = ['Mark', 'YAMLError', 'MarkedYAMLError'] class Mark: def __init__(self, name, index, line, column, buffer, pointer): self.name = name self.index = index self.line = line self.column = column self.buffer = buffer self.pointer = pointer def get_snippet...
mit
andreadean5/python-hpOneView
examples/metric_streaming.py
2
2754
# -*- coding: utf-8 -*- ### # (C) Copyright (2012-2016) Hewlett Packard Enterprise Development LP # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limi...
mit
custode/reviewboard
reviewboard/site/decorators.py
5
2318
from django.core.urlresolvers import reverse from django.http import HttpResponseRedirect from django.shortcuts import get_object_or_404, render_to_response from django.template.context import RequestContext from djblets.util.decorators import simple_decorator from reviewboard.site.models import LocalSite @simple_de...
mit
walterst/qiime
qiime/quality_scores_plot.py
6
7014
#!/usr/bin/env python # File created Sept 29, 2010 from __future__ import division __author__ = "William Walters" __copyright__ = "Copyright 2011, The QIIME Project" __credits__ = ["William Walters", "Greg Caporaso"] __license__ = "GPL" __version__ = "1.9.1-dev" __maintainer__ = "William Walters" __email__ = "William....
gpl-2.0
lootr/netzob
netzob/src/netzob/Inference/Vocabulary/FormatOperations/FieldSplitDelimiter.py
2
13859
# -*- coding: utf-8 -*- # +---------------------------------------------------------------------------+ # | 01001110 01100101 01110100 01111010 01101111 01100010 | # | | # | Netzob : Inferring communication prot...
gpl-3.0
k3nnyfr/s2a_fr-nsis
s2a/Python/Lib/test/script_helper.py
82
5791
# Common utility functions used by various script execution tests # e.g. test_cmd_line, test_cmd_line_script and test_runpy import sys import os import re import os.path import tempfile import subprocess import py_compile import contextlib import shutil try: import zipfile except ImportError: # If Python is b...
gpl-3.0
kenxwagner/PythonPlay
Project/webscrap/websc/Lib/site-packages/pip/_internal/self_outdated_check.py
9
8009
# The following comment should be removed at some point in the future. # mypy: disallow-untyped-defs=False from __future__ import absolute_import import datetime import hashlib import json import logging import os.path import sys from pip._vendor import pkg_resources from pip._vendor.packaging import version as pack...
mit
fablabnbg/inkscape-silhouette
silhouette/Strategy.py
1
40922
# (c) 2013 jw@suse.de # # Strategy.py -- cut strategy algorithms for a Graphtec Silhouette Cameo plotter. # # In order to support operation without a cutting mat, a strategic # rearrangement of cuts is helpful. # e.g. # * With a knive, sharp turns are to be avoided. They easily rupture the paper. # * With some pens, ...
gpl-2.0
radicalbit/ambari
ambari-common/src/main/python/resource_management/libraries/functions/list_ambari_managed_repos.py
3
1906
#!/usr/bin/env python """ 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");...
apache-2.0
fujunwei/chromium-crosswalk
build/android/pylib/base/base_test_runner.py
14
5084
# 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. """Base class for running tests on a single device.""" # TODO(jbudorick) Deprecate and remove this class and all subclasses after # any relevant parts h...
bsd-3-clause
smtchahal/cs-cz-map-installer
cs_cz_map_installer/mainwindow.py
1
9909
""" This module contains the MainWindow class responsible for rendering the main window of the application. """ import sys import os import logging from PySide import QtGui from PySide.QtGui import QMessageBox from .dialogs import ErrorDialog from . import mapinstaller LOGGING_FORMAT = ("[%(asctime)s] %(levelname)s...
mit
simonwydooghe/ansible
lib/ansible/modules/network/f5/bigip_file_copy.py
19
21688
#!/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', ...
gpl-3.0
40223227/2015cdbg6w0622-40223227-
static/Brython3.1.1-20150328-091302/Lib/ui/dialog.py
607
4994
from . import widget from browser import html, document class Dialog(widget.DraggableWidget): def __init__(self, id=None): self._div_shell=html.DIV( Class="ui-dialog ui-widget ui-widget-content ui-corner-all ui-front ui-draggable ui-resizable", style={'position': 'absolute', 'height': 'auto',...
gpl-3.0
ddurando/pox.carp
pox/lib/packet/rip.py
47
6250
# Copyright 2012 James McCauley # Copyright 2008 (C) Nicira, 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 ap...
apache-2.0
dxmgame/dxm-cocos
src/oslibs/cocos/cocos-src/tools/bindings-generator/backup/clang-llvm-3.3-pybinding/enumerations.py
307
1077
#===- enumerations.py - Python Enumerations ------------------*- python -*--===# # # The LLVM Compiler Infrastructure # # This file is distributed under the University of Illinois Open Source # License. See LICENSE.TXT for details. # #===--------------------------------------------------------------...
mit
modelrockettier/wget
testenv/conf/expected_files.py
6
2239
from difflib import unified_diff import os import sys from conf import hook from exc.test_failed import TestFailed """ Post-Test Hook: ExpectedFiles This is a Post-Test hook that checks the test directory for the files it contains. A dictionary object is passed to it, which contains a mapping of filenames and contents...
gpl-3.0
tmhm/scikit-learn
examples/datasets/plot_iris_dataset.py
283
1928
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= The Iris Dataset ========================================================= This data sets consists of 3 different types of irises' (Setosa, Versicolour, and Virginica) petal and sepal length, stored in a 150x4 numpy...
bsd-3-clause
indrajitr/ansible
lib/ansible/modules/import_role.py
7
2718
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: 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 DOCUMENTATION = r''' --- author: Ansible Core Team (@ansible) modul...
gpl-3.0
hhbyyh/spark
examples/src/main/python/ml/als_example.py
63
3026
# # 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
eallovon/xivo-provd-plugins
plugins/xivo-cisco-sccp/common/common.py
3
12217
# -*- coding: utf-8 -*- # Copyright (C) 2010-2014 Avencall # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This p...
gpl-3.0
40223250/40223250test
static/Brython3.1.1-20150328-091302/Lib/_collections.py
603
19111
# "High performance data structures # " # copied from pypy repo # # Copied and completed from the sandbox of CPython # (nondist/sandbox/collections/pydeque.py rev 1.1, Raymond Hettinger) # # edited for Brython line 558 : catch ImportError instead of AttributeError import operator #try: # from thread import get_i...
gpl-3.0
FireWRT/OpenWrt-Firefly-Libraries
staging_dir/host/lib/python2.7/ctypes/test/test_funcptr.py
32
3898
import os, unittest from ctypes import * try: WINFUNCTYPE except NameError: # fake to enable this test on Linux WINFUNCTYPE = CFUNCTYPE import _ctypes_test lib = CDLL(_ctypes_test.__file__) class CFuncPtrTestCase(unittest.TestCase): def test_basic(self): X = WINFUNCTYPE(c_int, c_int, c_int) ...
gpl-2.0
Tejal011089/med2-app
startup/webutils.py
30
1121
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt import webnotes from webnotes.utils import cint def get_website_settings(context): post_login = [] cart_enabled = cint(webnotes.conn.get_default("shopping_cart_enabled")) if cart_enable...
agpl-3.0
lyndsysimon/osf.io
api/base/middleware.py
13
2315
from pymongo.errors import OperationFailure from raven.contrib.django.raven_compat.models import sentry_exception_handler from framework.transactions import commands, messages, utils from .api_globals import api_globals # TODO: Verify that a transaction is being created for every # individual request. class TokuTra...
apache-2.0
bpgc-cte/python2017
Week 7/django/lib/python3.6/site-packages/django/utils/regex_helper.py
45
12911
""" Functions for reversing a regular expression (used in reverse URL resolving). Used internally by Django and not intended for external use. This is not, and is not intended to be, a complete reg-exp decompiler. It should be good enough for a large class of URLS, however. """ from __future__ import unicode_literals ...
mit
crosick/zhishu
ENV/lib/python2.7/encodings/cp1026.py
593
13369
""" Python Character Mapping Codec cp1026 generated from 'MAPPINGS/VENDORS/MICSFT/EBCDIC/CP1026.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,inp...
mit
chase-kernan/lsc-seis-gcm
gcm/web/coinc.py
1
2126
import bottle from gcm.data import channels as chn, coinc as co, raw from gcm.web.utils import * import numpy as np @bottle.get('/coinc/group/<group_id:int>') @bottle.view('coincs.html') def get_group(group_id): return {'root': WEB_ROOT, 'group': _get_group(group_id)} @bottle.get('/coinc/cross/group/<group_id:in...
gpl-2.0
ray-project/ray
python/ray/tune/examples/horovod_simple.py
1
4364
import torch import numpy as np import ray from ray import tune from ray.tune.integration.horovod import DistributedTrainableCreator import time def sq(x): m2 = 1. m1 = -20. m0 = 50. return m2 * x * x + m1 * x + m0 def qu(x): m3 = 10. m2 = 5. m1 = -20. m0 = -5. return m3 * x * x...
apache-2.0
adityacs/ansible
lib/ansible/modules/cloud/rackspace/rax_keypair.py
50
5128
#!/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
eckucukoglu/arm-linux-gnueabihf
arm-linux-gnueabihf/libc/usr/lib/python2.7/encodings/cp737.py
593
34937
""" Python Character Mapping Codec cp737 generated from 'VENDORS/MICSFT/PC/CP737.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_map) def decode(self,input,errors='strict...
gpl-2.0
taedori81/e-commerce-template
saleor/dashboard/product/views.py
7
10930
from __future__ import unicode_literals from django.contrib import messages from django.shortcuts import get_object_or_404, redirect from django.template.response import TemplateResponse from django.utils.http import is_safe_url from django.utils.translation import ugettext_lazy as _ from django.views.decorators.http ...
bsd-3-clause
lucidbard/NewsBlur
apps/reader/migrations/0008_oldest_unread_story_date.py
18
12369
# 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): # Adding field 'UserSubscription.oldest_unread_story_date' db.add_column('reader_usersubscription', 'oldes...
mit
UFTS-Device/NanoCoin
qa/rpc-tests/test_framework/bignum.py
123
1929
#!/usr/bin/env python3 # # bignum.py # # This file is copied from python-bitcoinlib. # # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # """Bignum routines""" import struct # generic big endian MPI format def bn_bytes(v, have...
mit
CnrLwlss/HTSauto
HTSscripts/C2FindBarcode.py
1
7171
# Finds images from ID in our archive and dumps file locations to .json file # Only images where a specific treatment and medium were applied, captured before a cutoff period after inoculation, are considered # Optionally copies symlinks to images or image files themselves to pdump directory for inspection/download # T...
gpl-2.0
jusdng/odoo
addons/website/tests/test_crawl.py
251
3415
# -*- coding: utf-8 -*- import logging import urlparse import time import lxml.html import openerp import re _logger = logging.getLogger(__name__) class Crawler(openerp.tests.HttpCase): """ Test suite crawling an openerp CMS instance and checking that all internal links lead to a 200 response. If a use...
agpl-3.0
Bytewerk/uClinux-ipcam
user/samba/source/python/examples/tdbpack/oldtdbutil.py
55
4116
#!/usr/bin/python ############################################################# # tdbutil # # Purpose: # Contains functions that are used to pack and unpack data # from Samba's tdb databases. Samba sometimes represents complex # data structures as a single value in a database. These functions # allow other python ...
gpl-2.0
GkAntonius/feynman
docs/auto_examples/Particle_Physics/plot_dchp1.py
2
2222
""" DCHP1 ===== Doubly Charged Higgs Production """ import matplotlib matplotlib.rcParams['mathtext.fontset'] = 'stix' matplotlib.rcParams['font.family'] = 'STIXGeneral' from feynman import Diagram fig = matplotlib.pyplot.figure(figsize=(10.,10.)) ax = fig.add_axes([0,0,1,1], frameon=False) diagram = Diagram(ax) di...
gpl-3.0
matchstick/kubernetes
hack/boilerplate/boilerplate.py
31
5238
#!/usr/bin/env python # Copyright 2015 The Kubernetes 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 # # Unle...
apache-2.0
landryb/QGIS
python/plugins/processing/algs/qgis/RegularPoints.py
10
4770
# -*- coding: utf-8 -*- """ *************************************************************************** RegularPoints.py --------------------- Date : September 2014 Copyright : (C) 2014 by Alexander Bruy Email : alexander dot bruy at gmail dot com *********...
gpl-2.0
aflaxman/scikit-learn
benchmarks/bench_plot_parallel_pairwise.py
127
1270
# Author: Mathieu Blondel <mathieu@mblondel.org> # License: BSD 3 clause import time import matplotlib.pyplot as plt from sklearn.utils import check_random_state from sklearn.metrics.pairwise import pairwise_distances from sklearn.metrics.pairwise import pairwise_kernels def plot(func): random_state = check_rand...
bsd-3-clause
nicoddemus/backtrader
samples/quickstart06.py
1
4786
#!/usr/bin/env python # -*- coding: utf-8; py-indent-offset:4 -*- ############################################################################### # # Copyright (C) 2015 Daniel Rodriguez # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as pub...
gpl-3.0
liupfskygre/qiime
tests/test_add_alpha_to_mapping_file.py
15
14308
#!/usr/bin/env python # File created on 02 Nov 2012 from __future__ import division __author__ = "Yoshiki Vazquez-Baeza" __copyright__ = "Copyright 2011, The QIIME project" __credits__ = ["Yoshiki Vazquez-Baeza"] __license__ = "GPL" __version__ = "1.9.1-dev" __maintainer__ = "Yoshiki Vazquez-Baeza" __email__ = "yoshik...
gpl-2.0
liaoqingwei/flask
tests/test_testing.py
143
6479
# -*- coding: utf-8 -*- """ tests.testing ~~~~~~~~~~~~~ Test client and more. :copyright: (c) 2015 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import pytest import flask from flask._compat import text_type def test_environ_defaults_from_config(): app = flask.Flask(_...
bsd-3-clause
marcoplaisier/pytoon
setup.py
2
1197
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys try: from setuptools import setup except ImportError: from distutils.core import setup if sys.argv[-1] == 'publish': os.system('python setup.py sdist upload') sys.exit() readme = open('README.rst').read() history = open('HISTORY.rst...
bsd-3-clause
siliconsmiley/QGIS
python/plugins/processing/algs/gdal/nearblack.py
1
2664
# -*- coding: utf-8 -*- """ *************************************************************************** nearblack.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com *****************************...
gpl-2.0
PythonicNinja/pydrill
pydrill/connection/base.py
1
4011
# -*- coding: utf-8 -*- import logging from ..exceptions import HTTP_EXCEPTIONS, TransportError try: import simplejson as json except ImportError: import json logger = logging.getLogger('pydrill') _tracer_already_configured = 'pydrill.trace' in logging.Logger.manager.loggerDict tracer = logging.getLogger(...
mit
NSLS-II/PyXRF
pyxrf/_version.py
1
15432
# This file helps to compute a version number in source trees obtained from # git-archive tarball (such as those provided by githubs download-from-tag # feature). Distribution tarballs (built by setup.py sdist) and build # directories (produced by setup.py build) will contain a much shorter file # that just contains th...
bsd-3-clause
asoliveira/NumShip
scripts/plot/leme-velo-v-zz-plt.py
1
3018
#!/usr/bin/env python # -*- coding: utf-8 -*- #É adimensional? adi = False #É para salvar as figuras(True|False)? save = True #Caso seja para salvar, qual é o formato desejado? formato = 'jpg' #Caso seja para salvar, qual é o diretório que devo salvar? dircg = 'fig-sen' #Caso seja para salvar, qual é o nome do arquivo...
gpl-3.0
ksweta/BeamIt-Server
beamit/resources/password.py
1
1284
from beamit.resources.base import Resource class PasswordChangeRequest(Resource): MEDIA_TYPE = 'application/vnd.beamit.password.change.request+json' def __init__(self, email, password, new_password): self.email = email self.password = password self.new_password = new_password de...
apache-2.0
40223211/2015cd_midterm2
static/Brython3.1.1-20150328-091302/Lib/_random.py
518
2451
from browser import window def _randint(a, b): return int(window.Math.random()*(b-a+1)+a) def _urandom(n): """urandom(n) -> str Return n random bytes suitable for cryptographic use.""" randbytes= [_randint(0,255) for i in range(n)] return bytes(randbytes) class Random: """Random n...
agpl-3.0
mrphrazer/miasm
example/jitter/example_types.py
3
8126
#! /usr/bin/env python2 """This script is just a short example of common usages for miasm.core.types. For a more complete view of what is possible, tests/core/types.py covers most of the module possibilities, and the module doc gives useful information as well. """ from __future__ import print_function from miasm.core...
gpl-2.0
DelazJ/QGIS
tests/src/python/test_qgsvectorlayertools.py
45
2025
# -*- coding: utf-8 -*- """QGIS Unit test utils for provider tests. .. note:: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. "...
gpl-2.0
martijnvermaat/rpclib
src/rpclib/test/interop/server/httprpc_pod_basic.py
1
1879
#!/usr/bin/env python # # rpclib - Copyright (C) Rpclib contributors. # # 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 # version 2.1 of the License, or (at your option) any later ...
lgpl-2.1
Python4AstronomersAndParticlePhysicists/PythonWorkshop-ICE
notebooks/ml/solutions/exercise_6.py
1
2217
from sklearn.metrics import precision_recall_curve, roc_curve, roc_auc_score, average_precision_score from sklearn.model_selection import StratifiedKFold from sklearn.tree import DecisionTreeClassifier from sklearn.datasets import make_moons from matplotlib import patches X, y = make_moons(n_samples=5000, noise=0.9) ...
mit
mydongistiny/external_chromium_org_third_party_WebKit
Tools/Scripts/webkitpy/common/system/user.py
27
6861
# Copyright (c) 2009, 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...
bsd-3-clause
garvitr/sympy
sympy/printing/tree.py
106
2450
from __future__ import print_function, division def pprint_nodes(subtrees): """ Prettyprints systems of nodes. Examples ======== >>> from sympy.printing.tree import pprint_nodes >>> print(pprint_nodes(["a", "b1\\nb2", "c"])) +-a +-b1 | b2 +-c """ def indent(s, type=1...
bsd-3-clause
Weijing/Weijing.github.io
talkmap.py
205
1188
# # Leaflet cluster map of talk locations # # (c) 2016-2017 R. Stuart Geiger, released under the MIT license # # Run this from the _talks/ directory, which contains .md files of all your talks. # This scrapes the location YAML field from each .md file, geolocates it with # geopy/Nominatim, and uses the getorg librar...
apache-2.0
fritsvanveen/QGIS
python/custom_widgets/qgis_customwidgets.py
13
1934
# -*- coding: utf-8 -*- """ *************************************************************************** customwidgets.py --------------------- Date : May 2014 Copyright : (C) 2014 by Denis Rouzaud Email : denis.rouzaud@gmail.com ****************************...
gpl-2.0
jdemel/gnuradio
gr-channels/python/channels/amp_bal.py
9
2511
#!/usr/bin/env python ################################################## # Gnuradio Python Flow Graph # Title: Amplitude Balance # Author: mettus # Description: Restores IQ amplitude balance # Generated: Thu Aug 1 11:47:46 2013 ################################################## from __future__ import unicode_literals...
gpl-3.0
AlexCaranha/Wox
PythonHome/Lib/site-packages/pip/_vendor/requests/sessions.py
294
22290
# -*- coding: utf-8 -*- """ requests.session ~~~~~~~~~~~~~~~~ This module provides a Session object to manage and persist settings across requests (cookies, auth, proxies). """ import os from collections import Mapping from datetime import datetime from .auth import _basic_auth_str from .compat import cookielib, Or...
mit
overtherain/scriptfile
software/googleAppEngine/lib/django_1_4/tests/modeltests/m2m_multiple/tests.py
150
2385
from __future__ import absolute_import from datetime import datetime from django.test import TestCase from .models import Article, Category class M2MMultipleTests(TestCase): def test_multiple(self): c1, c2, c3, c4 = [ Category.objects.create(name=name) for name in ["Sports", "Ne...
mit
Flimm/django-fullurl
fullurl/templatetags/fullurl.py
1
1889
from django import template from django.template import defaulttags from django.template.base import Node from django.templatetags.static import do_static register = template.Library() @register.tag def fullurl(parser, token): """Return an absolute URL (including the scheme and domain) matching the given view...
mit
LyreOrpheus/lyreserver
MusicBot/musicbot/exceptions.py
14
2599
import shutil import textwrap # Base class for exceptions class MusicbotException(Exception): def __init__(self, message, *, expire_in=0): self._message = message self.expire_in = expire_in @property def message(self): return self._message @property def message_no_format(s...
mit
icio/github3.py
github3/repos/comparison.py
10
2875
# -*- coding: utf-8 -*- """ github3.repos.comparison ======================== This module contains the Comparison object for comparing two commits via the GitHub API. """ from __future__ import unicode_literals from ..models import GitHubCore from .commit import RepoCommit class Comparison(GitHubCore): """The ...
bsd-3-clause
Varentsov/servo
tests/wpt/web-platform-tests/tools/third_party/pytest/testing/acceptance_test.py
12
29172
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function import os import sys import _pytest._code import py import pytest from _pytest.main import EXIT_NOTESTSCOLLECTED, EXIT_USAGEERROR class TestGeneralUsage(object): def test_config_error(self, testdir): testdir.makeconf...
mpl-2.0
rgommers/numpy
numpy/f2py/tests/test_return_complex.py
17
4615
import pytest from numpy import array from numpy.testing import assert_, assert_raises from . import util class TestReturnComplex(util.F2PyTest): def check_function(self, t, tname): if tname in ['t0', 't8', 's0', 's8']: err = 1e-5 else: err = 0.0 assert_(abs(t(234...
bsd-3-clause
ashray/VTK-EVM
Wrapping/Python/vtk/util/numpy_support.py
6
8679
"""This module adds support to easily import and export NumPy (http://numpy.scipy.org) arrays into/out of VTK arrays. The code is loosely based on TVTK (https://svn.enthought.com/enthought/wiki/TVTK). This code depends on an addition to the VTK data arrays made by Berk Geveci to make it support Python's buffer protoc...
bsd-3-clause
andymiller/vae-flow
vae/nnet.py
1
3389
import numpy as np import tensorflow as tf ### constructing and composing layers def make_layer(dot, activation): def layer(W, b): def apply(h): return activation(dot(h, W) + b) return apply return layer # TODO - a stochastic layer is really a composition of a deterministic layer...
mit
d9w/6858-android-intents
analyzer/androguard/core/androgen.py
7
7936
# This file is part of Androguard. # # Copyright (C) 2012, Anthony Desnos <desnos at t0t0.fr> # All rights reserved. # # Androguard 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 version 3 of th...
mit
jruiperezv/ANALYSE
lms/djangoapps/courseware/features/staff_debug_info.py
173
1472
""" Steps for staff_debug_info.feature lettuce tests """ from django.contrib.auth.models import User from lettuce import world, step from common import create_course, course_id from courseware.courses import get_course_by_id from instructor.access import allow_access @step(u'i am staff member for the course "([^"]*)...
agpl-3.0
andrebellafronte/stoq
stoqlib/lib/pdf.py
4
1127
# -*- Mode: Python; coding: utf-8 -*- # vi:si:et:sw=4:sts=4:ts=4 ## ## Copyright (C) 2011 Async Open Source <http://www.async.com.br> ## All rights reserved ## ## 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 Sof...
gpl-2.0
steveb/heat
heat/tests/test_grouputils.py
6
3180
# # 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
GastonLab/ddb-scripts
defunct/workflow-RNA-Seq_Salmon_Unpaired.py
3
1506
#!/usr/bin/env python # Standard packages import sys import argparse # Third-party packages from toil.job import Job # Package methods from ddb import configuration from ddb_ngsflow import pipeline from ddb_ngsflow.rna import salmon if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_a...
mit
mosbasik/buzhug
javasrc/lib/Jython/Lib/encodings/latin_1.py
853
1264
""" Python 'latin-1' Codec Written by Marc-Andre Lemburg (mal@lemburg.com). (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. """ import codecs ### Codec APIs class Codec(codecs.Codec): # Note: Binding these as C functions will result in the class not # converting them to methods. This is intended. ...
bsd-3-clause
jn7163/django
tests/flatpages_tests/test_templatetags.py
309
7111
from django.contrib.auth.models import AnonymousUser, User from django.contrib.flatpages.models import FlatPage from django.contrib.sites.models import Site from django.template import Context, Template, TemplateSyntaxError from django.test import TestCase, modify_settings, override_settings from .settings import FLAT...
bsd-3-clause
nkgilley/home-assistant
homeassistant/components/onvif/camera.py
6
6736
"""Support for ONVIF Cameras with FFmpeg as decoder.""" import asyncio from haffmpeg.camera import CameraMjpeg from haffmpeg.tools import IMAGE_JPEG, ImageFrame import requests from requests.auth import HTTPDigestAuth import voluptuous as vol from homeassistant.components.camera import SUPPORT_STREAM, Camera from hom...
apache-2.0