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 |
|---|---|---|---|---|---|
pombredanne/Rusthon | regtests/test-rust.py | 4 | 1223 | import os, sys, subprocess
passed = {}
ignore = ()
TODO_FIX = (
'ffi_hello.py', ## libc is unstable as of Rust1.2
'pointer_syntax.py',
'rust_select.py',
'try.py',
)
files = os.listdir('./rust')
files.sort()
for md in files:
if md in TODO_FIX:
print 'skip test: %s (TODO fix later)' %md
continue
elif not m... | bsd-3-clause |
CryptArc/bitcoin | test/functional/interface_rpc.py | 5 | 2791 | #!/usr/bin/env python3
# Copyright (c) 2018-2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Tests some generic aspects of the RPC interface."""
import os
from test_framework.authproxy import JSO... | mit |
roadmapper/ansible | lib/ansible/modules/windows/win_chocolatey_source.py | 38 | 3691 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCU... | gpl-3.0 |
arokem/nipy | examples/formula/parametric_design.py | 5 | 1927 | #!/usr/bin/env python
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""
In this example, we create a regression model for an event-related design in
which the response to an event at time T[i] is modeled as depending on the
amount of time since the las... | bsd-3-clause |
vishnumuthu/procamcalib_proj | doc/source/conf.py | 16 | 8529 | # -*- coding: utf-8 -*-
#
# rr-init documentation build configuration file, created by
# sphinx-quickstart on Wed Feb 18 16:46:18 2015.
#
# 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.
#
# A... | cc0-1.0 |
ryfeus/lambda-packs | HDF4_H5_NETCDF/source2.7/numpy/core/tests/test_half.py | 12 | 18605 | from __future__ import division, absolute_import, print_function
import platform
import pytest
import numpy as np
from numpy import uint16, float16, float32, float64
from numpy.testing import assert_, assert_equal
def assert_raises_fpe(strmatch, callable, *args, **kwargs):
try:
callable(*args, **kwargs)... | mit |
ThinkOpen-Solutions/odoo | addons/base_gengo/__init__.py | 377 | 1122 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Openerp sa (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of th... | agpl-3.0 |
Ernesto99/odoo | addons/report/tests/test_reports.py | 385 | 2251 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2014-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 |
pra85/calibre | src/calibre/gui2/dnd.py | 4 | 10959 | #!/usr/bin/env python
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2011, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import posixpa... | gpl-3.0 |
HPPTECH/hpp_IOSTressTest | Refer/IOST_OLD_SRC/IOST_0.11/IOST_Basic.py | 6 | 4169 | #!/usr/bin/python
#======================================================================
#
# Project : hpp_IOStressTest
# File : IOST_Basic.py
# Date : Oct 17, 2016
# Author : HuuHoang Nguyen
# Contact : hhnguyen@apm.com
# : hoangnh.hpp@gmail.com
# License : MIT License
# Copyright : 2016
# Desc... | mit |
aoom/pattern | pattern/text/search.py | 21 | 44939 | #### PATTERN | TEXT | PATTERN MATCHING #############################################################
# -*- coding: utf-8 -*-
# Copyright (c) 2010 University of Antwerp, Belgium
# Author: Tom De Smedt <tom@organisms.be>
# License: BSD (see LICENSE.txt for details).
# http://www.clips.ua.ac.be/pages/pattern
############... | bsd-3-clause |
m4nh/roars | scripts/nodes/examples/arp_detector_example.py | 1 | 2688 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
from roars.rosutils.rosnode import RosNode
from roars.vision.cameras import CameraRGB
from roars.vision.arucoutils import MarkerDetector
from roars.vision.arp import ARP
import roars.vision.cvutils as cvutils
import cv2
import numpy as np
import os
import json
#⬢⬢⬢⬢⬢➤ N... | gpl-3.0 |
jing-bao/pa-chromium | sync/tools/testserver/xmppserver.py | 6 | 19194 | # Copyright 2013 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.
"""A bare-bones and non-compliant XMPP server.
Just enough of the protocol is implemented to get it to work with
Chrome's sync notification system.
"""
imp... | bsd-3-clause |
ConnorDFlynn/Group1PySpider | tests/data_test_webpage.py | 67 | 1106 | #!/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 2015-01-24 13:44:10
from httpbin import app
@app.route('/pyspider/test.html')
def test_page():
return '''
<a href="/404">404
<a href="/links/10/0">0... | apache-2.0 |
a-b/PopClip-Extensions | source/InstantTranslate/main.py | 5 | 1603 | # coding=utf-8
LANG_CODES = {
"Arabic": "ar",
"Bosnian (Latin)": "bs-Latn",
"Bulgarian": "bg",
"Catalan": "ca",
"Chinese Simplified": "zh-CHS",
"Chinese Traditional": "zh-CHT",
"Croatian": "hr",
"Czech": "cs",
"Danish": "da",
"Dutch": "nl",
"English": "en",
"Estonian": "... | mit |
Akshay0724/scikit-learn | examples/text/hashing_vs_dict_vectorizer.py | 93 | 3243 | """
===========================================
FeatureHasher and DictVectorizer Comparison
===========================================
Compares FeatureHasher and DictVectorizer by using both to vectorize
text documents.
The example demonstrates syntax and speed only; it doesn't actually do
anything useful with the e... | bsd-3-clause |
jaloren/robotframework | utest/reporting/test_stringcache.py | 9 | 2439 | import time
import random
import string
import unittest
from robot.reporting.stringcache import StringCache, StringIndex
from robot.utils.asserts import assert_equal, assert_true, assert_false
try:
long
except NameError:
long = int
class TestStringCache(unittest.TestCase):
def setUp(self):
# T... | apache-2.0 |
rahushen/ansible | lib/ansible/modules/network/aci/aci_interface_selector_to_switch_policy_leaf_profile.py | 26 | 7567 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Bruno Calogero <brunocalogero@hotmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_... | gpl-3.0 |
ryfeus/lambda-packs | Sklearn_scipy_numpy/source/sklearn/svm/base.py | 6 | 36145 | from __future__ import print_function
import numpy as np
import scipy.sparse as sp
import warnings
from abc import ABCMeta, abstractmethod
from . import libsvm, liblinear
from . import libsvm_sparse
from ..base import BaseEstimator, ClassifierMixin, ChangedBehaviorWarning
from ..preprocessing import LabelEncoder
from... | mit |
IFAEControl/pirelay | pirelay/server.py | 1 | 1591 | #!/usr/bin/env python3
import time
from concurrent import futures
import grpc
from .protos import pirelay_pb2
from .protos import pirelay_pb2_grpc
from .relay import RelaysArray
_ONE_DAY_IN_SECONDS = 60 * 60 * 24
PINS = [21]
class PiRelayServer(pirelay_pb2_grpc.PiRelayServicer):
def __init__(self, bcm_pins... | lgpl-3.0 |
mwilliamson/python-mammoth | tests/docx/style_map_tests.py | 1 | 4495 | import io
from zipfile import ZipFile
from nose.tools import istest, assert_equal
from mammoth.docx.style_map import write_style_map, read_style_map
from mammoth.zips import open_zip
from mammoth.docx import xmlparser as xml
@istest
def reading_embedded_style_map_on_document_without_embedded_style_map_returns_none(... | bsd-2-clause |
bjoshua/ansible | lib/ansible/plugins/cache/jsonfile.py | 47 | 4628 | # (c) 2014, Brian Coca, Josh Drake, et al
#
# 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 |
Jgarcia-IAS/localizacion | openerp/addons/mail/mail_group_menu.py | 334 | 2631 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2012-today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | agpl-3.0 |
atsao72/sympy | sympy/combinatorics/prufer.py | 93 | 11915 | from __future__ import print_function, division
from sympy.core import Basic
from sympy.core.compatibility import iterable, as_int, range
from sympy.utilities.iterables import flatten
from collections import defaultdict
class Prufer(Basic):
"""
The Prufer correspondence is an algorithm that describes the
... | bsd-3-clause |
divya-csekar/flask-microblog-server | flask/Lib/encodings/iso8859_1.py | 593 | 13432 | """ Python Character Mapping Codec iso8859_1 generated from 'MAPPINGS/ISO8859/8859-1.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,input,errors='... | bsd-3-clause |
tensorflow/model-optimization | tensorflow_model_optimization/g3doc/tools/build_docs.py | 1 | 3663 | # 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 |
krisys/django | tests/forms_tests/field_tests/test_integerfield.py | 4 | 5979 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.forms import IntegerField, Textarea, ValidationError
from django.test import SimpleTestCase
from . import FormFieldAssertionsMixin
class IntegerFieldTest(FormFieldAssertionsMixin, SimpleTestCase):
def test_integerfield_1(self):
... | bsd-3-clause |
redhat-openstack/ironic | ironic/tests/policy_fixture.py | 8 | 1523 | # Copyright 2012 Hewlett-Packard Development Company, L.P.
#
# 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 applicabl... | apache-2.0 |
billwanjohi/ansible | lib/ansible/runner/lookup_plugins/first_found.py | 33 | 5953 | # (c) 2013, seth vidal <skvidal@fedoraproject.org> 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
# (at your optio... | gpl-3.0 |
aricchen/openHR | openerp/addons/crm/report/crm_phonecall_report.py | 48 | 4906 | # -*- 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 |
owlabs/incubator-airflow | airflow/executors/__init__.py | 1 | 3891 | # -*- coding: utf-8 -*-
#
# 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
#... | apache-2.0 |
dgquintas/vmcontroller.unstable | src/vmcontroller.host/vmcontroller/host/__init__.py | 2 | 1311 | """
VMController Host, agent for host system
"""
__version__ = '0.2.0'
__authors__ = ['"David Garcia Quintas" <dgquintas@gmail.com>',
'"Rohit Yadav" <rohityadav89@gmail.com>']
__copyright__ = "Copyright 2010 VMController Authors"
__license__ = """Licensed under the (Simplified) BSD License
you may not ... | bsd-3-clause |
aachik/flask-blog-abdulmx | env/lib/python2.7/site-packages/pip/_vendor/html5lib/html5parser.py | 169 | 117500 | from __future__ import absolute_import, division, unicode_literals
from pip._vendor.six import with_metaclass
import types
from . import inputstream
from . import tokenizer
from . import treebuilders
from .treebuilders._base import Marker
from . import utils
from . import constants
from .constants import spaceChara... | mit |
gentledevil/ansible | lib/ansible/module_utils/ec2.py | 67 | 8639 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | gpl-3.0 |
lmiccini/sos | sos/plugins/iprconfig.py | 3 | 4670 | # 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 the hope that it will be useful,
# but... | gpl-2.0 |
Threew/python-oauth2 | example/server.py | 375 | 7669 | """
The MIT License
Copyright (c) 2007 Leah Culver
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, publis... | mit |
suutari/shoop | shuup/notify/template.py | 1 | 3011 | # -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2012-2016, Shoop Commerce Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import unicode_literals
from django.utils.encoding... | agpl-3.0 |
leelasd/OPLS-AAM_for_Gromacs | GMX_TEST/GXG/N/NAMD_GMX_DIFF.py | 45 | 1077 | import os
from collections import OrderedDict
import sys
fil = open('energy.xvg').readlines()
GMX_dat = [float(f)/4.184 for f in fil[-1].split()[1:-1]]
nfil = open('LOG_NAMD').readlines()
for line in nfil:
if 'ENERGY: 0' in line:
NAMD_DAT = [float(f) for f in line.split()[2:12]]
break
#pr... | mit |
Jgarcia-IAS/ReporsitorioVacioOdoo | openerp/addons/hr_contract/__init__.py | 381 | 1107 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-Today OpenERP SA (<http://www.openerp.com)
#
# This program is free software: you can redistribute it and/or modify
# it under the term... | agpl-3.0 |
pomegranited/edx-platform | common/djangoapps/terrain/stubs/ora.py | 119 | 17323 | """
Stub implementation of ORA service.
This is an extremely simple version of the service, with most
business logic removed. In particular, the stub:
1) Provides an infinite number of peer and calibration essays,
with dummy data.
2) Simulates a set number of pending submissions for each student;
grades submi... | agpl-3.0 |
GbalsaC/bitnamiP | venv/lib/python2.7/site-packages/social/backends/exacttarget.py | 70 | 4029 | """
ExactTarget OAuth support.
Support Authentication from IMH using JWT token and pre-shared key.
Requires package pyjwt
"""
from datetime import timedelta, datetime
import jwt
from social.exceptions import AuthFailed, AuthCanceled
from social.backends.oauth import BaseOAuth2
class ExactTargetOAuth2(BaseOAuth2):
... | agpl-3.0 |
hoho/dosido | nodejs/deps/v8/third_party/jinja2/compiler.py | 335 | 63846 | # -*- coding: utf-8 -*-
"""
jinja2.compiler
~~~~~~~~~~~~~~~
Compiles nodes into python code.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
from itertools import chain
from copy import deepcopy
from keyword import iskeyword as is_python_keyword
from jinja2... | mit |
murphy-wang/aws-ec2 | lib/boto-2.34.0/boto/pyami/helloworld.py | 153 | 1238 | # Copyright (c) 2006,2007 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... | apache-2.0 |
yxl/emscripten-calligra-mobile | plan/plugins/scripting/tests/project_access.py | 7 | 3268 | #!/usr/bin/env kross
# -*- coding: utf-8 -*-
import traceback
import Kross
import Plan
import TestResult
TestResult.setResult( True )
asserttext = "Test of property '{0}' failed:\n Expected: '{2}'\n Result: '{1}'"
asserttext2 = "Failed to set property '{0}' to '{1}'. Result: {2}"
try:
project = Plan.proje... | gpl-2.0 |
ashang/calibre | src/calibre/utils/complete.py | 14 | 5285 | #!/usr/bin/env python2
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
from __future__ import with_statement
__license__ = 'GPL v3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
'''
BASH completion for calibre commands that are too complex for simple
completion... | gpl-3.0 |
pekermert/django-socketio | django_socketio/views.py | 10 | 2745 |
from django.http import HttpResponse
from django_socketio import events
from django_socketio.channels import SocketIOChannelProxy
from django_socketio.clients import client_start, client_end
from django_socketio.utils import format_log
def socketio(request):
"""
Socket.IO handler - maintains the lifecycle o... | bsd-2-clause |
cloudbase/nova-virtualbox | nova/tests/unit/keymgr/test_single_key_mgr.py | 78 | 2448 | # Copyright (c) 2013 The Johns Hopkins University/Applied Physics Laboratory
# 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/... | apache-2.0 |
elkingtonmcb/scikit-learn | sklearn/gaussian_process/gaussian_process.py | 78 | 34552 | # -*- coding: utf-8 -*-
# Author: Vincent Dubourg <vincent.dubourg@gmail.com>
# (mostly translation, see implementation details)
# Licence: BSD 3 clause
from __future__ import print_function
import numpy as np
from scipy import linalg, optimize
from ..base import BaseEstimator, RegressorMixin
from ..metrics... | bsd-3-clause |
danic96/Practica1 | Practica1/Aplicacio/views.py | 1 | 4321 | # from django.shortcuts import render
# Create your views here.
# from django.http import HttpResponse
from django.utils.decorators import method_decorator
from django.contrib.auth.decorators import login_required
from django.views.generic.edit import CreateView, UpdateView
from django.views.generic import DetailVi... | mit |
cristiana214/cristianachavez214-cristianachavez | python/src/Lib/test/test_difflib.py | 74 | 5281 | import difflib
from test.test_support import run_unittest, findfile
import unittest
import doctest
import sys
class TestSFbugs(unittest.TestCase):
def test_ratio_for_null_seqn(self):
# Check clearing of SF bug 763023
s = difflib.SequenceMatcher(None, [], [])
self.assertEqual(s.ratio(), 1)
... | apache-2.0 |
EdgarSun/Django-Demo | django/conf/locale/ko/formats.py | 313 | 2016 | # -*- 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 = 'Y년 n월 j일'
TIME_FORMAT = 'A g:i:s'
DATETIME_FORMAT = 'Y년 n월 j일 g:i:s A'
YE... | mit |
android-ia/platform_external_chromium_org | media/tools/layout_tests/trend_graph.py | 174 | 3309 | # 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.
"""A module for manipulating trend graph with analyzer result history."""
import os
import layouttest_analyzer_helpers
DEFAULT_TREND_GRAPH_PATH = os.p... | bsd-3-clause |
rbalda/neural_ocr | env/lib/python2.7/site-packages/numpy/lib/npyio.py | 42 | 71218 | from __future__ import division, absolute_import, print_function
import sys
import os
import re
import itertools
import warnings
import weakref
from operator import itemgetter
import numpy as np
from . import format
from ._datasource import DataSource
from numpy.core.multiarray import packbits, unpackbits
from ._ioto... | mit |
pastebt/you-get | src/you_get/extractors/miomio.py | 19 | 1195 | #!/usr/bin/env python
__all__ = ['miomio_download']
from ..common import *
from .sina import sina_download_by_xml
from .tudou import tudou_download_by_id
from .youku import youku_download_by_vid
def miomio_download(url, output_dir = '.', merge = True, info_only = False):
html = get_html(url)
title = r1(r'<... | mit |
gundalow/ansible | test/integration/targets/module_utils_urls/library/test_peercert.py | 29 | 2346 | #!/usr/bin/python
# Copyright: (c) 2020, 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
DOCUMENTATION = r'''
---
module: test_perrcert
short_description: Test getting t... | gpl-3.0 |
bholbrook73/thrift | contrib/parse_profiling.py | 57 | 10542 | #!/usr/bin/env python
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "Li... | apache-2.0 |
madjar/aurifere | tests/test_pkgbuild.py | 1 | 1304 | import os
import unittest
here = os.path.dirname(__file__)
class PkgbuildTest(unittest.TestCase):
def _get_pkgbuild(self):
from aurifere.pkgbuild import PKGBUILD
return PKGBUILD(os.path.join(here, 'fixtures/PKGBUILD'))
def test_attributes(self):
p = self._get_pkgbuild()
self.... | isc |
Gitlab11/odoo | addons/email_template/tests/__init__.py | 260 | 1093 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | agpl-3.0 |
andres-root/bitcoinxt | qa/rpc-tests/mempool_coinbase_spends.py | 125 | 3785 | #!/usr/bin/env python2
# Copyright (c) 2014 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test re-org scenarios with a mempool that contains transactions
# that spend (directly or indirectly) coin... | mit |
wechasing/tornado | demos/appengine/blog.py | 114 | 5385 | #!/usr/bin/env python
#
# Copyright 2009 Facebook
#
# 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 |
j-coll/opencga | opencga-app/app/cloud/azure/arm/scripts/mount.py | 4 | 7799 | import sys
import socket
import fcntl
import struct
import random
import os
import shutil
import subprocess
import time
import csv
import ipaddress
# Run `python3 -m unittest discover` in this dir to execute tests
default_mount_options_nfs = "nfs hard,nointr,proto=tcp,mountproto=tcp,retry=30 0 0"
default_mount_option... | apache-2.0 |
dotCipher/xcrypt-linux-kernel-module | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py | 11088 | 3246 | # Core.py - Python extension for perf script, core functions
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
from collections import defaultdict
def aut... | gpl-2.0 |
etos/django | django/conf/locale/ka/formats.py | 65 | 2113 | # 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 = 'l, j F, Y'
TIME_FORMAT = 'h:i a'
DATETIME_FORMAT = 'j F, Y h:i a'
YEAR_MONTH_FORMAT = 'F, Y'
MONTH_D... | bsd-3-clause |
tuxfux-hlp-notes/python-batches | archieves/batch-58/modules/sheets/lib/python2.7/site-packages/pip/cmdoptions.py | 361 | 9507 | """
shared options and groups
The principle here is to define options once, but *not* instantiate them globally.
One reason being that options with action='append' can carry state between parses.
pip parse's general options twice internally, and shouldn't pass on state.
To be consistent, all options will follow this d... | gpl-3.0 |
rolandmansilla/microblog | flask/lib/python2.7/site-packages/coverage/__init__.py | 43 | 1177 | # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt
"""Code coverage measurement for Python.
Ned Batchelder
http://nedbatchelder.com/code/coverage
"""
from coverage.version import __version__, __url__, version_inf... | bsd-3-clause |
erickpeirson/eratosthenes | eratosthenes/eratosthenes/managers.py | 2 | 3658 | from django.conf import settings
import requests
from bs4 import BeautifulSoup
import json
class RepositoryManager(object):
__name__ = 'RepositoryManager'
def __init__(self, endpoint, **kwargs):
self.endpoint = endpoint
for k, v in kwargs.iteritems():
setattr(self, k, v)
de... | gpl-2.0 |
mkaluza/external_chromium_org | chrome/common/extensions/docs/server2/test_file_system_test.py | 23 | 6554 | #!/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.
from copy import deepcopy
from file_system import FileNotFoundError, StatInfo
from test_file_system import TestFileSystem, MoveTo
i... | bsd-3-clause |
bslatkin/pycon2014 | lib/asyncio-0.4.1/asyncio/locks.py | 16 | 14325 | """Synchronization primitives."""
__all__ = ['Lock', 'Event', 'Condition', 'Semaphore', 'BoundedSemaphore']
import collections
from . import events
from . import futures
from . import tasks
class _ContextManager:
"""Context manager.
This enables the following idiom for acquiring and releasing a
lock a... | apache-2.0 |
TathagataChakraborti/resource-conflicts | PLANROB-2015/seq-sat-lama/py2.5/lib/python2.5/functools.py | 91 | 2155 | """functools.py - Tools for working with functions and callable objects
"""
# Python module wrapper for _functools C module
# to allow utilities written in Python to be added
# to the functools module.
# Written by Nick Coghlan <ncoghlan at gmail.com>
# Copyright (C) 2006 Python Software Foundation.
# See C source co... | mit |
aljex/iTerm2 | tests/esctest/tests/cnl.py | 31 | 2269 | import esccmd
from escutil import AssertEQ, GetCursorPosition, GetScreenSize
from esctypes import Point
class CNLTests(object):
def test_CNL_DefaultParam(self):
"""CNL moves the cursor down 1 with no parameter given."""
esccmd.CUP(Point(5, 3))
esccmd.CNL()
position = GetCursorPosition()
AssertEQ(... | gpl-2.0 |
Chilledheart/chromium | tools/telemetry/telemetry/value/summary_unittest.py | 3 | 14006 | # 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
import unittest
from telemetry import story
from telemetry.internal.results import page_test_results
from telemetry import page as page_module
fro... | bsd-3-clause |
ifduyue/django | tests/flatpages_tests/test_views.py | 130 | 6846 | from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.flatpages.models import FlatPage
from django.contrib.sites.models import Site
from django.test import TestCase, modify_settings, override_settings
from .settings import FLATPAGES_TEMPLATES
class TestDataMixin:
@clas... | bsd-3-clause |
urrego093/proyecto_mv | scripts/extract_pgsql_models.py | 15 | 10260 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Create web2py model (python code) to represent PostgreSQL tables.
Features:
* Uses ANSI Standard INFORMATION_SCHEMA (might work with other RDBMS)
* Detects legacy "keyed" tables (not having an "id" PK)
* Connects directly to running databases, no need to do a SQL dump... | gpl-3.0 |
CorundumGames/Invasodado | game/ufo.py | 1 | 3605 | from math import sin
from random import choice, uniform, expovariate
from pygame import Rect
from core import color
from core import config
from core.particles import ParticleEmitter
from game.block import get_block
from game.gameobject import GameObject
from game import gamedata
### Co... | gpl-3.0 |
wandec/grr | config/data_server.py | 13 | 1402 | #!/usr/bin/env python
"""Configuration parameters for the data servers."""
from grr.lib import config_lib
# The Data Store server.
config_lib.DEFINE_integer("Dataserver.stats_frequency", 60,
("Time interval in seconds for data server "
"statistics updates"))
confi... | apache-2.0 |
lamby/python-social-auth | social/backends/lastfm.py | 70 | 1888 | import hashlib
from social.utils import handle_http_errors
from social.backends.base import BaseAuth
class LastFmAuth(BaseAuth):
"""
Last.Fm authentication backend. Requires two settings:
SOCIAL_AUTH_LASTFM_KEY
SOCIAL_AUTH_LASTFM_SECRET
Don't forget to set the Last.fm callback to somethi... | bsd-3-clause |
stamen/fieldpapers | decoder/tasks.py | 3 | 1966 | from celery import Celery
from raven import Client
import compose, decode, forms
celery = Celery('tasks', broker='redis://')
client = Client()
@celery.task
def decodeScan(apibase, password, **msg):
""" Process an uploaded scan.
"""
url = msg['url']
print 'Decoding scan', msg['scan_id']
try:
... | gpl-2.0 |
tmenjo/cinder-2015.1.0 | cinder/tests/api/v1/stubs.py | 6 | 4045 | # Copyright 2010 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 |
mikewiebe-ansible/ansible | test/units/modules/network/fortios/test_fortios_web_proxy_forward_server.py | 21 | 10345 | # Copyright 2019 Fortinet, 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 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the... | gpl-3.0 |
rdo-infra/ci-config | ci-scripts/dlrnapi_promoter/qcow_client.py | 1 | 10534 | """
This file contains classes and functionto interact with qcow images servers
"""
import copy
import logging
import os
import paramiko
from common import PromotionError
class QcowConnectionClient(object):
"""
Proxy class for client connection
"""
_log = logging.getLogger("promoter")
def __ini... | apache-2.0 |
gautam1858/tensorflow | tensorflow/contrib/constrained_optimization/python/swap_regret_optimizer_test.py | 25 | 9262 | # Copyright 2018 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 |
zzxuanyuan/root | tutorials/pyroot/zdemo.py | 44 | 8459 | ## \file
## \ingroup tutorial_pyroot
## \notebook
## This macro is an example of graphs in log scales with annotations.
##
## The presented results
## are predictions of invariant cross-section of Direct Photons produced
## at RHIC energies, based on the universality of scaling function H(z).
##
##
## These Figures ... | lgpl-2.1 |
lekum/ansible-modules-extras | monitoring/logicmonitor_facts.py | 3 | 22050 | #!/usr/bin/python
"""LogicMonitor Ansible module for managing Collectors, Hosts and Hostgroups
Copyright (C) 2015 LogicMonitor
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 ver... | gpl-3.0 |
mlihan/msgapi | linebot/models/__init__.py | 3 | 1810 | # -*- 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | apache-2.0 |
mark-me/Pi-Jukebox | venv/Lib/site-packages/pip-19.0.3-py3.7.egg/pip/_vendor/pep517/envbuild.py | 22 | 5763 | """Build wheels/sdists by installing build deps to a temporary environment.
"""
import os
import logging
from pip._vendor import pytoml
import shutil
from subprocess import check_call
import sys
from sysconfig import get_paths
from tempfile import mkdtemp
from .wrappers import Pep517HookCaller
log = logging.getLogge... | agpl-3.0 |
liuqr/edx-xiaodun | common/lib/xmodule/xmodule/progress.py | 127 | 4896 | '''
Progress class for modules. Represents where a student is in a module.
Useful things to know:
- Use Progress.to_js_status_str() to convert a progress into a simple
status string to pass to js.
- Use Progress.to_js_detail_str() to convert a progress into a more detailed
string to pass to js.
In particular... | agpl-3.0 |
azatoth/scons | src/engine/SCons/Tool/intelc.py | 2 | 21046 | """SCons.Tool.icl
Tool-specific initialization for the Intel C/C++ compiler.
Supports Linux and Windows compilers, v7 and up.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# __COPYRIGHT__
#
# Permission ... | mit |
parksandwildlife/wastd | occurrence/migrations/0006_auto_20181129_1812.py | 1 | 1084 | # Generated by Django 2.0.8 on 2018-11-29 10:12
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('occurrence', '0005_auto_20181025_1720'),
]
operations = [
migrations.AlterField(
model_name='areaencounter',
name='s... | mit |
ammarkhann/FinalSeniorCode | lib/python2.7/site-packages/sympy/plotting/pygletplot/plot_window.py | 96 | 4467 | from __future__ import print_function, division
from pyglet.gl import *
from managed_window import ManagedWindow
from plot_camera import PlotCamera
from plot_controller import PlotController
from time import clock
class PlotWindow(ManagedWindow):
def __init__(self, plot, **kwargs):
"""
Named A... | mit |
jjmleiro/hue | desktop/core/ext-py/django-extensions-1.5.0/django_extensions/management/utils.py | 35 | 2694 | from django.conf import settings
import os
import sys
import logging
from django_extensions.management.signals import pre_command, post_command
try:
from importlib import import_module
except ImportError:
try:
from django.utils.importlib import import_module
except ImportError:
def import_m... | apache-2.0 |
obulpathi/vaultcoincpp | share/qt/make_spinner.py | 4415 | 1035 | #!/usr/bin/env python
# W.J. van der Laan, 2011
# Make spinning .mng animation from a .png
# Requires imagemagick 6.7+
from __future__ import division
from os import path
from PIL import Image
from subprocess import Popen
SRC='img/reload_scaled.png'
DST='../../src/qt/res/movies/update_spinner.mng'
TMPDIR='/tmp'
TMPNAM... | mit |
chhao91/pysal | pysal/spreg/tests/test_error_sp.py | 3 | 14241 | import unittest
import scipy
import pysal
import numpy as np
from pysal.spreg import error_sp as SP
class TestBaseGMError(unittest.TestCase):
def setUp(self):
db=pysal.open(pysal.examples.get_path("columbus.dbf"),"r")
y = np.array(db.by_col("HOVAL"))
self.y = np.reshape(y, (49,1))
X... | bsd-3-clause |
jnovinger/django | django/contrib/contenttypes/fields.py | 43 | 23567 | from __future__ import unicode_literals
from collections import defaultdict
from django.contrib.contenttypes.models import ContentType
from django.core import checks
from django.core.exceptions import FieldDoesNotExist, ObjectDoesNotExist
from django.db import DEFAULT_DB_ALIAS, connection, models, router, transaction... | bsd-3-clause |
chouseknecht/ansible | test/units/module_utils/basic/test_log.py | 120 | 7027 | # -*- coding: utf-8 -*-
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
# (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 absolute_import, division, print_function
__metaclass__ = type
import syslog
from itertools... | gpl-3.0 |
csdms/dakota | dakotathon/tests/test_plugin_hydrotrend_run.py | 1 | 3466 | #!/usr/bin/env python
#
# Test running the dakota.plugin.hydrotrend module.
#
# Call with:
# $ nosetests -sv
#
# Mark Piper (mark.piper@colorado.edu)
import os
import shutil
# import filecmp
import glob
from nose.tools import with_setup, assert_true
from dakotathon.dakota import Dakota
from dakotathon.plugins.hydro... | mit |
astorije/ansible-modules-extras | system/known_hosts.py | 60 | 8999 | #!/usr/bin/python
"""
Ansible module to manage the ssh known_hosts file.
Copyright(c) 2014, Matthew Vernon <mcv21@cam.ac.uk>
This module 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 Li... | gpl-3.0 |
kysolvik/reservoir-id | reservoir-id/classifier_train.py | 1 | 6974 | #!/usr/bin/env python
"""
Train random forest classifier
Inputs: CSV from build_att_table, small area cutoff
Outputs: Packaged up Random Forest model
@authors: Kylen Solvik
Date Create: 3/17/17
"""
# Load libraries
import pandas as pd
from sklearn import model_selection
from sklearn import preprocessing
from sklearn.... | gpl-3.0 |
DazWorrall/ansible | lib/ansible/modules/packaging/language/pip.py | 8 | 21296 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Matt Wright <matt@nobien.net>
# 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',
... | gpl-3.0 |
shivam1111/odoo | addons/l10n_be/wizard/__init__.py | 438 | 1145 | # -*- 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 |
ychen820/microblog | y/google-cloud-sdk/platform/google_appengine/lib/django-1.5/django/template/response.py | 221 | 6214 | from django.http import HttpResponse
from django.template import loader, Context, RequestContext
from django.utils import six
class ContentNotRenderedError(Exception):
pass
class SimpleTemplateResponse(HttpResponse):
rendering_attrs = ['template_name', 'context_data', '_post_render_callbacks']
def __in... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.