repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
ekiourk/ansible-modules-core | refs/heads/devel | packaging/language/__init__.py | 12133432 | |
ryfeus/lambda-packs | refs/heads/master | Shapely_numpy/source/numpy/distutils/lib2def.py | 193 | from __future__ import division, absolute_import, print_function
import re
import sys
import os
import subprocess
__doc__ = """This module generates a DEF file from the symbols in
an MSVC-compiled DLL import library. It correctly discriminates between
data and functions. The data is collected from the output of the... |
valrus/mingus3 | refs/heads/python3 | unittest/test_MusicXML.py | 4 | import sys
sys.path += ["../"]
import mingus.extra.MusicXML as mxl
import unittest
class test_MusicXML(unittest.TestCase):
def setUp(self):
pass
def suite():
return unittest.TestLoader().loadTestsFromTestCase(test_MusicXML)
|
starqiu/PythonLearn | refs/heads/master | Django-1.6.5/tests/i18n/commands/__init__.py | 116 | from django.utils.translation import ugettext as _, ungettext
# Translators: This comment should be extracted
dummy1 = _("This is a translatable string.")
# This comment should not be extracted
dummy2 = _("This is another translatable string.")
# This file has a literal with plural forms. When processed first, makem... |
ravibhure/ansible | refs/heads/devel | lib/ansible/modules/network/avi/avi_trafficcloneprofile.py | 15 | #!/usr/bin/python
#
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Eric Anderson (eanderson@avinetworks.com)
# module_check: supported
#
# Copyright: (c) 2017 Gaurav Rastogi, <grastogi@avinetworks.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
ANSIB... |
vienin/vlaunch | refs/heads/2.0 | sdk/bindings/xpcom/python/xpcom/nsError.py | 30 | # ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (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.mozilla.org/MPL/
#
# Softwa... |
equalitie/BotHound | refs/heads/master | src/training_set.py | 2 | """
This class is used to hold train as well as test set
AUTHORS:
- vmon (vmon@equaliti.e) 2013: Moved from train2ban
"""
import numpy as np
from operator import itemgetter
import pdb
class TrainingSet:
"""
Each TrainingSet consists of data, target and ip_index, in particular
you shouldn't add ip to t... |
PathoScope/PathoScope | refs/heads/master | pathoscope/pathoreport/PathoReportA.py | 1 | #!/usr/bin/python
# Initial Author: Solaiappan Manimaran
# PathoMap performs the alignment through wrappers for each type of aligners.
# Pathoscope - Predicts strains of genomes in Nextgen seq alignment file (sam/bl8)
# Copyright (C) 2013 Johnson Lab - Boston University and Crandall Lab George Washington Univer... |
hmoco/osf.io | refs/heads/develop | api/base/content_negotiation.py | 69 |
from rest_framework.negotiation import DefaultContentNegotiation
class JSONAPIContentNegotiation(DefaultContentNegotiation):
def select_renderer(self, request, renderers, format_suffix=None):
"""
Returns appropriate tuple (renderer, media type).
If 'application/json' in acceptable media... |
40223227/2015cdbg6w0622-40223227- | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/multiprocessing/dummy/__init__.py | 693 | #
# Support for the API of the multiprocessing package using threads
#
# multiprocessing/dummy/__init__.py
#
# Copyright (c) 2006-2008, R Oudkerk
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
... |
jordiclariana/ansible | refs/heads/devel | lib/ansible/modules/packaging/os/xbps.py | 37 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2016 Dino Occhialini <dino.occhialini@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 versi... |
GISPPU/GrenadaLandInformation | refs/heads/master | geonode/search/tests.py | 3 | #########################################################################
#
# Copyright (C) 2012 OpenPlans
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
#... |
ratnania/pyccel | refs/heads/master | doc/scripts/scripts/complex_numbers.py | 2 | from numpy import array
from numpy import zeros
from numpy import ones
x1 = 1+3j
x2 = complex(1,3)
x3 = [complex(1,1)]*10
x4 = [1+2j]*10
x5 = array([1+2j,2+3j])
x6 = zeros((100,100),'complex')
x7 = ones((100,100),'complex')
|
etos/django | refs/heads/master | django/db/migrations/exceptions.py | 39 | from django.db.utils import DatabaseError
class AmbiguityError(Exception):
"""More than one migration matches a name prefix."""
pass
class BadMigrationError(Exception):
"""There's a bad migration (unreadable/bad format/etc.)."""
pass
class CircularDependencyError(Exception):
"""There's an impo... |
bobquest33/peach | refs/heads/master | peach/nn/kmeans.py | 6 | ################################################################################
# Peach - Computational Intelligence for Python
# Jose Alexandre Nalon
#
# This file: nn/kmeans.py
# Clustering for use in radial basis functions
################################################################################
# Doc strin... |
kaksmet/servo | refs/heads/master | tests/wpt/web-platform-tests/websockets/handlers/echo-query_v13_wsh.py | 266 | #!/usr/bin/python
from mod_pywebsocket import msgutil, util
def web_socket_do_extra_handshake(request):
pass
def web_socket_transfer_data(request):
while True:
msgutil.send_message(request, request.unparsed_uri.split('?')[1] or '')
return
|
mropert/conan | refs/heads/develop | conans/client/command_profile_args.py | 1 | from conans.model.profile import Profile
from conans.errors import ConanException
from collections import defaultdict, OrderedDict
from conans.model.env_info import EnvValues
from conans.model.options import OptionsValues
from conans.model.scope import Scopes
def profile_from_args(args, cwd, default_folder):
""" ... |
cnoviello/micropython | refs/heads/master | tests/basics/class_getattr.py | 100 | # test that __getattr__, __getattrribute__ and instance members don't override builtins
class C:
def __init__(self):
self.__add__ = lambda: print('member __add__')
def __add__(self, x):
print('__add__')
def __getattr__(self, attr):
print('__getattr__', attr)
return None
d... |
BenTheElder/test-infra | refs/heads/master | gubernator/gcs_async_test.py | 20 | # Copyright 2016 The Kubernetes Authors.
#
# 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 ... |
heeraj123/oh-mainline | refs/heads/master | vendor/packages/twisted/doc/core/howto/tutorial/listings/finger/fingerPBclient.py | 22 | # test the PB finger on port 8889
# this code is essentially the same as
# the first example in howto/pb-usage
from twisted.spread import pb
from twisted.internet import reactor
def gotObject(object):
print "got object:", object
object.callRemote("getUser","moshez").addCallback(gotData)
# or
# object.callRe... |
micjerry/groupservice | refs/heads/master | handlers/removemember.py | 1 | import tornado.web
import tornado.gen
import json
import io
import logging
import motor
from bson.objectid import ObjectId
from mickey.basehandler import BaseHandler
import mickey.tp
import mickey.maps
import mickey.userfetcher
class RemoveMemberHandler(BaseHandler):
@tornado.web.asynchronous
@tornado.gen.co... |
draugiskisprendimai/odoo | refs/heads/8.0 | addons/point_of_sale/__init__.py | 378 | # -*- 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... |
helloTC/ATT | refs/heads/master | algorithm/__init__.py | 2 | __all__ = ['tools', 'surf_tools', 'vol_tools']
|
motion2015/a3 | refs/heads/a3 | common/lib/xmodule/xmodule/modulestore/mongo/base.py | 7 | """
Modulestore backed by Mongodb.
Stores individual XModules as single documents with the following
structure:
{
'_id': <location.as_dict>,
'metadata': <dict containing all Scope.settings fields>
'definition': <dict containing all Scope.content fields>
'definition.children': <list of all child locati... |
diverted247/signer | refs/heads/master | libs/pdfminer/pdfminer/pdfparser.py | 9 | #!/usr/bin/env python
import sys
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
from psparser import PSStackParser
from psparser import PSSyntaxError, PSEOF
from psparser import KWD, STRICT
from pdftypes import PDFException
from pdftypes import PDFStream, PDFObjRef
from pd... |
bratsche/Neutron-Drive | refs/heads/master | neutron-drive/django/http/multipartparser.py | 65 | """
Multi-part parsing for file uploads.
Exposes one class, ``MultiPartParser``, which feeds chunks of uploaded data to
file upload handlers for processing.
"""
import cgi
from django.conf import settings
from django.core.exceptions import SuspiciousOperation
from django.utils.datastructures import MultiValueDict
fro... |
tcporco/SageBoxModels | refs/heads/master | boxmodel/code_generation.py | 1 | #*****************************************************************************
# Copyright (C) 2017 Lee Worden <worden dot lee at gmail dot com>
#
# Distributed under the terms of the GNU General Public License (GPL) v.2
# http://www.gnu.org/licenses/
#************************************************... |
Gustry/QGIS | refs/heads/master | python/plugins/processing/algs/gdal/roughness.py | 12 | # -*- coding: utf-8 -*-
"""
***************************************************************************
roughness.py
---------------------
Date : October 2013
Copyright : (C) 2013 by Alexander Bruy
Email : alexander dot bruy at gmail dot com
***************... |
uraniumanchor/django-smart-selects | refs/heads/master | smart_selects/urls.py | 9 | try:
from django.conf.urls.defaults import patterns, url
except ImportError:
from django.conf.urls import patterns, url
urlpatterns = patterns(
'smart_selects.views',
url(r'^all/(?P<app>[\w\-]+)/(?P<model>[\w\-]+)/(?P<field>[\w\-]+)/(?P<value>[\w\-]+)/$',
'filterchain_all', name='chained_filter... |
mdaniel/intellij-community | refs/heads/master | python/testData/inspections/PyUnboundLocalVariableInspection/PositiveIteration.py | 21 | def test1():
for i in "abc":
j = 1
print(j)
def test2():
for i in (1, 2):
j = 1
print(j)
def test3():
for i in [1, 2]:
j = 1
print(j)
|
qutip/qutip-benchmark | refs/heads/master | benchmark/tests/test_15.py | 1 | from qutip import *
from numpy import *
from time import time
def test_15(runs=1):
"""
mcsolve_f90 evolution of 8-spin chain
"""
test_name='8-spin MC_F90 [256]'
N = 8# number of spins
# uniform parameters
h = 1.0 * 2 * pi * ones(N)
Jz = 0.1 * 2 * pi * ones(N)
Jx = 0.1 * 2 * pi * o... |
sbussetti/django-nested-admin | refs/heads/master | nested_admin/tests/one_deep/tests.py | 1 | try:
from distutils.spawn import find_executable
except:
find_executable = lambda f: None
import django
import inspect
import logging
import os
import shutil
import subprocess
import tempfile
from unittest import SkipTest
from django.contrib.admin.sites import site as admin_site
from nested_admin.tests.base i... |
Morgan-Stanley/treadmill | refs/heads/master | lib/python/treadmill/sproc/appcfgmgr.py | 2 | """Treadmill app configurator daemon, subscribes to eventmgr events.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import click
from treadmill import appcfgmgr
from treadmill import cli
def init():
"""Top... |
gangadhar-kadam/verve_live_erp | refs/heads/v5.0 | erpnext/selling/doctype/campaign/campaign.py | 100 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
from frappe.model.naming import make_autoname
class Campaign(Document):
def autoname(self):
... |
paplorinc/intellij-community | refs/heads/master | python/testData/refactoring/extractmethod/NameCollisionFile.before.py | 83 | def hello():
pass
<selection>print("Hello")</selection> |
ryfeus/lambda-packs | refs/heads/master | Tensorflow_OpenCV_Nightly/source/numpy/fft/helper.py | 15 | """
Discrete Fourier Transforms - helper.py
"""
from __future__ import division, absolute_import, print_function
import collections
try:
import threading
except ImportError:
import dummy_threading as threading
from numpy.compat import integer_types
from numpy.core import integer, empty, arange, asarray, roll
... |
georgepinca1/Iron | refs/heads/master | contrib/linearize/linearize-hashes.py | 33 | #!/usr/bin/python
#
# linearize-hashes.py: List blocks in a linear, no-fork version of the chain.
#
# Copyright (c) 2013-2014 The Bitcoin developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
from __future__ import pri... |
40223226/2015cdb_g8 | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/xml/dom/xmlbuilder.py | 873 | """Implementation of the DOM Level 3 'LS-Load' feature."""
import copy
import xml.dom
from xml.dom.NodeFilter import NodeFilter
__all__ = ["DOMBuilder", "DOMEntityResolver", "DOMInputSource"]
class Options:
"""Features object that has variables set for each DOMBuilder feature.
The DOMBuilder class uses a... |
shashank971/edx-platform | refs/heads/master | common/djangoapps/util/tests/test_sandboxing.py | 162 | """
Tests for sandboxing.py in util app
"""
from django.test import TestCase
from opaque_keys.edx.locator import LibraryLocator
from util.sandboxing import can_execute_unsafe_code
from django.test.utils import override_settings
from opaque_keys.edx.locations import SlashSeparatedCourseKey
class SandboxingTest(TestCa... |
johan--/tornado | refs/heads/master | maint/vm/windows/bootstrap.py | 99 | r"""Installs files needed for tornado testing on windows.
These instructions are compatible with the VMs provided by http://modern.ie.
The bootstrapping script works on the WinXP/IE6 and Win8/IE10 configurations,
although tornado's tests do not pass on XP.
1) Install virtualbox guest additions (from the device menu i... |
pyamg/pyamg | refs/heads/lloyd-unify | pyamg/classical/split.py | 1 | """Functions to compute C/F splittings for use in Classical AMG.
Overview
--------
A C/F splitting is a partitioning of the nodes in the graph of as connection
matrix (denoted S for strength) into sets of C (coarse) and F (fine) nodes.
The C-nodes are promoted to the coarser grid while the F-nodes are retained
on the ... |
marrow/package | refs/heads/develop | marrow/package/loader.py | 1 | from pkg_resources import iter_entry_points
from typeguard import check_argument_types
from typing import Sequence
nodefault = object()
def traverse(obj, target:str, default=nodefault, executable:bool=False, separator:str='.', protect:bool=True):
"""Traverse down an object, using getattr or getitem.
If ``executa... |
ebolyen/qiime2 | refs/heads/master | qiime2/core/type/tests/test_primitive.py | 3 | # ----------------------------------------------------------------------------
# Copyright (c) 2016-2017, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... |
alxgu/ansible | refs/heads/devel | lib/ansible/modules/storage/netapp/na_ontap_vserver_peer.py | 38 | #!/usr/bin/python
# (c) 2018-2019, NetApp, Inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... |
chrisspen/burlap | refs/heads/master | burlap/ssh.py | 1 | """
OpenSSH tasks
=============
This module provides tools to manage OpenSSH server and client.
"""
from __future__ import print_function
# from fabric.api import hide, shell_env
# from fabric.contrib.files import append, sed
# from burlap.service import is_running, restart
# from burlap.files import watch
from bu... |
Xeleste/namebench | refs/heads/master | libnamebench/config_test.py | 173 | #!/usr/bin/env python
# Copyright 2009 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... |
WCCCEDU/twitter-commons | refs/heads/master | src/python/twitter/common/app/inspection.py | 16 | # ==================================================================================================
# Copyright 2011 Twitter, Inc.
# --------------------------------------------------------------------------------------------------
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use thi... |
marcsans/cnn-physics-perception | refs/heads/master | phy/lib/python2.7/site-packages/numpy/distutils/command/autodist.py | 148 | """This module implements additional tests ala autoconf which can be useful.
"""
from __future__ import division, absolute_import, print_function
# We put them here since they could be easily reused outside numpy.distutils
def check_inline(cmd):
"""Return the inline identifier (may be empty)."""
cmd._check_... |
kewu1992/test-infra | refs/heads/master | scenarios/execute.py | 33 | #!/usr/bin/env python
# Copyright 2017 The Kubernetes Authors.
#
# 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... |
davido/buck | refs/heads/master | third-party/py/setuptools/pkg_resources/_vendor/__init__.py | 12133432 | |
rahulsharma1991/frontera | refs/heads/master | frontera/tests/__init__.py | 12133432 | |
fgesora/odoo | refs/heads/8.0 | addons/base_report_designer/plugin/openerp_report_designer/test/test_fields.py | 391 | #
# Use this module to retrive the fields you need according to the type
# of the OpenOffice operation:
# * Insert a Field
# * Insert a RepeatIn
#
import xmlrpclib
import time
sock = xmlrpclib.ServerProxy('http://localhost:8069/xmlrpc/object')
def get(object, level=3, ending=None, ending_excl=None, recur=None, roo... |
aesaae/ardupilot_str | refs/heads/master | mk/PX4/Tools/genmsg/test/test_genmsg_command_line.py | 216 | # Software License Agreement (BSD License)
#
# Copyright (c) 2011, Willow Garage, 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... |
psobot/SampleScanner | refs/heads/master | tests/readme_test.py | 1 | import subprocess
def readme_contentsof(name):
with open('README.md') as readme:
return (
readme.read()
.split('```contentsof<%s>' % name)[1]
.split('```')[0]
.strip()
)
def command_line_output_in_readme():
return readme_conte... |
Peddle/hue | refs/heads/master | desktop/core/ext-py/Django-1.6.10/tests/utils_tests/models.py | 265 | from django.db import models
class Category(models.Model):
name = models.CharField(max_length=100)
def next(self):
return self
class Thing(models.Model):
name = models.CharField(max_length=100)
category = models.ForeignKey(Category)
|
simontakite/sysadmin | refs/heads/master | pythonscripts/programmingpython/Gui/PIL/temp.py | 2 | """
display all images in a directory as thumbnail image buttons that display
the full image when clicked; requires PIL for JPEGs and thumbnail image
creation; to do: add scrolling if too many thumbs for window!
"""
import os, sys, math
from tkinter import *
from PIL import Image # <== req... |
jandersson/website | refs/heads/master | lib/werkzeug/contrib/testtools.py | 365 | # -*- coding: utf-8 -*-
"""
werkzeug.contrib.testtools
~~~~~~~~~~~~~~~~~~~~~~~~~~
This module implements extended wrappers for simplified testing.
`TestResponse`
A response wrapper which adds various cached attributes for
simplified assertions on various content types.
:copyright:... |
yukoba/sympy | refs/heads/master | examples/intermediate/mplot3d.py | 93 | #!/usr/bin/env python
"""Matplotlib 3D plotting example
Demonstrates plotting with matplotlib.
"""
import sys
from sample import sample
from sympy import sin, Symbol
from sympy.external import import_module
def mplot3d(f, var1, var2, show=True):
"""
Plot a 3d function using matplotlib/Tk.
"""
im... |
sbussetti/django-rq | refs/heads/master | django_rq/admin.py | 7 | from django.contrib import admin
from django_rq import settings
if settings.SHOW_ADMIN_LINK:
admin.site.index_template = 'django_rq/index.html' |
deot95/Tesis | refs/heads/master | Proyecto de Grado Ingeniería Electrónica/Workspace/Comparison/Full SWMM/ddpg.py | 1 | import linear_env
import sim_env
from actor import Actor
from critic import Critic
from replay_buffer import ReplayBuffer
import numpy as np
import tensorflow as tf
import keras.backend as kbck
import json
import time
import argparse
import matplotlib.pylab as plt
import os.path
def ou(x, mu, theta, sigma):
return ... |
aifil/odoo | refs/heads/8.0 | openerp/report/render/rml2txt/rml2txt.py | 49 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import sys
import StringIO
from lxml import etree
import utils
Font_size= 10.0
def verbose(text):
sys.stderr.write(text+"\n")
class textbox(object):
"""A box containing plain text.
... |
mkrupcale/ansible | refs/heads/devel | lib/ansible/modules/network/openvswitch_bridge.py | 16 | #!/usr/bin/python
#coding: utf-8 -*-
# (c) 2013, David Stygstra <david.stygstra@gmail.com>
#
# Portions copyright @ 2015 VMware, Inc.
#
# This file is part of Ansible
#
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Fre... |
dvliman/jaikuengine | refs/heads/master | .google_appengine/lib/django-1.4/django/contrib/markup/templatetags/markup.py | 65 | """
Set of "markup" template filters for Django. These filters transform plain text
markup syntaxes to HTML; currently there is support for:
* Textile, which requires the PyTextile library available at
http://loopcore.com/python-textile/
* Markdown, which requires the Python-markdown library from
... |
robotichead/NearBeach | refs/heads/development-0.28.8 | NearBeach/migrations/0009_auto_20210506_1925.py | 1 | # Generated by Django 3.1.2 on 2021-05-06 09:25
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('NearBeach', '0008_auto_20210424_2333'),
]
operations = [
migrations.AlterField(
model_name='project',
name='project_... |
elijah513/django | refs/heads/master | tests/get_earliest_or_latest/tests.py | 326 | from __future__ import unicode_literals
from datetime import datetime
from django.test import TestCase
from .models import Article, IndexErrorArticle, Person
class EarliestOrLatestTests(TestCase):
"""Tests for the earliest() and latest() objects methods"""
def tearDown(self):
"""Makes sure Article... |
pigeonflight/strider-plone | refs/heads/master | docker/appengine/google/appengine/api/channel/__init__.py | 27 | #!/usr/bin/env python
#
# Copyright 2007 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 o... |
nin042/phantomjs | refs/heads/master | src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/steps/closebugforlanddiff_unittest.py | 122 | # Copyright (C) 2009 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 f... |
sangwook236/SWL | refs/heads/master | python/test/machine_learning/tensorflow/run_mnist_cnn.py | 2 | #!/usr/bin/env python
# Path to libcudnn.so.
#export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH
#--------------------
import os, sys
if 'posix' == os.name:
swl_python_home_dir_path = '/home/sangwook/work/SWL_github/python'
lib_home_dir_path = '/home/sangwook/lib_repo/python'
else:
swl_python_home_dir_p... |
wisechengyi/pants | refs/heads/master | src/python/pants/__main__.py | 6 | # Copyright 2019 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from pants.bin import pants_loader
if __name__ == "__main__":
pants_loader.main()
|
Mistobaan/tensorflow | refs/heads/master | tensorflow/tools/git/gen_git_source.py | 9 | #!/usr/bin/env python
# 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
#
# Unle... |
mineo/python-musicbrainz2 | refs/heads/master | examples/getartist.py | 1 | #! /usr/bin/env python
#
# Retrieve an artist by ID and display all official albums.
#
# Usage:
# python getartist.py artist-id
#
# $Id$
#
import sys
import logging
import musicbrainz2.webservice as ws
import musicbrainz2.model as m
logging.basicConfig()
logger = logging.getLogger()
logger.setLevel(logging.DEBUG)
if... |
bcornwellmott/erpnext | refs/heads/develop | erpnext/docs/assets/img/setup/print/__init__.py | 12133432 | |
dbaxa/django | refs/heads/master | tests/contenttypes_tests/__init__.py | 12133432 | |
ferdianjovan/simple_follow | refs/heads/master | src/simple_follow/__init__.py | 12133432 | |
emakis/erpnext | refs/heads/develop | erpnext/hr/doctype/offer_term/__init__.py | 12133432 | |
abhikumar22/MYBLOG | refs/heads/master | blg/Lib/site-packages/pip/_vendor/colorama/ansitowin32.py | 450 | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
import re
import sys
import os
from .ansi import AnsiFore, AnsiBack, AnsiStyle, Style
from .winterm import WinTerm, WinColor, WinStyle
from .win32 import windll, winapi_test
winterm = None
if windll is not None:
winterm = WinTerm()
def ... |
bpyoung92/apprtc | refs/heads/master | build/build_app_engine_package.py | 1 | #!/usr/bin/python
"""Build App Engine source package.
"""
import json
import optparse
import os
import shutil
import subprocess
import sys
import requests
import test_file_herder
USAGE = """%prog src_path dest_path
Build the GAE source code package.
src_path Path to the source code root directory.
dest_path ... |
haylesr/angr | refs/heads/master | angr/analyses/ddg.py | 1 | import logging
from collections import defaultdict
import networkx
from simuvex import SimRegisterVariable, SimMemoryVariable
from simuvex import SimSolverModeError
from ..errors import AngrDDGError
from ..analysis import Analysis, register_analysis
from .code_location import CodeLocation
l = logging.getLogger("ang... |
googleapis/googleapis-gen | refs/heads/master | google/appengine/v1/google-cloud-appengine-v1-py/google/cloud/appengine_admin_v1/types/location.py | 1 | # -*- coding: utf-8 -*-
# Copyright 2020 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... |
mancoast/CPythonPyc_test | refs/heads/master | fail/322_test_modulefinder.py | 59 | import __future__
import os
import unittest
import distutils.dir_util
import tempfile
from test import support
import modulefinder
TEST_DIR = tempfile.mkdtemp()
TEST_PATH = [TEST_DIR, os.path.dirname(__future__.__file__)]
# Each test description is a list of 5 items:
#
# 1. a module name that will be imported by mo... |
TDAbboud/micropython | refs/heads/master | tests/basics/frozenset_binop.py | 41 | try:
frozenset
except NameError:
print("SKIP")
raise SystemExit
sets = [
frozenset(), frozenset({1}), frozenset({1, 2}), frozenset({1, 2, 3}), frozenset({2, 3}),
frozenset({2, 3, 5}), frozenset({5}), frozenset({7})
]
for s in sets:
for t in sets:
print(sorted(s), '|', sorted(t), '=', so... |
WeblateOrg/weblate | refs/heads/main | weblate/trans/defines.py | 2 | #
# Copyright © 2012 - 2021 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <https://weblate.org/>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Lice... |
wldcordeiro/servo | refs/heads/master | tests/wpt/css-tests/tools/manifest/vcs.py | 287 | import os
import subprocess
def get_git_func(repo_path):
def git(cmd, *args):
full_cmd = ["git", cmd] + list(args)
return subprocess.check_output(full_cmd, cwd=repo_path, stderr=subprocess.STDOUT)
return git
def is_git_repo(tests_root):
return os.path.exists(os.path.join(tests_root, ".git... |
ProfessorX/Config | refs/heads/master | .PyCharm30/system/python_stubs/-1247972723/gtk/_gtk/RecentChooserError.py | 1 | # encoding: utf-8
# module gtk._gtk
# from /usr/lib/python2.7/dist-packages/gtk-2.0/gtk/_gtk.so
# by generator 1.135
# no doc
# imports
import atk as __atk
import gio as __gio
import gobject as __gobject
import gobject._gobject as __gobject__gobject
class RecentChooserError(__gobject.GEnum):
# no doc
def __i... |
Mistobaan/tensorflow | refs/heads/master | tensorflow/python/profiler/tfprof_logger_test.py | 52 | # 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... |
Intel-tensorflow/tensorflow | refs/heads/master | tensorflow/python/debug/examples/v1/debug_errors.py | 22 | # 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... |
yhoshino11/pytest_example | refs/heads/master | .tox/flake8/lib/python2.7/site-packages/setuptools/tests/test_upload_docs.py | 151 | import os
import zipfile
import contextlib
import pytest
from setuptools.command.upload_docs import upload_docs
from setuptools.dist import Distribution
from .textwrap import DALS
from . import contexts
SETUP_PY = DALS(
"""
from setuptools import setup
setup(name='foo')
""")
@pytest.fixture
def ... |
ccomb/OpenUpgrade | refs/heads/master | addons/account/test/test_parent_structure.py | 432 | # -*- 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... |
hefen1/chromium | refs/heads/master | tools/telemetry/telemetry/user_story/user_story_filter_unittest.py | 12 | # 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 unittest
from telemetry.user_story import user_story_filter
from telemetry.page import page
from telemetry.page import page_set
class MockUrlFilter... |
nijx/hypertable | refs/heads/master | src/cc/HyperPython/tests/writer.py | 3 | import sys
import time
import libHyperPython
from hypertable.thriftclient import *
from hyperthrift.gen.ttypes import *
try:
client = ThriftClient("localhost", 38080)
print "SerializedCellsWriter example"
namespace = client.namespace_open("test")
client.hql_query(namespace, "drop table if exists thrift_test")... |
wdmchaft/taskcoach | refs/heads/master | taskcoachlib/config/options.py | 1 | '''
Task Coach - Your friendly task manager
Copyright (C) 2004-2010 Task Coach developers <developers@taskcoach.org>
Task Coach 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
... |
windyuuy/opera | refs/heads/master | chromium/src/tools/gyp/test/cxxflags/gyptest-cxxflags.py | 142 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies build of an executable with C++ define specified by a gyp define, and
the use of the environment during regeneration when the g... |
ee08b397/dpark | refs/heads/master | dpark/moosefs/master.py | 2 | import os
import socket
import threading
import Queue
import time
import struct
import logging
from consts import *
from utils import *
logger = logging.getLogger(__name__)
# mfsmaster need to been patched with dcache
ENABLE_DCACHE = False
class StatInfo:
def __init__(self, totalspace, availspace, trashspace,
... |
andmos/ansible | refs/heads/devel | lib/ansible/modules/network/layer3/__init__.py | 12133432 | |
zhouzhenghui/python-for-android | refs/heads/master | python-build/python-libs/gdata/tests/gdata_tests/calendar/__init__.py | 12133432 | |
campbe13/openhatch | refs/heads/master | vendor/packages/Django/tests/regressiontests/generic_relations_regress/__init__.py | 12133432 | |
streettraffic/streettraffic | refs/heads/develop | server_multiple_cities.py | 1 | ## import system module
import json
import rethinkdb as r
import time
import datetime as dt
import asyncio
## import custom module
from main_program.map_resource.utility import Utility
from main_program.database import TrafficData
from main_program import tools
from main_program.server import TrafficServer
class Test... |
chemfiles/chemfiles | refs/heads/master | tests/lints/check-capi-docs.py | 1 | #!/usr/bin/env python
# -*- coding: utf8 -*-
"""
A small script checking that all the C API functions are documented, and have
an example.
"""
from __future__ import print_function
import os
import sys
import codecs
ROOT = os.path.join(os.path.dirname(__file__), "..", "..")
ERRORS = 0
def error(message):
global ... |
Minjung/pysap | refs/heads/master | examples/ms_listener.py | 3 | #!/usr/bin/env python
# ===========
# pysap - Python library for crafting SAP's network protocols packets
#
# Copyright (C) 2015 by Martin Gallo, Core Security
#
# The library was designed and developed by Martin Gallo from the Security
# Consulting Services team of Core Security.
#
# This program is free software; you... |
hhatto/gruffy | refs/heads/master | test/test_stacked_bar.py | 1 | from gruffy import StackedBar
import os
from unittest import TestCase, main
from gruffy import StackedArea
TARGET_FILE = 'test.png'
class TestStackedBar(TestCase):
def tearDown(self):
os.remove(TARGET_FILE)
def test_writable(self):
g = StackedBar()
g.data("test1", [1, 2, 3])
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.