repo_name
stringlengths
5
100
path
stringlengths
4
294
copies
stringclasses
990 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
thunderboltsid/grpc
examples/python/helloworld/greeter_server.py
14
2232
# Copyright 2015, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
bsd-3-clause
dlam26/django-filer
filer/migrations/0005_auto__add_field_file_sha1__chg_field_file_file.py
68
10525
# encoding: 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 field 'File.sha1' db.add_column('filer_file', 'sha1', self.gf('django.db.models.fields.CharField'...
bsd-3-clause
danidomi/fofix
src/midi/MidiOutStream.py
12
8801
# -*- coding: ISO-8859-1 -*- class MidiOutStream: """ MidiOutstream is Basically an eventhandler. It is the most central class in the Midi library. You use it both for writing events to an output stream, and as an event handler for an input stream. This makes it extremely easy to take input fro...
gpl-2.0
SpiriLiao/linux
tools/perf/scripts/python/event_analyzing_sample.py
4719
7393
# event_analyzing_sample.py: general event handler in python # # Current perf report is already very powerful with the annotation integrated, # and this script is not trying to be as powerful as perf report, but # providing end user/developer a flexible way to analyze the events other # than trace points. # # The 2 dat...
gpl-2.0
elainenaomi/sciwonc-dataflow-examples
dissertation2017/Experiment 1A/instances/5_workflow_full_10files_primary_1sh_1rs_noannot_with_proj_3s/init_0/DataStoreInit.py
3
2598
#!/usr/bin/env python from pymongo import MongoClient import pymongo HOST = "172.31.28.140:27017" c = MongoClient('mongodb://'+HOST) dbname = "google" task = "task_events" ginfo = "general_info" statscpumemory = "stats_cpumemory" maxmincpumemory = "maxmin_cpumemory" mediancpu = "median_cpu" medianmemory = "median_...
gpl-3.0
dreamsxin/kbengine
kbe/src/lib/python/Lib/encodings/iso8859_3.py
272
13089
""" Python Character Mapping Codec iso8859_3 generated from 'MAPPINGS/ISO8859/8859-3.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,errors='...
lgpl-3.0
RuiNascimento/krepo
script.areswizard/pyshorteners/shorteners/readability.py
2
1682
# encoding: utf-8 """ Readbility url shortner api implementation Located at: https://readability.com/developers/api/shortener Doesnt' need anything from the app """ from .base import BaseShortener from ..exceptions import ShorteningErrorException, ExpandingErrorException class Readability(BaseShortener): api_url ...
gpl-2.0
shenlong3030/asv-django-guestbook
django/contrib/gis/db/backends/postgis/adapter.py
12
1200
""" This object provides quoting for GEOS geometries into PostgreSQL/PostGIS. """ from psycopg2 import Binary from psycopg2.extensions import ISQLQuote class PostGISAdapter(object): def __init__(self, geom): "Initializes on the geometry." # Getting the WKB (in string form, to allow easy...
bsd-3-clause
pooler/electrum-ltc
electrum_ltc/gui/kivy/uix/dialogs/lightning_tx_dialog.py
1
4129
import copy from datetime import datetime from decimal import Decimal from typing import NamedTuple, Callable, TYPE_CHECKING from kivy.app import App from kivy.factory import Factory from kivy.properties import ObjectProperty from kivy.lang import Builder from kivy.clock import Clock from kivy.uix.label import Label f...
mit
hbhzwj/imalse
tools/ns-allinone-3.14.1/ns-3.14.1/bindings/python/ns3modulescan-modular.py
186
11846
#! /usr/bin/env python import sys import os.path import pybindgen.settings from pybindgen.gccxmlparser import ModuleParser, PygenClassifier, PygenSection, WrapperWarning, find_declaration_from_name from pybindgen.typehandlers.codesink import FileCodeSink from pygccxml.declarations import templates from pygccxml.decla...
gpl-3.0
dipakvwarade/pychef
chef/base.py
4
4353
import six import collections import pkg_resources from chef.api import ChefAPI from chef.exceptions import * class ChefQuery(collections.Mapping): def __init__(self, obj_class, names, api): self.obj_class = obj_class self.names = names self.api = api def __len__(self): retur...
apache-2.0
webmaster442/prog-elektonikak
Kodok/Vegyes/02/functions.py
1
2618
#------------------------------------------------------------------------------ # Functions module # Various functions #------------------------------------------------------------------------------ import subprocess import serial #------------------------------------------------------------------------------ # Blueto...
bsd-2-clause
CatsAndDogsbvba/odoo
addons/account_test/account_test.py
342
2169
# -*- encoding: utf-8 -*- ############################################################################## # # Copyright (c) 2005-2006 TINY SPRL. (http://tiny.be) All Rights Reserved. # # $Id: product_expiry.py 4304 2006-10-25 09:54:51Z ged $ # # WARNING: This program as such is intended to be used by professional # prog...
agpl-3.0
taligen/taligen
taligen/TaskListTemplateSetItem.py
1
1175
#!/usr/bin/python # # Copyright (C) 2017 and later, taligen project. # All rights reserved. License: see package. # from taligen.SourceLocationStack import SourceLocationStack from taligen.SubstitutionException import SubstitutionException from taligen.SyntaxException import SyntaxException from taligen.TaskListTempla...
gpl-3.0
thejordan95/Groovebot2
plugins/factoids.py
1
4431
# Written by Scaevolus 2010 from util import hook, http, text, execute import string import re re_lineends = re.compile(r'[\r\n]*') # some simple "shortcodes" for formatting purposes shortcodes = { '[b]': '\x02', '[/b]': '\x02', '[u]': '\x1F', '[/u]': '\x1F', '[i]': '\x16', '[/i]': '\x16'} d...
gpl-3.0
CloudBoltSoftware/cloudbolt-forge
ui_extensions/scheduled_snapshots/views.py
1
13990
import croniter import datetime import os from django.conf import settings from django.contrib import messages from django.http import HttpResponseRedirect from django.urls import reverse from django.shortcuts import render, get_object_or_404 from django.utils.html import format_html from django.utils.safestring impor...
apache-2.0
sandeepgupta2k4/tensorflow
tensorflow/contrib/distributions/python/ops/onehot_categorical.py
78
9734
# 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
b-daniels/apitools
apitools/base/py/credentials_lib.py
5
22218
#!/usr/bin/env python """Common credentials classes and constructors.""" from __future__ import print_function import datetime import json import os import threading import httplib2 import oauth2client import oauth2client.client import oauth2client.gce import oauth2client.locked_file import oauth2client.multistore_fi...
apache-2.0
381426068/MissionPlanner
Lib/unittest/main.py
53
9256
"""Unittest main program""" import sys import os import types from . import loader, runner from .signals import installHandler __unittest = True FAILFAST = " -f, --failfast Stop on first failure\n" CATCHBREAK = " -c, --catch Catch control-C and display results\n" BUFFEROUTPUT = " -b, --...
gpl-3.0
Onidca/Cloudika
util/zotsh/zotsh.py
11
9414
#!/usr/bin/env python2 import sys, os import ConfigParser import requests from requests.auth import HTTPBasicAuth import easywebdav import easywebdav.__version__ as easywebdavversion __version__= "0.0.2" SERVER = None USER = None PASSWD = None VERIFY_SSL=True #########################################...
apache-2.0
dionyziz/rupture
etc/theory/experiments/rupture_performance/plot.py
4
2506
import matplotlib.pyplot as plt from collections import OrderedDict ''' # Divide&conquer adaptive (keeping only the last 2 known chars) on ruptureit, try 1 seconds = OrderedDict([ ('aes128cbc', [0, 11, 8, 5, 6, 6, 11]), # 47 ('aes128gcm', [0, 6, 8, 6, 5, 6, 7]), # 38 ('aes256cbc', [0, 7, 7, 5, 6, 6, 9]),...
mit
prdatur/cgminer
api-example.py
54
1334
#!/usr/bin/env python2.7 # Copyright 2013 Setkeh Mkfr # # 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 License, or (at your option) any later # version. See COPYING fo...
gpl-3.0
Antiun/odoo
addons/l10n_be/__openerp__.py
251
3666
# -*- 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
webmasterraj/FogOrNot
flask/lib/python2.7/site-packages/pandas/io/auth.py
16
3569
from __future__ import print_function # see LICENSES directory for copyright and license import os import sys import logging import httplib2 import apiclient.discovery as gapi import gflags import oauth2client.file as auth_file import oauth2client.client as oauth import oauth2client.tools as tools OOB_CALLBACK_URN = ...
gpl-2.0
googleapis/googleapis-gen
google/ads/googleads/v6/googleads-py/google/ads/googleads/v6/resources/types/carrier_constant.py
1
1887
# -*- coding: utf-8 -*- # 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...
apache-2.0
linglung/ytdl
youtube_dl/extractor/daum.py
52
11802
# coding: utf-8 from __future__ import unicode_literals import re import itertools from .common import InfoExtractor from ..compat import ( compat_parse_qs, compat_urllib_parse_unquote, compat_urllib_parse_urlencode, compat_urlparse, ) from ..utils import ( int_or_none, str_to_int, xpath_...
unlicense
mikewiebe-ansible/ansible
lib/ansible/modules/cloud/cloudstack/cs_firewall.py
13
13770
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright: (c) 2015, 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':...
gpl-3.0
aluedeke/chromedriver
py/selenium/webdriver/chrome/webdriver.py
12
3243
#!/usr/bin/python # # Copyright 2011-2013 Software freedom conservancy # # 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 b...
apache-2.0
deepmind/pycolab
pycolab/examples/research/lp-rnn/sequence_recall.py
1
12956
# Copyright 2018 the pycolab 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 in ...
apache-2.0
raymondxyang/tensorflow
tensorflow/python/kernel_tests/as_string_op_test.py
119
8652
# 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
nmrao/robotframework
src/robot/libraries/Easter.py
23
1222
# 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
TechBK/horizon-dev
openstack_dashboard/dashboards/admin/volumes/volume_types/extras/forms.py
63
2379
# 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 # distributed under t...
apache-2.0
chrishas35/django-travis-ci
django/views/decorators/csrf.py
88
2855
import warnings from django.middleware.csrf import CsrfViewMiddleware, get_token from django.utils.decorators import decorator_from_middleware, available_attrs from functools import wraps csrf_protect = decorator_from_middleware(CsrfViewMiddleware) csrf_protect.__name__ = "csrf_protect" csrf_protect.__doc__ = """ Thi...
bsd-3-clause
robwarm/gpaw-symm
gpaw/hs_operators.py
1
21570
# Copyright (C) 2008 CAMd # Please see the accompanying LICENSE file for further information. from __future__ import division import numpy as np from gpaw.utilities.blas import gemm def reshape(a_x, shape): """Get an ndarray of size shape from a_x buffer.""" return a_x.ravel()[:np.prod(shape)].reshape(shap...
gpl-3.0
davidwboswell/documentation_autoresponse
vendor-local/lib/python/pyquery/test.py
10
14945
#-*- coding:utf-8 -*- # # Copyright (C) 2008 - Olivier Lauzanne <olauzanne@gmail.com> # # Distributed under the BSD license, see LICENSE.txt from lxml import etree import unittest import doctest import socket import sys import os PY3k = sys.version_info >= (3,) if PY3k: from io import StringIO import pyquery ...
mpl-2.0
django-extensions/django-extensions
django_extensions/management/mysql.py
1
1506
# -*- coding: utf-8 -*- import configparser def parse_mysql_cnf(dbinfo): """ Attempt to parse mysql database config file for connection settings. Ideally we would hook into django's code to do this, but read_default_file is handled by the mysql C libs so we have to emulate the behaviour Settings ...
mit
zdary/intellij-community
python/helpers/pydev/build_tools/build_binaries_windows.py
9
3047
r''' Creating the needed environments for creating the pre-compiled distribution on Windows: See: build_tools\pydevd_release_process.txt for building binaries/release process. ''' from __future__ import unicode_literals import os import subprocess import sys from build import BINARY_DIRS, remove_binaries minico...
apache-2.0
WoLpH/CouchPotatoServer
libs/xmpp/features.py
199
8578
## features.py ## ## Copyright (C) 2003-2004 Alexey "Snake" Nezhdanov ## ## 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, or (at your option) ## any later versio...
gpl-3.0
sundeep-co-in/makegoalsdaily
logtoday/migrations/0001_initial.py
1
3501
# -*- coding: utf-8 -*- # Generated by Django 1.11.1 on 2017-06-06 06:39 from __future__ import unicode_literals from django.conf import settings import django.core.validators from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dep...
mit
Christewart/bitcoin
test/functional/p2p_unrequested_blocks.py
10
13944
#!/usr/bin/env python3 # Copyright (c) 2015-2018 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 processing of unrequested blocks. Setup: two nodes, node0+node1, not connected to each other. Nod...
mit
sandeepkoduri/GAE-html-to-pdf
libs/reportlab/lib/PyFontify.py
2
4960
#Copyright ReportLab Europe Ltd. 2000-2017 #see license.txt for license details __version__='3.3.0' __doc__=""" Module to analyze Python source code; for syntax coloring tools. Interface:: tags = fontify(pytext, searchfrom, searchto) - The 'pytext' argument is a string containing Python source code. - The (opt...
mit
nhicher/ansible
lib/ansible/modules/network/junos/junos_netconf.py
55
6248
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, Ansible by Red Hat, inc # 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
zstyblik/infernal-twin
build/pip/build/lib.linux-i686-2.7/pip/_vendor/html5lib/trie/datrie.py
1301
1178
from __future__ import absolute_import, division, unicode_literals from datrie import Trie as DATrie from pip._vendor.six import text_type from ._base import Trie as ABCTrie class Trie(ABCTrie): def __init__(self, data): chars = set() for key in data.keys(): if not isinstance(key, te...
gpl-3.0
Essk/FreeCodeCamp-Projects
node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/easy_xml.py
1558
4945
# Copyright (c) 2011 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import re import os def XmlToString(content, encoding='utf-8', pretty=False): """ Writes the XML content to disk, touching the file only if it has changed. ...
mit
kenshay/ImageScript
ProgramData/SystemFiles/Python/Lib/idlelib/configHelpSourceEdit.py
35
6626
"Dialog to specify or edit the parameters for a user configured help source." import os import sys from Tkinter import * import tkMessageBox import tkFileDialog class GetHelpSourceDialog(Toplevel): def __init__(self, parent, title, menuItem='', filePath='', _htest=False): """Get menu entry and url/ local...
gpl-3.0
jtg-gg/blink
Tools/Scripts/webkitpy/tool/commands/rebaselineserver.py
44
4641
# Copyright (c) 2010 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the ...
bsd-3-clause
brennie/reviewboard
reviewboard/site/models.py
5
4912
# # models.py -- Models for the "reviewboard.site" app. # # Copyright (c) 2010 David Trowbridge # # 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 lim...
mit
fast-project/fast-lib
vendor/yaml-cpp/test/gmock-1.7.0/gtest/test/gtest_uninitialized_test.py
2901
2480
#!/usr/bin/env python # # Copyright 2008, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list...
lgpl-3.0
Venturi/cms
env/lib/python2.7/site-packages/django/conf/locale/de_CH/formats.py
115
1445
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date from __future__ import unicode_literals DATE_FORMAT = 'j. F Y' TIME_FORMAT = 'H:i' DATE...
gpl-2.0
ageazrael/godot
doc/tools/makemd.py
22
9109
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import xml.etree.ElementTree as ET input_list = [] for arg in sys.argv[1:]: input_list.append(arg) if len(input_list) < 1: print 'usage: makemd.py <classes.xml>' sys.exit(0) def validate_tag(elem, tag): if elem.tag != tag: print "Tag...
mit
danlangridge/galah
galah/web/views/_login.py
1
5970
# Copyright 2012-2013 John Sullivan # Copyright 2012-2013 Other contributers as noted in the CONTRIBUTERS file # # This file is part of Galah. # # Galah is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, e...
agpl-3.0
peerster/CouchPotatoServer
libs/html5lib/treebuilders/__init__.py
1730
3405
"""A collection of modules for building different kinds of tree from HTML documents. To create a treebuilder for a new type of tree, you need to do implement several things: 1) A set of classes for various types of elements: Document, Doctype, Comment, Element. These must implement the interface of _base.treebuilders...
gpl-3.0
migonzalvar/youtube-dl
youtube_dl/extractor/flickr.py
98
2832
from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import compat_urllib_request from ..utils import ( ExtractorError, find_xpath_attr, ) class FlickrIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.|secure\.)?flickr\.com/photos/(?P<uploader_id>[\w\-_@]+)/...
unlicense
takaaptech/sky_engine
mojo/tools/check_mojom_golden_files.py
10
3768
#!/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 os.path import sys from filecmp import dircmp from shutil import rmtree from tempfile import mkdtemp from mopy.p...
bsd-3-clause
bigdataelephants/scikit-learn
sklearn/feature_selection/tests/test_base.py
170
3666
import numpy as np from scipy import sparse as sp from nose.tools import assert_raises, assert_equal from numpy.testing import assert_array_equal from sklearn.base import BaseEstimator from sklearn.feature_selection.base import SelectorMixin from sklearn.utils import check_array class StepSelector(SelectorMixin, Ba...
bsd-3-clause
all-of-us/raw-data-repository
tests/helpers/spec_participant_mixin.py
1
4482
# # This file is subject to the terms and conditions defined in the # file 'LICENSE', which is part of this source code package. # from rdr_service.data_gen.generators.participant import ParticipantGen from rdr_service.data_gen.generators.hpo import HPOGen class SpecParticipantMixin: """ Unittest structure fo...
bsd-3-clause
sylarcp/anita
venv/lib/python2.7/site-packages/werkzeug/contrib/lint.py
295
12282
# -*- coding: utf-8 -*- """ werkzeug.contrib.lint ~~~~~~~~~~~~~~~~~~~~~ .. versionadded:: 0.5 This module provides a middleware that performs sanity checks of the WSGI application. It checks that :pep:`333` is properly implemented and warns on some common HTTP errors such as non-empty respons...
mit
homeworkprod/byceps
byceps/services/shop/order/actions/create_tickets.py
1
1490
""" byceps.services.shop.order.actions.create_tickets ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :Copyright: 2006-2019 Jochen Kupperschmidt :License: Modified BSD, see LICENSE for details. """ from typing import Sequence from ....ticketing.models.ticket import Ticket from ....ticketing import ticket_creation_...
bsd-3-clause
2013Commons/HUE-SHARK
desktop/core/ext-py/Pygments-1.3.1/pygments/lexers/other.py
54
107650
# -*- coding: utf-8 -*- """ pygments.lexers.other ~~~~~~~~~~~~~~~~~~~~~ Lexers for other languages. :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import Lexer, RegexLexer, include, bygroups, using, \ ...
apache-2.0
bonitadecker77/python-for-android
python3-alpha/python3-src/Lib/test/test_dynamic.py
173
4479
# Test the most dynamic corner cases of Python's runtime semantics. import builtins import contextlib import unittest from test.support import run_unittest, swap_item, swap_attr class RebindBuiltinsTests(unittest.TestCase): """Test all the ways that we can change/shadow globals/builtins.""" def configure_...
apache-2.0
AndrewSmart/audacity
lib-src/lv2/serd/waflib/Tools/suncc.py
134
1378
#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file import os from waflib import Utils from waflib.Tools import ccroot,ar from waflib.Configure import conf @conf def find_scc(conf): v=conf.env cc=None if v['CC']:cc=v['CC'] ...
gpl-2.0
Juraci/tempest
tempest/services/compute/json/tenant_usages_client.py
9
1665
# Copyright 2013 NEC Corporation # 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 ...
apache-2.0
hayj/WorkspaceManager
workspacemanager/_trash/venv.py
1
1272
# coding: utf-8 from workspacemanager.utils import * import time import sh def generateVenv(theProjectDirectory=None): # Get args: argv = argvOptionsToDict() if argv is None and theProjectDirectory is None: print("Please check the readme for the command usage.") exit() # Get all ...
mit
prutseltje/ansible
lib/ansible/modules/cloud/amazon/aws_batch_job_definition.py
40
16337
#!/usr/bin/python # Copyright (c) 2017 Jon Meran <jonathan.meran@sonos.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} DOCUMENTAT...
gpl-3.0
tquilian/exelearningTest
twisted/test/test_logfile.py
19
6844
# Copyright (c) 2001-2004 Twisted Matrix Laboratories. # See LICENSE for details. from twisted.trial import unittest # system imports import os, shutil, time # twisted imports from twisted.python import logfile class LogFileTestCase(unittest.TestCase): """Test the rotating log file.""" def setUp(sel...
gpl-2.0
Grirrane/odoo
addons/l10n_uy/__openerp__.py
7
1740
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (c) 2011 Openerp.uy <openerp.uy@lists.launchpad.net> # Proyecto de Localización de OperERP para Uruguay # $Id$ # # This program i...
agpl-3.0
afloren/nipype
nipype/interfaces/ants/tests/test_auto_WarpImageMultiTransform.py
9
1850
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT from nipype.testing import assert_equal from nipype.interfaces.ants.resampling import WarpImageMultiTransform def test_WarpImageMultiTransform_inputs(): input_map = dict(args=dict(argstr='%s', ), dimension=dict(argstr='%d', position=1, usedefaul...
bsd-3-clause
theoryno3/gensim
gensim/test/test_word2vec.py
3
13591
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2010 Radim Rehurek <radimrehurek@seznam.cz> # Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html """ Automated tests for checking transformation algorithms (the models package). """ import logging import unittest import os import t...
gpl-3.0
indashnet/InDashNet.Open.UN2000
android/external/chromium_org/tools/gyp/test/rules/gyptest-default.py
226
1431
#!/usr/bin/env python # Copyright (c) 2011 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Verifies simple rules when using an explicit build target of 'all'. """ import TestGyp test = TestGyp.TestGyp() test.run_gyp('actions...
apache-2.0
Royal-Society-of-New-Zealand/NZ-ORCID-Hub
orcid_api_v3/models/funding_title_v30_rc2.py
1
4181
# coding: utf-8 """ ORCID Member No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 OpenAPI spec version: Latest Generated by: https://github.com/swagger-api/swagger-codegen.git """ import pprint import re # noqa: F401 import si...
mit
mgronhol/pouring-rain
mw-http.py
1
2700
#!/usr/bin/env python from MurkyWaters import MurkyWaters import time, json, sys import BaseHTTPServer import os import zlib def save_file( config, resid, data ): path = os.path.join( config['data-dir'], "%x"%resid ) with open( path, 'wb' ) as handle: handle.write( zlib.compress( data ) ) murky = None file...
bsd-3-clause
x303597316/hue
desktop/core/ext-py/tablib-0.10.0/tablib/packages/odf/table.py
96
9406
# -*- 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
Distrotech/bzr
tools/win32/bzr-win32-bdist-postinstall.py
2
4758
# (c) Canonical Ltd, 2006 # written by Alexander Belchenko for bzr project # # This script will be executed after installation of bzrlib package # and before installer exits. # All printed data will appear on the last screen of installation # procedure. # The main goal of this script is to create special batch file # l...
gpl-2.0
cchristelis/inasafe
safe/common/test/test_resource_parameter.py
10
1722
# coding=utf-8 """InaSAFE Disaster risk assessment tool developed by AusAid - **Test class for resource_parameter.py.** Contact : ole.moller.nielsen@gmail.com .. 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...
gpl-3.0
WillemMali/kops
vendor/k8s.io/kubernetes/examples/cluster-dns/images/frontend/client.py
504
1207
#!/usr/bin/env python # Copyright 2015 The Kubernetes 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 appli...
apache-2.0
damoti/shipmaster
shipmaster/plugins/graph/graph.py
1
1912
from shipmaster.core.plugins import Plugin, Platform class GraphPlugin(Plugin): @classmethod def should_load(cls, platform): return platform == Platform.cli @classmethod def contribute_to_argparse(cls, parser, commands): graph = parser.add_parser('graph', help="Show the graph.") ...
bsd-3-clause
vvuk/angle
src/commit_id.py
32
1052
import subprocess as sp import sys import os # Usage: commit_id.py check <angle_dir> (checks if git is present) # Usage: commit_id.py gen <angle_dir> <file_to_write> (generates commit id) def grab_output(command, cwd): return sp.Popen(command, stdout=sp.PIPE, shell=True, cwd=cwd).communicate()[0].strip() operati...
bsd-3-clause
cgar/servo
tests/wpt/css-tests/tools/html5lib/html5lib/trie/datrie.py
785
1166
from __future__ import absolute_import, division, unicode_literals from datrie import Trie as DATrie from six import text_type from ._base import Trie as ABCTrie class Trie(ABCTrie): def __init__(self, data): chars = set() for key in data.keys(): if not isinstance(key, text_type): ...
mpl-2.0
critzo/operator
tools/fetch.py
6
9355
#!/usr/bin/env python import csv import sys import os import vxargs #from monitor import parser as parsermodule #from monitor import common #from automate import * import csv from glob import glob import os import time def usage(): return """ fetch.py -- run a short bash script across many machines. Th...
apache-2.0
spacy-io/spaCy
spacy/tests/vocab_vectors/test_lookups.py
2
4651
import pytest from spacy.lookups import Lookups, Table from spacy.strings import get_string_id from spacy.vocab import Vocab from ..util import make_tempdir def test_lookups_api(): table_name = "test" data = {"foo": "bar", "hello": "world"} lookups = Lookups() lookups.add_table(table_name, data) ...
mit
ping/youtube-dl
youtube_dl/extractor/xvideos.py
4
3639
from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import compat_urllib_parse_unquote from ..utils import ( clean_html, determine_ext, ExtractorError, int_or_none, parse_duration, ) class XVideosIE(InfoExtractor): _VALID_URL = r'''(?x) ...
unlicense
Netuitive/Diamond
src/collectors/memory_cgroup/memory_cgroup.py
21
3634
# coding=utf-8 """ The MemoryCgroupCollector collects memory metric for cgroups Example config: ``` memory_path=/sys/fs/cgroup/memory/ skip=group\d+,mygroup\d\d enabled=True ``` memory_path -- path to CGroups memory stat skip -- comma-separated list of regexps, which paths should we skip Stats that we are interest...
mit
beni55/gunicorn
examples/frameworks/pylonstest/pylonstest/config/environment.py
29
1502
"""Pylons environment configuration""" import os from mako.lookup import TemplateLookup from pylons import config from pylons.error import handle_mako_error import pylonstest.lib.app_globals as app_globals import pylonstest.lib.helpers from pylonstest.config.routing import make_map def load_environment(global_conf, ...
mit
WhireCrow/openwrt-mt7620
staging_dir/host/lib/scons-2.1.0/SCons/Tool/c++.py
21
3388
"""SCons.Tool.c++ Tool-specific initialization for generic Posix C++ compilers. 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, 20...
gpl-2.0
WhireCrow/openwrt-mt7620
staging_dir/host/lib/scons-2.1.0/SCons/Platform/sunos.py
21
1941
"""engine.SCons.Platform.sunos Platform-specific initialization for Sun systems. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Platform.Platform() selection method. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009...
gpl-2.0
jjx02230808/project0223
doc/sphinxext/numpy_ext/numpydoc.py
413
6182
""" ======== numpydoc ======== Sphinx extension that handles docstrings in the Numpy standard format. [1] It will: - Convert Parameters etc. sections to field lists. - Convert See Also section to a See also entry. - Renumber references. - Extract the signature from the docstring, if it can't be determined otherwis...
bsd-3-clause
duyetdev/islab-portfolio-by-ghost
node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/pygments/unistring.py
240
404696
# -*- coding: utf-8 -*- """ pygments.unistring ~~~~~~~~~~~~~~~~~~ Strings of all Unicode characters of a certain category. Used for matching in Unicode-aware languages. Run to regenerate. Inspired by chartypes_create.py from the MoinMoin project. :copyright: Copyright 2006-2013 by the Pygment...
mit
gjvis/splinter
tests/fake_django/settings.py
7
1975
""" Django settings for fake_django project. For more information on this file, see https://docs.djangoproject.com/en/1.6/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.6/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ......
bsd-3-clause
CredoReference/edx-platform
openedx/core/djangoapps/embargo/middleware.py
9
4989
"""Middleware for embargoing site and courses. IMPORTANT NOTE: This code WILL NOT WORK if you have a misconfigured proxy server. If you are configuring embargo functionality, or if you are experiencing mysterious problems with embargoing, please check that your reverse proxy is setting any of the well known client IP...
agpl-3.0
nikesh-mahalka/cinder
cinder/tests/unit/scheduler/test_filter_scheduler.py
10
19494
# 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
shannpersand/cooper-type
_resources/FDK Adobe/Tools/SharedData/FDKScripts/plistlib.py
2
15742
"""plistlib.py -- a tool to generate and parse MacOSX .plist files. The PropertList (.plist) file format is a simple XML pickle supporting basic object types, like dictionaries, lists, numbers and strings. Usually the top level object is a dictionary. To write out a plist file, use the writePlist(rootObject, pathOrFi...
cc0-1.0
damonkohler/sl4a
python/src/Lib/plat-mac/lib-scriptpackages/Netscape/WorldWideWeb_suite.py
73
16106
"""Suite WorldWideWeb suite, as defined in Spyglass spec.: Level 1, version 1 Generated from /Volumes/Sap/Applications (Mac OS 9)/Netscape Communicator\xe2\x84\xa2 Folder/Netscape Communicator\xe2\x84\xa2 AETE/AEUT resource version 1/0, language 0, script 0 """ import aetools import MacOS _code = 'WWW!' class World...
apache-2.0
Sodki/ansible
contrib/inventory/cloudstack.py
119
9137
#!/usr/bin/env python # -*- coding: utf-8 -*- # # (c) 2015, René Moser <mail@renemoser.net> # # 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
mancoast/CPythonPyc_test
cpython/222_regex_tests.py
136
9081
# Regex test suite and benchmark suite v1.5a2 # Due to the use of r"aw" strings, this file will # only work with Python 1.5 or higher. # The 3 possible outcomes for each pattern [SUCCEED, FAIL, SYNTAX_ERROR] = range(3) # Benchmark suite (needs expansion) # # The benchmark suite does not test correctness, just speed. ...
gpl-3.0
jlark/azure-sdk-for-python
tests/test_managementcertificatemanagementservice.py
5
6981
#------------------------------------------------------------------------- # Copyright (c) Microsoft. 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.apa...
apache-2.0
piannucci/blurt
blurt_py_80211/streaming/blurt/phy/crc.py
1
1037
#!/usr/bin/env python import numpy as np from . import kernels class CRC: def __init__(self, M, G, crc_pass, L=16): self.M = M self.L = L self.crc_pass = crc_pass lut = np.arange(1<<L, dtype=np.uint64) << M for i in range(47,31,-1): # uh... lut ^= (G << (i-M)) * ...
mit
Senseg/Py4A
python-build/python-libs/gdata/src/gdata/blogger/client.py
135
5763
#!/usr/bin/env python # # Copyright (C) 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
tellapart/commandr
commandr/commandr.py
1
24821
# Copyright 2013 TellApart, 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 writi...
apache-2.0
MSusik/invenio
invenio/legacy/bibsched/bibtask_config.py
13
4735
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2008, 2009, 2010, 2011, 2012 CERN. ## ## Invenio 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 ## Licens...
gpl-2.0
endolith/scipy
scipy/optimize/tests/test_slsqp.py
12
23194
""" Unit test for SLSQP optimization. """ from numpy.testing import (assert_, assert_array_almost_equal, assert_allclose, assert_equal) from pytest import raises as assert_raises import pytest import numpy as np from scipy.optimize import fmin_slsqp, minimize, Bounds, NonlinearConstraint c...
bsd-3-clause