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 |
|---|---|---|---|---|---|
PatrickOReilly/scikit-learn | sklearn/externals/odict.py | 55 | 9148 | # Backport of OrderedDict() class that runs on Python 2.4, 2.5, 2.6, 2.7 and pypy.
# Passes Python2.7's test suite and incorporates all the latest updates.
# Copyright 2009 Raymond Hettinger
# http://code.activestate.com/recipes/576693/
"Ordered dictionary"
try:
from thread import get_ident as _get_ident
except Im... | bsd-3-clause |
luistorresm/odoo | addons/hr_timesheet_invoice/report/report_analytic.py | 299 | 5164 | # -*- 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... | agpl-3.0 |
luceatnobis/youtube-dl | youtube_dl/extractor/noz.py | 64 | 3665 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import (
compat_urllib_parse_unquote,
compat_xpath,
)
from ..utils import (
int_or_none,
find_xpath_attr,
xpath_text,
update_url_query,
)
class NozIE(InfoExtractor):
_VALID_URL = r'http... | unlicense |
heathweiss/lineScanner | sqliteDB.py | 1 | 1714 | import sqlite3
#conn = sqlite3.connect('lineScanner.db')
#c = conn.cursor()
def sayHello():
print "hello from sqlite"
def getLayers(c):
c.execute("select * from layer")
return (c.fetchall())
def printLayers(layers):
print layers
def insertLayer(layerName, x, y, z, conn, c):
try:
myId = getNextLayerI... | mit |
anas-taji/sale-workflow | sale_start_end_dates/__init__.py | 31 | 1062 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Sale Start End Dates module for Odoo
# Copyright (C) 2014-2015 Akretion (http://www.akretion.com)
# @author Alexis de Lattre <alexis.delattre@akretion.com>
#
# This program is free software: you can ... | agpl-3.0 |
Jgarcia-IAS/localizacion | openerp/addons/account_cancel/__openerp__.py | 261 | 1621 | # -*- 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 |
JanDintel/ansible | lib/ansible/plugins/lookup/password.py | 58 | 6200 | # (c) 2012, Daniel Hokka Zakrisson <daniel@hozac.com>
# (c) 2013, Javier Candeira <javier@candeira.com>
# (c) 2013, Maykel Moya <mmoya@speedyrails.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... | gpl-3.0 |
chshu/openthread | tests/scripts/thread-cert/v1_2_test_multicast_registration.py | 7 | 13827 | #!/usr/bin/env python3
#
# Copyright (c) 2020, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# ... | bsd-3-clause |
gautam1858/tensorflow | tensorflow/contrib/distribute/python/keras_backward_compat_test.py | 3 | 41099 | # 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 |
utke1/numpy | numpy/distutils/fcompiler/lahey.py | 229 | 1438 | from __future__ import division, absolute_import, print_function
import os
from numpy.distutils.fcompiler import FCompiler
compilers = ['LaheyFCompiler']
class LaheyFCompiler(FCompiler):
compiler_type = 'lahey'
description = 'Lahey/Fujitsu Fortran 95 Compiler'
version_pattern = r'Lahey/Fujitsu Fortran... | bsd-3-clause |
Ander-Alvarez/UltraKernel | scripts/tracing/draw_functrace.py | 14676 | 3560 | #!/usr/bin/python
"""
Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com>
Licensed under the terms of the GNU GPL License version 2
This script parses a trace provided by the function tracer in
kernel/trace/trace_functions.c
The resulted trace is processed into a tree to produce a more human
view of the call ... | gpl-2.0 |
RonEld/mbed | tools/host_tests/host_test.py | 73 | 15433 | """
mbed SDK
Copyright (c) 2011-2013 ARM Limited
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 wr... | apache-2.0 |
sharifelgamal/runtimes-common | ftl/common/context.py | 5 | 3058 | # Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | apache-2.0 |
pshen/ansible | lib/ansible/plugins/callback/junit.py | 92 | 8951 | # (c) 2016 Matt Clay <matt@mystile.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 version.
#
... | gpl-3.0 |
JeremiasE/KFormula | kword/plugins/scripting/scripts/onlinehelp.py | 4 | 1962 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import Kross
class Dialog:
def __init__(self):
self.forms = Kross.module("forms")
self.dialog = self.forms.createDialog("KHTML Part")
self.dialog.minimumWidth = 720
self.dialog.minimumHeight = 480
#dialog.setButtons("Ok|Cancel")... | gpl-2.0 |
timothydmorton/bokeh | examples/compat/mpl/lc_offsets.py | 34 | 1096 | from matplotlib.collections import LineCollection
import matplotlib.pyplot as plt
import numpy as np
from bokeh import mpl
from bokeh.plotting import output_file, show
# Simulate a series of ocean current profiles, successively
# offset by 0.1 m/s so that they form what is sometimes called
# a "waterfall" plot or a "... | bsd-3-clause |
Ingenico-ePayments/connect-sdk-python3 | ingenico/connect/sdk/domain/definitions/customer_base.py | 2 | 2898 | # -*- coding: utf-8 -*-
#
# This class was auto-generated from the API references found at
# https://epayments-api.developer-ingenico.com/s2sapi/v1/
#
from ingenico.connect.sdk.data_object import DataObject
from ingenico.connect.sdk.domain.definitions.company_information import CompanyInformation
class CustomerBase(D... | mit |
femmerling/DirMaker | box/lib/python2.7/site-packages/tornado/platform/auto.py | 15 | 1186 | #!/usr/bin/env python
#
# Copyright 2011 Facebook
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | mit |
prontog/integrity_check | tweet.py | 1 | 4503 | #!/usr/bin/env python
# Taken from the examples of python-twitter module.
'''Post a message to twitter'''
__author__ = 'dewitt@google.com'
import configparser
import getopt
import os
import sys
import twitter
USAGE = '''Usage: tweet [options] message
This script posts a message to Twitter.
Options:
-h ... | apache-2.0 |
cstipkovic/spidermonkey-research | python/mozbuild/mozbuild/action/generate_symbols_file.py | 2 | 3286 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import, print_function, unicode_literals
import argparse
import buildconfig
import os
f... | mpl-2.0 |
danielerikhansson/opendlv.miniature | thirdparty/cxxtest/python/cxxtest/cxxtestgen.py | 48 | 23791 | #-------------------------------------------------------------------------
# CxxTest: A lightweight C++ unit testing library.
# Copyright (c) 2008 Sandia Corporation.
# This software is distributed under the LGPL License v3
# For more information, see the COPYING file in the top CxxTest directory.
# Under the terms of ... | gpl-2.0 |
tjsavage/sfcsdatabase | django/core/files/move.py | 403 | 2931 | """
Move a file in the safest way possible::
>>> from django.core.files.move import file_move_safe
>>> file_move_safe("/tmp/old_file", "/tmp/new_file")
"""
import os
from django.core.files import locks
try:
from shutil import copystat
except ImportError:
import stat
def copystat(src, dst):
... | bsd-3-clause |
vicky2135/lucious | tests/functional/catalogue/test_review.py | 5 | 2068 | from oscar.test.testcases import WebTestCase
from oscar.test.factories import create_product, UserFactory
from oscar.apps.catalogue.reviews.signals import review_added
from oscar.test.contextmanagers import mock_signal_receiver
class TestACustomer(WebTestCase):
def setUp(self):
self.product = create_prod... | bsd-3-clause |
TedaLIEz/sentry | src/sentry/migrations/0021_auto__del_message__del_groupedmessage__del_unique_groupedmessage_proje.py | 36 | 10712 | # encoding: 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):
pass
def backwards(self, orm):
pass
models = {
'sentry.user': {
'Meta': {'object_nam... | bsd-3-clause |
wujuguang/sqlalchemy | lib/sqlalchemy/ext/mutable.py | 2 | 31808 | # ext/mutable.py
# Copyright (C) 2005-2019 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
r"""Provide support for tracking of in-place changes to scalar values,
which are prop... | mit |
andela-bojengwa/talk | venv/lib/python2.7/site-packages/rest_framework/authentication.py | 4 | 12827 | """
Provides various authentication policies.
"""
from __future__ import unicode_literals
import base64
from django.contrib.auth import authenticate
from django.core.exceptions import ImproperlyConfigured
from django.middleware.csrf import CsrfViewMiddleware
from django.conf import settings
from rest_framework import ... | mit |
harmy/kbengine | kbe/src/lib/python/Lib/encodings/cp1254.py | 272 | 13502 | """ Python Character Mapping Codec cp1254 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1254.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,in... | lgpl-3.0 |
atiqueahmedziad/addons-server | src/olympia/constants/permissions.py | 3 | 4787 | from collections import defaultdict, namedtuple
AclPermission = namedtuple('AclPermission', 'app, action')
# Null rule. Only useful in tests really as no access group should have this.
NONE = AclPermission('None', 'None')
# A special wildcard permission to use when checking if someone has access to
# any admin, or... | bsd-3-clause |
thomashaw/SecGen | modules/utilities/unix/audit_tools/ghidra/files/release/Ghidra/Features/Python/data/jython-2.7.1/Lib/encodings/mac_croatian.py | 593 | 13889 | """ Python Character Mapping Codec mac_croatian generated from 'MAPPINGS/VENDORS/APPLE/CROATIAN.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,inp... | gpl-3.0 |
jsanda/cassandra | pylib/cqlshlib/formatting.py | 4 | 11761 | # 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 |
Donkyhotay/MoonPy | zope/annotation/interfaces.py | 1 | 2810 | ##############################################################################
#
# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# T... | gpl-3.0 |
bonitadecker77/python-for-android | python3-alpha/python3-src/Lib/test/test_pep263.py | 62 | 1846 | # -*- coding: koi8-r -*-
import unittest
from test import support
class PEP263Test(unittest.TestCase):
def test_pep263(self):
self.assertEqual(
"ðÉÔÏÎ".encode("utf-8"),
b'\xd0\x9f\xd0\xb8\xd1\x82\xd0\xbe\xd0\xbd'
)
self.assertEqual(
"\ð".encode("utf-8")... | apache-2.0 |
PXke/invenio | invenio/legacy/external_authentication/cern_wrapper.py | 4 | 7436 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2007, 2008, 2009, 2010, 2011 CERN.
##
## Invenio 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
## Licens... | gpl-2.0 |
mrtexaznl/p2pool | p2pool/test/util/test_math.py | 283 | 1198 | from __future__ import division
import random
import unittest
from p2pool.util import math
def generate_alphabet():
if random.randrange(2):
return None
else:
a = map(chr, xrange(256))
random.shuffle(a)
return a[:random.randrange(2, len(a))]
class Test(unittest.TestCase):
... | gpl-3.0 |
40223104/2015cd_0512 | static/Brython3.1.1-20150328-091302/Lib/weakref.py | 769 | 11495 | """Weak reference support for Python.
This module is an implementation of PEP 205:
http://www.python.org/dev/peps/pep-0205/
"""
# Naming convention: Variables named "wr" are weak reference objects;
# they are called this instead of "ref" to avoid name collisions with
# the module-global ref() function imported from ... | agpl-3.0 |
renyi533/tensorflow | tensorflow/lite/python/optimize/sparsifier.py | 3 | 2139 | # Copyright 2020 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 |
Microvellum/Fluid-Designer | win64-vc/2.78/python/lib/test/test_asyncio/test_base_events.py | 3 | 53421 | """Tests for base_events.py"""
import errno
import logging
import math
import os
import socket
import sys
import threading
import time
import unittest
from unittest import mock
import asyncio
from asyncio import base_events
from asyncio import constants
from asyncio import test_utils
try:
from test import support... | gpl-3.0 |
ifduyue/sentry | tests/sentry/api/endpoints/test_user_authenticator_details.py | 1 | 13240 | from __future__ import absolute_import
import datetime
import mock
import six
from django.core.urlresolvers import reverse
from django.db.models import F
from django.conf import settings
from django.utils import timezone
from sentry.models import Authenticator, TotpInterface, RecoveryCodeInterface, SmsInterface, Org... | bsd-3-clause |
sankhesh/VTK | Interaction/Style/Testing/Python/TestStyleTrackballCamera.py | 26 | 2156 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
=========================================================================
Program: Visualization Toolkit
Module: TestNamedColorsIntegration.py
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.... | bsd-3-clause |
ScottWales/rose | lib/python/rose/apps/rose_arch_compressions/rose_arch_tar.py | 1 | 2848 | # -*- coding: utf-8 -*-
#-------------------------------------------------------------------------------
# (C) British Crown Copyright 2012-5 Met Office.
#
# This file is part of Rose, a framework for meteorological suites.
#
# Rose is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | gpl-3.0 |
louisLouL/pair_trading | capstone_env/lib/python3.6/site-packages/sqlalchemy/dialects/mysql/pyodbc.py | 32 | 2665 | # mysql/pyodbc.py
# Copyright (C) 2005-2017 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
.. dialect:: mysql+pyodbc
:name: PyODBC
:dbapi: pyodbc
:connectstr... | mit |
ericagol/GenRP | paper/figures/error/error.py | 3 | 2215 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import division, print_function
import h5py
import numpy as np
import celerite
from celerite import terms, plot_setup
np.random.seed(42)
plot_setup.setup(auto=True)
K = 10
J = np.arange(2, 64, 8)
N = 2**np.arange(6, 16)
alpha_error = np.empty((K, len(J... | mit |
dezelin/vbox-haiku | src/VBox/Additions/common/crOpenGL/cr_gl.py | 17 | 1632 | print """
/** @file
* VBox OpenGL chromium functions header
*/
/*
* Copyright (C) 2008-2010 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* you can redistribute it and/or modify it under the terms of t... | gpl-2.0 |
MapofLife/MOL | app/mapreduce/lib/files/shuffler.py | 41 | 3392 | #!/usr/bin/env python
#
# Copyright 2007 Google 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 o... | bsd-3-clause |
rynkowsg/hamster | wafadmin/Build.py | 6 | 20179 | #! /usr/bin/env python
# encoding: utf-8
import sys
if sys.hexversion < 0x020400f0: from sets import Set as set
import os,sys,errno,re,glob,gc,datetime,shutil
try:import cPickle
except:import pickle as cPickle
import Runner,TaskGen,Node,Scripting,Utils,Environment,Task,Logs,Options
from Logs import debug,error,info
fro... | gpl-3.0 |
datalogics-robb/scons | src/engine/SCons/compat/_scons_sets.py | 132 | 19624 | """Classes to represent arbitrary sets (including sets of sets).
This module implements sets using dictionaries whose values are
ignored. The usual operations (union, intersection, deletion, etc.)
are provided as both methods and operators.
Important: sets are not sequences! While they support 'x in s',
'len(s)', a... | mit |
HKUST-SING/tensorflow | tensorflow/python/ops/ctc_ops.py | 29 | 11075 | # 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 |
ericmckean/jaikuengine | join/views.py | 30 | 11161 | # Copyright 2009 Google 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, ... | apache-2.0 |
lazywei/scikit-learn | examples/linear_model/plot_logistic_l1_l2_sparsity.py | 384 | 2601 | """
==============================================
L1 Penalty and Sparsity in Logistic Regression
==============================================
Comparison of the sparsity (percentage of zero coefficients) of solutions when
L1 and L2 penalty are used for different values of C. We can see that large
values of C give mo... | bsd-3-clause |
SoteriousIdaofevil/xmlstar | src/libxml2-2.9.1.tar/libxml2-2.9.1/python/tests/relaxng.py | 35 | 1203 | #!/usr/bin/python -u
import libxml2
import sys
# Memory debug specific
libxml2.debugMemory(1)
schema="""<?xml version="1.0"?>
<element name="foo"
xmlns="http://relaxng.org/ns/structure/1.0"
xmlns:a="http://relaxng.org/ns/annotation/1.0"
xmlns:ex1="http://www.example.com/n1"
xmlns:e... | mit |
tomi77/ems-cli | ems_cli/commands/__init__.py | 1 | 1979 | import argparse
import json
import sys
import pyems
from ..i18n import _
class BaseCommand(object):
name = None
description = None
quiet_fields = {}
def __init__(self, subparsers=None):
if subparsers is not None:
self.parser = subparsers.add_parser(self.name,
... | mit |
MattsFleaMarket/python-for-android | python-modules/twisted/twisted/news/test/test_database.py | 49 | 7565 | # Copyright (c) 2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.news.database}.
"""
__metaclass__ = type
from email.Parser import Parser
from socket import gethostname
from twisted.trial.unittest import TestCase
from twisted.internet.defer import succeed
from twisted.mail.smtp i... | apache-2.0 |
0rent/0rent | orentapp/migrations/0020_auto_20150610_0927.py | 1 | 1346 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('orentapp', '0019_auto_20150608_1959'),
... | agpl-3.0 |
sho-h/ruby_env | devkit/mingw/bin/lib/encodings/cp866.py | 93 | 35350 | """ Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP866.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_map)
def decode(self,input,errors=... | mit |
SnappleCap/oh-mainline | vendor/packages/docutils/test/test_parsers/test_rst/test_substitutions.py | 19 | 8883 | #! /usr/bin/env python
# $Id: test_substitutions.py 4564 2006-05-21 20:44:42Z wiemann $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
Tests for states.py.
"""
from __init__ import DocutilsTestSupport
def suite():
s = DocutilsTestSupport.ParserTes... | agpl-3.0 |
mcanthony/rethinkdb | external/v8_3.30.33.16/build/gyp/test/mac/gyptest-xcode-gcc-clang.py | 254 | 1403 | #!/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.
"""
Verifies that xcode-style GCC_... settings that require clang are handled
properly.
"""
import TestGyp
import os
import sys
if sys.pl... | agpl-3.0 |
shakamunyi/neutron-dvr | neutron/plugins/brocade/tests/nostest.py | 28 | 1566 | # Copyright (c) 2013 Brocade Communications Systems, 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.... | apache-2.0 |
locuslab/dreaml | dreaml/transformations/metrics.py | 1 | 1250 | from dreaml.dataframe.transform import ContinuousTransform
from time import sleep
import numpy as np
class Metrics(ContinuousTransform):
""" Computes the given metrics
"""
def __init__(self,metrics_list,*args,**kwargs):
self.metrics_names = kwargs.pop('metrics_names',\
... | apache-2.0 |
jirikuncar/invenio | invenio/modules/search/template_context_functions/tfn_summarize_records.py | 13 | 1141 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2013 CERN.
#
# Invenio 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... | gpl-2.0 |
terhorst/psmcpp | smcpp/plotting.py | 2 | 5252 | from __future__ import absolute_import, division, print_function
import json
import matplotlib, matplotlib.style, matplotlib.cm
matplotlib.use("Agg")
matplotlib.style.use("seaborn-ticks")
import numpy as np
from numpy import array
from collections import defaultdict
import smcpp.defaults
from . import model
def pre... | gpl-3.0 |
openstack/python-heatclient | heatclient/tests/unit/test_actions.py | 1 | 4104 | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... | apache-2.0 |
naoyat/latin | latin/latin_char.py | 1 | 2038 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
LOWER_LONG_VOWELS = [257,275,299,333,363,563] # ā ē ī ō ū ȳ
UPPER_LONG_VOWELS = [256,274,298,332,362,562] # Ā Ē Ī Ō Ū Ȳ
TRANSTABLE_TOLOWER = {}
TRANSTABLE_TOUPPER = {}
for j in xrange(26): # A-Z / a-z
TRANSTABLE_TOLOWER[0x41+j] = unichr(0x61+j)
TRANSTABLE_TOUPPER... | mit |
ahmetcemturan/SFACT | fabmetheus_utilities/vector3index.py | 12 | 8587 | """
Vector3 is a three dimensional vector class.
Below are examples of Vector3 use.
>>> from vector3 import Vector3
>>> origin = Vector3()
>>> origin
0.0, 0.0, 0.0
>>> pythagoras = Vector3( 3, 4, 0 )
>>> pythagoras
3.0, 4.0, 0.0
>>> pythagoras.magnitude()
5.0
>>> pythagoras.magnitudeSquared()
25
>>> triplePythagoras ... | agpl-3.0 |
rosmo/ansible | lib/ansible/modules/cloud/azure/azure_rm_mysqlfirewallrule.py | 13 | 9672 | #!/usr/bin/python
#
# Copyright (c) 2018 Zim Kalinowski, <zikalino@microsoft.com>
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
watonyweng/nova | nova/tests/unit/virt/hyperv/test_rdpconsoleutilsv2.py | 83 | 1338 | # Copyright 2013 Cloudbase Solutions Srl
#
# 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 |
microcom/clouder | clouder_template_ldap/clouder_template_ldap.py | 2 | 5535 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Yannick Buron
# Copyright 2015, TODAY Clouder SASU
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License with Attribution
# ... | gpl-3.0 |
x111ong/django | tests/template_tests/syntax_tests/test_comment.py | 521 | 3667 | from django.test import SimpleTestCase
from ..utils import setup
class CommentSyntaxTests(SimpleTestCase):
@setup({'comment-syntax01': '{# this is hidden #}hello'})
def test_comment_syntax01(self):
output = self.engine.render_to_string('comment-syntax01')
self.assertEqual(output, 'hello')
... | bsd-3-clause |
blaercom/django-guardian | guardian/testsettings.py | 12 | 1433 | import os
DEBUG = False
ANONYMOUS_USER_ID = -1
SECRET_KEY = 'CHANGE_THIS_TO_SOMETHING_UNIQUE_AND_SECURE'
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.admin',
'django.contrib.messages',
'guardia... | bsd-2-clause |
quole/gensim | gensim/test/test_hdpmodel.py | 13 | 2414 | #!/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 |
cathay4t/libstoragemgmt | plugin/targetd/targetd.py | 4 | 36673 | # Copyright (C) 2011-2014 Red Hat, Inc.
# This library 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 2.1 of the License, or any later version.
#
# This library is distributed in the h... | lgpl-2.1 |
GaussDing/jieba | test/test_userdict.py | 3 | 1389 | #encoding=utf-8
from __future__ import print_function, unicode_literals
import sys
sys.path.append("../")
import jieba
jieba.load_userdict("userdict.txt")
import jieba.posseg as pseg
jieba.add_word('石墨烯')
jieba.add_word('凱特琳')
jieba.del_word('自定义词')
test_sent = (
"李小福是创新办主任也是云计算方面的专家; 什么是八一双鹿\n"
"例如我输入一个带“韩玉赏鉴”的标题,在自... | mit |
redmoonlas/textinsight | config/settings/common.py | 1 | 8518 | # -*- coding: utf-8 -*-
"""
Django settings for text_insight project.
For more information on this file, see
https://docs.djangoproject.com/en/dev/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/dev/ref/settings/
"""
from __future__ import absolute_import, unicod... | bsd-3-clause |
benoitsteiner/tensorflow-xsmm | tensorflow/compiler/xla/python/xla_client_test.py | 3 | 55766 | # 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 |
mohanprasath/Course-Work | data_analysis/uh_data_analysis_with_python/hy-data-analysis-with-python-spring-2020/part04-e01_cities/tmc/points.py | 91 | 1509 | from inspect import isclass, isfunction
from collections import defaultdict
point_register = {'suite': defaultdict(list), 'test': defaultdict(list)}
def qualifier(test):
return "%s.%s" % (test.__module__, test.__qualname__)
def save_points(o, points, dst):
q = qualifier(o)
dst[q] += filter(lambda point... | gpl-3.0 |
abhishek4747/Tejas-git | test_script/script.py | 1 | 1413 | import subprocess
import math
import os
if __name__=="__main__":
# Read config file
tejasdir = "/home/abhishek/Tejas-git/"
jarfile = "/home/abhishek/Desktop/test_tejas.jar"
scriptdir = tejasdir+"test_script/"
configfile = scriptdir+'config.xml'
resultdir = scriptdir +'results/'
resultfile = resultdir+'result_%... | apache-2.0 |
rimistri/mediatek | mt6592/kernel/tools/perf/scripts/python/sctop.py | 11180 | 1924 | # system call top
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Periodically displays system-wide system call totals, broken down by
# syscall. If a [comm] arg is specified, only syscalls called by
# [comm] are displayed. If an [interval] arg is specified,... | gpl-2.0 |
kevalds51/sympy | sympy/solvers/tests/test_inequalities.py | 17 | 12829 | """Tests for tools for solving inequalities and systems of inequalities. """
from sympy import (And, Eq, FiniteSet, Ge, Gt, Interval, Le, Lt, Ne, oo,
Or, S, sin, sqrt, Symbol, Union, Integral, Sum,
Function, Poly, PurePoly, pi, root)
from sympy.solvers.inequalities import (reduce_... | bsd-3-clause |
NaohiroTamura/ironic | ironic/drivers/modules/cimc/common.py | 10 | 2709 | # Copyright 2015, Cisco Systems.
#
# 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 wri... | apache-2.0 |
Thortoise/Super-Snake | Blender/animation_nodes-master/execution/group_execution_unit.py | 1 | 3493 | from . compile_scripts import compileScript
from .. problems import ExecutionUnitNotSetup
from . code_generator import (getInitialVariables,
iterSetupCodeLines,
getGlobalizeStatement,
linkOutputSocketsToTargets,
... | gpl-3.0 |
jymannob/Sick-Beard | lib/hachoir_parser/video/mov.py | 90 | 9144 | """
Apple Quicktime Movie (file extension ".mov") parser.
Documents:
- Parsing and Writing QuickTime Files in Java (by Chris Adamson, 02/19/2003)
http://www.onjava.com/pub/a/onjava/2003/02/19/qt_file_format.html
- QuickTime File Format (official technical reference)
http://developer.apple.com/documentation/QuickTi... | gpl-3.0 |
brennie/reviewboard | reviewboard/notifications/tests.py | 1 | 129241 | from __future__ import unicode_literals
import logging
from django.conf import settings
from django.contrib.auth.models import User
from django.core import mail
from django.http import Http404
from django.template import TemplateSyntaxError
from django.test.client import RequestFactory
from django.test.utils import o... | mit |
andreagrandi/duplicity-sx | duplicity/statistics.py | 2 | 12567 | # -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright 2002 Ben Escoto <ben@emerose.org>
# Copyright 2007 Kenneth Loafman <kenneth@loafman.com>
#
# This file is part of duplicity.
#
# Duplicity is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License... | gpl-2.0 |
JamesLinEngineer/RKMC | lib/gtest/scripts/fuse_gtest_files.py | 2577 | 8813 | #!/usr/bin/env python
#
# Copyright 2009, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | gpl-2.0 |
2ndQuadrant/ansible | lib/ansible/modules/cloud/azure/azure_rm_deployment.py | 2 | 29127 | #!/usr/bin/python
#
# Copyright (c) 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 |
amluto/libseccomp | tests/18-sim-basic_whitelist.py | 1 | 1343 | #!/usr/bin/env python
#
# Seccomp Library test program
#
# Copyright (c) 2013 Red Hat <pmoore@redhat.com>
# Author: Paul Moore <pmoore@redhat.com>
#
#
# This library is free software; you can redistribute it and/or modify it
# under the terms of version 2.1 of the GNU Lesser General Public License as
# published by t... | lgpl-2.1 |
shssoichiro/servo | tests/wpt/web-platform-tests/css/vendor-imports/mozilla/mozilla-central-reftests/text-decor-3/support/generate-text-emphasis-ruby-tests.py | 829 | 3042 | #!/usr/bin/env python
# - * - coding: UTF-8 - * -
"""
This script generates tests text-emphasis-ruby-001 ~ 004 which tests
emphasis marks with ruby in four directions. It outputs a list of all
tests it generated in the format of Mozilla reftest.list to the stdout.
"""
from __future__ import unicode_literals
TEST_FIL... | mpl-2.0 |
lepricon49/CouchPotatoServer | couchpotato/core/media/movie/providers/userscript/rottentomatoes.py | 37 | 1035 | import re
import traceback
from couchpotato import fireEvent
from couchpotato.core.logger import CPLog
from couchpotato.core.media._base.providers.userscript.base import UserscriptBase
log = CPLog(__name__)
autoload = 'RottenTomatoes'
class RottenTomatoes(UserscriptBase):
includes = ['*://www.rottentomatoes.... | gpl-3.0 |
ajdavis/asyncio | tests/test_transports.py | 35 | 3471 | """Tests for transports.py."""
import unittest
from unittest import mock
import asyncio
from asyncio import transports
class TransportTests(unittest.TestCase):
def test_ctor_extra_is_none(self):
transport = asyncio.Transport()
self.assertEqual(transport._extra, {})
def test_get_extra_info(... | apache-2.0 |
fabianvf/osf.io | tests/test_sanitize.py | 3 | 1726 | import unittest
from nose.tools import * # flake8: noqa
from website.util import sanitize
class TestSanitize(unittest.TestCase):
def test_escape_html(self):
assert_equal(
sanitize.clean_tag('<script> evil code </script>'),
'<script> evil code </script>',
)
... | apache-2.0 |
rrrene/django | django/db/backends/sqlite3/operations.py | 106 | 10799 | from __future__ import unicode_literals
import datetime
import uuid
from django.conf import settings
from django.core.exceptions import FieldError, ImproperlyConfigured
from django.db import utils
from django.db.backends import utils as backend_utils
from django.db.backends.base.operations import BaseDatabaseOperatio... | bsd-3-clause |
lecaoquochung/ddnb.django | tests/template_tests/tests.py | 2 | 124806 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from datetime import date, datetime
import os
import sys
import traceback
import unittest
import warnings
from django import template
from django.conf import settings
from django.contrib.auth.models import Group
from django.core import urlresolvers
from ... | bsd-3-clause |
infinidb/autooam | autooam/common/__init__.py | 1 | 1188 | # Copyright (C) 2014 InfiniDB, Inc.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; version 2 of
# the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOU... | gpl-2.0 |
caronc/nzbget-subliminal | Subliminal/setuptools/command/install.py | 216 | 4065 | import setuptools, sys, glob
from distutils.command.install import install as _install
from distutils.errors import DistutilsArgError
class install(_install):
"""Use easy_install to install the package, w/dependencies"""
user_options = _install.user_options + [
('old-and-unmanageable', None, "Try not ... | gpl-3.0 |
danisfermi/CodingPractice | Data Structures/Stack/Balanced Paranthesis/balancedParanthesis.py | 1 | 1217 | class stack:
def __init__(self):
self.s = []
self.size = 0
def printStack(self):
print "Printing Stack", self.s
def isEmpty(self):
if self.size == 0:
return True
else:
return False
def top(self):
return self.s[self.size-1]
d... | gpl-3.0 |
LucasMontero/COW | public/lib/codemirror/component-tools/update.py | 28 | 1102 | #!/usr/bin/env python
from distutils.version import StrictVersion as V
import os
import re
from subprocess import check_output, check_call
import sys
# the first version we started maintaining as a component
first_version = V('5.20')
blacklist_tags = ['v3.02', '5.13.4']
tools = os.path.dirname(os.path.abspath(__fil... | mpl-2.0 |
projectatomic/atomic-reactor | tests/test_download.py | 1 | 2233 | """
Copyright (c) 2019 Red Hat, Inc
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
"""
from __future__ import absolute_import
from io import BufferedReader, BytesIO
import os
import requests
import responses
import tempfile
imp... | bsd-3-clause |
liqd/adhocracy | src/adhocracy/migration/versions/004_Better_poll.py | 4 | 2504 | from datetime import datetime
from sqlalchemy import *
from migrate import *
import migrate.changeset
meta = MetaData()
delegateable_table = Table('delegateable', meta,
Column('id', Integer, primary_key=True),
Column('label', Unicode(255), nullable=False),
Column('type', String(50)),
Column('create_t... | agpl-3.0 |
andrewjrobinson/FreeCAD_sf_master | src/3rdParty/Pivy/gui/__init__.py | 38 | 1587 | ###
# Copyright (C) 2002-2005, Tamer Fahmy <tamer@tammura.at>
# 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, t... | lgpl-2.1 |
jsteemann/arangodb | 3rdParty/V8-4.3.61/third_party/python_26/Lib/idlelib/SearchDialogBase.py | 150 | 4385 | from Tkinter import *
class SearchDialogBase:
title = "Search Dialog"
icon = "Search"
needwrapbutton = 1
def __init__(self, root, engine):
self.root = root
self.engine = engine
self.top = None
def open(self, text, searchphrase=None):
self.text = text
if no... | apache-2.0 |
wildjan/Flask | Work/Trivia - Module 5/env/Lib/site-packages/flask/globals.py | 783 | 1137 | # -*- coding: utf-8 -*-
"""
flask.globals
~~~~~~~~~~~~~
Defines all the global objects that are proxies to the current
active context.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from functools import partial
from werkzeug.local import LocalStack, ... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.