repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
jdupl/youtube-dl-channel
refs/heads/master
youtube-dl-channel.py
1
#!/usr/bin/python3 # youtube-dl-channel # # Utility to download Youtube a channel's playlists. Updated for api v3. # Inspired by https://github.com/jordoncm/youtube-dl-playlist # # Python 3.x support only ! # # @author Justin Duplessis # @license GPL version 2 <http://www.gnu.org/licenses/gpl2.html> import sys import ...
k4lipso/rpi_remote
refs/heads/master
clientconsole.py
1
import sys, json from twisted.internet import protocol, reactor from twisted.internet.protocol import Factory class EchoClient(protocol.Protocol): def __init__(self): self.gpioimport = [] self.fileimport() print("ARGGV %s" % (sys.argv[1],)) def connectionMade(self): self....
adamgreenhall/scikit-learn
refs/heads/master
sklearn/semi_supervised/tests/test_label_propagation.py
307
""" test the label propagation module """ import nose import numpy as np from sklearn.semi_supervised import label_propagation from numpy.testing import assert_array_almost_equal from numpy.testing import assert_array_equal ESTIMATORS = [ (label_propagation.LabelPropagation, {'kernel': 'rbf'}), (label_propa...
IllusionRom-deprecated/android_platform_tools_idea
refs/heads/master
python/lib/Lib/xml/etree/ElementInclude.py
181
# # ElementTree # $Id: ElementInclude.py 1862 2004-06-18 07:31:02Z Fredrik $ # # limited xinclude support for element trees # # history: # 2003-08-15 fl created # 2003-11-14 fl fixed default loader # # Copyright (c) 2003-2004 by Fredrik Lundh. All rights reserved. # # fredrik@pythonware.com # http://www.pythonware...
MartynShaw/audacity
refs/heads/master
lib-src/lv2/lv2/plugins/eg-amp.lv2/waflib/Tools/javaw.py
266
#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file import os,re,tempfile,shutil from waflib import TaskGen,Task,Utils,Options,Build,Errors,Node,Logs from waflib.Configure import conf from waflib.TaskGen import feature,before_m...
romanoid/buck
refs/heads/master
test/com/facebook/buck/testutil/endtoend/testdata/cxx_dependent_on_py/py_lib/util_test.py
10
import unittest from util import Util class UtilTest(unittest.TestCase): def test_output(self): self.assertEqual("Python Generated CPP", Util().name)
20tab/upy
refs/heads/master
upy/contrib/gmaps/widgets.py
1
from django.forms import widgets from django.utils.encoding import force_unicode from django.utils.safestring import mark_safe from django.forms.util import flatatt class GoogleMapsAddressWidget(widgets.TextInput): "a widget that will place a google map right after the #id_address field" class Media: ...
espadrine/opera
refs/heads/master
chromium/src/third_party/WebKit/Tools/Scripts/webkitpy/common/system/path.py
191
# Copyright (C) 2010 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the ...
scorphus/thefuck
refs/heads/master
thefuck/rules/git_commit_reset.py
3
from thefuck.specific.git import git_support @git_support def match(command): return ('commit' in command.script_parts) @git_support def get_new_command(command): return 'git reset HEAD~'
maniteja123/sympy
refs/heads/master
sympy/simplify/tests/test_trigsimp.py
49
from sympy import ( symbols, sin, simplify, cos, trigsimp, rad, tan, exptrigsimp,sinh, cosh, diff, cot, Subs, exp, tanh, exp, S, integrate, I,Matrix, Symbol, coth, pi, log, count_ops, sqrt, E, expand, Piecewise) from sympy.utilities.pytest import XFAIL from sympy.abc import x, y, z, t, a, b, c, d, e, f, g...
andrewcmyers/tensorflow
refs/heads/master
tensorflow/contrib/learn/python/learn/estimators/metric_key.py
89
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
adw0rd/lettuce-py3
refs/heads/master
tests/unit/test_file_system.py
1
# -*- coding: utf-8 -*- import sys from io import StringIO from mox import Mox from nose.tools import assert_equals from nose.tools import assert_raises from lettuce import fs as io def test_has_a_stack_list(): "FileSystem stack list" assert hasattr(io.FileSystem, 'stack'), \ 'FileSystem should have...
adamtiger/tensorflow
refs/heads/master
tensorflow/python/framework/tensor_shape_div_test.py
178
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
NeftaliYagua/gae-init
refs/heads/master
main/config.py
9
# coding: utf-8 import os PRODUCTION = os.environ.get('SERVER_SOFTWARE', '').startswith('Google App Eng') DEBUG = DEVELOPMENT = not PRODUCTION try: # This part is surrounded in try/except because the config.py file is # also used in the run.py script which is used to compile/minify the client # side files (*....
fengyuanjs/catawampus
refs/heads/master
tr/vendor/tornado/demos/appengine/blog.py
9
#!/usr/bin/env python # # Copyright 2009 Facebook # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
jumpstarter-io/nova
refs/heads/master
nova/tests/network/test_rpcapi.py
11
# Copyright 2013 Red Hat, 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 agre...
seanbell/opensurfaces
refs/heads/master
server/common/backends.py
1
import logging import urllib2 import urlparse from django.conf import settings from django.core.files.storage import Storage from django.core.files.base import ContentFile from django.core.exceptions import ImproperlyConfigured from django.utils.http import urlquote from django.core.cache import cache from storages.b...
LetSpotify/letspotify-server
refs/heads/master
urls.py
1
from handlers.facebook_login import FacebookGraphLoginHandler from handlers.facebook_login import FacebookGraphStatusHandler from handlers.rooms import RoomsCreateHandler from handlers.rooms import RoomsDeleteHandler from handlers.rooms import RoomsCheckHandler from handlers.rooms import RoomsPlayerSendHandler from han...
yunxliu/crosswalk-test-suite
refs/heads/master
webapi/tct-csp-w3c-tests/csp-py/csp_ro_media-src_none_video_blocked_ext.py
23
def main(request, response): import simplejson as json f = file('config.json') source = f.read() s = json.JSONDecoder().decode(source) url1 = "http://" + s['host'] + ":" + str(s['ports']['http'][1]) url2 = "http://" + s['host'] + ":" + str(s['ports']['http'][0]) _CSP = "media-src 'none'; scr...
CyanogenMod/htc-kernel-espresso
refs/heads/espresso-2.6.29
arch/ia64/scripts/unwcheck.py
916
#!/usr/bin/env python # # Usage: unwcheck.py FILE # # This script checks the unwind info of each function in file FILE # and verifies that the sum of the region-lengths matches the total # length of the function. # # Based on a shell/awk script originally written by Harish Patil, # which was converted to Perl by Matthe...
ryano144/intellij-community
refs/heads/master
python/testData/inspections/PyNoneFunctionAssignmentInspection/noType.py
83
__author__ = 'ktisha' def foo(x): return x b = foo()
jbzdak/edx-platform
refs/heads/master
lms/djangoapps/courseware/tests/tests.py
115
""" Test for LMS courseware app. """ from textwrap import dedent from unittest import TestCase from django.core.urlresolvers import reverse import mock from nose.plugins.attrib import attr from opaque_keys.edx.locations import SlashSeparatedCourseKey from courseware.tests.helpers import LoginEnrollmentTestCase from x...
sychen/rst2pdf
refs/heads/master
rst2pdf/tests/input/sphinx-issue168/conf.py
17
# -*- coding: utf-8 -*- # # Foobar documentation build configuration file, created by # sphinx-quickstart on Wed Nov 11 10:37:39 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 ...
MichaelNedzelsky/intellij-community
refs/heads/master
python/helpers/pydev/third_party/pep8/lib2to3/lib2to3/fixes/fix_set_literal.py
326
""" Optional fixer to transform set() calls to set literals. """ # Author: Benjamin Peterson from lib2to3 import fixer_base, pytree from lib2to3.fixer_util import token, syms class FixSetLiteral(fixer_base.BaseFix): BM_compatible = True explicit = True PATTERN = """power< 'set' trailer< '(' ...
andreif/django
refs/heads/master
tests/migrations/test_executor.py
80
from django.apps.registry import apps as global_apps from django.db import connection from django.db.migrations.exceptions import InvalidMigrationPlan from django.db.migrations.executor import MigrationExecutor from django.db.migrations.graph import MigrationGraph from django.db.migrations.recorder import MigrationReco...
neilLasrado/erpnext
refs/heads/develop
erpnext/patches/v9_0/student_admission_childtable_migrate.py
23
# Copyright (c) 2017, Frappe and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe def execute(): # 'Schools' module changed to the 'Education' # frappe.reload_doc('schools', 'doctype', 'Student Admission Program') # frappe.reload_doc('scho...
varunarya10/heat
refs/heads/master
heat/tests/test_plugin_loader.py
5
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # 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...
40223141/lego
refs/heads/master
static/Brython3.1.1-20150328-091302/Lib/site-packages/pygame/surface.py
603
from browser import document, html, window from javascript import console, JSConstructor from .rect import Rect #import pygame.rect canvas_ID=1 _canvas_id=None class Surface: def __init__(self, dim=[], depth=16, surf=None): if surf is None: self._depth=depth self._canvas=html.CANVAS(width=...
obi-two/Rebelion
refs/heads/master
data/scripts/templates/object/draft_schematic/clothing/shared_clothing_jewelry_necklace_10.py
2
#### NOTICE: THIS FILE IS AUTOGENERATED #### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY #### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES from swgpy.object import * def create(kernel): result = Intangible() result.template = "object/draft_schematic/clothing/shared_clothing_jewelry_necklace_10.iff" result.a...
adamchainz/ansible
refs/heads/devel
lib/ansible/module_utils/facts/network/dragonfly.py
232
# 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 in the hope that ...
mustafat/odoo-1
refs/heads/8.0
addons/l10n_eu_service/__init__.py
303
import wizard import models
cloud9UG/odoo
refs/heads/8.0
openerp/addons/base/module/__init__.py
462
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
Oxyselenide/phoebe
refs/heads/master
phoebe/phoebe_web/config/urls.py
1
"""phoebe_web URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.11/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class...
onceuponatimeforever/oh-mainline
refs/heads/master
mysite/profile/management/commands/profile_hourly_tasks.py
15
# This file is part of OpenHatch. # Copyright (C) 2010 OpenHatch, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later v...
pomegranited/edx-platform
refs/heads/master
openedx/core/djangoapps/course_groups/management/commands/tests/test_post_cohort_membership_fix.py
32
""" Test for the post-migration fix commands that are included with this djangoapp """ from django.core.management import call_command from django.test.client import RequestFactory from openedx.core.djangoapps.course_groups.views import cohort_handler from openedx.core.djangoapps.course_groups.cohorts import get_cohor...
klnprj/testapp
refs/heads/master
django/db/backends/mysql/base.py
40
""" MySQL database backend for Django. Requires MySQLdb: http://sourceforge.net/projects/mysql-python """ import datetime import re import sys import warnings try: import MySQLdb as Database except ImportError, e: from django.core.exceptions import ImproperlyConfigured raise ImproperlyConfigured("Error l...
pburdet/hyperspy
refs/heads/master
hyperspy/io_plugins/image.py
1
# -*- coding: utf-8 -*- # Copyright 2007-2011 The HyperSpy developers # # This file is part of HyperSpy. # # HyperSpy 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...
Neuroglycerin/neukrill-net-work
refs/heads/master
generate_hlf_testcache.py
1
#!/usr/bin/env python """ Generate a cache of all the """ from __future__ import division import neukrill_net.highlevelfeatures import neukrill_net.utils import copy import numpy as np from sklearn.externals import joblib # Define output path pkl_path1 = '/disk/data1/s1145806/cached_hlf_test_data_raw.pkl' pkl_path2 ...
AndroidOpenDevelopment/android_external_chromium_org
refs/heads/lp
third_party/npapi/npspy/analyze_streams.py
127
# A script for analyzing the output of NPSPY and merging data about streams. import sys def ReadFile(filename, flags='rb'): """Returns the contents of a file.""" file = open(filename, flags) result = file.read() file.close() return result def WriteFile(filename, contents): """Overwrites t...
Carmezim/tensorflow
refs/heads/master
tensorflow/python/training/optimizer_test.py
74
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
tximikel/kuma
refs/heads/master
vendor/packages/translate/tools/pretranslate.py
24
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2008 Zuza Software Foundation # # This file is part of translate. # # 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 o...
valkjsaaa/sl4a
refs/heads/master
python/src/Lib/distutils/tests/test_msvc9compiler.py
50
"""Tests for distutils.msvc9compiler.""" import sys import unittest from distutils.errors import DistutilsPlatformError class msvc9compilerTestCase(unittest.TestCase): def test_no_compiler(self): # makes sure query_vcvarsall throws # a DistutilsPlatformError if the compiler # is not found...
lsst-dm/great3-public
refs/heads/master
validation/test_offsets.py
2
# Copyright (c) 2014, the GREAT3 executive committee (http://www.great3challenge.info/?q=contacts) # All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, are permitted # provided that the following conditions are met: # # 1. Redistributions of source code must retain...
yottu/yottu
refs/heads/master
lib/BoardPad.py
1
''' Created on Sep 28, 2015 ''' import thread import time from Pad import Pad from ThreadFetcher import ThreadFetcher from PostReply import PostReply from TermImage import TermImage from Autism import Autism from Subtitle import Subtitle from RelayChat import RelayChat import re class BoardPad(Pad): ''' classdocs ...
plissonf/scikit-learn
refs/heads/master
sklearn/semi_supervised/tests/test_label_propagation.py
307
""" test the label propagation module """ import nose import numpy as np from sklearn.semi_supervised import label_propagation from numpy.testing import assert_array_almost_equal from numpy.testing import assert_array_equal ESTIMATORS = [ (label_propagation.LabelPropagation, {'kernel': 'rbf'}), (label_propa...
adityaatluri/Urutu
refs/heads/master
test/test_device_cu.py
2
from Urutu import * import numpy as np @Urutu("CU") def math(a, b, c, d, e, f): __shared is x , y x = a[0:100] y = b[0:100] def add(p,q): p = p + 1 return p+q c[tx] = add(x[tx],y[tx]) def sub(p,q): p[tx] = 2*p[tx] return p[tx] - q[tx] def saxpy(s,a,p,b,q): s[tx] = a*p[tx] + b*q[tx] d[tx] = sub(x...
cloudera/hue
refs/heads/master
desktop/core/ext-py/openpyxl-2.6.4/openpyxl/utils/inference.py
2
from __future__ import absolute_import # Copyright (c) 2010-2019 openpyxl """ Type inference functions """ import datetime import re from openpyxl.styles import numbers PERCENT_REGEX = re.compile(r'^(?P<number>\-?[0-9]*\.?[0-9]*\s?)\%$') TIME_REGEX = re.compile(r""" ^(?: # HH:MM and HH:MM:SS (?P<hour>[0-1]{0,1}[0-9]...
reinhrst/panda
refs/heads/master
usr/lib/python2.7/encodings/cp1256.py
593
""" Python Character Mapping Codec cp1256 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1256.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,in...
fert89/prueba-3-heroku-flask
refs/heads/master
fabfile.py
12
from fabric.api import * # start with the default server def run(): """ Start with the default server """ local('python runserver.py') # start with unicorn server. def grun(): """ Start with gunicorn server """ local('gunicorn -c gunicorn.conf runserver:app') # run tests def tests(): """ Run u...
halvertoluke/edx-platform
refs/heads/default_branch
common/lib/xmodule/xmodule/tests/test_utils_django.py
193
"""Tests for methods defined in util/django.py""" from xmodule.util.django import get_current_request, get_current_request_hostname from nose.tools import assert_is_none from unittest import TestCase class UtilDjangoTests(TestCase): """ Tests for methods exposed in util/django """ def test_get_current...
slightstone/SickRage
refs/heads/master
lib/chardet/big5freq.py
3132
######################## 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...
synasius/django
refs/heads/master
django/db/models/fields/related.py
8
from __future__ import unicode_literals import warnings from functools import partial from django import forms from django.apps import apps from django.core import checks, exceptions from django.db import connection, router from django.db.backends import utils from django.db.models.deletion import CASCADE, SET_DEFAUL...
jaimeMF/youtube-dl
refs/heads/master
youtube_dl/cache.py
179
from __future__ import unicode_literals import errno import io import json import os import re import shutil import traceback from .compat import compat_expanduser, compat_getenv from .utils import write_json_file class Cache(object): def __init__(self, ydl): self._ydl = ydl def _get_root_dir(self)...
lizardsystem/lizard-fewsjdbc
refs/heads/master
bootstrap.py
120
############################################################################## # # Copyright (c) 2006 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOF...
wcmckee/nikola
refs/heads/master
nikola/data/themes/base/messages/messages_eo.py
5
# -*- encoding:utf-8 -*- from __future__ import unicode_literals MESSAGES = { "%d min remaining to read": "%d minutoj por legi", "(active)": "(aktiva)", "Also available in:": "Ankaŭ disponebla en:", "Archive": "Arkivo", "Authors": "Aŭtoroj", "Categories": "Kategorioj", "Comments": "Komentoj...
mmottahedi/nilmtk
refs/heads/master
nilmtk/stats/tests/test_totalenergyresults.py
7
#!/usr/bin/python from __future__ import print_function, division import unittest from ..totalenergyresults import TotalEnergyResults from ... import TimeFrame class TestEnergyResults(unittest.TestCase): def test_append(self): er = TotalEnergyResults() tf = TimeFrame('2012-01-01','2012-01-02') ...
knoguchi/kenix-scm
refs/heads/master
server/lib/boto/emr/bootstrap_action.py
56
# Copyright (c) 2010 Spotify AB # Copyright (c) 2010 Yelp # # 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...
jburel/openmicroscopy
refs/heads/develop_merge_trigger
components/tools/OmeroWeb/omeroweb/webadmin/custom_forms.py
12
#!/usr/bin/env python # -*- coding: utf-8 -*- # # # # Copyright (c) 2008 University of Dundee. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at ...
af1rst/bite-project
refs/heads/master
deps/gdata-python-client/tests/gdata_tests/spreadsheets/data_test.py
23
#!/usr/bin/env python # # Copyright (C) 2009 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 ...
technicalpickles/zulip
refs/heads/master
zilencer/management/commands/profile_request.py
118
from __future__ import absolute_import from optparse import make_option from django.core.management.base import BaseCommand from zerver.models import get_user_profile_by_email, UserMessage from zerver.views.old_messages import get_old_messages_backend import cProfile import logging from zerver.middleware import LogReq...
sudheesh001/oh-mainline
refs/heads/master
vendor/packages/PyYaml/lib3/yaml/error.py
294
__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...
jteehan/cfme_tests
refs/heads/master
cfme/web_ui/timelines.py
2
from datetime import datetime from utils.appliance.implementations.ui import navigate_to NONE_GROUP = 'NONE' class Timelines(object): """ Represents Common UI Page for showing generated events of different Providers as a timeline. UI page contains several drop-down items which are doing filtering of disp...
sigma-random/linux
refs/heads/master
arch/ia64/scripts/unwcheck.py
13143
#!/usr/bin/python # # Usage: unwcheck.py FILE # # This script checks the unwind info of each function in file FILE # and verifies that the sum of the region-lengths matches the total # length of the function. # # Based on a shell/awk script originally written by Harish Patil, # which was converted to Perl by Matthew Ch...
stuliveshere/SimplePyRay
refs/heads/master
src/prac2/prac2/toolbox/toolbox.py
1
import numpy as np import matplotlib.pyplot as pylab from matplotlib.widgets import Slider #================================================== # decorators #================================================== def io(func): ''' an io decorator that allows inpu...
sidchilling/stripe-revenue-report
refs/heads/master
stripe_revenue/stripe_revenue.py
1
'''stripe_revenue: Python library to get the stripe revenue customer-wise ''' __version__ = '1.0' __author__ = 'Siddharth Saha (sidchilling@gmail.com)' import stripe import calendar class StripeRevenue(object): api_key = None start_date = None end_date = None def __init__(self, api_key, start_date,...
qnhoang81/Kernel_POC
refs/heads/master
arch/ia64/scripts/unwcheck.py
916
#!/usr/bin/env python # # Usage: unwcheck.py FILE # # This script checks the unwind info of each function in file FILE # and verifies that the sum of the region-lengths matches the total # length of the function. # # Based on a shell/awk script originally written by Harish Patil, # which was converted to Perl by Matthe...
luogangyi/bcec-nova
refs/heads/stable/icehouse
nova/tests/integrated/test_servers.py
15
# Copyright 2011 Justin Santa Barbara # 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...
emersonsoftware/ansiblefork
refs/heads/devel
lib/ansible/modules/cloud/softlayer/sl_vm.py
14
#!/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...
jeremiah-c-leary/vhdl-style-guide
refs/heads/master
vsg/vhdlFile/classify/use_clause.py
1
from vsg.token import use_clause as token from vsg.vhdlFile import utils def detect(iToken, lObjects): ''' use_clause ::= use selected_name { , selected_name } ; ''' if utils.is_next_token('use', iToken, lObjects): return classify(iToken, lObjects) return iToken def classify(iT...
jwodder/ghutil
refs/heads/master
src/ghutil/cli/milestone/open.py
1
import click from ghutil.types import Repository @click.command() @Repository.option('-R', '--repo', '--repository', 'repo', help='Repository to which the milestone belongs') @click.argument('milestone') def cli(repo, milestone): """ Open a milestone """ repo.milestone(milestone).patch(jso...
mtconley/turntable
refs/heads/master
test/lib/python2.7/site-packages/scipy/fftpack/basic.py
17
""" Discrete Fourier Transforms - basic.py """ # Created by Pearu Peterson, August,September 2002 from __future__ import division, print_function, absolute_import __all__ = ['fft','ifft','fftn','ifftn','rfft','irfft', 'fft2','ifft2'] from numpy import zeros, swapaxes import numpy from . import _fftpack im...
blueboxgroup/ansible-modules-core
refs/heads/devel
cloud/amazon/iam_cert.py
17
#!/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...
erickt/hue
refs/heads/master
desktop/core/ext-py/python-openid-2.2.5/openid/yadis/discover.py
143
# -*- test-case-name: openid.test.test_yadis_discover -*- __all__ = ['discover', 'DiscoveryResult', 'DiscoveryFailure'] from cStringIO import StringIO from openid import fetchers from openid.yadis.constants import \ YADIS_HEADER_NAME, YADIS_CONTENT_TYPE, YADIS_ACCEPT_HEADER from openid.yadis.parsehtml import Me...
TheRealJoeLinux/circlecli
refs/heads/master
mocks/circlecli.py
1
# -*- coding: utf-8 -*- """ Mocks for the CircleCLI API library tests. """ from httmock import response, urlmatch NETLOC = r'(.*\.)?[^.]+\.com$' HEADERS = {'content-type': 'application/json'} GET = 'get' DELETE = 'delete' class Resource: """ A CircleCli resource. :param path: The file path to the resourc...
eleonrk/SickRage
refs/heads/master
lib/feedparser/namespaces/cc.py
43
# Support for the Creative Commons licensing extensions # Copyright 2010-2015 Kurt McKee <contactme@kurtmckee.org> # Copyright 2002-2008 Mark Pilgrim # All rights reserved. # # This file is a part of feedparser. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provide...
hguemar/cinder
refs/heads/master
cinder/volume/flows/manager/manage_existing.py
5
# Copyright 2014 IBM Corp. # # 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...
kdaily/altanalyze
refs/heads/master
mpmath/calculus/optimization.py
2
from copy import copy from ..libmp.backend import xrange class OptimizationMethods(object): def __init__(ctx): pass ############## # 1D-SOLVERS # ############## class Newton: """ 1d-solver generating pairs of approximative root and error. Needs starting points x0 close to th...
matehackers/tg-matebot
refs/heads/master
plugins/greatful/semana.py
1
# vim:fileencoding=utf-8 ## Agenda hebdomadária import dataset, datetime, pytz, random, sqlite3 ## Acrescenta relatório do dia na agenda hebdomadária def hoje(args): # args['bot'].sendMessage( # args['chat_id'], # u"Hoje é um great dia!", # parse_mode = None, # reply_to_message_id = args['message_id'] # ...
Parisson/Telemeta
refs/heads/master
telemeta/forms/format.py
2
import django.forms as forms from django.forms import ModelForm from telemeta.models import * class FormatForm(ModelForm): class Meta: model = Format exclude = ('item',)
actzendaria/xgt
refs/heads/vgt
tools/perf/scripts/python/syscall-counts-by-pid.py
11180
# 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 system call totals, broken down by syscall. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os, sys sys.path.append(os.env...
pombredanne/rab
refs/heads/master
rab/rab.py
3
""" Usage: rab snapshot create PATH... rab snapshot delete PATH... rab snapshot <name> add PATH... rab snapshot <name> reconstruct <file> PATH rab blocks delete rab [options] <command>... [<args>...] Options: -h --help Show this help message and quit. --version Show version. """ impo...
chuckbutler/airtime-charm
refs/heads/master
lib/charmhelpers/contrib/templating/contexts.py
7
# Copyright 2013 Canonical Ltd. # # Authors: # Charm Helpers Developers <juju@lists.ubuntu.com> """A helper to create a yaml cache of config with namespaced relation data.""" import os import yaml import charmhelpers.core.hookenv charm_dir = os.environ.get('CHARM_DIR', '') def dict_keys_without_hyphens(a_dict): ...
teonlamont/mne-python
refs/heads/master
tutorials/plot_epoching_and_averaging.py
5
""" .. _tut_epoching_and_averaging: Epoching and averaging (ERP/ERF) ================================ """ import os.path as op import numpy as np import mne ############################################################################### # In MNE, `epochs` refers to a collection of `single trials` or short segments #...
RyanDJLee/pyta
refs/heads/master
nodes/Comprehension.py
1
""" Comprehension astroid node Constructs that allow sequences to be built from other sequences. Attributes: - target (Node) - Typically a name or tuple node; the reference to use for each element. - iter (Node) - The object to iterate over. - ifs (List[Expr]) - List of tes...
waybarrios/worldmap
refs/heads/master
wm_extra/migrations/0002_endpoint.py
4
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('wm_extra', '0001_initial'), ] op...
magos2/magOS
refs/heads/master
sec/audit-tomcat.py
2
#!/usr/bin/python3.5 # -*- coding: utf-8 -*- from lxml import etree import os # Tomcat 8 serverXml = './tomcat_server.xml' outHTML = 'tomcat_audit.html' def out (s): fout.write(s+"\n") return def header (): out('<!DOCTYPE html>') out('<html>') out('<head>') out('<title>Tomcat8 Audit</title>') out(''...
Distrotech/intellij-community
refs/heads/master
python/testData/formatter/newLineAfterColonMultiClause.py
83
try: pass finally: pass
40223108/w18
refs/heads/master
static/Brython3.1.0-20150301-090019/Lib/os.py
635
r"""OS routines for Mac, NT, or Posix depending on what system we're on. This exports: - all functions from posix, nt, os2, or ce, e.g. unlink, stat, etc. - os.path is either posixpath or ntpath - os.name is either 'posix', 'nt', 'os2' or 'ce'. - os.curdir is a string representing the current directory ('.' or...
chrisfranzen/django
refs/heads/master
docs/_ext/applyxrefs.py
132
"""Adds xref targets to the top of files.""" import sys import os testing = False DONT_TOUCH = ( './index.txt', ) def target_name(fn): if fn.endswith('.txt'): fn = fn[:-4] return '_' + fn.lstrip('./').replace('/', '-') def process_file(fn, lines): lines.insert(0, '\n') lines...
mohanprasath/Course-Work
refs/heads/master
data_analysis/uh_data_analysis_with_python/hy-data-analysis-with-python-spring-2020/part06-e07_binding_sites/tmc/__main__.py
91
from unittest import TestProgram from .runner import TMCTestRunner import sys if sys.argv.__len__() > 1 and sys.argv[1] == 'available_points': TMCTestRunner().available_points() sys.exit() main = TestProgram main(testRunner=TMCTestRunner, module=None, failfast=False, buffer=True)
cs-au-dk/Artemis
refs/heads/master
WebKit/Tools/Scripts/webkitpy/layout_tests/models/test_failures.py
1
#!/usr/bin/env python # Copyright (C) 2010 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list ...
oyisre/discordbottery
refs/heads/develop
cogs/voice.py
1
from discord.ext import commands import discord from gmusicapi import Mobileclient import os import asyncio import threading import urllib.request import youtube_dl import shutil from collections import deque gpmapi = Mobileclient(debug_logging=False) class UrlDownloader(threading.Thread): """ Represents a url t...
drmrd/ansible
refs/heads/devel
test/units/modules/network/f5/test_bigip_selfip.py
17
# -*- coding: utf-8 -*- # # Copyright (c) 2017 F5 Networks Inc. # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os import json import pytest import sys from nose.plugins.skip imp...
albertomurillo/ansible
refs/heads/devel
lib/ansible/modules/network/onyx/onyx_vxlan.py
37
#!/usr/bin/python # # 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 ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
pigeonflight/strider-plone
refs/heads/master
docker/appengine/lib/PyAMF-0.6.1/pyamf/tests/test_flex.py
26
# -*- coding: utf-8 -*- # # Copyright (c) The PyAMF Project. # See LICENSE.txt for details. """ Flex compatibility tests. @since: 0.1.0 """ import unittest import pyamf from pyamf import flex, util, amf3, amf0 from pyamf.tests.util import EncoderMixIn class ArrayCollectionTestCase(unittest.TestCase, EncoderMixIn)...
hackndev/linux-hnd
refs/heads/master
arch/ia64/scripts/unwcheck.py
916
#!/usr/bin/env python # # Usage: unwcheck.py FILE # # This script checks the unwind info of each function in file FILE # and verifies that the sum of the region-lengths matches the total # length of the function. # # Based on a shell/awk script originally written by Harish Patil, # which was converted to Perl by Matthe...
masteroncluster/py-censure
refs/heads/master
censure/lang/en/constants.py
1
# -*- coding: utf-8 -*- # based on the words from http://www.noswearing.com/dictionary/ from __future__ import unicode_literals EXCLUDES_DATA = { } EXCLUDES_CORE = { } # 'cum': '^cum(($)|(bubble)|(dumpster)|()|()', FOUL_DATA = { 'a': [ '^anus', '^axwound', ], 'b': [ '^bamp...
epssy/hue
refs/heads/master
apps/rdbms/src/rdbms/api.py
21
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
chrippa/ds4drv
refs/heads/master
ds4drv/__main__.py
1
import sys import signal from threading import Thread from .actions import ActionRegistry from .backends import BluetoothBackend, HidrawBackend from .config import load_options from .daemon import Daemon from .eventloop import EventLoop from .exceptions import BackendError class DS4Controller(object): def __ini...
pavpanchekha/typed.py
refs/heads/master
typed/specialize.py
1
import warnings DEBUG = False def debug_print(*args): if DEBUG: print "~>", " ".join(map(str, args)) return args[-1] class TypedError(TypeError): def __init__(self, text, fn, sigs): self.text = text self.fn = fn self.sigs = sigs def __str__(self): s = ["%s for functi...