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 |
|---|---|---|---|---|---|
j-carpentier/nova | nova/tests/unit/cells/test_cells_weights.py | 17 | 9058 | # Copyright (c) 2012 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 |
cfelton/pymtl | pymtl/tools/translation/cpp.py | 8 | 33436 | #=======================================================================
# cpp.py
#=======================================================================
# Tool to translate PyMTL Models into a C simulation object.
from pymtl import *
from cpp_helpers import gen_cheader, gen_cdef, gen_py... | bsd-3-clause |
london-python-project-nights/romaine | tests/test_parser_examples.py | 1 | 11549 | from copy import deepcopy
import unittest
from tests import common
from romaine.parser.exceptions import (
MalformedTableError,
)
class TestExamplesParser(unittest.TestCase):
"""
Test examples gherkin parser functionality of romaine's core.
"""
def setUp(self):
"""
Prepare... | mit |
gptech/ansible | lib/ansible/modules/cloud/ovirt/ovirt_datacenters.py | 1 | 7378 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 Red Hat, Inc.
#
# 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
#... | gpl-3.0 |
AnthonyBroadCrawford/servo | tests/wpt/web-platform-tests/tools/pywebsocket/src/mod_pywebsocket/dispatch.py | 652 | 14786 | # Copyright 2012, 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 of conditions and the f... | mpl-2.0 |
mimecine/mongrel2 | examples/ws/python/echo.py | 55 | 3488 | import simplejson as json
from mongrel2 import handler
import wsutil
import sys
import time
import re
sender_id = "82209006-86FF-4982-B5EA-D1E29E55D480"
conn = handler.Connection(sender_id, "tcp://127.0.0.1:9990",
"tcp://127.0.0.1:9989")
CONNECTION_TIMEOUT=5
closingMessages={}
badUnicode=... | bsd-3-clause |
Sorsly/subtle | google-cloud-sdk/lib/third_party/google/protobuf/internal/wire_format_test.py | 126 | 10930 | #! /usr/bin/env python
#
# Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# https://developers.google.com/protocol-buffers/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions ... | mit |
ymcagodme/Norwalk-Judo | django/contrib/localflavor/us/models.py | 230 | 1294 | from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from django.db.models.fields import CharField
from django.contrib.localflavor.us.us_states import STATE_CHOICES
from django.contrib.localflavor.us.us_states import USPS_CHOICES
class USStateField(CharField):
description = _("... | bsd-3-clause |
binarydud/django-oscar | src/oscar/apps/order/reports.py | 23 | 2312 | import datetime
from oscar.core.loading import get_model
from django.utils.translation import ugettext_lazy as _
from oscar.core.loading import get_class
ReportGenerator = get_class('dashboard.reports.reports', 'ReportGenerator')
ReportCSVFormatter = get_class('dashboard.reports.reports',
... | bsd-3-clause |
nirs/vdsm | tests/network/unit/nmstate/bond_test.py | 2 | 3216 | #
# Copyright 2020-2021 Red Hat, 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; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed ... | gpl-2.0 |
tavendo/txaio | txaio/with_asyncio.py | 3 | 1328 | ###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Crossbar.io Technologies GmbH
#
# 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 ... | mit |
Weihonghao/ECM | Vpy34/lib/python3.5/site-packages/pandas/io/sql.py | 7 | 58343 | # -*- coding: utf-8 -*-
"""
Collection of query wrappers / abstractions to both facilitate data
retrieval and to reduce dependency on DB-specific API.
"""
from __future__ import print_function, division
from datetime import datetime, date, time
import warnings
import re
import numpy as np
import pandas._libs.lib as ... | agpl-3.0 |
Spleen64/Sick-Beard | sickbeard/clients/requests/packages/charade/cp949prober.py | 2801 | 1782 | ######################## 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-3.0 |
leilihh/novaha | nova/api/openstack/compute/image_metadata.py | 16 | 5056 | # 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.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | apache-2.0 |
vshtanko/scikit-learn | sklearn/cluster/tests/test_birch.py | 342 | 5603 | """
Tests for the birch clustering algorithm.
"""
from scipy import sparse
import numpy as np
from sklearn.cluster.tests.common import generate_clustered_data
from sklearn.cluster.birch import Birch
from sklearn.cluster.hierarchical import AgglomerativeClustering
from sklearn.datasets import make_blobs
from sklearn.l... | bsd-3-clause |
tempbottle/rethinkdb | test/rql_test/connections/http_support/werkzeug/contrib/securecookie.py | 294 | 12204 | # -*- coding: utf-8 -*-
r"""
werkzeug.contrib.securecookie
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This module implements a cookie that is not alterable from the client
because it adds a checksum the server checks for. You can use it as
session replacement if all you have is a user id or something to mark
... | agpl-3.0 |
lunafeng/django | tests/template_tests/syntax_tests/test_list_index.py | 521 | 2694 | from django.test import SimpleTestCase
from ..utils import setup
class ListIndexTests(SimpleTestCase):
@setup({'list-index01': '{{ var.1 }}'})
def test_list_index01(self):
"""
List-index syntax allows a template to access a certain item of a
subscriptable object.
"""
... | bsd-3-clause |
kalahbrown/HueBigSQL | desktop/core/ext-py/tablib-0.10.0/tablib/packages/xlrd3/biffh.py | 54 | 17755 | # Support module for the xlrd3 package.
#
# Portions copyright (c) 2005-2008 Stephen John Machin, Lingfo Pty Ltd
# This module is part of the xlrd package, which is released under a
# BSD-style licence.
#
# 2010-12-08 mozman refactoring for python 3
# 2008-02-10 SJM BIFF2 BLANK record
# 2008-02-08 SJM Preparati... | apache-2.0 |
dsfsdgsbngfggb/odoo | addons/google_account/controllers/main.py | 350 | 1270 | import simplejson
import urllib
import openerp
from openerp import http
from openerp.http import request
import openerp.addons.web.controllers.main as webmain
from openerp.addons.web.http import SessionExpiredException
from werkzeug.exceptions import BadRequest
import werkzeug.utils
class google_auth(http.Controller):... | agpl-3.0 |
petrutlucian94/nova | nova/api/openstack/compute/plugins/v3/services.py | 13 | 5102 | # 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 |
geektophe/shinken | shinken/satellite.py | 3 | 46474 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2009-2014:
# Gabes Jean, naparuba@gmail.com
# Gerhard Lausser, Gerhard.Lausser@consol.de
# Gregory Starck, g.starck@gmail.com
# Hartmut Goebel, h.goebel@goebel-consult.de
#
# This file is part of Shinken.
#
# Shinken is free software: you ca... | agpl-3.0 |
miltonruelas/cursotecnico | branch/l10n_py_vat/base_vat.py | 4 | 2023 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2011 Cubic ERP - Teradata SAC. (http://cubicerp.com).
#
# WARNING: This program as such is intended to be used by professional
# programmers who take t... | agpl-3.0 |
google/llvm-propeller | lldb/test/API/functionalities/multidebugger_commands/TestMultipleDebuggersCommands.py | 13 | 1694 | """
Test that commands do not try and hold on to stale CommandInterpreters in a multiple debuggers scenario
"""
from __future__ import print_function
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class MultipleDebuggersCommandsTestCase... | apache-2.0 |
nkhuyu/SFrame | cxxtest/python/python3/cxxtest/cxxtestgen.py | 48 | 23783 | #-------------------------------------------------------------------------
# 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 ... | bsd-3-clause |
bracket/handsome | examples/003_circle.py | 2 | 4941 | from handsome.Micropolygon import Micropolygon
from handsome.MicropolygonMesh import MicropolygonMesh, Position
from handsome.Pixel import FloatPixel, array_view, pixel_view
from handsome.Tile import Tile
from handsome.TileCache import TileCache
from handsome.capi import fill_micropolygon_mesh, generate_numpy_begin
fro... | bsd-2-clause |
agat63/AGAT_JB_kernel | Documentation/target/tcm_mod_builder.py | 3119 | 42754 | #!/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 |
mozilla/make.mozilla.org | vendor-local/lib/python/celery/utils/dispatch/saferef.py | 14 | 10768 | # -*- coding: utf-8 -*-
"""
"Safe weakrefs", originally from pyDispatcher.
Provides a way to safely weakref any function, including bound methods (which
aren't handled by the core weakref module).
"""
from __future__ import absolute_import
import weakref
import traceback
def safe_ref(target, on_delete=None):
""... | bsd-3-clause |
denny820909/builder | lib/python2.7/site-packages/SQLAlchemy-0.8.0b2-py2.7-linux-x86_64.egg/sqlalchemy/sql/__init__.py | 6 | 1109 | # sql/__init__.py
# Copyright (C) 2005-2012 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 .expression import (
Alias,
ClauseElement,
ColumnCollection,
Colu... | mit |
wwj718/edx-video | lms/djangoapps/certificates/migrations/0010_auto__del_field_generatedcertificate_enabled__add_field_generatedcerti.py | 188 | 5338 | # -*- coding: 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):
# Deleting field 'GeneratedCertificate.enabled'
db.delete_column('certificates_generatedcertificate', 'enabl... | agpl-3.0 |
mnahm5/django-estore | Lib/site-packages/crispy_forms/tests/test_settings.py | 28 | 1170 | import os
from crispy_forms.compatibility import text_type
BASE_DIR = os.path.dirname(__file__)
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.sessions',
'django.contrib.contenttypes',
'django.contrib.admin',
'crispy_forms',
)
DATABASES = {
'default': {
'ENGINE': 'django.... | mit |
HyperloopTeam/FullOpenMDAO | lib/python2.7/site-packages/networkx-1.9.1-py2.7.egg/networkx/algorithms/centrality/katz.py | 8 | 9925 | """
Katz centrality.
"""
# Copyright (C) 2004-2013 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
import networkx as nx
from networkx.utils import not_implemented_for
__author__ = "\n".join(['Aric Hagberg (a... | gpl-2.0 |
brachyprint/brachyprint | doc/conf.py | 1 | 7932 | # -*- coding: utf-8 -*-
#
# Brachyprint documentation build configuration file, created by
# sphinx-quickstart on Sun Feb 9 11:09:11 2014.
#
# 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.
#
#... | gpl-2.0 |
heilaw/fast-rcnn | lib/datasets/imdb.py | 37 | 6785 | # --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
import os
import os.path as osp
import PIL
from utils.cython_bbox impor... | mit |
orzinal/test | scripts/create_empty_label_file.py | 10 | 2246 | #! /usr/bin/env python
# ----------------------------------------------------------------------
# Copyright (C) 2014-2015, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This program is free software: you c... | agpl-3.0 |
nanaze/pystitch | pystitch/gen_html.py | 1 | 3100 | #!/usr/bin/env python
"""Utilities to generate HTML from an image.
Can be called from commandline. Usage:
gen_html.py image.png
"""
from PIL import Image
import os
import sys
import image, dmc_colors
import color_map
import color
def _GetTextColor(bg_color):
average = sum(bg_color) / float(len(bg_color))
aver... | apache-2.0 |
Jeff-Tian/mybnb | Python27/Lib/codeop.py | 72 | 6167 | r"""Utilities to compile possibly incomplete Python source code.
This module provides two interfaces, broadly similar to the builtin
function compile(), which take program text, a filename and a 'mode'
and:
- Return code object if the command is complete and valid
- Return None if the command is incomplete
- ... | apache-2.0 |
takaaptech/sky_engine | sky/tools/webkitpy/common/system/filesystem_mock.py | 11 | 16806 | # Copyright (C) 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 of conditions and the f... | bsd-3-clause |
alex/boto | boto/fps/connection.py | 153 | 14335 | # Copyright (c) 2012 Andy Davidoff http://www.disruptek.com/
# Copyright (c) 2010 Jason R. Coombs http://www.jaraco.com/
# Copyright (c) 2008 Chris Moyer http://coredumped.org/
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "... | mit |
pniedzielski/fb-hackathon-2013-11-21 | src/repl.it/jsrepl/extern/python/reloop-closured/lib/python2.7/imputil.py | 228 | 25764 | """
Import utilities
Exported classes:
ImportManager Manage the import process
Importer Base class for replacing standard import functions
BuiltinImporter Emulate the import mechanism for builtin and frozen modules
DynLoadSuffixImporter
"""
from warnings import warnpy3k
warnpy3k("the imputil... | agpl-3.0 |
tallakahath/pymatgen | pymatgen/analysis/elasticity/tests/test_stress.py | 8 | 2805 | from __future__ import absolute_import
import unittest
import numpy as np
import warnings
from pymatgen.analysis.elasticity.stress import Stress
from pymatgen.analysis.elasticity.strain import Deformation
from pymatgen.util.testing import PymatgenTest
class StressTest(PymatgenTest):
def setUp(self):
se... | mit |
GiriR/android_kernel_samsung_smdk4412 | 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 |
miguelparaiso/OdooAccessible | addons/association/__init__.py | 886 | 1054 | # -*- 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 |
liuwenf/moose | modules/porous_flow/doc/tests/dispersion.py | 14 | 1881 | #!/usr/bin/env python
import os
import sys
import numpy as np
import matplotlib.pyplot as plt
from scipy.special import erfc
import pandas as pd
#
# Diffusion-only test
#
# Read MOOSE simulation data
data = pd.read_csv("../../tests/dispersion/diff01_out_xmass_0021.csv")
# The analytical solution is erfc(u) where u i... | lgpl-2.1 |
storm-computers/odoo | openerp/report/render/odt2odt/odt2odt.py | 49 | 1309 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from openerp.report.render.rml2pdf import utils
import copy
class odt2odt(object):
def __init__(self, odt, localcontext):
self.localcontext = localcontext
self.etree = odt
self._node = None
... | agpl-3.0 |
kvaps/vdsm | lib/vdsm/virtsparsify.py | 2 | 2040 | #
# Copyright 2014 Red Hat, 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; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in th... | gpl-2.0 |
us-ignite/us_ignite | us_ignite/resources/models.py | 1 | 4037 | import watson
from django.core.urlresolvers import reverse
from django.db import models
from us_ignite.constants import IMAGE_HELP_TEXT
from us_ignite.common.fields import AutoUUIDField, URL_HELP_TEXT
from us_ignite.resources import managers, search
from django_extensions.db.fields import (
AutoSlugField,
Cr... | bsd-3-clause |
cancro7/gem5 | src/mem/slicc/ast/StateDeclAST.py | 32 | 3307 | # Copyright (c) 2011 Advanced Micro Devices, 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 of conditions... | bsd-3-clause |
xinwu/horizon | openstack_dashboard/dashboards/project/access_and_security/tests.py | 10 | 9143 | # Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the... | apache-2.0 |
treetrnk/Tuxemon | tuxemon/core/components/db.py | 2 | 4617 | # -*- coding: utf-8 -*-
#
# Tuxemon
# Copyright (C) 2014, William Edwards <shadowapex@gmail.com>,
# Benjamin Bean <superman2k5@gmail.com>
#
# This file is part of Tuxemon.
#
# Tuxemon is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as pu... | gpl-3.0 |
neerajvashistha/pa-dude | lib/python2.7/site-packages/django/contrib/gis/geos/geometry.py | 216 | 23649 | """
This module contains the 'base' GEOSGeometry object -- all GEOS Geometries
inherit from this object.
"""
from __future__ import unicode_literals
import json
from ctypes import addressof, byref, c_double
from django.contrib.gis import gdal
from django.contrib.gis.geometry.regex import hex_regex, json_regex, wkt_... | mit |
publicRoman/spark | examples/src/main/python/streaming/flume_wordcount.py | 83 | 2032 | #
# 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 |
chauhanhardik/populo | common/lib/calc/calc/preview.py | 224 | 12317 | """
Provide a `latex_preview` method similar in syntax to `evaluator`.
That is, given a math string, parse it and render each branch of the result,
always returning valid latex.
Because intermediate values of the render contain more data than simply the
string of latex, store it in a custom class `LatexRendered`.
"""... | agpl-3.0 |
Silvian/Blog | blog/migrations/0001_initial.py | 1 | 1053 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-03-31 00:50
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
depen... | gpl-3.0 |
benjaminbrinkman/open-ad-platform | .venv/lib/python3.4/site-packages/pip/commands/uninstall.py | 798 | 2884 | from __future__ import absolute_import
import pip
from pip.wheel import WheelCache
from pip.req import InstallRequirement, RequirementSet, parse_requirements
from pip.basecommand import Command
from pip.exceptions import InstallationError
class UninstallCommand(Command):
"""
Uninstall packages.
pip is a... | mit |
petricm/DIRAC | FrameworkSystem/scripts/dirac-admin-get-proxy.py | 2 | 4433 | #!/usr/bin/env python
########################################################################
# File : dirac-admin-get-proxy
# Author : Stuart Paterson
########################################################################
"""
Retrieve a delegated proxy for the given user and group
"""
from __future__ import p... | gpl-3.0 |
Microvellum/Fluid-Designer | win64-vc/2.78/python/lib/site-packages/sqlalchemy/testing/runner.py | 55 | 1607 | #!/usr/bin/env python
# testing/runner.py
# Copyright (C) 2005-2016 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
"""
Nose test runner module.
This script is a front-end to "... | gpl-3.0 |
whitehorse-io/encarnia | pyenv/lib/python2.7/site-packages/future/backports/email/encoders.py | 82 | 2800 | # Copyright (C) 2001-2006 Python Software Foundation
# Author: Barry Warsaw
# Contact: email-sig@python.org
"""Encodings and related functions."""
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
from future.builtins import str
__all__ = [
'encode_7or8... | mit |
ryancoleman/autodock-vina | boost_1_54_0/libs/python/test/voidptr.py | 46 | 1114 | # Copyright Niall Douglas 2005.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
"""
>>> from voidptr_ext import *
Check for correct conversion
>>> use(get())
Check that None is converted to a NULL ... | apache-2.0 |
ms-iot/python | cpython/Tools/scripts/fixnotice.py | 64 | 3059 | #! /usr/bin/env python3
"""(Ostensibly) fix copyright notices in files.
Actually, this script will simply replace a block of text in a file from one
string to another. It will only do this once though, i.e. not globally
throughout the file. It writes a backup file and then does an os.rename()
dance for atomicity.
... | bsd-3-clause |
rtucker-mozilla/inventory | mozdns/tests/utils.py | 2 | 1247 | import random
import string
from mozdns.create_zone.views import create_zone_ajax
from django.test import RequestFactory
# TODO This should be used everywhere
def get_post_data(random_str, suffix):
"""Return a valid set of data"""
return {
'root_domain': '{0}{1}'.format(random_str, suffix),
... | bsd-3-clause |
2014cdag7/2014cdag7 | wsgi/programs/cdag7/__init__.py | 12 | 23366 | import cherrypy
# 這是 CDAG7 類別的定義
class CDAG7(object):
# 各組利用 index 引導隨後的程式執行
@cherrypy.expose
def index(self, *args, **kwargs):
outstring = '''
這是 2014CDA 協同專案下的 cdag7 分組程式開發網頁, 以下為 W12 的任務執行內容.<br />
<!-- 這裡採用相對連結, 而非網址的絕對連結 (這一段為 html 註解) -->
<a href="cube1">cdag5 正方體參數繪圖</a>(尺寸變數 a, b, c)<br /><... | gpl-2.0 |
cnsoft/kbengine-cocos2dx | kbe/src/lib/python/Lib/test/mock_socket.py | 57 | 3149 | """Mock socket module used by the smtpd and smtplib tests.
"""
# imported for _GLOBAL_DEFAULT_TIMEOUT
import socket as socket_module
# Mock socket module
_defaulttimeout = None
_reply_data = None
# This is used to queue up data to be read through socket.makefile, typically
# *before* the socket object is even create... | lgpl-3.0 |
ramyfarid922/Quiz-Program | vendor/bundle/ruby/2.2.0/gems/libv8-3.16.14.7/vendor/gyp/pylib/gyp/easy_xml.py | 1049 | 4803 | # Copyright (c) 2011 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import re
import os
def XmlToString(content, encoding='utf-8', pretty=False):
""" Writes the XML content to disk, touching the file only if it has changed.
... | cc0-1.0 |
priyankarani/sale | invoice.py | 1 | 5078 | # This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
from functools import wraps
from sql import Table
from trytond.model import Workflow, fields
from trytond.pool import Pool, PoolMeta
from trytond.transaction import Transactio... | gpl-3.0 |
rahushen/ansible | lib/ansible/modules/network/aci/aci_contract_subject_to_filter.py | 2 | 9148 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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 |
csitarichie/boost_msm_bare_metal | boost/libs/python/pyste/src/Pyste/CppParser.py | 54 | 8553 | # Copyright Bruno da Silva de Oliveira 2003. Use, modification and
# distribution is subject to the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
from GCCXMLParser import ParseDeclarations
import tempfile
import shutil
import os
impor... | gpl-2.0 |
samba-team/samba | source4/torture/drs/python/getnc_schema.py | 2 | 11114 | import drs_base
import ldb
import time
from samba.dcerpc import misc
from samba.drs_utils import drs_Replicate, drsException
import samba
import random
import time
import os
break_me = os.getenv("PLEASE_BREAK_MY_WINDOWS") == "1"
assert break_me, ("This test breaks Windows active directory after "
"a ... | gpl-3.0 |
tomlanyon/dnspython | tests/test_resolver.py | 1 | 16287 | # Copyright (C) 2003-2017 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 "AS IS" AND ... | isc |
drewandersonnz/openshift-tools | openshift/installer/vendored/openshift-ansible-3.10.0-0.29.0/roles/lib_openshift/src/class/oc_adm_manage_node.py | 46 | 8788 | # pylint: skip-file
# flake8: noqa
class ManageNodeException(Exception):
''' manage-node exception class '''
pass
class ManageNodeConfig(OpenShiftCLIConfig):
''' ManageNodeConfig is a DTO for the manage-node command.'''
def __init__(self, kubeconfig, node_options):
super(ManageNodeConfig, se... | apache-2.0 |
ngokevin/zamboni | docs/conf.py | 2 | 7565 | # -*- coding: utf-8 -*-
#
# zamboni documentation build configuration file, created by
# sphinx-quickstart on Thu Oct 22 20:39:35 2009.
#
# 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.
#
# All... | bsd-3-clause |
wavefrontHQ/python-client | test/test_azure_configuration.py | 1 | 1314 | # coding: utf-8
"""
Wavefront REST API
<p>The Wavefront REST API enables you to interact with Wavefront servers using standard REST API tools. You can use the REST API to automate commonly executed operations such as automatically tagging sources.</p><p>When you make REST API calls outside the Wavefront REST ... | apache-2.0 |
40223139/39g7test | static/Brython3.1.3-20150514-095342/Lib/fnmatch.py | 894 | 3163 | """Filename matching with shell patterns.
fnmatch(FILENAME, PATTERN) matches according to the local convention.
fnmatchcase(FILENAME, PATTERN) always takes case in account.
The functions operate by translating the pattern into a regular
expression. They cache the compiled regular expressions for speed.
The function... | gpl-3.0 |
rbian/avocado-vt | virttest/virsh.py | 2 | 130509 | """
Utility classes and functions to handle connection to a libvirt host system
The entire contents of callables in this module (minus the names defined in
NOCLOSE below), will become methods of the Virsh and VirshPersistent classes.
A Closure class is used to wrap the module functions, lambda does not
properly store ... | gpl-2.0 |
Dolphman/pynationstates | tests/test_call.py | 1 | 12322 | import unittest
import nationstates as ns
from random import choice
import datetime
USERAGENT = "Automated Testing Builds by Circle CI for the nationstates API wrapper by The United Island Tribes. dolphdevgithub@gmail.com"
import os
test_nation = 'Python Nationstates API wrapper'
test_nation_r = 'pynationstates_telegr... | mit |
PsychoGame/android_kernel_samsung_royss_old | arch/ia64/scripts/unwcheck.py | 13143 | 1714 | #!/usr/bin/python
#
# Usage: unwcheck.py FILE
#
# This script checks the unwind info of each function in file FILE
# and verifies that the sum of the region-lengths matches the total
# length of the function.
#
# Based on a shell/awk script originally written by Harish Patil,
# which was converted to Perl by Matthew Ch... | gpl-2.0 |
retornaz/aseba | examples/clients/python-dbus/aseba.py | 1 | 7674 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
A Python binding for Aseba that relies on DBus for IPC.
Supports event sending/receiving as well as setting/getting an Aseba variable.
Typical usage:
def my_callback(evt):
pass
with Aseba as aseba:
aseba.on_event("evt_name", my_callback)
... | lgpl-3.0 |
titeuf87/evennia | evennia/contrib/rplanguage.py | 6 | 19614 | """
Language and whisper obfuscation system
Evennia contrib - Griatch 2015
This module is intented to be used with an emoting system (such as
contrib/rpsystem.py). It offers the ability to obfuscate spoken words
in the game in various ways:
- Language: The language functionality defines a pseudo-language map
to... | bsd-3-clause |
MyAOSP/external_chromium_org | third_party/pymock/mock.py | 424 | 75527 | # mock.py
# Test tools for mocking and patching.
# Copyright (C) 2007-2012 Michael Foord & the mock team
# E-mail: fuzzyman AT voidspace DOT org DOT uk
# mock 1.0
# http://www.voidspace.org.uk/python/mock/
# Released subject to the BSD License
# Please see http://www.voidspace.org.uk/python/license.shtml
# Scripts m... | bsd-3-clause |
koceg/gouda | gouda/engines/datasymbol.py | 1 | 2801 | import os
import tempfile
import cv2
try:
from win32com import client as com
from win32com.client import constants as c
import win32api
except ImportError:
com = win32api = c = None
from gouda.barcode import Barcode
from gouda.gouda_error import GoudaError
from gouda.util import debug_print, is_clsid... | gpl-2.0 |
reverieinc/RevCode | revcode/rev_code_joiner.py | 1 | 2522 | def join_rev_matra(rev_word, rev_vowel):
# rev_vowel_list = ["a","A","i","I","u","U","WR","WA","e","E","YE","WO","o","O","YO","x","M","X"]
# rev_consonant_list = ["k","K","g","G","Fd","c","C","j","J","Z","T","HT","D","HD","N","t","Ht","d","Hd","n","Q","p","P","b","B","m","y","r","R","l","v","L","Hz","s","S"... | gpl-3.0 |
simone/static-erre | ncc4roma/settings.py | 1 | 2976 | """
Django settings for ncc4roma project.
Generated by 'django-admin startproject' using Django 1.8.4.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build pat... | mit |
IKGapirov/android_kernel_SM-G800H | 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 |
Denisolt/Tensorflow_Chat_Bot | local/lib/python2.7/site-packages/numpy/core/getlimits.py | 100 | 9714 | """Machine limits for Float32 and Float64 and (long double) if available...
"""
from __future__ import division, absolute_import, print_function
__all__ = ['finfo', 'iinfo']
from .machar import MachAr
from . import numeric
from . import numerictypes as ntypes
from .numeric import array
def _frz(a):
"""fix rank-... | gpl-3.0 |
tmxdyf/PJSIP | pjsip-apps/src/confbot/confbot.py | 33 | 16405 | # $Id$
#
# SIP Conference Bot
#
# Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your optio... | gpl-2.0 |
uwdata/termite-data-server | server_src/modules/readers/TreeTMReader.py | 5 | 4194 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from LDAReader import LDAReader
class TreeTMReader(LDAReader):
"""
lda_db = a SQLite3 database
modelPath = a model folder containing files corpus.voc, model.topic-words, and model.docs
"""
PROB_THRESHOLD = 0.001
CORPUS_VOCAB_FILENAME = 'corpus.voc'
TOPI... | bsd-3-clause |
SINGROUP/pycp2k | pycp2k/classes/_each255.py | 1 | 1114 | from pycp2k.inputsection import InputSection
class _each255(InputSection):
def __init__(self):
InputSection.__init__(self)
self.Just_energy = None
self.Powell_opt = None
self.Qs_scf = None
self.Xas_scf = None
self.Md = None
self.Pint = None
self.Meta... | lgpl-3.0 |
PlazaRoute/PlazaRoute-doc | build/upload-to-jira.py | 1 | 1134 | #!/bin/python
import requests
import re
import os
import sys
base_url = "https://jira.robinsuter.ch"
api_url = "/rest/api/2/issue/{}/attachments"
headers = {"X-Atlassian-Token": "nocheck"}
jira_user = os.environ.get("JIRA_USER")
jira_pw = os.environ.get("JIRA_PW")
jira_prefix = "PZ"
branch = os.environ.get("TRAVIS_BR... | mit |
benjaminheng/pyivle | pyivle/community.py | 2 | 8715 | import api
class Community():
# Community.Communities
def communities(self, duration=0, auth=True):
params = {'Duration': duration}
return api.call('Communities', params, auth)
# Community.CommunitySearch
def community_search(self, searchType, keyword, activeOnly=False, titleOnly=False... | mit |
chdecultot/frappe | frappe/integrations/doctype/webhook/webhook.py | 15 | 2261 | # -*- coding: utf-8 -*-
# Copyright (c) 2017, Frappe Technologies and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
import json, requests
from frappe import _
from frappe.model.document import Document
from six.moves.urllib.parse import urlparse
fr... | mit |
nikhilprathapani/python-for-android | python-modules/twisted/twisted/test/test_sip.py | 59 | 33079 | # -*- test-case-name: twisted.test.test_sip -*-
# Copyright (c) 2001-2009 Twisted Matrix Laboratories.
# See LICENSE for details.
"""Session Initialization Protocol tests."""
from twisted.trial import unittest, util
from twisted.protocols import sip
from twisted.internet import defer, reactor, utils
from twisted.pyt... | apache-2.0 |
thaumos/ansible | lib/ansible/modules/cloud/vmware/vmware_datacenter.py | 56 | 6522 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2015, Joseph Callen <jcallen () csc.com>
# Copyright: (c) 2018, 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
... | gpl-3.0 |
rcbops/python-django-buildpackage | tests/regressiontests/model_fields/tests.py | 50 | 13789 | import datetime
from decimal import Decimal
from django import test
from django import forms
from django.core.exceptions import ValidationError
from django.db import models
from django.db.models.fields.files import FieldFile
from django.utils import unittest
from models import Foo, Bar, Whiz, BigD, BigS, Image, BigIn... | bsd-3-clause |
leshchevds/ganeti | lib/cmdlib/__init__.py | 4 | 3952 | #
#
# Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 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:
#
# 1. Redistributions of source code must retain the above copyri... | bsd-2-clause |
barseghyanartur/django-haystack | haystack/management/commands/update_index.py | 6 | 14000 | # encoding: utf-8
from __future__ import absolute_import, division, print_function, unicode_literals
import logging
import multiprocessing
import os
import time
from datetime import timedelta
from django.core.management.base import BaseCommand
from django.db import close_old_connections, reset_queries
from django.uti... | bsd-3-clause |
stormi/weblate | weblate/accounts/management/commands/importusers.py | 9 | 2983 | # -*- coding: utf-8 -*-
#
# Copyright © 2012 - 2015 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <http://weblate.org/>
#
# 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, eithe... | gpl-3.0 |
Yannig/ansible | lib/ansible/modules/files/assemble.py | 26 | 8673 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2012, Stephen Fromm <sfromm@gmail.com>
# Copyright: (c) 2016, Toshio Kuratomi <tkuratomi@ansible.com>
# Copyright: (c) 2017, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import ab... | gpl-3.0 |
be-cloud-be/horizon-addons | server/addons/account/models/partner.py | 4 | 22365 | # -*- coding: utf-8 -*-
from operator import itemgetter
import time
from openerp import api, fields, models, _
from openerp.tools import DEFAULT_SERVER_DATETIME_FORMAT
from openerp.exceptions import ValidationError
class AccountFiscalPosition(models.Model):
_name = 'account.fiscal.position'
_description = '... | agpl-3.0 |
gvlproject/libcloudbridge | cloudbridge/providers/openstack/subservices.py | 2 | 1583 | import logging
from cloudbridge.base.subservices import BaseBucketObjectSubService
from cloudbridge.base.subservices import BaseDnsRecordSubService
from cloudbridge.base.subservices import BaseFloatingIPSubService
from cloudbridge.base.subservices import BaseGatewaySubService
from cloudbridge.base.subservices import B... | mit |
jcoady9/python-for-android | python3-alpha/extra_modules/gdata/spreadsheets/client.py | 47 | 29482 | #!/usr/bin/env python
#
# Copyright (C) 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 ... | apache-2.0 |
tudorbarascu/QGIS | tests/src/python/test_layer_dependencies.py | 10 | 14386 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsSnappingUtils (complement to C++-based tests)
.. note:: 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 License, or
(at your ... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.