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 |
|---|---|---|---|---|---|
kuiwei/kuiwei | common/lib/capa/capa/correctmap.py | 47 | 6551 | #-----------------------------------------------------------------------------
# class used to store graded responses to CAPA questions
#
# Used by responsetypes and capa_problem
class CorrectMap(object):
"""
Stores map between answer_id and response evaluation result for each question
in a capa problem. ... | agpl-3.0 |
nvoron23/hue | desktop/core/ext-py/elementtree/elementtree/TidyTools.py | 125 | 3159 | #
# ElementTree
# $Id: TidyTools.py 1862 2004-06-18 07:31:02Z Fredrik $
#
# tools to run the "tidy" command on an HTML or XHTML file, and return
# the contents as an XHTML element tree.
#
# history:
# 2002-10-19 fl added to ElementTree library; added getzonebody function
#
# Copyright (c) 1999-2004 by Fredrik Lundh. ... | apache-2.0 |
kelp404/elasticsearch-py | test_elasticsearch/test_transport.py | 10 | 9810 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import time
from elasticsearch.transport import Transport, get_host_info
from elasticsearch.connection import Connection, ThriftConnection
from elasticsearch.connection_pool import DummyConnectionPool
from elasticsearch.exceptions import ConnectionError, ... | apache-2.0 |
the-ress/electron | script/release/uploaders/upload-symbols.py | 2 | 1602 | #!/usr/bin/env python
import os
import glob
import sys
sys.path.append(
os.path.abspath(os.path.dirname(os.path.abspath(__file__)) + "/../.."))
from lib.config import PLATFORM, s3_config, enable_verbose_mode
from lib.util import get_electron_branding, execute, rm_rf, safe_mkdir, s3put, \
get_o... | mit |
alfa-jor/addon | mediaserver/lib/requests/structures.py | 97 | 2981 | # -*- coding: utf-8 -*-
"""
requests.structures
~~~~~~~~~~~~~~~~~~~
Data structures that power Requests.
"""
from .compat import OrderedDict, Mapping, MutableMapping
class CaseInsensitiveDict(MutableMapping):
"""A case-insensitive ``dict``-like object.
Implements all methods and operations of
``Mutabl... | gpl-3.0 |
pmatam/thumbor | thumbor/optimizers/gifv.py | 4 | 1911 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# thumbor imaging service
# https://github.com/thumbor/thumbor/wiki
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2011 globo.com thumbor@googlegroups.com
import os
import subprocess
from thumbor.optimizers import BaseOpti... | mit |
almann/ion-python | tests/test_writer_binary.py | 2 | 2963 | # Copyright 2016 Amazon.com, Inc. or its affiliates. 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.
# A copy of the License is located at:
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file acc... | apache-2.0 |
40223101/w16b_test | static/Brython3.1.3-20150514-095342/Lib/unittest/test/testmock/testwith.py | 739 | 5806 | import unittest
from warnings import catch_warnings
from unittest.test.testmock.support import is_instance
from unittest.mock import MagicMock, Mock, patch, sentinel, mock_open, call
something = sentinel.Something
something_else = sentinel.SomethingElse
class WithTest(unittest.TestCase):
def test_with_sta... | agpl-3.0 |
LSSTC-DSFP/LSSTC-DSFP-Sessions | Session1/Day2/ImageProcessing/imageProc.py | 2 | 1787 | import numpy as np
#
# Names of mask planes
#
maskPlanes = dict(
BAD = np.uint16(1 << 0),
SATUR = np.uint16(1 << 1),
INTRP = np.uint16(1 << 2),
CR = np.uint16(1 << 3),
EDGE = np.uint16(1 << 4),
DETECTED = np.uint16(1 << 5),
)
def setPixels(da, x, y, good):
"""Fix b... | mit |
hbrunn/OpenUpgrade | addons/document/wizard/document_configuration.py | 381 | 4895 | # -*- 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 |
tushar7795/MicroBlog | flask/lib/python2.7/site-packages/coverage/__init__.py | 43 | 1177 | # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt
"""Code coverage measurement for Python.
Ned Batchelder
http://nedbatchelder.com/code/coverage
"""
from coverage.version import __version__, __url__, version_inf... | bsd-3-clause |
linktlh/Toontown-journey | otp/speedchat/SCMenuHolder.py | 5 | 5129 | from pandac.PandaModules import *
from direct.gui.DirectGui import *
from SCObject import SCObject
from SCElement import SCElement
from SCMenu import SCMenu
import types
class SCMenuHolder(SCElement):
N = 0.9
DefaultFrameColor = (0,
0,
0,
1.0 - N)
del N
MenuColorScaleDown = 0.95
def... | apache-2.0 |
iNecas/katello | cli/test/katello/tests/core/product/product_promote_test.py | 1 | 3293 | import unittest
from mock import Mock
import os
from katello.tests.core.action_test_utils import CLIOptionTestCase, CLIActionTestCase
from katello.tests.core.organization import organization_data
from katello.tests.core.product import product_data
from katello.tests.core.provider import provider_data
from katello.tes... | gpl-2.0 |
jeremiahmarks/sl4a | python/src/Lib/idlelib/RemoteDebugger.py | 52 | 11634 | """Support for remote Python debugging.
Some ASCII art to describe the structure:
IN PYTHON SUBPROCESS # IN IDLE PROCESS
#
# oid='gui_adapter'
+----------+ # +------------+ ... | apache-2.0 |
akrzos/cfme_tests | scripts/install_snmp_listener.py | 4 | 2178 | #!/usr/bin/env python2
"""SSH into a running appliance and install SNMP listener."""
import argparse
import requests
import sys
from utils.conf import credentials
from utils.path import scripts_data_path
from utils.ssh import SSHClient
def main():
parser = argparse.ArgumentParser(epilog=__doc__,
format... | gpl-2.0 |
raycarnes/odoomrp-wip | procurement_sale_forecast/models/procurement.py | 24 | 1118 | # -*- encoding: utf-8 -*-
##############################################################################
#
# This program 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, either version 3 of the... | agpl-3.0 |
Aspediens/codesync | src/snowTools/downloader.py | 2 | 12789 | # -*- coding: utf-8 -*-
#
# This file is part of CERN CodeSync for ServiceNow.
# Copyright (C) 2010 - 2015 European Organization for Nuclear Research (CERN).
#
# CERN CodeSync for ServiceNow is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by ... | gpl-3.0 |
takashi-suehiro/rtmtools | rtc_handle_example/rtc_handle/rtc_handle_1.0.py | 1 | 16845 | #/usr/bin/env python
# -*- coding: utf-8 -*-
# -*- Python -*-
# import sys
from omniORB import CORBA, URI
# from omniORB import any
from omniORB import any, cdrMarshal, cdrUnmarshal
import OpenRTM_aist
import RTC
from CorbaNaming import *
import SDOPackage
# from EmbryonicRtc import *
# class RtmEnv :
# rtm ... | mit |
nikdoof/django-eveigb | test_project/settings.py | 1 | 5384 | # Django settings for test_project project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 't... | bsd-3-clause |
cgstudiomap/cgstudiomap | main/eggs/reportlab-3.2.0-py2.7-linux-x86_64.egg/reportlab/pdfbase/_fontdata_widths_timesitalic.py | 56 | 3665 | widths = {'A': 611,
'AE': 889,
'Aacute': 611,
'Acircumflex': 611,
'Adieresis': 611,
'Agrave': 611,
'Aring': 611,
'Atilde': 611,
'B': 611,
'C': 667,
'Ccedilla': 667,
'D': 722,
'E': 611,
'Eacute': 611,
'Ecircumflex': 611,
'Edieresis': 611,
'Egrave': 611,
'Eth': 722,
'Euro': 500,
'F': 611,
'G': 722,
'... | agpl-3.0 |
Thoshh/wapad | lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/codingstatemachine.py | 2931 | 2318 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | mit |
eayunstack/oslo.messaging | tests/utils.py | 1 | 2075 | # Copyright 2010-2011 OpenStack Foundation
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2013 Hewlett-Packard Development Company, L.P.
# All Rights Reserved.
# Copyright 2013 Red Hat, Inc.
#
# Licensed under the Apac... | apache-2.0 |
rew4332/tensorflow | tensorflow/contrib/learn/python/learn/ops/seq2seq_ops.py | 24 | 5884 | # 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 |
cirosantilli/sulley | requests/jabber.py | 8 | 1969 | from sulley import *
########################################################################################################################
s_initialize("chat init")
"""
<?xml version="1.0" encoding="UTF-8" ?>
<stream:stream to="192.168.200.17" xmlns="jabber:client" xmlns:stream="http://etherx.jabber.org/streams">... | gpl-2.0 |
sejust/pykit | ectypes/region.py | 2 | 5431 | #!/usr/bin/env python
# coding: utf-8
import bisect
from pykit import rangeset
from pykit.dictutil import FixedKeysDict
from .block_id import BlockID
MERGE_COEF = 4
class BlockNotInRegion(Exception):
pass
class BlockAreadyInRegion(Exception):
pass
class LevelOutOfBound(Exception):
pass
def _rang... | mit |
bayusantoso/final-assignment-web-ontology | IMPLEMENTATION/Application/SourceCode/GOApps/flask/Lib/site-packages/setuptools/dist.py | 259 | 35320 | __all__ = ['Distribution']
import re
import os
import sys
import warnings
import numbers
import distutils.log
import distutils.core
import distutils.cmd
import distutils.dist
from distutils.core import Distribution as _Distribution
from distutils.errors import (DistutilsOptionError, DistutilsPlatformError,
Distuti... | gpl-3.0 |
deshbandhu-renovite/receipt-eCommerce | node_modules/node-gyp/gyp/pylib/gyp/common_test.py | 2542 | 1970 | #!/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.
"""Unit tests for the common.py file."""
import gyp.common
import unittest
import sys
class TestTopologicallySorted(unittest.TestCase):
... | gpl-3.0 |
NinjaMSP/crossbar | crossbar/router/test/test_testament.py | 2 | 8815 | #####################################################################################
#
# Copyright (c) Crossbar.io Technologies GmbH
#
# Unless a separate license agreement exists between you and Crossbar.io GmbH (e.g.
# you have purchased a commercial license), the license terms below apply.
#
# Should you enter ... | agpl-3.0 |
fzheng/codejam | lib/python2.7/site-packages/requests/utils.py | 148 | 22228 | # -*- coding: utf-8 -*-
"""
requests.utils
~~~~~~~~~~~~~~
This module provides utility functions that are used within Requests
that are also useful for external consumption.
"""
import cgi
import codecs
import collections
import io
import os
import re
import socket
import struct
import warnings
from . import __ver... | mit |
prashrock/Python | leetCode/largest_number/create_largest_number_from_array.py | 1 | 1340 | # Use a custom sort comparator to sort the integers
# Converted the sorted integer array into a string
def cmp_to_key(mycmp):
'Convert a cmp= function into a key= function'
class K:
def __init__(self, obj, *args):
self.obj = obj
def __lt__(self, other):
return mycmp(self.... | gpl-2.0 |
Venturi/cms | env/lib/python2.7/site-packages/phonenumbers/data/region_BZ.py | 10 | 1751 | """Auto-generated file, do not edit by hand. BZ metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_BZ = PhoneMetadata(id='BZ', country_code=501, international_prefix='00',
general_desc=PhoneNumberDesc(national_number_pattern='[2-8]\\d{6}|0\\d{10}', possible_number_p... | gpl-2.0 |
emulbreh/lymph | lymph/core/events.py | 1 | 3099 | import re
import logging
from lymph.core.interfaces import Component
from lymph.core import trace
logger = logging.getLogger(__name__)
class Event(object):
def __init__(self, evt_type, body, source=None, headers=None, event_id=None):
self.event_id = event_id
self.evt_type = evt_type
sel... | apache-2.0 |
ccrook/Quantum-GIS | tests/src/python/test_qgscolorschemeregistry.py | 19 | 2911 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsColorSchemeRegistry.
.. 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 later version... | gpl-2.0 |
ericzundel/pants | src/python/pants/engine/struct.py | 10 | 13553 | # coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from abc import abst... | apache-2.0 |
maxdeliso/elevatorSim | Lib/distutils/tests/test_bdist.py | 135 | 1534 | """Tests for distutils.command.bdist."""
import os
import unittest
from test.support import run_unittest
from distutils.command.bdist import bdist
from distutils.tests import support
class BuildTestCase(support.TempdirManager,
unittest.TestCase):
def test_formats(self):
# let's creat... | bsd-2-clause |
opoplawski/ansible-modules-extras | cloud/vmware/vmware_dvs_portgroup.py | 47 | 6921 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Joseph Callen <jcallen () csc.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Li... | gpl-3.0 |
drglove/SickRage | lib/github/tests/Tag.py | 39 | 2359 | # -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2012 Zearin <zearin@gonk.net> ... | gpl-3.0 |
mtougeron/python-openstacksdk | examples/session.py | 2 | 1379 | # 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 |
Altaf-Mahdi/i9100 | tools/perf/scripts/python/sched-migration.py | 11215 | 11670 | #!/usr/bin/python
#
# Cpu task migration overview toy
#
# Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com>
#
# perf script event handlers have been generated by perf script -g python
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Fre... | gpl-2.0 |
Mazecreator/tensorflow | tensorflow/contrib/distributions/python/ops/bijectors/softmax_centered.py | 85 | 1166 | # 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 |
mesocentrefc/Janua-SMS | janua/actions/sms_usage.py | 1 | 2426 | # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
#
# Copyright (c) 2016 Cédric Clerget - HPC Center of Franche-Comté University
#
# This file is part of Janua-SMS
#
# http://github.com/mesocentrefc/Janua-SMS
#
# This program is free software: you can redistribute it and/or modify
# it under th... | gpl-2.0 |
oneminot/audacity | lib-src/lv2/sord/waflib/Tools/cxx.py | 329 | 1223 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
from waflib import TaskGen,Task,Utils
from waflib.Tools import c_preproc
from waflib.Tools.ccroot import link_task,stlink_task
@TaskGen.extension('.cpp','.cc','.cxx','.C','.c+... | gpl-2.0 |
chrisndodge/edx-platform | common/test/acceptance/pages/studio/settings_certificates.py | 16 | 19832 | """
Course Certificates page objects.
The methods in these classes are organized into several conceptual buckets:
* Helpers: General utility methods used throughout, such as css selection helpers
* Properties: Specific page/object field getters/setters (mainly for form inputs)
* Wait Actions: EmptyPromises ... | agpl-3.0 |
Dziolas/invenio-oaiserver | tests/test_invenio_oaiserver.py | 1 | 1878 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2015 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 |
nathanbjenx/cairis | cairis/controllers/TemplateGoalController.py | 1 | 3319 | # 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... | apache-2.0 |
rseubert/scikit-learn | examples/applications/plot_out_of_core_classification.py | 255 | 13919 | """
======================================================
Out-of-core classification of text documents
======================================================
This is an example showing how scikit-learn can be used for classification
using an out-of-core approach: learning from data that doesn't fit into main
memory. ... | bsd-3-clause |
wuhengzhi/chromium-crosswalk | chrome/common/extensions/docs/server2/data_source.py | 37 | 1259 | # 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.
class DataSource(object):
'''
Defines an abstraction for all DataSources.
DataSources must have two public methods, get and Refresh. A DataSource is
... | bsd-3-clause |
andyr0id/PyGFNN | examples/gfnn/example1F.py | 1 | 1657 | #!/usr/bin/env python
__author__ = 'Andrew J. Lambert, andy@andyroid.co.uk'
"""
example1P
A one layer network with fixed internal connections
"""
from pygfnn.tools.plotting.gfnn import *
import pygfnn.tools.shortcuts as gfnn
import numpy as np
import timeit
import matplotlib.pyplot as plt
import scipy.io as sio
if... | gpl-2.0 |
rickhurst/Django-non-rel-blog | django/contrib/admin/templatetags/admin_list.py | 154 | 13963 | import datetime
from django.conf import settings
from django.contrib.admin.util import lookup_field, display_for_field, label_for_field
from django.contrib.admin.views.main import (ALL_VAR, EMPTY_CHANGELIST_VALUE,
ORDER_VAR, ORDER_TYPE_VAR, PAGE_VAR, SEARCH_VAR)
from django.core.exceptions import ObjectDoesNotExis... | bsd-3-clause |
Shedino/SherpaHighLevel | catkin_ws/src/casy_rover/mavlink/pymavlink/tools/mavgpslock.py | 11 | 2090 | #!/usr/bin/env python
'''
show GPS lock events in a MAVLink log
'''
import sys, time, os
from optparse import OptionParser
parser = OptionParser("gpslock.py [options]")
parser.add_option("--condition", default=None, help="condition for packets")
(opts, args) = parser.parse_args()
from pymavlink import mavutil
if ... | bsd-3-clause |
helldorado/ansible | lib/ansible/modules/database/misc/kibana_plugin.py | 52 | 7252 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2016, Thierno IB. BARRY @barryib
# Sponsored by Polyconseil http://polyconseil.fr.
#
# 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__ = t... | gpl-3.0 |
liberiun/cynin-intranet | src/ubify.viewlets/ubify/viewlets/browser/typetitle.py | 1 | 3657 | ###############################################################################
#cyn.in is an open source Collaborative Knowledge Management Appliance that
#enables teams to seamlessly work together on files, documents and content in
#a secure central environment.
#
#cyn.in v2 an open source appliance is distributed un... | gpl-3.0 |
ypkang/Dato-Core | cxxtest/cxxtest/cxx_parser.py | 31 | 72662 | #-------------------------------------------------------------------------
# CxxTest: A lightweight C++ unit testing library.
# Copyright (c) 2008 Sandia Corporation.
# This software is distributed under the LGPL License v2.1
# For more information, see the COPYING file in the top CxxTest directory.
# Under the terms o... | agpl-3.0 |
onyxfish/stovetop | gdata/calendar_resource/client.py | 12 | 7161 | #!/usr/bin/python
#
# Copyright 2009 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | mit |
jereze/scikit-learn | examples/datasets/plot_iris_dataset.py | 283 | 1928 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
The Iris Dataset
=========================================================
This data sets consists of 3 different types of irises'
(Setosa, Versicolour, and Virginica) petal and sepal
length, stored in a 150x4 numpy... | bsd-3-clause |
GoogleCloudPlatform/training-data-analyst | courses/machine_learning/deepdive2/structured/solutions/serving/application/lib/pyasn1_modules/rfc5035.py | 13 | 4523 | #
# This file is part of pyasn1-modules software.
#
# Created by Russ Housley with assistance from asn1ate v.0.6.0.
# Modified by Russ Housley to add a map for use with opentypes.
#
# Copyright (c) 2019, Vigil Security, LLC
# License: http://snmplabs.com/pyasn1/license.html
#
# Update to Enhanced Security Services for ... | apache-2.0 |
glorotxa/SME | FB15k/FB15k_evaluation.py | 4 | 7942 | #! /usr/bin/python
import sys
from model import *
def load_file(path):
return scipy.sparse.csr_matrix(cPickle.load(open(path)),
dtype=theano.config.floatX)
def convert2idx(spmat):
rows, cols = spmat.nonzero()
return rows[np.argsort(cols)]
def RankingEval(datapath='../data/', dataset='FB15k-... | bsd-3-clause |
zzeleznick/zDjango | venv/lib/python2.7/site-packages/django/contrib/gis/geos/prototypes/topology.py | 221 | 2936 | """
This module houses the GEOS ctypes prototype functions for the
topological operations on geometries.
"""
__all__ = ['geos_boundary', 'geos_buffer', 'geos_centroid', 'geos_convexhull',
'geos_difference', 'geos_envelope', 'geos_intersection',
'geos_linemerge', 'geos_pointonsurface', 'geos_pre... | mit |
code-for-india/sahana_shelter_worldbank | controllers/vol.py | 1 | 40041 | # -*- coding: utf-8 -*-
"""
Volunteer Management
"""
module = request.controller
resourcename = request.function
if not settings.has_module(module):
raise HTTP(404, body="Module disabled: %s" % module)
s3db.hrm_vars()
# =============================================================================
def index... | mit |
slightlymadphoenix/activityPointsApp | activitypoints/lib/python3.5/site-packages/django/contrib/gis/gdal/geomtype.py | 100 | 3310 | from django.contrib.gis.gdal.error import GDALException
from django.utils import six
class OGRGeomType(object):
"Encapsulates OGR Geometry Types."
wkb25bit = -2147483648
# Dictionary of acceptable OGRwkbGeometryType s and their string names.
_types = {0: 'Unknown',
1: 'Point',
... | mit |
normanmaurer/autobahntestsuite-maven-plugin | src/main/resources/twisted/manhole/service.py | 17 | 12930 |
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""L{twisted.manhole} L{PB<twisted.spread.pb>} service implementation.
"""
# twisted imports
from twisted import copyright
from twisted.spread import pb
from twisted.python import log, failure
from twisted.cred import portal
from twisted.applic... | apache-2.0 |
JJediny/python-social-auth | social/backends/strava.py | 70 | 1850 | """
Strava OAuth2 backend, docs at:
http://psa.matiasaguirre.net/docs/backends/strava.html
"""
from social.backends.oauth import BaseOAuth2
class StravaOAuth(BaseOAuth2):
name = 'strava'
AUTHORIZATION_URL = 'https://www.strava.com/oauth/authorize'
ACCESS_TOKEN_URL = 'https://www.strava.com/oauth/token... | bsd-3-clause |
beol/rbtools | docs/rbtools/_ext/rbt_commands.py | 5 | 10941 | from __future__ import unicode_literals
import argparse
import re
import sys
from docutils import nodes
from docutils.statemachine import ViewList
from six.moves import range
from sphinx.util.compat import Directive
from rbtools import commands
from rbtools.commands import OptionGroup, Option
class CommandClassNot... | mit |
wimnat/ansible | test/support/windows-integration/plugins/modules/win_lineinfile.py | 68 | 7333 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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'}
DOCUMENTATION = r'''
---
module: win_linein... | gpl-3.0 |
rosenbrockc/fortpy | fortpy/stats/bp.py | 1 | 5243 | """Methods for testing a code library against Fortran best practices to
help uncover subtle bugs that took a while for us to track down. See
especially http://www.cs.rpi.edu/~szymansk/OOF90/bugs.html"""
def _exec_check_pointers(executable):
"""Checks the specified executable for the pointer condition that not
... | mit |
mitoNGS/MToolBox | aux/filter_HF.py | 1 | 2956 | #!/usr/bin/env python
import fileinput
import sys, os
def usage():
print '''
This script is compatible with MToolBox versions < 1.2 only
This script filters the MToolBox vcf file based on Heteroplasmy threshold
Usage:
filter_HF.py <sample_name> <vcf_file> <HF_threshold[float]> <DP_threshold[float]> <out_type[vc... | gpl-3.0 |
HH890612/MiliCloud | lib/requests/packages/chardet/latin1prober.py | 1778 | 5232 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | mit |
cristian69/KernotekV3 | venv/lib/python2.7/site-packages/werkzeug/testsuite/formparser.py | 97 | 18740 | # -*- coding: utf-8 -*-
"""
werkzeug.testsuite.formparser
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tests the form parsing facilities.
:copyright: (c) 2013 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from __future__ import with_statement
import unittest
from os.path import join, dirn... | gpl-3.0 |
alexrao/YouCompleteMe | third_party/ycmd/third_party/requests/requests/exceptions.py | 895 | 2517 | # -*- coding: utf-8 -*-
"""
requests.exceptions
~~~~~~~~~~~~~~~~~~~
This module contains the set of Requests' exceptions.
"""
from .packages.urllib3.exceptions import HTTPError as BaseHTTPError
class RequestException(IOError):
"""There was an ambiguous exception that occurred while handling your
request.""... | gpl-3.0 |
ruibarreira/linuxtrail | usr/lib/python2.7/dist-packages/pygments/styles/tango.py | 135 | 7096 | # -*- coding: utf-8 -*-
"""
pygments.styles.tango
~~~~~~~~~~~~~~~~~~~~~
The Crunchy default Style inspired from the color palette from
the Tango Icon Theme Guidelines.
http://tango.freedesktop.org/Tango_Icon_Theme_Guidelines
Butter: #fce94f #edd400 #c4a000
Orange: #fcaf3e ... | gpl-3.0 |
leki75/ansible | lib/ansible/modules/database/proxysql/proxysql_backend_servers.py | 58 | 18999 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#... | gpl-3.0 |
ashhher3/scikit-learn | sklearn/cluster/tests/test_affinity_propagation.py | 31 | 2633 | """
Testing for Clustering methods
"""
import numpy as np
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_raises
from sklearn.cluster.affinity_propagation_ import AffinityPropagation
from sklearn.cluster.affinity_propagatio... | bsd-3-clause |
NicBeltramelli/trellis | roles/letsencrypt/templates/renew-certs.py | 14 | 1938 | #!/usr/bin/env python
import os
import sys
import time
from subprocess import CalledProcessError, check_output, STDOUT
failed = False
letsencrypt_cert_ids = {{ letsencrypt_cert_ids }}
for site in {{ sites_using_letsencrypt }}:
cert_path = os.path.join('{{ letsencrypt_certs_dir }}', site + '-' + letsencrypt_cert... | mit |
ruijie/quantum | quantum/openstack/common/rpc/impl_fake.py | 6 | 5233 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack 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
... | apache-2.0 |
broesamle/servo | etc/ci/performance/test_submit_to_perfherder.py | 106 | 4677 | #!/usr/bin/env python3
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import submit_to_perfherder
def test_format_testcase_name():
assert('about:blank' == submi... | mpl-2.0 |
xrg/tweepy | tweepy/parsers.py | 74 | 2622 | # Tweepy
# Copyright 2009-2010 Joshua Roesslein
# See LICENSE for details.
from tweepy.models import ModelFactory
from tweepy.utils import import_simplejson
from tweepy.error import TweepError
class Parser(object):
def parse(self, method, payload):
"""
Parse the response payload and return the r... | mit |
resmo/cloudstack | test/integration/component/test_vpc_network_pfrules.py | 6 | 43341 | # 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 |
fogleman/DCPU-16 | app/assembler.py | 1 | 16148 | import ply.lex as lex
import ply.yacc as yacc
# Constants
SIZE = 0x10000
# Lookups
BASIC_OPCODES = {
'SET': 0x01,
'ADD': 0x02,
'SUB': 0x03,
'MUL': 0x04,
'MLI': 0x05,
'DIV': 0x06,
'DVI': 0x07,
'MOD': 0x08,
'MDI': 0x09,
'AND': 0x0a,
'BOR': 0x0b,
'XOR': 0x0c,
'SHR': 0x... | mit |
srluge/SickRage | lib/stevedore/enabled.py | 51 | 3014 | import logging
from .extension import ExtensionManager
LOG = logging.getLogger(__name__)
class EnabledExtensionManager(ExtensionManager):
"""Loads only plugins that pass a check function.
The check_func argument should return a boolean, with ``True``
indicating that the extension should be loaded and ... | gpl-3.0 |
MSusik/invenio | invenio/modules/sword/models.py | 4 | 3949 | # -*- coding: utf-8 -*-
#
## This file is part of Invenio.
## Copyright (C) 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
## License, or (at your opti... | gpl-2.0 |
bnkr/selenit | selenibench/scripts.py | 1 | 3871 | from __future__ import print_function
import sys, argparse, selenium, contextlib, os, json, traceback
from datetime import datetime as DateTime
from datetime import timedelta as TimeDelta
from selenium.webdriver import Remote as WebDriverRemote
from selenium.webdriver.support.ui import WebDriverWait
class Selenibench... | mit |
py-geek/City-Air | venv/lib/python2.7/site-packages/django/middleware/cache.py | 77 | 9264 | """
Cache middleware. If enabled, each Django-powered page will be cached based on
URL. The canonical way to enable cache middleware is to set
``UpdateCacheMiddleware`` as your first piece of middleware, and
``FetchFromCacheMiddleware`` as the last::
MIDDLEWARE_CLASSES = [
'django.middleware.cache.UpdateCa... | mit |
dilawar/moose-core | tests/core/test_pyrun.py | 2 | 7507 | # pyrun.py ---
# Author: Subhasis Ray
# Maintainer: Dilawar Singh
# See https://github.com/BhallaLab/moose-examples/blob/b2e77237ef36e47d0080cc8c4fb6bb94313d2b5e/snippets/pyrun.py
# for details.
import os
import moose
import pytest
import sys
import io
import difflib
stdout_ = sys.stdout
if sys.version_info.major > ... | gpl-3.0 |
gangadharkadam/vlinkfrappe | frappe/model/mapper.py | 4 | 5136 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe, json
from frappe import _
from frappe.utils import cstr
from frappe.model import default_fields
def get_mapped_doc(from_doctype, from_docname, table_maps, target_d... | mit |
beppec56/xbmc | addons/service.xbmc.versioncheck/lib/jsoninterface.py | 89 | 1991 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Team-XBMC
#
# 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 versio... | gpl-2.0 |
jthomas04/C.I.F.G | neo/sys/linux/pk4/id_utils.py | 19 | 6768 | # a collection of utility functions to manipulate pak files
import os, zipfile, md5, pdb
# sorts in reverse alphabetical order like doom does for searching
def list_paks( path ):
files = os.listdir( path )
for i in files:
if ( i[-4:] != '.pk4' ):
files.remove( i )
files.sort()
files.reverse()
return files
... | gpl-3.0 |
openfun/edx-platform | common/test/acceptance/pages/studio/import_export.py | 23 | 8517 | """
Import/Export pages.
"""
from bok_choy.promise import EmptyPromise
import os
import re
import requests
from .utils import click_css
from .library import LibraryPage
from .course_page import CoursePage
from . import BASE_URL
class TemplateCheckMixin(object):
"""
Mixin for verifying that a template is loadi... | agpl-3.0 |
chauhanhardik/populo_2 | lms/djangoapps/class_dashboard/urls.py | 163 | 1470 | """
Class Dashboard API endpoint urls.
"""
from django.conf.urls import patterns, url
from django.conf import settings
COURSE_ID_PATTERN = settings.COURSE_ID_PATTERN
urlpatterns = patterns(
'',
# Json request data for metrics for entire course
url(r'^{}/all_sequential_open_distrib$'.format(settings.COURS... | agpl-3.0 |
MSOpenTech/edx-platform | common/test/acceptance/tests/lms/test_lms_edxnotes.py | 12 | 29664 | import os
from uuid import uuid4
from datetime import datetime
from unittest import skipUnless
from ..helpers import UniqueCourseTest
from ...fixtures.course import CourseFixture, XBlockFixtureDesc
from ...pages.lms.auto_auth import AutoAuthPage
from ...pages.lms.course_nav import CourseNavPage
from ...pages.lms.course... | agpl-3.0 |
chiviak/headphones | lib/requests/packages/urllib3/util/timeout.py | 1004 | 9544 | # The default socket timeout, used by httplib to indicate that no timeout was
# specified by the user
from socket import _GLOBAL_DEFAULT_TIMEOUT
import time
from ..exceptions import TimeoutStateError
# A sentinel value to indicate that no timeout was specified by the user in
# urllib3
_Default = object()
def current... | gpl-3.0 |
sshnaidm/ru | plugin.video.arrr.tv/resources/lib/simplejson/__init__.py | 448 | 12463 | r"""JSON (JavaScript Object Notation) <http://json.org> is a subset of
JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data
interchange format.
:mod:`simplejson` exposes an API familiar to users of the standard library
:mod:`marshal` and :mod:`pickle` modules. It is the externally maintained
version of ... | gpl-2.0 |
cstavr/synnefo | snf-cyclades-app/synnefo/db/migrations/0106_default_volume.py | 10 | 23336 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
"Write your forwards methods here."
# Note: Remember to use orm['appname.ModelName'] rather than "from appname.mo... | gpl-3.0 |
huidesign/googletest | test/gtest_break_on_failure_unittest.py | 2140 | 7339 | #!/usr/bin/env python
#
# Copyright 2006, 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... | bsd-3-clause |
cafecivet/django_girls_tutorial | Lib/encodings/iso8859_5.py | 593 | 13271 | """ Python Character Mapping Codec iso8859_5 generated from 'MAPPINGS/ISO8859/8859-5.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='... | gpl-2.0 |
MassStash/htc_m9_kernel_sense_5.0.2 | 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 |
mujiansu/arangodb | 3rdParty/V8-4.3.61/third_party/python_26/Lib/distutils/tests/test_msvc9compiler.py | 50 | 1231 | """Tests for distutils.msvc9compiler."""
import sys
import unittest
from distutils.errors import DistutilsPlatformError
class msvc9compilerTestCase(unittest.TestCase):
def test_no_compiler(self):
# makes sure query_vcvarsall throws
# a DistutilsPlatformError if the compiler
# is not found... | apache-2.0 |
ksachs/invenio | modules/bibindex/lib/tokenizers/BibIndexAuthorCountTokenizer.py | 8 | 2527 | # -*- coding:utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 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
## License, or (at you... | gpl-2.0 |
Sodki/ansible | lib/ansible/modules/storage/netapp/netapp_e_lun_mapping.py | 27 | 12314 | #!/usr/bin/python
# (c) 2016, NetApp, Inc
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.... | gpl-3.0 |
tobykurien/MakerDroid | assetsrc/public.mp3/fabmetheus_utilities/vector3index.py | 1 | 13371 | """
Vector3 is a three dimensional vector class.
Below are examples of Vector3 use.
>>> from vector3 import Vector3
>>> origin = Vector3()
>>> origin
0.0, 0.0, 0.0
>>> pythagoras = Vector3( 3, 4, 0 )
>>> pythagoras
3.0, 4.0, 0.0
>>> pythagoras.magnitude()
5.0
>>> pythagoras.magnitudeSquared()
25
>>> triplePythagoras ... | gpl-3.0 |
jyt109/termite-data-server | web2py/gluon/validators.py | 5 | 127490 | #!/bin/env python
# -*- coding: utf-8 -*-
"""
This file is part of the web2py Web Framework
Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu>
License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html)
Thanks to ga2arch for help with IS_IN_DB and IS_NOT_IN_DB on GAE
"""
import os
import re
import datetime
impor... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.