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 |
|---|---|---|---|---|---|
zx8/youtube-dl | youtube_dl/extractor/dump.py | 120 | 1036 | # encoding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
class DumpIE(InfoExtractor):
_VALID_URL = r'^https?://(?:www\.)?dump\.com/(?P<id>[a-zA-Z0-9]+)/'
_TEST = {
'url': 'http://www.dump.com/oneus/',
'md5': 'ad71704d1e67dfd9e81e3e8b42d69d99',
... | unlicense |
songfj/calibre | src/calibre/ebooks/markdown/extensions/toc.py | 46 | 8336 | """
Table of Contents Extension for Python-Markdown
* * *
(c) 2008 [Jack Miller](http://codezen.org)
Dependencies:
* [Markdown 2.1+](http://packages.python.org/Markdown/)
"""
from __future__ import absolute_import
from __future__ import unicode_literals
from . import Extension
from ..treeprocessors import Treeproce... | gpl-3.0 |
40423107/2017springcd_hw | theme/pelican-bootstrap3_local/static/glow/primitive.py | 161 | 4838 | from javascript import JSConstructor, JSObject
from .vector import vec
class primitive:
def __init__(self, prim, **kwargs):
for _key in kwargs.keys():
if isinstance(kwargs[_key], vec):
kwargs[_key]=kwargs[_key]._vec
self._prim=prim(kwargs)
def rotate(self, **kwargs):
if '... | agpl-3.0 |
Emergya/icm-openedx-educamadrid-platform-basic | cms/djangoapps/models/settings/course_grading.py | 143 | 8907 | from datetime import timedelta
from xmodule.modulestore.django import modulestore
class CourseGradingModel(object):
"""
Basically a DAO and Model combo for CRUD operations pertaining to grading policy.
"""
# Within this class, allow access to protected members of client classes.
# This comes up wh... | agpl-3.0 |
HBEE/odoo-addons | stock_picking_locations/__openerp__.py | 3 | 1744 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 ADHOC SA (http://www.adhoc.com.ar)
# All Rights Reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Pu... | agpl-3.0 |
quantumlib/OpenFermion | src/openfermion/testing/lih_integration_test.py | 1 | 6590 | # 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
# distribu... | apache-2.0 |
kpayson64/grpc | examples/python/route_guide/route_guide_pb2_grpc.py | 55 | 4244 | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
import route_guide_pb2 as route__guide__pb2
class RouteGuideStub(object):
"""Interface exported by the server.
"""
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
self.GetFe... | apache-2.0 |
MSusik/invenio | invenio/modules/formatter/format_elements/bfe_date_rec.py | 39 | 1053 | ## This file is part of Invenio.
## Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at your option... | gpl-2.0 |
lmazuel/azure-sdk-for-python | azure-batch/azure/batch/models/pool_add_parameter.py | 1 | 12361 | # 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 |
UBERMALLOW/kernel_lge_hammerhead | scripts/tracing/draw_functrace.py | 14676 | 3560 | #!/usr/bin/python
"""
Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com>
Licensed under the terms of the GNU GPL License version 2
This script parses a trace provided by the function tracer in
kernel/trace/trace_functions.c
The resulted trace is processed into a tree to produce a more human
view of the call ... | gpl-2.0 |
achang97/YouTunes | lib/python2.7/site-packages/pyasn1_modules/rfc2560.py | 5 | 8307 | #
# This file is part of pyasn1-modules software.
#
# Copyright (c) 2005-2017, Ilya Etingof <etingof@gmail.com>
# License: http://pyasn1.sf.net/license.html
#
# OCSP request/response syntax
#
# Derived from a minimal OCSP library (RFC2560) code written by
# Bud P. Bruegger <bud@ancitel.it>
# Copyright: Ancitel, S.p.a, ... | mit |
cosmicAsymmetry/zulip | zerver/tests/test_tutorial.py | 32 | 2671 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
from typing import Any, Dict
from zerver.lib.test_helpers import (
get_user_profile_by_email,
most_recent_message,
)
from zerver.lib.test_classes import (
ZulipTestCase,
)
from zerver.models import (
... | apache-2.0 |
cmelange/ansible | lib/ansible/plugins/action/script.py | 22 | 3738 | # (c) 2012, 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) any lat... | gpl-3.0 |
nmercier/linux-cross-gcc | linux/lib/python2.7/dist-packages/numpy/lib/tests/test_nanfunctions.py | 21 | 28230 | from __future__ import division, absolute_import, print_function
import warnings
import numpy as np
from numpy.testing import (
run_module_suite, TestCase, assert_, assert_equal, assert_almost_equal,
assert_raises, assert_array_equal
)
# Test data
_ndat = np.array([[0.6244, np.nan, 0.2692, 0.0116, np.na... | bsd-3-clause |
epssy/hue | desktop/core/ext-py/python-openid-2.2.5/openid/test/cryptutil.py | 87 | 2961 | import sys
import random
import os.path
from openid import cryptutil
# Most of the purpose of this test is to make sure that cryptutil can
# find a good source of randomness on this machine.
def test_cryptrand():
# It's possible, but HIGHLY unlikely that a correct implementation
# will fail by returning the ... | apache-2.0 |
kingvuplus/gui_test3 | lib/python/Plugins/Extensions/DVDBurn/ProjectSettings.py | 34 | 10923 | from Screens.Screen import Screen
from Screens.MessageBox import MessageBox
from Screens.HelpMenu import HelpableScreen
from Components.ActionMap import ActionMap
from Components.Sources.StaticText import StaticText
from Components.FileList import FileList
from Tools.Directories import fileExists, resolveFilename, SCOP... | gpl-2.0 |
alexlo03/ansible | contrib/inventory/vagrant.py | 28 | 4076 | #!/usr/bin/env python
"""
Vagrant external inventory script. Automatically finds the IP of the booted vagrant vm(s), and
returns it under the host group 'vagrant'
Example Vagrant configuration using this script:
config.vm.provision :ansible do |ansible|
ansible.playbook = "./provision/your_playbook.yml"
... | gpl-3.0 |
mrgloom/menpofit | menpofit/_version.py | 5 | 15768 |
# This file helps to compute a version number in source trees obtained from
# git-archive tarball (such as those provided by githubs download-from-tag
# feature). Distribution tarballs (built by setup.py sdist) and build
# directories (produced by setup.py build) will contain a much shorter file
# that just contains t... | bsd-3-clause |
xtao/openduckbill | src/openduckbilld.py | 3 | 1582 | #!/usr/bin/python2.4
# Copyright 2008 Google Inc.
# Author : Anoop Chandran <anoopj@google.com>
#
# openduckbill is a simple backup application. It offers support for
# transferring data to a local backup directory, NFS. It also provides
# file system monitoring of directories marked for backup. Please read
# the READ... | gpl-2.0 |
ZenHarbinger/snapcraft | integration_tests/test_tar_plugin.py | 2 | 2083 | # -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2015-2017 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in ... | gpl-3.0 |
taylorhxu/pybrain | examples/supervised/backprop/datasets/parity.py | 30 | 1587 | #!/usr/bin/env python
__author__ = 'Tom Schaul (tom@idsia.ch)'
from pybrain.datasets import SequentialDataSet
class ParityDataSet(SequentialDataSet):
""" Determine whether the bitstring up to the current point conains a pair number of 1s or not."""
def __init__(self):
SequentialDataSet.__init__(self, ... | bsd-3-clause |
sysalexis/kbengine | kbe/res/scripts/common/Lib/test/test_asynchat.py | 72 | 11161 | # test asynchat
from test import support
# If this fails, the test will be skipped.
thread = support.import_module('_thread')
import asynchat
import asyncore
import errno
import socket
import sys
import time
import unittest
import unittest.mock
try:
import threading
except ImportError:
threading = None
HOST... | lgpl-3.0 |
jicruz/heroku-bot | lib/pip/_vendor/distlib/wheel.py | 412 | 39115 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013-2016 Vinay Sajip.
# Licensed to the Python Software Foundation under a contributor agreement.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
from __future__ import unicode_literals
import base64
import codecs
import datetime
import distutils.util
from email import message_from... | gpl-3.0 |
nguyenppt/support-tools | googlecode-issues-exporter/github_issue_converter_test.py | 2 | 21195 | # Copyright 2013 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | apache-2.0 |
heke123/chromium-crosswalk | net/data/verify_certificate_chain_unittest/generate-expired-target-notBefore.py | 5 | 1182 | #!/usr/bin/python
# Copyright (c) 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Certificate chain with 1 intermediary, where the target is expired (violates
validity.notBefore). Verification is expected to fail."... | bsd-3-clause |
qlands/onadata | onadata/apps/logger/migrations/0007_auto__add_field_xform_has_start_time.py | 13 | 6918 | # 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 field 'XForm.has_start_time'
db.add_column('odk_logger_xform', 'has_start_time', self.gf('django.db.models... | bsd-2-clause |
cstipkovic/spidermonkey-research | python/macholib/macholib/itergraphreport.py | 16 | 1929 | """
Utilities for creating dot output from a MachOGraph
XXX: need to rewrite this based on altgraph.Dot
"""
from collections import deque
try:
from itertools import imap
except ImportError:
imap = map
__all__ = ['itergraphreport']
def itergraphreport(nodes, describe_edge, name='G'):
edges = deque()
... | mpl-2.0 |
anoopcs9/samba | python/samba/tests/net_join.py | 6 | 2340 | # Unix SMB/CIFS implementation.
#
# Copyright (C) Catalyst.Net Ltd. 2017
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later versio... | gpl-3.0 |
plusk01/roboclaw-v5 | examples/roboclaw_speeddistance.py | 2 | 2263 | #***Before using this example the motor/controller combination must be
#***tuned and the settings saved to the Roboclaw using IonMotion.
#***The Min and Max Positions must be at least 0 and 50000
import time
import roboclaw
def displayspeed():
enc1 = roboclaw.ReadEncM1(address)
enc2 = roboclaw.ReadEncM2(ad... | mit |
s142857/servo | tests/wpt/css-tests/tools/html5lib/html5lib/tests/test_stream.py | 446 | 6264 | from __future__ import absolute_import, division, unicode_literals
from . import support # flake8: noqa
import unittest
import codecs
from io import BytesIO
from six.moves import http_client
from html5lib.inputstream import (BufferedStream, HTMLInputStream,
HTMLUnicodeInputStream, ... | mpl-2.0 |
Lilykos/invenio | invenio/legacy/pdfchecker/__init__.py | 13 | 1091 | #!@PYTHON@
# -*- mode: python; coding: utf-8; -*-
#
# This file is part of Invenio.
# Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2014 CERN.
#
# Invenio is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundati... | gpl-2.0 |
keyurpatel076/MissionPlannerGit | Lib/site-packages/numpy/core/_internal.py | 53 | 18020 | #A place for code to be called from C-code
# that implements more complicated stuff.
import re
import sys
import warnings
from numpy.compat import asbytes, bytes
if (sys.byteorder == 'little'):
_nbo = asbytes('<')
else:
_nbo = asbytes('>')
def _makenames_list(adict):
from numpy.core import dtype
al... | gpl-3.0 |
neuroidss/nupic.research | projects/sequence_classification/run_encoder_with_union.py | 9 | 8995 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2016, 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 |
liushuaikobe/evermd | lib/thrift/transport/TTwisted.py | 74 | 6547 | #
# 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... | gpl-2.0 |
azazel75/LasaurApp | docs/conf.py | 1 | 9717 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# LasaurApp documentation build configuration file, created by
# sphinx-quickstart on Fri Jun 10 02:42:34 2016.
#
# 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
# ... | gpl-3.0 |
b-cannon/my_djae | djangae/db/utils.py | 1 | 10507 | #STANDARD LIB
from datetime import datetime
from decimal import Decimal
from itertools import chain
import warnings
#LIBRARIES
from django.conf import settings
from django.db import models
from django.db.backends.util import format_number
from django.db import IntegrityError
from django.utils import timezone
from goo... | bsd-3-clause |
abramhindle/marsyas-fork | scripts/sfplugin-test-wrapper.py | 5 | 1546 | #!/usr/bin/env python
import os
import sys
import subprocess
import shutil
import commands
def runCommand(workingDir, bextractLocation, sfpluginLocation, extraBextractCmdArgs,
mfFileLocation, outputMplFile, testFile, goodFilename):
os.chdir(workingDir)
bextractCmd = ("%s %s -t %s -p %s") % (be... | gpl-2.0 |
stefan-andritoiu/upm | examples/python/oled_ssd1308.py | 6 | 5876 | #!/usr/bin/env python
# Author: Zion Orent <zorent@ics.com>
# Copyright (c) 2015 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 ... | mit |
wubr2000/googleads-python-lib | examples/adxbuyer/v201502/basic_operations/remove_placement.py | 4 | 2203 | #!/usr/bin/python
#
# Copyright 2013 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | apache-2.0 |
hrjn/scikit-learn | examples/cluster/plot_birch_vs_minibatchkmeans.py | 333 | 3694 | """
=================================
Compare BIRCH and MiniBatchKMeans
=================================
This example compares the timing of Birch (with and without the global
clustering step) and MiniBatchKMeans on a synthetic dataset having
100,000 samples and 2 features generated using make_blobs.
If ``n_clusters... | bsd-3-clause |
paulrouget/servo | tests/wpt/web-platform-tests/webdriver/tests/close_window/user_prompts.py | 22 | 4182 | # META: timeout=long
import pytest
from tests.support.asserts import assert_dialog_handled, assert_error, assert_success
def close(session):
return session.transport.send(
"DELETE", "session/{session_id}/window".format(**vars(session)))
@pytest.fixture
def check_user_prompt_closed_without_exception(se... | mpl-2.0 |
PsychoTV/PsychoTeam.repository | plugin.video.PsychoTV/resources/lib/sources/wsonline_tv.py | 6 | 4721 | # -*- coding: utf-8 -*-
'''
Specto Add-on
Copyright (C) 2015 lambda
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 l... | gpl-2.0 |
sam-tsai/django-old | tests/regressiontests/utils/datastructures.py | 27 | 1212 | """
>>> from django.utils.datastructures import SortedDict
>>> d = SortedDict()
>>> d[7] = 'seven'
>>> d[1] = 'one'
>>> d[9] = 'nine'
>>> d.keys()
[7, 1, 9]
>>> d.values()
['seven', 'one', 'nine']
>>> d.items()
[(7, 'seven'), (1, 'one'), (9, 'nine')]
# Overwriting an item keeps it's place.
>>> d[1] = 'ONE'
>>> d.valu... | bsd-3-clause |
fldc/CouchPotatoServer | couchpotato/core/plugins/category/main.py | 61 | 3963 | import traceback
from couchpotato import get_db
from couchpotato.api import addApiView
from couchpotato.core.event import addEvent
from couchpotato.core.helpers.encoding import toUnicode
from couchpotato.core.logger import CPLog
from couchpotato.core.plugins.base import Plugin
from .index import CategoryIndex, Categor... | gpl-3.0 |
aviweit/libcloud | libcloud/test/test_utils.py | 42 | 13018 | # -*- 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 "Li... | apache-2.0 |
django-nonrel/djangoappengine | docs/conf.py | 3 | 7964 | # -*- coding: utf-8 -*-
#
# Django App Engine documentation build configuration file, created by
# sphinx-quickstart on Tue Dec 20 20:01:39 2011.
#
# 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 fil... | bsd-3-clause |
funbaker/astropy | astropy/io/misc/asdf/__init__.py | 2 | 1456 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
"""
The **asdf** subpackage contains code that is used to serialize astropy types
so that they can be represented and stored using the Advanced Scientific Data
Format (ASDF). This subpackage defines classes, referred to as **tags**,... | bsd-3-clause |
ingkebil/GMDBot | page_exists.py | 1 | 1236 | #!/usr/bin/env python
"""Check if a '(data page)' for a biomolecule exists"""
__author__ = "Kenny Billiau"
__copyright__ = "2014, GMD"
__license__ = "GPL v2"
__version__ = "0.1"
import sys
import urllib2
import re
import downloadinchi as inchi
import openpyxl as px
import urllib
def get_molecules_from_xlsx(fn):
... | gpl-2.0 |
ldgarcia/django-allauth | allauth/socialaccount/providers/vk/provider.py | 65 | 1616 | from allauth.socialaccount import providers
from allauth.socialaccount.providers.base import ProviderAccount
from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider
from allauth.socialaccount import app_settings
class VKAccount(ProviderAccount):
def get_profile_url(self):
return self.ac... | mit |
adviti/melange | thirdparty/google_appengine/lib/django_0_96/django/utils/feedgenerator.py | 32 | 11349 | """
Syndication feed generation library -- used for generating RSS, etc.
Sample usage:
>>> feed = feedgenerator.Rss201rev2Feed(
... title=u"Poynter E-Media Tidbits",
... link=u"http://www.poynter.org/column.asp?id=31",
... description=u"A group weblog by the sharpest minds in online media/journalism/publi... | apache-2.0 |
chidea/GoPythonDLLWrapper | bin/lib/wsgiref/util.py | 119 | 5634 | """Miscellaneous WSGI-related Utilities"""
import posixpath
__all__ = [
'FileWrapper', 'guess_scheme', 'application_uri', 'request_uri',
'shift_path_info', 'setup_testing_defaults',
]
class FileWrapper:
"""Wrapper to convert file-like objects to iterables"""
def __init__(self, filelike, blksize=819... | mit |
apigee/edx-platform | common/djangoapps/student/migrations/0031_drop_student_anonymoususerid_temp_archive.py | 5 | 15979 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
"Write your forwards methods here."
# Note: Remember to use orm['appname.ModelName'] rather than "from appname.mo... | agpl-3.0 |
codrut3/tensorflow | tensorflow/compiler/tests/reduce_ops_test.py | 19 | 5418 | # 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 |
johndpope/tensorflow | tensorflow/compiler/tests/clustering_test.py | 123 | 3878 | # 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 |
s1lvester/heuteinmannheim | heuteinma.py | 1 | 6121 | import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), "lib"))
import facebook
import websites
import feeds
#import beachstatus
from event import EventVault
import logging
import datetime
import time
import locale
locale.setlocale(locale.LC_TIME, '') # locale for date, time an the infamous germ... | mit |
fhools/doom3.gpl | neo/sys/gllog/logfunc.py | 62 | 2211 | #!/usr/bin/env python
# generate logging code
# this requires an analysis of the parameters for verbose and do actual call
import sys, string, re
from read import read_gl
def do_logfunc(f_in, f_out):
(gl, wgl, glX) = read_gl(f_in)
for l in (gl, glX):
for t in l:
# process ret type to strip trailing spaces
... | gpl-3.0 |
ghtmtt/QGIS | tests/src/python/test_qgsrange.py | 23 | 23316 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsRange
.. note:: This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
"""
__author_... | gpl-2.0 |
AlCutter/certificate-transparency | python/ct/client/async_log_client_test.py | 8 | 16485 | #!/usr/bin/env trial
import gflags
import json
import mock
import sys
import urlparse
from ct.client import log_client
from ct.client import async_log_client
from ct.client import log_client_test_util as test_util
from ct.client.db import database
from twisted.internet import defer
from twisted.internet import task
fr... | apache-2.0 |
GuLinux/PySpectrum | import_image.py | 1 | 5892 | from pyui.import_image import Ui_ImportImage
from PyQt5.QtWidgets import QWidget, QToolBar, QDialog, QDialogButtonBox, QProgressDialog, QMessageBox
from PyQt5.QtGui import QIcon
from PyQt5.QtCore import Qt, QCoreApplication
from qmathplotwidget import QMathPlotWidget, QImPlotWidget
import matplotlib.pyplot as plt
from ... | gpl-3.0 |
h-hirokawa/swampdragon | swampdragon/tests/test_selfpub_model.py | 1 | 3350 | from ..route_handler import ModelRouter
from ..pubsub_providers.base_provider import PUBACTIONS
from .dragon_test_case import DragonTestCase
from .models import FooSelfPub, BarSelfPub
from .serializers import FooSelfPubSerializer, BarSelfPubSerializer
from datetime import datetime
class FooModelRouter(ModelRouter):
... | bsd-3-clause |
Kalyzee/edx-platform | common/djangoapps/xblock_django/tests/test_user_service.py | 132 | 3992 | """
Tests for the DjangoXBlockUserService.
"""
from django.test import TestCase
from xblock_django.user_service import (
DjangoXBlockUserService,
ATTR_KEY_IS_AUTHENTICATED,
ATTR_KEY_USER_ID,
ATTR_KEY_USERNAME,
ATTR_KEY_USER_IS_STAFF,
)
from student.models import anonymous_id_for_user
from student.te... | agpl-3.0 |
redhat-openstack/ironic | ironic/tests/conf_fixture.py | 11 | 1431 | # 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 |
MingdaZhou/gnuradio | gr-vocoder/examples/codec2_audio_loopback.py | 47 | 1553 | #!/usr/bin/env python
#
# Copyright 2005,2007,2011 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 ... | gpl-3.0 |
AakashRaina/radpress | radpress/urls.py | 3 | 1287 | from django.conf.urls import patterns, url
from radpress.views import (
ArticleArchiveView, ArticleDetailView, ArticleListView, PreviewView,
PageDetailView, SearchView, ZenModeView, ZenModeUpdateView)
from radpress.feeds import ArticleFeed
urlpatterns = patterns(
'',
url(r'^$',
view=ArticleLis... | mit |
nexusz99/boto | boto/services/result.py | 153 | 5596 | #!/usr/bin/env python
# Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rig... | mit |
admcrae/tensorflow | tensorflow/examples/adding_an_op/zero_out_2_test.py | 111 | 1988 | # 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 |
mszewczy/odoo | addons/board/__openerp__.py | 261 | 1647 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2012 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you ca... | agpl-3.0 |
ecino/compassion-modules | thankyou_letters/__manifest__.py | 2 | 2325 | # -*- coding: utf-8 -*-
##############################################################################
#
# ______ Releasing children from poverty _
# / ____/___ ____ ___ ____ ____ ___________(_)___ ____
# / / / __ \/ __ `__ \/ __ \/ __ `/ ___/ ___/ / __ \/ __ \
# / /___/ /_/ / / / / / / /_/... | agpl-3.0 |
Hazelsuko07/17WarmingUp | py3.6/lib/python3.6/site-packages/pip/operations/check.py | 342 | 1590 |
def check_requirements(installed_dists):
missing_reqs_dict = {}
incompatible_reqs_dict = {}
for dist in installed_dists:
key = '%s==%s' % (dist.project_name, dist.version)
missing_reqs = list(get_missing_reqs(dist, installed_dists))
if missing_reqs:
missing_reqs_dict[... | mit |
DefyVentures/edx-platform | lms/djangoapps/survey/models.py | 81 | 7589 | """
Models to support Course Surveys feature
"""
import logging
from lxml import etree
from collections import OrderedDict
from django.db import models
from student.models import User
from django.core.exceptions import ValidationError
from model_utils.models import TimeStampedModel
from survey.exceptions import Surv... | agpl-3.0 |
INM-6/python-neo | neo/io/neuralynxio_v1.py | 2 | 105289 | """
Class for reading data from Neuralynx files.
This IO supports NCS, NEV and NSE file formats.
This module is an older implementation with old neo.io API.
A new class NeuralynxIO compunded by NeuralynxRawIO and BaseFromIO
superseed this one.
Depends on: numpy
Supported: Read
Author: Julia Sprenger, Carlos Canova... | bsd-3-clause |
captainpete/rethinkdb | external/v8_3.30.33.16/build/landmines.py | 49 | 4879 | #!/usr/bin/env python
# Copyright 2014 the V8 project 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 script runs every build as a hook. If it detects that the build should
be clobbered, it will touch the file <build_dir>/.lan... | agpl-3.0 |
dhutchis/accumulo | test/system/bench/cloudstone5/cloudstone5.py | 7 | 1070 | # 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 |
blamedcloud/AISuite | weight_heuristic.py | 2 | 2291 | #!/usr/bin/env python
#weight_heuristic.py
import random
from alphabeta import UPPER_BOUND
from alphabeta import LOWER_BOUND
class WeightHeuristic(object):
def __init__(self, weight_m):
self.weights = weight_m
self.wins = 0
self.losses = 0
def __call__(self, game_state):
value = 0
state = self.parse(gam... | mit |
bkirui/odoo | addons/account/company.py | 384 | 2814 | # -*- 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 |
jaapz/werkzeug | examples/couchy/views.py | 44 | 1999 | from werkzeug.utils import redirect
from werkzeug.exceptions import NotFound
from couchy.utils import render_template, expose, \
validate_url, url_for, Pagination
from couchy.models import URL
@expose('/')
def new(request):
error = url = ''
if request.method == 'POST':
url = request.form.get('url... | bsd-3-clause |
nesi/easybuild-framework | easybuild/framework/easyconfig/constants.py | 6 | 2350 | #
# Copyright 2013-2015 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en),
# the Hercules foundation (http... | gpl-2.0 |
bbc/kamaelia | Sketches/MPS/BugReports/FixTests/Kamaelia/Kamaelia/File/WholeFileWriter.py | 9 | 2403 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache License... | apache-2.0 |
polojacky/ehfpi | ehf/rest_framework/tests/test_nullable_fields.py | 16 | 1069 | from django.core.urlresolvers import reverse
from rest_framework.compat import patterns, url
from rest_framework.test import APITestCase
from rest_framework.tests.models import NullableForeignKeySource
from rest_framework.tests.serializers import NullableFKSourceSerializer
from rest_framework.tests.views import Nullab... | apache-2.0 |
tsdmgz/ansible | lib/ansible/utils/module_docs_fragments/aci.py | 36 | 2382 | # -*- coding: utf-8 -*-
# Copyright 2017 Dag Wieers <dag@wieers.com>
# Copyright 2017 Swetha Chunduri (@schunduri)
# This file is part of Ansible by Red Hat
#
# 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 Fo... | gpl-3.0 |
aabbox/kbengine | kbe/src/lib/python/Lib/test/test_asyncio/test_windows_events.py | 60 | 4592 | import os
import sys
import unittest
if sys.platform != 'win32':
raise unittest.SkipTest('Windows only')
import _winapi
import asyncio
from asyncio import _overlapped
from asyncio import test_utils
from asyncio import windows_events
class UpperProto(asyncio.Protocol):
def __init__(self):
self.buf =... | lgpl-3.0 |
grlee77/scipy | scipy/optimize/_lsq/trf.py | 21 | 19479 | """Trust Region Reflective algorithm for least-squares optimization.
The algorithm is based on ideas from paper [STIR]_. The main idea is to
account for the presence of the bounds by appropriate scaling of the variables (or,
equivalently, changing a trust-region shape). Let's introduce a vector v:
| ub[i] ... | bsd-3-clause |
adlius/osf.io | api/base/exceptions.py | 2 | 12106 | from past.builtins import basestring
from rest_framework import status as http_status
from django.utils.translation import ugettext_lazy as _
from rest_framework import status
from rest_framework.exceptions import APIException, AuthenticationFailed, ErrorDetail
def get_resource_object_member(error_key, context):
... | apache-2.0 |
fosfataza/protwis | common/sequence_signature.py | 1 | 29836 | """
A module for generating sequence signatures for the given two sets of proteins.
"""
from django.conf import settings
from django.core import exceptions
from alignment.functions import strip_html_tags, get_format_props
Alignment = getattr(__import__(
'common.alignment_' + settings.SITE_NAME,
fromlist=['Alig... | apache-2.0 |
anirudhSK/chromium | tools/perf/benchmarks/thread_times.py | 2 | 1721 | # 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.
from telemetry import test
from benchmarks import silk_flags
from measurements import thread_times
class ThreadTimesKeySilkCases(test.Test):
"""Measures ... | bsd-3-clause |
cmelange/ansible | lib/ansible/modules/system/aix_inittab.py | 26 | 7988 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Joris Weijters <joris.weijters@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... | gpl-3.0 |
wrigri/libcloud | libcloud/test/storage/test_oss.py | 11 | 36276 | # -*- 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 "Lice... | apache-2.0 |
dims/cinder | cinder/tests/unit/fake_vmem_client.py | 23 | 1779 | # Copyright 2014 Violin Memory, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | apache-2.0 |
brianjimenez/lightdock | bin/simulation/lightdock_setup.py | 1 | 6309 | #!/usr/bin/env python
"""Before launching the LightDock simulation, a setup step is required.
This step parses the input PDB structures, calculates the minimum ellipsoid
containing each of them, calculates the swarms on the surface of the
receptor and populates each swarm with random coordinates for each glowworm's... | gpl-3.0 |
m1ck/bookadoptions | django/conf/locale/pl/formats.py | 238 | 1288 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j E Y'
TIME_FORMAT = 'H:i:s'
DATETIME_FORMAT = 'j E Y H:i:s'
YEAR_MONTH_F... | bsd-3-clause |
garbled1/ansible | lib/ansible/module_utils/pure.py | 71 | 3161 | # -*- coding: utf-8 -*-
# This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own lic... | gpl-3.0 |
faun/django_test | build/lib/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 |
thedrow/django | tests/gis_tests/geo3d/tests.py | 199 | 17484 | from __future__ import unicode_literals
import os
import re
from unittest import skipUnless
from django.contrib.gis.db.models import Extent3D, Union
from django.contrib.gis.db.models.functions import (
AsGeoJSON, AsKML, Length, Perimeter, Scale, Translate,
)
from django.contrib.gis.gdal import HAS_GDAL
from djang... | bsd-3-clause |
whereismyjetpack/ansible | lib/ansible/plugins/connection/zone.py | 45 | 7978 | # Based on local.py (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# and chroot.py (c) 2013, Maykel Moya <mmoya@speedyrails.com>
# and jail.py (c) 2013, Michael Scherer <misc@zarb.org>
# (c) 2015, Dagobert Michelsen <dam@baltic-online.de>
# (c) 2015, Toshio Kuratomi <tkuratomi@ansible.com>
#
# This file ... | gpl-3.0 |
StanfordBioinformatics/loom | server/loomengine_server/core/settings.py | 2 | 14306 | # Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/
import datetime
import json
import logging
import os
import random
import socket
import sys
import tempfile
import warnings
from django.core.exceptions import ValidationError
SESSION_... | agpl-3.0 |
senuido/stash-scanner | lib/ModsHelper.py | 1 | 3577 | import json
import re
from lib.ModFilter import ModFilterType
from lib.ModFilterGroup import PSEUDO_MODS
from lib.Utility import AppException
class ModsHelper:
MODS_FNAME = 'res\\mods.json'
MOD_TEXT_REGEX = re.compile('\(([^()]+)\)\s+(.*)')
def __init__(self):
self.mod_list = None
self.m... | gpl-3.0 |
jashworth-isb/cmonkey-python | test/util_test.py | 1 | 11520 | """util_test.py - test classes for util module
This file is part of cMonkey Python. Please see README and LICENSE for
more information and licensing details.
"""
import unittest
import util
import operator
import numpy as np
class DelimitedFileTest(unittest.TestCase): # pylint: disable-msg=R0904
"""Test class f... | lgpl-3.0 |
Srisai85/scipy | scipy/stats/tests/test_contingency.py | 126 | 5959 | from __future__ import division, print_function, absolute_import
import numpy as np
from numpy.testing import (run_module_suite, assert_equal, assert_array_equal,
assert_array_almost_equal, assert_approx_equal, assert_raises,
assert_allclose)
from scipy.special import xlogy
from scipy.stats.contingen... | bsd-3-clause |
Lkhagvadelger/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/bot/patchanalysistask.py | 122 | 10361 | # Copyright (c) 2010 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... | bsd-3-clause |
baxter-cs/BaxterEPCSWeek1 | studentInfo.py | 1 | 1635 | def main():
students = [
Student("Larsson", 37),
Student("BonJovi", 55),
]
printHeader()
selection = getUserSelection()
if selection == 0:
printStudentsByAge(students)
elif selection == 1:
pass
elif selection == 2:
pass
else:
print "SELECTION NOT RECOGNIZED"
class Student:
d... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.