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 |
|---|---|---|---|---|---|
pedrobaeza/OpenUpgrade | addons/base_import_module/tests/test_module/__openerp__.py | 377 | 1290 | # -*- 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 |
wskplho/sl4a | python-build/python-libs/python-twitter/twitter.py | 89 | 70251 | #!/usr/bin/python2.4
#
# Copyright 2007 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... | apache-2.0 |
dkarakats/edx-platform | common/test/acceptance/pages/studio/component_editor.py | 65 | 5068 | from bok_choy.page_object import PageObject
from selenium.webdriver.common.keys import Keys
from utils import click_css
from selenium.webdriver.support.ui import Select
class BaseComponentEditorView(PageObject):
"""
A base :class:`.PageObject` for the component and visibility editors.
This class assumes ... | agpl-3.0 |
cappatar/knesset-data-pipelines | datapackage_pipelines_knesset/members/processors/load_members.py | 1 | 1419 | from datapackage_pipelines_knesset.common.base_processors.add_resource import AddResourceBaseProcessor
# only loads members with the following positionId:
SUPPORTED_POSITION_IDS = [43, 61]
class Processor(AddResourceBaseProcessor):
def _get_schema(self, resource_descriptor):
return resource_descriptor.ge... | mit |
trafi/gyp | test/mac/gyptest-loadable-module.py | 54 | 1280 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Tests that a loadable_module target is built correctly.
"""
import TestGyp
import os
import struct
import sys
if sys.platform == 'dar... | bsd-3-clause |
bertucho/epic-movie-quotes-quiz | dialogos/build/Twisted/twisted/logger/test/test_io.py | 11 | 7231 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Test cases for L{twisted.logger._io}.
"""
from __future__ import print_function
import sys
from twisted.trial import unittest
from .._levels import LogLevel
from .._logger import Logger
from .._observer import LogPublisher
from .._io impor... | mit |
Midrya/chromium | third_party/gsutil/gslib/commands/getlogging.py | 51 | 5500 | # Copyright 2011 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | bsd-3-clause |
surjit84/pmtk3 | matlabTools/metaTools/googlecode_upload.py | 304 | 8912 | #!/usr/bin/env python
#
# Copyright 2006, 2007 Google Inc. All Rights Reserved.
# Author: danderson@google.com (David Anderson)
#
# Script for uploading files to a Google Code project.
#
# This is intended to be both a useful script for people who want to
# streamline project uploads and a reference implementation for
... | mit |
sarvex/tensorflow | tensorflow/python/kernel_tests/functional_ops_test.py | 9 | 47969 | # 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 |
pgmillon/ansible | lib/ansible/modules/remote_management/redfish/idrac_redfish_command.py | 12 | 5893 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2018 Dell EMC Inc.
# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'status': ['preview'],
... | gpl-3.0 |
coolbho3k/kernel-roth | tools/perf/scripts/python/futex-contention.py | 11261 | 1486 | # futex contention
# (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Translation of:
#
# http://sourceware.org/systemtap/wiki/WSFutexContention
#
# to perf python scripting.
#
# Measures futex contention
import os, sys
sys.path.append(os.environ['PER... | gpl-2.0 |
imbasimba/astroquery | astroquery/skyview/tests/test_skyview.py | 2 | 2963 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import os.path
import types
import pytest
from astropy import coordinates
from astropy import units as u
from ...utils import commons
from ...utils.testing_tools import MockResponse
from ...skyview import SkyView
objcoords = {'Eta Carinae': coordinates.... | bsd-3-clause |
exu/poligon | python/python_koans/python3/koans/about_comprehension.py | 56 | 2234 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
class AboutComprehension(Koan):
def test_creating_lists_with_list_comprehensions(self):
feast = ['lambs', 'sloths', 'orangutans', 'breakfast cereals',
'fruit bats']
comprehension = [delicacy.capitalize() for de... | mit |
dermoth/gramps | gramps/gui/editors/displaytabs/locationmodel.py | 11 | 1690 | #
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2006 Donald N. Allingham
#
# 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 you... | gpl-2.0 |
warriorframework/warriorframework | warrior/WarriorCore/iterative_parallel_kw_driver.py | 1 | 4275 | '''
Copyright 2017, Fujitsu Network Communications, 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 w... | apache-2.0 |
ales-erjavec/orange | Orange/OrangeCanvas/gui/tests/test_toolgrid.py | 6 | 2920 | from PyQt4.QtGui import QAction, QToolButton
from .. import test
from ..toolgrid import ToolGrid
class TestToolGrid(test.QAppTestCase):
def test_tool_grid(self):
w = ToolGrid()
w.show()
self.app.processEvents()
def buttonsOrderedVisual():
# Process layout events so t... | gpl-3.0 |
smices/mWorkerService | src/lib/baidubce/http/handler.py | 2 | 2816 | # Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | mit |
valentinmetraux/hierophis | hierophis/maths/statistics/basic.py | 1 | 2080 | #!/usr/bin/env python
# -*- coding: utf 8 -*-
"""
Utility functions.
:copyright: 2015 Agile Geoscience
:license: Apache 2.0
"""
import numpy as np
import scipy.signal
def rms(a):
"""
Calculates the RMS of an array.
:param a: An array.
:returns: The RMS of the array.
"""
return np.sqrt(np.s... | apache-2.0 |
kenshay/ImageScripter | ProgramData/SystemFiles/Python/Lib/test/sample_doctest.py | 228 | 1037 | """This is a sample module that doesn't really test anything all that
interesting.
It simply has a few tests, some of which succeed and some of which fail.
It's important that the numbers remain constant as another test is
testing the running of these tests.
>>> 2+2
4
"""
def foo():
"""
>>> 2+2
5
... | gpl-3.0 |
kubaszostak/gdal-dragndrop | osgeo/apps/Python27/Lib/encodings/utf_16_be.py | 103 | 1079 | """ Python 'utf-16-be' Codec
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""
import codecs
### Codec APIs
encode = codecs.utf_16_be_encode
def decode(input, errors='strict'):
return codecs.utf_16_be_decode(input, errors, True)
class... | mit |
eXcomm/cjdns | node_build/dependencies/libuv/build/gyp/pylib/gyp/generator/ninja.py | 16 | 89501 | # Copyright (c) 2013 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 hashlib
import json
import multiprocessing
import os.path
import re
import signal
import subprocess
import sys
import gyp
imp... | gpl-3.0 |
kiall/designate-py3 | designate/storage/impl_sqlalchemy/migrate_repo/versions/066_add_update_status_index.py | 8 | 1469 | # Copyright (c) 2015 Rackspace Inc.
#
# Author: Tim Simmons <tim.simmons@rackspace.com>
#
# 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
#
#... | apache-2.0 |
all-of-us/raw-data-repository | tests/api_tests/test_ppi_data_check_api.py | 1 | 2788 | from rdr_service.model.code import CodeType
from tests.helpers.unittest_base import BaseTestCase
class CheckPpiDataApiTest(BaseTestCase):
def setUp(self):
super(CheckPpiDataApiTest, self).setUp(with_consent_codes=True)
self.participant_summary = self.data_generator.create_database_participant_sum... | bsd-3-clause |
rosemead/namebench | nb_third_party/dns/rdtypes/txtbase.py | 248 | 2986 | # Copyright (C) 2006, 2007, 2009, 2010 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED... | apache-2.0 |
CanalTP/navitia | source/log_analyzer/log_analyzer.py | 2 | 7813 | #! /usr/bin/python3
import plotly
from sortedcontainers import SortedKeyList
import re, os, argparse
kraken_regex = re.compile(r".* - Api : (.+), worker : (.+), request : (.+), start : (\d+), end : (\d+)")
jormun_regex = re.compile(r".*Task : (.+), request : (.+), start : (.+), end : (.+)")
generate_id_regex = re.... | agpl-3.0 |
wooga/airflow | airflow/example_dags/example_nested_branch_dag.py | 1 | 2019 | #
# 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... | apache-2.0 |
mxOBS/deb-pkg_xbmc-imx6 | addons/service.xbmc.versioncheck/service.py | 17 | 4169 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Team-XBMC
#
# 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... | gpl-2.0 |
dendisuhubdy/tensorflow | tensorflow/python/kernel_tests/sparse_tensor_dense_matmul_op_test.py | 61 | 15941 | # 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 |
mojolab/LivingData | lib/livdatops.py | 1 | 1153 | import pandas
def getColRenameDict(mergersheet,sheet):
colrenamedict={}
originalcolnames=mergersheet[sheet].fillna("NA")
newcolnames=mergersheet[mergersheet.columns[0]]
for i in range(0,len(originalcolnames)):
colrenamedict[originalcolnames[i]]=newcolnames[i]
# if originalcolnames[i]!="NA":
# colrenamedict[... | apache-2.0 |
katyhuff/moose | framework/contrib/nsiqcppstyle/rules/RULE_10_1_B_do_not_use_bufferoverflow_risky_function_for_windows.py | 43 | 2942 | """
Do not use buffer overflow risky functions in window env.
if they're found, this rule reports a violation.
== Buffer Overflow Risky Function List in Window ==
- strcat()
- wcscat()
- lstrcat()
- strcat()
- StrCatBuff()
- _tcscat()
- _ftcscat()
- strncat()
- StrNCat()
- strcpy()
- wcscpy()
-... | lgpl-2.1 |
jollyroger/debian-buildbot | buildbot/test/unit/test_steps_package_rpm_rpmbuild.py | 3 | 2875 | # This file is part of Buildbot. Buildbot is free software: you can
# redistribute it and/or modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | gpl-2.0 |
CSC-IT-Center-for-Science/pouta-blueprints | pebbles/views/authorize_instances.py | 1 | 3153 | from flask import abort, request, Response, Blueprint
import datetime
import logging
import re
from pebbles.models import InstanceToken
from pebbles.server import restful
authorize_instances = Blueprint('authorize_instances', __name__)
class AuthorizeInstancesView(restful.Resource):
def get(self):
toke... | mit |
superchilli/webapp | venv/lib/python2.7/site-packages/pygments/token.py | 365 | 5662 | # -*- coding: utf-8 -*-
"""
pygments.token
~~~~~~~~~~~~~~
Basic token types and the standard tokens.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
class _TokenType(tuple):
parent = None
def split(self):
buf = []
... | mit |
danmit/django-calaccess-raw-data | example/toolbox/management/commands/createfielddocissues.py | 29 | 5833 | import os
import time
import calculate
from github import Github
from django.conf import settings
from calaccess_raw import get_model_list
from calaccess_raw.management.commands import CalAccessCommand
from django.contrib.humanize.templatetags.humanize import intcomma
class Command(CalAccessCommand):
help = 'Crea... | mit |
andrius-preimantas/odoo | addons/hr_contract/base_action_rule.py | 389 | 2646 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2013 OpenERP S.A. <http://www.openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of th... | agpl-3.0 |
sudheesh001/oh-mainline | vendor/packages/python-openid/openid/__init__.py | 139 | 1623 | """
This package is an implementation of the OpenID specification in
Python. It contains code for both server and consumer
implementations. For information on implementing an OpenID consumer,
see the C{L{openid.consumer.consumer}} module. For information on
implementing an OpenID server, see the C{L{openid.server.se... | agpl-3.0 |
groovecoder/kuma | vendor/packages/translate/convert/test_po2html.py | 26 | 5722 | #!/usr/bin/env python
from pytest import mark
from translate.convert import po2html, test_convert
from translate.misc import wStringIO
class TestPO2Html:
def converthtml(self, posource, htmltemplate, includefuzzy=False):
"""helper to exercise the command line function"""
inputfile = wStringIO.S... | mpl-2.0 |
weiqiangdragonite/blog_tmp | python/baidu/myip.py | 1 | 1085 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# http://ip.taobao.com/instructions.php
import socket
#
common_headers = \
"Host: ip.taobao.com\r\n" + \
"Connection: Keep-Alive\r\n" + \
"Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\n" + \
"User-Agent: Mozilla/5.0 (X11; Lin... | gpl-2.0 |
NKSG/ns3 | bindings/python/apidefs/gcc-LP64/ns3_module_core.py | 4 | 220109 | from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
def register_types(module):
root_module = module.get_root()
## log.h: ns3::LogLevel [enumeration]
module.add_enum('LogLevel', ['LOG_NONE', 'LOG_ERROR', 'LOG_LEVEL_ERROR', 'LOG_WARN', 'LOG_LEVEL_WARN', 'LOG_DEBUG', 'LOG_L... | gpl-2.0 |
dhanababum/accessdb | accessdb/utils.py | 1 | 8395 | # -*- coding: utf-8 -*-
# Copyright 2017 Dhana Babu
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | apache-2.0 |
jimsize/PySolFC | pysollib/games/harp.py | 1 | 13061 | #!/usr/bin/env python
# -*- mode: python; coding: utf-8; -*-
# ---------------------------------------------------------------------------##
#
# Copyright (C) 1998-2003 Markus Franz Xaver Johannes Oberhumer
# Copyright (C) 2003 Mt. Hood Playing Card Co.
# Copyright (C) 2005-2009 Skomoroh
#
# This program is free softwa... | gpl-3.0 |
iafan/zing | tests/forms/project.py | 1 | 1228 | # -*- coding: utf-8 -*-
#
# Copyright (C) Pootle contributors.
# Copyright (C) Zing contributors.
#
# This file is a part of the Zing project. It is distributed under the GPL3
# or later license. See the LICENSE file for a copy of the license and the
# AUTHORS file for copyright and authorship information.
import pyte... | gpl-3.0 |
etherkit/OpenBeacon2 | client/linux-arm/venv/lib/python3.6/site-packages/PyInstaller/hooks/hook-gi.repository.GdkPixbuf.py | 1 | 6760 | #-----------------------------------------------------------------------------
# Copyright (c) 2005-2020, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License (version 2
# or later) with exception for distributing the bootloader.
#
# The full license is in the file COPYING.txt... | gpl-3.0 |
cindyyu/kuma | vendor/packages/translate/tools/test_podebug.py | 25 | 6654 | # -*- coding: utf-8 -*-
from translate.storage import base, po, xliff
from translate.tools import podebug
PO_DOC = """
msgid "This is a %s test, hooray."
msgstr ""
"""
XLIFF_DOC = """<?xml version='1.0' encoding='utf-8'?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.1" version="1.1">
<file original="NoName" ... | mpl-2.0 |
JenSte/pyqtgraph | examples/optics/pyoptic.py | 18 | 18439 | # -*- coding: utf-8 -*-
import pyqtgraph as pg
from pyqtgraph.Qt import QtGui, QtCore
import numpy as np
import csv, gzip, os
from pyqtgraph import Point
class GlassDB:
"""
Database of dispersion coefficients for Schott glasses
+ Corning 7980
"""
def __init__(self, fileName='schott_glasses.csv'):
... | mit |
xyzz/vcmi-build | project/jni/python/src/Demo/scripts/newslist.py | 32 | 11360 | #! /usr/bin/env python
#######################################################################
# Newslist $Revision: 66429 $
#
# Syntax:
# newslist [ -a ]
#
# This is a program to create a directory full of HTML pages
# which between them contain links to all the newsgroups available
# on your server.
#
# The -a op... | lgpl-2.1 |
javachengwc/hue | desktop/core/ext-py/guppy-0.1.10/guppy/etc/RE.py | 37 | 18932 | #._cv_part guppy.etc.RE
from guppy.etc.RE_Rect import chooserects
from guppy.etc.IterPermute import iterpermute
class InfiniteError(Exception):
pass
class WordsMemo:
def __init__(self, re, ch):
self.re = re
self.ch = ch
self.xs = {}
self.N = 0
def get_words_of_length(self, N):
# Return a list of wo... | apache-2.0 |
foromer4/scrapy | scrapy/utils/benchserver.py | 38 | 1332 | import random
from six.moves.urllib.parse import urlencode
from twisted.web.server import Site
from twisted.web.resource import Resource
from twisted.internet import reactor
class Root(Resource):
isLeaf = True
def getChild(self, name, request):
return self
def render(self, request):
tot... | bsd-3-clause |
macauleycheng/AOS_OF_Example | 04-VxLAN/04-AccessToNetworkPortFloodByMcast/edit_config.py | 4 | 8282 | import pkg_resources
pkg_resources.require("ncclient==0.4.3")
from ncclient import manager
import ncclient
#due to ofconfig design problem, it need fill port feature
#but we won't use it currently.
#of-agent nexthop 2 destination user-input-dst-mac ethernet 1/2 vid 2
config_nexthop_ucast_xml="""
<confi... | apache-2.0 |
381426068/ardupilot | Tools/autotest/param_metadata/htmlemit.py | 148 | 2754 | #!/usr/bin/env python
import re
from param import *
from emit import Emit
import cgi
# Emit docs in a form acceptable to the APM wordpress docs site
class HtmlEmit(Emit):
def __init__(self):
html_fname = 'Parameters.html'
self.f = open(html_fname, mode='w')
self.preamble = '''<!-- Dyn... | gpl-3.0 |
BT-fgarbely/odoo | addons/account_budget/report/crossovered_budget_report.py | 315 | 8657 | # -*- 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 |
chadnetzer/numpy-gaurdro | numpy/linalg/setup.py | 6 | 1339 |
import sys
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
from numpy.distutils.system_info import get_info
config = Configuration('linalg',parent_package,top_path)
config.add_data_dir('tests')
# Configure lapack_lite
lapack_info = get_... | bsd-3-clause |
nugget/home-assistant | homeassistant/components/apcupsd/sensor.py | 2 | 7313 | """Support for APCUPSd sensors."""
import logging
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
import homeassistant.helpers.config_validation as cv
from homeassistant.components import apcupsd
from homeassistant.const import (TEMP_CELSIUS, CONF_RESOURCES, POWER_WATT)
from homea... | apache-2.0 |
all-of-us/raw-data-repository | rdr_service/alembic/versions/72365b7c0037_add_gender_identity_enums.py | 1 | 1232 | """add gender identity enums
Revision ID: 72365b7c0037
Revises: 9c957ce496bf
Create Date: 2019-06-05 08:56:34.278852
"""
import model.utils
import sqlalchemy as sa
from alembic import op
from rdr_service.participant_enums import GenderIdentity
# revision identifiers, used by Alembic.
revision = "72365b7c0037"
down_... | bsd-3-clause |
guozhangwang/kafka | tests/kafkatest/services/trogdor/network_partition_fault_spec.py | 17 | 1816 | # 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 use ... | apache-2.0 |
gunny26/datalogger | datalogger/Test_DataLogger.py | 1 | 4699 | #!/usr/bin/python2
from __future__ import print_function
import unittest
import logging
logging.basicConfig(level=logging.INFO)
import datetime
import gzip
import json
import os
# own modules
from DataLogger import DataLogger as DataLogger
from Timeseries import Timeseries as Timeseries
from TimeseriesArray import Time... | apache-2.0 |
thaskell1/volatility | volatility/plugins/addrspaces/intel.py | 8 | 11081 | # Volatility
# Copyright (C) 2007-2013 Volatility Foundation
# Copyright (C) 2004,2005,2006 4tphi Research
#
# Authors:
# {npetroni,awalters}@4tphi.net (Nick Petroni and AAron Walters)
# Michael Cohen <scudette@users.sourceforge.net>
# Mike Auty <mike.auty@gmail.com>
#
# This file is part of Volatility.
#
# Volatility ... | gpl-2.0 |
RossBrunton/django | tests/admin_ordering/tests.py | 279 | 6702 | from __future__ import unicode_literals
from django.contrib import admin
from django.contrib.admin.options import ModelAdmin
from django.contrib.auth.models import User
from django.test import RequestFactory, TestCase
from .models import (
Band, DynOrderingBandAdmin, Song, SongInlineDefaultOrdering,
SongInlin... | bsd-3-clause |
MetrodataTeam/incubator-airflow | scripts/perf/dags/perf_dag_1.py | 44 | 1350 | # -*- coding: utf-8 -*-
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
... | apache-2.0 |
igemsoftware/SYSU-Software2013 | project/Python27/Lib/cookielib.py | 80 | 64452 | """HTTP cookie handling for web clients.
This module has (now fairly distant) origins in Gisle Aas' Perl module
HTTP::Cookies, from the libwww-perl library.
Docstrings, comments and debug strings in this code refer to the
attributes of the HTTP cookie system as cookie-attributes, to distinguish
them clearly from Pyth... | mit |
trankmichael/scipy | scipy/integrate/setup.py | 90 | 3250 | #!/usr/bin/env python
from __future__ import division, print_function, absolute_import
from os.path import join
from scipy._build_utils import numpy_nodepr_api
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
from numpy.distutils.system_info import get_... | bsd-3-clause |
pidydx/grr | grr/checks/sysctl_test.py | 2 | 1498 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for sysctl checks."""
from grr.lib import flags
from grr.lib import test_lib
from grr.lib.checks import checks_test_lib
from grr.parsers import linux_sysctl_parser
class SysctlTests(checks_test_lib.HostCheckTest):
@classmethod
def setUpClass(cls):
cls.L... | apache-2.0 |
rhurkes/chasegame | venv/lib/python2.7/site-packages/pip/index.py | 45 | 40374 | """Routines related to PyPI, indexes"""
import sys
import os
import re
import mimetypes
import posixpath
from pip.log import logger
from pip.util import Inf, normalize_name, splitext, is_prerelease
from pip.exceptions import (DistributionNotFound, BestVersionAlreadyInstalled,
InstallationE... | mit |
vtraag/leidenalg | tests/test_VertexPartition.py | 1 | 8491 | import unittest
import igraph as ig
import leidenalg
import random
from copy import deepcopy
from ddt import ddt, data, unpack
#%%
def name_object(obj, name):
obj.__name__ = name
return obj
graphs = [
###########################################################################
# Zachary karate network
... | gpl-3.0 |
azverkan/scons | test/MSVS/vs-6.0-files.py | 5 | 2715 | #!/usr/bin/env python
#
# __COPYRIGHT__
#
# 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, publish,
... | mit |
wdv4758h/ZipPy | lib-python/3/test/test_getopt.py | 173 | 6968 | # test_getopt.py
# David Goodger <dgoodger@bigfoot.com> 2000-08-19
from test.support import verbose, run_doctest, run_unittest, EnvironmentVarGuard
import unittest
import getopt
sentinel = object()
class GetoptTests(unittest.TestCase):
def setUp(self):
self.env = EnvironmentVarGuard()
if "POSIXL... | bsd-3-clause |
joshfriend/memegen | tests/test_routes_templates.py | 1 | 2217 | # pylint: disable=unused-variable
# pylint: disable=misplaced-comparison-constant
from .conftest import load
def describe_get():
def when_default_text(client):
response = client.get("/templates/iw")
assert 200 == response.status_code
assert dict(
name="Insanity Wolf",
... | mit |
markeTIC/OCB | addons/account/tests/test_account_move_closed_period.py | 136 | 1615 | from datetime import date
from openerp.tests.common import TransactionCase
from openerp.osv.orm import except_orm
class TestPeriodState(TransactionCase):
"""
Forbid creation of Journal Entries for a closed period.
"""
def setUp(self):
super(TestPeriodState, self).setUp()
cr, uid = sel... | agpl-3.0 |
ahmednuaman/django-angular | setup.py | 13 | 1246 | import os
from setuptools import setup, find_packages
from djangular import __version__
DESCRIPTION = 'Let Django play well with AngularJS'
CLASSIFIERS = [
'Environment :: Web Environment',
'Framework :: Django',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operati... | mit |
zahanm/foodpedia | django/conf/locale/sk/formats.py | 232 | 1288 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j. F Y'
TIME_FORMAT = 'G:i:s'
DATETIME_FORMAT = 'j. F Y G:i:s'
YEAR_MONTH... | bsd-3-clause |
Duke-NSOE/GeoHAT | GeoHat_V10/Scripts/networkx/tests/benchmark.py | 37 | 10636 | from timeit import Timer
# This is gratefully modeled after the benchmarks found in
# the numpy svn repository. http://svn.scipy.org/svn/numpy/trunk
class Benchmark(object):
"""
Benchmark a method or simple bit of code using different Graph classes.
If the test code is the same for each graph class, the... | cc0-1.0 |
aquavitae/rst2pdf | rst2pdf/tests/testcases/sphinx-issue284/sphinx/conf.py | 4 | 8455 | # -*- coding: utf-8 -*-
#
# Foobar documentation build configuration file, created by
# sphinx-quickstart on Wed Nov 11 10:37:39 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 ... | mit |
IEMLdev/ieml-api | ieml/usl/decoration/path.py | 2 | 20479 | from collections import defaultdict
from itertools import chain
from ieml.commons import OrderedEnum, monitor_decorator
from ieml.dictionary.script import Script
from ieml.usl.constants import FLEXION_SCRIPTS
from ieml.usl.syntagmatic_function import SyntagmaticFunction, SyntagmaticRole
from ieml.usl.usl import USL
fr... | gpl-3.0 |
Suninus/zulip | analytics/management/commands/user_stats.py | 113 | 1609 | from __future__ import absolute_import
import datetime
import pytz
from django.core.management.base import BaseCommand
from zerver.models import UserProfile, Realm, Stream, Message
class Command(BaseCommand):
help = "Generate statistics on user activity."
def add_arguments(self, parser):
parser.add_... | apache-2.0 |
DashaChuk/PyMySQL | pymysql/cursors.py | 7 | 15432 | # -*- coding: utf-8 -*-
from __future__ import print_function, absolute_import
import re
import warnings
from ._compat import range_type, text_type, PY2
from . import err
#: Regular expression for :meth:`Cursor.executemany`.
#: executemany only suports simple bulk insert.
#: You can use it to load large dataset.
RE... | mit |
bitemyapp/pgcli | tests/utils.py | 17 | 2002 | import pytest
import psycopg2
import psycopg2.extras
from pgcli.main import format_output
from pgcli.pgexecute import register_json_typecasters
# TODO: should this be somehow be divined from environment?
POSTGRES_USER, POSTGRES_HOST = 'postgres', 'localhost'
def db_connection(dbname=None):
conn = psycopg2.connec... | bsd-3-clause |
victormlourenco/red_kernel_lge_v500 | Documentation/networking/cxacru-cf.py | 14668 | 1626 | #!/usr/bin/env python
# Copyright 2009 Simon Arlott
#
# 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 i... | gpl-2.0 |
kwlzn/pants | src/python/pants/backend/jvm/tasks/jvm_compile/execution_graph.py | 23 | 11428 | # coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import Queue as queu... | apache-2.0 |
rasertux/importacsv | vendor/mysql/connector/django/features.py | 22 | 4331 | # MySQL Connector/Python - MySQL driver written in Python.
# New file added for Django 1.8
import django
if django.VERSION >= (1, 8):
from django.db.backends.base.features import BaseDatabaseFeatures
else:
from django.db.backends import BaseDatabaseFeatures
from django.utils.functional import cached_property
... | gpl-3.0 |
mustafat/odoo-1 | addons/account/report/account_balance.py | 198 | 5905 | # -*- 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 |
ioanpocol/superdesk-core | superdesk/storage/amazon_media_storage.py | 2 | 12253 | # -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014, 2015, 2016 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license
... | agpl-3.0 |
direvus/ansible | lib/ansible/modules/network/aci/aci_interface_policy_fc.py | 10 | 6142 | #!/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 |
zsoltdudas/lis-tempest | tempest/tests/test_hacking.py | 3 | 7788 | # Copyright 2014 Matthew Treinish
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | apache-2.0 |
FlaPer87/django-nonrel | tests/regressiontests/makemessages/extraction.py | 14 | 3452 | import os
import re
import shutil
from django.test import TestCase
from django.core import management
LOCALE='de'
class ExtractorTests(TestCase):
PO_FILE='locale/%s/LC_MESSAGES/django.po' % LOCALE
def setUp(self):
self._cwd = os.getcwd()
self.test_dir = os.path.abspath(os.path.dirname(__file... | bsd-3-clause |
JIC-CSB/dtoolcore | docs/source/conf.py | 1 | 5148 | # -*- coding: utf-8 -*-
#
# 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 configuration values have a default; values that are commented out
# serve to show the default.
# If extensi... | mit |
lucasosouza/berkeleyAI | tutorial/testParser.py | 49 | 2990 | # testParser.py
# -------------
# Licensing Information: You are free to use or extend these projects for
# educational purposes provided that (1) you do not distribute or publish
# solutions, (2) you retain this notice, and (3) you provide clear
# attribution to UC Berkeley, including a link to http://ai.berkeley.edu... | mit |
wbsavage/shinken | shinken/modules/logstore_null.py | 3 | 2366 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2009-2012:
# 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 can redis... | agpl-3.0 |
aswinpj/Pygments | pygments/lexers/_csound_builtins.py | 23 | 21643 | # -*- coding: utf-8 -*-
"""
pygments.lexers._csound_builtins
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
# Opcodes in Csound 6.05 from
# csound --list-opcodes
# except
# cggoto <http://www.csounds.... | bsd-2-clause |
nomadcube/scikit-learn | examples/covariance/plot_sparse_cov.py | 300 | 5078 | """
======================================
Sparse inverse covariance estimation
======================================
Using the GraphLasso estimator to learn a covariance and sparse precision
from a small number of samples.
To estimate a probabilistic model (e.g. a Gaussian model), estimating the
precision matrix, t... | bsd-3-clause |
Jimmy-Morzaria/scikit-learn | sklearn/utils/tests/test_murmurhash.py | 261 | 2836 | # Author: Olivier Grisel <olivier.grisel@ensta.org>
#
# License: BSD 3 clause
import numpy as np
from sklearn.externals.six import b, u
from sklearn.utils.murmurhash import murmurhash3_32
from numpy.testing import assert_array_almost_equal
from numpy.testing import assert_array_equal
from nose.tools import assert_equa... | bsd-3-clause |
romankagan/DDBWorkbench | python/lib/Lib/encodings/cp850.py | 593 | 34361 | """ Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP850.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_map)
def decode(self,input,errors='strict'):
... | apache-2.0 |
PythonProgramming/Beginning-Game-Development-with-Python-and-Pygame | Chapter 12/heavyfogtank.py.py | 3 | 2293 | from math import radians
from OpenGL.GL import *
from OpenGL.GLU import *
import pygame
from pygame.locals import *
# Import the Model3D class
import model3d
SCREEN_SIZE = (800, 600)
def resize(width, height):
glViewport(0, 0, width, height)
glMatrixMode(GL_PROJECTION)
glLoadIdentity()
gluPerspect... | mit |
freedomtan/tensorflow | tensorflow/python/platform/benchmark_test.py | 17 | 2860 | # 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 |
hfp/tensorflow-xsmm | tensorflow/contrib/boosted_trees/estimator_batch/custom_loss_head.py | 87 | 3030 | # 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 |
SaschaMester/delicium | tools/telemetry/telemetry/internal/util/path.py | 13 | 1600 | # 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.
import os
from telemetry.core import util
# TODO(dtu): Move these functions from core.util to here.
GetBaseDir = util.GetBaseDir
GetTelemetryDir = util.Ge... | bsd-3-clause |
alvarofierroclavero/scikit-learn | sklearn/ensemble/forest.py | 176 | 62555 | """Forest of trees-based ensemble methods
Those methods include random forests and extremely randomized trees.
The module structure is the following:
- The ``BaseForest`` base class implements a common ``fit`` method for all
the estimators in the module. The ``fit`` method of the base ``Forest``
class calls the ... | bsd-3-clause |
alex/boto | boto/rds/parametergroup.py | 170 | 7037 | # Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.org/
#
# 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, modi... | mit |
jlegendary/nupic | examples/prediction/experiments/confidenceTest/1/description.py | 17 | 2027 | # ----------------------------------------------------------------------
# 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 apply:
#
# This progra... | gpl-3.0 |
SCIP-Interfaces/PySCIPOpt | examples/unfinished/portfolio_soco.py | 2 | 2434 | """
portfolio_soco.py: modified markowitz model for portfolio optimization.
Approach: use second-order cone optimization.
Copyright (c) by Joao Pedro PEDROSO, Masahiro MURAMATSU and Mikio KUBO, 2012
"""
from pyscipopt import Model, quicksum, multidict
import math
def phi_inv(p):
"""phi_inv: inverse of gaussian ... | mit |
yosshy/nova | nova/tests/unit/cells/test_cells_utils.py | 9 | 7506 | # Copyright (c) 2012 Rackspace Hosting
# 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 req... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.