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 |
|---|---|---|---|---|---|
yuanzhao/gpdb | src/test/tinc/tincrepo/mpp/lib/mpp_tl.py | 12 | 1154 | """
Copyright (c) 2004-Present Pivotal Software, Inc.
This program and the accompanying materials are made available under
the terms of the 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 |
ryanolson/couchdb-python | perftest.py | 7 | 1440 | """
Simple peformance tests.
"""
import sys
import time
import couchdb
def main():
print 'sys.version : %r' % (sys.version,)
print 'sys.platform : %r' % (sys.platform,)
tests = [create_doc, create_bulk_docs]
if len(sys.argv) > 1:
tests = [test for test in tests if test.__name__ in sys.argv... | bsd-3-clause |
kunalgrover05/Mediawiki-pagelang | maintenance/language/zhtable/Makefile.py | 63 | 14541 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @author Philip
import tarfile as tf
import zipfile as zf
import os, re, shutil, sys, platform
pyversion = platform.python_version()
islinux = platform.system().lower() == 'linux'
if pyversion[:3] in ['2.6', '2.7']:
import urllib as urllib_request
import codecs
... | gpl-2.0 |
with-git/tensorflow | tensorflow/python/eager/benchmarks_test.py | 5 | 4874 | # 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 |
rest-of/the-deck | lambda/lib/python2.7/site-packages/pip/_vendor/progress/counter.py | 510 | 1502 | # -*- coding: utf-8 -*-
# Copyright (c) 2012 Giorgos Verigakis <verigak@gmail.com>
#
# Permission to use, copy, modify, and distribute this software 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 P... | mit |
hzy001/ansible | lib/ansible/plugins/callback/hipchat.py | 101 | 5867 | # (C) 2014, Matt Martz <matt@sivel.net>
# 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.
#
#... | gpl-3.0 |
tianyang-li/de-novo-rna-seq-quant-1 | util/trinity_0.py | 1 | 3040 | #!/usr/bin/env python
# Copyright (C) 2012 Tianyang Li
# tmy1018@gmail.com
#
# 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 lat... | gpl-3.0 |
sawenzel/root | interpreter/llvm/src/utils/lint/common_lint.py | 147 | 2589 | #!/usr/bin/python
#
# Common lint functions applicable to multiple types of files.
import re
def VerifyLineLength(filename, lines, max_length):
"""Checks to make sure the file has no lines with lines exceeding the length
limit.
Args:
filename: the file under consideration as string
lines: contents of t... | lgpl-2.1 |
toshywoshy/ansible | lib/ansible/module_utils/aws/iam.py | 60 | 2118 | # Copyright (c) 2017 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
import traceback
try:
from botocore.exceptions import ClientError, NoCredentialsError
except Im... | gpl-3.0 |
GreenRecycleBin/servo | tests/wpt/web-platform-tests/tools/html5lib/setup.py | 418 | 1694 | from distutils.core import setup
import os
import codecs
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Pyt... | mpl-2.0 |
chadoe/xbmc | addons/service.xbmc.versioncheck/service.py | 58 | 3959 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 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 3 of the License, or
# (at your option... | gpl-2.0 |
mancoast/CPythonPyc_test | fail/300_test_httpservers.py | 3 | 11640 | """Unittests for the various HTTPServer modules.
Written by Cody A.W. Somerville <cody-somerville@ubuntu.com>,
Josip Dzolonga, and Michael Otteneder for the 2007/08 GHOP contest.
"""
from http.server import BaseHTTPRequestHandler, HTTPServer, \
SimpleHTTPRequestHandler, CGIHTTPRequestHandler
import os
import sy... | gpl-3.0 |
mrquim/repository.mrquim | repo/script.module.pycryptodome/lib/Crypto/SelfTest/Protocol/test_KDF.py | 5 | 16508 | # -*- coding: utf-8 -*-
#
# SelfTest/Protocol/test_KDF.py: Self-test for key derivation functions
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedication to the public domain is not available,
# everyone is... | gpl-2.0 |
dllsf/odootest | addons/crm_partner_assign/wizard/crm_forward_to_partner.py | 377 | 10606 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... | agpl-3.0 |
rockyzhang/zhangyanhit-python-for-android-mips | python-modules/twisted/twisted/test/test_abstract.py | 61 | 2546 | # Copyright (c) 2007 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for generic file descriptor based reactor support code.
"""
from twisted.trial.unittest import TestCase
from twisted.internet.abstract import isIPAddress
class AddressTests(TestCase):
"""
Tests for address-related functi... | apache-2.0 |
mylene-campana/hpp-rbprm-corba | script/tests/hrp2_city1_path.py | 1 | 9565 | #/usr/bin/env python
# author: Mylene Campana (mcampana@laas.fr)
# Script which goes with hpp-rbprm-corba package.
# The script launches a skeleton-robot and a groundcrouch environment.
# It defines init and final configs, and solve them with RBPRM.
# Range Of Motions are spheres linked to the 4 end-effectors
#blender... | lgpl-3.0 |
Weihonghao/ECM | Vpy34/lib/python3.5/site-packages/pandas/compat/numpy/__init__.py | 3 | 2213 | """ support numpy compatiblitiy across versions """
import re
import numpy as np
from distutils.version import LooseVersion
from pandas.compat import string_types, string_and_binary_types
# numpy versioning
_np_version = np.__version__
_nlv = LooseVersion(_np_version)
_np_version_under1p8 = _nlv < '1.8'
_np_version_... | agpl-3.0 |
bukzor/sympy | sympy/matrices/expressions/tests/test_trace.py | 83 | 2693 | from sympy.core import Lambda, S, symbols
from sympy.concrete import Sum
from sympy.functions import adjoint, conjugate, transpose
from sympy.matrices import eye, Matrix, ShapeError, ImmutableMatrix
from sympy.matrices.expressions import (
Adjoint, Identity, FunctionMatrix, MatrixExpr, MatrixSymbol, Trace,
Zero... | bsd-3-clause |
adit-chandra/tensorflow | tensorflow/lite/testing/op_tests/tile.py | 4 | 2453 | # 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 |
dpinney/omf | omf/solvers/VB.py | 1 | 29740 | import pandas as pd
import pulp
import numpy as np
from numpy import *
class VirtualBattery(object):
""" Base class for abstraction. """
def __init__(self, ambient_temp, capacitance, resistance, rated_power, COP, deadband, setpoint, tcl_number):
# C :thermal capacitance
# R : thermal resistance... | gpl-2.0 |
ablavatski/draw | tests/test_attention.py | 7 | 4359 |
import unittest
import theano
import numpy as np
from theano import tensor as T
from draw.attention import *
floatX = theano.config.floatX
def test_batched_dot():
a = T.ftensor3('a')
b = T.ftensor3('b')
c = my_batched_dot(a, b)
# Test in with values
dim1, dim2, dim3, dim4 = 10, 12, 15, 20
... | mit |
raccoongang/socraticqs2 | mysite/lti/tests.py | 1 | 21256 | # coding=utf-8
import json
import oauth2
from datetime import date, timedelta
import unittest
from mock import patch, Mock
from ddt import ddt, data, unpack
from django.utils import timezone
from django.test import TestCase, Client
from django.contrib.auth.models import User
from django.core.urlresolvers import rever... | apache-2.0 |
lkhomenk/integration_tests | cfme/automate/dialogs/service_dialogs.py | 6 | 4707 | import attr
from cached_property import cached_property
from navmazing import NavigateToAttribute, NavigateToSibling
from widgetastic.utils import Fillable
from widgetastic.widget import Text
from widgetastic_patternfly import CandidateNotFound
from cfme.exceptions import ItemNotFound
from cfme.modeling.base import Ba... | gpl-2.0 |
samhoo/askbot-realworld | askbot/migrations/0044_migrate_has_custom_avatar_field.py | 20 | 27460 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
from askbot.utils.console import print_action
from unidecode import unidecode
class Migration(DataMigration):
def forwards(self, orm):
"Write your forwards methods here."
print... | gpl-3.0 |
gentledevil/ansible | lib/ansible/plugins/action/include_vars.py | 82 | 1853 | # (c) 2013-2014, Benno Joy <benno@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, either version 3 of the License, or
# (at your option) any later vers... | gpl-3.0 |
dga4654dan/UTM-Demo | V_1_0_2_1/UtmDemo_Sfs_2.9.0/UtmDemo_Sfs_2.9.0_Server/lib/Lib/test/test_bisect.py | 15 | 5533 | from test_support import TestFailed
import bisect
import sys
nerrors = 0
def check_bisect(func, list, elt, expected):
global nerrors
got = func(list, elt)
if got != expected:
print >> sys.stderr, \
"expected %s(%s, %s) -> %s, but got %s" % (func.__name__,
... | gpl-2.0 |
hogarthj/ansible | test/units/parsing/utils/test_yaml.py | 159 | 1176 | # -*- coding: utf-8 -*-
# (c) 2017, Ansible Project
#
# 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... | gpl-3.0 |
bala4901/odoo | addons/website/models/test_models.py | 56 | 1285 | # -*- coding: utf-8 -*-
from openerp.osv import orm, fields
class test_converter(orm.Model):
_name = 'website.converter.test'
_columns = {
'char': fields.char(),
'integer': fields.integer(),
'float': fields.float(),
'numeric': fields.float(digits=(16, 2)),
'many2one': f... | agpl-3.0 |
2uller/LotF | App/Tools/Scripts/texcheck.py | 12 | 9489 | """ TeXcheck.py -- rough syntax checking on Python style LaTeX documents.
Written by Raymond D. Hettinger <python at rcn.com>
Copyright (c) 2003 Python Software Foundation. All rights reserved.
Designed to catch common markup errors including:
* Unbalanced or mismatched parenthesis, brackets, and braces.... | gpl-2.0 |
xor10/adsbypasser | deploy/mirrors/summary.py | 5 | 4293 | import re
import sys
from markdown.blockprocessors import BlockProcessor
from markdown.preprocessors import Preprocessor
from markdown.preprocessors import ReferencePreprocessor
from markdown.extensions import Extension
from markdown import markdown
from util import to_abs_path
_CHANGELOG_PATH = to_abs_path('../../... | bsd-2-clause |
wbrefvem/openshift-ansible | playbooks/common/openshift-cluster/upgrades/library/openshift_upgrade_config.py | 35 | 5312 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""Ansible module for modifying OpenShift configs during an upgrade"""
import os
import yaml
DOCUMENTATION = '''
---
module: openshift_upgrade_config
short_description: OpenShift Upgrade Config
author: Jason DeTiberus
requirements: [ ]
'''
EXAMPLES = '''
'''
def modify_api_... | apache-2.0 |
etkirsch/scikit-learn | sklearn/datasets/species_distributions.py | 198 | 7923 | """
=============================
Species distribution dataset
=============================
This dataset represents the geographic distribution of species.
The dataset is provided by Phillips et. al. (2006).
The two species are:
- `"Bradypus variegatus"
<http://www.iucnredlist.org/apps/redlist/details/3038/0>`_... | bsd-3-clause |
freddierice/volatility | volatility/plugins/linux/vma_cache.py | 58 | 2724 | # Volatility
# Copyright (C) 2007-2013 Volatility Foundation
#
# This file is part of Volatility.
#
# Volatility is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your o... | gpl-2.0 |
rrampage/rethinkdb | external/v8_3.30.33.16/buildtools/checkdeps/rules.py | 65 | 6692 | # Copyright 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.
"""Base classes to represent dependency rules, used by checkdeps.py"""
import os
import re
class Rule(object):
"""Specifies a single rule for an includ... | agpl-3.0 |
manthansharma/kivy | kivy/core/camera/__init__.py | 15 | 4285 | '''
Camera
======
Core class for acquiring the camera and converting its input into a
:class:`~kivy.graphics.texture.Texture`.
.. versionchanged:: 1.10.0
The pygst and videocapture providers have been removed.
.. versionchanged:: 1.8.0
There is now 2 distinct Gstreamer implementation: one using Gi/Gst
wo... | mit |
J-Rios/TelegramBots | MolaBot/TSjson.py | 1 | 10795 | # -*- coding: utf-8 -*-
'''
Script: MolaBot.py
Descripcion:
Bot de Telegram que gestiona todo un sistema de reputaciones de los usuarios pertenecientes a
un grupo. Permite a un usuario, dar "Likes" a los mensajes de otros, y el numero global de
"Likes" (la suma de todos los likes de todos los mensa... | gpl-3.0 |
powlo/script.module.pydevd | lib/test_pydevd_reload/test_pydevd_reload.py | 53 | 11450 | import os # @NoMove
import sys # @NoMove
sys.path.insert(0, os.path.realpath(os.path.abspath('..')))
import pydevd_reload
import tempfile
import unittest
SAMPLE_CODE = """
class C:
def foo(self):
return 0
@classmethod
def bar(cls):
return (0, 0)
@staticmethod
def stomp():
... | epl-1.0 |
smiller171/ansible-modules-core | system/service.py | 8 | 57233 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of... | gpl-3.0 |
ominux/scikit-learn | examples/cluster/plot_adjusted_for_chance_measures.py | 1 | 4105 | """
==========================================================
Adjustment for chance in clustering performance evaluation
==========================================================
The following plots demonstrate the impact of the number of clusters and
number of samples on various clustering performance evaluation me... | bsd-3-clause |
sugartom/tensorflow-alien | tensorflow/tensorboard/backend/event_processing/event_accumulator.py | 2 | 30610 | # 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 |
dongjoon-hyun/tensorflow | tensorflow/contrib/eager/python/examples/revnet/config.py | 28 | 6581 | # Copyright 2018 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 |
Crystalnix/BitPop | chrome/test/functional/autofill_dataset_generator.py | 11 | 9785 | #!/usr/bin/env python
# Copyright (c) 2011 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.
"""Generates profile dictionaries for Autofill.
Used to test autofill.AutofillTest.FormFillLatencyAfterSubmit.
Can be used as a st... | bsd-3-clause |
jakev/dtf | python-dtf/tests/unit/test_prop.py | 2 | 5430 | # Android Device Testing Framework ("dtf")
# Copyright 2013-2016 Jake Valletta (@jake_valletta)
#
# 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 |
krismcfarlin/todo_angular_endpoints_sockets | bp_includes/external/babel/messages/pofile.py | 54 | 16041 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2007 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 of v... | lgpl-3.0 |
yashsharan/sympy | sympy/matrices/expressions/tests/test_trace.py | 83 | 2693 | from sympy.core import Lambda, S, symbols
from sympy.concrete import Sum
from sympy.functions import adjoint, conjugate, transpose
from sympy.matrices import eye, Matrix, ShapeError, ImmutableMatrix
from sympy.matrices.expressions import (
Adjoint, Identity, FunctionMatrix, MatrixExpr, MatrixSymbol, Trace,
Zero... | bsd-3-clause |
Diaoul/Dobby | dobby/db.py | 1 | 1627 | # Copyright 2011 Antoine Bertin <diaoulael@gmail.com>
#
# This file is part of Dobby.
#
# Dobby 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 ... | lgpl-3.0 |
nomaro/SickBeard_Backup | lib/guessit/matcher.py | 40 | 6496 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# GuessIt - A library for guessing information from filenames
# Copyright (c) 2012 Nicolas Wack <wackou@gmail.com>
#
# GuessIt is free software; you can redistribute it and/or modify it under
# the terms of the Lesser GNU General Public License as published by
# the Free ... | gpl-3.0 |
markYoungH/chromium.src | third_party/closure_linter/closure_linter/errorrules.py | 124 | 2276 | #!/usr/bin/env python
#
# Copyright 2010 The Closure Linter 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
#... | bsd-3-clause |
ClovisIRex/Snake-django | env/lib/python3.6/site-packages/pylint/checkers/utils.py | 3 | 29753 | # Copyright (c) 2006-2007, 2009-2014 LOGILAB S.A. (Paris, FRANCE) <contact@logilab.fr>
# Copyright (c) 2012-2014 Google, Inc.
# Copyright (c) 2013-2016 Claudiu Popa <pcmanticore@gmail.com>
# Copyright (c) 2015 Radu Ciorba <radu@devrandom.ro>
# Copyright (c) 2015 Dmitry Pribysh <dmand@yandex.ru>
# Copyright (c) 2016 Ash... | mit |
getnikola/plugins | v7/localsearch/localsearch/__init__.py | 1 | 4350 | # -*- coding: utf-8 -*-
# Copyright Β© 2012-2014 Roberto Alsina and others.
# 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 t... | mit |
udxxabp/zulip | zerver/lib/event_queue.py | 115 | 29293 | from __future__ import absolute_import
from django.conf import settings
from django.utils.timezone import now
from collections import deque
import datetime
import os
import time
import socket
import logging
import ujson
import requests
import cPickle as pickle
import atexit
import sys
import signal
import tornado
impo... | apache-2.0 |
frenchfrywpepper/ansible-modules-extras | cloud/webfaction/webfaction_site.py | 62 | 6939 | #!/usr/bin/python
#
# Create Webfaction website using Ansible and the Webfaction API
#
# ------------------------------------------
#
# (c) Quentin Stafford-Fraser 2015
#
# 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 Lic... | gpl-3.0 |
jgao54/airflow | airflow/migrations/versions/a56c9515abdc_remove_dag_stat_table.py | 6 | 1581 | #
# 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 |
shintoo/DailyImage | getimage.py | 1 | 1515 | #!/usr/bin/python
# getimage.py - this file is part of dailyimage
# Retrieve an image from a google image search
import sys # argv
import re # finding images
import requests # downloading results and images
import bs4 # finding images
def get_image(query):
'''
function get_im... | mit |
jorik041/CrackMapExec | cme/modules/get_keystrokes.py | 1 | 4591 | from cme.helpers.powershell import *
from cme.helpers.misc import gen_random_string
from cme.servers.smb import CMESMBServer
from gevent import sleep
from sys import exit
import os
class CMEModule:
'''
Executes PowerSploit's Get-Keystrokes script
Module by @byt3bl33d3r
'''
name = 'get_keys... | bsd-2-clause |
foursquare/commons-old | src/python/twitter/common/log/formatters/plain.py | 16 | 1610 | # ==================================================================================================
# Copyright 2011 Twitter, Inc.
# --------------------------------------------------------------------------------------------------
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use thi... | apache-2.0 |
scootergrisen/virtaal | virtaal/views/langview.py | 6 | 8842 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2009-2011 Zuza Software Foundation
#
# This file is part of Virtaal.
#
# 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 ... | gpl-2.0 |
mshafiq9/django | tests/template_tests/filter_tests/test_truncatewords.py | 215 | 1705 | from django.template.defaultfilters import truncatewords
from django.test import SimpleTestCase
from django.utils.safestring import mark_safe
from ..utils import setup
class TruncatewordsTests(SimpleTestCase):
@setup({'truncatewords01':
'{% autoescape off %}{{ a|truncatewords:"2" }} {{ b|truncatewords:"... | bsd-3-clause |
simongoffin/my_odoo_tutorial | addons/analytic/analytic.py | 12 | 17961 | # -*- 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 |
liangly/hadoop-common | src/contrib/thriftfs/scripts/hdfs.py | 116 | 14991 | #!/usr/bin/env python
"""
hdfs.py is a python client for the thrift interface to HDFS.
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 |
gopal1cloud/neutron | neutron/tests/unit/test_common_log.py | 22 | 2943 | # Copyright (c) 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
#
# Unless required by applicable... | apache-2.0 |
lucafavatella/intellij-community | python/lib/Lib/encodings/utf_16_be.py | 860 | 1037 | """ Python 'utf-16-be' Codec
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""
import codecs
### Codec APIs
encode = codecs.utf_16_be_encode
def decode(input, errors='strict'):
return codecs.utf_16_be_decode(input, errors, True)
class IncrementalEncod... | apache-2.0 |
odb9402/OPPA | oppa/macs/archive.py | 1 | 5675 | """
this module is actual fix some parameter by using
bayesian optimization. if we run this function in parallel,
we need to satisfied many condition which mentioned in the paper
named 'practical bayesian optimization in machine learning algorithm'
"""
from math import exp
import subprocess
import time
from multiproces... | mit |
charlescearl/VirtualMesos | third_party/libprocess/third_party/gmock-1.6.0/gtest/test/gtest_color_test.py | 3259 | 4911 | #!/usr/bin/env python
#
# Copyright 2008, 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... | apache-2.0 |
joachimmetz/plaso | plaso/parsers/plist_plugins/safari.py | 2 | 3592 | # -*- coding: utf-8 -*-
"""Plist parser plugin for Safari history plist files."""
from dfdatetime import cocoa_time as dfdatetime_cocoa_time
from plaso.containers import events
from plaso.containers import time_events
from plaso.lib import definitions
from plaso.parsers import plist
from plaso.parsers.plist_plugins i... | apache-2.0 |
Valka7a/python-playground | python-course-softuni/introduction-python3/lecture-one-excercises/ex7.py | 1 | 1947 | import turtle
# Get user's input
board_size = input('Enter bord size: ')
# Validate user's input
try:
board_size = int(board_size)
if board_size < 8:
raise Exception('Board size cannot be less then 8.')
except ValueError:
print('Invalid input!')
exit()
except Exception as error:
print(er... | mit |
subramani95/neutron | neutron/plugins/ml2/driver_context.py | 6 | 4610 | # Copyright (c) 2013 OpenStack Foundation
# 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 ... | apache-2.0 |
montoyjh/pymatgen | pymatgen/io/xyz.py | 5 | 4144 | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
import re
from pymatgen.core.structure import Molecule
from monty.io import zopen
"""
Module implementing an XYZ file object class.
"""
__author__ = "Shyue Ping Ong"
__copyright__ = "Copyright 2012, The Mate... | mit |
jpippy/pyo | pyolib/controls.py | 5 | 24741 | """
Objects designed to create parameter's control at audio rate.
These objects can be used to create envelopes, line segments
and conversion from python number to audio signal.
The audio streams of these objects can't be sent to the output
soundcard.
"""
"""
Copyright 2009-2015 Olivier Belanger
This file is part ... | gpl-3.0 |
kootenpv/yagmail | setup.py | 1 | 2037 | from setuptools import setup
from setuptools import find_packages
with open('README.rst') as f:
LONG_DESCRIPTION = f.read()
MAJOR_VERSION = '0'
MINOR_VERSION = '14'
MICRO_VERSION = '247'
VERSION = "{}.{}.{}".format(MAJOR_VERSION, MINOR_VERSION, MICRO_VERSION)
setup(
name='yagmail',
version=VERSION,
de... | mit |
jtyuan/racetrack | src/dev/sparc/T1000.py | 66 | 5810 | # Copyright (c) 2006-2007 The Regents of The University of Michigan
# 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 ... | bsd-3-clause |
NadaBayoumy/DjangoPythonBlog | Blog/BlogApp/forms.py | 1 | 2667 | #nada
from django import forms
from .models import Category
from .models import ForbiddenWords
from .models import Post
from django import forms
#end nada
#alem
from .models import Post, Reply
#end alem
#hossam
from django import forms
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.m... | gpl-2.0 |
bravo-zhang/spark | python/pyspark/mllib/__init__.py | 123 | 1412 | #
# 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 |
RetailMeNotSandbox/dart | src/python/dart/client/python/examples/datasets/owen_outclick_us_v02.py | 1 | 14227 | from dart.client.python.dart_client import Dart
from dart.model.dataset import Column, DatasetData, Dataset, DataFormat, FileFormat, RowFormat, DataType, Compression, \
LoadType
if __name__ == '__main__':
dart = Dart('localhost', 5000)
assert isinstance(dart, Dart)
dataset = dart.save_dataset(Dataset(... | mit |
AthinaB/synnefo | snf-cyclades-app/synnefo/api/flavors.py | 9 | 3419 | # 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 |
Doteveryone/BetterJobAdverts | jobcert/filters.py | 1 | 1556 | from jobcert import app
@app.template_filter('readability_words')
def readability_words_filter(s):
score = int(s)
if score in range(90, 100):
return "Very Easy"
elif score in range(80, 89):
return "Easy"
elif score in range(70, 79):
return "Fairly Easy"
elif score in range (... | agpl-3.0 |
gwu-libraries/sfm-ui | sfm/ui/migrations/0021_auto_20180712_1310.py | 2 | 10258 | # Generated by Django 2.0.7 on 2018-07-12 17:10
import django.contrib.auth.validators
from django.db import migrations, models
import jsonfield.fields
class Migration(migrations.Migration):
dependencies = [
('ui', '0020_auto_20180608_1144'),
]
operations = [
migrations.AddField(
... | mit |
City-of-Helsinki/kuulemma | kuulemma/migrations/versions/14051cff79e_rename_hearing_section_to_alternative.py | 2 | 4084 | # -*- coding: utf-8 -*-
# Kuulemma
# Copyright (C) 2014, Fast Monkeys Oy
#
# This program 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 option) any later... | agpl-3.0 |
MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-3.0/Lib/test/test_userdict.py | 2 | 6470 | # Check every path through every method of UserDict
from test import support, mapping_tests
import collections
d0 = {}
d1 = {"one": 1}
d2 = {"one": 1, "two": 2}
d3 = {"one": 1, "two": 3, "three": 5}
d4 = {"one": None, "two": None}
d5 = {"one": 1, "two": 1}
class UserDictTest(mapping_tests.TestHashMappingProtocol):
... | mit |
PatKayongo/patkayongo.github.io | node_modules/pygmentize-bundled/vendor/pygments/build-3.3/pygments/formatters/img.py | 94 | 18053 | # -*- coding: utf-8 -*-
"""
pygments.formatters.img
~~~~~~~~~~~~~~~~~~~~~~~
Formatter for Pixmap output.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import sys
from pygments.formatter import Formatter
from pygments.util import ge... | mit |
sqlalchemy/sqlalchemy | lib/sqlalchemy/ext/orderinglist.py | 3 | 13875 | # ext/orderinglist.py
# Copyright (C) 2005-2021 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""A custom list that manages index/position information for contained
elements... | mit |
mfherbst/spack | var/spack/repos/builtin/packages/r-plotly/package.py | 5 | 2533 | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 |
dllsf/odootest | addons/account/report/account_partner_ledger.py | 81 | 13063 | # -*- 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 |
avdi/rust | src/etc/generate-keyword-tests.py | 53 | 1985 | #!/usr/bin/env python
#
# Copyright 2013 The Rust Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution and at
# http://rust-lang.org/COPYRIGHT.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
#... | apache-2.0 |
hungtt57/matchmaker | lib/python2.7/site-packages/django/db/backends/mysql/base.py | 103 | 15969 | """
MySQL database backend for Django.
Requires mysqlclient: https://pypi.python.org/pypi/mysqlclient/
MySQLdb is supported for Python 2 only: http://sourceforge.net/projects/mysql-python
"""
from __future__ import unicode_literals
import datetime
import re
import sys
import warnings
from django.conf import settings... | mit |
anas-taji/sale-workflow | sale_sourced_by_line/model/sale.py | 33 | 2963 | # -*- coding: utf-8 -*-
#
#
# Author: Guewen Baconnier, Yannick Vaucher
# Copyright 2013-2015 Camptocamp SA
#
# This program 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... | agpl-3.0 |
blitzmann/Pyfa | eos/utils/stats.py | 1 | 2381 | # ===============================================================================
# Copyright (C) 2010 Diego Duclos
#
# This file is part of eos.
#
# eos 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, ... | gpl-3.0 |
chrisdew/pyparsing-autocomplete | examples/urlExtractor.py | 16 | 1749 | # URL extractor
# Copyright 2004, Paul McGuire
from pyparsing import Literal,Suppress,CharsNotIn,CaselessLiteral,\
Word,dblQuotedString,alphanums,SkipTo
import urllib
import pprint
# Define the pyparsing grammar for a URL, that is:
# URLlink ::= <a href= URL>linkText</a>
# URL ::= doubleQuotedSt... | mit |
lidavidm/sympy | sympy/core/tests/test_expr.py | 3 | 54640 | from __future__ import division
from sympy import (Add, Basic, S, Symbol, Wild, Float, Integer, Rational, I,
sin, cos, tan, exp, log, nan, oo, sqrt, symbols, Integral, sympify,
WildFunction, Poly, Function, Derivative, Number, pi, NumberSymbol, zoo,
Piecewise, Mul, Pow, nsimplify, ratsimp, trigsimp, radsim... | bsd-3-clause |
nlalevee/spark | python/pyspark/ml/tuning.py | 6 | 26126 | #
# 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 |
antonve/s4-project-mooc | common/lib/xmodule/xmodule/tests/test_course_module.py | 2 | 15329 | import unittest
from datetime import datetime, timedelta
from fs.memoryfs import MemoryFS
from mock import Mock, patch
import itertools
from xblock.runtime import KvsFieldData, DictKeyValueStore
import xmodule.course_module
from xmodule.modulestore.xml import ImportSystem, XMLModuleStore
from opaque_keys.edx.locati... | agpl-3.0 |
gnychis/gnuradio-3.5.0-dmr | gnuradio-core/src/python/gnuradio/gr/qa_fsk_stuff.py | 11 | 2664 | #!/usr/bin/env python
#
# Copyright 2004,2007,2010 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 you... | gpl-3.0 |
pawaranand/phr-frappe | frappe/website/template.py | 16 | 2988 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import strip_html
from frappe.website.utils import scrub_relative_urls
from jinja2.utils import concat
from jinja2 import meta
import re
def r... | mit |
percyfal/snakemakelib-core | snakemakelib/plot/bokeh/color.py | 1 | 1126 | # Copyright (C) 2015 by Per Unneberg
import math
import pandas.core.common as com
from bokeh.palettes import brewer as bokeh_brewer
from .palettes import brewer as snakemakelib_brewer
import logging
logger = logging.getLogger(__name__)
MINSIZE = 3
MAXSIZE = 9 # FIXME: some palettes have 9 as max, some 11
brewer = b... | mit |
jacinda/ant | playgame.py | 1 | 20674 | #!/usr/bin/env python
from __future__ import print_function
import traceback
import sys
import os
import time
from optparse import OptionParser, OptionGroup
import random
import cProfile
import visualizer.visualize_locally
import json
try:
from StringIO import StringIO
except ImportError:
from io import StringI... | gpl-2.0 |
jjas0nn/solvem | tensorflow/lib/python2.7/site-packages/google/protobuf/internal/symbol_database_test.py | 43 | 5386 | #! /usr/bin/env python
#
# Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# https://developers.google.com/protocol-buffers/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions ... | mit |
Nowheresly/odoo | openerp/addons/base/ir/ir_logging.py | 326 | 1882 | ##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2014 OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Publi... | agpl-3.0 |
sakura-internet/saklient.python | saklient/errors/exceptionfactory.py | 1 | 32200 | # -*- coding:utf-8 -*-
# This code is automatically transpiled by Saklient Translator
import six
from .httpexception import HttpException
from .httpbadgatewayexception import HttpBadGatewayException
from .httpbadrequestexception import HttpBadRequestException
from .httpconflictexception import HttpConflictException
f... | mit |
ankurjimmy/catawampus | tr/download.py | 5 | 18628 | #!/usr/bin/python
# Copyright 2011 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 appli... | apache-2.0 |
guorendong/iridium-browser-ubuntu | third_party/skia/tools/bench_pictures_cfg_helper.py | 44 | 3148 | # 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.
""" Helper functions to be used in bench_pictures.cfg. """
def Config(**kwargs):
config = {}
for key in kwargs:
config[key] = kwargs[key]
re... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.