repo_name
stringlengths
5
100
path
stringlengths
4
375
copies
stringclasses
991 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
tmuelle2/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/bot/layouttestresultsreader_unittest.py
124
6488
# Copyright (c) 2011 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 ...
bsd-3-clause
eviljeff/zamboni
mkt/detail/views.py
3
1825
import hashlib from django import http from django.shortcuts import get_object_or_404 from django.views.decorators.http import etag import commonware.log import mkt from mkt.constants import MANIFEST_CONTENT_TYPE from mkt.site.decorators import allow_cross_site_request from mkt.webapps.decorators import app_view_fac...
bsd-3-clause
virgree/odoo
addons/account_chart/__init__.py
526
1055
# -*- 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...
agpl-3.0
googleapis/googleapis-gen
google/ads/googleads/v7/googleads-py/google/ads/googleads/v7/enums/types/budget_status.py
1
1102
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # 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...
apache-2.0
fuhongliang/odoo
addons/account/report/account_general_journal.py
381
7669
# -*- 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
Georacer/last_letter
last_letter/scripts/magnetometer.py
2
3857
#!/usr/bin/env python import roslib import sys import rospy import geomag from geometry_msgs.msg import Vector3, Vector3Stamped import numpy as np from uav_utils import getMag, ThermalRise from mathutils import saturation, quat2Reb, Vector2Array, quat2euler from math import floor, exp, atan2, pi from last_letter.msg ...
gpl-3.0
anandsimmy/ecommerce
src/oscar/apps/basket/migrations/0001_initial.py
12
3081
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Basket', fields=[ ('id', models.AutoField(auto_...
bsd-3-clause
morenopc/dimagi
dimagi/dimagi/wsgi.py
1
1560
""" WSGI config for dimagi 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`` s...
mit
anurag313/scikit-learn
sklearn/feature_extraction/tests/test_text.py
110
34127
from __future__ import unicode_literals import warnings from sklearn.feature_extraction.text import strip_tags from sklearn.feature_extraction.text import strip_accents_unicode from sklearn.feature_extraction.text import strip_accents_ascii from sklearn.feature_extraction.text import HashingVectorizer from sklearn.fe...
bsd-3-clause
hasteur/g13bot_tools_new
scripts/piper.py
1
4720
#!/usr/bin/python # -*- coding: utf-8 -*- r""" This bot uses external filtering programs for munging text. For example: python pwb.py piper -filter:"tr A-Z a-z" -page:Wikipedia:Sandbox Would lower case the article with tr(1). Muliple -filter commands can be specified: python pwb.py piper -filter:cat -filte...
mit
AusDTO/dto-digitalmarketplace-buyer-frontend
tests/app/views/test_marketplace.py
1
42556
# coding=utf-8 from datetime import datetime from lxml import html import pytest import mock from nose.tools import assert_equal, assert_true, assert_not_equals from six import iteritems from ...helpers import BaseApplicationTest from dmapiclient import api_stubs from dmutils.formats import DATETIME_FORMAT import pe...
mit
ehirt/odoo
openerp/addons/base/ir/ir_exports.py
338
1672
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the...
agpl-3.0
jkshaver/virtualenv-1.8.2
env/lib/python2.7/site-packages/django/contrib/gis/tests/relatedapp/tests.py
198
14731
from __future__ import absolute_import from datetime import date from django.contrib.gis.geos import GEOSGeometry, Point, MultiPoint from django.contrib.gis.db.models import Collect, Count, Extent, F, Union from django.contrib.gis.geometry.backend import Geometry from django.contrib.gis.tests.utils import mysql, orac...
mit
collective/eden
controllers/pr.py
2
21070
# -*- coding: utf-8 -*- """ Person Registry, Controllers """ module = request.controller resourcename = request.function # ----------------------------------------------------------------------------- # Options Menu (available in all Functions' Views) def s3_menu_postp(): # @todo: rewrite this for new framew...
mit
ronfung/incubator-airflow
airflow/utils/json.py
31
1925
# -*- coding: utf-8 -*- # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software ...
apache-2.0
nullx002/pychess
testing/database.py
21
1577
from __future__ import print_function import unittest from pychess.Utils.const import * from pychess.Savers.database import save, load from pychess.Savers.pgn import load as pgnload from pychess.Savers.pgn import walk from pychess.Database import model from pychess.Database.model import set_engine, metadata, collectio...
gpl-3.0
iarroyof/nlp-pipeline
log_MLRKHS.py
1
20264
""" Experimental machine for Reproducing kernel Hilbert spaces implemented in Theano. Main functionalities of this code were aquired from the Theano Multilayer Perceptron tutorial. Only RKHS and number of layers functionalities were introduced by me. Ignacio Arroyo-Fernandez IIMAS -- UNAM """ from __future__ import ...
gpl-3.0
google/tink
python/tink/jwt/_jwt_public_key_sign.py
1
1740
# Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
apache-2.0
bcarroll/authmgr
python-3.6.2-Win64/Lib/site-packages/pip/_vendor/requests/packages/chardet/escprober.py
2936
3187
######################## 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...
bsd-3-clause
obloko/cms
cms/registry.py
1
3729
# -*- coding: utf-8 -*- from collections import namedtuple import inspect import threading from django.db import models as django_models from django.db.models import fields as django_fields from django.db.models.fields import related as django_related from django.utils.lru_cache import lru_cache # Represents an item...
gpl-3.0
migueldiascosta/easybuild-framework
test/__init__.py
3
1386
## # Copyright 2009-2017 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be), # Flemish Research Foundation (F...
gpl-2.0
PlanTool/plantool
wrappingPlanners/Deterministic/LAMA/planning-lama(finished)/translate/pddl/parser.py
11
1118
__all__ = ["ParseError", "parse_nested_list"] class ParseError(Exception): pass # Basic functions for parsing PDDL (Lisp) files. def parse_nested_list(input_file): tokens = tokenize(input_file) next_token = tokens.next() if next_token != "(": raise ParseError("Expected '(', got %s." % next_tok...
gpl-2.0
esdalmaijer/EyeTribe-Toolbox-for-Matlab
python_source/pytribe.py
1
53195
# PyTribe: classes to communicate with EyeTribe eye trackers # # author: Edwin Dalmaijer # email: edwin.dalmaijer@psy.ox.ac.uk # # version 4 (21-Jun-2016) import os import copy import json import time import socket import codecs from threading import Lock, Thread from multiprocessing import Event, Proces...
gpl-3.0
aaron-prindle/minikube
hack/get_k8s_version.py
3
2584
#!/usr/bin/env python # Copyright 2016 The Kubernetes 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 # # Unle...
apache-2.0
google/tf-quant-finance
tf_quant_finance/math/root_search/newton_test.py
1
4256
# Lint as: python3 # Copyright 2021 Google LLC # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
apache-2.0
Sorsly/subtle
google-cloud-sdk/lib/surface/compute/target_tcp_proxies/create.py
6
3207
# Copyright 2014 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...
mit
StephenWeber/ansible
lib/ansible/modules/network/eos/eos_user.py
6
11880
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
gpl-3.0
pluser/nikola
nikola/data/themes/base/messages/messages_sk.py
6
1599
# -*- encoding:utf-8 -*- from __future__ import unicode_literals MESSAGES = { "%d min remaining to read": "zostáva %d minút na čítanie", "(active)": "(aktívne)", "Also available in:": "Tiež dostupné v:", "Archive": "Archív", "Categories": "Kategórie", "Comments": "Komentáre", "LANGUAGE": "S...
mit
bjodah/symengine.py
benchmarks/Lambdify.py
2
4346
#!/usr/bin/env python from time import clock import numpy as np import sympy as sp import symengine as se import warnings # Real-life example (ion speciation problem in water chemistry) x = sp.symarray('x', 14) p = sp.symarray('p', 14) args = np.concatenate((x, p)) exp = sp.exp exprs = [x[0] + x[1] - x[4] + 36.252574...
mit
pablodanielrey/python
alumnos/alumnos-sin-mail/ImportStudents.py
1
2632
''' Created on 19/12/2013 @author: pablo ''' import csv import ldap import ldap.modlist as modlist import uuid l = ldap.initialize("ldap://127.0.0.1:3389") l.protocol_version = ldap.VERSION3 l.simple_bind("cn=admin,dc=econo", "pcucqccp") countnew = 0 countchanged = 0 countchangesmail = 0 with open('/tmp/alumnos-s...
gpl-3.0
snailwalker/v2ex
html5lib/filters/whitespace.py
133
1204
try: frozenset except NameError: # Import from the sets module for python 2.3 from sets import ImmutableSet as frozenset import re import _base from html5lib.constants import rcdataElements, spaceCharacters spaceCharacters = u"".join(spaceCharacters) SPACES_REGEX = re.compile(u"[%s]+" % spaceCharacters) ...
bsd-3-clause
endlessm/chromium-browser
third_party/catapult/third_party/gsutil/third_party/pyasn1/tests/codec/ber/test_encoder.py
6
49629
# # This file is part of pyasn1 software. # # Copyright (c) 2005-2017, Ilya Etingof <etingof@gmail.com> # License: http://snmplabs.com/pyasn1/license.html # import sys try: import unittest2 as unittest except ImportError: import unittest from tests.base import BaseTestCase from pyasn1.type import tag from p...
bsd-3-clause
EntityFXCode/arsenalsuite
python/scripts/verifier_plugins/urgentPrios.py
10
1171
from PyQt4.QtCore import * from PyQt4.QtSql import * from blur.Stone import * from blur.Classes import * from verifier_plugin_factory import * requiredShots = {} requiredShots['30'] = [['21a_020', 'hf2-light'], ['21a_040', 'hf2-light'], ['04_060', 'hf2-light'], ...
gpl-2.0
joelferrier/margaritashotgun
margaritashotgun/cli.py
1
11467
import argparse import logging import os import yaml from yaml import YAMLError from margaritashotgun.exceptions import InvalidConfigurationError logger = logging.getLogger(__name__) default_allowed_keys = ["aws", "hosts", "workers", "logging", "repository"] aws_allowed_keys = ["bucket"] host_allowed_keys = ["addr", ...
mit
vasco-santos/DHT-Demo
src/Chord.py
1
29520
from argparse import ArgumentParser from twisted.internet import protocol, reactor from threading import Thread from pickle import dumps from pickle import loads from time import sleep from math import log from math import ceil from sys import getsizeof from random import randint import mysql.connector impor...
gpl-3.0
rmboggs/django
django/utils/baseconv.py
650
2982
# Copyright (c) 2010 Guilherme Gondim. All rights reserved. # Copyright (c) 2009 Simon Willison. All rights reserved. # Copyright (c) 2002 Drew Perttula. All rights reserved. # # License: # Python Software Foundation License version 2 # # See the file "LICENSE" for terms & conditions for usage, and a DISCLAIMER OF # ...
bsd-3-clause
forbidden-ali/LaZagne
Windows/src/LaZagne/softwares/windows/secrets.py
10
1980
import subprocess import os, sys from secretsdump import retrieve_hash from config.header import Header from config.write_output import print_debug from ctypes import * import logging from config.moduleInfo import ModuleInfo class Secrets(ModuleInfo): def __init__(self): options = {'command': '-s', 'acti...
lgpl-3.0
lucienfostier/gaffer
python/GafferSceneTest/SetVisualiserTest.py
8
12700
########################################################################## # # Copyright (c) 2019, Cinesite VFX Ltd. 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 ...
bsd-3-clause
Epirex/android_external_chromium_org
native_client_sdk/src/tools/tests/chrome_mock.py
107
1498
#!/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. import optparse import sys import time import urllib2 def PrintAndFlush(s): print s sys.stdout.flush() def main(args): pars...
bsd-3-clause
rsennrich/multidomain_smt
cluster.py
1
9750
#!/usr/bin/python # -*- coding: utf-8 -*- # Author: Rico Sennrich <sennrich@cl.uzh.ch> from __future__ import division import sys import os import random import math import operator from subprocess import Popen, PIPE from collections import defaultdict from config import LMPLZ_CMD def euclidean_distance(v1, v2): ...
gpl-2.0
raycarnes/odoomrp-wip
procurement_purchase_no_grouping/tests/test_procurement_purchase_no_grouping.py
25
3266
# -*- coding: utf-8 -*- # (c) 2015 Pedro M. Baeza # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html from openerp.tests.common import TransactionCase class TestProcurementPurchaseNoGrouping(TransactionCase): def setUp(self): super(TestProcurementPurchaseNoGrouping, self).setUp() se...
agpl-3.0
Jgarcia-IAS/localizacion
openerp/addons-extra/odoo-pruebas/odoo-server/addons/stock/report/__init__.py
376
1088
# -*- 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
ColOfAbRiX/ansible
lib/ansible/modules/cloud/rackspace/rax_cbs.py
25
7273
#!/usr/bin/python # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distributed...
gpl-3.0
Captain-Coder/tribler
Tribler/Test/Core/Modules/test_tracker_manager.py
1
3583
from twisted.internet.defer import inlineCallbacks from Tribler.Core.Config.tribler_config import TriblerConfig from Tribler.Core.Modules.tracker_manager import TrackerManager from Tribler.Core.Session import Session from Tribler.Test.Core.base_test import TriblerCoreTest class TestTrackerManager(TriblerCoreTest): ...
lgpl-3.0
spudsdude/XBMC-Flicks
resources/lib/iqueue.py
1
82506
from Netflix import * import getopt import time import re import xbmcplugin, xbmcaddon, xbmcgui, xbmc import urllib, urllib2 import webbrowser import os from settings import * from xinfo import * import simplejson # parameter keys PARAMETER_KEY_MODE = "mode" SUBMENU1a = "Movies" SUBMENU1b = "TV Shows" MODE1a = 11 MOD...
gpl-3.0
ankit01ojha/coala-bears
bears/xml2/XMLBear.py
9
2772
import itertools import re from coalib.bearlib.abstractions.Linter import linter from dependency_management.requirements.DistributionRequirement import ( DistributionRequirement) from coalib.settings.Setting import path, url from coalib.results.RESULT_SEVERITY import RESULT_SEVERITY def path_or_url(xml_dtd): ...
agpl-3.0
astropy/astropy
astropy/units/tests/test_quantity_annotations.py
6
7862
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst import pytest from astropy import units as u # pylint: disable=W0611 @pytest.mark.parametrize("solarx_unit,solary_unit", [ (u.arcsec, u.arcsec), ('angle', 'angle')]) def test_ar...
bsd-3-clause
okfish/django-oscar
src/oscar/apps/checkout/app.py
23
2535
from django.conf import settings from django.conf.urls import url from django.contrib.auth.decorators import login_required from oscar.core.application import Application from oscar.core.loading import get_class class CheckoutApplication(Application): name = 'checkout' index_view = get_class('checkout.views...
bsd-3-clause
RPI-OPENEDX/edx-platform
lms/djangoapps/student_account/test/test_views.py
20
20748
# -*- coding: utf-8 -*- """ Tests for student account views. """ import re from unittest import skipUnless from urllib import urlencode import json import mock import ddt from django.conf import settings from django.core.urlresolvers import reverse from django.core import mail from django.contrib import messages from...
agpl-3.0
salguarnieri/intellij-community
python/lib/Lib/site-packages/django/template/defaultfilters.py
71
29514
"""Default variable filters.""" import re from decimal import Decimal, InvalidOperation, ROUND_HALF_UP import random as random_module try: from functools import wraps except ImportError: from django.utils.functional import wraps # Python 2.4 fallback. from django.template.base import Variable, Library from d...
apache-2.0
rhurkes/chasegame
venv/lib/python2.7/site-packages/werkzeug/script.py
147
11249
# -*- coding: utf-8 -*- r''' werkzeug.script ~~~~~~~~~~~~~~~ .. admonition:: Deprecated Functionality ``werkzeug.script`` is deprecated without replacement functionality. Python's command line support improved greatly with :mod:`argparse` and a bunch of alternative modules. Most ...
mit
cloudify-cosmo/cloudify-manager
tests/integration_tests/tests/agentless_tests/test_hooks.py
1
12445
######## # Copyright (c) 2013 GigaSpaces Technologies Ltd. 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...
apache-2.0
msekletar/systemd-fedora
.ycm_extra_conf.py
129
1551
import itertools import os import subprocess def GetFlagsFromMakefile(varname): return subprocess.check_output([ "make", "-s", "print-%s" % varname]).decode().split() def Flatten(lists): return list(itertools.chain.from_iterable(lists)) def DirectoryOfThisScript(): return os.path.dirname(os.path.abspat...
gpl-2.0
videlec/sage-flatsurf
flatsurf/geometry/similarity_surface.py
1
105268
r""" Similarity surfaces. """ from __future__ import absolute_import, print_function, division from six.moves import range, map, filter, zip from six import iteritems import itertools from sage.misc.cachefunc import cached_method from sage.misc.sage_unittest import TestSuite from sage.structure.sage_object import S...
gpl-2.0
James-Firth/pip
pip/_vendor/requests/compat.py
1039
1469
# -*- coding: utf-8 -*- """ pythoncompat """ from .packages import chardet import sys # ------- # Pythons # ------- # Syntax sugar. _ver = sys.version_info #: Python 2.x? is_py2 = (_ver[0] == 2) #: Python 3.x? is_py3 = (_ver[0] == 3) try: import simplejson as json except (ImportError, SyntaxError): # si...
mit
Gitlab11/odoo
addons/analytic_contract_hr_expense/analytic_contract_hr_expense.py
223
7860
# -*- 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
luci/luci-py
appengine/components/components/auth/machine_auth_test.py
2
5624
#!/usr/bin/env vpython # Copyright 2016 The LUCI Authors. All rights reserved. # Use of this source code is governed under the Apache License, Version 2.0 # that can be found in the LICENSE file. import base64 import datetime import sys import unittest from test_support import test_env test_env.setup_test_env() impo...
apache-2.0
chuan9/chromium-crosswalk
build/android/pylib/device/adb_wrapper_test.py
36
2860
# Copyright 2013 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. """Tests for the AdbWrapper class.""" import os import tempfile import time import unittest from pylib.device import adb_wrapper from pylib.device import d...
bsd-3-clause
2015fallproject/2015fallcase2
static/Brython3.2.0-20150701-214155/Lib/test/unittests/test_syslog.py
89
1104
from test import support syslog = support.import_module("syslog") #skip if not supported import unittest # XXX(nnorwitz): This test sucks. I don't know of a platform independent way # to verify that the messages were really logged. # The only purpose of this test is to verify the code doesn't crash or leak. class T...
agpl-3.0
irvined1982/openlava-web
openlavaweb/views.py
1
80499
#!/usr/bin/env python # Copyright 2011 David Irvine # # This file is part of Openlava Web # # Openlava Web 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)...
gpl-3.0
cchurch/ansible
test/units/modules/network/f5/test_bigip_sys_daemon_log_tmm.py
2
4595
# -*- coding: utf-8 -*- # # Copyright: (c) 2018, F5 Networks Inc. # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os import json import pytest import sys if sys.version_info < (2...
gpl-3.0
4commerce-technologies-AG/erpnext
erpnext/accounts/report/general_ledger/general_ledger.py
24
5834
# 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 _ def execute(filters=None): account_details = {} for acc in frappe.db.sql("""...
agpl-3.0
kosz85/django
tests/i18n/tests.py
9
72596
import datetime import decimal import gettext as gettext_module import os import pickle from contextlib import contextmanager from importlib import import_module from threading import local from django import forms from django.conf import settings from django.conf.urls.i18n import i18n_patterns from django.template im...
bsd-3-clause
quanganh2627/Kernel-fo-Zenfone-6-by-BORETS24
scripts/tracing/draw_functrace.py
14676
3560
#!/usr/bin/python """ Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com> Licensed under the terms of the GNU GPL License version 2 This script parses a trace provided by the function tracer in kernel/trace/trace_functions.c The resulted trace is processed into a tree to produce a more human view of the call ...
gpl-2.0
luistorresm/odoo
addons/mrp_operations/report/__init__.py
443
1131
# -*- 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...
agpl-3.0
heke123/chromium-crosswalk
content/test/gpu/gpu_tests/gpu_rasterization.py
15
3193
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from gpu_tests import cloud_storage_test_base from gpu_tests import gpu_rasterization_expectations import page_sets from telemetry.page import page_test fro...
bsd-3-clause
n8henrie/eyeflask
setup.py
1
1877
# -*- coding: utf-8 -*- import re try: from setuptools import setup, find_packages except ImportError: from distutils.core import setup try: import pypandoc readme = pypandoc.convert('README.md', 'rst') history = pypandoc.convert('CHANGELOG.md', 'rst') except (ImportError, OSError): with open(...
mit
KellyChan/Python
javascript/backbone/backbone-templates/backbone-fileupload/venvs/lib/python2.7/site-packages/django/contrib/gis/tests/test_geoforms.py
240
2671
from django.forms import ValidationError from django.contrib.gis import forms from django.contrib.gis.geos import GEOSGeometry from django.utils import unittest class GeometryFieldTest(unittest.TestCase): def test00_init(self): "Testing GeometryField initialization with defaults." fld = forms.Geo...
mit
Nitaco/ansible
lib/ansible/modules/storage/netapp/na_ontap_snapshot.py
9
11805
#!/usr/bin/python # (c) 2018, NetApp, Inc # GNU General Public License v3.0+ # (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
gpl-3.0
craynot/django
tests/one_to_one/tests.py
54
19834
from __future__ import unicode_literals from django.db import IntegrityError, connection, transaction from django.test import TestCase from .models import ( Bar, Director, Favorites, HiddenPointer, ManualPrimaryKey, MultiModel, Place, Pointer, RelatedModel, Restaurant, School, Target, UndergroundBar, Wait...
bsd-3-clause
HAYASAKA-Ryosuke/faker
faker/providers/person/uk_UA/__init__.py
16
14885
# coding=utf-8 from __future__ import unicode_literals from .. import Provider as PersonProvider class Provider(PersonProvider): formats = ( '{{first_name_male}} {{last_name}}', '{{first_name_female}} {{last_name}}', '{{prefix_male}} {{first_name_male}} {{last_name}}', '{{prefix_fe...
mit
sw25sw25/Docker
pip/_vendor/requests/packages/urllib3/util/retry.py
699
9924
import time import logging from ..exceptions import ( ConnectTimeoutError, MaxRetryError, ProtocolError, ReadTimeoutError, ResponseError, ) from ..packages import six log = logging.getLogger(__name__) class Retry(object): """ Retry configuration. Each retry attempt will create a new Re...
mit
harisibrahimkv/django
tests/contenttypes_tests/test_views.py
20
5424
import datetime from unittest import mock from django.contrib.contenttypes.models import ContentType from django.contrib.sites.models import Site from django.db import models from django.test import TestCase, override_settings from django.test.utils import isolate_apps from .models import ( Article, Author, Model...
bsd-3-clause
slohse/ansible
lib/ansible/modules/database/proxysql/proxysql_global_variables.py
52
8254
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2017, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type DOCUMENTATION = ''' --- module: proxysql_global_variables ...
gpl-3.0
ecosoft-odoo/odoo
addons/website_forum/models/forum.py
233
38491
# -*- coding: utf-8 -*- from datetime import datetime import uuid from werkzeug.exceptions import Forbidden import logging import openerp from openerp import api, tools from openerp import SUPERUSER_ID from openerp.addons.website.models.website import slug from openerp.exceptions import Warning from openerp.osv impo...
agpl-3.0
nouiz/pydy
examples/Kane1985/Chapter6/Ex11.12_11.13.py
8
2718
#!/usr/bin/env python # -*- coding: utf-8 -*- """Exercises 11.12, 11.13 from Kane 1985.""" from __future__ import division from sympy import pi, solve, symbols, trigsimp from sympy.physics.mechanics import ReferenceFrame, RigidBody, Point from sympy.physics.mechanics import dot, dynamicsymbols, inertia, msprint from u...
bsd-3-clause
alexbruy/QGIS
python/plugins/processing/algs/gdal/ogr2ogrtopostgis.py
2
14108
# -*- coding: utf-8 -*- """ *************************************************************************** ogr2ogrtopostgis.py --------------------- Date : November 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com ********************...
gpl-2.0
woutdenolf/spectrocrunch
spectrocrunch/detectors/tests/test_base.py
1
1951
# -*- coding: utf-8 -*- import unittest from .. import base from ...patch import jsonpickle from ...materials import compoundfromname from ...materials import element from ...materials import mixture class test_base(unittest.TestCase): @unittest.skipIf(compoundfromname.xraylib is None, "xraylib not installed") ...
mit
migasfree/migasfree
migasfree/server/migrations/0032_4_17_migasfree_play_fixtures.py
1
1417
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations from django.core.management.sql import emit_post_migrate_signal from django.contrib.auth.hashers import make_password def add_migasfree_play_user(apps, schema_editor): db_alias = schema_editor.connection.alias e...
gpl-3.0
malcolmwhite/DungeonsAndDragons
src/main/managers/conflict/base_conflict_manager.py
1
6767
import logging from random import shuffle from src.main.utils.utils import join_multi_line_strings class BaseConflictManager(object): """ Abstract class with core functionality for managing conflicts. Implementations must implement :py:meth:`base_conflict_manager.BaseConflictManager._pick_conflict` and ...
mit
madcowfred/evething
thing/models/__init__.py
2
2453
# flake8: noqa # Locations from thing.models.region import Region from thing.models.constellation import Constellation from thing.models.system import System from thing.models.station import Station # Entities from thing.models.faction import Faction from thing.models.alliance import Alliance from thing.models.corpor...
bsd-2-clause
lukego/linux
tools/perf/scripts/python/net_dropmonitor.py
1812
1749
# Monitor the system for dropped packets and proudce a report of drop locations and counts import os import sys sys.path.append(os.environ['PERF_EXEC_PATH'] + \ '/scripts/python/Perf-Trace-Util/lib/Perf/Trace') from perf_trace_context import * from Core import * from Util import * drop_log = {} kallsyms = [] def...
gpl-2.0
awanke/bokeh
examples/plotting/file/markers.py
45
1530
from numpy.random import random from bokeh.plotting import figure, show, output_file def mscatter(p, x, y, typestr): p.scatter(x, y, marker=typestr, line_color="#6666ee", fill_color="#ee6666", fill_alpha=0.5, size=12) def mtext(p, x, y, textstr): p.text(x, y, text=[textstr], text_color="...
bsd-3-clause
SPlanzer/QGIS-AIMS-Plugin
AimsUI/AimsClient/Gui/Ui_EditFeatureDialog.py
2
32628
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'AimsUI/AimsClient/Gui/Ui_EditFeatureDialog.ui' # # Created: Fri Sep 16 08:59:46 2016 # by: PyQt4 UI code generator 4.10.4 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = Qt...
bsd-3-clause
raincoatrun/ThinkStats2
code/hinc.py
67
1494
"""This file contains code used in "Think Stats", by Allen B. Downey, available from greenteapress.com Copyright 2014 Allen B. Downey License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html """ from __future__ import print_function import numpy as np import pandas import thinkplot import thinkstats2 def Clean(s):...
gpl-3.0
aiyyoi/DevFest-MaxBond
MaxBond/env/lib/python2.7/site-packages/jinja2/testsuite/regression.py
414
8382
# -*- coding: utf-8 -*- """ jinja2.testsuite.regression ~~~~~~~~~~~~~~~~~~~~~~~~~~~ Tests corner cases and bugs. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ import unittest from jinja2.testsuite import JinjaTestCase from jinja2 import Template, Enviro...
mit
jpic/pescator
pages/migrations/0002_auto__add_field_page_header_image.py
1
3847
# -*- 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 field 'Page.header_image' db.add_column(u'pages_page', 'header_image', self.g...
bsd-2-clause
edxnercel/edx-platform
common/djangoapps/third_party_auth/management/commands/saml.py
80
1410
# -*- coding: utf-8 -*- """ Management commands for third_party_auth """ from django.core.management.base import BaseCommand, CommandError import logging from third_party_auth.models import SAMLConfiguration from third_party_auth.tasks import fetch_saml_metadata class Command(BaseCommand): """ manage.py commands ...
agpl-3.0
barsgroup/barsup-core
src/pynch/tests/auth/__init__.py
1
2452
# coding: utf-8 """Вспомогательные конструкции для тестов аутентификации и авторизации.""" from pynch.tests import DBMapperMock ADMIN_SESSION = "administrator-session-id" USER_SESSION = "user-sessin-id" class DBMapperAuth(DBMapperMock): """Заглушка для маппера.""" def create_data(self): """ Создан...
mit
117111302/iris
iris/packagedb/urls.py
2
3153
# -*- coding: utf-8 -*- # This file is part of IRIS: Infrastructure and Release Information System # # Copyright (C) 2013 Intel Corporation # # IRIS is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # version 2.0 as published by the Free Software Foundation....
gpl-2.0
charanpald/sandbox
sandbox/predictors/edge/test/CommonNeighboursPredictorTest.py
1
1615
import unittest import numpy from exp.sandbox.predictors.edge.CommonNeighboursPredictor import CommonNeighboursPredictor from apgl.graph import * class CommonNeighboursPredictorTest(unittest.TestCase): def testPredictEdge(self): numVertices = 10 numFeatures = 1 vList = VertexList(numV...
gpl-3.0
nabilbendafi/bottle
main.py
1
1256
import os import re from bottle import Bottle, request, response from bottle import static_file import jinja2 # set useful definitions root_dir = os.path.dirname(__file__) templates_dir = os.path.join(root_dir, 'templates') # initialise jinja2 environment JINJA_ENVIRONMENT = jinja2.Environment(loader=jinja2.FileSys...
apache-2.0
realestate-com-au/harpoon
harpoon/amazon.py
1
3453
from harpoon.errors import BadAmazon from harpoon import VERSION from botocore.exceptions import ClientError, NoCredentialsError from input_algorithms.spec_base import NotSpecified from six.moves.urllib.parse import urlparse from contextlib import contextmanager import logging import base64 import boto3 import os log...
mit
cnobile2012/dcolumn
example_site/settings/travis.py
1
1197
from .base import * DEBUG = False TRAVIS = True # Make data dir DATA_DIR = os.path.abspath(os.path.join(BASE_DIR, '..', 'data')) not os.path.isdir(DATA_DIR) and os.mkdir(DATA_DIR, 0o0775) DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'dcolumn', 'US...
mit
beni55/txZMQ
txzmq/test/test_pubsub.py
1
4438
""" Tests for L{txzmq.pubsub}. """ from twisted.trial import unittest from txzmq.connection import ZmqEndpoint, ZmqEndpointType from txzmq.factory import ZmqFactory from txzmq.pubsub import ZmqPubConnection, ZmqSubConnection from txzmq.test import _wait try: from zmq.core.error import ZMQError except ImportError...
gpl-2.0
takis/odoo
openerp/addons/test_impex/tests/test_import.py
231
30712
# -*- coding: utf-8 -*- import openerp.modules.registry import openerp from openerp.tests import common from openerp.tools.misc import mute_logger def ok(n): """ Successful import of ``n`` records :param int n: number of records which should have been imported """ return n, 0, 0, 0 def error(row, me...
agpl-3.0
slava-sh/NewsBlur
apps/profile/migrations/0006_collapsed_folders.py
18
4538
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Profile.collapsed_folders' db.add_column('profile_profile', 'collapsed_folders', self.gf('...
mit
hochthom/kaggle-taxi-ii
src/mk_submission_Experts.py
2
1994
import os import time import numpy as np import cPickle as pickle import pandas as pd from sklearn.ensemble import RandomForestRegressor, GradientBoostingRegressor from sklearn.cross_validation import ShuffleSplit from utils import haversineKaggle, rmse, CITY_CENTER t0 = time.time() df = pd.read_csv('../data/tes...
mit
wolfram74/numerical_methods_iserles_notes
venv/lib/python2.7/site-packages/IPython/core/magics/logging.py
21
6597
"""Implementation of magic functions for IPython's own logging. """ #----------------------------------------------------------------------------- # Copyright (c) 2012 The IPython Development Team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distribut...
mit
aachik/flask-blog-abdulmx
env/lib/python2.7/site-packages/setuptools/lib2to3_ex.py
907
1998
""" Customized Mixin2to3 support: - adds support for converting doctests This module raises an ImportError on Python 2. """ from distutils.util import Mixin2to3 as _Mixin2to3 from distutils import log from lib2to3.refactor import RefactoringTool, get_fixers_from_package import setuptools class DistutilsRefactorin...
mit