repo_name
stringlengths
6
100
path
stringlengths
4
294
copies
stringlengths
1
5
size
stringlengths
4
6
content
stringlengths
606
896k
license
stringclasses
15 values
akiss77/servo
tests/wpt/css-tests/tools/pywebsocket/src/test/testdata/handlers/blank_wsh.py
499
1557
# Copyright 2009, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
mpl-2.0
ewindisch/nova
nova/scheduler/filters/availability_zone_filter.py
20
1882
# Copyright (c) 2011-2012 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 # # Un...
apache-2.0
chudaol/edx-platform
common/djangoapps/student/auth.py
111
5910
""" The application interface to roles which checks whether any user trying to change authorization has authorization to do so, which infers authorization via role hierarchy (GlobalStaff is superset of auths of course instructor, ...), which consults the config to decide whether to check course creator role, and other ...
agpl-3.0
valexandersaulys/airbnb_kaggle_contest
venv/lib/python3.4/site-packages/numpy/distutils/fcompiler/hpux.py
229
1464
from __future__ import division, absolute_import, print_function from numpy.distutils.fcompiler import FCompiler compilers = ['HPUXFCompiler'] class HPUXFCompiler(FCompiler): compiler_type = 'hpux' description = 'HP Fortran 90 Compiler' version_pattern = r'HP F90 (?P<version>[^\s*,]*)' executables...
gpl-2.0
Skydes/Monitoring
src/capture.py
1
4332
#!/usr/bin/env python ''' Copyright (c) 2016, Paul-Edouard Sarlin All rights reserved. Project: Autonomous Monitoring System File: capture.py Date: 2016-08-08 Author: Paul-Edouard Sarlin Website: https://github.com/skydes/monitoring ''' from multiprocessing imp...
bsd-3-clause
mpercich/Calendarize
ios/dateparser/lib/python2.7/site-packages/convertdate/julianday.py
1
1740
#!/usr/bin/env python # -*- coding: utf-8 -*- # This file is part of convertdate. # http://github.com/fitnr/convertdate # Licensed under the GPL-v3.0 license: # http://opensource.org/licenses/MIT # Copyright (c) 2016, fitnr <fitnr@fakeisthenewreal> from datetime import datetime from . import gregorian from . import ...
mit
blois/AndroidSDKCloneMin
ndk/prebuilt/linux-x86_64/lib/python2.7/idlelib/Debugger.py
89
15818
import os import bdb import types from Tkinter import * from idlelib.WindowList import ListedToplevel from idlelib.ScrolledList import ScrolledList from idlelib import macosxSupport class Idb(bdb.Bdb): def __init__(self, gui): self.gui = gui bdb.Bdb.__init__(self) def user_line(self, frame):...
apache-2.0
oscaro/django
django/contrib/auth/admin.py
52
8051
from django.db import transaction from django.conf import settings from django.contrib import admin from django.contrib.admin.options import IS_POPUP_VAR from django.contrib.auth import update_session_auth_hash from django.contrib.auth.forms import (UserCreationForm, UserChangeForm, AdminPasswordChangeForm) from dj...
bsd-3-clause
ckan/datapusher
datapusher/main.py
1
1147
import os import six import ckanserviceprovider.web as web from datapusher import jobs # check whether jobs have been imported properly assert(jobs.push_to_datastore) def serve(): web.init() web.app.run(web.app.config.get('HOST'), web.app.config.get('PORT')) def serve_test(): web.init() return web...
agpl-3.0
mahak/packstack
packstack/plugins/keystone_100.py
2
26987
# -*- 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
scalingdata/Impala
thirdparty/thrift-0.9.0/lib/py/src/Thrift.py
42
4072
# # 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
django-nonrel/django
tests/i18n/contenttypes/tests.py
55
1164
# coding: utf-8 from __future__ import unicode_literals import os from django.contrib.contenttypes.models import ContentType from django.test import TestCase from django.test.utils import override_settings, TransRealMixin from django.utils._os import upath from django.utils import six from django.utils import transla...
bsd-3-clause
daenamkim/ansible
lib/ansible/plugins/lookup/file.py
27
2361
# (c) 2012, Daniel Hokka Zakrisson <daniel@hozac.com> # (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 = """ lookup: file author: Daniel H...
gpl-3.0
koyuawsmbrtn/eclock
windows/Python27/Lib/site-packages/pip/_vendor/requests/packages/chardet/mbcharsetprober.py
2924
3268
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
gpl-2.0
zacharyvoase/zrpc
tests/server_test.py
1
4208
from __future__ import with_statement from contextlib import contextmanager from Queue import Queue import threading from bson import BSON from nose.tools import assert_equal import zmq from zrpc.concurrency import Callback from zrpc.server import Server from zrpc.registry import Registry REGISTRY = Registry() c...
unlicense
biblepay/biblepay
test/functional/node_network_limited.py
1
5097
#!/usr/bin/env python3 # Copyright (c) 2017 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Tests NODE_NETWORK_LIMITED. Tests that a node configured with -prune=550 signals NODE_NETWORK_LIMITED corre...
mit
ajfriend/cvxpy
cvxpy/interface/cvxopt_interface/dense_matrix_interface.py
3
2704
""" Copyright 2013 Steven Diamond This file is part of CVXPY. CVXPY 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. CVXPY is distributed i...
gpl-3.0
ChristianAA/python_koans_solutions
python2/contemplate_koans.py
86
1295
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Acknowledgment: # # Python Koans is a port of Ruby Koans originally written by Jim Weirich # and Joe O'brien of Edgecase. There are some differences and tweaks specific # to the Python language, but a great deal of it has been copied wholesale. # So thank guys! # impo...
mit
dr-nate/msmbuilder
msmbuilder/example_datasets/alanine_dipeptide.py
9
2015
# Author: Robert McGibbon <rmcgibbo@gmail.com> # Contributors: Matthew Harrigan <matthew.harrigan@outlook.com> # Copyright (c) 2016, Stanford University and the Authors # All rights reserved. # ----------------------------------------------------------------------------- # Imports # -----------------------------------...
lgpl-2.1
ryfeus/lambda-packs
Keras_tensorflow_nightly/source2.7/tensorflow/contrib/linear_optimizer/__init__.py
158
1308
# Copyright 2016 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...
mit
oostende/dvbapp2-gui-egami
lib/python/Components/Renderer/Listbox.py
118
3071
from Renderer import Renderer from enigma import eListbox # the listbox renderer is the listbox, but no listbox content. # the content will be provided by the source (or converter). # the source should emit the 'changed' signal whenever # it has a new listbox content. # the source needs to have the 'content' propert...
gpl-2.0
joariasl/odoo
openerp/addons/base/tests/test_ir_filters.py
285
11000
# -*- coding: utf-8 -*- import functools from openerp import exceptions from openerp.tests import common def noid(d): """ Removes values that are not relevant for the test comparisons """ d.pop('id', None) d.pop('action_id', None) return d class FiltersCase(common.TransactionCase): def build(self...
agpl-3.0
KarlTDebiec/Ramaplot
PDistDataset.py
1
20943
# -*- coding: utf-8 -*- # ramaplot.PDistDataset.py # # Copyright (C) 2015 Karl T Debiec # All rights reserved. # # This software may be modified and distributed under the terms of the # BSD license. See the LICENSE file for details. """ Manages probability distribution datasets. """ ##########################...
bsd-3-clause
amrdraz/kodr
app/brython/www/src/Lib/test/test_userdict.py
91
6469
# Check every path through every method of UserDict from test import support, mapping_tests import collections d0 = {} d1 = {"one": 1} d2 = {"one": 1, "two": 2} d3 = {"one": 1, "two": 3, "three": 5} d4 = {"one": None, "two": None} d5 = {"one": 1, "two": 1} class UserDictTest(mapping_tests.TestHashMappingProtocol): ...
mit
stacywsmith/ansible
lib/ansible/modules/network/aos/aos_blueprint.py
78
9017
#!/usr/bin/python # # (c) 2017 Apstra Inc, <community@apstra.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 opt...
gpl-3.0
kfrerichs/roleplay
node_modules/node-gyp/gyp/pylib/gyp/ordered_dict.py
2354
10366
# Unmodified from http://code.activestate.com/recipes/576693/ # other than to add MIT license header (as specified on page, but not in code). # Linked from Python documentation here: # http://docs.python.org/2/library/collections.html#collections.OrderedDict # # This should be deleted once Py2.7 is available on all bot...
gpl-3.0
dbentley/pants
tests/python/pants_test/backend/jvm/tasks/test_scalastyle.py
4
10105
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import logging from ...
apache-2.0
garverp/gnuradio
gr-digital/python/digital/ofdm_sync_ml.py
58
7663
#!/usr/bin/env python # # Copyright 2007,2008 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your opt...
gpl-3.0
blueboxgroup/nova
nova/tests/unit/api/openstack/compute/test_api.py
11
5836
# Copyright 2010 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
arpitjain9819/FIRE-AND-FLAMES
scripts/rt-tester/rt-tester.py
11005
5307
#!/usr/bin/python # # rt-mutex tester # # (C) 2006 Thomas Gleixner <tglx@linutronix.de> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # import os import sys import getopt import sh...
gpl-2.0
eptmp3/Sick-Beard
sickbeard/clients/transmission.py
30
4145
# Author: Mr_Orange <mr_orange@hotmail.it> # URL: http://code.google.com/p/sickbeard/ # # This file is part of Sick Beard. # # Sick Beard 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...
gpl-3.0
Aptitudetech/ERPNext
erpnext/setup/doctype/item_group/item_group.py
15
5518
# 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 import urllib from frappe.utils import nowdate, cint, cstr from frappe.utils.nestedset import NestedSet from frappe.website.website_genera...
cc0-1.0
ycsoft/FatCat-Server
LIBS/boost_1_58_0/tools/build/src/tools/make.py
9
2084
# Status: ported. # Base revision: 64068 # Copyright 2003 Dave Abrahams # Copyright 2003 Douglas Gregor # Copyright 2006 Rene Rivera # Copyright 2002, 2003, 2004, 2005, 2006 Vladimir Prus # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or http://www.bo...
mit
mattcieslak/DSI2
dsi2/ui/volume_slicer.py
1
10860
#!/usr/bin/env python import numpy as np import nibabel as nib # Traits stuff from traits.api import ( HasTraits, Instance, Array, Bool, Dict, on_trait_change, Range, Color, Any, Int, DelegatesTo, CInt, Property, File ) from traitsui.api import View, Item, VGroup, \ HGroup, Group, RangeEditor, ColorEdito...
gpl-3.0
MalloyPower/parsing-python
front-end/testsuite-python-lib/Python-3.5.0/Lib/test/test_sunau.py
92
4663
from test.support import TESTFN import unittest from test import audiotests from audioop import byteswap import sys import sunau class SunauTest(audiotests.AudioWriteTests, audiotests.AudioTestsWithSourceFile): module = sunau class SunauPCM8Test(SunauTest, unittest.TestCase): sndfilename = '...
mit
achak1987/greenroute
src/google.py
1
8516
''' @author: Antorweep Chakravorty ''' import googlemaps import rapidjson as json import pickle import pprint from datetime import datetime from vertex import vertex from edge import edge class GoogleMapsAPI(object): def __init__(self, username, password, app_id, app_token): self.username = username ...
mit
ihsanudin/odoo
addons/edi/edi_service.py
377
2517
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2011 OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GN...
agpl-3.0
Southpaw-TACTIC/TACTIC
src/context/client/tactic-api-python-4.0.api04/Lib/encodings/mbcs.py
103
1258
""" Python 'mbcs' Codec for Windows Cloned by Mark Hammond (mhammond@skippinet.com.au) from ascii.py, which was written by Marc-Andre Lemburg (mal@lemburg.com). (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. """ # Import them explicitly to cause an ImportError # on non-Windows systems from codecs ...
epl-1.0
ezequielpereira/Time-Line
libs64/wx/lib/agw/fourwaysplitter.py
4
33687
# --------------------------------------------------------------------------------- # # FOURWAYSPLITTER wxPython IMPLEMENTATION # # Andrea Gavana, @ 03 Nov 2006 # Latest Revision: 14 Apr 2010, 12.00 GMT # # # TODO List # # 1. Any idea? # # For All Kind Of Problems, Requests Of Enhancements And Bug Reports, Please # Wri...
gpl-3.0
rnirmal/cinder
cinder/tests/api/openstack/test_wsgi.py
4
29524
# vim: tabstop=4 shiftwidth=4 softtabstop=4 import inspect import webob from cinder import exception from cinder import test from cinder.api.openstack import wsgi from cinder.tests.api.openstack import fakes class RequestTest(test.TestCase): def test_content_type_missing(self): request = wsgi.Request.bl...
apache-2.0
davidzchen/tensorflow
tensorflow/python/framework/ops.py
2
254309
# 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
lloydbadger/test
lib/httpd/extension.py
16
1590
# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use ...
apache-2.0
JCBarahona/edX
common/djangoapps/edxmako/shortcuts.py
67
5272
# Copyright (c) 2008 Mikeal Rogers # # 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...
agpl-3.0
liszd/whyliam.workflows.youdao
urllib3/packages/rfc3986/_mixin.py
1
13255
"""Module containing the implementation of the URIMixin class.""" import warnings from . import exceptions as exc from . import misc from . import normalizers from . import validators class URIMixin(object): """Mixin with all shared methods for URIs and IRIs.""" __hash__ = tuple.__hash__ def authority_...
mit
tarak/django-change-email
change_email/models.py
1
7639
from datetime import timedelta from django.contrib.sites.models import RequestSite from django.contrib.sites.models import Site from django.core.mail import EmailMultiAlternatives from django.core.mail import send_mail from django.core.urlresolvers import reverse from django.db import models from django.template.loade...
bsd-3-clause
stclair/wes-cms
django/contrib/localflavor/uy/forms.py
310
2083
# -*- coding: utf-8 -*- """ UY-specific form helpers. """ import re from django.core.validators import EMPTY_VALUES from django.forms.fields import Select, RegexField from django.forms import ValidationError from django.utils.translation import ugettext_lazy as _ from django.contrib.localflavor.uy.util import get_vali...
bsd-3-clause
qgis/QGIS-Django
qgis-app/styles/migrations/0008_auto_20201215_2124.py
1
2000
# Generated by Django 2.2.13 on 2020-12-15 21:24 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('styles', '0007_auto_20201109_0112'), ] operations = [ migrations.AlterFie...
gpl-2.0
alexhayes/django-geopostcodes
django_geopostcodes/helpers.py
1
1155
# -*- coding: utf-8 -*- """ django_geopostcodes.helpers ~~~~~~~~~~~~~~~~~~~~~~~~~~~ Helper functions for django-geopostcodes. """ from __future__ import absolute_import, print_function, unicode_literals import csv from django.contrib.gis.geos import Point from django.db.transaction import atomic from .m...
mit
DanielCoutoVale/openccg
ccgbank/bin/get_factors_from_parse.py
4
2137
#!/usr/bin/env python """ (c) 2008 Dennis N. Mehay Use this file any way you want, just please give the author credit if it makes it into any research in any meaningful way. I make no claims whatsoever about the fitness or merchantability of this code. Use at your own risk. Take a file of CCGbank-style parses and ...
lgpl-2.1
nnewsom/webbies
lib/NotFoundHandler.py
2
3193
from .Probe import Probe from urllib.parse import urlparse from difflib import SequenceMatcher from hashlib import md5 from .Common import * import re,asyncio class NotFoundHandler: def __init__(self,max_word=20,threshold=0.9): self.threshold= threshold self.history = set() self.bhash_histo...
mit
DucQuang1/youtube-dl
youtube_dl/extractor/kaltura.py
63
4867
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import compat_urllib_parse from ..utils import ( ExtractorError, int_or_none, ) class KalturaIE(InfoExtractor): _VALID_URL = r'''(?x) (?:kaltura:| https?://(:?(?:www|cdnapisec)\.)...
unlicense
sujitbehera27/MyRoboticsProjects-Arduino
src/resource/Python/examples/InMoov.py
2
9184
# a larger script for InMoov inMoov = Runtime.createAndStart("inMoov", "InMoov") # attach an arduino to InMoov # possible board types include uno atmega168 atmega328p atmega2560 atmega1280 atmega32u4 # the MRLComm.ino sketch must be loaded into the Arduino for MyRobotLab control ! # set COM number according to t...
apache-2.0
Vimos/scikit-learn
sklearn/ensemble/bagging.py
23
38399
"""Bagging meta-estimator.""" # Author: Gilles Louppe <g.louppe@gmail.com> # License: BSD 3 clause from __future__ import division import itertools import numbers import numpy as np from warnings import warn from abc import ABCMeta, abstractmethod from ..base import ClassifierMixin, RegressorMixin from ..externals....
bsd-3-clause
szilveszter/django
tests/migrations/test_loader.py
15
7274
from unittest import skipIf from django.test import TestCase, override_settings from django.db import connection, connections from django.db.migrations.loader import MigrationLoader, AmbiguityError from django.db.migrations.recorder import MigrationRecorder from django.test import modify_settings from django.utils imp...
bsd-3-clause
netcon-source/OpenClimateGIS
src/openclimategis/util/ncconv/converters.py
7
6327
import geojson from util.helpers import get_temp_path from util.toshp import OpenClimateShp #from pykml.factory import KML_ElementMaker as KML from osgeo import osr, ogr import io import csv import os def get_sr(srid): sr = osr.SpatialReference() sr.ImportFromEPSG(srid) return(sr) def as_geojson(elements)...
bsd-3-clause
Jionglun/-w16b_test
static/Brython3.1.3-20150514-095342/Lib/browser/indexed_db.py
632
3008
class EventListener: def __init__(self, events=[]): self._events=events def append(self, event): self._events.append(event) def fire(self, e): for _event in self._events: _event(e) class IndexedDB: def __init__(self): if not __BRYTHON__.has_indexedDB: raise NotImple...
agpl-3.0
spacewalkproject/spacewalk
scripts/ncsu-rhntools/subscribeRHN.py
8
3275
#!/usr/bin/python # subscribeRHN.py - Clean up after RHN blows chucks # Copyright (C) 2007 NC State University # Written by Jack Neely <jjneely@ncsu.edu> # # 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 F...
gpl-2.0
2015fallproject/2015fallcase2
static/Brython3.2.0-20150701-214155/Lib/pydoc_data/topics.py
694
385454
# -*- coding: utf-8 -*- # Autogenerated by Sphinx on Sat Mar 23 15:42:31 2013 topics = {'assert': '\nThe ``assert`` statement\n************************\n\nAssert statements are a convenient way to insert debugging assertions\ninto a program:\n\n assert_stmt ::= "assert" expression ["," expression]\n\nThe simple form,...
agpl-3.0
bthirion/nipy
nipy/algorithms/statistics/tests/test_utils.py
2
1419
#!/usr/bin/env python import numpy as np from scipy.stats import norm from ..utils import multiple_mahalanobis, z_score, multiple_fast_inv from nose.tools import assert_true from numpy.testing import assert_almost_equal, assert_array_almost_equal def test_z_score(): p = np.random.rand(10) z = z_score(p) ...
bsd-3-clause
rtfd/readthedocs.org
readthedocs/embed/views.py
1
13361
"""Views for the embed app.""" import functools import json import logging import re from urllib.parse import urlparse from django.shortcuts import get_object_or_404 from django.template.defaultfilters import slugify from django.utils.functional import cached_property from docutils.nodes import make_id from pyquery i...
mit
srivassumit/servo
components/script/dom/bindings/codegen/parser/tests/test_special_method_signature_mismatch.py
241
6622
def WebIDLTest(parser, harness): threw = False try: parser.parse(""" interface SpecialMethodSignatureMismatch1 { getter long long foo(long index); }; """) results = parser.finish() except: threw = True harness.ok(threw, "Should have...
mpl-2.0
ylatuya/Flumotion
common/pep8.py
9
29802
#!/usr/bin/python # pep8.py - Check Python source code formatting, according to PEP 8 # Copyright (C) 2006 Johann C. Rocholl <johann@browsershots.org> # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation files # (the "Software"), to deal in the...
gpl-2.0
Bashar/django
tests/foreign_object/tests.py
39
18028
import datetime from operator import attrgetter from .models import ( Country, Person, Group, Membership, Friendship, Article, ArticleTranslation, ArticleTag, ArticleIdea, NewsArticle) from django.test import TestCase, skipUnlessDBFeature from django.utils.translation import activate from django.core.exception...
bsd-3-clause
cybercercher/crits
crits/services/views.py
13
9774
import json import logging from django.conf import settings from django.contrib.auth.decorators import user_passes_test from django.core.urlresolvers import reverse from django.http import HttpResponse, HttpResponseRedirect from django.shortcuts import render_to_response from django.template import RequestContext from...
mit
leoliujie/odoo
addons/mrp/wizard/mrp_price.py
381
2132
# -*- 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
ppwwyyxx/tensorflow
tensorflow/python/ops/ragged/ragged_map_ops.py
7
17956
# Copyright 2018 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
jonathonwalz/ansible
lib/ansible/modules/windows/win_group.py
22
1941
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2014, Chris Hoffman <choffman@chathamfinancial.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 ...
gpl-3.0
AntonGitName/au-linux-kernel-spring-2016
linux/tools/perf/scripts/python/syscall-counts-by-pid.py
1996
2105
# system call counts, by pid # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide system call totals, broken down by syscall. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os, sys sys.path.append(os.env...
gpl-2.0
ehirt/odoo
openerp/addons/base/module/report/ir_module_reference_print.py
384
3704
# -*- 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
rhattersley/iris
lib/iris/tests/unit/fileformats/structured_array_identification/test_GroupStructure.py
17
8779
# (C) British Crown Copyright 2014 - 2015, Met Office # # This file is part of Iris. # # Iris 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 # (at your option) any l...
lgpl-3.0
powellc/hacklabs-wiki
hacklabs-wiki/apps/wiki/models/__init__.py
2
3237
# -*- coding: utf-8 -*- from django import VERSION from django.conf import settings as django_settings from django.core.exceptions import ImproperlyConfigured import warnings from six import string_types # TODO: Don't use wildcards from .article import * from .urlpath import * # TODO: Should the below stuff be execu...
bsd-3-clause
openjck/kuma
kuma/demos/tests/test_views.py
12
15980
# -*- coding: utf-8 -*- import datetime from os.path import dirname from StringIO import StringIO import zipfile from nose.tools import eq_, ok_ from nose.plugins.attrib import attr from pyquery import PyQuery as pq from constance import config from kuma.core.urlresolvers import reverse from kuma.core.utils import p...
mpl-2.0
alivecor/tensorflow
tensorflow/contrib/integrate/python/ops/odes_test.py
57
10354
# Copyright 2016 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
clickbeetle/portage-cb
pym/portage/dbapi/bintree.py
1
44915
# Copyright 1998-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 __all__ = ["bindbapi", "binarytree"] import portage portage.proxy.lazyimport.lazyimport(globals(), 'portage.checksum:hashfunc_map,perform_multiple_checksums,' + \ 'verify_all,_apply_hash_filter,_hash_filter',...
gpl-2.0
EchO-KID/google-breakpad
src/tools/gyp/pylib/gyp/generator/gypd.py
912
3325
# Copyright (c) 2011 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. """gypd output module This module produces gyp input as its output. Output files are given the .gypd extension to avoid overwriting the .gyp files that they are ...
bsd-3-clause
nexiles/odoo
addons/analytic_contract_hr_expense/analytic_contract_hr_expense.py
109
7858
# -*- 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
JohnDenker/brython
www/src/Lib/pprint.py
634
12757
# Author: Fred L. Drake, Jr. # fdrake@acm.org # # This is a simple little module I wrote to make life easier. I didn't # see anything quite like it in the library, though I may have overlooked # something. I wrote this when I was trying to read some heavily nested # tuples with fairly non-desc...
bsd-3-clause
vedujoshi/os_tempest
tools/subunit-trace.py
2
9777
#!/usr/bin/env python # Copyright 2014 Hewlett-Packard Development Company, L.P. # Copyright 2014 Samsung Electronics # 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 #...
apache-2.0
CubicERP/odoo
addons/account/wizard/account_report_general_journal.py
378
1697
# -*- 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
SlimRemix/android_external_chromium_org
build/linux/install-chromeos-fonts.py
111
2373
#!/usr/bin/env python # 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. # Script to install the Chrome OS fonts on Linux. # This script can be run manually (as root), but is also run as part # install-build-...
bsd-3-clause
bikong2/scikit-learn
sklearn/decomposition/tests/test_sparse_pca.py
160
6028
# Author: Vlad Niculae # License: BSD 3 clause import sys import numpy as np from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import SkipTest from sklearn.utils.testing import ass...
bsd-3-clause
hhj0325/pystock
com/hhj/sogou/countByTime.py
1
1082
""" 选取发布时间为2018年的文章,并对其进行月份统计 """ import numpy as np import pandas as pd from pyecharts import Bar df = pd.read_csv('sg_articles.csv', header=None, names=["title", "article", "name", "date"]) list1 = [] list2 = [] for j in df['date']: # 获取文章发布年份及月份 time_1 = j.split('-')[0] time_2 = j.split('-')[1] lis...
apache-2.0
harnesscloud/xtreemfs
cpp/thirdparty/protobuf-2.5.0/python/google/protobuf/internal/text_format_test.py
48
24654
#! /usr/bin/python # # Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # http://code.google.com/p/protobuf/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # ...
bsd-3-clause
rchicoli/samba
buildtools/wafsamba/samba_autoconf.py
4
25021
# a waf tool to add autoconf-like macros to the configure section import Build, os, sys, Options, preproc, Logs import string from Configure import conf from samba_utils import * import samba_cross missing_headers = set() #################################################### # some autoconf like helpers, to make the ...
gpl-3.0
simonjbeaumont/planex
tests/test_planex_spec.py
1
6322
# Run these tests with 'nosetests': # install the 'python-nose' package (Fedora/CentOS or Ubuntu) # run 'nosetests' in the root of the repository import unittest import platform import planex.spec def get_rpm_machine(): if platform.machine() == 'x86_64': return 'x86_64' return 'i386' def get_de...
lgpl-2.1
szarvas/anc-field
examples/ie224-impulse.py
1
5152
# -*- coding: utf-8 -*- from __future__ import division import numpy as np import matplotlib.pyplot as plt from scipy import signal, stats import sys sys.path.append('..') from anc_field_py.ancfield import * from anc_field_py.ancutil import * def add_microphones(ancObject): # error_mic ancObject.AddMic([4,1...
gpl-3.0
tukutela/Kay-Framework
kay/views/i18n.py
10
4888
import os from werkzeug import Response from werkzeug.utils import import_string import kay from kay.conf import settings from kay.utils.text import javascript_quote import gettext as gettext_module NullSource = """ /* gettext identity library */ function gettext(msgid) { return msgid; } function ngettext(singular,...
bsd-3-clause
vbannai/neutron
neutron/tests/unit/hyperv/test_hyperv_rpcapi.py
3
4541
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2013 Cloudbase Solutions SRL # Copyright 2013 Pedro Navarro Perez # 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...
apache-2.0
ppanczyk/ansible
lib/ansible/modules/network/avi/avi_tenant.py
27
3806
#!/usr/bin/python # # Created on Aug 25, 2016 # @author: Gaurav Rastogi (grastogi@avinetworks.com) # Eric Anderson (eanderson@avinetworks.com) # module_check: supported # Avi Version: 17.1.1 # # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the te...
gpl-3.0
ojengwa/talk
venv/lib/python2.7/site-packages/rest_framework/utils/representation.py
21
2976
""" Helper functions for creating user-friendly representations of serializer classes and serializer fields. """ from __future__ import unicode_literals from django.db import models from django.utils.encoding import force_text from django.utils.functional import Promise from rest_framework.compat import unicode_repr im...
mit
fmeynadier/allantools
tests/functional_tests/test_remove_small_ns.py
2
1226
import pytest import allantools.allantools as at import numpy as np minimum_ns = 1 taus = np.arange(1, 499) devs = np.random.rand(len(taus)) deverrs_l = np.random.rand(len(taus)) deverrs_h = np.random.rand(len(taus)) ns = np.zeros(len(taus)) ns[0] = len(ns) last_i = 0 for i in range(1, len(ns)): ns[i] = max(ns[i-...
lgpl-3.0
Changaco/oh-mainline
vendor/packages/twisted/doc/core/examples/shaper.py
26
1604
# -*- Python -*- """Example of rate-limiting your web server. Caveat emptor: While the transfer rates imposed by this mechanism will look accurate with wget's rate-meter, don't forget to examine your network interface's traffic statistics as well. The current implementation tends to create lots of small packets in s...
agpl-3.0
minersoft/httpd_logs
apache_log.py
1
13255
# # Copyright Michael Groys, 2014 # from ncsa_log import NCSALogFormat, NCSALogRecord, FieldNotDefinedException from m.utilities import mergeDictionaries import re class ApacheLogFormat(NCSALogFormat): idpattern = r"\>?[a-zA-Z]|\{[-\w]+\}[ieoC]" # continue field numbering after NCSA basic fields START_...
bsd-3-clause
normtown/SickRage
lib/sqlalchemy/event/api.py
75
3844
# event/api.py # Copyright (C) 2005-2014 the SQLAlchemy authors and contributors <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """Public API functions for the event system. """ from __future__ import absolute_import...
gpl-3.0
saisaizhang/Food
flask/lib/python2.7/site-packages/setuptools/compat.py
456
2094
import sys import itertools PY3 = sys.version_info >= (3,) PY2 = not PY3 if PY2: basestring = basestring import __builtin__ as builtins import ConfigParser from StringIO import StringIO BytesIO = StringIO func_code = lambda o: o.func_code func_globals = lambda o: o.func_globals im_func...
bsd-3-clause
globalpolicy/pyWall
main.py
1
6745
# Author : globalpolicy # Date : March 2-4, 2017 # Script : pyWall # Description : Change windows wallpaper # Python : 3.5 # Blog : c0dew0rth.blogspot.com import requests from bs4 import BeautifulSoup import random import shutil # for copying raw image data(a file-like object) to an actual image file i...
mit
pratikmallya/hue
desktop/core/ext-py/tablib-0.10.0/tablib/packages/odf3/chart.py
56
2636
# -*- coding: utf-8 -*- # Copyright (C) 2006-2007 Søren Roug, European Environment Agency # # 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 # version 2.1 of the License, or (at you...
apache-2.0
blois/AndroidSDKCloneMin
ndk/prebuilt/linux-x86_64/lib/python2.7/encodings/utf_8_sig.py
412
3685
""" Python 'utf-8-sig' Codec This work similar to UTF-8 with the following changes: * On encoding/writing a UTF-8 encoded BOM will be prepended/written as the first three bytes. * On decoding/reading if the first three bytes are a UTF-8 encoded BOM, these bytes will be skipped. """ import codecs ### Codec APIs ...
apache-2.0
havt/odoo
addons/hr_gamification/models/gamification.py
388
4836
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013 OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms of the ...
agpl-3.0
boyuegame/kbengine
kbe/res/scripts/common/Lib/asyncio/coroutines.py
63
6139
__all__ = ['coroutine', 'iscoroutinefunction', 'iscoroutine'] import functools import inspect import opcode import os import sys import traceback import types from . import events from . import futures from .log import logger # Opcode of "yield from" instruction _YIELD_FROM = opcode.opmap['YIELD_FROM'] ...
lgpl-3.0