repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
C00kiie/Youtube-Mp3-telegram-bot
refs/heads/master
youtube_dl/extractor/screencast.py
44
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..compat import ( compat_parse_qs, compat_urllib_request, ) from ..utils import ( ExtractorError, ) class ScreencastIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?screencast\.com/t/(?P<id>[a-zA-Z0-9]+...
blablack/deteriorate-lv2
refs/heads/master
waflib/extras/cppcheck.py
49
#! /usr/bin/env python # -*- encoding: utf-8 -*- # Michel Mooij, michel.mooij7@gmail.com """ Tool Description ================ This module provides a waf wrapper (i.e. waftool) around the C/C++ source code checking tool 'cppcheck'. See http://cppcheck.sourceforge.net/ for more information on the cppcheck tool itself....
rgayon/l2tdevtools
refs/heads/master
l2tdevtools/dpkg_files.py
1
# -*- coding: utf-8 -*- """Dpkg build files generator.""" from __future__ import unicode_literals import logging import os import shutil import stat import time class DPKGBuildFilesGenerator(object): """Dpkg build files generator.""" _EMAIL_ADDRESS = ( 'log2timeline development team <log2timeline-dev@goo...
jaraco/pytest
refs/heads/master
testing/deprecated_test.py
8
import pytest def test_yield_tests_deprecation(testdir): testdir.makepyfile(""" def func1(arg, arg2): assert arg == arg2 def test_gen(): yield "m1", func1, 15, 3*5 yield "m2", func1, 42, 6*7 """) result = testdir.runpytest('-ra') result.stdout.fnmatc...
Mastermindzh/han4pi
refs/heads/master
python/games/pong/hoofdmenu.py
1
import pygame, sys def hoofdmenu(scherm, menu, lettertypeGrootte = 70, afstand = 1.4, fgcolor = (255,255,255), cursorkleur = (255,0,0)): x_pos=(scherm.scherm.get_width()/2)-(scherm.scherm.get_width()/3.2)#xpositie menu y_pos=(scherm.scherm.get_height()/2)-(len(menu)*32)#ypositie menu lett...
raycarnes/odoomrp-wip
refs/heads/8.0
product_packaging_through_attributes/models/product.py
25
# -*- coding: utf-8 -*- ############################################################################## # For copyright and license notices, see __openerp__.py file in root directory ############################################################################## from openerp import models, fields, api class ProductAtt...
deo1/deo1
refs/heads/master
KaggleTitanic/models/model_2017_09_17_16_09_41-0.9675.py
1
import numpy as np from sklearn.ensemble import RandomForestClassifier from sklearn.model_selection import train_test_split # NOTE: Make sure that the class is labeled 'class' in the data file tpot_data = np.recfromcsv('PATH/TO/DATA/FILE', delimiter='COLUMN_SEPARATOR', dtype=np.float64) features = np.delete(tpot_data...
ingenieroariel/pinax
refs/heads/master
projects/temp_group_project/apps/basic_groups/admin.py
1
from django.contrib import admin from basic_groups.models import BasicGroup class BasicGroupAdmin(admin.ModelAdmin): list_display = ('name', 'slug', 'creator', 'created', 'deleted') # @@@ assuming we keep deleted admin.site.register(BasicGroup, BasicGroupAdmin)
mexicancoin/MXNCore
refs/heads/master
share/qt/extract_strings_qt.py
1
#!/usr/bin/python ''' Extract _("...") strings for translation and convert to Qt4 stringdefs so that they can be picked up by Qt linguist. ''' from subprocess import Popen, PIPE import glob import operator import os import sys OUT_CPP="qt/mxnstrings.cpp" EMPTY=['""'] def parse_po(text): """ Parse 'po' format ...
rmcgibbo/numpy
refs/heads/master
numpy/distutils/command/build_py.py
264
from __future__ import division, absolute_import, print_function from distutils.command.build_py import build_py as old_build_py from numpy.distutils.misc_util import is_string class build_py(old_build_py): def run(self): build_src = self.get_finalized_command('build_src') if build_src.py_modules...
mccarrion/python-practice
refs/heads/master
crash_course/chapter18/learning_log/learning_log/urls.py
1
"""learning_log 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') Cla...
ominux/scikit-learn
refs/heads/master
examples/linear_model/plot_ols.py
2
""" ====================== Ordinary Least Squares ====================== Simple Ordinary Least Squares example, we draw the linear least squares solution for a random set of points in the plane. """ print __doc__ import numpy as np import pylab as pl from sklearn import linear_model # this is our test set, it's jus...
pschmitt/home-assistant
refs/heads/dev
homeassistant/components/yamaha_musiccast/media_player.py
7
"""Support for Yamaha MusicCast Receivers.""" import logging import socket import pymusiccast import voluptuous as vol from homeassistant.components.media_player import PLATFORM_SCHEMA, MediaPlayerEntity from homeassistant.components.media_player.const import ( MEDIA_TYPE_MUSIC, SUPPORT_NEXT_TRACK, SUPPOR...
feibaliang/blog
refs/heads/master
node_modules/pygmentize-bundled/vendor/pygments/build-3.3/pygments/formatters/terminal256.py
362
# -*- coding: utf-8 -*- """ pygments.formatters.terminal256 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Formatter for 256-color terminal output with ANSI sequences. RGB-to-XTERM color conversion routines adapted from xterm256-conv tool (http://frexx.de/xterm-256-notes/data/xterm256-conv2.tar.bz2) by Wolfg...
dyn888/youtube-dl
refs/heads/master
youtube_dl/extractor/footyroom.py
13
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor class FootyRoomIE(InfoExtractor): _VALID_URL = r'http://footyroom\.com/(?P<id>[^/]+)' _TESTS = [{ 'url': 'http://footyroom.com/schalke-04-0-2-real-madrid-2015-02/', 'info_dict': { 'id': 'scha...
neiudemo1/django
refs/heads/master
tests/check_framework/tests.py
116
# -*- coding: utf-8 -*- from __future__ import unicode_literals import sys from django.apps import apps from django.core import checks from django.core.checks import Error, Warning from django.core.checks.registry import CheckRegistry from django.core.management import call_command from django.core.management.base im...
kwlzn/pants
refs/heads/master
tests/python/pants_test/backend/jvm/subsystems/test_shader_integration.py
12
# coding=utf-8 # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import json import o...
ntu-dsi-dcn/ntu-dsi-dcn
refs/heads/master
waf-tools/boost.py
51
#!/usr/bin/env python # encoding: utf-8 # # partially based on boost.py written by Gernot Vormayr # written by Ruediger Sonderfeld <ruediger@c-plusplus.de>, 2008 # modified by Bjoern Michaelsen, 2008 # modified by Luca Fossati, 2008 # rewritten for waf 1.5.1, Thomas Nagy, 2008 # rewritten for waf 1.6.2, Sylvain...
johankaito/fufuka
refs/heads/master
microblog/flask/venv/lib/python2.7/site-packages/ws4py/__init__.py
5
# -*- coding: utf-8 -*- # # 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 following disclaimer. # * ...
andresgz/django
refs/heads/master
tests/i18n/patterns/urls/included.py
452
from django.conf.urls import url from django.views.generic import TemplateView view = TemplateView.as_view(template_name='dummy.html') urlpatterns = [ url(r'^foo/$', view, name='not-prefixed-included-url'), ]
geminateCoder/Character-Archive-Website
refs/heads/master
Lib/encodings/punycode.py
250
""" Codec for the Punicode encoding, as specified in RFC 3492 Written by Martin v. Löwis. """ import codecs ##################### Encoding ##################################### def segregate(str): """3.1 Basic code point segregation""" base = bytearray() extended = set() for c in str: if ord...
gsnbng/erpnext
refs/heads/develop
erpnext/selling/doctype/sms_center/sms_center.py
14
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe.utils import cstr from frappe import msgprint, _ from frappe.model.document import Document from frappe.core.doctype.sms_se...
FujitsuEnablingSoftwareTechnologyGmbH/tempest
refs/heads/monasca-tests
tempest/api/telemetry/base.py
3
# 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 # d...
kragniz/mypaint
refs/heads/master
lib/pixbufsurface.py
1
# This file is part of MyPaint. # Copyright (C) 2008 by Martin Renold <martinxyz@gmx.ch> # # 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) ...
weleen/mxnet
refs/heads/master
example/multi-task/example_multi_task.py
16
# 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...
joopert/home-assistant
refs/heads/dev
homeassistant/components/locative/__init__.py
2
"""Support for Locative.""" import logging from typing import Dict import voluptuous as vol from aiohttp import web import homeassistant.helpers.config_validation as cv from homeassistant.components.device_tracker import DOMAIN as DEVICE_TRACKER from homeassistant.const import ( HTTP_UNPROCESSABLE_ENTITY, ATT...
wxkdesky/phantomjs
refs/heads/master
src/breakpad/src/tools/gyp/test/generator-output/gyptest-subdir2-deep.py
151
#!/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 building a target from a .gyp file a few subdirectories deep when the --generator-output= option is used to put the build confi...
chrisfilda/edx_platform
refs/heads/master
common/lib/xmodule/xmodule/stringify.py
275
# -*- coding: utf-8 -*- from lxml import etree def stringify_children(node): ''' Return all contents of an xml tree, without the outside tags. e.g. if node is parse of "<html a="b" foo="bar">Hi <div>there <span>Bruce</span><b>!</b></div><html>" should return "Hi <div>there <span>Bruce...
sainthkh/morningglory
refs/heads/master
morningglory/blog/admin.py
13848
from django.contrib import admin # Register your models here.
praemdonck/micropython
refs/heads/master
tests/basics/fun_error.py
65
# test errors from bad function calls def test_exc(code, exc): try: exec(code) print("no exception") except exc: print("right exception") except: print("wrong exception") # function doesn't take keyword args test_exc("[].append(x=1)", TypeError) # function with variable nu...
openstack/watcher
refs/heads/master
watcher/decision_engine/datasources/grafana_translator/base.py
2
# -*- encoding: utf-8 -*- # Copyright (c) 2019 European Organization for Nuclear Research (CERN) # # Authors: Corne Lukken <info@dantalion.nl> # # 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 ...
edhuckle/statsmodels
refs/heads/master
docs/sphinxext/ipython_directive.py
30
# -*- coding: utf-8 -*- """Sphinx directive to support embedded IPython code. This directive allows pasting of entire interactive IPython sessions, prompts and all, and their code will actually get re-executed at doc build time, with all prompts renumbered sequentially. It also allows you to input code as a pure pytho...
innovativeappsolutions/borrowit
refs/heads/master
Code/borrowit/platforms/ios/www/lib/satellizer/examples/server/python/app.py
9
from datetime import datetime, timedelta import os import jwt import json import requests import base64 from functools import wraps from urlparse import parse_qs, parse_qsl from urllib import urlencode from flask import Flask, g, send_file, request, redirect, url_for, jsonify from flask.ext.sqlalchemy import SQLAlchemy...
djstein/vue-django-webpack
refs/heads/master
project/settings.py
1
""" Django settings for project project. Generated by 'django-admin startproject' using Django 1.10.5. 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 os...
IBCCW/mavlink
refs/heads/master
pymavlink/tools/mavloss.py
45
#!/usr/bin/env python ''' show MAVLink packet loss ''' import sys, time, os from argparse import ArgumentParser parser = ArgumentParser(description=__doc__) parser.add_argument("--no-timestamps", dest="notimestamps", action='store_true', help="Log doesn't have timestamps") parser.add_argument("--planner", action='st...
vmax-feihu/hue
refs/heads/master
desktop/core/ext-py/pycrypto-2.6.1/lib/Crypto/Random/Fortuna/FortunaGenerator.py
125
# -*- coding: ascii -*- # # FortunaGenerator.py : Fortuna's internal PRNG # # Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net> # # =================================================================== # The contents of this file are dedicated to the public domain. To # the extent that dedication to the publi...
Bysmyyr/chromium-crosswalk
refs/heads/master
tools/telemetry/third_party/gsutilz/third_party/boto/boto/ec2/networkinterface.py
150
# Copyright (c) 2011 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without ...
jonghyeopkim/p2pool
refs/heads/master
SOAPpy/WSDL.py
294
"""Parse web services description language to get SOAP methods. Rudimentary support.""" ident = '$Id: WSDL.py 1467 2008-05-16 23:32:51Z warnes $' from version import __version__ import wstools import xml from Errors import Error from Client import SOAPProxy, SOAPAddress from Config import Config import urllib class...
danlrobertson/servo
refs/heads/master
tests/wpt/web-platform-tests/tools/third_party/pytest/src/_pytest/helpconfig.py
32
""" version info, help messages, tracing configuration. """ from __future__ import absolute_import, division, print_function import py import pytest from _pytest.config import PrintHelp import os import sys from argparse import Action class HelpAction(Action): """This is an argparse Action that will raise an ex...
normanmaurer/autobahntestsuite-maven-plugin
refs/heads/master
src/main/resources/twisted/python/test/pullpipe.py
41
#!/usr/bin/python # -*- test-case-name: twisted.python.test.test_sendmsg -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. import sys, os from struct import unpack # This makes me sad. Why aren't things nice? sys.path.insert(0, __file__.rsplit('/', 4)[0]) from twisted.python.sendmsg import...
LeMaker/linux-sunxi
refs/heads/lemaker-3.4
tools/perf/scripts/python/check-perf-trace.py
11214
# perf script event handlers, generated by perf script -g python # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # This script tests basic functionality such as flag and symbol # strings, common_xxx() calls back into perf, begin, end, unhandled # events, etc. ...
srynot4sale/jarvis
refs/heads/master
functions/contact.py
1
import data.model import function import kernel.action class controller(function.function): def list(self): datasource = self.get_data_source() sql = """ SELECT * FROM function_contact_entities WHERE deleted IS NUL...
heracek/django-nonrel
refs/heads/master
tests/modeltests/model_formsets/models.py
89
import datetime from django.db import models class Author(models.Model): name = models.CharField(max_length=100) class Meta: ordering = ('name',) def __unicode__(self): return self.name class BetterAuthor(Author): write_speed = models.IntegerField() class Book(models.Model): aut...
nuwang/gvl_commandline_utilities
refs/heads/master
roles/gvl.commandline-utilities/templates/jupyterhub_config.py
3
# Configuration file for jupyterhub. #------------------------------------------------------------------------------ # Configurable configuration #------------------------------------------------------------------------------ #------------------------------------------------------------------------------ # JupyterHub...
ProjectSWGCore/NGECore2
refs/heads/master
scripts/object/tangible/lair/piket/lair_piket.py
85615
import sys def setup(core, object): return
drwyrm/Flexget
refs/heads/develop
flexget/api/core/user.py
2
from __future__ import unicode_literals, division, absolute_import from builtins import * # noqa pylint: disable=unused-import, redefined-builtin from flask import request, jsonify from flask_login import current_user from flexget.api import api, APIResource from flexget.api.app import BadRequest, base_message_schem...
anandpdoshi/erpnext
refs/heads/develop
erpnext/hr/doctype/salary_component/test_salary_component.py
39
# -*- coding: utf-8 -*- # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt from __future__ import unicode_literals import frappe import unittest # test_records = frappe.get_test_records('Salary Component') class TestSalaryComponent(unittest.TestCase): pass
jswope00/GAI
refs/heads/master
i18n/tests/test_generate.py
15
from datetime import datetime, timedelta import os import sys import string import random import re from unittest import TestCase from mock import patch from polib import pofile from pytz import UTC from i18n import extract from i18n import generate from i18n import dummy from i18n.config import CONFIGURATION class...
datenbetrieb/odoo
refs/heads/8.0
addons/fetchmail/fetchmail.py
167
# -*- 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...
itsjeyd/edx-platform
refs/heads/master
lms/djangoapps/lti_provider/tests/test_views.py
7
""" Tests for the LTI provider views """ from django.core.urlresolvers import reverse from django.test import TestCase from django.test.client import RequestFactory from mock import patch, MagicMock from nose.plugins.attrib import attr from courseware.testutils import RenderXBlockTestMixin from lti_provider import vi...
jhoos/django
refs/heads/master
tests/forms_tests/tests/test_widgets.py
29
# -*- coding: utf-8 -*- from __future__ import unicode_literals import copy import datetime from django.contrib.admin.tests import AdminSeleniumWebDriverTestCase from django.core.files.uploadedfile import SimpleUploadedFile from django.core.urlresolvers import reverse from django.forms import ( BooleanField, Char...
drnlm/sqlobject
refs/heads/master
sqlobject/tests/test_select_through.py
2
import pytest from sqlobject import ForeignKey, SQLMultipleJoin, SQLObject, SQLRelatedJoin, \ StringCol from sqlobject.tests.dbtest import inserts, setupClass # Tests retrieving objects through a join/fk on a selectResults class SRThrough1(SQLObject): three = ForeignKey('SRThrough3') twos = SQLMultipleJ...
jeffdwyatt/taiga-back
refs/heads/master
tests/integration/test_watch_userstories.py
7
# Copyright (C) 2015 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2015 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2015 David Barragán <bameda@dbarragan.com> # Copyright (C) 2015 Anler Hernández <hello@anler.me> # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
mgaitan/scipy
refs/heads/master
scipy/interpolate/ndgriddata.py
45
""" Convenience interface to N-D interpolation .. versionadded:: 0.9 """ from __future__ import division, print_function, absolute_import import numpy as np from .interpnd import LinearNDInterpolator, NDInterpolatorBase, \ CloughTocher2DInterpolator, _ndim_coords_from_arrays from scipy.spatial import cKDTree _...
blooparksystems/odoo
refs/heads/9.0
addons/mrp_operations/report/__init__.py
47
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import mrp_workorder_analysis
translate/pootle
refs/heads/master
pootle/i18n/dates.py
5
# -*- coding: utf-8 -*- # # Copyright (C) Pootle contributors. # # This file is a part of the Pootle project. It is distributed under the GPL3 # or later license. See the LICENSE file for a copy of the license and the # AUTHORS file for copyright and authorship information. from datetime import datetime from django.c...
ar7z1/ansible
refs/heads/devel
test/units/modules/network/nxos/test_nxos_bgp_neighbor_af.py
68
# (c) 2016 Red Hat Inc. # # 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 dis...
FeiZhan/Algo-Collection
refs/heads/master
answers/leetcode/Remove Duplicates from Sorted List/Remove Duplicates from Sorted List.py
1
# Definition for singly-linked list. # class ListNode(object): # def __init__(self, x): # self.val = x # self.next = None class Solution(object): def deleteDuplicates(self, head): """ :type head: ListNode :rtype: ListNode """ if None == head or None == h...
henrywoo/qblog
refs/heads/master
blogapp/urls.py
1
from django.conf.urls import include, url from . import views from django.views.generic.dates import ArchiveIndexView from blogapp.views import ArticleMonthArchiveView from .models import Post urlpatterns = [ url(r'^$', views.index), url(r'^about$', views.about), url(r'^blog$', views.post_list), url(r'...
suutari-ai/shoop
refs/heads/master
shuup/core/taxing/_price.py
3
# This file is part of Shuup. # # Copyright (c) 2012-2017, Shoop Commerce Ltd. All rights reserved. # # This source code is licensed under the OSL-3.0 license found in the # LICENSE file in the root directory of this source tree. from shuup.core.pricing import TaxfulPrice, TaxlessPrice class TaxedPrice(object): "...
jules185/IoT_Hackathon
refs/heads/master
.homeassistant/deps/aiohttp/http_exceptions.py
7
"""Low-level http related exceptions.""" __all__ = ('HttpProcessingError',) class HttpProcessingError(Exception): """HTTP error. Shortcut for raising HTTP errors with custom code, message and headers. :param int code: HTTP Error code. :param str message: (optional) Error message. :param list of...
dezynetechnologies/odoo
refs/heads/8.0
addons/event/__init__.py
350
# -*- 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...
moodpulse/l2
refs/heads/develop
api/plans/urls.py
1
from django.urls import path from . import views urlpatterns = [ path('plan-operations-save', views.plan_operations_save), path('get-plan-operations-by-patient', views.get_plan_operations_by_patient), path('get-plan-by-params', views.get_plan_operations_by_params), path('departments-can-operate', view...
wdurhamh/statsmodels
refs/heads/master
statsmodels/sandbox/examples/try_quantile_regression1.py
33
'''Example to illustrate Quantile Regression Author: Josef Perktold polynomial regression with systematic deviations above ''' import numpy as np from statsmodels.compat.python import zip from scipy import stats import statsmodels.api as sm from statsmodels.regression.quantile_regression import QuantReg sige = 0....
atsao72/sympy
refs/heads/master
sympy/assumptions/ask_generated.py
64
""" The contents of this file are the return value of ``sympy.assumptions.ask.compute_known_facts``. Do NOT manually edit this file. Instead, run ./bin/ask_update.py. """ from sympy.core.cache import cacheit from sympy.logic.boolalg import And, Not, Or from sympy.assumptions.ask import Q # -{ Known facts in Conjunct...
80vul/pyspider
refs/heads/master
tests/test_scheduler.py
3
#!/usr/bin/env python # -*- encoding: utf-8 -*- # vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8: # Author: Binux<i@binux.me> # http://binux.me # Created on 2014-02-08 22:37:13 import os import time import shutil import unittest2 as unittest import logging import logging.config logging.config.fileConfig("pyspid...
twz915/django
refs/heads/master
tests/logging_tests/urls.py
56
from django.conf.urls import url from . import views urlpatterns = [ url(r'^innocent/$', views.innocent), url(r'^suspicious/$', views.suspicious), url(r'^suspicious_spec/$', views.suspicious_spec), ]
alphafoobar/intellij-community
refs/heads/master
python/testData/inspections/PyUnresolvedReferencesInspection/attributesOfGenerics.py
83
class B(object): def __init__(self, x): """ :type x: T :rtype: B of T """ self._x = x def foo(self): """ :rtype: T """ return self._x class C(B): def bar(self): expr = self.foo() return expr.upper() #pass
Sharpie/python-kitchensink
refs/heads/master
ks/__init__.py
1
# -*- coding: utf-8 -*- """ ks ~~ Top-level KitchenSink module. :copyright: (c) 2012 -- by Charlie Sharpsteen :license: MIT """
t-hey/QGIS-Original
refs/heads/master
tests/src/python/test_qgsatlascomposition.py
4
# -*- coding: utf-8 -*- ''' test_qgsatlascomposition.py -------------------------------------- Date : Oct 2012 Copyright : (C) 2012 by Dr. Hugo Mercier email : hugo dot mercier at oslandia dot com **************...
ryansb/boto
refs/heads/master
boto/directconnect/__init__.py
145
# Copyright (c) 2013 Amazon.com, Inc. or its affiliates. # All Rights Reserved # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights...
AuyaJackie/odoo
refs/heads/8.0
addons/base_gengo/res_company.py
321
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms o...
idbedead/RNA-sequence-tools
refs/heads/master
hd5_subsample.py
2
import collections import matplotlib import matplotlib.pyplot as plt import numpy as np import pandas as pd import scipy.sparse as sp_sparse import tables np.random.seed(0) GeneBCMatrix = collections.namedtuple('GeneBCMatrix', ['gene_ids', 'gene_names', 'barcodes', 'matrix']) def get_matrix_from_h5(filename, genome...
andybrnr/QuantEcon.py
refs/heads/master
quantecon/tests/test_quadsum.py
7
""" Filename: test_tauchen.py Authors: Chase Coleman Date: 07/24/2014 Tests for quadsums.py file """ import sys import os import unittest import numpy as np from numpy.testing import assert_allclose from quantecon.quadsums import var_quadratic_sum, m_quadratic_sum def test_var_simplesum(): beta = .95 A = 1....
kenshay/ImageScript
refs/heads/master
ProgramData/SystemFiles/Python/Lib/site-packages/qtconsole/call_tip_widget.py
10
# Standard library imports import re from unicodedata import category # System library imports from qtconsole.qt import QtCore, QtGui class CallTipWidget(QtGui.QLabel): """ Shows call tips by parsing the current text of Q[Plain]TextEdit. """ #-------------------------------------------------------------...
Akanoa/swift
refs/heads/master
test/functional/swift_test_client.py
5
# Copyright (c) 2010-2012 OpenStack Foundation # # 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 agree...
thalamus/Flexget
refs/heads/develop
flexget/plugins/operate/disable.py
16
from __future__ import unicode_literals, division, absolute_import import logging from flexget import plugin from flexget.event import event from flexget.config_schema import one_or_more log = logging.getLogger('disable') def all_builtins(): """Helper function to return an iterator over all builtin plugins.""" ...
noironetworks/networking-cisco
refs/heads/master
networking_cisco/tests/unit/cisco/device_manager/test_db_device_manager.py
2
# Copyright 2014 Cisco Systems, Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
takeshineshiro/glance
refs/heads/master
setup.py
225
# Copyright (c) 2013 Hewlett-Packard Development Company, L.P. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
codecollision/DropboxToFlickr
refs/heads/master
django/contrib/webdesign/tests.py
379
# -*- coding: utf-8 -*- import unittest from django.contrib.webdesign.lorem_ipsum import * from django.template import loader, Context class WebdesignTest(unittest.TestCase): def test_words(self): self.assertEqual(words(7), u'lorem ipsum dolor sit amet consectetur adipisicing') def test_paragraphs...
Tigerwhit4/taiga-back
refs/heads/master
tests/integration/resources_permissions/test_tasks_custom_attributes_resource.py
20
# Copyright (C) 2015 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2015 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2015 David Barragán <bameda@dbarragan.com> # 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 F...
teepark/junction
refs/heads/master
examples/echo/client.py
1
#!/usr/bin/env python # vim: fileencoding=utf8:et:sta:ai:sw=4:ts=4:sts=4 import sys import traceback import greenhouse import junction HOST = "127.0.0.1" PORT = 12345 RELAY_ADDR = (HOST, 9100) SERVICE_ADDR = (HOST, 9000) SERVICE = 1 greenhouse.global_exception_handler(traceback.print_exception) def main(): ...
SiLab-Bonn/basil
refs/heads/master
tests/test_SimI2c.py
1
# # ------------------------------------------------------------ # Copyright (c) All rights reserved # SiLab, Institute of Physics, University of Bonn # ------------------------------------------------------------ # import unittest import os from basil.dut import Dut from basil.utils.sim.utils import cocotb_compile_a...
pwns4cash/vivisect
refs/heads/master
vtrace/util.py
24
# Copyright (C) 2007 Invisigoth - See LICENSE file for details import vtrace import vtrace.notifiers as v_notifiers import vtrace.rmi as v_rmi class TraceManager: """ A trace-manager is a utility class to extend from when you may be dealing with multiple tracer objects. It allows for persistant mode sett...
8u1a/plaso
refs/heads/master
tests/parsers/sqlite_plugins/mac_document_versions.py
3
#!/usr/bin/python # -*- coding: utf-8 -*- """Tests for the Mac OS X Document Versions plugin.""" import unittest # pylint: disable=unused-import from plaso.formatters import mac_document_versions as mac_doc_rev_formatter from plaso.lib import eventdata from plaso.lib import timelib from plaso.parsers.sqlite_plugins i...
ssssam/rdflib
refs/heads/master
test/test_slice.py
8
from rdflib import Graph, URIRef import unittest class GraphSlice(unittest.TestCase): def testSlice(self): """ We pervert the slice object, and use start, stop, step as subject, predicate, object all operations return generators over full triples """ sl=lamb...
tremblerz/breach-detection-system
refs/heads/master
dashboard/dashboard/urls.py
1
"""dashboard URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.10/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-...
nirmeshk/oh-mainline
refs/heads/master
vendor/packages/Django/django/contrib/comments/urls.py
382
from django.conf.urls import patterns, url urlpatterns = patterns('django.contrib.comments.views', url(r'^post/$', 'comments.post_comment', name='comments-post-comment'), url(r'^posted/$', 'comments.comment_done', name='comments-comment-done'), url(r'^flag/(\d+)/$', 'moderati...
kashia5555/qualitybots
refs/heads/master
src/appengine/models/bots_user.py
26
#!/usr/bin/python2.4 # # Copyright 2011 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required...
CivilHub/CivilHub
refs/heads/master
locations/migrations/0004_auto_20150707_1112.py
1
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations def create_default_background_file(apps, schema_editor): LocationBackgroundFile = apps.get_model("locations", "LocationBackgroundFile") background = LocationBackgroundFile.objects.create(name='default') ...
GaetanCambier/CouchPotatoServer
refs/heads/develop
couchpotato/core/downloaders/nzbget.py
15
from base64 import standard_b64encode from datetime import timedelta import re import shutil import socket import traceback import xmlrpclib from couchpotato.core._base.downloader.main import DownloaderBase, ReleaseDownloadList from couchpotato.core.helpers.encoding import ss, sp from couchpotato.core.helpers.variable...
iulian787/spack
refs/heads/develop
var/spack/repos/builtin/packages/ceres-solver/package.py
5
# 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 CeresSolver(CMakePackage): """Ceres Solver is an open source C++ library for modeling and ...
lmokto/magicmethods
refs/heads/master
__call__/example1.py
1
#http://stackoverflow.com/questions/5824881/python-call-special-method-practical-example ''' # output 0! = 1 1! = 1 2! = 2 3! = 6 4! = 24 5! = 120 6! = 720 7! = 5040 8! = 40320 9! = 362880 ''' class Factorial: def __init__(self): self.cache = {} def __call__(self, n): if n not in self.cache:...
msegado/edx-platform
refs/heads/master
lms/djangoapps/course_api/blocks/urls.py
69
""" Course Block API URLs """ from django.conf import settings from django.conf.urls import patterns, url from .views import BlocksView, BlocksInCourseView urlpatterns = patterns( '', # This endpoint requires the usage_key for the starting block. url( r'^v1/blocks/{}'.format(settings.USAGE_KEY_PAT...
School-of-Innovation-Experiment/InnovationManagement
refs/heads/master
registration/forms.py
2
# -*- coding: UTF-8 -*- ''' Created on 2012-11-10 @author: tianwei ''' #Forms and validation code for user registration. import uuid from django import forms from django.utils.translation import ugettext_lazy as _ from django.contrib.auth.models import User from registration.models import RegistrationProfile attrs_d...
Kronuz/django-sentry
refs/heads/master
sentry/migrations/0034_auto__add_groupbookmark__add_unique_groupbookmark_project_user_group.py
7
# 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 model 'GroupBookmark' db.create_table('sentry_groupbookmark', ( ('id', self.gf('djang...
sssemil/cjdns
refs/heads/socket
node_build/dependencies/libuv/build/gyp/pylib/gyp/mac_tool.py
1569
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Utility functions to perform Xcode-style build steps. These functions are executed via gyp-mac-tool when using the Makefile generator. ""...
sigmavirus24/pip
refs/heads/master
pip/_vendor/requests/packages/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...
SnakeJenny/TensorFlow
refs/heads/master
tensorflow/python/framework/errors_impl.py
59
# 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...
tumbl3w33d/ansible
refs/heads/devel
test/units/modules/network/fortios/test_fortios_wireless_controller_wtp.py
20
# Copyright 2019 Fortinet, Inc. # # 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 program is distributed in the...