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 |
|---|---|---|---|---|---|
rlizana/bank-payment | account_banking_sepa_credit_transfer/migrations/8.0.0.3/pre-migration.py | 15 | 1301 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 Akretion (http://www.akretion.com/)
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the... | agpl-3.0 |
PythonCharmers/bokeh | bokeh/charts/builder/donut_builder.py | 31 | 8206 | """This is the Bokeh charts interface. It gives you a high level API to build
complex plot is a simple way.
This is the Donut class which lets you build your Donut charts just passing
the arguments to the Chart class and calling the proper functions.
It also add a new chained stacked method.
"""
#---------------------... | bsd-3-clause |
gangadhar-kadam/nassimapp | stock/stock_ledger.py | 27 | 11820 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import webnotes
from webnotes import msgprint
from webnotes.utils import cint, flt, cstr, now
from stock.utils import get_valuation_method
import jso... | agpl-3.0 |
chaozh/zookeeper | src/contrib/monitoring/ganglia/zookeeper_ganglia.py | 64 | 7829 | # 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 |
sethwoodworth/collect_phil_cdc | imginfo.py | 1 | 2312 | ################################################################################
################## ### ### ########### ### ### #####################
################## ## ## ## ## ## ########## ## ## ## ## ## ####################
################## # ### ## ## ## ########## # ### ## ## ## #################... | gpl-3.0 |
benbristow/GistPy | gistpy.py | 1 | 1418 | #!/usr/bin/env python
#Designed for Python 2
#By Ben Bristow - http://github.com/benbristow/
import sys
import os.path
import simplejson as json
import requests
import pyperclip #Requires xclip on Linux
def checkFileExists(filename):
if os.path.isfile(filename):
return True
else:
return False
... | mit |
kawamon/hue | desktop/core/src/desktop/routing.py | 2 | 1214 | #!/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 |
ccrook/Quantum-GIS | tests/src/python/test_qgsmaplayermodel.py | 13 | 15382 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsMapLayerModel
.. 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.
"""
_... | gpl-2.0 |
vinilios/synnefo | snf-astakos-app/astakos/im/tests/__init__.py | 7 | 1133 | # Copyright (C) 2010-2014 GRNET S.A.
#
# 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 version.
#
# This program is distributed i... | gpl-3.0 |
pcm17/tensorflow | tensorflow/contrib/learn/python/learn/estimators/linear.py | 5 | 37179 | # Copyright 2016 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 |
Edraak/circleci-edx-platform | lms/djangoapps/certificates/tests/test_cert_management.py | 70 | 10052 | """Tests for the resubmit_error_certificates management command. """
import ddt
from contextlib import contextmanager
from django.core.management.base import CommandError
from nose.plugins.attrib import attr
from django.test.utils import override_settings
from mock import patch
from opaque_keys.edx.locator import Cour... | agpl-3.0 |
brianlsharp/MissionPlanner | Lib/distutils/command/install_data.py | 60 | 2926 | """distutils.command.install_data
Implements the Distutils 'install_data' command, for installing
platform-independent data files."""
# contributed by Bastian Kleineidam
__revision__ = "$Id$"
import os
from distutils.core import Command
from distutils.util import change_root, convert_path
class instal... | gpl-3.0 |
mixedpuppy/offlineimap | offlineimap/mbnames.py | 13 | 2716 | # Mailbox name generator
# Copyright (C) 2002 John Goerzen
# <jgoerzen@complete.org>
#
# 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 ... | gpl-2.0 |
aimejeux/enigma2 | lib/python/Components/HdmiCec.py | 2 | 12526 | import struct
import os
from sys import maxint
from enigma import eTimer, eHdmiCEC, eActionMap
from config import config, ConfigSelection, ConfigYesNo, ConfigSubsection, ConfigText
from Tools.StbHardware import getFPWasTimerWakeup
from Tools.Directories import fileExists
config.hdmicec = ConfigSubsection()
config.hdm... | gpl-2.0 |
mohittahiliani/adaptive-RED-ns3 | doc/tutorial-pt-br/pickle-to-xml.py | 392 | 1500 | #!/usr/bin/python
# output xml format:
# <pages>
# <page url="xx"><prev url="yyy">zzz</prev><next url="hhh">lll</next><fragment>file.frag</fragment></page>
# ...
# </pages>
import pickle
import os
import codecs
def dump_pickles(out, dirname, filename, path):
f = open(os.path.join(dirname, filename), 'r')
da... | gpl-2.0 |
jeroenj/CouchPotatoServer | libs/bs4/diagnose.py | 431 | 6315 | """Diagnostic functions, mainly for use when doing tech support."""
import cProfile
from StringIO import StringIO
from HTMLParser import HTMLParser
import bs4
from bs4 import BeautifulSoup, __version__
from bs4.builder import builder_registry
import os
import pstats
import random
import tempfile
import time
import tra... | gpl-3.0 |
sbidoul/buildbot | master/buildbot/monkeypatches/servicechecks.py | 11 | 1405 | # This file is part of Buildbot. Buildbot 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.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | gpl-2.0 |
OptiPop/external_chromium_org | tools/cygprofile/mergetraces.py | 52 | 8029 | #!/usr/bin/python
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Use: ../mergetraces.py `ls cyglog.* -Sr` > merged_cyglog
""""Merge multiple logs files from different processes into a single log.
Give... | bsd-3-clause |
bocaaust/FreshLife | django_project/env/lib/python2.7/site-packages/pip/compat/dictconfig.py | 921 | 23096 | # This is a copy of the Python logging.config.dictconfig module,
# reproduced with permission. It is provided here for backwards
# compatibility for Python versions prior to 2.7.
#
# Copyright 2009-2010 by Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# docu... | apache-2.0 |
ar7z1/ansible | lib/ansible/module_utils/facts/system/python.py | 232 | 1999 | # This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that ... | gpl-3.0 |
Jamagas/gtest-1.7.0 | test/gtest_catch_exceptions_test.py | 2139 | 9901 | #!/usr/bin/env python
#
# Copyright 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 o... | bsd-3-clause |
longmen21/edx-platform | common/test/acceptance/tests/test_annotatable.py | 16 | 5654 | # -*- coding: utf-8 -*-
"""
E2E tests for the LMS.
"""
from common.test.acceptance.tests.helpers import UniqueCourseTest
from common.test.acceptance.pages.studio.auto_auth import AutoAuthPage
from common.test.acceptance.pages.lms.courseware import CoursewarePage
from common.test.acceptance.pages.lms.annotation_compone... | agpl-3.0 |
tdsmith/celltool | celltool/utility/pil_lite/PIL/TiffImagePlugin.py | 1 | 25801 | #
# The Python Imaging Library.
# $Id: TiffImagePlugin.py 2803 2006-07-31 19:18:57Z fredrik $
#
# TIFF file handling
#
# TIFF is a flexible, if somewhat aged, image file format originally
# defined by Aldus. Although TIFF supports a wide variety of pixel
# layouts and compression methods, the name doesn't really stand... | gpl-2.0 |
Mattze96/youtube-dl | youtube_dl/downloader/rtsp.py | 119 | 1528 | from __future__ import unicode_literals
import os
import subprocess
from .common import FileDownloader
from ..utils import (
check_executable,
encodeFilename,
)
class RtspFD(FileDownloader):
def real_download(self, filename, info_dict):
url = info_dict['url']
self.report_destination(file... | unlicense |
googleads/google-ads-python | google/ads/googleads/v6/resources/types/detail_placement_view.py | 1 | 2837 | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | apache-2.0 |
oihane/odoo | addons/sale_stock/__openerp__.py | 214 | 2553 | # -*- 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 |
frreiss/tensorflow-fred | tensorflow/python/data/experimental/kernel_tests/optimization/inject_prefetch_test.py | 1 | 4249 | # Copyright 2019 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 |
skiselev/upm | examples/python/yg1006.py | 7 | 2022 | #!/usr/bin/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 limi... | mit |
wangyizhen/python-data-mining-platform | example/twc_naive_bayes_train_test.py | 8 | 1180 | """
this is a sample shows twc-naive-bayes train and test
"""
import math
import pickle
import sys,os
sys.path.append(os.path.join(os.getcwd(), '../'))
from pymining.math.matrix import Matrix
from pymining.math.text2matrix import Text2Matrix
from pymining.nlp.segmenter import Segmenter
from pymining.common.global_inf... | bsd-3-clause |
aclifton/cpeg853-gem5 | ext/ply/test/yacc_prec1.py | 164 | 1556 | # -----------------------------------------------------------------------------
# yacc_prec1.py
#
# Tests case where precedence specifier doesn't match up to terminals
# -----------------------------------------------------------------------------
import sys
if ".." not in sys.path: sys.path.insert(0,"..")
import ply.... | bsd-3-clause |
manazhao/tf_recsys | tensorflow/python/framework/file_system_test.py | 76 | 1898 | # 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 |
okcom84301/openwrt | target/linux/x86/image/mkimg_bifferboard.py | 561 | 1265 | #!/usr/bin/env python
"""
Create firmware for 4/8MB Bifferboards, suitable for uploading using
either bb_upload8.py or bb_eth_upload8.py
"""
import struct, sys
# Increase the kmax value if the script gives errors about the kernel being
# too large. You need to set the Biffboot kmax value to the same value yo... | gpl-2.0 |
mcking49/apache-flask | Python/Lib/test/test_str.py | 1 | 19137 | import unittest
import struct
import sys
from test import test_support, string_tests
class StrTest(
string_tests.CommonTest,
string_tests.MixinStrUnicodeUserStringTest,
string_tests.MixinStrUserStringTest,
string_tests.MixinStrUnicodeTest,
):
type2test = str
# We don't need to propagate ... | mit |
mick-d/nipype | nipype/interfaces/c3.py | 5 | 1785 | # -*- coding: utf-8 -*-
"""The ants module provides basic functions for interfacing with ants functions.
Change directory to provide relative paths for doctests
>>> import os
>>> filepath = os.path.dirname( os.path.realpath( __file__ ) )
>>> datadir = os.path.realpath(os.path.join(filepath, '../testing/dat... | bsd-3-clause |
NVDARemote/NVDARemote | addon/globalPlugins/remoteClient/keyboard_hook.py | 5 | 1906 | from logging import getLogger
logger = getLogger('keyboard_hook')
import ctypes
from ctypes import (
wintypes,
Structure,
c_long,
c_int,
)
HC_ACTION = 0
WH_KEYBOARD_LL = 13
LLKHF_INJECTED = 16
LLKHF_UP = 128
KF_EXTENDED = 0x0100
LLKHF_EXTENDED = KF_EXTENDED >> 8
class KBDLLHOOKSTRUCT(Structur... | gpl-2.0 |
StackStorm/st2 | st2common/tests/unit/test_action_db_utils.py | 3 | 22030 | # -*- coding: utf-8 -*-
# Copyright 2020 The StackStorm Authors.
# Copyright 2019 Extreme Networks, 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... | apache-2.0 |
kawamon/hue | desktop/core/ext-py/dnspython-1.15.0/dns/rdtypes/ANY/GPOS.py | 18 | 5369 | # Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED "... | apache-2.0 |
krame505/board_games | python/move.py | 1 | 2497 | from abc import ABCMeta, abstractmethod
class Move:
"""Common abstract base class for moves"""
__metaclass__ = ABCMeta
# @abstractmethod
# def __str__(self):
# return self.show(None)
@abstractmethod
def __repr__(self):
pass
@abstractmethod
def __hash__(self):
pas... | gpl-3.0 |
erwilan/ansible | lib/ansible/modules/monitoring/logstash_plugin.py | 77 | 5251 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Ansible module to manage elasticsearch plugins
(c) 2017, Loic Blot <loic.blot@unix-experience.fr>
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 So... | gpl-3.0 |
intip/django-cms | cms/migrations/0005_auto_20140924_1039.py | 57 | 4895 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
from django.db.models import F
from treebeard.numconv import NumConv
STEPLEN = 4
ALPHABET = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'
class MP_AddHandler(object):
def __init__(self):
self.stmts = []
NUM = N... | bsd-3-clause |
MyAOSP/external_chromium_org | native_client_sdk/src/tools/tests/httpd_test.py | 72 | 3450 | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import Queue
import sys
import subprocess
import threading
import unittest
import urllib2
SCRIPT_DIR = os.path.dirname(o... | bsd-3-clause |
dorbarker/INNUca | src/SPAdes-3.9.0-Linux/share/spades/joblib2/hashing.py | 13 | 6254 | """
Fast cryptographic hash of Python objects, with a special case for fast
hashing of numpy arrays.
"""
# Author: Gael Varoquaux <gael dot varoquaux at normalesup dot org>
# Copyright (c) 2009 Gael Varoquaux
# License: BSD Style, 3 clauses.
import pickle
try:
from hashlib import md5
except ImportError:
from ... | gpl-3.0 |
hyperized/ansible | test/units/modules/network/fortios/test_fortios_system_replacemsg_nntp.py | 21 | 8409 | # Copyright 2019 Fortinet, 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, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the... | gpl-3.0 |
nerzhul/ansible | lib/ansible/modules/packaging/os/portinstall.py | 12 | 7096 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, berenddeboer
# Written by berenddeboer <berend@pobox.com>
# Based on pkgng module written by bleader <bleader at ratonland.org>
#
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publish... | gpl-3.0 |
jamslevy/gsoc | app/django/db/backends/postgresql_psycopg2/base.py | 15 | 4062 | """
PostgreSQL database backend for Django.
Requires psycopg 2: http://initd.org/projects/psycopg2
"""
from django.db.backends import *
from django.db.backends.postgresql.operations import DatabaseOperations as PostgresqlDatabaseOperations
from django.db.backends.postgresql.client import DatabaseClient
from django.db... | apache-2.0 |
gangadhar-kadam/prjlib | webnotes/utils/email_lib/smtp.py | 2 | 12839 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
"""
Sends email via outgoing server specified in "Control Panel"
Allows easy adding of Attachments of "File" objects
"""
import webnotes
from webnotes import conf
from webno... | mit |
elkingtonmcb/sympy | examples/galgebra/products_latex.py | 72 | 2650 | #!/usr/bin/env python
from __future__ import print_function
from sympy import symbols
from sympy.galgebra import MV, Format
from sympy.galgebra import xdvi
def main():
Format()
coords = (x, y, z) = symbols('x y z')
(ex, ey, ez, grad) = MV.setup('e*x|y|z', '[1,1,1]', coords=coords)
s = MV('s', 'sca... | bsd-3-clause |
ejankan/cassandra | pylib/cqlshlib/saferscanner.py | 89 | 2711 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | apache-2.0 |
arthru/OpenUpgrade | addons/point_of_sale/report/__init__.py | 381 | 1238 | # -*- 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 |
vongochung/buiquocviet | django/contrib/gis/gdal/prototypes/geom.py | 91 | 4762 | from ctypes import c_char_p, c_double, c_int, c_void_p, POINTER
from django.contrib.gis.gdal.envelope import OGREnvelope
from django.contrib.gis.gdal.libgdal import lgdal, GEOJSON
from django.contrib.gis.gdal.prototypes.errcheck import check_bool, check_envelope
from django.contrib.gis.gdal.prototypes.generation import... | bsd-3-clause |
KyoungRan/Django_React_ex | Django_React_Workshop-mbrochh/django/myvenv/lib/python3.4/site-packages/django/contrib/contenttypes/migrations/0002_remove_content_type_name.py | 582 | 1168 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
def add_legacy_name(apps, schema_editor):
ContentType = apps.get_model('contenttypes', 'ContentType')
for ct in ContentType.objects.all():
try:
ct.name = apps.get_model(ct.app_label, c... | mit |
SUSE/kiwi | test/unit/package_manager/zypper_test.py | 1 | 7265 | from mock import patch
from pytest import raises
import mock
from kiwi.path import Path
from kiwi.package_manager.zypper import PackageManagerZypper
from kiwi.exceptions import KiwiRequestError
class TestPackageManagerZypper:
def setup(self):
repository = mock.Mock()
repository.root_dir = 'root-... | gpl-3.0 |
bratsche/Neutron-Drive | google_appengine/lib/PyAMF/pyamf/tests/adapters/_google_models.py | 26 | 1253 | from google.appengine.ext import db
class PetModel(db.Model):
"""
"""
# 'borrowed' from http://code.google.com/appengine/docs/datastore/entitiesandmodels.html
name = db.StringProperty(required=True)
type = db.StringProperty(required=True, choices=set(["cat", "dog", "bird"]))
birthdate = db.Da... | bsd-3-clause |
ychen820/microblog | flask/lib/python2.7/site-packages/wtforms/fields/core.py | 58 | 33124 | from __future__ import unicode_literals
import datetime
import decimal
import itertools
from wtforms import widgets
from wtforms.compat import text_type, izip
from wtforms.i18n import DummyTranslations
from wtforms.validators import StopValidation
from wtforms.utils import unset_value
__all__ = (
'BooleanField'... | bsd-3-clause |
junneyang/taskflow | tools/clear_zk.py | 2 | 1332 | #!/usr/bin/env python
import contextlib
import os
import re
import sys
top_dir = os.path.abspath(os.path.join(os.path.dirname(__file__),
os.pardir))
sys.path.insert(0, top_dir)
from taskflow.utils import kazoo_utils
@contextlib.contextmanager
def finalize_client(client):
... | apache-2.0 |
chauhanhardik/populo | common/lib/xmodule/xmodule/modulestore/tests/test_mixed_modulestore.py | 40 | 126024 | """
Unit tests for the Mixed Modulestore, with DDT for the various stores (Split, Draft, XML)
"""
from collections import namedtuple
import datetime
import logging
import ddt
import itertools
import mimetypes
from uuid import uuid4
from contextlib import contextmanager
from mock import patch
# Mixed modulestore depend... | agpl-3.0 |
ElementsProject/elements | test/functional/p2p_eviction.py | 1 | 5754 | #!/usr/bin/env python3
# Copyright (c) 2019 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 node eviction logic
When the number of peers has reached the limit of maximum connections,
the next ... | mit |
someorz/spark | examples/src/main/python/mllib/naive_bayes_example.py | 106 | 2285 | #
# 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 |
JioEducation/edx-platform | lms/djangoapps/shoppingcart/management/commands/retire_order.py | 30 | 1559 | """
Script for retiring order that went through cybersource but weren't
marked as "purchased" in the db
"""
from django.core.management.base import BaseCommand
from shoppingcart.models import Order
from shoppingcart.exceptions import UnexpectedOrderItemStatus, InvalidStatusToRetire
class Command(BaseCommand):
""... | agpl-3.0 |
alextruberg/custom_django | tests/queries/models.py | 5 | 14071 | """
Various complex queries that have been problematic in the past.
"""
from __future__ import unicode_literals
import threading
from django.db import models
from django.utils import six
from django.utils.encoding import python_2_unicode_compatible
class DumbCategory(models.Model):
pass
class ProxyCategory(Dum... | bsd-3-clause |
jwallen/MEASURE | measure/output.py | 1 | 14194 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
################################################################################
#
# MEASURE - Master Equation Automatic Solver for Unimolecular REactions
#
# Copyright (c) 2010 by Joshua W. Allen (jwallen@mit.edu)
#
# Permission is hereby granted, free of charge, to... | mit |
oihane/odoo | addons/product/tests/test_uom.py | 346 | 2677 | from openerp.tests.common import TransactionCase
class TestUom(TransactionCase):
"""Tests for unit of measure conversion"""
def setUp(self):
super(TestUom, self).setUp()
self.product = self.registry('product.product')
self.uom = self.registry('product.uom')
self.imd = self.regi... | agpl-3.0 |
luriz/astar | aStar.py | 1 | 8396 | import math
import loader
import cellOpening
cellList = []
class Cell(object):
posY = -1
posX = -1
valueFinal = -1 # value of cell in the f(x) + heuristic *g(x) map
def __init__(self, posY, posX, valueFinal):
self.posY = posY
self.posX = posX
self.valueFinal = valueFinal
# ch... | gpl-3.0 |
coderbone/SickRage | lib/concurrent/futures/_compat.py | 106 | 4976 | from keyword import iskeyword as _iskeyword
from operator import itemgetter as _itemgetter
import sys as _sys
def namedtuple(typename, field_names):
"""Returns a new subclass of tuple with named fields.
>>> Point = namedtuple('Point', 'x y')
>>> Point.__doc__ # docstring for the new cla... | gpl-3.0 |
hgdeoro/pilas | pilasengine/configuracion/__init__.py | 2 | 5437 | # -*- coding: utf-8 -*-
# pilas engine: un motor para hacer videojuegos
#
# Copyright 2010-2014 - Hugo Ruscitti
# License: LGPLv3 (see http://www.gnu.org/licenses/lgpl.html)
#
# Website - http://www.pilas-engine.com.ar
import os
import sys
import re
import codecs
import time
import pickle
import json
from PyQt4 impor... | lgpl-3.0 |
calvinchengx/O-Kay-Blog-wih-Kay-0.10.0 | kay/lib/babel/messages/pofile.py | 6 | 16841 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2007-2008 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://babel.edgewall.org/wiki/License.
#
# This software consists... | bsd-3-clause |
peterjoel/servo | tests/wpt/web-platform-tests/tools/wpt/tests/test_wpt.py | 2 | 16606 | import errno
import os
import shutil
import socket
import subprocess
import sys
import tempfile
import time
import urllib2
import pytest
from tools.wpt import wpt
here = os.path.abspath(os.path.dirname(__file__))
def is_port_8000_in_use():
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
try:
... | mpl-2.0 |
fastai/fastai | fastai/callback/captum.py | 1 | 5575 | # AUTOGENERATED! DO NOT EDIT! File to edit: nbs/73_callback.captum.ipynb (unless otherwise specified).
__all__ = ['json_clean', 'CaptumInterpretation']
# Cell
import tempfile
from ..basics import *
# Cell
from ipykernel import jsonutil
# Cell
# Dirty hack as json_clean doesn't support CategoryMap type
_json_clean=j... | apache-2.0 |
sclabs/sitestatus-nonrel | django/contrib/databrowse/plugins/calendars.py | 247 | 4317 | from django import http
from django.db import models
from django.contrib.databrowse.datastructures import EasyModel
from django.contrib.databrowse.sites import DatabrowsePlugin
from django.shortcuts import render_to_response
from django.utils.text import capfirst
from django.utils.encoding import force_unicode
from dja... | bsd-3-clause |
ifduyue/sentry | src/sentry/south_migrations/0077_auto__add_trackeduser__add_unique_trackeduser_project_ident.py | 3 | 32898 | # -*- 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):
# Adding model 'TrackedUser'
db.create_table(
'sentry_trackeduser', (
(
... | bsd-3-clause |
Marcusz97/CILP_Facilitatore_Audacity | lib-src/lv2/lv2/waflib/Tools/c_tests.py | 330 | 4280 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
from waflib import Task
from waflib.Configure import conf
from waflib.TaskGen import feature,before_method,after_method
import sys
LIB_CODE='''
#ifdef _MSC_VER
#define testEXP... | gpl-2.0 |
mohierf/shinken | test/test_nocontacts.py | 18 | 1504 | #!/usr/bin/env python
# Copyright (C) 2009-2014:
# Gabes Jean, naparuba@gmail.com
# Gerhard Lausser, Gerhard.Lausser@consol.de
#
# This file is part of Shinken.
#
# Shinken is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the F... | agpl-3.0 |
novaksam/python-jss | test/jss_test.py | 1 | 13680 | #!/usr/bin/env python
"""Tests for jss wrapper.
These tests will FAIL! A few of the tests assert values local to my
institution. Edit them to work in your environment, or find a better way to do
it and send me an email!
For test to succeed, you need to set up a preferences file at:
~/Library/Preferences/com.github.she... | gpl-3.0 |
havt/odoo | addons/base_report_designer/plugin/openerp_report_designer/bin/script/ModifyExistingReport.py | 384 | 8450 | #########################################################################
#
# Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com
# Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>).
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser Gene... | agpl-3.0 |
adelton/django | django/core/checks/security/csrf.py | 477 | 1796 | from django.conf import settings
from .. import Tags, Warning, register
W003 = Warning(
"You don't appear to be using Django's built-in "
"cross-site request forgery protection via the middleware "
"('django.middleware.csrf.CsrfViewMiddleware' is not in your "
"MIDDLEWARE_CLASSES). Enabling the middle... | bsd-3-clause |
ebigelow/LOTlib | LOTlib/Hypotheses/Lexicon/WeightedLexicon.py | 3 | 5054 | # -*- coding: utf-8 -*-
from copy import copy
from LOTlib.Miscellaneous import flip, weighted_sample, ifelse, log
from LOTlib.DataAndObjects import UtteranceData
from SimpleLexicon import SimpleLexicon
class WeightedLexicon(SimpleLexicon):
"""
A weighted lexicon is a lexicon where each word has a w... | gpl-3.0 |
scalyr/scalyr-agent-2 | scalyr_agent/third_party_python2/glob2/compat.py | 13 | 6859 | # Back-port functools.lru_cache to Python 2 (and <= 3.2)
# {{{ http://code.activestate.com/recipes/578078/ (r6)
from collections import namedtuple
from functools import update_wrapper
from threading import RLock
_CacheInfo = namedtuple("CacheInfo", ["hits", "misses", "maxsize", "currsize"])
class _HashedSeq(list):
... | apache-2.0 |
missionpinball/mpf-examples | tests/test_TutorialStep18.py | 1 | 6126 | from mpfmc.tests.MpfIntegrationTestCase import MpfIntegrationTestCase
class TestTutorialStep18(MpfIntegrationTestCase):
def getConfigFile(self):
return 'config.yaml'
def getMachinePath(self):
return self.get_abs_path('tutorial_step_18')
def get_platform(self):
return 'smart_virt... | mit |
mohittahiliani/PIE-ns3 | waf-tools/cflags.py | 16 | 4963 | from waflib import Logs, Options, Utils
class CompilerTraits(object):
def get_warnings_flags(self, level):
"""get_warnings_flags(level) -> list of cflags"""
raise NotImplementedError
def get_optimization_flags(self, level):
"""get_optimization_flags(level) -> list of cflags"""
raise NotImplementedError
d... | gpl-2.0 |
kordano/samba-ldb-mdb | lib/testtools/scripts/_lp_release.py | 15 | 7695 | #!/usr/bin/python
"""Release testtools on Launchpad.
Steps:
1. Make sure all "Fix committed" bugs are assigned to 'next'
2. Rename 'next' to the new version
3. Release the milestone
4. Upload the tarball
5. Create a new 'next' milestone
6. Mark all "Fix committed" bugs in the milestone as "Fix released"
Assume... | gpl-3.0 |
hyperized/ansible-modules-core | commands/raw.py | 27 | 2975 | # this is a virtual module that is entirely implemented server side
# 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 op... | gpl-3.0 |
pushscreen/pushscreen-python | setup.py | 1 | 1257 | #!/usr/bin/env python
import os
import sys
import pushscreen
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
if sys.argv[-1] == 'publish':
os.system('python setup.py sdist upload')
sys.exit()
os.environ['PYTHONDONTWRITEBYTECODE'] = '1'
packages = [
'pushs... | isc |
php-coder/origin | vendor/github.com/google/certificate-transparency/python/ct/crypto/error.py | 34 | 4487 | """Status codes are bad, but True/False is not expressive enough.
Consider a cryptographic signature verification method verify(data, sig) that
returns 1 for valid signatures, 0 for invalid signatures, and -1 to signal some
specific error. This can easily lead to insecure usage such as
if verify(data, sig):
# do s... | apache-2.0 |
datastax/python-driver | tests/integration/standard/test_metadata.py | 1 | 117497 | # Copyright DataStax, 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, softwa... | apache-2.0 |
oVirt/ovirt-engine-cli | src/ovirtcli/shell/cmdshell.py | 1 | 4727 | #
# Copyright (c) 2010 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | apache-2.0 |
goshippo/shippo-python-client | examples/tracking.py | 1 | 1736 | import shippo
'''
In this tutorial we have an order with a sender address,
recipient address and parcel information that we need to ship.
'''
# Replace <API-KEY> with your key
shippo.config.api_key = "<API-KEY>"
# Tracking based on a Shippo transaction
transaction_id = '<TRANSACTION-ID>'
transaction = shippo.Transac... | mit |
batxes/4c2vhic | Six_zebra_models/Six_zebra_models_final_output_0.1_-0.1_13000/Six_zebra_models30406.py | 4 | 13922 | import _surface
import chimera
try:
import chimera.runCommand
except:
pass
from VolumePath import markerset as ms
try:
from VolumePath import Marker_Set, Link
new_marker_set=Marker_Set
except:
from VolumePath import volume_path_dialog
d= volume_path_dialog(True)
new_marker_set= d.new_marker_set
marker_set... | gpl-3.0 |
mapr/hue | desktop/core/ext-py/tablib-0.10.0/tablib/packages/xlrd3/xldate.py | 54 | 6641 | # No part of the content of this file was derived from the works of David Giffin.
#
# Copyright © 2005-2008 Stephen John Machin, Lingfo Pty Ltd
# This module is part of the xlrd3 package, which is released under a
# BSD-style licence.
#
# Provides function(s) for dealing with Microsoft Excel ™ dates.
#
# 2008-1... | apache-2.0 |
saradbowman/osf.io | scripts/tests/test_user_summary.py | 13 | 3770 | from datetime import timedelta
from django.utils import timezone
import mock
from nose.tools import * # noqa
import pytz
from osf.models import OSFUser
from tests.base import OsfTestCase
from osf_tests.factories import AuthUserFactory, NodeLogFactory, InstitutionFactory
from scripts.analytics.user_summary import User... | apache-2.0 |
mancoast/CPythonPyc_test | crash/244_test_resource.py | 27 | 1690 | import os
import resource
from test.test_support import TESTFN
# This test is checking a few specific problem spots. RLIMIT_FSIZE
# should be RLIM_INFINITY, which will be a really big number on a
# platform with large file support. On these platforms, we need to
# test that the get/setrlimit functions properly conv... | gpl-3.0 |
pahko/isort | isort/isort.py | 3 | 38021 | """isort.py.
Exposes a simple library to sort through imports within Python code
usage:
SortImports(file_name)
or:
sorted = SortImports(file_contents=file_contents).output
Copyright (C) 2013 Timothy Edmund Crosley
Permission is hereby granted, free of charge, to any person obtaining a copy of this software... | mit |
cloudfoundry/php-buildpack-legacy | builds/runtimes/python-2.7.6/lib/python2.7/distutils/command/clean.py | 251 | 2814 | """distutils.command.clean
Implements the Distutils 'clean' command."""
# contributed by Bastian Kleineidam <calvin@cs.uni-sb.de>, added 2000-03-18
__revision__ = "$Id$"
import os
from distutils.core import Command
from distutils.dir_util import remove_tree
from distutils import log
class clean(Command):
desc... | mit |
GheRivero/ansible | lib/ansible/modules/network/slxos/slxos_config.py | 23 | 17456 | #!/usr/bin/python
#
# (c) 2018 Extreme Networks Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any late... | gpl-3.0 |
awanke/bokeh | examples/compat/mpl/polycollection.py | 34 | 1276 | from matplotlib.collections import PolyCollection
import matplotlib.pyplot as plt
import numpy as np
from bokeh import mpl
from bokeh.plotting import output_file, show
# Generate data. In this case, we'll make a bunch of center-points and generate
# verticies by subtracting random offsets from those center-points
num... | bsd-3-clause |
stormi/tsunami | src/primaires/scripting/fonctions/est_mort.py | 1 | 2009 | # -*-coding:Utf-8 -*
# Copyright (c) 2012 LE GOFF Vincent
# 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
# l... | bsd-3-clause |
evanma92/routeh | flask/lib/python2.7/site-packages/setuptools/tests/test_find_packages.py | 151 | 5930 | """Tests for setuptools.find_packages()."""
import os
import sys
import shutil
import tempfile
import platform
import pytest
import setuptools
from setuptools import find_packages
find_420_packages = setuptools.PEP420PackageFinder.find
# modeled after CPython's test.support.can_symlink
def can_symlink():
TESTFN... | bsd-3-clause |
stephane-martin/salt-debian-packaging | salt-2016.3.2/tests/integration/shell/enabled.py | 1 | 3559 | # -*- coding: utf-8 -*-
# Import Python Libs
from __future__ import absolute_import
import os
import textwrap
# Import Salt Testing libs
from salttesting.helpers import ensure_in_syspath
ensure_in_syspath('../../')
# Import Salt Libs
import integration
import salt.utils
STATE_DIR = os.path.join(integration.FILES,... | apache-2.0 |
kobejean/tensorflow | tensorflow/contrib/data/python/kernel_tests/serialization/shuffle_and_repeat_dataset_serialization_test.py | 14 | 1552 | # 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 |
yan12125/youtube-dl | youtube_dl/extractor/spankbang.py | 8 | 6646 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
determine_ext,
ExtractorError,
merge_dicts,
orderedSet,
parse_duration,
parse_resolution,
str_to_int,
url_or_none,
urlencode_postdata,
)
class SpankBangIE(InfoExtractor):
... | unlicense |
orangeduck/PyAutoC | Python27/Lib/test/test_complex_args.py | 136 | 3507 |
import unittest
from test import test_support
import textwrap
class ComplexArgsTestCase(unittest.TestCase):
def check(self, func, expected, *args):
self.assertEqual(func(*args), expected)
# These functions are tested below as lambdas too. If you add a
# function test, also add a similar lambda ... | bsd-2-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.