repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
elit3ge/SickRage | refs/heads/master | lib/sqlalchemy/orm/evaluator.py | 79 | # orm/evaluator.py
# Copyright (C) 2005-2014 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
import operator
from ..sql import operators
class UnevaluatableError(Exception):
... |
gnarula/eden_deployment | refs/heads/master | controllers/setup.py | 1 | # -*- coding: utf-8 -*-
import os
"""
Setup Tool
"""
module = request.controller
resourcename = request.function
if not settings.has_module(module):
raise HTTP(404, body="Module disabled: %s" % module)
def index():
""" Show the index """
return dict()
def local_deploy():
s3db.configure("setup_de... |
goldeneye-source/ges-python | refs/heads/master | lib/ctypes/test/test_parameters.py | 11 | import unittest, sys
class SimpleTypesTestCase(unittest.TestCase):
def setUp(self):
import ctypes
try:
from _ctypes import set_conversion_mode
except ImportError:
pass
else:
self.prev_conv_mode = set_conversion_mode("ascii", "strict")
def te... |
bingsyslab/360projection | refs/heads/master | cube.py | 1 | import cv2
import numpy as np
def deg2rad(d):
return float(d) * np.pi / 180
def xrotation(th):
c = np.cos(th)
s = np.sin(th)
return np.array([[1, 0, 0], [0, c, s], [0, -s, c]])
def yrotation(th):
c = np.cos(th)
s = np.sin(th)
return np.array([[c, 0, s], [0, 1, 0], [-s, 0, c]])
class Face:
def __ini... |
marcsans/cf-cold-start | refs/heads/master | src/similarity.py | 1 |
# coding: utf-8
# In[1]:
import numpy as np
import pandas as pd
# In[2]:
def similarity(U):
num_users = U.shape[0]
min_dist = 0.01
sim = np.eye(num_users)
for i in range(num_users):
for j in range(i):
s = 1 / (min_dist + np.arccos(np.dot(U[i,:], U[j,:].T)/(np.linalg.norm(U[i,:]... |
junix/powerline | refs/heads/develop | powerline/listers/vim.py | 18 | # vim:fileencoding=utf-8:noet
from __future__ import (unicode_literals, division, absolute_import, print_function)
from powerline.theme import requires_segment_info
from powerline.bindings.vim import (current_tabpage, list_tabpages, vim_getbufoption)
try:
import vim
except ImportError:
vim = {}
def tabpage_update... |
Avinash-Raj/appengine-django-skeleton | refs/heads/master | lib/django/core/management/commands/createcachetable.py | 342 | from django.conf import settings
from django.core.cache import caches
from django.core.cache.backends.db import BaseDatabaseCache
from django.core.management.base import BaseCommand, CommandError
from django.db import (
DEFAULT_DB_ALIAS, connections, models, router, transaction,
)
from django.db.utils import Databa... |
KaranToor/MA450 | refs/heads/master | google-cloud-sdk/lib/surface/genomics/datasets/restore.py | 6 | # 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 by applicable law or ag... |
JavML/django | refs/heads/master | tests/gis_tests/test_geoip2.py | 75 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
import unittest
from unittest import skipUnless
from django.conf import settings
from django.contrib.gis.geoip2 import HAS_GEOIP2
from django.contrib.gis.geos import HAS_GEOS, GEOSGeometry
from django.test import mock
from django.utils import s... |
diego-d5000/MisValesMd | refs/heads/master | env/lib/python2.7/site-packages/django/utils/regex_helper.py | 1 | """
Functions for reversing a regular expression (used in reverse URL resolving).
Used internally by Django and not intended for external use.
This is not, and is not intended to be, a complete reg-exp decompiler. It
should be good enough for a large class of URLS, however.
"""
from __future__ import unicode_li... |
laurent-george/weboob | refs/heads/master | weboob/capabilities/pricecomparison.py | 7 | # -*- coding: utf-8 -*-
# Copyright(C) 2012 Romain Bignon
#
# This file is part of weboob.
#
# weboob is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your opti... |
newmediamedicine/indivo_server_1_0 | refs/heads/master | utils/datasections/machine_apps.py | 1 | from indivo import models
import importer_utils
class Machine_apps:
machineapp_tags = ('name', 'email', 'consumer_key', 'secret', 'app_type')
def __init__(self, machineapps_node, verbosity):
self.process_machineapps(machineapps_node, verbosity)
def process_machineapps(self, machineapps_node, verbosity):
... |
dracorpg/python-ivi | refs/heads/master | ivi/testequity/testequityf4.py | 6 | """
Python Interchangeable Virtual Instrument Library
Driver for Test Equity Model 140
Copyright (c) 2014 Jeff Wurzbach
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, inclu... |
shaufi/odoo | refs/heads/8.0 | addons/hr_payroll/wizard/__init__.py | 442 | #-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# d$
#
# This program is free software: you can redistribute it and/or modify
# it ... |
sniegu/django-surround | refs/heads/master | surround/django/basic/invalid_subdomain_urls.py | 1 | from django.conf.urls import patterns, url
from django.http import Http404
def invalid_host_view(request):
raise Http404('unmatched domain: %s' % request.get_host())
urlpatterns = patterns('portal.views',
url(r'^.*$', invalid_host_view),
)
|
PaulKinlan/cli-caniuse | refs/heads/master | site/app/scripts/bower_components/jsrepl-build/extern/python/closured/lib/python2.7/distutils/command/upload.py | 176 | """distutils.command.upload
Implements the Distutils 'upload' subcommand (upload package to PyPI)."""
import os
import socket
import platform
from urllib2 import urlopen, Request, HTTPError
from base64 import standard_b64encode
import urlparse
import cStringIO as StringIO
from hashlib import md5
from distutils.errors... |
dennis-sheil/commandergenius | refs/heads/sdl_android | project/jni/python/src/Lib/test/test_StringIO.py | 55 | # Tests StringIO and cStringIO
import unittest
import StringIO
import cStringIO
import types
from test import test_support
class TestGenericStringIO(unittest.TestCase):
# use a class variable MODULE to define which module is being tested
# Line of data to test as string
_line = 'abcdefghijklmnopqrstuvwx... |
z0by/django | refs/heads/master | django/contrib/flatpages/migrations/0001_initial.py | 134 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('sites', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='FlatPage',
fields=[
... |
bwsblake/lettercounter | refs/heads/master | django-norel-env/lib/python2.7/site-packages/django/utils/timesince.py | 79 | from __future__ import unicode_literals
import datetime
from django.utils.timezone import is_aware, utc
from django.utils.translation import ungettext, ugettext
def timesince(d, now=None, reversed=False):
"""
Takes two datetime objects and returns the time between d and now
as a nicely formatted string, ... |
krintoxi/NoobSec-Toolkit | refs/heads/master | NoobSecToolkit /tools/inject/waf/uspses.py | 10 | #!/usr/bin/env python
"""
Copyright (c) 2006-2015 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
import re
from lib.core.enums import HTTP_HEADER
from lib.core.settings import WAF_ATTACK_VECTORS
__product__ = "USP Secure Entry Server (United Security Providers)"
def de... |
pforret/python-for-android | refs/heads/master | python-modules/twisted/twisted/conch/checkers.py | 59 | # -*- test-case-name: twisted.conch.test.test_checkers -*-
# Copyright (c) 2001-2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Provide L{ICredentialsChecker} implementations to be used in Conch protocols.
"""
import os, base64, binascii, errno
try:
import pwd
except ImportError:
pwd = None
e... |
Kytoh/authpuppy | refs/heads/master | ap-node-extra-plugin/web/js/lib/build/build.py | 28 | #!/usr/bin/env python
import sys
sys.path.append("../tools")
import mergejs
have_compressor = None
try:
import jsmin
have_compressor = "jsmin"
except ImportError:
try:
import minimize
have_compressor = "minimize"
except Exception, E:
print E
pass
sourceDirectory = "../... |
gangadharkadam/letzfrappe | refs/heads/v5.0 | frappe/patches/v5_0/communication_parent.py | 74 | import frappe
def execute():
frappe.reload_doc("core", "doctype", "communication")
frappe.db.sql("""update tabCommunication set reference_doctype = parenttype, reference_name = parent""")
|
lthurlow/Network-Grapher | refs/heads/master | proj/internal/vuln-scan.py | 1 | #!/usr/bin/python
nessus = "/opt/nessus/bin/nessus"
print nessus
in_file = open("EXTENDED","r")
ip_list = []
count = 0
fcount = 0
out_file = open("TESTX","w")
for line in in_file:
if count % 31 == 0:
out_file.close()
filename = "IPS-"+str(fcount)
out_file = open(filename,"w")
fcount += 1
count... |
j0nathan33/CouchPotatoServer | refs/heads/develop | libs/enzyme/riff.py | 179 | # -*- coding: utf-8 -*-
# enzyme - Video metadata parser
# Copyright 2011-2012 Antoine Bertin <diaoulael@gmail.com>
# Copyright 2003-2006 Thomas Schueppel <stain@acm.org>
# Copyright 2003-2006 Dirk Meyer <dischi@freevo.org>
#
# This file is part of enzyme.
#
# enzyme is free software; you can redistribute it and/or mod... |
EelcoHoogendoorn/Numpy_arraysetops_EP | refs/heads/master | setup.py | 1 | from setuptools import find_packages, setup
from version import __version__
setup(
name="numpy-indexed",
packages=find_packages(),
version=__version__,
install_requires=['numpy', 'future'],
keywords="numpy group_by set-operations indexing",
description=open("README.rst").readlines()[5],
... |
dmlc/mxnet | refs/heads/master | python/mxnet/gluon/model_zoo/vision/squeezenet.py | 11 | # 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... |
NL66278/odoo | refs/heads/8.0 | addons/website_mail_group/models/mail_group.py | 321 | # -*- coding: utf-8 -*-
from openerp.osv import osv
from openerp import tools
from openerp.tools.translate import _
from openerp.tools.safe_eval import safe_eval as eval
from openerp.addons.website.models.website import slug
class MailGroup(osv.Model):
_inherit = 'mail.group'
def message_get_email_values(sel... |
stackArmor/security_monkey | refs/heads/develop | security_monkey/watchers/custom/awsinspector.py | 1 | """
.. module: security_monkey.watchers.custom.AwsInspector
:platform: Unix
.. version:: $$VERSION$$
.. moduleauthor:: Pritam D. Gautam <pritam.gautam@nuagebiz.tech> @nuage
"""
from datetime import datetime, timedelta
from security_monkey import app
from security_monkey.decorators import iter_account_region, rec... |
heladio/my-blog | refs/heads/master | pelica-env/lib/python2.7/sre.py | 4 | /usr/lib/python2.7/sre.py |
RobertWWong/WebDev | refs/heads/master | djangoApp/ENV/lib/python3.5/site-packages/django/conf/locale/pl/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 = 'j E Y'
TIME_FORMAT = 'H:i'
DATETI... |
anhstudios/swganh | refs/heads/develop | data/scripts/templates/object/mobile/shared_voritor_dasher.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 = Creature()
result.template = "object/mobile/shared_voritor_dasher.iff"
result.attribute_template_id = 9
result.s... |
typhainepl/genome3D | refs/heads/master | update_databases/scope_update.py | 1 | #!/usr/bin/env python
import urllib2
import os
import cx_Oracle
import re
import ConfigParser
import sys
import time
sys.path.insert(0,'/Users/typhaine/Desktop/genome3D/config/')
sys.path.insert(0,'/nfs/msd/work2/typhaine/genome3D/config/')
from config import dosql
configdata = ConfigParser.RawConfigParser()
confi... |
minlexx/pyevemon | refs/heads/master | esi_client/models/put_fleets_fleet_id_members_member_id_internal_server_error.py | 1 | # coding: utf-8
"""
EVE Swagger Interface
An OpenAPI for EVE Online
OpenAPI spec version: 0.4.6
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
class PutFleetsFleetIdMembersMemberIdInternalServerError(object)... |
DongliangGao/pydec | refs/heads/master | pydec/io/tests/test_arrayio.py | 6 | from pydec.testing import *
from scipy import arange, prod, reshape, rand, random, allclose, rank, zeros
from scipy.sparse import csr_matrix, csc_matrix, coo_matrix
from pydec.io.arrayio import write_array, read_array
#TODO replace with tempfile
filename = '/tmp/pydec_arrayio_testfile.dat'
class TestArrayIO():
... |
jendap/tensorflow | refs/heads/master | tensorflow/python/ops/signal/dct_ops.py | 10 | # 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... |
ryfeus/lambda-packs | refs/heads/master | Sklearn_scipy_numpy/source/scipy/linalg/_cython_wrapper_generators.py | 51 | """
Code generator script to make the Cython BLAS and LAPACK wrappers
from the files "cython_blas_signatures.txt" and
"cython_lapack_signatures.txt" which contain the signatures for
all the BLAS/LAPACK routines that should be included in the wrappers.
"""
from operator import itemgetter
fortran_types = {'int': 'integ... |
samedder/azure-cli | refs/heads/master | src/command_modules/azure-cli-storage/azure/cli/command_modules/storage/tests/test_storage_queue_scenarios.py | 3 | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
MrHamdulay/myjvm | refs/heads/master | klasses/java_lang_Float.py | 1 | from __future__ import absolute_import
import struct
def floatToRawIntBits(klass, vm, method, frame):
float_value = frame.get_local(0)
print 'float', float_value
assert isinstance(float_value, float)
int_bits = struct.unpack('>l', struct.pack('>f', float_value))[0]
return int_bits
|
open-power/eCMD | refs/heads/master | ecmd-core/pyapi/gen_apply.py | 2 | #!/usr/bin/env python
from fileinput import input
import re
# Read in a Python module generated by SWIG, extract all parameter names starting with o_
# or io_ and output a list of SWIG %apply statements to map them to output parameters.
o_names = set()
io_names = set()
def output(names, totype, fromtype):
print(... |
benoitsteiner/tensorflow-xsmm | refs/heads/master | tensorflow/contrib/training/python/training/evaluation_test.py | 15 | # 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 applicable ... |
servo/rust | refs/heads/master | src/etc/get-snapshot.py | 9 | #!/usr/bin/env python
#
# Copyright 2011-2014 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 lice... |
confluenity/uiside | refs/heads/master | app.py | 1 | # -*- coding: utf-8 -*-
# Test PySide-based GUI application application
import sys
import traceback
from PySide import QtGui
from PySide import QtCore
from uiside.dialogs.file import OpenFileDialog
from uiside.dialogs.file import SaveFileDialog
from uiside.dialogs.msg import MessageBox
class MainWindow(QtGui.QMain... |
Serag8/Bachelor | refs/heads/master | google_appengine/lib/django-1.3/django/contrib/gis/gdal/tests/test_ds.py | 137 | import os
import unittest
from django.contrib.gis.gdal import DataSource, Envelope, OGRGeometry, OGRException, OGRIndexError, GDAL_VERSION
from django.contrib.gis.gdal.field import OFTReal, OFTInteger, OFTString
from django.contrib.gis.geometry.test_data import get_ds_file, TestDS, TEST_DATA
# List of acceptable data ... |
jamesmf/recommenderW2V | refs/heads/master | scripts/keras/keras/initializations.py | 9 | from __future__ import absolute_import
import theano
import theano.tensor as T
import numpy as np
from .utils.theano_utils import sharedX, shared_zeros
def get_fans(shape):
fan_in = shape[0] if len(shape) == 2 else np.prod(shape[1:])
fan_out = shape[1] if len(shape) == 2 else shape[0]
return fan_in, fan_o... |
galenhz/micropython | refs/heads/master | examples/SDdatalogger/datalogger.py | 98 | # datalogger.py
# Logs the data from the acceleromter to a file on the SD-card
import pyb
# creating objects
accel = pyb.Accel()
blue = pyb.LED(4)
switch = pyb.Switch()
# loop
while True:
# wait for interrupt
# this reduces power consumption while waiting for switch press
pyb.wfi()
# start if switc... |
davidlmorton/spikepy | refs/heads/master | spikepy/developer/file_interpreter.py | 1 | # Copyright (C) 2012 David Morton
#
# 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 distribut... |
ssh1/stbgui | refs/heads/master | tests/test_timer.py | 56 | import enigma
import sys
import time
import tests
#enigma.reset()
def test_timer(repeat = 0, timer_start = 3600, timer_length = 1000, sim_length = 86400 * 7):
import NavigationInstance
at = time.time()
t = NavigationInstance.instance.RecordTimer
print t
print "old mwt:", t.MaxWaitTime
t.MaxWaitTime = 86400 *... |
eammx/proyectosWeb | refs/heads/master | proyectoPython/env/lib/python3.6/site-packages/werkzeug/__init__.py | 1 | """
werkzeug
~~~~~~~~
Werkzeug is the Swiss Army knife of Python web development.
It provides useful classes and functions for any WSGI application to
make the life of a Python web developer much easier. All of the provided
classes are independent from each other so you can mix it with any other
library.
:copyright:... |
ar45/django | refs/heads/master | django/contrib/gis/db/backends/postgis/models.py | 396 | """
The GeometryColumns and SpatialRefSys models for the PostGIS backend.
"""
from django.contrib.gis.db.backends.base.models import SpatialRefSysMixin
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class PostGISGeometryColumns(models.Model):
... |
saifrahmed/bokeh | refs/heads/master | bokeh/tests/test_objects.py | 42 | from __future__ import absolute_import
import unittest
from mock import Mock
from six import add_metaclass
from six.moves import xrange
import copy
def large_plot(n):
from bokeh.models import (Plot, PlotContext, LinearAxis, Grid, GlyphRenderer,
ColumnDataSource, DataRange1d, PanTool, WheelZoomTool, BoxZoo... |
johnnyLadders/Nathive_CITA | refs/heads/master | utils/docgen/docclass.py | 1 | #!/usr/bin/env python
#coding=utf-8
# Nathive (and this file) 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 newer.
#
# You should have received a copy of the GNU General ... |
eromoe/pyspider | refs/heads/master | pyspider/libs/bench.py | 7 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8:
# Author: Binux<roy@binux.me>
# http://binux.me
# Created on 2014-12-08 22:23:10
# rate: 10000000000
# burst: 10000000000
import time
import logging
logger = logging.getLogger('bench')
from six.moves import queue ... |
kuri-kustar/pixhawk_plotting_tools | refs/heads/master | px4tools_scripts/px4tools/version.py | 1 |
# THIS FILE IS GENERATED FROM SETUP.PY
short_version = '0.7.7'
version = '0.7.7'
full_version = '0.7.7'
git_revision = 'Unknown'
release = True
if not release:
version = full_version
|
ALPSquid/thebutton-monitor | refs/heads/master | src/examples/limitlessled_example.py | 1 | import ledcontroller
from thebutton import TheButton
import math
class ButtonApp():
def __init__(self):
CONTROLLER_ADDRESS="192.168.1.119"
self.led = ledcontroller.LedController(CONTROLLER_ADDRESS)
self.group = 0 #Limitless LED Bulb Bridge Group of LEDs to use. 0 is all.
# Create a new instance of the b... |
stevenewey/django | refs/heads/master | django/utils/dateformat.py | 365 | """
PHP date() style date formatting
See http://www.php.net/date for format strings
Usage:
>>> import datetime
>>> d = datetime.datetime.now()
>>> df = DateFormat(d)
>>> print(df.format('jS F Y H:i'))
7th October 2003 11:39
>>>
"""
from __future__ import unicode_literals
import calendar
import datetime
import re
impo... |
phil65/xbmc | refs/heads/master | addons/service.xbmc.versioncheck/lib/aptdeamonhandler.py | 177 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Team-XBMC
#
# 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 versio... |
mesutcang/kendoku | refs/heads/master | runlab.py | 1 | #!/usr/bin/python2
# -*- encoding: utf-8 -*-
#
# Author: Peter Schüller (2014)
# Adapted from a script posted by Adam Marshall Smith on the potassco mailing list (2014)
#
import sys
import re
import json
import subprocess
import collections
import traceback
def extractExtensions(answerset):
#print(repr(answer_set))... |
neiudemo1/django | refs/heads/master | tests/cache/liberal_backend.py | 446 | from django.core.cache.backends.locmem import LocMemCache
class LiberalKeyValidationMixin(object):
def validate_key(self, key):
pass
class CacheClass(LiberalKeyValidationMixin, LocMemCache):
pass
|
florian-dacosta/OCB | refs/heads/8.0 | addons/portal/wizard/share_wizard.py | 158 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2011 OpenERP S.A (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... |
TshepangRas/tshilo-dikotla | refs/heads/develop | td_maternal/admin/maternal_ultrasound_initial_admin.py | 2 | from collections import OrderedDict
from django.contrib import admin
from edc_export.actions import export_as_csv_action
from ..forms import MaternalUltraSoundInitialForm
from ..models import MaternalUltraSoundInitial
from .base_maternal_model_admin import BaseMaternalModelAdmin
class MaternalUltraSoundInitialAdmi... |
mars-knowsnothing/amos-bot | refs/heads/master | src/Lib/site-packages/wheel/egg2wheel.py | 471 | #!/usr/bin/env python
import os.path
import re
import sys
import tempfile
import zipfile
import wheel.bdist_wheel
import shutil
import distutils.dist
from distutils.archive_util import make_archive
from argparse import ArgumentParser
from glob import iglob
egg_info_re = re.compile(r'''(?P<name>.+?)-(?P<ver>.+?)
(-... |
go38/anki | refs/heads/master | aqt/customstudy.py | 18 | # Copyright: Damien Elmes <anki@ichi2.net>
# -*- coding: utf-8 -*-
# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
from aqt.qt import *
import aqt
from aqt.utils import showInfo, showWarning
from anki.consts import *
RADIO_NEW = 1
RADIO_REV = 2
RADIO_FORGOT = 3
RADIO_AHEAD = 4
RADIO_PRE... |
ygol/odoo | refs/heads/8.0 | addons/l10n_fr/wizard/fr_report_compute_resultant.py | 374 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2008 JAILLET Simon - CrysaLEAD - www.crysalead.fr
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
#... |
osmfj/sotmjp-website | refs/heads/master | sotmjp/proposals/apps.py | 2 | from __future__ import unicode_literals
from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
class ProposalsConfig(AppConfig):
name = "sotmjp.proposals"
verbose_name = _("Proposals")
|
block8437/python-gui-builder | refs/heads/master | loader.py | 1 | import os, gui
import xml.etree.ElementTree as ET
from Tkinter import *
import tkMessageBox
class NonexistantFileError(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
class InvalidGUILineError(Exception):
def __init__(self, value):
self.value = value
def... |
twobob/buildroot-kindle | refs/heads/master | output/build/host-python-2.7.2/Lib/stringprep.py | 278 | # This file is generated by mkstringprep.py. DO NOT EDIT.
"""Library that exposes various tables found in the StringPrep RFC 3454.
There are two kinds of tables: sets, for which a member test is provided,
and mappings, for which a mapping function is provided.
"""
from unicodedata import ucd_3_2_0 as unicodedata
ass... |
transt/cloud-init-0.7.5 | refs/heads/master | cloudinit/config/cc_disk_setup.py | 6 | # vi: ts=4 expandtab
#
# Copyright (C) 2009-2010 Canonical Ltd.
# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
#
# Author: Ben Howard <ben.howard@canonical.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License ... |
GabrielNicolasAvellaneda/kafka | refs/heads/trunk | system_test/system_test_env.py | 116 | # 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... |
caelan/stripstream | refs/heads/master | robotics/openrave/transforms.py | 1 | from openravepy import poseTransformPoints, matrixFromPose, matrixFromQuat, matrixFromAxisAngle, rotationMatrixFromQuat, quatFromAxisAngle, poseFromMatrix, axisAngleFromRotationMatrix, quatFromRotationMatrix, quatMult, quatInverse, quatRotateDirection, quatSlerp, RaveGetAffineDOFValuesFromTransform, DOFAffine, transf... |
RuudBurger/CouchPotatoServer | refs/heads/master | libs/synchronousdeluge/exceptions.py | 159 | __all__ = ["DelugeRPCError"]
class DelugeRPCError(Exception):
def __init__(self, name, msg, traceback):
self.name = name
self.msg = msg
self.traceback = traceback
def __str__(self):
return "{0}: {1}: {2}".format(self.__class__.__name__, self.name, self.msg)
|
ProfessionalIT/maxigenios-website | refs/heads/master | sdk/google_appengine/google/appengine/tools/devappserver2/endpoints/endpoints_server_test.py | 8 | #!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... |
dmanev/ArchExtractor | refs/heads/master | ArchExtractor/tests/testgen/Base/SwComponent/PortInterface/DataElement_test.py | 1 | # auto-generated test file
import unittest
import umlgen.Base.SwComponent.PortInterface.DataElement
# Start of user code imports
from Datatype.DataType import DataType
# End of user code
class DataElementTest(unittest.TestCase):
def setUp(self):
# self._testInstance = umlgen.Base.SwComponent.PortInterface.... |
pacificIT/mopidy | refs/heads/develop | mopidy/internal/__init__.py | 190 | from __future__ import absolute_import, unicode_literals
|
kpdyer/regex2dfa | refs/heads/master | third_party/re2/re2/testing/unicode_test.py | 325 | #!/usr/bin/python2.4
#
# Copyright 2008 The RE2 Authors. All Rights Reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
"""Unittest for the util/regexp/re2/unicode.py module."""
import os
import StringIO
from google3.pyglib import flags
from google3.testing... |
pfhayes/boto | refs/heads/develop | boto/s3/keyfile.py | 203 | # Copyright 2013 Google Inc.
# Copyright 2011, Nexenta Systems Inc.
#
# 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, co... |
songmonit/CTTMSONLINE_V8 | refs/heads/master | addons/account/report/account_invoice_report.py | 224 | # -*- 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... |
malayaleecoder/servo | refs/heads/master | python/mach/mach/mixin/logging.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/.
from __future__ import absolute_import, unicode_literals
import logging
class LoggingMixin(object):
"""Provides f... |
sparkslabs/kamaelia_ | refs/heads/master | Sketches/AB/backup/AB-Dev/Kamaelia/Apps/Whiteboard/SmartBoard.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... |
paulfitz/phantomjs | refs/heads/master | src/qt/qtwebkit/Tools/Scripts/webkitpy/common/system/workspace.py | 189 | # Copyright (c) 2010 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 of conditions and the ... |
daniarherikurniawan/Chameleon512 | refs/heads/master | src/contrib/hod/hodlib/GridServices/__init__.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... |
hanzorama/magenta | refs/heads/master | magenta/music/music21_to_note_sequence_io_test.py | 1 | # Copyright 2016 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 by applicable law or ag... |
gary-pickens/HouseMonitor | refs/heads/master | housemonitor/lib/moduleloader.py | 1 | '''
Created on Sep 17, 2012
@author: Gary
'''
import imp
import os
import sys
from sets import Set
import re
import inspect
from housemonitor.lib.base import Base
from housemonitor.configuration.xmlconfiguration import XmlConfiguration
from housemonitor.lib.getdatetime import GetDateTime
class ModuleLoader( Base ):... |
dcroc16/skunk_works | refs/heads/master | google_appengine/lib/django-1.3/tests/regressiontests/backends/models.py | 55 | from django.contrib.contenttypes import generic
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.db import connection
class Square(models.Model):
root = models.IntegerField()
square = models.PositiveIntegerField()
def __unicode__(self):
return "%... |
jsoref/django | refs/heads/master | django/contrib/gis/geos/linestring.py | 8 | from django.contrib.gis.geos import prototypes as capi
from django.contrib.gis.geos.coordseq import GEOSCoordSeq
from django.contrib.gis.geos.error import GEOSException
from django.contrib.gis.geos.geometry import (
GEOSGeometry, ProjectInterpolateMixin,
)
from django.contrib.gis.geos.point import Point
from django... |
SnappleCap/oh-mainline | refs/heads/master | vendor/packages/kombu/funtests/tests/test_couchdb.py | 22 | from nose import SkipTest
from funtests import transport
class test_couchdb(transport.TransportCase):
transport = 'couchdb'
prefix = 'couchdb'
event_loop_max = 100
def before_connect(self):
try:
import couchdb # noqa
except ImportError:
raise SkipTest('couchd... |
mariecpereira/IA369Z | refs/heads/master | deliver/ia870/iagrain.py | 2 | # -*- encoding: utf-8 -*-
# Module iagrain
import numpy as np
from string import upper
def iagrain(fr, f, measurement, option="image"):
measurement = upper(measurement)
option = upper(option)
if fr.ndim == 1: fr = fr[newaxis,:]
n = fr.max()
if option == 'DATA': y = np.empty((n,),np.float)
... |
showgood/YCM_windows | refs/heads/master | python/ycm/completers/all/identifier_completer.py | 4 | #!/usr/bin/env python
#
# Copyright (C) 2011, 2012 Google Inc.
#
# This file is part of YouCompleteMe.
#
# YouCompleteMe 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
# (... |
googledatalab/pydatalab | refs/heads/master | google/datalab/utils/facets/generic_feature_statistics_generator.py | 4 | # Copyright 2017 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 by applicable law or a... |
turbomanage/training-data-analyst | refs/heads/master | courses/machine_learning/deepdive2/structured/solutions/serving/application/lib/werkzeug/useragents.py | 7 | # -*- coding: utf-8 -*-
"""
werkzeug.useragents
~~~~~~~~~~~~~~~~~~~
This module provides a helper to inspect user agent strings. This module
is far from complete but should work for most of the currently available
browsers.
:copyright: 2007 Pallets
:license: BSD-3-Clause
"""
import re
... |
Azure/azure-sdk-for-python | refs/heads/sync-eng/common-js-nightly-docs-2-1768-ForTestPipeline | sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/aio/operations/_top_level_domains_operations.py | 1 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... |
jopohl/urh | refs/heads/master | src/urh/ui/ElidedLabel.py | 1 | from PyQt5.QtCore import QSize, Qt
from PyQt5.QtGui import QFontMetrics
from PyQt5.QtWidgets import QLabel
class ElidedLabel(QLabel):
def __init__(self, parent=None):
super().__init__(parent)
self.full_text = ""
def __set_elided_text(self):
fm = QFontMetrics(self.font())
super... |
vikas1885/test1 | refs/heads/master | cms/djangoapps/contentstore/views/tests/utils.py | 198 | """
Utilities for view tests.
"""
import json
from contentstore.tests.utils import CourseTestCase
from contentstore.views.helpers import xblock_studio_url
from xmodule.modulestore.tests.factories import ItemFactory
class StudioPageTestCase(CourseTestCase):
"""
Base class for all tests of Studio pages.
"... |
mesosphere-mergebot/mergebot-test-dcos | refs/heads/master | packages/adminrouter/extra/src/test-harness/modules/mocker/endpoints/reflectors.py | 13 | # Copyright (C) Mesosphere, Inc. See LICENSE file for details.
"""All the code relevant for reflecting mocker, both Unix Socket and TCP/IP based"""
import logging
from mocker.endpoints.basehandler import BaseHTTPRequestHandler
from mocker.endpoints.generic import TcpIpHttpEndpoint, UnixSocketHTTPEndpoint
# pylint: ... |
darkleons/BE | refs/heads/master | addons/website_event_sale/__init__.py | 1577 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... |
fuhongliang/erpnext | refs/heads/develop | erpnext/hr/doctype/job_opening/test_job_opening.py | 87 | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
# test_records = frappe.get_test_records('Job Opening')
class TestJobOpening(unittest.TestCase):
pass
|
opennetworkinglab/onos | refs/heads/master | tools/test/topos/sol.py | 43 | #!/usr/bin/python
import sys, solar
topo = solar.Solar(cips=sys.argv[1:])
topo.run()
|
tangyiyong/odoo | refs/heads/8.0 | setup/win32/win32_service.py | 362 | # -*- coding: utf-8 -*-
import servicemanager
import win32api
import win32process
import win32service
import win32serviceutil
import subprocess
import sys
from os.path import dirname, join, split
execfile(join(dirname(__file__), '..', 'server', 'openerp', 'release.py'))
class OdooService(win32serviceutil.ServiceF... |
nvoron23/hue | refs/heads/master | desktop/core/ext-py/python-openid-2.2.5/openid/test/test_negotiation.py | 74 |
import unittest
from support import CatchLogs
from openid.message import Message, OPENID2_NS, OPENID1_NS, OPENID_NS
from openid import association
from openid.consumer.consumer import GenericConsumer, ServerError
from openid.consumer.discover import OpenIDServiceEndpoint, OPENID_2_0_TYPE
class ErrorRaisingConsumer(G... |
saurabh6790/test-med-app | refs/heads/master | patches/february_2013/p04_remove_old_doctypes.py | 30 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
import webnotes, os
def execute():
webnotes.delete_doc("DocType", "Product")
webnotes.delete_doc("DocType", "Test")
webnotes.delete_doc("Module Def", "Test")
os.system("rm -rf app/te... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.