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
Just-D/chromium-1
tools/resources/find_used_resources.py
24
2073
#!/usr/bin/env python # Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import argparse import re import sys USAGE = """find_used_resources.py [-h] [-i INPUT] [-o OUTPUT] Outputs the sorted list of resourc...
bsd-3-clause
Eureka22/ASM_xf
PythonD/lib/python2.4/DocXMLRPCServer.py
12
11031
"""Self documenting XML-RPC Server. This module can be used to create XML-RPC servers that serve pydoc-style documentation in response to HTTP GET requests. This documentation is dynamically generated based on the functions and methods registered with the server. This module is built upon the pydoc and SimpleXMLRPCSe...
gpl-2.0
jvrsantacruz/XlsxWriter
xlsxwriter/test/comparison/test_chart_layout05.py
8
2042
############################################################################### # # Tests for XlsxWriter. # # Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org # from ..excel_comparsion_test import ExcelComparisonTest from ...workbook import Workbook class TestCompareXLSXFiles(ExcelComparisonTest): """...
bsd-2-clause
KerkhoffTechnologies/shinken
test/test_problem_impact.py
18
17614
#!/usr/bin/env python # Copyright (C) 2009-2014: # Gabes Jean, naparuba@gmail.com # Gerhard Lausser, Gerhard.Lausser@consol.de # # This file is part of Shinken. # # Shinken 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 F...
agpl-3.0
rdsathene/SchoolIdolAPI
api/migrations/0020_auto_20150217_1849.py
4
2998
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('api', '0019_auto_20150216_0813'), ] operations = [ migrations.AddField( model_name='event', name='ja...
apache-2.0
latticelabs/Mitty
setup.py
1
2920
from setuptools import setup, find_packages __version__ = eval(open('mitty/version.py').read().split('=')[1]) setup( name='mitty', version=__version__, description='Simulator for genomic data', author='Seven Bridges Genomics', author_email='kaushik.ghose@sbgenomics.com', packages=find_packages(...
gpl-2.0
tthtlc/volatility
contrib/plugins/pagecheck.py
55
1739
# Volatility # # This file is part of Volatility. # # Volatility 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 of the License, or # (at your option) any later version. # # Volatility is dist...
gpl-2.0
coolbombom/CouchPotatoServer
libs/tornado/util.py
56
9238
"""Miscellaneous utility functions and classes. This module is used internally by Tornado. It is not necessarily expected that the functions and classes defined here will be useful to other applications, but they are documented here in case they are. The one public-facing part of this module is the `Configurable` cl...
gpl-3.0
mlhenderson/narrative
src/biokbase/narrative/exception_util.py
2
1847
from requests.exceptions import HTTPError from biokbase.NarrativeJobService.Client import ServerError as NJSServerError from biokbase.userandjobstate.baseclient import ServerError as UJSServerError class NarrativeException(Exception): def __init__(self, code, message, name, source): self.code = code ...
mit
biezhihua/FrescoStudy
run_comparison.py
53
10328
#!/usr/bin/env python # This file provided by Facebook is for non-commercial testing and evaluation # purposes only. Facebook reserves all rights not expressly granted. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL...
bsd-3-clause
lleobox/PYtypecho
app/modules.py
1
5106
# coding: utf-8 import uuid from datetime import datetime from flask.ext.login import UserMixin from werkzeug.security import generate_password_hash, check_password_hash from . import db, login_manager def create_only_slug(form): if form.slug.data == "": slug = str(datetime.now())[0:10] + "-" + str(uuid...
apache-2.0
fsinfuhh/Bitpoll
bitpoll/settings.py
1
9609
""" Django settings for bitpoll project. Generated by 'django-admin startproject' using Django 1.9. For more information on this file, see https://docs.djangoproject.com/en/1.9/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.9/ref/settings/ """ import os # B...
gpl-3.0
Denisolt/IEEE-NYIT-MA
local/lib/python2.7/site-packages/unidecode/x0ba.py
253
4765
data = ( 'mya', # 0x00 'myag', # 0x01 'myagg', # 0x02 'myags', # 0x03 'myan', # 0x04 'myanj', # 0x05 'myanh', # 0x06 'myad', # 0x07 'myal', # 0x08 'myalg', # 0x09 'myalm', # 0x0a 'myalb', # 0x0b 'myals', # 0x0c 'myalt', # 0x0d 'myalp', # 0x0e 'myalh', # 0x0f 'myam', # ...
gpl-3.0
eayunstack/horizon
openstack_dashboard/dashboards/project/databases/urls.py
36
1237
# Copyright 2013 Rackspace Hosting # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
apache-2.0
chengjf/database-interface-doc-management
flask-demo/flask/Lib/encodings/iso2022_jp_1.py
816
1061
# # iso2022_jp_1.py: Python Unicode Codec for ISO2022_JP_1 # # Written by Hye-Shik Chang <perky@FreeBSD.org> # import _codecs_iso2022, codecs import _multibytecodec as mbc codec = _codecs_iso2022.getcodec('iso2022_jp_1') class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class Incrementa...
apache-2.0
liorvh/raspberry_pwn
src/pentest/sqlmap/lib/core/testing.py
7
10693
#!/usr/bin/env python """ Copyright (c) 2006-2014 sqlmap developers (http://sqlmap.org/) See the file 'doc/COPYING' for copying permission """ import codecs import doctest import os import re import shutil import sys import tempfile import time import traceback from extra.beep.beep import beep from lib.controller.co...
gpl-3.0
vmora/QGIS
tests/src/python/test_qgssourceselectprovider.py
22
5218
# -*- coding: utf-8 -*- """ Test the QgsSourceSelectProvider and QgsSourceSelectProviderRegistry classes Run with: ctest -V -R PyQgsSourceSelectProvider .. note:: 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 Softwar...
gpl-2.0
razvanphp/arangodb
3rdParty/V8-3.31.74.1/third_party/python_26/Lib/encodings/cp875.py
593
13110
""" Python Character Mapping Codec cp875 generated from 'MAPPINGS/VENDORS/MICSFT/EBCDIC/CP875.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,input...
apache-2.0
atlashealth/ansible-modules-core
system/setup.py
64
5222
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, 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...
gpl-3.0
newvem/django-registration
registration/backends/default/urls.py
44
2442
""" URLconf for registration and activation, using django-registration's default backend. If the default behavior of these views is acceptable to you, simply use a line like this in your root URLconf to set up the default URLs for registration:: (r'^accounts/', include('registration.backends.default.urls')), Thi...
bsd-3-clause
bosstb/HaberPush
youtube_dl/extractor/einthusan.py
34
3416
# coding: utf-8 from __future__ import unicode_literals import base64 import json from .common import InfoExtractor from ..compat import ( compat_urlparse, compat_str, ) from ..utils import ( extract_attributes, ExtractorError, get_elements_by_class, urlencode_postdata, ) class EinthusanIE(I...
mit
louyihua/edx-platform
cms/djangoapps/contentstore/views/tests/test_item.py
4
114324
"""Tests for items views.""" import json from datetime import datetime, timedelta import ddt from mock import patch, Mock, PropertyMock from pytz import UTC from pyquery import PyQuery from webob import Response from django.http import Http404 from django.test import TestCase from django.test.client import RequestFac...
agpl-3.0
C00kiie/Youtube-Mp3-telegram-bot
youtube_dl/extractor/cctv.py
64
6903
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import compat_str from ..utils import ( float_or_none, try_get, unified_timestamp, ) class CCTVIE(InfoExtractor): IE_DESC = '央视网' _VALID_URL = r'https?://(?:(?:[^/]+)\.(?:cntv|cctv)\...
mit
andresgz/django
tests/template_tests/filter_tests/test_cut.py
521
2269
from django.template.defaultfilters import cut from django.test import SimpleTestCase from django.utils.safestring import mark_safe from ..utils import setup class CutTests(SimpleTestCase): @setup({'cut01': '{% autoescape off %}{{ a|cut:"x" }} {{ b|cut:"x" }}{% endautoescape %}'}) def test_cut01(self): ...
bsd-3-clause
BorgERP/borg-erp-6of3
addons/hr_timesheet_invoice/report/__init__.py
9
1155
# -*- 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
szeged/servo
tests/wpt/web-platform-tests/tools/third_party/h2/examples/fragments/client_https_setup_fragment.py
25
3887
# -*- coding: utf-8 -*- """ Client HTTPS Setup ~~~~~~~~~~~~~~~~~~ This example code fragment demonstrates how to set up a HTTP/2 client that negotiates HTTP/2 using NPN and ALPN. For the sake of maximum explanatory value this code uses the synchronous, low-level sockets API: however, if you're not using sockets direct...
mpl-2.0
F5Networks/f5-common-python
devtools/code_generator.py
1
1330
from __future__ import absolute_import # Copyright 2016 F5 Networks 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 ...
apache-2.0
ImmobilienScout24/aws-stager
src/main/python/aws_stager/__init__.py
1
1802
# The MIT License (MIT) # # Copyright (c) 2014 ImmobilienScout GmbH # # 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 u...
mit
PeterDaveHello/eden
modules/templates/MCOP/config.py
7
79279
# -*- coding: utf-8 -*- try: # Python 2.7 from collections import OrderedDict except: # Python 2.6 from gluon.contrib.simplejson.ordered_dict import OrderedDict from datetime import timedelta from gluon import current from gluon.html import * from gluon.storage import Storage from s3 import s3_avata...
mit
mikalstill/nova
nova/tests/unit/virt/xenapi/test_agent.py
5
18464
# Copyright 2013 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
stamhe/zulip
api/integrations/codebase/zulip_codebase_config.py
124
2537
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright © 2014 Zulip, Inc. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights #...
apache-2.0
TNT-Samuel/Coding-Projects
DNS Server/Source - Copy/Lib/encodings/euc_kr.py
816
1027
# # euc_kr.py: Python Unicode Codec for EUC_KR # # Written by Hye-Shik Chang <perky@FreeBSD.org> # import _codecs_kr, codecs import _multibytecodec as mbc codec = _codecs_kr.getcodec('euc_kr') class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class IncrementalEncoder(mbc.MultibyteIncrem...
gpl-3.0
pducks32/intergrala
python/sympy/sympy/mpmath/functions/elliptic.py
18
39057
r""" Elliptic functions historically comprise the elliptic integrals and their inverses, and originate from the problem of computing the arc length of an ellipse. From a more modern point of view, an elliptic function is defined as a doubly periodic function, i.e. a function which satisfies .. math :: f(z + 2 \om...
mit
timlau/dnf-utils
plugins/sample.py
1
3103
# dnf-utils - add-on tools for DNF # Copyright (C) 2014 Tim Lauridsen < timlau<AT>fedoraproject<DOT>org > # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the...
gpl-2.0
sdaftuar/bitcoin
contrib/devtools/update-translations.py
17
7584
#!/usr/bin/env python # Copyright (c) 2014 Wladimir J. van der Laan # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. ''' Run this script from the root of the repository to update all translations from transifex. It will do the follo...
mit
VanyaDNDZ/django-sybase-backend
sqlsybase_server/pyodbc/compiler.py
1
10019
from django.db.models.sql import compiler from datetime import datetime import re from django.db.models.base import Model REV_ODIR = { 'ASC': 'DESC', 'DESC': 'ASC' } SQL_SERVER_8_LIMIT_QUERY = \ """SELECT * FROM ( SELECT TOP %(limit)s * FROM ( %(orig_sql)s ORDER BY %(ord)s ) AS %(table)s ORDER...
unlicense
ptkool/spark
python/pyspark/broadcast.py
13
7295
# # 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 us...
apache-2.0
vijaylbais/boto
boto/ec2containerservice/__init__.py
54
1717
# Copyright (c) 2015 Amazon.com, Inc. or its affiliates. # All Rights Reserved # # 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...
mit
bradmontgomery/django-rainbowtests
setup.py
2
1284
from setuptools import setup from rainbowtests import __version__ setup( name='django-rainbowtests', version=__version__, description="A colorful Django Test Runner.", long_description=open('README.rst').read(), author='Brad Montgomery', author_email='brad@bradmontgomery.net', url='https://...
mit
googleapis/python-bigquery
samples/snippets/materialized_view_test.py
1
2840
# Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
apache-2.0
incessantmeraki/p2pworkshop
persisted-chat/node_modules/node-gyp/gyp/gyptest.py
1752
8019
#!/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. __doc__ = """ gyptest.py -- test runner for GYP tests. """ import os import optparse import subprocess import sys class CommandRunner(obje...
mit
justinfinkle/pydiffexp
scripts/osmo_yeast_prep.py
1
2736
import sys import warnings import numpy as np import pandas as pd def parse_title(title, split_str=" "): """ Parse the title of GSE13100 into usable metadata. Should work with pandas apply() Args: title: split_str: Returns: """ split = title.split(split_str) meta = [] ...
gpl-3.0
eagleamon/home-assistant
homeassistant/components/ffmpeg.py
1
6820
""" Component that will help set the ffmpeg component. For more details about this component, please refer to the documentation at https://home-assistant.io/components/ffmpeg/ """ import asyncio import logging import os import voluptuous as vol from homeassistant.core import callback from homeassistant.const import ...
apache-2.0
rlaager/libvirt
docs/index.py
53
37181
#!/usr/bin/python -u # # imports the API description and fills up a database with # name relevance to modules, functions or web pages # # Operation needed: # ================= # # install mysqld, the python wrappers for mysql and libxml2, start mysqld # - mysql-server # - mysql # - php-mysql # - MySQL-python # Chan...
lgpl-2.1
codepantry/django
django/contrib/syndication/views.py
192
8680
from __future__ import unicode_literals from calendar import timegm from django.conf import settings from django.contrib.sites.shortcuts import get_current_site from django.core.exceptions import ImproperlyConfigured, ObjectDoesNotExist from django.http import Http404, HttpResponse from django.template import Templat...
bsd-3-clause
bright-sparks/chromium-spacewalk
chrome/browser/web_dev_style/js_checker.py
44
9115
# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Presubmit script for Chromium JS resources. See chrome/browser/PRESUBMIT.py """ import regex_check class JSChecker(object): def __init__(self, i...
bsd-3-clause
meizuosc/m9
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
ctruchi/deluge-webui2
deluge/plugins/Blocklist/deluge/plugins/blocklist/peerguardian.py
8
1555
## # Copyright 2007 Steve 'Tarka' Smith (tarka@internode.on.net) # Distributed under the same terms as Deluge ## import logging from exceptions import Exception from struct import unpack import gzip, socket log = logging.getLogger(__name__) class PGException(Exception): pass # Incrementally reads PeerGuardian b...
gpl-3.0
Tong-Chen/scikit-learn
sklearn/manifold/tests/test_isomap.py
31
3991
from itertools import product import numpy as np from numpy.testing import assert_almost_equal, assert_array_almost_equal from sklearn import datasets from sklearn import manifold from sklearn import neighbors from sklearn import pipeline from sklearn import preprocessing from sklearn.utils.testing import assert_less ...
bsd-3-clause
Crescent-Saturn/Hello_Python
Week8/Bubble_shoot_final.py
1
3541
# Basic infrastructure for Bubble Shooter import simplegui import random import math # Global constants WIDTH = 800 HEIGHT = 600 FIRING_POSITION = [WIDTH // 2, HEIGHT] FIRING_LINE_LENGTH = 60 FIRING_ANGLE_VEL_INC = 0.02 BUBBLE_RADIUS = 20 COLOR_LIST = ["Red", "Green", "Blue", "White"] # global variables firing_angle...
gpl-3.0
ubc/edx-platform
cms/djangoapps/contentstore/views/library.py
57
9271
""" Views related to content libraries. A content library is a structure containing XBlocks which can be re-used in the multiple courses. """ from __future__ import absolute_import import json import logging from contentstore.views.item import create_xblock_info from contentstore.utils import reverse_library_url, add...
agpl-3.0
LeoDepriester/Kodi-Pymote
xbmcjson/xbmcjson.py
2
2528
#!/bin/env python import urllib, urllib2 import json from StringIO import StringIO PLAYER_VIDEO=1 class XBMCTransport(object): """Base class for XBMC transport""" def execute(self, method, args): pass class XBMCJsonTransport(XBMCTransport): """HTTP Json transport""" def __init__(self, url, username='xbm...
gpl-3.0
salamer/django
django/contrib/gis/db/backends/spatialite/introspection.py
391
3131
from django.contrib.gis.gdal import OGRGeomType from django.db.backends.sqlite3.introspection import ( DatabaseIntrospection, FlexibleFieldLookupDict, ) from django.utils import six class GeoFlexibleFieldLookupDict(FlexibleFieldLookupDict): """ Sublcass that includes updates the `base_data_types_reverse` ...
bsd-3-clause
zhenv5/scikit-learn
sklearn/gaussian_process/regression_models.py
259
2166
# -*- coding: utf-8 -*- # Author: Vincent Dubourg <vincent.dubourg@gmail.com> # (mostly translation, see implementation details) # Licence: BSD 3 clause """ The built-in regression models submodule for the gaussian_process module. """ import numpy as np def constant(x): """ Zero order polynomial (...
bsd-3-clause
noblisnsp/volatility
volatility/plugins/overlays/windows/win2003_sp0_x86_vtypes.py
58
288637
ntkrnlmp_types = { 'LIST_ENTRY64' : [ 0x10, { 'Flink' : [ 0x0, ['unsigned long long']], 'Blink' : [ 0x8, ['unsigned long long']], } ], 'LIST_ENTRY32' : [ 0x8, { 'Flink' : [ 0x0, ['unsigned long']], 'Blink' : [ 0x4, ['unsigned long']], } ], '__unnamed_100a' : [ 0x8, { 'LowPart' : [ 0x0, ['unsig...
gpl-2.0
keen99/SickRage
lib/unidecode/x07c.py
252
4663
data = ( 'Ze ', # 0x00 'Xi ', # 0x01 'Guo ', # 0x02 'Yi ', # 0x03 'Hu ', # 0x04 'Chan ', # 0x05 'Kou ', # 0x06 'Cu ', # 0x07 'Ping ', # 0x08 'Chou ', # 0x09 'Ji ', # 0x0a 'Gui ', # 0x0b 'Su ', # 0x0c 'Lou ', # 0x0d 'Zha ', # 0x0e 'Lu ', # 0x0f 'Nian ', # 0x10 'Suo ', ...
gpl-3.0
matthewwardrop/formulaic
benchmarks/plot.py
1
1418
import os import matplotlib.pyplot as plt import numpy as np import pandas as pd data = pd.read_csv(os.path.join(os.path.dirname(__file__), 'benchmarks.csv')).sort_values('mean') def grouped_barplot(df, cat, subcat, val, err, subcats=None, **kwargs): # based on https://stackoverflow.com/a/42033734 categori...
mit
petercable/mi-instrument
mi/idk/platform/egg_generator.py
11
9991
#!/usr/bin/env python """ @file coi-services/mi.idk.platform/egg_generator.py @author Emily Hahn @brief Generate egg for a platform agent driver. """ __author__ = 'Emily Hahn' __license__ = 'Apache 2.0' from mi.core.log import get_logger ; log = get_logger() import string import re import os import sys import shuti...
bsd-2-clause
abhishekarora12/ansible
test/units/plugins/cache/test_cache.py
87
3627
# (c) 2012-2015, 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
lgbouma/astrobase
astrobase/emailutils.py
2
7441
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # emailutils.py - Waqas Bhatti (wbhatti@astro.princeton.edu) - Jun 2013 # License: MIT. See LICENSE.txt for complete text. '''This is a small utility module to send email using an SMTP server that requires logins. The email settings are stored in a file called .emailsetti...
mit
chonix/trinity
tools/perf/scripts/python/failed-syscalls-by-pid.py
11180
2058
# failed 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 failed system call totals, broken down by pid. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.pa...
gpl-2.0
inares/edx-platform
common/djangoapps/request_cache/__init__.py
51
1910
""" A cache that is cleared after every request. This module requires that :class:`request_cache.middleware.RequestCache` is installed in order to clear the cache after each request. """ import logging from urlparse import urlparse from django.conf import settings from django.test.client import RequestFactory from ...
agpl-3.0
bwilcox-1234/ChatScript
SRC/curl/curl-7.56.1/tests/http_pipe.py
41
14039
#!/usr/bin/python # Copyright 2012 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
mit
papouso/odoo
addons/fleet/fleet.py
266
46376
# -*- 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
mashaoze/esp-idf
tools/esp_app_trace/pylibelf/util/__init__.py
14
1040
from .. import * from ..types import * from ..constants import * from ctypes import * import os def _class(elf): return ord(elf_getident(elf, None).contents[EI_CLASS]) def is32(elf): return _class(elf) == ELFCLASS32 def is64(elf): return _class(elf) == ELFCLASS64 def select(elf, fname): if is32(elf): re...
apache-2.0
iovisor/bcc
examples/networking/simulation.py
3
5257
import os import subprocess import pyroute2 from pyroute2 import IPRoute, NetNS, IPDB, NSPopen class Simulation(object): """ Helper class for controlling multiple namespaces. Inherit from this class and setup your namespaces. """ def __init__(self, ipdb): self.ipdb = ipdb self.ipdb...
apache-2.0
cessationoftime/nixops
nixops/resources/azure_gateway_connection.py
6
8968
# -*- coding: utf-8 -*- # Automatic provisioning of Azure virtual network gateway connections. import os import azure from nixops.util import attr_property from nixops.azure_common import ResourceDefinition, ResourceState, ResId, normalize_location from azure.mgmt.network import * class AzureGatewayConnectionDefin...
lgpl-3.0
gfxmonk/0compile
include_deps.py
3
1348
# Copyright (C) 2007, Thomas Leonard # See http://0install.net/0compile.html import os, __main__ import shutil from zeroinstall import SafeException from zeroinstall.zerostore import manifest from support import BuildEnv, ensure_dir, lookup def do_include_deps(args): """include-deps""" buildenv = BuildEnv() dep...
lgpl-2.1
40223108/w18
static/Brython3.1.3-20150514-095342/Lib/unittest/test/test_result.py
788
19069
import io import sys import textwrap from test import support import traceback import unittest class Test_TestResult(unittest.TestCase): # Note: there are not separate tests for TestResult.wasSuccessful(), # TestResult.errors, TestResult.failures, TestResult.testsRun or # TestResult.shouldStop because t...
gpl-3.0
ejpbruel/servo
tests/wpt/css-tests/tools/wptserve/wptserve/ranges.py
329
3003
from utils import HTTPException class RangeParser(object): def __call__(self, header, file_size): prefix = "bytes=" if not header.startswith(prefix): raise HTTPException(416, message="Unrecognised range type %s" % (header,)) parts = header[len(prefix):].split(",") rang...
mpl-2.0
UKPLab/semeval2017-scienceie
code/skip-thoughts/TomKenter-siamese-cbow-faf752ef6a99/docClassify.py
1
3459
#! /usr/bin/python import sys,cPickle as pkl,numpy as np from keras.layers import Dense, Dropout from keras.models import Sequential from keras.utils.np_utils import to_categorical import stack5 as st_learn # SAMPLE USAGE # ./docClassify.py vectors_docs_siamese.pkl def build_nn(input_dim, output_dim,hidden_dim=100):...
apache-2.0
LordHighfixxer/lrdhifxr-cogs
apitoolsoz/apitoolsoz.py
1
5904
import discord from discord.ext import commands from .utils import checks import aiohttp import json import logging import time import os log = logging.getLogger('red.apitoolsoz') class ApitoolsOz: """Steam and SteamSpy related commands""" def __init__(self, bot): self.bot = bot ...
gpl-3.0
apollo13/ansible
lib/ansible/plugins/inventory/generator.py
14
5548
# Copyright (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = ''' name: generator plugin_type: inventory version_added: "2.6" shor...
gpl-3.0
ashhher3/scikit-learn
examples/text/document_clustering.py
31
8036
""" ======================================= Clustering text documents using k-means ======================================= This is an example showing how the scikit-learn can be used to cluster documents by topics using a bag-of-words approach. This example uses a scipy.sparse matrix to store the features instead of ...
bsd-3-clause
WindCanDie/spark
python/pyspark/tests/test_readwrite.py
11
24007
# # 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 us...
apache-2.0
hsuchifeng/cuda-convnet2
python_util/data.py
180
7803
# Copyright 2014 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
apache-2.0
Foxboron/Frank
app/jobs/__init__.py
1
1066
#!/usr/bin/env python from abc import ABCMeta, abstractmethod from pkgutil import iter_modules from os.path import dirname, basename # import_module wasn't added until 2.7 try: from importlib import import_module except ImportError: def import_module(name): __import__(name) class AbstractJob(object)...
mit
GDGND/evm
allauth/socialaccount/providers/soundcloud/provider.py
75
1141
from allauth.socialaccount import providers from allauth.socialaccount.providers.base import ProviderAccount from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider class SoundCloudAccount(ProviderAccount): def get_profile_url(self): return self.account.extra_data.get('permalink_url') ...
mit
MartinDelzant/scikit-learn
benchmarks/bench_tree.py
297
3617
""" To run this, you'll need to have installed. * scikit-learn Does two benchmarks First, we fix a training set, increase the number of samples to classify and plot number of classified samples as a function of time. In the second benchmark, we increase the number of dimensions of the training set, classify a sam...
bsd-3-clause
josuebrunel/myemacs
python-libs/rope/contrib/changestack.py
115
1392
"""For performing many refactorings as a single command `changestack` module can be used to perform many refactorings on top of each other as one bigger command. It can be used like:: stack = ChangeStack(project, 'my big command') #.. stack.push(refactoring1.get_changes()) #.. stack.push(refactoring2.get_...
gpl-3.0
shubhdev/openedx
lms/djangoapps/student_profile/test/test_views.py
34
3367
# -*- coding: utf-8 -*- """ Tests for student profile views. """ from django.conf import settings from django.core.urlresolvers import reverse from django.test import TestCase from django.test.client import RequestFactory from util.testing import UrlResetMixin from student.tests.factories import UserFactory from stu...
agpl-3.0
p4datasystems/CarnotKEdist
dist/Lib/test/test_grammar.py
72
32702
# Python test set -- part 1, grammar. # This just tests whether the parser accepts them all. from test.test_support import run_unittest, check_syntax_error, \ check_py3k_warnings import unittest import sys # testing import * from sys import * class TokenTests(unittest.TestCase): de...
apache-2.0
Nixonite/Movie-Spoiler-Twitter-Bot
fetchSpoilers.py
1
1933
import urllib2 from BeautifulSoup import BeautifulSoup import sqlite3 import time spoilerSite = 'http://www.spollywood.com/' #maybe move to main.py def sqlStart(): return sqlite3.connect('moviespoilerbot.db') def sqlConnection(sqlconn): return sqlconn.cursor() def sqlClose(conn): conn.close() def weirdTextFix(...
gpl-2.0
sam-m888/gprime
gprime/filters/rules/person/_multiplemarriages.py
1
1773
# # gPrime - A web-based genealogy program # # Copyright (C) 2002-2006 Donald N. Allingham # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your optio...
gpl-2.0
robocomp/robocomp-robolab
components/hardware/imu/pyimu/src/genericworker.py
1
2828
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2019 by YOUR NAME HERE # # This file is part of RoboComp # # RoboComp 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...
gpl-3.0
prasannav7/ggrc-core
src/ggrc/models/program.py
3
3053
# Copyright (C) 2013 Google Inc., authors, and contributors <see AUTHORS file> # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> # Created By: david@reciprocitylabs.com # Maintained By: david@reciprocitylabs.com from ggrc import db from ggrc.models.context import HasOwnContext from ggrc.mo...
apache-2.0
katstalk/android_external_chromium_org
tools/perf/measurements/memory_multi_tab.py
23
1619
# 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. """Multi tab memory test. This test is a multi tab test, but we're interested in measurements for the entire test rather than each single page. """ from m...
bsd-3-clause
luzfcb/cookiecutter-django
{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_views.py
1
2441
import pytest from django.contrib.auth.models import AnonymousUser from django.http.response import Http404 from django.test import RequestFactory from {{ cookiecutter.project_slug }}.users.models import User from {{ cookiecutter.project_slug }}.users.tests.factories import UserFactory from {{ cookiecutter.project_slu...
bsd-3-clause
bdfoster/blumate
blumate/components/sensor/thinkingcleaner.py
1
3570
"""Support for ThinkingCleaner.""" import logging from datetime import timedelta import blumate.util as util from blumate.helpers.entity import Entity _LOGGER = logging.getLogger(__name__) REQUIREMENTS = ['https://github.com/TheRealLink/pythinkingcleaner' '/archive/v0.0.2.zip' '#pythi...
mit
TakayukiSakai/tensorflow
tensorflow/models/embedding/word2vec_test.py
3
2255
# 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
sharad/calibre
setup/installer/osx/app/sign.py
1
2568
#!/usr/bin/env python # vim:fileencoding=utf-8 from __future__ import (unicode_literals, division, absolute_import, print_function) __license__ = 'GPL v3' __copyright__ = '2014, Kovid Goyal <kovid at kovidgoyal.net>' import subprocess, os, sys, plistlib from contextlib import contextmanager fr...
gpl-3.0
dezelin/scons
scons-local/SCons/Tool/cyglink.py
29
2819
"""SCons.Tool.cyglink Customization of gnulink for Cygwin (http://www.cygwin.com/) 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. """ import SCons.Action import SCons.Util import gnulink def shlib_generator(t...
mit
rdeheele/odoo
addons/hr_payroll/__openerp__.py
52
2616
#-*- coding:utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved # d$ # # This program is free software: you can redistribute it and/or modify # it ...
agpl-3.0
carvalhomb/tsmells
lib/CherryPy/cherrypy/tutorial/tut08_generators_and_yield.py
2
1195
""" Bonus Tutorial: Using generators to return result bodies Instead of returning a complete result string, you can use the yield statement to return one result part after another. This may be convenient in situations where using a template package like CherryPy or Cheetah would be overkill, and messy string concatena...
gpl-2.0
samkuehn/suds
suds/bindings/multiref.py
209
4181
# This program is free software; you can redistribute it and/or modify # it under the terms of the (LGPL) GNU Lesser General Public License as # published by the Free Software Foundation; either version 3 of the # License, or (at your option) any later version. # # This program is distributed in the hope that it will ...
lgpl-3.0
mwmuni/LIGGGHTS_GUI
OpenGL/raw/GLX/AMD/gpu_association.py
8
1094
'''Autogenerated by xml_generate script, do not edit!''' from OpenGL import platform as _p, arrays # Code generation uses this from OpenGL.raw.GLX import _types as _cs # End users want this... from OpenGL.raw.GLX._types import * from OpenGL.raw.GLX import _errors from OpenGL.constant import Constant as _C import ctype...
gpl-3.0
meduz/NeuroTools
examples/matlab_vs_python/smallnet_acml.py
3
4164
# Created by Eugene M. Izhikevich, 2003 Modified by S. Fusi 2007 # Ported to Python by Eilif Muller, 2008. # # Notes: # # Requires matplotlib,ipython,numpy>=1.0.3 # On a debian/ubuntu based system: # $ apt-get install python-matplotlib python-numpy ipython # # Start ipython with threaded plotting support: # $ ipython -...
gpl-2.0
SCgeeker/OpenSesame
setup_shared.py
2
1444
#!/usr/bin/env python #-*- coding:utf-8 -*- """ This file is part of OpenSesame. OpenSesame 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
yewang15215/django
tests/postgres_tests/test_array.py
7
30141
import decimal import json import unittest import uuid from django import forms from django.core import exceptions, serializers, validators from django.core.exceptions import FieldError from django.core.management import call_command from django.db import IntegrityError, connection, models from django.test import Tran...
bsd-3-clause
jamescurtin/maptool
basic_lti_app/tests/test_views.py
4
1056
import unittest from django.test import RequestFactory from django_auth_lti import const from mock import patch, ANY, DEFAULT, Mock from basic_lti_app.views import lti_launch @patch.multiple('basic_lti_app.views', render=DEFAULT) class BasicLTIAppViewsTests(unittest.TestCase): longMessage = True def setUp(sel...
mit