repo_name stringlengths 5 100 | path stringlengths 4 294 | copies stringclasses 990
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
thedod/redwind | redwind/plugins/twitter.py | 1 | 18500 | from .. import app
from .. import db
from .. import hooks
from .. import queue
from .. import util
from ..models import Post, Context, Setting, get_settings
from flask.ext.login import login_required
from flask import request, redirect, url_for, make_response,\
render_template, flash, abort, has_request_context
i... | bsd-2-clause |
pombredanne/pants | tests/python/pants_test/backend/jvm/tasks/jvm_compile/java/test_javac_plugin_integration.py | 8 | 2601 | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from unittest import... | apache-2.0 |
jizdoteka/jizdoteka-web | apps/web/forms.py | 1 | 1925 | from django import forms
from . import models
from django.contrib.auth.models import User
from django.utils.translation import ugettext_lazy as _
class SearchJourney(forms.Form):
city_from = forms.CharField()
city_to = forms.CharField()
class Journey(forms.ModelForm):
#def __init__(self, user, *args, **... | gpl-3.0 |
tonysimpson/Ni | py-utils/cvs.py | 5 | 3563 | import sys, os
def data2unix(lines):
data = []
modif = 0
for line in lines:
line1 = line.replace('\r', '')
modif = modif + (line!=line1)
data.append(line1)
return data, modif
def data2win(lines):
data = []
modif = 0
for line in lines:
if line[-1:] == '\n':
... | mit |
calvinleenyc/zulip | tools/deprecated/generate-activity-metrics.py | 11 | 6051 | #!/usr/bin/env python
#
# Generates % delta activity metrics from graphite/statsd data
#
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
import os, sys
from six.moves import range
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
import optp... | apache-2.0 |
AccelAI/accel.ai | flask-aws/lib/python2.7/site-packages/boto/cloudsearch/__init__.py | 145 | 1731 | # Copyright (c) 2012 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2012 Amazon.com, Inc. or its affiliates.
# All Rights Reserved
#
# 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... | mit |
LLNL/spack | var/spack/repos/builtin/packages/xterm/package.py | 5 | 1502 | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Xterm(AutotoolsPackage):
"""The xterm program is a terminal emulator for the X Window Syst... | lgpl-2.1 |
preparationh67/youtube-dl | youtube_dl/extractor/yandexmusic.py | 45 | 6355 | # coding: utf-8
from __future__ import unicode_literals
import re
import hashlib
from .common import InfoExtractor
from ..compat import (
compat_str,
compat_urllib_parse,
compat_urllib_request,
)
from ..utils import (
int_or_none,
float_or_none,
)
class YandexMusicTrackIE(InfoExtractor):
IE_... | unlicense |
mariokostelac/ra | vendor/googletest/scripts/fuse_gtest_files.py | 2577 | 8813 | #!/usr/bin/env python
#
# Copyright 2009, 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... | gpl-3.0 |
aps-sids/zulip | zerver/management/commands/enqueue_digest_emails.py | 115 | 4031 | from __future__ import absolute_import
import datetime
import pytz
import logging
from django.conf import settings
from django.core.management.base import BaseCommand
from zerver.lib.queue import queue_json_publish
from zerver.models import UserActivity, UserProfile, get_realm, Realm
## Logging setup ##
log_format ... | apache-2.0 |
jmcarp/sandman | tests/models.py | 1 | 2621 | """Models for unit testing sandman"""
from flask.ext.sqlalchemy import BaseQuery
from flask.ext.admin.contrib.sqla import ModelView
from sandman.model import register, Model, activate
from sandman.model.models import db
class ArtistAdminView(ModelView):
pass
class SomeModel(db.Model):
__tablename__ = 'some_m... | apache-2.0 |
ntymtsiv/CloudFerry | cloudferrylib/os/actions/task_transfer.py | 11 | 1499 | # Copyright (c) 2014 Mirantis 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 agreed to in writing, so... | apache-2.0 |
smartfile/django-1.4 | tests/regressiontests/test_client_regress/views.py | 27 | 4366 | import warnings
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.http import HttpResponse, HttpResponseRedirect
from django.core.exceptions import SuspiciousOperation
from django.shortcuts import render_to_response
from django.utils import simplejson
from django.ut... | bsd-3-clause |
redhat-openstack/sahara | sahara/plugins/hdp/versions/version_1_3_2/services.py | 7 | 30087 | # Copyright (c) 2013 Hortonworks, 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 agreed to in ... | apache-2.0 |
mwarkentin/ansible-modules-extras | packaging/pkgin.py | 43 | 5198 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Shaun Zinck
# Written by Shaun Zinck <shaun.zinck at gmail.com>
# Based on pacman module written by Afterburn <http://github.com/afterburn>
# that was based on apt module written by Matthew Williams <matthew@flowroute.com>
#
# This module is free software: you can... | gpl-3.0 |
blrm/robottelo | tests/foreman/api/test_syncplan.py | 1 | 30199 | """Unit tests for the ``sync_plans`` paths.
A full API reference for sync plans can be found here:
http://www.katello.org/docs/api/apidoc/sync_plans.html
"""
import random
from datetime import datetime, timedelta
from fauxfactory import gen_string
from nailgun import client, entities
from random import sample
from ro... | gpl-3.0 |
renegelinas/mi-instrument | mi/dataset/driver/ctdav_n/auv/ctdav_n_auv_telemetered_driver.py | 3 | 1405 | #!/usr/bin/env python
"""
@package mi.dataset.driver.ctdav_n.auv
@file mi/dataset/driver/ctdav_n/auv/ctdav_n_auv_telemetered_driver.py
@author Jeff Roy
@brief Driver for the ctdav_n_auv instrument
Release notes:
Initial Release
"""
from mi.dataset.dataset_driver import SimpleDatasetDriver
from mi.dataset.parser.ctd... | bsd-2-clause |
batmancn/MyLife | learn/demos/python_demo/core_python_programming_code/ch20/advcgi.py | 3 | 6468 | #!/usr/bin/env python
from cgi import FieldStorage
from os import environ
from cStringIO import StringIO
from urllib import quote, unquote
from string import capwords, strip, split, join
class AdvCGI:
header = 'Content-Type: text/html\n\n'
url = '/py/advcgi.py'
formhtml = '''<HTML><HEAD><TITLE>
Advanced... | gpl-3.0 |
arenadata/ambari | ambari-server/src/main/resources/stacks/BigInsights/4.0/services/HIVE/package/scripts/mysql_server.py | 4 | 1792 | #!/usr/bin/env python
"""
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");... | apache-2.0 |
pigeonflight/strider-plone | docker/appengine/lib/django-1.4/django/contrib/formtools/preview.py | 315 | 5754 | """
Formtools Preview application.
"""
from django.http import Http404
from django.shortcuts import render_to_response
from django.template.context import RequestContext
from django.utils.crypto import constant_time_compare
from django.contrib.formtools.utils import form_hmac
AUTO_ID = 'formtools_%s' # Each form here... | mit |
rananda/cfme_tests | cfme/tests/infrastructure/test_iso_provisioning.py | 5 | 3608 | # -*- coding: utf-8 -*-
import fauxfactory
import pytest
from utils.conf import cfme_data
from cfme.common.provider import cleanup_vm
from cfme.infrastructure.provider import InfraProvider
from cfme.infrastructure.pxe import get_template_from_config, ISODatastore
from cfme.provisioning import do_vm_provisioning
from u... | gpl-2.0 |
svn2github/audacity | lib-src/lv2/serd/waflib/Tools/ccroot.py | 14 | 12438 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
import os
from waflib import Task,Utils,Node,Errors
from waflib.TaskGen import after_method,before_method,feature,taskgen_method,extension
from waflib.Tools import c_aliases,c... | gpl-2.0 |
quinot/ansible | lib/ansible/modules/network/avi/avi_microservicegroup.py | 41 | 3925 | #!/usr/bin/python
#
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Eric Anderson (eanderson@avinetworks.com)
# module_check: supported
#
# Copyright: (c) 2017 Gaurav Rastogi, <grastogi@avinetworks.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
ANSIB... | gpl-3.0 |
maurofaccenda/ansible | lib/ansible/modules/network/lenovo/cnos_vlan.py | 59 | 11374 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Lenovo, 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 |
yunity/yunity-core | karrot/groups/receivers.py | 1 | 3517 | import json
import requests
from django.conf import settings
from django.db.models.signals import post_save, pre_delete
from django.dispatch import receiver
from karrot.conversations.models import Conversation
from karrot.groups import roles, stats
from karrot.groups.emails import prepare_user_became_editor_email
fro... | agpl-3.0 |
JackRostron/edx-python-compsci | w2_simple_programs_ps1.py | 1 | 3393 | '''
Write a program to calculate the credit card balance after one year if a person only pays the minimum monthly payment required by the credit card company each month.
The following variables contain values as described below:
balance - the outstanding balance on the credit card
annualInterestRate - annual interes... | gpl-3.0 |
hellhovnd/django | tests/files/models.py | 141 | 1038 | """
42. Storing files according to a custom storage system
``FileField`` and its variations can take a ``storage`` argument to specify how
and where files should be stored.
"""
import random
import tempfile
from django.db import models
from django.core.files.storage import FileSystemStorage
temp_storage_location =... | bsd-3-clause |
xerxes2/gpodder | src/gpodder/gtkui/interface/common.py | 2 | 22172 | # -*- coding: utf-8 -*-
#
# gPodder - A media aggregator and podcast client
# Copyright (c) 2005-2011 Thomas Perl and the gPodder Team
#
# gPodder 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 |
2ndQuadrant/ansible | lib/ansible/modules/network/nxos/nxos_ospf.py | 100 | 4148 | #!/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 |
Odingod/mne-python | mne/preprocessing/bads.py | 24 | 1160 | # Authors: Denis Engemann <denis.engemann@gmail.com>
# License: BSD (3-clause)
import numpy as np
def find_outliers(X, threshold=3.0, max_iter=2):
"""Find outliers based on iterated Z-scoring
This procedure compares the absolute z-score against the threshold.
After excluding local outliers, the compari... | bsd-3-clause |
jborean93/ansible | test/support/network-integration/collections/ansible_collections/cisco/ios/plugins/action/ios.py | 11 | 5111 | #
# (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
# (at your option) any later version.
#
# Ansible is d... | gpl-3.0 |
raychorn/knowu | django/djangononrelsample2/django/template/loaders/app_directories.py | 114 | 2362 | """
Wrapper for loading templates from "templates" directories in INSTALLED_APPS
packages.
"""
import os
import sys
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.template.base import TemplateDoesNotExist
from django.template.loader import BaseLoader
from django.u... | lgpl-3.0 |
prune998/ansible | hacking/tests/gen_distribution_version_testcase.py | 58 | 1877 | #!/usr/bin/env python
"""
This script generated test_cases for test_distribution_version.py.
To do so it outputs the relevant files from /etc/*release, the output of platform.dist() and the current ansible_facts regarding the distribution version.
This assumes a working ansible version in the path.
"""
import platf... | gpl-3.0 |
jyizheng/goldfish_pasr_lib_x86 | tools/perf/util/setup.py | 4998 | 1330 | #!/usr/bin/python2
from distutils.core import setup, Extension
from os import getenv
from distutils.command.build_ext import build_ext as _build_ext
from distutils.command.install_lib import install_lib as _install_lib
class build_ext(_build_ext):
def finalize_options(self):
_build_ext.finalize_optio... | gpl-2.0 |
XDrake99/IDTP | protocol/http/url.py | 1 | 5533 | from urlparse import urlunparse as urlimplode, urlparse as urlexplode
from urlparse import parse_qsl as queryexplode, urljoin
from urllib import urlencode as queryimplode, quote
import re
"""
:copyright: (c) 2012 by Damien 'bl0b' Leroux
:license: MIT
"""
__author__ = "Damien 'bl0b' Leroux <damien.leroux@gmail.com>"... | mit |
shineyear/catawampus | tr/vendor/bup/cmd/xstat-cmd.py | 7 | 4734 | #!/usr/bin/env python
# Copyright (C) 2010 Rob Browning
#
# This code is covered under the terms of the GNU Library General
# Public License as described in the bup LICENSE file.
import sys, stat, errno
from bup import metadata, options, xstat
from bup.helpers import handle_ctrl_c, saved_errors, add_error, log
def fs... | apache-2.0 |
kazemakase/scikit-learn | sklearn/cluster/mean_shift_.py | 106 | 14056 | """Mean shift clustering algorithm.
Mean shift clustering aims to discover *blobs* in a smooth density of
samples. It is a centroid based algorithm, which works by updating candidates
for centroids to be the mean of the points within a given region. These
candidates are then filtered in a post-processing stage to elim... | bsd-3-clause |
rickerc/heat_audit | heat/tests/test_neutron_firewall.py | 5 | 18265 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | apache-2.0 |
florian-dacosta/OCB | addons/product/pricelist.py | 25 | 23373 | # -*- 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 |
ericholscher/mkdocs | mkdocs/relative_path_ext.py | 1 | 4422 | """
# Relative Path Markdown Extension
During the MkDocs build we rewrite URLs that link to local
Markdown or media files. Using the following pages configuration
we can look at how the output is changed.
pages:
- ['index.md']
- ['tutorial/install.md']
- ['tutorial/intro.md']
## Markdown URLs
When l... | bsd-2-clause |
t794104/ansible | lib/ansible/modules/network/netvisor/pn_prefix_list.py | 31 | 4285 | #!/usr/bin/python
# Copyright: (c) 2018, Pluribus Networks
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['... | gpl-3.0 |
smandy/d_c_experiment | scons-local-2.3.4/SCons/Tool/dvips.py | 9 | 3441 | """SCons.Tool.dvips
Tool-specific initialization for dvips.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001 - 2014 The SCons Foundation
#
# Permission is hereby granted, free of charge... | mit |
pravsripad/mne-python | mne/decoding/ems.py | 12 | 7624 | # Author: Denis Engemann <denis.engemann@gmail.com>
# Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Jean-Remi King <jeanremi.king@gmail.com>
#
# License: BSD (3-clause)
from collections import Counter
import numpy as np
from .mixin import TransformerMixin, EstimatorMixin
from .base import _set_c... | bsd-3-clause |
rmmh/kubernetes-test-infra | gubernator/third_party/cloudstorage/common.py | 129 | 12326 | # Copyright 2012 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 ag... | apache-2.0 |
diogo149/treeano | treeano/sandbox/nodes/partition_axis.py | 3 | 2371 | """
NOTE: concatenation seems very slow
"""
import treeano
import treeano.nodes as tn
@treeano.register_node("partition_axis")
class PartitionAxisNode(treeano.NodeImpl):
"""
node that returns a fraction of the input tensor
rough explanation:
x.shape == (4, 8, 12, 16, 20)
y = partition_axis(x, s... | apache-2.0 |
Shouqun/node-gn | tools/depot_tools/recipes/recipe_modules/git_cl/examples/full.py | 1 | 1393 | # -*- coding: utf-8 -*-
# Copyright 2016 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 recipe_engine.config_types import Path
DEPS = [
'git_cl',
'recipe_engine/path',
'recipe_engine/raw_io',
'recipe_engine... | mit |
misugijunz/userinfuser | serverside/fantasm/lock.py | 28 | 9106 | """ Fantasm: A taskqueue-based Finite State Machine for App Engine Python
Docs and examples: http://code.google.com/p/fantasm/
Copyright 2010 VendAsta Technologies 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 ob... | gpl-3.0 |
johnmgregoire/JCAPRamanDataProcess | PlateAlignViaEdge_v8.py | 1 | 17031 | import sys,os, pickle, numpy, pylab, operator, itertools
import cv2
from shutil import copy as copyfile
from PyQt4.QtCore import *
from PyQt4.QtGui import *
import matplotlib.pyplot as plt
from DataParseApp import dataparseDialog
from sklearn.decomposition import NMF
projectpath=os.path.split(os.path.abspath(__file__)... | bsd-3-clause |
stacywsmith/ansible | lib/ansible/modules/network/aos/aos_asn_pool.py | 42 | 10488 | #!/usr/bin/python
#
# (c) 2017 Apstra Inc, <community@apstra.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 opt... | gpl-3.0 |
meletakis/collato | lib/python2.7/site-packages/django/views/defaults.py | 108 | 2732 | from django import http
from django.template import (Context, RequestContext,
loader, Template, TemplateDoesNotExist)
from django.views.decorators.csrf import requires_csrf_token
# This can be called when CsrfViewMiddleware.process_view has not run,
# therefore need @requires_csrf_token i... | gpl-2.0 |
hopeall/odoo | openerp/addons/test_new_api/tests/test_onchange.py | 208 | 7641 | # -*- coding: utf-8 -*-
from openerp.tests import common
class TestOnChange(common.TransactionCase):
def setUp(self):
super(TestOnChange, self).setUp()
self.Discussion = self.env['test_new_api.discussion']
self.Message = self.env['test_new_api.message']
def test_default_get(self):
... | agpl-3.0 |
TheWylieStCoyote/gnuradio | gr-qtgui/examples/pyqt_time_c.py | 3 | 6213 | #!/usr/bin/env python
#
# Copyright 2011,2012,2015 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
from __future__ import print_function
from __future__ import unicode_literals
from gnuradio import gr
from gnuradio import blocks
import sys
try:
f... | gpl-3.0 |
Servir-Mekong/SurfaceWaterTool | lib/google/protobuf/internal/import_test_package/outer_pb2.py | 1 | 2806 | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/protobuf/internal/import_test_package/outer.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import re... | gpl-3.0 |
lakshayg/tensorflow | tensorflow/python/estimator/export/export_output.py | 18 | 6713 | # 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 |
Dark-Hacker/horizon | openstack_dashboard/contrib/sahara/content/data_processing/job_executions/urls.py | 25 | 1493 | # 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
# distributed under the... | apache-2.0 |
manoldonev/algo1-assignments | src/common/priority_queue.py | 1 | 1927 | from heapq import heappush, heappop, heapify
from dataclasses import dataclass, field
from typing import Generic, Optional, TypeVar
T = TypeVar('T')
S = TypeVar('S')
@dataclass(order=True)
class PrioritizedItem(Generic[T, S]):
priority: S
task: T = field(compare=False)
is_active: bool = field(default=Tru... | mit |
jorik041/shadowsocks | tests/test.py | 1016 | 5029 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# 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 b... | apache-2.0 |
goddardl/cortex | test/IECoreGL/ShaderStateComponentTest.py | 12 | 2401 | ##########################################################################
#
# Copyright (c) 2012, Image Engine Design 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:
#
# * Redistribu... | bsd-3-clause |
jseabold/scipy | scipy/special/tests/test_ellip_harm.py | 99 | 9413 | #
# Tests for the Ellipsoidal Harmonic Function,
# Distributed under the same license as SciPy itself.
#
from __future__ import division, print_function, absolute_import
import warnings
import numpy as np
from numpy.testing import (assert_equal, assert_almost_equal, assert_allclose,
assert... | bsd-3-clause |
GbalsaC/bitnamiP | common/lib/chem/chem/chemtools.py | 250 | 10721 | """This module originally includes functions for grading Vsepr problems.
Also, may be this module is the place for other chemistry-related grade functions. TODO: discuss it.
"""
import json
import unittest
import itertools
def vsepr_parse_user_answer(user_input):
"""
user_input is json generated by vsepr.js... | agpl-3.0 |
cosmic-api/cosmic.py | docs/source/conf.py | 1 | 7919 | # -*- coding: utf-8 -*-
#
# apio documentation build configuration file, created by
# sphinx-quickstart on Thu Nov 15 20:31:55 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.
#
# All co... | mit |
mlq/fMBT | utils/eyenfinger.py | 9 | 70710 | # fMBT, free Model Based Testing tool
# Copyright (c) 2012, Intel Corporation.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms and conditions of the GNU Lesser General Public License,
# version 2.1, as published by the Free Software Foundation.
#
# This program is distribut... | lgpl-2.1 |
toshywoshy/ansible | lib/ansible/playbook/playbook_include.py | 76 | 6978 | # (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 |
Hack22learn/Small-Application---Python | picturePerfect/top_genre.py | 2 | 1133 | __auther__='Sudhanshu Patel'
import xlrd
#find top 3 frequently occuring genere
Wbook = xlrd.open_workbook('PicturePerfect.xlsx') #global data
def TopGenere(limit=3):
#top n genere
#print 'no of sheets ',Wbook.nsheets
# we r goint to process only first sheet
data = Wbook.sheet_by_index(0)
ge... | mit |
allotria/intellij-community | plugins/hg4idea/testData/bin/hgext/record.py | 90 | 24113 | # record.py
#
# Copyright 2007 Bryan O'Sullivan <bos@serpentine.com>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
'''commands to interactively select changes for commit/qrefresh'''
from mercurial.i18n import gettext, _
from me... | apache-2.0 |
BellScurry/gem5-fault-injection | src/mem/ruby/network/Network.py | 26 | 2738 | # Copyright (c) 2009 Advanced Micro Devices, 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... | bsd-3-clause |
lumig242/Hue-Integration-with-CDAP | desktop/libs/metadata/src/metadata/optimizer_api.py | 3 | 11647 | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | apache-2.0 |
johndpope/tensorflow | tensorflow/python/ops/logging_ops.py | 64 | 14358 | # 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 |
SummerLW/Perf-Insight-Report | third_party/gsutil/third_party/crcmod/docs/source/conf.py | 31 | 7691 | # -*- coding: utf-8 -*-
#
# crcmod documentation build configuration file, created by
# sphinx-quickstart on Thu Jan 21 14:04:12 2010.
#
# 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.
#
# All ... | bsd-3-clause |
mikewiebe-ansible/ansible | lib/ansible/plugins/callback/oneline.py | 41 | 3532 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
... | gpl-3.0 |
Bismarrck/tensorflow | tensorflow/python/framework/contrib_test.py | 116 | 1544 | # 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 |
tomviner/net-panel | ping.py | 1 | 8642 | #!/usr/bin/env python
import os
import sys
import re
import subprocess
import time
import pygtk
import gtk
import gobject
pygtk.require('2.0')
gtk.gdk.threads_init()
IWCONFIG_PATH = '/sbin/iwconfig'
def matching_wifi_network(good_ssids=()):
try:
p = subprocess.Popen(IWCONFIG_PATH, stdout=subprocess.PIP... | mit |
juanalfonsopr/odoo | openerp/report/print_fnc.py | 458 | 1318 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... | agpl-3.0 |
supriyasingh01/github_basics | Internetworking Distributed Project/finalProject/ovs/pox-master/pox/lib/util.py | 4 | 10875 | # Copyright 2011 James McCauley
#
# This file is part of POX.
#
# POX 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.
#
# POX is distri... | cc0-1.0 |
sumitsourabh/opencog | opencog/python/spatiotemporal/unix_time.py | 34 | 1924 | from datetime import datetime
from time import mktime
from random import random
from scipy.stats.distributions import rv_frozen
__author__ = 'keyvan'
class UnixTime(float):
def __new__(cls, datetime_or_number):
if type(datetime_or_number) is UnixTime:
return datetime_or_number
assert ... | agpl-3.0 |
metaml/nupic | src/nupic/data/utils.py | 39 | 4348 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013-15, 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 pro... | agpl-3.0 |
vilorious/pyload | module/lib/jinja2/utils.py | 64 | 18630 | # -*- coding: utf-8 -*-
"""
jinja2.utils
~~~~~~~~~~~~
Utility functions.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import re
import sys
import errno
try:
from thread import allocate_lock
except ImportError:
from dummy_thread import allocate_lo... | gpl-3.0 |
cobalys/django | tests/regressiontests/templates/response.py | 16 | 12764 | import os
import pickle
import time
from datetime import datetime
from django.test import RequestFactory, TestCase
from django.conf import settings
from django.template import Template, Context
from django.template.response import (TemplateResponse, SimpleTemplateResponse,
Content... | bsd-3-clause |
appsembler/edx-platform | openedx/core/djangoapps/heartbeat/default_checks.py | 17 | 3917 | """
A set of built-in default checks for the platform heartbeat endpoint
Other checks should be included in their respective modules/djangoapps
"""
from datetime import datetime, timedelta
from time import sleep, time
from django.conf import settings
from django.core.cache import cache
from django.db import connectio... | agpl-3.0 |
gorjuce/odoo | addons/hr_holidays/__openerp__.py | 260 | 3101 | # -*- 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 |
AdamIsrael/PerfKitBenchmarker | perfkitbenchmarker/providers/mesos/mesos_docker_instance.py | 3 | 9086 | # Copyright 2015 PerfKitBenchmarker 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 appli... | apache-2.0 |
xesscorp/skidl | tests/test_name.py | 1 | 1655 | import pytest
from skidl import *
from .setup_teardown import *
def test_name_1():
vreg1 = Part("xess.lib", "1117")
assert vreg1.ref == "U1"
vreg1.ref = "U1"
assert vreg1.ref == "U1"
bus1 = Bus(None)
assert bus1.name == BUS_PREFIX + "1"
bus1 = Bus("T1")
assert bus1.name == "T1"
b... | mit |
jnerin/ansible | lib/ansible/modules/cloud/vmware/vca_fw.py | 26 | 7965 | #!/usr/bin/python
# Copyright (c) 2015 VMware, Inc. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
ct-23/home-assistant | tests/components/test_hassio.py | 3 | 5510 | """The tests for the hassio component."""
import asyncio
import os
from unittest.mock import patch, Mock, MagicMock
import pytest
from homeassistant.const import HTTP_HEADER_HA_AUTH
from homeassistant.setup import async_setup_component
from tests.common import mock_coro
API_PASSWORD = 'pass1234'
@pytest.fixture
d... | apache-2.0 |
steinbachr/world-cup-challenge | tests/test_populators.py | 1 | 2279 | from populators.teams_populator import TeamsPopulator
from populators.players_populator import PlayersPopulator
from populators.tournament_populator import TournamentPopulator
from models.team import Team
from models.tournament import Tournament
import unittest
import pdb
class TestTournamentPopulator(unittest.TestCa... | mit |
nightjean/Deep-Learning | tensorflow/python/kernel_tests/where_op_test.py | 64 | 2544 | # 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 |
rubyinhell/brython | www/src/Lib/test/test_dictcomps.py | 121 | 3782 | import unittest
from test import support
# For scope testing.
g = "Global variable"
class DictComprehensionTest(unittest.TestCase):
def test_basics(self):
expected = {0: 10, 1: 11, 2: 12, 3: 13, 4: 14, 5: 15, 6: 16, 7: 17,
8: 18, 9: 19}
actual = {k: k + 10 for k in range(10)... | bsd-3-clause |
AndroidOpenDevelopment/android_external_chromium_org | third_party/google_appengine_cloudstorage/cloudstorage/api_utils.py | 102 | 10048 | # 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 ag... | bsd-3-clause |
padfoot27/merlin | venv/lib/python2.7/site-packages/setuptools/tests/environment.py | 151 | 1611 | import os
import sys
import unicodedata
from subprocess import Popen as _Popen, PIPE as _PIPE
def _which_dirs(cmd):
result = set()
for path in os.environ.get('PATH', '').split(os.pathsep):
filename = os.path.join(path, cmd)
if os.access(filename, os.X_OK):
result.add(path)
ret... | mit |
jmesteve/medical | openerp/addons/point_of_sale/report/pos_details_summary.py | 22 | 5615 | # -*- 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 |
randomshinichi/QRL | src/qrl/daemon/helper/logger.py | 4 | 3162 | # coding=utf-8
# Distributed under the MIT software license, see the accompanying
# file LICENSE or http://www.opensource.org/licenses/mit-license.php.
import sys
import logging
import traceback
import os
from colorlog import ColoredFormatter
from logging.handlers import RotatingFileHandler
from qrl.core import conf... | mit |
labsanmartin/Bika-LIMS | bika/lims/exportimport/instruments/rochecobas/taqman/model96.py | 2 | 4974 | # -*- coding: utf-8 -*-
""" Roche Cobas Taqman 96
"""
import csv
from DateTime import DateTime
from bika.lims.exportimport.instruments.resultsimport import \
AnalysisResultsImporter, InstrumentResultsFileParser
from bika.lims import bikaMessageFactory as _
from bika.lims.utils import t
import json
import traceback... | agpl-3.0 |
40223143/2015_0505 | static/Brython3.1.1-20150328-091302/Lib/markdown2.py | 669 | 8143 | import browser.html
import re
class URL:
def __init__(self,src):
elts = src.split(maxsplit=1)
self.href = elts[0]
self.alt = ''
if len(elts)==2:
alt = elts[1]
if alt[0]=='"' and alt[-1]=='"':self.alt=alt[1:-1]
elif alt[0]=="'" and alt[-1]=="'":sel... | agpl-3.0 |
aristanetworks/neutron | neutron/plugins/openvswitch/common/constants.py | 22 | 2735 | # Copyright (c) 2012 OpenStack Foundation.
#
# 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... | apache-2.0 |
deved69/pelican-1 | pelican/log.py | 13 | 5862 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals, print_function
__all__ = [
'init'
]
import os
import sys
import logging
import locale
from collections import defaultdict, Mapping
import six
class BaseFormatter(logging.Formatter):
def __init__(self, fmt=None, datefmt=None):
FORMAT =... | agpl-3.0 |
lento/cortex | test/IECoreMaya/NamespacePollution.py | 14 | 2230 | ##########################################################################
#
# Copyright (c) 2007-2010, Image Engine Design 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:
#
# * Redis... | bsd-3-clause |
danieldresser/cortex | contrib/IECoreAlembic/test/IECoreAlembic/ABCToMDCTest.py | 12 | 3137 | ##########################################################################
#
# Copyright (c) 2012-2013, Image Engine Design 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:
#
# * Red... | bsd-3-clause |
yojota/volatility | volatility/plugins/gui/eventhooks.py | 58 | 2622 | # Volatility
# Copyright (C) 2007-2013 Volatility Foundation
# Copyright (C) 2010,2011,2012 Michael Hale Ligh <michael.ligh@mnin.org>
#
# This file is part of Volatility.
#
# Volatility is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the F... | gpl-2.0 |
ctsit/nacculator | nacc/lbd/v3_1/ivp/builder.py | 1 | 16847 | ###############################################################################
# Copyright 2015-2020 University of Florida. All rights reserved.
# This file is part of UF CTS-IT's NACCulator project.
# Use of this source code is governed by the license found in the LICENSE file.
#######################################... | bsd-2-clause |
Omegaphora/external_chromium_org | tools/telemetry/telemetry/web_perf/metrics/mainthread_jank_stats_unittest.py | 55 | 5209 | # 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 unittest
from telemetry.timeline import model as model_module
from telemetry.timeline import async_slice
from telemetry.web_perf import timeline_inte... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.