repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
richardliaw/ray | refs/heads/master | python/ray/internal/internal_api.py | 2 | import ray.worker
from ray import profiling
__all__ = ["free", "global_gc"]
def global_gc():
"""Trigger gc.collect() on all workers in the cluster."""
worker = ray.worker.global_worker
worker.core_worker.global_gc()
def memory_summary():
"""Returns a formatted string describing memory usage in the... |
henry808/euler | refs/heads/master | 035/test_035.py | 1 | from eul035 import are_rotations_primes
def test_are_rotations_primes():
# fails on 5 by design
inputs_true = [3, 7, 11, 13, 17, 31, 37, 71, 73, 79, 97]
inputs_false = [4, 6, 8, 9, 10, 19, 23, 29]
for i in inputs_true:
assert(are_rotations_primes(i) is True)
for i in inputs_false:
... |
hckiang/DBLite | refs/heads/master | boost_1_54_0/libs/python/test/args.py | 46 | # Copyright David Abrahams 2004. Distributed under 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 args_ext import *
>>> raw(3, 4, foo = 'bar', baz = 42)
((3, 4), {'foo': 'bar', 'baz': 42})
Prove that we can handle em... |
mpeters/ansible | refs/heads/devel | v2/ansible/playbook/vars.py | 7690 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... |
YoungKwonJo/mlxtend | refs/heads/master | tests/tests_regression/test_linear_regression.py | 1 | from mlxtend.regression import LinearRegression
from mlxtend.data import iris_data
import numpy as np
from numpy.testing import assert_almost_equal
def test_univariate_normal_equation():
X = np.array([ 1, 2, 3, 4, 5])[:, np.newaxis]
y = np.array([ 1, 2, 3, 4, 5])
ne_lr = LinearRegression(solver='normal_equ... |
illfelder/compute-image-packages | refs/heads/master | packages/python-google-compute-engine/google_compute_engine/instance_setup/instance_config.py | 6 | #!/usr/bin/python
# Copyright 2016 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 by appli... |
ssh-odoo/scrapy | refs/heads/master | scrapy/core/spidermw.py | 80 | """
Spider Middleware manager
See documentation in docs/topics/spider-middleware.rst
"""
import six
from twisted.python.failure import Failure
from scrapy.middleware import MiddlewareManager
from scrapy.utils.defer import mustbe_deferred
from scrapy.utils.conf import build_component_list
def _isiterable(possible_iter... |
jbreitbart/fast-lib | refs/heads/master | vendor/yaml-cpp/test/gmock-1.7.0/gtest/test/gtest_xml_output_unittest.py | 1815 | #!/usr/bin/env python
#
# Copyright 2006, 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... |
recursion-cn/recursion | refs/heads/master | bin/activate_this.py | 1076 | """By using execfile(this_file, dict(__file__=this_file)) you will
activate this virtualenv environment.
This can be used when you must use an existing Python interpreter, not
the virtualenv bin/python
"""
try:
__file__
except NameError:
raise AssertionError(
"You must run this like execfile('path/to/... |
jeremiahsavage/cwltool | refs/heads/master | cwltool/workflow.py | 1 | from . import job
from . import draft2tool
from .utils import aslist
from .process import Process, get_feature, empty_subtree, shortname, uniquename
from .errors import WorkflowException
import copy
import logging
import random
import os
from collections import namedtuple
import functools
import schema_salad.validate a... |
hogarthj/ansible | refs/heads/devel | test/units/modules/remote_management/oneview/test_oneview_fcoe_network_facts.py | 77 | # Copyright (c) 2016-2017 Hewlett Packard Enterprise Development LP
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from ansible.compat.tests import unittest
from oneview_module_loader import FcoeNetworkFactsModule
from hpe_test_utils import FactsParamsTestCase
ERROR_MSG... |
ptrendx/mxnet | refs/heads/master | python/mxnet/initializer.py | 1 | # 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... |
go-bears/nupic | refs/heads/master | src/nupic/frameworks/opf/common_models/cluster_params.py | 15 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2015, Numenta, Inc. Unless you have purchased from
# Numenta, Inc. a separate commercial license for this software code, the
# following terms and conditions apply:
#
# This pro... |
williamHuang5468/StockServer | refs/heads/master | stockserver/views.py | 1 | from flask import jsonify, render_template, request, Response, session
from stockserver import app
import uuid
import hashlib
import sqlcommand as sql
# register done
# login
# logout
@app.route("/")
def index():
user = {'nickname': 'Guest'}
return render_template('index.html', title="Home", user=user)
# rep... |
mrquim/repository.mrquim | refs/heads/master | script.module.livestreamer/lib/livestreamer/stream/rtmpdump.py | 37 | import re
from time import sleep
from .streamprocess import StreamProcess
from ..compat import str
from ..exceptions import StreamError
from ..packages import pbs as sh
from ..utils import rtmpparse
class RTMPStream(StreamProcess):
"""RTMP stream using rtmpdump.
*Attributes:*
- :attr:`params` A :class... |
hurrinico/stock-logistics-workflow | refs/heads/8.0 | __unported__/stock_filter_none_zero_qty/product.py | 23 | # -*- coding: utf-8 -*-
#############################################################################
#
# Copyright (c) 2010-2012, OPENTIA Group (<http://opentia.com>)
# The word "OPENTIA" is an European Community Trademark property
# of the Opentia Group
#
# @author: Opentia "Happy Hacking" Team
# @e-ma... |
Thoshh/wapad | refs/heads/master | lib/python2.7/site-packages/pip/commands/show.py | 142 | from __future__ import absolute_import
from email.parser import FeedParser
import logging
import os
from pip.basecommand import Command
from pip.status_codes import SUCCESS, ERROR
from pip._vendor import pkg_resources
logger = logging.getLogger(__name__)
class ShowCommand(Command):
"""Show information about o... |
swoop-inc/graflux | refs/heads/master | graflux/metric_index.py | 1 | import json
import weakref
import re
GRAPHITE_GLOB_REGEX = re.compile('\*|{')
# TODO there are some dumb things done in here, could be faster
class MetricNode(object):
__slots__ = ['parent', 'children', '__weakref__']
def __init__(self, parent):
# weakref here as python's circular reference finder ... |
raskolnikova/infomaps | refs/heads/master | node_modules/node-gyp/gyp/tools/pretty_sln.py | 1831 | #!/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.
"""Prints the information in a sln file in a diffable way.
It first outputs each projects in alphabetical order with their
dependenci... |
mydongistiny/external_chromium_org | refs/heads/benzo | third_party/protobuf/python/google/protobuf/internal/enum_type_wrapper.py | 292 | # Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions o... |
tranlyvu/find-link | refs/heads/master | wikilink/__init__.py | 1 | """
wikilink
~~~~~~~~
wikilink is a multiprocessing web-scraping application to scrape wiki pages and
find minimum number of links between two given wiki pages.
:copyright: (c) 2016 - 2019 by Tran Ly VU. All Rights Reserved.
:license: Apache License 2.0.
"""
from .wiki_link import WikiLink
n... |
RachaelT/UTDchess-RospyXbee | refs/heads/master | src/FullChess/src/ROS_Templates/PID_Template.py | 1 | #!/usr/bin/env python
import rospy
import tf
import math
from geometry_msgs.msg import PointStamped
from chessbot.msg import RobCMD
import time
import struct
import binascii
import thread
#this gives the transform listener thesub correct frame subscription for every node
NAME = rospy.get_namespace()
NAME = NAME[1:(l... |
CopeX/odoo | refs/heads/8.0 | openerp/cli/deploy.py | 369 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import os
import requests
import sys
import tempfile
import zipfile
from . import Command
class Deploy(Command):
"""Deploy a module on an Odoo instance"""
def __init__(self):
super(Deploy, self).__init__()
self.session = requests.se... |
studio666/cjdns | refs/heads/master | node_build/dependencies/libuv/build/gyp/test/generator-output/gyptest-rules.py | 198 | #!/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 --generator-output= behavior when using rules.
"""
import TestGyp
# Android doesn't support --generator-output.
test = TestGy... |
overtherain/scriptfile | refs/heads/master | software/googleAppEngine/lib/django_1_3/django/contrib/gis/db/backends/mysql/operations.py | 312 | from django.db.backends.mysql.base import DatabaseOperations
from django.contrib.gis.db.backends.adapter import WKTAdapter
from django.contrib.gis.db.backends.base import BaseSpatialOperations
class MySQLOperations(DatabaseOperations, BaseSpatialOperations):
compiler_module = 'django.contrib.gis.db.models.sql.co... |
Sbalbp/DIRAC | refs/heads/integration | WorkloadManagementSystem/DB/__init__.py | 18 | ############################################################
# $HeadURL$
############################################################
"""
DIRAC.WorkloadManagementSystem.DB package
"""
__RCSID__ = "$Id$"
|
t2m-foxfone/android_kernel_msm | refs/heads/foxfone-one-lollipop | tools/perf/scripts/python/sctop.py | 11180 | # system call top
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Periodically displays system-wide system call totals, broken down by
# syscall. If a [comm] arg is specified, only syscalls called by
# [comm] are displayed. If an [interval] arg is specified,... |
nwokeo/supysonic | refs/heads/master | venv/lib/python2.7/site-packages/PIL/XpmImagePlugin.py | 16 | #
# The Python Imaging Library.
# $Id$
#
# XPM File handling
#
# History:
# 1996-12-29 fl Created
# 2001-02-17 fl Use 're' instead of 'regex' (Python 2.1) (0.7)
#
# Copyright (c) Secret Labs AB 1997-2001.
# Copyright (c) Fredrik Lundh 1996-2001.
#
# See the README file for information on usage and redistribution.
#... |
blablack/deteriorate-lv2 | refs/heads/master | waflib/extras/run_r_script.py | 51 | #!/usr/bin/env python
# encoding: utf-8
# Hans-Martin von Gaudecker, 2012
"""
Run a R script in the directory specified by **ctx.bldnode**.
For error-catching purposes, keep an own log-file that is destroyed if the
task finished without error. If not, it will show up as rscript_[index].log
in the bldnode directory.
... |
infyponics/infyponics | refs/heads/master | bson/__init__.py | 14 | # Copyright 2009-2015 MongoDB, 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 writin... |
inares/edx-platform | refs/heads/inares_sass | lms/djangoapps/courseware/tests/test_group_access.py | 77 | """
This module defines tests for courseware.access that are specific to group
access control rules.
"""
import ddt
from nose.plugins.attrib import attr
from stevedore.extension import Extension, ExtensionManager
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.fac... |
openhatch/oh-mainline | refs/heads/master | vendor/packages/django-extensions/django_extensions/utils/text.py | 46 | from django.utils.encoding import force_unicode
from django.utils.functional import allow_lazy
def truncate_letters(s, num):
""" truncates a string to a number of letters, similar to truncate_words """
s = force_unicode(s)
length = int(num)
if len(s) > length:
s = s[:length]
if not s.e... |
ericvandenbergfb/spark | refs/heads/master | examples/src/main/python/ml/index_to_string_example.py | 123 | #
# 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... |
matrixise/odoo | refs/heads/8.0 | addons/note/tests/test_note.py | 427 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2013-TODAY OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... |
2ndQuadrant/ansible | refs/heads/master | test/integration/targets/module_utils/module_utils/spam3/ham/bacon.py | 298 | data = 'spam3'
|
abhinavsingh/proxy.py | refs/heads/develop | proxy/testing/test_case.py | 1 | # -*- coding: utf-8 -*-
"""
proxy.py
~~~~~~~~
⚡⚡⚡ Fast, Lightweight, Pluggable, TLS interception capable proxy server focused on
Network monitoring, controls & Application development, testing, debugging.
:copyright: (c) 2013-present by Abhinav Singh and contributors.
:license: BSD, see LICENSE... |
motion2015/edx-platform | refs/heads/master | lms/djangoapps/branding/models.py | 84 | """
Model used by Video module for Branding configuration.
Includes:
BrandingInfoConfig: A ConfigurationModel for managing how Video Module will
use Branding.
"""
import json
from django.db.models import TextField
from django.core.exceptions import ValidationError
from config_models.models import Configura... |
yencarnacion/jaikuengine | refs/heads/master | .google_appengine/lib/django-0.96/django/db/models/related.py | 49 | class BoundRelatedObject(object):
def __init__(self, related_object, field_mapping, original):
self.relation = related_object
self.field_mappings = field_mapping[related_object.name]
def template_name(self):
raise NotImplementedError
def __repr__(self):
return repr(self.__d... |
kongseokhwan/kulcloud-iitp-neutron | refs/heads/master | neutron/api/rpc/handlers/metadata_rpc.py | 58 | # Copyright (c) 2014 OpenStack Foundation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... |
cleder/parsewkt | refs/heads/master | setup.py | 1 | from setuptools import setup, find_packages
import sys, os
from setuptools.command.test import test as TestCommand
class PyTest(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
self.test_suite = True
def run_tests(self):
#import he... |
Limags/MissionPlanner | refs/heads/master | Lib/site-packages/numpy/lib/shape_base.py | 76 | __all__ = ['column_stack','row_stack', 'dstack','array_split','split','hsplit',
'vsplit','dsplit','apply_over_axes','expand_dims',
'apply_along_axis', 'kron', 'tile', 'get_array_wrap']
import numpy.core.numeric as _nx
from numpy.core.numeric import asarray, zeros, newaxis, outer, \
concatena... |
adamdmcbride/Nufront_linux_kernel | refs/heads/master | tools/perf/python/twatch.py | 3213 | #! /usr/bin/python
# -*- python -*-
# -*- coding: utf-8 -*-
# twatch - Experimental use of the perf python interface
# Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com>
#
# This application is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License... |
divio/django | refs/heads/master | django/db/models/fields/files.py | 129 | import datetime
import os
import warnings
from django import forms
from django.core import checks
from django.core.files.base import File
from django.core.files.images import ImageFile
from django.core.files.storage import default_storage
from django.db.models import signals
from django.db.models.fields import Field
f... |
eLBati/odoo | refs/heads/master | addons/l10n_hn/__init__.py | 411 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2009-2010 Salvatore J. Trimarchi <salvatore@trimarchi.co.cc>
# (http://salvatoreweb.co.cc)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of th... |
spasovski/zamboni | refs/heads/master | mkt/stats/api.py | 2 | from django import http
import commonware
import requests
from rest_framework.exceptions import ParseError
from rest_framework.generics import ListAPIView
from rest_framework.response import Response
from rest_framework.views import APIView
from lib.metrics import get_monolith_client
import amo
from stats.models imp... |
FlaPer87/django-nonrel | refs/heads/master | tests/regressiontests/templates/templatetags/custom.py | 56 | from django import template
from django.template.defaultfilters import stringfilter
register = template.Library()
def trim(value, num):
return value[:num]
trim = stringfilter(trim)
register.filter(trim)
|
nesaro/driza | refs/heads/master | pyrqt/iuqt4/operaciones/woperaciones.py | 1 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
#Copyright (C) 2007-2008 Néstor Arocha Rodríguez
#This file is part of pyrqt.
#
#pyrqt 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 Licens... |
dgouldin/myspaceid-python-sdk | refs/heads/master | src/myspace/config/HTTPResponse.py | 1 |
class HTTPResponse(object):
headers = None
status = None
body = None
final_url = None
def __init__(self, final_url=None, status=None, headers=None, body=None):
self.final_url = final_url
self.status = status
self.headers = headers
self.body = body
... |
inventivehack/yaus | refs/heads/master | links/urls.py | 1 | from django.conf.urls import url
from .views import (
URLRedirectView
)
urlpatterns = [
url(r'^(?P<url>[-\w]+)/$', URLRedirectView.as_view(), name='redirect'),
]
|
Boussadia/weboob | refs/heads/master | modules/lolix/test.py | 3 | # -*- coding: utf-8 -*-
# Copyright(C) 2013 Bezleputh
#
# This file is part of weboob.
#
# weboob is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your opt... |
erikriver/eduIntelligent-cynin | refs/heads/master | src/ubify.coretypes/ubify/__init__.py | 25 | ###############################################################################
#cyn.in is an open source Collaborative Knowledge Management Appliance that
#enables teams to seamlessly work together on files, documents and content in
#a secure central environment.
#
#cyn.in v2 an open source appliance is distributed ... |
GDG-JSS-NOIDA/programmr | refs/heads/master | programmr/app/migrations/0012_auto_20170118_1214.py | 1 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2017-01-18 06:44
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app', '0011_merge_20170117_1701'),
]
operations = [
migrations.AddField(
... |
wavesoft/LiveQ | refs/heads/master | liveq-common/liveq/utils/ascii85.py | 1 | #Kabopan - Readable Algorithms. Public Domain, 2007-2009
"""
Ascii85 / Base85
base coder
Paul E. Rutter
"""
def char_range(start, end):
return "".join(chr(i) for i in range(ord(start), ord(end) + 1))
DIGITS = char_range("0", "9")
ASCII = char_range("\x00", "\xff")
ALPHABET = char_range("A", "Z")
ALPHABET_LOWERCAS... |
EvanK/ansible | refs/heads/devel | lib/ansible/module_utils/network/ingate/common.py | 21 | # -*- coding: utf-8 -*-
# Copyright: (c) 2018, Ingate Systems AB
# 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
try:
from ingate import ingatesdk
HAS_INGATESDK = True
except ... |
spasticVerbalizer/-tg-station | refs/heads/master | tools/mapmerge/maintloot.py | 118 | #!/usr/bin/env python3
import argparse
import collections
import re
from map_helpers import parse_map
if __name__=='__main__':
parser = argparse.ArgumentParser()
parser.add_argument("mapfile")
args = parser.parse_args()
M = parse_map(args.mapfile)
# Format of this map parsing
# dict(coordinat... |
Omegaphora/external_chromium_org | refs/heads/lp5.1 | tools/telemetry/third_party/pyserial/serial/urlhandler/protocol_rfc2217.py | 167 | #! python
#
# Python Serial Port Extension for Win32, Linux, BSD, Jython
# see ../__init__.py
#
# This is a thin wrapper to load the rfc2271 implementation.
#
# (C) 2011 Chris Liechti <cliechti@gmx.net>
# this is distributed under a free software license, see license.txt
from serial.rfc2217 import Serial
|
GaretJax/pop-utils | refs/heads/master | poputils/conf.py | 1 |
import os
from lxml import etree
def schema(name):
"""
Retrieves a schema by name from the 'schemata' directory and wraps it in an
lxml.etree.XMLSchema object.
"""
schema = os.path.join(os.path.dirname(__file__), 'schemata', name + '.xsd')
document = etree.parse(schema) # Will raise if schem... |
TeachAtTUM/edx-platform | refs/heads/master | lms/djangoapps/bulk_email/migrations/0001_initial.py | 3 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
from django.conf import settings
from opaque_keys.edx.django.models import CourseKeyField
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MO... |
nijinashok/sos | refs/heads/master | sos/plugins/insights.py | 1 | # This file is part of the sos project: https://github.com/sosreport/sos
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# version 2 of the GNU General Public License.
#
# See the LICENSE file in the source distribution ... |
nkgilley/home-assistant | refs/heads/dev | tests/testing_config/custom_components/test/alarm_control_panel.py | 18 | """
Provide a mock alarm_control_panel platform.
Call init before using it in your tests to ensure clean test data.
"""
from homeassistant.components.alarm_control_panel import AlarmControlPanelEntity
from homeassistant.components.alarm_control_panel.const import (
SUPPORT_ALARM_ARM_AWAY,
SUPPORT_ALARM_ARM_HOM... |
georgemarshall/django | refs/heads/master | django/contrib/gis/sitemaps/kml.py | 101 | from django.apps import apps
from django.contrib.gis.db.models.fields import GeometryField
from django.contrib.sitemaps import Sitemap
from django.db import models
from django.urls import reverse
class KMLSitemap(Sitemap):
"""
A minimal hook to produce KML sitemaps.
"""
geo_format = 'kml'
def __i... |
bayusantoso/final-assignment-web-ontology | refs/heads/master | IMPLEMENTATION/Application/SourceCode/GOApps/flask/Lib/functools.py | 68 | """functools.py - Tools for working with functions and callable objects
"""
# Python module wrapper for _functools C module
# to allow utilities written in Python to be added
# to the functools module.
# Written by Nick Coghlan <ncoghlan at gmail.com>,
# Raymond Hettinger <python at rcn.com>,
# and Łukasz Langa <lukasz... |
int19h/PTVS | refs/heads/master | Python/Tests/TestData/TestDiscoverer/SyntaxErrorPytest/test_syntax_error.py | 3 | def test_with_syntax_error():
for (]
|
FreeAgent/djangoappengine-starter | refs/heads/master | django/conf/urls/static.py | 156 | import re
from django.conf import settings
from django.conf.urls.defaults import patterns, url
from django.core.exceptions import ImproperlyConfigured
def static(prefix, view='django.views.static.serve', **kwargs):
"""
Helper function to return a URL pattern for serving files in debug mode.
from django.co... |
rickerc/keystone_audit | refs/heads/cis-havana-staging | keystone/openstack/common/fixture/moxstubout.py | 14 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2013 Hewlett-Packard Development Company, L.P.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "Li... |
zjutjsj1004/third | refs/heads/master | boost/tools/build/test/double_loading.py | 6 | #!/usr/bin/python
# Copyright 2003 Vladimir Prus
# Distributed under 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)
import BoostBuild
t = BoostBuild.Tester()
# Regression test for double loading of the same Jamfile.
t.... |
rowillia/buck | refs/heads/master | third-party/py/pex/pex/interpreter.py | 52 | # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
"""pex support for interacting with interpreters."""
from __future__ import absolute_import
import os
import re
import subprocess
import sys
from collections import defaultdict
from pkg... |
JetBrains/intellij-community | refs/heads/master | python/testData/inspections/PyStringFormatInspection/PercentStringWithFormatStringReplacementSymbols.py | 29 | var = "if (1 == x)\n{\n%s;\n}" % "return 0"
"%s" % <warning descr="Too few arguments for format string">()</warning> |
pierreg/tensorflow | refs/heads/master | tensorflow/python/kernel_tests/scan_ops_test.py | 21 | # 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... |
rohitwaghchaure/erpnext_smart | refs/heads/develop | erpnext/support/doctype/maintenance_schedule_detail/maintenance_schedule_detail.py | 41 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class MaintenanceScheduleDetail(Document):
pass |
googleapis/googleapis-gen | refs/heads/master | google/cloud/orchestration/airflow/service/v1/airflow-service-v1-py/tests/__init__.py | 951 |
# -*- 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 o... |
trachelr/mne-python | refs/heads/master | mne/io/bti/read.py | 10 | # Authors: Denis A. Engemann <denis.engemann@gmail.com>
# simplified BSD-3 license
import struct
import numpy as np
from ...externals.six import b
def _unpack_matrix(fid, fmt, rows, cols, dtype):
""" Aux Function """
out = np.zeros((rows, cols), dtype=dtype)
bsize = struct.calcsize(fmt)
str... |
rtucker-mozilla/mozilla_inventory | refs/heads/master | vendor-local/src/django-extensions/django_extensions/management/utils.py | 16 | from django.conf import settings
import os
import sys
def get_project_root():
""" get the project root directory """
settings_mod = __import__(settings.SETTINGS_MODULE, {}, {}, [''])
return os.path.dirname(os.path.abspath(settings_mod.__file__))
def _make_writeable(filename):
"""
Make sure that t... |
fhe-odoo/odoo | refs/heads/8.0 | addons/mass_mailing/tests/test_mail.py | 388 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms... |
GetSomeBlocks/Score_Soccer | refs/heads/master | resources/lib/IMDbPY/imdb/parser/common/__init__.py | 5 | """
parser.common package (imdb package).
This package provides some modules containing code shared amongst
different parsers.
Copyright 2005 Davide Alberani <da@erlug.linux.it>
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
t... |
FinnStutzenstein/OpenSlides | refs/heads/master | server/openslides/topics/__init__.py | 9 | default_app_config = "openslides.topics.apps.TopicsAppConfig"
|
crosswalk-project/blink-crosswalk | refs/heads/master | Source/bindings/scripts/interface_dependency_resolver.py | 12 | # Copyright (C) 2013 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 ... |
mattcongy/itshop | refs/heads/master | docker-images/taigav2/taiga-back/taiga/base/utils/dicts.py | 2 | # -*- coding: utf-8 -*-
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can r... |
tavaresdong/courses-notes | refs/heads/master | ucb_cs61A/homework/hw08/tests/derive-exp.py | 3 | test = {
'name': 'derive-exp',
'points': 1,
'suites': [
{
'cases': [
{
'code': r"""
scm> (derive x^2 'x)
(* 2 x)
scm> (derive x^3 'x)
(* 3 (^ x 2))
scm> (derive (make-sum x^3 x^2) 'x)
(+ (* 3 (^ x 2)) (* 2 x))
""",
... |
prampey/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/pytest/doc/en/example/costlysetup/sub1/test_quick.py | 235 |
def test_quick(setup):
pass
|
arborh/tensorflow | refs/heads/master | tensorflow/python/ops/ragged/ragged_string_ops.py | 4 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
Doveps/mono | refs/heads/master | bassist/bassist/parser/json_file/lib.py | 2 | # Copyright (c) 2015 Kurt Yoder
# See the file LICENSE for copying permission.
import logging
import os
import importlib
module_logger = logging.getLogger(__name__)
def get_parser(path):
'''For a given json file in a path, e.g. "/path/to/file.json", look for a
json file parsing module in the current path. If ... |
donami/overflow | refs/heads/master | vendor/doctrine/orm/docs/en/conf.py | 2448 | # -*- coding: utf-8 -*-
#
# Doctrine 2 ORM documentation build configuration file, created by
# sphinx-quickstart on Fri Dec 3 18:10:24 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.
... |
enovance/numeter | refs/heads/master | web-app/numeter_webapp/multiviews/views/customize/event.py | 2 | from django.http import HttpResponse
from django.shortcuts import render, get_object_or_404
from django.utils.translation import ugettext_lazy as _
from django.contrib import messages
from core.utils.decorators import login_required
from core.utils import make_page
from multiviews.models import Event
from multiviews.f... |
jostep/tensorflow | refs/heads/master | tensorflow/contrib/tensor_forest/python/kernel_tests/scatter_add_ndim_op_test.py | 114 | # 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... |
encbladexp/ansible | refs/heads/devel | lib/ansible/plugins/callback/__init__.py | 8 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... |
ayumilong/rethinkdb | refs/heads/next | external/v8_3.30.33.16/build/gyp/test/sanitize-rule-names/gyptest-sanitize-rule-names.py | 344 | #!/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.
"""
Make sure rule names with non-"normal" characters in them don't cause
broken build files. This test was originally causing broken .ninja... |
frankk00/realtor | refs/heads/master | gdata/Crypto/PublicKey/__init__.py | 273 | """Public-key encryption and signature algorithms.
Public-key encryption uses two different keys, one for encryption and
one for decryption. The encryption key can be made public, and the
decryption key is kept private. Many public-key algorithms can also
be used to sign messages, and some can *only* be used for sig... |
brianmay/karaage | refs/heads/master | karaage/people/emails.py | 2 | # Copyright 2010-2017, The University of Melbourne
# Copyright 2010-2017, Brian May
#
# This file is part of Karaage.
#
# Karaage 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... |
openhatch/new-mini-tasks | refs/heads/master | vendor/packages/Django/django/contrib/gis/tests/geoapp/feeds.py | 308 | from __future__ import absolute_import
from django.contrib.gis import feeds
from .models import City
class TestGeoRSS1(feeds.Feed):
link = '/city/'
title = 'Test GeoDjango Cities'
def items(self):
return City.objects.all()
def item_link(self, item):
return '/city/%s/' % item.pk
... |
Fusion-Rom/android_external_chromium_org | refs/heads/lp5.1 | tools/telemetry/telemetry/core/platform/linux_platform_backend_unittest.py | 27 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import unittest
from telemetry import decorators
from telemetry.core import util
from telemetry.core.platform import linux_platform_backend
class... |
ekivemark/my_device | refs/heads/master | bbp/bbp/settings.py | 1 | """
Django settings for bbp_oa project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
imp... |
koniiiik/django | refs/heads/master | django/contrib/messages/storage/cookie.py | 116 | import json
from django.conf import settings
from django.contrib.messages.storage.base import BaseStorage, Message
from django.http import SimpleCookie
from django.utils import six
from django.utils.crypto import constant_time_compare, salted_hmac
from django.utils.safestring import SafeData, mark_safe
class Message... |
fzimmermann89/pyload | refs/heads/stable | module/plugins/accounts/DebridItaliaCom.py | 1 | # -*- coding: utf-8 -*-
import re
import time
from module.plugins.internal.MultiAccount import MultiAccount
class DebridItaliaCom(MultiAccount):
__name__ = "DebridItaliaCom"
__type__ = "account"
__version__ = "0.18"
__status__ = "testing"
__config__ = [("mh_mode" , "all;listed;unliste... |
KingPsychopath/namebench | refs/heads/master | nb_third_party/dns/rdtypes/ANY/NSEC3PARAM.py | 248 | # Copyright (C) 2004-2007, 2009, 2010 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED ... |
xxsergzzxx/python-for-android | refs/heads/master | python-modules/twisted/twisted/spread/ui/tkutil.py | 81 |
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
"""Utilities for building L{PB<twisted.spread.pb>} clients with L{Tkinter}.
"""
from Tkinter import *
from tkSimpleDialog import _QueryString
from tkFileDialog import _Dialog
from twisted.spread import pb
from twisted.internet import re... |
arielrossanigo/pycamp_scheduling | refs/heads/master | example_generation.py | 1 | import json
import random
by_project_number_of_votes = {
"Programar, que es eso?": 15,
"Vis de redes neuronales": 3,
"Mirror Pypi": 12,
"Linkode": 5,
"Recordium": 6,
"Radio to podcast": 3,
"Choppycamp": 12,
"LabJM": 2,
"Pilas": 10,
"Cuentos a epub": 3,
"Web PyAr": 8,
"Mo... |
li77leprince/shadowsocks | refs/heads/master | shadowsocks/asyncdns.py | 655 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2014-2015 clowwindy
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... |
sontek/rethinkdb | refs/heads/next | test/rql_test/connections/http_support/werkzeug/testsuite/compat.py | 146 | # -*- coding: utf-8 -*-
"""
werkzeug.testsuite.compat
~~~~~~~~~~~~~~~~~~~~~~~~~
Ensure that old stuff does not break on update.
:copyright: (c) 2014 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import unittest
import warnings
from werkzeug.testsuite import WerkzeugTestCase
... |
andresailer/DIRAC | refs/heads/rel-v6r22 | Interfaces/API/test/Test_JobAPI.py | 5 | """ Basic unit tests for the Job API
"""
__RCSID__ = "$Id$"
import StringIO
from DIRAC.Interfaces.API.Job import Job
from DIRAC.Core.Utilities.ClassAd.ClassAdLight import ClassAd
def test_basicJob():
job = Job()
job.setOwner('ownerName')
job.setOwnerGroup('ownerGroup')
job.setName('jobName')
job.setJobG... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.