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 |
|---|---|---|---|---|---|
yk5/incubator-airflow | tests/dags/test_impersonation.py | 15 | 1466 | # -*- 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 |
nathanielvarona/airflow | tests/providers/amazon/aws/hooks/test_sns.py | 3 | 2627 | #
# 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 |
mitocw/edx-platform | common/lib/xmodule/xmodule/tests/__init__.py | 3 | 21869 | """
unittests for xmodule
Run like this:
paver test_lib -l common/lib/xmodule
"""
import inspect
import json
import os
import pprint
import sys
import traceback
import unittest
from contextlib import contextmanager
from functools import wraps
import six
from django.test import TestCase
from django.utils.encod... | agpl-3.0 |
heran7/edx-platform | lms/djangoapps/certificates/models.py | 14 | 5506 | from django.contrib.auth.models import User
from django.db import models
from datetime import datetime
"""
Certificates are created for a student and an offering of a course.
When a certificate is generated, a unique ID is generated so that
the certificate can be verified later. The ID is a UUID4, so that
it can't be... | agpl-3.0 |
xen0l/ansible | lib/ansible/cli/__init__.py | 1 | 40009 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2016, Toshio Kuratomi <tkuratomi@ansible.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, eithe... | gpl-3.0 |
Moriadry/tensorflow | tensorflow/contrib/keras/python/keras/layers/pooling.py | 36 | 21337 | # 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 |
mjudsp/Tsallis | examples/tree/plot_tree_regression.py | 95 | 1516 | """
===================================================================
Decision Tree Regression
===================================================================
A 1D regression with decision tree.
The :ref:`decision trees <tree>` is
used to fit a sine curve with addition noisy observation. As a result, it
learns ... | bsd-3-clause |
3people/dropship_project | code/Dmok.py | 1 | 5356 | import os
class Board:
SIZE = 15
def __init__(self):
self.board = [['+' for _ in range(self.SIZE)] for _ in range(self.SIZE)]
self.player1 = input("player1의 이름을 입력하시오 : ")
self.player2 = input("player2의 이름을 입력하시오 : ")
self.startgame()
def printboard(self):
"""Prin... | mit |
tinloaf/home-assistant | homeassistant/components/binary_sensor/rachio.py | 6 | 4623 | """
Integration with the Rachio Iro sprinkler system controller.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/binary_sensor.rachio/
"""
from abc import abstractmethod
import logging
from homeassistant.components.binary_sensor import BinarySensorDevice... | apache-2.0 |
siddharthv/sm | drivers/verifyVHDsOnSR.py | 11 | 4963 | #!/usr/bin/python
#
# Copyright (C) Citrix Systems Inc.
#
# This program 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 Foundation; version 2.1 only.
#
# This program is distributed in the hope that it will be u... | lgpl-2.1 |
eirmag/weboob | modules/ebonics/backend.py | 1 | 2047 | # -*- coding: utf-8 -*-
# Copyright(C) 2012 Romain Bignon
#
# This file is part of weboob.
#
# weboob 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 Free Software Foundation, either version 3 of the License, or
# (at your opt... | agpl-3.0 |
kevinyu98/spark | python/pyspark/ml/tests/test_persistence.py | 8 | 16821 | #
# 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 us... | apache-2.0 |
renaelectronics/linuxcnc | src/emc/usr_intf/gmoccapy/player.py | 20 | 2208 | #!/usr/bin/env python
'''
This class is used to handle sound messages from gmoccapy,
it is just a coppy of a class from gscreen and has been slighly modified
Copyright 2014 Norbert Schechner
nieson@web.de
original Author = Chris Morley
This program is free software; you can redistribute it an... | gpl-2.0 |
sserrot/champion_relationships | venv/Lib/site-packages/networkx/algorithms/shortest_paths/tests/test_unweighted.py | 1 | 4670 | #!/usr/bin/env python
import networkx as nx
def validate_grid_path(r, c, s, t, p):
assert isinstance(p, list)
assert p[0] == s
assert p[-1] == t
s = ((s - 1) // c, (s - 1) % c)
t = ((t - 1) // c, (t - 1) % c)
assert len(p) == abs(t[0] - s[0]) + abs(t[1] - s[1]) + 1
p = [((u - 1) // c, (u -... | mit |
BackupGGCode/python-for-android | python3-alpha/extra_modules/gdata/contacts/service.py | 120 | 17345 | #!/usr/bin/env python
#
# Copyright 2009 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 requir... | apache-2.0 |
leonsooi/pymel | pymel/core/windows.py | 8 | 31300 | """
Functions for creating UI elements, as well as their class counterparts.
"""
import re
import sys
import functools
import traceback
import pymel.util as _util
import pymel.internal.pmcmds as cmds
import pymel.internal.factories as _factories
import pymel.internal as _internal
import pymel.versions as _versions
f... | bsd-3-clause |
shastah/spacewalk | client/debian/packages-already-in-debian/rhn-client-tools/src/firstboot/rhn_provide_certificate_gui.py | 29 | 2509 | # Copyright 2006--2010 Red Hat, Inc.
#
# 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; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT... | gpl-2.0 |
ehirt/odoo | addons/mail/tests/test_mail_features.py | 26 | 59734 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | agpl-3.0 |
saurabh6790/pow-lib | webnotes/utils/minify.py | 71 | 5891 | # This code is original from jsmin by Douglas Crockford, it was translated to
# Python by Baruch Even. The original code had the following copyright and
# license.
#
# /* jsmin.c
# 2007-05-22
#
# Copyright (c) 2002 Douglas Crockford (www.crockford.com)
#
# Permission is hereby granted, free of charge, to any person ob... | mit |
leemac/JellyfishRss | rss/wsgi.py | 2 | 1410 | """
WSGI config for rss project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` sett... | mit |
390910131/Misago | misago/threads/tests/test_posts_moderation.py | 8 | 3827 | from misago.forums.models import Forum
from misago.users.testutils import AuthenticatedUserTestCase
from misago.threads import moderation, testutils
from misago.threads.models import Thread, Post
class PostsModerationTests(AuthenticatedUserTestCase):
def setUp(self):
super(PostsModerationTests, self).set... | gpl-2.0 |
largelymfs/w2vtools | build/scipy/scipy/weave/tests/test_scxx_object.py | 5 | 27994 | """ Test refcounting and behavior of SCXX.
"""
from __future__ import absolute_import, print_function
import sys
from UserList import UserList
from numpy.testing import (TestCase, dec, assert_equal, assert_, assert_raises,
run_module_suite)
from scipy.weave import inline_tools
from weave_... | mit |
surgebiswas/poker | PokerBots_2017/Johnny/scipy/signal/tests/test_spectral.py | 21 | 31200 | from __future__ import division, print_function, absolute_import
import warnings
import numpy as np
from numpy.testing import assert_raises, assert_approx_equal, \
assert_, run_module_suite, TestCase,\
assert_allclose, assert_array_equal,\
a... | mit |
jdereus/labman | labcontrol/gui/handlers/study.py | 1 | 2270 | # ----------------------------------------------------------------------------
# Copyright (c) 2017-, LabControl development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# -------------------------------------------------... | bsd-3-clause |
pedrobaeza/odoo | addons/hr_timesheet_invoice/hr_timesheet_invoice.py | 40 | 18268 | # -*- 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 |
sspreitzer/tahoe-lafs | misc/coding_tools/check-interfaces.py | 9 | 9011 |
# To check a particular Tahoe source distribution, this should be invoked from
# the root directory of that distribution as
#
# bin/tahoe @misc/coding_tools/check-interfaces.py
import os, sys, re, platform
import zope.interface as zi
# We use the forked version of verifyClass below.
#from zope.interface.verify imp... | gpl-2.0 |
SickGear/SickGear | lib/tmdbsimple/movies.py | 4 | 21610 | # -*- coding: utf-8 -*-
"""
tmdbsimple.movies
~~~~~~~~~~~~~~~~~
This module implements the Movies, Collections, Companies, Keywords, and
Reviews functionality of tmdbsimple.
Created by Celia Oakley on 2013-10-31.
:copyright: (c) 2013-2020 by Celia Oakley
:license: GPLv3, see LICENSE for more details
"""
from .base ... | gpl-3.0 |
jnewland/home-assistant | homeassistant/components/telegram_bot/__init__.py | 4 | 28060 | """Support to send and receive Telegram messages."""
import io
from ipaddress import ip_network
from functools import partial
import importlib
import logging
import requests
from requests.auth import HTTPBasicAuth, HTTPDigestAuth
import voluptuous as vol
from homeassistant.components.notify import (
ATTR_DATA, AT... | apache-2.0 |
rabimba/p2pScrapper | BitTorrent-5.2.2/BTL/md5crypt.py | 8 | 2813 | #!/usr/local/bin/python
# Based on FreeBSD src/lib/libcrypt/crypt.c 1.2
# http://www.freebsd.org/cgi/cvsweb.cgi/~checkout~/src/lib/libcrypt/crypt.c?rev=1.2&content-type=text/plain
# Original license:
# * "THE BEER-WARE LICENSE" (Revision 42):
# * <phk@login.dknet.dk> wrote this file. As long as you retain this notice... | mit |
Eksmo/calibre | src/calibre/ebooks/markdown/commandline.py | 5 | 3520 | """
COMMAND-LINE SPECIFIC STUFF
=============================================================================
The rest of the code is specifically for handling the case where Python
Markdown is called from the command line.
"""
import markdown
import sys
import logging
from logging import DEBUG, INFO, CRITICAL
EXECU... | gpl-3.0 |
adaoex/ocomon | includes/fckeditor/editor/filemanager/connectors/py/config.py | 89 | 7095 | #!/usr/bin/env python
"""
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2009 Frederico Caldeira Knabben
*
* == BEGIN LICENSE ==
*
* Licensed under the terms of any of the following licenses at your
* choice:
*
* - GNU General Public License Version 2 or l... | gpl-2.0 |
ronekko/chainer | chainer/functions/pooling/upsampling_2d.py | 2 | 9773 | import numpy
from chainer.backends import cuda
from chainer import function_node
from chainer.functions.pooling import pooling_2d
from chainer.utils import conv
from chainer.utils import type_check
class Upsampling2D(pooling_2d.Pooling2D):
"""Upsampling over a set of 2d planes w/ indices used for max pooling.""... | mit |
apigee/edx-platform | lms/djangoapps/certificates/migrations/0011_auto__del_field_generatedcertificate_certificate_id__add_field_generat.py | 188 | 5961 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting field 'GeneratedCertificate.certificate_id'
db.delete_column('certificates_generatedcertificate',... | agpl-3.0 |
eBay/cronus-agent | agent/agent/lib/security/agentauth.py | 1 | 5600 | #pylint: disable=E1121,W0105
'''
Copyright 2014 eBay Software 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 applicabl... | apache-2.0 |
Andproject/tools_protobuf | python/google/protobuf/internal/reflection_test.py | 1 | 69911 | # Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions o... | bsd-3-clause |
jiegec/gnuradio | gr-wxgui/grc/panel.py | 47 | 1651 | # Copyright 2009 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 version.
#
# G... | gpl-3.0 |
daedalus/python-bitcoin_r | testscript.py | 4 | 2533 | #!/usr/bin/python
#
# testscript.py
#
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
import sys
import time
import Log
import MemPool
import ChainDb
import cStringIO
from bitcoin.coredefs import NETWORKS
from bitcoin.core... | mit |
probablytom/tomwallis.net | venv/lib/python2.7/site-packages/django/contrib/gis/forms/fields.py | 74 | 4444 | from __future__ import unicode_literals
from django import forms
from django.utils.translation import ugettext_lazy as _
# While this couples the geographic forms to the GEOS library,
# it decouples from database (by not importing SpatialBackend).
from django.contrib.gis.geos import GEOSException, GEOSGeometry
from .... | artistic-2.0 |
IronLanguages/ironpython2 | Src/StdLib/Lib/site-packages/win32com/servers/test_pycomtest.py | 2 | 4414 | # This is part of the Python test suite.
# The object is registered when you first run the test suite.
# (and hopefully unregistered once done ;-)
# Ensure the vtables in the tlb are known.
from win32com import universal
from win32com.server.exception import COMException
from win32com.client import gencache
import win... | apache-2.0 |
JAOSP/aosp_platform_external_chromium_org | chrome/test/functional/ispy/ispy_core/tests/rendering_test_manager/mock_cloud_bucket.py | 23 | 1390 | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Subclass of CloudBucket used for testing."""
from tests.rendering_test_manager import cloud_bucket
class MockCloudBucket(cloud_bucket.CloudBucket):
"... | bsd-3-clause |
oldmantaiter/disco | tests/test_partial.py | 11 | 1292 | from functools import partial
from disco.test import TestCase, TestJob
from disco.worker.classic.worker import Params
def foo(x, extra):
return x + extra
def init(items, params, extra):
pass
def reader(fd, size, fname, extra):
from disco.worker.task_io import chain_reader
for k, v in chain_reader(fd... | bsd-3-clause |
pgmillon/ansible | lib/ansible/modules/cloud/digital_ocean/digital_ocean_region_info.py | 25 | 3202 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Ansible Project
# Copyright: (c) 2018, Abhijeet Kasurde <akasurde@redhat.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__ = ty... | gpl-3.0 |
javachengwc/hue | apps/spark/src/spark/api.py | 2 | 7242 | #!/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 |
google-code-export/los-cocos | test/test_repeat2.py | 6 | 1034 | from __future__ import division, print_function, unicode_literals
# This code is so you can run the samples without installing the package
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
#
testinfo = "s, t 0.5, s, t 1, s, t 1.5, s, t 2, s, t 2.5, s, q"
tags = "Repeat"
import co... | bsd-3-clause |
varunarya10/nova_test_latest | nova/tests/unit/virt/test_driver.py | 71 | 1850 | # Copyright (c) 2013 Citrix Systems, Inc.
# Copyright 2013 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... | apache-2.0 |
ChopChopKodi/pelisalacarta | python/version-command-line/platformcode/platformtools.py | 3 | 1137 | # -*- coding: utf-8 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# platformtools
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
from core import config
def dialog_ok(heading, line1, line2="", line3=""):
return True
def dialog_notification(heading,... | gpl-3.0 |
feigames/Odoo | addons/base_action_rule/base_action_rule.py | 33 | 16971 | # -*- 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 |
dimagol/trex-core | scripts/external_libs/pyzmq-14.5.0/python2/arm/ucs4/64bit/zmq/sugar/constants.py | 31 | 2305 | """0MQ Constants."""
# Copyright (c) PyZMQ Developers.
# Distributed under the terms of the Modified BSD License.
from zmq.backend import constants
from zmq.utils.constant_names import (
base_names,
switched_sockopt_names,
int_sockopt_names,
int64_sockopt_names,
bytes_sockopt_names,
fd_sockopt... | apache-2.0 |
liang42hao/bokeh | bokeh/server/storage/abstract_model_storage.py | 13 | 1342 | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2015, Continuum Analytics, Inc. All rights reserved.
#
# Powered by the Bokeh Development Team.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#----------------------------------------... | bsd-3-clause |
ctjacobs/pyqso | pyqso/log.py | 1 | 15133 | #!/usr/bin/env python3
# Copyright (C) 2013-2017 Christian Thomas Jacobs.
# This file is part of PyQSO.
# PyQSO 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 |
MrMC/mrmc | tools/EventClients/lib/python/zeroconf.py | 181 | 4874 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2008-2013 Team XBMC
#
# 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 opti... | gpl-2.0 |
ng110/pyqtgraph | pyqtgraph/graphicsItems/PlotItem/plotConfigTemplate_pyqt.py | 49 | 11402 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file './pyqtgraph/graphicsItems/PlotItem/plotConfigTemplate.ui'
#
# Created: Mon Dec 23 10:10:51 2013
# by: PyQt4 UI code generator 4.10
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_from... | mit |
eggpi/mc723-p3 | bin/arp.py | 20 | 7173 | #!/usr/bin/python -O
versionstring = "beta3"
datestring = "june 30, 2006"
import os,sys,stat,re
import arp_help, arp_output, arp_utils
from arp_output import ctext
actions=[
"pack", "unpack", "list",
"delete", "make", "test",
"help"
]
options=["--tree", "--version", "--pretend","--help"]
shortmapping={"P":"--... | lgpl-2.1 |
jamdin/jdiner-mobile-byte3 | lib/werkzeug/test.py | 183 | 34152 | # -*- coding: utf-8 -*-
"""
werkzeug.test
~~~~~~~~~~~~~
This module implements a client to WSGI applications for testing.
:copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import sys
import mimetypes
from time import time
from... | apache-2.0 |
shashank971/edx-platform | lms/djangoapps/course_structure_api/v0/serializers.py | 39 | 1437 | """ Django REST Framework Serializers """
from django.core.urlresolvers import reverse
from rest_framework import serializers
from courseware.courses import course_image_url
class CourseSerializer(serializers.Serializer):
""" Serializer for Courses """
id = serializers.CharField() # pylint: disable=invalid... | agpl-3.0 |
Grirrane/odoo | addons/gamification/wizard/update_goal.py | 386 | 1848 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013 OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the ... | agpl-3.0 |
kloper/pato | python/test/__init__.py | 1 | 2750 | # -*- python -*-
"""@file
@brief Common test stuff
Copyright (c) 2014-2015 Dimitry Kloper <kloper@users.sf.net>.
All rights reserved.
@page License
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
1. Redistributions of s... | bsd-2-clause |
Francis-Liu/animated-broccoli | nova/tests/functional/api_sample_tests/test_extended_availability_zone.py | 21 | 2379 | # Copyright 2012 Nebula, Inc.
# Copyright 2013 IBM Corp.
#
# 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... | apache-2.0 |
awesomethomas/gemrb | gemrb/GUIScripts/ie_feats.py | 6 | 2759 | # -*-python-*-
# GemRB - Infinity Engine Emulator
# Copyright (C) 2011 The GemRB Project
#
# 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) ... | gpl-2.0 |
CenterForOpenScience/SHARE | share/janitor/tasks.py | 2 | 2634 | import logging
import pendulum
import celery
from django.db.models import Exists
from django.db.models import OuterRef
from share.ingest.scheduler import IngestScheduler
from share.models import NormalizedData
from share.models import RawDatum, IngestJob
logger = logging.getLogger(__name__)
@celery.shared_task(b... | apache-2.0 |
jalr/privacyidea | privacyidea/lib/tokens/yubicotoken.py | 1 | 7718 | # -*- coding: utf-8 -*-
#
# privacyIDEA is a fork of LinOTP
# May 08, 2014 Cornelius Kölbel
# License: AGPLv3
# contact: http://www.privacyidea.org
#
# 2016-04-04 Cornelius Kölbel <cornelius@privacyidea.org>
# Use central yubico_api_signature function
# 2015-01-28 Rewrite during flask migration
# ... | agpl-3.0 |
e-loue/pyke | pyke/question_base.py | 2 | 4648 | # $Id$
# coding=utf-8
#
# Copyright © 2008 Bruce Frederiksen
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, m... | mit |
pinguinkiste/bioconda-recipes | recipes/gfinisher/gfinisher.py | 61 | 2611 | #!/usr/bin/env python
#
# Wrapper script for Java Conda packages that ensures that the java runtime
# is invoked with the right options. Adapted from the bash script (http://stackoverflow.com/questions/59895/can-a-bash-script-tell-what-directory-its-stored-in/246128#246128).
#
# Program Parameters
#
import os
import s... | mit |
jelly/calibre | src/calibre/utils/run_tests.py | 2 | 5027 | #!/usr/bin/env python2
# vim:fileencoding=utf-8
# License: GPLv3 Copyright: 2016, Kovid Goyal <kovid at kovidgoyal.net>
from __future__ import (unicode_literals, division, absolute_import,
print_function)
import unittest, functools, os, importlib, zipfile
from calibre.utils.monotonic import mon... | gpl-3.0 |
cachance7/BattleQuip | battlequip/util.py | 1 | 2470 | import collections
import re
def namedtuple_with_defaults(typename, field_names, default_values=[]):
T = collections.namedtuple(typename, field_names)
T.__new__.__defaults__ = (None,) * len(T._fields)
if isinstance(default_values, collections.Mapping):
prototype = T(**default_values)
else:
... | mit |
Reflexe/doc_to_pdf | Windows/share/Scripts/python/HelloWorld.py | 12 | 1539 | # HelloWorld python script for the scripting framework
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# This file... | mpl-2.0 |
digimarc/django | django/utils/timesince.py | 119 | 2512 | from __future__ import unicode_literals
import datetime
from django.utils.html import avoid_wrapping
from django.utils.timezone import is_aware, utc
from django.utils.translation import ugettext, ungettext_lazy
def timesince(d, now=None, reversed=False):
"""
Takes two datetime objects and returns the time b... | bsd-3-clause |
edisonlz/fruit | web_project/base/site-packages/pyExcelerator/ImportXLS.py | 22 | 18390 | #!/usr/bin/env python
# -*- coding: windows-1251 -*-
# Copyright (C) 2005 Roman V. Kiseliov
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must re... | apache-2.0 |
m16Takahiro/kakeibo | kakeibo/settings.py | 1 | 3863 | """
Django settings for kakeibo project.
Generated by 'django-admin startproject' using Django 1.11.3.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
import os... | mit |
JulyKikuAkita/PythonPrac | cs15211/PermutationSequence.py | 1 | 9970 | __source__ = 'https://leetcode.com/problems/permutation-sequence/'
# https://github.com/kamyu104/LeetCode/blob/master/Python/permutation-sequence.py
# Time: O(n)
# Space: O(1)
# Math
#
# Description: Leetcode # 60. Permutation Sequence
#
# The set [1,2,3,...,n] contains a total of n! unique permutations.
#
# By listin... | apache-2.0 |
timsnyder/bokeh | examples/models/file/gauges.py | 5 | 4484 | from __future__ import print_function
from math import pi, sin, cos
from bokeh.document import Document
from bokeh.embed import file_html
from bokeh.resources import INLINE
from bokeh.util.browser import view
from bokeh.models.glyphs import Circle, Arc, Ray, Text
from bokeh.models import ColumnDataSource, Range1d, P... | bsd-3-clause |
debugger06/MiroX | linux/plat/popen.py | 2 | 1644 | # Miro - an RSS based video player application
# Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011
# Participatory Culture Foundation
#
# 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; eithe... | gpl-2.0 |
squadran2003/PYTHON-DIRECTORY-WATCHER | lib/python3.5/site-packages/pip/_vendor/requests/sessions.py | 439 | 24250 | # -*- coding: utf-8 -*-
"""
requests.session
~~~~~~~~~~~~~~~~
This module provides a Session object to manage and persist settings across
requests (cookies, auth, proxies).
"""
import os
from collections import Mapping
from datetime import datetime
from .auth import _basic_auth_str
from .compat import cookielib, Or... | mit |
quamilek/django | tests/urlpatterns_reverse/views.py | 218 | 1538 | from functools import partial, update_wrapper
from django.contrib.auth.decorators import user_passes_test
from django.core.urlresolvers import reverse_lazy
from django.http import HttpResponse
from django.views.generic import RedirectView
def empty_view(request, *args, **kwargs):
return HttpResponse('')
def kw... | bsd-3-clause |
entomb/CouchPotatoServer | libs/tornado/autoreload.py | 22 | 11978 | #!/usr/bin/env python
#
# Copyright 2009 Facebook
#
# 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... | gpl-3.0 |
ltowarek/budget-supervisor | third_party/saltedge/swagger_client/models/removed_customer_response_data.py | 1 | 3772 | # coding: utf-8
"""
Salt Edge Account Information API
API Reference for services # noqa: E501
OpenAPI spec version: 5.0.0
Contact: support@saltedge.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class RemovedCustomerRe... | mit |
photoninger/ansible | lib/ansible/modules/cloud/amazon/elasticache.py | 15 | 20791 | #!/usr/bin/python
#
# Copyright (c) 2017 Ansible Project
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = """
---
mod... | gpl-3.0 |
iofun/spider | spider/system/campaigns.py | 1 | 5125 | # -*- coding: utf-8 -*-
'''
Spider campaigns system logic.
'''
# This file is part of spider.
# Distributed under the terms of the last AGPL License.
# The full license is in the file LICENCE, distributed as part of this software.
__author__ = 'Team Machine'
import arrow
import motor
import uuid
import loggin... | agpl-3.0 |
chrrrles/ansible | lib/ansible/playbook/conditional.py | 48 | 4463 | # (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 |
escalant3/pyblueprints | pyblueprints/neo4j.py | 2 | 13666 | #!/usr/bin/env python
#-*- coding:utf-8 -*-
#####################################################################
# A set of classes implementing Blueprints API for Neo4j engine. #
# #
# File: pyblueprints/neo4j.py ... | gpl-3.0 |
dksr/graph_utils | weisfeiler_lehman_graph_isomorphism_test.py | 1 | 1864 | from igraph import Graph
def weisfeiler_lehman_graph_isomorphism_test(G1,G2):
""" Performs the Weisfeiler-Lehman test of Isomorphism:
Weisfeiler and Lehman: A reduction of a graph to a canonical form
and an algebra arising during this reduction,
Nauchno-Technicheskaya Informatsiya, Ser. 2, no. 9 (196... | mit |
jnewland/ha-config | custom_components/senseme/config_flow.py | 1 | 2995 | """Config flow for SenseME."""
import ipaddress
import voluptuous as vol
from aiosenseme import async_get_device_by_ip_address, discover_all
from homeassistant import config_entries
from homeassistant.const import CONF_HOST
from .const import CONF_HOST_MANUAL, CONF_INFO, DOMAIN
DISCOVER_TIMEOUT = 5
class SensemeFl... | mit |
cuboxi/android_external_chromium_org | chrome/common/extensions/docs/server2/data_source.py | 45 | 1237 | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
class DataSource(object):
'''
Defines an abstraction for all DataSources.
DataSources must have two public methods, get and Cron. A DataSource is
i... | bsd-3-clause |
mcking49/apache-flask | Python/Lib/site-packages/simplejson/tests/test_fail.py | 147 | 6346 | import sys
from unittest import TestCase
import simplejson as json
# 2007-10-05
JSONDOCS = [
# http://json.org/JSON_checker/test/fail1.json
'"A JSON payload should be an object or array, not a string."',
# http://json.org/JSON_checker/test/fail2.json
'["Unclosed array"',
# http://json.org/JSON_che... | mit |
ssls/beetle-agent | tests/modules/teams/resources/test_modifying_teams.py | 1 | 4600 | # encoding: utf-8
# pylint: disable=missing-docstring
import json
from app.modules.teams import models
def test_new_team_creation(flask_app_client, db, regular_user):
# pylint: disable=invalid-name
team_title = "Test Team Title"
with flask_app_client.login(regular_user, auth_scopes=('teams:write', )):
... | mit |
vgrem/Office365-REST-Python-Client | tests/sharepoint/test_site.py | 1 | 1652 | from office365.sharepoint.web_application.webApplication import WebApplication
from tests import test_site_url
from tests.sharepoint.sharepoint_case import SPTestCase
from office365.sharepoint.lists.list_template_type import ListTemplateType
from office365.sharepoint.sites.site import Site
class TestSite(SPTestCase)... | mit |
shhui/nova | nova/cells/filters/image_properties.py | 28 | 2494 | # Copyright (c) 2012-2013 Rackspace Hosting
# 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
#
# Unles... | apache-2.0 |
Nic30/hwtLib | hwtLib/amba/datapump/interconnect/rStrictOrder_test.py | 1 | 5032 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import unittest
from hwt.simulator.simTestCase import SimTestCase
from hwtLib.amba.datapump.interconnect.rStricOrder import RStrictOrderInterconnect
from hwtLib.amba.datapump.sim_ram import AxiDpSimRam
from pyMathBitPrecise.bit_utils import mask
from hwtSimApi.constants ... | mit |
spiside/pdb-tutorial | solutions/dicegame/runner.py | 1 | 1693 | from .die import Die
from .utils import i_just_throw_an_exception
class GameRunner:
def __init__(self):
self.dice = Die.create_dice(5)
self.reset()
def reset(self):
self.round = 1
self.wins = 0
self.loses = 0
@property
def answer(self):
... | mit |
joseandro/liToCNF | sValidator.py | 1 | 1230 | # This module validates inequations along with their solutions
# Author: Joseandro Luiz
def isValid(cnf, res):
"""
This function validates a CNF
@rtype: bool
"""
# Turn all variables from CNF positive (we have to compare them later)
andBoolClause = None
for i in cnf :
orBoolClaus... | gpl-3.0 |
akeyong/vnpy | vn.tutorial/tick2trade/vn.trader_t2t/ctpGateway/ctpDataType.py | 75 | 263961 | # encoding: UTF-8
defineDict = {}
typedefDict = {}
#//////////////////////////////////////////////////////////////////////
#@system 新一代交易所系统
#@company 上海期货信息技术有限公司
#@file ThostFtdcUserApiDataType.h
#@brief 定义了客户端接口使用的业务数据类型
#@history
#20060106 赵鸿昊 创建该文件
#/////////////////////////////////////////////////////////////... | mit |
emoron/simpleai | tests/search/test_hidden_variables.py | 5 | 1765 | import unittest
from operator import itemgetter
from simpleai.search import convert_to_binary
fst = itemgetter(0)
class TestHiddenVariableRepr(unittest.TestCase):
def setUp(self):
alldiff = lambda vars_, values_: len(set(values_)) == len(values_)
const = lambda vars_, values_: True
self... | mit |
n1bor/bitcoin | test/functional/p2p_addr_relay.py | 10 | 2862 | #!/usr/bin/env python3
# Copyright (c) 2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""
Test addr relay
"""
from test_framework.messages import (
CAddress,
NODE_NETWORK,
NODE_WITNESS... | mit |
openbudgets/openbudgets | openbudgets/api/v1/urls.py | 2 | 1032 | from django.conf.urls import url, include
from rest_framework.urlpatterns import format_suffix_patterns
from openbudgets.api.v1.views import api_v1
from openbudgets.apps.entities.urls.api import entities, divisions, domains
from openbudgets.apps.sheets.urls.api import templates, sheets
from openbudgets.apps.contexts.ur... | bsd-3-clause |
lakshayg/tensorflow | tensorflow/tools/docs/build_docs_test.py | 53 | 2485 | # 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 |
KarlTDebiec/westpa | lib/cmds/w_states.py | 4 | 9254 | # Copyright (C) 2013 Matthew C. Zwier and Lillian T. Chong
#
# This file is part of WESTPA.
#
# WESTPA 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... | gpl-3.0 |
pquerna/tls-client-hello-stats | third_party/dpkt/dpkt/dpkt.py | 13 | 5653 |
# $Id: dpkt.py 43 2007-08-02 22:42:59Z jon.oberheide $
"""Simple packet creation and parsing."""
import copy, itertools, socket, struct
class Error(Exception): pass
class UnpackError(Error): pass
class NeedData(UnpackError): pass
class PackError(Error): pass
class _MetaPacket(type):
def __new__(cls, clsname, c... | apache-2.0 |
erramuzpe/NeuroVault | neurovault/apps/statmaps/nidm_results.py | 3 | 7405 | import os
import rdflib
import shutil
import tempfile
import zipfile
from collections import Counter
from fnmatch import fnmatch
from rdflib.plugins.parsers.notation3 import BadSyntax
from urlparse import urlparse
class NIDMUpload:
def __init__(self, zip_path,tmp_dir=None,load=True):
self.path = zip_path... | mit |
manashmndl/LearningPyQt | pyqt/chap11/contactdlg.py | 1 | 5621 | #!/usr/bin/env python
# Copyright (c) 2008-14 Qtrac Ltd. All rights reserved.
# This program or module 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
# version 3 of the Lic... | mit |
LEPT-Development/Android_kernel_lge_C50 | tools/perf/scripts/python/netdev-times.py | 11271 | 15048 | # Display a process of packets and processed time.
# It helps us to investigate networking or network device.
#
# options
# tx: show only tx chart
# rx: show only rx chart
# dev=: show only thing related to specified device
# debug: work with debug mode. It shows buffer status.
import os
import sys
sys.path.append(os... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.