repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
shinpeimuraoka/ryu
refs/heads/master
ryu/lib/ofctl_v1_5.py
5
# Copyright (C) 2016 Nippon Telegraph and Telephone Corporation. # # 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 applicab...
kosgroup/odoo
refs/heads/10.0
addons/website_hr_recruitment/__manifest__.py
22
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. { 'name': 'Online Jobs', 'category': 'Website', 'version': '1.0', 'summary': 'Job Descriptions And Application Forms', 'description': """ Odoo Contact Form ==================== """, 'depe...
waseem18/oh-mainline
refs/heads/master
vendor/packages/south/south/tests/non_managed/models.py
148
# -*- coding: UTF-8 -*- """ An app with a model that is not managed for testing that South does not try to manage it in any way """ from django.db import models class Legacy(models.Model): name = models.CharField(max_length=10) size = models.IntegerField() class Meta: db_table = "legacy_...
community-ssu/telepathy-gabble
refs/heads/master
tests/twisted/muc/send-error.py
1
""" Test incoming error messages in MUC channels. """ import dbus from gabbletest import exec_test from servicetest import EventPattern import constants as cs import ns from mucutil import join_muc_and_check def test(q, bus, conn, stream): conn.Connect() q.expect('dbus-signal', signal='StatusChanged', ...
popoffka/ponydraw
refs/heads/master
server/server.py
1
#!/usr/bin/python # -*- coding: utf-8 -*- # © 2012 Aleksejs Popovs <me@popoffka.ru> # Licensed under MIT License. See ../LICENSE for more info. import sys, json import config import argparse, os from twisted.internet import reactor from twisted.python import log from autobahn.websocket import WebSocketServerFactory, W...
mPowering/django-orb
refs/heads/master
docs/settings.py
1
# Django settings for docs project. # import source code dir import os import sys sys.path.insert(0, os.getcwd()) sys.path.insert(0, os.path.join(os.getcwd(), os.pardir)) SITE_ID = 303 DEBUG = True TEMPLATE_DEBUG = DEBUG SECRET_KEY = "foobar" DATABASES = {"default": { "NAME": ":memory:", "ENGINE": "django.db....
yuwei0927/python
refs/heads/master
读写文件练习.py
1
f=open('record.txt') boy=[] girl=[] count=1 for each_line in f: if each_line[:6] != '======': (role, line_spoken) = each_line.split(':',1) if role == '小甲鱼': boy.append(line_spoken) if role == '小客服': girl.append(line_spoken) else: file_name_boy = 'boy_' +...
takeflight/django
refs/heads/master
django/template/loaders/locmem.py
5
""" Wrapper for loading templates from a plain Python dict. """ from django.template.base import TemplateDoesNotExist from .base import Loader as BaseLoader class Loader(BaseLoader): is_usable = True def __init__(self, templates_dict): self.templates_dict = templates_dict def load_template_sou...
liucode/tempest-master
refs/heads/master
tools/colorizer.py
42
#!/usr/bin/env python # Copyright (c) 2013, Nebula, Inc. # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file exc...
mkaluza/external_chromium_org
refs/heads/kk44
third_party/markupsafe/_compat.py
390
# -*- coding: utf-8 -*- """ markupsafe._compat ~~~~~~~~~~~~~~~~~~ Compatibility module for different Python versions. :copyright: (c) 2013 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import sys PY2 = sys.version_info[0] == 2 if not PY2: text_type = str string_type...
korrosivesec/crits
refs/heads/master
crits/signatures/handlers.py
3
import datetime import hashlib import json import HTMLParser from django.core.urlresolvers import reverse from django.http import HttpResponse from django.shortcuts import render_to_response from django.template import RequestContext from mongoengine.base import ValidationError from crits.core.crits_mongoengine impor...
liyun074/gooDay
refs/heads/master
node_modules/node-gyp/gyp/pylib/gyp/common_test.py
2542
#!/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. """Unit tests for the common.py file.""" import gyp.common import unittest import sys class TestTopologicallySorted(unittest.TestCase): ...
bowlofstew/changes
refs/heads/master
tests/changes/api/serializer/models/test_logchunk.py
3
from datetime import datetime from uuid import UUID from changes.api.serializer import serialize from changes.models import LogSource, LogChunk def test_simple(): logchunk = LogChunk( id=UUID(hex='33846695b2774b29a71795a009e8168a'), source_id=UUID(hex='0b61b8a47ec844918d372d5741187b1c'), ...
KyleJamesWalker/ansible
refs/heads/devel
lib/ansible/modules/cloud/centurylink/clc_modify_server.py
70
#!/usr/bin/python # # Copyright (c) 2015 CenturyLink # # 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 la...
potassco/clingo
refs/heads/master
examples/clingo/controller-threads/controller.py
1
#!/usr/bin/env python import os import readline import atexit import signal from clingo import Control, Function, Number from threading import Thread, Condition class Connection: def __init__(self): self.condition = Condition() self.messages = [] def receive(self, timeout=None): self....
dhermes/google-cloud-python
refs/heads/master
spanner/tests/system/test_system.py
2
# Copyright 2016 Google LLC 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 applicable law or ag...
Endika/django
refs/heads/master
tests/auth_tests/urls.py
80
from django.conf.urls import url from django.contrib import admin from django.contrib.auth import views from django.contrib.auth.decorators import login_required from django.contrib.auth.forms import AuthenticationForm from django.contrib.auth.urls import urlpatterns as auth_urlpatterns from django.contrib.messages.api...
heeraj123/oh-mainline
refs/heads/master
vendor/packages/scrapy/scrapy/http/response/text.py
16
""" This module implements the TextResponse class which adds encoding handling and discovering (through HTTP headers) to base Response class. See documentation in docs/topics/request-response.rst """ import re import codecs from scrapy.http.response.dammit import UnicodeDammit from scrapy.http.response import Respons...
Jayflux/servo
refs/heads/master
tests/wpt/web-platform-tests/tools/html5lib/html5lib/html5parser.py
423
from __future__ import absolute_import, division, unicode_literals from six import with_metaclass import types from . import inputstream from . import tokenizer from . import treebuilders from .treebuilders._base import Marker from . import utils from . import constants from .constants import spaceCharacters, ascii...
midma101/m0du1ar
refs/heads/master
.venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/langhebrewmodel.py
2762
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Simon Montagu # Portions created by the Initial Developer are Copyright (C) 2005 # the Initial Developer. All Rights Reserved...
ohsu-computational-biology/server
refs/heads/g2p-2.5
ez_setup.py
30
#!/usr/bin/env python """Bootstrap setuptools installation To use setuptools in your package's setup.py, include this file in the same directory and add this to the top of your setup.py:: from ez_setup import use_setuptools use_setuptools() To require a specific version of setuptools, set a download mirror, ...
Shiroy/servo
refs/heads/master
components/script/dom/bindings/codegen/parser/tests/test_array_of_interface.py
158
import WebIDL def WebIDLTest(parser, harness): parser.parse(""" interface A { attribute long a; }; interface B { attribute A[] b; }; """); parser.finish()
t794104/ansible
refs/heads/devel
lib/ansible/modules/network/netscaler/netscaler_ssl_certkey.py
31
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2017 Citrix Systems # 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', ...
dymkowsk/mantid
refs/heads/master
scripts/test/ReductionSettingsTest.py
3
import unittest from mantid.simpleapi import * from reduction_settings import * class BasicSettingsObjectUsageTest(unittest.TestCase): def setUp(self): self.settings = get_settings_object("BasicSettingsObjectUsageTest") def tearDown(self): for prop_man_name in PropertyManagerDataService.getObj...
lkostler/AME60649_project_final
refs/heads/master
moltemplate/moltemplate/src/remove_duplicates_nbody.py
30
#!/usr/bin/env python """ Get rid of lines containing duplicate bonded nbody interactions in the corresponding section of a LAMMPS data file (such as bonds, angles, dihedrals and impropers). Duplicate lines which occur later are preserved and the earlier lines are erased. (This program reads from sys....
hejq0310/git-repo
refs/heads/master
error.py
48
# # Copyright (C) 2008 The Android Open Source Project # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
jgabriellima/self_organization_map
refs/heads/master
som.py
1
""" Self Organizing maps neural networks. """ import random import math class Map(object): #Class Constructor #@param dimensions: Number of input dimensions #@param length: Length of the output grid #@param filePath: The file path with the input data. def __init__(self,dimensi...
ylando2/pysol-with-easy-gaps
refs/heads/master
pysollib/games/ultra/tarock.py
2
#!/usr/bin/env python # -*- mode: python; coding: utf-8; -*- ##---------------------------------------------------------------------------## ## ## Copyright (C) 1998-2003 Markus Franz Xaver Johannes Oberhumer ## Copyright (C) 2003 Mt. Hood Playing Card Co. ## Copyright (C) 2005-2009 Skomoroh ## ## This program is free ...
HackLinux/goblin-core
refs/heads/master
llvm/3.4.2/llvm-3.4.2.src/test/CodeGen/SystemZ/Large/branch-range-03.py
10
# Test 32-bit COMPARE AND BRANCH in cases where the sheer number of # instructions causes some branches to be out of range. # RUN: python %s | llc -mtriple=s390x-linux-gnu | FileCheck %s # Construct: # # before0: # conditional branch to after0 # ... # beforeN: # conditional branch to after0 # main: # 0xffcc by...
TheoRettisch/p2pool-giarcoin
refs/heads/master
p2pool/web.py
47
from __future__ import division import errno import json import os import sys import time import traceback from twisted.internet import defer, reactor from twisted.python import log from twisted.web import resource, static import p2pool from bitcoin import data as bitcoin_data from . import data as p2pool_data, p2p ...
IPMITMO/statan
refs/heads/master
coala-bears/tests/verilog/VerilogLintBearTest.py
24
from bears.verilog.VerilogLintBear import VerilogLintBear from coalib.testing.LocalBearTestHelper import verify_local_bear good_file = """ module mux2to1 (w0, w1, s, f); input w0, w1, s; output f; assign f = s ? w1 : w0; endmodule """ bad_file = """ module updowncount(R, Clock, L, E, up_down, Q); parameter n...
xindus40223115/2015cd_midterm
refs/heads/master
static/Brython3.1.0-20150301-090019/Lib/webbrowser.py
735
from browser import window __all__ = ["Error", "open", "open_new", "open_new_tab"] class Error(Exception): pass _target = { 0: '', 1: '_blank', 2: '_new' } # hack... def open(url, new=0, autoraise=True): """ new window or tab is not controllable on the client side. autoraise not available. ""...
lancezlin/pyjs
refs/heads/master
pyjs/lib/getopt.py
8
# -*- coding: iso-8859-1 -*- """Parser for command line options. This module helps scripts to parse the command line arguments in sys.argv. It supports the same conventions as the Unix getopt() function (including the special meanings of arguments of the form `-' and `--'). Long options similar to those supported by...
michaelpacer/scikit-image
refs/heads/master
skimage/viewer/utils/dialogs.py
37
import os from ..qt import QtGui __all__ = ['open_file_dialog', 'save_file_dialog'] def _format_filename(filename): if isinstance(filename, tuple): # Handle discrepancy between PyQt4 and PySide APIs. filename = filename[0] if len(filename) == 0: return None return str(filename) ...
DinoCow/airflow
refs/heads/master
airflow/providers/apache/hive/example_dags/example_twitter_dag.py
7
# # 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...
cstipkovic/spidermonkey-research
refs/heads/master
js/src/tests/lib/tasks_win.py
4
# 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/. */ from __future__ import print_function, unicode_literals, division import subprocess import sys from datetime import d...
hivesolutions/appier
refs/heads/master
src/appier/test/typesf.py
1
#!/usr/bin/python # -*- coding: utf-8 -*- # Hive Appier Framework # Copyright (c) 2008-2021 Hive Solutions Lda. # # This file is part of Hive Appier Framework. # # Hive Appier Framework is free software: you can redistribute it and/or modify # it under the terms of the Apache License as published by the Apach...
hsiaoyi0504/scikit-learn
refs/heads/master
sklearn/externals/joblib/_memory_helpers.py
303
try: # Available in Python 3 from tokenize import open as open_py_source except ImportError: # Copied from python3 tokenize from codecs import lookup, BOM_UTF8 import re from io import TextIOWrapper, open cookie_re = re.compile("coding[:=]\s*([-\w.]+)") def _get_normal_name(orig_enc): ...
alubbe/FrameworkBenchmarks
refs/heads/master
toolset/setup/linux/setup_util.py
40
import re import os import sys import subprocess import platform from threading import Thread from Queue import Queue, Empty class NonBlockingStreamReader: ''' Enables calling readline in a non-blocking manner with a blocking stream, such as the ones returned from subprocess.Popen Originally written by Eyal...
slipcon/gitlint
refs/heads/master
qa/base.py
2
import os from datetime import datetime from uuid import uuid4 from unittest2 import TestCase from sh import git, rm, touch # pylint: disable=no-name-in-module class BaseTestCase(TestCase): # In case of assert failures, print the full error message maxDiff = None tmp_git_repo = None @classmethod ...
xuegang/gpdb
refs/heads/master
src/test/tinc/tincrepo/mpp/gpdb/tests/storage/pg_twophase/commit_drop_tests/post_sql/test_postsqls.py
63
""" Copyright (C) 2004-2015 Pivotal Software, Inc. All rights reserved. This program and the accompanying materials are made available under the terms of the 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 ...
RubenKelevra/rethinkdb
refs/heads/next
external/v8_3.30.33.16/build/gyp/test/mac/gyptest-strip-default.py
232
#!/usr/bin/env python # Copyright (c) 2013 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 that the default STRIP_STYLEs match between different generators. """ import TestGyp import re import subprocess import sys i...
Lynx187/script.module.urlresolver
refs/heads/master
lib/urlresolver/plugins/realdebrid.py
3
""" urlresolver XBMC Addon Copyright (C) 2013 t0mm0, JUL1EN094, bstrdsmkr 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...
JARR-aggregator/JARR
refs/heads/master
newspipe/bootstrap.py
1
#! /usr/bin/env python # -*- coding: utf-8 - # required imports and code execution for basic functionning import calendar import logging import os from flask import Flask, request from flask_migrate import Migrate from flask_talisman import Talisman from flask_babel import Babel, format_datetime from flask_sqlalchem...
jjmleiro/hue
refs/heads/master
desktop/core/ext-py/guppy-0.1.10/guppy/etc/xterm.py
37
#._cv_part xterm # Run an xterm on current process or a forked process # Adapted from pty.py in Python 1.5.2 distribution. # The pty.fork() couldnt be used because it didn't return # the pty name needed by xterm # I couldnt import pty.py to use master_open because it didn't find termios. import os, sys, FCNTL # We...
dnjohnstone/hyperspy
refs/heads/RELEASE_next_minor
hyperspy/learn/mva.py
1
# -*- coding: utf-8 -*- # Copyright 2007-2020 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...
pcchenxi/baseline
refs/heads/master
baselines/common/cg.py
10
import numpy as np def cg(f_Ax, b, cg_iters=10, callback=None, verbose=False, residual_tol=1e-10): """ Demmel p 312 """ p = b.copy() r = b.copy() x = np.zeros_like(b) rdotr = r.dot(r) fmtstr = "%10i %10.3g %10.3g" titlestr = "%10s %10s %10s" if verbose: print(titlestr % ("iter...
ekiwi/tinyos-1.x
refs/heads/master
contrib/ucb/apps/Monstro/lib/Robot/Util.py
2
import os, re, time, Config def findMotes() : comList = [] moteList = os.popen("motelist").readlines() if len(moteList) > 2 : moteList = moteList[2:] for moteDesc in moteList : if Config.PLATFORM == "win32" : results = re.search( "COM(?P<comNum>\d+)\s+Telos"...
zhjunlang/kbengine
refs/heads/master
kbe/src/lib/python/Lib/unittest/main.py
84
"""Unittest main program""" import sys import argparse import os from . import loader, runner from .signals import installHandler __unittest = True MAIN_EXAMPLES = """\ Examples: %(prog)s test_module - run tests from test_module %(prog)s module.TestClass - run tests from module.TestClass ...
plotly/python-api
refs/heads/master
packages/python/plotly/plotly/validators/scattergeo/hoverlabel/_bgcolorsrc.py
1
import _plotly_utils.basevalidators class BgcolorsrcValidator(_plotly_utils.basevalidators.SrcValidator): def __init__( self, plotly_name="bgcolorsrc", parent_name="scattergeo.hoverlabel", **kwargs ): super(BgcolorsrcValidator, self).__init__( plotly_name=plotly_name, p...
reyha/zulip
refs/heads/master
zilencer/management/commands/create_deployment.py
1
from __future__ import absolute_import from __future__ import print_function from optparse import make_option import sys from typing import Any from django.core.management.base import BaseCommand, CommandParser from zerver.models import get_realm_by_string_id from zerver.lib.create_user import random_api_key from ze...
BaladiDogGames/baladidoggames.github.io
refs/heads/master
mingw/bin/lib/code.py
256
"""Utilities needed to emulate Python's interactive interpreter. """ # Inspired by similar code by Jeff Epler and Fredrik Lundh. import sys import traceback from codeop import CommandCompiler, compile_command __all__ = ["InteractiveInterpreter", "InteractiveConsole", "interact", "compile_command"] def ...
scieloorg/elixir
refs/heads/master
elixir/utils.py
1
from io import StringIO, BytesIO from zipfile import ZipFile import codecs import logging class WrapFiles(object): def __init__(self, *args): self.memory_zip = BytesIO() self.thezip = ZipFile(self.memory_zip, 'a') if len(args) > 0: self.append(*args) def append(self, *arg...
ttyangf/pdfium_gyp
refs/heads/master
test/home_dot_gyp/gyptest-home-includes-config-env.py
260
#!/usr/bin/env python # Copyright (c) 2013 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 inclusion of $HOME/.gyp_new/include.gypi works when GYP_CONFIG_DIR is set. """ import os import TestGyp test = TestGyp.TestGy...
festovalros/Examine_odoo8_accounting
refs/heads/master
account/project/report/__init__.py
427
# -*- 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...
sjbog/ajenti
refs/heads/master
ajenti/utils/PrioList.py
17
# encoding: utf-8 # # Copyright (C) 2006-2010 Dmitry Zamaruev (dmitry.zamaruev@gmail.com) from UserList import UserList class PrioList(UserList): def __init__(self, max_priority=100): super(PrioList, self).__init__() self.prio = [] self._max = max_priority self._def = max_priorit...
Chasego/codirit
refs/heads/master
leetcode/418-Sentence-Screen-Fitting/SentenceScreenFitting_001.py
5
class Solution(object): def wordsTyping(self, sentence, rows, cols): """ :type sentence: List[str] :type rows: int :type cols: int :rtype: int """ cnt = 0 start = 0 row_circ = len(''.join(sentence)) + len(sentence) nrc = (cols + 1) / ro...
feliperfranca/django-nonrel-example
refs/heads/master
django/utils/dates.py
488
"Commonly-used date structures" from django.utils.translation import ugettext_lazy as _, pgettext_lazy WEEKDAYS = { 0:_('Monday'), 1:_('Tuesday'), 2:_('Wednesday'), 3:_('Thursday'), 4:_('Friday'), 5:_('Saturday'), 6:_('Sunday') } WEEKDAYS_ABBR = { 0:_('Mon'), 1:_('Tue'), 2:_('Wed'), 3:_('Thu'), 4:_('Fri')...
yaroslavprogrammer/django
refs/heads/master
django/db/models/fields/__init__.py
28
from __future__ import unicode_literals import copy import datetime import decimal import math import warnings from base64 import b64decode, b64encode from itertools import tee from django.db import connection from django.db.models.loading import get_model from django.db.models.query_utils import QueryWrapper from dj...
40223139/2015cdaa5-12
refs/heads/master
static/Brython3.1.1-20150328-091302/Lib/this.py
948
s = """Gur Mra bs Clguba, ol Gvz Crgref Ornhgvshy vf orggre guna htyl. Rkcyvpvg vf orggre guna vzcyvpvg. Fvzcyr vf orggre guna pbzcyrk. Pbzcyrk vf orggre guna pbzcyvpngrq. Syng vf orggre guna arfgrq. Fcnefr vf orggre guna qrafr. Ernqnovyvgl pbhagf. Fcrpvny pnfrf nera'g fcrpvny rabhtu gb oernx gur ehyrf. Nygubhtu cenpg...
cogmission/nupic
refs/heads/master
external/linux32/lib/python2.6/site-packages/matplotlib/projections/geo.py
69
import math import numpy as np import numpy.ma as ma import matplotlib rcParams = matplotlib.rcParams from matplotlib.artist import kwdocd from matplotlib.axes import Axes from matplotlib import cbook from matplotlib.patches import Circle from matplotlib.path import Path from matplotlib.ticker import Formatter, Locat...
leeseuljeong/leeseulstack_neutron
refs/heads/master
neutron/tests/unit/oneconvergence/test_nvsdlib.py
8
# Copyright 2014 OneConvergence, 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...
biviosoftware/macutil
refs/heads/master
tests/test_rename.py
1
import macutil.dropbox_photos_rename import os import subprocess import time import datetime _tmp = os.path.join(os.environ['PWD'], 'tmp') subprocess.call(['rm', '-rf', _tmp]) os.mkdir(_tmp) _dropbox = os.path.join(_tmp, 'Dropbox') os.mkdir(_dropbox) _photos = os.path.join(_dropbox, 'Photos') os.mkdir(_photos) _camera...
HonzaKral/django
refs/heads/master
tests/admin_autodiscover/tests.py
526
from unittest import TestCase from django.contrib import admin class AdminAutoDiscoverTests(TestCase): """ Test for bug #8245 - don't raise an AlreadyRegistered exception when using autodiscover() and an admin.py module contains an error. """ def test_double_call_autodiscover(self): # The...
pkoutsias/SickRage
refs/heads/master
sickbeard/helpers.py
1
# coding=utf-8 # Author: Nic Wolfe <nic@wolfeden.ca> # URL: https://sickrage.github.io # Git: https://github.com/SickRage/SickRage.git # # This file is part of SickRage. # # SickRage 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...
jbedorf/tensorflow
refs/heads/master
tensorflow/python/autograph/converters/lists.py
30
# 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...
2014c2g2/teamwork
refs/heads/master
wsgi/programs/c2g15/__init__.py
5
import cherrypy # 這是 C2G15 類別的定義 class C2G15(object): # 各組利用 index 引導隨後的程式執行 @cherrypy.expose def index(self, *args, **kwargs): outstring = ''' 這是 2014C2 協同專案下的 c2g15 分組程式開發網頁, 以下為 W12 的任務執行內容.<br /> <!-- 這裡採用相對連結, 而非網址的絕對連結 (這一段為 html 註解) --> <a href="fillpoly">c2g15 fillpoly 繪圖</a><br /> <a href=...
wdv4758h/ZipPy
refs/heads/master
lib-python/3/test/crashers/nasty_eq_vs_dict.py
63
# from http://mail.python.org/pipermail/python-dev/2001-June/015239.html # if you keep changing a dictionary while looking up a key, you can # provoke an infinite recursion in C # At the time neither Tim nor Michael could be bothered to think of a # way to fix it. class Yuck: def __init__(self): self.i =...
edry/edx-platform
refs/heads/master
common/djangoapps/student/migrations/0019_create_approved_demographic_fields_fall_2012.py
188
# -*- 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): # Deleting field 'UserProfile.occupation' db.delete_column('auth_userprofile', 'occupation') # Dele...
JioCloud/contrail-controller
refs/heads/master
src/config/common/vnc_type_conv.py
22
# # Copyright (c) 2013 Juniper Networks, Inc. All rights reserved. # import sys import re import types from types import * import vnc_api_service # dictionary representation to XML representation def dict_to_elem(wrap_tag, obj_dict): xml_str = "<%s>" % (wrap_tag) for fname in obj_dict: if isinstance(...
Timmenem/micropython
refs/heads/master
tests/unicode/unicode_pos.py
116
# str methods with explicit start/end pos print("Привет".startswith("П")) print("Привет".startswith("р", 1)) print("абвба".find("а", 1)) print("абвба".find("а", 1, -1))
vsol75/suricata
refs/heads/master
scripts/suricatasc/setup.py
18
#!/usr/bin/env python from distutils.core import setup SURICATASC_VERSION = "0.9" setup(name='suricatasc', version=SURICATASC_VERSION, description='Suricata unix socket client', author='Eric Leblond', author_email='eric@regit.org', url='https://www.suricata-ids.org/', scripts=['sur...
meefik/tinykernel-flo
refs/heads/tiny-jb-mr2
tools/perf/python/twatch.py
7370
#! /usr/bin/python # -*- python -*- # -*- coding: utf-8 -*- # twatch - Experimental use of the perf python interface # Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com> # # This application is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License...
fchu/hadoop-0.20.205
refs/heads/master
contrib/hod/hodlib/Hod/nodePool.py
182
#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 use thi...
meduz/NeuroTools
refs/heads/master
src/plotting.py
1
""" NeuroTools.plotting =================== This module contains a collection of tools for plotting and image processing that shall facilitate the generation and handling of NeuroTools data visualizations. It utilizes the Matplotlib and the Python Imaging Library (PIL) packages. Classes ------- SimpleMultiplot ...
svanschalkwyk/datafari
refs/heads/master
windows/python/Lib/test/test_future.py
137
# Test various flavors of legal and illegal future statements import unittest from test import test_support import re rx = re.compile('\((\S+).py, line (\d+)') def get_error_location(msg): mo = rx.search(str(msg)) return mo.group(1, 2) class FutureTest(unittest.TestCase): def test_future1(self): ...
Android-AOSP/external_skia
refs/heads/master
tools/roll_deps.py
68
#!/usr/bin/python2 # Copyright 2014 Google Inc. # # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Skia's Chromium DEPS roll script. This script: - searches through the last N Skia git commits to find out the hash that is associated with the SVN revision numb...
TakeshiTseng/ryu
refs/heads/master
ryu/ofproto/ofproto_v1_5_parser.py
5
# Copyright (C) 2012, 2013, 2014 Nippon Telegraph and Telephone Corporation. # Copyright (C) 2012, 2013 Isaku Yamahata <yamahata at valinux co jp> # # 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...
pratikmallya/pyrax
refs/heads/master
tests/unit/test_manager.py
12
#!/usr/bin/env python # -*- coding: utf-8 -*- import random import unittest from mock import MagicMock as Mock import pyrax.exceptions as exc from pyrax import manager import pyrax.utils as utils from pyrax import fakes fake_url = "http://example.com" class ManagerTest(unittest.TestCase): def __init__(self, ...
brijeshkesariya/odoo
refs/heads/8.0
addons/point_of_sale/wizard/pos_discount.py
382
# -*- 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...
bgris/ODL_bgris
refs/heads/master
lib/python3.5/site-packages/mpl_toolkits/mplot3d/__init__.py
21
from __future__ import (absolute_import, division, print_function, unicode_literals) import six from .axes3d import Axes3D
hfegetude/PresentacionEquiposElectronicos
refs/heads/master
node_modules/node-gyp/gyp/pylib/gyp/simple_copy.py
1869
# Copyright 2014 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. """A clone of the default copy.deepcopy that doesn't handle cyclic structures or complex types except for dicts and lists. This is because gyp copies so large structur...
mkheirkhah/mptcp
refs/heads/development
src/visualizer/visualizer/hud.py
189
import goocanvas import core import math import pango import gtk class Axes(object): def __init__(self, viz): self.viz = viz self.color = 0x8080C0FF self.hlines = goocanvas.Path(parent=viz.canvas.get_root_item(), stroke_color_rgba=self.color) self.hlines.lower(None) self.vl...
zero-rp/miniblink49
refs/heads/master
third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/__init__.py
6014
# Required for Python to search this directory for module files
faust64/ansible
refs/heads/devel
lib/ansible/modules/network/avi/avi_pkiprofile.py
8
#!/usr/bin/python # # Created on Aug 25, 2016 # @author: Gaurav Rastogi (grastogi@avinetworks.com) # Eric Anderson (eanderson@avinetworks.com) # module_check: supported # Avi Version: 16.3.8 # # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the te...
thiagopnts/servo
refs/heads/master
components/script/dom/bindings/codegen/pythonpath.py
131
# 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/. """ Run a python script, adding extra directories to the python path. """ def main(args): def usage(): pri...
tcchenbtx/project-zeta-J
refs/heads/master
code/tsa_s4.py
3
from __future__ import print_function, division import numpy as np import numpy.linalg as npl import matplotlib import matplotlib.pyplot as plt from matplotlib import colors from matplotlib import gridspec import os import re import json import nibabel as nib from utils import subject_class as sc from utils import outl...
vitiral/micropython
refs/heads/master
tests/basics/builtin_override.py
70
# test overriding builtins import builtins # override generic builtin builtins.abs = lambda x: x + 1 print(abs(1)) # __build_class__ is handled in a special way builtins.__build_class__ = lambda x, y: ('class', y) class A: pass print(A)
bmaluenda/SWITCH-Pyomo-Chile
refs/heads/Chile
switch_mod/project/unitcommit/fuel_use.py
1
# Copyright 2015 The Switch Authors. All rights reserved. # Licensed under the Apache License, Version 2, which is in the LICENSE file. """ This module describes fuel use with considerations of unit commitment and incremental heat rates using piecewise linear expressions. If you want to use this module directly in a ...
watonyweng/neutron
refs/heads/master
neutron/db/quota/driver.py
4
# Copyright 2011 OpenStack Foundation. # 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 req...
msmolens/VTK
refs/heads/slicer-v6.3.0-2015-07-21-426987d
IO/Geometry/Testing/Python/Plot3DScalars.py
20
#!/usr/bin/env python import vtk from vtk.test import Testing from vtk.util.misc import vtkGetDataRoot VTK_DATA_ROOT = vtkGetDataRoot() # # All Plot3D scalar functions # # Create the RenderWindow, Renderer and both Actors # renWin = vtk.vtkRenderWindow() iren = vtk.vtkRenderWindowInteractor() iren.SetRenderWindow(renW...
ClovisIRex/Snake-django
refs/heads/master
env/lib/python3.6/site-packages/django/contrib/gis/geos/prototypes/io.py
41
import threading from ctypes import POINTER, Structure, byref, c_char, c_char_p, c_int, c_size_t from django.contrib.gis.geos.base import GEOSBase from django.contrib.gis.geos.libgeos import GEOM_PTR, GEOSFuncFactory from django.contrib.gis.geos.prototypes.errcheck import ( check_geom, check_sized_string, check_st...
shashank971/edx-platform
refs/heads/master
openedx/core/djangoapps/credit/models.py
8
# -*- coding: utf-8 -*- """ Models for Credit Eligibility for courses. Credit courses allow students to receive university credit for successful completion of a course on EdX """ import datetime from collections import defaultdict import logging import pytz from django.conf import settings from django.core.cache im...
georgid/sms-tools
refs/heads/georgid-withMelodia
lectures/5-Sinusoidal-model/plots-code/spectral-sine-synthesis.py
24
import numpy as np import matplotlib.pyplot as plt from scipy.signal import hamming, triang, blackmanharris from scipy.fftpack import fft, ifft, fftshift import math import sys, os, functools, time sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../../software/models/')) import stft as S...
zorroblue/scikit-learn
refs/heads/master
benchmarks/bench_lasso.py
111
""" Benchmarks of Lasso vs LassoLars First, we fix a training set and increase the number of samples. Then we plot the computation time as function of the number of samples. In the second benchmark, we increase the number of dimensions of the training set. Then we plot the computation time as function of the number o...
lidavidm/mathics-heroku
refs/heads/master
venv/lib/python2.7/site-packages/django/contrib/admin/validation.py
108
from django.core.exceptions import ImproperlyConfigured from django.db import models from django.db.models.fields import FieldDoesNotExist from django.forms.models import BaseModelForm, BaseModelFormSet, _get_foreign_key from django.contrib.admin.util import get_fields_from_path, NotRelationField """ Does basic ModelA...
patdaburu/mothergeo-py
refs/heads/master
mothergeo/db/postgis/__init__.py
2
#!/usr/bin/env python # -*- coding: utf-8 -*- """ .. currentmodule:: __init__.py .. moduleauthor:: Pat Daburu <pat@daburu.net> Provide a brief description of the module. """
apyrgio/synnefo
refs/heads/release-0.16
snf-django-lib/snf_django/utils/routers.py
8
# Copyright (C) 2010-2014 GRNET S.A. # # 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 i...
cidadania/e-cidadania
refs/heads/master
src/core/spaces/url_names.py
2
# -*- coding: utf-8 -*- # # Copyright (c) 2013 Clione Software # Copyright (c) 2010-2013 Cidadania S. Coop. Galega # # 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.or...
wilblack/AutobahnPython
refs/heads/master
examples/twisted/wamp/basic/rpc/options/frontend.py
8
############################################################################### ## ## Copyright (C) 2014 Tavendo GmbH ## ## 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:/...