repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
sbreen94/Zeus_S4_r3 | tools/perf/scripts/python/syscall-counts-by-pid.py | 11180 | 1927 | # system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os, sys
sys.path.append(os.env... | gpl-2.0 |
ammarkhann/FinalSeniorCode | lib/python2.7/site-packages/sympy/polys/polyfuncs.py | 24 | 9645 | """High-level polynomials manipulation functions. """
from __future__ import print_function, division
from sympy.polys.polytools import (
poly_from_expr, parallel_poly_from_expr, Poly)
from sympy.polys.polyoptions import allowed_flags
from sympy.polys.specialpolys import (
symmetric_poly, interpolating_poly)... | mit |
beiko-lab/gengis | bin/Lib/site-packages/pythonwin/pywin/scintilla/keycodes.py | 4 | 5241 | import string
import win32con
import win32api
import win32ui
MAPVK_VK_TO_CHAR = 2
key_name_to_vk = {}
key_code_to_name = {}
_better_names = {
"escape": "esc",
"return": "enter",
"back": "pgup",
"next": "pgdn",
}
def _fillvkmap():
# Pull the VK_names from win32con
names = [... | gpl-3.0 |
hyperized/ansible | lib/ansible/modules/cloud/vmware/vmware_guest_vnc.py | 23 | 8071 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2018, Armin Ranjbar Daemi <armin@webair.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... | gpl-3.0 |
nerguri/bigcouch | couchjs/scons/scons-local-2.0.1/SCons/Tool/gs.py | 61 | 2553 | """SCons.Tool.gs
Tool-specific initialization for Ghostscript.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundatio... | apache-2.0 |
kangfend/django | tests/auth_tests/test_signals.py | 312 | 4005 | import datetime
from django.contrib.auth import signals
from django.contrib.auth.models import User
from django.test import TestCase, override_settings
from django.test.client import RequestFactory
@override_settings(USE_TZ=False,
PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'],
ROOT_URLC... | bsd-3-clause |
UrusTeam/android_ndk_toolchain_cross | lib/python2.7/test/test_fcntl.py | 41 | 4288 | """Test program for the fcntl C module.
OS/2+EMX doesn't support the file locking operations.
"""
import os
import struct
import sys
import _testcapi
import unittest
from test.test_support import (verbose, TESTFN, unlink, run_unittest,
import_module)
# Skip test if no fnctl module.
fcntl = import_module('fcntl')... | gpl-2.0 |
capoe/espressopp.soap | bench/lennard_jones/gen_lennard_jones.py | 2 | 5498 | #!/usr/bin/env python
###########################################################################
# #
# This Python script generates an input file to be used for #
# LAMMPS or ESPRESSO++ ... | gpl-3.0 |
sgzsh269/django | django/contrib/auth/tokens.py | 433 | 2803 | from datetime import date
from django.conf import settings
from django.utils import six
from django.utils.crypto import constant_time_compare, salted_hmac
from django.utils.http import base36_to_int, int_to_base36
class PasswordResetTokenGenerator(object):
"""
Strategy object used to generate and check token... | bsd-3-clause |
jkugler/ansible | test/units/parsing/yaml/test_loader.py | 181 | 11400 | # coding: utf-8
# (c) 2015, Toshio Kuratomi <tkuratomi@ansible.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your o... | gpl-3.0 |
Obus/scikit-learn | doc/datasets/mldata_fixture.py | 367 | 1183 | """Fixture module to skip the datasets loading when offline
Mock urllib2 access to mldata.org and create a temporary data folder.
"""
from os import makedirs
from os.path import join
import numpy as np
import tempfile
import shutil
from sklearn import datasets
from sklearn.utils.testing import install_mldata_mock
fr... | bsd-3-clause |
TheWhisp/android_kernel_samsung_msm7x27a | tools/perf/scripts/python/check-perf-trace.py | 11214 | 2503 | # perf script event handlers, generated by perf script -g python
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# This script tests basic functionality such as flag and symbol
# strings, common_xxx() calls back into perf, begin, end, unhandled
# events, etc. ... | gpl-2.0 |
carvalhomb/tsmells | guess/src/Lib/encodings/iso8859_8.py | 2 | 2860 | """ Python Character Mapping Codec generated from '8859-8.TXT' with gencodec.py.
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
(c) Copyright 2000 Guido van Rossum.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(... | gpl-2.0 |
richardcs/ansible | test/runner/lib/csharp_import_analysis.py | 49 | 2452 | """Analyze C# import statements."""
from __future__ import absolute_import, print_function
import os
import re
from lib.util import (
display,
)
def get_csharp_module_utils_imports(powershell_targets, csharp_targets):
"""Return a dictionary of module_utils names mapped to sets of powershell file paths.
... | gpl-3.0 |
ZeitOnline/zeit.push | src/zeit/push/browser/mobile.py | 1 | 1348 | from zope.cachedescriptors.property import Lazy as cachedproperty
import logging
import sys
import zeit.push.interfaces
import zope.security.proxy
log = logging.getLogger(__name__)
class FindTitle(object):
def __call__(self):
name = self.request.form.get('q')
if not name:
return ''
... | bsd-3-clause |
ga7g08/sympy | examples/advanced/relativity.py | 89 | 4384 | #!/usr/bin/env python
"""
This example calculates the Ricci tensor from the metric and does this
on the example of Schwarzschild solution.
If you want to derive this by hand, follow the wiki page here:
http://en.wikipedia.org/wiki/Deriving_the_Schwarzschild_solution
Also read the above wiki and follow the reference... | bsd-3-clause |
NcLang/vimrc | sources_non_forked/YouCompleteMe/third_party/ycmd/cpp/ycm/tests/gmock/gtest/scripts/pump.py | 2471 | 23673 | #!/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... | mit |
gitoffdabus/inf1340_2015_asst1 | exercise3.py | 1 | 5527 | #!/usr/bin/env python
""" Assignment 1, Exercise 3, INF1340, Fall, 2015. Troubleshooting Car Issues.
This module contains one function diagnose_car(). It is an expert system to
interactive diagnose car issues.
"""
__author__ = 'Susan Sim'
__email__ = "ses@drsusansim.org"
__copyright__ = "2015 Susan Sim"
__license__... | mit |
chandler14362/panda3d | direct/src/leveleditor/HotKeyUI.py | 15 | 6340 | import wx
from wx.lib.scrolledpanel import ScrolledPanel
class EditHotKeyDialog(wx.Dialog):
def __init__(self, parent, id, title, key):
wx.Dialog.__init__(self, parent, id, title, size=(250, 240))
self.currKey = key
self.panel = wx.Panel(self, -1)
self.updateUI()
vbox = wx.B... | bsd-3-clause |
nelmiux/CarnotKE | jyhton/lib-python/2.7/xml/sax/saxutils.py | 43 | 11384 | """\
A library of useful helper classes to the SAX classes, for the
convenience of application and driver writers.
"""
import os, urlparse, urllib, types
import io
import sys
import handler
import xmlreader
try:
_StringTypes = [types.StringType, types.UnicodeType]
except AttributeError:
_StringTypes = [types.... | apache-2.0 |
grafgustav/accessmail | src/Service/ImapReceiver.py | 1 | 1024 | __author__ = 'phillip'
from .MailReceiver import MailReceiver
import poplib
class IMAPReceiver(MailReceiver):
def __init__(self, config):
self._conn = None
def connect(self, config):
self._server = poplib.POP3_SSL()
self._server.apop()
def delete_mail(self, n):
self._se... | mit |
freakboy3742/django | django/contrib/gis/geos/prepared.py | 180 | 1575 | from .base import GEOSBase
from .prototypes import prepared as capi
class PreparedGeometry(GEOSBase):
"""
A geometry that is prepared for performing certain operations.
At the moment this includes the contains covers, and intersects
operations.
"""
ptr_type = capi.PREPGEOM_PTR
destructor =... | bsd-3-clause |
mollstam/UnrealPy | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Twisted-15.2.1/twisted/application/app.py | 3 | 22072 | # -*- test-case-name: twisted.test.test_application,twisted.test.test_twistd -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
from __future__ import print_function
import sys
import os
import pdb
import getpass
import traceback
import signal
from operator import attrgetter
from twisted.pyt... | mit |
kurennon/misc-tools | find_validator/find_validator.py | 1 | 1259 | #!/usr/bin/env python3
DIG_CHARS = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
def find_validator(dig_string, old_base):
dig_sum = sum_digits(dig_string, old_base)
return dig_sum[-1:].upper()
def sum_digits(dig_string, old_base):
int_sum = 0
while dig_string:
int_sum += int(dig_string[:1], base=... | gpl-3.0 |
GeoNode/geonode | geonode/documents/views.py | 3 | 24792 | # -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2016 OSGeo
#
# 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 ... | gpl-3.0 |
backupManager/pyflag | src/pyflag/CacheManager.py | 5 | 14600 | """ This module implements a Cache Manager.
A Cache manager is a coordinated way of gaining access to the object
cache on disk. PyFlag keeps many objects cached on disk for fast
access. The cache manager manages the specific organization of cache
objects, and provides a unified API for accessing and creating these
obj... | gpl-2.0 |
bmanojlovic/ansible | lib/ansible/modules/network/dnsmadeeasy.py | 25 | 13970 | #!/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 |
largelymfs/topical_word_embeddings | TWE-2/gensim/utils.py | 11 | 29224 | #!/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
"""
This module contains various general utility functions.
"""
from __future__ import with_statement
import logging
logger = logging.... | mit |
miles0411/pm | venv/lib/python2.7/site-packages/wheel/test/test_basic.py | 472 | 6405 | """
Basic wheel tests.
"""
import os
import pkg_resources
import json
import sys
from pkg_resources import resource_filename
import wheel.util
import wheel.tool
from wheel import egg2wheel
from wheel.install import WheelFile
from zipfile import ZipFile
from shutil import rmtree
test_distributions = ("complex-dist"... | apache-2.0 |
yggi49/wtforms-polyglot | wtf_polyglot/meta.py | 1 | 2876 | from __future__ import unicode_literals
try:
from html import escape
from html.parser import HTMLParser
except ImportError:
from cgi import escape
from HTMLParser import HTMLParser
from wtforms.meta import DefaultMeta
from wtforms.widgets.core import HTMLString
class PolyglotHTMLParser(HTMLParser):
... | bsd-3-clause |
vivekanand1101/neutron | neutron/plugins/ml2/drivers/type_vlan.py | 31 | 11748 | # 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 |
markcheno/trading-with-python | lib/classes.py | 76 | 7847 | """
worker classes
@author: Jev Kuznetsov
Licence: GPL v2
"""
__docformat__ = 'restructuredtext'
import os
import logger as logger
import yahooFinance as yahoo
from functions import returns, rank
from datetime import date
from pandas import DataFrame, Series
import numpy as np
import pandas as pd
im... | bsd-3-clause |
adlerweb/otr-verwaltung | otrverwaltung/gui/widgets/BetterTreeView.py | 4 | 2154 | # -*- coding: utf-8 -*-
### BEGIN LICENSE
# Copyright (C) 2010 Benjamin Elbers <elbersb@gmail.com>
#This program is free software: you can redistribute it and/or modify it
#under the terms of the GNU General Public License version 3, as published
#by the Free Software Foundation.
#
#This program is distributed in the... | gpl-3.0 |
CoderBotOrg/coderbotsrv | server/lib/OpenSSL/rand.py | 11 | 4579 | """
PRNG management routines, thin wrappers.
See the file RATIONALE for a short explanation of why this module was written.
"""
from functools import partial
from six import integer_types as _integer_types
from OpenSSL._util import (
ffi as _ffi,
lib as _lib,
exception_from_error_queue as _exception_fro... | gpl-3.0 |
vijayanandnandam/youtube-dl | youtube_dl/extractor/kuwo.py | 18 | 12536 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import compat_urlparse
from ..utils import (
get_element_by_id,
clean_html,
ExtractorError,
InAdvancePagedList,
remove_start,
)
class KuwoBaseIE(InfoExtractor):
_FORMATS = [
... | unlicense |
Weihonghao/ECM | Vpy34/lib/python3.5/site-packages/pip/_vendor/requests/packages/chardet/jpcntx.py | 1777 | 19348 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | agpl-3.0 |
madj4ck/ansible | lib/ansible/plugins/action/group_by.py | 172 | 1401 | # Copyright 2012, Jeroen Hoekx <jeroen@hoekx.be>
#
# 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 ve... | gpl-3.0 |
aronparsons/spacewalk | scripts/ncsu-rhntools/rhnstats/rhndb.py | 19 | 4788 | # rhndb.py -- Database functions
# Copyright (C) 2007 NC State University
# Written by Jack Neely <jjneely@ncsu.edu>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the Lic... | gpl-2.0 |
patcon/open-cabinet | venv/lib/python2.7/site-packages/django/conf/__init__.py | 135 | 7622 | """
Settings and configuration for Django.
Values will be read from the module specified by the DJANGO_SETTINGS_MODULE environment
variable, and then from django.conf.global_settings; see the global settings file for
a list of all possible variables.
"""
import importlib
import os
import time
import warnings
from dj... | mit |
torchingloom/edx-platform | common/lib/xmodule/xmodule/master_class_module.py | 1 | 15766 | # -*- coding: utf-8 -*-
"""Word cloud is ungraded xblock used by students to
generate and view word cloud.
On the client side we show:
If student does not yet answered - `num_inputs` numbers of text inputs.
If student have answered - words he entered and cloud.
"""
import json
import logging
import datetime
import cs... | agpl-3.0 |
atgreen/bitcoin | contrib/linearize/linearize-hashes.py | 214 | 3037 | #!/usr/bin/python
#
# linearize-hashes.py: List blocks in a linear, no-fork version of the chain.
#
# Copyright (c) 2013-2014 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
from __future__ import pr... | mit |
ryancanhelpyou/servo | python/mozlog/mozlog/structured/structuredlog.py | 41 | 15680 | # 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 unicode_literals
from multiprocessing import current_process
from threading import current_threa... | mpl-2.0 |
megraf/asuswrt-merlin | release/src/router/samba36/lib/dnspython/dns/rdtypes/ANY/NSEC3.py | 248 | 6716 | # Copyright (C) 2004-2007, 2009, 2010 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED ... | gpl-2.0 |
VerizonDigital/rsyslog | plugins/impstats/statslog-splitter.py | 23 | 8323 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# * Copyright (C) 2013 Adiscon GmbH.
# * This file is part of RSyslog
# *
# * This script processes impstats logfiles and splits them into csv files
# *
import sys
import datetime
import time
import os
# Include regex definitions
import statslog_regex
from statslog_re... | gpl-3.0 |
gauribhoite/personfinder | env/google_appengine/lib/django-1.3/django/contrib/localflavor/uk/forms.py | 313 | 1943 | """
UK-specific Form helpers
"""
import re
from django.forms.fields import CharField, Select
from django.forms import ValidationError
from django.utils.translation import ugettext_lazy as _
class UKPostcodeField(CharField):
"""
A form field that validates its input is a UK postcode.
The regular expressi... | apache-2.0 |
mollstam/UnrealPy | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/numpy-1.9.2/numpy/lib/tests/test_arraypad.py | 34 | 22206 | """Tests for the pad functions.
"""
from __future__ import division, absolute_import, print_function
from numpy.testing import TestCase, run_module_suite, assert_array_equal
from numpy.testing import assert_raises, assert_array_almost_equal
import numpy as np
from numpy.lib import pad
class TestStatistic(TestCase):... | mit |
wwj718/edx-video | i18n/converter.py | 16 | 2271 | import re
import itertools
class Converter:
"""Converter is an abstract class that transforms strings.
It hides embedded tags (HTML or Python sequences) from transformation
To implement Converter, provide implementation for inner_convert_string()
Strategy:
1. extract tags embedded... | agpl-3.0 |
woutervanwijk/mopidy | mopidy/mpd/protocol/current_playlist.py | 2 | 12653 | from __future__ import unicode_literals
import warnings
from mopidy.mpd import exceptions, protocol, translator
@protocol.commands.add('add')
def add(context, uri):
"""
*musicpd.org, current playlist section:*
``add {URI}``
Adds the file ``URI`` to the playlist (directories add recursively... | apache-2.0 |
ZLLab-Mooc/edx-platform | pavelib/paver_tests/test_paver_bok_choy_cmds.py | 36 | 5914 | """
Tests for the bok-choy paver commands themselves.
Run just this test with: paver test_lib -t pavelib/paver_tests/test_paver_bok_choy_cmds.py
"""
import os
import unittest
from paver.easy import BuildFailure
from pavelib.utils.test.suites import BokChoyTestSuite
REPO_DIR = os.getcwd()
class TestPaverBokChoyCmd(un... | agpl-3.0 |
EmanueleCannizzaro/scons | test/DVIPDF/DVIPDFCOM.py | 1 | 2061 | #!/usr/bin/env python
#
# Copyright (c) 2001 - 2016 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to us... | mit |
devs1991/test_edx_docmode | venv/lib/python2.7/site-packages/coverage/pytracer.py | 34 | 5990 | # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt
"""Raw data collector for coverage.py."""
import dis
import sys
from coverage import env
# We need the YIELD_VALUE opcode below, in a comparison-friendly form.
Y... | agpl-3.0 |
colinnewell/odoo | addons/mail/mail_thread.py | 111 | 109095 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2009-today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | agpl-3.0 |
googleapis/googleapis-gen | google/cloud/aiplatform/v1/aiplatform-v1-py/google/cloud/aiplatform_v1/services/pipeline_service/transports/grpc_asyncio.py | 1 | 18872 | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | apache-2.0 |
guoxiaolongzte/spark | examples/src/main/python/ml/polynomial_expansion_example.py | 123 | 1522 | #
# 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 |
janek-warchol/ansible | lib/ansible/cli/pull.py | 81 | 9626 | # (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 the License, or
# (at your option) any lat... | gpl-3.0 |
Endika/odoo | addons/payment_adyen/models/adyen.py | 165 | 7767 | # -*- coding: utf-'8' "-*-"
import base64
try:
import simplejson as json
except ImportError:
import json
from hashlib import sha1
import hmac
import logging
import urlparse
from openerp.addons.payment.models.payment_acquirer import ValidationError
from openerp.addons.payment_adyen.controllers.main import Adye... | agpl-3.0 |
nagyistoce/odoo-dev-odoo | addons/portal_project/project.py | 285 | 1809 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013-TODAY OpenERP S.A (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms... | agpl-3.0 |
gunan/tensorflow | tensorflow/python/keras/saving/saved_model/layer_serialization.py | 3 | 6416 | # 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 |
puttarajubr/commcare-hq | custom/ilsgateway/tests/test_locations_sync.py | 1 | 4004 | from datetime import datetime
import json
import os
from django.test import TestCase
from corehq.apps.commtrack.models import CommtrackConfig
from corehq.apps.commtrack.tests.util import bootstrap_domain as initial_bootstrap
from corehq.apps.locations.models import Location, SQLLocation
from custom.ilsgateway.api impor... | bsd-3-clause |
jonnor/FreeCAD | src/Mod/PartDesign/fcgear/svggear.py | 27 | 2415 | # (c) 2014 David Douard <david.douard@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License (LGPL)
# as published by the Free Software Foundation; either version 2 of
# the License, or (at your option) any later version.... | lgpl-2.1 |
aabbox/kbengine | kbe/src/lib/python/Lib/test/test_scope.py | 84 | 20234 | import unittest
import weakref
from test.support import check_syntax_error, cpython_only, run_unittest
class ScopeTests(unittest.TestCase):
def testSimpleNesting(self):
def make_adder(x):
def adder(y):
return x + y
return adder
inc = make_adder(1)
... | lgpl-3.0 |
pgrinaway/yank | Yank/tests/test_yank.py | 2 | 9253 | #!/usr/local/bin/env python
"""
Test YANK using simple models.
DESCRIPTION
This test suite generates a number of simple models to test the 'Yank' facility.
COPYRIGHT
Written by John D. Chodera <jchodera@gmail.com> while at the University of California Berkeley.
LICENSE
This code is licensed under the latest avai... | lgpl-3.0 |
davidvg/google_api | google_api/gmail_api.py | 1 | 13120 | '''
Basic Python3 implementation of some functionality of the Gmail API.
Based on the code from the Gmail API documentation.
Requires a 'secret file' to allow authentication (see [1])
Installation
-----------
In Python3, install the API using pip3:
pip3 install --upgrade google-api-python-client
Install packages... | mit |
underloki/Cyprium | kernel/__init__.py | 3 | 1876 | ########################################################################
# #
# Cyprium is a multifunction cryptographic, steganographic and #
# cryptanalysis tool developped by members of The Hackademy. #
# French White Hat Hackers... | gpl-3.0 |
santisiri/popego | envs/ALPHA-POPEGO/lib/python2.5/site-packages/twisted/plugins/twisted_reactors.py | 62 | 1420 | # Copyright (c) 2006 Twisted Matrix Laboratories.
# See LICENSE for details.
from twisted.application.reactors import Reactor
default = Reactor(
'default', 'twisted.internet.default',
'The best reactor for the current platform.')
select = Reactor(
'select', 'twisted.internet.selectreactor', 'select(2)-ba... | bsd-3-clause |
diagramsoftware/odoo | addons/hr_recruitment/report/__init__.py | 442 | 1107 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... | agpl-3.0 |
mzdaniel/oh-mainline | vendor/packages/Django/tests/regressiontests/managers_regress/tests.py | 92 | 2544 | from django.test import TestCase
from models import Child1, Child2, Child3, Child4, Child5, Child6, Child7
class ManagersRegressionTests(TestCase):
def test_managers(self):
a1 = Child1.objects.create(name='fred', data='a1')
a2 = Child1.objects.create(name='barney', data='a2')
b1 = Child2.... | agpl-3.0 |
cloudera/hue | desktop/core/ext-py/oauth2client-4.1.3/tests/contrib/django_util/test_django_storage.py | 21 | 5763 | # Copyright 2016 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 |
gsp8181/python-xbee | docs/source/conf.py | 34 | 6355 | # -*- coding: utf-8 -*-
#
# python-xbee documentation build configuration file, created by
# sphinx-quickstart on Sat Jul 24 22:28:51 2010.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
#... | mit |
n0max/servo | tests/wpt/css-tests/tools/html5lib/parse.py | 420 | 8783 | #!/usr/bin/env python
"""usage: %prog [options] filename
Parse a document to a tree, with optional profiling
"""
import sys
import os
import traceback
from optparse import OptionParser
from html5lib import html5parser, sanitizer
from html5lib.tokenizer import HTMLTokenizer
from html5lib import treebuilders, serializ... | mpl-2.0 |
nens/threedi-verification | threedi_verification/views.py | 1 | 6949 | # (c) Nelen & Schuurmans. GPL licensed, see LICENSE.txt.
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division
from __future__ import print_function, unicode_literals
from collections import OrderedDict
import itertools
import logging
from django.conf import settings
from django.core.urlresolvers i... | gpl-3.0 |
Lax/Packages | ganglia-gmond-modules-python-plugins/usr/lib64/ganglia/python_modules/sockstat.py | 1 | 2803 | # sockstat module for ganglia 3.1.x and above
# Copyright (C) Wang Jian <lark@linux.net.cn>, 2009
import os, sys
import time
last_poll_time = 0
sockstats = {
'tcp_total': 0,
'tcp_established': 0,
'tcp_orphan': 0,
'tcp_timewait': 0,
'udp_total': 0 }
def metric_update():
global sockstats
f... | gpl-3.0 |
ljnutal6/media-recommend | app/virtualenvs/recommedia/lib/python2.7/site-packages/setuptools/sandbox.py | 76 | 9449 | import os, sys, tempfile, operator, pkg_resources
if os.name == "java":
import org.python.modules.posix.PosixModule as _os
else:
_os = sys.modules[os.name]
try:
_file = file
except NameError:
_file = None
_open = open
from distutils.errors import DistutilsError
from pkg_resources import working_set
fro... | gpl-2.0 |
bikeNomad/mbed | workspace_tools/hooks.py | 55 | 4593 | # Configurable hooks in the build system. Can be used by various platforms
# to customize the build process.
################################################################################
# Hooks for the various parts of the build process
# Internal mapping of hooks per tool
_hooks = {}
# Internal mapping of runni... | apache-2.0 |
SivagnanamCiena/robotframework | setup.py | 16 | 3334 | #!/usr/bin/env python
import sys
import os
from os.path import abspath, join, dirname
from distutils.core import setup
try:
import setuptools # use setuptools when available
except ImportError:
pass
CURDIR = dirname(abspath(__file__))
execfile(join(CURDIR, 'src', 'robot', 'version.py'))
VERSION = get_ver... | apache-2.0 |
kmod/icbd | stdlib/python2.5/idlelib/FormatParagraph.py | 57 | 5726 | # Extension to format a paragraph
# Does basic, standard text formatting, and also understands Python
# comment blocks. Thus, for editing Python source code, this
# extension is really only suitable for reformatting these comment
# blocks or triple-quoted strings.
# Known problems with comment reformatting:
# * If t... | mit |
jjx02230808/project0223 | sklearn/ensemble/partial_dependence.py | 251 | 15097 | """Partial dependence plots for tree ensembles. """
# Authors: Peter Prettenhofer
# License: BSD 3 clause
from itertools import count
import numbers
import numpy as np
from scipy.stats.mstats import mquantiles
from ..utils.extmath import cartesian
from ..externals.joblib import Parallel, delayed
from ..externals im... | bsd-3-clause |
OTWillems/GEO1005 | SpatialDecision/external/networkx/algorithms/tree/branchings.py | 32 | 25237 | # encoding: utf-8
"""
Algorithms for finding optimum branchings and spanning arborescences.
This implementation is based on:
J. Edmonds, Optimum branchings, J. Res. Natl. Bur. Standards 71B (1967),
233–240. URL: http://archive.org/details/jresv71Bn4p233
"""
# TODO: Implement method from Gabow, Galil, Spence ... | gpl-2.0 |
shravan-achar/servo | tests/wpt/web-platform-tests/conformance-checkers/tools/ins-del-datetime.py | 107 | 8420 | # -*- coding: utf-8 -*-
import os
ccdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
template = """<!DOCTYPE html>
<meta charset=utf-8>
"""
errors = {
"date-year-0000": "0000-12-09",
"date-month-00": "2002-00-15",
"date-month-13": "2002-13-15",
"date-0005-02-29": "0005-02-29",
"date... | mpl-2.0 |
elijah513/django | tests/staticfiles_tests/cases.py | 270 | 4520 | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals
import codecs
import os
import shutil
import tempfile
from django.conf import settings
from django.core.management import call_command
from django.template import Context, Template
from django.test import SimpleTestCase, override_settings
from django.u... | bsd-3-clause |
mKeRix/home-assistant | homeassistant/components/lcn/light.py | 12 | 5827 | """Support for LCN lights."""
import pypck
from homeassistant.components.light import (
ATTR_BRIGHTNESS,
ATTR_TRANSITION,
SUPPORT_BRIGHTNESS,
SUPPORT_TRANSITION,
LightEntity,
)
from homeassistant.const import CONF_ADDRESS
from . import LcnDevice
from .const import (
CONF_CONNECTIONS,
CONF_... | mit |
teltek/edx-platform | common/djangoapps/edxmako/tests.py | 4 | 6742 | import unittest
import ddt
from django.conf import settings
from django.urls import reverse
from django.http import HttpResponse
from django.test import TestCase
from django.test.client import RequestFactory
from django.test.utils import override_settings
from edx_django_utils.cache import RequestCache
from mock impor... | agpl-3.0 |
40223136/2015cdag1man | static/Brython3.1.3-20150514-095342/Lib/textwrap.py | 745 | 16488 | """Text wrapping and filling.
"""
# Copyright (C) 1999-2001 Gregory P. Ward.
# Copyright (C) 2002, 2003 Python Software Foundation.
# Written by Greg Ward <gward@python.net>
import re
__all__ = ['TextWrapper', 'wrap', 'fill', 'dedent', 'indent']
# Hardcode the recognized whitespace characters to the US-ASCII
# whit... | gpl-3.0 |
ddaze/invenio | invenio/version.py | 3 | 1187 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2014, 2015 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... | gpl-2.0 |
paolomonella/ursus | xmlToolBox/minidomToolBox.py | 1 | 7687 | #! /usr/bin/env python
# This is a toolbox I'm using to look for specific things in the XML DOM
##################
# Import modules #
##################
from __future__ import print_function
from xml.dom.minidom import parse, parseString
#import xml.dom.minidom
#################
# Parse the XML #
#################
... | gpl-2.0 |
FFMG/myoddweb.piger | monitor/api/python/Python-3.7.2/Modules/_decimal/libmpdec/literature/fnt.py | 50 | 7169 | #
# Copyright (c) 2008-2016 Stefan Krah. 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
# notice, this list of conditions ... | gpl-2.0 |
apdavison/python-neo | neo/test/iotest/test_neuralynxio.py | 1 | 18949 | """
Tests of neo.io.neuralynxio.py
"""
import time
import warnings
import unittest
import numpy as np
import quantities as pq
from neo.test.iotest.common_io_test import BaseTestIO
from neo.core import *
from neo.io.neuralynxio import NeuralynxIO
from neo import AnalogSignal
class CommonNeuralynxIOTest(BaseTestIO... | bsd-3-clause |
cupy/cupy | tests/cupy_tests/random_tests/test_generator.py | 1 | 39103 | import functools
import os
import threading
import unittest
import numpy
import pytest
import cupy
from cupy import cuda
from cupy.cuda import runtime
from cupy.random import _generator
from cupy import testing
from cupy.testing import _attr
from cupy.testing import _condition
from cupy.testing import _hypothesis
fr... | mit |
karthick03/python3-in-one-pic | src/nativeDatatypes.py | 19 | 2928 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Number
## integer
a = 1
b = 0x10 # 16
c = 0o10 # 8
d = 0b10 # 2
print(type(a)) # <class 'int'>
## float
c = 1.2
d = .5 # 0.5
g = .314e1 # 3.14
print(type(g)) # <class 'float'>
## complex
e = 1+2j
f = comp... | mit |
btat/Booktype | lib/booktype/apps/reader/tests/functest_views.py | 1 | 8237 | from django.test import TestCase
from django.core.urlresolvers import reverse
from .factory_models import UserFactory, BookFactory, BookVersionFactory
from .factory_models import ChapterFactory, BookTocFactory
from .factory_models import PLAIN_USER_PASSWORD
class ReaderBaseTestCase(TestCase):
"""
Base test ca... | agpl-3.0 |
Coelhon/MasterRepo.repository | plugin.video.specto/resources/lib/sources/disabled/hevcfilm_mv.py | 2 | 4438 | # -*- coding: utf-8 -*-
'''
Specto Add-on
Copyright (C) 2015 lambda
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 l... | gpl-2.0 |
eerwitt/tensorflow | tensorflow/contrib/graph_editor/tests/subgraph_test.py | 147 | 3511 | # 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 |
baroquebobcat/pants | contrib/go/tests/python/pants_test/contrib/go/tasks/test_go_binary_create.py | 1 | 1949 | # coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
from pant... | apache-2.0 |
abstract-open-solutions/l10n-italy | l10n_it_bill_of_entry/company.py | 15 | 1752 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2013 Agile Business Group sagl (<http://www.agilebg.com>)
# Copyright (C) 2013
# Associazione OpenERP Italia (<http://www.openerp-italia.org>)
#
# This program is free software: you can r... | agpl-3.0 |
don-github/edx-platform | common/lib/symmath/symmath/formula.py | 66 | 25851 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Flexible python representation of a symbolic mathematical formula.
Acceptes Presentation MathML, Content MathML (and could also do OpenMath).
Provides sympy representation.
"""
#
# File: formula.py
# Date: 04-May-12 (creation)
# Author: I. Chuang <ichuang@mit.edu>
#
im... | agpl-3.0 |
ryfeus/lambda-packs | Tensorflow_Pandas_Numpy/source3.6/tensorflow/python/keras/_impl/keras/applications/imagenet_utils.py | 15 | 7524 | # 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... | mit |
aureooms/networkx | networkx/algorithms/swap.py | 12 | 9844 | # -*- coding: utf-8 -*-
"""Swap edges in a graph.
"""
# Copyright (C) 2004-2015 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
from __future__ import division
import math
import random
import networkx as n... | bsd-3-clause |
837278709/metro-openerp | metro_project/wizard/task_print.py | 2 | 6522 | # -*- 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 |
niallrmurphy/pyvern | test_tree.py | 1 | 20890 | #!/usr/bin/env python
# encoding: utf-8
# Niall Richard Murphy <niallm@gmail.com>
"""Test the tree (gap-production) object."""
import sys
import constants
import random
import tree
# Perhaps unittest2 is available. Try to import it, for
# those cases where we are running python 2.7.
try:
import unittest2 as unitt... | apache-2.0 |
grivescorbett/heroku-buildpack-python | vendor/pip-pop/pip/_vendor/html5lib/treebuilders/_base.py | 915 | 13711 | from __future__ import absolute_import, division, unicode_literals
from pip._vendor.six import text_type
from ..constants import scopingElements, tableInsertModeElements, namespaces
# The scope markers are inserted when entering object elements,
# marquees, table cells, and table captions, and are used to prevent for... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.