repo_name
stringlengths
5
100
path
stringlengths
4
375
copies
stringclasses
991 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
stevenbrichards/boto
boto/cognito/identity/layer1.py
135
24701
# Copyright (c) 2014 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
chalasr/Flask-P2P
venv/lib/python2.7/site-packages/jinja2/environment.py
614
47244
# -*- coding: utf-8 -*- """ jinja2.environment ~~~~~~~~~~~~~~~~~~ Provides a class that holds runtime and parsing time options. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ import os import sys from jinja2 import nodes from jinja2.defaults import BLOCK_S...
mit
egonw/citeulike
plugins/python/worldcat.py
2
1451
#!/usr/bin/env python import re, sys, urlparse, urllib2 from cultools import urlparams, bail import socket socket.setdefaulttimeout(15) # # Read URL from stdin and check it's OK # url = sys.stdin.readline().strip() oclc_match = re.search(r'/(oclc|isbn)/([0-9\-]+)', url, re.IGNORECASE) if not oclc_match: bail("Co...
bsd-3-clause
GeorgeJahad/graphite-api
tests/test_http.py
14
1174
from . import TestCase class HttpTestCase(TestCase): def test_cors(self): response = self.app.options('/render') self.assertFalse( 'Access-Control-Allow-Origin' in response.headers.keys()) response = self.app.options('/render', headers=( ('Origin', 'https://example...
apache-2.0
bblacey/FreeCAD-MacOS-CI
src/Mod/Path/PathScripts/PathAreaUtils.py
9
15642
import area from nc.nc import * import PathScripts.nc.iso import math import PathKurveUtils # some globals, to save passing variables as parameters too much area_for_feed_possible = None tool_radius_for_pocket = None def cut_curve(curve, need_rapid, p, rapid_safety_space, current_start_depth, final_depth): ...
lgpl-2.1
serialx/pexpect-u
tools/testall.py
3
1975
#!/usr/bin/env python '''This script runs all tests in a directory. It does not need to know about the tests ahead of time. It recursively descends from the current directory and automatically builds up a list of tests to run. Only directories named 'tests' are processed. The path to each 'tests' directory is added to ...
mit
mtanski/linux-fs
tools/perf/scripts/python/futex-contention.py
1997
1508
# futex contention # (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com> # Licensed under the terms of the GNU GPL License version 2 # # Translation of: # # http://sourceware.org/systemtap/wiki/WSFutexContention # # to perf python scripting. # # Measures futex contention import os, sys sys.path.append(os.environ['PER...
gpl-2.0
g-stream/g-stream
tests/test_user_model.py
5
3984
import unittest import time from app import create_app, db from app.models import User, AnonymousUser, Role, Permission class UserModelTestCase(unittest.TestCase): def setUp(self): self.app = create_app('testing') self.app_context = self.app.app_context() self.app_context.push() db...
mit
treycausey/scikit-learn
sklearn/__check_build/__init__.py
30
1669
""" Module to give helpful messages to the user that did not compile the scikit properly. """ import os INPLACE_MSG = """ It appears that you are importing a local scikit-learn source tree. For this, you need to have an inplace install. Maybe you are in the source directory and you need to try from another location.""...
bsd-3-clause
awatts/boto
tests/integration/ec2/autoscale/test_cert_verification.py
126
1575
# Copyright (c) 2012 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2012 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 withou...
mit
stasiek/robotframework
src/robot/reporting/resultwriter.py
18
5933
# Copyright 2008-2015 Nokia Solutions and Networks # # 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 l...
apache-2.0
muccg/rdrf
rdrf/rdrf/views/context_views.py
1
15077
from django.urls import reverse_lazy from django.forms import ModelForm from django.views.generic.base import View from django.shortcuts import render from django.contrib.auth.decorators import login_required from django.utils.decorators import method_decorator from django.urls import reverse from django.http import Ht...
agpl-3.0
dezynetechnologies/odoo
addons/document/report/__init__.py
444
1068
# -*- 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
AnderEnder/ansible-modules-extras
database/vertica/vertica_user.py
148
14500
#!/usr/bin/python # -*- coding: utf-8 -*- # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. #...
gpl-3.0
miguelcarrasco/anothercryptosolver
anothercryptosolver/genwordlist.py
1
1216
#!/usr/bin/python # -*- coding: utf-8 -*- import sys from sqlalchemy import create_engine from wordlistdb_management import WordListDBCreator def print_instructions(executable): print executable + ':' print 'Reads the standard input and generates a sqlite database that can be used with susdecipher.py' p...
mit
3L3N4/theHarvester
lib/graphs.py
16
32822
""" +-------------------------------------------------------------------+ | H T M L - G R A P H S (v4.8) | | | | Copyright Gerd Tentler www.gerd-tentler.de/tools | | Created: Sep. 17, 2002 ...
gpl-2.0
shajrawi/swift
utils/swift_build_support/swift_build_support/SwiftBuildSupport.py
34
7469
# utils/SwiftBuildSupport.py - Utilities for Swift build scripts -*- python -*- # # This source file is part of the Swift.org open source project # # Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors # Licensed under Apache License v2.0 with Runtime Library Exception # # See https://swift.org/LICENSE.t...
apache-2.0
vivyly/fancast
fancast/casting/models.py
1
3383
from operator import itemgetter from django.db import models from shortuuidfield import ShortUUIDField MEDIUM_CHOICES = [(x, x) for x in ['movie', 'tv', 'book', 'comicbook', 'play',...
bsd-3-clause
mdinger/rust
src/etc/snapshot.py
37
8006
# Copyright 2011-2015 The Rust Project Developers. See the COPYRIGHT # file at the top-level directory of this distribution and at # http://rust-lang.org/COPYRIGHT. # # Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or # http://www.apache.org/licenses/LICENSE-2.0> or the MIT license # <LICENSE-MIT or ht...
apache-2.0
bollu/sandhi
modules/gr36/gnuradio-core/src/python/gnuradio/gr/qa_vector_sink_source.py
18
2014
#!/usr/bin/env python # # Copyright 2008,2010 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 optio...
gpl-3.0
magicnote/yohe
phpfmt.py
1
41900
import csv import os import os.path import shutil import sublime import sublime_plugin import subprocess import time import sys from os.path import dirname, realpath dist_dir = os.path.dirname(os.path.abspath(__file__)) sys.path.insert(0, dist_dir) from diff_match_patch.python3.diff_match_patch import diff_match_patch...
mit
ywcui1990/nupic.research
htmresearch/support/nlp_model_test_helpers.py
9
8428
#!/usr/bin/env python # ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2016, Numenta, Inc. Unless you have purchased from # Numenta, Inc. a separate commercial license for this software code, the # following terms and conditio...
agpl-3.0
rhdedgar/openshift-tools
openshift/installer/vendored/openshift-ansible-git-2016-04-18/roles/lib_yaml_editor/build/src/yedit.py
9
6339
# pylint: skip-file class YeditException(Exception): ''' Exception class for Yedit ''' pass class Yedit(object): ''' Class to modify yaml files ''' re_valid_key = r"(((\[-?\d+\])|([a-zA-Z-./]+)).?)+$" re_key = r"(?:\[(-?\d+)\])|([a-zA-Z-./]+)" def __init__(self, filename=None, content=None, c...
apache-2.0
mozilla/django-jobvite
django_jobvite/models.py
1
1868
from django.db import models class Category(models.Model): name = models.CharField(max_length=100) slug = models.CharField(max_length=100, unique=True) description = models.TextField(blank=True) def __unicode__(self): return self.name def to_dict(self): fields = self._meta.fields...
bsd-3-clause
CristianBB/SickRage
lib/github/PaginatedList.py
23
7862
# -*- coding: utf-8 -*- # ########################## Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> # # Copyright 2012 Zearin <zearin@gonk.net> ...
gpl-3.0
jindongh/boto
tests/integration/sts/test_session_token.py
101
3405
# Copyright (c) 2012 Mitch Garnaat http://garnaat.org/ # 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
DonBeo/statsmodels
statsmodels/base/data.py
6
21327
""" Base tools for handling various kinds of data structures, attaching metadata to results, and doing data cleaning """ from statsmodels.compat.python import reduce, iteritems, lmap, zip, range from statsmodels.compat.numpy import np_matrix_rank import numpy as np from pandas import DataFrame, Series, TimeSeries, isnu...
bsd-3-clause
nrhine1/scikit-learn
examples/ensemble/plot_bias_variance.py
357
7324
""" ============================================================ Single estimator versus bagging: bias-variance decomposition ============================================================ This example illustrates and compares the bias-variance decomposition of the expected mean squared error of a single estimator again...
bsd-3-clause
ztemt/NX507J_Lollipop_kernel
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
transientskp/tkp
tkp/telescope/lofar/noise.py
3
5683
""" functions for calculating theoretical noise levels of LOFAR equipment. For more information about the math used here read the `sensitivity of the LOFAR array page <http://www.astron.nl/radio-observatory/astronomers/lofar-imaging-capabilities-sensitivity/sensitivity-lofar-array/sensiti>`_. To check the values calc...
bsd-2-clause
Almad/django-sane-testing
djangosanetesting/runnercompat.py
1
16346
import sys import signal import unittest from django.conf import settings from django.core.exceptions import ImproperlyConfigured #This module was taken from Django 1.2.4 source code and embedded for backward #compatibility. # #Copyright (c) Django Software Foundation #Distributed under BSD license try: all exce...
bsd-3-clause
KaranToor/MA450
google-cloud-sdk/.install/.backup/platform/gsutil/gslib/addlhelp/anon.py
10
2147
# -*- coding: utf-8 -*- # 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless require...
apache-2.0
Architektor/PySnip
venv/lib/python2.7/site-packages/twisted/trial/_dist/__init__.py
57
1941
# -*- test-case-name: twisted.trial._dist.test -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ This package implements the distributed Trial test runner: - The L{twisted.trial._dist.disttrial} module implements a test runner which runs in a manager process and can launch addition...
gpl-3.0
peervalhoegen/SudoQ
utilities/compareStringFiles.py
2
1120
#!/usr/bin/python # -*- coding: utf-8 -*- #aufruf: python comparebla.py english foreign ignore import sys import datetime import re from collections import defaultdict englishLinesRaw = open(sys.argv[1]).readlines() #fill a dictionary variable_name:string_value for english only_english_strings =[l.strip() for l in f...
gpl-3.0
sunze/py_flask
venv/lib/python3.4/site-packages/mako/ext/pygmentplugin.py
60
4540
# ext/pygmentplugin.py # Copyright (C) 2006-2015 the Mako authors and contributors <see AUTHORS file> # # This module is part of Mako and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php from pygments.lexers.web import \ HtmlLexer, XmlLexer, JavascriptLexer, CssLexer from py...
mit
Intel-Corporation/tensorflow
tensorflow/contrib/data/python/ops/counter.py
22
1757
# 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
zhaohuaw/stock-logistics-warehouse
__unported__/stock_inventory_with_location/__openerp__.py
10
1555
# -*- coding: utf-8 -*- ################################################################################# # # OpenERP, Open Source Management Solution # Copyright (C) 2011 Julius Network Solutions SARL <contact@julius.fr> # # This program is free software: you can redistribute it and/or modify # it under th...
agpl-3.0
rhelmer/socorro
socorro/unittest/processor/test_breakpad_pipe_to_json.py
11
15280
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from nose.tools import eq_, ok_ import socorro.processor.breakpad_pipe_to_json as bpj from socorro.lib.util import Dot...
mpl-2.0
grundprinzip/Impala
tests/comparison/common.py
3
11914
# Copyright (c) 2014 Cloudera, 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 o...
apache-2.0
lahosken/pants
tests/python/pants_test/engine/legacy/test_build_ignore_integration.py
8
4320
# 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 os import tem...
apache-2.0
waytai/django
django/contrib/gis/utils/ogrinspect.py
391
9090
""" This module is for inspecting OGR data sources and generating either models for GeoDjango and/or mapping dictionaries for use with the `LayerMapping` utility. """ from django.contrib.gis.gdal import DataSource from django.contrib.gis.gdal.field import ( OFTDate, OFTDateTime, OFTInteger, OFTInteger64, OFTReal, O...
bsd-3-clause
StephenKing/summerschool-2015-ryu
ryu/tests/unit/lib/test_import_module.py
47
2443
# Copyright (C) 2013 Nippon Telegraph and Telephone Corporation. # Copyright (C) 2013 YAMAMOTO Takashi <yamamoto at valinux co jp> # # 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:...
apache-2.0
atsolakid/edx-platform
openedx/core/djangoapps/user_api/legacy_urls.py
146
1461
""" Defines the URL routes for this app. """ from django.conf import settings from django.conf.urls import include, patterns, url from rest_framework import routers from . import views as user_api_views from .models import UserPreference USER_API_ROUTER = routers.DefaultRouter() USER_API_ROUTER.register(r'users', us...
agpl-3.0
gotostack/iSwift
iswift/azureurls.py
1
2538
# 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
Xero-Hige/LuGus-VHDL
VGASimulator/simulator.py
1
1204
#!/usr/local/bin/python from screen import Screen from vga_controller import VGAController from reader import Reader from translator import Translator from time import sleep import config def clean(): reader.clean() vga_controller.save() def loop(): info = reader.readline() while (info): va...
gpl-3.0
tjth/lotterycoin
qa/rpc-tests/bipdersig.py
66
3130
#!/usr/bin/env python2 # Copyright (c) 2014-2015 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Test the BIP66 changeover logic # from test_framework.test_framework import BitcoinTestFramework fro...
mit
Peratham/tweater
py/nltk/metrics/scores.py
4
7976
# Natural Language Toolkit: Evaluation # # Copyright (C) 2001-2011 NLTK Project # Author: Edward Loper <edloper@gradient.cis.upenn.edu> # Steven Bird <sb@csse.unimelb.edu.au> # URL: <http://www.nltk.org/> # For license information, see LICENSE.TXT import sys import math import random try: from scipy.stat...
gpl-3.0
nii-cloud/dodai-compute
nova/tests/test_quantum.py
3
12317
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 Nicira, 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/LICEN...
apache-2.0
guillaumevincent/rangevoting
commands.py
2
1477
import logging logger = logging.getLogger(__name__) class RangeVoteCommandValidator: def __init__(self, data): self.data = data def is_valid(self): if 'question' not in self.data or 'choices' not in self.data: logger.debug('RangeVoteCommandValidator : question or choices not in r...
mit
bilgili/Voreen
modules/python/ext/python27/modules/sysconfig.py
26
25574
"""Provide access to Python's configuration information. """ import sys import os from os.path import pardir, realpath _INSTALL_SCHEMES = { 'posix_prefix': { 'stdlib': '{base}/lib/python{py_version_short}', 'platstdlib': '{platbase}/lib/python{py_version_short}', 'purelib': '{base}/lib/pyt...
gpl-2.0
JTCunning/sentry
src/sentry/api/endpoints/project_details.py
5
4612
from __future__ import absolute_import from rest_framework import serializers, status from rest_framework.response import Response from sentry.api.base import DocSection from sentry.api.bases.project import ProjectEndpoint from sentry.api.decorators import sudo_required from sentry.api.serializers import serialize fr...
bsd-3-clause
tensorflow/tensorflow
tensorflow/python/framework/tensor_shape_test.py
9
21959
# 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
jklenzing/pysat
pysat/utils/coords.py
2
16721
""" pysat.coords - coordinate transformations for pysat ========================================= pysat.coords contains a number of coordinate-transformation functions used throughout the pysat package. """ import numpy as np import pandas as pds def adjust_cyclic_data(samples, high=2.0*np.pi, low=0.0): """Adju...
bsd-3-clause
philsch/ansible
lib/ansible/modules/cloud/webfaction/webfaction_db.py
63
6442
#!/usr/bin/python # # Create a webfaction database using Ansible and the Webfaction API # # ------------------------------------------ # # (c) Quentin Stafford-Fraser 2015, with contributions gratefully acknowledged from: # * Andy Baker # * Federico Tarantini # # This file is part of Ansible # # Ansible is free...
gpl-3.0
NerdHerd91/flailbot
flailbot.py
1
1879
# FlailBot - Provides on-demand flailing capabilities. # Much of this structure is borrowed from the following example on the TwistedMatrix site. # https://twistedmatrix.com/documents/12.0.0/core/howto/clients.html # twisted imports from twisted.words.protocols import irc from twisted.internet import reactor, protoco...
mit
4doemaster/enigma2
lib/python/Screens/RdsDisplay.py
18
8347
from enigma import iPlayableService, iRdsDecoder from Screens.Screen import Screen from Components.ActionMap import NumberActionMap from Components.ServiceEventTracker import ServiceEventTracker from Components.Pixmap import Pixmap from Components.Label import Label from Components.Sources.StaticText import StaticText ...
gpl-2.0
idekerlab/graph-services
services/nx_pagerank/service/test/cxmate_pb2.py
5
92271
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: cxmate.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflec...
mit
ssokolow/ventilomatic
control_node/main.py
1
5623
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """Ventilomatic Control Node Program --snip-- Requires: - PySerial Copyright (C) 2014 Stephan Sokolow 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; ...
gpl-2.0
kampanita/pelisalacarta
python/version-mediaserver/platformcode/controllers/jsonserver.py
6
7114
# -*- coding: utf-8 -*- #------------------------------------------------------------ # pelisalacarta # Controlador para RSS # http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/ #------------------------------------------------------------ import sys, os from core import config from core import logger from...
gpl-3.0
eonpatapon/nova
nova/objects/image_meta.py
13
16310
# Copyright 2014 Red Hat, 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 law or agreed to in writing, s...
apache-2.0
jkburges/phantomjs
src/qt/qtwebkit/Tools/BuildSlaveSupport/build.webkit.org-config/wkbuild_unittest.py
116
4793
# Copyright (C) 2010 Apple 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: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
bsd-3-clause
Debian/openjfx
modules/web/src/main/native/Source/JavaScriptCore/inspector/scripts/codegen/objc_generator.py
2
25284
#!/usr/bin/env python # # Copyright (c) 2014, 2016 Apple 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: # 1. Redistributions of source code must retain the above copyright # notice, this ...
gpl-2.0
KenCoder/quarter
lambda/requests/compat.py
1039
1469
# -*- coding: utf-8 -*- """ pythoncompat """ from .packages import chardet import sys # ------- # Pythons # ------- # Syntax sugar. _ver = sys.version_info #: Python 2.x? is_py2 = (_ver[0] == 2) #: Python 3.x? is_py3 = (_ver[0] == 3) try: import simplejson as json except (ImportError, SyntaxError): # si...
epl-1.0
RichardLitt/wyrd-django-dev
django/middleware/locale.py
104
2423
"This is the locale selecting middleware that will look at accept headers" from django.conf import settings from django.core.urlresolvers import (is_valid_path, get_resolver, LocaleRegexURLResolver) from django.http import HttpResponseRedirect from django.utils.cache import patch_...
bsd-3-clause
mp-coder/translate-dev-tools
esprima/parser.py
1
120549
# -*- coding: utf-8 -*- # Copyright JS Foundation and other contributors, https://js.foundation/ # # 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 # ...
mit
TeamEOS/external_chromium_org
components/test/data/autofill/merge/tools/reserialize_profiles_from_query.py
162
1177
#!/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. import sys from autofill_merge_common import SerializeProfiles, ColumnNameToFieldType def main(): """Serializes the output of the ...
bsd-3-clause
bratatidas9/Impala-1
thirdparty/thrift-0.9.0/tutorial/php/runserver.py
117
1121
#!/usr/bin/env python # # 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 # "L...
apache-2.0
lechat/CouchPotato
library/imdb/parser/http/searchCompanyParser.py
67
2911
""" parser.http.searchCompanyParser module (imdb package). This module provides the HTMLSearchCompanyParser class (and the search_company_parser instance), used to parse the results of a search for a given company. E.g., when searching for the name "Columbia Pictures", the parsed page would be: http://akas.imdb.co...
gpl-3.0
tensorflow/graphics
tensorflow_graphics/math/interpolation/__init__.py
1
1116
# Copyright 2020 The TensorFlow 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
apache-2.0
ghchinoy/tensorflow
tensorflow/contrib/rpc/python/ops/rpc_op.py
41
1103
# 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
hoehnp/navit_test
lib/python2.7/site-packages/pip/req/req_uninstall.py
510
6897
from __future__ import absolute_import import logging import os import tempfile from pip.compat import uses_pycache, WINDOWS, cache_from_source from pip.exceptions import UninstallationError from pip.utils import rmtree, ask, is_local, renames, normalize_path from pip.utils.logging import indent_log logger = loggin...
gpl-2.0
hellfyre/StratumsphereStatusBot
jsonserver.py
1
3019
# -*- coding: utf-8 -*- __author__ = 'Matthias Uschok <dev@uschok.de>' import json import BaseHTTPServer import threading from urlparse import parse_qs, urlparse import status callbacks = dict() class JsonHandler(BaseHTTPServer.BaseHTTPRequestHandler): def do_GET(self): print("path:", self.path) ...
apache-2.0
helifu/kudu
src/kudu/scripts/max_skew_estimate.py
4
3087
#!/usr/bin/env python # # 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 # "...
apache-2.0
JeremyAgost/gemrb
gemrb/GUIScripts/bg1/GUICG12.py
3
6688
# GemRB - Infinity Engine Emulator # Copyright (C) 2003 The GemRB Project # # 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 option) any later versi...
gpl-2.0
ashaarunkumar/spark-tk
python/sparktk/frame/ops/multiclass_classification_metrics.py
14
5704
# vim: set encoding=utf-8 # Copyright (c) 2016 Intel Corporation  # # 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 require...
apache-2.0
ajoaoff/django
django/contrib/sessions/base_session.py
348
1623
""" This module allows importing AbstractBaseSession even when django.contrib.sessions is not in INSTALLED_APPS. """ from __future__ import unicode_literals from django.db import models from django.utils.encoding import python_2_unicode_compatible from django.utils.translation import ugettext_lazy as _ class BaseSes...
bsd-3-clause
xtreamerdev/linux-mips
tools/perf/scripts/python/check-perf-trace.py
948
2501
# perf trace event handlers, generated by perf trace -g python # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # This script tests basic functionality such as flag and symbol # strings, common_xxx() calls back into perf, begin, end, unhandled # events, etc. Ba...
gpl-2.0
gnmiller/craig-bot
craig-bot/lib/python3.6/site-packages/uritemplate/api.py
36
1911
""" uritemplate.api =============== This module contains the very simple API provided by uritemplate. """ from uritemplate.template import URITemplate def expand(uri, var_dict=None, **kwargs): """Expand the template with the given parameters. :param str uri: The templated URI to expand :param dict var...
mit
audiohacked/pyBusPirate
src/buspirate/rawwire.py
1
8032
# Created by Sean Nelson on 2018-08-19. # Copyright 2018 Sean Nelson <audiohacked@gmail.com> # # This file is part of pyBusPirate. # # pyBusPirate is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version...
gpl-2.0
GuillaumeGomez/servo
tests/wpt/css-tests/tools/pytest/_pytest/skipping.py
168
12742
""" support for skip/xfail functions and markers. """ import os import sys import traceback import py import pytest from _pytest.mark import MarkInfo, MarkDecorator def pytest_addoption(parser): group = parser.getgroup("general") group.addoption('--runxfail', action="store_true", dest="runxfail", ...
mpl-2.0
petrjasek/superdesk-core
superdesk/data_updates/00008_20180404-165521_archive.py
2
1636
# -*- coding: utf-8; -*- # This file is part of Superdesk. # For the full copyright and license information, please see the # AUTHORS and LICENSE files distributed with this source code, or # at https://www.sourcefabric.org/superdesk/license # # Author : Jérôme # Creation: 2018-04-04 16:55 from superdesk.commands.dat...
agpl-3.0
vuntz/glance
glance/db/sqlalchemy/migrate_repo/versions/010_default_update_at.py
19
2424
# 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
xieta/mincoin
qa/rpc-tests/test_framework/netutil.py
98
5030
#!/usr/bin/env python3 # Copyright (c) 2014-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # Linux network utilities import sys import socket import fcntl import struct import array import os fro...
mit
syhost/android_kernel_zte_nx503a
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
zpao/buck
third-party/py/pathlib/test_pathlib.py
57
77535
import collections import io import os import errno import pathlib import pickle import shutil import socket import stat import sys import tempfile import unittest from contextlib import contextmanager if sys.version_info < (2, 7): try: import unittest2 as unittest except ImportError: raise Imp...
apache-2.0
k1-hedayati/snippets
get_cards_from_flashcardmachine.py
1
1090
from glob import glob import sys from urllib.request import urlopen from pyquery import PyQuery as pq def extract(page_url): extracted_cards = [] page = pq(url=page_url, opener=lambda url, **kw: urlopen(url).read()) front_list = page('div#cards>div>table>tr>td:even') back_list = page('d...
gpl-2.0
malkoto1/just_cook
SQLAlchemy-1.0.4/test/orm/test_validators.py
28
9951
from test.orm import _fixtures from sqlalchemy.testing import fixtures, assert_raises, eq_, ne_ from sqlalchemy.orm import mapper, Session, validates, relationship from sqlalchemy.testing.mock import Mock, call class ValidatorTest(_fixtures.FixtureTest): def test_scalar(self): users = self.tables.users ...
gpl-2.0
overtherain/scriptfile
software/googleAppEngine/lib/django_1_2/tests/regressiontests/test_utils/tests.py
66
2307
r""" # Some checks of the doctest output normalizer. # Standard doctests do fairly >>> from django.utils import simplejson >>> from django.utils.xmlutils import SimplerXMLGenerator >>> from StringIO import StringIO >>> def produce_long(): ... return 42L >>> def produce_int(): ... return 42 >>> def produce_j...
mit
18padx08/PPTex
PPTexEnv_x86_64/lib/python2.7/site-packages/scipy/signal/spectral.py
9
13829
"""Tools for spectral analysis. """ from __future__ import division, print_function, absolute_import import numpy as np from scipy import fftpack from . import signaltools from .windows import get_window from ._spectral import lombscargle import warnings from scipy.lib.six import string_types __all__ = ['periodogra...
mit
cuilishen/cuilishenMissionPlanner
Lib/lib2to3/fixes/fix_itertools.py
148
1549
""" Fixer for itertools.(imap|ifilter|izip) --> (map|filter|zip) and itertools.ifilterfalse --> itertools.filterfalse (bugs 2360-2363) imports from itertools are fixed in fix_itertools_import.py If itertools is imported as something else (ie: import itertools as it; it.izip(spam, eggs)) method calls w...
gpl-3.0
dragondjf/musicplayer
gui/mainwindow/mainwindow.py
1
3267
#!/usr/bin/python # -*- coding: utf-8 -*- from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtWidgets import * from gui.menus import SettingsMenu from gui.functionpages import MainTitleBar, MusicLeftBar, MusicBottomBar, MusicStackPage from gui.dwidgets import DMainWindow, DMainFrame from gui.utils impo...
gpl-2.0
jinankjain/linux
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
tadebayo/myedge
myvenv/Lib/site-packages/django/db/backends/postgresql/operations.py
15
11062
from __future__ import unicode_literals from psycopg2.extras import Inet from django.conf import settings from django.db.backends.base.operations import BaseDatabaseOperations class DatabaseOperations(BaseDatabaseOperations): def unification_cast_sql(self, output_field): internal_type = output_field.get...
mit
hfinucane/ansible
lib/ansible/plugins/lookup/nested.py
157
2100
# (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 the License, or # (at your option) any lat...
gpl-3.0
cowlicks/numpy
numpy/random/setup.py
58
2425
from __future__ import division, print_function from os.path import join, split, dirname import os import sys from distutils.dep_util import newer from distutils.msvccompiler import get_build_version as get_msvc_build_version def needs_mingw_ftime_workaround(): # We need the mingw workaround for _ftime if the msv...
bsd-3-clause
hainm/statsmodels
statsmodels/tsa/vector_ar/var_model.py
25
50516
""" Vector Autoregression (VAR) processes References ---------- Lutkepohl (2005) New Introduction to Multiple Time Series Analysis """ from __future__ import division, print_function from statsmodels.compat.python import (range, lrange, string_types, StringIO, iteritems, cStringIO) fr...
bsd-3-clause
lanniaoershi/android_kernel_oneplus_msm8994
scripts/tracing/draw_functrace.py
14676
3560
#!/usr/bin/python """ Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com> Licensed under the terms of the GNU GPL License version 2 This script parses a trace provided by the function tracer in kernel/trace/trace_functions.c The resulted trace is processed into a tree to produce a more human view of the call ...
gpl-2.0
delectable/DIGITS
digits/test_status.py
5
2316
# Copyright (c) 2015, NVIDIA CORPORATION. All rights reserved. from gevent import monkey; monkey.patch_all() from nose.tools import assert_raises import mock import pickle import tempfile from status import Status from config import config_value from job import Job class TestScheduler(): def test_run_too_soon(...
bsd-3-clause
WeblateOrg/weblate
weblate/formats/helpers.py
2
1365
# # Copyright © 2012 - 2021 Michal Čihař <michal@cihar.com> # # This file is part of Weblate <https://weblate.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 3 of the Lice...
gpl-3.0
bobobox/ansible
lib/ansible/modules/network/nxos/nxos_vlan.py
7
13865
#!/usr/bin/python # # 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 distribut...
gpl-3.0