repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
SummerLW/Perf-Insight-Report | refs/heads/test | third_party/gsutil/third_party/boto/boto/pyami/installers/ubuntu/ebs.py | 115 | # Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.org/
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modi... |
tiagoprn/experiments | refs/heads/master | django/drf_veiculos_app/src/veiculos/apps/core/migrations/0004_auto_20170120_0206.py | 1 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2017-01-20 02:06
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0003_auto_20160721_2306'),
]
operations = [
migrations.AlterField(
... |
senttech/Cura | refs/heads/pl-i18n | cura/LayerPolygon.py | 2 | from UM.Math.Color import Color
import numpy
class LayerPolygon:
NoneType = 0
Inset0Type = 1
InsetXType = 2
SkinType = 3
SupportType = 4
SkirtType = 5
InfillType = 6
SupportInfillType = 7
MoveCombingType = 8
MoveRetractionType = 9
SupportInterfaceType = 10
__jump_... |
Shao-Feng/crosswalk-test-suite | refs/heads/master | webapi/tct-csp-w3c-tests/csp-py/csp_font-src_cross-origin_multi_allowed_one-manual.py | 30 | def main(request, response):
import simplejson as json
f = file('config.json')
source = f.read()
s = json.JSONDecoder().decode(source)
url1 = "http://" + s['host'] + ":" + str(s['ports']['http'][1])
url2 = "http://" + s['host'] + ":" + str(s['ports']['http'][0])
_CSP = "font-src " + url1 + "... |
rikadederika/pychess | refs/heads/master | lib/pychess/Variants/bughouse.py | 21 | # Bughouse Chess
from pychess.Utils.const import *
from pychess.Utils.Board import Board
class BughouseBoard(Board):
variant = BUGHOUSECHESS
class BughouseChess:
__desc__ = _("FICS bughouse: http://www.freechess.org/Help/HelpFiles/bughouse.html")
name = _("Bughouse")
cecp_name = "bughouse"
board ... |
40223121/2015cd_midterm | refs/heads/master | setup.py | 388 | from setuptools import setup
setup(name='CP Project 2014',
version='1.0',
description='OpenShift App for CP Project',
author='MDE NFU Taiwan',
author_email='2014cpcadp@gmail.com',
url='http://www.python.org/sigs/distutils-sig/',
install_requires=['CherryPy'],
) |
nitin-cherian/Webapps | refs/heads/master | TalkPython/P4E/my_web_app/.env/lib/python3.5/site-packages/pip/_vendor/requests/packages/chardet/gb2312prober.py | 2993 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org 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 Reserved.
#
# Con... |
jpgerke/bds-files | refs/heads/master | chapter-10-sequence/nuccount.py | 9 | #!/usr/bin/env python
# nuccount.py -- tally nucleotides in a file
import sys
from collections import Counter
from readfq import readfq
IUPAC_BASES = "ACGTRYSWKMBDHVN-."
# intialize counter
counts = Counter()
for name, seq, qual in readfq(sys.stdin):
# for each sequence entry, add all its bases to the counter
... |
guschmue/tensorflow | refs/heads/master | tensorflow/python/feature_column/feature_column_test.py | 2 | # Copyright 2017 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... |
Codlydodly/python-client | refs/heads/master | venv/lib/python2.7/site-packages/pip/pep425tags.py | 469 | """Generate and work with PEP 425 Compatibility Tags."""
import sys
import warnings
try:
import sysconfig
except ImportError: # pragma nocover
# Python < 2.7
import distutils.sysconfig as sysconfig
import distutils.util
def get_abbr_impl():
"""Return abbreviated implementation name."""
if hasat... |
sandlerb/lemonpy | refs/heads/master | lemonpy/ipc.py | 1 | #
# IPC utilities for Lemonbar
#
import json
import os
import queue
import socket
import threading
import uuid
from .common import LemonpyError, default_lemonpy_dir
from enum import Enum
class SocketExists(LemonpyError):
"""
Socket already exists.
"""
pass
class SocketDoesNotExist(LemonpyError):
... |
mozilla/verbatim | refs/heads/master | vendor/lib/python/translate/misc/wsgiserver/wsgiserver.py | 4 | """A high-speed, production ready, thread pooled, generic HTTP server.
Simplest example on how to use this module directly
(without using CherryPy's application machinery)::
from cherrypy import wsgiserver
def my_crazy_app(environ, start_response):
status = '200 OK'
response_headers = [('Cont... |
APE-Project/APE_Server | refs/heads/master | deps/js/src/tests/progressbar.py | 9 | # Text progress bar library, like curl or scp.
import sys, datetime
class ProgressBar:
def __init__(self, label, limit, label_width=12):
self.label = label
self.limit = limit
self.label_width = label_width
self.cur = 0
self.t0 = datetime.datetime.now()
self.barlen ... |
ddxgz/swift-webstorage | refs/heads/master | webadmin/models.py | 1 | import datetime
from django.db import models
from django.utils import timezone
# Create your models here.
# if use this, other page model can be deleted
# class UserModel(models.Model):
# # member_type = models.IntegerField(default=0)
# tenant = models.ForeignKey(TenantModel)
# username = models.CharFiel... |
jhdulaney/dnf | refs/heads/master | tests/cli/commands/test_search.py | 5 | # -*- coding: utf-8 -*-
# Copyright (C) 2014-2018 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is distributed ... |
agry/NGECore2 | refs/heads/master | scripts/skillMods/expertise_bm_pet_evade_value.py | 1156 | import sys
def add(core, actor, skillMod, value):
return
def deduct(core, actor, skillMod, value):
return
|
Inspq/ansible | refs/heads/inspq | lib/ansible/modules/cloud/rackspace/rax_queue.py | 70 | #!/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... |
rlworkgroup/metaworld | refs/heads/master | metaworld/policies/sawyer_button_press_topdown_v2_policy.py | 1 | import numpy as np
from metaworld.policies.action import Action
from metaworld.policies.policy import Policy, assert_fully_parsed, move
class SawyerButtonPressTopdownV2Policy(Policy):
@staticmethod
@assert_fully_parsed
def _parse_obs(obs):
return {
'hand_pos': obs[:3],
'h... |
suyashphadtare/vestasi-erp-new-final | refs/heads/develop | erpnext/stock/doctype/warehouse/__init__.py | 37694 | from __future__ import unicode_literals
|
kilon/sverchok | refs/heads/master | node_scripts/templates/zeffii/kdtree_3_closest.py | 4 | import mathutils
from mathutils import Vector, kdtree
def sv_main(v=[[]], mdist=0.4):
in_sockets = [
['v', 'verts', v],
['s', 'mdist', mdist]
]
e = []
if v and v[0]:
v = v[0]
# make kd tree
# documentation mathutils.kdtree.html
size = len(v)
... |
kimroen/rust | refs/heads/master | src/etc/generate-keyword-tests.py | 24 | #!/usr/bin/env python
#
# Copyright 2013 The Rust Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution and at
# http://rust-lang.org/COPYRIGHT.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
#... |
bensternthal/snippets-service | refs/heads/master | vendor-local/lib/python/mock.py | 424 | # mock.py
# Test tools for mocking and patching.
# Copyright (C) 2007-2012 Michael Foord & the mock team
# E-mail: fuzzyman AT voidspace DOT org DOT uk
# mock 1.0
# http://www.voidspace.org.uk/python/mock/
# Released subject to the BSD License
# Please see http://www.voidspace.org.uk/python/license.shtml
# Scripts m... |
jobartucz/prisoners-dilemma | refs/heads/master | team3.py | 1 | ####
# Each team's file must define four tokens:
# team_name: a string
# strategy_name: a string
# strategy_description: a string
# move: A function that returns 'c' or 'b'
####
team_name = 'Noah Hanson' # Only 10 chars displayed.
strategy_name = 'The name the team gives to this strategy'
str... |
haveal/googleads-python-lib | refs/heads/master | examples/adwords/v201502/remarketing/add_conversion_tracker.py | 4 | #!/usr/bin/python
#
# Copyright 2015 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 b... |
SebasSBM/django | refs/heads/master | django/template/__init__.py | 198 | """
Django's support for templates.
The django.template namespace contains two independent subsystems:
1. Multiple Template Engines: support for pluggable template backends,
built-in backends and backend-independent APIs
2. Django Template Language: Django's own template engine, including its
built-in loaders, ... |
alhashash/odoomrp-wip | refs/heads/8.0 | quality_control_claim/models/qc_test.py | 29 | # -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in root directory
##############################################################################
from openerp import models, fields
class QcTest(models.Mo... |
ThirdProject/android_external_chromium_org | refs/heads/cm-11.0 | chrome/test/functional/chromoting/chromoting_base.py | 67 | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Common imports, setup, etc for chromoting tests."""
import os
def _SetupPaths():
"""Add chrome/test/functional to sys.path for importing pyauto_f... |
vikas1885/test1 | refs/heads/master | common/djangoapps/terrain/stubs/youtube.py | 88 | """
Stub implementation of YouTube for acceptance tests.
To start this stub server on its own from Vagrant:
1.) Locally, modify your Vagrantfile so that it contains:
config.vm.network :forwarded_port, guest: 8031, host: 8031
2.) From within Vagrant dev environment do:
cd common/djangoapps/terrain
pyth... |
jk1/intellij-community | refs/heads/master | python/testData/quickFixes/PyAddFieldQuickFixTest/fromUnusedParameterKeyword.py | 80 | class A:
def __init__(self, fo<caret>o=True):
print('hello') |
calfonso/ansible | refs/heads/devel | lib/ansible/modules/network/dellos9/dellos9_facts.py | 50 | #!/usr/bin/python
#
# (c) 2015 Peter Sprygada, <psprygada@ansible.com>
# Copyright (c) 2016 Dell Inc.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_versio... |
jmontleon/libetnaviv | refs/heads/0.0.1 | tools/etnaviv_gdb.py | 5 | # GDB plugin for etnaviv driver debugging.
# This needs gdb 7.5+ to work.
#
# usage (from gdb):
# source /path/to/etnaviv_gdb.py
#
# Commands:
# gpu-state (prefix|uniforms)
# Show full GPU state (default) or only registers with a certain prefix.
# The special prefix 'uniforms' shows only the shader ... |
Southpaw-TACTIC/Team | refs/heads/master | src/python/Lib/multiprocessing/util.py | 2 | #
# Module providing various facilities to other parts of the package
#
# multiprocessing/util.py
#
# Copyright (c) 2006-2008, R Oudkerk --- see COPYING.txt
#
import itertools
import weakref
import atexit
import threading # we want threading to install it's
# cleanup function... |
gangadharkadam/v6_erp | refs/heads/master | erpnext/startup/boot.py | 13 | # 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
def boot_session(bootinfo):
"""boot session - send website info if guest"""
import frappe
bootinfo.custom_css = frappe.db.get_value... |
psykzz/flask-admin | refs/heads/master | flask_admin/contrib/sqla/view.py | 1 | import logging
from sqlalchemy.orm.attributes import InstrumentedAttribute
from sqlalchemy.orm import joinedload
from sqlalchemy.sql.expression import desc
from sqlalchemy import Column, Boolean, func, or_
from sqlalchemy.exc import IntegrityError
from flask import flash
from flask.ext.admin._compat import string_ty... |
502BadGateway/New_Wizards | refs/heads/master | bubbleSort.py | 2 | class BubbleSorting():
def run(treasureList):
for passnum in range(len(treasureList)-1,0,-1):
for i in range(passnum):
if treasureList[i].points > treasureList[i + 1].points:
theSortBot.swap(i, i + 1) |
ondra-novak/chromium.src | refs/heads/nw | tools/site_compare/drivers/win32/keyboard.py | 173 | #!/usr/bin/env python
# Copyright (c) 2011 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.
"""SiteCompare module for simulating keyboard input.
This module contains functions that can be used to simulate a user
pressing k... |
lesina/C-2016 | refs/heads/master | vector3d/googletest-master/googletest/test/gtest_test_utils.py | 344 | #!/usr/bin/env python
#
# Copyright 2006, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... |
tylerc-atx/script_library | refs/heads/master | Sam_bak/web/db.py | 2 | """
Database API
(part of web.py)
"""
from __future__ import print_function
from .utils import threadeddict, storage, iters, iterbetter, safestr, safeunicode
import datetime, time, os, urllib, re
from .py3helpers import PY2, string_types, numeric_types, iteritems
try:
from urllib import parse as urlparse
from... |
dkubiak789/OpenUpgrade | refs/heads/8.0 | addons/website_forum/__init__.py | 598 | # -*- coding: utf-8 -*-
import controllers
import models
|
aviarypl/mozilla-l10n-addons-server | refs/heads/master | src/olympia/accounts/tests/test_serializers.py | 2 | # -*- coding: utf-8 -*-
from django.test.utils import override_settings
import six
from rest_framework import serializers
from rest_framework.test import APIRequestFactory
from olympia import amo
from olympia.access.models import Group, GroupUser
from olympia.accounts.serializers import (
BaseUserSerializer, Pub... |
ArcherSys/ArcherSys | refs/heads/master | Lib/site-packages/jinja2/environment.py | 614 | # -*- coding: utf-8 -*-
"""
jinja2.environment
~~~~~~~~~~~~~~~~~~
Provides a class that holds runtime and parsing time options.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import os
import sys
from jinja2 import nodes
from jinja2.defaults import BLOCK_S... |
vaygr/ansible | refs/heads/devel | test/units/modules/network/f5/test_bigip_config.py | 28 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2017 F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import json
import sys
from nose.plugins.skip import SkipTest
i... |
l0b0/cds-invenio-vengmark | refs/heads/install-from-source | modules/websubmit/lib/functions/Ask_For_Record_Details_Confirmation.py | 4 | ## This file is part of CDS Invenio.
## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 CERN.
##
## CDS 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
## License, or (... |
inovtec-solutions/OpenERP | refs/heads/branch_openerp | openerp/addons/mx/Misc/OrderedMapping.py | 1 | #!/usr/local/python
""" OrderedMapping - A compromise between a dictionary and a list.
Copyright (c) 1998-2000, Marc-Andre Lemburg; mailto:mal@lemburg.com
See the documentation for further information on copyrights,
or contact the author. All Rights Reserved.
"""
import types, operator
from mx.Tools impor... |
neonatura/crotalus | refs/heads/master | lib/libxml2/python/tests/relaxng.py | 35 | #!/usr/bin/python -u
import libxml2
import sys
# Memory debug specific
libxml2.debugMemory(1)
schema="""<?xml version="1.0"?>
<element name="foo"
xmlns="http://relaxng.org/ns/structure/1.0"
xmlns:a="http://relaxng.org/ns/annotation/1.0"
xmlns:ex1="http://www.example.com/n1"
xmlns:e... |
hassanabidpk/django | refs/heads/master | django/core/management/__init__.py | 25 | from __future__ import unicode_literals
import collections
import os
import pkgutil
import sys
from importlib import import_module
import django
from django.apps import apps
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.core.management.base import (
BaseComma... |
srinivas-narayan/SimpleITKProject | refs/heads/master | RegionGrowing.py | 1 | ##############################################
#Region growing segmentation example
##############################################
from matplotlib import pyplot as plt
import SimpleITK as sitk
import numpy as np
import math
###################################
#Main program starts here
#############################... |
omlet05/MediaTek-HelioX10-Kernel | refs/heads/master | alps/kernel-3.10/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. ... |
BoardFellows/ScotlandYard | refs/heads/master | scotland_yard/syard_api/apps.py | 1 | from django.apps import AppConfig
class SyardApiConfig(AppConfig):
name = 'syard_api'
|
elyobo/pyoanda | refs/heads/master | pyoanda/exceptions.py | 3 | class BadCredentials(Exception):
pass
class BadRequest(Exception):
pass
|
agry/NGECore2 | refs/heads/master | scripts/object/mobile/dressed_lost_aqualish_scout_female_01.py | 85615 | import sys
def setup(core, object):
return |
jhetherly/EnglishSpeechUpsampler | refs/heads/master | src/shuffle_op_test.py | 1 | import numpy as np
import tensorflow as tf
class ShuffleTest(tf.test.TestCase):
def testShuffle(self):
shuffle_module = tf.load_op_library('shuffle_op.so')
shuffle = shuffle_module.shuffle
input_tensor = np.arange(12).reshape((3, 4))
desired_shape = np.array([6, -1])
outpu... |
bentwire/mbed | refs/heads/master | workspace_tools/host_tests/tcpecho_server.py | 52 | """
mbed SDK
Copyright (c) 2011-2013 ARM Limited
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 wr... |
NationalAssociationOfRealtors/LabLog | refs/heads/master | lablog/interfaces/wunderground.py | 1 | from lablog.interfaces import Interface
from lablog import messages
import humongolus.field as field
from datetime import datetime, timedelta
import requests
class Wunderground(Interface):
exchange = messages.Exchanges.weather
measurement_key = "weather"
run_delta = timedelta(minutes=5)
station_id = f... |
UnbDroid/robomagellan | refs/heads/master | Codigos/Raspberry/catkin_Bauchspiess/build/catkin_generated/order_packages.py | 1 | # generated from catkin/cmake/template/order_packages.context.py.in
source_root_dir = "/home/ricardo/catkin_ws/src"
whitelisted_packages = "".split(';') if "" != "" else []
blacklisted_packages = "".split(';') if "" != "" else []
underlay_workspaces = "/home/ricardo/catkin_ws/devel;/opt/ros/indigo".split(';') if "/home... |
benschmaus/catapult | refs/heads/master | dashboard/dashboard/pinpoint/handlers/jobs_test.py | 2 | # Copyright 2017 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 json
import unittest
import webapp2
import webtest
from google.appengine.ext import ndb
from google.appengine.ext import testbed
from dashboard.pin... |
cetygamer/pywinauto | refs/heads/master | pywinauto/unittests/test_mouse.py | 1 | """Tests for mouse.py"""
import time
import copy
import sys
import os
import unittest
if sys.platform == 'win32':
import win32clipboard
sys.path.append(".")
from pywinauto.application import Application
from pywinauto.keyboard import SendKeys
from pywinauto import mouse
from pywinauto.timings i... |
dvopsway/elastalert | refs/heads/master | docs/source/conf.py | 3 | # -*- coding: utf-8 -*-
#
# ElastAlert documentation build configuration file, created by
# sphinx-quickstart on Thu Jul 11 15:45:31 2013.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# ... |
flwh/KK_mt6589_iq451 | refs/heads/master | prebuilts/python/darwin-x86/2.7.5/lib/python2.7/encodings/raw_unicode_escape.py | 852 | """ Python 'raw-unicode-escape' Codec
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""
import codecs
### Codec APIs
class Codec(codecs.Codec):
# Note: Binding these as C functions will result in the class not
# converting them to methods. This is ... |
efforia/django-socialize | refs/heads/master | demo/demo/wsgi.py | 3 | """
WSGI config for demo project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS... |
chenjun0210/tensorflow | refs/heads/master | tensorflow/contrib/learn/python/learn/utils/export_test.py | 72 | # 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... |
brodoll/sms-tools | refs/heads/master | lectures/05-Sinusoidal-model/plots-code/peaks-on-spectrogram.py | 21 | import numpy as np
import matplotlib.pyplot as plt
import sys, os, time
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../../software/models/'))
import stft as STFT
import sineModel as SM
import utilFunctions as UF
(fs, x) = UF.wavread(os.path.join(os.path.dirname(os.path.realpath(__fi... |
ydaniv/tornado | refs/heads/master | tornado/iostream.py | 48 | #!/usr/bin/env python
#
# Copyright 2009 Facebook
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
Chetwyn/git-cola | refs/heads/master | cola/resources.py | 9 | """Provides the prefix() function for finding cola resources"""
from __future__ import division, absolute_import, unicode_literals
import os
import webbrowser
from os.path import dirname
from cola import core
_modpath = core.abspath(__file__)
if os.path.join('share', 'git-cola', 'lib') in _modpath:
# this is th... |
aleen42/three.js | refs/heads/master | utils/exporters/blender/addons/io_three/dialogs.py | 299 | from bpy import context
CONTEXT = {
0: {
'title': "Error Message",
'icon': 'CANCEL'
},
1: {
'title': "Warning Message",
'icon': 'ERROR' # I prefer this icon for warnings
},
2: {
'title': "Message",
'icon': 'NONE'
},
3: {
'title': "Ques... |
knyghty/knyg.ht | refs/heads/master | pages/migrations/0006_auto_20140911_1422.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('pages', '0005_auto_20140911_1419'),
]
operations = [
migrations.AlterField(
model_name='page',
name=... |
akuster/linux-yocto-3.14 | refs/heads/master | tools/perf/scripts/python/syscall-counts.py | 11181 | # system call counts
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.path.append(os.envir... |
cernops/nova | refs/heads/master | nova/tests/unit/objects/test_quotas.py | 69 | # Copyright 2013 Rackspace Hosting.
#
# 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... |
iuliat/nova | refs/heads/master | nova/objects/host_mapping.py | 29 | # 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... |
chand3040/sree_odoo | refs/heads/master | openerp/addons/l10n_pt/__openerp__.py | 380 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2012 Thinkopen Solutions, Lda. All Rights Reserved
# http://www.thinkopensolutions.com.
# $Id$
#
# This program is free software: you can red... |
jimrybarski/piwarmer | refs/heads/master | backend/tests/thermometer.py | 2 | import unittest
from backend.device.thermometer import Thermometer
from backend.device.mock import MockMAX31855
import math
class ThermometerTests(unittest.TestCase):
def setUp(self):
self.thermometer = Thermometer(MockMAX31855())
def test_read_c(self):
for i in range(10000):
temp... |
pipsiscool/audacity | refs/heads/master | lib-src/lv2/lv2/plugins/eg04-sampler.lv2/waflib/Tools/waf_unit_test.py | 267 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
import os,sys
from waflib.TaskGen import feature,after_method
from waflib import Utils,Task,Logs,Options
testlock=Utils.threading.Lock()
@feature('test')
@after_method('apply_... |
crepererum/invenio-oauthclient | refs/heads/master | invenio_oauthclient/contrib/github.py | 6 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2014 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
# License, or (at your option) any later... |
edlabh/SickRage | refs/heads/master | lib/hachoir_core/i18n.py | 86 | # -*- coding: UTF-8 -*-
"""
Functions to manage internationalisation (i18n):
- initLocale(): setup locales and install Unicode compatible stdout and
stderr ;
- getTerminalCharset(): guess terminal charset ;
- gettext(text) translate a string to current language. The function always
returns Unicode string. You can a... |
tecan/xchat-rt | refs/heads/master | plugins/scripts/Supybot-0.83.4.1-bitcoinotc-bot/plugins/Limiter/plugin.py | 9 | ###
# Copyright (c) 2004-2005, Jeremiah Fincher
# Copyright (c) 2009, James Vega
# 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 copyri... |
iAmMrinal0/plexpy | refs/heads/master | plexpy/http_handler.py | 2 | # This file is part of PlexPy.
#
# PlexPy 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.
#
# PlexPy is distributed in the hope th... |
SunghanKim/numpy | refs/heads/master | numpy/core/setup_common.py | 27 | from __future__ import division, absolute_import, print_function
# Code common to build tools
import sys
import warnings
import copy
import binascii
from numpy.distutils.misc_util import mingw32
#-------------------
# Versioning support
#-------------------
# How to change C_API_VERSION ?
# - increase C_API_VERSI... |
brianjgeiger/osf.io | refs/heads/develop | api_tests/registrations/views/test_registration_bibliographic_contributors_list.py | 10 | import pytest
from api.base.settings.defaults import API_BASE
from api_tests.nodes.views.test_node_bibliographic_contributors_list import TestNodeBibliographicContributors
from osf_tests.factories import (
RegistrationFactory,
ProjectFactory
)
from osf.utils.permissions import READ, WRITE
@pytest.mark.django... |
MoamerEncsConcordiaCa/tensorflow | refs/heads/master | tensorflow/contrib/bayesflow/examples/reinforce_simple/reinforce_simple_example.py | 105 | # 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... |
google-code-export/django-hotclub | refs/heads/master | apps/local_apps/core/templatetags/comments_tag.py | 7 | from django import template
register = template.Library()
def comments(context, obj):
return {
'object': obj,
'request': context['request'],
'user': context['user'],
}
register.inclusion_tag('threadedcomments/comments.html', takes_context=True)(comments) |
JackDanger/sentry | refs/heads/master | src/sentry/web/frontend/project_plugins.py | 10 | from __future__ import absolute_import
from django.contrib import messages
from django.utils.translation import ugettext_lazy as _
from sentry.plugins import plugins
from sentry.web.frontend.base import ProjectView
class ProjectPluginsView(ProjectView):
required_scope = 'project:write'
def handle(self, req... |
jmcarp/django | refs/heads/master | django/contrib/gis/geos/prototypes/geom.py | 288 | from ctypes import POINTER, c_char_p, c_int, c_size_t, c_ubyte
from django.contrib.gis.geos.libgeos import CS_PTR, GEOM_PTR, GEOSFuncFactory
from django.contrib.gis.geos.prototypes.errcheck import (
check_geom, check_minus_one, check_sized_string, check_string, check_zero,
)
# This is the return type used by bina... |
retomerz/intellij-community | refs/heads/master | python/testData/copyPaste/LineToEnd.dst.py | 83 | print 1<caret>
print 3
|
amyvmiwei/kbengine | refs/heads/master | kbe/res/scripts/common/Lib/test/test_modulefinder.py | 10 | import os
import errno
import importlib.machinery
import py_compile
import shutil
import unittest
import tempfile
from test import support
import modulefinder
TEST_DIR = tempfile.mkdtemp()
TEST_PATH = [TEST_DIR, os.path.dirname(tempfile.__file__)]
# Each test description is a list of 5 items:
#
# 1. a module name t... |
acigna/pywez | refs/heads/master | zsi/test/wsdl2py/test_VIM25.py | 1 | #!/usr/bin/env python
############################################################################
# Joshua R. Boverhof, LBNL
# See LBNLCopyright for copyright notice!
###########################################################################
import os, sys, unittest
from ServiceTest import main, ServiceTestCase, Serv... |
unicef/un-partner-portal | refs/heads/develop | backend/unpp_api/apps/sanctionslist/migrations/0001_initial.py | 1 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-10-19 08:10
from __future__ import unicode_literals
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import model_utils.fields
class Migration(migrations.Migr... |
MiCode/mi2_kernel | refs/heads/master | scripts/gcc-wrapper.py | 501 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2011-2012, Code Aurora Forum. 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 a... |
doraemonext/wechat-platform | refs/heads/develop | wechat_platform/system/library/news/views.py | 1 | # -*- coding: utf-8 -*-
from django.views.generic import DetailView
from django.http import Http404
from system.library.news.models import LibraryNews
class NewsDetailView(DetailView):
"""
图文展示页面
"""
template_name = 'news/detail.html'
model = LibraryNews
pk_url_kwarg = 'token' |
krzychb/rtd-test-bed | refs/heads/master | components/json/cJSON/tests/unity/auto/unity_test_summary.py | 22 | #! python3
# ==========================================
# Unity Project - A Test Framework for C
# Copyright (c) 2015 Alexander Mueller / XelaRellum@web.de
# [Released under MIT License. Please refer to license.txt for details]
# Based on the ruby script by Mike Karlesky, Mark VanderVoord, Greg Williams
# ====... |
wangyum/tensorflow | refs/heads/master | tensorflow/contrib/factorization/python/ops/factorization_ops.py | 28 | # 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... |
flyfei/python-for-android | refs/heads/master | python-modules/zope/zope/__init__.py | 878 | # this is a namespace package
try:
import pkg_resources
pkg_resources.declare_namespace(__name__)
except ImportError:
import pkgutil
__path__ = pkgutil.extend_path(__path__, __name__)
|
BjoernT/python-openstackclient | refs/heads/master | openstackclient/volume/v1/volume_type.py | 2 | # Copyright 2012-2013 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 la... |
cactusbin/nyt | refs/heads/master | matplotlib/examples/axes_grid/demo_axes_rgb.py | 7 | import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1.axes_rgb import make_rgb_axes, RGBAxes
def get_demo_image():
from matplotlib.cbook import get_sample_data
f = get_sample_data("axes_grid/bivariate_normal.npy", asfileobj=False)
z = np.load(f)
# z is a numpy array of 15x15
... |
tumbl3w33d/ansible | refs/heads/devel | lib/ansible/modules/cloud/cloudstack/cs_network_acl_rule.py | 13 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2017, René Moser <mail@renemoser.net>
# 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': '... |
YongseopKim/crosswalk-test-suite | refs/heads/master | webapi/tct-callhistory-tizen-tests/inst.apk.py | 903 | #!/usr/bin/env python
import os
import shutil
import glob
import time
import sys
import subprocess
from optparse import OptionParser, make_option
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PARAMETERS = None
ADB_CMD = "adb"
def doCMD(cmd):
# Do not need handle timeout in this short script, let tool... |
x111ong/django | refs/heads/master | tests/template_tests/filter_tests/test_default.py | 521 | from django.template.defaultfilters import default
from django.test import SimpleTestCase
from django.utils.safestring import mark_safe
from ..utils import setup
class DefaultTests(SimpleTestCase):
"""
Literal string arguments to the default filter are always treated as
safe strings, regardless of the au... |
akshayaurora/kivy | refs/heads/master | kivy/input/postproc/dejitter.py | 22 | '''
Dejitter
========
Prevent blob jittering.
A problem that is often faced (esp. in optical MT setups) is that of
jitterish BLOBs caused by bad camera characteristics. With this module
you can get rid of that jitter. You just define a threshold
`jitter_distance` in your config, and all touch movements that move
the ... |
Trult/youtube-dl | refs/heads/master | youtube_dl/extractor/nrk.py | 83 | # encoding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
ExtractorError,
float_or_none,
parse_duration,
unified_strdate,
)
class NRKIE(InfoExtractor):
_VALID_URL = r'(?:nrk:|https?://(?:www\.)?nrk\.no/video/PS\*)(?P<id>\d+)'
... |
Nexenta/s3-tests | refs/heads/master | virtualenv/lib/python2.7/site-packages/requests/packages/chardet2/euckrfreq.py | 323 | ######################## 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... |
diagramsoftware/bank-payment | refs/heads/8.0 | account_banking_mandate/models/payment_line.py | 4 | # -*- coding: utf-8 -*-
# © 2014 Compassion CH - Cyril Sester <csester@compassion.ch>
# © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza
# © 2015 Akretion - Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields, api, excep... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.