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 |
|---|---|---|---|---|---|
etetoolkit/ete | ete3/citation.py | 3 | 6080 | # -*- coding: utf-8 -*-
# #START_LICENSE###########################################################
#
#
# This file is part of the Environment for Tree Exploration program
# (ETE). http://etetoolkit.org
#
# ETE is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public Lice... | gpl-3.0 |
apocquet/django | django/contrib/syndication/views.py | 192 | 8680 | from __future__ import unicode_literals
from calendar import timegm
from django.conf import settings
from django.contrib.sites.shortcuts import get_current_site
from django.core.exceptions import ImproperlyConfigured, ObjectDoesNotExist
from django.http import Http404, HttpResponse
from django.template import Templat... | bsd-3-clause |
kou/zulip | zerver/tornado/django_api.py | 2 | 5777 | from functools import lru_cache
from typing import Any, Container, Dict, Iterable, List, Mapping, Optional, Sequence, Tuple, Union
from urllib.parse import urlparse
import orjson
import requests
from django.conf import settings
from requests.adapters import ConnectionError, HTTPAdapter
from requests.models import Prep... | apache-2.0 |
MeirKriheli/Open-Knesset | auxiliary/management/commands/process_tags_file.py | 14 | 4517 | import os, csv
from django.core.management.base import BaseCommand, CommandError
from optparse import make_option
from django.conf import settings
from auxiliary.models import TagSynonym
from tagging.models import Tag
from django.db import IntegrityError
DATA_ROOT = getattr(settings, 'DATA_ROOT',
os.path.join(sett... | bsd-3-clause |
lenovo-yt2-dev/android_kernel_lenovo_baytrail | scripts/rt-tester/rt-tester.py | 11005 | 5307 | #!/usr/bin/python
#
# rt-mutex tester
#
# (C) 2006 Thomas Gleixner <tglx@linutronix.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
import os
import sys
import getopt
import sh... | gpl-2.0 |
mixturemodel-flow/tensorflow | tensorflow/contrib/keras/api/keras/applications/inception_v3/__init__.py | 57 | 1167 | # 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 |
guilhermetavares/django-debug-toolbar | debug_toolbar/middleware.py | 8 | 5364 | """
Debug Toolbar middleware
"""
from __future__ import absolute_import, unicode_literals
import re
import threading
from django.conf import settings
from django.utils.encoding import force_text
from django.utils import six
from debug_toolbar.toolbar import DebugToolbar
from debug_toolbar import settings as dt_sett... | bsd-3-clause |
ppmim/AFOSN | run_patch.py | 1 | 7925 | """
DESCRIPTION
-----------
For each directory provided on the command line the
headers all of the FITS files in that directory are modified
to add information like LST, apparent object position, and more.
See the full documentation for a list of the specific keywords
that are modified.
Header patching
^^^^^^^^^^^^^^... | gpl-2.0 |
Ripley6811/TAIMAU | src/db_tools/TM2014_tables_v3.py | 1 | 20670 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Version 3 splits Order into Order and OrderItem,
Shipment into Shipment and ShipmentItem.
Just as Invoice was split from version 1 to 2.
InvoiceItem and ShipmentItem now reference each other.
Invoice number is removed as primary key and placed with integer.
NOTE: Cla... | gpl-2.0 |
snasoft/QtCreatorPluginsPack | Bin/3rdParty/vera/bin/lib/email/charset.py | 180 | 16043 | # Copyright (C) 2001-2006 Python Software Foundation
# Author: Ben Gertzfield, Barry Warsaw
# Contact: email-sig@python.org
__all__ = [
'Charset',
'add_alias',
'add_charset',
'add_codec',
]
import codecs
import email.base64mime
import email.quoprimime
from email import errors
from email.encoders ... | lgpl-3.0 |
openpeer/webrtc-gyp | pylib/gyp/easy_xml.py | 1049 | 4803 | # Copyright (c) 2011 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import re
import os
def XmlToString(content, encoding='utf-8', pretty=False):
""" Writes the XML content to disk, touching the file only if it has changed.
... | bsd-3-clause |
mikelseverson/Udacity-Deep_Learning-Nanodegree | weight-initialization/helper.py | 153 | 3649 | import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
def hist_dist(title, distribution_tensor, hist_range=(-4, 4)):
"""
Display histogram of a TF distribution
"""
with tf.Session() as sess:
values = sess.run(distribution_tensor)
plt.title(title)
plt.hist(values, ... | mit |
jemekite/Dougpool | setup.py | 197 | 2181 | import os
import shutil
import sys
import zipfile
import platform
from distutils.core import setup
from distutils.sysconfig import get_python_lib
import py2exe
version = __import__('p2pool').__version__
im64 = '64' in platform.architecture()[0]
if os.path.exists('INITBAK'):
os.remove('INITBAK')
os.rename(os.path... | gpl-3.0 |
bheesham/servo | tests/wpt/css-tests/tools/sslutils/openssl.py | 253 | 13023 | import functools
import os
import shutil
import subprocess
import tempfile
from datetime import datetime
class OpenSSL(object):
def __init__(self, logger, binary, base_path, conf_path, hosts, duration,
base_conf_path=None):
"""Context manager for interacting with OpenSSL.
Creates a... | mpl-2.0 |
x2nie/odoo | addons/hr_contract/__openerp__.py | 52 | 1877 | # -*- 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 |
atila1974/AK-OnePlusOne-CAF | tools/perf/scripts/python/sctop.py | 11180 | 1924 | # system call top
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Periodically displays system-wide system call totals, broken down by
# syscall. If a [comm] arg is specified, only syscalls called by
# [comm] are displayed. If an [interval] arg is specified,... | gpl-2.0 |
ychen820/microblog | y/google-cloud-sdk/platform/google_appengine/lib/django-1.4/django/http/__init__.py | 41 | 30763 | from __future__ import absolute_import
import datetime
import os
import re
import sys
import time
import warnings
from pprint import pformat
from urllib import urlencode, quote
from urlparse import urljoin, urlparse
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
try:
... | bsd-3-clause |
antoviaque/edx-platform | common/test/acceptance/pages/studio/video/video.py | 14 | 22307 | """
CMS Video
"""
import time
import os
import requests
from bok_choy.promise import EmptyPromise, Promise
from bok_choy.javascript import wait_for_js, js_defined
from ....tests.helpers import YouTubeStubConfig
from ...lms.video.video import VideoPage
from ...common.utils import wait_for_notification
from selenium.webd... | agpl-3.0 |
varunarya10/nova_test_latest | nova/api/openstack/__init__.py | 7 | 18970 | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# 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 ... | apache-2.0 |
drhagen/parsita | tests/test_basic.py | 1 | 18599 | from unittest import TestCase
import pytest
from parsita import *
class LiteralTestCase(TestCase):
def test_literals(self):
class TestParsers(GeneralParsers):
a = lit('a')
bb = lit('bb')
self.assertEqual(TestParsers.a.parse('a'), Success('a'))
self.assertEqual(Te... | mit |
axinging/chromium-crosswalk | tools/cr/cr/commands/info.py | 59 | 1276 | # 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.
"""A module for the info implementation of Command."""
import cr
class InfoCommand(cr.Command):
"""The cr info command implementation."""
def __init_... | bsd-3-clause |
GbalsaC/bitnamiP | venv/lib/python2.7/site-packages/newrelic-2.46.0.37/newrelic/packages/requests/packages/chardet/jpcntx.py | 1777 | 19348 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client 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 R... | agpl-3.0 |
Fireblend/chromium-crosswalk | media/tools/layout_tests/layouttest_analyzer_helpers.py | 120 | 23084 | # Copyright (c) 2012 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.
"""Helper functions for the layout test analyzer."""
from datetime import datetime
from email.mime.multipart import MIMEMultipart
from email.mime.text i... | bsd-3-clause |
drewkhoury/aws-daredevil | daredevil.py | 1 | 2729 | import boto3
from pprint import pprint
from datetime import datetime
import time
def make_tag_dict(ec2_object):
"""Given an tagable ec2_object, return dictionary of existing tags."""
tag_dict = {}
if ec2_object.tags is None: return tag_dict
for tag in ec2_object.tags:
tag_dict[tag['Key']] = tag... | mit |
abzaloid/maps | django-project/lib/python2.7/site-packages/django/template/engine.py | 37 | 10786 | import warnings
from django.core.exceptions import ImproperlyConfigured
from django.utils import lru_cache, six
from django.utils.deprecation import RemovedInDjango20Warning
from django.utils.functional import cached_property
from django.utils.module_loading import import_string
from .base import Context, Lexer, Pars... | mit |
Branlala/docker-sickbeardfr | sickbeard/lib/hachoir_metadata/audio.py | 90 | 15495 | from lib.hachoir_metadata.metadata import (registerExtractor,
Metadata, RootMetadata, MultipleMetadata)
from lib.hachoir_parser.audio import AuFile, MpegAudioFile, RealAudioFile, AiffFile, FlacParser
from lib.hachoir_parser.container import OggFile, RealMediaFile
from lib.hachoir_core.i18n import _
from lib.hachoir... | mit |
ducthien1490/youtube-dl | youtube_dl/extractor/nfl.py | 76 | 6197 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_urllib_parse_urlparse,
)
from ..utils import (
ExtractorError,
int_or_none,
remove_end,
)
class NFLIE(InfoExtractor):
IE_NAME = 'nfl.com'
_VALID_URL = r'''(?x)htt... | unlicense |
gandrewstone/BitcoinUnlimited | qa/rpc-tests/invalidblockrequest.py | 53 | 4184 | #!/usr/bin/env python2
#
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
from test_framework.test_framework import ComparisonTestFramework
from test_framework.util import *
from test_framework.comptool import TestManager, Te... | mit |
mhdella/scikit-learn | sklearn/neighbors/tests/test_kd_tree.py | 129 | 7848 | import numpy as np
from numpy.testing import assert_array_almost_equal
from sklearn.neighbors.kd_tree import (KDTree, NeighborsHeap,
simultaneous_sort, kernel_norm,
nodeheap_sort, DTYPE, ITYPE)
from sklearn.neighbors.dist_metrics import Dista... | bsd-3-clause |
JPalmerio/GRB_population_code | catalogs/GBM_cat/GBM_Ep_constraint_testing.py | 1 | 1178 | import sys
import platform
if platform.system() == 'Linux':
sys.path.insert(0,'/nethome/palmerio/Dropbox/Plotting_GUI/Src')
elif platform.system() == 'Darwin':
sys.path.insert(0,'/Users/palmerio/Dropbox/Plotting_GUI/Src')
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import plotting_functions... | gpl-3.0 |
slebit/android_kernel_lge_v500 | tools/perf/scripts/python/sctop.py | 11180 | 1924 | # system call top
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Periodically displays system-wide system call totals, broken down by
# syscall. If a [comm] arg is specified, only syscalls called by
# [comm] are displayed. If an [interval] arg is specified,... | gpl-2.0 |
karthik-sethuraman/ONFOpenTransport | RI/flask_server/tapi_server/models/tapi_notification_notification_subscription_service.py | 4 | 12793 | # coding: utf-8
from __future__ import absolute_import
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from tapi_server.models.base_model_ import Model
from tapi_server.models.tapi_common_global_class import TapiCommonGlobalClass # noqa: F401,E501
from tapi_server.model... | apache-2.0 |
phdowling/scikit-learn | sklearn/externals/joblib/my_exceptions.py | 289 | 3257 | """
Exceptions
"""
# Author: Gael Varoquaux < gael dot varoquaux at normalesup dot org >
# Copyright: 2010, Gael Varoquaux
# License: BSD 3 clause
import sys
class JoblibException(Exception):
"""A simple exception with an error message that you can get to."""
def __init__(self, *args):
self.args = a... | bsd-3-clause |
yterauchi/primecloud-controller | iaas-gw/src/DescribeKeyPairs.py | 5 | 1656 | # coding: UTF-8
#
# Copyright 2014 by SCSK Corporation.
#
# This file is part of PrimeCloud Controller(TM).
#
# PrimeCloud Controller(TM) 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 versi... | gpl-2.0 |
Ken69267/gpytage | gpytage/rename.py | 1 | 4560 | #!/usr/bin/env python
#
# rename.py GPytage module
#
############################################################################
# Copyright (C) 2009-2010 by Kenneth Prugh #
# ken69267@gmail.com #
# ... | gpl-2.0 |
kevindiltinero/seass3 | src/thefile.py | 1 | 1064 | def get_cmmds(filename):
values = []
next = []
final = []
file = open(filename, 'r')
for line in file:
values.append(line.split(' '))
for i in range(len(values)):
for j in range(4):
temporary = values[i][j]
if temporary.endswith('\n'):
nex... | bsd-2-clause |
asiersarasua/QGIS | python/custom_widgets/qgis_customwidgets.py | 37 | 2012 | # -*- coding: utf-8 -*-
"""
***************************************************************************
customwidgets.py
---------------------
Date : May 2014
Copyright : (C) 2014 by Denis Rouzaud
Email : denis.rouzaud@gmail.com
****************************... | gpl-2.0 |
servo/servo | components/script/dom/bindings/codegen/parser/tests/test_union_nullable.py | 276 | 1292 | def WebIDLTest(parser, harness):
threw = False
try:
parser.parse("""
interface OneNullableInUnion {
void foo((object? or DOMString?) arg);
};
""")
results = parser.finish()
except:
threw = True
harness.ok(threw,
"Two ... | mpl-2.0 |
alsrgv/tensorflow | tensorflow/python/training/localhost_cluster_performance_test.py | 36 | 4694 | # 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 |
webmasterraj/GaSiProMo | flask/lib/python2.7/site-packages/numpy/ma/tests/test_subclassing.py | 69 | 12418 | # pylint: disable-msg=W0611, W0612, W0511,R0201
"""Tests suite for MaskedArray & subclassing.
:author: Pierre Gerard-Marchant
:contact: pierregm_at_uga_dot_edu
:version: $Id: test_subclassing.py 3473 2007-10-29 15:18:13Z jarrod.millman $
"""
from __future__ import division, absolute_import, print_function
import num... | gpl-2.0 |
Vvucinic/Wander | venv_2_7/lib/python2.7/site-packages/Django-1.9-py2.7.egg/django/core/checks/security/sessions.py | 477 | 2595 | from django.conf import settings
from .. import Tags, Warning, register
def add_session_cookie_message(message):
return message + (
" Using a secure-only session cookie makes it more difficult for "
"network traffic sniffers to hijack user sessions."
)
W010 = Warning(
add_session_cookie_... | artistic-2.0 |
steveyen/moxi | t/moxi_mock_b2b.py | 1 | 30300 | import sys
import string
import socket
import select
import unittest
import threading
import time
import re
import struct
from memcacheConstants import REQ_MAGIC_BYTE, RES_MAGIC_BYTE
from memcacheConstants import REQ_PKT_FMT, RES_PKT_FMT, MIN_RECV_PACKET
from memcacheConstants import SET_PKT_FMT, DEL_PKT_FMT, INCRDECR... | bsd-3-clause |
sjperkins/tensorflow | tensorflow/contrib/learn/python/learn/learn_io/data_feeder.py | 88 | 31139 | # 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 |
thundernet8/WRGameVideos-API | venv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/pg8000.py | 58 | 8375 | # postgresql/pg8000.py
# Copyright (C) 2005-2015 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:: postgresql+pg8000
:name: pg8000
:dbapi: pg8000
:co... | gpl-2.0 |
zeehio/META-SHARE | misc/tools/generateMeta/parse_xsd.py | 6 | 61501 | """
The XSD schema analysis (parsing) part of the generator
"""
## LICENSE
## Copyright (c) 2003 Dave Kuhlman
## 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, inclu... | bsd-3-clause |
hbarghi/VirtualBattery1 | src/internet/bindings/callbacks_list.py | 67 | 2406 | callback_classes = [
['void', 'ns3::Ipv6Address', 'unsigned char', 'unsigned char', 'unsigned char', 'unsigned int', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
['void', 'ns3::Ipv4Address', 'unsigned char', 'unsigned char', 'unsigned char', 'unsigned int', 'ns3::empty', 'ns3::empty', 'ns3::empty', ... | gpl-2.0 |
frdb194/django | tests/template_tests/templatetags/custom.py | 161 | 5408 | import operator
import warnings
from django import template
from django.template.defaultfilters import stringfilter
from django.utils import six
from django.utils.html import escape, format_html
register = template.Library()
@register.filter
@stringfilter
def trim(value, num):
return value[:num]
@register.fil... | bsd-3-clause |
FHannes/intellij-community | python/lib/Lib/site-packages/django/contrib/comments/models.py | 313 | 7636 | import datetime
from django.contrib.auth.models import User
from django.contrib.comments.managers import CommentManager
from django.contrib.contenttypes import generic
from django.contrib.contenttypes.models import ContentType
from django.contrib.sites.models import Site
from django.db import models
from django.core im... | apache-2.0 |
abought/osf.io | website/addons/osfstorage/tests/test_utils.py | 37 | 2525 | #!/usr/bin/env python
# encoding: utf-8
from nose.tools import * # noqa
from framework import sessions
from framework.flask import request
from website.models import Session
from website.addons.osfstorage.tests import factories
from website.addons.osfstorage import utils
from website.addons.osfstorage.tests.utils... | apache-2.0 |
anna-effeindzourou/trunk | examples/anna_scripts/tilt/tilttest_box.py | 1 | 9173 | # -*- coding: utf-8
from yade import ymport,utils,pack,export,qt,bodiesHandling
import gts,os
# for plotting
from math import *
from yade import plot
############################
### DEFINING PARAMETERS ###
############################
#GEOMETRIC :dimension of the rectangular box
a=.2 # side dimension
h=.1 # h... | gpl-2.0 |
VitalPet/hr | hr_contract_hourly_rate/models/hr_contract_job.py | 23 | 2026 | # -*- coding:utf-8 -*-
##############################################################################
#
# Copyright (C) 2014 Savoir-faire Linux. All Rights Reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as publish... | agpl-3.0 |
nagyistoce/odoo-dev-odoo | addons/product_extended/wizard/wizard_price.py | 270 | 3043 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2011 OpenERP S.A. (<http://www.openerp.com>).
# $Id$
#
# This program is free... | agpl-3.0 |
eg-zhang/scikit-learn | sklearn/ensemble/weight_boosting.py | 71 | 40664 | """Weight Boosting
This module contains weight boosting estimators for both classification and
regression.
The module structure is the following:
- The ``BaseWeightBoosting`` base class implements a common ``fit`` method
for all the estimators in the module. Regression and classification
only differ from each ot... | bsd-3-clause |
almarklein/scikit-image | doc/examples/plot_regionprops.py | 2 | 1300 | """
=========================
Measure region properties
=========================
This example shows how to measure properties of labelled image regions.
"""
import math
import matplotlib.pyplot as plt
import numpy as np
from skimage.draw import ellipse
from skimage.morphology import label
from skimage.measure impor... | bsd-3-clause |
sibskull/synaptiks | tests/kde/widgets/test_config.py | 1 | 5513 | # -*- coding: utf-8 -*-
# Copyright (c) 2011, Sebastian Wiesner <lunaryorn@googlemail.com>
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above... | bsd-2-clause |
Dhiru/gstudio | gnowsys-ndf/gnowsys_ndf/ndf/views/e-book.py | 3 | 2256 | ''' -- imports from installed packages -- '''
from django.shortcuts import render_to_response
from django.template import RequestContext
# from django.core.urlresolvers import reverse
from mongokit import paginator
try:
from bson import ObjectId
except ImportError: # old pymongo
from pymongo.objectid import Objec... | agpl-3.0 |
toirl/cointrader | cointrader/strategy.py | 1 | 2832 | #!/usr/bin/env python
import datetime
import logging
from cointrader.indicators import (
WAIT, BUY, SELL, Signal, macdh_momententum, macdh, double_cross
)
log = logging.getLogger(__name__)
class Strategy(object):
"""Docstring for Strategy. """
def __str__(self):
return "{}".format(self.__class_... | mit |
c-wilson/klustaviewa | klustaviewa/stats/tests/test_quality.py | 2 | 1402 | """Unit tests for stats.quality module."""
# -----------------------------------------------------------------------------
# Imports
# -----------------------------------------------------------------------------
import os
import numpy as np
from kwiklib.dataio.tests.mock_data import (setup, teardown,
nspikes, n... | bsd-3-clause |
shelbycruver/real-python-test | env/lib/python2.7/site-packages/setuptools/tests/test_resources.py | 345 | 23973 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# NOTE: the shebang and encoding lines are for ScriptHeaderTests do not remove
import os
import sys
import tempfile
import shutil
from unittest import TestCase
import pkg_resources
from pkg_resources import (parse_requirements, VersionConflict, parse_version,
Distribution... | gpl-2.0 |
mozvip/CouchPotatoServer | libs/chardet/jpcntx.py | 190 | 19049 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client 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 R... | gpl-3.0 |
ZenDevelopmentSystems/scikit-learn | benchmarks/bench_lasso.py | 297 | 3305 | """
Benchmarks of Lasso vs LassoLars
First, we fix a training set and increase the number of
samples. Then we plot the computation time as function of
the number of samples.
In the second benchmark, we increase the number of dimensions of the
training set. Then we plot the computation time as function of
the number o... | bsd-3-clause |
EliotBerriot/django | tests/migrations/test_graph.py | 99 | 11829 | import warnings
from django.db.migrations.exceptions import (
CircularDependencyError, NodeNotFoundError,
)
from django.db.migrations.graph import RECURSION_DEPTH_WARNING, MigrationGraph
from django.test import SimpleTestCase
from django.utils.encoding import force_text
class GraphTests(SimpleTestCase):
"""
... | bsd-3-clause |
zaina/nova | nova/virt/vmwareapi/host.py | 60 | 3232 | # Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
# Copyright (c) 2012 VMware, 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/lic... | apache-2.0 |
duembeg/gsat | modules/wnd_main_config.py | 1 | 10359 | """----------------------------------------------------------------------------
wnd_main_config.py
Copyright (C) 2013-2020 Wilhelm Duembeg
This file is part of gsat. gsat is a cross-platform GCODE debug/step for
Grbl like GCODE interpreters. With features similar to software debuggers.
Features such as... | gpl-2.0 |
upliftaero/MissionPlanner | Lib/site-packages/scipy/stats/tests/test_kdeoth.py | 53 | 1278 |
from scipy import stats
import numpy as np
from numpy.testing import assert_almost_equal, assert_
def test_kde_1d():
#some basic tests comparing to normal distribution
np.random.seed(8765678)
n_basesample = 500
xn = np.random.randn(n_basesample)
xnmean = xn.mean()
xnstd = xn.std(ddof=1)
... | gpl-3.0 |
skycucumber/xuemc | python/venv/lib/python2.7/site-packages/requests/packages/chardet/chardetect.py | 1786 | 2504 | #!/usr/bin/env python
"""
Script which takes one or more file paths and reports on their detected
encodings
Example::
% chardetect somefile someotherfile
somefile: windows-1252 with confidence 0.5
someotherfile: ascii with confidence 1.0
If no paths are provided, it takes its input from stdin.
"""
from... | gpl-2.0 |
Princeton-Quadcopter/PQ-Software | Ardupilot/Tools/autotest/apm_unit_tests/dev/arducopter_AP_Limits.py | 227 | 2098 | import arducopter
import util, pexpect, sys, time, math, shutil, os
from common import *
import mavutil, mavwp, random
def unit_test(mavproxy, mav):
'''A scripted flight plan for testing AP_Limits'''
time.sleep(5)
print "# Setting AP_Limits parameters"
mavproxy.send('param set LIM_ENABLED 1\n')
... | gpl-3.0 |
bukzor/sympy | sympy/physics/unitsystems/units.py | 57 | 13509 | # -*- coding: utf-8 -*-
"""
Unit system for physical quantities; include definition of constants.
"""
from __future__ import division
import numbers
from sympy import sympify, Expr, Number, Pow, Mul
from .dimensions import Dimension, DimensionSystem
class Unit(Expr):
"""
Class for the units.
A unit is... | bsd-3-clause |
ifding/ifding.github.io | stylegan2-ada/metrics/clustering.py | 1 | 4125 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this software and rel... | mit |
kamalx/edx-platform | common/djangoapps/student/auth.py | 48 | 5895 | """
The application interface to roles which checks whether any user trying to change
authorization has authorization to do so, which infers authorization via role hierarchy
(GlobalStaff is superset of auths of course instructor, ...), which consults the config
to decide whether to check course creator role, and other ... | agpl-3.0 |
sanyaade-iot/jasper-client | client/modules/HN.py | 35 | 4833 | # -*- coding: utf-8-*-
import urllib2
import re
import random
from bs4 import BeautifulSoup
from client import app_utils
from semantic.numbers import NumberService
WORDS = ["HACKER", "NEWS", "YES", "NO", "FIRST", "SECOND", "THIRD"]
PRIORITY = 4
URL = 'http://news.ycombinator.com'
class HNStory:
def __init__(s... | mit |
boriel/zxbasic | src/symbols/number.py | 1 | 4546 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# vim: ts=4:et:sw=4:
# ----------------------------------------------------------------------
# Copyleft (K), Jose M. Rodriguez-Rosa (a.k.a. Boriel)
#
# This program is Free Software and is released under the terms of
# the GNU General License
# ------------... | gpl-3.0 |
ftrimble/route-grower | pyroute/lib_gpx.py | 1 | 2521 | #!/usr/bin/python
#-----------------------------------------------------------------------------
# Library for handling GPX files
#
# Usage:
#
#-----------------------------------------------------------------------------
# Copyright 2007, Oliver White
#
# This program is free software: you can redistribute it and/or m... | apache-2.0 |
tomasbw/linux-yocto-4.4 | 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 |
orhankislal/madlib | src/madpack/yaml/tokens.py | 985 | 2573 |
class Token(object):
def __init__(self, start_mark, end_mark):
self.start_mark = start_mark
self.end_mark = end_mark
def __repr__(self):
attributes = [key for key in self.__dict__
if not key.endswith('_mark')]
attributes.sort()
arguments = ', '.join(['%s=... | apache-2.0 |
safwanrahman/linuxdesh | kitsune/sumo/tests/test_form_fields.py | 17 | 4265 | from django.core.exceptions import ValidationError
from django.utils import translation
from nose.tools import eq_
from kitsune.sumo.form_fields import _format_decimal, TypedMultipleChoiceField
from kitsune.sumo.tests import TestCase
class TestFormatDecimal(TestCase):
def test_default_locale(self):
"""... | bsd-3-clause |
mightysween/vs980-kernel | tools/perf/scripts/python/failed-syscalls-by-pid.py | 11180 | 2058 | # failed system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide failed system call totals, broken down by pid.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.pa... | gpl-2.0 |
xiaoyuanW/gem5 | src/python/m5/simulate.py | 23 | 11685 | # Copyright (c) 2012 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 functionality ... | bsd-3-clause |
jcpowermac/ansible | lib/ansible/modules/monitoring/sensu_subscription.py | 27 | 4974 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Anders Ingemann <aim@secoya.dk>
# 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 |
trevor/mailman3 | src/mailman/handlers/to_usenet.py | 2 | 2105 | # Copyright (C) 1998-2014 by the Free Software Foundation, Inc.
#
# This file is part of GNU Mailman.
#
# GNU Mailman 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 you... | gpl-3.0 |
carlgao/lenga | images/lenny64-peon/usr/share/python-support/python-django/django/utils/tzinfo.py | 313 | 2511 | "Implementation of tzinfo classes for use with datetime.datetime."
import time
from datetime import timedelta, tzinfo
from django.utils.encoding import smart_unicode, smart_str, DEFAULT_LOCALE_ENCODING
class FixedOffset(tzinfo):
"Fixed offset in minutes east from UTC."
def __init__(self, offset):
if i... | mit |
mahendra-r/edx-platform | common/djangoapps/student/migrations/0044_linkedin_add_company_identifier.py | 102 | 14163 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'LinkedInAddToProfileConfiguration.company_identifier'
db.add_column('student_linkedinaddtopr... | agpl-3.0 |
blzr/enigma2 | lib/python/Components/Pixmap.py | 3 | 3113 | from ConditionalWidget import ConditionalWidget
from GUIComponent import GUIComponent
from enigma import ePixmap, eTimer
from Tools.Directories import resolveFilename, SCOPE_CURRENT_SKIN
from os import path
from skin import loadPixmap
class Pixmap(GUIComponent):
GUI_WIDGET = ePixmap
def getSize(self):
s = self... | gpl-2.0 |
ckundo/nvda | source/XMLFormatting.py | 2 | 1854 | from xml.parsers import expat
import textInfos
from logHandler import log
class XMLTextParser(object):
def __init__(self):
self.parser=expat.ParserCreate('utf-8')
self.parser.StartElementHandler=self._startElementHandler
self.parser.EndElementHandler=self._EndElementHandler
self.parser.CharacterDa... | gpl-2.0 |
ddico/account-financial-tools | account_credit_control_dunning_fees/tests/test_fees_generation.py | 1 | 4628 | # Copyright 2014-2017 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo.tests import common
class FixedFeesTester(common.TransactionCase):
def setUp(self):
"""Initialize credit control level mock to test fees computations"""
super(FixedFeesTester, self).setUp... | agpl-3.0 |
amisrs/one-eighty | angular_flask/lib/python2.7/site-packages/gevent/backdoor.py | 2 | 6965 | # Copyright (c) 2009-2014, gevent contributors
# Based on eventlet.backdoor Copyright (c) 2005-2006, Bob Ippolito
"""
Interactive greenlet-based network console that can be used in any process.
The :class:`BackdoorServer` provides a REPL inside a running process. As
long as the process is monkey-patched, the ``Backdoo... | mit |
OCA/maintainer-tools | tests/test_gen_addon_readme.py | 3 | 2714 | # License AGPLv3 (https://www.gnu.org/licenses/agpl-3.0-standalone.html)
# Copyright (c) 2018 ACSONE SA/NV
import os
import shutil
import subprocess
import sys
import pytest
@pytest.fixture
def addons_dir(tmpdir):
here = os.path.dirname(__file__)
addons_dir = str(tmpdir / "addons")
shutil.copytree(os.pa... | agpl-3.0 |
MyRookie/SentimentAnalyse | venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/euckrfreq.py | 3121 | 45978 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client 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 R... | mit |
jeremiahyan/odoo | addons/website_slides/tests/test_karma.py | 5 | 4777 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.addons.website_slides.tests import common
from odoo.tests import tagged
from odoo.tests.common import users
from odoo.tools import mute_logger
@tagged('functional')
class TestKarmaGain(common.SlidesCase):
... | gpl-3.0 |
EmilStenstrom/nephele | nephele.py | 1 | 1817 | #!/usr/bin/env python -u
"""
Nephele - Finding movies to watch on the internet is easy,
finding GOOD movies to watch is hard. Let Nephele, the greek
nymph of the clouds, help you.
Usage:
nephele.py get_popular [--limit=<n>] [--filter=<spec>] [--debug]
nephele.py get_grades <directory> [--limit=<n>] [--filter... | mit |
JohnOrlando/gnuradio-bitshark | gr-qtgui/src/python/qt_digital_window.py | 4 | 7361 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'qt_digital_window.ui'
#
# Created: Thu Jun 18 07:57:58 2009
# by: PyQt4 UI code generator 4.4.3
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
class Ui_DigitalWindow(object):
def setupUi(s... | gpl-3.0 |
teto/libnl_old | python/netlink/route/link.py | 1 | 16902 | #
# Copyright (c) 2011 Thomas Graf <tgraf@suug.ch>
#
"""Module providing access to network links
This module provides an interface to view configured network links,
modify them and to add and delete virtual network links.
The following is a basic example:
import netlink.core as netlink
import netlink.route.l... | lgpl-2.1 |
constKutsy/GeoWiki | .compit/lib/python3.6/site-packages/setuptools/command/install_egg_info.py | 412 | 2203 | from distutils import log, dir_util
import os
from setuptools import Command
from setuptools import namespaces
from setuptools.archive_util import unpack_archive
import pkg_resources
class install_egg_info(namespaces.Installer, Command):
"""Install an .egg-info directory for the package"""
description = "In... | unlicense |
liutairan/eMolFrag | Old versions/eMolFrag_2016_12_21_02/eMolFrag.py | 1 | 37326 | #Process:
#1. Get a list of original sdf files
#2. Use chopRDKit02.py generates fragments and list of files with total atom number, carbon atom number, nitrogen and oxygen atom number
#3. Form lists of by atom numbers
#4. Run rmRedLinker03.py or rmRedRigid01.py on different lists generated by step 3. Remove redundancy ... | gpl-3.0 |
tombstone/models | research/object_detection/utils/object_detection_evaluation_test.py | 1 | 48048 | # Copyright 2017 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 |
hdinsight/hue | desktop/core/ext-py/Django-1.6.10/django/contrib/gis/geos/prototypes/prepared.py | 623 | 1032 | from ctypes import c_char
from django.contrib.gis.geos.libgeos import GEOM_PTR, PREPGEOM_PTR
from django.contrib.gis.geos.prototypes.errcheck import check_predicate
from django.contrib.gis.geos.prototypes.threadsafe import GEOSFunc
# Prepared geometry constructor and destructors.
geos_prepare = GEOSFunc('GEOSPrepare')... | apache-2.0 |
getpatchwork/patchwork | patchwork/migrations/0043_merge_patch_submission.py | 1 | 11421 | from django.conf import settings
from django.db import connection, migrations, models
import django.db.models.deletion
import patchwork.fields
def migrate_data(apps, schema_editor):
if connection.vendor == 'postgresql':
schema_editor.execute(
"""
UPDATE patchwork_submission
... | gpl-2.0 |
realincubus/pluto_clang | orio-0.1.0/src/module/loop/submodule/permut/transformator.py | 5 | 5953 | #
# Contain the transformation procedure
#
import sys
import module.loop.ast, module.loop.ast_lib.forloop_lib
#-----------------------------------------
class Transformator:
'''Code transformator'''
def __init__(self, seq, stmt):
'''To instantiate a code transformator object'''
self.seq = s... | gpl-3.0 |
vivekanand1101/ultisnips | pythonx/UltiSnips/snippet/parsing/_lexer.py | 29 | 10109 | #!/usr/bin/env python
# encoding: utf-8
"""Not really a lexer in the classical sense, but code to convert snippet
definitions into logical units called Tokens."""
import string
import re
from UltiSnips.compatibility import as_unicode
from UltiSnips.position import Position
from UltiSnips.text import unescape
class... | gpl-3.0 |
agconti/njode | env/lib/python2.7/site-packages/sphinx/builders/html.py | 11 | 43902 | # -*- coding: utf-8 -*-
"""
sphinx.builders.html
~~~~~~~~~~~~~~~~~~~~
Several HTML builders.
:copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import os
import sys
import zlib
import codecs
import posixpath
import cPickle as pickle
from o... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.