repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
fredwilliam/PMO | refs/heads/master | apps/commtrack_calendar/views.py | 2 | from rapidsms.webui.utils import render_to_response, paginated
from xformmanager.models import *
#from wqm.models import *
from hq.models import *
from graphing.models import *
from receiver.models import *
from domain.decorators import login_and_domain_required
from reporters.utils import *
from resources.models impor... |
kevinseelbach/generic_utils | refs/heads/master | src/generic_utils/celery/__init__.py | 1 | """
Python Utils for Celery Job Framework
"""
from generic_utils.config import get_config_value
from generic_utils.loggingtools import getLogger
from generic_utils.rabbitmq.utils import get_rabbitmq_config_values
from generic_utils.redis.utils import get_redis_config_values
log = getLogger()
class BrokerTypes(object... |
abhishek-ch/hue | refs/heads/master | desktop/core/ext-py/Django-1.6.10/tests/mail/custombackend.py | 277 | """A custom backend for testing."""
from django.core.mail.backends.base import BaseEmailBackend
class EmailBackend(BaseEmailBackend):
def __init__(self, *args, **kwargs):
super(EmailBackend, self).__init__(*args, **kwargs)
self.test_outbox = []
def send_messages(self, email_messages):
... |
rc/sfepy | refs/heads/master | tests/test_input_two_bodies_contact.py | 5 | from __future__ import absolute_import
input_name = '../examples/linear_elasticity/two_bodies_contact.py'
output_name = 'test_two_bodies_contact.vtk'
from tests_basic import TestInput
class Test(TestInput):
pass
|
liyu1990/sklearn | refs/heads/master | sklearn/metrics/tests/test_regression.py | 272 | from __future__ import division, print_function
import numpy as np
from itertools import product
from sklearn.utils.testing import assert_raises
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.... |
kangkot/arangodb | refs/heads/devel | 3rdParty/V8-4.3.61/third_party/python_26/Lib/test/test_optparse.py | 51 | #!/usr/bin/python
#
# Test suite for Optik. Supplied by Johannes Gijsbers
# (taradino@softhome.net) -- translated from the original Optik
# test suite to this PyUnit-based version.
#
# $Id: test_optparse.py 61000 2008-02-23 17:40:11Z christian.heimes $
#
import sys
import os
import re
import copy
import types
import... |
batoure/ScienceManager | refs/heads/master | tests/service/__init__.py | 6 | __author__ = 'Austin'
|
timlinux/watchkeeper | refs/heads/develop | django_project/sms/migrations/0004_auto__add_messageset.py | 5 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'MessageSet'
db.create_table('sms_messageset', (
('id', self.gf('django.db.mode... |
eoneil1942/voltdb-4.7fix | refs/heads/master | third_party/python/schemaobject/tests/test_connection.py | 15 | #!/usr/bin/python
"""
Tests for the Database Connection URL (RFC 1738)
http://www.ietf.org/rfc/rfc1738.txt
"""
import re
import unittest
from schemaobject.connection import REGEX_RFC1738
class TestDatabaseURL(unittest.TestCase):
def test_user_pw_host_port_db(self):
test = "mysql://user:password@localhos... |
fos/fos-legacy | refs/heads/master | build_helpers.py | 2 | ''' Module to automate cython building '''
import os
from os.path import join as pjoin
from distutils.extension import Extension
def make_cython_ext(modulename,
has_cython,
include_dirs=None,
extra_c_sources=None):
''' Create Cython extension builder f... |
BrianGasberg/filterpy | refs/heads/master | filterpy/kalman/__init__.py | 2 | # -*- coding: utf-8 -*-
"""Copyright 2015 Roger R Labbe Jr.
FilterPy library.
http://github.com/rlabbe/filterpy
Documentation at:
https://filterpy.readthedocs.org
Supporting book at:
https://github.com/rlabbe/Kalman-and-Bayesian-Filters-in-Python
This is licensed under an MIT license. See the readme.MD file
for mor... |
neil-davis/penfold | refs/heads/master | src/plugins/PortScannerPlugin.py | 1 | import logging
import socket
from netaddr import IPAddress
from yapsy.IPlugin import IPlugin
log = logging.getLogger(__name__)
class PortScannerPlugin(IPlugin):
"""Takes a single IP address and a port range as an input and returns the
ports that are open"""
def execute(self, info):
startin... |
GalaxyTab4/twrp_kernel_samsung_degaswifi | refs/heads/twrp-omni | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py | 11088 | # Core.py - Python extension for perf script, core functions
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
from collections import defaultdict
def aut... |
anhstudios/swganh | refs/heads/develop | data/scripts/templates/object/tangible/ship/attachment/weapon/shared_bwing_weapon2r_s05.py | 2 | #### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/ship/attachment/weapon/shared_bwing_weapon2r_s05.iff"
result.attrib... |
eccles/lnxproc | refs/heads/master | lnxproc/pidenviron.py | 1 | '''
Contains PidEnviron() class
Reads the /proc/<pid>/environ file
'''
from logging import getLogger
from os import path as ospath
from .readfile import ReadFile
LOGGER = getLogger(__name__)
class PidEnviron(ReadFile):
'''
PidEnviron handling
'''
FILENAME = ospath.join('proc', '%s', 'environ')... |
gymnasium/edx-platform | refs/heads/open-release/hawthorn.master | common/lib/xmodule/xmodule/modulestore/draft_and_published.py | 17 | """
This module provides an abstraction for Module Stores that support Draft and Published branches.
"""
import threading
import logging
from abc import ABCMeta, abstractmethod
from contextlib import contextmanager
from six import text_type
from . import ModuleStoreEnum, BulkOperationsMixin
from .exceptions import Ite... |
reedstrm/Pyrseas | refs/heads/master | tests/relation/test_relvar.py | 2 | # -*- coding: utf-8 -*-
"""Test RelVars"""
from __future__ import unicode_literals
from copy import copy
from datetime import date, datetime, timedelta
import pytest
from psycopg2 import DatabaseError, IntegrityError
from pyrseas.relation import RelVar, Attribute
from pyrseas.testutils import RelationTestCase
TEST_... |
yanheven/glance | refs/heads/master | glance/api/__init__.py | 6 | # Copyright 2011-2012 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... |
xirdneh/oposum | refs/heads/master | oPOSum/libs/migrate.py | 1 | import MySQLdb as mdb
import sys
from oPOSum.apps.products.models import *
import re
from django.core.exceptions import ObjectDoesNotExist
import re
import logging
from decimal import Decimal
logger = logging.getLogger("oPOSum.mysql")
def get_con( ):
try:
con = mdb.connect('joyeriasbalco.com', 'balco', 'tsm... |
naveenpanwar/tgoat | refs/heads/master | functional_tests/test_simple_list_creation.py | 1 | from .base import FunctionalTest
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
class NewVisitorTest(FunctionalTest):
def test_can_start_a_list_and_retrive_it_later(self):
# Edith has heard about a cool new online to-do app. She goes
# to check out its homepage
... |
stack-of-tasks/rbdlpy | refs/heads/master | tutorial/lib/python2.7/site-packages/OpenGL/raw/GLES1/EXT/__init__.py | 1729 | """OpenGL Extensions""" |
mwmuni/LIGGGHTS_GUI | refs/heads/master | OpenGL/raw/GL/HP/__init__.py | 1729 | """OpenGL Extensions""" |
ol-loginov/intellij-community | refs/heads/master | python/lib/Lib/site-packages/django/core/cache/backends/filebased.py | 229 | "File-based cache backend"
import os
import time
import shutil
try:
import cPickle as pickle
except ImportError:
import pickle
from django.core.cache.backends.base import BaseCache
from django.utils.hashcompat import md5_constructor
class FileBasedCache(BaseCache):
def __init__(self, dir, params):
... |
keisuke-umezawa/chainer | refs/heads/master | tests/chainer_tests/testing_tests/test_unary_math_function_test.py | 11 | import unittest
from chainer import function_node
from chainer import testing
def dummy():
pass
class TestNoNumpyFunction(unittest.TestCase):
def test_no_numpy_function(self):
with self.assertRaises(ValueError):
testing.unary_math_function_unittest(dummy) # no numpy.dummy
class Dumm... |
kislyuk/aegea | refs/heads/develop | aegea/batch.py | 1 | """
Manage AWS Batch jobs, queues, and compute environments.
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import os, sys, argparse, base64, collections, io, subprocess, json, time, re, hashlib, itertools
from typing import List
from botocore.exceptions import ClientError
fr... |
Velociraptor85/pyload | refs/heads/stable | module/gui/__init__.py | 20578 | |
ampax/edx-platform-backup | refs/heads/live | cms/djangoapps/contentstore/management/commands/tests/test_git_export.py | 9 | """
Unittests for exporting to git via management command.
"""
import copy
import os
import shutil
import StringIO
import subprocess
import unittest
from uuid import uuid4
from django.conf import settings
from django.core.management import call_command
from django.core.management.base import CommandError
from django.... |
lcy-seso/Paddle | refs/heads/develop | python/paddle/fluid/tests/unittests/test_scale_op.py | 5 | # Copyright (c) 2018 PaddlePaddle 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 app... |
hybrideagle/django | refs/heads/master | django/conf/locale/az/formats.py | 1059 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j E Y г.'
TIME_FORMAT = 'G:i'
DAT... |
witcxc/scipy | refs/heads/master | scipy/optimize/tests/test_cobyla.py | 10 | from __future__ import division, print_function, absolute_import
import math
import numpy as np
from numpy.testing import assert_allclose, TestCase, run_module_suite, \
assert_
from scipy.optimize import fmin_cobyla, minimize
class TestCobyla(TestCase):
def setUp(self):
self.x0 = [4.95,0.66]
... |
ddurst/zamboni | refs/heads/master | mkt/constants/ratingsbodies.py | 4 | # -*- coding: utf-8 -*-
from django.utils.translation import ugettext_lazy as _lazy
NAME_GENERAL = _lazy('For all ages')
# L10n: %d is the age in years. For ages %d and higher.
NAME_LAZY = _lazy('For ages %d+') # Fill this in after accessing.
NAME_REJECTED = _lazy(u'Rating Rejected')
NAME_PENDING = _lazy(u'Rating Pe... |
heropunch/tamactiluya | refs/heads/master | tamactiluya/views/user.py | 3 | # -*- coding: utf-8 -*-
from flask import Blueprint, Response
from flask import request, flash, render_template, redirect, url_for, current_app
from flask_login import login_user, logout_user, current_user, fresh_login_required
from tamactiluya import forms
from tamactiluya.models import User
mod = Blueprint('user'... |
katiecheng/Bombolone | refs/heads/master | env/lib/python2.7/site-packages/fabfile/utils.py | 27 | from __future__ import with_statement
from contextlib import contextmanager
from fabric.api import hide, puts
@contextmanager
def msg(txt):
puts(txt + "...", end='', flush=True)
with hide('everything'):
yield
puts("done.", show_prefix=False, flush=True)
|
xianggong/m2c_unit_test | refs/heads/master | test/operator/relational_less_than_long16long16/compile.py | 1861 | #!/usr/bin/python
import os
import subprocess
import re
def runCommand(command):
p = subprocess.Popen(command,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
p.wait()
return iter(p.stdout.readline, b'')
def dumpRunCommand(command,... |
vabs22/zulip | refs/heads/master | zerver/tests/test_alert_words.py | 3 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
from zerver.lib.alert_words import (
add_user_alert_words,
alert_words_in_realm,
remove_user_alert_words,
user_alert_words,
)
from zerver.lib.test_helpers import (
most_recent_message,
most_rec... |
eeshangarg/oh-mainline | refs/heads/master | vendor/packages/celery/celery/tests/test_backends/test_base.py | 18 | from __future__ import absolute_import
from __future__ import with_statement
import sys
import types
from mock import Mock
from nose import SkipTest
from celery.utils import serialization
from celery.utils.serialization import subclass_exception
from celery.utils.serialization import \
find_nearest_pickleabl... |
TxBlackWolf/My-Gray-Hacker-Resources | refs/heads/master | Web_Security/urllib2/simple_http_requests.py | 4 | #!/usr/bin/env python
__author__ = "bt3"
import urllib2
import urllib
def post_general(url):
values = {'name' : 'Dana Scullt',
'location' : 'Virginia',
'language' : 'Python' }
data = urllib.urlencode(values)
req = urllib2.Request(url, data)
response = urllib2.urlopen(req)... |
zatuper/pywebstepic | refs/heads/master | ask/qa/admin.py | 13848 | from django.contrib import admin
# Register your models here.
|
tuxfux-hlp-notes/python-batches | refs/heads/master | archieves/batch-62/files/myenv/lib/python2.7/site-packages/pip/utils/logging.py | 516 | from __future__ import absolute_import
import contextlib
import logging
import logging.handlers
import os
try:
import threading
except ImportError:
import dummy_threading as threading
from pip.compat import WINDOWS
from pip.utils import ensure_dir
try:
from pip._vendor import colorama
# Lots of differen... |
mbox/django | refs/heads/master | django/dispatch/__init__.py | 758 | """Multi-consumer multi-producer dispatching mechanism
Originally based on pydispatch (BSD) http://pypi.python.org/pypi/PyDispatcher/2.0.1
See license.txt for original license.
Heavily modified for Django's purposes.
"""
from django.dispatch.dispatcher import Signal, receiver # NOQA
|
wdv4758h/ZipPy | refs/heads/master | edu.uci.python.benchmark/src/benchmarks/sympy/sympy/combinatorics/tests/test_perm_groups.py | 24 | from sympy.combinatorics.perm_groups import PermutationGroup
from sympy.combinatorics.named_groups import SymmetricGroup, CyclicGroup,\
DihedralGroup, AlternatingGroup, AbelianGroup, RubikGroup
from sympy.combinatorics.permutations import Permutation, _af_rmuln
from sympy.utilities.pytest import skip, XFAIL
from sy... |
s0930342674/pyload | refs/heads/stable | module/plugins/hoster/LoadTo.py | 13 | # -*- coding: utf-8 -*-
#
# Test links:
# http://www.load.to/JWydcofUY6/random.bin
# http://www.load.to/oeSmrfkXE/random100.bin
import re
from module.plugins.captcha.SolveMedia import SolveMedia
from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class LoadTo(SimpleHoster):
__name__ ... |
nychitman1/android_kernel_lge_hammerhead | refs/heads/m | Documentation/networking/cxacru-cf.py | 14668 | #!/usr/bin/env python
# Copyright 2009 Simon Arlott
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 2 of the License, or (at your option)
# any later version.
#
# This program i... |
GauravSahu/odoo | refs/heads/8.0 | addons/share/__openerp__.py | 250 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2011 OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you ... |
joelfiddes/toposubv2 | refs/heads/master | topoMAPP/utils/fileSearch.py | 1 | import os
def search(path, file):
fullPath = path
inDir = os.listdir(path)
for element in inDir:
if os.path.join(path, file) == os.path.join(path, element):
fullPath = os.path.join(fullPath, file)
print(fullPath)
return fullPath
elif os.path.isdir(os.path.join(path, element)):
fullpath = ... |
AOSP-S4-KK/platform_external_chromium_org | refs/heads/kk-4.4 | third_party/simplejson/encoder.py | 219 | """Implementation of JSONEncoder
"""
import re
from decimal import Decimal
def _import_speedups():
try:
from simplejson import _speedups
return _speedups.encode_basestring_ascii, _speedups.make_encoder
except ImportError:
return None, None
c_encode_basestring_ascii, c_make_encoder = _im... |
mzdaniel/oh-mainline | refs/heads/master | vendor/packages/twisted/twisted/test/process_echoer.py | 143 | """Write back all data it receives."""
import sys
data = sys.stdin.read(1)
while data:
sys.stdout.write(data)
sys.stdout.flush()
data = sys.stdin.read(1)
sys.stderr.write("byebye")
sys.stderr.flush()
|
almeidapaulopt/erpnext | refs/heads/develop | erpnext/patches/v4_0/reset_permissions_for_masters.py | 30 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import print_function, unicode_literals
from frappe.permissions import reset_perms
def execute():
for doctype in ("About Us Settings", "Accounts Settings", "Activity Type",
... |
DaveBerkeley/lasercut | refs/heads/master | laser/gears.py | 1 | #!/usr/bin/python
import sys
import math
from laser import Polygon, Circle, Collection, Config
from laser import radians, rotate_2d
from render import DXF as dxf
# Involute gears, see :
# http://www.cartertools.com/involute.html
#
#
def circle_intersect(v, r):
# see http://mathworld.wolfram.com/Circle-LineInte... |
alfa-addon/addon | refs/heads/master | plugin.video.alfa/lib/past/utils/__init__.py | 4 | """
Various non-built-in utility functions and definitions for Py2
compatibility in Py3.
For example:
>>> # The old_div() function behaves like Python 2's / operator
>>> # without "from __future__ import division"
>>> from past.utils import old_div
>>> old_div(3, 2) # like 3/2 in Py2
0
>>> ... |
sparkslabs/kamaelia_ | refs/heads/master | Sketches/AB/backup/AB-Whiteboard-V1/Kamaelia/UI/Pygame/Display.py | 3 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache License... |
smaty1/shadowsocks-1 | refs/heads/master | tests/gen_multiple_passwd.py | 978 | #!/usr/bin/python
import json
with open('server-multi-passwd-performance.json', 'wb') as f:
r = {
'server': '127.0.0.1',
'local_port': 1081,
'timeout': 60,
'method': 'aes-256-cfb'
}
ports = {}
for i in range(7000, 9000):
ports[str(i)] = 'aes_password'
r['po... |
manjunaths/tensorflow | refs/heads/master | tensorflow/python/saved_model/main_op.py | 120 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
LinkHS/incubator-mxnet | refs/heads/master | example/gluon/embedding_learning/data.py | 30 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
rowemoore/odoo | refs/heads/8.0 | addons/point_of_sale/wizard/pos_confirm.py | 343 | # -*- 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... |
hastexo/edx-platform | refs/heads/master | cms/lib/xblock/tagging/models.py | 14 | """
Django Model for tags
"""
from django.db import models
class TagCategories(models.Model):
"""
This model represents tag categories.
"""
name = models.CharField(max_length=255, unique=True)
title = models.CharField(max_length=255)
class Meta(object):
app_label = "tagging"
o... |
amcat/amcat | refs/heads/master | amcat/tools/progress.py | 1 | ##########################################################################
# (C) Vrije Universiteit, Amsterdam (the Netherlands) #
# #
# This file is part of AmCAT - The Amsterdam Content Analysis Toolkit #
# ... |
junkieDolphin/tbdc15 | refs/heads/master | trips_accidents_scatter.py | 1 | from pylab import *
import os
import pandas
import tarfile
scale = 1000.0
trips_path = os.path.expanduser('~/data/tbdc2015/infoblu/palermo.tar.gz')
accidents_path = os.path.expanduser('~/data/tbdc2015/unipol/BDC2015_UnipolsaiClaims2014_PA.csv')
boxes_path = os.path.expanduser('~/data/tbdc2015/city_boxes.csv')
city_cod... |
utkbansal/kuma | refs/heads/master | vendor/packages/git/actor.py | 32 | # actor.py
# Copyright (C) 2008-2010 Michael Trier (mtrier@gmail.com) and contributors
#
# This module is part of GitPython and is released under
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
import re
class Actor(object):
"""Actors hold information about a person acting on the repository.... |
lhellebr/spacewalk | refs/heads/master | backend/server/importlib/debPackage.py | 6 | #
# Copyright (c) 2010--2016 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a c... |
Acidburn0zzz/servo | refs/heads/master | tests/wpt/web-platform-tests/eventsource/resources/cors.py | 5 | import os
from wptserve import pipes
def run_other(request, response, path):
#This is a terrible hack
environ = {"__file__": path}
exec(compile(open(path, "r").read(), path, 'exec'), environ, environ)
rv = environ["main"](request, response)
return rv
def main(request, response):
origin = reque... |
eayunstack/neutron | refs/heads/master | neutron/tests/unit/agent/windows/test_ip_lib.py | 1 | # Copyright 2016 Cloudbase Solutions.
# 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
#
# Un... |
mollstam/UnrealPy | refs/heads/master | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/pywin32-219/win32/Demos/security/query_information.py | 34 | from ntsecuritycon import *
import win32api, win32security, winerror
# This is a Python implementation of win32api.GetDomainName()
def GetDomainName():
try:
tok = win32security.OpenThreadToken(win32api.GetCurrentThread(),
TOKEN_QUERY, 1)
except win32api.error... |
yehnan/python_book_yehnan | refs/heads/master | ch07/ch07_big5_uao_test.py | 1 |
# -*- coding: utf-8 -*-
from __future__ import print_function
import codecs
import big5ext
import big5uao
def getregentry(codec_name):
if codec_name == 'big5ext':
return codecs.CodecInfo(
name='big5ext',
encode=big5ext.Codec().encode,
decode=big5ext.Codec().decode,
incremen... |
gspeedtech/Audacity-2 | refs/heads/master | lib-src/lv2/sratom/waflib/Tools/winres.py | 331 | #! /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 re,traceback
from waflib import Task,Logs,Utils
from waflib.TaskGen import extension
from waflib.Tools import c_preproc
@extension('.rc')
def rc_file(self,node):
obj_e... |
rwakulszowa/servo | refs/heads/master | tests/wpt/web-platform-tests/mathml/tools/underover.py | 101 | #!/usr/bin/python
from utils import mathfont
import fontforge
breveCodePoint = 0x2D8 # accent operator
degreeCodePoint = 0xB0 # nonaccent operator
accentBaseHeight = 4 * mathfont.em
v = 3 * mathfont.em
f = mathfont.create("underover-accentbaseheight%d-overbarextraascender%d" % (accentBaseHeight, v))
mathfont.createS... |
saurabh6790/medsyn-app1 | refs/heads/master | utilities/repost_stock.py | 29 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import webnotes
from webnotes.utils import flt
def repost(allow_negative_stock=False):
"""
Repost everything!
"""
webnotes.conn.auto_commit_on... |
afrolov1/nova | refs/heads/master | nova/api/openstack/compute/schemas/v3/extended_volumes.py | 31 | # Copyright 2013 NEC Corporation. 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 ... |
adlius/osf.io | refs/heads/develop | api/actions/permissions.py | 6 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from rest_framework import permissions as drf_permissions
from api.base.utils import get_user_auth
from osf.models.action import ReviewAction
from osf.models.mixins import ReviewableMixin, ReviewProviderMixin
from osf.utils.workflows import ReviewTrigger... |
ghchinoy/tensorflow | refs/heads/master | tensorflow/contrib/keras/api/keras/preprocessing/image/__init__.py | 27 | # 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... |
philanthropy-u/edx-platform | refs/heads/master | openedx/core/djangoapps/user_api/tests/factories.py | 13 | """Provides factories for User API models."""
from factory.django import DjangoModelFactory
from factory import SubFactory
from student.tests.factories import UserFactory
from opaque_keys.edx.locator import CourseLocator
from ..models import UserCourseTag, UserOrgTag, UserPreference
# Factories are self documenting
... |
richardfergie/googleads-python-lib | refs/heads/master | examples/dfp/v201502/team_service/get_teams_by_statement.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... |
odoo-brazil/l10n-brazil-wip | refs/heads/10.0-develop | l10n_br_account_product/wizard/l10n_br_account_document_status_sefaz.py | 2 | # -*- coding: utf-8 -*-
# Copyright (C) 2013 Luis Felipe Miléo - KMEE
# Copyright (C) 2014 Renato Lima - Akretion
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from openerp import models, fields, api
class L10nBrAccountDocumentStatusSefaz(models.TransientModel):
""" Check fiscal document key""... |
bringsvor/account-financial-tools | refs/heads/8.0 | account_balance_line/account_move_line.py | 31 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Vincent Renaville (Camptocamp)
# Copyright 2010-2014 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public... |
BondAnthony/ansible | refs/heads/devel | lib/ansible/plugins/inventory/auto.py | 29 | # Copyright (c) 2017 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
DOCUMENTATION = '''
name: auto
author:
- Matt Davis (@nitzmahone)
version_added: "... |
bnsantos/python-junk-code | refs/heads/master | algorithms/math/fibonacci.py | 1 | __author__ = 'bruno'
import helper.validateInput as ValidateInput
def recursive(n):
if ValidateInput.validate_integer_positive_input(n):
if n == 0:
return 0
elif n == 1:
return 1
else:
return recursive(n-1)+recursive(n-2)
else:
return None
... |
sdh11/gnuradio | refs/heads/master | gr-digital/python/digital/ofdm_txrx.py | 6 | #
# Copyright 2013 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 version.
#
#... |
m3pt0r/l0l | refs/heads/master | core/database/Linux86/cd_eject.py | 2 | #http://shell-storm.org/shellcode/files/shellcode-621.php
def cd_eject():
shellcode = r"\x6a\x0b\x58\x99\x52\x6a\x6d\x68\x63\x64\x72\x6f\x89\xe1\x52"
shellcode += r"\x66\x68\x63\x74\x68\x2f\x65\x6a\x65\x68\x2f\x62\x69\x6e\x68"
shellcode += r"\x2f\x75\x73\x72\x89\xe3\x52\x51\x53\x89\xe1\xcd\x80\x40\xcd\x80"
retur... |
guerrierk/dolibarr | refs/heads/develop | htdocs/modulebuilder/template/doc/user/source/conf.py | 19 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# My Module documentation build configuration file, created by
# sphinx-quickstart on Mon Sep 26 17:54:17 2016.
#
# 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
# ... |
gres147679/IngSoftwareRectaFinal | refs/heads/master | Tarea4/testingPostpago.py | 1 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import unittest
import psycopg2
import database
import dbparams
import Factura
import metodoFacturacionPrepago
import sys,os
import datetime
# Set de Pruebas para el Módulo Facturas
#
# Se han realizado una serie de pruebas unitarias destinadas a comprobar la eficacia
# del ... |
Conflei/ATI | refs/heads/master | [ATI] Misfenterest/Frontend/env/lib/python2.6/site-packages/pip/vcs/subversion.py | 280 | from __future__ import absolute_import
import logging
import os
import re
from pip._vendor.six.moves.urllib import parse as urllib_parse
from pip.index import Link
from pip.utils import rmtree, display_path
from pip.utils.logging import indent_log
from pip.vcs import vcs, VersionControl
_svn_xml_url_re = re.compile... |
bgavran/DNC | refs/heads/master | src/utils.py | 1 | import os
class ProjectPath:
base = os.path.dirname(os.path.dirname(__file__))
def __init__(self, log_dir):
self.log_dir = log_dir
from time import localtime, strftime
self.timestamp = strftime("%B_%d__%H:%M", localtime())
self.log_path = os.path.join(ProjectPath.base, self.... |
sencha/chromium-spacewalk | refs/heads/master | build/inverse_depth.py | 133 | #!/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 os
import sys
def DoMain(argv):
depth = argv[0]
return os.path.relpath(os.getcwd(), os.path.abspath(depth))
def main(arg... |
alexlo03/ansible | refs/heads/devel | test/units/modules/network/f5/test_bigip_profile_dns.py | 8 | # -*- coding: utf-8 -*-
#
# Copyright: (c) 2017, F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import json
import pytest
import sys
from nose.plugins.skip i... |
xrmx/django-stored-messages | refs/heads/master | stored_messages/urls.py | 2 | """
At the moment this module does something only when restframework is available
"""
from django.conf import settings
if 'rest_framework' in settings.INSTALLED_APPS:
from rest_framework.routers import DefaultRouter
from django.conf.urls import url, include
from . import views
router = DefaultRouter()... |
flipjack/django | refs/heads/master | oscar/test/factories/catalogue.py | 47 | # coding=utf-8
import factory
from oscar.core.loading import get_model
__all__ = [
'ProductClassFactory', 'ProductFactory',
'CategoryFactory', 'ProductCategoryFactory',
'ProductAttributeFactory', 'AttributeOptionGroupFactory',
'OptionFactory', 'AttributeOptionFactory',
'ProductAttributeValueFactor... |
ilexius/odoo | refs/heads/master | addons/account/wizard/account_move_reversal.py | 46 | from openerp import models, fields, api
from openerp.tools.translate import _
class AccountMoveReversal(models.TransientModel):
"""
Account move reversal wizard, it cancel an account move by reversing it.
"""
_name = 'account.move.reversal'
_description = 'Account move reversal'
date = fields.... |
pulinagrawal/nupic | refs/heads/master | tests/unit/nupic/algorithms/anomaly_likelihood_test.py | 12 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013-2015, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This p... |
martinjuckes/ceda_cc | refs/heads/master | ceda_cc/utils_c4.py | 1 | """A set of classes running checks and providing utilities to support checks"""
import string, re, os, sys, traceback, ctypes, collections
def strmm3( mm ):
return string.join( map( lambda x: '%s="%s" [correct: "%s"]' % x, mm ), '; ' )
from fcc_utils import mipTableScan
from xceptions import *
re_dlr01 = re.compil... |
ehdr/luigi | refs/heads/master | test/runtests.py | 99 | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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... |
pantsbuild/pex | refs/heads/main | pex/vendor/_vendored/pip/pip/_internal/operations/install/legacy.py | 15 | """Legacy installation process, i.e. `setup.py install`.
"""
import logging
import os
import sys
from distutils.util import change_root
from pip._internal.exceptions import InstallationError
from pip._internal.utils.logging import indent_log
from pip._internal.utils.misc import ensure_dir
from pip._internal.utils.set... |
jsakamoto/selenium | refs/heads/master | py/test/selenium/webdriver/common/frame_switching_tests.py | 3 | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... |
meabsence/python-for-android | refs/heads/master | python3-alpha/python3-src/Lib/curses/textpad.py | 155 | """Simple textbox editing widget with Emacs-like keybindings."""
import curses
import curses.ascii
def rectangle(win, uly, ulx, lry, lrx):
"""Draw a rectangle with corners at the provided upper-left
and lower-right coordinates.
"""
win.vline(uly+1, ulx, curses.ACS_VLINE, lry - uly - 1)
win.hline(u... |
ReganBell/QReview | refs/heads/master | examples/drawing/degree_histogram.py | 30 | #!/usr/bin/env python
"""
Random graph from given degree sequence.
Draw degree rank plot and graph with matplotlib.
"""
__author__ = """Aric Hagberg <aric.hagberg@gmail.com>"""
import networkx as nx
import matplotlib.pyplot as plt
G = nx.gnp_random_graph(100,0.02)
degree_sequence=sorted(nx.degree(G).values(),reverse=T... |
yyjiang/scikit-learn | refs/heads/master | benchmarks/bench_plot_incremental_pca.py | 374 | """
========================
IncrementalPCA benchmark
========================
Benchmarks for IncrementalPCA
"""
import numpy as np
import gc
from time import time
from collections import defaultdict
import matplotlib.pyplot as plt
from sklearn.datasets import fetch_lfw_people
from sklearn.decomposition import Incre... |
yograterol/django | refs/heads/master | django/conf/locale/eo/formats.py | 504 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = r'j\-\a \d\e F Y' # '26-a ... |
Huluzai/DoonSketch | refs/heads/master | inkscape-0.48.5/share/extensions/webslicer_create_group.py | 1 | #!/usr/bin/env python
'''
Copyright (C) 2010 Aurelio A. Heckert, aurium (a) gmail dot com
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any late... |
rafalkowalski/open-event-orga-server | refs/heads/development | migrations/versions/dc0f787c88ae_.py | 10 | """empty message
Revision ID: dc0f787c88ae
Revises: ('124271738482', '40911d5c6c5b')
Create Date: 2016-07-11 17:34:27.602000
"""
# revision identifiers, used by Alembic.
revision = 'dc0f787c88ae'
down_revision = ('124271738482', '40911d5c6c5b')
from alembic import op
import sqlalchemy as sa
import sqlalchemy_utils
... |
chirpradio/chirpradio-volunteers | refs/heads/master | site-packages/django/forms/widgets.py | 3 | """
HTML Widget classes
"""
try:
set
except NameError:
from sets import Set as set # Python 2.3 fallback
import copy
from itertools import chain
from django.conf import settings
from django.utils.datastructures import MultiValueDict, MergeDict
from django.utils.html import escape, conditional_escape
from dj... |
libo/Enigma2 | refs/heads/master | lib/python/Screens/FactoryReset.py | 39 | from Screens.MessageBox import MessageBox
class FactoryReset(MessageBox):
def __init__(self, session):
MessageBox.__init__(self, session, _("When you do a factory reset, you will lose ALL your configuration data\n"
"(including bouquets, services, satellite data ...)\n"
"After completion of factory reset, your... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.