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
groovecoder/kuma
vendor/packages/logilab/astng/manager.py
25
11622
# copyright 2003-2013 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of logilab-astng. # # logilab-astng is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as publis...
mpl-2.0
gangadharkadam/office_erp
erpnext/manufacturing/doctype/bom_replace_tool/bom_replace_tool.py
18
1378
# 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 frappe from frappe.utils import cstr, flt from frappe import _ from frappe.model.document import Document class BOMReplaceTool(Document): d...
agpl-3.0
Keleir/glances
glances/plugins/glances_mem.py
11
11098
# -*- coding: utf-8 -*- # # This file is part of Glances. # # Copyright (C) 2015 Nicolargo <nicolas@nicolargo.com> # # Glances is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the Lic...
lgpl-3.0
ingadhoc/odoo
addons/decimal_precision/tests/test_qweb_float.py
335
1986
# -*- coding: utf-8 -*- from openerp.tests import common class TestFloatExport(common.TransactionCase): def setUp(self): super(TestFloatExport, self).setUp() self.Model = self.registry('decimal.precision.test') def get_converter(self, name): converter = self.registry('ir.qweb.field.flo...
agpl-3.0
HousekeepLtd/django
tests/template_backends/test_django.py
199
4793
from template_tests.test_response import test_processor_name from django.template import RequestContext from django.template.backends.django import DjangoTemplates from django.template.library import InvalidTemplateLibrary from django.test import RequestFactory, ignore_warnings, override_settings from django.utils.dep...
bsd-3-clause
sylarcp/anita
venv/lib/python2.7/site-packages/sqlalchemy/dialects/mssql/pymssql.py
21
2968
# mssql/pymssql.py # Copyright (C) 2005-2015 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 """ .. dialect:: mssql+pymssql :name: pymssql :dbapi: pymssql :connects...
mit
saurabh6790/ON-RISAPP
selling/doctype/patient_registration/patient_registration.py
11
3373
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt # For license information, please see license.txt from __future__ import unicode_literals import webnotes from webnotes.utils import cstr, cint, flt, comma_or, nowdate, get_base_path import barcode import os from we...
agpl-3.0
sloanyang/aquantic
Tools/Scripts/webkitpy/common/checkout/checkout.py
119
9383
# 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 ...
gpl-2.0
pombredanne/parakeet
parakeet/syntax/wrappers.py
2
1799
from .. import names, prims from ..ndtypes import ScalarT, Type, type_conv from .. syntax import FormalArgs, Var, UntypedFn, Return, PrimCall, Expr, Cast _untyped_fn_cache = {} def simple_untyped_fn(name, expr, n_inputs = 1, fixed_args =...
bsd-3-clause
kuiwei/kuiwei
common/djangoapps/external_auth/tests/test_openid_provider.py
46
16144
#-*- encoding=utf-8 -*- ''' Created on Jan 18, 2013 @author: brian ''' import openid import json from openid.fetchers import HTTPFetcher, HTTPResponse from urlparse import parse_qs, urlparse from django.conf import settings from django.test import TestCase, LiveServerTestCase from django.core.cache import cache from ...
agpl-3.0
jsgf/xen
tools/python/logging/logging-0.4.9.2/test/log_test2.py
42
4047
#!/usr/bin/env python # # Copyright 2001-2002 by Vinay Sajip. All Rights Reserved. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, # provided that the above copyright notice appear in all copies and that # both that copyright n...
gpl-2.0
meteorcloudy/tensorflow
tensorflow/contrib/layers/python/layers/feature_column_ops.py
31
37478
# 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...
apache-2.0
dan1/horizon-proto
horizon/tables/base.py
8
70786
# Copyright 2012 Nebula, 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 or agree...
apache-2.0
cloudwatt/contrail-neutron-plugin
neutron_plugin_contrail/plugins/opencontrail/loadbalancer/virtual_ip.py
3
9900
# # Copyright (c) 2014 Juniper Networks, Inc. All rights reserved. # from neutron.api.v2 import attributes from neutron.common import exceptions as n_exc from neutron.extensions import loadbalancer from neutron.openstack.common import log as logging from neutron.openstack.common import uuidutils from vnc_api.vnc_api im...
apache-2.0
ReamerKim/pad_crawling
util/beautifulsoup4-4.3.2/beautifulsoup4-4.3.2/build/lib/bs4/tests/test_docs.py
607
1067
"Test harness for doctests." # pylint: disable-msg=E0611,W0142 __metaclass__ = type __all__ = [ 'additional_tests', ] import atexit import doctest import os #from pkg_resources import ( # resource_filename, resource_exists, resource_listdir, cleanup_resources) import unittest DOCTEST_FLAGS = ( doctes...
gpl-2.0
kongji2008/genetify
pygooglechart/examples/labels.py
2
1720
#!/usr/bin/env python import os import sys import math import random ROOT = os.path.dirname(os.path.abspath(__file__)) sys.path.insert(0, os.path.join(ROOT, '..')) from pygooglechart import SimpleLineChart from pygooglechart import Axis import settings import helper def cat_proximity(): """Cat proximity graph ...
mit
indictranstech/focal-erpnext
erpnext/stock/stock_ledger.py
15
13389
# 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 frappe from frappe import _ from frappe.utils import cint, flt, cstr, now from erpnext.stock.utils import get_valuation_method import json # ...
agpl-3.0
zenoss/ZenPacks.chudler.GoogleAppEngine
ZenPacks/chudler/GoogleAppEngine/mechanize/_pullparser.py
15
14326
"""A simple "pull API" for HTML parsing, after Perl's HTML::TokeParser. Examples This program extracts all links from a document. It will print one line for each link, containing the URL and the textual description between the <A>...</A> tags: import pullparser, sys f = file(sys.argv[1]) p = pullparser.PullParser(f...
gpl-2.0
Timtam/cards-against-humanity
editor/card_panel.py
1
5429
from const import * from shared.card import CARD_BLACK, CARD_WHITE, Card class CardPanel(wx.Panel): def __init__(self, parent, card_id=-1, size=(ELEMENT_SIZE, ELEMENT_SIZE), text="", card_type=CARD_WHITE): wx.Panel.__init__(self, parent=parent, size=size, na...
mit
kepstin/picard
picard/ui/ui_edittagdialog.py
2
5033
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'ui/edittagdialog.ui' # # Created: Fri Jul 13 15:19:05 2012 # by: PyQt4 UI code generator 4.8.3 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 excep...
gpl-2.0
home-assistant/home-assistant
tests/components/alexa/test_intent.py
14
17698
"""The tests for the Alexa component.""" # pylint: disable=protected-access import json import pytest from homeassistant.components import alexa from homeassistant.components.alexa import intent from homeassistant.const import CONTENT_TYPE_JSON from homeassistant.core import callback from homeassistant.setup import a...
apache-2.0
ctxis/canape
CANAPE.Scripting/Lib/distutils/dir_util.py
106
7877
"""distutils.dir_util Utility functions for manipulating directories and directory trees.""" __revision__ = "$Id$" import os import errno from distutils.errors import DistutilsFileError, DistutilsInternalError from distutils import log # cache for by mkpath() -- in addition to cheapening redundant calls, # eliminat...
gpl-3.0
FlorianLudwig/odoo
addons/account/wizard/account_automatic_reconcile.py
340
11604
# -*- 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
neopenx/Dragon
Dragon/python/dragon/vm/tensorflow/ops/array_ops.py
1
1712
# -------------------------------------------------------- # TensorFlow @ Dragon # Copyright(c) 2017 SeetaTech # Written by Ting Pan # -------------------------------------------------------- __all__ = [ 'expand_dims', 'shape', 'zeros', 'ones', 'placeholder', 'concat', 'transpose', 'til...
bsd-2-clause
kuza55/keras
examples/mnist_mlp.py
7
1738
'''Trains a simple deep NN on the MNIST dataset. Gets to 98.40% test accuracy after 20 epochs (there is *a lot* of margin for parameter tuning). 2 seconds per epoch on a K520 GPU. ''' from __future__ import print_function import numpy as np np.random.seed(1337) # for reproducibility from keras.datasets import mnist...
mit
tmeits/pybrain
pybrain/auxiliary/gaussprocess.py
25
9240
from __future__ import print_function __author__ = 'Thomas Rueckstiess, ruecksti@in.tum.de; Christian Osendorfer, osendorf@in.tum.de' from scipy import r_, exp, zeros, eye, array, asarray, random, ravel, diag, sqrt, sin, cos, sort, mgrid, dot, floor from scipy import c_ #@UnusedImport from scipy.linalg import solve,...
bsd-3-clause
MrNuggles/HeyBoet-Telegram-Bot
temboo/Library/Google/Spreadsheets/StructuredQuery.py
4
6133
# -*- coding: utf-8 -*- ############################################################################### # # StructuredQuery # Retrieves a list-based feed containing data in your Google spreadsheet that meets a specified criteria. # # Python versions 2.6, 2.7, 3.x # # Copyright 2014, Temboo Inc. # # Licensed under the ...
gpl-3.0
tumbl3w33d/ansible
lib/ansible/modules/cloud/digital_ocean/digital_ocean_certificate_info.py
25
3570
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2018, Ansible Project # Copyright: (c) 2018, Abhijeet Kasurde <akasurde@redhat.com> # 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__ = ty...
gpl-3.0
jakubroztocil/httpie
tests/test_auth_plugins.py
2
3696
from mock import mock from httpie.cli.constants import SEPARATOR_CREDENTIALS from httpie.plugins import AuthPlugin from httpie.plugins.registry import plugin_manager from utils import http, HTTP_OK # TODO: run all these tests in session mode as well USERNAME = 'user' PASSWORD = 'password' # Basic auth encoded `USER...
bsd-3-clause
FlorentChamault/My_sickbeard
lib/hachoir_metadata/video.py
90
15568
from lib.hachoir_core.field import MissingField from lib.hachoir_metadata.metadata import (registerExtractor, Metadata, RootMetadata, MultipleMetadata) from lib.hachoir_metadata.metadata_item import QUALITY_GOOD from lib.hachoir_metadata.safe import fault_tolerant from lib.hachoir_parser.video import MovFile, AsfFi...
gpl-3.0
santoshn/softboundcets-34
softboundcets-llvm-clang34/tools/clang/docs/analyzer/conf.py
6
8021
# -*- coding: utf-8 -*- # # Clang Static Analyzer documentation build configuration file, created by # sphinx-quickstart on Wed Jan 2 15:54:28 2013. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated...
bsd-3-clause
vvw/gensim
gensim/summarization/keywords.py
32
7295
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html from gensim.summarization.pagerank_weighted import pagerank_weighted as _pagerank from gensim.summarization.textcleaner import clean_text_by_word as _clean_text_by_word from gensim.summarization.t...
gpl-3.0
lmcro/webserver
qa/127-SCGI-Post.py
8
1736
import os from base import * DIR = "/SCGI2/" MAGIC = "Cherokee and SCGI rocks!" PORT = get_free_port() PYTHON = look_for_python() SCRIPT = """ from pyscgi import * class TestHandler (SCGIHandler): def handle_request (self): self.handle_post() self.send('Content-Type: text/plain\\r\\n\\r\\n'...
gpl-2.0
brianrodri/oppia
core/domain/auth_domain.py
2
8845
# coding: utf-8 # # Copyright 2020 The Oppia 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 requi...
apache-2.0
gangadharkadam/v5_erp
erpnext/tests/sel_tests.py
41
2553
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt """ Run Selenium Tests Requires a clean install. After reinstalling fresh db, call frappe --execute erpnext.tests.sel_tests.start """ from __future__ import unicode_literals import fra...
agpl-3.0
Ra1nWarden/googletest
test/gtest_env_var_test.py
2408
3487
#!/usr/bin/env python # # Copyright 2008, 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...
bsd-3-clause
madprog/virtualenv
virtualenv_embedded/site.py
784
27543
"""Append module search paths for third-party packages to sys.path. **************************************************************** * This module is automatically imported during initialization. * **************************************************************** In earlier versions of Python (up to 1.5a3), scripts or...
mit
cosmoharrigan/pylearn2
pylearn2/gui/tangent_plot.py
44
1730
""" Code for plotting curves with tangent lines. """ __author__ = "Ian Goodfellow" try: from matplotlib import pyplot except Exception: pyplot = None from theano.compat.six.moves import xrange def tangent_plot(x, y, s): """ Plots a curve with tangent lines. Parameters ---------- x : lis...
bsd-3-clause
erikrose/pip
pip/baseparser.py
424
10465
"""Base option parser setup""" from __future__ import absolute_import import sys import optparse import os import re import textwrap from distutils.util import strtobool from pip._vendor.six import string_types from pip._vendor.six.moves import configparser from pip.locations import ( legacy_config_file, config_b...
mit
trustly/trustly-client-python
trustly/data/jsonrpcnotificationrequest.py
1
3241
""" The MIT License (MIT) Copyright (c) 2014 Trustly Group AB Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, me...
mit
dremio/arrow
integration/integration_test.py
4
33972
# 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...
apache-2.0
ActiveState/code
recipes/Python/543261_grade_keeper/recipe-543261.py
1
2222
#! /usr/bin/python # keep record of grades. Made by Caleb Herbert. 0.1-PUBLIC # NOTE! All letter answers are to be written in quotes (including dates)! print """############################################ # Welcome to Gradebook! v 0.1 # # YOUR LIGHT WEIGHT SCHOOL RECORD MANAGER! # #######################...
mit
h3biomed/ansible
test/units/modules/network/iosxr/test_iosxr_config.py
59
10185
# # (c) 2016 Red Hat 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. # # Ansible is d...
gpl-3.0
bzhou26/NRA-Crawler
geopy/geocoders/openmapquest.py
13
4107
""" :class:`.OpenMapQuest` geocoder. """ from geopy.compat import urlencode from geopy.geocoders.base import ( Geocoder, DEFAULT_FORMAT_STRING, DEFAULT_TIMEOUT, DEFAULT_SCHEME ) from geopy.location import Location from geopy.util import logger __all__ = ("OpenMapQuest", ) class OpenMapQuest(Geocode...
mit
bdyetton/prettychart
website/project/views/node.py
1
40848
# -*- coding: utf-8 -*- import logging import httplib as http import math from itertools import islice from flask import request from modularodm import Q from modularodm.exceptions import ModularOdmException, ValidationValueError from framework import status from framework.utils import iso8601format from framework.mo...
apache-2.0
FCP-INDI/nipype
nipype/utils/onetime.py
10
2622
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: """Descriptor support for NIPY. Utilities to support special Python descriptors [1,2], in particular the use of a useful pattern for properties we call 'one time properties'. These are object attributes w...
bsd-3-clause
danmar/cppcheck
test/bug-hunting/cve.py
2
2063
# Test if --bug-hunting works using cve tests import glob import logging import os import sys import subprocess if sys.argv[0] in ('test/bug-hunting/cve.py', './test/bug-hunting/cve.py'): CPPCHECK_PATH = './cppcheck' TEST_SUITE = 'test/bug-hunting/cve' else: CPPCHECK_PATH = '../../cppcheck' TEST_SUITE...
gpl-3.0
qedsoftware/commcare-hq
corehq/apps/sms/migrations/0016_add_phonenumber.py
1
1393
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import dimagi.utils.couch.migration class Migration(migrations.Migration): dependencies = [ ('sms', '0015_rename_phonenumber_to_phoneblacklist'), ] operations = [ migrations.CreateMo...
bsd-3-clause
chriscauley/django-shop
setup.py
13
1131
from setuptools import setup, find_packages import os import shop CLASSIFIERS = [ 'Environment :: Web Environment', 'Framework :: Django', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'To...
bsd-3-clause
jvanz/core
wizards/com/sun/star/wizards/web/export/ConfiguredExporter.py
9
1837
# # This file is part of the LibreOffice project. # # 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/. # # This file incorporates work covered by the following license noti...
gpl-3.0
alberto-antonietti/nest-simulator
pynest/examples/Potjans_2014/stimulus_params.py
19
2283
# -*- coding: utf-8 -*- # # stimulus_params.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST 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...
gpl-2.0
pypa/pip
tests/functional/test_build_env.py
4
7568
from textwrap import dedent import pytest from pip._internal.build_env import BuildEnvironment from tests.lib import create_basic_wheel_for_package, make_test_finder def indent(text, prefix): return '\n'.join((prefix if line else '') + line for line in text.split('\n')) def run_with_build...
mit
yawnosnorous/python-for-android
python3-alpha/python3-src/Lib/plat-os2emx/_emx_link.py
57
2499
# _emx_link.py # Written by Andrew I MacIntyre, December 2002. """_emx_link.py is a simplistic emulation of the Unix link(2) library routine for creating so-called hard links. It is intended to be imported into the os module in place of the unimplemented (on OS/2) Posix link() function (os.link()). We do this on OS...
apache-2.0
HBehrens/feedsanitizer
django/core/management/commands/startapp.py
321
1909
import os from django.core.management.base import copy_helper, CommandError, LabelCommand from django.utils.importlib import import_module class Command(LabelCommand): help = "Creates a Django app directory structure for the given app name in the current directory." args = "[appname]" label = 'application...
mit
JaDogg/__py_playground
reference/parsley/doc/calc.py
4
1088
import math from parsley import makeGrammar def calculate(start, pairs): result = start for op, value in pairs: if op == '+': result += value elif op == '-': result -= value elif op == '*': result *= value e...
mit
klenks/jobsportal
venv/lib/python2.7/site-packages/django/contrib/gis/geos/linestring.py
136
6019
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, LinearGeometryMixin from django.contrib.gis.geos.point import Point from django.contrib.gis....
mit
dhenrygithub/QGIS
python/ext-libs/markupsafe/__init__.py
701
10338
# -*- coding: utf-8 -*- """ markupsafe ~~~~~~~~~~ Implements a Markup string. :copyright: (c) 2010 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import re import string from collections import Mapping from markupsafe._compat import text_type, string_types, int_types, \ u...
gpl-2.0
duqiao/django
django/views/static.py
190
5142
""" Views and functions for serving static files. These are only to be used during development, and SHOULD NOT be used in a production setting. """ from __future__ import unicode_literals import mimetypes import os import posixpath import re import stat from django.http import ( FileResponse, Http404, HttpRespons...
bsd-3-clause
MG-RAST/DRISEE
drisee.py
2
25594
#!/usr/bin/env python import os, sys, re, time, datetime, hashlib, shutil import subprocess import cStringIO import string, random from Bio import SeqIO from random import randrange from optparse import OptionParser from multiprocessing import Pool __doc__ = """ Script to calculate sequence error. Input: fasta/fastq ...
bsd-2-clause
CCI-Tools/ect-core
cate/ds/local.py
1
37425
# The MIT License (MIT) # Copyright (c) 2016, 2017 by the ESA CCI Toolbox development team and contributors # # 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 wi...
mit
popazerty/e2
lib/python/Plugins/SystemPlugins/RemoteControlCode/plugin.py
4
4307
from enigma import ePicLoad from Screens.Screen import Screen from Components.ActionMap import ActionMap from Components.Label import Label from Components.ConfigList import ConfigListScreen from Components.config import config, configfile, ConfigSubsection, ConfigSelection, getConfigListEntry from Components.Pixmap i...
gpl-2.0
sharma1nitish/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/common/config/committervalidator_unittest.py
120
2649
# 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 f...
bsd-3-clause
optima-ict/odoo
addons/account_asset/account_asset.py
5
28027
# -*- coding: utf-8 -*- from datetime import date, datetime from dateutil.relativedelta import relativedelta from openerp import api, fields, models, _ from openerp.exceptions import UserError, ValidationError from openerp.tools import DEFAULT_SERVER_DATE_FORMAT as DF class AccountAssetCategory(models.Model): _...
agpl-3.0
XiaodunServerGroup/xiaodun-platform
common/test/acceptance/pages/lms/rubric.py
6
4302
""" Rubric for open-ended response problems, including calibration and peer-grading. """ from bok_choy.page_object import PageObject from bok_choy.promise import EmptyPromise, fulfill_after, fulfill_before class ScoreMismatchError(Exception): """ The provided scores do not match the rubric on the page. "...
agpl-3.0
qxsch/QXSConsolas
examples/CopyThat/copyThat/requests/packages/chardet/chardistribution.py
2755
9226
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights R...
gpl-3.0
ric2b/Vivaldi-browser
chromium/third_party/blink/web_tests/external/wpt/tools/third_party/html5lib/html5lib/tests/test_parser2.py
30
5415
from __future__ import absolute_import, division, unicode_literals from six import PY2, text_type, unichr import io from . import support # noqa from html5lib.constants import namespaces, tokenTypes from html5lib import parse, parseFragment, HTMLParser # tests that aren't autogenerated from text files def test_a...
bsd-3-clause
Omegaphora/external_chromium_org
tools/valgrind/chrome_tests.py
32
31784
#!/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. ''' Runs various chrome tests through valgrind_test.py.''' import glob import logging import multiprocessing import optparse impor...
bsd-3-clause
dreamsxin/kbengine
kbe/res/scripts/common/Lib/site-packages/pip/_vendor/six.py
271
23462
"""Utilities for writing code that runs on Python 2 and 3""" # Copyright (c) 2010-2014 Benjamin Peterson # # 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 with...
lgpl-3.0
Julius2342/pyvlx
pyvlx/api/get_state.py
1
1220
"""Module for retrieving gateway state from API.""" from pyvlx.dataobjects import DtoState from .api_event import ApiEvent from .frames import FrameGetStateConfirmation, FrameGetStateRequest class GetState(ApiEvent): """Class for retrieving gateway state from API.""" def __init__(self, pyvlx): """In...
lgpl-3.0
tensor-tang/Paddle
python/paddle/fluid/tests/unittests/test_parallel_executor_seresnext_with_reduce_cpu.py
2
3977
# Copyright (c) 2019 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 appli...
apache-2.0
danielnelson/aiohttp
aiohttp/web_reqrep.py
5
24862
import asyncio import binascii import cgi import collections import datetime import http.cookies import io import json import math import time import warnings import enum from email.utils import parsedate from types import MappingProxyType from urllib.parse import urlsplit, parse_qsl, unquote from . import hdrs from...
apache-2.0
hansraj/video-transcoding
utils/generate_tests.py
2
3731
#!/usr/bin/env python """ Arista Test Generator ===================== Generate a series of test files containing audio/video to run through the transcoder for unit testing. License ------- Copyright 2008 Daniel G. Taylor <dan@programmer-art.org> This file is part of Arista. Arista is free software: you can...
lgpl-2.1
MichaelQQ/linux-2.6.35-vpls
tools/perf/scripts/python/check-perf-trace.py
948
2501
# perf trace event handlers, generated by perf trace -g python # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # This script tests basic functionality such as flag and symbol # strings, common_xxx() calls back into perf, begin, end, unhandled # events, etc. Ba...
gpl-2.0
Slepice1/simple-web-generator
setup.py
1
9036
# -*- coding: utf-8 -*- from __future__ import print_function import os import sys import imp import subprocess ## Python 2.6 subprocess.check_output compatibility. Thanks Greg Hewgill! if 'check_output' not in dir(subprocess): def check_output(cmd_args, *args, **kwargs): proc = subprocess.Popen( ...
mit
arborh/tensorflow
tensorflow/lite/experimental/micro/tools/make/merge_arduino_zips.py
24
1646
# Copyright 2019 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
miguelinux/vbox
src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py
1
44961
## @file GenInfFile.py # # This file contained the logical of transfer package object to INF files. # # Copyright (c) 2011 - 2014, Intel Corporation. All rights reserved.<BR> # # This program and the accompanying materials are licensed and made available # under the terms and conditions of the BSD License which accompa...
gpl-2.0
btenaglia/hpc-historias-clinicas
hpc-historias-clinicas/inter_consultas/views.py
1
3625
# -*- coding: utf-8 -*- from django.shortcuts import render from django.views.generic import ListView, CreateView, UpdateView, DeleteView from django.contrib import messages from braces.views import LoginRequiredMixin from .models import InterConsultas from ..historias.models import Historias class InterConsultasMix...
bsd-3-clause
mihneadb/suse_bug_reporter
bugreporter/gathering_modules/cmdline.py
1
1128
''' Copyright (C) 2011 Mihnea Dobrescu-Balaur 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 is distributed in ...
gpl-2.0
alajara/servo
python/servo/command_base.py
1
24514
# Copyright 2013 The Servo Project Developers. See the COPYRIGHT # file at the top-level directory of this distribution. # # Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or # http://www.apache.org/licenses/LICENSE-2.0> or the MIT license # <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your #...
mpl-2.0
fossoult/odoo
openerp/addons/test_impex/tests/test_export.py
158
19124
# -*- coding: utf-8 -*- import itertools import openerp.modules.registry import openerp from openerp.tests import common class CreatorCase(common.TransactionCase): model_name = False def __init__(self, *args, **kwargs): super(CreatorCase, self).__init__(*args, **kwargs) self.model = None ...
agpl-3.0
factorlibre/OCB
openerp/addons/base/tests/test_mail_examples.py
302
57129
#!/usr/bin/env python # -*- coding: utf-8 -*- MISC_HTML_SOURCE = """ <font size="2" style="color: rgb(31, 31, 31); font-family: monospace; font-variant: normal; line-height: normal; ">test1</font> <div style="color: rgb(31, 31, 31); font-family: monospace; font-variant: normal; line-height: normal; font-size: 12px; fo...
agpl-3.0
leighpauls/k2cro4
v8/test/benchmarks/testcfg.py
11
3348
# Copyright 2011 the V8 project authors. 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 conditi...
bsd-3-clause
bikong2/django
django/contrib/gis/gdal/base.py
654
1179
from ctypes import c_void_p from django.contrib.gis.gdal.error import GDALException from django.utils import six class GDALBase(object): """ Base object for GDAL objects that has a pointer access property that controls access to the underlying C pointer. """ # Initially the pointer is NULL. _...
bsd-3-clause
paweljasinski/ironpython3
Tests/compat/sbs_parse_string.py
3
4400
##################################################################################### # # Copyright (c) Microsoft Corporation. All rights reserved. # # This source code is subject to terms and conditions of the Apache License, Version 2.0. A # copy of the license can be found in the License.html file at the root of t...
apache-2.0
alsrgv/tensorflow
tensorflow/python/ops/batch_norm_benchmark.py
25
10767
# 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...
apache-2.0
suiyuan2009/tensorflow
tensorflow/examples/how_tos/reading_data/fully_connected_reader.py
59
7434
# 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...
apache-2.0
psyhofreak/ft-engine
mysql-test/suite/tokudb/t/change_column_char.py
54
1339
#!/usr/bin/env python import sys def gen_test(n): print "CREATE TABLE t (a CHAR(%d));" % (n) for v in [ 'hi', 'there', 'people' ]: print "INSERT INTO t VALUES ('%s');" % (v) for i in range(2,256): if i < n: print "--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/" print "--e...
gpl-2.0
takeflight/django
django/core/serializers/__init__.py
121
8167
""" Interfaces for serializing Django objects. Usage:: from django.core import serializers json = serializers.serialize("json", some_queryset) objects = list(serializers.deserialize("json", json)) To add your own serializers, use the SERIALIZATION_MODULES setting:: SERIALIZATION_MODULES = { ...
bsd-3-clause
PhiInnovations/mdp28-linux-bsp
meta-openembedded/meta-oe/recipes-devtools/python/python-pyyaml/setup.py
69
1936
NAME = 'PyYAML' VERSION = '3.06' DESCRIPTION = "YAML parser and emitter for Python" LONG_DESCRIPTION = """\ YAML is a data serialization format designed for human readability and interaction with scripting languages. PyYAML is a YAML parser and emitter for Python. PyYAML features a complete YAML 1.1 parser, Unicode s...
mit
Grogdor/CouchPotatoServer
couchpotato/core/settings.py
42
8457
from __future__ import with_statement import ConfigParser from hashlib import md5 from CodernityDB.hash_index import HashIndex from couchpotato.api import addApiView from couchpotato.core.event import addEvent, fireEvent from couchpotato.core.helpers.encoding import toUnicode from couchpotato.core.helpers.variable imp...
gpl-3.0
markuskont/salt-tick
vagrant/lib/win-x64/M2Crypto/RSA.py
8
13128
"""M2Crypto wrapper for OpenSSL RSA API. Copyright (c) 1999-2004 Ng Pheng Siong. All rights reserved.""" import sys import util, BIO, Err, m2 class RSAError(Exception): pass m2.rsa_init(RSAError) no_padding = m2.no_padding pkcs1_padding = m2.pkcs1_padding sslv23_padding = m2.sslv23_padding pkcs1_oaep_padding = m2....
gpl-3.0
wemanuel/smry
smry/server-auth/ls/google-cloud-sdk/platform/gsutil/third_party/boto/tests/integration/sns/__init__.py
761
1104
# Copyright (c) 2006-2011 Mitch Garnaat http://garnaat.org/ # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modi...
apache-2.0
KokareIITP/django
django/core/serializers/json.py
320
3782
""" Serialize data to/from JSON """ # Avoid shadowing the standard library json module from __future__ import absolute_import, unicode_literals import datetime import decimal import json import sys import uuid from django.core.serializers.base import DeserializationError from django.core.serializers.python import ( ...
bsd-3-clause
singhj/gae-hello-world
mapreduce/key_ranges.py
49
4157
#!/usr/bin/env python """An abstract for a collection of key_range.KeyRange objects.""" from google.appengine.ext import key_range from mapreduce import namespace_range __all__ = [ "KeyRangesFactory", "KeyRanges"] # pylint: disable=g-bad-name class KeyRangesFactory(object): """Factory for KeyRanges.""...
apache-2.0
dynius/p2pool
p2pool/work.py
42
23951
from __future__ import division import base64 import random import re import sys import time from twisted.internet import defer from twisted.python import log import bitcoin.getwork as bitcoin_getwork, bitcoin.data as bitcoin_data from bitcoin import helper, script, worker_interface from util import forest, jsonrpc,...
gpl-3.0
iohannez/gnuradio
gr-filter/python/filter/qa_pfb_interpolator.py
7
2724
#!/usr/bin/env python # # Copyright 2012-2014 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 optio...
gpl-3.0
ARM-software/lisa
lisa/generic.py
2
5097
# SPDX-License-Identifier: Apache-2.0 # # Copyright (C) 2020, Arm Limited and contributors. # # 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
mantidproject/mantid
scripts/test/Muon/quick_edit/quick_edit_presenter_test.py
3
3612
# Mantid Repository : https://github.com/mantidproject/mantid # # Copyright &copy; 2021 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source, # Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS # SPDX - License - Identifier: GPL - 3.0 + impo...
gpl-3.0
sexroute/commandergenius
project/jni/python/src/Tools/scripts/nm2def.py
94
2444
#! /usr/bin/env python """nm2def.py Helpers to extract symbols from Unix libs and auto-generate Windows definition files from them. Depends on nm(1). Tested on Linux and Solaris only (-p option to nm is for Solaris only). By Marc-Andre Lemburg, Aug 1998. Additional notes: the output of nm is supposed to look like th...
lgpl-2.1
amishb/youtube-dl
test/test_age_restriction.py
171
1379
#!/usr/bin/env python from __future__ import unicode_literals # Allow direct execution import os import sys import unittest sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from test.helper import try_rm from youtube_dl import YoutubeDL def _download_restricted(url, filename, age): ...
unlicense