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 |
|---|---|---|---|---|---|
40223232/w16b_test | wsgi.py | 1 | 27797 | #@+leo-ver=5-thin
#@+node:2014fall.20141212095015.1775: * @file wsgi.py
# coding=utf-8
# 上面的程式內容編碼必須在程式的第一或者第二行才會有作用
################# (1) 模組導入區
# 導入 cherrypy 模組, 為了在 OpenShift 平台上使用 cherrypy 模組, 必須透過 setup.py 安裝
#@@language python
#@@tabwidth -4
#@+<<declarations>>
#@+node:2014fall.20141212095015.1776: ** <<declar... | gpl-3.0 |
h3biomed/ansible | lib/ansible/modules/network/aruba/aruba_config.py | 34 | 16793 | #!/usr/bin/python
#
# Copyright: Ansible Team
# 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 |
3dfxmadscientist/odoo_vi | addons/website/models/ir_ui_view.py | 17 | 8282 | # -*- coding: utf-8 -*-
import copy
import re
import simplejson
import werkzeug
from lxml import etree, html
from openerp import SUPERUSER_ID
from openerp.addons.website.models import website
from openerp.http import request
from openerp.osv import osv, fields
class view(osv.osv):
_inherit = "ir.ui.view"
_co... | agpl-3.0 |
pgleeson/TempRepo3 | lib/jython/Lib/pydoc.py | 10 | 90404 | #!/usr/bin/env python
# -*- coding: Latin-1 -*-
"""Generate Python documentation in HTML or text for interactive use.
In the Python interpreter, do "from pydoc import help" to provide online
help. Calling help(thing) on a Python object documents the object.
Or, at the shell command line outside of Python:
Run "pydo... | gpl-2.0 |
joerocklin/gem5 | ext/ply/test/yacc_misplaced.py | 174 | 1539 | # -----------------------------------------------------------------------------
# yacc_misplaced.py
#
# A misplaced | in grammar rules
# -----------------------------------------------------------------------------
import sys
if ".." not in sys.path: sys.path.insert(0,"..")
import ply.yacc as yacc
from calclex import... | bsd-3-clause |
linjoahow/w17test_1 | static/Brython3.1.1-20150328-091302/Lib/configparser.py | 692 | 50025 | """Configuration file parser.
A configuration file consists of sections, lead by a "[section]" header,
and followed by "name: value" entries, with continuations and such in
the style of RFC 822.
Intrinsic defaults can be specified by passing them into the
ConfigParser constructor as a dictionary.
class:
ConfigParse... | gpl-3.0 |
mapr/hue | desktop/core/ext-py/Django-1.6.10/tests/one_to_one/tests.py | 49 | 5781 | from __future__ import absolute_import
from django.db import transaction, IntegrityError
from django.test import TestCase
from .models import (Place, Restaurant, Waiter, ManualPrimaryKey, RelatedModel,
MultiModel)
class OneToOneTests(TestCase):
def setUp(self):
self.p1 = Place(name='Demon Dogs', add... | apache-2.0 |
android-ia/platform_external_chromium_org | tools/flakiness/is_flaky_test.py | 94 | 2089 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Unit tests for is_flaky."""
import is_flaky
import subprocess
import sys
import threading
import unittest
class IsFlakyTest(unittest.TestCase):
def ... | bsd-3-clause |
chinmaygarde/mojo | sky/engine/build/scripts/make_element_lookup_trie.py | 3 | 5136 | #!/usr/bin/env python
# Copyright (C) 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:
#
# * Redistributions of source code must retain the above copyright
# notice, this list ... | bsd-3-clause |
shsingh/ansible | test/units/modules/network/eos/test_eos_bgp.py | 38 | 10035 | #
# (c) 2019, Ansible by Red Hat, inc
# 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
from ansible.module_utils.network.eos.providers.cli.config.bgp.process import Provider
from ansib... | gpl-3.0 |
harryliangye/Public_Opinion_Finder | TextBlob/textblob/base.py | 16 | 2945 | # -*- coding: utf-8 -*-
"""Abstract base classes for models (taggers, noun phrase extractors, etc.)
which define the interface for descendant classes.
.. versionchanged:: 0.7.0
All base classes are defined in the same module, ``textblob.base``.
"""
from __future__ import absolute_import
from abc import ABCMeta, ab... | bsd-2-clause |
vivianli32/TravelConnect | flask/lib/python3.4/site-packages/whoosh/lang/isri.py | 95 | 17041 | # -*- coding: utf-8 -*-
#
# Natural Language Toolkit: The ISRI Arabic Stemmer
#
# Copyright (C) 2001-2012 NLTK Proejct
# Algorithm: Kazem Taghva, Rania Elkhoury, and Jeffrey Coombs (2005)
# Author: Hosam Algasaier <hosam_hme@yahoo.com>
# URL: <http://www.nltk.org/>
# For license information, see LICENSE.TXT
"""
ISRI A... | mit |
aperigault/ansible | lib/ansible/modules/network/netvisor/_pn_show.py | 47 | 5646 | #!/usr/bin/python
""" PN CLI show commands """
#
# 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 ver... | gpl-3.0 |
direvus/ansible | test/units/executor/module_common/test_recursive_finder.py | 22 | 8032 | # (c) 2017, 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 option) any later... | gpl-3.0 |
DailyActie/Surrogate-Model | 00-courses/operators_as _functions.py | 1 | 1783 | # MIT License
#
# Copyright (c) 2016 Daily Actie
#
# 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 use, copy, modify, merge, ... | mit |
cherez/youtube-dl | youtube_dl/extractor/rutv.py | 106 | 7702 | # encoding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
ExtractorError,
int_or_none
)
class RUTVIE(InfoExtractor):
IE_DESC = 'RUTV.RU'
_VALID_URL = r'''(?x)
https?://player\.(?:rutv\.ru|vgtrk\.com)/
(?P<path>flas... | unlicense |
sgallagher/reviewboard | reviewboard/webapi/resources/base_watched_object.py | 6 | 5319 | from __future__ import unicode_literals
from django.contrib.auth.models import User
from django.core.exceptions import ObjectDoesNotExist
from django.http import HttpResponseRedirect
from django.utils import six
from djblets.webapi.decorators import (webapi_login_required,
webapi... | mit |
KaranToor/MA450 | google-cloud-sdk/lib/googlecloudsdk/third_party/apis/deploymentmanager/v2/deploymentmanager_v2_client.py | 6 | 22417 | """Generated client library for deploymentmanager version v2."""
# NOTE: This file is autogenerated and should not be edited by hand.
from apitools.base.py import base_api
from googlecloudsdk.third_party.apis.deploymentmanager.v2 import deploymentmanager_v2_messages as messages
class DeploymentmanagerV2(base_api.Base... | apache-2.0 |
opoplawski/ansible | contrib/inventory/docker.py | 120 | 12105 | #!/usr/bin/env python
# (c) 2013, Paul Durivage <paul.durivage@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
# (a... | gpl-3.0 |
MickSandoz/compassion-modules | contract_compassion/model/contract_origin.py | 2 | 4839 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2014 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Emanuel Cino <ecino@compassion.ch>
#
# The licence is in the file __open... | agpl-3.0 |
naparuba/kunai | test/test_encryption.py | 2 | 2198 | #!/usr/bin/env python
# Copyright (C) 2014:
# Gabes Jean, naparuba@gmail.com
from opsbro_test import *
from opsbro.library import libstore
from opsbro.log import cprint
from opsbro.util import unicode_to_bytes, bytes_to_unicode
encrypter = libstore.get_encrypter()
class TestUDPEncrypter(OpsBroTest):
def set... | mit |
hunter007/wechatpy | wechatpy/enterprise/messages.py | 4 | 1152 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from wechatpy.fields import IntegerField, StringField
from wechatpy import messages
MESSAGE_TYPES = {}
def register_message(msg_type):
def register(cls):
MESSAGE_TYPES[msg_type] = cls
return cls
return register... | mit |
Ironarcher/casso-backend | lib/werkzeug/local.py | 159 | 14275 | # -*- coding: utf-8 -*-
"""
werkzeug.local
~~~~~~~~~~~~~~
This module implements context-local objects.
:copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import copy
from functools import update_wrapper
from werkzeug.wsgi impo... | apache-2.0 |
Yannig/ansible | lib/ansible/modules/network/cloudengine/ce_bgp_neighbor_af.py | 27 | 109137 | #!/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 distribut... | gpl-3.0 |
gunchleoc/django | django/utils/deprecation.py | 51 | 2897 | from __future__ import absolute_import
import inspect
import warnings
class RemovedInDjango20Warning(PendingDeprecationWarning):
pass
class RemovedInNextVersionWarning(DeprecationWarning):
pass
class warn_about_renamed_method(object):
def __init__(self, class_name, old_method_name, new_method_name, d... | bsd-3-clause |
carolFrohlich/nipype | nipype/interfaces/camino/tests/test_auto_ComputeEigensystem.py | 12 | 1358 | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from ....testing import assert_equal
from ..dti import ComputeEigensystem
def test_ComputeEigensystem_inputs():
input_map = dict(args=dict(argstr='%s',
),
environ=dict(nohash=True,
usedefault=True,
),
ignore_exception=dict(nohash=True,
... | bsd-3-clause |
tdtrask/ansible | test/units/modules/network/netscaler/test_netscaler_nitro_request.py | 57 | 12941 |
# Copyright (c) 2017 Citrix Systems
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# ... | gpl-3.0 |
marco-lancini/Showcase | django/db/models/sql/where.py | 289 | 13163 | """
Code to manage the creation and SQL rendering of 'where' constraints.
"""
import datetime
from itertools import repeat
from django.utils import tree
from django.db.models.fields import Field
from django.db.models.query_utils import QueryWrapper
from datastructures import EmptyResultSet, FullResultSet
# Connection... | mit |
ZLLab-Mooc/edx-platform | lms/djangoapps/instructor/tests/test_registration_codes.py | 43 | 12486 | """
Test for the registration code status information.
"""
from course_modes.models import CourseMode
from courseware.tests.factories import InstructorFactory
from xmodule.modulestore.tests.factories import CourseFactory
from django.utils.translation import ugettext as _
from shoppingcart.models import (
Invoice, C... | agpl-3.0 |
HousekeepLtd/django | django/conf/locale/ko/formats.py | 404 | 2320 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'Y년 n월 j일'
TIME_FORMAT = 'A g:i'
D... | bsd-3-clause |
ar45/django | django/contrib/sessions/backends/file.py | 336 | 7715 | import datetime
import errno
import logging
import os
import shutil
import tempfile
from django.conf import settings
from django.contrib.sessions.backends.base import (
VALID_KEY_CHARS, CreateError, SessionBase,
)
from django.contrib.sessions.exceptions import InvalidSessionKey
from django.core.exceptions import I... | bsd-3-clause |
Zhongqilong/mykbengineer | kbe/src/lib/python/Lib/test/test_email/test__header_value_parser.py | 68 | 111429 | import string
import unittest
from email import _header_value_parser as parser
from email import errors
from email import policy
from test.test_email import TestEmailBase, parameterize
class TestTokens(TestEmailBase):
# EWWhiteSpaceTerminal
def test_EWWhiteSpaceTerminal(self):
x = parser.EWWhiteSpace... | lgpl-3.0 |
yvaucher/hr | __unported__/hr_resume/__openerp__.py | 2 | 1657 | # -*- encoding: utf-8 -*-
###############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
#
# This program is free software: you can redistribute it and/or modify
# it un... | agpl-3.0 |
danielhjames/Booktype | lib/booktype/urls.py | 6 | 3152 | # This file is part of Booktype.
# Copyright (c) 2012 Aleksandar Erkalovic <aleksandar.erkalovic@sourcefabric.org>
#
# Booktype 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 Li... | agpl-3.0 |
Kilhog/odoo | addons/account/report/account_invoice_report.py | 224 | 12489 | # -*- 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 |
GitHublong/hue | desktop/core/ext-py/boto-2.38.0/boto/datapipeline/exceptions.py | 235 | 1471 | # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# 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 ... | apache-2.0 |
Unode/firefox_decrypt | tests/simpletap/__init__.py | 1 | 3764 | """
Test Anything Protocol extension to Python's unit testing framework
This module contains TAPTestRunner and TAPTestResult which are used to produce
a test report in a TAP compatible format. All remaining functionality comes
from Python's own unittest module.
The core of the tests does not need any change and is pu... | gpl-3.0 |
pkainz/pylearn2 | pylearn2/sandbox/cuda_convnet/debug.py | 41 | 3019 | __authors__ = "Ian Goodfellow"
__copyright__ = "Copyright 2010-2012, Universite de Montreal"
__credits__ = ["Ian Goodfellow"]
__license__ = "3-clause BSD"
__maintainer__ = "LISA Lab"
__email__ = "pylearn-dev@googlegroups"
from pylearn2.testing.skip import skip_if_no_gpu
skip_if_no_gpu()
import logging
import numpy as ... | bsd-3-clause |
firerszd/kbengine | kbe/src/lib/python/Lib/test/test_source_encoding.py | 67 | 5223 | # -*- coding: koi8-r -*-
import unittest
from test.support import TESTFN, unlink, unload
import importlib
import os
import sys
import subprocess
class SourceEncodingTest(unittest.TestCase):
def test_pep263(self):
self.assertEqual(
"ðÉÔÏÎ".encode("utf-8"),
b'\xd0\x9f\xd0\xb8\xd1\x8... | lgpl-3.0 |
40223141/lego | static/Brython3.1.1-20150328-091302/Lib/threading.py | 730 | 45641 | """Thread module emulating a subset of Java's threading model."""
import sys as _sys
import _thread
from time import sleep as _sleep
try:
from time import monotonic as _time
except ImportError:
from time import time as _time
from traceback import format_exc as _format_exc
from _weakrefset import WeakSet
# No... | agpl-3.0 |
iwm911/plaso | plaso/parsers/plist_plugins/softwareupdate_test.py | 1 | 2465 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2014 The Plaso Project Authors.
# Please see the AUTHORS file for details on individual authors.
#
# 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 L... | apache-2.0 |
SpectreJan/gnuradio | gr-filter/python/filter/gui/icons_rc.py | 58 | 173558 | # -*- coding: utf-8 -*-
# Resource object code
#
# Created: Fri Aug 3 00:15:09 2012
# by: The Resource Compiler for PyQt (Qt v4.8.0)
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore
qt_resource_data = "\
\x00\x00\x08\x4a\
\x3c\
\x3f\x78\x6d\x6c\x20\x76\x65\x72\x73\x69\x6f\x6e\x3... | gpl-3.0 |
NeerajM999/recap-python | LearnPython/data_structures/binary_tree.py | 1 | 1761 | class Node:
def __init__(self, value):
self.value = value
self.left = None
self.right = None
class BinaryTree(object):
def __init__(self, root_val):
self.root = Node(root_val)
def preorder_traversal(self, start, traversal):
""" Root -> left -> right """
if... | gpl-3.0 |
mayankcu/Django-social | venv/Lib/site-packages/django/core/management/color.py | 635 | 1608 | """
Sets up the terminal color scheme.
"""
import os
import sys
from django.utils import termcolors
def supports_color():
"""
Returns True if the running system's terminal supports color, and False
otherwise.
"""
unsupported_platform = (sys.platform in ('win32', 'Pocket PC'))
# isatty is not ... | bsd-3-clause |
kret0s/gnuhealth-live | tryton/server/trytond-3.8.3/trytond/model/fields/one2one.py | 1 | 2080 | # 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 types import NoneType
from trytond.model.fields.field import Field
from trytond.model.fields.many2many import Many2Many
from trytond.pool import Pool
class One2One(Many... | gpl-3.0 |
supriyantomaftuh/syzygy | third_party/colorama/initialise.py | 49 | 1222 | import atexit
import sys
from .ansitowin32 import AnsiToWin32
orig_stdout = sys.stdout
orig_stderr = sys.stderr
wrapped_stdout = sys.stdout
wrapped_stderr = sys.stderr
atexit_done = False
def reset_all():
AnsiToWin32(orig_stdout).reset_all()
def init(autoreset=False, convert=None, strip=None, wrap=True):
... | apache-2.0 |
75651/kbengine_cloud | kbe/res/scripts/common/Lib/idlelib/idle_test/htest.py | 59 | 12613 | '''Run human tests of Idle's window, dialog, and popup widgets.
run(*tests)
Run each callable in tests after finding the matching test spec in this file.
If there are none, run an htest for each spec dict in this file after finding
the matching callable in the module named in the spec.
In a tested module, let X be a ... | lgpl-3.0 |
flyfei/python-for-android | python-modules/twisted/twisted/trial/test/test_doctest.py | 61 | 2405 | # Copyright (c) 2001-2008 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Test twisted's doctest support.
"""
from twisted.trial import itrial, runner, unittest, reporter
from twisted.trial.test import mockdoctest
class TestRunners(unittest.TestCase):
"""
Tests for Twisted's doctest support.
... | apache-2.0 |
hujiajie/chromium-crosswalk | third_party/cython/src/Cython/Debugger/DebugWriter.py | 103 | 2192 | from __future__ import with_statement
import os
import sys
import errno
try:
from lxml import etree
have_lxml = True
except ImportError:
have_lxml = False
try:
# Python 2.5
from xml.etree import cElementTree as etree
except ImportError:
try:
# Python 2.5
... | bsd-3-clause |
Metonimie/Beaglebone | programs/server.py | 1 | 3147 | #!/usr/bin/env python
"""
A very simple server in python
used to control gpio pins on the beaglebone black.
The server listens for POST requests on port
6410. It has no security at all, which means
that it accepts post-data from everyone.
Send a GET request::
curl http://localhost
Send a POST request::
curl -... | gpl-3.0 |
qiulimao/weblocust | pyspider/database/elasticsearch/resultdb.py | 10 | 3922 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8:
# Author: Binux<roy@binux.me>
# http://binux.me
# Created on 2016-01-18 19:41:24
import time
import elasticsearch.helpers
from elasticsearch import Elasticsearch
from pyspider.database.base.resultdb import Result... | apache-2.0 |
arbrandes/edx-configuration | playbooks/roles/supervisor/files/pre_supervisor_checks.py | 1 | 12593 | import argparse
import boto.ec2
from boto.utils import get_instance_metadata, get_instance_identity
from boto.exception import AWSConnectionError
import hipchat
import os
import subprocess
import traceback
import socket
import time
# Services that should be checked for migrations.
MIGRATION_COMMANDS = {
'lms':... | agpl-3.0 |
photoninger/ansible | test/runner/lib/manage_ci.py | 18 | 7268 | """Access Ansible Core CI remote services."""
from __future__ import absolute_import, print_function
import os
import pipes
import tempfile
from time import sleep
import lib.pytar
from lib.util import (
SubprocessError,
ApplicationError,
run_command,
intercept_command,
)
from lib.core_ci import (
... | gpl-3.0 |
chainer/chainer | tests/chainerx_tests/dtype_utils.py | 5 | 5772 | import itertools
import numpy
import chainerx
def _permutate_dtype_mapping(dtype_mapping_list):
# Permutates in dtypes of dtype mapping.
d = {}
for in_dtypes, out_dtype in dtype_mapping_list:
for in_dtypes_ in itertools.permutations(in_dtypes):
d[in_dtypes_] = out_dtype
return so... | mit |
kapouer/node-gyp | gyp/pylib/gyp/generator/xcode.py | 110 | 54811 | # 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 filecmp
import gyp.common
import gyp.xcodeproj_file
import errno
import os
import sys
import posixpath
import re
import shutil
import subprocess
import temp... | mit |
cyanogen/uchroma | uchroma/traits.py | 1 | 11759 | #
# uchroma - Copyright (C) 2021 Stefanie Kondik
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, version 3.
#
# This program is distributed in the hope that it will be useful, but
# WIT... | lgpl-3.0 |
pelya/commandergenius | project/jni/python/src/Lib/getopt.py | 167 | 7316 | # -*- coding: iso-8859-1 -*-
"""Parser for command line options.
This module helps scripts to parse the command line arguments in
sys.argv. It supports the same conventions as the Unix getopt()
function (including the special meanings of arguments of the form `-'
and `--'). Long options similar to those supported by... | lgpl-2.1 |
aapav01/kernel_ms013g_3-4-x | 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 |
mkaluza/external_chromium_org | chrome/browser/resources/test_presubmit.py | 61 | 19703 | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Unit tests for Web Development Style Guide checker."""
import os
import re
import sys
import unittest
test_dir = os.path.dirna... | bsd-3-clause |
GheRivero/ansible | lib/ansible/modules/cloud/azure/azure_rm_securitygroup_facts.py | 23 | 10605 | #!/usr/bin/python
#
# Copyright (c) 2016 Matt Davis, <mdavis@ansible.com>
# Chris Houseknecht, <house@redhat.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
ANS... | gpl-3.0 |
moniqx4/bite-project | deps/gdata-python-client/src/gdata/finance/__init__.py | 125 | 15397 | #!/usr/bin/python
#
# Copyright (C) 2009 Tan Swee Heng
#
# 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 la... | apache-2.0 |
dongjoon-hyun/tensorflow | tensorflow/contrib/distributions/python/kernel_tests/chi2_test.py | 25 | 3426 | # 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 |
holmes/intellij-community | python/lib/Lib/site-packages/django/contrib/auth/tests/urls.py | 90 | 1102 | from django.conf.urls.defaults import patterns
from django.contrib.auth.urls import urlpatterns
from django.contrib.auth.views import password_reset
from django.contrib.auth.decorators import login_required
from django.http import HttpResponse
from django.template import Template, RequestContext
def remote_user_auth_v... | apache-2.0 |
cardmagic/PyAMF | pyamf/adapters/_django_db_models_base.py | 1 | 8476 | # Copyright (c) 2007-2009 The PyAMF Project.
# See LICENSE.txt for details.
"""
`django.db.models` adapter module.
:see: `Django Project <http://www.djangoproject.com>`_
:since: 0.4.1
"""
from django.db.models.base import Model
from django.db.models import fields
from django.db.models.fields import related, files
... | mit |
RenaudParis/servo | tests/wpt/update/fetchlogs.py | 222 | 3183 | # 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/.
import argparse
import cStringIO
import gzip
import json
import os
import requests
import urlparse
treeherder_base = "h... | mpl-2.0 |
vishnu2kmohan/dcos | test_util/installer_api_test.py | 4 | 14586 | """Python API for interacting with installer API
"""
import abc
import json
import os
from subprocess import CalledProcessError
from typing import Optional
import pkg_resources
import requests
import yaml
from retrying import retry
from pkgpanda.util import load_yaml
from ssh.tunnel import Tunnelled
MAX_STAGE_TIME =... | apache-2.0 |
endlessm/chromium-browser | third_party/libyuv/tools_libyuv/valgrind/gdb_helper.py | 9 | 3053 | # Copyright (c) 2017 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All contributing project au... | bsd-3-clause |
paolodedios/pybuilder | src/integrationtest/python/should_skip_undefined_keys_when_filtering_tests.py | 3 | 1371 | # -*- coding: utf-8 -*-
#
# This file is part of PyBuilder
#
# Copyright 2011-2020 PyBuilder Team
#
# 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/l... | apache-2.0 |
nolanliou/tensorflow | tensorflow/contrib/losses/python/metric_learning/metric_loss_ops_test.py | 41 | 20535 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
Frenzie/youtube-dl | youtube_dl/extractor/pbs.py | 2 | 13463 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
ExtractorError,
determine_ext,
int_or_none,
strip_jsonp,
unified_strdate,
US_RATINGS,
)
class PBSIE(InfoExtractor):
_VALID_URL = r'''(?x)https?://
(?:
... | unlicense |
poiesisconsulting/openerp-restaurant | hr_attendance/hr_attendance.py | 6 | 8088 | # -*- 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 |
CSC-IT-Center-for-Science/pouta-blueprints | pebbles/tests/test_docker_driver.py | 1 | 32367 | import json
import logging
import docker.errors
import pebbles.drivers.provisioning.docker_driver as docker_driver
from pebbles.tests.base import BaseTestCase
from pebbles.drivers.provisioning.docker_driver import NAMESPACE_CPU, NAMESPACE_GPU
from pebbles.drivers.provisioning.docker_driver import DD_STATE_ACTIVE, DD_ST... | mit |
aznrice/android_kernel_samsung_afyonltetmo | tools/perf/scripts/python/net_dropmonitor.py | 4235 | 1554 | # Monitor the system for dropped packets and proudce a report of drop locations and counts
import os
import sys
sys.path.append(os.environ['PERF_EXEC_PATH'] + \
'/scripts/python/Perf-Trace-Util/lib/Perf/Trace')
from perf_trace_context import *
from Core import *
from Util import *
drop_log = {}
kallsyms = []
def... | gpl-2.0 |
savoirfairelinux/OpenUpgrade | addons/account/report/account_general_journal.py | 381 | 7669 | # -*- 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 |
tchellomello/home-assistant | homeassistant/helpers/frame.py | 8 | 3066 | """Provide frame helper for finding the current frame context."""
import asyncio
import functools
import logging
from traceback import FrameSummary, extract_stack
from typing import Any, Callable, Optional, Tuple, TypeVar, cast
from homeassistant.exceptions import HomeAssistantError
_LOGGER = logging.getLogger(__name... | apache-2.0 |
jmartinezchaine/OpenERP | openerp/addons/web/test/test_menu.py | 16 | 4792 | # -*- coding: utf-8 -*-
import mock
import unittest2
from ..controllers import main
from ..common.session import OpenERPSession
class Placeholder(object):
def __init__(self, **kwargs):
for k, v in kwargs.iteritems():
setattr(self, k, v)
class LoadTest(unittest2.TestCase):
def setUp(self):... | agpl-3.0 |
NeostreamTechnology/Microservices | venv/lib/python2.7/site-packages/simplejson/tests/test_encode_basestring_ascii.py | 147 | 2337 | from unittest import TestCase
import simplejson.encoder
from simplejson.compat import b
CASES = [
(u'/\\"\ucafe\ubabe\uab98\ufcde\ubcda\uef4a\x08\x0c\n\r\t`1~!@#$%^&*()_+-=[]{}|;:\',./<>?', '"/\\\\\\"\\ucafe\\ubabe\\uab98\\ufcde\\ubcda\\uef4a\\b\\f\\n\\r\\t`1~!@#$%^&*()_+-=[]{}|;:\',./<>?"'),
(u'\u0123\u4567\... | mit |
ppwwyyxx/tensorpack | tensorpack/utils/logger.py | 2 | 5996 | # -*- coding: utf-8 -*-
# File: logger.py
"""
The logger module itself has the common logging functions of Python's
:class:`logging.Logger`. For example:
.. code-block:: python
from tensorpack.utils import logger
logger.set_logger_dir('train_log/test')
logger.info("Test")
logger.error("Error happened... | apache-2.0 |
ICOS-Carbon-Portal/data | src/main/python/update-restheart/Restheart.py | 1 | 2242 | import requests
class Restheart(object):
def __init__(self):
# self._baseUrl = 'http://127.0.0.1:8088/db/' # localhost
self._baseUrl = 'https://restheart.icos-cp.eu/db/' # production
self._verfify = True if self._baseUrl.__contains__('restheart') else False
def get_records_to_update(self, op, pagesize, coll... | gpl-3.0 |
pombreda/pyfilesystem-4 | fs/osfs/watch_inotify.py | 8 | 10520 | """
fs.osfs.watch_inotify
=============
Change watcher support for OSFS, backed by pyinotify.
"""
import os
import sys
import errno
import select
import threading
from fs.errors import *
from fs.path import *
from fs.watch import *
try:
import pyinotify
except Exception, e:
# pyinotify sometimes raises it... | bsd-3-clause |
rarmknecht/peepdf | jsbeautifier/unpackers/packer.py | 76 | 3302 | #
# Unpacker for Dean Edward's p.a.c.k.e.r, a part of javascript beautifier
# by Einar Lielmanis <einar@jsbeautifier.org>
#
# written by Stefano Sanfilippo <a.little.coder@gmail.com>
#
# usage:
#
# if detect(some_string):
# unpacked = unpack(some_string)
#
"""Unpacker for Dean Edward's p.a.c.k.e.r"""
import r... | gpl-3.0 |
Shouqun/node-gn | tools/depot_tools/fetch_configs/breakpad.py | 3 | 1074 | # Copyright (c) 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import sys
import config_util # pylint: disable=import-error
# This class doesn't need an __init__ method, so we disable the warning
# pylint: disabl... | mit |
numenta/nupic.research | nupic/research/frameworks/backprop_structure/ray_ax/__init__.py | 3 | 1162 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2020, 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 progra... | agpl-3.0 |
domecraft/Games | RPG/classes.py | 1 | 3530 | class character:
def __init__(self, name, gender ,health, race, role, status, strength, defense, magic, bounty, income, reputation):
self.name = name
self.health = health
self.status = status
self.strength = strength
self.defense = defense
self.race = race
sel... | gpl-2.0 |
brchiu/tensorflow | tensorflow/__init__.py | 29 | 1685 | # 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 |
fbergmann/libSEDML | examples/python/create_sedml.py | 1 | 5521 | #!/usr/bin/env python
##
## @file create_sedml.py
## @brief cerates a SED-ML document.
## @author Frank T. Bergmann
##
## <!--------------------------------------------------------------------------
## This file is part of libSEDML. Please visit http://sed-ml.org for more
## information about SEDML, and the la... | bsd-2-clause |
basicthinker/ThyNVM | src/arch/x86/isa/insts/simd64/floating_point/arithmetic/__init__.py | 91 | 2470 | # Copyright (c) 2007 The Hewlett-Packard Development Company
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implemen... | bsd-3-clause |
jawilson/home-assistant | tests/components/sensor/test_mqtt.py | 5 | 2151 | """The tests for the MQTT sensor platform."""
import unittest
from homeassistant.bootstrap import _setup_component
import homeassistant.components.sensor as sensor
from tests.common import mock_mqtt_component, fire_mqtt_message
from tests.common import get_test_home_assistant
class TestSensorMQTT(unittest.TestCase)... | mit |
molmod/yaff | yaff/pes/colvar.py | 1 | 13249 | # -*- coding: utf-8 -*-
# YAFF is yet another force-field code.
# Copyright (C) 2011 Toon Verstraelen <Toon.Verstraelen@UGent.be>,
# Louis Vanduyfhuys <Louis.Vanduyfhuys@UGent.be>, Center for Molecular Modeling
# (CMM), Ghent University, Ghent, Belgium; all rights reserved unless otherwise
# stated.
#
# This file is pa... | gpl-3.0 |
Edu-Glez/Bank_sentiment_analysis | env/lib/python3.6/site-packages/ipykernel/kernelapp.py | 5 | 19344 | """An Application for launching a kernel"""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
from __future__ import print_function
import atexit
import os
import sys
import signal
import traceback
import logging
from tornado import ioloop
import zmq
from zmq.event... | apache-2.0 |
yongshengwang/builthue | desktop/libs/libsentry/src/libsentry/test_client.py | 34 | 3196 | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | apache-2.0 |
hgl888/chromium-crosswalk | third_party/mojo/src/mojo/public/tools/bindings/pylib/mojom/parse/parser.py | 32 | 13000 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Generates a syntax tree from a Mojo IDL file."""
import imp
import os.path
import sys
def _GetDirAbove(dirname):
"""Returns the directory "above" this... | bsd-3-clause |
rane-hs/anntools-py3x | anntools/cooperation.py | 2 | 20493 | #!/usr/bin/python
# -*- coding: ascii -*-
'''
Cooperation schemes.
(C) 2007-2008 - Viktor Ferenczi (python@cx.hu) - Licence: GNU LGPL
This module provides cooperation schemes. It is very useful whenever forward
compatibility is required between tools operating on a common object space.
Cooperation instances allows c... | lgpl-2.1 |
yanweifu/reweighted-ws | show-param-trajectory.py | 6 | 1912 | #!/usr/bin/env python2
from __future__ import division, print_function
import logging
import h5py
import numpy as np
import tsne
import pylab
#x2 = tsne.bh_sne(x)
if __name__ == "__main__":
import sys
import argparse
logger = logging.getLogger(__name__)
parser = argparse.ArgumentParser()
par... | agpl-3.0 |
P0cL4bs/3vilTwinAttacker | plugins/captivePortal/flask_demo.py | 2 | 1778 | import re
from ast import literal_eval
from plugins.captivePortal.plugin import CaptiveTemplatePlugin
"""
Description:
This program is a core for wifi-pumpkin.py. file which includes functionality
plugins for Pumpkin-Proxy.
Copyright:
Copyright (C) 2015-2016 Marcos Nesster P0cl4bs Team
This program i... | gpl-3.0 |
rlee287/pyautoupdate | pyautoupdate/launcher.py | 2 | 31325 | from __future__ import absolute_import, print_function
from datetime import datetime
from logging import WARNING
import multiprocessing
import os
import pprint
import re
import shutil
from sys import version_info
import tempfile
import warnings
# Module in different place depending on python version
if version_info[0... | lgpl-2.1 |
ekiourk/ansible-modules-core | database/mysql/mysql_user.py | 24 | 17625 | #!/usr/bin/python
# (c) 2012, Mark Theunissen <mark.theunissen@gmail.com>
# Sponsored by Four Kitchens http://fourkitchens.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... | gpl-3.0 |
egaxegax/django-dbcartajs | django/contrib/webdesign/tests.py | 232 | 1092 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import unittest
from django.contrib.webdesign.lorem_ipsum import *
from django.template import loader, Context
class WebdesignTest(unittest.TestCase):
def test_words(self):
self.assertEqual(words(7), 'lorem ipsum dolor sit amet consectetur... | gpl-2.0 |
mivade/tornado | tornado/platform/caresresolver.py | 4 | 3465 | import pycares # type: ignore
import socket
from tornado.concurrent import Future
from tornado import gen
from tornado.ioloop import IOLoop
from tornado.netutil import Resolver, is_valid_ip
import typing
if typing.TYPE_CHECKING:
from typing import Generator, Any, List, Tuple, Dict # noqa: F401
class CaresRes... | apache-2.0 |
saimn/glue | glue/core/decorators.py | 5 | 2231 | from __future__ import absolute_import, division, print_function
from functools import wraps
__all__ = ['memoize', 'singleton', 'memoize_attr_check']
def _make_key(args, kwargs):
return args, frozenset(kwargs.items())
def memoize(func):
"""Save results of function calls to avoid repeated calculation"""
... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.