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 |
|---|---|---|---|---|---|
jamiefolsom/edx-platform | lms/djangoapps/instructor/tests/test_services.py | 33 | 3567 | """
Tests for the InstructorService
"""
import json
from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
from courseware.models import StudentModule
from instructor.services import InstructorService
from instructor.tests.test_tools i... | agpl-3.0 |
vicky2135/lucious | oscar/lib/python2.7/site-packages/django/db/backends/sqlite3/features.py | 38 | 2739 | from __future__ import unicode_literals
from django.db import utils
from django.db.backends.base.features import BaseDatabaseFeatures
from django.utils import six
from django.utils.functional import cached_property
from .base import Database
try:
import pytz
except ImportError:
pytz = None
class DatabaseFe... | bsd-3-clause |
sbesson/PyGithub | tests/RepositoryKey.py | 3 | 3820 | ############################ Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2012 Zearin <zearin@gonk.net> ... | lgpl-3.0 |
jamesliu/mxnet | python/mxnet/rnn/rnn.py | 44 | 4264 | # 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 |
simphony/simphony-remote | jupyterhub/remoteappmanager_config.py | 1 | 2462 | # # --------------------
# # Docker configuration
# # --------------------
# #
# # Configuration options for connecting to the docker machine.
# # These options override the default provided by the local environment
# # variables.
# #
# # The endpoint of the docker machine, specified as a URL.
# # By default, it is obt... | bsd-3-clause |
csrocha/OpenUpgrade | addons/website_forum/tests/test_forum.py | 87 | 7632 | # -*- coding: utf-8 -*-
from openerp.addons.website_forum.tests.common import KARMA, TestForumCommon
from openerp.addons.website_forum.models.forum import KarmaError
from openerp.exceptions import Warning, AccessError
from openerp.tools import mute_logger
class TestForum(TestForumCommon):
@mute_logger('openerp.... | agpl-3.0 |
tseaver/google-cloud-python | logging/tests/unit/test_entries.py | 4 | 26350 | # Copyright 2016 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | apache-2.0 |
takeshineshiro/heat | heat/engine/parameters.py | 2 | 20719 | #
# 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
# ... | apache-2.0 |
MattsFleaMarket/python-for-android | python3-alpha/python3-src/Lib/encodings/cp1253.py | 272 | 13094 | """ Python Character Mapping Codec cp1253 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1253.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,in... | apache-2.0 |
DeMille/emailhooks | django_nonrel/django/contrib/gis/geos/libgeos.py | 91 | 5833 | """
This module houses the ctypes initialization procedures, as well
as the notice and error handler function callbacks (get called
when an error occurs in GEOS).
This module also houses GEOS Pointer utilities, including
get_pointer_arr(), and GEOM_PTR.
"""
import logging
import os
import re
from ctypes import c_... | mit |
Tagar/incubator-airflow | tests/task/task_runner/test_bash_task_runner.py | 10 | 3875 | # -*- coding: utf-8 -*-
#
# 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
#... | apache-2.0 |
rafiqsaleh/VERCE | verce-hpc-pe/src/networkx/algorithms/tests/test_clique.py | 32 | 4909 | #!/usr/bin/env python
from nose.tools import *
import networkx as nx
from networkx import convert_node_labels_to_integers as cnlti
class TestCliques:
def setUp(self):
z=[3,4,3,4,2,4,2,1,1,1,1]
self.G=cnlti(nx.generators.havel_hakimi_graph(z),first_label=1)
self.cl=list(nx.find_cliques(self... | mit |
bearstech/ansible | test/units/plugins/cache/test_cache.py | 94 | 4172 | # (c) 2012-2015, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | gpl-3.0 |
azavea/raster-foundry | app-tasks/rf/src/rf/uploads/geotiff/factories.py | 2 | 4123 | # Factories to create scenes from geotiffs on disk somewhere
import logging
import os
import boto3
from .create_images import create_geotiff_image
from .create_scenes import create_geotiff_scene
from rf.utils import cog
from rf.utils.io import (
Visibility,
IngestStatus,
upload_tifs,
s3_bucket_and_key... | apache-2.0 |
krafczyk/spack | var/spack/repos/builtin/packages/snap-korf/package.py | 5 | 2360 | ##############################################################################
# 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 |
figue/raspberry-pi-kernel | tools/perf/scripts/python/futex-contention.py | 11261 | 1486 | # futex contention
# (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Translation of:
#
# http://sourceware.org/systemtap/wiki/WSFutexContention
#
# to perf python scripting.
#
# Measures futex contention
import os, sys
sys.path.append(os.environ['PER... | gpl-2.0 |
lanffy/VagrantForPhp | files/software/node-v0.12.7-linux-x86/lib/node_modules/npm/node_modules/node-gyp/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... | mit |
Sidney84/pa-chromium | native_client_sdk/src/tools/genhttpfs.py | 79 | 2524 | #!/usr/bin/env python
# Copyright (c) 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.
# This scripts generates a manifest file for the MountHttp file system.
# Files and directory paths are specified on the command-li... | bsd-3-clause |
ammarkhann/FinalSeniorCode | lib/python2.7/site-packages/numpy/doc/ufuncs.py | 87 | 5427 | """
===================
Universal Functions
===================
Ufuncs are, generally speaking, mathematical functions or operations that are
applied element-by-element to the contents of an array. That is, the result
in each output array element only depends on the value in the corresponding
input array (or arrays) a... | mit |
bhavishya235/Smart-Email-Client | detect.py | 3 | 1094 | import math
from nltk.tokenize import *
from nltk.probability import *
def main():
THRESHOLD = -400
docs = 95
d_file = open('dictionary2').readlines()
dict_key = []
dict_occ = []
dict_indx = []
test_file = open('test', 'w')
test_file.write('0 ') #Writing label 0
i = 0
for line in d_file:
tmp = li... | apache-2.0 |
jolid/script.module.donnie | lib/donnie/tvrelease.py | 1 | 4966 | import urllib2, urllib, sys, os, re, random, copy
from BeautifulSoup import BeautifulSoup, Tag, NavigableString
import xbmc,xbmcplugin,xbmcgui,xbmcaddon
from t0mm0.common.net import Net
from t0mm0.common.addon import Addon
from scrapers import CommonScraper
net = Net()
try:
import json
except:
# pre-frodo and python... | gpl-2.0 |
axsauze/eventsfinder | django/db/models/expressions.py | 109 | 5738 | import datetime
from django.utils import tree
class ExpressionNode(tree.Node):
"""
Base class for all query expressions.
"""
# Arithmetic connectors
ADD = '+'
SUB = '-'
MUL = '*'
DIV = '/'
MOD = '%%' # This is a quoted % operator - it is quoted
# because it can be u... | bsd-3-clause |
chennan47/osf.io | osf/migrations/0060_reviews.py | 5 | 4956 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2017-09-14 11:09
from __future__ import unicode_literals
from django.conf import settings
from django.core.management.sql import emit_post_migrate_signal
from django.db import migrations, models
import django.db.models.deletion
from api.preprint_providers.permiss... | apache-2.0 |
bratsche/Neutron-Drive | google_appengine/google/appengine/api/images/images_not_implemented_stub.py | 5 | 1491 | #!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | bsd-3-clause |
rootulp/exercism | python/luhn/luhn_test.py | 12 | 1526 | from collections import Counter
import unittest
from luhn import Luhn
class LuhnTests(unittest.TestCase):
def test_addends(self):
# uses a Counter to avoid specifying order of return value
self.assertEqual(Counter([1, 4, 1, 4, 1]),
Counter(Luhn(12121).addends()))
def... | mit |
sobjornstad/esc | tests/esc/test_helpme.py | 1 | 3706 | """
Tests for the on-line help system.
"""
from decimal import Decimal
import pytest
from esc import builtin_stubs
from esc import display
from esc import helpme
from esc.status import status
from esc.commands import main_menu
from esc.registers import Registry
from esc.stack import StackState
# pylint: disable=red... | gpl-3.0 |
uskudnik/ggrc-core | src/ggrc_workflows/migrations/versions/20140529010047_1d33919af441_initial_ggrc_workflows_migration.py | 2 | 12596 |
"""Initial ggrc_workflows migration
Revision ID: 1d33919af441
Revises: None
Create Date: 2014-05-29 01:00:47.198955
"""
# revision identifiers, used by Alembic.
revision = '1d33919af441'
down_revision = None
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic ... | apache-2.0 |
jeffdwyatt/taiga-back | taiga/feedback/apps.py | 21 | 1263 | # Copyright (C) 2014 Andrey Antukh <niwi@niwi.be>
# Copyright (C) 2014 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014 David Barragán <bameda@dbarragan.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 F... | agpl-3.0 |
kpiorno/kivy3dgui | kivy3dgui/objloader.py | 1 | 5490 | from kivy.logger import Logger
import os
class MeshData(object):
def __init__(self, **kwargs):
self.name = kwargs.get("name")
self.vertex_format = [
('v_pos', 3, 'float'),
('v_normal', 3, 'float'),
('v_tc0', 2, 'float')]
self.vertices = []
self.i... | mit |
pasiegel/SickGear | lib/hachoir_core/iso639.py | 129 | 18544 | # -*- coding: utf-8 -*-
"""
ISO639-2 standart: the module only contains the dictionary ISO639_2
which maps a language code in three letters (eg. "fre") to a language
name in english (eg. "French").
"""
# ISO-639, the list comes from:
# http://www.loc.gov/standards/iso639-2/php/English_list.php
_ISO639 = (
(u"Abkha... | gpl-3.0 |
ellisonbg/terminado | demos/single.py | 4 | 1267 | """A single common terminal for all websockets.
"""
import tornado.web
# This demo requires tornado_xstatic and XStatic-term.js
import tornado_xstatic
from terminado import TermSocket, SingleTermManager
from common_demo_stuff import run_and_show_browser, STATIC_DIR, TEMPLATE_DIR
class TerminalPageHandler(tornado.web.... | bsd-2-clause |
kykdev/lolliwiz_lentislte | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py | 11088 | 3246 | # 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 |
tchernomax/ansible | test/runner/lib/executor.py | 3 | 54420 | """Execute Ansible tests."""
from __future__ import absolute_import, print_function
import json
import os
import collections
import datetime
import re
import tempfile
import time
import textwrap
import functools
import pipes
import sys
import hashlib
import difflib
import filecmp
import lib.pytar
import lib.thread
... | gpl-3.0 |
andmos/ansible | test/units/modules/network/f5/test_bigip_wait.py | 21 | 3568 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2017 F5 Networks 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
import os
import json
import pytest
import sys
if sys.version_info < (2, ... | gpl-3.0 |
Universal-Model-Converter/UMC3.0a | data/Python/x86/Lib/site-packages/scipy/stats/tests/test_continuous_basic.py | 3 | 14981 | from __future__ import division, print_function, absolute_import
import warnings
import numpy.testing as npt
import numpy as np
import nose
from scipy import stats
"""
Test all continuous distributions.
Parameters were chosen for those distributions that pass the
Kolmogorov-Smirnov test. This provides safe parame... | mit |
zerobatu/edx-platform | cms/djangoapps/contentstore/views/helpers.py | 51 | 11507 | """
Helper methods for Studio views.
"""
from __future__ import absolute_import
from uuid import uuid4
import urllib
from django.conf import settings
from django.http import HttpResponse
from django.shortcuts import redirect
from django.utils.translation import ugettext as _
from edxmako.shortcuts import render_to_... | agpl-3.0 |
mancoast/CPythonPyc_test | crash/273_test_ssl.py | 21 | 59319 | # Test the support for SSL and sockets
import sys
import unittest
from test import test_support
import asyncore
import socket
import select
import time
import gc
import os
import errno
import pprint
import urllib, urlparse
import traceback
import weakref
import functools
import platform
from BaseHTTPServer import HTT... | gpl-3.0 |
bmentges/django-cart | cart/cart.py | 1 | 2554 | import datetime
from django.db.models import Sum
from django.db.models import F
from . import models
CART_ID = 'CART-ID'
class ItemAlreadyExists(Exception):
pass
class ItemDoesNotExist(Exception):
pass
class Cart:
def __init__(self, request):
cart_id = request.session.get(CART_ID)
if ... | lgpl-3.0 |
librallu/cohorte-herald | python/herald/remote/herald_xmlrpc.py | 1 | 10255 | #!/usr/bin/env python
# -- Content-Encoding: UTF-8 --
"""
Pelix remote services implementation based on Herald messaging and xmlrpclib
:author: Thomas Calmant
:copyright: Copyright 2014, isandlaTech
:license: Apache License 2.0
:version: 0.0.3
:status: Alpha
..
Copyright 2014 isandlaTech
Licensed under the ... | apache-2.0 |
mateon1/servo | tests/wpt/css-tests/tools/html5lib/doc/conf.py | 436 | 9028 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# html5lib documentation build configuration file, created by
# sphinx-quickstart on Wed May 8 00:04:49 2013.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# aut... | mpl-2.0 |
mediachain/cccoin | node/node_temporal.py | 1 | 24616 | #!/usr/bin/env python
"""
Maintains a stable view of / access to state:
- Combines multiple underlying blockchain sources,
- Temporally tracks degrees of confidence based on age, with chain reorg support.
"""
##
## Note: BUG1 refers to,
##
## When you have nested manager.dict()'s, instead of:
## h['a']['b'] = 'c... | mit |
chevanlol360/android_kernel_lge_vu2u | tools/perf/scripts/python/futex-contention.py | 11261 | 1486 | # futex contention
# (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Translation of:
#
# http://sourceware.org/systemtap/wiki/WSFutexContention
#
# to perf python scripting.
#
# Measures futex contention
import os, sys
sys.path.append(os.environ['PER... | gpl-2.0 |
AutorestCI/azure-sdk-for-python | azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/storage_insight.py | 2 | 2686 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | mit |
nemesiscodex/JukyOS-sugar | extensions/deviceicon/touchpad.py | 1 | 4769 | # Copyright (C) 2010, Walter Bender, Sugar Labs
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is di... | gpl-2.0 |
janschulz/igraph | interfaces/python/igraph/nexus.py | 1 | 21903 | # vim:ts=4:sw=4:sts=4:et
# -*- coding: utf-8 -*-
"""Interface to the Nexus online graph repository.
The classes in this file facilitate access to the Nexus online graph
repository at U{http://nexus.igraph.org}.
The main entry point of this package is the C{Nexus} variable, which is
an instance of L{NexusConnection}. ... | gpl-2.0 |
jhaux/tensorflow | tensorflow/contrib/keras/python/keras/applications/xception.py | 25 | 12314 | # 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 |
viennacl/pyviennacl-dev | pyviennacl/io.py | 2 | 1546 | import pyviennacl as p
import numpy as np
def read_mtx(fname, dtype=p.float32, sparse_type=p.CompressedMatrix):
"""
Read a MatrixMarket file. Assume coordinate format. Very crude!
"""
fd = open(fname)
lines = list(map(lambda x: x.strip().split(" "), fd.readlines()))
ln = -1
for line in line... | mit |
jsj2008/kdegames | kajongg/src/modeltest.py | 2 | 20981 | """
##
## Copyright (C) 2007 Trolltech ASA. All rights reserved.
## Copyright (C) 2010-2012 Wolfgang Rohdewald <wolfgang@rohdewald.de>
##
## This file is part of the Qt Concurrent project on Trolltech Labs.
##
## This file may be used under the terms of the GNU General Public
## License version 2.0 as published by the ... | gpl-2.0 |
cikelengfeng/HTTPIDL | Sources/Compiler/docopt.py | 94 | 19946 | """Pythonic command-line interface parser that will make you smile.
* http://docopt.org
* Repository and issue-tracker: https://github.com/docopt/docopt
* Licensed under terms of MIT license (see LICENSE-MIT)
* Copyright (c) 2013 Vladimir Keleshev, vladimir@keleshev.com
"""
import sys
import re
__all__ = ['doco... | mit |
Joergen/zamboni | mkt/fireplace/tests/test_api.py | 1 | 1450 | import json
from nose.tools import eq_
import amo
from addons.models import AddonUpsell
from mkt.api.base import get_url, list_url
from mkt.api.tests import BaseAPI
from mkt.api.tests.test_oauth import get_absolute_url
from mkt.webapps.models import Webapp
from mkt.site.fixtures import fixture
class TestAppDetail(... | bsd-3-clause |
jepcastelein/marketopy | marketo.py | 1 | 9277 | import requests
import logging
import time
class MarketoClient:
"""Basic Marketo Client"""
def __init__(self, identity, client_id, client_secret, api):
self.api_endpoint = api
self.identity_endpoint = identity
self.client_id = client_id
self.client_secret = client_secret
... | apache-2.0 |
jcassee/django-analytical | tests/unit/test_tag_hubspot.py | 1 | 1602 | """
Tests for the HubSpot template tags and filters.
"""
import pytest
from django.http import HttpRequest
from django.template import Context
from django.test.utils import override_settings
from utils import TagTestCase
from analytical.templatetags.hubspot import HubSpotNode
from analytical.utils import AnalyticalEx... | mit |
Idematica/django-oscar | tests/functional/customer/auth_tests.py | 6 | 4801 | import re
from django.core import mail
from django.core.urlresolvers import reverse
from django_webtest import WebTest
from oscar.test.testcases import WebTestCase
from oscar.core.compat import get_user_model
User = get_user_model()
class TestAUserWhoseForgottenHerPassword(WebTest):
def test_can_reset_her_pa... | bsd-3-clause |
walty8/trac | tracopt/ticket/deleter.py | 1 | 7165 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2010 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://trac.edgewall.org/wiki/TracLicense.
#
# This software consists o... | bsd-3-clause |
k3nnyfr/s2a_fr-nsis | s2a/Python/Lib/lib-tk/tkColorChooser.py | 149 | 1786 | # tk common colour chooser dialogue
#
# this module provides an interface to the native color dialogue
# available in Tk 4.2 and newer.
#
# written by Fredrik Lundh, May 1997
#
# fixed initialcolor handling in August 1998
#
#
# options (all have default values):
#
# - initialcolor: colour to mark as selected when dial... | gpl-3.0 |
pombredanne/algos-urv | gdata/youtube/service.py | 5 | 58040 | #!/usr/bin/python
#
# Copyright (C) 2008 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | bsd-3-clause |
ggaughan/dee | darwen.py | 1 | 3332 | from Dee import Relation, Key, Tuple, QUOTA, MAX, MIN, IS_EMPTY, COUNT, GENERATE
from DeeDatabase import Database
class darwen_Database(Database):
def __init__(self, name):
"""Define initial relvars and their initial values here
(Called once on database creation)"""
Database.__ini... | mit |
chirilo/ana-ka-todo-app | node_modules/laravel-elixir/node_modules/npm/node_modules/node-gyp/gyp/tools/pretty_gyp.py | 2618 | 4756 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Pretty-prints the contents of a GYP file."""
import sys
import re
# Regex to remove comments when we're counting braces.
COMMENT_RE = ... | mit |
scottmcmaster/catapult | third_party/mapreduce/mapreduce/status.py | 29 | 12789 | #!/usr/bin/env python
#
# Copyright 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | bsd-3-clause |
diofeher/django-nfa | django/contrib/admin/widgets.py | 1 | 8956 | """
Form Widget classes specific to the Django admin site.
"""
import copy
from django import newforms as forms
from django.newforms.widgets import RadioFieldRenderer
from django.newforms.util import flatatt
from django.utils.datastructures import MultiValueDict
from django.utils.text import capfirst, truncate_words
... | bsd-3-clause |
fxia22/ASM_xf | PythonD/site_python/numarray/image/combine.py | 2 | 9369 | import numarray as num
from _combine import combine as _comb
import operator as _operator
def _combine_f(funcstr, arrays, output=None, outtype=None, nlow=0, nhigh=0, badmasks=None):
arrays = [ num.asarray(a) for a in arrays ]
shape = arrays[0].shape
if output is None:
if outtype is not None:
... | gpl-2.0 |
mahak/neutron | neutron/tests/unit/plugins/ml2/drivers/openvswitch/agent/openflow/native/test_br_tun.py | 2 | 21858 | # Copyright (C) 2014,2015 VA Linux Systems Japan K.K.
# Copyright (C) 2014,2015 YAMAMOTO Takashi <yamamoto at valinux co jp>
# 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 t... | apache-2.0 |
Russell-IO/ansible | lib/ansible/executor/task_result.py | 23 | 4602 | # Copyright: (c) 2012-2014, Michael DeHaan <michael.dehaan@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
from copy import deepcopy
from ansible.parsing.dataloader import ... | gpl-3.0 |
izapolsk/integration_tests | cfme/containers/project.py | 3 | 5378 | import attr
from navmazing import NavigateToAttribute
from navmazing import NavigateToSibling
from cfme.common import Taggable
from cfme.common import TaggableCollection
from cfme.common import TagPageView
from cfme.containers.provider import ContainerObjectAllBaseView
from cfme.containers.provider import ContainerObj... | gpl-2.0 |
vivianli32/TravelConnect | flask/lib/python3.4/site-packages/babel/messages/jslexer.py | 162 | 5317 | # -*- coding: utf-8 -*-
"""
babel.messages.jslexer
~~~~~~~~~~~~~~~~~~~~~~
A simple JavaScript 1.5 lexer which is used for the JavaScript
extractor.
:copyright: (c) 2013 by the Babel Team.
:license: BSD, see LICENSE for more details.
"""
from operator import itemgetter
import re
from babel._co... | mit |
chaitu2289/xray_scattering | liblinear-multicore-2.1-2/python/liblinearutil.py | 4 | 8712 | #!/usr/bin/env python
import os, sys
sys.path = [os.path.dirname(os.path.abspath(__file__))] + sys.path
from liblinear import *
from liblinear import __all__ as liblinear_all
from ctypes import c_double
__all__ = ['svm_read_problem', 'load_model', 'save_model', 'evaluations',
'train', 'predict'] + libline... | bsd-3-clause |
chdb/DhammaMap | app/cryptoken.py | 1 | 6464 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#from __future__ import unicode_literals
import hashlib
import hmac
import os
import json
import utils as u
import widget as W
import logging
from base64 import urlsafe_b64encode\
, urlsafe_b64decode
class Base64Error (Exception):
'''invalid Base64 chara... | mit |
slowfranklin/samba | source4/heimdal/lib/wind/util.py | 88 | 1978 | #!/usr/local/bin/python
# -*- coding: iso-8859-1 -*-
# $Id$
# Copyright (c) 2004 Kungliga Tekniska Högskolan
# (Royal Institute of Technology, Stockholm, Sweden).
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following... | gpl-3.0 |
moylop260/odoo-dev | addons/report/models/report_paperformat.py | 64 | 7912 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2014-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | agpl-3.0 |
SciLifeLab/bcbio-nextgen | bcbio/rnaseq/count.py | 1 | 12286 | """
count number of reads mapping to features of transcripts
"""
import os
import sys
import itertools
# soft imports
try:
import HTSeq
import pandas as pd
import gffutils
except ImportError:
HTSeq, pd, gffutils = None, None, None
from bcbio.utils import file_exists
from bcbio.distributed.transaction... | mit |
hotdoc/hotdoc_gi_extension | setup.py | 1 | 1887 | # -*- coding: utf-8 -*-
#
# Copyright © 2015,2016 Mathieu Duponchelle <mathieu.duponchelle@opencreed.com>
# Copyright © 2015,2016 Collabora Ltd
#
# This library 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 Found... | lgpl-2.1 |
aroche/django | tests/serializers_regress/tests.py | 144 | 23114 | """
A test spanning all the capabilities of all the serializers.
This class defines sample data and a dynamically generated
test case that is capable of testing the capabilities of
the serializers. This includes all valid data values, plus
forward, backwards and self references.
"""
from __future__ import unicode_lite... | bsd-3-clause |
lepricon49/headphones | lib/html5lib/filters/inject_meta_charset.py | 1730 | 2746 | from __future__ import absolute_import, division, unicode_literals
from . import _base
class Filter(_base.Filter):
def __init__(self, source, encoding):
_base.Filter.__init__(self, source)
self.encoding = encoding
def __iter__(self):
state = "pre_head"
meta_found = (self.enco... | gpl-3.0 |
gsehub/edx-platform | lms/djangoapps/bulk_email/tests/test_email.py | 9 | 28165 | # -*- coding: utf-8 -*-
"""
Unit tests for sending course email
"""
import json
import os
from unittest import skipIf
import ddt
from django.conf import settings
from django.core import mail
from django.core.mail.message import forbid_multi_line_headers
from django.core.management import call_command
from django.urls ... | agpl-3.0 |
patochectp/navitia | source/navitiacommon/navitiacommon/__init__.py | 53 | 1193 | # Copyright (c) 2001-2014, Canal TP and/or its affiliates. All rights reserved.
#
# This file is part of Navitia,
# the software to build cool stuff with public transport.
#
# Hope you'll enjoy and contribute to this project,
# powered by Canal TP (www.canaltp.fr).
# Help us simplify mobility and open public tr... | agpl-3.0 |
apurvbhartia/gnuradio-routing | gnuradio-core/src/python/gnuradio/gruimpl/sdr_1000.py | 18 | 2582 | #
# Copyright 2003,2004 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your option)
# any later versi... | gpl-3.0 |
dagwieers/ansible | lib/ansible/plugins/callback/__init__.py | 13 | 16626 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | gpl-3.0 |
pugpe/pugpe | apps/cert/management/commands/send_certificates.py | 1 | 2215 | # -*- coding: utf-8 -*-
import traceback
from datetime import timedelta
from django.core import mail
from django.core.mail import EmailMultiAlternatives, mail_admins
from django.core.management.base import BaseCommand
from django.template.loader import render_to_string
from django.utils.translation import ugettext_laz... | mit |
wgcv/SWW-Crashphone | lib/python2.7/site-packages/pip/_vendor/distlib/scripts.py | 190 | 12307 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Vinay Sajip.
# Licensed to the Python Software Foundation under a contributor agreement.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
from io import BytesIO
import logging
import os
import re
import struct
import sys
from .compat import sysconfig, fsencode, detect_encoding, ... | apache-2.0 |
kodat/odoo-module-template | odoo_module_template/model.py | 1 | 1936 | # -*- coding: utf-8 -*-
# Bashir Idirs (Alsuty)
# Copyright (C) 2016.
#
# This Code is free: 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 optio... | gpl-3.0 |
XiaosongWei/chromium-crosswalk | third_party/WebKit/Source/build/scripts/make_media_features.py | 78 | 1324 | #!/usr/bin/env python
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import media_feature_symbol
import in_generator
import template_expander
import name_utilities
import sys
class MakeMediaFeaturesWri... | bsd-3-clause |
Commonists/wm_metrics | app/wmmetrics.py | 2 | 4057 | #!/usr/bin/env python
# -*- coding: latin-1 -*-
"""wm_metrics flask webapp module."""
import os
import sys
from flask import Flask, render_template, request
current_dir = os.path.abspath(os.path.dirname(__file__))
sys.path.insert(0, os.path.join(current_dir, '..'))
from wm_metrics.fdc.round import Round
from wm_me... | mit |
susuchina/ERPNEXT | erpnext/manufacturing/doctype/bom/bom.py | 11 | 14754 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import cint, cstr, flt
from frappe import _
from frappe.model.document import Document
from operator import itemgetter... | agpl-3.0 |
svenstaro/ansible | lib/ansible/modules/network/f5/bigip_device_dns.py | 78 | 12525 | #!/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 |
joopert/home-assistant | tests/components/homekit/test_type_thermostats.py | 2 | 22963 | """Test different accessory types: Thermostats."""
from collections import namedtuple
from unittest.mock import patch
import pytest
from homeassistant.components.climate.const import (
ATTR_CURRENT_TEMPERATURE,
ATTR_HVAC_ACTION,
ATTR_HVAC_MODE,
ATTR_HVAC_MODES,
ATTR_MAX_TEMP,
ATTR_MIN_TEMP,
... | apache-2.0 |
mmnelemane/neutron | neutron/tests/unit/notifiers/test_nova.py | 18 | 14302 | # Copyright 2014 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 requ... | apache-2.0 |
switchboardOp/ansible | lib/ansible/playbook/taggable.py | 62 | 3447 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | gpl-3.0 |
kurtdawg24/robotframework | utest/utils/test_markuputils.py | 24 | 28370 | import unittest
from robot.utils.asserts import assert_equals
from robot.utils.markuputils import html_escape, html_format, attribute_escape
from robot.utils.htmlformatters import TableFormatter
_format_table = TableFormatter()._format_table
def assert_escape_and_format(inp, exp_escape=None, exp_format=None):
... | apache-2.0 |
mavit/ansible | lib/ansible/plugins/connection/__init__.py | 14 | 15940 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2015 Toshio Kuratomi <tkuratomi@ansible.com>
# (c) 2017, Peter Sprygada <psprygad@redhat.com>
# (c) 2017 Ansible Project
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import fcntl
import gettext
import os
import ... | gpl-3.0 |
saurabh6790/med_app_rels | patches/may_2013/p08_change_item_wise_tax.py | 30 | 1085 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
import webnotes
import json
from webnotes.utils import flt
def execute():
webnotes.conn.auto_commit_on_many_writes = 1
for doctype in ["Purchase Taxes and Charges", "Sales Taxes and Ch... | agpl-3.0 |
sixfeetup/cloud-custodian | c7n/resources/waf.py | 1 | 1475 | # Copyright 2016-2017 Capital One Services, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | apache-2.0 |
gusai-francelabs/datafari | debian7/zookeeper/src/contrib/huebrowser/zkui/src/zkui/utils.py | 114 | 1120 | # 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 |
BT-astauder/odoo | addons/lunch/__openerp__.py | 267 | 2542 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2012 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the G... | agpl-3.0 |
JoseBlanca/vcf_crumbs | test/test_utils.py | 1 | 4369 | # Copyright 2013 Jose Blanca, Peio Ziarsolo, COMAV-Univ. Politecnica Valencia
# This file is part of seq_crumbs.
# vcf_crumbs 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, ... | gpl-3.0 |
saradbowman/osf.io | api/base/filters.py | 2 | 24828 | import datetime
import functools
import operator
import re
import pytz
from api.base import utils
from api.base.exceptions import (
InvalidFilterComparisonType,
InvalidFilterError, InvalidFilterFieldError,
InvalidFilterMatchType, InvalidFilterOperator,
InvalidFilterValue,
)
from api.base.serializers im... | apache-2.0 |
johnstyle/ghostium | assets/_components/highlight.js.origin/docs/conf.py | 6 | 7771 | # -*- coding: utf-8 -*-
#
# highlight.js documentation build configuration file, created by
# sphinx-quickstart on Wed Sep 12 23:48:27 2012.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
... | mit |
guru-digital/CouchPotatoServer | couchpotato/core/media/movie/providers/metadata/base.py | 48 | 7263 | import os
import shutil
import traceback
from couchpotato.core.event import addEvent, fireEvent
from couchpotato.core.helpers.encoding import sp
from couchpotato.core.helpers.variable import getIdentifier, underscoreToCamel
from couchpotato.core.logger import CPLog
from couchpotato.core.media._base.providers.metadata.... | gpl-3.0 |
Mozta/pagina-diagnostijuego | venv/lib/python2.7/site-packages/pip/commands/uninstall.py | 798 | 2884 | from __future__ import absolute_import
import pip
from pip.wheel import WheelCache
from pip.req import InstallRequirement, RequirementSet, parse_requirements
from pip.basecommand import Command
from pip.exceptions import InstallationError
class UninstallCommand(Command):
"""
Uninstall packages.
pip is a... | gpl-3.0 |
zstyblik/infernal-twin | build/pillow/PIL/ImagePath.py | 47 | 1239 | #
# The Python Imaging Library
# $Id$
#
# path interface
#
# History:
# 1996-11-04 fl Created
# 2002-04-14 fl Added documentation stub class
#
# Copyright (c) Secret Labs AB 1997.
# Copyright (c) Fredrik Lundh 1996.
#
# See the README file for information on usage and redistribution.
#
from PIL import Image
# th... | gpl-3.0 |
aldenjenkins/foobargamingwebsite | paypal/pro/migrations/0001_initial.py | 12 | 2843 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.Create... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.