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
simar7/singh-kernel-shamu
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
feigames/Odoo
addons/website_blog/__openerp__.py
303
1819
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
agpl-3.0
faux123/kernel-msm
tools/perf/scripts/python/netdev-times.py
11271
15048
# Display a process of packets and processed time. # It helps us to investigate networking or network device. # # options # tx: show only tx chart # rx: show only rx chart # dev=: show only thing related to specified device # debug: work with debug mode. It shows buffer status. import os import sys sys.path.append(os...
gpl-2.0
xaratustrah/webstats
webstats_cgi.py
1
5320
#!/usr/bin/env python3.4 # -*- coding: utf-8 -*- """ A simple CGI script that shows server's GPU, CPU and memory load on the browser. Xaratustrah 2016 """ import subprocess, re from jinja2 import Template CMD = [ 'uname -n', 'uname -mrsv', 'date', 'sar -r 1 1', 'nvidia-smi --query-gpu=gpu_uuid,...
gpl-3.0
parkys1/swift_sandbox
test/functionalnosetests/test_object.py
10
21986
#!/usr/bin/python import unittest from nose import SkipTest from uuid import uuid4 from swift.common.constraints import MAX_META_COUNT, MAX_META_NAME_LENGTH, \ MAX_META_OVERALL_SIZE, MAX_META_VALUE_LENGTH from swift_testing import check_response, retry, skip, skip3, swift_test_user class TestObject(unittest.Te...
apache-2.0
TadejSk/conference-scheduler
app/views/views_conference.py
1
5037
import ast from django.contrib.auth.decorators import login_required from django.shortcuts import render, redirect from app.models import Conference, Paper __author__ = 'Tadej' @login_required def conference_list(request): conferences = Conference.objects.filter(user=request.user).order_by('id') form_data = [...
gpl-3.0
bluecoiner/bluecoin-new
qa/rpc-tests/zmq_test.py
41
3224
#!/usr/bin/env python3 # Copyright (c) 2015-2016 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 ZMQ interface # from test_framework.test_framework import BitcoinTestFramework from test_framew...
mit
mmulazzani/HoneyConnector
client/stem/descriptor/networkstatus.py
2
54852
# Copyright 2012-2013, Damian Johnson # See LICENSE for licensing information """ Parsing for Tor network status documents. This supports both the v2 and v3 dir-spec. Documents can be obtained from a few sources... * the 'cached-consensus' file in tor's data directory * tor metrics, at https://metrics.torproject.org/...
gpl-3.0
iuliat/nova
nova/api/validator.py
50
3221
# Copyright 2011 Cloudscaling, 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 requir...
apache-2.0
codeforkansascity/address-api
scrapers/countyscraper.py
3
4611
from bs4 import BeautifulSoup import json import requests import sys def FormatAPN(apn): return '{0}-{1}-{2}-{3}-{4}-{5}-{6}-{7}'.format(apn[0:2], apn[2:5], apn[5:7], apn[7:9], apn[9:11], apn[11], apn[12:14], apn[14:len(apn)]) def ExtractJSONAPNS(fileloc): file = open(fileloc, 'r') extractedJSON = json.JSONDecode...
mit
guohongze/adminset
vendor/django-celery-results-master/t/unit/test_models.py
3
2147
from __future__ import absolute_import, unicode_literals import pytest from datetime import datetime, timedelta from celery import states, uuid from celery.five import text_t from django_celery_results.models import TaskResult from django_celery_results.utils import now @pytest.mark.django_db() @pytest.mark.usefi...
gpl-2.0
nitzmahone/ansible-modules-core
cloud/openstack/os_user_group.py
77
3146
#!/usr/bin/python # Copyright (c) 2015 Hewlett-Packard Development Company, L.P. # # This module 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...
gpl-3.0
bpramod/azure-linux-extensions
VMEncryption/test/console_logger.py
4
1347
#!/usr/bin/env python # # ********************************************************* # Copyright (c) Microsoft. All rights reserved. # # Apache 2.0 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 # dis...
apache-2.0
HyunsukBaek/etherpad-lite
src/node_modules/npm/node_modules/node-gyp/gyp/test/library/gyptest-static.py
430
2241
#!/usr/bin/env python # Copyright (c) 2009 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. """ Verifies simple build of a "Hello, world!" program with static libraries, including verifying that libraries are rebuilt correctly when ...
apache-2.0
michath/ConMonkey
testing/mozbase/mozprofile/mozprofile/cli.py
2
4555
#!/usr/bin/env python # 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/. """ Creates and/or modifies a Firefox profile. The profile can be modified by passing in addons t...
mpl-2.0
arabenjamin/scikit-learn
examples/ensemble/plot_ensemble_oob.py
259
3265
""" ============================= OOB Errors for Random Forests ============================= The ``RandomForestClassifier`` is trained using *bootstrap aggregation*, where each new tree is fit from a bootstrap sample of the training observations :math:`z_i = (x_i, y_i)`. The *out-of-bag* (OOB) error is the average er...
bsd-3-clause
VielSoft/odoo
addons/sale/tests/test_product_id_change.py
145
2785
from openerp.tests.common import TransactionCase class TestProductIdChange(TransactionCase): """Test that when an included tax is mapped by a fiscal position, the included tax must be subtracted to the price of the product. """ def setUp(self): super(TestProductIdChange, self).setUp() ...
agpl-3.0
jferreir/mbed
workspace_tools/export/codered.py
49
1697
""" mbed SDK Copyright (c) 2011-2013 ARM Limited 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 writin...
apache-2.0
eirki/gargbot_3000
tests/test_commands.py
1
1486
#! /usr/bin/env python3 # coding: utf-8 from __future__ import annotations import datetime as dt from psycopg2.extensions import connection from gargbot_3000 import commands from tests import conftest def test_cmd_ping(): response = commands.cmd_ping() assert response == {"text": "GargBot 3000 is active. B...
mit
azureplus/hue
desktop/core/ext-py/avro-1.7.6/src/avro/io.py
64
31863
# 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
jstacoder/pycrm
level2_pycrm/sample_data.py
1
1395
from flask_dashed.dashboard import DefaultDashboard, DashboardWidget, HelloWorldWidget """ USERS - name, email, password, contacts, agencies CONTACTS - name, email, agencies, location, phone, address AGENCIES - name, email, contacts, main-contact, phone, alt-phone, zone """ def display(): USERS = { 'on...
bsd-3-clause
mikehankey/fireball_camera
scan-stills.py
1
34000
#!/usr/bin/python3 from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas from matplotlib.figure import Figure from sklearn.cluster import KMeans from sklearn import datasets from scipy.spatial.distance import cdist import matplotlib.pyplot as plt from random import randint import time import ...
gpl-3.0
awkspace/ansible
lib/ansible/modules/network/avi/avi_applicationpersistenceprofile.py
31
6715
#!/usr/bin/python # # @author: Gaurav Rastogi (grastogi@avinetworks.com) # Eric Anderson (eanderson@avinetworks.com) # module_check: supported # Avi Version: 17.1.1 # # Copyright: (c) 2017 Gaurav Rastogi, <grastogi@avinetworks.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses...
gpl-3.0
firebitsbr/raspberry_pwn
src/pentest/wifite/wifite.py
8
119239
#!/usr/bin/python # -*- coding: cp1252 -*- """ WIFITE (c) 2010, 2011 derv merkler, Jose Maria Chia, Aaron Type -h or -help for command-line options """ """ TODO LIST: -crack at IVS option (-ivs) -chop-chop stops if failed -- have it start again until it runs out of time! -find someone to test SKA (m...
gpl-3.0
MozillaSecurity/FuzzManager
server/taskmanager/management/commands/taskmanager_pulse_listen.py
1
3037
# -*- coding: utf-8 -*- from logging import getLogger from pathlib import Path from django.conf import settings from django.core.management import BaseCommand, CommandError # noqa from mozillapulse.consumers import GenericConsumer, PulseConfiguration from ...tasks import update_task, update_pool_defns LOG = getLog...
mpl-2.0
vrv/tensorflow
tensorflow/contrib/keras/python/keras/layers/merge.py
2
18933
# 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
IshankGulati/scikit-learn
sklearn/decomposition/tests/test_online_lda.py
24
14430
import numpy as np from scipy.linalg import block_diag from scipy.sparse import csr_matrix from scipy.special import psi from sklearn.decomposition import LatentDirichletAllocation from sklearn.decomposition._online_lda import (_dirichlet_expectation_1d, _dirichlet_expect...
bsd-3-clause
aszlig/MongooseIM
tools/zabbix_api.py
35
78787
# This is a port of the ruby zabbix api found here: # http://trac.red-tux.net/browser/ruby/api/zbx_api.rb # #LGPL 2.1 http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html #Zabbix API Python Library. #Original Ruby Library is Copyright (C) 2009 Andrew Nelson nelsonab(at)red-tux(dot)net #Python Library is Copyright (...
gpl-2.0
tedi3231/openerp
openerp/tests/test_osv.py
446
4722
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2010 OpenERP S.A. http://www.openerp.com # # This program is free software: you can redistribute it and/or modify # it under the terms of the GN...
agpl-3.0
xfournet/intellij-community
python/lib/Lib/platform.py
74
40969
#!/usr/bin/env python """ This module tries to retrieve as much platform-identifying data as possible. It makes this information available via function APIs. If called from the command line, it prints the platform information concatenated as single string to stdout. The output format is useable as par...
apache-2.0
akuster/yali
yali/storage/library/swap.py
2
2608
#!/usr/bin/python # -*- coding: utf-8 -*- import os import resource import gettext __trans = gettext.translation('yali', fallback=True) _ = __trans.ugettext import yali.util from yali.storage.library import devicemapper from yali.storage.library import LibraryError class SwapError(LibraryError): pass class Old...
gpl-2.0
flar2/villec2-bulletproof
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py
12527
1935
# Util.py - Python extension for perf script, miscellaneous utility code # # Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com> # # This software may be distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. import errno, os FUTEX_WAIT = 0...
gpl-2.0
clouddocx/boto
tests/integration/s3/test_https_cert_validation.py
111
6023
# Copyright 2011 Google Inc. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, dis- # trib...
mit
ispras/NetBlox-plug-ins
numericCharacteristics/communityMeasuresABL/apps/measuresABL_computer.py
1
4448
from math import log import networkx as nx import sys __author__ = 'misha' MIN_NONTRIVIAL_COMM_SIZE = 3 def community_quality(graph, comm_list, is_directed): # TODO define format: do we have coordinates of users (or towers?) in a separate file? return -1 def get_unique_nodes(comm_list): unique_nodes...
apache-2.0
divergentdave/inspectors-general
inspectors/hhs.py
1
30504
#!/usr/bin/env python import datetime import itertools import logging import os import re from urllib.parse import urljoin, urlparse, urlunparse, urldefrag from utils import utils, inspector, admin # http://oig.hhs.gov/reports-and-publications/index.asp archive = 1985 # options: # standard since/year options for ...
cc0-1.0
victor-prado/broker-manager
environment/lib/python3.5/site-packages/pandas/io/tests/sas/test_sas7bdat.py
7
4973
import pandas as pd from pandas.compat import PY2 import pandas.util.testing as tm import os import io import numpy as np class TestSAS7BDAT(tm.TestCase): def setUp(self): self.dirpath = tm.get_data_path() self.data = [] self.test_ix = [list(range(1, 16)), [16]] for j in 1, 2: ...
mit
ESOedX/edx-platform
openedx/core/djangoapps/theming/tests/test_util.py
2
3064
""" Test helpers for Comprehensive Theming. """ from __future__ import absolute_import, print_function import contextlib import os import os.path import re from functools import wraps from django.conf import settings from django.contrib.sites.models import Site from mock import patch import edxmako from openedx.core...
agpl-3.0
TheTypoMaster/chromium-crosswalk
tools/perf/measurements/media.py
21
2644
# 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. from telemetry.page import page_test from metrics import cpu from metrics import media from metrics import power from metrics import system_memory class M...
bsd-3-clause
Tesora-Release/tesora-trove
trove/guestagent/service.py
14
1196
# Copyright 2011 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
apache-2.0
mattkenney/feedsqueeze
xpath/parser.py
5
17304
import xpath.expr as X from xpath.yappsrt import * from string import * import re class XPathScanner(Scanner): patterns = [ ("r'\\:'", re.compile('\\:')), ("r'node'", re.compile('node')), ("r'text'", re.compile('text')), ("r'comment'", re.compile('comment')), ("r'processin...
agpl-3.0
defionscode/ansible
lib/ansible/modules/network/eos/eos_vlan.py
25
11418
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, Ansible by Red Hat, inc # # This file is part of Ansible by Red Hat # # 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 Li...
gpl-3.0
EnEff-BIM/EnEffBIM-Framework
SimModel_Python_API/simmodel_swig/Release/SimController_SupplyWater_Temperature.py
1
12065
# This file was automatically generated by SWIG (http://www.swig.org). # Version 3.0.7 # # Do not make changes to this file unless you know what you are doing--modify # the SWIG interface file instead. from sys import version_info if version_info >= (2, 6, 0): def swig_import_helper(): from os.path imp...
mit
dcruzsteven/DataScienceFromScratch
code/recommender_systems.py
60
6291
from __future__ import division import math, random from collections import defaultdict, Counter from linear_algebra import dot users_interests = [ ["Hadoop", "Big Data", "HBase", "Java", "Spark", "Storm", "Cassandra"], ["NoSQL", "MongoDB", "Cassandra", "HBase", "Postgres"], ["Python", "scikit-learn", "sci...
unlicense
prasanna08/oppia
core/tests/gae_suite.py
1
3185
# Copyright 2014 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 required by applicable ...
apache-2.0
drxaero/calibre
src/chardet/euckrfreq.py
323
45962
######################## 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
menandmice/mnm-opendnssec
odsmmsync.py
1
13350
#! env python2 # Copyright (C) 2011-2015 Men & Mice # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND MEN & MIC...
isc
muendelezaji/workload-automation
wlauto/common/android/workload.py
1
23976
# Copyright 2013-2015 ARM Limited # # 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 w...
apache-2.0
RPGOne/Skynet
scikit-learn-c604ac39ad0e5b066d964df3e8f31ba7ebda1e0e/examples/linear_model/plot_bayesian_ridge.py
248
2588
""" ========================= Bayesian Ridge Regression ========================= Computes a Bayesian Ridge Regression on a synthetic dataset. See :ref:`bayesian_ridge_regression` for more information on the regressor. Compared to the OLS (ordinary least squares) estimator, the coefficient weights are slightly shift...
bsd-3-clause
andersonresende/django
django/contrib/gis/tests/inspectapp/tests.py
23
6714
from __future__ import unicode_literals import os import re from unittest import skipUnless from django.core.management import call_command from django.db import connection, connections from django.test import TestCase, skipUnlessDBFeature from django.contrib.gis.gdal import HAS_GDAL from django.contrib.gis.geometry....
bsd-3-clause
gholms/euca2ools
euca2ools/commands/ec2/importkeypair.py
6
2104
# Copyright 2009-2013 Eucalyptus Systems, Inc. # # Redistribution and use of this software 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 ...
bsd-2-clause
nharraud/b2share
invenio/modules/formatter/format_elements/bfe_authors_parent.py
13
14797
# -*- coding: utf-8 -*- # # $Id$ # # This file is part of Invenio. # Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2011, 2014 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 versio...
gpl-2.0
weinbe58/QuSpin
examples/scripts/outdated/boson_MBL.py
1
2746
from quspin.basis import boson_basis_1d,spin_basis_1d from quspin.operators import hamiltonian,exp_op from quspin.tools.measurements import obs_vs_time import numpy as np import matplotlib.pyplot as plt N=10 L=2*N start=0 stop=10 num=20 endpoint=True basis = boson_basis_1d(L,Nb=N) np.random.seed() U_1 = [[1.0,...
bsd-3-clause
moto-timo/ironpython3
Tests/test_clrload2.py
3
2340
##################################################################################### # # 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 th...
apache-2.0
ESOedX/edx-platform
lms/djangoapps/courseware/tests/test_about.py
1
28959
""" Test the about xblock """ from __future__ import absolute_import import datetime import ddt import mock import pytz import six from ccx_keys.locator import CCXLocator from django.conf import settings from django.test.utils import override_settings from django.urls import reverse from milestones.tests.utils import...
agpl-3.0
cynapse/cynin
src/ubify.policy/ubify/policy/locales/googtext.py
5
3759
#!/usr/bin/env python # # googtext 0.1 # Written on 2009-03-27 by Senko Rasic <senko@senko.net> # This software is Public Domain. Use it as you like. import gtranslate import polib import sys import re class GoogText: STRINGS_PER_REQUEST = 100 def __init__(self, client_url, api_key=None): self.api =...
gpl-3.0
VigTech/Vigtech-Services
env/lib/python2.7/site-packages/django/conf/locale/zh_Hans/formats.py
634
1810
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'Y年n月j日' # 2016年9月5...
lgpl-3.0
broferek/ansible
test/units/modules/network/fortios/test_fortios_firewall_shaping_policy.py
21
12994
# Copyright 2019 Fortinet, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the...
gpl-3.0
fabian4/ceilometer
ceilometer/storage/sqlalchemy/migrate_repo/versions/028_alembic_migrations.py
9
5041
# # Copyright 2014 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
apache-2.0
Tesora-Release/tesora-trove
trove/extensions/cassandra/service.py
3
1164
# Copyright 2015 Tesora 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 a...
apache-2.0
superwood/tcollector
collectors/etc/config.py
10
1933
#!/usr/bin/python # This file is part of tcollector. # Copyright (C) 2010 The tcollector Authors. # # This program 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 License, or (a...
gpl-3.0
MA3STR0/simpletor
simpletor/tor.py
1
1747
import socks import socket import json from stem.control import Controller from stem import Signal try: from urllib2 import urlopen # python2 except ImportError: from urllib.request import urlopen # python3 class Tor(object): """Tor class for socks proxy and controller""" def __init__(self, socks_...
mit
shanewholloway/werkzeug
docs/conf.py
42
6631
# -*- coding: utf-8 -*- # # Werkzeug documentation build configuration file, created by # sphinx-quickstart on Fri Jan 16 23:10:43 2009. # # This file is execfile()d with the current directory set to its containing dir. # # The contents of this file are pickled, so don't put values in the namespace # that aren't pickle...
bsd-3-clause
kenshay/ImageScript
ProgramData/SystemFiles/Python/Lib/site-packages/django/db/backends/base/features.py
44
10181
from django.db.models.aggregates import StdDev from django.db.utils import ProgrammingError from django.utils.functional import cached_property class BaseDatabaseFeatures(object): gis_enabled = False allows_group_by_pk = False allows_group_by_selected_pks = False empty_fetchmany_value = [] update_...
gpl-3.0
rouault/Quantum-GIS
python/user.py
7
4676
# -*- coding: utf-8 -*- """ *************************************************************************** user.py --------------------- Date : January 2015 Copyright : (C) 2015 by Nathan Woodrow Email : woodrow dot nathan at gmail dot com ********************...
gpl-2.0
OpenUpgrade-dev/OpenUpgrade
addons/l10n_fr/report/base_report.py
154
5632
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (c) 2008 JAILLET Simon - CrysaLEAD - www.crysalead.fr # # WARNING: This program as such is intended to be used by professional # programmers who take the whole responsability of assessing all potential #...
agpl-3.0
kuiwei/edx-platform
lms/djangoapps/foldit/views.py
191
6365
import hashlib import json import logging from django.contrib.auth.decorators import login_required from django.http import HttpResponse from django.views.decorators.http import require_POST from django.views.decorators.csrf import csrf_exempt from foldit.models import Score, PuzzleComplete from student.models import...
agpl-3.0
amplifylitco/asiaq
disco_aws_automation/disco_route53.py
1
3922
""" Some code to manage Route53. Route53 manages our domains and DNS records. """ import logging from boto.route53 import Route53Connection from boto.route53.record import Record from disco_aws_automation.resource_helper import throttled_call logger = logging.getLogger(__name__) class DiscoRoute53(object): """...
bsd-2-clause
ethanrowe/flowz
flowz/test/application_test.py
2
5614
import contextlib import itertools import threading import mock from nose import tools from tornado import gen from tornado import ioloop from tornado import testing as tt from flowz import app from flowz import channels COUNTER = itertools.count() def mock_channel(*callables): chan = mock.Mock(name='MockChanne...
mit
Adraxas/Dolce-tools
node_modules/accessibility-developer-tools/lib/closure-library/closure/bin/build/depstree_test.py
354
3692
#!/usr/bin/env python # # Copyright 2009 The Closure Library 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 ...
lgpl-3.0
RexFuzzle/sfepy
sfepy/optimize/shape_optim.py
1
14091
import os.path as op import numpy as nm from sfepy.base.base import output, assert_, remap_dict, pause, Struct from sfepy.discrete.equations import get_expression_arg_names from sfepy.discrete.evaluate import eval_equations import free_form_def as ffd ## # c: 15.10.2007, r: 15.04.2008 def update_mesh( shape_opt, pb,...
bsd-3-clause
fahhem/openhtf
test/output/callbacks/callbacks_test.py
2
3436
# Copyright 2016 Google Inc. All Rights Reserved. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agre...
apache-2.0
PatSunter/pyOTPA
Trips_Generator/od_reader_VISTA.py
1
3632
import csv import sys from datetime import time #General strategy is # Keep parsing up lines till I find one that says "Destination SLA" # Then pull in all the other columns, so we get their indices. # Then skip out the "Annotations" columns, build a dict of Indices->SLA # Next row then can find the "Origin SLA" and ...
bsd-3-clause
ClearCorp-dev/odoo
addons/purchase/partner.py
210
2566
# -*- 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
pwns4cash/vivisect
vstruct/builder.py
7
8943
''' VStruct builder! Used to serialize structure definitions etc... ''' import copy import types import inspect import vstruct import vstruct.primitives as vs_prim prim_types = [ None, vs_prim.v_uint8, vs_prim.v_uint16, None, vs_prim.v_uint32, ...
apache-2.0
mikhaildubov/AST-text-analysis
east/synonyms/synonyms.py
2
6541
# -*- coding: utf-8 -* import codecs import collections import itertools import math import os import subprocess from xml.dom import minidom from east import consts from east import exceptions from east import utils as common_utils from east.synonyms import utils class SynonymExtractor(object): def __init__(s...
mit
lz1988/django-web2015
tests/regressiontests/utils/html.py
13
6347
from __future__ import unicode_literals import unittest from django.utils import html class TestUtilsHtml(unittest.TestCase): def check_output(self, function, value, output=None): """ Check that function(value) equals output. If output is None, check that function(value) equals value. ...
bsd-2-clause
TheTypoMaster/chromium-crosswalk
tools/gypv8sh.py
14
2927
#!/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 is used by chrome_tests.gypi's js2webui action to maintain the argument lists and to generate inlinable tests. """ ...
bsd-3-clause
syphar/django
tests/forms_tests/tests/test_widgets.py
12
10441
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.contrib.admin.tests import AdminSeleniumTestCase from django.forms import ( CheckboxSelectMultiple, ClearableFileInput, RadioSelect, TextInput, ) from django.forms.widgets import ( ChoiceFieldRenderer, ChoiceInput, RadioFieldRenderer, ...
bsd-3-clause
nttks/jenkins-test
lms/djangoapps/notes/views.py
63
1158
from django.contrib.auth.decorators import login_required from django.http import Http404 from edxmako.shortcuts import render_to_response from opaque_keys.edx.locations import SlashSeparatedCourseKey from courseware.courses import get_course_with_access from notes.models import Note from notes.utils import notes_enabl...
agpl-3.0
ritashugisha/OmniTube
selenium/webdriver/safari/webdriver.py
27
2605
#!/usr/bin/python # # Copyright 2011-2013 Sofware freedom conservancy # # 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...
gpl-3.0
posterior/loom
loom/cleanse.py
2
3755
# Copyright (c) 2014, Salesforce.com, Inc. All rights reserved. # Copyright (c) 2015, Google, Inc. # # 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 ...
bsd-3-clause
shark8me/libpgm
libpgm/tablecpdfactorization.py
1
18605
# Copyright (c) 2012, CyberPoint International, LLC # 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 lis...
bsd-3-clause
mnuthan1/workflow
lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/compat.py
2943
1157
######################## BEGIN LICENSE BLOCK ######################## # Contributor(s): # Ian Cordasco - port to Python # # This library 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 # versio...
apache-2.0
tensorflow/tensorflow
tensorflow/python/keras/layers/preprocessing/hashing_distribution_test.py
6
2394
# Copyright 2020 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
abhisg/scikit-learn
examples/model_selection/plot_confusion_matrix.py
244
2496
""" ================ Confusion matrix ================ Example of confusion matrix usage to evaluate the quality of the output of a classifier on the iris data set. The diagonal elements represent the number of points for which the predicted label is equal to the true label, while off-diagonal elements are those that ...
bsd-3-clause
blutooth/gp-svi
tests/test_binary_ops.py
7
4508
from __future__ import absolute_import from __future__ import print_function import autograd.numpy as np import autograd.numpy.random as npr from autograd.util import * from autograd import grad, value_and_grad rs = npr.RandomState(0) def arg_pairs(): scalar = 2.0 vector = rs.randn(4) mat = rs.randn(3, 4) ...
mit
puzan/ansible
lib/ansible/modules/cloud/amazon/ec2_vol_facts.py
25
4114
#!/usr/bin/python # # This is a free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This Ansible library is distributed in the hope that i...
gpl-3.0
mrkm4ntr/incubator-airflow
tests/providers/google/cloud/hooks/test_video_intelligence.py
7
4112
# # 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...
apache-2.0
thekingofkings/focusread
libs/werkzeug/websocket.py
18
11344
import re import errno import socket import struct import collections from base64 import b64decode, b64encode from hashlib import sha1 WS_KEY = b'258EAFA5-E914-47DA-95CA-C5AB0DC85B11' def pack_message(message): """Pack the message inside ``00`` and ``FF`` As per the dataframing section (5.3) for the websoc...
mit
jesseh/dothis
volunteering/migrations/0009_auto_20140803_1757.py
2
1619
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('volunteering', '0008_remove_campaign_start_date'), ] operations = [ migrations.CreateModel( name='Message', ...
agpl-3.0
TobiasLohner/SkyLines
tests/lib/test_igc.py
4
1493
# -*- coding: utf-8 -*- import datetime from skylines.lib.igc import read_igc_headers def test_empty_file(): assert read_igc_headers([]) == {} def test_logger_information(): assert (read_igc_headers(['AFLA6NG']) == dict(manufacturer_id='FLA', logger_id='6NG')) def test_filser_logger_id(): ...
agpl-3.0
oblitum/ycmd
ycmd/tests/cs/subcommands_test.py
3
18867
# Copyright (C) 2015-2017 ycmd contributors # # This file is part of ycmd. # # ycmd 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. # #...
gpl-3.0
habibmasuro/bitex
libs/ws4py/client/__init__.py
9
8025
# -*- coding: utf-8 -*- from base64 import b64encode from hashlib import sha1 import os import socket import ssl from ws4py import WS_KEY, WS_VERSION from ws4py.exc import HandshakeError from ws4py.websocket import WebSocket from ws4py.compat import urlsplit, enc, dec __all__ = ['WebSocketBaseClient'] class WebSocke...
gpl-3.0
jjs0sbw/CSPLN
apps/scaffolding/mac/web2py/web2py.app/Contents/Resources/gluon/packages/dal/pydal/adapters/imap.py
8
43003
# -*- coding: utf-8 -*- import datetime import re import sys from .._globals import IDENTITY, GLOBAL_LOCKER from .._compat import PY2, integer_types, basestring from ..connection import ConnectionPool from ..objects import Field, Query, Expression from ..helpers.classes import SQLALL from ..helpers.methods import use_...
gpl-3.0
aktech/sympy
sympy/series/acceleration.py
98
3314
""" Convergence acceleration / extrapolation methods for series and sequences. References: Carl M. Bender & Steven A. Orszag, "Advanced Mathematical Methods for Scientists and Engineers: Asymptotic Methods and Perturbation Theory", Springer 1999. (Shanks transformation: pp. 368-375, Richardson extrapolation: pp. 375-3...
bsd-3-clause
Gitlab11/odoo
addons/marketing/__init__.py
378
1071
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-TODAY OpenERP SA (http://www.openerp.com) # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
agpl-3.0
petermat/phantomjs
src/qt/qtwebkit/Tools/QueueStatusServer/config/logging.py
122
1582
# Copyright (C) 2013 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
veronicagg/autorest
src/generator/AutoRest.Python.Azure.Tests/Expected/AcceptanceTests/Paging/fixtures/acceptancetestspaging/models/paging_get_odata_multiple_pages_options.py
16
1068
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
landryb/psutil
test/_bsd.py
21
7771
#!/usr/bin/env python # Copyright (c) 2009, Giampaolo Rodola'. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # TODO: add test for comparing connections with 'sockstat' cmd """BSD specific tests. These are implicitly run by test_psutil.py."...
bsd-3-clause
luzpaz/QGIS
python/plugins/processing/script/OpenScriptFromFileAction.py
45
2373
# -*- coding: utf-8 -*- """ *************************************************************************** OpenScriptFromFileAction.py --------------------- Date : May 2018 Copyright : (C) 2018 by Mathieu Pellerin Email : nirvn dot asia at gmail dot com ******...
gpl-2.0