repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
Shawnxkwang/CS0008-f2016 | f2016_cs8_xiw69_a1/f2016_cs8_xiw69_a1.py | 1 | 2622 |
# Xiaokai Wang
# xiw69@pitt.edu
# CS 0008
# assignmnet #1
# ask the user to input preferred unit system/ distance driven/ gas usage
choice = input("Please enter your preferred unit system (USC/Metric): ")
dist = float(input("Please input your distance driven: "))
gas = float(input("Please input your gas usage during... | mit |
Microsoft/PTVS | Python/Product/Miniconda/Miniconda3-x64/Lib/site-packages/conda/core/portability.py | 1 | 7021 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
from logging import getLogger
from os.path import realpath
import re
import struct
from ..base.constants import PREFIX_PLACEHOLDER
from ..common.compat import on_win
from ..exceptions import CondaIOError, Binary... | apache-2.0 |
ChenJunor/hue | desktop/core/ext-py/tablib-0.10.0/tablib/formats/_xls.py | 34 | 3266 | # -*- coding: utf-8 -*-
""" Tablib - XLS Support.
"""
import sys
from tablib.compat import BytesIO, xlwt, xlrd, XLRDError
import tablib
title = 'xls'
extensions = ('xls',)
# special styles
wrap = xlwt.easyxf("alignment: wrap on")
bold = xlwt.easyxf("font: bold on")
def detect(stream):
"""Returns True if give... | apache-2.0 |
sudhaMR/Django-Perception | imgpage/urls.py | 1 | 1204 | """perception URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-... | mit |
gauravbose/digital-menu | digimenu2/build/lib.linux-x86_64-2.7/django/contrib/gis/utils/wkt.py | 589 | 1923 | """
Utilities for manipulating Geometry WKT.
"""
from django.utils import six
def precision_wkt(geom, prec):
"""
Returns WKT text of the geometry according to the given precision (an
integer or a string). If the precision is an integer, then the decimal
places of coordinates WKT will be truncated t... | bsd-3-clause |
mila/django-noticebox | setup.py | 1 | 1110 | #!/usr/bin/env python
import codecs
from setuptools import setup, find_packages
url='http://github.com/mila/django-noticebox/tree/master'
try:
long_description = codecs.open('README.rst', "r", "utf-8").read()
except IOError:
long_description = "See %s" % url
setup(
name='django-noticebox',
version... | bsd-3-clause |
ajnirp/servo | tests/wpt/web-platform-tests/conformance-checkers/tools/dl.py | 107 | 4915 | # -*- coding: utf-8 -*-
import os
ccdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
template = """<!DOCTYPE html>
<meta charset=utf-8>
"""
errors = {
"dl-in-p": "<p><dl><dt>text<dd>text</dl></p>",
"header-in-dt": "<dl><dt><header>text</header><dd>text</dl>",
"footer-in-dt": "<dl><dt><foot... | mpl-2.0 |
BorisJeremic/Real-ESSI-Examples | analytic_solution/test_cases/Contact/Interface_Mesh_Types/Interface_1/HardContact_ElPPlShear/compare_txt.py | 637 | 2094 | #!/usr/bin/python
import h5py
import sys
import numpy as np
import os
import re
import random
# find the path to my own python function:
cur_dir=os.getcwd()
sep='test_cases'
test_DIR=cur_dir.split(sep,1)[0]
scriptDIR=test_DIR+'compare_function'
sys.path.append(scriptDIR)
# import my own function for color and comparat... | cc0-1.0 |
alfa-jor/addon | mediaserver/lib/chardet/sjisprober.py | 290 | 3774 | ######################## 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... | gpl-3.0 |
iruga090/python-social-auth | social/backends/gae.py | 89 | 1292 | """
Google App Engine support using User API
"""
from __future__ import absolute_import
from google.appengine.api import users
from social.backends.base import BaseAuth
from social.exceptions import AuthException
class GoogleAppEngineAuth(BaseAuth):
"""GoogleAppengine authentication backend"""
name = 'googl... | bsd-3-clause |
develnk/irbispanel | admin/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja_test.py | 1843 | 1786 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
""" Unit tests for the ninja.py file. """
import gyp.generator.ninja as ninja
import unittest
import StringIO
import sys
import TestCommon
... | lgpl-3.0 |
vbannai/neutron | neutron/db/migration/alembic_migrations/versions/folsom_initial.py | 5 | 19679 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2012 New Dream Network, LLC (DreamHost)
#
# 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/li... | apache-2.0 |
neumark/unimodel | test/test_model_registry.py | 1 | 1934 | from unittest import TestCase
from test.helpers import flatten
from test.fixtures import TreeNode, tree_data
from unimodel.model import Unimodel, Field
from unimodel.types import *
import json
from unimodel.model import ModelRegistry
from unimodel.backends.json.serializer import JSONSerializer, JSONValidationException
... | apache-2.0 |
markeTIC/OCB | openerp/tools/image.py | 172 | 10660 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2012-today OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of... | agpl-3.0 |
jwren/intellij-community | python/helpers/third_party/thriftpy/_shaded_thriftpy/contrib/tracking/__init__.py | 7 | 7723 | # -*- coding: utf-8 -*-
"""
Tracking support similar to twitter finagle-thrift.
Note: When using tracking, every client should have a corresponding
server processor.
"""
from __future__ import absolute_import
import os.path
import time
from ...thrift import TClient, TApplicationException, TMessageType, \
TProc... | apache-2.0 |
braintreeps/moto | moto/datapipeline/responses.py | 14 | 2699 | from __future__ import unicode_literals
import json
from moto.core.responses import BaseResponse
from .models import datapipeline_backends
class DataPipelineResponse(BaseResponse):
@property
def parameters(self):
# TODO this should really be moved to core/responses.py
if self.body:
... | apache-2.0 |
CriticalD20/Sine-Cosine | sinecosine.py | 1 | 2215 | """
sinecosine.py
Author: James Napier
Credit: http://www.discoveryplayground.com/computer-programming-for-kids/rgb-colors/, Mr. Dennison
Assignment:
In this assignment you must use *list comprehensions* to generate sprites that show the behavior
of certain mathematical functions: sine and cosine.
The sine and cosi... | mit |
aerrami/mtools | mtools/test/test_all_import.py | 7 | 1549 | from nose.tools import nottest, make_decorator
from functools import wraps
# tools without any external dependencies
from mtools.mlogfilter.mlogfilter import MLogFilterTool
from mtools.mlogvis.mlogvis import MLogVisTool
from mtools.mloginfo.mloginfo import MLogInfoTool
tools = [MLogFilterTool, MLogVisTool, MLogInfoTo... | apache-2.0 |
CitizenB/ansible | contrib/inventory/apache-libcloud.py | 151 | 11756 | #!/usr/bin/env python
# (c) 2013, Sebastien Goasguen <runseb@gmail.com>
#
# 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 ... | gpl-3.0 |
brendandc/multilingual-google-image-scraper | create-language-zip.py | 1 | 3067 | import optparse
import os
optparser = optparse.OptionParser()
optparser.add_option("-l", "--language", dest="language", default="French", help="Language to package")
optparser.add_option("-b", "--bucket", dest="bucket", default="brendan.callahan.thesis", help="S3 bucket name")
optparser.add_option("-p", "--prefix", de... | mit |
wildjan/Flask | Work/TriviaMVAWjut/TriviaMVA/env/Lib/site-packages/setuptools/command/upload_docs.py | 390 | 6782 | # -*- coding: utf-8 -*-
"""upload_docs
Implements a Distutils 'upload_docs' subcommand (upload documentation to
PyPI's pythonhosted.org).
"""
from base64 import standard_b64encode
from distutils import log
from distutils.errors import DistutilsOptionError
from distutils.command.upload import upload
import os
import s... | apache-2.0 |
vlachoudis/sl4a | python/src/Lib/encodings/cp860.py | 593 | 34937 | """ Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP860.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_map)
def decode(self,input,errors='strict'):
... | apache-2.0 |
wreese/megacfs | vendor/github.com/google/certificate-transparency/python/ct/dashboard/grapher.py | 35 | 2026 | from datetime import datetime
import gviz_api
class GvizGrapher(object):
"""A grapher that produces JSON output for the Google Visualizaton
Datatable.
"""
def __init__(self):
pass
def _get_nested_attr(self, item, attr):
attributes = attr.split(".")
ret = item
for a... | apache-2.0 |
alilotfi/django | django/contrib/auth/management/commands/createsuperuser.py | 136 | 8602 | """
Management utility to create superusers.
"""
from __future__ import unicode_literals
import getpass
import sys
from django.contrib.auth import get_user_model
from django.contrib.auth.management import get_default_username
from django.contrib.auth.password_validation import validate_password
from django.core impor... | bsd-3-clause |
Deepakpatle/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/steps/validatereviewer.py | 119 | 2894 | # 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 th... | bsd-3-clause |
andreif/django | django/utils/decorators.py | 31 | 7500 | "Functions that help with dynamically creating decorators for views."
try:
from contextlib import ContextDecorator
except ImportError:
ContextDecorator = None
from functools import WRAPPER_ASSIGNMENTS, update_wrapper, wraps
from django.utils import six
class classonlymethod(classmethod):
def __get__(se... | bsd-3-clause |
synicalsyntax/zulip | zerver/tests/test_submessage.py | 7 | 4652 | from typing import Any, Dict, List
from unittest import mock
from zerver.lib.message import MessageDict
from zerver.lib.test_classes import ZulipTestCase
from zerver.models import Message, SubMessage
class TestBasics(ZulipTestCase):
def test_get_raw_db_rows(self) -> None:
cordelia = self.example_user('co... | apache-2.0 |
hadim/spindle_tracker | spindle_tracker/io/trackmate.py | 1 | 5663 | import itertools
import xml.etree.cElementTree as et
import networkx as nx
import pandas as pd
import numpy as np
def trackmate_peak_import(trackmate_xml_path, get_tracks=False):
"""Import detected peaks with TrackMate Fiji plugin.
Parameters
----------
trackmate_xml_path : str
TrackMate XML... | bsd-3-clause |
ftCommunity/ftcommunity-apps | packages/BenoiTXT/colormap.py | 2 | 17652 | #! /usr/bin/env python3
# -*- coding: utf-8 -*-
#
def listColorMaps():
return ["default","rainbow","forest","planet","beach","fire","dreamy","autumn","oeco telecom","icy","r-g-b","r-g-b 32","y-c-m","kill bill","amstrad","zuse","boole","roentgen","3d glasses","soylent green","douglas adams","matrix","from hell", "n... | gpl-3.0 |
kronat/ns-3-dev-git | src/network/bindings/modulegen__gcc_ILP32.py | 1 | 773065 | from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warnings.warn("exception %r in wrapper %s" % (exception, wrapper))
... | gpl-2.0 |
vvv1559/intellij-community | python/helpers/pydev/_pydev_runfiles/pydev_runfiles_unittest.py | 35 | 7553 | try:
import unittest2 as python_unittest # @UnresolvedImport
except:
import unittest as python_unittest
from _pydev_runfiles import pydev_runfiles_xml_rpc
import time
from _pydevd_bundle import pydevd_io
import traceback
from _pydevd_bundle.pydevd_constants import * #@UnusedWildImport
#=====================... | apache-2.0 |
juanyaw/PTVS | Python/Tests/TestData/WFastCgi/DjangoSimpleAppUrlRewrite/DjangoApplication/wsgi.py | 56 | 1185 | """
WSGI config for DjangoApplication7 project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WS... | apache-2.0 |
zeptonaut/catapult | third_party/WebOb/webob/descriptors.py | 17 | 9038 | from datetime import (
date,
datetime,
)
import re
from webob.byterange import (
ContentRange,
Range,
)
from webob.compat import (
PY3,
text_type,
)
from webob.datetime_utils import (
parse_date,
serialize_date,
)
from webob.util import (
header_docstring,
wa... | bsd-3-clause |
gibxxi/nzbToMedia | libs/dogpile/cache/compat.py | 10 | 1219 | import sys
py2k = sys.version_info < (3, 0)
py3k = sys.version_info >= (3, 0)
py32 = sys.version_info >= (3, 2)
py27 = sys.version_info >= (2, 7)
jython = sys.platform.startswith('java')
win32 = sys.platform.startswith('win')
try:
import threading
except ImportError:
import dummy_threading as threading
if ... | gpl-3.0 |
myyk/duwamish | wsgi.py | 72 | 1232 | """
WSGI config for project project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` ... | gpl-3.0 |
40223136/w17test1 | static/Brython3.1.1-20150328-091302/Lib/sre_constants.py | 692 | 7172 | #
# Secret Labs' Regular Expression Engine
#
# various symbols used by the regular expression engine.
# run this script to update the _sre include files!
#
# Copyright (c) 1998-2001 by Secret Labs AB. All rights reserved.
#
# See the sre.py file for information on usage and redistribution.
#
"""Internal support modul... | gpl-3.0 |
damocles972/Sick-Beard | lib/hachoir_parser/archive/ar.py | 90 | 1734 | """
GNU ar archive : archive file (.a) and Debian (.deb) archive.
"""
from lib.hachoir_parser import Parser
from lib.hachoir_core.field import (FieldSet, ParserError,
String, RawBytes, UnixLine)
from lib.hachoir_core.endian import BIG_ENDIAN
class ArchiveFileEntry(FieldSet):
def createFields(self):
yi... | gpl-3.0 |
qiyuangong/leetcode | python/143_Reorder_List.py | 2 | 1441 | # Definition for singly-linked list.
# class ListNode(object):
# def __init__(self, x):
# self.val = x
# self.next = None
class Solution(object):
# def reorderList(self, head):
# """
# :type head: ListNode
# :rtype: void Do not return anything, modify head in-place inste... | mit |
google-code-export/quirkysoft | waf_tools/test_sox.py | 5 | 2740 | import unittest
import waftester
import Build
import sox
import base64
test_wav = """
UklGRqMBAABXQVZFZm10IBIAAAABAAEAgD4AAIA+AAABAAgAAABkYXRhfQEAAN7e3t7e3t7e3t7e
3t7e3t7e3t7bp9KnvK2zvLahxbbSqqHSs7+qsLOq597ng+Hn3uF83nnb24B5ht7b5IC/5+HngOfh
29580nbb24Z8mOHe54PV597kgOeA29t8fHzb296AquTe54DkfNjh3t7blYChpOHh3t7bgIB8gOTe
3t... | gpl-3.0 |
atosatto/ansible | lib/ansible/utils/module_docs_fragments/cnos.py | 77 | 3621 | # Copyright (C) 2017 Lenovo, Inc.
#
# 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.
#
# Ansi... | gpl-3.0 |
csuttles/utils | python/todo-api/flask/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/latin1prober.py | 1778 | 5232 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | apache-2.0 |
arjunjain/xssalert | XSSAlert/uipy/xss_rc.py | 1 | 164742 | # -*- coding: utf-8 -*-
# Resource object code
#
# Created by: The Resource Compiler for PyQt (Qt v4.7.1)
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore
qt_resource_data = "\
\x00\x00\x05\x44\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x20\x00\... | gpl-3.0 |
Ikuyadeu/codecombat | scripts/devSetup/which.py | 79 | 2385 | __author__ = 'root'
#copied from python3
import os
import sys
def which(cmd, mode=os.F_OK | os.X_OK, path=None):
"""Given a command, mode, and a PATH string, return the path which
conforms to the given mode on the PATH, or None if there is no such
file.
`mode` defaults to os.F_OK | os.X_OK. `path` def... | mit |
jirikuncar/invenio | invenio/modules/records/bases.py | 12 | 2784 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2014, 2015 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... | gpl-2.0 |
ritzk/ansible-modules-extras | system/firewalld.py | 4 | 15671 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Adam Miller (maxamillion@fedoraproject.org)
#
# 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 ... | gpl-3.0 |
pombredanne/brisk-hadoop-common | src/contrib/thriftfs/gen-py/hadoopfs/ThriftHadoopFileSystem.py | 107 | 107431 | #
# Autogenerated by Thrift
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
from thrift.Thrift import *
from ttypes import *
from thrift.Thrift import TProcessor
from thrift.transport import TTransport
from thrift.protocol import TBinaryProtocol
try:
from thrift.protocol import fastbinary
exce... | apache-2.0 |
wxgeo/geophar | wxgeometrie/sympy/printing/rcode.py | 3 | 14687 | """
R code printer
The RCodePrinter converts single sympy expressions into single R expressions,
using the functions defined in math.h where possible.
"""
from __future__ import print_function, division
from sympy.core import S
from sympy.core.compatibility import string_types, range
from sympy.codegen.ast import... | gpl-2.0 |
tianyang-li/de-novo-rna-seq-quant-1 | boost_1_51_0/libs/python/test/operators.py | 46 | 1166 | # Copyright David Abrahams 2004. Distributed under the Boost
# Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
'''
>>> from operators_ext import *
Check __nonzero__ support
>>> assert X(2)
>>> assert not X(0)
----
>>> x = X(42)
>>> x.val... | gpl-3.0 |
nanonyme/which | test/test_which.py | 16 | 6848 | #!/usr/bin/env python
# Copyright (c) 2002-2003 ActiveState Corp.
# Author: Trent Mick (TrentM@ActiveState.com)
"""Test suite for which.py."""
import sys
import os
import re
import tempfile
import unittest
import testsupport
#XXX:TODO
# - def test_registry_success(self): ...App Paths setting
# - def test_regist... | mit |
jpburstrom/sampleman | mainwindowui.py | 1 | 18965 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'sampleman.ui'
#
# Created: Sun Mar 7 13:00:58 2010
# by: PyQt4 UI code generator 4.7
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
class Ui_MainWindow(object):
def setupUi(self, MainWind... | gpl-3.0 |
mcus/SickRage | sickbeard/notifiers/pushalot.py | 3 | 4107 | # Author: Maciej Olesinski (https://github.com/molesinski/)
# Based on prowl.py by Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of SickRage.
#
# SickRage is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publ... | gpl-3.0 |
thiriel/maps | django/contrib/staticfiles/management/commands/collectstatic.py | 149 | 8992 | import os
import sys
import shutil
from optparse import make_option
from django.conf import settings
from django.core.files.storage import get_storage_class
from django.core.management.base import CommandError, NoArgsCommand
from django.utils.encoding import smart_str
from django.contrib.staticfiles import finders
c... | bsd-3-clause |
mavenlin/tensorflow | tensorflow/contrib/remote_fused_graph/pylib/__init__.py | 96 | 1290 | # 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... | apache-2.0 |
yavwa/Shilling | test/functional/rpc_invalidateblock.py | 27 | 2796 | #!/usr/bin/env python3
# Copyright (c) 2014-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the invalidateblock RPC."""
from test_framework.test_framework import BitcoinTestFramework
from t... | mit |
NeovaHealth/odoo | addons/delivery/__init__.py | 376 | 1103 | # -*- 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... | agpl-3.0 |
beck/django | django/middleware/common.py | 27 | 7178 | import hashlib
import logging
import re
from django import http
from django.conf import settings
from django.core import urlresolvers
from django.core.exceptions import PermissionDenied
from django.core.mail import mail_managers
from django.utils.encoding import force_text
logger = logging.getLogger('django.request')... | bsd-3-clause |
dcroc16/skunk_works | google_appengine/lib/django-1.5/django/contrib/localflavor/kw/forms.py | 110 | 2016 | """
Kuwait-specific Form helpers
"""
from __future__ import unicode_literals
import re
from datetime import date
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import Field
from django.utils.translation import gettext as _
id_re = re.compile(r'^(?P<i... | mit |
rossasa/server-tools | base_user_role/models/user.py | 5 | 1785 | # -*- coding: utf-8 -*-
# Copyright 2014 ABF OSIELL <http://osiell.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from openerp import api, fields, models
class ResUsers(models.Model):
_inherit = 'res.users'
role_line_ids = fields.One2many(
'res.users.role.line', 'user_id', stri... | agpl-3.0 |
tinchoa/broflow | pox/misc/debug_deadlock.py | 26 | 1699 | # Copyright 2012 James McCauley
#
# This file is part of POX.
#
# POX 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.
#
# POX is distri... | gpl-3.0 |
Drooids/erpnext | erpnext/accounts/doctype/period_closing_voucher/test_period_closing_voucher.py | 34 | 1961 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import unittest
import frappe
from frappe.utils import flt
from erpnext.accounts.doctype.journal_entry.test_journal_entry import make_journal_entry
cl... | agpl-3.0 |
tvenkat/askbot-devel | askbot/migrations/0119_auto__add_postflagreason.py | 18 | 27643 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'PostFlagReason'
db.create_table('askbot_postflagreason', (
('id', self.gf('djang... | gpl-3.0 |
Weihonghao/ECM | Vpy34/lib/python3.5/site-packages/theano/tensor/nlinalg.py | 1 | 23539 | from __future__ import absolute_import, print_function, division
import logging
import numpy
from six.moves import xrange
import theano
from theano.tensor import as_tensor_variable
from theano.gof import Op, Apply
from theano.gradient import DisconnectedType
from theano.tensor import basic as tensor
logger = loggin... | agpl-3.0 |
vebin/Wox | PythonHome/Lib/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py | 305 | 4235 | from binascii import hexlify, unhexlify
from hashlib import md5, sha1
from ..exceptions import SSLError
try: # Test for SSL features
SSLContext = None
HAS_SNI = False
import ssl
from ssl import wrap_socket, CERT_NONE, PROTOCOL_SSLv23
from ssl import SSLContext # Modern SSL?
from ssl import... | mit |
vad/django-cms | cms/south_migrations/0062_auto__add_field_staticplaceholder_site__del_unique_staticplaceholder_c.py | 63 | 18267 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Removing unique constraint on 'StaticPlaceholder', fields ['code']
db.d... | bsd-3-clause |
robertnishihara/ray | rllib/agents/marwil/tests/test_marwil.py | 1 | 2166 | import os
from pathlib import Path
import unittest
import ray
import ray.rllib.agents.marwil as marwil
from ray.rllib.utils.framework import try_import_tf
from ray.rllib.utils.test_utils import check_compute_single_action, \
framework_iterator
tf1, tf, tfv = try_import_tf()
class TestMARWIL(unittest.TestCase):
... | apache-2.0 |
MelanieBittl/dolfin | test/unit/python/book/chapter_1_files/stationary/nonlinear_poisson/pde_newton_np.py | 3 | 3181 | """
FEniCS tutorial demo program:
Nonlinear Poisson equation with Dirichlet conditions
in x-direction and homogeneous Neumann (symmetry) conditions
in all other directions. The domain is the unit hypercube in
of a given dimension.
-div(q(u)*nabla_grad(u)) = 0,
u = 0 at x=0, u=1 at x=1, du/dn=0 at all other boundaries.... | gpl-3.0 |
fengbaicanhe/intellij-community | plugins/hg4idea/testData/bin/mercurial/parsers.py | 91 | 3343 | # parsers.py - Python implementation of parsers.c
#
# Copyright 2009 Matt Mackall <mpm@selenic.com> and others
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
from mercurial.node import bin, nullid
from mercurial import util
impor... | apache-2.0 |
kivy/python-for-android | pythonforandroid/bootstrap.py | 4 | 17288 | import functools
import glob
import importlib
import os
from os.path import (join, dirname, isdir, normpath, splitext, basename)
from os import listdir, walk, sep
import sh
import shlex
import shutil
from pythonforandroid.logger import (shprint, info, logger, debug)
from pythonforandroid.util import (
current_dire... | mit |
ycaihua/kbengine | kbe/res/scripts/common/Lib/_strptime.py | 78 | 21679 | """Strptime-related classes and functions.
CLASSES:
LocaleTime -- Discovers and stores locale-specific time information
TimeRE -- Creates regexes for pattern matching a string of text containing
time information
FUNCTIONS:
_getlang -- Figure out what language is being used for the locale
... | lgpl-3.0 |
8l/beri | cheritest/trunk/tests/mt/test_mt_rdhwr.py | 2 | 1520 | #-
# Copyright (c) 2014 Michael Roe
# All rights reserved.
#
# This software was developed by SRI International and the University of
# Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237
# ("CTSRD"), as part of the DARPA CRASH research programme.
#
# @BERI_LICENSE_HEADER_START@
#
# Licensed to BER... | apache-2.0 |
m4rx9/rna-pdb-tools | rna_tools/tools/renum_pdb_to_aln/renum_pdb_to_aln.py | 2 | 3954 | #!/usr/bin/env python
"""renum_pdb_to_aln.py - renumber a pdb file based on the alignment.
author: A. Zyla under supervision of mmagnus
.. warning:: works only for single chain! and requires Biopython (tested with v1.68)
"""
import logging
import argparse
from Bio.SeqRecord import SeqRecord
from Bio import SeqIO
fro... | mit |
PulsePod/old-www-do-not-use | lib/python2.7/site-packages/werkzeug/testsuite/debug.py | 101 | 7859 | # -*- coding: utf-8 -*-
"""
werkzeug.testsuite.debug
~~~~~~~~~~~~~~~~~~~~~~~~
Tests some debug utilities.
:copyright: (c) 2013 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import unittest
import sys
import re
from werkzeug.testsuite import WerkzeugTestCase
from werkzeug.deb... | mit |
nailtaras/nailcoin | qa/rpc-tests/rest.py | 45 | 15272 | #!/usr/bin/env python2
# Copyright (c) 2014 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test REST interface
#
from test_framework.test_framework import BitcoinTestFramework
from test_framework... | mit |
nikitasingh981/scikit-learn | examples/linear_model/plot_sparse_recovery.py | 70 | 7486 | """
============================================================
Sparse recovery: feature selection for sparse linear models
============================================================
Given a small number of observations, we want to recover which features
of X are relevant to explain y. For this :ref:`sparse linear ... | bsd-3-clause |
caneruguz/osf.io | admin/desk/views.py | 26 | 3628 | from django.shortcuts import render
from django.views.generic import ListView, DetailView
from django.contrib.auth.mixins import PermissionRequiredMixin
from osf.models.user import OSFUser
from admin.desk.utils import DeskClient, DeskError, DeskCustomerNotFound
class DeskCaseList(PermissionRequiredMixin, ListView):... | apache-2.0 |
zaxtax/scikit-learn | benchmarks/bench_lasso.py | 297 | 3305 | """
Benchmarks of Lasso vs LassoLars
First, we fix a training set and increase the number of
samples. Then we plot the computation time as function of
the number of samples.
In the second benchmark, we increase the number of dimensions of the
training set. Then we plot the computation time as function of
the number o... | bsd-3-clause |
cylc/cylc | cylc/flow/cycling/loader.py | 1 | 4880 | # THIS FILE IS PART OF THE CYLC SUITE ENGINE.
# Copyright (C) NIWA & British Crown (Met Office) & Contributors.
#
# 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,... | gpl-3.0 |
Cl3MM/metagoofil | hachoir_parser/file_system/ext2.py | 95 | 18035 | """
EXT2 (Linux) file system parser.
Author: Victor Stinner
Sources:
- EXT2FS source code
http://ext2fsd.sourceforge.net/
- Analysis of the Ext2fs structure
http://www.nondot.org/sabre/os/files/FileSystems/ext2fs/
"""
from hachoir_parser import Parser
from hachoir_core.field import (FieldSet, ParserError,
Bi... | gpl-2.0 |
lfcnassif/MultiContentViewer | release/modules/ext/libreoffice/program/python-core-3.3.0/lib/token.py | 743 | 3034 | """Token constants (from "token.h")."""
__all__ = ['tok_name', 'ISTERMINAL', 'ISNONTERMINAL', 'ISEOF']
# This file is automatically generated; please don't muck it up!
#
# To update the symbols in this file, 'cd' to the top directory of
# the python source tree after building the interpreter and run:
#
# ./pyth... | lgpl-3.0 |
vangheem/xhtml2pdf | test/pdfjoiner.py | 154 | 1447 | # -*- coding: utf-8 -*-
# Copyright 2010 Dirk Holtwick, holtwick.it
#
# 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 ... | apache-2.0 |
joongh/robotframework | src/robot/model/namepatterns.py | 2 | 1560 | # Copyright 2008-2015 Nokia Networks
# Copyright 2016- Robot Framework 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
... | apache-2.0 |
M4sse/chromium.src | ppapi/generate_ppapi_include_tests.py | 177 | 6295 | #!/usr/bin/env python
# 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.
"""This script should be run manually on occasion to make sure the gyp file and
the includes tests are up to date.
It does the fol... | bsd-3-clause |
stack-of-tasks/rbdlpy | tutorial/lib/python2.7/site-packages/OpenGL/GL/NV/texture_shader2.py | 9 | 1456 | '''OpenGL extension NV.texture_shader2
This module customises the behaviour of the
OpenGL.raw.GL.NV.texture_shader2 to provide a more
Python-friendly API
Overview (from the spec)
This extension extends the NV_texture_shader functionality to
support texture shader operations for 3D textures.
See the NV_textur... | lgpl-3.0 |
Zenfone2-Dev/kernel-FlareM | scripts/rt-tester/rt-tester.py | 11005 | 5307 | #!/usr/bin/python
#
# rt-mutex tester
#
# (C) 2006 Thomas Gleixner <tglx@linutronix.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
import os
import sys
import getopt
import sh... | gpl-2.0 |
cryptickp/libcloud | libcloud/utils/logging.py | 64 | 1750 | # 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 ... | apache-2.0 |
andipeng/MagnePlane | src/hyperloop/Python/OldMagnePlaneCode/tube_limit_flow.py | 4 | 10274 | from math import pi
import numpy as np
from scipy.optimize import newton
import pylab
from openmdao.core.component import Component
from openmdao.core.group import Group
from openmdao.units.units import convert_units as cu
from openmdao.components.param_comp import ParamComp
from openmdao.components.constraint import... | apache-2.0 |
pjotrligthart/openmoo2-unofficial | game/gui/info_screen.py | 2 | 2724 | import pygame
from _game_constants import *
import screen
import networking
import gui
import dictionary
class InfoScreen(screen.Screen):
def __init__(self):
screen.Screen.__init__(self)
self.__tech_review = "achievements"
def reset_triggers_list(self):
screen.Screen.reset_triggers_list(self)
... | gpl-2.0 |
gskielian/SimpleCV | scripts/install/win/OpenKinect/freenect-examples/demo_mp_async.py | 15 | 1082 | #!/usr/bin/env python
import freenect
import matplotlib.pyplot as mp
import signal
import frame_convert
mp.ion()
image_rgb = None
image_depth = None
keep_running = True
def display_depth(dev, data, timestamp):
global image_depth
data = frame_convert.pretty_depth(data)
mp.gray()
mp.fig... | bsd-3-clause |
jemekite/youtube-dl | youtube_dl/extractor/tubitv.py | 48 | 2674 | # coding: utf-8
from __future__ import unicode_literals
import codecs
import re
from .common import InfoExtractor
from ..compat import (
compat_urllib_parse,
compat_urllib_request
)
from ..utils import (
ExtractorError,
int_or_none,
)
class TubiTvIE(InfoExtractor):
_VALID_URL = r'https?://(?:www... | unlicense |
badreddinetahir/pwn_plug_sources | src/metagoofil/hachoir_parser/image/bmp.py | 95 | 6682 | """
Microsoft Bitmap picture parser.
- file extension: ".bmp"
Author: Victor Stinner
Creation: 16 december 2005
"""
from hachoir_parser import Parser
from hachoir_core.field import (FieldSet,
UInt8, UInt16, UInt32, Bits,
String, RawBytes, Enum,
PaddingBytes, NullBytes, createPaddingField)
from hachoir_cor... | gpl-3.0 |
40223123/finaltestone | static/Brython3.1.1-20150328-091302/Lib/opcode.py | 714 | 5442 |
"""
opcode module - potentially shared between dis and other modules which
operate on bytecodes (e.g. peephole optimizers).
"""
__all__ = ["cmp_op", "hasconst", "hasname", "hasjrel", "hasjabs",
"haslocal", "hascompare", "hasfree", "opname", "opmap",
"HAVE_ARGUMENT", "EXTENDED_ARG", "hasnargs"]
... | agpl-3.0 |
sjsucohort6/openstack | python/venv/lib/python2.7/site-packages/neutronclient/tests/unit/test_cli20_router.py | 4 | 14364 | # Copyright 2012 VMware, 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 ap... | mit |
DanteOnline/free-art | venv/lib/python3.4/site-packages/pip/_vendor/html5lib/treewalkers/dom.py | 505 | 1421 | from __future__ import absolute_import, division, unicode_literals
from xml.dom import Node
from . import _base
class TreeWalker(_base.NonRecursiveTreeWalker):
def getNodeDetails(self, node):
if node.nodeType == Node.DOCUMENT_TYPE_NODE:
return _base.DOCTYPE, node.name, node.publicId, node.sy... | gpl-3.0 |
gquirozbogner/contentbox-master | third_party/django/contrib/auth/tests/test_basic.py | 105 | 9914 | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals
import locale
from django.contrib.auth import get_user_model
from django.contrib.auth.management.commands import createsuperuser
from django.contrib.auth.models import User, AnonymousUser
from django.contrib.auth.tests.custom_user import CustomUser
fro... | apache-2.0 |
louiskun/flaskGIT | venv/lib/python2.7/site-packages/pip/_vendor/cachecontrol/caches/file_cache.py | 762 | 3532 | import hashlib
import os
from pip._vendor.lockfile import LockFile
from pip._vendor.lockfile.mkdirlockfile import MkdirLockFile
from ..cache import BaseCache
from ..controller import CacheController
def _secure_open_write(filename, fmode):
# We only want to write to this file, so open it in write only mode
... | mit |
tjmonsi/cmsc129-2016-repo | submissions/exercise3/pitargue/lexical_analyzer.py | 1 | 8280 | import string
class DFA:
keywords = [
'var',
'input',
'output',
'break',
'continue',
'if',
'elsif',
'else',
'switch',
'case',
'default',
'while',
'do',
'for',
'foreach',
'in',
'f... | mit |
LTD-Beget/tornado | tornado/test/simple_httpclient_test.py | 57 | 27142 | from __future__ import absolute_import, division, print_function, with_statement
import collections
from contextlib import closing
import errno
import gzip
import logging
import os
import re
import socket
import ssl
import sys
from tornado import gen
from tornado.httpclient import AsyncHTTPClient
from tornado.httputi... | apache-2.0 |
kenshinx/nproxy | contrib/libuv-v1.0.2/docs/src/conf.py | 12 | 11192 | # -*- coding: utf-8 -*-
#
# libuv API documentation documentation build configuration file, created by
# sphinx-quickstart on Sun Jul 27 11:47:51 2014.
#
# 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
# autogener... | bsd-2-clause |
burakince/ocl_web | ocl_web/users/forms.py | 7 | 2122 | # -*- coding: utf-8 -*-
"""
Forms for users.
"""
from django.utils.translation import ugettext as _
from django import forms
#from django.core.urlresolvers import reverse
from .models import User
class UserForm(forms.Form):
""" User edit form """
required_css_class = 'required'
first_name = forms.Cha... | mpl-2.0 |
aipescience/django-daiquiri | daiquiri/core/adapter/download/base.py | 1 | 4910 | import logging
import csv
import subprocess
import re
from django.conf import settings
from daiquiri.core.generators import generate_csv, generate_votable, generate_fits
from daiquiri.core.utils import get_doi_url
logger = logging.getLogger(__name__)
class BaseDownloadAdapter(object):
def __init__(self, datab... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.