repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
chrisfilda/edx_platform
refs/heads/master
lms/djangoapps/staticbook/tests.py
8
""" Test the lms/staticbook views. """ import textwrap import mock import requests from django.test.utils import override_settings from django.core.urlresolvers import reverse, NoReverseMatch from courseware.tests.modulestore_config import TEST_DATA_MIXED_MODULESTORE from student.tests.factories import UserFactory,...
takeflight/django
refs/heads/master
django/contrib/redirects/tests.py
112
from django import http from django.conf import settings from django.contrib.sites.models import Site from django.core.exceptions import ImproperlyConfigured from django.test import TestCase, modify_settings, override_settings from django.utils import six from .middleware import RedirectFallbackMiddleware from .models...
tedelhourani/ansible
refs/heads/devel
lib/ansible/modules/network/cloudengine/ce_config.py
27
#!/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 distribut...
ademilly/waterflow
refs/heads/master
waterflow/__init__.py
1
"""dataflow package provides a framework to build data analysis pipeline class: Flow -- main class for the dataflow package ; provides functionnal tools to transform a dataset and do machine learning with it """ from flow import Flow from ml import ML from source import Source from ._version impo...
jmcarbo/openerp8-addons
refs/heads/master
project_scrum/wizard/project_scrum_email.py
5
# -*- 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...
slisson/intellij-community
refs/heads/master
python/testData/inspections/PyArgumentListInspection/dictFromKeys.py
52
print(dict.fromkeys(<warning descr="Parameter 'seq' unfilled">)</warning>) print(dict.fromkeys(['foo', 'bar']))
fahrrad/pythonchallenge
refs/heads/master
2.py
1
from_a = 'abcdefghijklmnopqrstuvwxyz' to_a ='cdefghijklmnopqrstuvwxyzab' s = """g fmnc wms bgblr rpylqjyrc gr zw fylb. rfyrq ufyr amknsrcpq ypc dmp. bmgle gr gl zw fylb gq glcddgagclr ylb rfyr'q ufw rfgq rcvr gq qm jmle. sqgle qrpgle.kyicrpylq() gq pcamkkclbcb. lmu ynnjw ml rfc spj.""" d = str.maketrans(from_a, to_a)...
apocalypsebg/odoo
refs/heads/8.0
addons/l10n_ar/__openerp__.py
260
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011 Cubic ERP - Teradata SAC (<http://cubicerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the...
georgeriz/myFlaskBackend
refs/heads/master
lib/flask/config.py
781
# -*- coding: utf-8 -*- """ flask.config ~~~~~~~~~~~~ Implements the configuration related objects. :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import imp import os import errno from werkzeug.utils import import_string from ._compat import string_type...
clejeu03/EWP
refs/heads/master
view/sketchViewModule/SketchBoardView.py
1
#!/usr/bin/env python # -*- coding: utf-8 -*- from PySide import QtGui, QtCore from view.sketchViewModule.Track import Track from view.sketchViewModule.SketchList import SketchList class SketchBoardView (QtGui.QWidget): def __init__(self, app, sessionView): super(SketchBoardView, self).__init__() ...
Finntack/pootle
refs/heads/master
pootle/apps/pootle_app/project_tree.py
1
# -*- 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. import errno import logging import os import...
pedro2555/acars-api
refs/heads/master
run.py
1
#!/usr/bin/env python """ Aircraft Communications Addressing and Reporting System API for Flight Simulation Copyright (C) 2017 Pedro Rodrigues <prodrigues1990@gmail.com> This file is part of ACARS API. ACARS API is free software: you can redistribute it and/or modify it under the terms of the GNU General Pub...
davidchiles/openaddresses
refs/heads/master
scripts/no/make_out.py
45
#!/bin/python import os import unicodecsv as csv writer = csv.DictWriter(open('no.csv', 'w'), fieldnames=('X','Y','PUNKT','KOMM','OBJTYPE','GATENR','GATENAVN','HUSNR','BOKST','POSTNR','POSTNAVN','TRANSID')) writer.writeheader() for f in os.listdir('./csv'): print(f) with open('./csv/{}'.format(f)) as csvf...
srbhklkrn/SERVOENGINE
refs/heads/master
components/script/dom/bindings/codegen/parser/tests/test_any_null.py
276
def WebIDLTest(parser, harness): threw = False try: parser.parse(""" interface DoubleNull { attribute any? foo; }; """) results = parser.finish() except: threw = True harness.ok(threw, "Should have thrown.")
ahnqirage/spark
refs/heads/master
python/pyspark/__init__.py
21
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
gutouyu/cs231n
refs/heads/master
cs231n/assignment/assignment3/cs231n/im2col.py
53
import numpy as np def get_im2col_indices(x_shape, field_height, field_width, padding=1, stride=1): # First figure out what the size of the output should be N, C, H, W = x_shape assert (H + 2 * padding - field_height) % stride == 0 assert (W + 2 * padding - field_height) % stride == 0 out_height = (H + 2 * ...
hpcloud-mon/tempest
refs/heads/master
tempest/api/image/v1/test_image_members_negative.py
4
# Copyright 2013 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 t...
tsdmgz/ansible
refs/heads/devel
test/runner/test.py
1
#!/usr/bin/env python # PYTHON_ARGCOMPLETE_OK """Test runner for all Ansible tests.""" from __future__ import absolute_import, print_function import errno import os import sys from lib.util import ( ApplicationError, display, raw_command, find_pip, get_docker_completion, ) from lib.delegation im...
JPFrancoia/scikit-learn
refs/heads/master
sklearn/tests/test_multiclass.py
8
import numpy as np import scipy.sparse as sp from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_true from sklearn.utils.testing import assert_false from sklearn.utils.testing ...
tempbottle/mcrouter
refs/heads/master
mcrouter/test/test_empty_pool.py
13
# Copyright (c) 2015, Facebook, Inc. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. An additional grant # of patent rights can be found in the PATENTS file in the same directory. from __future__ import absolute_...
dushu1203/chromium.src
refs/heads/nw12
third_party/pexpect/screen.py
171
"""This implements a virtual screen. This is used to support ANSI terminal emulation. The screen representation and state is implemented in this class. Most of the methods are inspired by ANSI screen control codes. The ANSI class extends this class to add parsing of ANSI escape codes. PEXPECT LICENSE This license...
kimoonkim/spark
refs/heads/branch-2.1-kubernetes
python/pyspark/mllib/__init__.py
123
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
18514253911/directive-demo
refs/heads/master
node_modules/node-gyp/gyp/setup.py
2462
#!/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. from setuptools import setup setup( name='gyp', version='0.1', description='Generate Your Projects', author='Chromium Authors', a...
peick/docker-build
refs/heads/master
tests/raw/import_python_stdlib.py
1
import sys version = sys.version # reference to an existing docker image Image('test/bary')
darshn/sim_test
refs/heads/master
scripts/keyboard_base_alt.py
2
import time, sys, math import pygame import rospy, tf from geometry_msgs.msg import Twist, Pose, Quaternion from gazebo_msgs.msg import ModelStates from std_srvs.srv import Empty class BaseKeyboardController: def __init__(self): self.gui_init() self.rospy_init() rospy.loginfo(rospy.get_na...
sthenc/bss_tester
refs/heads/master
stari_kodovi/fft_test.py
1
#!/usr/bin/python import scipy import scipy.fftpack import pylab from scipy import pi t = scipy.linspace(0,120,4000) acc = lambda t: 10*scipy.cos(2*pi*10*t) #+ 5*scipy.sin(2*pi*8.0*t) #+ 2*scipy.random.random(len(t)) signal = acc(t) FFT = abs(scipy.fft(signal)) freqs = scipy.fftpack.fftfreq(signal.size, t[1]-t[0])...
odoousers2014/odoo
refs/heads/master
addons/account/wizard/account_report_partner_ledger.py
8
# -*- 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...
appleseedhq/cortex
refs/heads/master
python/IECoreMaya/FnOpHolder.py
5
########################################################################## # # Copyright (c) 2008-2011, Image Engine Design 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: # # * Redis...
agentxan/nzbToMedia
refs/heads/master
libs/jaraco/windows/api/environ.py
4
import ctypes.wintypes SetEnvironmentVariable = ctypes.windll.kernel32.SetEnvironmentVariableW SetEnvironmentVariable.restype = ctypes.wintypes.BOOL SetEnvironmentVariable.argtypes = [ctypes.wintypes.LPCWSTR]*2 GetEnvironmentVariable = ctypes.windll.kernel32.GetEnvironmentVariableW GetEnvironmentVariable.restype = ct...
xfumihiro/powerline
refs/heads/develop
powerline/matchers/vim/__init__.py
21
# vim:fileencoding=utf-8:noet from __future__ import (unicode_literals, division, absolute_import, print_function) import os from powerline.bindings.vim import vim_getbufoption, buffer_name def help(matcher_info): return str(vim_getbufoption(matcher_info, 'buftype')) == 'help' def cmdwin(matcher_info): name = b...
abdoosh00/edx-rtl-final
refs/heads/master
lms/djangoapps/shoppingcart/migrations/0002_auto__add_field_paidcourseregistration_mode.py
182
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'PaidCourseRegistration.mode' db.add_column('shoppingcart_paidcourseregistration', 'mode', ...
sivaprakashniet/push_pull
refs/heads/master
p2p/lib/python2.7/site-packages/django/contrib/auth/management/commands/createsuperuser.py
131
""" Management utility to create superusers. """ from __future__ import unicode_literals import getpass import sys from django.contrib.auth import get_user_model from django.contrib.auth.management import get_default_username from django.core import exceptions from django.core.management.base import BaseCommand, Comm...
maxmalysh/congenial-octo-adventure
refs/heads/master
report1/task1_compact.py
1
import numpy as np from typing import List from enum import Enum from scipy import sparse from random import randint class PivotMode(Enum): BY_ROW = 0 BY_COLUMN = 1 BY_MATRIX = 2 SPARSE = 3 def pivot_by_row(A: np.matrix, k: int, rp: List[float]): mat_size = A.shape[0] r_max_lead = k for...
ritchyteam/odoo
refs/heads/master
addons/document/wizard/__init__.py
444
# -*- 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...
Conjuror/fxos-certsuite
refs/heads/master
mcts/utils/handlers/__init__.py
25
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/.
zsoltdudas/lis-tempest
refs/heads/LIS
tempest/common/utils/windows/remote_client.py
2
#!/usr/bin/python # Copyright 2014 Cloudbase Solutions Srl # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-...
antepsis/anteplahmacun
refs/heads/master
sympy/deprecated/class_registry.py
26
from sympy.core.decorators import deprecated from sympy.core.core import BasicMeta, Registry, all_classes class ClassRegistry(Registry): """ Namespace for SymPy classes This is needed to avoid problems with cyclic imports. To get a SymPy class, use `C.<class_name>` e.g. `C.Rational`, `C.Add`. Fo...
starrify/scrapy
refs/heads/master
tests/CrawlerProcess/asyncio_enabled_reactor.py
7
import asyncio from twisted.internet import asyncioreactor asyncioreactor.install(asyncio.get_event_loop()) import scrapy from scrapy.crawler import CrawlerProcess class NoRequestsSpider(scrapy.Spider): name = 'no_request' def start_requests(self): return [] process = CrawlerProcess(settings={ ...
sdague/home-assistant
refs/heads/dev
homeassistant/components/daikin/climate.py
16
"""Support for the Daikin HVAC.""" import logging import voluptuous as vol from homeassistant.components.climate import PLATFORM_SCHEMA, ClimateEntity from homeassistant.components.climate.const import ( ATTR_FAN_MODE, ATTR_HVAC_MODE, ATTR_PRESET_MODE, ATTR_SWING_MODE, HVAC_MODE_COOL, HVAC_MOD...
111t8e/h2o-2
refs/heads/master
py/testdir_rpy2/test_expr_rpy2.py
8
import unittest, random, sys, time sys.path.extend(['.','..','../..','py']) import h2o, h2o_browse as h2b, h2o_exec as h2e, h2o_import as h2i, h2o_cmd, h2o_util import rpy2.robjects as robjects import h2o_eqns import math print "run some random expressions (using h2o_eqn.py) in exec and R and compare results (eventua...
kkozarev/mwacme
refs/heads/master
MS_Inspect_menu_version/RectSelect.py
1
########################################################################## ############################## RectSelect ############################### ########################################################################### import matplotlib matplotlib.use('TkAgg') import matplotlib.pyplot as plt import numpy as np...
chekunkov/scrapy
refs/heads/master
scrapy/utils/response.py
28
""" This module provides some useful functions for working with scrapy.http.Response objects """ import os import re import weakref import webbrowser import tempfile from twisted.web import http from twisted.web.http import RESPONSES from w3lib import html from scrapy.http import HtmlResponse, TextResponse from scra...
felix1m/knowledge-base
refs/heads/master
kb/factory.py
1
# -*- coding: utf-8 -*- """ kb.factory ~~~~~~~~~~~~~~~~ kb factory module """ import os from flask import Flask from flask_security import SQLAlchemyUserDatastore from .core import db, mail, security, api_manager from .helpers import register_blueprints from .middleware import HTTPMethodOverrideMiddlewa...
yezhangxiang/blokus
refs/heads/master
generate_tensor.py
1
import json import numpy as np import matplotlib.pyplot as plt import math import os import sys from utility import process_file_list, show_channels from multiway_tree import add_node, write_tree from matrix2tensor import matrix2tensor channel_size = 20 def json2tensor(json_file, chessman_dic, chessman_state_id, ou...
justintweaver/mtchi-cert-game
refs/heads/master
makahiki/apps/lib/django_cas/decorators.py
9
"""Replacement authentication decorators that work around redirection loops""" try: from functools import wraps except ImportError: from django.utils.functional import wraps from django.contrib.auth import REDIRECT_FIELD_NAME from django.http import HttpResponseForbidden, HttpResponseRedirect from django.util...
ioannistsanaktsidis/invenio
refs/heads/prod
modules/bibrank/lib/bibrankgkb.py
25
## -*- mode: python; coding: utf-8; -*- ## ## This file is part of Invenio. ## Copyright (C) 2007, 2008, 2010, 2011 CERN. ## ## Invenio 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...
JacobCallahan/CloudBot
refs/heads/master
plugins/eightball.py
35
import os import asyncio import codecs import random from cloudbot import hook from cloudbot.util import colors @hook.on_start() def load_responses(bot): path = os.path.join(bot.data_dir, "8ball_responses.txt") global responses with codecs.open(path, encoding="utf-8") as f: responses = [line.stri...
lkostler/AME60649_project_final
refs/heads/master
moltemplate/moltemplate/examples/coarse_grained_examples/protein_folding_examples/1bead+chaperone/frustrated+minichaperone/moltemplate_files/generate_tables/calc_chaperone_table.py
90
#!/usr/bin/env python # Calculate a table of pairwise energies and forces between atoms in the # protein and a chaperone provided in the supplemental materials section of: # AI Jewett, A Baumketner and J-E Shea, PNAS, 101 (36), 13192-13197, (2004) # This is stored in a tabulated force field with a singularity at a di...
CamelBackNotation/CarnotKE
refs/heads/master
jyhton/lib-python/2.7/test/test_distutils.py
139
"""Tests for distutils. The tests for distutils are defined in the distutils.tests package; the test_suite() function there returns a test suite that's ready to be run. """ from test import test_support import distutils.tests def test_main(): test_support.run_unittest(distutils.tests.test_suite()) test_supp...
e-gob/plataforma-kioscos-autoatencion
refs/heads/master
scripts/ansible-play/.venv/lib/python2.7/site-packages/ansible/modules/cloud/amazon/ec2.py
9
#!/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...
exelearning/iteexe
refs/heads/master
twisted/test/test_pbfailure.py
16
# Copyright (c) 2001-2004 Twisted Matrix Laboratories. # See LICENSE for details. from twisted.trial import unittest from twisted.spread import pb, flavors, jelly from twisted.internet import reactor, defer from twisted.python import log, failure ## # test exceptions ## class PoopError(Exception): pass class FailEr...
oswalpalash/remoteusermgmt
refs/heads/master
RUM/lib/python2.7/site-packages/pip/_vendor/packaging/utils.py
1126
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function import re _canonicalize_regex = re.compile(r"[-_.]+") def canonicalize...
alphafoobar/intellij-community
refs/heads/master
python/testData/codeInsight/controlflow/assertfalseargument.py
83
assert False, 'foo' print('unreachable 1') assert False, f() print('unreachable 2')
mahabs/nitro
refs/heads/master
nssrc/com/citrix/netscaler/nitro/resource/config/appflow/appflowpolicylabel_binding.py
1
# # Copyright (c) 2008-2015 Citrix Systems, 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 l...
inspyration/django-gluon
refs/heads/master
gluon/util/migrations/0001_initial.py
1
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django.utils.timezone from django.conf import settings import base.fields class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ...
XiaodunServerGroup/xiaodun-platform
refs/heads/master
lms/djangoapps/certificates/models.py
22
from django.contrib.auth.models import User from django.db import models from datetime import datetime from model_utils import Choices """ Certificates are created for a student and an offering of a course. When a certificate is generated, a unique ID is generated so that the certificate can be verified later. The ID...
joariasl/odoo
refs/heads/8.0
addons/base_geolocalize/models/res_partner.py
239
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013_Today OpenERP SA (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
atomicobject/kinetic-c
refs/heads/master
vendor/protobuf-2.5.0/python/setup.py
32
#! /usr/bin/python # # See README for usage instructions. import sys import os import subprocess # We must use setuptools, not distutils, because we need to use the # namespace_packages option for the "google" package. try: from setuptools import setup, Extension except ImportError: try: from ez_setup import u...
Tyler2004/pychess
refs/heads/master
lib/pychess/Variants/corner.py
20
from __future__ import print_function # Corner Chess import random from pychess.Utils.const import * from pychess.Utils.Board import Board class CornerBoard(Board): variant = CORNERCHESS def __init__ (self, setup=False, lboard=None): if setup is True: Board.__init__(self, setup=self.shuf...
johnsonc/OTM2
refs/heads/master
opentreemap/treemap/tests/ui/__init__.py
3
# -*- coding: utf-8 -*- from __future__ import print_function from __future__ import unicode_literals from __future__ import division import importlib from time import sleep from django.test import LiveServerTestCase from django.conf import settings from django.contrib.contenttypes.models import ContentType from reg...
jeenalee/servo
refs/heads/master
tests/wpt/web-platform-tests/tools/pytest/doc/en/example/assertion/test_setup_flow_example.py
217
def setup_module(module): module.TestStateFullThing.classcount = 0 class TestStateFullThing: def setup_class(cls): cls.classcount += 1 def teardown_class(cls): cls.classcount -= 1 def setup_method(self, method): self.id = eval(method.__name__[5:]) def test_42(self): ...
SpectreJan/gnuradio
refs/heads/master
gr-wxgui/python/wxgui/scopesink_gl.py
58
# # Copyright 2008,2010,2012 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 your option) # any later ve...
lmazuel/azure-sdk-for-python
refs/heads/master
azure-mgmt-datafactory/azure/mgmt/datafactory/models/cassandra_linked_service.py
1
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
komsas/OpenUpgrade
refs/heads/master
addons/mrp/report/workcenter_load.py
437
# -*- 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...
HiroIshikawa/21playground
refs/heads/master
visualizer/_app_boilerplate/venv/lib/python3.5/site-packages/requests/packages/chardet/mbcharsetprober.py
2923
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
Paczesiowa/youtube-dl
refs/heads/master
youtube_dl/extractor/ruhd.py
149
# -*- coding: utf-8 -*- from __future__ import unicode_literals from .common import InfoExtractor class RUHDIE(InfoExtractor): _VALID_URL = r'http://(?:www\.)?ruhd\.ru/play\.php\?vid=(?P<id>\d+)' _TEST = { 'url': 'http://www.ruhd.ru/play.php?vid=207', 'md5': 'd1a9ec4edf8598e3fbd92bb16072ba83'...
mscuthbert/abjad
refs/heads/master
abjad/tools/pitchtools/test/test_pitchtools_NamedPitch___copy__.py
2
# -*- encoding: utf-8 -*- import copy from abjad import * def test_pitchtools_NamedPitch___copy___01(): pitch = NamedPitch(13) new = copy.copy(pitch) assert new is not pitch assert new.accidental is not pitch.accidental
ajaxsys/dict-admin
refs/heads/master
docutils/languages/gl.py
149
# -*- coding: utf-8 -*- # Author: David Goodger # Contact: goodger@users.sourceforge.net # Revision: $Revision: 2224 $ # Date: $Date: 2004-06-05 21:40:46 +0200 (Sat, 05 Jun 2004) $ # Copyright: This module has been placed in the public domain. # New language mappings are welcome. Before doing a new translation, pleas...
zhangfangyan/devide
refs/heads/master
modules/vtk_basic/vtkSESAMEReader.py
7
# class generated by DeVIDE::createDeVIDEModuleFromVTKObject from module_kits.vtk_kit.mixins import SimpleVTKClassModuleBase import vtk class vtkSESAMEReader(SimpleVTKClassModuleBase): def __init__(self, module_manager): SimpleVTKClassModuleBase.__init__( self, module_manager, vtk.v...
Fireblend/chromium-crosswalk
refs/heads/master
testing/scripts/get_compile_targets.py
76
#!/usr/bin/env python # Copyright 2014 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 argparse import json import os import sys import common def main(argv): parser = argparse.ArgumentParser() parser.add_arg...
Cloud-Elasticity-Services/as-libcloud
refs/heads/trunk
docs/examples/loadbalancer/elb/create_load_balancer.py
51
from libcloud.loadbalancer.base import Member, Algorithm from libcloud.compute.types import Provider from libcloud.compute.providers import get_driver ACCESS_ID = 'your access id' SECRET_KEY = 'your secret key' cls = get_driver(Provider.ELB) driver = cls(key=ACCESS_ID, secret=SECRET_KEY) print(driver.list_balancers(...
TeamEOS/external_chromium_org
refs/heads/lp5.0
tools/telemetry/telemetry/value/__init__.py
9
# 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. """ The Value hierarchy provides a way of representing the values measurements produce such that they can be merged across runs, grouped by page, and output t...
MFoster/breeze
refs/heads/master
tests/regressiontests/admin_util/tests.py
44
from __future__ import absolute_import, unicode_literals from datetime import datetime from django.conf import settings from django.contrib import admin from django.contrib.admin import helpers from django.contrib.admin.util import (display_for_field, label_for_field, lookup_field, NestedObjects) from django.cont...
nzavagli/UnrealPy
refs/heads/master
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/django-1.8.2/tests/gis_tests/distapp/models.py
31
from django.contrib.gis.db import models from django.utils.encoding import python_2_unicode_compatible from ..utils import gisfield_may_be_null @python_2_unicode_compatible class NamedModel(models.Model): name = models.CharField(max_length=30) objects = models.GeoManager() class Meta: abstract ...
geekboxzone/lollipop_external_skia
refs/heads/geekbox
platform_tools/android/bin/gyp_to_android.py
66
#!/usr/bin/python # Copyright 2014 Google Inc. # # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Script for generating the Android framework's version of Skia from gyp files. """ import os import shutil import sys import tempfile # Find the top of trunk SCRI...
spartonia/django-oscar
refs/heads/master
src/oscar/apps/basket/middleware.py
15
from django.conf import settings from django.contrib import messages from django.core.signing import BadSignature, Signer from django.utils.functional import SimpleLazyObject, empty from django.utils.translation import ugettext_lazy as _ from oscar.core.loading import get_class, get_model Applicator = get_class('offe...
rajive/mongrel2
refs/heads/master
examples/mp3stream/handler.py
98
from mp3stream import ConnectState, Streamer from mongrel2 import handler import glob sender_id = "9703b4dd-227a-45c4-b7a1-ef62d97962b2" CONN = handler.Connection(sender_id, "tcp://127.0.0.1:9995", "tcp://127.0.0.1:9994") STREAM_NAME = "Mongrel2 Radio" MP3_FILES = glob.glob("*.mp3") pr...
barneyElDinosaurio/thefuck
refs/heads/master
tests/rules/test_python_execute.py
17
import pytest from thefuck.rules.python_execute import match, get_new_command from tests.utils import Command @pytest.mark.parametrize('command', [ Command(script='python foo'), Command(script='python bar')]) def test_match(command): assert match(command, None) @pytest.mark.parametrize('command, new_com...
Erethon/synnefo
refs/heads/develop
snf-astakos-app/astakos/scripts/snf_service_export.py
9
import os os.environ['DJANGO_SETTINGS_MODULE'] = 'synnefo.settings' import sys from optparse import OptionParser from synnefo.lib.services import fill_endpoints, filter_public from django.utils import simplejson as json astakos_services = { 'astakos_account': { 'type': 'account', 'component': 'ast...
praveenaki/zulip
refs/heads/master
zerver/management/commands/rename_stream.py
116
from __future__ import absolute_import from django.core.management.base import BaseCommand from zerver.lib.actions import do_rename_stream from zerver.models import Realm, get_realm import sys class Command(BaseCommand): help = """Change the stream name for a realm.""" def add_arguments(self, parser): ...
diblaze/TDP002
refs/heads/master
Old Exams/201508/Uppgift5.py
1
#! /usr/bin/env python3 import random import re if __name__ == "__main__": number = input("Mata in ett heltal: ") number = int(number) list_of_random_numbers = [format(random.randint(0, 59), "02") for x in range(number)] print(list_of_random_numbers) found = [] notDone = True while...
kang000feng/shadowsocks
refs/heads/master
utils/autoban.py
1033
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2015 clowwindy # # 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 u...
agancsos/python
refs/heads/master
team_in_Python.py
1
team={}; team[Lead]=\"t\"; team[SR Analyst]=\"Rob\"; team[SR Analyst]=\"Usha\"; team[SR Analyst]=\"Tom\"; for title,person in team.iteritems(): print person,\",\",title
Illinois-tech-ITM/BSMP-2016-ISCSI-Packet-Injection
refs/heads/master
Scapy/ip_forward.py
2
#!/etc/usr/python from scapy.all import * import sys iface = "eth0" filter = "ip" #victim in this case is the initiator VICTIM_IP = "192.168.1.190" #The IP of this Kali Virtualbox system MY_IP = "192.168.1.143" # gateway is the target TARGET_IP = "192.168.1.191" #VICTIM_MAC = "### This is the MAC of this Kali virtual...
ginabythebay/camlistore
refs/heads/master
lib/python/fusepy/low-level/llfuse_example.py
21
#!/usr/bin/env python ''' $Id: llfuse_example.py 46 2010-01-29 17:10:10Z nikratio $ Copyright (c) 2010, Nikolaus Rath <Nikolaus@rath.org> All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistrib...
tersmitten/ansible
refs/heads/devel
lib/ansible/plugins/action/async_status.py
54
# Copyright: (c) 2018, 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 from ansible.errors import AnsibleError from ansible.plugins.action import ActionBase from ansible...
zouyapeng/horizon
refs/heads/stable/juno
openstack_dashboard/dashboards/project/loadbalancers/views.py
10
# Copyright 2013, Big Switch Networks, 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 applic...
huwei/wechat-python-sdk
refs/heads/master
wechat_sdk/context/framework/django/backends/db.py
25
# -*- coding: utf-8 -*- from django.db import IntegrityError, transaction, router from django.utils import timezone from wechat_sdk.context.framework.django.backends.base import ContextBase, CreateError from wechat_sdk.context.framework.django.exceptions import SuspiciousOpenID class ContextStore(ContextBase): ...
mKeRix/home-assistant
refs/heads/dev
homeassistant/components/bbb_gpio/switch.py
7
"""Allows to configure a switch using BeagleBone Black GPIO.""" import logging import voluptuous as vol from homeassistant.components import bbb_gpio from homeassistant.components.switch import PLATFORM_SCHEMA from homeassistant.const import CONF_NAME, DEVICE_DEFAULT_NAME import homeassistant.helpers.config_validatio...
nghia-huynh/gem5-stable
refs/heads/master
src/mem/slicc/symbols/__init__.py
82
# Copyright (c) 2009 The Hewlett-Packard Development Company # 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...
wndias/bc.repository
refs/heads/master
script.module.youtube.dl/lib/youtube_dl/extractor/hotstar.py
28
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( ExtractorError, determine_ext, int_or_none, ) class HotStarIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?hotstar\.com/(?:.+?[/-])?(?P<id>\d{10})' _TESTS = [{ 'url': 'http...
aferr/LatticeMemCtl
refs/heads/master
ext/ply/test/lex_state4.py
174
# lex_state4.py # # Bad state declaration import sys if ".." not in sys.path: sys.path.insert(0,"..") import ply.lex as lex tokens = [ "PLUS", "MINUS", "NUMBER", ] states = (('comment', 'exclsive'),) t_PLUS = r'\+' t_MINUS = r'-' t_NUMBER = r'\d+' # Comments def t_comment(t): r'/\*' t.le...
ionux/p2pool
refs/heads/master
p2pool/bitcoin/getwork.py
267
''' Representation of a getwork request/reply ''' from __future__ import division from . import data as bitcoin_data from . import sha256 from p2pool.util import pack def _swap4(s): if len(s) % 4: raise ValueError() return ''.join(s[x:x+4][::-1] for x in xrange(0, len(s), 4)) class BlockAttempt(obje...
nimbis/django-shop
refs/heads/master
example/myshop/management/commands/fix_filer_bug_965.py
1
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.core.management.base import BaseCommand from filer.models.imagemodels import Image class Command(BaseCommand): help = "Fix https://github.com/divio/django-filer/issues/965" def handle(self, verbosity, *args, **options): for...
TeamEOS/external_chromium_org
refs/heads/lp5.0
tools/telemetry/telemetry/results/page_test_results_unittest.py
9
# Copyright 2014 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 from telemetry.results import base_test_results_unittest from telemetry.page import page_set from telemetry.results import page_test_results class...
aequitas/home-assistant
refs/heads/dev
homeassistant/components/fritzbox/sensor.py
7
"""Support for AVM Fritz!Box smarthome temperature sensor only devices.""" import logging import requests from homeassistant.const import TEMP_CELSIUS from homeassistant.helpers.entity import Entity from . import ( ATTR_STATE_DEVICE_LOCKED, ATTR_STATE_LOCKED, DOMAIN as FRITZBOX_DOMAIN) _LOGGER = logging.getLogg...
annahs/atmos_research
refs/heads/master
NC_plot_Dg_sigma_BCmassconc_DpDc_vs_altitude-fullcampaign.py
1
import sys import os import numpy as np from pprint import pprint from datetime import datetime from datetime import timedelta import mysql.connector import math import matplotlib.pyplot as plt import matplotlib.colors from matplotlib import dates from mpl_toolkits.basemap import Basemap import calendar from scipy.opti...
Programmica/python-gtk3-tutorial
refs/heads/master
_examples/cellrendererpixbuf.py
1
#!/usr/bin/env python3 import gi gi.require_version('Gtk', '3.0') from gi.repository import Gtk from gi.repository import GdkPixbuf class CellRendererPixbuf(Gtk.Window): def __init__(self): Gtk.Window.__init__(self) self.set_title("CellRendererPixbuf") self.connect("destroy", Gtk.main_quit...
aweinstock314/servo
refs/heads/master
tests/wpt/harness/wptrunner/__init__.py
1447
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/.
Winterflower/mdf
refs/heads/master
mdf/lab/progress.py
3
import sys import uuid from mdf.remote import messaging _fmt = "%Y-%m-%d %H:%M:%S" class ProgressBar(object): def __init__(self, start_date, end_date): # this is only approximate as it doesn't take weekends into account self.start_date = start_date self.num_days = (end_date - start_date)....