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
spacetelescope/stsci.tools
lib/stsci/tools/basicpar.py
1
60106
"""basicpar.py -- General base class for parameter objects. Broken out from PyRAF's IrafPar class. $Id$ """ import re import sys from . import irafutils, minmatch from .irafglobals import INDEF, Verbose, yes, no int_types = (int, ) # container class used for __deepcopy__ method class _EmptyClass:...
bsd-3-clause
ALSchwalm/python-prompt-toolkit
prompt_toolkit/contrib/completers/filesystem.py
3
3312
from __future__ import unicode_literals from prompt_toolkit.completion import Completer, Completion import os __all__ = ( 'PathCompleter', ) class PathCompleter(Completer): """ Complete for Path variables. :param get_paths: Callable which returns a list of directories to look into ...
bsd-3-clause
indictranstech/buyback-erp
erpnext/hr/doctype/hr_settings/hr_settings.py
38
1282
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe.utils import cint from frappe.model.document import Document class HR...
agpl-3.0
jamesrobertlloyd/kmc-research
src/deep_learning/rbm_label.py
1
23562
"""This tutorial introduces restricted boltzmann machines (RBM) using Theano. Boltzmann Machines (BMs) are a particular form of energy-based model which contain hidden variables. Restricted Boltzmann Machines further restrict BMs to those without visible-visible and hidden-hidden connections. Modified by James Robert...
mit
diegoguimaraes/django
django/contrib/gis/gdal/srs.py
11
12004
""" The Spatial Reference class, represensents OGR Spatial Reference objects. Example: >>> from django.contrib.gis.gdal import SpatialReference >>> srs = SpatialReference('WGS84') >>> print(srs) GEOGCS["WGS 84", DATUM["WGS_1984", SPHEROID["WGS 84",6378137,298.257223563, AUTHOR...
bsd-3-clause
jeanlinux/calibre
setup/pypi.py
14
13151
#!/usr/bin/env python2 # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai from __future__ import with_statement __license__ = 'GPL v3' __copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>' __docformat__ = 'restructuredtext en' import os, StringIO, urllib2, urlparse, base64, hashlib, httplib, socket from Config...
gpl-3.0
slavi104/cashtracker
cashtracker_project/app_cashtracker/tests/report_pdf_tests.py
1
2438
from django.test import TestCase from app_cashtracker.helpers.ReportPDF import * from app_cashtracker.models.User import User from app_cashtracker.models.Category import Category from app_cashtracker.models.Subcategory import Subcategory from app_cashtracker.models.Payment import Payment from app_cashtracker.models.Rep...
lgpl-3.0
ruymanengithub/vison
vison/datamodel/QLAtools.py
1
10255
# -*- coding: utf-8 -*- """ Quick-Look-Analysis Tools. :History: Created on Wed Mar 16 11:31:58 2016 @author: Ruyman Azzollini """ # IMPORT STUFF import numpy as np import os from matplotlib import pyplot as plt import string as st from vison.datamodel import ccd from vison.support import latex from pdb import s...
gpl-3.0
manojpandey/hackenvision16
tinybank/tinybank/venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/response.py
199
2167
from __future__ import absolute_import from ..packages.six.moves import http_client as httplib from ..exceptions import HeaderParsingError def is_fp_closed(obj): """ Checks whether a given file-like object is closed. :param obj: The file-like object to check. """ try: # Check vi...
mit
home-assistant/home-assistant
tests/components/met_eireann/test_config_flow.py
3
3022
"""Tests for Met Éireann config flow.""" from unittest.mock import patch import pytest from homeassistant import config_entries, data_entry_flow from homeassistant.components.met_eireann.const import DOMAIN, HOME_LOCATION_NAME from homeassistant.const import CONF_ELEVATION, CONF_LATITUDE, CONF_LONGITUDE @pytest.fix...
apache-2.0
holiman/evmlab
netsstore.py
1
1143
""" """ #!/usr/bin/env python import json import tempfile, os from evmlab import compiler as c from evmlab import vm from evmlab import genesis def generateCall(): # the caller p = c.Program() # create2(self,value = 0,instart = 0, insize = 0, salt = 0): p.op(c.ADDRESS) p.create2(0,0,0,0) #...
gpl-3.0
zlorf/django-dbsettings
dbsettings/forms.py
2
2516
import re from collections import OrderedDict from django.apps import apps from django import forms from django.utils.text import capfirst from dbsettings.loading import get_setting_storage RE_FIELD_NAME = re.compile(r'^(.+)__(.*)__(.+)$') class SettingsEditor(forms.BaseForm): "Base editor, from which customi...
bsd-3-clause
lordmuffin/aws-cfn-plex
functions/credstash/pip/_vendor/requests/compat.py
327
1687
# -*- coding: utf-8 -*- """ requests.compat ~~~~~~~~~~~~~~~ This module handles import compatibility issues between Python 2 and Python 3. """ from .packages import chardet import sys # ------- # Pythons # ------- # Syntax sugar. _ver = sys.version_info #: Python 2.x? is_py2 = (_ver[0] == 2) #: Python 3.x? is_p...
mit
fyffyt/pylearn2
pylearn2/scripts/plot_monitor.py
37
10204
#!/usr/bin/env python """ usage: plot_monitor.py model_1.pkl model_2.pkl ... model_n.pkl Loads any number of .pkl files produced by train.py. Extracts all of their monitoring channels and prompts the user to select a subset of them to be plotted. """ from __future__ import print_function __authors__ = "Ian Goodfell...
bsd-3-clause
mrgloom/menpofit
menpofit/atm/fitter.py
1
14525
from __future__ import division from menpofit.fitter import MultilevelFitter from menpofit.fittingresult import AMMultilevelFittingResult from menpofit.transform import (ModelDrivenTransform, OrthoMDTransform, DifferentiableAlignmentSimilarity) from menpofit.lucaskanade.residual import ...
bsd-3-clause
alextsui05/gmock
gtest/test/gtest_filter_unittest.py
2826
21261
#!/usr/bin/env python # # Copyright 2005 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...
bsd-3-clause
almarklein/scikit-image
skimage/io/_plugins/fits_plugin.py
2
4636
__all__ = ['imread', 'imread_collection'] import skimage.io as io try: import pyfits except ImportError: raise ImportError("PyFITS could not be found. Please refer to\n" "http://www.stsci.edu/resources/software_hardware/pyfits\n" "for further instructions.") def imread(fname, dtype=None): ...
bsd-3-clause
Mageluer/computational_physics_N2014301040052
final/code/perceptron_model/flowers_1v1.py
1
1855
import pandas as pd import numpy as np import matplotlib.pyplot as pl import matplotlib.colors as mcl from sklearn import datasets import SVM1v1 as pc """ df = pd.read_csv("https://archive.ics.uci.edu/ml/machine-learning-databases/iris/iris.data", header=None) y = df.iloc[0:100, 4].values y = np.where(y == 'Iris-setos...
mit
Don42/youtube-dl
youtube_dl/extractor/adobetv.py
96
4630
from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( parse_duration, unified_strdate, str_to_int, float_or_none, ISO639Utils, ) class AdobeTVIE(InfoExtractor): _VALID_URL = r'https?://tv\.adobe\.com/watch/[^/]+/(?P<id>[^/]+)' _TEST = { '...
unlicense
fos/fos-legacy
scratch/4gletools/outline_render_brain.py
1
2254
from __future__ import with_statement from contextlib import nested import pyglet from gletools import ( ShaderProgram, FragmentShader, VertexShader, Depthbuffer, Texture, Projection, UniformArray, Lighting, Color ) from gletools.gl import * from util import Mesh, Processor, Kernel, offsets, gl_init from gauss...
bsd-3-clause
pgleeson/TestArea
lib/jython/Lib/test/cjkencodings_test.py
34
65909
teststring = { 'big5': ( "\xa6\x70\xa6\xf3\xa6\x62\x20\x50\x79\x74\x68\x6f\x6e\x20\xa4\xa4" "\xa8\xcf\xa5\xce\xac\x4a\xa6\xb3\xaa\xba\x20\x43\x20\x6c\x69\x62" "\x72\x61\x72\x79\x3f\x0a\xa1\x40\xa6\x62\xb8\xea\xb0\x54\xac\xec" "\xa7\xde\xa7\xd6\xb3\x74\xb5\x6f\xae\x69\xaa\xba\xa4\xb5\xa4\xd1" "\x2c\x20\xb6\x7d\xb5\x6f\x...
gpl-2.0
YueLinHo/Subversion
tools/dev/wc-format.py
1
1957
#!/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 # "L...
apache-2.0
mgit-at/ansible
lib/ansible/modules/cloud/openstack/os_stack.py
7
9217
#!/usr/bin/python # coding: utf-8 -*- # (c) 2016, Mathieu Bultel <mbultel@redhat.com> # (c) 2016, Steve Baker <sbaker@redhat.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__ = type ANSIBLE...
gpl-3.0
lmazuel/ansible
lib/ansible/modules/commands/raw.py
56
3569
# this is a virtual module that is entirely implemented server side # 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 op...
gpl-3.0
GdZ/scriptfile
software/googleAppEngine/lib/django_1_4/django/contrib/localflavor/se/utils.py
93
2389
import datetime def id_number_checksum(gd): """ Calculates a Swedish ID number checksum, using the "Luhn"-algoritm """ n = s = 0 for c in (gd['year'] + gd['month'] + gd['day'] + gd['serial']): tmp = ((n % 2) and 1 or 2) * int(c) if tmp > 9: tmp = sum([int(i) for i i...
mit
LLNL/spack
var/spack/repos/builtin/packages/libtiff/package.py
3
1103
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Libtiff(AutotoolsPackage): """LibTIFF - Tag Image File Format (TIFF) Library and Utilities...
lgpl-2.1
rhdekker/collatex
collatex-pythonport/collatex/linsuffarr.py
2
34420
#! /usr/bin/python # -*- coding: utf-8 -*- """ Linsuffarr: Suffix arrays for natural language processing In its simplest use as a command line, this Python module performs the linear construction of the suffix array for the text given on the standard input (Kärkkäinen and Sanders, Linear work suffix array construction...
gpl-3.0
OS2World/APP-INTERNET-torpak_2
Lib/test/test_cl.py
12
3930
#! /usr/bin/env python """Whimpy test script for the cl module Roger E. Masse """ import cl from test.test_support import verbose clattrs = ['ADDED_ALGORITHM_ERROR', 'ALAW', 'ALGORITHM_ID', 'ALGORITHM_VERSION', 'AUDIO', 'AWARE_ERROR', 'AWARE_MPEG_AUDIO', 'AWARE_MULTIRATE', 'AWCMP_CONST_QUAL', 'AWCMP_FIXED_RATE', 'A...
mit
sicily/qt4.8.4
src/3rdparty/webkit/Source/ThirdParty/gyp/test/defines/gyptest-defines-env-regyp.py
151
1312
#!/usr/bin/env python # Copyright (c) 2009 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. """ Verifies build of an executable with C++ define specified by a gyp define, and the use of the environment during regeneration when the g...
lgpl-2.1
malzantot/protobuf-socket-rpc
python/src/protobuf/socketrpc/controller.py
9
2490
#!/usr/bin/python # Copyright (c) 2009 Las Cumbres Observatory (www.lcogt.net) # Copyright (c) 2010 Jan Dittberner # # 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, inclu...
mit
shepdelacreme/ansible
lib/ansible/modules/storage/netapp/netapp_e_alerts.py
25
10359
#!/usr/bin/python # (c) 2018, NetApp, Inc # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
gpl-3.0
gxx/lettuce
tests/integration/lib/Django-1.3/tests/regressiontests/utils/feedgenerator.py
51
2526
import datetime from django.utils import feedgenerator, tzinfo, unittest class FeedgeneratorTest(unittest.TestCase): """ Tests for the low-level syndication feed framework. """ def test_get_tag_uri(self): """ Test get_tag_uri() correctly generates TagURIs. """ self.ass...
gpl-3.0
sogis/Quantum-GIS
python/ext-libs/owslib/fes.py
29
16239
# -*- coding: ISO-8859-15 -*- # ============================================================================= # Copyright (c) 2009 Tom Kralidis # # Authors : Tom Kralidis <tomkralidis@gmail.com> # # Contact email: tomkralidis@gmail.com # ============================================================================= """...
gpl-2.0
rbrito/pkg-youtube-dl
youtube_dl/extractor/airmozilla.py
57
2697
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( int_or_none, parse_duration, parse_iso8601, ) class AirMozillaIE(InfoExtractor): _VALID_URL = r'https?://air\.mozilla\.org/(?P<id>[0-9a-z-]+)/?' _TEST = { 'url': 'htt...
unlicense
nlharris/narrative
src/biokbase/userandjobstate/client.py
4
45124
############################################################ # # Autogenerated by the KBase type compiler - # any changes made here will be overwritten # # Passes on URLError, timeout, and BadStatusLine exceptions. # See: # http://docs.python.org/2/library/urllib2.html # http://docs.python.org/2/library/htt...
mit
sparkslabs/kamaelia
Sketches/MPS/BugReports/FixTests/Kamaelia/Kamaelia/Support/Data/Repository.py
3
46255
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1) # # (1) Kamaelia Contributors are listed in the AUTHORS file and at # http://www.kamaelia.org/AUTHORS - please extend this file, # not this notice. # # Licensed under the Apache License, Ve...
apache-2.0
shinru2004/android_kernel_htc_a11
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py
11088
3246
# Core.py - Python extension for perf script, core functions # # Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com> # # This software may be distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. from collections import defaultdict def aut...
gpl-2.0
MIPS/external-chromium_org-tools-grit
grit/pseudo.py
62
4072
#!/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. '''Pseudotranslation support. Our pseudotranslations are based on the P-language, which is a simple vowel-extending language. Exa...
bsd-2-clause
Venris/crazyflie-multilink
lib/cflib/crazyflie/toc.py
1
7081
#!/usr/bin/env python # -*- coding: utf-8 -*- # # || ____ _ __ # +------+ / __ )(_) /_______________ _____ ___ # | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \ # +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/ # || || /_____/_/\__/\___/_/ \__,_/ /___/\___/ # # Copyright (C) 20...
gpl-2.0
yaccz/xhtml2pdf
xhtml2pdf/tags.py
13
19943
# -*- coding: utf-8 -*- from reportlab.graphics.barcode import createBarcodeDrawing from reportlab.lib.pagesizes import A4 from reportlab.lib.units import inch, mm from reportlab.platypus.doctemplate import NextPageTemplate, FrameBreak from reportlab.platypus.flowables import Spacer, HRFlowable, PageBreak, Flowable fro...
apache-2.0
dya2/python-for-android
python3-alpha/python3-src/Lib/test/datetimetester.py
47
146989
"""Test date/time type. See http://www.zope.org/Members/fdrake/DateTimeWiki/TestCases """ import sys import pickle import unittest from operator import lt, le, gt, ge, eq, ne, truediv, floordiv, mod from test import support import datetime as datetime_module from datetime import MINYEAR, MAXYEAR from datetime impo...
apache-2.0
magnucki/gitinspector
gitinspector/interval.py
50
1220
# coding: utf-8 # # Copyright © 2012-2013 Ejwa Software. All rights reserved. # # This file is part of gitinspector. # # gitinspector 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 Lic...
gpl-3.0
mpvismer/pyqtgraph
pyqtgraph/tests/test_exit_crash.py
29
1182
import os, sys, subprocess, tempfile import pyqtgraph as pg import six import pytest code = """ import sys sys.path.insert(0, '{path}') import pyqtgraph as pg app = pg.mkQApp() w = pg.{classname}({args}) """ skipmessage = ('unclear why this test is failing. skipping until someone has' ' time to fix it'...
mit
uni-peter-zheng/tp-qemu
qemu/tests/virtio_scsi_mq.py
2
8932
import logging import re from autotest.client.shared import error from autotest.client import local_host from virttest import utils_misc from virttest import env_process from virttest import qemu_qtree @error.context_aware def run(test, params, env): """ Qemu multiqueue test for virtio-scsi controller: 1...
gpl-2.0
Livit/Livit.Learn.EdX
common/djangoapps/heartbeat/views.py
199
1440
from xmodule.modulestore.django import modulestore from dogapi import dog_stats_api from util.json_request import JsonResponse from django.db import connection from django.db.utils import DatabaseError from xmodule.exceptions import HeartbeatFailure @dog_stats_api.timed('edxapp.heartbeat') def heartbeat(request): ...
agpl-3.0
DrSLDR/consilium
consilium/consilium/settings.py
1
3675
""" Django settings for consilium project. Generated by 'django-admin startproject' using Django 1.10.4. For more information on this file, see https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.10/ref/settings/ """ import ...
gpl-3.0
wangming28/syzygy
third_party/numpy/files/numpy/lib/tests/test_ufunclike.py
35
1924
from numpy.testing import * import numpy.core as nx import numpy.lib.ufunclike as ufl from numpy.testing.decorators import deprecated class TestUfunclike(TestCase): def test_isposinf(self): a = nx.array([nx.inf, -nx.inf, nx.nan, 0.0, 3.0, -3.0]) out = nx.zeros(a.shape, bool) tgt = nx.array...
apache-2.0
vaygr/ansible
lib/ansible/plugins/lookup/first_found.py
20
4304
# (c) 2013, seth vidal <skvidal@fedoraproject.org> red hat, inc # (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = """ lookup: first_found ...
gpl-3.0
GodBlessPP/W17test_2nd_2
static/Brython3.1.1-20150328-091302/Lib/xml/sax/xmlreader.py
824
12612
"""An XML Reader is the SAX 2 name for an XML parser. XML Parsers should be based on this code. """ from . import handler from ._exceptions import SAXNotSupportedException, SAXNotRecognizedException # ===== XMLREADER ===== class XMLReader: """Interface for reading an XML document using callbacks. XMLReade...
gpl-3.0
emedinaa/contentbox
third_party/oauthlib/oauth1/rfc5849/endpoints/request_token.py
6
8904
# -*- coding: utf-8 -*- """ oauthlib.oauth1.rfc5849.endpoints.request_token ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This module is an implementation of the request token provider logic of OAuth 1.0 RFC 5849. It validates the correctness of request token requests, creates and persists tokens as well as create t...
apache-2.0
galaxyproject/tools-iuc
tools/humann/customizemapping.py
5
1781
#!/usr/bin/env python # -*- coding: utf-8 -*- import argparse from pathlib import Path if __name__ == '__main__': # Read command line parser = argparse.ArgumentParser(description='Customize HUMAnN utility mapping') parser.add_argument('--in_mapping', help="Path to mapping file to reduce") parser.add_...
mit
ChanduERP/odoo
addons/account/__openerp__.py
190
7542
# -*- 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
AOSP-S4-KK/platform_external_chromium_org
build/android/pylib/instrumentation/test_package.py
61
1121
# Copyright (c) 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Class representing instrumentation test apk and jar.""" import os from pylib.utils import apk_helper import test_jar class TestPackage(test_jar.T...
bsd-3-clause
atruberg/django-custom
django/views/decorators/clickjacking.py
550
1759
from functools import wraps from django.utils.decorators import available_attrs def xframe_options_deny(view_func): """ Modifies a view function so its response has the X-Frame-Options HTTP header set to 'DENY' as long as the response doesn't already have that header set. e.g. @xframe_optio...
bsd-3-clause
devs1991/test_edx_docmode
venv/lib/python2.7/site-packages/newrelic-2.46.0.37/newrelic/packages/requests/adapters.py
205
16799
# -*- coding: utf-8 -*- """ requests.adapters ~~~~~~~~~~~~~~~~~ This module contains the transport adapters that Requests uses to define and maintain connections. """ import socket from .models import Response from .packages.urllib3 import Retry from .packages.urllib3.poolmanager import PoolManager, proxy_from_url ...
agpl-3.0
ActiveState/code
recipes/Python/576869_Longest_commsubsequence_problem/recipe-576869.py
2
3166
""" A Longest common subsequence (LCS) problem solver. This problem is a good example of dynamic programming, and also has its significance in biological applications. For more information about LCS, please see: http://en.wikipedia.org/wiki/Longest_common_subsequence_problem Copyright 2...
mit
physycom/QGIS
python/plugins/processing/algs/qgis/IdwInterpolation.py
9
7135
# -*- coding: utf-8 -*- """ *************************************************************************** IdwInterpolation.py --------------------- Date : October 2016 Copyright : (C) 2016 by Alexander Bruy Email : alexander dot bruy at gmail dot com ********...
gpl-2.0
StamKaly/altitude-mod-foundation
alti_discord/bot.py
1
8731
import discord import asyncio import aiohttp import async_timeout import json class DiscordMusic(discord.Client): def __init__(self, number, commands_queue, output_queue, youtube_key, server_id, voice_channel_id, text_channel_id): discord.Client.__init__(self) self.number = number self.com...
mit
qrsforever/workspace
ML/learn/TensorFlow_for_Machine_Intelligence/ch03.py
1
11044
#!/usr/bin/python3 # -*- coding: utf-8 -*- # @file ch3.2.1.py # @brief # @author QRS # @blog qrsforever.github.io # @version 1.0 # @date 2019-05-23 23:41:40 ############################# jupyter-vim map ###################################### # https://github.com/qrsforever/vim/blob/master/bundle/.configs/jupyter-vim...
mit
yasoob/youtube-dl-GUI
youtube_dl/extractor/tfo.py
11
2038
# coding: utf-8 from __future__ import unicode_literals import json from .common import InfoExtractor from ..utils import ( HEADRequest, ExtractorError, int_or_none, clean_html, ) class TFOIE(InfoExtractor): _GEO_COUNTRIES = ['CA'] _VALID_URL = r'https?://(?:www\.)?tfo\.org/(?:en|fr)/(?:[^/]...
mit
dwagon/explorertools
explorer/kstat.py
1
4834
#!/usr/local/bin/python # # Script to understand kstat output # # Written by Dougal Scott <dwagon@pobox.com> # $Id: kstat.py 2393 2012-06-01 06:38:17Z dougals $ # $HeadURL: http://svn/ops/unix/explorer/trunk/explorer/kstat.py $ import os import sys import getopt import re import explorerbase #########################...
gpl-2.0
aviweit/libcloud
libcloud/utils/iso8601.py
58
4302
""" Copyright (c) 2007 Michael Twomey 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 limitation the rights to use, copy, modify, merge, publish, distribute,...
apache-2.0
sunzhxjs/JobGIS
lib/python2.7/site-packages/pip/commands/completion.py
435
1991
from __future__ import absolute_import import sys from pip.basecommand import Command BASE_COMPLETION = """ # pip %(shell)s completion start%(script)s# pip %(shell)s completion end """ COMPLETION_SCRIPTS = { 'bash': """ _pip_completion() { COMPREPLY=( $( COMP_WORDS="${COMP_WORDS[*]}" \\ CO...
mit
jabesq/home-assistant
tests/components/python_script/test_init.py
22
9516
"""Test the python_script component.""" import asyncio import logging from unittest.mock import patch, mock_open from homeassistant.setup import async_setup_component from homeassistant.components.python_script import execute @asyncio.coroutine def test_setup(hass): """Test we can discover scripts.""" script...
apache-2.0
the5fire/onlinetodos
fabfile/__init__.py
1
1594
#coding:utf-8 import os PROJECT_ROOT = os.path.dirname(os.path.dirname(__file__)) from fabric.api import task, roles, cd from fabric.state import env from essay.tasks import build from essay.tasks import deploy from essay.tasks import virtualenv, supervisor, package, git env.GIT_SERVER = 'https://github.com/' # s...
apache-2.0
aleksandaratanasov/catkin_pkg
src/catkin_pkg/package.py
3
23688
# Software License Agreement (BSD License) # # Copyright (c) 2012, Willow Garage, 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...
bsd-3-clause
stack-of-tasks/rbdlpy
tutorial/lib/python2.7/site-packages/OpenGL/raw/EGL/KHR/create_context.py
8
1674
'''Autogenerated by xml_generate script, do not edit!''' from OpenGL import platform as _p, arrays # Code generation uses this from OpenGL.raw.EGL import _types as _cs # End users want this... from OpenGL.raw.EGL._types import * from OpenGL.raw.EGL import _errors from OpenGL.constant import Constant as _C import ctype...
lgpl-3.0
soileater/noobest
websites/views.py
1
3987
from utils.api import get_watcher from django.shortcuts import render, HttpResponseRedirect from utils.constants import ErrorList, division from rank.models import Player from rank.constants import RANK_INT from rank.views import get_vector, get_score, get_data, get_rank import operator import json def index(request...
mit
srene/ns-3-mptcp
src/emu/bindings/modulegen__gcc_ILP32.py
24
286058
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers import pybindgen.settings import warnings class ErrorHandler(pybindgen.settings.ErrorHandler): def handle_error(self, wrapper, exception, traceback_): warnings.warn("exception %r in wrapper %s" % (exception, wrapper)) ...
gpl-2.0
AmperificSuperKANG/lge_kernel_loki
tools/perf/scripts/python/failed-syscalls-by-pid.py
11180
2058
# failed system call counts, by pid # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide failed system call totals, broken down by pid. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.pa...
gpl-2.0
SNAPPETITE/backend
flask/lib/python2.7/site-packages/flask_whooshalchemy.py
59
9076
''' whooshalchemy flask extension ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Adds whoosh indexing capabilities to SQLAlchemy models for Flask applications. :copyright: (c) 2012 by Karl Gyllstrom :license: BSD (see LICENSE.txt) ''' from __future__ import with_statement from __future__ import absolute_imp...
mit
mistercrunch/airflow
airflow/models/sensorinstance.py
10
6417
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
apache-2.0
Anonymous-X6/django
django/db/backends/mysql/base.py
323
15548
""" MySQL database backend for Django. Requires mysqlclient: https://pypi.python.org/pypi/mysqlclient/ MySQLdb is supported for Python 2 only: http://sourceforge.net/projects/mysql-python """ from __future__ import unicode_literals import datetime import re import sys import warnings from django.conf import settings...
bsd-3-clause
q40223241/2015cdb_g3_40223241
cadb_g3_0420-master/static/Brython3.1.1-20150328-091302/Lib/site-packages/spur.py
184
4974
#coding: utf-8 import math # 導入數學函式後, 圓周率為 pi # deg 為角度轉為徑度的轉換因子 deg = math.pi/180. class Spur(object): def __init__(self, ctx): self.ctx = ctx def create_line(self, x1, y1, x2, y2, width=3, fill="red"): self.ctx.beginPath() self.ctx.lineWidth = width self.ctx.moveTo(x1, y1) ...
gpl-3.0
chiotlune/ext
gnuradio-3.7.0.1/gr-digital/examples/narrowband/benchmark_rx.py
4
4751
#!/usr/bin/env python # # Copyright 2010,2011,2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at you...
gpl-2.0
kennedyshead/home-assistant
tests/components/uk_transport/test_sensor.py
5
3165
"""The tests for the uk_transport platform.""" import re from unittest.mock import patch import requests_mock from homeassistant.components.uk_transport.sensor import ( ATTR_ATCOCODE, ATTR_CALLING_AT, ATTR_LOCALITY, ATTR_NEXT_BUSES, ATTR_NEXT_TRAINS, ATTR_STATION_CODE, ATTR_STOP_NAME, ...
apache-2.0
jeongchanKim/TizenRT
external/protobuf/python/google/protobuf/reflection.py
56
4562
# Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # https://developers.google.com/protocol-buffers/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redi...
apache-2.0
akarol/cfme_tests
cfme/tests/services/test_pxe_service_catalogs.py
1
5646
# -*- coding: utf-8 -*- import fauxfactory import pytest from widgetastic.utils import partial_match from cfme import test_requirements from cfme.common.provider import cleanup_vm from cfme.infrastructure.provider import InfraProvider from cfme.infrastructure.pxe import get_pxe_server_from_config, get_template_from_co...
gpl-2.0
SatoshiNXSimudrone/sl4a-damon-clone
python/src/Lib/test/test_richcmp.py
55
11262
# Tests for rich comparisons import unittest from test import test_support import operator class Number: def __init__(self, x): self.x = x def __lt__(self, other): return self.x < other def __le__(self, other): return self.x <= other def __eq__(self, other): return...
apache-2.0
obimod/taiga-back
taiga/projects/issues/migrations/0003_auto_20141210_1108.py
13
1037
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.db import connection from taiga.projects.userstories.models import * from taiga.projects.tasks.models import * from taiga.projects.issues.models import * from taiga.projects.models import * def _fix_ta...
agpl-3.0
jorik041/scikit-learn
examples/model_selection/plot_validation_curve.py
229
1823
""" ========================== Plotting Validation Curves ========================== In this plot you can see the training scores and validation scores of an SVM for different values of the kernel parameter gamma. For very low values of gamma, you can see that both the training score and the validation score are low. ...
bsd-3-clause
navcoindev/navcoin-core
qa/rpc-tests/cfund-rawtx-create-proposal.py
1
24704
#!/usr/bin/env python3 # Copyright (c) 2018 The Navcoin 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 NavCoinTestFramework from test_framework.cfund_util import * import...
mit
BaesFr/Sick-Beard
lib/jsonrpclib/jsonrpc.py
86
17140
""" 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 distributed under the Lice...
gpl-3.0
mitocw/edx-platform
lms/djangoapps/instructor_task/tests/test_api.py
3
15688
""" Test for LMS instructor background task queue management """ import ddt from celery.states import FAILURE from mock import MagicMock, Mock, patch from six.moves import range from bulk_email.models import SEND_TO_LEARNERS, SEND_TO_MYSELF, SEND_TO_STAFF, CourseEmail from common.test.utils import normalize_repr fro...
agpl-3.0
zalando/zmon-aws-agent
tests/test_elastigroup.py
1
9681
from unittest.mock import patch, MagicMock import boto3 import pytest from botocore.exceptions import ClientError from spotinst_sdk import SpotinstClientException import requests_mock import zmon_aws_agent from zmon_aws_agent.elastigroup import Elastigroup, extract_instance_details def test_get_elastigroup_entities...
apache-2.0
coolbombom/CouchPotatoServer
libs/requests/packages/urllib3/contrib/ntlmpool.py
59
4740
# urllib3/contrib/ntlmpool.py # Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt) # # This module is part of urllib3 and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """ NTLM authenticating pool, contributed by erikcederstran Issue #10, see: http://co...
gpl-3.0
AunShiLord/sympy
sympy/utilities/tests/test_autowrap.py
54
6665
# Tests that require installed backends go into # sympy/test_external/test_autowrap import os import tempfile import shutil from sympy.utilities.autowrap import (autowrap, binary_function, CythonCodeWrapper, ufuncify, UfuncifyCodeWrapper, CodeWrapper) from sympy.utilities.codegen import (CCodeGen, CodeGen...
bsd-3-clause
deepmind/dm_control
dm_control/mujoco/wrapper/core.py
1
34339
# Copyright 2017 The dm_control Authors. # # 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 i...
apache-2.0
jeffery9/mixprint_addons
portal/wizard/portal_wizard.py
7
9586
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2011 OpenERP S.A (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
agpl-3.0
jpoimboe/linux
scripts/gdb/linux/symbols.py
588
6302
# # gdb helper commands and functions for Linux kernel debugging # # load kernel and module symbols # # Copyright (c) Siemens AG, 2011-2013 # # Authors: # Jan Kiszka <jan.kiszka@siemens.com> # # This work is licensed under the terms of the GNU GPL version 2. # import gdb import os import re from linux import module...
gpl-2.0
avocado-framework/avocado-vt
virttest/utils_windows/drive.py
2
3534
""" Windows drive utilities """ from . import wmic from virttest import utils_misc def _logical_disks(session, cond=None, props=None): cmd = wmic.make_query("LogicalDisk", cond, props, get_swch=wmic.FMT_TYPE_LIST) out = utils_misc.wait_for(lambda: wmic.parse_list(session.cmd(cmd, ...
gpl-2.0
crazy-cat/incubator-mxnet
example/fcn-xs/data.py
52
6068
# 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 u...
apache-2.0
Shade5/coala
setup.py
8
4774
#!/usr/bin/env python3 import datetime import locale import platform import sys from os import getenv from subprocess import call import setuptools.command.build_py from setuptools import find_packages, setup from setuptools.command.test import test as TestCommand from coalib import VERSION, assert_supported_version...
agpl-3.0
SatoshiNXSimudrone/sl4a-damon-clone
python/src/Tools/framer/framer/function.py
48
4246
"""Functions.""" from framer import template from framer.util import cstring, unindent METH_O = "METH_O" METH_NOARGS = "METH_NOARGS" METH_VARARGS = "METH_VARARGS" def parsefmt(fmt): for c in fmt: if c == '|': continue yield c class Argument: def __init__(self, name): sel...
apache-2.0
SaschaMester/delicium
chrome/test/mini_installer/file_verifier.py
125
1116
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import os import verifier class FileVerifier(verifier.Verifier): """Verifies that the current files match the expectation dictionaries.""" def _Verif...
bsd-3-clause
lmyrefelt/CouchPotatoServer
libs/requests/__init__.py
62
1863
# -*- coding: utf-8 -*- # __ # /__) _ _ _ _ _/ _ # / ( (- (/ (/ (- _) / _) # / """ requests HTTP library ~~~~~~~~~~~~~~~~~~~~~ Requests is an HTTP library, written in Python, for human beings. Basic GET usage: >>> import requests >>> r = requests.get('http://python.org') >>> r.sta...
gpl-3.0
adrienbrault/home-assistant
tests/components/plex/test_init.py
4
7416
"""Tests for Plex setup.""" import copy from datetime import timedelta import ssl from unittest.mock import patch import plexapi import requests import homeassistant.components.plex.const as const from homeassistant.config_entries import ( ENTRY_STATE_LOADED, ENTRY_STATE_NOT_LOADED, ENTRY_STATE_SETUP_ERRO...
mit
edmundgentle/schoolscript
SchoolScript/bin/Debug/pythonlib/Lib/email/header.py
3
23088
# Copyright (C) 2002-2007 Python Software Foundation # Author: Ben Gertzfield, Barry Warsaw # Contact: email-sig@python.org """Header encoding and decoding functionality.""" __all__ = [ 'Header', 'decode_header', 'make_header', ] import re import binascii import email.quoprimime impo...
gpl-2.0
DDEFISHER/servo
tests/wpt/web-platform-tests/tools/wptserve/wptserve/pipes.py
23
14147
from cgi import escape import gzip as gzip_module import re import time import types import uuid from cStringIO import StringIO def resolve_content(response): rv = "".join(item for item in response.iter_content(read_file=True)) if type(rv) == unicode: rv = rv.encode(response.encoding) return rv ...
mpl-2.0
joone/chromium-crosswalk
third_party/android_platform/development/scripts/symbol.py
14
19655
#!/usr/bin/python # # Copyright (C) 2013 The Android Open Source Project # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless require...
bsd-3-clause