repo_name stringlengths 5 100 | path stringlengths 4 375 | copies stringclasses 991
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
vv1133/home_web | django/contrib/gis/tests/relatedapp/tests.py | 58 | 14918 | from __future__ import absolute_import
from django.contrib.gis.geos import HAS_GEOS
from django.contrib.gis.tests.utils import HAS_SPATIAL_DB, mysql, oracle, no_mysql, no_oracle, no_spatialite
from django.test import TestCase
from django.utils.unittest import skipUnless
if HAS_GEOS:
from django.contrib.gis.db.mod... | bsd-3-clause |
google/contentbox | third_party/modeltranslation/manager.py | 5 | 13076 | # -*- coding: utf-8 -*-
"""
The idea of MultilingualManager is taken from
django-linguo by Zach Mathew
https://github.com/zmathew/django-linguo
"""
from django.db import models
from django.db.models import FieldDoesNotExist
from django.db.models.fields.related import RelatedField, RelatedObject
from django.db.models.s... | apache-2.0 |
payjp/payjp-python | payjp/test/helper.py | 1 | 3831 | import datetime
import json
import os
import random
import re
import string
import unittest
from mock import patch, Mock
from six import string_types
import payjp
NOW = datetime.datetime.now()
DUMMY_CARD = {
'number': '4242424242424242',
'exp_month': NOW.month,
'exp_year': NOW.year + 4
}
DUMMY_CHARGE ... | mit |
millaguie/Vernam | vernam/message.py | 1 | 4778 | # -*- coding: utf-8 -*-
"""
Message module holds all methods to work with message files
"""
import sys
import os
import array
from struct import pack
from struct import unpack
import uuid
import hashlib
import keymanagement
import yaml
import ownbase32
from util import hashSum
L2RHEADER = bytearray([222, 210, 7, 163, ... | bsd-3-clause |
dhruvagarwal/django | django/utils/_os.py | 502 | 3581 | from __future__ import unicode_literals
import os
import sys
import tempfile
from os.path import abspath, dirname, isabs, join, normcase, normpath, sep
from django.core.exceptions import SuspiciousFileOperation
from django.utils import six
from django.utils.encoding import force_text
if six.PY2:
fs_encoding = sy... | bsd-3-clause |
kalessin/scrapy | docs/utils/linkfix.py | 141 | 1764 | #!/usr/bin/python
"""
Linkfix - a companion to sphinx's linkcheck builder.
Uses the linkcheck's output file to fix links in docs.
Originally created for this issue:
https://github.com/scrapy/scrapy/issues/606
Author: dufferzafar
"""
import re
# Used for remembering the file (and its contents)
# so we don't have ... | bsd-3-clause |
leejir/darkforce | juggle/codegen/deletenote.py | 3 | 1137 | # 2014-12-17
# build by qianqians
# deletenote
def deletenote(filestr):
genfilestr = []
count = 0
errornote = ""
for i in xrange(len(filestr)):
str = filestr[i]
while(1):
if count == 1:
indexafter = str.find("*/")
if indexafter is not -1:
... | gpl-3.0 |
Ivoz/pip | pip/_vendor/requests/packages/urllib3/util.py | 248 | 21407 | # urllib3/util.py
# Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt)
#
# This module is part of urllib3 and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
from base64 import b64encode
from binascii import hexlify, unhexlify
from collections import name... | mit |
mohamed--abdel-maksoud/chromium.src | mojo/public/third_party/jinja2/environment.py | 614 | 47244 | # -*- coding: utf-8 -*-
"""
jinja2.environment
~~~~~~~~~~~~~~~~~~
Provides a class that holds runtime and parsing time options.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import os
import sys
from jinja2 import nodes
from jinja2.defaults import BLOCK_S... | bsd-3-clause |
R4stl1n/allianceauth | allianceauth/services/modules/smf/views.py | 5 | 5057 | import logging
from django.contrib import messages
from django.contrib.auth.decorators import login_required, permission_required
from django.shortcuts import render, redirect
from allianceauth.services.forms import ServicePasswordForm
from .manager import SmfManager
from .models import SmfUser
from .tasks import Smf... | gpl-2.0 |
u9621071/kernel-uek-UEK3 | 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 |
pmoulon/TheiaSfM | docs/make_docs.py | 19 | 2872 | #!/usr/bin/python
#
# Ceres Solver - A fast non-linear least squares minimizer
# Copyright 2013 Google Inc. All rights reserved.
# http://code.google.com/p/ceres-solver/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#... | bsd-3-clause |
cloudify-cosmo/softlayer-python | SoftLayer/managers/sshkey.py | 5 | 2631 | """
SoftLayer.sshkey
~~~~~~~~~~~~~~~~
SSH Key Manager/helpers
:license: MIT, see LICENSE for more details.
"""
from SoftLayer import utils
class SshKeyManager(utils.IdentifierMixin, object):
"""Manages account SSH keys.
:param SoftLayer.API.Client client: an API client instance
"""
... | mit |
agramian/PythonExternalProgramTestFramework | reportlab/graphics/samples/radar.py | 42 | 3252 | #Autogenerated by ReportLab guiedit do not edit
from reportlab.graphics.charts.legends import Legend
from reportlab.graphics.samples.excelcolors import *
from reportlab.graphics.charts.spider import SpiderChart
from reportlab.graphics.shapes import Drawing, _DrawingEditorMixin, String
from reportlab.graphics.charts.tex... | mit |
TheMOOCAgency/edx-platform | openedx/core/djangoapps/course_groups/tests/test_partition_scheme.py | 7 | 16239 | """
Test the partitions and partitions service
"""
import json
from django.conf import settings
import django.test
from mock import patch
from nose.plugins.attrib import attr
from unittest import skipUnless
from courseware.masquerade import handle_ajax, setup_masquerade
from courseware.tests.test_masquerade import S... | agpl-3.0 |
coberger/DIRAC | DataManagementSystem/scripts/dirac-dms-show-se-status.py | 7 | 1713 | #!/usr/bin/env python
from DIRAC.Core.Base import Script
Script.setUsageMessage( """
Get status of the available Storage Elements
Usage:
%s [<options>]
""" % Script.scriptName )
Script.parseCommandLine()
import DIRAC
from DIRAC import gConfig,gLogger
from DIRAC.Resour... | gpl-3.0 |
nafraf/spreads | spreadsplug/intervaltrigger.py | 5 | 2788 | # -*- coding: utf-8 -*-
# Copyright (C) 2014 Johannes Baiter <johannes.baiter@gmail.com>
#
# 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
# License, or (at your ... | agpl-3.0 |
alexalemi/battleship | players/util.py | 1 | 3217 | """
Author: Alex Alemi
Some utility routines for python players
"""
import logging
import socket
import os
import sys
from random import randrange
ship_sizes = {"A": 5, "B": 4, "D": 3, "S": 3, "P": 2}
def board_str(board):
""" Return the many lined string for a board """
boardstr = ""
for i in xrange(10):... | mit |
GorK-ChO/selenium | py/test/selenium/webdriver/chrome/chrome_network_emulation_tests.py | 29 | 1252 | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | apache-2.0 |
OpenPymeMx/account-financial-reporting | account_financial_report_webkit/report/partner_balance.py | 29 | 4238 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Author: Guewen Baconnier
# Copyright Camptocamp SA 2011
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# ... | agpl-3.0 |
itkinside/ufs | itkufs/common/views/display.py | 1 | 3418 | from operator import itemgetter
from django.contrib.auth.decorators import login_required
from django.contrib import messages
from django.shortcuts import render
from itkufs.common.decorators import limit_to_group, limit_to_owner
from itkufs.accounting.models import Account, Group
@login_required
@limit_to_group
de... | gpl-2.0 |
bbbenja/SickRage | lib/sqlalchemy/dialects/oracle/zxjdbc.py | 79 | 7744 | # oracle/zxjdbc.py
# Copyright (C) 2005-2014 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
.. dialect:: oracle+zxjdbc
:name: zxJDBC for Jython
:dbapi: zxjdbc
:c... | gpl-3.0 |
sleepinghungry/wwif | students/simone/aiy yiy yiy.py | 1 | 1028 | Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:18:55) [MSC v.1900 64 bit (AMD64)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> file
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
file
NameError: name 'file' is not defined
>>>
RESTART: Z:\Coding Cl... | mit |
ganxueliang88/idracserver | idrac/log_api.py | 3 | 2265 | # coding: utf-8
from argparse import ArgumentParser, FileType
from contextlib import closing
from io import open as copen
from json import dumps
from math import ceil
import re
from os.path import basename, dirname, exists, join
from struct import unpack
from subprocess import Popen
from sys import platform, prefix, ... | gpl-2.0 |
LIS/lis-tempest | tempest/tests/cmd/test_tempest_init.py | 3 | 4205 | # Copyright 2015 Hewlett-Packard Development Company, L.P.
#
# 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 applicabl... | apache-2.0 |
Teamxrtc/webrtc-streaming-node | third_party/webrtc/src/chromium/src/tools/metrics/histograms/update_bad_message_reasons.py | 31 | 1275 | # Copyright 2015 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.
"""Updates the various BadMessage enums in histograms.xml file with values read
from the corresponding bad_message.h files.
If the file was pretty-printed, ... | mit |
autosportlabs/kivy | kivy/core/clipboard/__init__.py | 9 | 4563 | '''
Clipboard
=========
Core class for accessing the Clipboard. If we are not able to access the
system clipboard, a fake one will be used.
Usage example:
.. code-block:: kv
#:import Clipboard kivy.core.clipboard.Clipboard
Button:
on_release:
self.text = Clipboard.paste()
Cl... | mit |
abelfunctions/abelfunctions | examples/riemanntheta_demo.py | 2 | 8564 | """
Grady Williams
January 28, 2013
This module provides functions for displaying graphs of the Riemann-Theta
function. There are 12 different graphs that can be generated, 10 of them
correspond to the graphics shown on the Digital Library of Mathematical
Functions page for Riemann Theta (dlmf.nist.gov/21.4) and the ... | mit |
laurent-george/bokeh | examples/glyphs/data_tables.py | 41 | 3178 | from bokeh.io import vplot
from bokeh.models import ColumnDataSource, DataRange1d, Plot, LinearAxis, Grid, Circle, HoverTool, BoxSelectTool
from bokeh.models.widgets import DataTable, TableColumn, StringFormatter, NumberFormatter, StringEditor, IntEditor, NumberEditor, SelectEditor
from bokeh.embed import file_html
fro... | bsd-3-clause |
Gabrielcarvfer/NS3 | src/bridge/bindings/modulegen__gcc_LP64.py | 4 | 283981 | from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warnings.warn("exception %r in wrapper %s" % (exception, wrapper))
... | gpl-2.0 |
viniciusgama/blog_gae | django/contrib/gis/gdal/prototypes/srs.py | 321 | 3378 | from ctypes import c_char_p, c_int, c_void_p, POINTER
from django.contrib.gis.gdal.libgdal import lgdal, std_call
from django.contrib.gis.gdal.prototypes.generation import \
const_string_output, double_output, int_output, \
srs_output, string_output, void_output
## Shortcut generation for routines with known p... | bsd-3-clause |
GbalsaC/bitnamiP | venv/lib/python2.7/site-packages/social/backends/nk.py | 70 | 2723 | from urllib import urlencode
import six
from requests_oauthlib import OAuth1
from social.backends.oauth import BaseOAuth2
class NKOAuth2(BaseOAuth2):
"""NK OAuth authentication backend"""
name = 'nk'
AUTHORIZATION_URL = 'https://nk.pl/oauth2/login'
ACCESS_TOKEN_URL = 'https://nk.pl/oauth2/token'
... | agpl-3.0 |
Senseg/Py4A | python-modules/twisted/twisted/python/urlpath.py | 81 | 3431 | # -*- test-case-name: twisted.test.test_paths -*-
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
#
import urlparse
import urllib
class URLPath:
def __init__(self, scheme='', netloc='localhost', path='',
query='', fragment=''):
self.scheme = scheme or 'h... | apache-2.0 |
48thct2jtnf/P | contrib/linearize/linearize-hashes.py | 18 | 3037 | #!/usr/bin/python
#
# linearize-hashes.py: List blocks in a linear, no-fork version of the chain.
#
# Copyright (c) 2013-2014 The Bitcoin developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
from __future__ import pri... | mit |
RPGOne/Skynet | scikit-learn-c604ac39ad0e5b066d964df3e8f31ba7ebda1e0e/examples/linear_model/plot_ridge_path.py | 254 | 1655 | """
===========================================================
Plot Ridge coefficients as a function of the regularization
===========================================================
Shows the effect of collinearity in the coefficients of an estimator.
.. currentmodule:: sklearn.linear_model
:class:`Ridge` Regressi... | bsd-3-clause |
wwfifi/uliweb | uliweb/orm/__init__.py | 1 | 148065 | # This module is used for wrapping SqlAlchemy to a simple ORM
# Author: limodou <limodou@gmail.com>
__all__ = ['Field', 'get_connection', 'Model', 'do_',
'set_debug_query', 'set_auto_create', 'set_auto_set_model',
'get_model', 'set_model', 'engine_manager',
'set_auto_transaction_in_web', 'set_auto_trans... | bsd-2-clause |
guillaume-philippon/aquilon | lib/aquilon/worker/processes.py | 1 | 37384 | # -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2008,2009,2010,2011,2012,2013,2014,2015,2016 Contributor
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You ma... | apache-2.0 |
kofkings/RSA_python | RSA.py | 1 | 5017 | import random
from fractions import gcd
def RSA(plainText):
# Generate Key
# p, q is 2 random large prime (512 bit)
p = generateLargePrime(512)
q = generateLargePrime(512)
while p == q:
q = generateLargePrime(512)
n = p * q
totientN = (p - 1) * (q - 1)
# PublicKey = random in (... | gpl-3.0 |
CuriosoInformatico/HoneyCheck | dhcp_watchmen.py | 1 | 3960 | import logging.config
logging.getLogger('scapy.runtime').setLevel(logging.ERROR)
from threading import Thread
from scapy.all import *
import time
logger = logging.getLogger(name='elchicodepython.honeycheck')
def exec_array( array, **kwargs):
for object, method in array:
method(object, **kwargs) # == ob... | mit |
MotorolaMobilityLLC/external-chromium_org | third_party/gtk+/gtk/compose-parse.py | 149 | 34346 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# compose-parse.py, version 1.3
#
# multifunction script that helps manage the compose sequence table in GTK+ (gtk/gtkimcontextsimple.c)
# the script produces statistics and information about the whole process, run with --help for more.
#
# You may need to switch your pyt... | bsd-3-clause |
byndcivilization/toy-infrastructure | flask-app/venv/lib/python3.6/site-packages/pip/utils/ui.py | 490 | 11597 | from __future__ import absolute_import
from __future__ import division
import itertools
import sys
from signal import signal, SIGINT, default_int_handler
import time
import contextlib
import logging
from pip.compat import WINDOWS
from pip.utils import format_size
from pip.utils.logging import get_indentation
from pip... | gpl-3.0 |
DavidNorman/tensorflow | tensorflow/python/kernel_tests/proto/proto_op_test_base.py | 22 | 16705 | # =============================================================================
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#... | apache-2.0 |
WPMedia/dd-agent | utils/proxy.py | 8 | 2497 | # (C) Datadog, Inc. 2010-2016
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
import logging
import os
from urllib import getproxies
from urlparse import urlparse
log = logging.getLogger(__name__)
def set_no_proxy_settings():
"""
Starting with Agent 5.0.0, there should always be ... | bsd-3-clause |
LinusU/ansible | lib/ansible/cli/vault.py | 52 | 5972 | # (c) 2014, James Tanner <tanner.jc@gmail.com>
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed i... | gpl-3.0 |
knuevena/americorps-backend | orgmember.py | 1 | 4018 | from user import User
from db import Base, Session
from sqlalchemy import *
from sqlalchemy.orm import relation, sessionmaker
from datetime import datetime, date
from attendee import Attendee
from werkzeug.security import generate_password_hash, check_password_hash
from flask import json
from sqlalchemy import exc
from... | mit |
linkedin/indextank-service | api/boto/ec2/__init__.py | 10 | 2038 | # Copyright (c) 2006-2008 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 rights to use, copy, modi... | apache-2.0 |
apagac/cfme_tests | cfme/tests/infrastructure/test_vm_power_control.py | 1 | 27862 | # -*- coding: utf-8 -*-
import random
import time
import pytest
from cfme import test_requirements
from cfme.base.credential import Credential
from cfme.base.login import BaseLoggedInPage
from cfme.infrastructure.provider import InfraProvider
from cfme.infrastructure.provider.rhevm import RHEVMProvider
from cfme.infr... | gpl-2.0 |
NeovaHealth/odoo | addons/stock_account/wizard/stock_return_picking.py | 342 | 2715 | # -*- 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 |
aperigault/ansible | lib/ansible/modules/storage/netapp/na_ontap_cluster.py | 26 | 10668 | #!/usr/bin/python
# (c) 2017, NetApp, 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',
'status': ['preview'],
... | gpl-3.0 |
linked67/p2pool-lire | wstools/TimeoutSocket.py | 293 | 5293 | """Based on code from timeout_socket.py, with some tweaks for compatibility.
These tweaks should really be rolled back into timeout_socket, but it's
not totally clear who is maintaining it at this point. In the meantime,
we'll use a different module name for our tweaked version to avoid any
confusion.
T... | gpl-3.0 |
sugartom/tensorflow-alien | tensorflow/contrib/bayesflow/__init__.py | 57 | 1871 | # 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 |
NEricN/RobotCSimulator | Python/App/Lib/site-packages/pip/backwardcompat/__init__.py | 394 | 3756 | """Stuff that differs in different Python versions and platform
distributions."""
import os
import imp
import sys
import site
__all__ = ['WindowsError']
uses_pycache = hasattr(imp, 'cache_from_source')
class NeverUsedException(Exception):
"""this exception should never be raised"""
try:
WindowsError = Wind... | apache-2.0 |
localu/metagoofil | hachoir_parser/container/swf.py | 84 | 16477 | """
SWF (Macromedia/Adobe Flash) file parser.
Documentation:
- Alexis' SWF Reference:
http://www.m2osw.com/swf_alexref.html
- http://www.half-serious.com/swf/format/
- http://www.anotherbigidea.com/javaswf/
- http://www.gnu.org/software/gnash/
Author: Victor Stinner
Creation date: 29 october 2006
"""
from ha... | gpl-2.0 |
chen0031/Dato-Core | src/unity/python/doc/scripts/doxypy-0.4.2.py | 15 | 14005 | #!/usr/bin/env python
__applicationName__ = "doxypy"
__blurb__ = """
doxypy is an input filter for Doxygen. It preprocesses python
files so that docstrings of classes and functions are reformatted
into Doxygen-conform documentation blocks.
"""
__doc__ = __blurb__ + \
"""
In order to make Doxygen preprocess files thro... | agpl-3.0 |
rplevka/selenium | py/test/selenium/webdriver/common/rendered_webelement_tests.py | 63 | 3233 | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | apache-2.0 |
slohse/ansible | lib/ansible/modules/system/alternatives.py | 29 | 5286 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Gabe Mulley <gabe.mulley@gmail.com>
# (c) 2015, David Wittman <dwittman@gmail.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
... | gpl-3.0 |
mapr/hue | desktop/core/ext-py/Django-1.6.10/tests/model_fields/test_imagefield.py | 54 | 16032 | from __future__ import absolute_import
import os
import shutil
from django.core.exceptions import ImproperlyConfigured
from django.core.files import File
from django.core.files.images import ImageFile
from django.test import TestCase
from django.utils._os import upath
from django.utils.unittest import skipIf
try:
... | apache-2.0 |
rfinn/LCS | paper1code/LCSreadmaster.v2.py | 1 | 46244 | #!/usr/bin/env python
import pyfits
from LCScommon import *
from pylab import *
import os
import mystuff as my
#these correpond to area w/more uniform covereage
MKW824um=array([220.16377,3.4883817,1.3137727,2.5,12.7456],'f')
MKW1124um=array([202.36305,11.746882,1.2454248,2.9,206.4],'f')
NGC24um=array([244.30994,34.933... | gpl-3.0 |
Endika/edx-platform | common/lib/xmodule/xmodule/modulestore/tests/test_mixed_modulestore.py | 7 | 136521 | """
Unit tests for the Mixed Modulestore, with DDT for the various stores (Split, Draft, XML)
"""
from collections import namedtuple
import datetime
import logging
import ddt
import itertools
import mimetypes
from uuid import uuid4
from contextlib import contextmanager
from mock import patch, Mock, call
# Mixed module... | agpl-3.0 |
openshift/openshift-tools | scripts/monitoring/cron-send-os-skydns-checks.py | 12 | 6971 | #!/usr/bin/env python
# vim: expandtab:tabstop=4:shiftwidth=4
'''
Send Openshift Master SkyDNS metric checks to Zagg
Openshift uses SkyDNS to locate services inside of the cluster.
Openshift implements SkyDNS a bit different. Normally SkyDNS uses etcd as a backend
for the DNS data to be stored. Openshift us... | apache-2.0 |
CVL-GitHub/karaage | karaage/legacy/institutes/south_migrations/0002_move_instutute_models_to_institutes_app.py | 3 | 8280 | # -*- coding: utf-8 -*-
from south.v2 import SchemaMigration
class Migration(SchemaMigration):
depends_on = (
("people", "0012_move_instutute_models_to_institutes_app"),
)
def forwards(self, orm):
# moved logic to karaage.people.migrations.0012_move_instutute_models_to_institutes_app
... | gpl-3.0 |
morphis/home-assistant | homeassistant/components/light/yeelight.py | 4 | 10411 | """
Support for Xiaomi Yeelight Wifi color bulb.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/light.yeelight/
"""
import logging
import colorsys
import voluptuous as vol
from homeassistant.util.color import (
color_temperature_mired_to_kelvin as ... | apache-2.0 |
yohanko88/gem5-DC | src/python/m5/params.py | 7 | 69061 | # Copyright (c) 2012-2014 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the functiona... | bsd-3-clause |
h8rift/android_kernel_htc_msm8960-evita-1_85 | tools/perf/scripts/python/check-perf-trace.py | 11214 | 2503 | # perf script event handlers, generated by perf script -g python
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# This script tests basic functionality such as flag and symbol
# strings, common_xxx() calls back into perf, begin, end, unhandled
# events, etc. ... | gpl-2.0 |
mikebrevard/UnixAdministration | vagrant/etc/data/genData/venv/lib/python3.4/site-packages/setuptools/depends.py | 462 | 6370 | import sys
import imp
import marshal
from imp import PKG_DIRECTORY, PY_COMPILED, PY_SOURCE, PY_FROZEN
from distutils.version import StrictVersion
from setuptools import compat
__all__ = [
'Require', 'find_module', 'get_module_constant', 'extract_constant'
]
class Require:
"""A prerequisite to building or inst... | mit |
arkmaxim/grpc | src/python/grpcio/grpc/framework/foundation/logging_pool.py | 21 | 3030 | # Copyright 2015, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | bsd-3-clause |
pingpan2013/sensor-box-project | sensor_project/sensor_box.py | 1 | 6325 | #!/usr/bin/env python
#
# File Name: sensor_box.py
#
# Desc:
# Control the sensor to get humidity and moisture infomation
# If internet is down, store the result into local files
# else send the data to the database
#
import os
import time
import datetime
import logging
import subprocess
import RPi.GPIO as GPIO
impo... | gpl-3.0 |
ict-felix/stack | modules/resource/manager/transit-network/src/proxy_interface.py | 2 | 1172 | # Copyright 2014-2015 National Institute of Advanced Industrial Science and Technology
#
# 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
#
# U... | apache-2.0 |
apophys/freeipa | ipaclient/remote_plugins/2_156/netgroup.py | 16 | 24373 | #
# Copyright (C) 2016 FreeIPA Contributors see COPYING for license
#
# pylint: disable=unused-import
import six
from . import Command, Method, Object
from ipalib import api, parameters, output
from ipalib.parameters import DefaultFrom
from ipalib.plugable import Registry
from ipalib.text import _
from ipapython.dn ... | gpl-3.0 |
pjbull/mkdocs | mkdocs/commands/new.py | 30 | 1433 | # coding: utf-8
from __future__ import unicode_literals
import io
import logging
import os
config_text = 'site_name: My Docs\n'
index_text = """# Welcome to MkDocs
For full documentation visit [mkdocs.org](http://mkdocs.org).
## Commands
* `mkdocs new [dir-name]` - Create a new project.
* `mkdocs serve` - Start th... | bsd-2-clause |
xNovax/SickRage | lib/unidecode/x091.py | 252 | 4655 | data = (
'Ruo ', # 0x00
'Bei ', # 0x01
'E ', # 0x02
'Yu ', # 0x03
'Juan ', # 0x04
'Yu ', # 0x05
'Yun ', # 0x06
'Hou ', # 0x07
'Kui ', # 0x08
'Xiang ', # 0x09
'Xiang ', # 0x0a
'Sou ', # 0x0b
'Tang ', # 0x0c
'Ming ', # 0x0d
'Xi ', # 0x0e
'Ru ', # 0x0f
'Chu ', # 0x10
'Zi ... | gpl-3.0 |
jameskdev/lge-kernel-batman_skt | tools/perf/python/twatch.py | 3213 | 1338 | #! /usr/bin/python
# -*- python -*-
# -*- coding: utf-8 -*-
# twatch - Experimental use of the perf python interface
# Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com>
#
# This application is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License... | gpl-2.0 |
damonkohler/sl4a | python/xmpppy/doc/examples/xtalk.py | 87 | 2951 | #!/usr/bin/python
# $Id: xtalk.py,v 1.4 2008/08/09 17:00:18 normanr Exp $
import sys,os,xmpp,time,select
class Bot:
def __init__(self,jabber,remotejid):
self.jabber = jabber
self.remotejid = remotejid
def register_handlers(self):
self.jabber.RegisterHandler('message',self.xmpp_message... | apache-2.0 |
yesudeep/cmc | app/console/app/pygments/styles/native.py | 23 | 1917 | # -*- coding: utf-8 -*-
"""
pygments.styles.native
~~~~~~~~~~~~~~~~~~~~~~
pygments version of my "native" vim theme.
:copyright: 2006-2007 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from pygments.style import Style
from pygments.token import Keyword, Name, Comment, String... | mit |
zzicewind/linux | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py | 1891 | 3300 | # Core.py - Python extension for perf script, core functions
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
from collections import defaultdict
def aut... | gpl-2.0 |
mindpin/mindpin_oppia | core/controllers/reader.py | 1 | 11151 | # Copyright 2014 The Oppia 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 applicable ... | apache-2.0 |
madan96/sympy | sympy/printing/rcode.py | 7 | 14467 | """
R code printer
The RCodePrinter converts single sympy expressions into single R expressions,
using the functions defined in math.h where possible.
"""
from __future__ import print_function, division
from sympy.core import S
from sympy.core.compatibility import string_types, range
from sympy.codegen.ast import... | bsd-3-clause |
jss-emr/openerp-7-src | openerp/addons/l10n_br/__init__.py | 430 | 1403 | # -*- encoding: utf-8 -*-
###############################################################################
# #
# Copyright (C) 2009 Renato Lima - Akretion #
# ... | agpl-3.0 |
siconos/siconos-deb | wrap/doxy2swig.py | 1 | 17516 | #!/usr/bin/env python
"""Doxygen XML to SWIG docstring converter.
Usage:
doxy2swig.py [options] input.xml output.i
Converts Doxygen generated XML files into a file containing docstrings
that can be used by SWIG-1.3.x. Note that you need to get SWIG
version > 1.3.23 or use Robin Dunn's docstring patch to be able t... | apache-2.0 |
TechInvestLab/dot15926 | editor_qt/iso15926/patterns/patterns_actions.py | 1 | 15984 | """
.15925 Editor
Copyright 2014 TechInvestLab.ru dot15926@gmail.com
.15925 Editor 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 3.0 of the License, or (at your option) any later version.... | lgpl-3.0 |
vprime/puuuu | env/lib/python2.7/site-packages/django/utils/translation/trans_real.py | 35 | 25577 | """Translation helper functions."""
from __future__ import unicode_literals
import locale
import os
import re
import sys
import gettext as gettext_module
from threading import local
import warnings
from django.utils.importlib import import_module
from django.utils.datastructures import SortedDict
from django.utils.en... | mit |
towerjoo/mindsbook | django/contrib/localflavor/es/forms.py | 309 | 7537 | # -*- coding: utf-8 -*-
"""
Spanish-specific Form helpers
"""
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import RegexField, Select
from django.utils.translation import ugettext_lazy as _
import re
class ESPostalCodeField(RegexField):
"""
A... | bsd-3-clause |
GarciaPL/TrafficCity | Streets4MPI/utils.py | 2 | 1073 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# utils.py
# Copyright 2012 Joachim Nitschke
#
# This file is part of Streets4MPI.
#
# Streets4MPI is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version... | gpl-2.0 |
google-research/privateFM | privateFM/FM_simulate.py | 1 | 4753 | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | apache-2.0 |
adconk/grandmaangieskitchen | node_modules/gulp-sass/node_modules/node-sass/node_modules/pangyp/gyp/pylib/gyp/common.py | 366 | 19638 | # 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.
from __future__ import with_statement
import collections
import errno
import filecmp
import os.path
import re
import tempfile
import sys
# A minimal memoizing d... | apache-2.0 |
GoogleCloudPlatform/training-data-analyst | courses/machine_learning/deepdive2/structured/labs/serving/application/lib/click/_compat.py | 19 | 23399 | import re
import io
import os
import sys
import codecs
from weakref import WeakKeyDictionary
PY2 = sys.version_info[0] == 2
CYGWIN = sys.platform.startswith('cygwin')
# Determine local App Engine environment, per Google's own suggestion
APP_ENGINE = ('APPENGINE_RUNTIME' in os.environ and
'Development/' ... | apache-2.0 |
CCI-MOC/nova | nova/config.py | 14 | 2488 | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# Copyright 2012 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the ... | apache-2.0 |
fx19880617/helix | helix-core/src/main/scripts/integration-test/script/pexpect.py | 11 | 76727 | #
# 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... | apache-2.0 |
google/llvm-propeller | lldb/test/API/lang/objc/objc-struct-argument/TestObjCStructArgument.py | 3 | 2329 | """Test passing structs to Objective-C methods."""
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class TestObjCStructArgument(TestBase):
mydir = TestBase.compute_mydir(__file__)
def setUp(self):
# Call super's setUp()... | apache-2.0 |
sharifulgeo/networkx | networkx/algorithms/components/tests/test_semiconnected.py | 64 | 1901 | from itertools import chain
import networkx as nx
from nose.tools import *
class TestIsSemiconnected(object):
def test_undirected(self):
assert_raises(nx.NetworkXNotImplemented, nx.is_semiconnected,
nx.Graph())
assert_raises(nx.NetworkXNotImplemented, nx.is_semiconnected,
... | bsd-3-clause |
oliviertilmans/ipmininet | ipmininet/host/config/named.py | 1 | 15108 | """Base classes to configure a Named daemon"""
import os
from typing import List, Union, Sequence, Optional
from ipaddress import IPv4Address, IPv6Address, ip_address
from mininet.log import lg
from ipmininet.overlay import Overlay
from ipmininet.utils import realIntfList, find_node, has_cmd
from ipmininet.router.con... | gpl-2.0 |
a113n/bcbio-nextgen | bcbio/distributed/multi.py | 4 | 3761 | """Run tasks in parallel on a single machine using multiple cores.
"""
import functools
try:
import joblib
except ImportError:
joblib = False
from bcbio.distributed import resources
from bcbio.log import logger, setup_local_logging
from bcbio.pipeline import config_utils
from bcbio.provenance import diagnosti... | mit |
quizlet/grpc | tools/run_tests/python_utils/upload_test_results.py | 7 | 4239 | #!/usr/bin/env python
# Copyright 2017 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | apache-2.0 |
tcheehow/MissionPlanner | Lib/email/_parseaddr.py | 53 | 16241 | # Copyright (C) 2002-2007 Python Software Foundation
# Contact: email-sig@python.org
"""Email address parsing code.
Lifted directly from rfc822.py. This should eventually be rewritten.
"""
__all__ = [
'mktime_tz',
'parsedate',
'parsedate_tz',
'quote',
]
import time
SPACE = ' '... | gpl-3.0 |
don-github/edx-platform | lms/djangoapps/lms_xblock/test/test_runtime.py | 92 | 6099 | """
Tests of the LMS XBlock Runtime and associated utilities
"""
from django.contrib.auth.models import User
from django.conf import settings
from ddt import ddt, data
from mock import Mock
from unittest import TestCase
from urlparse import urlparse
from opaque_keys.edx.locations import SlashSeparatedCourseKey
from lm... | agpl-3.0 |
Sjors/bitcoin | test/functional/wallet_backup.py | 22 | 8943 | #!/usr/bin/env python3
# Copyright (c) 2014-2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the wallet backup features.
Test case is:
4 nodes. 1 2 and 3 send transactions between each other... | mit |
santisiri/popego | envs/ALPHA-POPEGO/lib/python2.5/site-packages/twisted/test/test_error.py | 20 | 4619 |
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
from twisted.trial import unittest
from twisted.internet import error
import socket
class TestStringification(unittest.TestCase):
"""Test that the exceptions have useful stringifications.
"""
listOfTests = [
#(out... | bsd-3-clause |
amyvmiwei/neon | neon/util/param.py | 4 | 1219 | # ----------------------------------------------------------------------------
# Copyright 2014 Nervana Systems 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.o... | apache-2.0 |
tysonclugg/django | tests/template_loader/tests.py | 153 | 7435 | from django.template import TemplateDoesNotExist
from django.template.loader import (
get_template, render_to_string, select_template,
)
from django.test import SimpleTestCase, override_settings
from django.test.client import RequestFactory
@override_settings(TEMPLATES=[{
'BACKEND': 'django.template.backends.... | bsd-3-clause |
wearpants/osf.io | website/addons/box/tests/test_serializer.py | 11 | 1096 | # -*- coding: utf-8 -*-
"""Serializer tests for the Box addon."""
import mock
from nose.tools import * # noqa (PEP8 asserts)
from website.addons.base.testing.serializers import StorageAddonSerializerTestSuiteMixin
from website.addons.box.tests.utils import MockBox
from website.addons.box.tests.factories import BoxAcc... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.