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 |
|---|---|---|---|---|---|
EasonYi/zulip | zerver/lib/statistics.py | 115 | 4695 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from zerver.models import UserProfile, UserActivity, UserActivityInterval, Message
from django.utils.timezone import utc
from datetime import timedelta
from itertools import chain
def median(data):
data = sorted(data)
size = len(data)
if si... | apache-2.0 |
nitish116/pystache | pystache/tests/common.py | 31 | 7060 | # coding: utf-8
"""
Provides test-related code that can be used by all tests.
"""
import os
import pystache
from pystache import defaults
from pystache.tests import examples
# Save a reference to the original function to avoid recursion.
_DEFAULT_TAG_ESCAPE = defaults.TAG_ESCAPE
_TESTS_DIR = os.path.dirname(pystac... | mit |
wzbozon/scikit-learn | benchmarks/bench_tree.py | 297 | 3617 | """
To run this, you'll need to have installed.
* scikit-learn
Does two benchmarks
First, we fix a training set, increase the number of
samples to classify and plot number of classified samples as a
function of time.
In the second benchmark, we increase the number of dimensions of the
training set, classify a sam... | bsd-3-clause |
tuxfux-hlp-notes/python-batches | archieves/batch-61/modules/myenv/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/contrib/pyopenssl.py | 216 | 13871 | '''SSL with SNI_-support for Python 2.
This needs the following packages installed:
* pyOpenSSL (tested with 0.13)
* ndg-httpsclient (tested with 0.3.2)
* pyasn1 (tested with 0.1.6)
To activate it call :func:`~urllib3.contrib.pyopenssl.inject_into_urllib3`.
This can be done in a ``sitecustomize`` module, or at any o... | gpl-3.0 |
blueskycoco/rt-thread | bsp/stm32/stm32f411-atk-nano/rtconfig.py | 32 | 3836 | import os
# toolchains options
ARCH='arm'
CPU='cortex-m4'
CROSS_TOOL='gcc'
# bsp lib config
BSP_LIBRARY_TYPE = None
if os.getenv('RTT_CC'):
CROSS_TOOL = os.getenv('RTT_CC')
if os.getenv('RTT_ROOT'):
RTT_ROOT = os.getenv('RTT_ROOT')
# cross_tool provides the cross compiler
# EXEC_PATH is the compiler execute... | gpl-2.0 |
Changaco/oh-mainline | vendor/packages/feedparser/feedparser/sgmllib3.py | 149 | 17788 | """A parser for SGML, using the derived class as a static DTD."""
# XXX This only supports those SGML features used by HTML.
# XXX There should be a way to distinguish between PCDATA (parsed
# character data -- the normal case), RCDATA (replaceable character
# data -- only char and entity references and end tags are ... | agpl-3.0 |
DirtyUnicorns/android_external_chromium_org | third_party/jinja2/sandbox.py | 637 | 13445 | # -*- coding: utf-8 -*-
"""
jinja2.sandbox
~~~~~~~~~~~~~~
Adds a sandbox layer to Jinja as it was the default behavior in the old
Jinja 1 releases. This sandbox is slightly different from Jinja 1 as the
default behavior is easier to use.
The behavior can be changed by subclassing the environm... | bsd-3-clause |
tal-nino/ansible | lib/ansible/plugins/action/assert.py | 163 | 2353 | # Copyright 2012, Dag Wieers <dag@wieers.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 versi... | gpl-3.0 |
c86j224s/snippet | Python_Pygments/lib/python3.6/site-packages/pygments/lexers/_mql_builtins.py | 31 | 24736 | # -*- coding: utf-8 -*-
"""
pygments.lexers._mql_builtins
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Builtins for the MqlLexer.
:copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
types = (
'AccountBalance',
'AccountCompany',
'AccountCredit... | apache-2.0 |
akumar21NCSU/servo | tests/wpt/css-tests/css-text-decor-3_dev/html/reference/support/generate-text-emphasis-line-height-tests.py | 829 | 3431 | #!/usr/bin/env python
# - * - coding: UTF-8 - * -
"""
This script generates tests text-emphasis-line-height-001 ~ 004 except
001z. They test the line height expansion in different directions. This
script outputs a list of all tests it generated in the format of Mozilla
reftest.list to the stdout.
"""
from __future__ ... | mpl-2.0 |
robotology-playground/qpOASES | interfaces/python/setup.py | 2 | 2254 | #!/usr/bin/env python
"""qpOASES python distutils setup script."""
#
# This file is part of qpOASES.
#
# qpOASES -- An Implementation of the Online Active Set Strategy.
# Copyright (C) 2007-2017 by Hans Joachim Ferreau, Andreas Potschka,
# Christian Kirches et al. All rights reserved.
#
# qpOASES is free software... | lgpl-2.1 |
TileHalo/servo | components/script/dom/bindings/codegen/parser/tests/test_distinguishability.py | 134 | 5560 | def firstArgType(method):
return method.signatures()[0][1][0].type
def WebIDLTest(parser, harness):
parser.parse("""
dictionary Dict {
};
callback interface Foo {
};
interface Bar {
// Bit of a pain to get things that have dictionary types
void passDict(optional Di... | mpl-2.0 |
AdrienGuille/pyMABED | build_event_browser.py | 1 | 3036 | # coding: utf-8
# std
import time
import argparse
import os
import shutil
# web
from flask import Flask, render_template
from flask_frozen import Freezer
# mabed
import mabed.utils as utils
__author__ = "Adrien Guille"
__email__ = "adrien.guille@univ-lyon2.fr"
event_browser = Flask(__name__, static_folder='browser... | mit |
xuguozhi/DIGITS | digits/dataset/tasks/create_db.py | 4 | 9161 | # Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.
import sys
import os.path
import re
import operator
import digits
from digits import utils
from digits.utils import subclass, override
from digits.task import Task
# NOTE: Increment this everytime the pickled version changes
PICKLE_VERSION = 3
@su... | bsd-3-clause |
baconz/shaka-player | third_party/gjslint/closure_linter-2.3.13/closure_linter/requireprovidesorter.py | 24 | 11330 | #!/usr/bin/env python
#
# Copyright 2011 The Closure Linter 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
#... | apache-2.0 |
shadowsocks1/shadowsocks | shadowsocks/eventloop.py | 949 | 7288 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2013-2015 clowwindy
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | apache-2.0 |
leki75/ansible | lib/ansible/modules/network/aci/aci_rest.py | 9 | 13219 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2015 Jason Edelman <jason@networktocode.com>, Network to Code, LLC
# Copyright 2017 Dag Wieers <dag@wieers.com>
# This file is part of Ansible by Red Hat
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Pu... | gpl-3.0 |
uwafsl/MissionPlanner | Lib/site-packages/scipy/stats/tests/test_fit.py | 53 | 2657 | # NOTE: contains only one test, _est_cont_fit, that is renamed so that
# nose doesn't run it
# I put this here for the record and for the case when someone wants to
# verify the quality of fit
# with current parameters: relatively small sample size, default starting values
# Ran 84 tests in 401.797s
# ... | gpl-3.0 |
tynn/numpy | numpy/fft/tests/test_helper.py | 16 | 9774 | """Test functions for fftpack.helper module
Copied from fftpack.helper by Pearu Peterson, October 2005
"""
from __future__ import division, absolute_import, print_function
import numpy as np
from numpy.testing import assert_array_almost_equal, assert_equal
from numpy import fft, pi
from numpy.fft.helper import _FFTCa... | bsd-3-clause |
mganeva/mantid | qt/python/mantidqt/widgets/codeeditor/test/test_multifileinterpreter.py | 1 | 2516 | # Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2017 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source
# & Institut Laue - Langevin
# SPDX - License - Identifier: GPL - 3.0 +
# This file is part of the mantid workbenc... | gpl-3.0 |
matus-stehlik/glowing-batman | base/templatetags/roots_tags.py | 1 | 1874 | from django import template
from django.core.urlresolvers import reverse
from django.conf import settings
from django.template.base import TemplateSyntaxError
register = template.Library()
@register.simple_tag
def url_active(request, urls, *args, **kwargs):
if request.path in (reverse(url, args=list(*args), kwar... | mit |
eshijia/magnum | magnum/tests/unit/common/test_magnum_keystoneclient.py | 15 | 10425 | # Copyright 2014 - Rackspace Hosting.
#
# 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... | apache-2.0 |
ampax/edx-platform-backup | lms/djangoapps/verify_student/tests/test_ssencrypt.py | 13 | 3639 | import base64
from nose.tools import assert_equals
from verify_student.ssencrypt import (
aes_decrypt, aes_encrypt, encrypt_and_encode, decode_and_decrypt,
rsa_decrypt, rsa_encrypt, random_aes_key
)
def test_aes():
key_str = "32fe72aaf2abb44de9e161131b5435c8d37cbdb6f5df242ae860b283115f2dae"
key = key... | agpl-3.0 |
leiferikb/bitpop | src/third_party/scons-2.0.1/engine/SCons/Tool/applelink.py | 61 | 2851 | """SCons.Tool.applelink
Tool-specific initialization for the Apple gnu-like linker.
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 (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 201... | gpl-3.0 |
Maximilian-Reuter/SickRage-1 | lib/unidecode/x0ad.py | 253 | 4766 | data = (
'gwan', # 0x00
'gwanj', # 0x01
'gwanh', # 0x02
'gwad', # 0x03
'gwal', # 0x04
'gwalg', # 0x05
'gwalm', # 0x06
'gwalb', # 0x07
'gwals', # 0x08
'gwalt', # 0x09
'gwalp', # 0x0a
'gwalh', # 0x0b
'gwam', # 0x0c
'gwab', # 0x0d
'gwabs', # 0x0e
'gwas', # 0x0f
'gwass', #... | gpl-3.0 |
harmsm/pytc | pytc/indiv_models/binding_polynomial.py | 2 | 3400 | __description__ = \
"""
models.py
Models subclassed from ITCModel used to model (and fit) ITC data.
"""
__author__ = "Michael J. Harms"
__date__ = "2016-06-22"
import inspect
import numpy as np
import scipy.optimize
from .base import ITCModel
from . import bp_ext
class BindingPolynomial(ITCModel):
"""
Base ... | unlicense |
tillahoffmann/tensorflow | tensorflow/python/keras/preprocessing/image/__init__.py | 71 | 2059 | # 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 |
omarkhan/ansible-modules-core | cloud/azure/azure.py | 92 | 24105 | #!/usr/bin/python
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed... | gpl-3.0 |
cchurch/ansible | test/units/modules/storage/netapp/test_netapp_e_ldap.py | 56 | 17659 | # (c) 2018, NetApp Inc.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
import os
import shutil
import tempfile
from ansible.modules.storage.netapp.netapp_e_ldap import Ldap
from units.modules.utils import ModuleTestCase, set_module_args, AnsibleFailJson, AnsibleExitJson
... | gpl-3.0 |
uwafsl/ardupilot | Tools/autotest/pysim/util.py | 13 | 14034 | import math
from math import sqrt, acos, cos, pi, sin, atan2
import os, sys, time, random
from rotmat import Vector3, Matrix3
from subprocess import call, check_call,Popen, PIPE
def m2ft(x):
'''meters to feet'''
return float(x) / 0.3048
def ft2m(x):
'''feet to meters'''
return float(x) * 0.3048
def k... | gpl-3.0 |
WhileLoop/ansible-modules-extras | cloud/amazon/ecs_cluster.py | 15 | 8027 | #!/usr/bin/python
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed... | gpl-3.0 |
nfcharles/python-aws-sign | aws_sign/v4/__init__.py | 1 | 1295 | from .. import ServiceConstants
class Sigv4ServiceConstants(ServiceConstants):
"""Logical grouping of Signature Version 4 service constants
This class sets the appropriate Signature v4 specific parameters required
for signing.
"""
# Minimum required headers for signature v4 signed requests
__R... | mit |
Lykayos/Fallout-13-EN | bot/C_sarcasticball.py | 67 | 1479 | from random import choice as fsample
sarcastic_responses = ["Yeah right","What do I look like to you?","Are you kidding me?",#UsF
"As much as you","You don't believe that yourself","When pigs fly",#UsF
"Like your grandma","You would like to know, wouldn't you?", #UsF
... | agpl-3.0 |
fernandog/osmc | package/mediacenter-skin-osmc/files/usr/share/kodi/addons/script.module.unidecode/lib/unidecode/x09c.py | 253 | 4659 | data = (
'Huan ', # 0x00
'Quan ', # 0x01
'Ze ', # 0x02
'Wei ', # 0x03
'Wei ', # 0x04
'Yu ', # 0x05
'Qun ', # 0x06
'Rou ', # 0x07
'Die ', # 0x08
'Huang ', # 0x09
'Lian ', # 0x0a
'Yan ', # 0x0b
'Qiu ', # 0x0c
'Qiu ', # 0x0d
'Jian ', # 0x0e
'Bi ', # 0x0f
'E ', # 0x10
'Yan... | gpl-2.0 |
servo/servo | tests/wpt/web-platform-tests/tools/third_party/h2/examples/fragments/server_https_setup_fragment.py | 14 | 3875 | # -*- coding: utf-8 -*-
"""
Server HTTPS Setup
~~~~~~~~~~~~~~~~~~
This example code fragment demonstrates how to set up a HTTP/2 server that
negotiates HTTP/2 using NPN and ALPN. For the sake of maximum explanatory value
this code uses the synchronous, low-level sockets API: however, if you're not
using sockets direct... | mpl-2.0 |
CognizantOneDevOps/Insights | PlatformAgents/com/cognizant/devops/platformagents/agents/alm/pivotaltracker/PivotalTrackerAgent3.py | 1 | 16890 |
#-------------------------------------------------------------------------------
# Copyright 2017 Cognizant Technology Solutions
#
# 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:/... | apache-2.0 |
azureplus/hue | desktop/core/ext-py/pysaml2-2.4.0/src/saml2/mcache.py | 34 | 7053 | #!/usr/bin/env python
import logging
import memcache
from saml2 import time_util
from saml2.cache import ToOld, CacheError
# The assumption is that any subject may consist of data
# gathered from several different sources, all with their own
# timeout time.
logger = logging.getLogger(__name__)
def _key(prefix, name... | apache-2.0 |
lakshayg/tensorflow | tensorflow/python/keras/_impl/keras/utils/generic_utils.py | 8 | 13405 | # 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 |
lzhjie/benchmark | client_redis.py | 1 | 1166 | # coding: utf-8
# Copyright (C) zhongjie luo <l.zhjie@qq.com>
import redis
from db_bench import DbConnection, multi_process_bench, Options
class StrictRedis(DbConnection):
def __init__(self, options):
super(StrictRedis, self).__init__(options)
self.__db = 0
self.__client = None... | mit |
bparzella/secsgem | secsgem/secs/data_items/objid.py | 1 | 1674 | #####################################################################
# objid.py
#
# (c) Copyright 2021, Benjamin Parzella. All rights reserved.
#
# This library 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 Foun... | lgpl-2.1 |
dvliman/jaikuengine | .google_appengine/lib/django-1.4/django/contrib/auth/tests/__init__.py | 79 | 1419 | from django.contrib.auth.tests.auth_backends import (BackendTest,
RowlevelBackendTest, AnonymousUserBackendTest, NoBackendsTest,
InActiveUserBackendTest, NoInActiveUserBackendTest)
from django.contrib.auth.tests.basic import BasicTestCase
from django.contrib.auth.tests.context_processors import AuthContextProce... | apache-2.0 |
jaeilepp/mne-python | mne/simulation/tests/test_raw.py | 1 | 13124 | # Authors: Mark Wronkiewicz <wronk@uw.edu>
# Yousra Bekhti <yousra.bekhti@gmail.com>
# Eric Larson <larson.eric.d@gmail.com>
#
# License: BSD (3-clause)
import os.path as op
import warnings
from copy import deepcopy
import numpy as np
from numpy.testing import assert_allclose, assert_array_equal
fro... | bsd-3-clause |
aam-at/tensorflow | tensorflow/python/data/benchmarks/batch_benchmark.py | 16 | 2887 | # 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 |
ppiotr/Invenio | modules/webbasket/lib/webbasket_config.py | 4 | 3206 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 CERN.
##
## Invenio 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
## ... | gpl-2.0 |
ace8957/SeniorDesignKernel | Documentation/target/tcm_mod_builder.py | 2358 | 40707 | #!/usr/bin/python
# The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD
#
# Copyright (c) 2010 Rising Tide Systems
# Copyright (c) 2010 Linux-iSCSI.org
#
# Author: nab@kernel.org
#
import os, sys
import subprocess as sub
import string
import re
import optparse
tcm_dir = ""
fabric_ops... | gpl-2.0 |
Johnzero/erp | openerp/addons/document/__init__.py | 9 | 1227 | # -*- 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 |
CMUSV-VisTrails/WorkflowRecommendation | vistrails/core/cache/utils.py | 1 | 2304 | ###############################################################################
##
## Copyright (C) 2006-2011, University of Utah.
## All rights reserved.
## Contact: contact@vistrails.org
##
## This file is part of VisTrails.
##
## "Redistribution and use in source and binary forms, with or without
## modification, ... | bsd-3-clause |
a67878813/script | flvrepair.py | 1 | 3480 | # coding: utf-8
#2019.11.24 refixed in ubuntu19.10
#使用前需安装yamdi
#sudo apt install yamdi
#ubuntu 16.04LTS
#与win机器mount命令示例:
#sudo mount -t cifs -o username="用户名",password="密码",uid=1000 //192.168.2.90/raid5_5-9/直播录像 /mnt2
#若目录不存在,terminal中
#sudo mkdir mnt2
#sudo chown -R linux用户名:linux用户名 mnt2
#使用方法 :
#1.修改脚本预计遍历flv的目... | apache-2.0 |
x684867/nemesis | src/node/deps/v8/tools/run-tests.py | 2 | 14665 | #!/usr/bin/env python
#
# Copyright 2012 the V8 project authors. 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
# noti... | mit |
osh/gnuradio | gr-pager/python/pager/pager_utils.py | 68 | 1746 | #
# Copyright 2008,2009 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your option)
# any later version... | gpl-3.0 |
jackkiej/SickRage | sickbeard/providers/tokyotoshokan.py | 7 | 5084 | # coding=utf-8
# Author: Mr_Orange
#
# URL: https://sickrage.github.io
#
# This file is part of SickRage.
#
# SickRage 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 ... | gpl-3.0 |
YeelerG/twilio-python | docs/conf.py | 6 | 8670 | # -*- coding: utf-8 -*-
#
# twilio-python2 documentation build configuration file, created by
# sphinx-quickstart on Mon Dec 13 16:47:32 2010.
#
# 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.
... | mit |
jzawar/highstreet | app.py | 1 | 5268 | #!/usr/bin/env python
from __future__ import print_function
from future.standard_library import install_aliases
install_aliases()
from urllib.parse import urlparse, urlencode
from urllib.request import urlopen, Request
from urllib.error import HTTPError
import json
import os
import re
from flask import Flask
from f... | apache-2.0 |
2014c2g4/2015cda_g7 | static/Brython3.1.1-20150328-091302/Lib/encodings/__init__.py | 764 | 5067 | """ Standard "encodings" Package
Standard Python encoding modules are stored in this package
directory.
Codec modules must have names corresponding to normalized encoding
names as defined in the normalize_encoding() function below, e.g.
'utf-8' must be implemented by the module 'utf_8.py'.
Ea... | gpl-3.0 |
Teagan42/home-assistant | homeassistant/components/zha/core/channels/__init__.py | 2 | 12705 | """
Channels module for Zigbee Home Automation.
For more details about this component, please refer to the documentation at
https://home-assistant.io/integrations/zha/
"""
import asyncio
from concurrent.futures import TimeoutError as Timeout
from enum import Enum
from functools import wraps
import logging
from random ... | apache-2.0 |
rcosnita/fantastico | fantastico/routing_engine/__init__.py | 1 | 1176 | '''
Copyright 2013 Cosnita Radu Viorel
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, distribu... | mit |
adamtiger/tensorflow | tensorflow/contrib/seq2seq/python/ops/beam_search_decoder.py | 23 | 28748 | # 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 |
pudo/aleph | aleph/tests/test_groups_api.py | 1 | 1170 | from aleph.core import db
from aleph.model import Role
from aleph.views.util import validate
from aleph.tests.util import TestCase
class GroupsApiTestCase(TestCase):
def setUp(self):
super(GroupsApiTestCase, self).setUp()
self.role = self.create_user(foreign_id='user_1')
group = Role.load... | mit |
max0d41/kazoo | kazoo/recipe/election.py | 47 | 2222 | """ZooKeeper Leader Elections
:Maintainer: None
:Status: Unknown
"""
from kazoo.exceptions import CancelledError
class Election(object):
"""Kazoo Basic Leader Election
Example usage with a :class:`~kazoo.client.KazooClient` instance::
zk = KazooClient()
election = zk.Election("/electionpat... | apache-2.0 |
suyashphadtare/vestasi-erp-final | erpnext/setup/utils.py | 35 | 2162 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _, throw
from frappe.utils import flt
def get_company_currency(company):
currency = frappe.db.get_value("Company",... | agpl-3.0 |
MattRijk/django-ecomsite | lib/python2.7/site-packages/django/db/backends/sqlite3/base.py | 30 | 22608 | """
SQLite3 backend for django.
Works with either the pysqlite2 module or the sqlite3 module in the
standard library.
"""
from __future__ import unicode_literals
import datetime
import decimal
import warnings
import re
from django.db import utils
from django.db.backends import *
from django.db.backends.sqlite3.clien... | cc0-1.0 |
kmacinnis/sympy | sympy/functions/special/tests/test_spec_polynomials.py | 7 | 9208 | from sympy import (
Symbol, Dummy, diff, Derivative, Rational, roots, sympify, S, sqrt, hyper,
cos, gamma, conjugate, factorial, pi, oo, zoo, binomial, Sum, RisingFactorial,
legendre, assoc_legendre, chebyshevu, chebyshevt, chebyshevt_root, chebyshevu_root,
laguerre, assoc_laguerre, laguerre_poly, hermi... | bsd-3-clause |
cclauss/compose | tests/integration/service_test.py | 10 | 30972 | from __future__ import unicode_literals
from __future__ import absolute_import
import os
from os import path
from docker.errors import APIError
import mock
import tempfile
import shutil
import six
from compose import __version__
from compose.const import (
LABEL_CONTAINER_NUMBER,
LABEL_ONE_OFF,
LABEL_PROJ... | apache-2.0 |
spoqa/nirum-python | tests/datastructures_test.py | 1 | 4258 | import collections
import pickle
from pytest import raises
from nirum.datastructures import List, Map
def test_map_init():
assert list(Map()) == []
assert (sorted(Map([('a', 1), ('b', 2)]).items()) ==
sorted(Map({'a': 1, 'b': 2}).items()) ==
sorted(Map(Map({'a': 1, 'b': 2})).items())... | mit |
rdkit/rdkit-orig | rdkit/DataStructs/UnitTestBitEnsemble.py | 5 | 3478 | # $Id$
#
# Copyright (C) 2003-2006 greg Landrum and Rational Discovery LLC
#
# @@ All Rights Reserved @@
# This file is part of the RDKit.
# The contents are covered by the terms of the BSD license
# which is included in the file license.txt, found at the root
# of the RDKit source tree.
#
""" unit testing code f... | bsd-3-clause |
pombreda/libkml | third_party/googletest-r108/test/gtest_uninitialized_test.py | 15 | 3254 | #!/usr/bin/env python
#
# Copyright 2008, 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 |
jitendra29/servo | tests/wpt/web-platform-tests/webdriver/cookie/cookie_test.py | 142 | 1853 | import os
import sys
import unittest
sys.path.insert(1, os.path.abspath(os.path.join(__file__, "../..")))
import base_test
from selenium.common import exceptions
class CookieTest(base_test.WebDriverBaseTest):
def setUp(self):
self.driver.get(self.webserver.where_is("cookie/res/cookie_container.html"))
... | mpl-2.0 |
jamison904/T989_TW_JB | tools/perf/python/twatch.py | 3213 | 1338 | #! /usr/bin/python
# -*- python -*-
# -*- coding: utf-8 -*-
# twatch - Experimental use of the perf python interface
# Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com>
#
# This application is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License... | gpl-2.0 |
macks22/scikit-learn | examples/manifold/plot_mds.py | 261 | 2616 | """
=========================
Multi-dimensional scaling
=========================
An illustration of the metric and non-metric MDS on generated noisy data.
The reconstructed points using the metric MDS and non metric MDS are slightly
shifted to avoid overlapping.
"""
# Author: Nelle Varoquaux <nelle.varoquaux@gmail.... | bsd-3-clause |
priya-pp/Tacker | tacker/common/clients.py | 2 | 1866 | # 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
# distributed under t... | apache-2.0 |
scottydelta/vy | vyapp/plugins/pdb/debug.py | 6 | 5824 | """
"""
from untwisted.network import core, cmap, READ, Device
from untwisted.tkinter import extern
from subprocess import Popen, PIPE, STDOUT
from untwisted.utils.iofd import *
from untwisted.utils.shrug import *
from vyapp.plugins.pdb import event
from vyapp.tools import set_status_msg
from vyapp.tools import get_op... | mit |
ycaihua/kbengine | kbe/res/scripts/common/Lib/lib2to3/fixes/fix_throw.py | 203 | 1582 | """Fixer for generator.throw(E, V, T).
g.throw(E) -> g.throw(E)
g.throw(E, V) -> g.throw(E(V))
g.throw(E, V, T) -> g.throw(E(V).with_traceback(T))
g.throw("foo"[, V[, T]]) will warn about string exceptions."""
# Author: Collin Winter
# Local imports
from .. import pytree
from ..pgen2 import token
from .. im... | lgpl-3.0 |
thnee/ansible | lib/ansible/modules/cloud/google/gcp_iam_service_account.py | 16 | 8781 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Google
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
... | gpl-3.0 |
gustavo-guimaraes/siga | backend/venv/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... | mit |
nasoundead/emacs.d | elpa/elpy-20161230.303/elpy/tests/test_impmagic.py | 12 | 2473 | # coding: utf-8
"""Tests for the elpy.impmagic module"""
import re
import sys
import unittest
from elpy import impmagic
from elpy.tests.support import BackendTestCase
TEST_SOURCE = '''# test file
import time
import logging
os.getcwd()
time.sleep(1)
'''
@unittest.skipIf(sys.version_info >= (3, 5), "importmagic f... | bsd-2-clause |
opensourceBrown/DR | DR/plugin/tools/toolsForGame/main.py | 265 | 3576 | import sys, string, os
from Tkinter import *
import steps
Plugins = sys.argv[1]
print Plugins
pluginList = Plugins.split(':')
maxStep = 2
curStep = 1
stepList = []
# functions
# show step on the num index
def showStep(num):
global stepList
stepNum = len(stepList)
if num >= stepNum or num <= 0 :
... | mit |
white-wolf-17/InstantCMS_hero-template | templates/hero/node_modules/gulp-sass/node_modules/node-sass/node_modules/pangyp/gyp/pylib/gyp/input_test.py | 1841 | 3207 | #!/usr/bin/env python
# Copyright 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.
"""Unit tests for the input.py file."""
import gyp.input
import unittest
import sys
class TestFindCycles(unittest.TestCase):
def setUp(self... | gpl-2.0 |
Salandora/OctoPrint | src/octoprint/server/util/__init__.py | 1 | 6142 | # coding=utf-8
from __future__ import absolute_import, division, print_function
__author__ = "Gina Häußge <osd@foosel.net>"
__license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html'
__copyright__ = "Copyright (C) 2014 The OctoPrint Project - Released under terms of the AGPLv3 License"
fr... | agpl-3.0 |
ray-project/ray | release/tune_tests/scalability_tests/wait_cluster.py | 7 | 1237 | import argparse
import time
import ray
ray.init(address="auto")
parser = argparse.ArgumentParser()
parser.add_argument(
"num_nodes",
type=int,
help="Wait for this number of nodes (includes head)")
parser.add_argument(
"max_time_s", type=int, help="Wait for this number of seconds")
parser.add_argume... | apache-2.0 |
iwaseyusuke/ryu | ryu/services/protocols/zebra/db/route.py | 4 | 6524 | # Copyright (C) 2017 Nippon Telegraph and Telephone Corporation.
#
# 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 appli... | apache-2.0 |
Vaidyanath/tempest | tempest/api_schema/response/compute/v2/limits.py | 12 | 4541 | # Copyright 2014 NEC Corporation. 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 |
gkarlin/django-jenkins | build/Django/django/contrib/staticfiles/finders.py | 102 | 9658 | import os
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.core.files.storage import default_storage, Storage, FileSystemStorage
from django.utils.datastructures import SortedDict
from django.utils.functional import empty, memoize, LazyObject
from django.utils.importl... | lgpl-3.0 |
YongseopKim/crosswalk-test-suite | webapi/tct-cors-w3c-tests/inst.wgt.py | 3 | 7005 | #!/usr/bin/env python
import os
import shutil
import glob
import time
import sys
import subprocess
import string
from optparse import OptionParser, make_option
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PKG_NAME = os.path.basename(SCRIPT_DIR)
PARAMETERS = None
#XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=... | bsd-3-clause |
UKTradeInvestment/export-wins-data | mi/tests/test_hvc_views.py | 1 | 42324 | import datetime
from django.test import TestCase
from django.utils.timezone import get_current_timezone
from factory.fuzzy import FuzzyChoice
from freezegun import freeze_time
from django.urls import reverse
from django.core.management import call_command
from fixturedb.factories.win import create_win_factory
from... | gpl-3.0 |
whereismyjetpack/ansible | lib/ansible/modules/windows/win_robocopy.py | 15 | 4928 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Corwin Brown <blakfeld@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 Lic... | gpl-3.0 |
eharney/cinder | cinder/tests/functional/test_volumes.py | 1 | 5004 | # Copyright 2011 Justin Santa Barbara
# 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 |
subramani95/neutron | neutron/tests/unit/test_config.py | 19 | 2401 | # Copyright (c) 2012 OpenStack Foundation.
#
# 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... | apache-2.0 |
genzgd/Lampost-Mud | lampmud/mud/chat.py | 1 | 1548 | from lampost.gameops.action import ActionError
from lampost.di.resource import Injected, module_inject
from lampmud.mud.action import mud_action
sm = Injected('session_manager')
module_inject(__name__)
@mud_action('emote', target_class='cmd_str')
def emote(source, target):
source.broadcast(raw="{}{} {}".format('... | mit |
apanda/phantomjs-intercept | src/qt/qtwebkit/Tools/Scripts/webkitpy/layout_tests/models/test_results.py | 126 | 3187 | # Copyright (C) 2010 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... | bsd-3-clause |
SakuradaJun/django-allauth | allauth/socialaccount/providers/xing/views.py | 65 | 1258 | import json
from allauth.socialaccount.providers.oauth.client import OAuth
from allauth.socialaccount.providers.oauth.views import (OAuthAdapter,
OAuthLoginView,
OAuthCallbackView)
from .provider import X... | mit |
Lujeni/ansible | lib/ansible/modules/cloud/amazon/cloudfront_invalidation.py | 1 | 10548 | #!/usr/bin/python
# Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['pre... | gpl-3.0 |
Skytim/nccuTEG | pybossa/auth/token.py | 6 | 1167 | # -*- coding: utf8 -*-
# This file is part of PyBossa.
#
# Copyright (C) 2013 SF Isle of Man Limited
#
# PyBossa is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at... | agpl-3.0 |
mKeRix/home-assistant | tests/components/nws/conftest.py | 13 | 1289 | """Fixtures for National Weather Service tests."""
import pytest
from tests.async_mock import AsyncMock, patch
from tests.components.nws.const import DEFAULT_FORECAST, DEFAULT_OBSERVATION
@pytest.fixture()
def mock_simple_nws():
"""Mock pynws SimpleNWS with default values."""
with patch("homeassistant.compon... | mit |
refgenomics/onecodex | tests/test_cli.py | 2 | 12041 | from click.testing import CliRunner
import mock
import os
import pytest
from testfixtures import Replace
from onecodex import Cli
from tests.conftest import API_DATA
DATE_FORMAT = "%Y-%m-%d %H:%M"
@pytest.fixture
def mock_file_upload():
with mock.patch("onecodex.lib.upload._upload_sequence_fileobj") as m:
... | mit |
victorzhao/miniblink49 | v8_5_1/tools/release/search_related_commits.py | 22 | 6486 | #!/usr/bin/env python
# Copyright 2015 the V8 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.
import argparse
import operator
import os
import re
from sets import Set
from subprocess import Popen, PIPE
import sys
def search_al... | gpl-3.0 |
detule/linux-msm-d2 | tools/perf/scripts/python/check-perf-trace.py | 11214 | 2503 | # perf script event handlers, generated by perf script -g python
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# This script tests basic functionality such as flag and symbol
# strings, common_xxx() calls back into perf, begin, end, unhandled
# events, etc. ... | gpl-2.0 |
DirkHoffmann/nuxeo-drive | nx_cx_Freeze/__init__.py | 3 | 7683 | """cx_Freeze extension
Extends:
- the 'build' command with the 'exe-command' option to allow using a
different command from 'build_exe' to build executables from Python scripts.
- the 'install' command with the 'skip-sub-commands' option to allow not
running a set of sub commands, e.g.:
install --skip-sub-comma... | lgpl-2.1 |
thestealth131205/HTC_Desire_510_64bit | tools/perf/scripts/python/net_dropmonitor.py | 2669 | 1738 | # 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 |
trustedanalytics/data-catalog | tests/test_query_translation.py | 1 | 16431 | #
# Copyright (c) 2015 Intel Corporation
#
# 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 i... | apache-2.0 |
vseledkin/neon | tests/test_schedule.py | 10 | 2629 | # ----------------------------------------------------------------------------
# Copyright 2015 Nervana Systems 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.o... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.