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 |
|---|---|---|---|---|---|
nipy/brainx | brainx/weighted_modularity.py | 2 | 15781 |
import copy
import numpy as np
import networkx as nx
from . import util
class WeightedPartition(object):
"""Represent a weighted Graph Partition
The main object keeping track of the nodes in each partition is the
communities attribute.
"""
def __init__(self, graph, communities=None):
... | bsd-3-clause |
kave/cfgov-refresh | cfgov/v1/migrations/0014_add_fields_sublanding.py | 2 | 4100 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import wagtail.wagtailcore.fields
import wagtail.wagtailsnippets.blocks
import v1.models.snippets
import wagtail.wagtailimages.blocks
import wagtail.wagtailcore.blocks
class Migration(migrations.Migration):
... | cc0-1.0 |
gx1997/chrome-loongson | third_party/webdriver/python/test/selenium/webdriver/firefox/test_ff_launcher.py | 3 | 1137 | #!/usr/bin/env python
# Copyright 2008-2009 WebDriver committers
# Copyright 2008-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/LICEN... | bsd-3-clause |
biancini/met | doc/source/conf.py | 3 | 8074 | # -*- coding: utf-8 -*-
#
# Saml2 Metadata Explorer Tool documentation build configuration file, created by
# sphinx-quickstart on Thu Oct 4 17:54:30 2012.
#
# 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
# autoge... | bsd-2-clause |
rudhir-upretee/Sumo_With_Netsim | tools/assign/routeChoices.py | 2 | 22027 | #!/usr/bin/env python
"""
@file routeChoices.py
@author Evamarie Wiessner
@author Yun-Pang Floetteroed
@date 2007-02-27
@version $Id: routeChoices.py 12181 2012-03-26 15:42:38Z yunpangwang $
This script is to calculate the route choice probabilities based on different methods.
- Gawron
- step-size (TBD)
- ....... | gpl-3.0 |
Edraak/edx-platform | cms/djangoapps/contentstore/tests/test_course_settings.py | 15 | 53377 | """
Tests for Studio Course Settings.
"""
import datetime
import ddt
import json
import copy
import mock
from mock import patch
import unittest
from django.conf import settings
from django.utils.timezone import UTC
from django.test.utils import override_settings
from contentstore.utils import reverse_course_url, reve... | agpl-3.0 |
CoderBotOrg/coderbotsrv | server/lib/werkzeug/testsuite/urls.py | 145 | 15382 | # -*- coding: utf-8 -*-
"""
werkzeug.testsuite.urls
~~~~~~~~~~~~~~~~~~~~~~~
URL helper tests.
:copyright: (c) 2014 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import unittest
from werkzeug.testsuite import WerkzeugTestCase
from werkzeug.datastructures import OrderedMultiD... | gpl-3.0 |
DTOcean/dtocean-core | test_data/inputs_wp2_wave.py | 1 | 3952 | # -*- coding: utf-8 -*-
"""
Created on Thu Apr 09 10:39:38 2015
@author: 108630
"""
import os
from datetime import datetime, timedelta
import numpy as np
dir_path = os.path.dirname(__file__)
# Setup
x = np.linspace(0.,1000.,20.)
y = np.linspace(0.,300.,20.)
nx = len(x)
ny = len(y)
# Bathymetry?
X, Y = np.meshgr... | gpl-3.0 |
maohongyuan/kbengine | kbe/res/scripts/common/Lib/test/test_statistics.py | 72 | 60420 | """Test suite for statistics module, including helper NumericTestCase and
approx_equal function.
"""
import collections
import decimal
import doctest
import math
import random
import sys
import types
import unittest
from decimal import Decimal
from fractions import Fraction
# Module to be tested.
import statistics... | lgpl-3.0 |
qsnake/gpaw | gpaw/test/xcatom.py | 1 | 1515 | import numpy as np
import numpy.random as ra
from gpaw.setup import create_setup
from gpaw.xc import XC
from gpaw.test import equal
x = 0.000001
ra.seed(8)
for xc in ['LDA', 'PBE']:
print xc
xc = XC(xc)
s = create_setup('N', xc)
ni = s.ni
nii = ni * (ni + 1) // 2
D_p = 0.1 * ra.random(nii) + 0... | gpl-3.0 |
Shnatsel/cjdns | node_build/dependencies/libuv/build/gyp/test/intermediate_dir/gyptest-intermediate-dir.py | 100 | 1400 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies that targets have independent INTERMEDIATE_DIRs.
"""
import TestGyp
test = TestGyp.TestGyp()
test.run_gyp('test.gyp', chdir=... | gpl-3.0 |
cabanm/project-euler | problem46.py | 1 | 1213 | # Project Euler - Problem 46
# --------------------------
# What is the smallest odd composite that cannot be written as the sum of a prime and twice a square?
from myMath import isPrime
from time import time
# Find primes up to a certain number and output a list of them
def primes(top):
seive = range(2, top+1)
for... | gpl-2.0 |
eemirtekin/edx-platform | common/lib/capa/capa/safe_exec/tests/test_safe_exec.py | 190 | 9817 | """Test safe_exec.py"""
import hashlib
import os
import os.path
import random
import textwrap
import unittest
from nose.plugins.skip import SkipTest
from capa.safe_exec import safe_exec, update_hash
from codejail.safe_exec import SafeExecException
from codejail.jail_code import is_configured
class TestSafeExec(uni... | agpl-3.0 |
2ndQuadrant/ansible | lib/ansible/modules/cloud/profitbricks/profitbricks.py | 59 | 21483 | #!/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 |
dparlevliet/zelenka-report-storage | server-local/twisted/internet/test/test_newtls.py | 47 | 6566 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.internet._newtls}.
"""
from __future__ import division, absolute_import
from twisted.trial import unittest
from twisted.internet.test.reactormixins import ReactorBuilder
from twisted.internet.test.connectionmixins import ... | lgpl-3.0 |
cslzchen/osf.io | addons/wiki/models.py | 6 | 20005 | # -*- coding: utf-8 -*-
import datetime
import functools
import logging
import markdown
import pytz
from django.db.models.expressions import F
from django.db.models.aggregates import Max
from django.core.exceptions import ValidationError
from django.utils import timezone
from framework.auth.core import Auth
from addon... | apache-2.0 |
tdjordan/tortoisegit | gitgtk/addremove.py | 1 | 1219 | #
# Add/Remove dialog for TortoiseHg
#
# Copyright (C) 2007 TK Soh <teekaysoh@gmail.com>
#
try:
import pygtk
pygtk.require("2.0")
except:
pass
import gtk
import gobject
from mercurial import ui, util, hg
from mercurial.i18n import _
from status import GStatus
def run(hgcmd='add', root='', cwd='', files=[... | gpl-2.0 |
otherness-space/myProject003 | my_project_003/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree.py | 915 | 12621 | from __future__ import absolute_import, division, unicode_literals
from pip._vendor.six import text_type
import re
from . import _base
from .. import ihatexml
from .. import constants
from ..constants import namespaces
from ..utils import moduleFactoryFactory
tag_regexp = re.compile("{([^}]*)}(.*)")
def getETreeBu... | mit |
vaimi/pydisambiguation | ui/qtgui.py | 1 | 6824 | from PyQt5.QtWidgets import (QWidget, QFrame, QLabel, QPushButton, QComboBox, QLineEdit,QTextEdit, QGridLayout, QApplication, QHBoxLayout, QRadioButton)
import logging
class AlgorithmRadioButton(QRadioButton):
def __init__(self, text, id=None, group=None):
super().__init__(text)
self.algorithmId = ... | gpl-3.0 |
madelynfreed/rlundo | venv/lib/python2.7/site-packages/IPython/html/utils.py | 4 | 4281 | """Notebook related utilities"""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
from __future__ import print_function
import os
import stat
try:
from urllib.parse import quote, unquote
except ImportError:
from urllib import quote, unquote
from IPython.u... | gpl-3.0 |
ajhalme/kbsim | lib/pgu/gui/surface.py | 13 | 4406 | """Funtions for manipulating pygame surfaces."""
import pygame
def subsurface(s,r):
"""Return the subsurface of a surface, with some help, checks."""
r = pygame.Rect(r)
if r.x < 0 or r.y < 0:
raise Exception("rectangle out of bounds: surface=%dx%d, rect=%s" % (
s.get_width(),s.get_height()... | gpl-3.0 |
RenderBroken/android_kernel_samsung_smdk4412 | 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 |
phoenixsbk/kvmmgr | packaging/setup/plugins/ovirt-engine-common/base/distro-rpm/log_setup_event.py | 3 | 2435 | #
# ovirt-engine-setup -- ovirt engine setup
# Copyright (C) 2013 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 r... | apache-2.0 |
TathagataChakraborti/resource-conflicts | PLANROB-2015/seq-sat-lama/py2.5/lib/python2.5/test/test_sys.py | 9 | 12224 | # -*- coding: iso-8859-1 -*-
import unittest, test.test_support
import sys, cStringIO
class SysModuleTest(unittest.TestCase):
def test_original_displayhook(self):
import __builtin__
savestdout = sys.stdout
out = cStringIO.StringIO()
sys.stdout = out
dh = sys.__displayhook_... | mit |
armstrong/armstrong.utils.backends | armstrong/utils/backends/base.py | 1 | 2522 | from django.conf import settings as default_settings
from django.core.exceptions import ImproperlyConfigured
try:
from importlib import import_module
except ImportError: # PY26 # pragma: no cover
from django.utils.importlib import import_module
# DEPRECATED: To be removed in Backends 2.0
import warnings
DID_... | apache-2.0 |
mattt416/neutron | neutron/plugins/ml2/drivers/freescale/mechanism_fslsdn.py | 40 | 9123 | # Copyright (c) 2014 Freescale Semiconductor
#
# 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 ... | apache-2.0 |
hroncok/python-brainfuck | test.py | 1 | 5155 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import unittest
# tested modules
import brainx
import image_png
#
# Class with temporary fake output
#
import sys
class FakeStdOut:
def write(self, *args, **kwargs):
pass
def flush(self):
pass
#
# Classes with tests
#
class TestBrainfuck... | isc |
hdinsight/hue | apps/sqoop/src/sqoop/client/config.py | 32 | 2320 | # Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file ex... | apache-2.0 |
klenks/jobsportal | env/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/contrib/appengine.py | 360 | 7937 | from __future__ import absolute_import
import logging
import os
import warnings
from ..exceptions import (
HTTPError,
HTTPWarning,
MaxRetryError,
ProtocolError,
TimeoutError,
SSLError
)
from ..packages.six import BytesIO
from ..request import RequestMethods
from ..response import HTTPResponse
... | mit |
tomkun/stem | test/unit/response/getinfo.py | 3 | 3899 | """
Unit tests for the stem.response.getinfo.GetInfoResponse class.
"""
import unittest
import stem.response
import stem.response.getinfo
import stem.socket
from test import mocking
EMPTY_RESPONSE = "250 OK"
SINGLE_RESPONSE = """\
250-version=0.2.3.11-alpha-dev
250 OK"""
BATCH_RESPONSE = """\
250-version=0.2.3.11... | lgpl-3.0 |
Mitali-Sodhi/CodeLingo | Dataset/python/tornado_strategy.py | 10 | 2224 | import json
from tornado.template import Loader, Template
from social.utils import build_absolute_uri
from social.strategies.base import BaseStrategy, BaseTemplateStrategy
class TornadoTemplateStrategy(BaseTemplateStrategy):
def render_template(self, tpl, context):
path, tpl = tpl.rsplit('/', 1)
... | mit |
ujenmr/ansible | lib/ansible/plugins/inventory/generator.py | 27 | 5400 | # Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
name: generator
plugin_type: inventory
version_added: "2.6"
shor... | gpl-3.0 |
mortardata/mortar-recsys | luigiscripts/retail-luigi.py | 4 | 19420 | import luigi
from luigi import configuration
from luigi.s3 import S3Target, S3PathTask
from boto.dynamodb2.types import NUMBER, STRING
from mortar.luigi import mortartask
from mortar.luigi import dynamodb
"""
This luigi pipeline runs the retail example, pulling data from S3 and storing results in DynamoDB.
To run, ... | apache-2.0 |
viggates/nova | nova/volume/encryptors/luks.py | 10 | 4263 | # Copyright (c) 2013 The Johns Hopkins University/Applied Physics Laboratory
# 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/... | apache-2.0 |
piotrmaslanka/satella | satella/configuration/schema/basic.py | 1 | 6186 | import codecs
import os
import re
import typing as tp
from satella.exceptions import ConfigurationValidationError
from .base import Descriptor, ConfigDictValue
from .registry import register_custom_descriptor
@staticmethod
def _make_boolean(v: tp.Any) -> bool:
if isinstance(v, str):
if v.upper() == 'TRUE... | bsd-3-clause |
citrix-openstack-build/python-cinderclient | cinderclient/v2/quotas.py | 1 | 1597 | # Copyright (c) 2013 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | apache-2.0 |
jlspyaozhongkai/Uter | third_party_build/Python-2.7.9/lib/python2.7/xml/sax/__init__.py | 230 | 3581 | """Simple API for XML (SAX) implementation for Python.
This module provides an implementation of the SAX 2 interface;
information about the Java version of the interface can be found at
http://www.megginson.com/SAX/. The Python version of the interface is
documented at <...>.
This package contains the following modu... | gpl-3.0 |
ychen820/microblog | y/google-cloud-sdk/.install/.backup/platform/gsutil/third_party/boto/tests/devpay/test_s3.py | 136 | 7410 | #!/usr/bin/env python
# Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/
#
# 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 ri... | bsd-3-clause |
mancoast/CPythonPyc_test | fail/330_test_mailcap.py | 118 | 9221 | import mailcap
import os
import shutil
import test.support
import unittest
# Location of mailcap file
MAILCAPFILE = test.support.findfile("mailcap.txt")
# Dict to act as mock mailcap entry for this test
# The keys and values should match the contents of MAILCAPFILE
MAILCAPDICT = {
'application/x-movie':
[... | gpl-3.0 |
aaronmckinstry706/twitter-crime-prediction | src/jobs/crime_prediction/run.py | 1 | 13899 | import datetime
import logging
import operator
import os
import sys
import pyspark as pyspark
import pyspark.ml.feature as feature
import pyspark.ml.classification as classification
import pyspark.ml as ml
import pyspark.ml.clustering as clustering
import pyspark.sql as sql
import pyspark.sql.functions as functions
im... | gpl-3.0 |
nhomar/odoo-mirror | addons/account_accountant/__openerp__.py | 313 | 1878 | # -*- 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 |
aimejeux/enigma2 | lib/python/Plugins/Extensions/DVDBurn/TitleCutter.py | 98 | 3312 | from Plugins.Extensions.CutListEditor.ui import CutListEditor
from Components.ServiceEventTracker import ServiceEventTracker
from enigma import iPlayableService, iServiceInformation
from Tools.Directories import fileExists
class TitleCutter(CutListEditor):
def __init__(self, session, t):
CutListEditor.__init__(self... | gpl-2.0 |
dmoliveira/networkx | networkx/linalg/modularitymatrix.py | 30 | 4430 | """Modularity matrix of graphs.
"""
# Copyright (C) 2004-2015 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
from __future__ import division
import networkx as nx
from networkx.utils import not_implemented_f... | bsd-3-clause |
manipopopo/tensorflow | tensorflow/tools/common/traverse.py | 98 | 3484 | # 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 |
plusvaliamarket/storable | node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py | 1284 | 100329 | # Copyright (c) 2013 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 collections
import copy
import hashlib
import json
import multiprocessing
import os.path
import re
import signal
import subprocess
import sys
import gyp
imp... | apache-2.0 |
Rav3nPL/polcoin | share/qt/extract_strings_qt.py | 321 | 1873 | #!/usr/bin/python
'''
Extract _("...") strings for translation and convert to Qt4 stringdefs so that
they can be picked up by Qt linguist.
'''
from subprocess import Popen, PIPE
import glob
import operator
import os
import sys
OUT_CPP="qt/bitcoinstrings.cpp"
EMPTY=['""']
def parse_po(text):
"""
Parse 'po' for... | mit |
eestay/edx-platform | common/test/acceptance/tests/video/test_video_handout.py | 48 | 6601 | # -*- coding: utf-8 -*-
"""
Acceptance tests for CMS Video Handout.
"""
from .test_studio_video_module import CMSVideoBaseTest
class VideoHandoutTest(CMSVideoBaseTest):
"""
CMS Video Handout Test Class
"""
def setUp(self):
super(VideoHandoutTest, self).setUp()
def _create_course_unit_wi... | agpl-3.0 |
zenodo/invenio | invenio/legacy/miscutil/solrutils_bibrank_indexer.py | 13 | 7209 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2011 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
# License, or (at your option) any later... | gpl-2.0 |
UweFleis3/Uwe | py/openage/testing/testing.py | 46 | 1566 | from .. import assets
testspec_asset = "tests_py"
def read_testspec():
tests = {}
demos = {}
testspec_filename = assets.get_file(testspec_asset)
with open(testspec_filename) as testspec:
for test in testspec.read().split('\n'):
test = test.strip()
if not test or test.... | gpl-3.0 |
commtrack/temp-rapidsms | apps/blaster/app.py | 3 | 1881 | from datetime import datetime
import rapidsms
from blaster.models import *
class App (rapidsms.app.App):
"""From the view, conduct a message blast. Responses get collected
with the blast. Only one blast can be open at a given time."""
# TODO: due to this app being developed for the Uganda Minis... | lgpl-3.0 |
RuthAngus/LSST-max | code/GP_periodogram.py | 1 | 1066 | from __future__ import print_function
import numpy as np
import matplotlib.pyplot as plt
from GProtation import make_plot, lnprob, neglnlike
import emcee
import time
import george
from george.kernels import ExpSquaredKernel, ExpSine2Kernel
import scipy.optimize as spo
def GP_periodogram(x, y, yerr, p_init, plims, N):
... | mit |
rogerscristo/BotFWD | env/lib/python3.6/site-packages/urllib3/request.py | 290 | 5946 | from __future__ import absolute_import
from .filepost import encode_multipart_formdata
from .packages.six.moves.urllib.parse import urlencode
__all__ = ['RequestMethods']
class RequestMethods(object):
"""
Convenience mixin for classes who implement a :meth:`urlopen` method, such
as :class:`~urllib3.con... | mit |
google/pkcs11test | gtest-1.10.0/googlemock/scripts/gmock_doctor.py | 346 | 24131 | #!/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... | apache-2.0 |
BillBillBillBill/Tickeys-linux | tickeys/kivy/uix/accordion.py | 16 | 15727 | '''
Accordion
=========
.. versionadded:: 1.0.8
.. image:: images/accordion.jpg
:align: right
The Accordion widget is a form of menu where the options are stacked either
vertically or horizontally and the item in focus (when touched) opens up to
display its content.
The :class:`Accordion` should contain one or... | mit |
horizontracy/rpi_tool | api/venv/lib/python2.7/site-packages/pip/vcs/git.py | 280 | 7608 | from __future__ import absolute_import
import logging
import tempfile
import os.path
from pip._vendor.six.moves.urllib import parse as urllib_parse
from pip._vendor.six.moves.urllib import request as urllib_request
from pip.utils import display_path, rmtree
from pip.vcs import vcs, VersionControl
urlsplit = urllib... | mit |
cffex/cmdb | test/project/webci_attr_type.py | 1 | 10754 | #!/usr/bin/python
#coding: utf-8
#print "Content-type: text/html\n"
#Author: LIPH
import web
import demjson
import json
import string
import time
import urlparse
import webci_attr
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
render = web.template.render('templates/')
urls = ( '/ciattrtyp... | apache-2.0 |
hethapu/big-data-python-class | Lectures/code/Scrapy-Samples-master/crawlspider/yacctab.py | 12 | 130324 |
# yacctab.py
# This file is automatically generated. Do not edit.
_tabversion = '3.2'
_lr_method = 'LALR'
_lr_signature = '"\xce\xf2\x9e\xca\x17\xf7\xe0\x81\x1f\r\xc4\x0b+;\x87'
_lr_action_items = {'VOID':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,24,25,27,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,4... | mit |
sogis/Quantum-GIS | scripts/widgets_tree.py | 23 | 6214 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
***************************************************************************
widgets_tree.py
---------------------
Date : May 2011
Copyright : (C) 2011 by Martin Dobias
Email : wonder dot sk at gmail dot com
... | gpl-2.0 |
rcbops/python-django-buildpackage | django/templatetags/static.py | 233 | 2149 | from django import template
from django.utils.encoding import iri_to_uri
register = template.Library()
class PrefixNode(template.Node):
def __repr__(self):
return "<PrefixNode for %r>" % self.name
def __init__(self, varname=None, name=None):
if name is None:
raise template.Templa... | bsd-3-clause |
vikingMei/mxnet | python/mxnet/image/detection.py | 7 | 39710 | # 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 |
Daniex/horizon | openstack_dashboard/test/integration_tests/pages/project/compute/access_and_security/keypairspage.py | 49 | 2716 | # Copyright 2014 Hewlett-Packard Development Company, L.P
# 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.... | apache-2.0 |
towerjoo/mindsbook | django/contrib/admin/actions.py | 83 | 2968 | """
Built-in, globally-available admin actions.
"""
from django import template
from django.core.exceptions import PermissionDenied
from django.contrib.admin import helpers
from django.contrib.admin.util import get_deleted_objects, model_ngettext
from django.db import router
from django.shortcuts import render_to_resp... | bsd-3-clause |
egemsoft/esef-yawd-translation | translations/utils.py | 1 | 5003 | import os
import sys
from django.conf import settings
from django.utils.encoding import smart_str
from django.utils.translation import check_for_language
from django.utils.translation.trans_real import get_language_from_path
_default = None
_supported = []
def get_default_language():
"""
Detects the default... | bsd-3-clause |
danbradham/shadeset | shadeset/packages/yaml/yaml3/resolver.py | 48 | 8970 |
__all__ = ['BaseResolver', 'Resolver']
from .error import *
from .nodes import *
import re
class ResolverError(YAMLError):
pass
class BaseResolver:
DEFAULT_SCALAR_TAG = 'tag:yaml.org,2002:str'
DEFAULT_SEQUENCE_TAG = 'tag:yaml.org,2002:seq'
DEFAULT_MAPPING_TAG = 'tag:yaml.org,2002:map'
yaml_im... | mit |
DazWorrall/ansible | lib/ansible/modules/monitoring/zabbix_host.py | 11 | 22176 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013-2014, Epic Games, 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 |
jianglu/mojo | tools/valgrind/asan/third_party/asan_symbolize.py | 64 | 16609 | #!/usr/bin/env python
#===- lib/asan/scripts/asan_symbolize.py -----------------------------------===#
#
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
#
#===----------------------------------------... | bsd-3-clause |
bowlofstew/Impala | thirdparty/hive-1.1.0-cdh5.7.0-SNAPSHOT/lib/py/thrift/server/TNonblockingServer.py | 62 | 10916 | #
# 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 |
DBeath/flask-feedrsub | feedrsub/feeds/feedfinder/feedfinder4.py | 1 | 7270 | import logging
import time
from typing import Tuple
from urllib.parse import urlsplit, urljoin
from bs4 import BeautifulSoup
from feedrsub.feeds.feedfinder.feedinfo import FeedInfo
from feedrsub.utils.requests_session import RequestsSession, requests_session
logger = logging.getLogger("feedfinder4")
def coerce_url... | mit |
toshywoshy/ansible | lib/ansible/modules/cloud/vmware/vcenter_extension_info.py | 21 | 3480 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Abhijeet Kasurde <akasurde@redhat.com>
# 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... | gpl-3.0 |
liberorbis/libernext | env/lib/python2.7/site-packages/celery/tests/utils/test_term.py | 9 | 2633 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import sys
from celery.utils import term
from celery.utils.term import colored, fg
from celery.five import text_t
from celery.tests.case import Case, SkipTest
class test_colored(Case):
def setUp(self):
if sys.platform == ... | gpl-2.0 |
gangadhar-kadam/laganfrappe | frappe/core/doctype/property_setter/property_setter.py | 32 | 2633 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class PropertySetter(Document):
def autoname(self):
self.name = self.doc_type + "-" \
+ (self.field_name and (s... | mit |
jiaojiaoloveu/ucore_lab | related_info/ostep/ostep11-threadintro/x86.py | 102 | 37305 | #! /usr/bin/env python
import sys
import time
import random
from optparse import OptionParser
#
# HELPER
#
def dospace(howmuch):
for i in range(howmuch):
print '%24s' % ' ',
# useful instead of assert
def zassert(cond, str):
if cond == False:
print 'ABORT::', str
exit(1)
return
c... | gpl-2.0 |
NoMasp/wwmmo | website/bs4/dammit.py | 408 | 29302 | # -*- coding: utf-8 -*-
"""Beautiful Soup bonus library: Unicode, Dammit
This library converts a bytestream to Unicode through any means
necessary. It is heavily based on code from Mark Pilgrim's Universal
Feed Parser. It works best on XML and XML, but it does not rewrite the
XML or HTML to reflect a new encoding; tha... | mit |
Badg/hwiopy | hwiopy/platforms/beagle.py | 1 | 6484 | ''' Beaglebone/Beagleboard/Etc hardware-specific operations.
LICENSING
-------------------------------------------------
hwiopy: A common API for hardware input/output access.
Copyright (C) 2014-2015 Nicholas Badger
badg@nickbadger.com
nickbadger.com
This library is free software; you can redistribut... | lgpl-2.1 |
cyril51/Sick-Beard | sickbeard/providers/piratebay/__init__.py | 30 | 12946 | # Author: Mr_Orange <mr_orange@hotmail.it>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of Sick Beard.
#
# Sick Beard 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 |
tchellomello/home-assistant | homeassistant/components/wake_on_lan/__init__.py | 4 | 1682 | """Support for sending Wake-On-LAN magic packets."""
from functools import partial
import logging
import voluptuous as vol
import wakeonlan
from homeassistant.const import CONF_BROADCAST_ADDRESS, CONF_BROADCAST_PORT, CONF_MAC
import homeassistant.helpers.config_validation as cv
_LOGGER = logging.getLogger(__name__)
... | apache-2.0 |
TalwalkarLab/paleo | paleo/layers/conv.py | 1 | 11804 | """The module estimates 2D convolution layers."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import math
import six
from paleo.layers import base
class Deconv2D(base.BaseLayer):
"""Deconv2D"""
def __init__(self,
name,
... | apache-2.0 |
CroatianMeteorNetwork/RMS | Utils/RMS2UFO.py | 2 | 5644 | """ Convert the FTPdetectinfo format to UFOorbit input CSV. """
from __future__ import print_function, division, absolute_import
import os
import argparse
import datetime
import numpy as np
import RMS.Astrometry.ApplyAstrometry
from RMS.Astrometry.Conversions import datetime2JD, altAz2RADec
from RMS.Formats import ... | gpl-3.0 |
ronbelson/ghost-proxy-hebrew | node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/dump_dependency_json.py | 899 | 2768 | # Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import collections
import os
import gyp
import gyp.common
import gyp.msvs_emulation
import json
import sys
generator_supports_multiple_toolsets = True
generator_... | mit |
andrius-preimantas/odoo | openerp/addons/base/module/wizard/base_module_configuration.py | 447 | 2274 | # -*- 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 |
nathaliaspatricio/febracev | friends/views.py | 1 | 1329 | # -*- coding: utf-8 -*-
from django.contrib.auth.models import User
from django.shortcuts import render_to_response, get_object_or_404, redirect
from django.template import RequestContext
from friends.utils import get_following_set, get_follower_set, get_mutual_set
from django.contrib.auth.decorators import login_requi... | gpl-2.0 |
vikas1885/test1 | lms/djangoapps/verify_student/tests/fake_software_secure.py | 57 | 1682 | """
Fake Software Secure page for use in acceptance tests.
"""
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.core.urlresolvers import reverse
from django.utils.decorators import method_decorator
from django.views.generic.base import View
from edxmako.shortcuts ... | agpl-3.0 |
hefen1/chromium | tools/telemetry/telemetry/web_perf/timeline_based_measurement.py | 2 | 11281 | # 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.
from collections import defaultdict
from telemetry.core.platform import tracing_category_filter
from telemetry.core.platform import tracing_options
from tel... | bsd-3-clause |
PsychoTV/PsychoTeam.repository | plugin.video.PsychoTV/resources/lib/libraries/libtools.py | 6 | 21914 | # -*- coding: utf-8 -*-
'''
Specto Add-on
Copyright (C) 2015 lambda
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 l... | gpl-2.0 |
dlazz/ansible | lib/ansible/modules/cloud/azure/azure_rm_aks_facts.py | 9 | 3921 | #!/usr/bin/python
#
# Copyright (c) 2018 Yuwei Zhou, <yuwzho@microsoft.com>
#
# 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 |
nvoron23/hue | desktop/core/ext-py/elementtree/elementtree/SimpleXMLWriter.py | 103 | 8616 | #
# SimpleXMLWriter
# $Id: SimpleXMLWriter.py 2312 2005-03-02 18:13:39Z fredrik $
#
# a simple XML writer
#
# history:
# 2001-12-28 fl created
# 2002-11-25 fl fixed attribute encoding
# 2002-12-02 fl minor fixes for 1.5.2
# 2004-06-17 fl added pythondoc markup
# 2004-07-23 fl added flush method (from Jay Grav... | apache-2.0 |
lukeiwanski/tensorflow | tensorflow/contrib/solvers/python/kernel_tests/least_squares_test.py | 129 | 3348 | # 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 |
tusimbe/APM | Tools/LogAnalyzer/tests/TestParams.py | 12 | 2585 | from LogAnalyzer import Test,TestResult
import DataflashLog
import math # for isnan()
class TestParams(Test):
'''test for any obviously bad parameters in the config'''
def __init__(self):
Test.__init__(self)
self.name = "Parameters"
# helper functions
def __checkParamIsEqual(self, paramName, expectedValue... | gpl-3.0 |
popazerty/test | lib/python/Screens/Hotkey.py | 4 | 25926 | from Components.ActionMap import ActionMap, HelpableActionMap
from Components.Button import Button
from Components.ChoiceList import ChoiceList, ChoiceEntryComponent
from Components.SystemInfo import SystemInfo
from Components.config import config, ConfigSubsection, ConfigText, ConfigYesNo
from Components.PluginCompone... | gpl-2.0 |
ccie5159/pynet | appliedpy_ecourse/class9/net_main.py | 4 | 6670 | #!/usr/bin/env python
import django
import time
from net_system.models import NetworkDevice, Credentials, SnmpCredentials
from remote_connection import SSHConnection
from inventory import CiscoGatherInventory, AristaGatherInventory
from inventory import onepk_find_model, onepk_find_device_type, onepk_find_os_version... | apache-2.0 |
meska/SoCo | tests/test_services.py | 7 | 8183 | # -*- coding: utf-8 -*-
"""Tests for the services module."""
# These tests require pytest, and mock. Mock comes with Python 3.3, but has
# also been backported for Python 2.7. It is available on pypi.
from __future__ import unicode_literals
import pytest
from soco.exceptions import SoCoUPnPException
from soco.servi... | mit |
lezlightlr/system-of-record | tests/test_blockchain_object_repository.py | 2 | 3908 | from systemofrecord.repository import blockchain_object_repository
from systemofrecord.repository.message_id_validator import InvalidTitleIdException
from tests.system_of_record_message_fixtures import *
from datatypes import system_of_record_request_validator
from datatypes.core import unicoded
from tests.teardown_uni... | mit |
malin1993ml/h-store | src/dtxn/valleak_test.py | 9 | 2760 | #!/usr/bin/python
import errno
import os
import shutil
import subprocess
import tempfile
import unittest
import valleak
class TempDir(object):
def __init__(self):
self.name = tempfile.mkdtemp()
def __del__(self):
shutil.rmtree(self.name)
def compileC(tempdir_path, text):
exe_name = te... | gpl-3.0 |
philanthropy-u/edx-platform | openedx/core/djangoapps/verified_track_content/management/commands/swap_from_auto_track_cohort_pilot.py | 2 | 15035 | """Management command to migrate a course's xblock's group_access from Verified Track Cohorts to Enrollment Tracks"""
from __future__ import print_function
from contentstore.course_group_config import GroupConfiguration
from django.conf import settings
from course_modes.models import CourseMode
from django.core.manag... | agpl-3.0 |
paweljasinski/ironpython3 | Tests/interop/com/dlrcomlib/DispEvents.py | 3 | 36304 | #####################################################################################
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# This source code is subject to terms and conditions of the Apache License, Version 2.0. A
# copy of the license can be found in the License.html file at the root of t... | apache-2.0 |
Accelerite/cinder | cinder/db/sqlalchemy/migrate_repo/versions/007_add_volume_snapshot_fk.py | 42 | 1285 | # 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 |
llazzaro/django-pywars | pywars/tasks.py | 2 | 6862 | from __future__ import absolute_import
from celery import shared_task
from celery.exceptions import SoftTimeLimitExceeded
import time
import threading
from subprocess import Popen, PIPE
import signal
import subprocess
import tempfile
import os
import shutil
import json
import random
ENGINE_NAME = "ona_eng.py"
ENGI... | bsd-2-clause |
YouRik/Received | qml/components/python/requests/status_codes.py | 926 | 3200 | # -*- coding: utf-8 -*-
from .structures import LookupDict
_codes = {
# Informational.
100: ('continue',),
101: ('switching_protocols',),
102: ('processing',),
103: ('checkpoint',),
122: ('uri_too_long', 'request_uri_too_long'),
200: ('ok', 'okay', 'all_ok', 'all_okay', 'all_good', '\\o/'... | gpl-2.0 |
pombredanne/fedmsg | fedmsg/tests/fedmsg-test-config.py | 5 | 3504 | # This file is part of fedmsg.
# Copyright (C) 2012 - 2014 Red Hat, Inc.
#
# fedmsg is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later ver... | lgpl-2.1 |
EraYaN/CouchPotatoServer | couchpotato/core/downloaders/putio/__init__.py | 34 | 2471 | from .main import PutIO
def autoload():
return PutIO()
config = [{
'name': 'putio',
'groups': [
{
'tab': 'downloaders',
'list': 'download_providers',
'name': 'putio',
'label': 'put.io',
'description': 'This will start a torrent download... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.