repo_name stringlengths 5 100 | path stringlengths 4 375 | copies stringclasses 991
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
zfrenchee/pandas | pandas/tests/groupby/aggregate/test_other.py | 1 | 17999 | # -*- coding: utf-8 -*-
"""
test all other .agg behavior
"""
from __future__ import print_function
import pytest
from datetime import datetime, timedelta
from functools import partial
import numpy as np
import pandas as pd
from pandas import date_range, DataFrame, Index, MultiIndex, Series
from pandas.core.groupb... | bsd-3-clause |
robinandeer/puzzle | tests/plugins/store/mixins/test_mixin_comment.py | 1 | 2294 | # -*- coding: utf-8 -*-
from puzzle.models.sql import Comment
def test_add_comment_case(test_db):
text = 'test-comment'
case_obj = test_db.cases().first()
comment_obj = test_db.add_comment(case_obj, text)
assert isinstance(comment_obj, Comment)
assert comment_obj.text == text
def test_add_comment_... | mit |
paurosello/frappe | frappe/tests/test_global_search.py | 7 | 7660 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import unittest
import frappe
from frappe.utils import global_search
from frappe.test_runner import make_test_objects
import frappe.utils
class TestGlobalSearch(unittest.TestCas... | mit |
zstackorg/zstack-woodpecker | integrationtest/vm/vm_password/test_cloned_vm_chg_passwd_c6_32.py | 2 | 5348 | '''
test for cloned vm changing password
@author: SyZhao
'''
import apibinding.inventory as inventory
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_lib as test_lib
import zstackwoodpecker.test_state as test_state
import zstackwoodpecker.operations.vm_operations as vm_ops
import ... | apache-2.0 |
untom/scikit-learn | sklearn/datasets/tests/test_samples_generator.py | 67 | 14842 | from __future__ import division
from collections import defaultdict
from functools import partial
import numpy as np
from sklearn.externals.six.moves import zip
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_almost_equal
fr... | bsd-3-clause |
movmov/cc | vendor/Twisted-10.0.0/twisted/protocols/socks.py | 59 | 7792 | # -*- test-case-name: twisted.test.test_socks -*-
# Copyright (c) 2001-2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Implementation of the SOCKSv4 protocol.
"""
# python imports
import struct
import string
import socket
import time
# twisted imports
from twisted.internet import reactor, protocol, ... | apache-2.0 |
tequa/ammisoft | ammimain/WinPython-64bit-2.7.13.1Zero/python-2.7.13.amd64/Tools/Scripts/pindent.py | 37 | 17171 | #! /usr/bin/env python
# This file contains a class and a main program that perform three
# related (though complimentary) formatting operations on Python
# programs. When called as "pindent -c", it takes a valid Python
# program as input and outputs a version augmented with block-closing
# comments. When called as ... | bsd-3-clause |
dgjustice/ansible | lib/ansible/modules/cloud/amazon/ec2_vol_facts.py | 25 | 4114 | #!/usr/bin/python
#
# This is a 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 Ansible library is distributed in the hope that i... | gpl-3.0 |
mgunyho/pyspread | pyspread/src/lib/ODSReader.py | 1 | 3950 | # Copyright 2011 Marco Conti
# 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, sof... | gpl-3.0 |
NCI-Cloud/horizon | openstack_dashboard/dashboards/admin/images/forms.py | 52 | 2166 | # Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the... | apache-2.0 |
showell/zulip | zerver/management/commands/send_password_reset_email.py | 3 | 2403 | from argparse import ArgumentParser
from typing import Any, List
from django.contrib.auth.tokens import default_token_generator
from zerver.forms import generate_password_reset_url
from zerver.lib.management import CommandError, ZulipBaseCommand
from zerver.lib.send_email import FromAddress, send_email
from zerver.mo... | apache-2.0 |
mortada/tensorflow | tensorflow/contrib/tensor_forest/python/kernel_tests/finished_nodes_op_test.py | 80 | 6006 | # 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 |
pathompongoo/ThGovJobApp | env/lib/python2.7/site-packages/pip/_vendor/colorama/initialise.py | 474 | 1597 | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
import atexit
import sys
from .ansitowin32 import AnsiToWin32
orig_stdout = sys.stdout
orig_stderr = sys.stderr
wrapped_stdout = sys.stdout
wrapped_stderr = sys.stderr
atexit_done = False
def reset_all():
AnsiToWin32(orig_stdout).rese... | gpl-3.0 |
nyuszika7h/youtube-dl | youtube_dl/extractor/kusi.py | 58 | 3122 | # coding: utf-8
from __future__ import unicode_literals
import random
import re
from .common import InfoExtractor
from ..compat import compat_urllib_parse_unquote_plus
from ..utils import (
int_or_none,
float_or_none,
timeconvert,
update_url_query,
xpath_text,
)
class KUSIIE(InfoExtractor):
... | unlicense |
nanjj/softlayer-python | SoftLayer/CLI/block/access/authorize.py | 2 | 1970 | """Authorizes hosts on a specific block volume."""
# :license: MIT, see LICENSE for more details.
import click
import SoftLayer
from SoftLayer.CLI import environment
from SoftLayer.CLI import exceptions
@click.command()
@click.argument('volume_id')
@click.option('--hardware-id', '-h', multiple=True,
he... | mit |
nabsboss/CouchPotatoServer | libs/flask/signals.py | 50 | 1973 | # -*- coding: utf-8 -*-
"""
flask.signals
~~~~~~~~~~~~~
Implements signals based on blinker if available, otherwise
falls silently back to a noop
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
signals_available = False
try:
from blinker import Name... | gpl-3.0 |
ajdawson/cartopy | lib/cartopy/tests/mpl/test_mpl_integration.py | 2 | 18162 | # (C) British Crown Copyright 2011 - 2014, Met Office
#
# This file is part of cartopy.
#
# cartopy 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, either version 3 of the License, or
# (at your option)... | lgpl-3.0 |
google/qkeras | experimental/lo/table/parser.py | 2 | 3954 | # 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 or agreed to in writing,... | apache-2.0 |
MjAbuz/foundation | lib/precompilers.py | 1 | 1083 | from compressor.filters.base import CompilerFilter
from compressor.filters.css_default import CssAbsoluteFilter
from compressor.utils import staticfiles
class CustomCssAbsoluteFilter(CssAbsoluteFilter):
def find(self, basename):
# This is the same as the inherited implementation except for the
# r... | mit |
bakhtout/odoo-educ | addons/product_margin/product_margin.py | 194 | 8823 | # -*- 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 |
n-west/gnuradio | gr-vocoder/python/vocoder/__init__.py | 57 | 1132 | #
# Copyright 2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
#... | gpl-3.0 |
persandstrom/home-assistant | tests/helpers/test_location.py | 3 | 1918 | """Tests Home Assistant location helpers."""
import unittest
from homeassistant.const import ATTR_LATITUDE, ATTR_LONGITUDE
from homeassistant.core import State
from homeassistant.helpers import location
class TestHelpersLocation(unittest.TestCase):
"""Set up the tests."""
def test_has_location_with_invalid_... | apache-2.0 |
mwx1993/TACTIC | src/tactic/ui/table/foreign_key_element_wdg.py | 6 | 4048 | ###########################################################
#
# Copyright (c) 2005-2008, Southpaw Technology
# All Rights Reserved
#
# PROPRIETARY INFORMATION. This software is proprietary to
# Southpaw Technology, and is not to be reproduced, transmitted,
# or disclosed in any way without written ... | epl-1.0 |
alilotfi/django | django/core/files/images.py | 429 | 2428 | """
Utility functions for handling images.
Requires Pillow as you might imagine.
"""
import struct
import zlib
from django.core.files import File
class ImageFile(File):
"""
A mixin for use alongside django.core.files.base.File, which provides
additional features for dealing with images.
"""
def ... | bsd-3-clause |
nhejazi/scikit-learn | sklearn/externals/joblib/numpy_pickle.py | 56 | 23237 | """Utilities for fast persistence of big data, with optional compression."""
# Author: Gael Varoquaux <gael dot varoquaux at normalesup dot org>
# Copyright (c) 2009 Gael Varoquaux
# License: BSD Style, 3 clauses.
import pickle
import os
import sys
import warnings
try:
from pathlib import Path
except ImportError:... | bsd-3-clause |
igmhub/pyLyA | bin/picca_reduce_spall.py | 1 | 1252 | #!/usr/bin/env python3
from astropy.table import Table
import argparse
import numpy as np
parser = argparse.ArgumentParser()
parser.add_argument('--spall',
type=str,
required=True,
help='Path to spAll file')
parser.add_argument('--qso-catalog',
... | gpl-3.0 |
bfontaine/web-pp | pp/unidecode/x068.py | 252 | 4674 | data = (
'Zhi ', # 0x00
'Liu ', # 0x01
'Mei ', # 0x02
'Hoy ', # 0x03
'Rong ', # 0x04
'Zha ', # 0x05
'[?] ', # 0x06
'Biao ', # 0x07
'Zhan ', # 0x08
'Jie ', # 0x09
'Long ', # 0x0a
'Dong ', # 0x0b
'Lu ', # 0x0c
'Sayng ', # 0x0d
'Li ', # 0x0e
'Lan ', # 0x0f
'Yong ', # 0x10... | mit |
jscott1989/happening | src/events/tests/test_events.py | 2 | 2592 | """Test previous events page."""
from happening.tests import TestCase
from model_mommy import mommy
from datetime import datetime, timedelta
import pytz
class TestEvents(TestCase):
"""Test previous events page."""
def test_previous_events(self):
"""Test that previous events are listed correctly."""... | mit |
Acehaidrey/incubator-airflow | tests/providers/google/cloud/operators/test_translate.py | 7 | 2618 | #
# 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 |
ghxandsky/zstack-utility | zstacklib/zstacklib/utils/ip.py | 3 | 1487 | '''
@author: yyk
'''
class IpAddress(object):
'''
Help to save and compare IP Address.
'''
def __init__(self, ip):
self.ip_list = ip.split('.', 3)
self.ips = []
for item in self.ip_list:
if not item.isdigit():
raise Exception('%s is no... | apache-2.0 |
zenoss/ZenPacks.sodonnell.TransformReport | setup.py | 1 | 2871 | ################################
# These variables are overwritten by Zenoss when the ZenPack is exported
# or saved. Do not modify them directly here.
# NB: PACKAGES is deprecated
NAME = 'ZenPacks.sodonnell.TransformReport'
VERSION = '1.0'
AUTHOR = 'Steven O\'Donnell'
LICENSE = "GPLv2"
NAMESPACE_PACKAGES = ['ZenPacks... | gpl-2.0 |
dhimmel/networkx | networkx/algorithms/tests/test_link_prediction.py | 52 | 18877 | import math
from functools import partial
from nose.tools import *
import networkx as nx
def _test_func(G, ebunch, expected, predict_func, **kwargs):
result = predict_func(G, ebunch, **kwargs)
exp_dict = dict((tuple(sorted([u, v])), score) for u, v, score in expected)
res_dict = dict((tuple(sorted([u, v... | bsd-3-clause |
annegabrielle/secure_adhoc_network_ns-3 | ns3_source_code/ns-3.10/.waf-1.5.16-e6d03192b5ddfa5ef2c8d65308e48e42/wafadmin/Configure.py | 6 | 7794 | #! /usr/bin/env python
# encoding: utf-8
import os,shlex,sys,time
try:import cPickle
except ImportError:import pickle as cPickle
import Environment,Utils,Options,Logs
from Logs import warn
from Constants import*
try:
from urllib import request
except:
from urllib import urlopen
else:
urlopen=request.urlopen
conf_te... | gpl-2.0 |
rahul67/hue | desktop/core/ext-py/Django-1.6.10/tests/utils_tests/test_datetime_safe.py | 205 | 2079 | import unittest
from datetime import date as original_date, datetime as original_datetime
from django.utils.datetime_safe import date, datetime
class DatetimeTests(unittest.TestCase):
def setUp(self):
self.just_safe = (1900, 1, 1)
self.just_unsafe = (1899, 12, 31, 23, 59, 59)
self.really_... | apache-2.0 |
diogocs1/comps | web/addons/edi/models/__init__.py | 442 | 1116 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2011 OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GN... | apache-2.0 |
xsynergy510x/android_external_chromium_org | tools/cr/cr/commands/sync.py | 112 | 1871 | # 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.
"""A module for the sync command."""
import os.path
import cr
class SyncCommand(cr.Command):
"""The implementation of the sync command.
This command... | bsd-3-clause |
40223134/40223134w17 | static/Brython3.1.1-20150328-091302/Lib/site-packages/pygame/__init__.py | 603 | 6082 | ## pygame - Python Game Library
## Copyright (C) 2000-2001 Pete Shinners
##
## This library is free software; you can redistribute it and/or
## modify it under the terms of the GNU Library General Public
## License as published by the Free Software Foundation; either
## version 2 of the License, or (... | gpl-3.0 |
wtgme/labeldoc2vec | gensim/test/test_tfidfmodel.py | 18 | 3417 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2010 Radim Rehurek <radimrehurek@seznam.cz>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
Automated tests for checking transformation algorithms (the models package).
"""
import logging
import unittest
import os
import o... | lgpl-2.1 |
AlienVault-Engineering/service-manager | src/main/python/service_buddy/vcs/vcs.py | 1 | 5632 | import json
import os
import logging
from collections import OrderedDict
from Bitbucket import BitbucketVCSProvider
from service_buddy.service.loader import walk_service_map, safe_mkdir, ensure_app_directory_exists, \
ensure_service_directory_exists
from service_buddy.service.service import Service
from service_b... | apache-2.0 |
owlabs/incubator-airflow | tests/contrib/operators/test_gcs_to_gdrive.py | 1 | 6686 | # -*- 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 |
MisterTea/HyperNEAT | boost_1_57_0/libs/python/test/enum.py | 12 | 1840 | # Copyright David Abrahams 2004. Distributed under the Boost
# Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
'''
>>> from enum_ext import *
>>> identity(color.red) # in case of duplicated enums it always take the last enum
enum_ext.color... | bsd-3-clause |
DarthMaulware/EquationGroupLeaks | Leak #5 - Lost In Translation/windows/Resources/Dsz/PyScripts/Lib/dsz/version/__init__.py | 1 | 1874 | # uncompyle6 version 2.9.10
# Python bytecode 2.7 (62211)
# Decompiled from: Python 3.6.0b2 (default, Oct 11 2016, 05:27:10)
# [GCC 6.2.0 20161005]
# Embedded file name: __init__.py
import dsz
import dsz.version.checks
import dsz.version.checks.windows
import dsz.version.checks.unix
def _getenvvalue(name, addr):
... | unlicense |
mjirayu/edx-theme | node_modules/gulp-sass/node_modules/node-sass/node_modules/pangyp/gyp/pylib/gyp/generator/ninja.py | 372 | 89149 | # Copyright (c) 2013 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import copy
import hashlib
import json
import multiprocessing
import os.path
import re
import signal
import subprocess
import sys
import gyp
import gyp.common
impo... | apache-2.0 |
m-kuhn/QGIS | python/plugins/processing/algs/grass7/ext/r_mask_vect.py | 12 | 1940 | # -*- coding: utf-8 -*-
"""
***************************************************************************
r_mask_vect.py
--------------
Date : February 2016
Copyright : (C) 2016 by Médéric Ribreux
Email : medspx at medspx dot fr
******************************... | gpl-2.0 |
Varriount/Colliberation | libs/twisted/conch/test/test_text.py | 12 | 3557 | # -*- test-case-name: twisted.conch.test.test_text -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
from twisted.trial import unittest
from twisted.conch.insults import helper, text
A = text.attributes
class Serialization(unittest.TestCase):
def setUp(self):
self.attrs = helpe... | mit |
JulienMcJay/eclock | windows/Python27/Lib/site-packages/pywin32-218-py2.7-win32.egg/isapi/samples/redirector_asynch.py | 16 | 2772 | # This is a sample ISAPI extension written in Python.
# This is like the other 'redirector' samples, but uses asnch IO when writing
# back to the client (it does *not* use asynch io talking to the remote
# server!)
from isapi import isapicon, threaded_extension
import sys
import traceback
import urllib
# sys.isapidl... | gpl-2.0 |
xindus40223115/w16b_test | static/Brython3.1.3-20150514-095342/Lib/posix.py | 603 | 20904 | """This module provides access to operating system functionality that is
standardized by the C Standard and the POSIX standard (a thinly
disguised Unix interface). Refer to the library manual and
corresponding Unix manual entries for more information on calls."""
import datetime
from browser import window
def _rand... | gpl-3.0 |
40423130/test | pelicanconf.py | 1 | 1957 | #!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
AUTHOR = 'KMOL'
SITENAME = '2017 協同產品設計實習 設計二甲 張勝雄'
# 不要用文章所在目錄作為類別
USE_FOLDER_AS_CATEGORY = False
#PATH = 'content'
#OUTPUT_PATH = 'output'
TIMEZONE = 'Asia/Taipei'
DEFAULT_LANG = 'en'
# Feed generation is usually not desired... | agpl-3.0 |
hitsthings/node-gyp | gyp/pylib/gyp/easy_xml.py | 1049 | 4803 | # Copyright (c) 2011 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import re
import os
def XmlToString(content, encoding='utf-8', pretty=False):
""" Writes the XML content to disk, touching the file only if it has changed.
... | mit |
crakensio/django_training | lib/python2.7/site-packages/docutils/utils/error_reporting.py | 104 | 7765 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# :Id: $Id: error_reporting.py 7668 2013-06-04 12:46:30Z milde $
# :Copyright: © 2011 Günter Milde.
# :License: Released under the terms of the `2-Clause BSD license`_, in short:
#
# Copying and distribution of this file, with or without modification,
# are permitted... | cc0-1.0 |
shitolepriya/Saloon_erp | erpnext/accounts/report/gross_profit/gross_profit.py | 15 | 10248 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _, scrub
from frappe.utils import flt
def execute(filters=None):
if not filters: filters = {}
gross_profit_data = Gr... | agpl-3.0 |
Akasurde/ansible | test/support/integration/plugins/modules/ec2_ami_info.py | 38 | 9158 | #!/usr/bin/python
# Copyright: Ansible Project
# 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': ['preview'],
... | gpl-3.0 |
volam2/support-tools | wiki_to_md/impl/constants.py | 151 | 6658 | # Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | apache-2.0 |
edcast-inc/edx-platform-edcast | lms/djangoapps/course_structure_api/v0/views.py | 19 | 27873 | """ API implementation for course-oriented interactions. """
from collections import namedtuple
import json
import logging
from django.conf import settings
from django.http import Http404
from rest_framework.authentication import OAuth2Authentication, SessionAuthentication
from rest_framework.exceptions import Authen... | agpl-3.0 |
krishna-pandey-git/django | tests/utils_tests/test_numberformat.py | 307 | 4049 | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals
from decimal import Decimal
from sys import float_info
from unittest import TestCase
from django.utils.numberformat import format as nformat
class TestNumberFormat(TestCase):
def test_format_number(self):
self.assertEqual(nformat(1234, '... | bsd-3-clause |
anilmuthineni/tensorflow | tensorflow/contrib/factorization/python/ops/gmm.py | 11 | 12252 | # 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 |
njmube/erpnext | erpnext/hr/doctype/upload_attendance/upload_attendance.py | 14 | 4441 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import cstr, add_days, date_diff
from frappe import _
from frappe.uti... | agpl-3.0 |
jolyonb/edx-platform | lms/djangoapps/shoppingcart/reports.py | 18 | 10759 | """ Objects and functions related to generating CSV reports """
from decimal import Decimal
import unicodecsv
from django.utils.translation import ugettext as _
from six import text_type
from course_modes.models import CourseMode
from courseware.courses import get_course_by_id
from shoppingcart.models import Certifi... | agpl-3.0 |
pillip8282/TizenRT | build/tools/esp32/partiton_table/parttool.py | 10 | 5184 | ###########################################################################
#
# Copyright 2019 Samsung Electronics 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
#
# ... | apache-2.0 |
oeeagle/quantum | neutron/plugins/nicira/dhcp_meta/nvp.py | 2 | 28330 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 VMware, 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/lic... | apache-2.0 |
nagyistoce/edx-platform | common/djangoapps/util/memcache.py | 251 | 1344 | """
This module provides a KEY_FUNCTION suitable for use with a memcache backend
so that we can cache any keys, not just ones that memcache would ordinarily accept
"""
from django.utils.encoding import smart_str
import hashlib
import urllib
def fasthash(string):
"""
Hashes `string` into a string representatio... | agpl-3.0 |
jaredhasenklein/the-blue-alliance | tests/test_match_cleanup.py | 5 | 2248 | import unittest2
from google.appengine.ext import ndb
from google.appengine.ext import testbed
from helpers.match_helper import MatchHelper
from datafeeds.offseason_matches_parser import OffseasonMatchesParser
from models.event import Event
from models.match import Match
class TestMatchCleanup(unittest2.TestCase):
... | mit |
broesamle/servo | tests/wpt/web-platform-tests/tools/pytest/_pytest/nose.py | 228 | 2527 | """ run test suites written for nose. """
import sys
import py
import pytest
from _pytest import unittest
def get_skip_exceptions():
skip_classes = set()
for module_name in ('unittest', 'unittest2', 'nose'):
mod = sys.modules.get(module_name)
if hasattr(mod, 'SkipTest'):
skip_cla... | mpl-2.0 |
tareqalayan/ansible | test/sanity/pylint/plugins/string_format.py | 72 | 2998 | # (c) 2018, Matt Martz <matt@sivel.net>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import sys
import six
import astroid
from pylint.interfaces import IAstr... | gpl-3.0 |
CospanDesign/nysa-verilog | verilog/generic/test/block_fifo/test_dut.py | 1 | 4059 | import os
import sys
import cocotb
import logging
from cocotb.result import TestFailure
from cocotb.clock import Clock
import time
from array import array as Array
from cocotb.triggers import Timer, FallingEdge, ReadWrite, NextTimeStep
from block_fifo_driver import BlockFIFOWritePath
from block_fifo_driver import Bloc... | mit |
whosea/android-Ultra-Pull-To-Refresh | update-project.py | 34 | 1047 | import os
vars = {
'ptr_lib_version': '1.0.11',
'ptr_lib_stable_version': '1.0.11',
'cube_sdk_version': '1.0.44.39-SNAPSHOT'
}
files = [
'README.md',
'README-cn.md',
'ptr-lib/pom.xml',
'ptr-lib/gradle.properties',
'ptr-demo/pom.xml',
'ptr-... | mit |
rosmo/ansible | test/units/modules/network/f5/test_bigip_device_httpd.py | 14 | 9670 | # -*- coding: utf-8 -*-
#
# Copyright: (c) 2017, F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import json
import pytest
import sys
if sys.version_info < (2... | gpl-3.0 |
tuskar/tuskar-ui | openstack_dashboard/dashboards/infrastructure/resource_management/resource_classes/forms.py | 1 | 1766 | from django.core.urlresolvers import reverse
from django.utils.translation import ugettext_lazy as _
from horizon import exceptions
from horizon import forms
from horizon import messages
from openstack_dashboard import api
import logging
LOG = logging.getLogger(__name__)
class DeleteForm(forms.SelfHandlingForm):
... | apache-2.0 |
mensler/ansible | lib/ansible/modules/cloud/amazon/ec2_vpc_net.py | 72 | 10280 | #!/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 distributed... | gpl-3.0 |
ruilin/RLMap | tools/python/booking_hotels.py | 8 | 9531 | #!/usr/bin/env python
# coding: utf8
from __future__ import print_function
from collections import defaultdict
from datetime import datetime
import argparse
import base64
import eviltransform
import json
import logging
import os
import pickle
import time
import urllib2
# Initialize logging.
logging.basicConfig(level=... | apache-2.0 |
ifduyue/sentry | tests/sentry/api/serializers/test_fields.py | 2 | 2845 | from __future__ import absolute_import
from rest_framework import serializers
from sentry.testutils import TestCase
from sentry.api.serializers.rest_framework import ListField, ActorField
from sentry.models import User, Team
class ChildSerializer(serializers.Serializer):
b_field = serializers.CharField(max_len... | bsd-3-clause |
HiroIshikawa/21playground | learning/venv/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/contrib/ntlmpool.py | 1010 | 4507 | """
NTLM authenticating pool, contributed by erikcederstran
Issue #10, see: http://code.google.com/p/urllib3/issues/detail?id=10
"""
try:
from http.client import HTTPSConnection
except ImportError:
from httplib import HTTPSConnection
from logging import getLogger
from ntlm import ntlm
from urllib3 import HTT... | mit |
felixma/nova | nova/objects/floating_ip.py | 13 | 10207 | # Copyright 2014 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 a... | apache-2.0 |
google-research/google-research | tunas/basic_specs_test.py | 1 | 1603 | # coding=utf-8
# Copyright 2021 The Google Research Authors.
#
# 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 applicab... | apache-2.0 |
Tangcuyu/perfectinfo | lib/socksd/node_modules/node-ninja/gyp/pylib/gyp/common_test.py | 2542 | 1970 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Unit tests for the common.py file."""
import gyp.common
import unittest
import sys
class TestTopologicallySorted(unittest.TestCase):
... | mit |
adrienbrault/home-assistant | homeassistant/components/iota/__init__.py | 5 | 1899 | """Support for IOTA wallets."""
from datetime import timedelta
from iota import Iota
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.discovery import load_platform
from homeassistant.helpers.entity import Entity
CONF_IRI = "iri"
CONF_TESTNET = "testnet"
CONF_W... | mit |
jasonzzz/ansible-modules-core | network/nxos/nxos_vrf_interface.py | 6 | 15234 | #!/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 |
jccaicedo/localization-agent | detection/rcnn/multiClassDetector.py | 1 | 2165 | import utils as cu
import libDetection as det
from dataProcessor import processData
import svmClassifier as svm
import latentSVM as lsvm
class Detector():
def __init__(self,models,threshold,maxOverlap):
self.models = models
self.threshold = threshold
self.maxOverlap = maxOverlap
def run(self,img,f... | mit |
michaelld/gnuradio | gr-utils/python/modtool/templates/gr-newmod/docs/doxygen/doxyxml/generated/compoundsuper.py | 23 | 360037 | #!/usr/bin/env python
#
# Generated Thu Jun 11 18:44:25 2009 by generateDS.py.
#
from __future__ import print_function
from __future__ import unicode_literals
import sys
from xml.dom import minidom
from xml.dom import Node
import six
#
# User methods
#
# Calls to the methods in these classes are generated by gen... | gpl-3.0 |
CGenie/solar | solar/solar/core/handlers/ansible_template.py | 1 | 2928 | # -*- coding: utf-8 -*-
from fabric import api as fabric_api
from fabric.state import env
import os
from solar.core.log import log
from solar.core.handlers.base import TempFileHandler
from solar import errors
# otherwise fabric will sys.exit(1) in case of errors
env.warn_only = True
# if we would have something lik... | apache-2.0 |
ManiacalLabs/BiblioPixelAnimations | BiblioPixelAnimations/matrix/spectrum/__init__.py | 2 | 5878 | from bibliopixel.animation.matrix import Matrix
from bibliopixel.util import log
from . system_eq import EQ
class BaseSpectrumDraw:
def __init__(self, anim):
self.anim = anim
self.width = anim.width
self.height = anim.height
self.led = anim._led
self.height_map... | mit |
NewpTone/stacklab-nova | nova/rootwrap/wrapper.py | 8 | 2407 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2011 OpenStack, LLC.
# 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... | apache-2.0 |
54lihaoxin/leetcode_python | src/InsertInterval/test_suite.py | 1 | 1759 |
import sys
from solution import Solution
from Interval import Interval
class TestSuite:
def run(self):
self.test000()
self.test001()
self.test002()
self.test003()
# self.test004()
def test000(self):
print 'test 000\n'
... | apache-2.0 |
throwable-one/lettuce | tests/integration/lib/Django-1.2.5/tests/regressiontests/null_fk/tests.py | 43 | 1868 | from django.test import TestCase
from regressiontests.null_fk.models import *
class NullFkTests(TestCase):
def test_null_fk(self):
d = SystemDetails.objects.create(details='First details')
s = SystemInfo.objects.create(system_name='First forum', system_details=d)
f = Forum.objects.create(... | gpl-3.0 |
FrankNagel/qlc | src/webapp/quanthistling/scripts/annotations/annotations_for_walton1997.py | 1 | 10830 | # -*- coding: utf8 -*-
import sys, os
sys.path.append(os.path.abspath('.'))
import re
from operator import attrgetter
import difflib
# Pylons model init sequence
import pylons.test
import logging
from quanthistling.config.environment import load_environment
from quanthistling.model.meta import Sessi... | gpl-3.0 |
nathangeffen/tbonline-2 | tbonlineproject/post/templatetags/posttags.py | 1 | 4695 | import re
import tagging.utils
from django import template
from django.contrib.contenttypes.models import ContentType
from django.contrib.comments.models import Comment
from tagging.models import Tag
from post.models import BasicPost, EditorChoice, PostWithImage, PostWithSimpleImage, PostWithSlideshow, PostWithEmbedd... | mit |
silence-star/z5_kernel | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py | 12527 | 1935 | # Util.py - Python extension for perf script, miscellaneous utility code
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
import errno, os
FUTEX_WAIT = 0... | gpl-2.0 |
jnayak1/osf.io | framework/auth/cas.py | 9 | 8386 | # -*- coding: utf-8 -*-
import furl
import json
import urllib
import requests
import httplib as http
from lxml import etree
from website import settings
from framework.auth import User
from framework.auth import authenticate
from framework.flask import redirect
from framework.exceptions import HTTPError
class CasEr... | apache-2.0 |
youprofit/shogun | tests/integration/python_modular/test_one.py | 21 | 2671 | #!/usr/bin/env python
"""
Test one data file
"""
from numpy import *
import sys
import kernel
import distance
import classifier
import clustering
import distribution
import regression
import preprocessor
from modshogun import Math_init_random
SUPPORTED=['kernel', 'distance', 'classifier', 'clustering', 'distribution... | gpl-3.0 |
baffolobill/mb_test_1 | src/mbtest1/erp_test/tests/test_baskets.py | 1 | 9806 | # coding: utf-8
"""
3.2 Пользователь может размещать корзины в юнитах
"""
from django.test import TestCase
from django.core.urlresolvers import reverse
from rest_framework import status
from rest_framework.test import APITestCase
from ..models import Basket, BasketSlot, Server, ServerTemplate, Rack
from ..exceptions im... | mit |
Nicop06/ansible | lib/ansible/modules/network/nxos/nxos_system.py | 18 | 11690 | #!/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 |
Kalyzee/edx-platform | openedx/core/djangoapps/content/course_structures/api/v0/tests_api.py | 80 | 5764 | """
Course Structure api.py tests
"""
from .api import course_structure
from openedx.core.djangoapps.content.course_structures.signals import listen_for_course_publish
from xmodule.modulestore.django import SignalHandler
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tes... | agpl-3.0 |
whitehorse-io/encarnia | evennia/evennia/server/models.py | 8 | 3456 | """
Server Configuration flags
This holds persistent server configuration flags.
Config values should usually be set through the
manager's conf() method.
"""
from builtins import object
try:
import cPickle as pickle
except ImportError:
import pickle
from django.db import models
from evennia.utils.idmapper... | mit |
sebastienhupin/qxrad | qooxdoo/tool/pylib/simplejson/jsonfilter.py | 178 | 1662 | import simplejson
import cgi
class JSONFilter(object):
def __init__(self, app, mime_type='text/x-json'):
self.app = app
self.mime_type = mime_type
def __call__(self, environ, start_response):
# Read JSON POST input to jsonfilter.json if matching mime type
response = {'status': ... | lgpl-3.0 |
arnavd96/Cinemiezer | myvenv/lib/python3.4/site-packages/django/core/management/commands/migrate.py | 12 | 14655 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import time
from collections import OrderedDict
from importlib import import_module
from django.apps import apps
from django.core.checks import Tags, run_checks
from django.core.management.base import BaseCommand, CommandError
from django.core.management... | mit |
MattsFleaMarket/python-for-android | python3-alpha/python3-src/Lib/test/test_traceback.py | 62 | 12604 | """Test cases for traceback module"""
from _testcapi import traceback_print, exception_print
from io import StringIO
import sys
import unittest
import re
from test.support import run_unittest, Error, captured_output
from test.support import TESTFN, unlink
import traceback
class SyntaxTracebackCases(unittest.TestCas... | apache-2.0 |
classmember/proof_of_concept | python/events/lib/python3.4/site-packages/pip/_vendor/chardet/universaldetector.py | 244 | 12485 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | mit |
aachik/flask-blog-abdulmx | env/lib/python2.7/site-packages/jinja2/ext.py | 603 | 25078 | # -*- coding: utf-8 -*-
"""
jinja2.ext
~~~~~~~~~~
Jinja extensions allow to add custom tags similar to the way django custom
tags work. By default two example extensions exist: an i18n and a cache
extension.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD.
"""
from jinja2 import nod... | mit |
gw0/rs-skip-gram-in-myhdl | WordContextProduct.py | 1 | 6689 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# pylint: disable=C0103,W0621
"""
Word-context embeddings product model needed for skip-gram training.
"""
__author__ = "GW [http://gw.tnode.com/] <gw.2015@tnode.com>"
__license__ = "GPLv3+"
from myhdl import Signal, ConcatSignal, intbv, fixbv, delay, always, always_comb, ... | agpl-3.0 |
caveman-dick/ansible | lib/ansible/module_utils/facts/collector.py | 12 | 10433 | # 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.