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 |
|---|---|---|---|---|---|
ucyo/xsuite | tests/xcdo/test_errors_xcdo.py | 1 | 2935 | #!/usr/bin/env python
# coding: utf-8
"""Test error messages."""
import os
import pytest
from xsuite import xcdo
from xsuite.tools import load_data
ds = load_data('pre', decode_times=False)
datadir = os.path.join(os.path.dirname(__file__), os.path.pardir, os.path.pardir, 'data')
filename = os.path.join(datadir, 'sr... | gpl-3.0 |
ben-hopps/nupic | src/nupic/frameworks/opf/clamodel.py | 19 | 55990 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | agpl-3.0 |
grierson/memsim | pavement.py | 1 | 2883 | """ Automate Commands """
from paver.easy import *
import paver.doctools
from paver.tasks import task
from pip.req import parse_requirements
from paver.setuputils import (
install_distutils_tasks
)
# -- REQUIRED-FOR: setup, sdist, ...
# NOTE: Adds a lot more python-project related tasks.
install_distutils_tasks()
... | isc |
schoksey/networking-odl | networking_odl/openstack/common/cache/backends.py | 76 | 7793 | # Copyright 2013 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | apache-2.0 |
iksaif/defcon | defcon/status/serializers.py | 1 | 1988 | """Serializers for defcon.status."""
from rest_framework import serializers
from defcon.status import models
# Models for the full API.
class ComponentSerializer(serializers.HyperlinkedModelSerializer):
"""Serializer for Component."""
class Meta:
"""Configuration."""
model = models.Componen... | gpl-3.0 |
TeamExodus/kernel_lge_hammerhead | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py | 12527 | 1935 | # Util.py - Python extension for perf script, miscellaneous utility code
#
# 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.
import errno, os
FUTEX_WAIT = 0... | gpl-2.0 |
solintegra/addons | product/__init__.py | 443 | 1120 | # -*- 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 |
motion2015/edx-platform | common/lib/xmodule/xmodule/modulestore/tests/utils.py | 39 | 5990 | """
Helper classes and methods for running modulestore tests without Django.
"""
from importlib import import_module
from opaque_keys.edx.keys import UsageKey
from unittest import TestCase
from xblock.fields import XBlockMixin
from xmodule.x_module import XModuleMixin
from xmodule.modulestore import ModuleStoreEnum
fro... | agpl-3.0 |
fabioz/Pydev | plugins/org.python.pydev.core/pysrc/_pydevd_bundle/pydevd_source_mapping.py | 2 | 6436 | import bisect
from _pydevd_bundle.pydevd_constants import dict_items, NULL, KeyifyList
import pydevd_file_utils
class SourceMappingEntry(object):
__slots__ = ['source_filename', 'line', 'end_line', 'runtime_line', 'runtime_source']
def __init__(self, line, end_line, runtime_line, runtime_source):
as... | epl-1.0 |
alex/pip | pip/_vendor/html5lib/tokenizer.py | 1710 | 76929 | from __future__ import absolute_import, division, unicode_literals
try:
chr = unichr # flake8: noqa
except NameError:
pass
from collections import deque
from .constants import spaceCharacters
from .constants import entities
from .constants import asciiLetters, asciiUpper2Lower
from .constants import digits, ... | mit |
msabramo/ansible | lib/ansible/modules/windows/win_group.py | 56 | 1791 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Chris Hoffman <choffman@chathamfinancial.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 ... | gpl-3.0 |
Jollytown/Garuda | server/garuda/lib/python2.7/site-packages/django/core/management/commands/runserver.py | 34 | 6760 | from __future__ import unicode_literals
from optparse import make_option
from datetime import datetime
import errno
import os
import re
import sys
import socket
from django.core.management.base import BaseCommand, CommandError
from django.core.servers.basehttp import run, get_internal_wsgi_application
from django.db ... | mit |
jhutar/spacewalk | utils/depsolver.py | 7 | 8084 | #!/usr/bin/python
#
# -*- coding: utf-8 -*-
#
# Copyright (c) 2012--2015 Red Hat, Inc.
#
# Lookup package dependencies in a yum repository
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied w... | gpl-2.0 |
luo3555/shadowsocks-bak | shadowsocks/crypto/table.py | 1044 | 8108 | # !/usr/bin/env python
#
# Copyright 2015 clowwindy
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | apache-2.0 |
rlphillipsiii/regression-interface | pylib/yaml/resolver.py | 474 | 8972 |
__all__ = ['BaseResolver', 'Resolver']
from error import *
from nodes import *
import re
class ResolverError(YAMLError):
pass
class BaseResolver(object):
DEFAULT_SCALAR_TAG = u'tag:yaml.org,2002:str'
DEFAULT_SEQUENCE_TAG = u'tag:yaml.org,2002:seq'
DEFAULT_MAPPING_TAG = u'tag:yaml.org,2002:map'
... | gpl-2.0 |
jamesblunt/sympy | sympy/vector/tests/test_printing.py | 10 | 5621 | # -*- coding: utf-8 -*-
from sympy import Integral, latex, Function
from sympy import pretty as xpretty
from sympy.vector import CoordSysCartesian, Vector, Dyadic, express
from sympy.abc import a, b, c
from sympy.core.compatibility import u_decode as u
from sympy.utilities.pytest import XFAIL
def pretty(expr):
"""... | bsd-3-clause |
jamesblunt/edx-platform | common/djangoapps/student/admin.py | 20 | 5060 | '''
django admin pages for courseware model
'''
from django import forms
from config_models.admin import ConfigurationModelAdmin
from django.contrib.auth.models import User
from student.models import UserProfile, UserTestGroup, CourseEnrollmentAllowed, DashboardConfiguration
from student.models import (
CourseEnro... | agpl-3.0 |
highweb-project/highweb-webcl-html5spec | components/test/data/autofill/merge/tools/reserialize_profiles_from_query.py | 162 | 1177 | #!/usr/bin/env python
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import sys
from autofill_merge_common import SerializeProfiles, ColumnNameToFieldType
def main():
"""Serializes the output of the ... | bsd-3-clause |
HolgerPeters/scikit-learn | examples/ensemble/plot_gradient_boosting_oob.py | 82 | 4768 | """
======================================
Gradient Boosting Out-of-Bag estimates
======================================
Out-of-bag (OOB) estimates can be a useful heuristic to estimate
the "optimal" number of boosting iterations.
OOB estimates are almost identical to cross-validation estimates but
they can be compute... | bsd-3-clause |
bjornlevi/5thpower | nefndaralit/env/lib/python3.6/site-packages/pip/cmdoptions.py | 15 | 16473 | """
shared options and groups
The principle here is to define options once, but *not* instantiate them
globally. One reason being that options with action='append' can carry state
between parses. pip parses general options twice internally, and shouldn't
pass on state. To be consistent, all options will follow this de... | mit |
klnprj/testapp | django/contrib/gis/geos/mutable_list.py | 405 | 10386 | # Copyright (c) 2008-2009 Aryeh Leib Taurog, all rights reserved.
# Released under the New BSD license.
"""
This module contains a base type which provides list-style mutations
without specific data storage methods.
See also http://www.aryehleib.com/MutableLists.html
Author: Aryeh Leib Taurog.
"""
class ListMixin(obj... | bsd-3-clause |
crazyAxe/tp-libvirt | libvirt/tests/src/virsh_cmd/pool/virsh_pool_create_as.py | 4 | 2053 | import os
import logging
from autotest.client.shared import error
from virttest import libvirt_storage
from virttest import virsh
def run(test, params, env):
'''
Test the command virsh pool-create-as
(1) Call virsh pool-create-as
(2) Call virsh -c remote_uri pool-create-as
(3) Call virsh pool-c... | gpl-2.0 |
maciekcc/tensorflow | tensorflow/python/saved_model/utils_test.py | 14 | 5251 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
krafczyk/spack | var/spack/repos/builtin/packages/loki/package.py | 4 | 2174 | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 |
NTesla/pattern | pattern/web/pdf/encodingdb.py | 56 | 1548 | #!/usr/bin/env python2
import re
from psparser import PSLiteral
from glyphlist import glyphname2unicode
from latin_enc import ENCODING
## name2unicode
##
STRIP_NAME = re.compile(r'[0-9]+')
def name2unicode(name):
"""Converts Adobe glyph names to Unicode numbers."""
if name in glyphname2unicode:
retu... | bsd-3-clause |
azumimuo/family-xbmc-addon | script.module.youtube.dl/lib/youtube_dl/extractor/groupon.py | 84 | 2599 | from __future__ import unicode_literals
from .common import InfoExtractor
class GrouponIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?groupon\.com/deals/(?P<id>[^/?#&]+)'
_TEST = {
'url': 'https://www.groupon.com/deals/bikram-yoga-huntington-beach-2#ooid=tubGNycTo_9Uxg82uESj4i61EYX8nyuf',
... | gpl-2.0 |
alexandrucoman/vbox-nova-driver | nova/tests/unit/compute/fake_resource_tracker.py | 9 | 1186 | # Copyright (c) 2012 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | apache-2.0 |
CydarLtd/ansible | lib/ansible/modules/network/asa/asa_config.py | 43 | 12077 | #!/usr/bin/python
#
# 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.
#
# Ansible is distribut... | gpl-3.0 |
UstadMobile/exelearning-ustadmobile-work | twisted/conch/client/direct.py | 69 | 3224 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
from twisted.internet import defer, protocol, reactor
from twisted.conch import error
from twisted.conch.ssh import transport
from twisted.python import log
class SSHClientFactory(protocol.ClientFactory):
def __init__(self, d, options, ve... | gpl-2.0 |
autorealm/MayoiNeko | develop/fn/iters.py | 2 | 8530 | from sys import version_info
from collections import deque, Iterable
from operator import add, itemgetter, attrgetter, not_
from functools import partial
from itertools import (islice,
chain,
starmap,
repeat,
tee,
... | apache-2.0 |
fenixbinario/ardupilot | mk/PX4/Tools/genmsg/test/test_genmsg_gentools.py | 215 | 9526 | #!/usr/bin/env python
# Software License Agreement (BSD License)
#
# Copyright (c) 2008, Willow Garage, 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... | gpl-3.0 |
freevo/freevo1 | src/video/plugins/reencode.py | 1 | 23696 | # -*- coding: iso-8859-1 -*-
# -----------------------------------------------------------------------
# re-encode recorded TV programmes
# -----------------------------------------------------------------------
# $Id$
#
# Notes:
# ToDo:
#
# -----------------------------------------------------------------------
# Free... | gpl-2.0 |
4bic/grano | grano/views/facets.py | 4 | 5046 | from flask import request
from restpager import Pager
from sqlalchemy.orm import aliased
from sqlalchemy.sql import func
from grano.lib.exc import BadRequest
from grano.lib.args import arg_bool
from grano.model import Project, Relation
from grano.model import Entity, Property, Schema, db
from grano.views import filter... | mit |
JarnoRFB/GENNN | builder/network_builder.py | 1 | 14253 | import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
import json
from builder.helper import get_tensor_size
from tensorflow.examples.tutorials.mnist import input_data
import os
import datetime
import math
VALIDATION_SIZE = 5000
mnist = input_data.read_data_sets('MNIST_data', one_hot=False, reshap... | mit |
memtoko/django | tests/m2m_intermediary/tests.py | 381 | 1334 | from __future__ import unicode_literals
from datetime import datetime
from django.test import TestCase
from django.utils import six
from .models import Article, Reporter, Writer
class M2MIntermediaryTests(TestCase):
def test_intermeiary(self):
r1 = Reporter.objects.create(first_name="John", last_name="... | bsd-3-clause |
cloudbase/nova | nova/notifications/objects/exception.py | 4 | 1908 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | apache-2.0 |
nagyistoce/euca2ools | euca2ools/commands/ec2/createkeypair.py | 6 | 2211 | # Copyright 2009-2013 Eucalyptus Systems, Inc.
#
# Redistribution and use of this software 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 ... | bsd-2-clause |
simon-anders/htseq | python3/doc/tss3.py | 7 | 1263 | import HTSeq
import numpy
from matplotlib import pyplot
bamfile = HTSeq.BAM_Reader( "SRR001432_head.bam" )
gtffile = HTSeq.GFF_Reader( "Homo_sapiens.GRCh37.56_chrom1.gtf" )
halfwinwidth = 3000
fragmentsize = 200
tsspos = HTSeq.GenomicArrayOfSets( "auto", stranded=False )
for feature in gtffile:
if feature.type == ... | gpl-3.0 |
prds21/repository-barrialTV | barrialTV/channels/oranline.py | 5 | 11984 | # -*- coding: utf-8 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Canal para oranline
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#------------------------------------------------------------
import urlparse,urllib2,urllib,re
import os, sys
from core imp... | gpl-2.0 |
mancoast/CPythonPyc_test | cpython/260_test__locale.py | 74 | 5431 | from test.test_support import verbose, TestSkipped, run_unittest
from _locale import (setlocale, LC_NUMERIC, RADIXCHAR, THOUSEP, nl_langinfo,
localeconv, Error)
import unittest
from platform import uname
if uname()[0] == "Darwin":
maj, min, mic = [int(part) for part in uname()[2].split(".")]
... | gpl-3.0 |
devsim/devsim | examples/diode/pythonmesh3d.py | 1 | 1524 | from devsim import *
import devsim.python_packages.pythonmesh
def gmsh_reader(mesh, device, filename="", coordinates="", physical_names="", elements=""):
if (filename):
create_gmsh_mesh(mesh=mesh, file=filename)
else:
create_gmsh_mesh(mesh=mesh, coordinates=coordinates, physical_names=physical... | apache-2.0 |
benfinke/ns_python | build/lib/nssrc/com/citrix/netscaler/nitro/resource/stat/responder/responderpolicylabel_stats.py | 3 | 4092 | #
# Copyright (c) 2008-2015 Citrix 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.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | apache-2.0 |
polimediaupv/edx-platform | lms/djangoapps/courseware/features/navigation.py | 96 | 5608 | # pylint: disable=missing-docstring
# pylint: disable=redefined-outer-name
from lettuce import world, step
from common import course_location
from problems_setup import PROBLEM_DICT
from nose.tools import assert_in
@step(u'I am viewing a course with multiple sections')
def view_course_multiple_sections(step):
cr... | agpl-3.0 |
cselis86/edx-platform | lms/djangoapps/verify_student/tests/test_ssencrypt.py | 101 | 3623 | import base64
from nose.tools import assert_equals
from verify_student.ssencrypt import (
aes_decrypt, aes_encrypt, encrypt_and_encode, decode_and_decrypt,
rsa_decrypt, rsa_encrypt
)
def test_aes():
key_str = "32fe72aaf2abb44de9e161131b5435c8d37cbdb6f5df242ae860b283115f2dae"
key = key_str.decode("hex... | agpl-3.0 |
Shapes/pisa-fix-django | test/story2canvas.py | 13 | 1323 | # -*- coding: ISO-8859-1 -*-
# Copyright 2010 Dirk Holtwick, holtwick.it
#
# 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 requir... | apache-2.0 |
shakamunyi/nova | nova/tests/unit/virt/libvirt/test_rbd.py | 21 | 11227 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | apache-2.0 |
alexm92/sentry | src/sentry/web/frontend/create_organization_member.py | 5 | 2885 | from __future__ import absolute_import
from django.conf import settings
from django.contrib import messages
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from django.utils.translation import ugettext_lazy as _
from sentry import roles
from sentry.models import Team, TeamSta... | bsd-3-clause |
chuck1/kernel | tools/perf/scripts/python/syscall-counts-by-pid.py | 1996 | 2105 | # 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 system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os, sys
sys.path.append(os.env... | gpl-2.0 |
firmlyjin/brython | www/src/Lib/itertools.py | 630 | 16041 | import operator
class accumulate:
def __init__(self, iterable, func = operator.add):
self.it = iter(iterable)
self._total = None
self.func = func
def __iter__(self):
return self
def __next__(self):
if not self._total:
self._total = next(self.it)... | bsd-3-clause |
changsimon/trove | trove/tests/unittests/cluster/test_cluster.py | 1 | 8963 | # Copyright 2014 eBay Software Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | apache-2.0 |
barriquello/iotstack | openwsn-fw-work/firmware/openos/openwsn/07-App/udpecho/udpecho.py | 2 | 2057 | import time
import socket
NUM_TRIES = 10
request = "poipoipoipoi"
myAddress = '' #means 'all'
myPort = 21568
hisAddress = 'bbbb::1415:92cc:0:2'
hisPort = 7
delays = []
succ = 0
fail = 0
print "Testing udpEcho..."
for i in range(NUM_TRIES):
# log
output = []
output... | mit |
sudheerchintala/LearnEraPlatForm | common/lib/xmodule/xmodule/partitions/partitions.py | 34 | 3862 | """Defines ``Group`` and ``UserPartition`` models for partitioning"""
from collections import namedtuple
# We use ``id`` in this file as the IDs of our Groups and UserPartitions,
# which Pylint disapproves of.
# pylint: disable=invalid-name, redefined-builtin
class Group(namedtuple("Group", "id name")):
"""
A... | agpl-3.0 |
GeoNode/django-osgeo-importer | osgeo_importer/validators.py | 1 | 2604 | import logging
import os
from zipfile import is_zipfile, ZipFile
from django.conf import settings
from osgeo_importer.importers import VALID_EXTENSIONS
from osgeo_importer.utils import NoDataSourceFound, load_handler
OSGEO_IMPORTER = getattr(settings, 'OSGEO_IMPORTER', 'osgeo_importer.importers.OGRImport')
logger ... | gpl-3.0 |
chrisfilda/edx_platform | common/djangoapps/student/migrations/0001_initial.py | 188 | 8556 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'UserProfile'
db.create_table('auth_userprofile', (
('id', self.gf('django.db.models.f... | agpl-3.0 |
kennethgillen/ansible | lib/ansible/modules/cloud/amazon/route53_zone.py | 19 | 7299 | #!/usr/bin/python
# 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.
#
# Ansible is distributed... | gpl-3.0 |
pblottiere/QGIS | tests/src/python/test_qgsproviderconnection_ogr_gpkg.py | 25 | 5926 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for OGR GeoPackage QgsAbastractProviderConnection API.
.. 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 you... | gpl-2.0 |
MaximNevrov/neutron | neutron/db/migration/alembic_migrations/versions/liberty/expand/1b4c6e320f79_address_scope_support_in_subnetpool.py | 36 | 1102 | # Copyright 2015 Huawei Technologies India Pvt. Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | apache-2.0 |
GehenHe/Recognize-Face-on-Android | tensorflow/python/ops/gradient_checker_test.py | 18 | 11199 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
bchiroma/DreamProject_2 | dream/simulation/GUI/Batches.py | 4 | 2884 | import copy
import json
import time
import random
import operator
from dream.simulation.GUI.Shifts import Simulation as ShiftsSimulation
from dream.simulation.GUI.Default import schema
class Simulation(ShiftsSimulation):
def getConfigurationDict(self):
conf = ShiftsSimulation.getConfigurationDict(self)
conf... | gpl-3.0 |
reyha/zulip | zerver/management/commands/show_admins.py | 8 | 1189 | from __future__ import absolute_import
from __future__ import print_function
from typing import Any
from argparse import ArgumentParser
from django.core.management.base import BaseCommand
from zerver.models import get_realm_by_string_id, Realm
import sys
class Command(BaseCommand):
help = """Show the admins in a... | apache-2.0 |
mgogoulos/libcloud | libcloud/backup/drivers/dummy.py | 31 | 1460 | # 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 use ... | apache-2.0 |
flyher/pymo | symbian/PythonForS60/module-repo/standard-modules/encodings/iso8859_2.py | 593 | 13660 | """ Python Character Mapping Codec iso8859_2 generated from 'MAPPINGS/ISO8859/8859-2.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='... | mit |
jemekite/youtube-dl | youtube_dl/compat.py | 39 | 15655 | from __future__ import unicode_literals
import collections
import getpass
import optparse
import os
import re
import shutil
import socket
import subprocess
import sys
import itertools
try:
import urllib.request as compat_urllib_request
except ImportError: # Python 2
import urllib2 as compat_urllib_request
... | unlicense |
michaelaye/scikit-image | doc/ext/plot2rst.py | 13 | 20439 | """
Example generation from python files.
Generate the rst files for the examples by iterating over the python
example files. Files that generate images should start with 'plot'.
To generate your own examples, add this extension to the list of
``extensions``in your Sphinx configuration file. In addition, make sure th... | bsd-3-clause |
alexbarton/ansible-cmdb | lib/yaml/cyaml.py | 537 | 3290 |
__all__ = ['CBaseLoader', 'CSafeLoader', 'CLoader',
'CBaseDumper', 'CSafeDumper', 'CDumper']
from _yaml import CParser, CEmitter
from constructor import *
from serializer import *
from representer import *
from resolver import *
class CBaseLoader(CParser, BaseConstructor, BaseResolver):
def __init__(... | gpl-3.0 |
ojii/django-shop | shop/util/address.py | 1 | 3585 | #-*- coding: utf-8 -*-
from django.contrib.auth.models import AnonymousUser
from django.core.exceptions import ObjectDoesNotExist
from shop.models import AddressModel
#===============================================================================
# Addresses handling
#================================================... | bsd-3-clause |
fujunwei/chromium-crosswalk | chrome/test/chromedriver/util.py | 77 | 4920 | # 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.
"""Generic utilities for all python scripts."""
import atexit
import httplib
import os
import signal
import stat
import subprocess
import sys
import tem... | bsd-3-clause |
idea4bsd/idea4bsd | python/lib/Lib/site-packages/django/core/management/commands/test.py | 244 | 1747 | from django.core.management.base import BaseCommand
from optparse import make_option
import sys
class Command(BaseCommand):
option_list = BaseCommand.option_list + (
make_option('--noinput', action='store_false', dest='interactive', default=True,
help='Tells Django to NOT prompt the user for in... | apache-2.0 |
msabramo/ansible | lib/ansible/modules/network/f5/bigip_selfip.py | 19 | 21466 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2016 F5 Networks 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
# ... | gpl-3.0 |
rvraghav93/scikit-learn | sklearn/learning_curve.py | 8 | 15418 | """Utilities to evaluate models with respect to a variable
"""
# Author: Alexander Fabisch <afabisch@informatik.uni-bremen.de>
#
# License: BSD 3 clause
import warnings
import numpy as np
from .base import is_classifier, clone
from .cross_validation import check_cv
from .externals.joblib import Parallel, delayed
fro... | bsd-3-clause |
bsarsgard/blackrocktickets | texas/admin.py | 1 | 2044 | """
Texas - Ticket Sales System
Copyright (C) 2010 Ben Sarsgard
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 ... | apache-2.0 |
urashima9616/Leetcode_Python | Leet162_FindPeakElement.py | 1 | 1547 | """
A peak element is an element that is greater than its neighbors.
Given an input array where num[i] ≠ num[i+1], find a peak element and return its index.
The array may contain multiple peaks, in that case return the index to any one of the peaks is fine.
You may imagine that num[-1] = num[n] = -∞.
For example, i... | gpl-3.0 |
louissobel/Drapache | drapache/dbpy/builtins/dbpy/dropbox_dbpy/client_wrapper.py | 1 | 1197 |
name = 'api'
__doc__ = "Access to the raw dropbox API methods"
WRAPPED_METHODS = [
'account_info',
'add_copy_ref',
'create_copy_ref',
'delta',
'file_copy',
'file_create_folder',
'file_delete',
'file_move',
'get_file',
'get_file_and_metadata',
'media',
'metadata',
'put_file',
'request',
'restore',
... | mit |
drix00/microanalysis_file_format | pySpectrumFileFormat/OxfordInstruments/MapRaw/MapRawFormat.py | 1 | 7049 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
.. py:currentmodule:: OxfordInstruments.MapRaw.MapRawFormat
:synopsis: Read Oxford Instruments map in the raw format.
.. moduleauthor:: Hendrix Demers <hendrix.demers@mail.mcgill.ca>
Read Oxford Instruments map in the raw format.
"""
#################... | apache-2.0 |
dssg/wikienergy | disaggregator/build/pandas/pandas/tseries/resample.py | 1 | 16718 | from datetime import timedelta
import numpy as np
from pandas.core.groupby import BinGrouper, Grouper
from pandas.tseries.frequencies import to_offset, is_subperiod, is_superperiod
from pandas.tseries.index import DatetimeIndex, date_range
from pandas.tseries.tdi import TimedeltaIndex
from pandas.tseries.offsets impo... | mit |
supriyantomaftuh/django | tests/queries/models.py | 119 | 17751 | """
Various complex queries that have been problematic in the past.
"""
from __future__ import unicode_literals
import threading
from django.db import models
from django.utils import six
from django.utils.encoding import python_2_unicode_compatible
class DumbCategory(models.Model):
pass
class ProxyCategory(Du... | bsd-3-clause |
tprrt/linux-stable | Documentation/sphinx/kerneldoc.py | 63 | 7169 | # coding=utf-8
#
# Copyright © 2016 Intel Corporation
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, me... | gpl-2.0 |
imaculate/scikit-learn | examples/applications/plot_out_of_core_classification.py | 32 | 13829 | """
======================================================
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 |
Euphoria-OS-Devices/android_kernel_motorola_msm8226 | scripts/gcc-wrapper.py | 182 | 3404 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2011-2012, The Linux Foundation. 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 th... | gpl-2.0 |
toomanycats/IndeedScraper | compare.py | 1 | 4116 | from sklearn.feature_extraction.text import CountVectorizer
import indeed_scrape
import GrammarParser
import subprocess
import numpy as np
import logging
import os
from os import path
import numpy as np
data_dir = os.getenv('OPENSHIFT_DATA_DIR')
if data_dir is None:
data_dir = os.getenv('PWD')
logging = logging.g... | mit |
davidmueller13/efficientkernel | tools/perf/scripts/python/net_dropmonitor.py | 1258 | 1562 | # Monitor the system for dropped packets and proudce a report of drop locations and counts
import os
import sys
sys.path.append(os.environ['PERF_EXEC_PATH'] + \
'/scripts/python/Perf-Trace-Util/lib/Perf/Trace')
from perf_trace_context import *
from Core import *
from Util import *
drop_log = {}
kallsyms = []
def... | gpl-2.0 |
ayes/bsmapp | allauth/account/management/commands/account_emailconfirmationmigration.py | 76 | 2557 | from django.core.management.base import BaseCommand, CommandError
from django.core.management.color import no_style
from django.db import connections
from allauth.account import app_settings
from allauth.account.models import EmailAddress, EmailConfirmation
class Command(BaseCommand):
def handle(self, *args, **op... | gpl-3.0 |
cloudtools/troposphere | troposphere/quicksight.py | 1 | 6722 | # Copyright (c) 2012-2021, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
#
# *** Do not modify - this file is autogenerated ***
# Resource specification version: 31.0.0
from troposphere import Tags
from . import AWSObject, AWSProperty
from .validators import boolean, double
... | bsd-2-clause |
2013Commons/HUE-SHARK | build/env/lib/python2.7/site-packages/Django-1.2.3-py2.7.egg/django/contrib/sessions/backends/file.py | 43 | 5309 | import errno
import os
import tempfile
from django.conf import settings
from django.contrib.sessions.backends.base import SessionBase, CreateError
from django.core.exceptions import SuspiciousOperation, ImproperlyConfigured
class SessionStore(SessionBase):
"""
Implements a file based session store.
"""
... | apache-2.0 |
robmcmullen/peppy | peppy/major.py | 1 | 68855 | # peppy Copyright (c) 2006-2010 Rob McMullen
# Licenced under the GPLv2; see http://peppy.flipturn.org for more info
"""Base module for major mode implementations.
Implementing a new major mode means to extend from a wx Control and the
L{MajorMode} base mixin class. Several attributes must be set: C{icon} that
points... | gpl-2.0 |
ptone/django-predicate | predicate/lookup_utils.py | 2 | 5075 | import datetime
import operator
import re
from django.db import models
class LookupQueryEvaluator(object):
evaluators = ()
def __init__(self, rhs):
self.rhs = rhs
def __call__(self, lhs):
rhs = self.cast_rhs(lhs)
lhs = self.cast_lhs(lhs)
return all(evaluator(lhs, rhs) f... | bsd-3-clause |
mattdavis90/base10 | base10/dialects/json_dialect.py | 1 | 1717 | import json
import six
from base10.base import Dialect, Metric
from base10.exceptions import DialectError
class JSONDialect(Dialect):
"""
{
name: 'cpu_usage',
fields: {
user: 0.2,
free: 0.75
},
metadata: {
hostname: 'host-1'
},
... | mit |
guorendong/iridium-browser-ubuntu | native_client/site_scons/site_tools/naclsdk.py | 2 | 28784 | #!/usr/bin/python
# Copyright (c) 2012 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""NaCl SDK tool SCons."""
import __builtin__
import re
import os
import shutil
import sys
import SCons.Scanner
import SCons.Scri... | bsd-3-clause |
tlatzko/spmcluster | .tox/2.7-nocov/lib/python2.7/site-packages/nose/suite.py | 57 | 22341 | """
Test Suites
-----------
Provides a LazySuite, which is a suite whose test list is a generator
function, and ContextSuite,which can run fixtures (setup/teardown
functions or methods) for the context that contains its tests.
"""
from __future__ import generators
import logging
import sys
import unittest
from nose.... | bsd-2-clause |
mufaddalq/cloudstack-datera-driver | test/integration/smoke/test_ssvm.py | 1 | 38772 | # 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 |
waheedahmed/edx-platform | common/djangoapps/student/tests/test_auto_auth.py | 17 | 10889 | from django.test import TestCase
from django.test.client import Client
from django.contrib.auth.models import User
from django.conf import settings
from django_comment_common.models import (
Role, FORUM_ROLE_ADMINISTRATOR, FORUM_ROLE_MODERATOR, FORUM_ROLE_STUDENT)
from django_comment_common.utils import seed_permis... | agpl-3.0 |
cparawhore/ProyectoSubastas | site-packages/django/db/models/sql/query.py | 15 | 92135 | """
Create SQL statements for QuerySets.
The code in here encapsulates all of the SQL construction so that QuerySets
themselves do not have to (and could be backed by things other than SQL
databases). The abstraction barrier only works one way: this module has to know
all about the internals of models in order to get ... | mit |
meejah/AutobahnPython | examples/twisted/wamp/rpc/complex/frontend.py | 2 | 2317 | ###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Tavendo GmbH
#
# 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 with... | mit |
palazzem/ot-examples | examples/threads.py | 1 | 3008 | """Context propagation examples when dealing with multi-threaded
applications.
"""
import threading
from ext import tracer, helpers
def main_thread_instrumented_only():
"""The main thread is instrumented but not its children."""
def do_some_work():
# code executed in children threads; they don't have... | mit |
nprapps/dailygraphics | fabfile/assets.py | 2 | 7215 | #!/usr/bin/env python
"""
Commands related to the syncing assets.
"""
from fnmatch import fnmatch
from glob import glob
import os
from fabric.api import prompt, task
import app_config
import utils
@task
def sync(path):
"""
Intelligently synchronize assets between S3 and local folder.
"""
ignore_glo... | mit |
vikatory/kbengine | kbe/src/lib/python/Lib/asyncio/transports.py | 63 | 9872 | """Abstract Transport class."""
import sys
_PY34 = sys.version_info >= (3, 4)
__all__ = ['BaseTransport', 'ReadTransport', 'WriteTransport',
'Transport', 'DatagramTransport', 'SubprocessTransport',
]
class BaseTransport:
"""Base class for transports."""
def __init__(self, extra=None)... | lgpl-3.0 |
elventear/ansible | lib/ansible/modules/cloud/ovirt/ovirt_clusters_facts.py | 13 | 3422 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 Red Hat, 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
#... | gpl-3.0 |
qingpingguo/git-repo | subcmds/download.py | 48 | 2942 | #
# Copyright (C) 2008 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | apache-2.0 |
umuzungu/zipline | zipline/pipeline/loaders/blaze/buyback_auth.py | 1 | 2593 | from .core import (
SID_FIELD_NAME,
TS_FIELD_NAME,
)
from zipline.pipeline.common import (
BUYBACK_AMOUNT_FIELD_NAME,
BUYBACK_ANNOUNCEMENT_FIELD_NAME,
BUYBACK_TYPE_FIELD_NAME,
BUYBACK_UNIT_FIELD_NAME,
)
from zipline.pipeline.data import BuybackAuthorizations
from zipline.pipeline.loaders import ... | apache-2.0 |
joachimmetz/artifacts | artifacts/artifact.py | 3 | 3417 | # -*- coding: utf-8 -*-
"""The artifact definition."""
from __future__ import unicode_literals
from artifacts import errors
from artifacts import registry
class ArtifactDefinition(object):
"""Artifact definition interface.
Attributes:
conditions (list[str]): conditions.
description (str): description.
... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.