repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
atosatto/ansible | refs/heads/devel | lib/ansible/modules/cloud/cloudstack/cs_project.py | 43 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2015, René Moser <mail@renemoser.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 Lice... |
Oteng/youtube-dl | refs/heads/master | youtube_dl/extractor/glide.py | 153 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
class GlideIE(InfoExtractor):
IE_DESC = 'Glide mobile video messages (glide.me)'
_VALID_URL = r'https?://share\.glide\.me/(?P<id>[A-Za-z0-9\-=_+]+)'
_TEST = {
'url': 'http://share.glide.me/UZF8zlmuQbe4mr+7dC... |
grnet/snf-ganeti | refs/heads/master | lib/utils/retry.py | 2 | #
#
# Copyright (C) 2006, 2007, 2010, 2011 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:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list ... |
taknira/certificate-transparency | refs/heads/master | python/ct/client/reporter_test.py | 7 | #!/usr/bin/env python
import unittest
import sys
from collections import defaultdict
from ct.client import reporter
from ct.client.db import cert_desc
from ct.client.db import sqlite_cert_db
from ct.client.db import sqlite_connection as sqlitecon
from ct.crypto import cert
from ct.proto import certificate_pb2
from ct.... |
goodwinnk/intellij-community | refs/heads/master | python/testData/intentions/quotedStringDoubleSlash.py | 83 | data_path = dirname(realpath(__file__)).replace('\<caret>\', '/') |
habibmasuro/kivy | refs/heads/master | kivy/event.py | 56 | # This is a "jumping" module, required for python-for-android project
# Because we are putting all the module into the same .so, their can be name
# conflict. We have one conflict with pygame.event and kivy.event => Both are
# python extension and have the same "initevent" symbol. So right now, just
# rename this one.
... |
pybee/seasnake | refs/heads/master | tests/test_utils.py | 1 | from __future__ import unicode_literals
import unittest
from .utils import adjust
class AdjustTests(unittest.TestCase):
def assertEqualOutput(self, actual, expected):
self.assertEqual(adjust(actual), adjust(expected))
def test_adjust(self):
"Test input can be stripped of leading spaces."
... |
luminize/python-can | refs/heads/master | can/interfaces/socketcan_ctypes.py | 1 | from __future__ import print_function
import sys
import ctypes
import logging
import select
from ctypes.util import find_library
import can
from can.interfaces.socketcan_constants import * # CAN_RAW
from can.bus import BusABC
from can.message import Message
from can.broadcastmanager import CyclicSendTaskABC, MultiRa... |
tpo/ansible | refs/heads/devel | lib/ansible/module_utils/_text.py | 35 | # Copyright (c), Toshio Kuratomi <tkuratomi@ansible.com> 2016
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
"""
.. warn:: Use ansible.module_utils.common.text.converters ... |
hackers-terabit/portage | refs/heads/master | pym/portage/package/ebuild/_config/helper.py | 14 | # Copyright 2010-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
__all__ = (
'ordered_by_atom_specificity', 'prune_incremental',
)
from _emerge.Package import Package
from portage.dep import best_match_to_list, _repo_separator
def ordered_by_atom_specificity(cpdict, pkg, re... |
Axford/AFRo | refs/heads/master | hardware/utils/MCAD/get_submodules.py | 15 | #!/usr/bin/python
import os
os.system("git submodule update --init")
|
chennan47/osf.io | refs/heads/develop | admin_tests/pre_reg/test_serializers.py | 16 | import pytest
from osf_tests.factories import DraftRegistrationFactory, ProjectFactory, AuthUserFactory, RegistrationFactory, RetractionFactory
from osf.models import DraftRegistrationApproval
from website.prereg.utils import get_prereg_schema
from admin.pre_reg.serializers import get_approval_status
pytestmark = pyt... |
zhiyue/owllook | refs/heads/master | owllook/views/md_blueprint.py | 1 | #!/usr/bin/env python
from sanic import Blueprint
from sanic.response import html, text, redirect
from jinja2 import Environment, PackageLoader, select_autoescape
from urllib.parse import urlparse, parse_qs
from owllook.database.mongodb import MotorBase
from owllook.fetcher.cache import get_the_latest_chapter, cache_o... |
drnextgis/QGIS | refs/heads/master | python/plugins/GdalTools/tools/doContour.py | 5 | # -*- coding: utf-8 -*-
"""
***************************************************************************
doContour.py
---------------------
Date : June 2010
Copyright : (C) 2010 by Giuseppe Sucameli
Email : brush dot tyler at gmail dot com
******************... |
datapythonista/pandas | refs/heads/master | pandas/core/tools/numeric.py | 1 | from typing import Optional
import numpy as np
from pandas._libs import lib
from pandas.core.dtypes.cast import maybe_downcast_numeric
from pandas.core.dtypes.common import (
ensure_object,
is_datetime_or_timedelta_dtype,
is_decimal,
is_integer_dtype,
is_number,
is_numeric_dtype,
is_scala... |
kyrelos/vitelco-mobile-money-wallet | refs/heads/master | app_dir/wallet_api/views.py | 1 | from rest_framework.response import Response
from rest_framework.reverse import reverse
from rest_framework.views import APIView
from structlog import get_logger
logger = get_logger('transactions')
class APIRootView(APIView):
def get(self, request):
api_registry = {
"Transactions": {
... |
paulojamorim/invesalius3 | refs/heads/master | invesalius/gui/brain_seg_dialog.py | 5 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
import importlib
import multiprocessing
import os
import pathlib
import subprocess
import sys
import tempfile
import time
import numpy as np
import wx
from pubsub import pub as Publisher
import invesalius.data.slice_ as slc
from invesalius.segmentation.brain import segme... |
matthewelse/pyOCD | refs/heads/cortex-a | pyOCD/gdbserver/__init__.py | 6 | """
mbed CMSIS-DAP debugger
Copyright (c) 2006-2013 ARM Limited
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 ... |
iomarmochtar/ozpy | refs/heads/master | ozpy/utils.py | 1 | __author__ = 'Imam Omar Mochtar (iomarmochtar@gmail.com)'
class OZUtils:
@classmethod
def get_attrs(self, attrs, look_for=[]):
result = {}
# mark for what has been found
_found_lfor = []
convert_vals = {'TRUE': True, 'FALSE': False}
for attr in attrs:
k = ... |
mccheung/kbengine | refs/heads/master | kbe/src/lib/python/Tools/iobench/iobench.py | 44 | # -*- coding: utf-8 -*-
# This file should be kept compatible with both Python 2.6 and Python >= 3.0.
import itertools
import os
import platform
import re
import sys
import time
from optparse import OptionParser
out = sys.stdout
TEXT_ENCODING = 'utf8'
NEWLINES = 'lf'
# Compatibility
try:
xrange
except NameError... |
theduke/django-baseline | refs/heads/master | django_baseline/models.py | 1 | from __future__ import unicode_literals
from django.db import models
from django.contrib.contenttypes.models import ContentType
from django.utils.translation import ugettext_lazy as _
def get_object_or_none(qs, *args, **kwargs):
"""
Try to retrieve a model, and return None if
it is not found.
Useful ... |
ESOedX/edx-platform | refs/heads/master | openedx/core/djangoapps/profile_images/tests/helpers.py | 2 | """
Helper methods for use in profile image tests.
"""
from __future__ import absolute_import
from contextlib import contextmanager
import os
from tempfile import NamedTemporaryFile
from django.core.files.uploadedfile import UploadedFile
import piexif
from PIL import Image
from six.moves import range
@contextmanager... |
savoirfairelinux/stock-logistics-workflow | refs/heads/8.0 | picking_dispatch/company.py | 24 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Alexandre Fayolle
# Copyright 2012-2014 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
#... |
kenshay/ImageScript | refs/heads/master | ProgramData/SystemFiles/Python/Lib/site-packages/bs4/testing.py | 4 | # encoding: utf-8
"""Helper classes for tests."""
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
__license__ = "MIT"
import pickle
import copy
import functools
import unittest
from unittest import TestCase
from bs4 import BeautifulSoup
from bs4.element import (
... |
refuge-attic/bigcouch | refs/heads/master | couchjs/scons/scons-local-2.0.1/SCons/Tool/Subversion.py | 61 | """SCons.Tool.Subversion.py
Tool-specific initialization for Subversion.
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 The SCons F... |
0Chencc/CTFCrackTools | refs/heads/master | Lib/distutils/tests/test_clean.py | 95 | """Tests for distutils.command.clean."""
import sys
import os
import unittest
import getpass
from distutils.command.clean import clean
from distutils.tests import support
from test.test_support import run_unittest
class cleanTestCase(support.TempdirManager,
support.LoggingSilencer,
... |
sam81/pybdf | refs/heads/master | prep-release/make_deb.py | 1 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
import os, platform, time
#get current version number from setup.py
f = open('../setup.py', 'r')
ln = f.readlines()
f.close()
for i in range(len(ln)):
if ln[i].strip().split('=')[0].strip() == "version":
ver = ln[i].strip().split('=')[1].strip()
... |
mstriemer/amo-validator | refs/heads/master | tests/compat/test_gecko46.py | 4 | from helper import CompatTestCase
from validator.compat import FX46_DEFINITION
class TestFX46Compat(CompatTestCase):
"""Test that compatibility tests for Gecko 46 are properly executed."""
VERSION = FX46_DEFINITION
def test_mTab_renames(self):
variations = (
'filter.removeProgressLis... |
hkchenhongyi/django | refs/heads/master | tests/user_commands/management/commands/leave_locale_alone_false.py | 428 | from django.core.management.base import BaseCommand
from django.utils import translation
class Command(BaseCommand):
can_import_settings = True
leave_locale_alone = False
def handle(self, *args, **options):
return translation.get_language()
|
MadeiraCloud/salt | refs/heads/master | sources/salt/cloud/__init__.py | 1 | # -*- coding: utf-8 -*-
'''
The top level interface used to translate configuration data back to the
correct cloud modules
'''
# Import python libs
import copy
import os
import glob
import time
import signal
import logging
import multiprocessing
from itertools import groupby
# Import salt.cloud libs
import salt.utils... |
joaduo/mepinta | refs/heads/master | core/pipeline_backend/pipeline_backend_python/pipeline_backend/logging/logging.py | 1 | # -*- coding: utf-8 -*-
'''
Mepinta
Copyright (c) 2011-2012, Joaquin G. Duo, mepinta@joaquinduo.com.ar
This file is part of Mepinta.
Mepinta 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 th... |
coreycb/qemu | refs/heads/vtpm | tests/qapi-schema/test-qapi.py | 78 | #
# QAPI parser test harness
#
# Copyright (c) 2013 Red Hat Inc.
#
# Authors:
# Markus Armbruster <armbru@redhat.com>
#
# This work is licensed under the terms of the GNU GPL, version 2 or later.
# See the COPYING file in the top-level directory.
#
from qapi import *
from pprint import pprint
import sys
try:
exp... |
Mega-DatA-Lab/mxnet | refs/heads/master | tests/python/unittest/test_random.py | 13 | # 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 u... |
h3llrais3r/SickRage | refs/heads/master | lib/unidecode/x0ce.py | 253 | data = (
'cwik', # 0x00
'cwit', # 0x01
'cwip', # 0x02
'cwih', # 0x03
'cyu', # 0x04
'cyug', # 0x05
'cyugg', # 0x06
'cyugs', # 0x07
'cyun', # 0x08
'cyunj', # 0x09
'cyunh', # 0x0a
'cyud', # 0x0b
'cyul', # 0x0c
'cyulg', # 0x0d
'cyulm', # 0x0e
'cyulb', # 0x0f
'cyuls', # 0x1... |
datamade/where-the-work-is | refs/heads/master | data/slugify_header.py | 2 | if __name__ == "__main__":
import sys
import csv
reader = csv.reader(sys.stdin)
header = ['_'.join(r.replace('/', '_').replace(':', '').split(' ')).lower() for r in next(reader)]
writer = csv.writer(sys.stdout)
writer.writerow(header)
writer.writerows(reader)
|
alirizakeles/zato | refs/heads/dsuch-f-gh723-add-exe-agent | code/zato-web-admin/src/zato/admin/web/views/security/ntlm.py | 1 | # -*- coding: utf-8 -*-
"""
Copyright (C) 2013 Dariusz Suchojad <dsuch at zato.io>
Licensed under LGPLv3, see LICENSE.txt for terms and conditions.
"""
from __future__ import absolute_import, division, print_function, unicode_literals
# stdlib
import logging
# Zato
from zato.admin.web.forms import ChangePasswordFo... |
minhphung171093/GreenERP_V8 | refs/heads/master | openerp/addons/stock_account/__openerp__.py | 269 | # -*- 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... |
maclandrol/ete | refs/heads/master | examples/general/custom_tree_traversing.py | 4 | from ete2 import Tree
t = Tree( '(A:1,(B:1,(C:1,D:1):0.5):0.5);' )
# Browse the tree from a specific leaf to the root
node = t.search_nodes(name="C")[0]
while node:
print node
node = node.up
# --C
# /-C
# ---------|
# \-D
#
# /-B
# ---------|
# | /-C
# \... |
iAmMrinal0/plexpy | refs/heads/master | 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
... |
Agent007/deepchem | refs/heads/master | contrib/tensorflow_models/utils.py | 1 | #!/usr/bin/python
#
# Copyright 2015 Google 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 a... |
muku42/bokeh | refs/heads/master | examples/plotting/file/image.py | 45 | import numpy as np
from bokeh.plotting import figure, show, output_file
N = 1000
x = np.linspace(0, 10, N)
y = np.linspace(0, 10, N)
xx, yy = np.meshgrid(x, y)
d = np.sin(xx)*np.cos(yy)
output_file("image.html", title="image.py example")
p = figure(x_range=[0, 10], y_range=[0, 10])
p.image(image=[d], x=[0], y=[0],... |
ledrui/Probabilistic-Programming-and-Bayesian-Methods-for-Hackers | refs/heads/master | Chapter2_MorePyMC/separation_plot.py | 86 | # separation plot
# Author: Cameron Davidson-Pilon,2013
# see http://mdwardlab.com/sites/default/files/GreenhillWardSacks.pdf
import matplotlib.pyplot as plt
import numpy as np
def separation_plot( p, y, **kwargs ):
"""
This function creates a separation plot for logistic and probit classification.
Se... |
storm-computers/odoo | refs/heads/9.0 | openerp/report/printscreen/ps_form.py | 49 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import openerp
from openerp.report.interface import report_int
import openerp.tools as tools
from openerp.report import render
from lxml import etree
import time, os
class report_printscreen_list(report_int):
def... |
RydrDojo/Ridr | refs/heads/master | pylotVenv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/charsetgroupprober.py | 2928 | ######################## 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 ... |
GiulioGx/RNNs | refs/heads/master | sources/combiningRule/ClippingCombination.py | 1 | from theano.tensor.shared_randomstreams import RandomStreams
from Configs import Configs
from combiningRule import LinearCombination
from infos.InfoGroup import InfoGroup
import theano.tensor as TT
class ClippingCombination(LinearCombination):
def __init__(self, thr: float, clip_style: str, seed=Configs.seed):
... |
dbtsai/spark | refs/heads/master | examples/src/main/python/ml/power_iteration_clustering_example.py | 54 | #
# 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... |
ayepezv/GAD_ERP | refs/heads/master | addons/gamification/__init__.py | 337 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import models
import wizard
|
GbalsaC/bitnamiP | refs/heads/master | venv/lib/python2.7/site-packages/scipy/misc/pilutil.py | 5 | """
A collection of image utilities using the Python Imaging Library (PIL).
Note that PIL is not a dependency of SciPy and this module is not
available on systems that don't have PIL installed.
"""
from __future__ import division, print_function, absolute_import
# Functions which need the PIL
import numpy
import te... |
dav1x/ansible | refs/heads/devel | lib/ansible/modules/cloud/rackspace/rax_queue.py | 70 | #!/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... |
indautgrp/erpnext | refs/heads/develop | erpnext/accounts/doctype/sales_invoice_item/__init__.py | 37694 | from __future__ import unicode_literals
|
gangadharkadam/v6_erp | refs/heads/master | erpnext/utilities/doctype/address/__init__.py | 37694 | from __future__ import unicode_literals
|
DarkFenX/Pyfa | refs/heads/master | graphs/data/base/getter.py | 2 | # =============================================================================
# Copyright (C) 2010 Diego Duclos
#
# This file is part of pyfa.
#
# pyfa 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 ... |
OCA/account-invoice-reporting | refs/heads/12.0 | partner_time_to_pay/models/res_partner.py | 1 | # Copyright 2017 Open Source Integrators
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from datetime import datetime
from odoo import api, fields, models
class ResPartner(models.Model):
_inherit = 'res.partner'
d2p_life = fields.Float(
compute='_compute_d2x',
string='AVG Da... |
carlcarl/imgurup | refs/heads/master | doc/conf.py | 1 | # -*- coding: utf-8 -*-
#
# imgurup documentation build configuration file, created by
# sphinx-quickstart on Fri Oct 4 16:37:56 2013.
#
# 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... |
rahul67/hue | refs/heads/master | desktop/core/ext-py/Mako-0.8.1/test/test_block.py | 43 | from mako.template import Template
from mako.lookup import TemplateLookup
from mako import exceptions
from test import TemplateTest, assert_raises, assert_raises_message
from test.util import flatten_result, result_lines
class BlockTest(TemplateTest):
def test_anonymous_block_namespace_raises(self):
asse... |
vam-google/google-cloud-java | refs/heads/master | google-cloud-clients/google-cloud-securitycenter/synth.py | 1 | # Copyright 2018 Google LLC
#
# 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, s... |
cvegaj/ElectriCERT | refs/heads/master | venv3/lib/python3.6/distutils/__init__.py | 1211 | import os
import sys
import warnings
import imp
import opcode # opcode is not a virtualenv module, so we can use it to find the stdlib
# Important! To work on pypy, this must be a module that resides in the
# lib-python/modified-x.y.z directory
dirname = os.path.dirname
distutils_path = o... |
bryantbiggs/luther-02 | refs/heads/master | src/torrents.py | 2 | '''
Poll torrent sites checking for number of torrent copies for a select film
'''
import time
import re
import requests
import pandas as pd
from bs4 import BeautifulSoup
from src.my_aws import S3
KEY_OMDB = 'OMDB_API.csv'
KEY_OMDB_TOR = 'OMDB_Torrents.csv'
BUCKET = 'movie-torrents'
class TorrentCount():
'''
... |
chrismarcellino/edgycamera | refs/heads/master | ThirdParty/OpenCV/samples/python/cv20squares.py | 6 | """
Find Squares in image by finding countours and filtering
"""
#Results slightly different from C version on same images, but is
#otherwise ok
import math
import cv
def angle(pt1, pt2, pt0):
"calculate angle contained by 3 points(x, y)"
dx1 = pt1[0] - pt0[0]
dy1 = pt1[1] - pt0[1]
dx2 = pt2[0] - pt0... |
gganis/root | refs/heads/master | main/python/rootrm.py | 31 | #!/usr/bin/env @python@
# ROOT command line tools: rootrm
# Author: Julien Ripoche
# Mail: julien.ripoche@u-psud.fr
# Date: 20/08/15
"""Command line to remove objects from ROOT files"""
import cmdLineUtils
import sys
# Help strings
COMMAND_HELP = "Remove objects from ROOT files"
EPILOG = """Examples:
- rootrm exam... |
dskoda/vasp-ita | refs/heads/master | vaspirin/splitter.py | 2 | import os,sys,shutil
from . import projection
class PROCAR_splitter (object):
'''
Deals with big PROCAR files: splits the file directly onto .dat files, thus bypassing the .dat generator. This is useful for very large files (~ GB files), since it does not requires the standard open-and-close approach to reading the ... |
alshedivat/tensorflow | refs/heads/master | tensorflow/contrib/slim/python/slim/data/prefetch_queue_test.py | 25 | # 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... |
outofmem0ry/incubator-hawq | refs/heads/master | tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/utest/parseerror.py | 11 | from pychecker2 import TestSupport
from pychecker2 import ParseChecks
from pychecker2 import VariableChecks
from pychecker2.File import File
class UnknownTestCase(TestSupport.WarningTester):
def testParseError(self):
self.warning('===\n', 1, ParseChecks.ParseCheck.syntaxErrors,
'could ... |
codrut3/tensorflow | refs/heads/master | tensorflow/contrib/lite/toco/python/toco_wrapper.py | 19 | # 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... |
arantebillywilson/python-snippets | refs/heads/master | microblog/flask/lib/python3.5/site-packages/coverage/__init__.py | 8 | # 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... |
grap/OCB | refs/heads/7.0 | addons/mrp_jit/__openerp__.py | 60 | # -*- 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... |
Karel-van-de-Plassche/bokeh | refs/heads/master | bokeh/util/version.py | 4 | """ Provide a version for the Bokeh library.
This module uses `versioneer`_ to manage version strings. During development,
`versioneer`_ will compute a version string from the current git revision.
For packaged releases based off tags, the version string is hard coded in the
files packaged for distribution.
Attribute... |
kingvuplus/bh-s | refs/heads/master | lib/python/Blackhole/BhEpgPanel.py | 2 | from Screens.Screen import Screen
from Screens.MessageBox import MessageBox
from Screens.VirtualKeyBoard import VirtualKeyBoard
from Components.ActionMap import ActionMap
from Components.Label import Label
from Components.Pixmap import Pixmap
from Components.Sources.List import List
from Components.ConfigList import Co... |
awkspace/ansible | refs/heads/devel | lib/ansible/modules/network/cloudengine/ce_evpn_global.py | 31 | #!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distribut... |
linjoahow/w17test_1 | refs/heads/master | static/Brython3.1.0-20150301-090019/Lib/genericpath.py | 727 | """
Path operations common to more than one OS
Do not use directly. The OS specific modules import the appropriate
functions from this module themselves.
"""
import os
import stat
__all__ = ['commonprefix', 'exists', 'getatime', 'getctime', 'getmtime',
'getsize', 'isdir', 'isfile']
# Does a path exist?
#... |
mapping/OpenClimateGIS | refs/heads/master | src/openclimategis/climatedata/views.py | 7 | from django.http import HttpResponse
from climatedata.models import Archive
from django.shortcuts import render_to_response
import logging
logger = logging.getLogger(__name__)
def index(request):
logger.debug("just testing...")
logger.info("just testing...")
logger.error("just testing...")
# ... |
akosel/incubator-airflow | refs/heads/master | airflow/www_rbac/__init__.py | 1213 | # -*- 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
#... |
wdv4758h/ZipPy | refs/heads/master | lib-python/3/importlib/test/test_api.py | 5 | from . import util
import imp
import importlib
import sys
import unittest
class ImportModuleTests(unittest.TestCase):
"""Test importlib.import_module."""
def test_module_import(self):
# Test importing a top-level module.
with util.mock_modules('top_level') as mock:
with util.impo... |
typhainepl/genome3D | refs/heads/master | interpro_unintegrated/complete_trac_file.py | 1 | #!/usr/bin/env python
#######################################################################################
# @author T. Paysan-Lafosse
# For each cluster, this script get particular blocks (gold, one to many domains between cath and scop MDA blocks)
##################################################################... |
authmillenon/RIOT | refs/heads/master | tests/pkg_minmea/tests/01-run.py | 8 | #!/usr/bin/env python3
import sys
from testrunner import run
def testfunc(child):
child.expect_exact('START')
child.expect_exact('SUCCESS')
if __name__ == "__main__":
sys.exit(run(testfunc))
|
Hearen/Scrawlers | refs/heads/master | Sina/PageParser.py | 1 | #coding=utf-8
'''
Author: LHearen
E-mail: LHearen@126.com
Time : 2015-12-05 10:47
Description: Used to collect and parse the posts;
'''
import urllib
import re
import os
import mmap
import time
import datetime
import threading
import multiprocessing
from multiprocessing import Process
from Queue import... |
moonlightly/android_kernel_huawei_msm7x27a | refs/heads/cm-10.1 | Documentation/networking/cxacru-cf.py | 14668 | #!/usr/bin/env python
# Copyright 2009 Simon Arlott
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 2 of the License, or (at your option)
# any later version.
#
# This program i... |
kschwank/dcache-docker | refs/heads/master | dcache/deps/.vim/bundle/jedi-vim/jedi/jedi/parser/fast.py | 32 | """
Basically a parser that is faster, because it tries to parse only parts and if
anything changes, it only reparses the changed parts. But because it's not
finished (and still not working as I want), I won't document it any further.
"""
import re
from itertools import chain
from jedi._compatibility import use_metacl... |
vhazali/cs5331 | refs/heads/master | assignment3/verifier/scapy-2.3.1/scapy/arch/unix.py | 15 | ## This file is part of Scapy
## See http://www.secdev.org/projects/scapy for more informations
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
"""
Common customizations for all Unix-like operating systems other than Linux
"""
import sys,os,struct,socket,time
from... |
steventimberman/masterDebater | refs/heads/master | venv/lib/python2.7/site-packages/django/contrib/postgres/forms/hstore.py | 46 | import json
from django import forms
from django.core.exceptions import ValidationError
from django.utils import six
from django.utils.translation import ugettext_lazy as _
__all__ = ['HStoreField']
class HStoreField(forms.CharField):
"""
A field for HStore data which accepts dictionary JSON input.
"""
... |
boompieman/iim_project | refs/heads/master | project_python2/lib/python2.7/site-packages/jinja2/runtime.py | 335 | # -*- coding: utf-8 -*-
"""
jinja2.runtime
~~~~~~~~~~~~~~
Runtime helpers.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD.
"""
import sys
from itertools import chain
from jinja2.nodes import EvalContext, _context_function_types
from jinja2.utils import Markup, soft_unicode, escape, missing... |
TESScience/SPyFFI | refs/heads/master | scripts/testpsf.py | 1 | #!/usr/bin/env python
# create an observation centered at the north ecliptic pole (midlatitude)
# noinspection PyUnresolvedReferences
from SPyFFI.Observation import Observation, default
# start from the default settings
inputs = default
inputs['camera']['label'] = 'newtest'
inputs['catalog']['name'] = 'testpattern'... |
damonkohler/sl4a | refs/heads/master | python/src/Lib/test/test_threadsignals.py | 75 | """PyUnit testing that threads honor our signal semantics"""
import unittest
import thread
import signal
import os
import sys
from test.test_support import run_unittest, TestSkipped
if sys.platform[:3] in ('win', 'os2') or sys.platform=='riscos':
raise TestSkipped, "Can't test signal on %s" % sys.platform
proces... |
eclayaz/codejam-commandline | refs/heads/master | lib/error.py | 20 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
#
# Copyright 2011 Google 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 re... |
kevinmel2000/brython | refs/heads/master | www/src/Lib/test/unittests/badsyntax_future4.py | 383 | """This is a test"""
import __future__
from __future__ import nested_scopes
def f(x):
def g(y):
return x + y
return g
result = f(2)(4)
|
Fireblend/scikit-learn | refs/heads/master | benchmarks/bench_plot_incremental_pca.py | 374 | """
========================
IncrementalPCA benchmark
========================
Benchmarks for IncrementalPCA
"""
import numpy as np
import gc
from time import time
from collections import defaultdict
import matplotlib.pyplot as plt
from sklearn.datasets import fetch_lfw_people
from sklearn.decomposition import Incre... |
deathspawn/moffit | refs/heads/moffit | plugins/bible.py | 2 | import requests
import re
from cloudbot import hook
@hook.command("bible", "passage", singlethreaded=True)
def bible(text):
"""Prints the specified passage from the Bible"""
passage = text.strip()
params = {
'passage':passage,
'formatting':'plain',
'type':'json'
}
r = reque... |
andela-ooladayo/django | refs/heads/master | django/contrib/admin/templatetags/admin_modify.py | 342 | from django import template
register = template.Library()
@register.inclusion_tag('admin/prepopulated_fields_js.html', takes_context=True)
def prepopulated_fields_js(context):
"""
Creates a list of prepopulated_fields that should render Javascript for
the prepopulated fields for both the admin form and i... |
RNAcentral/rnacentral-webcode | refs/heads/master | rnacentral/apiv1/renderers.py | 1 | from rest_framework import renderers
class RnaFastaRenderer(renderers.BaseRenderer):
"""
Render the fasta data received from RnaFastaSerializer.
"""
media_type = 'text/fasta'
format = 'fasta'
def render(self, data, media_type=None, renderer_context=None):
"""
RnaFastaSerialize... |
Suninus/NewsBlur | refs/heads/master | apps/rss_feeds/management/shellplus_imports.py | 16 | from django.conf import settings
import redis
from apps.social.models import *
r = redis.Redis(connection_pool=settings.REDIS_FEED_UPDATE_POOL)
print "Redis: %s" % r |
kmiddleton/labmisc | refs/heads/master | elisa_reg.py | 1 | #!/usr/bin/env python
from __future__ import division
import argparse
import os
import sys
import time
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import scipy as sp
import scipy.optimize
import scipy.stats
def standardize(infile, max_q, factor, first_row):
"Fit OD = (A-D)/(1+(x/C... |
kwierman/osf.io | refs/heads/develop | website/notifications/views.py | 10 | import httplib as http
from flask import request
from framework import sentry
from framework.auth.decorators import must_be_logged_in
from framework.exceptions import HTTPError
from website.notifications import utils
from website.notifications.constants import NOTIFICATION_TYPES
from website.notifications.model impo... |
coloft/qemu | refs/heads/master | scripts/tracetool/backend/dtrace.py | 102 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
DTrace/SystemTAP backend.
"""
__author__ = "Lluís Vilanova <vilanova@ac.upc.edu>"
__copyright__ = "Copyright 2012-2014, Lluís Vilanova <vilanova@ac.upc.edu>"
__license__ = "GPL version 2 or (at your option) any later version"
__maintainer__ = "Stefan Hajnoczi... |
soscpd/bee | refs/heads/master | root/tests/zguide/examples/Python/MDP.py | 4 | """Majordomo Protocol definitions"""
# This is the version of MDP/Client we implement
C_CLIENT = "MDPC01"
# This is the version of MDP/Worker we implement
W_WORKER = "MDPW01"
# MDP/Server commands, as strings
W_READY = "\001"
W_REQUEST = "\002"
W_REPLY = "\003"
W_HEARTBEAT = "\004... |
thiblahute/meson | refs/heads/master | mesonbuild/dependencies/platform.py | 1 | # Copyright 2013-2017 The Meson development team
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agree... |
arvinquilao/android_kernel_cyanogen_msm8916 | refs/heads/cm-13.0-seed | Documentation/networking/cxacru-cf.py | 14668 | #!/usr/bin/env python
# Copyright 2009 Simon Arlott
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 2 of the License, or (at your option)
# any later version.
#
# This program i... |
britcey/ansible | refs/heads/devel | lib/ansible/modules/database/postgresql/postgresql_ext.py | 64 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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.
#... |
SmartPeople/zulip | refs/heads/master | analytics/tests/test_counts.py | 1 | from __future__ import absolute_import
from django.apps import apps
from django.db import models
from django.db.models import Sum
from django.test import TestCase
from django.utils.timezone import now as timezone_now
from django.utils.timezone import utc as timezone_utc
from analytics.lib.counts import CountStat, COU... |
e-q/scipy | refs/heads/master | scipy/sparse/linalg/tests/test_matfuncs.py | 8 | #
# Created by: Pearu Peterson, March 2002
#
""" Test functions for scipy.linalg.matfuncs module
"""
import math
import numpy as np
from numpy import array, eye, exp, random
from numpy.linalg import matrix_power
from numpy.testing import (
assert_allclose, assert_, assert_array_almost_equal, assert_equal,
... |
KamranMackey/CloudBot | refs/heads/gonzobot | plugins/history.py | 22 | from collections import deque
import time
import asyncio
import re
from cloudbot import hook
from cloudbot.util import timeformat
from cloudbot.event import EventType
db_ready = []
def db_init(db, conn_name):
"""check to see that our db has the the seen table (connection name is for caching the result per conne... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.