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 |
|---|---|---|---|---|---|
bsilverthorn/qy | src/qy/test/test_language.py | 1 | 8791 | """
@author: Bryan Silverthorn <bcs@cargo-cult.org>
"""
import math
import numpy
import qy
from nose.tools import (
assert_true,
assert_false,
assert_equal,
assert_raises,
assert_almost_equal,
)
from qy import (
emit_and_execute,
Object,
)
def test_qy_python_no_arguments():
""... | mit |
kawasaki2013/python-for-android-x86 | python3-alpha/python3-src/Lib/unittest/test/test_discovery.py | 785 | 13838 | import os
import re
import sys
import unittest
class TestableTestProgram(unittest.TestProgram):
module = '__main__'
exit = True
defaultTest = failfast = catchbreak = buffer = None
verbosity = 1
progName = ''
testRunner = testLoader = None
def __init__(self):
pass
class TestDisc... | apache-2.0 |
saurabh6790/med_app_rels | install_erpnext.py | 15 | 10409 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
#!/usr/bin/env python
from __future__ import unicode_literals
import os, sys
import argparse
is_redhat = is_debian = None
root_password = None
requirements = [
"chardet",
"cssmin",
"... | agpl-3.0 |
renyi533/tensorflow | tensorflow/python/ops/linalg/sparse/conjugate_gradient.py | 6 | 5706 | # 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 |
silly-wacky-3-town-toon/SOURCE-COD | Panda3D-1.10.0/Pmw/Pmw_1_3/lib/PmwScrolledListBox.py | 5 | 12709 | # Based on iwidgets2.2.0/scrolledlistbox.itk code.
import types
import Tkinter
import Pmw
class ScrolledListBox(Pmw.MegaWidget):
_classBindingsDefinedFor = 0
def __init__(self, parent = None, **kw):
# Define the megawidget options.
INITOPT = Pmw.INITOPT
optiondefs = (
('dblclickcommand', None, ... | apache-2.0 |
cms-btv-pog/rootpy | rootpy/tree/categories.py | 4 | 9881 | # Copyright 2012 the rootpy developers
# distributed under the terms of the GNU General Public License
from __future__ import absolute_import
import re
from .cut import Cut
__all__ = [
'Categories',
]
class Categories(object):
"""
Implements a mechanism to ease the creation of cuts that describe
no... | gpl-3.0 |
florian-f/sklearn | examples/cluster/plot_dbscan.py | 3 | 2634 | # -*- coding: utf-8 -*-
"""
===================================
Demo of DBSCAN clustering algorithm
===================================
Finds core samples of high density and expands clusters from them.
"""
print(__doc__)
import numpy as np
from scipy.spatial import distance
from sklearn.cluster import DBSCAN
from s... | bsd-3-clause |
michalliu/OpenWrt-Firefly-Libraries | staging_dir/target-mipsel_1004kc+dsp_uClibc-0.9.33.2/usr/lib/python3.4/ctypes/test/test_buffers.py | 97 | 2284 | from ctypes import *
from ctypes.test import need_symbol
import unittest
class StringBufferTestCase(unittest.TestCase):
def test_buffer(self):
b = create_string_buffer(32)
self.assertEqual(len(b), 32)
self.assertEqual(sizeof(b), 32 * sizeof(c_char))
self.assertIs(type(b[0]), bytes)... | gpl-2.0 |
rasata/ansible | lib/ansible/plugins/cache/__init__.py | 67 | 2087 | # (c) 2014, 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 |
nnarang7/python_koans | python2/koans/about_strings.py | 58 | 3030 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
class AboutStrings(Koan):
def test_double_quoted_strings_are_strings(self):
string = "Hello, world."
self.assertEqual(__, isinstance(string, basestring))
def test_single_quoted_strings_are_also_strings(self):
st... | mit |
mbrubeck/servo | tests/wpt/web-platform-tests/tools/third_party/py/py/_log/warning.py | 60 | 2565 | import py, sys
class DeprecationWarning(DeprecationWarning):
def __init__(self, msg, path, lineno):
self.msg = msg
self.path = path
self.lineno = lineno
def __repr__(self):
return "%s:%d: %s" %(self.path, self.lineno+1, self.msg)
def __str__(self):
return self.msg
d... | mpl-2.0 |
Intel-Corporation/tensorflow | tensorflow/examples/saved_model/integration_tests/export_mnist_cnn.py | 3 | 8104 | # 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 |
pengzhangdev/PokemonGo-Bot | pokemongo_bot/cell_workers/evolve_pokemon.py | 1 | 7211 | from random import uniform
from pokemongo_bot import inventory
from pokemongo_bot.human_behaviour import sleep
from pokemongo_bot.inventory import Pokemon
from pokemongo_bot.item_list import Item
from pokemongo_bot.base_task import BaseTask
class EvolvePokemon(BaseTask):
SUPPORTED_TASK_API_VERSION = 1
def __... | mit |
nemesisdesign/django | tests/forms_tests/widget_tests/test_selectmultiple.py | 25 | 4817 | from django.forms import SelectMultiple
from .base import WidgetTest
class SelectMultipleTest(WidgetTest):
widget = SelectMultiple
numeric_choices = (('0', '0'), ('1', '1'), ('2', '2'), ('3', '3'), ('0', 'extra'))
def test_render_selected(self):
self.check_html(self.widget(choices=self.beatles),... | bsd-3-clause |
blstream/ut-arena | ut_arena_py_api/ut_arena/settings.py | 1 | 3193 | """
Django settings for ut_arena_py_api project.
Generated by 'django-admin startproject' using Django 1.9.2.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/settings/
"""
impo... | apache-2.0 |
UstadMobile/exelearning-ustadmobile-work | twisted/test/test_udp.py | 23 | 24961 | # -*- test-case-name: twisted.test.test_udp -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for implementations of L{IReactorUDP} and L{IReactorMulticast}.
"""
from __future__ import division, absolute_import
from twisted.trial import unittest
from twisted.python.compat import ... | gpl-2.0 |
brunousml/inbox | inbox/users/migrations/0001_initial.py | 265 | 3054 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.utils.timezone
import django.contrib.auth.models
import django.core.validators
class Migration(migrations.Migration):
dependencies = [
('auth', '0006_require_contenttypes_0002'),
]
... | bsd-2-clause |
cogmission/nupic | tests/unit/nupic/algorithms/cla_classifier_diff_test.py | 35 | 1634 | #!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions ... | agpl-3.0 |
hifly/OpenUpgrade | addons/website_event/models/event.py | 89 | 5542 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | agpl-3.0 |
brentp/methylcode | bench/scripts/fastq_pair_filter.py | 3 | 4382 | #!/usr/bin/python
"""
%prog [options] pair_1.fastq pair_2.fastq
filter reads from paired fastq so that no unmatching reads remain.
output files are pair_1.fastq.trim and pair_2.fastq.trim
see: http://hackmap.blogspot.com/2010/09/filtering-paired-end-reads-high.html
"""
__version__ = "0.1.0"
from subprocess import Pop... | bsd-3-clause |
hassoon3/odoo | openerp/addons/test_documentation_examples/tests/test_delegation.py | 366 | 1299 | # -*- coding: utf-8 -*-
from openerp.tests import common
class TestDelegation(common.TransactionCase):
def setUp(self):
super(TestDelegation, self).setUp()
env = self.env
record = env['delegation.parent'].create({
'child0_id': env['delegation.child0'].create({'field_0': 0}).id,... | agpl-3.0 |
OsirisSPS/osiris-sps | client/share/plugins/AF9A4C281070FDB0F34CF417CDB168AB38C8A388/lib/encodings/iso8859_1.py | 593 | 13432 | """ Python Character Mapping Codec iso8859_1 generated from 'MAPPINGS/ISO8859/8859-1.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,input,errors='... | gpl-3.0 |
ffleischer/muzei | web/models.py | 21 | 1288 | # Copyright 2014 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 |
ThePletch/ansible | lib/ansible/modules/cloud/amazon/s3_sync.py | 9 | 18213 | #!/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 |
ahmadshahwan/cohorte-runtime | python/src/lib/python/unidecode/x01d.py | 240 | 3608 | data = (
'', # 0x00
'', # 0x01
'', # 0x02
'', # 0x03
'', # 0x04
'', # 0x05
'', # 0x06
'', # 0x07
'', # 0x08
'', # 0x09
'', # 0x0a
'', # 0x0b
'', # 0x0c
'', # 0x0d
'', # 0x0e
'', # 0x0f
'', # 0x10
'', # 0x11
'', # 0x12
'', # 0x13
'', # 0x14
'', # 0x15
'',... | apache-2.0 |
mj10777/QGIS | python/plugins/processing/algs/qgis/MinimumBoundingGeometry.py | 30 | 11887 | # -*- coding: utf-8 -*-
"""
***************************************************************************
MinimumBoundingGeometry.py
--------------------------
Date : September 2017
Copyright : (C) 2017 by Nyall Dawson
Email : nyall dot dawson at gmail dot co... | gpl-2.0 |
huor/incubator-hawq | pxf/src/scripts/pxf_manual_failover.py | 12 | 5127 | #!/usr/bin/env python
# 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
# "Li... | apache-2.0 |
orekyuu/intellij-community | python/lib/Lib/site-packages/django/utils/unittest/main.py | 332 | 9388 | """Unittest main program"""
import sys
import os
import types
from django.utils.unittest import loader, runner
try:
from django.utils.unittest.signals import installHandler
except ImportError:
installHandler = None
__unittest = True
FAILFAST = " -f, --failfast Stop on first failure\n"
CATCHBREAK = ... | apache-2.0 |
brean/python-pathfinding | pathfinding/finder/finder.py | 1 | 6586 | # -*- coding: utf-8 -*-
import heapq # used for the so colled "open list" that stores known nodes
import time # for time limitation
from pathfinding.core.util import SQRT2
from pathfinding.core.diagonal_movement import DiagonalMovement
# max. amount of tries we iterate until we abort the search
MAX_RUNS = float('in... | mit |
django-id/website | app_author/models.py | 1 | 2195 | from django.contrib.auth.models import User
from django.core.exceptions import ValidationError
from django.db import models
from django.db.models.signals import post_save
from django.dispatch import receiver
# CUSTOM FILE SIZE VALIDATOR
def validate_image(fieldfile_obj):
"""
Limit image size upload
"""
... | mit |
shurihell/testasia | common/lib/xmodule/xmodule/error_module.py | 115 | 7587 | """
Modules that get shown to the users when an error has occurred while
loading or rendering other modules
"""
import hashlib
import logging
import json
import sys
from lxml import etree
from xmodule.x_module import XModule, XModuleDescriptor
from xmodule.errortracker import exc_info_to_str
from xblock.fields import... | agpl-3.0 |
alexgamas/p2pool | wstools/TimeoutSocket.py | 293 | 5293 | """Based on code from timeout_socket.py, with some tweaks for compatibility.
These tweaks should really be rolled back into timeout_socket, but it's
not totally clear who is maintaining it at this point. In the meantime,
we'll use a different module name for our tweaked version to avoid any
confusion.
T... | gpl-3.0 |
maciejkula/scipy | scipy/__init__.py | 2 | 4603 | """
SciPy: A scientific computing package for Python
================================================
Documentation is available in the docstrings and
online at http://docs.scipy.org.
Contents
--------
SciPy imports all the functions from the NumPy namespace, and in
addition provides:
Subpackages
-----------
Using a... | bsd-3-clause |
apanju/odoo | openerp/report/common.py | 457 | 3337 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 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 |
seanli9jan/tensorflow | tensorflow/contrib/training/python/training/sampling_ops.py | 18 | 17360 | # 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 |
dancingdan/tensorflow | tensorflow/python/kernel_tests/reduction_ops_test_big.py | 14 | 7391 | # 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 |
escapewindow/mozharness | test/test_base_script.py | 11 | 31844 | import gc
import mock
import os
import re
import types
import unittest
PYWIN32 = False
if os.name == 'nt':
try:
import win32file
PYWIN32 = True
except:
pass
import mozharness.base.errors as errors
import mozharness.base.log as log
from mozharness.base.log import DEBUG, INFO, WARNING, E... | mpl-2.0 |
mhl/mysociety-cvs | sitestats/pylib/sitestats/backports/contrib/auth/middleware.py | 1 | 2933 | from django.contrib import auth
from django.core.exceptions import ImproperlyConfigured
class RemoteUserMiddleware(object):
"""
Middleware for utilizing web-server-provided authentication.
If request.user is not authenticated, then this middleware attempts to
authenticate the username passed in the ``... | agpl-3.0 |
perfidia/seleshot | doc/gen_api.py | 1 | 3756 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
import os
import sys
import string
sys.path.append('../src')
import seleshot
TEMPLATE = """===
API
===
"""
OUTPUT = os.path.join("_static", "api.txt")
# from http://legacy.python.org/dev/peps/pep-0257/
def trim(docstring):
if not docstring:
re... | mit |
batermj/algorithm-challenger | code-analysis/programming_anguage/python/source_codes/Python3.8.0/Python-3.8.0/Lib/encodings/iso2022_jp_3.py | 816 | 1061 | #
# iso2022_jp_3.py: Python Unicode Codec for ISO2022_JP_3
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
import _codecs_iso2022, codecs
import _multibytecodec as mbc
codec = _codecs_iso2022.getcodec('iso2022_jp_3')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class Incrementa... | apache-2.0 |
whr20120503/wy | node_modules/gulp-sass/node_modules/node-sass/node_modules/pangyp/gyp/pylib/gyp/generator/msvs.py | 372 | 124844 | # 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.
import collections
import copy
import ntpath
import os
import posixpath
import re
import subprocess
import sys
import gyp.common
import gyp.easy_xml as easy_xml
i... | mit |
nanshihui/PocCollect | component/JDWP/JDWPvul.py | 1 | 2106 | #!/usr/bin/env python
# encoding: utf-8
from t import T
import os
import platform
import subprocess
import signal
import time
import requests,urllib2,json,urlparse
class TimeoutError(Exception):
pass
def command(cmd, timeout=60):
"""Run command and return the output
cmd - the command to run
timeout - m... | mit |
hsuchie4/TACTIC | src/pyasm/deprecated/flash/site/shot_tab_wdg.py | 6 | 11615 | ###########################################################
#
# Copyright (c) 2005, Southpaw Technology
# All Rights Reserved
#
# PROPRIETARY INFORMATION. This software is proprietary to
# Southpaw Technology, and is not to be reproduced, transmitted,
# or disclosed in any way without written permi... | epl-1.0 |
stuart-stanley/RackHD | test/tests/rackhd11/test_rackhd11_api_lookups.py | 12 | 3817 | '''
Copyright 2016, EMC, Inc.
Author(s):
George Paulos
'''
import fit_path # NOQA: unused import
import os
import sys
import subprocess
import fit_common
# Select test group here using @attr
from nose.plugins.attrib import attr
@attr(api_1_1=True)
class rackhd11_api_lookups(fit_common.unittest.TestCase):
def... | apache-2.0 |
jaor/bigmler | bigmler/tests/test_15_delete_dir.py | 1 | 2579 | # -*- coding: utf-8 -*-
#!/usr/bin/env python
#
# Copyright 2015-2020 BigML
#
# 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 requi... | apache-2.0 |
jbedorf/tensorflow | tensorflow/contrib/cudnn_rnn/python/ops/cudnn_rnn_ops.py | 2 | 80868 | # 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 |
vnsofthe/odoo-dev | addons/purchase/wizard/purchase_order_group.py | 376 | 3379 | # -*- 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 |
exploreodoo/datStruct | odoo/addons/hr_timesheet/__init__.py | 410 | 1104 | # -*- 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... | gpl-2.0 |
OpenAcademy-OpenStack/nova-scheduler | nova/crypto.py | 14 | 16165 | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# 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 ... | apache-2.0 |
archen/django | django/utils/text.py | 3 | 15042 | from __future__ import unicode_literals
import re
import unicodedata
from gzip import GzipFile
from io import BytesIO
import warnings
from django.utils.encoding import force_text
from django.utils.functional import allow_lazy, SimpleLazyObject
from django.utils import six
from django.utils.six.moves import html_entit... | bsd-3-clause |
sugartom/tensorflow-alien | tensorflow/python/kernel_tests/spacetobatch_op_test.py | 115 | 24899 | # 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 |
bdh1011/wau | venv/lib/python2.7/encodings/cp1251.py | 593 | 13617 | """ Python Character Mapping Codec cp1251 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1251.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... | mit |
theonewolf/siegvswolf | lib/requests/packages/urllib3/__init__.py | 650 | 1701 | # urllib3/__init__.py
# Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt)
#
# This module is part of urllib3 and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
urllib3 - Thread-safe connection pooling and re-using.
"""
__author__ = 'Andrey Petrov (a... | mit |
nojhan/weboob-devel | modules/adecco/module.py | 7 | 17064 | # -*- coding: utf-8 -*-
# Copyright(C) 2013 Bezleputh
#
# This file is part of weboob.
#
# weboob 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 opt... | agpl-3.0 |
glmcdona/meddle | examples/example_deviceiocontrol/processes.py | 1 | 1377 | from process_base import *
from targets import *
import subprocess
import os
class ProcessDeviceIo(ProcessBase):
def __init__(self, Controller, crashdump_folder, breakpoint_handler, pid, ph, unique_identifier, verbose, logger):
# Specific options
self.path_to_exe = b"C:\\Windows\\System32\\notepad.exe"
self.c... | mit |
x111ong/odoo | addons/mrp_operations/report/mrp_code_barcode.py | 381 | 1511 | # -*- 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 |
GlitchKernel/Glitch-i9300 | tools/perf/scripts/python/failed-syscalls-by-pid.py | 11180 | 2058 | # failed 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 failed system call totals, broken down by pid.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.pa... | gpl-2.0 |
infraredbg/Lenovo_A820_kernel_kk | bionic/libc/tools/genserv.py | 8 | 1980 | #!/usr/bin/env python
#
import sys, os, string, re
def usage():
print """\
usage: genserv < /etc/services > libc/netbsd/net/services.h
this program is used to generate the hard-coded internet service list for the
Bionic C library.
"""
re_service = re.compile(r"([\d\w\-_]+)\s+(\d+)/(tcp|udp)(.*)")
re_alia... | gpl-2.0 |
mncoon/odoo-addons | syscoon_purchase_vendor_products/models/purchase_vendor_products.py | 2 | 1167 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from lxml import etree
from openerp import models, fields, api
class PurchaseOrder(models.Model):
_inherit = 'purchase.order'
product_filter = fields.Boolean('Product Filter', default=True)
@api.multi
... | lgpl-3.0 |
building39/nebula2 | scripts/cdmi_explorer/CDMIMain/handlers.py | 1 | 2951 | '''
Created on Jun 9, 2013
@author: mmartin
'''
import sys
from gi.repository import Gtk
from CDMIAbout import CDMIAbout
from CDMIConnect import CDMIConnect
from CDMIHelp import CDMIHelp
class Handlers(object):
'''
classdocs
'''
def __init__(self, session):
self.session = session
de... | apache-2.0 |
galenhz/micropython | tests/basics/memoryview1.py | 56 | 1328 | # test memoryview
# test reading from bytes
b = b'1234'
m = memoryview(b)
print(len(m))
print(m[0], m[1], m[-1])
print(list(m))
# test writing to bytes
try:
m[0] = 1
except TypeError:
print("TypeError")
# test writing to bytearray
b = bytearray(b)
m = memoryview(b)
m[0] = 1
print(b)
print(list(m))
# test sl... | mit |
dresden-weekly/ansible | lib/ansible/runner/lookup_plugins/nested.py | 174 | 2285 | # (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 |
cliburn/flow | src/plugins/statistics/summary.py | 1 | 1069 | """Provide summary statistics on data."""
from plugin import Statistics
from numpy import min, max, mean, median, std
class Summary(Statistics):
"""Plugin to display summary statistics"""
name = "Summary"
def Main(self, model):
"""Calculate summary statistics"""
self.model = model
f... | gpl-3.0 |
fitermay/intellij-community | python/helpers/py3only/docutils/languages/__init__.py | 170 | 1626 | # $Id: __init__.py 7648 2013-04-18 07:36:22Z milde $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
# Internationalization details are documented in
# <http://docutils.sf.net/docs/howto/i18n.html>.
"""
This package contains modules for language-dependent fe... | apache-2.0 |
mementum/backtrader | backtrader/analyzers/logreturnsrolling.py | 1 | 5020 | #!/usr/bin/env python
# -*- coding: utf-8; py-indent-offset:4 -*-
###############################################################################
#
# Copyright (C) 2015-2020 Daniel Rodriguez
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License a... | gpl-3.0 |
mihaip/delicious2google | app/openid/dh.py | 168 | 1608 | from openid import cryptutil
from openid import oidutil
def strxor(x, y):
if len(x) != len(y):
raise ValueError('Inputs to strxor must have the same length')
xor = lambda (a, b): chr(ord(a) ^ ord(b))
return "".join(map(xor, zip(x, y)))
class DiffieHellman(object):
DEFAULT_MOD = 15517289818147... | apache-2.0 |
codilime/cloudify-agent | cloudify_agent/installer/config/decorators.py | 1 | 5377 | #########
# Copyright (c) 2015 GigaSpaces Technologies Ltd. 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 |
liang42hao/bokeh | bokeh/server/models/server_model.py | 13 | 1124 | from __future__ import absolute_import
from bokeh.exceptions import DataIntegrityException, UnauthorizedException
class ServerModel(object):
idfield = None
typename = None
@classmethod
def modelkey(cls, objid):
return "model:%s:%s"% (cls.typename, objid)
def mykey(self):
return s... | bsd-3-clause |
JazzeYoung/VeryDeepAutoEncoder | pylearn2/pylearn2/corruption.py | 44 | 12818 | """
Corruptor classes: classes that encapsulate the noise process for the DAE
training criterion.
"""
# Third-party imports
from __future__ import print_function
import numpy
import theano
from theano import tensor
T = tensor
from pylearn2.utils.rng import make_np_rng
# Shortcuts
theano.config.warn.sum_div_dimshuffle... | bsd-3-clause |
cloudbau/cinder | cinder/api/v1/snapshot_metadata.py | 6 | 6264 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 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.apach... | apache-2.0 |
liubenyuan/vispy-tutorial | examples/04-tetrahedron.py | 1 | 4445 | # pylint: disable=invalid-name, no-member, unused-argument
""" passing varyings to fragment """
import numpy as np
from vispy import app, gloo
from vispy.util.transforms import translate, perspective, rotate
# note the 'color' and 'v_color' in vertex
vertex = """
uniform mat4 u_model; // Model matrix
uniform... | apache-2.0 |
ChristinaZografou/sympy | sympy/core/containers.py | 29 | 7731 | """Module for SymPy containers
(SymPy objects that store other SymPy objects)
The containers implemented in this module are subclassed to Basic.
They are supposed to work seamlessly within the SymPy framework.
"""
from __future__ import print_function, division
from sympy.core.basic import Basic
from sy... | bsd-3-clause |
seomoz/simhash-db-py | simhash_db/hbase_client.py | 1 | 3893 | #! /usr/bin/env python
'''Our code to connect to the HBase backend. It uses the happybase
package, which depends on the Thrift service that (for now) is
part of HBase.'''
from gevent import monkey
monkey.patch_all()
import struct
import happybase
import Hbase_thrift
from . import BaseClient
def column_name(integer... | mit |
awes0menessInc/python-projects | Alien-Invasion/button.py | 1 | 1269 | import pygame.font
class Button():
""" A class to create a button. """
def __init__(self, screen, msg):
"""Initialize button attributes."""
self.screen = screen
self.screen_rect = screen.get_rect()
# Set the dimensions and properties of the button.
self.width, self.he... | mit |
msfrank/mandelbrot | mandelbrot/registry.py | 1 | 3001 | # Copyright 2015 Michael Frank <msfrank@syntaxjockey.com>
#
# This file is part of Mandelbrot.
#
# Mandelbrot 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 opti... | gpl-3.0 |
andrewmoses/ssquiz | flask/lib/python2.7/site-packages/sqlalchemy/connectors/pyodbc.py | 59 | 6264 | # connectors/pyodbc.py
# Copyright (C) 2005-2015 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
from . import Connector
from .. import util
import sys
import re
class PyOD... | bsd-3-clause |
farazrehman/aws-resources | CloudFormation/nash/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/utf8prober.py | 2919 | 2652 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org 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 Reserved.
#
# Con... | gpl-2.0 |
edoko/Air_Kernel-N5 | Documentation/target/tcm_mod_builder.py | 4981 | 41422 | #!/usr/bin/python
# The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD
#
# Copyright (c) 2010 Rising Tide Systems
# Copyright (c) 2010 Linux-iSCSI.org
#
# Author: nab@kernel.org
#
import os, sys
import subprocess as sub
import string
import re
import optparse
tcm_dir = ""
fabric_ops... | gpl-2.0 |
gardner/youtube-dl | youtube_dl/downloader/dash.py | 81 | 2343 | from __future__ import unicode_literals
import re
from .common import FileDownloader
from ..compat import compat_urllib_request
class DashSegmentsFD(FileDownloader):
"""
Download segments in a DASH manifest
"""
def real_download(self, filename, info_dict):
self.report_destination(filename)
... | unlicense |
jaimahajan1997/sympy | sympy/core/tests/test_evalf.py | 18 | 19147 | from sympy import (Abs, Add, atan, ceiling, cos, E, Eq, exp,
factorial, fibonacci, floor, Function, GoldenRatio, I, Integral,
integrate, log, Mul, N, oo, pi, Pow, product, Product,
Rational, S, Sum, sin, sqrt, sstr, sympify, Symbol, Max, nfloat)
from sympy.core.evalf import (complex_accuracy, PrecisionExhau... | bsd-3-clause |
fga-gpp-mds/2017.2-Receituario-Medico | medical_prescription/exam/test/test_view_list_exam.py | 1 | 2093 | # Django imports
from django.test import TestCase
from django.test.client import RequestFactory
from django.contrib.auth.models import AnonymousUser
from django.core.exceptions import PermissionDenied
# Local Django imports
from exam.views import ListExams
from user.models import User, Patient, HealthProfessional
cl... | mit |
anitailieva/fullstack-javascript | node_modules/node-gyp/gyp/PRESUBMIT.py | 1369 | 3662 | # 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.
"""Top-level presubmit script for GYP.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the presubmit API built... | gpl-3.0 |
KaelChen/numpy | numpy/distutils/fcompiler/compaq.py | 102 | 4145 |
#http://www.compaq.com/fortran/docs/
from __future__ import division, absolute_import, print_function
import os
import sys
from numpy.distutils.fcompiler import FCompiler
from numpy.distutils.compat import get_exception
from distutils.errors import DistutilsPlatformError
compilers = ['CompaqFCompiler']
if os.name !... | bsd-3-clause |
rshk/python-pcapng | tests/test_parse_wireshark_capture_files.py | 1 | 10200 | import pytest
from pcapng.blocks import InterfaceDescription, ObsoletePacket, SectionHeader
from pcapng.scanner import FileScanner
def test_sample_test001_ntar():
with open("test_data/test001.ntar", "rb") as fp:
scanner = FileScanner(fp)
blocks = list(scanner)
# There is just a section h... | apache-2.0 |
lunixbochs/actualvim | lib/neovim/api/buffer.py | 1 | 6063 | """API for working with a Nvim Buffer."""
from .common import Remote
from ..compat import IS_PYTHON3
__all__ = ('Buffer')
if IS_PYTHON3:
basestring = str
def adjust_index(idx, default=None):
"""Convert from python indexing convention to nvim indexing convention."""
if idx is None:
return defau... | mit |
asherkhb/coge | bin/last_wrapper/Bio/Motif/Thresholds.py | 3 | 3447 | # Copyright 2008 by Norbert Dojer. All rights reserved.
# Adapted by Bartek Wilczynski.
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
"""Approximate calculation of appropriate thresholds for motif ... | bsd-2-clause |
emonty/vhd-util | tools/python/xen/web/static.py | 52 | 2001 | #============================================================================
# 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 the Free Software Foundation.
#
# This library is distributed in the hope th... | gpl-2.0 |
bthirion/nipy | examples/labs/need_data/localizer_glm_ar.py | 3 | 5428 | #!/usr/bin/env python
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
from __future__ import print_function # Python 2/3 compatibility
__doc__ = """
Full step-by-step example of fitting a GLM to experimental data and visualizing
the results.
More specif... | bsd-3-clause |
dstroppa/openstack-smartos-nova-grizzly | nova/tests/test_libvirt_utils.py | 16 | 1444 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2012 NTT Data
# 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/licen... | apache-2.0 |
mitchrule/Miscellaneous | Django_Project/django/Lib/site-packages/django/db/backends/oracle/features.py | 79 | 2298 | from django.db.backends.base.features import BaseDatabaseFeatures
from django.db.utils import InterfaceError
try:
import pytz
except ImportError:
pytz = None
class DatabaseFeatures(BaseDatabaseFeatures):
empty_fetchmany_value = ()
needs_datetime_string_cast = False
interprets_empty_strings_as_nul... | mit |
rmboggs/django | django/utils/feedgenerator.py | 155 | 17772 | """
Syndication feed generation library -- used for generating RSS, etc.
Sample usage:
>>> from django.utils import feedgenerator
>>> feed = feedgenerator.Rss201rev2Feed(
... title="Poynter E-Media Tidbits",
... link="http://www.poynter.org/column.asp?id=31",
... description="A group Weblog by the sharpes... | bsd-3-clause |
rust-lang/sublime-rust | rust/batch.py | 2 | 3832 | """Classes used for aggregating messages that are on the same line."""
from . import util
class MessageBatch:
"""Abstract base class for a set of messages that apply to the same line.
:ivar children: List of additional messages, may be empty.
:ivar hidden: Boolean if this message should be displayed.
... | mit |
amcnicoll/ECV34_TWI_Forward_Firmware | tests/gtest-1.4.0/scripts/gen_gtest_pred_impl.py | 294 | 21993 | #!/usr/bin/env python
#
# Copyright 2006, 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-3.0 |
ChawalitK/odoo | addons/l10n_ro/__openerp__.py | 8 | 1351 | # -*- encoding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
# @author - Fekete Mihai <feketemihai@gmail.com>, Tatár Attila <atta@nvm.ro>
# Copyright (C) 2015 Tatár Attila
# Copyright (C) 2015 Forest and Biomass Services Romania (http://www.forbiom.eu).
# Copyright (C) 2011 TOT... | gpl-3.0 |
hkhamm/django_rest_tutorial_2 | env/lib/python2.7/site-packages/django/contrib/gis/measure.py | 212 | 12367 | # Copyright (c) 2007, Robert Coup <robert.coup@onetrackmind.co.nz>
# 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,
#... | mit |
AthinaB/synnefo | snf-astakos-app/astakos/im/management/commands/service-import.py | 7 | 3862 | # 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 |
rversteegen/commandergenius | project/jni/python/src/Lib/test/regex_tests.py | 136 | 9081 | # Regex test suite and benchmark suite v1.5a2
# Due to the use of r"aw" strings, this file will
# only work with Python 1.5 or higher.
# The 3 possible outcomes for each pattern
[SUCCEED, FAIL, SYNTAX_ERROR] = range(3)
# Benchmark suite (needs expansion)
#
# The benchmark suite does not test correctness, just speed. ... | lgpl-2.1 |
miipl-naveen/optibizz | addons/procurement_jit_stock/__openerp__.py | 241 | 1738 | # -*- 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 |
mikehankey/fireball_camera | ffmpeg_record.py | 1 | 2859 | #!/usr/bin/python3
import glob
import sys
import subprocess
import os
import time
video_dir = "/mnt/ams2"
def check_running(cam_num, type):
if type == "HD":
cmd = "ps -aux |grep \"ffmpeg\" | grep \"HD\" | grep \"cam" + cam_num + "\" | grep -v grep | wc -l"
else:
cmd = "ps -aux |grep \"ffmpeg\" | gr... | gpl-3.0 |
varunarya10/nova_test_latest | nova/tests/unit/api/openstack/compute/contrib/test_agents.py | 33 | 17053 | # Copyright 2012 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.