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
slz/delidded-kernel-n900t-note3
tools/perf/scripts/python/sched-migration.py
11215
11670
#!/usr/bin/python # # Cpu task migration overview toy # # Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com> # # perf script event handlers have been generated by perf script -g python # # This software is distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Fre...
gpl-2.0
gangadhar-kadam/prjapp
hr/doctype/leave_control_panel/leave_control_panel.py
30
2230
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import webnotes from webnotes.utils import cint, cstr, flt, nowdate from webnotes.model.doc import Document from webnotes.model.code import get_obj ...
agpl-3.0
tchakravarty/PyMurphy
Archive/pmtk3-master/python/utils.py
7
4579
#!/usr/bin/env python import os import scipy.io as sio import numpy as np import glob PYTHON_DIR = os.path.dirname(os.path.realpath(__file__)) DATA_DIR = os.path.join(os.path.dirname(PYTHON_DIR), 'pmtkdataCopy') def add_ones(X): """Add a column of ones to X""" n = len(X) return np.column_stack((np.ones(...
mit
Teamxrtc/webrtc-streaming-node
third_party/depot_tools/external_bin/gsutil/gsutil_4.15/gsutil/third_party/httplib2/python3/httplib2/__init__.py
29
56301
""" httplib2 A caching http interface that supports ETags and gzip to conserve bandwidth. Requires Python 3.0 or later Changelog: 2009-05-28, Pilgrim: ported to Python 3 2007-08-18, Rick: Modified so it's able to use a socks proxy if needed. """ __author__ = "Joe Gregorio (joe@bitworking.org)" __copyright__ = "Co...
mit
MostafaGazar/tensorflow
tensorflow/python/kernel_tests/matrix_inverse_op_test.py
15
3457
# 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
flewrain/flewrain-dolphin
Externals/scons-local/scons-local-2.0.1/SCons/Tool/qt.py
61
13252
"""SCons.Tool.qt Tool-specific initialization for Qt. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation # # Pe...
gpl-2.0
dga4654dan/UTM-Demo
V_1_0_1/UtmDemo_Sfs_2.9.0/UtmDemo_Sfs_2.9.0_Server/lib/Lib/encodings/mac_greek.py
9
6699
""" Python Character Mapping Codec generated from 'GREEK.TXT' with gencodec.py. Written by Marc-Andre Lemburg (mal@lemburg.com). (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. (c) Copyright 2000 Guido van Rossum. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,error...
gpl-2.0
hdinsight/hue
desktop/core/ext-py/tablib-0.10.0/tablib/packages/odf/script.py
100
1104
# -*- 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
hpproliant/ironic
ironic/common/keystone.py
4
5539
# 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 # di...
apache-2.0
ccn-2m/django
tests/regressiontests/modeladmin/models.py
60
1514
# coding: utf-8 from django.contrib.auth.models import User from django.db import models from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class Band(models.Model): name = models.CharField(max_length=100) bio = models.TextField() sign_date = models.DateField() ...
bsd-3-clause
azaghal/ansible
lib/ansible/plugins/lookup/vars.py
9
3230
# (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: vars author: Ansible Core version_added: "2.5" short_description: L...
gpl-3.0
makinux/PyCsmap
CSMapMake.py
1
2664
# -*- coding: utf-8 -* from PIL import Image import os import argparse import requests import math from CSMap import CSMap parser = argparse.ArgumentParser(description='MyScript') parser.add_argument('images_x_start', type=int) parser.add_argument('images_x_end', type=int) parser.add_argument('images_y_...
mit
vmax-feihu/hue
desktop/core/ext-py/lxml-3.3.6/src/lxml/tests/test_relaxng.py
16
5736
# -*- coding: utf-8 -*- """ Test cases related to RelaxNG parsing and validation """ import unittest, sys, os.path this_dir = os.path.dirname(__file__) if this_dir not in sys.path: sys.path.insert(0, this_dir) # needed for Py3 from common_imports import etree, BytesIO, _bytes, HelperTestCase, fileInTestDir from...
apache-2.0
Inspq/ansible
lib/ansible/modules/notification/osx_say.py
70
2306
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Michael DeHaan <michael@ansible.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 ...
gpl-3.0
chirilo/kuma
vendor/packages/translate/convert/xliff2odf.py
23
6604
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2004-2014 Zuza Software Foundation # # This file is part of translate. # # translate is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2...
mpl-2.0
helpmoeny/pythoncode
Python_labs/lab10/warmup.py
1
1907
################################################################################ ## Demonstration program for class Date ################################################################################ import date print("[Testing Area-__init__]") J = date.Date( brake, me, 2013 )#testin two arguments to function that...
unlicense
bzero/networkx
networkx/algorithms/components/strongly_connected.py
30
11937
# -*- coding: utf-8 -*- """Strongly connected components. """ # Copyright (C) 2004-2015 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 from networkx.utils.decorators import not_implemen...
bsd-3-clause
Pluto-tv/chromium-crosswalk
tools/vim/tests/chromium.ycm_extra_conf_unittest.py
7
10297
#!/usr/bin/env python # Copyright 2015 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Tests for chromium.ycm_extra_conf. These tests should be getting picked up by the PRESUBMIT.py in /tools/vim. Currently the tests ...
bsd-3-clause
nibrahim/PlasTeX
plasTeX/ConfigManager/String.py
8
1512
#!/usr/bin/env python from UserString import UserString from Generic import GenericOption, DEFAULTS, GenericParser, GenericArgument class StringParser(GenericParser): pass class StringOption(StringParser, GenericOption, UserString): """ String configuration option """ synopsis = '' def __init__(self, doc...
mit
jean/sentry
src/sentry/south_migrations/0131_auto__add_organizationmember__add_unique_organizationmember_organizati.py
2
42604
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'OrganizationMember' db.create_table( 'sentry_organizationmember', ( ...
bsd-3-clause
jarvys/django-1.7-jdb
tests/invalid_models_tests/test_relative_fields.py
14
45353
# -*- encoding: utf-8 -*- from __future__ import unicode_literals from django.core.checks import Error from django.db import models from django.test.utils import override_settings from django.test.testcases import skipIfDBFeature from .base import IsolatedModelsTestCase class RelativeFieldTests(IsolatedModelsTestCa...
bsd-3-clause
lucidbard/NewsBlur
api/newsblur.py
11
10077
# Original API work by Dananjaya Ramanayake <dananjaya86@gmail.com> # Retooled by Samuel Clay, August 2011 # Modified by Luke Hagan, 2011-11-05 import urllib, urllib2 import cookielib import json __author__ = "Dananjaya Ramanayake <dananjaya86@gmail.com>, Samuel Clay <samuel@newsblur.com>" __version__ = "1.0" API_UR...
mit
hydroshare/hydroshare-demo-auth
setup.py
3
1620
import os from setuptools import setup, find_packages def read_file(filename): """Read a file into a string""" path = os.path.abspath(os.path.dirname(__file__)) filepath = os.path.join(path, filename) try: return open(filepath).read() except IOError: return '' setup( name='dj...
bsd-2-clause
CSD-Public/stonix
src/MacBuild/proto/lib/manage_user/macos_user.py
1
31321
""" Cross platform user creation and management Created for testing cross user testing for the ramdisk project, specifically unionfs functionality. @author: Roy Nielsen """ import re import os import pty import sys import shutil from subprocess import Popen ########## # local app libraries from lib.manage_user.pa...
gpl-2.0
mlachwani/Android-4.4.3-HTC-M8-Kernel-ATT
Documentation/target/tcm_mod_builder.py
4981
41422
#!/usr/bin/python # The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD # # Copyright (c) 2010 Rising Tide Systems # Copyright (c) 2010 Linux-iSCSI.org # # Author: nab@kernel.org # import os, sys import subprocess as sub import string import re import optparse tcm_dir = "" fabric_ops...
gpl-2.0
keen99/SickRage
tornado/test/twisted_test.py
18
25239
# 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
emawind84/readthedocs.org
readthedocs/projects/feeds.py
26
1035
"""Project RSS feeds""" from django.contrib.syndication.views import Feed from readthedocs.projects.models import Project class LatestProjectsFeed(Feed): """RSS feed for projects that were recently updated""" title = "Recently updated documentation" link = "http://readthedocs.org" description = "R...
mit
dreamsxin/kbengine
kbe/src/lib/python/Lib/hashlib.py
82
7983
#. Copyright (C) 2005-2010 Gregory P. Smith (greg@krypto.org) # Licensed to PSF under a Contributor Agreement. # __doc__ = """hashlib module - A common interface to many hash functions. new(name, data=b'') - returns a new hash object implementing the given hash function; initializing the has...
lgpl-3.0
sunpeak/MITMf
core/packetfilter.py
4
1221
import threading from core.utils import set_ip_forwarding, iptables from core.logger import logger from scapy.all import * from traceback import print_exc from netfilterqueue import NetfilterQueue formatter = logging.Formatter("%(asctime)s [PacketFilter] %(message)s", datefmt="%Y-%m-%d %H:%M:%S") log = logger().setup...
gpl-3.0
mgit-at/ansible
lib/ansible/plugins/terminal/asa.py
42
2417
# # (c) 2016 Red Hat Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is d...
gpl-3.0
rwakulszowa/servo
tests/wpt/web-platform-tests/service-workers/tools/blink-import.py
88
6816
import os import re import shutil import glob import tempfile import sys from collections import defaultdict here = os.path.abspath(os.path.split(__file__)[0]) def get_extra_files(chromium_root): return [(os.path.join(chromium_root, "LayoutTests", "http", "tests", "resources", "testharness-helpers.js"), ...
mpl-2.0
keras-team/keras-io
examples/nlp/text_classification_from_scratch.py
1
8972
""" Title: Text classification from scratch Authors: Mark Omernick, Francois Chollet Date created: 2019/11/06 Last modified: 2020/05/17 Description: Text sentiment classification starting from raw text files. """ """ ## Introduction This example shows how to do text classification starting from raw text (as a set of t...
apache-2.0
yang-g/grpc
src/python/grpcio/support.py
7
3941
# Copyright 2016 gRPC authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing...
apache-2.0
aahnne04/omaha
plugins/update/generate_plugin_idls.py
67
3325
#!/usr/bin/python2.4 # # Copyright 2007-2009 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
apache-2.0
evilhero/mylar
lib/bs4/testing.py
22
30829
"""Helper classes for tests.""" # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. __license__ = "MIT" import pickle import copy import functools import unittest from unittest import TestCase from bs4 import BeautifulSoup from bs4.element import ( CharsetMetaAttr...
gpl-3.0
marcok/odoo_modules
hr_employee_time_clock/models/hr_contract.py
1
8125
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2016 - now Bytebrand Outsourcing AG (<http://www.bytebrand.net>). # # This program is free software: you can redistribute it and/or modify # it...
agpl-3.0
savoirfairelinux/django
tests/basic/tests.py
5
29056
import threading from datetime import datetime, timedelta from django.core.exceptions import MultipleObjectsReturned, ObjectDoesNotExist from django.db import DEFAULT_DB_ALIAS, DatabaseError, connections from django.db.models.manager import BaseManager from django.db.models.query import EmptyQuerySet, QuerySet from dj...
bsd-3-clause
maartenq/ansible
test/runner/lib/executor.py
2
50538
"""Execute Ansible tests.""" from __future__ import absolute_import, print_function import json import os import collections import datetime import re import tempfile import time import textwrap import functools import pipes import sys import hashlib import lib.pytar import lib.thread from lib.core_ci import ( ...
gpl-3.0
SlimSaber/android_external_chromium
testing/gtest/scripts/upload_gtest.py
1963
2851
#!/usr/bin/env python # # 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...
bsd-3-clause
flintsoft/peacecoin
contrib/testgen/gen_base58_test_vectors.py
1064
4344
#!/usr/bin/env python ''' Generate valid and invalid base58 address and private key test vectors. Usage: gen_base58_test_vectors.py valid 50 > ../../src/test/data/base58_keys_valid.json gen_base58_test_vectors.py invalid 50 > ../../src/test/data/base58_keys_invalid.json ''' # 2012 Wladimir J. van der Laan # R...
mit
yashaswi-reddy/icsisumm
icsisumm-primary-sys34_v1/nltk/nltk-0.9.2/nltk_contrib/wordnet/dbinfo_html.py
9
7200
# Natural Language Toolkit: Wordnet Interface: Graphical Wordnet Browser # # Copyright (C) 2007 - 2008 University of Pennsylvania # Author: Jussi Salmela <jtsalmela@users.sourceforge.net> # URL: <http://nltk.sf.net> # For license information, see LICENSE.TXT import os from collections import defaultdict from ...
gpl-3.0
brandond/ansible
lib/ansible/modules/cloud/cloudstack/cs_snapshot_policy.py
14
10609
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2016, René Moser <mail@renemoser.net> # 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', ...
gpl-3.0
abhilashnta/edx-platform
common/lib/xmodule/xmodule/library_content_module.py
34
24809
# -*- coding: utf-8 -*- """ LibraryContent: The XBlock used to include blocks from a library in a course. """ import json from lxml import etree from copy import copy from capa.responsetypes import registry from gettext import ngettext from lazy import lazy from .mako_module import MakoModuleDescriptor from opaque_key...
agpl-3.0
mkrupcale/ansible
lib/ansible/modules/cloud/vmware/vmware_portgroup.py
32
5724
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Joseph Callen <jcallen () csc.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 Li...
gpl-3.0
deokjinkim/servo
tests/wpt/css-tests/tools/six/test_six.py
418
22226
import operator import sys import types import py import six def test_add_doc(): def f(): """Icky doc""" pass six._add_doc(f, """New doc""") assert f.__doc__ == "New doc" def test_import_module(): from logging import handlers m = six._import_module("logging.handlers") asser...
mpl-2.0
splunk/splunk-webframework
server/splunkdj/management/commands/wsgiserver/mediahandler.py
1
3038
#!/usr/bin/env python # -*- coding: utf-8 -*- # fix these up import os, stat, mimetypes import django from django.utils.http import http_date from django.conf import settings from django.contrib.staticfiles import finders import logging logger = logging.getLogger('splunk') class BlockIterator(object): # Vlada Mac...
apache-2.0
rcharp/toyota-flask
venv/lib/python2.7/site-packages/requests/packages/chardet/langbulgarianmodel.py
2965
12784
######################## 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...
apache-2.0
GoogleChrome/big-rig
app/src/thirdparty/telemetry/internal/actions/mouse_click_unittest.py
31
1617
# Copyright 2015 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.core import exceptions from telemetry.internal.actions import mouse_click from telemetry.testing import tab_test_case class MouseClickAction...
apache-2.0
guschmue/tensorflow
tensorflow/contrib/bayesflow/python/kernel_tests/layers_dense_variational_test.py
5
11390
# Copyright 2017 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
plq/spyne
spyne/model/primitive/__init__.py
2
7308
# # spyne - Copyright (C) Spyne contributors. # # 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 your option) any later version. # # This libra...
lgpl-2.1
DoubleCiti/daimaduan.com
daimaduan/migrations/20160318173601.py
1
1459
# coding: utf-8 import hashlib import time from mongodb_migrations.base import BaseMigration class Migration(BaseMigration): def upgrade(self): """ Add default bookmark to every user :return: """ user_ids = [str(i['user']) for i in self.db.bookmark.find()] users =...
bsd-3-clause
gauravbose/digital-menu
django/core/management/commands/dbshell.py
467
1192
from django.core.management.base import BaseCommand, CommandError from django.db import DEFAULT_DB_ALIAS, connections class Command(BaseCommand): help = ("Runs the command-line client for specified database, or the " "default database if none is provided.") requires_system_checks = False def add...
bsd-3-clause
kun--hust/libcloud_with_cn
libcloud/test/compute/test_ssh_client.py
17
11868
# -*- coding: utf-8 -*- # 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 "Li...
apache-2.0
zverevalexei/trex-http-proxy
trex_client/external_libs/pyzmq-14.5.0/python3/cel59/32bit/zmq/eventloop/minitornado/platform/auto.py
50
1424
#!/usr/bin/env python # # Copyright 2011 Facebook # # 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...
mit
BIMSBbioinfo/bioconda-recipes
recipes/biopet-bamstats/biopet-bamstats.py
72
3369
#!/usr/bin/env python # # Wrapper script for starting the biopet-bamstats JAR package # # This script is written for use with the Conda package manager and is copied # from the peptide-shaker wrapper. Only the parameters are changed. # (https://github.com/bioconda/bioconda-recipes/blob/master/recipes/peptide-shaker/pep...
mit
abhitopia/tensorflow
tensorflow/tools/compatibility/tf_upgrade_test.py
48
6045
# 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
GenericStudent/home-assistant
homeassistant/components/image/__init__.py
10
6882
"""The Picture integration.""" import asyncio import logging import pathlib import secrets import shutil import typing from PIL import Image, ImageOps, UnidentifiedImageError from aiohttp import hdrs, web from aiohttp.web_request import FileField import voluptuous as vol from homeassistant.components.http.static impo...
apache-2.0
fgclaramonte/Odoo-addons
pos_order_categories/__openerp__.py
1
1761
# -*- encoding: utf-8 -*- ############################################################################## # pos_order_categories # Copyright (c) 2017 Francisco Manuel García Claramonte <francisco@garciac.es> # # This program is free software: you can redistribute it and/or modify # it under the terms of the ...
gpl-3.0
40223246/w16b_test
static/Brython3.1.3-20150514-095342/Lib/site-packages/pygame/rect.py
603
13689
#!/usr/bin/env python '''Pygame object for storing rectangular coordinates. ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' import copy #import SDL.video import SDL class _RectProxy: '''Proxy for SDL_Rect that can handle negative size.''' __slots__ = ['x', 'y', 'w', 'h'] def __init__(self...
agpl-3.0
omni5cience/django-inlineformfield
.tox/py27/lib/python2.7/site-packages/IPython/nbformat/v1/rwbase.py
31
1479
"""Base classes and function for readers and writers. Authors: * Brian Granger """ #----------------------------------------------------------------------------- # Copyright (C) 2008-2011 The IPython Development Team # # Distributed under the terms of the BSD License. The full license is in # the file COPYING, ...
mit
apprentice3d/Wox
PythonHome/Lib/site-packages/chardet/charsetprober.py
3127
1902
######################## 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...
mit
kod3r/neon
tests/test_initializers.py
10
2621
# ---------------------------------------------------------------------------- # Copyright 2015 Nervana Systems Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.o...
apache-2.0
christianurich/VIBe2UrbanSim
3rdparty/opus/src/urbansim/gridcell/vacant_SSS_sqft_from_buildings.py
2
2287
# Opus/UrbanSim urban simulation software. # Copyright (C) 2005-2009 University of Washington # See opus_core/LICENSE from opus_core.variables.variable import Variable from variable_functions import my_attribute_label from opus_core.misc import clip_to_zero_if_needed class vacant_SSS_sqft_from_buildings(Varia...
gpl-2.0
sclabs/sitestatus-nonrel
django/contrib/auth/decorators.py
230
2388
import urlparse try: from functools import wraps except ImportError: from django.utils.functional import wraps # Python 2.4 fallback. from django.conf import settings from django.contrib.auth import REDIRECT_FIELD_NAME from django.utils.decorators import available_attrs def user_passes_test(test_func, login...
bsd-3-clause
artful-addict/rwd-starter-kit
node_modules/node-gyp/gyp/pylib/gyp/generator/android.py
960
45344
# 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. # Notes: # # This generates makefiles suitable for inclusion into the Android build system # via an Android.mk file. It is based on make.py, the standard makefile ...
mit
anaran/olympia
apps/amo/helpers.py
1
20802
import collections import json as jsonlib import os import random import re from operator import attrgetter from urlparse import urljoin from django.conf import settings from django.core.exceptions import ObjectDoesNotExist from django.forms import CheckboxInput from django.utils import translation from django.utils.e...
bsd-3-clause
packetbeat/gopacket
layers/test_creator.py
84
3683
#!/usr/bin/python # Copyright 2012 Google, Inc. All rights reserved. """TestCreator creates test templates from pcap files.""" import argparse import base64 import glob import re import string import subprocess import sys class Packet(object): """Helper class encapsulating packet from a pcap file.""" def __ini...
bsd-3-clause
armersong/zato
code/zato-common/src/zato/common/markov_passwords.py
6
11748
# coding: utf8 """ Use Markov chains to generate random text that sounds Japanese. This makes random pronounceable passwords that are both strong and easy to memorize. Of course English or any other language could be used in the sample text. See more details at http://exyr.org/2011/random-pronounceable-passwords/ Auth...
gpl-3.0
Alex-Chizhov/python_training
home_work_4_fixture/test_add_group_and_contact.py
1
1218
# -*- coding: utf-8 -*- from group import Group from info_contact import Infos from application import Application import pytest @pytest.fixture def app(request): fixture = Application() request.addfinalizer(fixture.destroy) return fixture def test_add_group(app): app.login( username="admin", passw...
apache-2.0
zaccoz/odoo
addons/website_mail_group/models/mail_group.py
321
2678
# -*- coding: utf-8 -*- from openerp.osv import osv from openerp import tools from openerp.tools.translate import _ from openerp.tools.safe_eval import safe_eval as eval from openerp.addons.website.models.website import slug class MailGroup(osv.Model): _inherit = 'mail.group' def message_get_email_values(sel...
agpl-3.0
zacharyvoase/django-postgres
tests/test_project/viewtest/tests.py
1
1775
from contextlib import closing from django.contrib import auth from django.core.management import call_command from django.db import connection from django.test import TestCase import models class ViewTestCase(TestCase): def setUp(self): call_command('sync_pgviews', *[], **{}) def test_views_have_...
unlicense
victorbergelin/scikit-learn
examples/neighbors/plot_approximate_nearest_neighbors_hyperparameters.py
227
5170
""" ================================================= Hyper-parameters of Approximate Nearest Neighbors ================================================= This example demonstrates the behaviour of the accuracy of the nearest neighbor queries of Locality Sensitive Hashing Forest as the number of candidates and the numb...
bsd-3-clause
openhatch/oh-mainline
vendor/packages/scrapy/scrapy/utils/reactor.py
178
1360
from twisted.internet import reactor, error def listen_tcp(portrange, host, factory): """Like reactor.listenTCP but tries different ports in a range.""" assert len(portrange) <= 2, "invalid portrange: %s" % portrange if not hasattr(portrange, '__iter__'): return reactor.listenTCP(portrange, factory...
agpl-3.0
anilmuthineni/tensorflow
tensorflow/python/framework/tensor_shape_test.py
79
17267
# 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
oktayacikalin/pyglet
experimental/input/linux_const.py
28
8183
#!/usr/bin/env python '''Event constants from /usr/include/linux/input.h ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' EV_SYN = 0x00 EV_KEY = 0x01 EV_REL = 0x02 EV_ABS = 0x03 EV_MSC = 0x04 EV_LED = 0x11 EV_SND = 0x12 EV_REP = 0x14 EV_FF = 0x15 EV_PWR = 0x16 EV_FF_STATUS = 0x17 EV_MAX = 0x1f # Synchro...
bsd-3-clause
isyippee/nova
nova/api/openstack/compute/ips.py
7
2897
# 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
tcheehow/MissionPlanner
Lib/distutils/command/bdist_wininst.py
50
15281
"""distutils.command.bdist_wininst Implements the Distutils 'bdist_wininst' command: create a windows installer exe-program.""" __revision__ = "$Id$" import sys import os import string from sysconfig import get_python_version from distutils.core import Command from distutils.dir_util import remove_tr...
gpl-3.0
VigTech/Vigtech-Services
env/lib/python2.7/site-packages/pip/_vendor/requests/api.py
435
5415
# -*- coding: utf-8 -*- """ requests.api ~~~~~~~~~~~~ This module implements the Requests API. :copyright: (c) 2012 by Kenneth Reitz. :license: Apache2, see LICENSE for more details. """ from . import sessions def request(method, url, **kwargs): """Constructs and sends a :class:`Request <Request>`. :par...
lgpl-3.0
baidu/Paddle
python/paddle/fluid/transpiler/distribute_transpiler.py
1
90029
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
apache-2.0
mattpap/sympy-polys
sympy/mpmath/tests/test_special.py
7
2827
from sympy.mpmath import * def test_special(): assert inf == inf assert inf != -inf assert -inf == -inf assert inf != nan assert nan != nan assert isnan(nan) assert --inf == inf assert abs(inf) == inf assert abs(-inf) == inf assert abs(nan) != abs(nan) assert isnan(inf - in...
bsd-3-clause
chemelnucfin/tensorflow
tensorflow/contrib/bigtable/__init__.py
29
1329
# 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
DasIch/django
tests/admin_checks/tests.py
118
23502
from __future__ import unicode_literals from django import forms from django.contrib import admin from django.contrib.admin import AdminSite from django.contrib.contenttypes.admin import GenericStackedInline from django.core import checks from django.test import SimpleTestCase, override_settings from .models import A...
bsd-3-clause
maurofaccenda/ansible
lib/ansible/modules/web_infrastructure/ansible_tower/tower_host.py
33
5923
#!/usr/bin/python #coding: utf-8 -*- # (c) 2017, Wayne Witzel III <wayne@riotousliving.com> # # 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 optio...
gpl-3.0
jungle90/Openstack-Swift-I-O-throttler
test/unit/common/middleware/test_staticweb.py
19
34527
# Copyright (c) 2010 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 a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to ...
apache-2.0
nisse3000/pymatgen
pymatgen/analysis/magnetism/tests/test_analyzer.py
2
11626
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. from __future__ import division, unicode_literals from pymatgen.core import Specie, Element, Lattice, Structure from pymatgen.io.cif import CifParser from pymatgen.analysis.magnetism import * import os import ...
mit
wdxtub/Patriots
static/code/sentiment_lstm.py
1
10671
# -*- coding: utf-8 -*- from __future__ import absolute_import #导入3.x的特征函数 from __future__ import print_function import yaml import sys reload(sys) sys.setdefaultencoding('utf8') import pandas as pd #导入Pandas import numpy as np #导入Numpy import jieba #导入结巴分词 import h5py, pickle, os, datetime from keras.models import m...
gpl-3.0
xxshutong/openerp-7.0
openerp/addons/purchase/res_config.py
19
5621
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
ofir123/CouchPotatoServer
libs/rtorrent/rpc/__init__.py
14
10808
# Copyright (c) 2013 Chris Lucas, <chris@chrisjlucas.com> # 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, ...
gpl-3.0
keon/algorithms
algorithms/arrays/merge_intervals.py
1
2055
""" In mathematics, a (real) interval is a set of real numbers with the property that any number that lies between two numbers in the set is also included in the set. """ class Interval: """ A set of real numbers with methods to determine if other numbers are included in the set. Includes related m...
mit
mlperf/training_results_v0.7
Fujitsu/benchmarks/resnet/implementations/implementation_open/mxnet/benchmark/opperf/nd_operations/nn_optimizer_operators.py
2
2216
# 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
jeremycline/pulp
server/pulp/server/event/http.py
9
2330
""" Forwards events to a HTTP call. The configuration used by this notifier is as follows: url Full URL to contact with the event data. A POST request will be made to this URL with the contents of the events in the body. Eventually this should be enhanced to support authentication credentials as well. """ import...
gpl-2.0
Judystudy/gooderp_addons
warehouse/tests/test_inventory.py
5
10903
# -*- coding: utf-8 -*- from odoo.tests.common import TransactionCase from odoo.exceptions import UserError class TestInventory(TransactionCase): def setUp(self): super(TestInventory, self).setUp() self.env.ref('core.goods_category_1').account_id = self.env.ref( 'finance.account_goods...
agpl-3.0
zzzeek/sqlalchemy
lib/sqlalchemy/engine/base.py
3
118014
# engine/base.py # Copyright (C) 2005-2021 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: https://www.opensource.org/licenses/mit-license.php from __future__ import with_statement import contextlib import sys from .interfaces...
mit
xxvii27/gae-pushtest
bp_includes/external/requests/packages/chardet/chardistribution.py
2755
9226
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights R...
lgpl-3.0
charleslaw/pyfft
fft.py
1
6159
# -*- coding: utf-8 -*- """ Created on Sun Aug 29 00:09:26 2010 @author: Charles Law """ import math def fft(fin, inverse): nfft = len(fin) twiddles, factors = fft_alloc(nfft, inverse) fout = [] for i in xrange(nfft): fout.append((0, 0)) fout_ind_start = 0 ...
bsd-3-clause
onesfreedom/pybuilder
src/unittest/python/plugins/python/pyfix_unittest_plugin_tests.py
6
1779
# -*- coding: utf-8 -*- # # This file is part of PyBuilder # # Copyright 2011-2015 PyBuilder Team # # 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/l...
apache-2.0
mrunge/horizon
openstack_dashboard/dashboards/admin/volumes/volume_types/forms.py
4
5903
# 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 # d...
apache-2.0
magicrub/MissionPlanner
Lib/site-packages/scipy/cluster/doc/ex1.py
61
1214
from scipy import * from scipy.cluster import vq def cluster_data(data,cluster_cnt,iter=20,thresh=1e-5): """ Group data into a number of common clusters data -- 2D array of data points. Each point is a row in the array. cluster_cnt -- The number of clusters to use iter -- number of iterat...
gpl-3.0
raybrshen/pattern_recognition
noise_detection/tools/filter_noise.py
1
3213
__author__ = 'ray' import os from subprocess import Popen,PIPE import wave import numpy as np def run_comm(comm): process = Popen(comm, stdout=PIPE) (std_out,std_err) = process.communicate() exit_code = process.wait() if std_out: print std_out if std_err!=None: print std_err def run_comm_save_out...
apache-2.0
lcy03406/protobuf
python/google/protobuf/internal/api_implementation.py
229
3438
# 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: # # * Redistributions o...
bsd-3-clause