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
ufjfeng/leetcode-jf-soln
python/010_regular_expression_matching.py
1
1839
""" Implement regular expression matching with support for '.' and '*'. '.' Matches any single character. '*' Matches zero or more of the preceding element. The matching should cover the entire input string (not partial). The function prototype should be: bool isMatch(const char *s, const char *p) Some examples: ...
mit
mitodl/ansible
lib/ansible/color.py
6
2412
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) an...
gpl-3.0
jfinkels/PADS
pads/graphdegeneracy.py
1
1736
"""GraphDegeneracy.py Compute the degeneracy of graphs, and degeneracy orderings of graphs. D. Eppstein, July 2016. """ from .graphs import is_undirected from .bucketqueue import BucketQueue def degeneracySequence(G): """Generate pairs (vertex,number of later neighbors) in degeneracy order. """ if not ...
mit
itsjeyd/edx-platform
common/djangoapps/xblock_django/api.py
40
2336
""" API methods related to xblock state. """ from xblock_django.models import XBlockConfiguration, XBlockStudioConfiguration def deprecated_xblocks(): """ Return the QuerySet of deprecated XBlock types. Note that this method is independent of `XBlockStudioConfigurationFlag` and `XBlockStudioConfiguration...
agpl-3.0
simontorres/goodman
goodman_pipeline/wcs/tests/test_unittest.py
2
5855
from __future__ import absolute_import from unittest import TestCase, skip from ..wcs import WCS import numpy as np import os import re import sys from astropy.io import fits from astropy.modeling import (models, fitting, Model) from ccdproc import CCDData class TestWCS(TestCase): def setUp(self): ...
bsd-3-clause
lmyrefelt/CouchPotatoServer
couchpotato/core/providers/torrent/thepiratebay/__init__.py
3
1224
from main import ThePirateBay def start(): return ThePirateBay() config = [{ 'name': 'thepiratebay', 'groups': [ { 'tab': 'searcher', 'subtab': 'providers', 'list': 'torrent_providers', 'name': 'ThePirateBay', 'description': 'The world\'s...
gpl-3.0
davisein/jitsudone
django/django/contrib/gis/geos/prototypes/prepared.py
623
1032
from ctypes import c_char from django.contrib.gis.geos.libgeos import GEOM_PTR, PREPGEOM_PTR from django.contrib.gis.geos.prototypes.errcheck import check_predicate from django.contrib.gis.geos.prototypes.threadsafe import GEOSFunc # Prepared geometry constructor and destructors. geos_prepare = GEOSFunc('GEOSPrepare')...
bsd-3-clause
Jenselme/unlog
setup.py
1
1401
#!/usr/bin/env python3 from setuptools import setup from setuptools.command.test import test as TestCommand class PyTest(TestCommand): def finalize_options(self): TestCommand.finalize_options(self) self.test_args = [] self.test_suite = True def run_tests(self): # import here, ...
mit
EnTeQuAk/dotfiles
vim/ftplugin/orgmode/plugins/EditStructure.py
1
12618
# -*- coding: utf-8 -*- from orgmode import ORGMODE, apply_count, repeat, realign_tags, DIRECTION_FORWARD, DIRECTION_BACKWARD from orgmode.menu import Submenu, Separator, ActionEntry from orgmode.keybinding import Keybinding, Plug, MODE_INSERT, MODE_NORMAL from liborgmode import Heading from orgmode.exceptions import ...
unlicense
xiandiancloud/edxplaltfom-xusong
common/lib/xmodule/xmodule/modulestore/draft_and_published.py
4
4916
""" This module provides an abstraction for Module Stores that support Draft and Published branches. """ import threading from abc import ABCMeta, abstractmethod from contextlib import contextmanager from . import ModuleStoreEnum # Things w/ these categories should never be marked as version=DRAFT DIRECT_ONLY_CATEGOR...
agpl-3.0
trabacus-softapps/openerp-8.0-cc
openerp/addons/base_report_designer/plugin/openerp_report_designer/bin/script/Fields.py
384
12340
######################################################################### # # Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com # Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>). # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser Gene...
agpl-3.0
acarmel/CouchPotatoServer
libs/tornado/platform/twisted.py
65
21419
# Author: Ovidiu Predescu # Date: July 2011 # # 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 ...
gpl-3.0
mlaitinen/odoo
addons/mail/__openerp__.py
257
3602
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2010-Today OpenERP S.A. (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the term...
agpl-3.0
valtandor/easybuild-framework
easybuild/scripts/prep_for_release.py
9
10336
#!/usr/bin/env python ## # Copyright 2009-2015 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://vscentrum.be/nl/en), # the He...
gpl-2.0
Godiyos/python-for-android
python-modules/twisted/twisted/names/error.py
52
2016
# -*- test-case-name: twisted.names.test -*- # Copyright (c) 2001-2004 Twisted Matrix Laboratories. # See LICENSE for details. """ Exception class definitions for Twisted Names. """ from twisted.internet.defer import TimeoutError class DomainError(ValueError): """ Indicates a lookup failed because there wer...
apache-2.0
timlinux/QGIS
python/plugins/processing/gui/BatchInputSelectionPanel.py
30
10001
# -*- coding: utf-8 -*- """ *************************************************************************** BatchInputSelectionPanel.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com **************...
gpl-2.0
badele/fabtools
fabtools/tests/functional_tests/test_apt_key.py
4
2880
import pytest from fabric.api import run from fabtools.utils import run_as_root pytestmark = pytest.mark.network def test_add_apt_key_with_key_id_from_url(): from fabtools.deb import add_apt_key try: add_apt_key(keyid='C4DEFFEB', url='http://repo.varnish-cache.org/debian/GPG-key.txt') run_...
bsd-2-clause
GbalsaC/bitnamiP
venv/lib/python2.7/site-packages/networkx/linalg/spectrum.py
35
2271
""" Eigenvalue spectrum of graphs. """ # Copyright (C) 2004-2011 by # Aric Hagberg <hagberg@lanl.gov> # Dan Schult <dschult@colgate.edu> # Pieter Swart <swart@lanl.gov> # All rights reserved. # BSD license. import networkx as nx __author__ = "\n".join(['Aric Hagberg (hagberg@lanl.gov)', ...
agpl-3.0
alexmandujano/django
tests/forms_tests/tests/test_widgets.py
49
67143
# -*- coding: utf-8 -*- from __future__ import unicode_literals import copy import datetime from django.contrib.admin.tests import AdminSeleniumWebDriverTestCase from django.core.files.uploadedfile import SimpleUploadedFile from django.core.urlresolvers import reverse from django.forms import * from django.forms.widg...
bsd-3-clause
Xaltotun/conan
conans/test/integration/basic_build_test.py
1
3239
import unittest from conans.test.tools import TestClient import os from conans.paths import CONANINFO from conans.test.utils.cpp_test_files import cpp_hello_conan_files from nose.plugins.attrib import attr from conans.util.files import load from conans.model.info import ConanInfo import platform from conans.util.log im...
mit
vlajos/kcov
tests/tools/lookup-xml-node.py
2
1343
#!/usr/bin/env python import sys import xml.dom.minidom #all these imports are standard on most modern python implementations def readFile(name): f = open(name,'r') data = f.read() f.close() return data def lookupClassName(dom, name): tags = dom.getElementsByTagName('class') for tag in ta...
gpl-2.0
danimo/qt-creator
tests/system/suite_CSUP/tst_CSUP06/test.py
3
9506
############################################################################# ## ## Copyright (C) 2015 The Qt Company Ltd. ## Contact: http://www.qt.io/licensing ## ## This file is part of Qt Creator. ## ## Commercial License Usage ## Licensees holding valid commercial Qt licenses may use this file in ## accordance wit...
lgpl-2.1
matthew-brett/pymc
pymc/sandbox/EM.py
1
5716
__author__ = 'Anand Patil, anand.prabhakar.patil@gmail.com' from pymc.NormalApproximation import * import pymc as pm import numpy as np class EM(MAP): """ N = EM(input, sampler, db='ram', eps=.001, diff_order = 5) Normal approximation to the posterior of a model via the EM algorithm. Useful methods:...
mit
apurvbhartia/gnuradio-routing
gr-digital/examples/narrowband/receive_path.py
5
5441
#!/usr/bin/env python # # Copyright 2005-2007,2011 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 you...
gpl-3.0
Novasoft-India/OperERP-AM-Motors
openerp/addons/purchase/report/order.py
56
1475
# -*- 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
Yuriy-Leonov/nova
nova/virt/vmwareapi/io_util.py
12
6274
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2012 VMware, Inc. # Copyright (c) 2011 Citrix Systems, Inc. # Copyright 2011 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # ...
apache-2.0
RNAcentral/rnacentral-webcode
rnacentral/portal/models/xref.py
1
25620
""" Copyright [2009-2017] EMBL-European Bioinformatics Institute Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
apache-2.0
asm-products/movie-database-service
ani/lib/python2.7/site-packages/django/core/files/storage.py
58
10456
import os import errno import itertools from datetime import datetime from django.conf import settings from django.core.exceptions import SuspiciousFileOperation from django.core.files import locks, File from django.core.files.move import file_move_safe from django.utils.encoding import force_text, filepath_to_uri fro...
agpl-3.0
vertoe/p2pool-drk
nattraverso/pynupnp/soap.py
288
3547
""" This module is a SOAP client using twisted's deferreds. It uses the SOAPpy package. @author: Raphael Slinckx @copyright: Copyright 2005 @license: LGPL @contact: U{raphael@slinckx.net<mailto:raphael@slinckx.net>} @version: 0.1.0 """ __revision__ = "$id" import SOAPpy, logging from SOAPpy.Config import Config from...
gpl-3.0
mk-fg/feedjack
feedjack/migrations.south/0021_hash_post_guids.py
2
10125
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import DataMigration from django.db import models from hashlib import sha256 import hmac def guid_hash(guid, nid='feedjack:guid'): return 'urn:{0}:{1}'.format( nid, hmac.new(nid, msg=guid, digestmod=sha256).hexdigest() ) clas...
bsd-3-clause
JoyTeam/metagam
mg/mmorpg/equip.py
1
68596
#!/usr/bin/python2.6 # This file is a part of Metagam project. # # Metagam 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 # any later version. # # Metagam is distributed ...
gpl-3.0
wldcordeiro/servo
components/script/dom/bindings/codegen/parser/tests/test_nullable_equivalency.py
110
3536
import WebIDL def WebIDLTest(parser, harness): parser.parse(""" interface TestNullableEquivalency1 { attribute long a; attribute long? b; }; interface TestNullableEquivalency2 { attribute ArrayBuffer a; attribute ArrayBuffer? b; }; ...
mpl-2.0
lisael/pg-django
tests/regressiontests/reverse_single_related/tests.py
150
1491
from __future__ import absolute_import from django.test import TestCase from .models import Source, Item class ReverseSingleRelatedTests(TestCase): """ Regression tests for an object that cannot access a single related object due to a restrictive default manager. """ def test_reverse_single_rel...
bsd-3-clause
rschnapka/account-financial-tools
account_reversal/account_reversal.py
14
6466
# -*- coding: utf-8 -*- ############################################################################## # # Account reversal module for OpenERP # Copyright (C) 2011 Akretion (http://www.akretion.com). All Rights Reserved # @author Alexis de Lattre <alexis.delattre@akretion.com> # with the kind advice of Nico...
agpl-3.0
ShashaQin/erpnext
erpnext/selling/report/territory_target_variance_item_group_wise/territory_target_variance_item_group_wise.py
17
5541
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe import _, msgprint from frappe.utils import flt from erpnext.accounts.utils import get_fiscal_year from erpnext.controllers.tr...
agpl-3.0
JianpingZeng/xcc
xcc/java/utils/lit/lit/LitConfig.py
24
5477
from __future__ import absolute_import import inspect import os import sys import lit.Test import lit.formats import lit.TestingConfig import lit.util # LitConfig must be a new style class for properties to work class LitConfig(object): """LitConfig - Configuration data for a 'lit' test runner instance, shared ...
bsd-3-clause
krieger-od/nwjs_chromium.src
tools/site_compare/commands/timeload.py
189
4936
# Copyright (c) 2011 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. """SiteCompare command to time page loads Loads a series of URLs in a series of browsers (and browser versions) and measures how long the page takes to ...
bsd-3-clause
Jw00/WATT
tools/pepper.js/tools/httpd.py
5
2931
#!/usr/bin/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 of co...
apache-2.0
steveklabnik/servo
tests/wpt/web-platform-tests/tools/html5lib/html5lib/tests/test_whitespace_filter.py
453
5642
from __future__ import absolute_import, division, unicode_literals import unittest from html5lib.filters.whitespace import Filter from html5lib.constants import spaceCharacters spaceCharacters = "".join(spaceCharacters) try: unittest.TestCase.assertEqual except AttributeError: unittest.TestCase.assertEqual =...
mpl-2.0
pheanex/xpython
exercises/connect/example.py
3
1828
class ConnectGame: directions = [(0, 1), (0, -1), (1, 0), (-1, 0), (1, -1), (-1, 1)] white = "O" black = "X" none = "" def __init__(self, lines): self.board = self.make_board(lines) assert len(self.board) > 0 self.width = len(self.board[0]) self.height = len(self....
mit
noam09/kodi
script.module.israeliveresolver/lib/livestreamer/requests/packages/chardet/mbcssm.py
982
19608
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Con...
gpl-3.0
leanrobot/contestsite
testing/control.py
1
3249
from __future__ import absolute_import from datetime import datetime, date, timedelta from django.contrib.auth.models import User, Group import django.contrib.auth.hashers as hasher from django.conf import settings from control.models import ContestSettings from team.models import UserSettings from problems.models im...
gpl-3.0
openstack/manila
manila/tests/share/drivers/dell_emc/plugins/powermax/test_connection.py
1
98088
# Copyright (c) 2019 Dell Inc. or its subsidiaries. # 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 # # ...
apache-2.0
nvoron23/scikit-learn
sklearn/metrics/tests/test_classification.py
53
49781
from __future__ import division, print_function import numpy as np from scipy import linalg from functools import partial from itertools import product import warnings from sklearn import datasets from sklearn import svm from sklearn.datasets import make_multilabel_classification from sklearn.preprocessing import la...
bsd-3-clause
resmo/ansible
test/units/module_utils/hwc/test_dict_comparison.py
23
4685
# -*- coding: utf-8 -*- # 2018.07.26 --- use DictComparison instead of GcpRequest # # (c) 2016, Tom Melendez <tom@supertom.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software ...
gpl-3.0
vitmod/enigma2
lib/python/Components/Sources/RecordState.py
30
1153
from Source import Source from Components.Element import cached from enigma import iRecordableService, pNavigation import Components.RecordingConfig from Components.config import config class RecordState(Source): def __init__(self, session): Source.__init__(self) self.records_running = 0 self.session = session ...
gpl-2.0
jolevq/odoopub
addons/analytic/report/analytic_inverted_balance.py
23
5761
# -*- 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
AOSPU/external_chromium_org
tools/telemetry/telemetry/page/page_measurement.py
9
3541
# Copyright 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. from telemetry.page import page_test class MeasurementFailure(page_test.Failure): """Exception that can be thrown from MeasurePage to indicate an undesir...
bsd-3-clause
mblanchard23/brefcrawler
table_setup.py
1
1131
def table_queries(): players = """create table players(player_id varchar(255),Name varchar(255),Played_From int,Played_To int,Pos varchar(255),Ht varchar(255),Wt int,Birth_Date varchar(255),College varchar(255))""" season_stats = """create table season_stats (player_id varchar(255) ,Season varchar(255) ...
mit
photoninger/ansible
lib/ansible/module_utils/facts/hardware/freebsd.py
26
6890
# 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 in the hope that ...
gpl-3.0
boundarydevices/android_external_chromium_org
content/test/gpu/page_sets/PRESUBMIT.py
10
2903
# Copyright (c) 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. import os import re import sys def _GetTelemetryPath(input_api): return os.path.join( os.path.dirname(os.path.dirname(os.path.dirname(os.path.di...
bsd-3-clause
marc-sensenich/ansible
lib/ansible/modules/net_tools/netbox/netbox_ip_address.py
4
8748
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2018, Mikhail Yohman (@fragmentedpacket) <mikhail.yohman@gmail.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__ = type ANSIBLE_MET...
gpl-3.0
ojengwa/grr
endtoend_tests/fingerprint.py
4
1137
#!/usr/bin/env python """End to end tests for lib.flows.general.fingerprint.""" from grr.endtoend_tests import base from grr.lib import aff4 from grr.lib import rdfvalue class TestFingerprintFileOSLinux(base.AutomatedTest): """Tests if Fingerprinting works on Linux.""" platforms = ["Linux"] flow = "Fingerprin...
apache-2.0
danieljaouen/ansible
lib/ansible/utils/color.py
146
3893
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) an...
gpl-3.0
murex/murex-coding-dojo
Paris/2015/2015-03-26-Countdown-Randori-Ruby-Python/test_hiker.py
1
1077
import hiker import operator #def test_acceptance_test(): # '''Acceptance test''' # numbers = [100, 5, 5, 2, 6, 8] # target = 522 # result, calc = hiker.countdown(numbers, target) # assert result == target def test_one_plus_two(): numbers = [100, 1, 5, 2, 6, 8] target = 3 calc = hiker.countd...
mit
viniciuschiele/flask-binding
docs/conf.py
2
9244
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Flask-IO documentation build configuration file, created by # sphinx-quickstart on Mon Oct 12 20:57:12 2015. # # 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 # a...
apache-2.0
szopu/django
tests/modeladmin/tests.py
31
56330
from __future__ import unicode_literals from datetime import date import warnings from django import forms from django.contrib.admin.options import (ModelAdmin, TabularInline, HORIZONTAL, VERTICAL) from django.contrib.admin.sites import AdminSite from django.contrib.admin.widgets import AdminDateWidget, AdminRad...
bsd-3-clause
krishn9502/Angular-Express-Ecommerce
node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/mac_tool.py
1569
23354
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Utility functions to perform Xcode-style build steps. These functions are executed via gyp-mac-tool when using the Makefile generator. ""...
mit
sdague/home-assistant
homeassistant/components/gree/__init__.py
5
1850
"""The Gree Climate integration.""" import logging from homeassistant.components.climate import DOMAIN as CLIMATE_DOMAIN from homeassistant.config_entries import ConfigEntry from homeassistant.core import HomeAssistant from .bridge import CannotConnect, DeviceHelper from .const import DOMAIN _LOGGER = logging.getLog...
apache-2.0
CDTjamie/The_Boids
boids/bad_boids.py
1
5258
from matplotlib import pyplot as plt from matplotlib import animation import random import numpy as np import yaml # Deliberately terrible code for teaching purposes config = yaml.load(open("boids/config.yaml")) boid_number = config["boid_number"] x_position_limits = config["x_position_limits"] y_position_limits = c...
mit
OSGeoLabBp/tutorials
english/data_processing/lessons/code/mosaicplus.py
1
3420
#!/usr/bin/env python3 """ Cut image into mosaic rows and columns with one pixel overlap """ import sys import argparse import os import tempfile from osgeo import gdal parser = argparse.ArgumentParser() parser.add_argument('names', metavar='file_names', type=str, nargs='*', help='image files t...
cc0-1.0
noelbk/neutron-juniper
neutron/tests/unit/nicira/test_nvp_api_request_eventlet.py
5
12582
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (C) 2009-2012 Nicira Networks, 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://w...
apache-2.0
issi5862/ishida_jbd2_linux-2.0
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/SchedGui.py
12980
5411
# SchedGui.py - Python extension for perf script, basic GUI code for # traces drawing and overview. # # Copyright (C) 2010 by Frederic Weisbecker <fweisbec@gmail.com> # # This software is distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. ...
gpl-2.0
flask-admin/flask-admin
flask_admin/model/base.py
1
79665
import warnings import re import csv import mimetypes import time from math import ceil from werkzeug.utils import secure_filename from flask import (current_app, request, redirect, flash, abort, json, Response, get_flashed_messages, stream_with_context) try: import tablib except ImportError: ...
bsd-3-clause
TyberiusPrime/nikola
nikola/plugins/template/jinja.py
9
4862
# -*- coding: utf-8 -*- # Copyright © 2012-2015 Roberto Alsina and others. # 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 t...
mit
slohse/ansible
lib/ansible/module_utils/oneview.py
23
18876
# This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the author of the module, and may assign their own license # to the complete wo...
gpl-3.0
nanolearningllc/edx-platform-cypress
common/lib/xmodule/xmodule/modulestore/tests/test_mongo.py
30
36803
""" Unit tests for the Mongo modulestore """ # pylint: disable=protected-access # pylint: disable=no-name-in-module # pylint: disable=bad-continuation from nose.tools import assert_equals, assert_raises, \ assert_not_equals, assert_false, assert_true, assert_greater, assert_is_instance, assert_is_none # pylint: ena...
agpl-3.0
incuna/heroku-buildpack-python-test
test/django-1.4-skeleton/haystack/settings.py
83
5348
# Django settings for haystack project. DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@example.com'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. 'NAME': '', ...
mit
alianmohammad/pd-gem5-latest
src/dev/Device.py
47
3145
# Copyright (c) 2005-2007 The Regents of The University of Michigan # 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 ...
bsd-3-clause
y-asano/primecloud-controller
iaas-gw/src/iaasgw/common/pccConnections.py
3
10796
# coding: UTF-8 # # Copyright 2014 by SCSK Corporation. # # This file is part of PrimeCloud Controller(TM). # # PrimeCloud Controller(TM) 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...
gpl-2.0
fnouama/intellij-community
python/lib/Lib/site-packages/django/utils/simplejson/decoder.py
409
11952
"""Implementation of JSONDecoder """ import re import sys import struct from django.utils.simplejson.scanner import make_scanner c_scanstring = None __all__ = ['JSONDecoder'] FLAGS = re.VERBOSE | re.MULTILINE | re.DOTALL def _floatconstants(): _BYTES = '7FF80000000000007FF0000000000000'.decode('hex') if sys...
apache-2.0
360youlun/django-cms
cms/migrations/0015_modified_by_added.py
525
20033
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models try: from django.contrib.auth import get_user_model except ImportError: # django < 1.5 from django.contrib.auth.models import User else: User = get_user_model() user_orm_label...
bsd-3-clause
seansu4you87/kupo
sandbox/python/django/mysite/polls/views.py
1
1545
from django.core.urlresolvers import reverse from django.http import HttpResponseRedirect, HttpResponse, Http404 from django.shortcuts import get_object_or_404, render from django.views import generic from django.utils import timezone from .models import Choice, Question class IndexView(generic.ListView): templat...
mit
javacruft/percona-server-5.6
plugin/percona-pam-for-mysql/doc/source/conf.py
33
7910
# -*- coding: utf-8 -*- # # Percona PAM authentication plugin documentation build configuration file, created by # sphinx-quickstart on Mon Jun 27 22:27:15 2011. # # 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 # a...
gpl-2.0
nox/servo
python/servo/testing_commands.py
3
40013
# 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
gfneto/bitcoin-abe
Abe/Chain/PpcPosChain.py
28
1130
# Copyright(C) 2014 by Abe developers. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later version. # # This program is dist...
agpl-3.0
h3biomed/ansible
lib/ansible/modules/cloud/docker/docker_network_info.py
16
3816
#!/usr/bin/python # # Copyright 2016 Red Hat | Ansible # 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': ['prev...
gpl-3.0
ManiacTwister/dionaea
modules/python/scripts/smb/include/gssapifields.py
11
6201
#******************************************************************************** #* Dionaea #* - catches bugs - #* #* #* #* Copyright (C) 2010 Markus Koetter #* #* This program is free software; you can redistribute it and/or #* modify it under the terms of the...
gpl-2.0
mcopik/Elemental
python/core/Matrix.py
3
19735
# # Copyright (c) 2009-2015, Jack Poulson # All rights reserved. # # This file is part of Elemental and is under the BSD 2-Clause License, # which can be found in the LICENSE file in the root directory, or at # http://opensource.org/licenses/BSD-2-Clause # from environment import * import numpy as np buffer_fro...
bsd-3-clause
alexlo03/ansible
test/units/modules/network/netscaler/test_netscaler_cs_action.py
68
23035
# Copyright (c) 2017 Citrix Systems # # 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. # # ...
gpl-3.0
jesuscript/topo-mpi
contrib/ae.py
1
5458
""" Under construction: functions to measure aftereffects. """ from numpy import array from topo.command.analysis import decode_feature from topo.command.basic import pattern_present from topo.base.arrayutil import wrap from topo.misc.util import frange from topo.misc.keyedlist import KeyedList import topo from mat...
bsd-3-clause
noba3/KoTos
addons/script.video.F4mProxy/lib/androidsslPy.py
21
2193
#! /usr/bin/python from __future__ import with_statement # ignobleepub.pyw, version 3.5 # modified by shani and adapted it for android __license__ = 'GPL v3' import sys import os class IGNOBLEError(Exception): pass def _load_crypto_libcrypto(): from ctypes import CDLL, POINTER, c_void_p, c_char_p, c_int...
gpl-2.0
thomasbi1/free_gait
free_gait_python/src/free_gait/action.py
1
10431
#! /usr/bin/env python import roslib from free_gait import * import threading from actionlib_msgs.msg import GoalStatus import roslaunch import tempfile import os import traceback class ActionState: ERROR = -1 # Error state. UNINITIALIZED = 0 # Not initialized. INITIALIZED = 1 # Successfully ...
bsd-3-clause
saadbinakhlaq/django-oscar
oscar/apps/dashboard/reports/csv_utils.py
6
2420
# -*- coding: utf-8 -*- import codecs import csv import cStringIO # These classes are copied from http://docs.python.org/2/library/csv.html class CsvUnicodeWriter(object): """ A CSV writer which will write rows to CSV file "f", which is encoded in the given encoding. """ def __init__(self, f, d...
bsd-3-clause
bmbouter/Opus
opus/project/dcmux/admin.py
2
1390
############################################################################## # Copyright 2010 North Carolina State University # # # # Licensed under the Apache License, Version 2.0 (the "License"); # # ...
apache-2.0
andreaso/ansible
lib/ansible/modules/cloud/rackspace/rax_cdb_user.py
70
6430
#!/usr/bin/python -tt # 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 distrib...
gpl-3.0
scotwk/cloud-custodian
tools/c7n_salactus/c7n_salactus/inventory.py
2
4397
# Copyright 2017 Capital One Services, 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...
apache-2.0
mdj2/django
django/contrib/sessions/backends/signed_cookies.py
45
3181
try: from django.utils.six.moves import cPickle as pickle except ImportError: import pickle from django.conf import settings from django.core import signing from django.contrib.sessions.backends.base import SessionBase class PickleSerializer(object): """ Simple wrapper around pickle to be used in si...
bsd-3-clause
kelseyoo14/Wander
venv_2_7/lib/python2.7/site-packages/Django-1.9-py2.7.egg/django/contrib/admin/__init__.py
562
1243
# ACTION_CHECKBOX_NAME is unused, but should stay since its import from here # has been referenced in documentation. from django.contrib.admin.decorators import register from django.contrib.admin.filters import ( AllValuesFieldListFilter, BooleanFieldListFilter, ChoicesFieldListFilter, DateFieldListFilter, Fiel...
artistic-2.0
kastenpotential/zion.vim
python3/pyvim/core.py
1
1440
""" Core library for Zion / PyVim. """ import vim import importlib from pyvim import logger, config, events log = None class PyVimCore(object): """docstring for PyVimCor """ def __init__(self): self.conf = config.init() global log log = logger.init() self._plugins = {} ...
gpl-3.0
dudonwai/dudonsblog
Lib/site-packages/django/contrib/admin/utils.py
66
16919
from __future__ import unicode_literals import datetime import decimal from collections import defaultdict from django.contrib.auth import get_permission_codename from django.core.exceptions import FieldDoesNotExist from django.core.urlresolvers import NoReverseMatch, reverse from django.db import models from django....
mit
Nirvedh/CoarseCoherence
src/arch/sparc/SparcInterrupts.py
69
1754
# Copyright (c) 2008 The Regents of The University of Michigan # 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
leppa/home-assistant
homeassistant/components/supla/cover.py
6
1553
"""Support for Supla cover - curtains, rollershutters etc.""" import logging from pprint import pformat from homeassistant.components.cover import ATTR_POSITION, CoverDevice from homeassistant.components.supla import SuplaChannel _LOGGER = logging.getLogger(__name__) def setup_platform(hass, config, add_entities, d...
apache-2.0
BiaDarkia/scikit-learn
sklearn/decomposition/nmf.py
3
45741
""" Non-negative matrix factorization """ # Author: Vlad Niculae # Lars Buitinck # Mathieu Blondel <mathieu@mblondel.org> # Tom Dupre la Tour # License: BSD 3 clause from __future__ import division, print_function from math import sqrt import warnings import numbers import time import numpy ...
bsd-3-clause
labcodes/django
tests/forms_tests/models.py
52
3546
import datetime import itertools import tempfile from django.core.files.storage import FileSystemStorage from django.db import models callable_default_counter = itertools.count() def callable_default(): return next(callable_default_counter) temp_storage = FileSystemStorage(location=tempfile.mkdtemp()) class...
bsd-3-clause
Mj258/weiboapi
srapyDemo/envs/Lib/site-packages/win32comext/shell/test/testShellItem.py
20
2921
# Test IShellItem and related interfaces from win32com.shell import shell, shellcon, knownfolders import unittest class TestShellItem(unittest.TestCase): def assertShellItemsEqual(self, i1, i2): n1 = i1.GetDisplayName(shellcon.SHGDN_FORPARSING) n2 = i2.GetDisplayName(shellcon.SHGDN_FORPARSING) ...
mit
Jovy23/N920TUVU2COJ5_Kernel
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/SchedGui.py
12980
5411
# SchedGui.py - Python extension for perf script, basic GUI code for # traces drawing and overview. # # Copyright (C) 2010 by Frederic Weisbecker <fweisbec@gmail.com> # # This software is distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. ...
gpl-2.0
Edraak/circleci-edx-platform
lms/djangoapps/edraak_university/forms.py
1
2380
import re from django import forms from django.utils.translation import ugettext_lazy as _ from openedx.core.djangoapps.user_api.accounts import NAME_MIN_LENGTH from models import UniversityID class UniversityIDForm(forms.ModelForm): full_name = forms.CharField( label=_('Full Name *'), help_tex...
agpl-3.0
DirtyUnicorns/android_external_chromium_org
third_party/cython/src/Cython/Tests/TestStringIOTree.py
113
1940
import unittest from Cython import StringIOTree as stringtree code = """ cdef int spam # line 1 cdef ham(): a = 1 b = 2 c = 3 d = 4 def eggs(): pass cpdef bacon(): print spam print 'scotch' print 'tea?' print 'or coffee?' # line 16 """ linemap = dict(...
bsd-3-clause
teto/ns-3-dev-git
src/visualizer/visualizer/plugins/show_last_packets.py
7
10866
from gi.repository import GObject from gi.repository import Gtk import ns.core import ns.network import ns.visualizer from visualizer.base import InformationWindow from kiwi.ui.objectlist import ObjectList, Column ## ShowLastPackets class class ShowLastPackets(InformationWindow): ## @var win # window ##...
gpl-2.0