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
cedi4155476/QGIS
scripts/context_help_id.py
48
2262
#!/usr/bin/python """ /*************************************************************************** context_help_id.py ------------------- begin : 2009-11-16 copyright : (C) 2009 by Gary E.Sherman email : gs...
gpl-2.0
QianBIG/odoo
addons/account_asset/wizard/wizard_asset_compute.py
382
2518
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of t...
agpl-3.0
programming086/livestreamer
src/livestreamer/plugins/filmon.py
33
4578
import re from livestreamer.compat import urlparse from livestreamer.plugin import Plugin from livestreamer.plugin.api import http, validate from livestreamer.stream import HLSStream, RTMPStream CHINFO_URL = "http://www.filmon.com/ajax/getChannelInfo" SWF_URL = "http://www.filmon.com/tv/modules/FilmOnTV/files/flashap...
bsd-2-clause
crwilcox/PTVS
Python/Tests/TestData/VirtualEnv/env/Lib/encodings/unicode_internal.py
103
1241
""" Python 'unicode-internal' Codec Written by Marc-Andre Lemburg (mal@lemburg.com). (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. """ import codecs ### Codec APIs class Codec(codecs.Codec): # Note: Binding these as C functions will result in the class not # converting them to meth...
apache-2.0
nagyistoce/edx-platform
cms/djangoapps/contentstore/management/commands/tests/test_import.py
63
4186
""" Unittests for importing a course via management command """ import os from path import path import shutil import tempfile from django.core.management import call_command from django_comment_common.utils import are_permissions_roles_seeded from xmodule.modulestore.django import modulestore from xmodule.modulestor...
agpl-3.0
anweiss/azure-quickstart-templates
bosh-setup/scripts/setup_env.py
3
4937
#!/usr/bin/env python import json import netaddr import os import random import re import requests import sys from azure.storage.blob import BlobService from azure.storage.table import TableService def prepare_storage(settings): default_storage_account_name = settings["DEFAULT_STORAGE_ACCOUNT_NAME"] storage_a...
mit
Tech-XCorp/ultracold-ions
uci/BendKickUpdater.py
2
6511
# vi: ts=4 sw=4 import pyopencl.array as cl_array import pyopencl as cl import numpy import sys import os import uci.TrapConfiguration as TrapConfiguration import uci.CyclAdvance as CyclAdvance import uci.AxialDampingAdvance as AxialDampingAdvance import uci.AngularDampingAdvance as AngularDampingAdvance import uci.Co...
mit
Silance/classTranscribe
p2fa-vislab-master/text_to_transcript.py
2
2270
# This is a simple script to turn a a text file of lines or paragraphs # into a transcript file that can be used for the forced alignment. # '#' is the comment character in the text files import sys import simplejson as json import os.path from string import punctuation import click import jsonschema def is_word_onl...
mit
yencarnacion/jaikuengine
.google_appengine/lib/django-1.3/django/contrib/gis/gdal/error.py
466
1517
""" This module houses the OGR & SRS Exception objects, and the check_err() routine which checks the status code returned by OGR methods. """ #### OGR & SRS Exceptions #### class GDALException(Exception): pass class OGRException(Exception): pass class SRSException(Exception): pass class OGRIndexError(OGRException, K...
apache-2.0
AkA84/edx-platform
lms/djangoapps/notifier_api/tests.py
115
9872
import itertools import ddt from django.conf import settings from django.test.client import RequestFactory from django.test.utils import override_settings from openedx.core.djangoapps.course_groups.models import CourseUserGroup from django_comment_common.models import Role, Permission from lang_pref import LANGUAGE_K...
agpl-3.0
mcsosa121/cafa
cafaenv/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/poolmanager.py
359
13092
from __future__ import absolute_import import collections import functools import logging try: # Python 3 from urllib.parse import urljoin except ImportError: from urlparse import urljoin from ._collections import RecentlyUsedContainer from .connectionpool import HTTPConnectionPool, HTTPSConnectionPool from ...
mit
JeroenZegers/Nabu-MSSS
nabu/neuralnetworks/loss_computers/ms_loss.py
1
2597
"""@file ms_loss.py contains the MsLoss. Temporary naming of file and class""" import loss_computer import tensorflow as tf class MsLoss(loss_computer.LossComputer): """A loss computer that calculates the loss""" def __call__(self, targets, logits, seq_length): # target is actually only required for it's shape...
mit
ikosenn/cray-cray
fummy.py
1
2626
""" Author: ikosenn This is a program to eliminate stale git branches. It checks last commits and based on the staleness threshold eliminates all stale branches Another CL function is provided to eliminate all available branches. You can also remove all branches that have already been merged ...
mit
nttks/xqueue
queue/views.py
5
1614
from django.contrib.auth import authenticate, login, logout from django.contrib.auth.decorators import login_required from django.contrib.auth.models import User from django.http import HttpResponse from django.views.decorators.csrf import csrf_exempt import json # Xqueue reply format: # JSON-serialized dict: # ...
agpl-3.0
jairglez/intel-iot-refkit
meta-iotqa/lib/oeqa/runtime/connectivity/bluetooth/bluetooth.py
1
11137
import time import os import string from oeqa.utils.helper import shell_cmd_timeout class BTFunction(object): """ @class BTFunction """ log = "" def __init__(self, target): self.target = target # un-block software rfkill lock self.target.run('rfkill unblock all') sel...
mit
AutorestCI/azure-sdk-for-python
azure-mgmt-monitor/azure/mgmt/monitor/operations/action_groups_operations.py
1
19086
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
molly/women-social-reformers-on-wikipedia
gather.py
1
2451
# Copyright (c) 2015–2016 Molly White # # Permission is hereby granted, free of charge, to any person obtaining a copy of this software # and associated documentation files (the "Software"), to deal in the Software without # restriction, including without limitation the rights to use, copy, modify, merge, publish, # di...
mit
alu042/edx-platform
common/lib/xmodule/xmodule/capa_base.py
16
61704
"""Implements basics of Capa, including class CapaModule.""" import cgi import copy import datetime import hashlib import json import logging import os import traceback import struct import sys import re # We don't want to force a dependency on datadog, so make the import conditional try: import dogstats_wrapper a...
agpl-3.0
bhilburn/gnuradio
gr-blocks/python/blocks/qa_tsb_vector_sink_X.py
47
1905
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2014 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...
gpl-3.0
plin1112/pysimm
pysimm/cassandra.py
1
67253
# ****************************************************************************** # pysimm.cassandra module # ****************************************************************************** # # ****************************************************************************** # License # *************************************...
mit
luoyetx/mxnet
tests/python/gpu/test_operator_gpu.py
2
89596
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
apache-2.0
jymannob/CouchPotatoServer
couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/tvplay.py
7
2775
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( ExtractorError, parse_iso8601, qualities, ) class TVPlayIE(InfoExtractor): _VALID_URL = r'http://(?:www\.)?tvplay\.lv/parraides/[^/]+/(?P<id>\d+)' _TESTS = [ { ...
gpl-3.0
stclair/wes-cms
django/utils/unittest/result.py
570
6105
"""Test result object""" import sys import traceback import unittest from StringIO import StringIO from django.utils.unittest import util from django.utils.unittest.compatibility import wraps __unittest = True def failfast(method): @wraps(method) def inner(self, *args, **kw): if getattr(self, 'fail...
bsd-3-clause
Changron/NTHUOJ_web
nthuoj/settings.py
1
4448
#-*- encoding=UTF-8 -*- """ Django settings for nthuoj project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ # Build paths inside the project like this: os.path...
mit
igemsoftware/SYSU-Software2013
project/Python27/Lib/site-packages/pythonwin/pywin/framework/app.py
2
13934
# App.py # Application stuff. # The application is responsible for managing the main frame window. # # We also grab the FileOpen command, to invoke our Python editor " The PythonWin application code. Manages most aspects of MDI, etc " import win32con import win32api import win32ui import sys import string import os fro...
mit
flwh/KK_mt6589_iq451
prebuilts/python/linux-x86/2.7.5/lib/python2.7/lib2to3/refactor.py
199
28068
# Copyright 2006 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Refactoring framework. Used as a main program, this can refactor any number of files and/or recursively descend down directories. Imported as a module, this provides infrastructure to write your own refactoring too...
gpl-2.0
frjaraur/python-deployer
docs/conf.py
2
8446
# -*- coding: utf-8 -*- # # python-deploy-framework documentation build configuration file, created by # sphinx-quickstart on Thu Jun 20 22:12:13 2013. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerat...
bsd-2-clause
Rdbaker/GameCenter
rank/public/forms.py
2
1079
# -*- coding: utf-8 -*- from flask_wtf import Form from wtforms import TextField, PasswordField from wtforms.validators import DataRequired from rank.user.models import User class LoginForm(Form): username = TextField('Username', validators=[DataRequired()]) password = PasswordField('Password', validators=[D...
mit
josschne/BabyWomp
cocos2d/tools/closure-compiler/obfuscate.py
11
4476
#!/usr/bin/python # obfuscate.py # Create Ant buildfile to obfuscate game source code # Copyright (c) 2012 cocos2d-x.org # Author: WangZhe # define global variables context = { "input" : "undefined", "output" : "undefined", "cocos2d" : "undefined", } # begin import sys import os, os.path...
mit
admcrae/tensorflow
tensorflow/contrib/learn/python/learn/tests/dataframe/unary_transform_test.py
62
2527
# 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
mdietrichc2c/OCB
addons/account/report/account_analytic_entries_report.py
306
3879
# -*- 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
chop-dbhi/varify-data-warehouse
vdw/samples/migrations/0008_force_migrate_default_cohort_and_project.py
1
23232
# encoding: utf-8 import datetime from south.db import db from south.v2 import DataMigration from django.db import models from vdw.samples.models import DEFAULT_COHORT_NAME, DEFAULT_PROJECT_NAME class Migration(DataMigration): def forwards(self, orm): "Write your forwards methods here." Project ...
bsd-2-clause
ccomb/OpenUpgrade
openerp/addons/base/ir/ir_ui_view.py
19
50329
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
seanli9jan/tensorflow
tensorflow/python/ops/matmul_benchmark.py
15
5483
# 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
yangwe1/NetEase-MusicBox
src/api.py
13
9571
#!/usr/bin/env python #encoding: UTF-8 ''' 网易云音乐 Api ''' import re import json import requests import hashlib # list去重 def uniq(arr): arr2 = list(set(arr)) arr2.sort(key=arr.index) return arr2 default_timeout = 10 class NetEase: def __init__(self): self.header = { 'Accept': '*...
mit
gpeden/ynab-enhanced
lib/kango-framework-latest/kango/__init__.py
11
2804
import json import logging import sys import os logger = logging.getLogger('kango') def die(message): logger.error(message) sys.exit(1) def is_framework_file(path): include_dirs = ('includes', 'kango', 'kango-ui') if os.path.isfile(path): dir_name = os.path.basename(os.path....
mit
kingtaurus/cs224d
assignment1/q3_word2vec_sol.py
1
7778
import numpy as np import random from q1_softmax_sol import softmax_sol as softmax from q2_gradcheck import gradcheck_naive from q2_sigmoid_sol import sigmoid_sol as sigmoid from q2_sigmoid_sol import sigmoid_grad_sol as sigmoid_grad def normalizeRows_sol(x): """ Row normalization function """ # Implement a...
mit
vivekanand1101/python-fedora
fedora/tg/identity/jsonfasprovider2.py
3
19500
# -*- coding: utf-8 -*- # # Copyright (C) 2007-2011 Red Hat, Inc. # This file is part of python-fedora # # python-fedora 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 Lice...
gpl-2.0
taxpon/sverchok
ui/sv_icons.py
1
1302
import bpy import os import glob import bpy.utils.previews # custom icons dictionary _icon_collection = {} def custom_icon(name): load_custom_icons() # load in case they custom icons not already loaded custom_icons = _icon_collection["main"] default = lambda: None # for no icon with given name will r...
gpl-3.0
gylian/Sick-Beard
lib/beets/vfs.py
17
1747
# This file is part of beets. # Copyright 2013, Adrian Sampson. # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, ...
gpl-3.0
geekboxzone/lollipop_external_chromium_org
third_party/bintrees/bintrees/avltree.py
156
10803
#!/usr/bin/env python #coding:utf-8 # Author: mozman (python version) # Purpose: avl tree module (Julienne Walker's unbounded none recursive algorithm) # source: http://eternallyconfuzzled.com/tuts/datastructures/jsw_tut_avl.aspx # Created: 01.05.2010 # Copyright (c) 2010-2013 by Manfred Moitzi # License: MIT License ...
bsd-3-clause
jdber1/opendrop
opendrop/app/common/image_acquisition/__init__.py
2
1445
# Copyright © 2020, Joseph Berry, Rico Tabor (opendrop.dev@gmail.com) # OpenDrop is released under the GNU GPL License. You are free to # modify and distribute the code, but always under the same license # (i.e. you cannot make commercial derivatives). # # If you use this software in your research, please cite the foll...
gpl-3.0
timduru/platform-external-chromium_org
chrome/test/functional/test_utils.py
60
14092
# 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 copy import ctypes import email import logging import os import shutil import smtplib import subprocess import sys import types import pyauto_functio...
bsd-3-clause
virlos/virl-salt
common/salt-minion/files/states.keystone.py
2
22451
# -*- coding: utf-8 -*- ''' Management of Keystone users ============================ :depends: - keystoneclient Python module :configuration: See :py:mod:`salt.modules.keystone` for setup instructions. .. code-block:: yaml Keystone tenants: keystone.tenant_present: - names: - admin ...
gpl-2.0
40223247/test2
static/Brython3.1.1-20150328-091302/Lib/xml/etree/__init__.py
1200
1604
# $Id: __init__.py 3375 2008-02-13 08:05:08Z fredrik $ # elementtree package # -------------------------------------------------------------------- # The ElementTree toolkit is # # Copyright (c) 1999-2008 by Fredrik Lundh # # By obtaining, using, and/or copying this software and/or its # associated documentation, you ...
gpl-3.0
kailIII/emaresa
aeroo/report_aeroo/check_deps.py
15
1946
# -*- encoding: utf-8 -*- ############################################################################## # # Copyright (c) 2009-2011 Alistek Ltd (http://www.alistek.com) All Rights Reserved. # General contacts <info@alistek.com> # # WARNING: This program as such is intended to be used by professional...
agpl-3.0
rzr/synapse
synapse/handlers/presence.py
1
46696
# -*- coding: utf-8 -*- # Copyright 2014, 2015 OpenMarket Ltd # # 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
lokeshjindal15/gem5_transform
src/mem/slicc/ast/ExprStatementAST.py
27
2338
# Copyright (c) 1999-2008 Mark D. Hill and David A. Wood # Copyright (c) 2009 The Hewlett-Packard Development Company # 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 co...
bsd-3-clause
jeremybrodt/mbed
tools/test_db.py
119
5838
""" mbed SDK Copyright (c) 2011-2014 ARM Limited 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 wr...
apache-2.0
xzYue/odoo
addons/crm_claim/__openerp__.py
260
1939
# -*- 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
bitmaintech/p2pool
SOAPpy/SOAPBuilder.py
289
22852
""" ################################################################################ # Copyright (c) 2003, Pfizer # Copyright (c) 2001, Cayce Ullman. # Copyright (c) 2001, Brian Matthews. # # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provid...
gpl-3.0
turbokongen/home-assistant
homeassistant/components/plaato/config_flow.py
2
7438
"""Config flow for Plaato.""" import logging from pyplaato.plaato import PlaatoDeviceType import voluptuous as vol from homeassistant import config_entries from homeassistant.config_entries import ConfigEntry from homeassistant.const import CONF_SCAN_INTERVAL, CONF_TOKEN, CONF_WEBHOOK_ID from homeassistant.core impor...
apache-2.0
BrentDorsey/pipeline
gpu.ml/src/main/python/debug/debug_model_gpu.py
4
1568
from tensorflow.python import debug as tf_debug import tensorflow as tf from tensorflow.python.client import timeline import numpy as np tf.logging.set_verbosity(tf.logging.INFO) x_train = np.random.rand(100000).astype(np.float32) print(x_train) noise = np.random.normal(scale=0.01, size=len(x_train)) y_train = x_t...
apache-2.0
mushtaqak/edx-platform
lms/djangoapps/commerce/tests/test_views.py
1
17521
""" Tests for commerce views. """ import json from uuid import uuid4 from nose.plugins.attrib import attr import ddt from django.conf import settings from django.core.urlresolvers import reverse from django.test import TestCase from django.test.utils import override_settings import mock from xmodule.modulestore.tests...
agpl-3.0
worldbit/worldbit
qa/rpc-tests/test_framework/bignum.py
230
1995
# # # bignum.py # # This file is copied from python-bitcoinlib. # # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # """Bignum routines""" from __future__ import absolute_import, division, print_function, unicode_literals imp...
mit
romeotestuser/glimsol_report
report/billing_statement.py
1
2348
# -*- 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...
gpl-2.0
darkwing/kuma
vendor/packages/pygments/lexers/pawn.py
75
8094
# -*- coding: utf-8 -*- """ pygments.lexers.pawn ~~~~~~~~~~~~~~~~~~~~ Lexers for the Pawn languages. :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.lexer import RegexLexer from pygments.token import Text, Comment, Opera...
mpl-2.0
SCORE42/nodeshot
nodeshot/core/nodes/views.py
2
8422
from django.http import Http404 from django.utils.translation import ugettext_lazy as _ from django.utils.decorators import method_decorator from django.views.decorators.cache import cache_page from django.db.models import Q from rest_framework import permissions, authentication, generics, pagination from nodeshot.co...
gpl-3.0
fw1121/nextflu
augur/src/fitness_model.py
2
10334
import argparse import numpy as np import dendropy from collections import defaultdict from datetime import date from itertools import izip from fitness_predictors import * ymin = 2005 ymax = 2015 min_freq = 0.1 max_freq = 0.9 min_tips = 10 pc=1e-2 regularization = 1e-3 default_predictors = ['lb', 'ep', 'ne_star'] cl...
agpl-3.0
b-carter/numpy
numpy/core/tests/test_multiarray.py
1
260744
from __future__ import division, absolute_import, print_function import collections import tempfile import sys import shutil import warnings import operator import io import itertools import functools import ctypes import os import gc from contextlib import contextmanager if sys.version_info[0] >= 3: import builti...
bsd-3-clause
dorotan/pythontraining
env/Lib/site-packages/pip/_vendor/requests/adapters.py
356
19740
# -*- coding: utf-8 -*- """ requests.adapters ~~~~~~~~~~~~~~~~~ This module contains the transport adapters that Requests uses to define and maintain connections. """ import os.path import socket from .models import Response from .packages.urllib3.poolmanager import PoolManager, proxy_from_url from .packages.urllib...
apache-2.0
akhilaananthram/nupic
nupic/data/stats.py
39
6350
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
agpl-3.0
PepperPD/edx-pepper-platform
common/djangoapps/student/migrations/0001_initial.py
188
8556
# 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 model 'UserProfile' db.create_table('auth_userprofile', ( ('id', self.gf('django.db.models.f...
agpl-3.0
bilke/OpenSG-1.8
SConsLocal/scons-local-0.96.1/SCons/Platform/irix.py
2
1555
"""SCons.Platform.irix Platform-specific initialization for SGI IRIX 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 The SCons Foundation # # Permiss...
lgpl-2.1
dila93/google-app-engine-django
appengine_django/serializer/json.py
40
1647
#!/usr/bin/python2.4 # # Copyright 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 law or...
apache-2.0
gregomni/swift
utils/chex.py
51
1026
#!/usr/bin/env python # Check HEX -- a stupid filter that allows hexadecimal literals to be checked # for in LLVM IR FileCheck tests. It works by replacing occurrences of # strings matching the regex /< (i[0-9]+) \s+ (0x[0-9A-Fa-f]+) >/x with the # decimal literal equivalent that would really appear in printed LLVM IR....
apache-2.0
albertjan/pypyjs
website/js/pypy.js-0.2.0/lib/modules/_collections.py
10
13253
"""High performance data structures """ # # Copied and completed from the sandbox of CPython # (nondist/sandbox/collections/pydeque.py rev 1.1, Raymond Hettinger) # # Note that PyPy also contains a built-in module '_collections' which will hide # this one if compiled in. try: from threading import _get_ident as...
mit
toshywoshy/ansible
test/units/modules/network/nso/nso_module.py
21
3960
# Copyright (c) 2017 Cisco and/or its affiliates. # # 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 v...
gpl-3.0
mrabbah/snmpccgx
flask/lib/python2.7/site-packages/pip/_vendor/requests/auth.py
355
8175
# -*- coding: utf-8 -*- """ requests.auth ~~~~~~~~~~~~~ This module contains the authentication handlers for Requests. """ import os import re import time import hashlib import threading from base64 import b64encode from .compat import urlparse, str from .cookies import extract_cookies_to_jar from .utils import pa...
gpl-3.0
nickgzzjr/simplecoin_multi
simplecoin/models.py
3
35426
import calendar from decimal import Decimal import decimal import logging import cPickle from collections import namedtuple from datetime import datetime, timedelta from flask import current_app from sqlalchemy.schema import CheckConstraint from .model_lib import base from .filters import sig_round from . import db, ...
mit
JamesShaeffer/QGIS
tests/src/python/test_qgsnetworkcontentfetcherregistry.py
45
4925
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsNetworkContentFetcherRegistry .. 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 Software Foundation; either version 2 of the License, or (at your option) any late...
gpl-2.0
lzw120/django
django/contrib/gis/gdal/prototypes/geom.py
91
4762
from ctypes import c_char_p, c_double, c_int, c_void_p, POINTER from django.contrib.gis.gdal.envelope import OGREnvelope from django.contrib.gis.gdal.libgdal import lgdal, GEOJSON from django.contrib.gis.gdal.prototypes.errcheck import check_bool, check_envelope from django.contrib.gis.gdal.prototypes.generation import...
bsd-3-clause
nash-x/hws
neutron/plugins/l2_proxy/agent/clients.py
1
9765
# Copyright 2014, Huawei, 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...
apache-2.0
harlowja/networkx
networkx/algorithms/centrality/current_flow_betweenness.py
42
13430
""" Current-flow betweenness centrality measures. """ # Copyright (C) 2010-2012 by # Aric Hagberg <hagberg@lanl.gov> # Dan Schult <dschult@colgate.edu> # Pieter Swart <swart@lanl.gov> # All rights reserved. # BSD license. import random import networkx as nx from networkx.algorithms.centrality.flow_mat...
bsd-3-clause
codrut3/tensorflow
tensorflow/contrib/learn/python/learn/ops/losses_ops.py
43
3174
# 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
malayaleecoder/servo
tests/wpt/web-platform-tests/tools/pytest/testing/test_genscript.py
194
1689
import pytest import sys @pytest.fixture(scope="module") def standalone(request): return Standalone(request) class Standalone: def __init__(self, request): self.testdir = request.getfuncargvalue("testdir") script = "mypytest" result = self.testdir.runpytest("--genscript=%s" % script) ...
mpl-2.0
yk5/beam
sdks/python/apache_beam/metrics/cells_test.py
18
4137
# # 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
schultetwin/hostap-open
wpa_supplicant/examples/wpas-dbus-new-wps.py
114
2221
#!/usr/bin/python import dbus import sys, os import time import gobject from dbus.mainloop.glib import DBusGMainLoop WPAS_DBUS_SERVICE = "fi.w1.wpa_supplicant1" WPAS_DBUS_INTERFACE = "fi.w1.wpa_supplicant1" WPAS_DBUS_OPATH = "/fi/w1/wpa_supplicant1" WPAS_DBUS_INTERFACES_INTERFACE = "fi.w1.wpa_supplicant1.Interface" ...
gpl-2.0
sibskull/synaptiks
synaptiks/monitors/mouses.py
1
8959
# -*- coding: utf-8 -*- # Copyright (c) 2011, Sebastian Wiesner <lunaryorn@googlemail.com> # 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...
bsd-2-clause
willprice/arduino-sphere-project
scripts/example_direction_finder/temboo/Library/Google/Plus/Activities/List.py
5
6698
# -*- coding: utf-8 -*- ############################################################################### # # List # Returns a list of all activities in the specified collection for a particular user. # # Python versions 2.6, 2.7, 3.x # # Copyright 2014, Temboo Inc. # # Licensed under the Apache License, Version 2.0 (t...
gpl-2.0
jeffreyliu3230/scrapi
scrapi/harvesters/doepages.py
9
1966
from __future__ import unicode_literals from datetime import date, timedelta from lxml import etree from scrapi import requests from scrapi import settings from scrapi.base import XMLHarvester from scrapi.linter import RawDocument from scrapi.util import copy_to_unicode, format_date_with_slashes from scrapi.base.sch...
apache-2.0
qinzuoze/cwm_mtk_recovery_cn_cm10.1
make-overlay.py
20
2898
# Copyright (C) 2011 The Android Open Source Project # # 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 ...
bsd-2-clause
dgrant/eyefiserver2
usr/local/bin/eyefiserver.py
2
37607
#!/usr/bin/env python """ * Copyright (c) 2009, Jeffrey Tchang * Additional *pike * All rights reserved. * * * THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. I...
gpl-3.0
jramos/p2pool
SOAPpy/Server.py
289
27143
from __future__ import nested_scopes """ ################################################################################ # # SOAPpy - Cayce Ullman (cayce@actzero.com) # Brian Matthews (blm@actzero.com) # Gregory Warnes (Gregory.R.Warnes@Pfizer.com) # Christopher Blunck (blunck...
gpl-3.0
snoopycrimecop/openmicroscopy
components/tools/OmeroPy/test/integration/gatewaytest/test_get_objects.py
1
45419
#!/usr/bin/env python # -*- coding: utf-8 -*- """ gateway tests - Testing the gateway.getObject() and deleteObjects() methods Copyright 2013-2015 Glencoe Software, Inc. All rights reserved. Use is subject to license terms supplied in LICENSE.txt pytest fixtures used as defined in conftest.py: - gatewa...
gpl-2.0
chand3040/cloud_that
pavelib/utils/test/bokchoy_utils.py
63
4808
""" Helper functions for bok_choy test tasks """ import sys import os import time import httplib import subprocess from paver.easy import sh from pavelib.utils.envs import Env from pavelib.utils.process import run_background_process try: from pygments.console import colorize except ImportError: colorize = lamb...
agpl-3.0
2ndQuadrant/ansible
lib/ansible/modules/network/onyx/onyx_igmp.py
21
7851
#!/usr/bin/python # # Copyright: 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 ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
gpl-3.0
WA4OSH/Learn_Python
oldLady.py
1
2383
#------------------------------------------------------------------------------- # Name: oldLady.py # Purpose: Demo of program control, loops, branches, etc. # # Author: Konrad Roeder, adapted from the nusery rhyme # There was an Old Lady song from the # Secret History of Nurse...
cc0-1.0
linsalrob/EdwardsLab
patric/parse_gto.py
1
2770
""" Parse a GTO object """ import os import sys import argparse from roblib import bcolors import json def list_keys(gto, verbose=False): """ List the primary keys in the patric file :param gto: the json gto :param verbose: more output :return: """ print("{}".format("\n".join(gto.keys())...
mit
argriffing/cvxpy
cvxpy/problems/kktsolver.py
12
3728
""" Copyright 2013 Steven Diamond This file is part of CVXPY. CVXPY is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. CVXPY is distributed i...
gpl-3.0
AnhellO/DAS_Sistemas
Ago-Dic-2017/Enrique Castillo/Ordinario/test/Lib/site-packages/pip/_vendor/cachecontrol/filewrapper.py
346
2531
from io import BytesIO class CallbackFileWrapper(object): """ Small wrapper around a fp object which will tee everything read into a buffer, and when that file is closed it will execute a callback with the contents of that buffer. All attributes are proxied to the underlying file object. Thi...
mit
deandunbar/bitwave
hackathon_version/venv/lib/python2.7/site-packages/django/utils/tree.py
70
5039
""" A class for storing a tree graph. Primarily used for filter constructs in the ORM. """ import copy class Node(object): """ A single internal node in the tree graph. A Node should be viewed as a connection (the root) with the children being either leaf nodes or other Node instances. """ # ...
mit
lcpt/xc
verif/tests/elements/spring_test_01.py
1
2830
# -*- coding: utf-8 -*- # home made test __author__= "Luis C. Pérez Tato (LCPT) and Ana Ortega (AOO)" __copyright__= "Copyright 2015, LCPT and AOO" __license__= "GPL" __version__= "3.0" __email__= "l.pereztato@gmail.com" K= 1000 # Spring constant l= 100 # Distance between nodes F= 1 # Force magnitude import xc_base ...
gpl-3.0
BenKettlewell/Livestreamer-Command-Line-Generator
livestreamerCLG.py
1
2267
''' Parses crunchyroll URLs and provides a string command line argument to download them. Utilizing youtube-dl to split sub and video files but livestreamer functionality can be added with minimal effort -h, --help Output this help document -u, --url Provide a single url -f, --file Provide location of...
gpl-2.0
root-mirror/root
tutorials/roofit/rf604_constraints.py
11
2705
## \file ## \ingroup tutorial_roofit ## \notebook -nodraw ## Likelihood and minimization: fitting with constraints ## ## \macro_code ## ## \date February 2018 ## \authors Clemens Lange, Wouter Verkerke (C++ version) from __future__ import print_function import ROOT # Create model and dataset # ----------------------...
lgpl-2.1
OpenCobolIDE/OpenCobolIDE
open_cobol_ide/extlibs/future/backports/email/parser.py
82
5312
# Copyright (C) 2001-2007 Python Software Foundation # Author: Barry Warsaw, Thomas Wouters, Anthony Baxter # Contact: email-sig@python.org """A parser of RFC 2822 and MIME email messages.""" from __future__ import unicode_literals from __future__ import division from __future__ import absolute_import __all__ = ['Par...
gpl-3.0
htzy/bigfour
common/test/acceptance/pages/lms/course_wiki.py
146
2170
""" Wiki tab on courses """ from .course_page import CoursePage from ...pages.studio.utils import type_in_codemirror class CourseWikiPage(CoursePage): """ Course wiki navigation and objects. """ url_path = "wiki" def is_browser_on_page(self): """ Browser is on the wiki page if t...
agpl-3.0
flh/odoo
openerp/addons/test_impex/tests/test_import.py
154
30429
# -*- coding: utf-8 -*- import openerp.modules.registry import openerp from openerp.tests import common from openerp.tools.misc import mute_logger def ok(n): """ Successful import of ``n`` records :param int n: number of records which should have been imported """ return n, 0, 0, 0 def error(row, me...
agpl-3.0
biomadeira/gae_bib2yaml
simplejson/ordered_dict.py
1039
3370
"""Drop-in replacement for collections.OrderedDict by Raymond Hettinger http://code.activestate.com/recipes/576693/ """ from UserDict import DictMixin # Modified from original to support Python 2.4, see # http://code.google.com/p/simplejson/issues/detail?id=53 try: all except NameError: def all(seq): ...
mit
repotvsupertuga/tvsupertuga.repository
script.module.future/libs/libfuturize/fixes/fix_print.py
72
3384
# Copyright 2006 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Fixer for print. Change: "print" into "print()" "print ..." into "print(...)" "print(...)" not changed "print ... ," into "print(..., end=' ')" "print >>x, ..." into "print(....
gpl-2.0