repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
helldorado/ansible | refs/heads/devel | test/runner/lib/sanity/pep8.py | 49 | """Sanity test for PEP 8 style guidelines using pycodestyle."""
from __future__ import absolute_import, print_function
import os
import re
from lib.sanity import (
SanitySingleVersion,
SanityMessage,
SanityFailure,
SanitySuccess,
)
from lib.util import (
SubprocessError,
display,
run_comm... |
TheTypoMaster/chromium-crosswalk | refs/heads/master | chrome/common/extensions/docs/server2/new_github_file_system_test.py | 97 | #!/usr/bin/env python
# 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.
import json
from copy import deepcopy
from cStringIO import StringIO
from functools import partial
from hashlib import sha1
from random... |
musicrighter/CIS422-P2 | refs/heads/master | env/lib/python3.4/site-packages/pip/_vendor/html5lib/inputstream.py | 435 | from __future__ import absolute_import, division, unicode_literals
from pip._vendor.six import text_type
from pip._vendor.six.moves import http_client
import codecs
import re
from .constants import EOF, spaceCharacters, asciiLetters, asciiUppercase
from .constants import encodings, ReparseException
from . import util... |
robcarver17/systematictradingexamples | refs/heads/master | plots_for_perhaps/yieldsprediction.py | 1 | from scipy import stats
import pandas as pd
import numpy as np
from datetime import datetime as dt
def read_ts_csv(fname, dindex="Date"):
data=pd.read_csv(fname)
dateindex=[dt.strptime(dx, "%d/%m/%y") for dx in list(data[dindex])]
data.index=dateindex
del(data[dindex])
return data
def get_di... |
shootstar/novatest | refs/heads/master | nova/db/sqlalchemy/migrate_repo/versions/135_add_node_to_instances.py | 21 | # Copyright 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 ... |
nvoron23/brython | refs/heads/master | site/tests/unittests/test/warning_tests.py | 398 | # Helper module for testing the skipmodules argument of warnings.warn()
import warnings
def outer(message, stacklevel=1):
inner(message, stacklevel)
def inner(message, stacklevel=1):
warnings.warn(message, stacklevel=stacklevel)
|
mihailignatenko/erp | refs/heads/master | addons/survey/wizard/survey_email_compose_message.py | 214 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010-Today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... |
mrfuxi/django | refs/heads/master | django/core/cache/backends/dummy.py | 629 | "Dummy cache backend"
from django.core.cache.backends.base import DEFAULT_TIMEOUT, BaseCache
class DummyCache(BaseCache):
def __init__(self, host, *args, **kwargs):
BaseCache.__init__(self, *args, **kwargs)
def add(self, key, value, timeout=DEFAULT_TIMEOUT, version=None):
key = self.make_key... |
hamedramzi/libtorrent | refs/heads/master | bindings/python/simple_client.py | 13 | #!/usr/bin/env python
# Copyright Arvid Norberg 2008. Use, modification and distribution is
# subject to the Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
from __future__ import print_function
import libtorrent as lt
import time
import sy... |
retomerz/intellij-community | refs/heads/master | python/testData/refactoring/extractmethod/DuplicateCheckParam.after.py | 79 | def f():
a = do_smth()
b1 = foo(a)
a = do_smth()
b = foo(a + 1)
do_smth_with(b1, b)
def foo(a_new):
b1 = do_smth_with(a_new)
return b1
|
ywatanabex/gensim | refs/heads/develop | gensim/test/test_corpora_dictionary.py | 46 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
Unit tests for the `corpora.Dictionary` class.
"""
from collections import Mapping
import logging
import tempfile
import unittest
import os
import os.path
import scipy
import gensim
from ge... |
djabber/Dashboard | refs/heads/master | bottle/dash/lib/python2.7/site-packages/setuptools/command/bdist_rpm.py | 470 | # This is just a kludge so that bdist_rpm doesn't guess wrong about the
# distribution name and version, if the egg_info command is going to alter
# them, another kludge to allow you to build old-style non-egg RPMs, and
# finally, a kludge to track .rpm files for uploading when run on Python <2.5.
from distutils.comma... |
SNU-sunday/fisspy | refs/heads/master | fisspy/image/interactive_image.py | 1 | from __future__ import absolute_import, division
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import gridspec
from fisspy.read.readbase import getRaster as _getRaster
from fisspy.image.base import alignoffset, shift3d
__author__ = "Juhyung Kang"
__email__ = "jhkang@astro.snu.ac.kr"
class single... |
StefanoRaggi/Lean | refs/heads/master | Algorithm.Python/FutureOptionShortPutITMExpiryRegressionAlgorithm.py | 3 | # QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect 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 Licen... |
twitchyliquid64/R2K9 | refs/heads/master | TemplateAPI/Parser.py | 3 | ### IMPORTS ###
import re
import Node
### PARSER ###
TEMPLATE_DIR = 'templates/'
class Template(object):
'''Builds a node tree'''
SPLIT_RE = re.compile(r'((?:\{!.+?!\})|(?:\{%.+?%\}))') #Non capturing groups prevent silly re.split output
MATCH_RE = {
'SAFEEVAL': re.compile(r'\{%\s*safe\s+(.+)%\}'),
'EVAL': ... |
plang85/rough_surfaces | refs/heads/master | tests/test_generate.py | 1 | import pytest
import numpy as np
import rough_surfaces.analyse as ra
import rough_surfaces.params as rp
import rough_surfaces.generate as rg
import rough_surfaces.surface as rs
@pytest.fixture
def rough_surface():
# TODO more hurst parameters
# TODO discretization parameter abstraction
N_power_of_two = 9
... |
usersource/tasks | refs/heads/master | tasks_phonegap/Tasks/plugins/io.usersource.anno/tools/copytool3/apiclient/mimeparse.py | 189 | # Copyright (C) 2007 Joe Gregorio
#
# Licensed under the MIT License
"""MIME-Type Parser
This module provides basic functions for handling mime-types. It can handle
matching mime-types against a list of media-ranges. See section 14.1 of the
HTTP specification [RFC 2616] for a complete explanation.
http://www.w3.o... |
NazimAli2017/Django-Rest-API-Videos | refs/heads/master | video_api/video_app/migrations/0001_initial.py | 1 | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-05-19 00:39
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
]
|
amitgandhinz/cdn | refs/heads/master | poppy/provider/fastly/controllers.py | 2 | # Copyright (c) 2013 Red Hat, 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 writ... |
junalmeida/Sick-Beard | refs/heads/master | autoProcessTV/sabToSickBeard.py | 21 | #!/usr/bin/env python
# Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of Sick Beard.
#
# Sick Beard is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, eithe... |
ysu-hust/cosmodel | refs/heads/master | utils/distribution_functions.py | 1 | # -*- coding: utf-8 -*-
def lognormal_cdf(x, logmean, logsd):
from scipy.special import erf
import math
mu = logmean
sigma = logsd
return 1/2 + (erf((math.log(x) - mu)/(2**0.5 * sigma)))/2
def normal_cdf(x, mean, stdev):
from scipy.special import erf
mu = mean
sigma = stdev
p = 0.5... |
CatherineWong/zxing-glass | refs/heads/master | cpp/scons/scons-local-2.0.0.final.0/SCons/Tool/aixlink.py | 34 | """SCons.Tool.aixlink
Tool-specific initialization for the IBM Visual Age 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, 2010 T... |
purpleidea/macaronic-net | refs/heads/master | django/utils/_threading_local.py | 343 | """Thread-local objects
(Note that this module provides a Python version of thread
threading.local class. Depending on the version of Python you're
using, there may be a faster one available. You should always import
the local class from threading.)
Thread-local objects support the management of thread-local dat... |
horance-liu/tensorflow | refs/heads/master | tensorflow/contrib/learn/python/learn/estimators/linear_test.py | 58 | # 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... |
junhuac/MQUIC | refs/heads/master | depot_tools/third_party/pylint/reporters/html.py | 59 | # Copyright (c) 2003-2013 LOGILAB S.A. (Paris, FRANCE).
# 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... |
TkkrLab/py-ledart | refs/heads/master | Ledart/Tools/Graphics/HSVColorTools.py | 3 | class ColorHSV(object):
def __init__(self, hue, saturation, value):
self.hue = hue
self.saturation = saturation
self.value = value
class ColorHSVOps(object):
def __init__(self):
pass
ColorHSVOps = ColorHSVOps |
slisson/intellij-community | refs/heads/master | python/lib/Lib/site-packages/django/contrib/flatpages/tests/forms.py | 94 | from django.contrib.flatpages.admin import FlatpageForm
from django.test import TestCase
class FlatpageAdminFormTests(TestCase):
def setUp(self):
self.form_data = {
'title': "A test page",
'content': "This is a test",
'sites': [1],
}
def test_flatpage_admin_... |
tplavcic/percona-xtradb-cluster | refs/heads/5.6 | doc/source/conf.py | 1 | # -*- coding: utf-8 -*-
#
# Percona XtraBackup documentation build configuration file, created by
# sphinx-quickstart on Mon Jun 27 22:27:15 2011.
#
# 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 fi... |
kenwang815/KodiPlugins | refs/heads/master | script.module.oceanktv/lib/youtube_dl/extractor/pornhub.py | 6 | from __future__ import unicode_literals
import itertools
import os
import re
from .common import InfoExtractor
from ..compat import (
compat_HTTPError,
compat_urllib_parse_unquote,
compat_urllib_parse_unquote_plus,
compat_urllib_parse_urlparse,
)
from ..utils import (
ExtractorError,
int_or_no... |
bwencke/eastmonroe | refs/heads/master | lib/jinja2/environment.py | 614 | # -*- coding: utf-8 -*-
"""
jinja2.environment
~~~~~~~~~~~~~~~~~~
Provides a class that holds runtime and parsing time options.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import os
import sys
from jinja2 import nodes
from jinja2.defaults import BLOCK_S... |
nesdis/djongo | refs/heads/master | tests/django_tests/tests/v22/tests/template_tests/syntax_tests/test_named_endblock.py | 521 | from django.template import TemplateSyntaxError
from django.test import SimpleTestCase
from ..utils import setup
class NamedEndblockTests(SimpleTestCase):
@setup({'namedendblocks01': '1{% block first %}_{% block second %}'
'2{% endblock second %}_{% endblock first %}3'})
def ... |
DBMandrake/osmc | refs/heads/master | package/mediacenter-skin-osmc/files/usr/share/kodi/addons/script.module.unidecode/lib/unidecode/x059.py | 252 | data = (
'Shou ', # 0x00
'Yi ', # 0x01
'Zhi ', # 0x02
'Gu ', # 0x03
'Chu ', # 0x04
'Jiang ', # 0x05
'Feng ', # 0x06
'Bei ', # 0x07
'Cay ', # 0x08
'Bian ', # 0x09
'Sui ', # 0x0a
'Qun ', # 0x0b
'Ling ', # 0x0c
'Fu ', # 0x0d
'Zuo ', # 0x0e
'Xia ', # 0x0f
'Xiong ', # 0x10
... |
web30s/odoo-9.0c-20160402 | refs/heads/master | hello/templates/openerp/addons/account/tests/account_test_users.py | 46 | from openerp.addons.account.tests.account_test_classes import AccountingTestCase
class AccountTestUsers(AccountingTestCase):
"""Tests for diffrent type of user 'Accountant/Adviser' and added groups"""
def setUp(self):
super(AccountTestUsers, self).setUp()
self.res_user_model = self.env['res.... |
jubatus/jubakit | refs/heads/master | jubakit/recommender.py | 1 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
import jubatus
import jubatus.embedded
from .base import GenericSchema, BaseDataset, BaseService, GenericConfig
from .compat import *
class Schema(GenericSchema):
"""
Schema for Recommender service.
"""
... |
wiget/beets | refs/heads/master | beets/importer.py | 3 | # This file is part of beets.
# Copyright 2013, Adrian Sampson.
#
# 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, ... |
samuelchong/libcloud | refs/heads/trunk | libcloud/common/abiquo.py | 28 | # 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 ... |
FenceAtMHacks/flaskbackend | refs/heads/master | fence-api/flask/lib/python2.7/site-packages/pip/_vendor/requests/auth.py | 44 | # -*- coding: utf-8 -*-
"""
requests.auth
~~~~~~~~~~~~~
This module contains the authentication handlers for Requests.
"""
import os
import re
import time
import hashlib
from base64 import b64encode
from .compat import urlparse, str
from .cookies import extract_cookies_to_jar
from .utils import parse_dict_header, ... |
chinmaygarde/mojo | refs/heads/ios | third_party/cython/src/Cython/Compiler/ExprNodes.py | 86 | #
# Parse tree nodes for expressions
#
import cython
cython.declare(error=object, warning=object, warn_once=object, InternalError=object,
CompileError=object, UtilityCode=object, TempitaUtilityCode=object,
StringEncoding=object, operator=object,
Naming=object, Nodes=objec... |
ProjectSWGCore/NGECore2 | refs/heads/master | scripts/object/building/poi/lok_imperial_small2.py | 85615 | import sys
def setup(core, object):
return |
KyleJamesWalker/ansible | refs/heads/devel | lib/ansible/modules/network/nsupdate.py | 15 | #!/usr/bin/python
"""
Ansible module to manage DNS records using dnspython
(c) 2016, Marcin Skarbek <github@skarbek.name>
(c) 2016, Andreas Olsson <andreas@arrakis.se>
(c) 2017, Loic Blot <loic.blot@unix-experience.fr>
This module was ported from https://github.com/mskarbek/ansible-nsupdate
This file is part of Ansi... |
tplusx/stdma-ns3 | refs/heads/master | sources/src/lte/doc/source/conf.py | 27 | # -*- coding: utf-8 -*-
#
# ns-3 documentation build configuration file, created by
# sphinx-quickstart on Tue Dec 14 09:00:39 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.
#
# All co... |
catapult-project/catapult | refs/heads/master | third_party/gsutil/gslib/vendored/boto/boto/logs/layer1.py | 146 | # Copyright (c) 2014 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights ... |
samuelhavron/heroku-buildpack-python | refs/heads/master | Python-3.4.3/Doc/includes/email-headers.py | 85 | # Import the email modules we'll need
from email.parser import Parser
# If the e-mail headers are in a file, uncomment this line:
#headers = Parser().parse(open(messagefile, 'r'))
# Or for parsing headers in a string, use:
headers = Parser().parsestr('From: <user@example.com>\n'
'To: <someone_else@example.c... |
cmnelson/pynsx | refs/heads/master | pynsx/go.py | 2 | __author__ = 'cmnelson' |
mmazanec22/too-windy | refs/heads/master | env/lib/python3.5/site-packages/pip/utils/appdirs.py | 340 | """
This code was taken from https://github.com/ActiveState/appdirs and modified
to suit our purposes.
"""
from __future__ import absolute_import
import os
import sys
from pip.compat import WINDOWS, expanduser
from pip._vendor.six import PY2, text_type
def user_cache_dir(appname):
r"""
Return full path to t... |
lache/RacingKingLee | refs/heads/master | monitor/engine.win64/2.74/python/lib/tracemalloc.py | 83 | from collections import Sequence, Iterable
from functools import total_ordering
import fnmatch
import linecache
import os.path
import pickle
# Import types and functions implemented in C
from _tracemalloc import *
from _tracemalloc import _get_object_traceback, _get_traces
def _format_size(size, sign):
for unit ... |
makinacorpus/formhub | refs/heads/master | odk_logger/tests/test_backup_tools.py | 5 | import os
import tempfile
import shutil
from datetime import datetime
from django.conf import settings
from odk_logger.models import Instance
from odk_logger.import_tools import django_file
from main.tests.test_base import MainTestCase
from odk_logger.import_tools import create_instance
from utils.backup_tools import _... |
omakk/servo | refs/heads/master | components/script/dom/bindings/codegen/parser/tests/test_duplicate_qualifiers.py | 241 | def WebIDLTest(parser, harness):
threw = False
try:
parser.parse("""
interface DuplicateQualifiers1 {
getter getter byte foo(unsigned long index);
};
""")
results = parser.finish()
except:
threw = True
harness.ok(threw, "Should have... |
proversity-org/edx-platform | refs/heads/master | openedx/core/djangoapps/theming/tests/test_theme_style_overrides.py | 4 | """
Tests for comprehensive themes.
"""
from django.conf import settings
from django.core.urlresolvers import reverse
from django.test import TestCase
from django.contrib import staticfiles
from openedx.core.djangoapps.theming.tests.test_util import with_comprehensive_theme
from openedx.core.djangolib.testing.utils im... |
Jawoll/automatchthreads | refs/heads/master | match_client.py | 1 | from modules.overgg import Overgg
import socket, pickle ,time
def find_match_by_url(url):
for match in upcoming['matches']:
if url == match['match_link']:
return match['timestamp']
return '0'
port = 10000
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server_addr... |
Yukinoshita47/Yuki-Chan-The-Auto-Pentest | refs/heads/master | Module/dirsearch/lib/utils/TerminalSize.py | 1 | # -*- coding: utf-8 -*-
# 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... |
FlorianLudwig/odoo | refs/heads/8.0 | addons/stock/report/__init__.py | 376 | # -*- 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... |
ryandougherty/mwa-capstone | refs/heads/heroku | MWA_Tools/build/lib/mwapy/obssched/add_rfstream.py | 2 | #!/usr/bin/env python
import psycopg2
import os, sys, optparse, logging
def main():
logging.basicConfig(format='%(levelname)s: %(message)s')
usage="usage: %prog [options]"
parser=optparse.OptionParser(usage=usage)
parser.add_option("-g","--gps",dest="gpstime", default=None,type="int",
... |
huiyi1990/luigi | refs/heads/master | test/contrib/sge_test.py | 40 | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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... |
tech-sketch/zabbix_book_sample | refs/heads/master | 2nd_edition/Chapter7/7-3_host_resource_utilization.py | 1 | #!/bin/env python
from pyVim.connect import SmartConnect, Disconnect
from pyVmomi import vim
import ssl
context = ssl._create_unverified_context()
zabbix_sender = 'zabbix_senderパス'
zabbix_server = 'Zabbixサーバホスト名またはIPアドレス'
esxi_host = sys.argv[1] #HyperVisor hostname
username = sys.argv[2] #HyperVisor login username
... |
40223114/2015_g4 | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/unittest/test/test_assertions.py | 738 | import datetime
import warnings
import unittest
from itertools import product
class Test_Assertions(unittest.TestCase):
def test_AlmostEqual(self):
self.assertAlmostEqual(1.00000001, 1.0)
self.assertNotAlmostEqual(1.0000001, 1.0)
self.assertRaises(self.failureException,
... |
ipmobiletech/react-native | refs/heads/master | ReactAndroid/src/main/java/com/facebook/react/bridge/package_js.py | 409 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import os
import sys
import zipfile
srcs = sys.argv[1:]
with zipfile.ZipFile(sys.stdout, 'w') as jar:
for src in srcs:
archive_name = os.path.join('assets/',... |
cecep-edu/edx-platform | refs/heads/eucalyptus.2 | lms/djangoapps/courseware/tests/test_video_xml.py | 134 | # -*- coding: utf-8 -*-
# pylint: disable=protected-access
"""Test for Video Xmodule functional logic.
These test data read from xml, not from mongo.
We have a ModuleStoreTestCase class defined in
common/lib/xmodule/xmodule/modulestore/tests/django_utils.py.
You can search for usages of this in the cms and lms tests ... |
steventimberman/masterDebater | refs/heads/master | venv/lib/python2.7/site-packages/chardet/codingstatemachine.py | 289 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... |
michaelld/gnuradio | refs/heads/master | gr-blocks/python/blocks/qa_conjugate.py | 7 | #!/usr/bin/env python
#
# Copyright 2012,2013 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 optio... |
karlgluck/heroes-of-the-storm-replay-parser | refs/heads/master | s2protocol/protocol26490.py | 7 | # Copyright (c) 2013 Blizzard Entertainment
#
# 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, publi... |
fabm-model/fabm | refs/heads/master | util/standard_variables/parse_standard_variables.py | 1 | #!/usr/bin/env python
from __future__ import print_function
import sys
import os.path
import io
try:
from urllib import urlretrieve
except ImportError:
from urllib.request import urlretrieve
import xml.etree.ElementTree
import yaml # http://pyyaml.org
variablespath = 'variables.yaml'
localpath = 'cf-standard... |
holdenk/spark | refs/heads/master | examples/src/main/python/ml/dct_example.py | 27 | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... |
henriknelson/micropython | refs/heads/master | tests/basics/frozenset_add.py | 41 | try:
frozenset
except NameError:
print("SKIP")
raise SystemExit
s = frozenset({1, 2, 3, 4})
try:
print(s.add(5))
except AttributeError:
print("AttributeError")
try:
print(s.update([5]))
except AttributeError:
print("AttributeError")
|
roncho12/frontapp | refs/heads/master | frontalization_API/dlib-18.15/python_examples/find_candidate_object_locations.py | 3 | #!/usr/bin/python
#
# This example shows how to use find_candidate_object_locations(). The
# function takes an input image and generates a set of candidate rectangles
# which are expected to bound any objects in the image.
# It is based on the paper:
# Segmentation as Selective Search for Object Recognition by Koen... |
uclmr/inferbeddings | refs/heads/master | inferbeddings/models/training/util.py | 1 | # -*- coding: utf-8 -*-
import numpy as np
def make_batches(size, batch_size):
"""
Returns a list of batch indices (tuples of indices).
:param size: Size of the dataset (number of examples).
:param batch_size: Batch size.
:return: List of batch indices (tuples of indices).
"""
nb_batch =... |
lmorchard/django | refs/heads/master | tests/template_tests/syntax_tests/test_extends.py | 83 | from django.test import SimpleTestCase
from ..utils import setup
inheritance_templates = {
'inheritance01': "1{% block first %}&{% endblock %}3{% block second %}_{% endblock %}",
'inheritance02': "{% extends 'inheritance01' %}"
"{% block first %}2{% endblock %}{% block second %}4{% endblo... |
yitian134/chromium | refs/heads/master | ppapi/generators/idl_visitor.py | 53 | # 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.
""" Visitor Object for traversing AST """
#
# IDLVisitor
#
# The IDLVisitor class will traverse an AST truncating portions of the tree
# when 'VisitFilt... |
tarthy6/dozer-thesis | refs/heads/master | py/eudoxos.py | 3 | # encoding: utf-8
# 2008 © Václav Šmilauer <eudoxos@arcig.cz>
#
# I doubt there functions will be useful for anyone besides me.
#
"""Miscillaneous functions that are not believed to be generally usable,
therefore kept in my "private" module here.
They comprise notably oofem export and various CPM-related functions.
""... |
dpac-vlsi/SynchroTrace | refs/heads/master | src/mem/slicc/ast/FuncCallExprAST.py | 8 | # Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
# Copyright (c) 2009 The Hewlett-Packard Development Company
# 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 co... |
takluyver/readthedocs.org | refs/heads/master | readthedocs/rtd_tests/utils.py | 43 | import logging
from os import chdir, environ, getcwd
from os.path import abspath, join as pjoin
from shutil import copytree
import subprocess
from tempfile import mkdtemp
log = logging.getLogger(__name__)
def check_output(l, env=()):
if env == ():
output = subprocess.Popen(l, stdout=subprocess.PIPE).comm... |
chrismeyersfsu/ansible | refs/heads/devel | lib/ansible/modules/packaging/language/easy_install.py | 10 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Matt Wright <matt@nobien.net>
#
# 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... |
domino-team/openwrt-cc | refs/heads/master | package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/v8/tools/testrunner/server/status_handler.py | 123 | # 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
# notice, this list of conditi... |
vikas-parashar/zulip | refs/heads/master | zerver/tests/webhooks/test_travis.py | 6 | # -*- coding: utf-8 -*-
from six import text_type
from six.moves import urllib
from zerver.lib.test_classes import WebhookTestCase
class TravisHookTests(WebhookTestCase):
STREAM_NAME = 'travis'
URL_TEMPLATE = u"/api/v1/external/travis?stream={stream}&api_key={api_key}&topic=builds"
FIXTURE_DIR_NAME = 'trav... |
madratman/nuklei-code | refs/heads/master | contrib/scons-2.3.0/scons-local-2.3.0/SCons/Variables/PathVariable.py | 11 | """SCons.Variables.PathVariable
This file defines an option type for SCons implementing path settings.
To be used whenever a a user-specified path override should be allowed.
Arguments to PathVariable are:
option-name = name of this option on the command line (e.g. "prefix")
option-help = help string for optio... |
Bismarrck/tensorflow | refs/heads/master | tensorflow/python/data/experimental/ops/optimization.py | 2 | # 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... |
kanagasabapathi/python-for-android | refs/heads/master | python3-alpha/python3-src/Lib/test/test_genexps.py | 56 | doctests = """
Test simple loop with conditional
>>> sum(i*i for i in range(100) if i&1 == 1)
166650
Test simple nesting
>>> list((i,j) for i in range(3) for j in range(4) )
[(0, 0), (0, 1), (0, 2), (0, 3), (1, 0), (1, 1), (1, 2), (1, 3), (2, 0), (2, 1), (2, 2), (2, 3)]
Test nesting with the inner ... |
meisterkleister/erpnext | refs/heads/master | erpnext/buying/doctype/__init__.py | 37694 | from __future__ import unicode_literals
|
orangeduck/PyAutoC | refs/heads/master | Python27/Lib/plat-mac/Carbon/QDOffscreen.py | 82 | # Generated from 'QDOffscreen.h'
def FOUR_CHAR_CODE(x): return x
pixPurgeBit = 0
noNewDeviceBit = 1
useTempMemBit = 2
keepLocalBit = 3
useDistantHdwrMemBit = 4
useLocalHdwrMemBit = 5
pixelsPurgeableBit = 6
pixelsLockedBit = 7
mapPixBit = 16
newDepthBit = 17
alignPixBit = 18
newRowBytesBit = 19
reallocPixBit = 20
clipP... |
bakkou-badri/dataminingproject | refs/heads/master | env/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/big5freq.py | 3132 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... |
minhphung171093/OpenERP_V7 | refs/heads/master | openerp/tools/lru.py | 204 | # -*- coding: utf-8 -*-
# taken from http://code.activestate.com/recipes/252524-length-limited-o1-lru-cache-implementation/
import threading
from func import synchronized
__all__ = ['LRU']
class LRUNode(object):
__slots__ = ['prev', 'next', 'me']
def __init__(self, prev, me):
self.prev = prev
... |
matmutant/sl4a | refs/heads/master | python/src/Lib/test/crashers/mutation_inside_cyclegc.py | 346 |
# The cycle GC collector can be executed when any GC-tracked object is
# allocated, e.g. during a call to PyList_New(), PyDict_New(), ...
# Moreover, it can invoke arbitrary Python code via a weakref callback.
# This means that there are many places in the source where an arbitrary
# mutation could unexpectedly occur.... |
flacjacket/qtile | refs/heads/master | libqtile/widget/pomodoro.py | 3 | # Copyright (c) 2017 Zordsdavini
#
# 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, distrib... |
valhallasw/pywikibot-core | refs/heads/master | pywikibot/compat/__init__.py | 7 | """Package to provide compatibility with compat scripts."""
|
andresailer/DIRAC | refs/heads/rel-v6r22 | ConfigurationSystem/test/Test_agentOptions.py | 1 | """Check options for all agents."""
import logging
import pytest
from DIRAC.tests.Utilities.assertingUtils import AgentOptionsTest
from DIRAC import S_OK
AGENTS = [('DIRAC.AccountingSystem.Agent.NetworkAgent', {'IgnoreOptions': ['MaxCycles', 'MessageQueueURI',
... |
kaspar030/RIOT | refs/heads/master | tests/pkg_nanopb/tests/01-run.py | 21 | #!/usr/bin/env python3
import sys
from testrunner import run
def testfunc(child):
child.expect_exact('Your lucky number was 13!')
if __name__ == "__main__":
sys.exit(run(testfunc))
|
hph86/requesocks | refs/heads/master | requesocks/models.py | 2 | # -*- coding: utf-8 -*-
"""
requests.models
~~~~~~~~~~~~~~~
This module contains the primary objects that power Requests.
"""
import os
from datetime import datetime
from .hooks import dispatch_hook, HOOKS
from .structures import CaseInsensitiveDict
from .status_codes import codes
from .auth import HTTPBasicAuth, ... |
c11/yatsm | refs/heads/master | yatsm/utils.py | 2 | from __future__ import division
from datetime import datetime as dt
import fnmatch
import os
import re
import sys
import numpy as np
import pandas as pd
import six
try:
from scandir import walk
except:
from os import walk
from log_yatsm import logger
# JOB SPECIFIC FUNCTIONS
def distribute_jobs(job_number... |
magicrub/MissionPlanner | refs/heads/master | Lib/xml/dom/NodeFilter.py | 72 | # This is the Python mapping for interface NodeFilter from
# DOM2-Traversal-Range. It contains only constants.
class NodeFilter:
"""
This is the DOM2 NodeFilter interface. It contains only constants.
"""
FILTER_ACCEPT = 1
FILTER_REJECT = 2
FILTER_SKIP = 3
SHOW_ALL ... |
derron/git-repo | refs/heads/master | command.py | 40 | #
# Copyright (C) 2008 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... |
foufou55/Sick-Beard | refs/heads/development | lib/hachoir_parser/file_system/fat.py | 90 | from lib.hachoir_core.compatibility import sorted
from lib.hachoir_parser import Parser
from lib.hachoir_core.field import (FieldSet, StaticFieldSet,
RawBytes, PaddingBytes, createPaddingField, Link, Fragment,
Bit, Bits, UInt8, UInt16, UInt32,
String, Bytes, NullBytes)
from lib.hachoir_core.field.integer im... |
aricchen/openHR | refs/heads/master | openerp/addons/account/report/account_invoice_report.py | 37 | # -*- 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... |
phalax4/CarnotKE | refs/heads/master | jyhton/bugtests/stdtest.py | 13 |
import test.regrtest
import os, sys
skipped = [
'test_al',
'test_asynchat',
'test_audioop',
'test_b1',
'test_b2',
'test_bastion',
'test_bsddb',
'test_capi',
'test_cd',
'test_cl',
'test_cmath',
'test_commands',
'test_crypt',
'test_curses',
'test_dbm',
... |
levkar/odoo | refs/heads/10.0 | addons/l10n_fr_fec/__init__.py | 23 | #-*- coding:utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
# Copyright (C) 2013-2015 Akretion (http://www.akretion.com)
import wizard
|
csrocha/OpenUpgrade | refs/heads/8.0 | addons/l10n_be_intrastat/l10n_be_intrastat.py | 258 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Odoo, Open Source Business Applications
# Copyright (C) 2014-2015 Odoo S.A. <http://www.odoo.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the ... |
haphaeu/yoshimi | refs/heads/master | EulerProject/085b.py | 3 | # bs
|
antoinecarme/pyaf | refs/heads/master | tests/artificial/transf_BoxCox/trend_MovingAverage/cycle_5/ar_12/test_artificial_128_BoxCox_MovingAverage_5_12_20.py | 1 | import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 128 , FREQ = 'D', seed = 0, trendtype = "MovingAverage", cycle_length = 5, transform = "BoxCox", sigma = 0.0, exog_count = 20, ar_order = 12); |
hanicker/odoo | refs/heads/8.0 | addons/website_gengo/models/base_gengo_translations.py | 356 | # -*- coding: utf-8 -*-
from openerp.osv import osv
class base_gengo_translations(osv.TransientModel):
_inherit = 'base.gengo.translations'
# update GROUPS, that are the groups allowing to access the gengo key.
# this is done here because in the base_gengo module, the various website
# groups do not ... |
craisins/wh2kbot | refs/heads/master | plugins/mem.py | 23 | import os
import re
from util import hook
@hook.command(autohelp=False)
def mem(inp):
".mem -- returns bot's current memory usage -- linux/windows only"
if os.name == 'posix':
status_file = open("/proc/%d/status" % os.getpid()).read()
line_pairs = re.findall(r"^(\w+):\s*(.*)\s*$", status_fil... |
zentai/zlist | refs/heads/master | task.py | 1 | import datetime
import cherrypy
import logging
import hashlib
from settings import db
from pymongo import MongoClient
class Tasklist:
exposed = True
def __init__(self):
client = MongoClient(db.get("MONGODB_IP"), db.get("MONGODB_PORT"))
client.admin.authenticate(db.get("USER"), db.get("PASS"))
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.