repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
nsharp3/OptimalAlphaShapes | refs/heads/master | FluidFuncs.py | 1 | # Nicholas Sharp - nsharp3@vt.edu
# Various 2D fluid functions and derivatives for dynamical systems problems
import numpy as np
# A a linear flow in the postive X direction
class LinearXFlow2D:
def __init__(self, vel):
self.name = 'LinearXFlow3D'
self.info = '%s: vel = %.4e'%(se... |
seblefevre/testerman | refs/heads/master | qtesterman/epydoc/checker.py | 2 | #
# objdoc: epydoc documentation completeness checker
# Edward Loper
#
# Created [01/30/01 05:18 PM]
# $Id: checker.py,v 1.1 2008/06/01 17:57:45 slefevr Exp $
#
"""
Documentation completeness checker. This module defines a single
class, C{DocChecker}, which can be used to check the that specified
classes of objects a... |
tareqalayan/ansible | refs/heads/devel | lib/ansible/modules/cloud/amazon/aws_config_aggregator.py | 31 | #!/usr/bin/python
# Copyright: (c) 2018, Aaron Smith <ajsmith10381@gmail.com>
# 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',
... |
chvrga/outdoor-explorer | refs/heads/master | java/play-1.4.4/samples-and-tests/i-am-a-developer/mechanize/_pullparser.py | 15 | """A simple "pull API" for HTML parsing, after Perl's HTML::TokeParser.
Examples
This program extracts all links from a document. It will print one
line for each link, containing the URL and the textual description
between the <A>...</A> tags:
import pullparser, sys
f = file(sys.argv[1])
p = pullparser.PullParser(f... |
lijieamd/mavlink | refs/heads/master | pymavlink/tools/mavsigloss.py | 47 | #!/usr/bin/env python
'''
show times when signal is lost
'''
import sys, time, os
from argparse import ArgumentParser
parser = ArgumentParser(description=__doc__)
parser.add_argument("--no-timestamps", dest="notimestamps", action='store_true', help="Log doesn't have timestamps")
parser.add_argument("--planner", acti... |
JorisDeRieck/Flexget | refs/heads/develop | flexget/components/sites/sites/wordpress.py | 4 | from __future__ import unicode_literals, division, absolute_import
from builtins import * # noqa pylint: disable=unused-import, redefined-builtin
from future.moves.urllib.parse import urlencode
import logging
import re
from flexget import plugin
from flexget.event import event
from flexget.plugin import PluginError
... |
craigderington/studentloan5 | refs/heads/master | studentloan5/Lib/site-packages/django/contrib/messages/storage/fallback.py | 704 | from django.contrib.messages.storage.base import BaseStorage
from django.contrib.messages.storage.cookie import CookieStorage
from django.contrib.messages.storage.session import SessionStorage
class FallbackStorage(BaseStorage):
"""
Tries to store all messages in the first backend, storing any unstored
me... |
hifly/OpenUpgrade | refs/heads/8.0 | addons/pad/__init__.py | 433 | # -*- coding: utf-8 -*-
import pad
import res_company
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
acogdev/ansible | refs/heads/devel | lib/ansible/executor/process/__init__.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... |
jkugler/ansible | refs/heads/devel | test/units/playbook/__init__.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... |
sagarduwal/programming | refs/heads/master | permutation_combination/permutation/permutation.py | 3 | def npr(n, r):
if r > n or n < 0 or r < 0:
return -1
ans = 1
for i in range(n, n - r, -1):
ans *= i
return ans
def main():
permutation = npr(15, 5)
if permutation > 0:
print(permutation)
else:
print('Invalid Input')
if __name__ == '__main__':
main()
|
jlaura/pysal | refs/heads/master | pysal/network/network.py | 5 | from collections import defaultdict, OrderedDict
import math
import os
import cPickle
import copy
import numpy as np
import pysal as ps
from pysal.weights.util import get_ids
from analysis import NetworkG, NetworkK, NetworkF
import util
__all__ = ["Network", "PointPattern", "NetworkG", "NetworkK", "NetworkF"]
clas... |
mitsuhiko/jinja2 | refs/heads/master | tests/test_utils.py | 3 | import pickle
import random
from collections import deque
from copy import copy as shallow_copy
import pytest
from markupsafe import Markup
from jinja2.utils import consume
from jinja2.utils import generate_lorem_ipsum
from jinja2.utils import LRUCache
from jinja2.utils import missing
from jinja2.utils import object_... |
Chive/cookiecutter-aldryn-addon | refs/heads/master | {{cookiecutter.repo_name}}/setup.py | 2 | # -*- coding: utf-8 -*-
from setuptools import setup, find_packages
from {{cookiecutter.package_name}} import __version__
REQUIREMENTS = []
CLASSIFIERS = [
'Development Status :: 2 - Pre-Alpha',
'Environment :: Web Environment',
'Framework :: Django',
'Intended Audience :: Developers',
'License ::... |
ombt/analytics | refs/heads/master | books/programming_in_python_3/book_examples/py31eg/make_html_skeleton.py | 2 | #!/usr/bin/env python3
# Copyright (c) 2008-11 Qtrac Ltd. All rights reserved.
# This program or 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 Free Software Foundation, either version 3 of the License, or
# (at your option) an... |
bl4ckic3/ARMSCGen | refs/heads/master | shellcodes/thumb/dupsh.py | 3 | import dup
import sh
def generate(sock=4, cmd='/bin/sh'):
"""Duplicates sock to stdin, stdout and stderr and spawns a shell
Args:
sock(int/str/reg): sock descriptor
cmd(str): executes a cmd (default: /bin/sh)
"""
sc = dup.generate(sock)
sc += sh.generate(cmd)
return sc
|
danithaca/mxnet | refs/heads/master | example/warpctc/toy_ctc.py | 15 | # pylint: disable=C0111,too-many-arguments,too-many-instance-attributes,too-many-locals,redefined-outer-name,fixme
# pylint: disable=superfluous-parens, no-member, invalid-name
from __future__ import print_function
import sys
sys.path.insert(0, "../../python")
import numpy as np
import mxnet as mx
import random
from ls... |
nikgr95/scrapy | refs/heads/master | tests/test_http_cookies.py | 94 | from six.moves.urllib.parse import urlparse
from unittest import TestCase
from scrapy.http import Request, Response
from scrapy.http.cookies import WrappedRequest, WrappedResponse
class WrappedRequestTest(TestCase):
def setUp(self):
self.request = Request("http://www.example.com/page.html",
... |
georgid/sms-tools | refs/heads/georgid-withMelodia | lectures/9-Sound-description/plots-code/spectralFlux-onsetFunction.py | 25 | import numpy as np
import matplotlib.pyplot as plt
import essentia.standard as ess
M = 1024
N = 1024
H = 512
fs = 44100
spectrum = ess.Spectrum(size=N)
window = ess.Windowing(size=M, type='hann')
flux = ess.Flux()
onsetDetection = ess.OnsetDetection(method='hfc')
x = ess.MonoLoader(filename = '../../../sounds/speech-m... |
Universal-Model-Converter/UMC3.0a | refs/heads/master | data/Python/x86/Lib/site-packages/numpy/distutils/fcompiler/sun.py | 94 | from numpy.distutils.ccompiler import simple_version_match
from numpy.distutils.fcompiler import FCompiler
compilers = ['SunFCompiler']
class SunFCompiler(FCompiler):
compiler_type = 'sun'
description = 'Sun or Forte Fortran 95 Compiler'
# ex:
# f90: Sun WorkShop 6 update 2 Fortran 95 6.2 Patch 11169... |
funkring/fdoo | refs/heads/8.0-fdoo | pygal/graph/stackedline.py | 4 | # -*- coding: utf-8 -*-
# This file is part of pygal
#
# A python svg graph plotting library
# Copyright © 2012-2014 Kozea
#
# This library is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the Free
# Software Foundation, either version... |
watspidererik/testenv | refs/heads/master | flask/lib/python2.7/site-packages/pip/_vendor/cachecontrol/heuristics.py | 22 | import calendar
from email.utils import formatdate, parsedate
from datetime import datetime, timedelta
class BaseHeuristic(object):
def warning(self):
"""
Return a valid 1xx warning header value describing the cache adjustments.
"""
return '110 - "Response is Stale"'
def up... |
JJGO/ProjectEuler | refs/heads/master | p006.py | 1 | #!/usr/bin/env python
"""
Project Euler Problem 6
=======================
The sum of the squares of the first ten natural numbers is,
1^2 + 2^2 + ... + 10^2 = 385
The square of the sum of the first ten natural numbers is,
(1 + 2 + ... + 10)^2 = 55^2 = 3025
... |
ormnv/os_final_project | refs/heads/master | django/contrib/localflavor/sk/sk_regions.py | 543 | """
Slovak regions according to http://sk.wikipedia.org/wiki/Administrat%C3%ADvne_%C4%8Dlenenie_Slovenska
"""
from django.utils.translation import ugettext_lazy as _
REGION_CHOICES = (
('BB', _('Banska Bystrica region')),
('BA', _('Bratislava region')),
('KE', _('Kosice region')),
('NR', _('Nitra regi... |
Kilhog/odoo | refs/heads/8.0 | addons/website_event_sale/models/sale_order.py | 197 | # -*- coding: utf-8 -*-
from openerp import SUPERUSER_ID
from openerp.osv import osv, fields
from openerp.tools.translate import _
import openerp.addons.decimal_precision as dp
# defined for access rules
class sale_order(osv.Model):
_inherit = "sale.order"
def _cart_find_product_line(self, cr, uid, ids, produ... |
rgreinho/molecule | refs/heads/master | test/unit/command/test_destroy.py | 1 | # Copyright (c) 2015-2016 Cisco Systems, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge... |
ganeshrn/ansible | refs/heads/devel | test/integration/targets/module_utils_urls/library/test_peercert.py | 29 | #!/usr/bin/python
# Copyright: (c) 2020, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = r'''
---
module: test_perrcert
short_description: Test getting t... |
daspecster/google-cloud-python | refs/heads/master | vision/google/cloud/vision/client.py | 1 | # Copyright 2016 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 agreed to in writing, ... |
mrry/tensorflow | refs/heads/windows | tensorflow/contrib/layers/python/layers/optimizers_test.py | 6 | # 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... |
Ashatz/bcindex | refs/heads/master | __init__.py | 1 | #-------------------------------------------------------------------------------
# Name: module1
# Purpose:
#
# Author: Andrew Shatz
#
# Created: 22/10/2014
# Copyright: (c) Andrew Shatz 2014
# Licence: <your licence>
#-------------------------------------------------------------------------------... |
sinesiobittencourt/explainshell | refs/heads/master | tests/test-integration.py | 6 | import unittest, subprocess, pymongo, os
from explainshell import manager, matcher
class test_integration(unittest.TestCase):
def test(self):
mngr = manager.manager('localhost', 'explainshell_tests', [os.path.join(os.path.dirname(__file__), 'echo.1.gz')], drop=True)
mngr.run()
cmd = 'echo... |
paran0ids0ul/infernal-twin | refs/heads/master | build/pillow/PIL/ImageSequence.py | 45 | #
# The Python Imaging Library.
# $Id$
#
# sequence support classes
#
# history:
# 1997-02-20 fl Created
#
# Copyright (c) 1997 by Secret Labs AB.
# Copyright (c) 1997 by Fredrik Lundh.
#
# See the README file for information on usage and redistribution.
#
##
class Iterator(object):
"""
This class implem... |
meteorfox/PerfKitBenchmarker | refs/heads/master | perfkitbenchmarker/linux_packages/sysbench.py | 8 | # Copyright 2014 PerfKitBenchmarker 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 appli... |
kenshay/ImageScript | refs/heads/master | ProgramData/SystemFiles/Python/Lib/site-packages/chardet/mbcharsetprober.py | 2923 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... |
DylanMcCall/Empathy---Hide-contact-groups | refs/heads/master | tools/make-version-script.py | 14 | #!/usr/bin/python
"""Construct a GNU ld or Debian dpkg version-script from a set of
RFC822-style symbol lists.
Usage:
make-version-script.py [--symbols SYMBOLS] [--unreleased-version VER]
[--dpkg "LIBRARY.so.0 LIBRARY0 #MINVER#"]
[--dpkg-build-depends-package LIBRARY-dev]
[FILES...]
Each ... |
edx/edx-enterprise | refs/heads/master | test_utils/fake_catalog_api.py | 1 | # -*- coding: utf-8 -*-
"""
Fake responses for course catalog api.
"""
import copy
from collections import OrderedDict
import mock
from six.moves import reduce as six_reduce
from test_utils import FAKE_UUIDS
FAKE_URL = 'https://fake.url'
FAKE_COURSE_RUN = {
'key': 'course-v1:edX+DemoX+Demo_Course',
'uuid':... |
renhaoqi/gem5-stable | refs/heads/master | src/cpu/testers/directedtest/RubyDirectedTester.py | 69 | # Copyright (c) 2010 Advanced Micro Devices, 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... |
weblyzard/ewrt | refs/heads/develop | src/eWRT/lib/Result.py | 1 | #!/usr/bin/env python
# Result is an item of ResultSet
from builtins import object
class Result(object):
# constructor
# @parameter id, name
def __init__(self, id, name):
self.id = id
self.name = name
# get the ID of Result
# @return Id
def getId(self):
return self.i... |
brian-l/django-1.4.10 | refs/heads/master | tests/regressiontests/custom_columns_regress/models.py | 34 | """
Regression for #9736.
Checks some pathological column naming to make sure it doesn't break
table creation or queries.
"""
from django.db import models
class Article(models.Model):
Article_ID = models.AutoField(primary_key=True, db_column='Article ID')
headline = models.CharField(max_length=100)
aut... |
kustodian/ansible | refs/heads/devel | lib/ansible/plugins/doc_fragments/acme.py | 12 | # -*- coding: utf-8 -*-
# Copyright: (c) 2016 Michael Gruener <michael.gruener@chaosmoon.net>
# 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
class ModuleDocFragment(object):
# Sta... |
fkmhrk/kiilib_python | refs/heads/master | kiilib/demo/uploadFile.py | 1 | #!/usr/bin/python
import sys
import os
# Python Tutorial 6.1.2. "The directory containing the script being run is placed at the beginning of the search path, ahead of the standard library path."
sys.path.append(sys.path[0] + "/../..")
import kiilib
from config import *
def main():
context = kiilib.KiiContext(APP_... |
Ishiihara/kafka | refs/heads/trunk | tests/kafkatest/tests/core/transactions_test.py | 6 | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... |
shamangeorge/beets | refs/heads/master | test/test_query.py | 4 | # -*- coding: utf-8 -*-
# This file is part of beets.
# Copyright 2016, Adrian Sampson.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation t... |
trondhindenes/ansible | refs/heads/devel | test/units/modules/network/edgeos/test_edgeos_config.py | 66 | #
# (c) 2018 Red Hat Inc.
#
# 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 d... |
isaachenrion/jets | refs/heads/master | src/data_ops/SupervisedDataset.py | 1 | from torch.utils.data import Dataset
class SupervisedDataset(Dataset):
def __init__(self, x, y):
super().__init__()
self.x = x
self.y = y
def shuffle(self):
perm = np.random.permutation(len(self.x))
self.x = [self.x[i] for i in perm]
self.y = [self.y[i] for i in... |
k3nnyfr/s2a_fr-nsis | refs/heads/master | s2a/Python/Lib/xml/parsers/expat.py | 230 | """Interface to the Expat non-validating XML parser."""
__version__ = '$Revision: 17640 $'
from pyexpat import *
|
ankurankan/scikit-learn | refs/heads/master | sklearn/neighbors/tests/test_kde.py | 17 | import numpy as np
from sklearn.utils.testing import (assert_allclose, assert_raises,
assert_equal)
from sklearn.neighbors import KernelDensity, KDTree, NearestNeighbors
from sklearn.neighbors.ball_tree import kernel_norm
from sklearn.pipeline import make_pipeline
from sklearn.dataset... |
filipposantovito/suds-jurko | refs/heads/master | suds/umx/core.py | 18 | # This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) GNU Lesser General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will b... |
ESS-LLP/erpnext-healthcare | refs/heads/master | erpnext/patches/v4_2/update_project_milestones.py | 121 | from __future__ import unicode_literals
import frappe
def execute():
for project in frappe.db.sql_list("select name from tabProject"):
frappe.reload_doc("projects", "doctype", "project")
p = frappe.get_doc("Project", project)
p.update_milestones_completed()
p.db_set("percent_milestones_completed", p.percent_m... |
peterfpeterson/mantid | refs/heads/master | Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/SANS/SANSLoad.py | 3 | # Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source,
# Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
# SPDX - License - Identifier: GPL - 3.0 +
# py... |
santisiri/popego | refs/heads/master | envs/ALPHA-POPEGO/lib/python2.5/site-packages/twisted/trial/test/weird.py | 82 | from twisted.trial import unittest
from twisted.internet import defer
# Used in test_tests.TestUnhandledDeferred
class TestBleeding(unittest.TestCase):
"""This test creates an unhandled Deferred and leaves it in a cycle.
The Deferred is left in a cycle so that the garbage collector won't pick it
up i... |
sinkuri256/python-for-android | refs/heads/master | python3-alpha/python3-src/Lib/encodings/cp037.py | 266 | """ Python Character Mapping Codec cp037 generated from 'MAPPINGS/VENDORS/MICSFT/EBCDIC/CP037.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,input... |
HPPTECH/hpp_IOSTressTest | refs/heads/master | IOST_0.23/Libs/IOST_WRun/IOST_WRun_StationInfo.py | 3 | #!/usr/bin/python
#======================================================================
#
# Project : hpp_IOStressTest
# File : Libs/IOST_WRun/IOST_WRun_StationInfo.py
# Date : Oct 25, 2016
# Author : HuuHoang Nguyen
# Contact : hhnguyen@apm.com
# : hoangnh.hpp@gmail.com
# License : MIT License
... |
erdc/proteus | refs/heads/cutfem_update | scripts/cobras_saj_embankment.py | 1 | #! /usr/bin/env python
from builtins import range
import math
def genPoly(polyfileBase = "cobras_saj_embankment",
lengthBousDomain = 170.0,ransDomainStop=1000.00,
ransDomainHeight = 10.0,
inflowLength = 10.0,
inflowPad = 15.0,
outflowLength= 1.0,
... |
yanheven/nova | refs/heads/master | nova/tests/unit/virt/test_block_device.py | 6 | # 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 applicable law or agreed to in... |
adcentury/electron | refs/heads/master | script/upload-checksums.py | 131 | #!/usr/bin/env python
import argparse
import hashlib
import os
import tempfile
from lib.config import s3_config
from lib.util import download, rm_rf, s3put
DIST_URL = 'https://atom.io/download/atom-shell/'
def main():
args = parse_args()
url = DIST_URL + args.version + '/'
directory, files = download_files... |
B-MOOC/edx-platform | refs/heads/master | common/lib/xmodule/xmodule/fields.py | 144 | import time
import logging
import re
from xblock.fields import JSONField
import datetime
import dateutil.parser
from pytz import UTC
log = logging.getLogger(__name__)
class Date(JSONField):
'''
Date fields know how to parse and produce json (iso) compatible formats. Converts to tz aware datetimes.
'''
... |
40223125/w16btest1 | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/site-packages/spur.py | 291 | #coding: utf-8
import math
# 導入數學函式後, 圓周率為 pi
# deg 為角度轉為徑度的轉換因子
deg = math.pi/180.
class Spur(object):
def __init__(self, ctx):
self.ctx = ctx
def create_line(self, x1, y1, x2, y2, width=3, fill="red"):
self.ctx.beginPath()
self.ctx.lineWidth = width
self.ctx.moveTo(x1, y1)
... |
stvstnfrd/edx-platform | refs/heads/master | openedx/core/djangoapps/oauth_dispatch/tests/test_dot_overrides.py | 1 | """
Test of custom django-oauth-toolkit behavior
"""
# pylint: disable=protected-access
import datetime
import unittest
from django.conf import settings
from django.contrib.auth.models import User # lint-amnesty, pylint: disable=imported-auth-user
from django.test import RequestFactory, TestCase
from django.utils ... |
saeki-masaki/glance | refs/heads/master | glance/tests/unit/v2/test_registry_client.py | 7 | # Copyright 2013 Red Hat, 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... |
alex/boto | refs/heads/develop | tests/unit/cloudsearch2/test_search.py | 114 | #!/usr/bin env python
from boto.cloudsearch2.domain import Domain
from boto.cloudsearch2.layer1 import CloudSearchConnection
from tests.compat import mock, unittest
from httpretty import HTTPretty
import json
from boto.cloudsearch2.search import SearchConnection, SearchServiceException
from boto.compat import six, m... |
satoshinm/NetCraft | refs/heads/master | server.py | 1 | #!/usr/bin/env python
#
import sys, time, socket, re
from math import floor
from world import World
import Queue
import SocketServer
import datetime
import random
import requests
import sqlite3
import threading
import traceback
DEFAULT_HOST = '0.0.0.0'
DEFAULT_PORT = 4080
DB_PATH = 'craft.db'
LOG_PATH = 'log.txt'
CH... |
czpython/aldryn-newsblog | refs/heads/master | aldryn_newsblog/migrations/0001_initial.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import taggit.managers
import aldryn_categories.fields
import aldryn_newsblog.models
import filer.fields.image
from django.conf import settings
import sortedm2m.fields
import django.utils.timezone
import djangocms_... |
wang1352083/pythontool | refs/heads/master | python-2.7.12-lib/user.py | 313 | """Hook to allow user-specified customization code to run.
As a policy, Python doesn't run user-specified code on startup of
Python programs (interactive sessions execute the script specified in
the PYTHONSTARTUP environment variable if it exists).
However, some programs or sites may find it convenient to allow users... |
glenn-edgar/local_controller_3 | refs/heads/master | __backup__/flask_web/werkzeug-master/docs/makearchive.py | 50 | import os
import conf
name = "werkzeug-docs-" + conf.version
os.chdir("_build")
os.rename("html", name)
os.system("tar czf %s.tar.gz %s" % (name, name))
os.rename(name, "html")
|
nicobustillos/odoo | refs/heads/8.0 | addons/website_google_map/controllers/main.py | 161 | # -*- coding: utf-8 -*-
import json
from openerp import SUPERUSER_ID
from openerp.addons.web import http
from openerp.addons.web.http import request
class google_map(http.Controller):
'''
This class generates on-the-fly partner maps that can be reused in every
website page. To do so, just use an ``<ifram... |
orekyuu/intellij-community | refs/heads/master | python/testData/resolve/multiFile/moduleValueCollision/boo.py | 83 | BOO = "only kidding"
|
IsaacYangSLA/nuxeo-drive | refs/heads/master | nuxeo-drive-client/nxdrive/tests/test_security_updates.py | 1 | import time
import sys
from nxdrive.tests.common_unit_test import UnitTestCase
from nose.plugins.skip import SkipTest
class TestSecurityUpdates(UnitTestCase):
def test_synchronize_denying_read_access(self):
if sys.platform != 'win32':
raise SkipTest("WIP in https://jira.nuxeo.com/browse/NXDR... |
virt2real/linux-davinci | refs/heads/master | tools/perf/tests/attr.py | 58 | #! /usr/bin/python
import os
import sys
import glob
import optparse
import tempfile
import logging
import shutil
import ConfigParser
class Fail(Exception):
def __init__(self, test, msg):
self.msg = msg
self.test = test
def getMsg(self):
return '\'%s\' - %s' % (self.test.path, self.msg)... |
BrunaNayara/django_webapp | refs/heads/master | qa/urls.py | 1 | from django.conf.urls import patterns, url
from qa import views
urlpatterns = patterns('',
url(r'^$', views.index, name = 'index'),
)
|
staute/shinken_package | refs/heads/master | shinken/objects/satellitelink.py | 9 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2009-2014:
# Gabes Jean, naparuba@gmail.com
# Gerhard Lausser, Gerhard.Lausser@consol.de
# Gregory Starck, g.starck@gmail.com
# Hartmut Goebel, h.goebel@goebel-consult.de
#
# This file is part of Shinken.
#
# Shinken is free software: you c... |
piiswrong/mxnet | refs/heads/master | plugin/opencv/__init__.py | 61 | # 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... |
overtherain/scriptfile | refs/heads/master | software/googleAppEngine/lib/django_1_2/tests/regressiontests/forms/localflavor/nl.py | 89 | from django.contrib.localflavor.nl.forms import (NLPhoneNumberField,
NLZipCodeField, NLSoFiNumberField, NLProvinceSelect)
from utils import LocalFlavorTestCase
class NLLocalFlavorTests(LocalFlavorTestCase):
def test_NLProvinceSelect(self):
f = NLProvinceSelect()
out = u'''<select name="provin... |
autosportlabs/RaceCapture_App | refs/heads/master | autosportlabs/racecapture/views/configuration/rcp/canconfigview.py | 1 | #
# Race Capture App
#
# Copyright (C) 2014-2017 Autosport Labs
#
# This file is part of the Race Capture App
#
# This 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 ... |
texastribune/tx_salaries | refs/heads/master | tx_salaries/utils/transformers/texas_state_university.py | 1 | from . import base
from . import mixins
from datetime import date
from .. import cleaver
# --row=4
class TransformedRecord(
mixins.GenericCompensationMixin,
mixins.GenericDepartmentMixin, mixins.GenericIdentifierMixin,
mixins.GenericJobTitleMixin, mixins.GenericPersonMixin,
mixins.Me... |
40223202/2015cdb_g2 | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/xml/sax/_exceptions.py | 625 | """Different kinds of SAX Exceptions"""
#in brython the 4 lines below causes an $globals['Exception'] error
#import sys
#if sys.platform[:4] == "java":
# from java.lang import Exception
#del sys
# ===== SAXEXCEPTION =====
class SAXException(Exception):
"""Encapsulate an XML error or warning. This class can con... |
idahu29/payment-redis | refs/heads/master | manage.py | 1 | from flask_script import Server, Manager
# from flask_migrate import Migrate, MigrateCommand
from application.app import app
import logging
manager = Manager(app)
# manager.add_command("runserver", Server(host="0.0.0.0", port=5000, ssl_crt='/Users/biao/Documents/myprojects/payment-redis/myselfsigned.cer', ssl_key='/U... |
bblay/iris | refs/heads/master | docs/iris/example_tests/test_global_map.py | 3 | # (C) British Crown Copyright 2010 - 2013, Met Office
#
# This file is part of Iris.
#
# Iris is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation, either version 3 of the License, or
# (at your option) any l... |
dexterx17/nodoSocket | refs/heads/master | clients/Python-2.7.6/Demo/scripts/lpwatch.py | 10 | #! /usr/bin/env python
# Watch line printer queue(s).
# Intended for BSD 4.3 lpq.
import os
import sys
import time
DEF_PRINTER = 'psc'
DEF_DELAY = 10
def main():
delay = DEF_DELAY # XXX Use getopt() later
try:
thisuser = os.environ['LOGNAME']
except:
thisuser = os.environ['USER']
pri... |
obnoxxx/samba | refs/heads/master | buildtools/wafsamba/tests/test_bundled.py | 45 | # Copyright (C) 2012 Jelmer Vernooij <jelmer@samba.org>
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
# Thi... |
yourcelf/cmsplugin-filer | refs/heads/master | cmsplugin_filer_folder/models.py | 17 | from django.utils.translation import ugettext_lazy as _
from django.db import models
from cms.models import CMSPlugin, Page
from django.utils.translation import ugettext_lazy as _
from posixpath import join, basename, splitext, exists
from filer.fields.folder import FilerFolderField
from django.conf import settings
fro... |
LightStage-Aber/LightStage-Repo | refs/heads/master | src/sequences/spherical_gradient.py | 1 | from __future__ import division
from collections import deque
import math
import numpy as np
### Calculate X-Axis Gradient White Value.
class BaseSequenceContainer:
def __init__(self, led_vertex, x_value, index, intensity_baseline):
self.led_vertex = led_vertex
self.x_value = x_value
self.i... |
calexil/FightstickDisplay | refs/heads/master | pyglet/window/mouse.py | 1 | # ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# Copyright (c) 2008-2021 pyglet contributors
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the follo... |
pyspeckit/pyspeckit | refs/heads/master | pyspeckit/cubes/__init__.py | 8 | """
:Author: Adam Ginsburg <adam.g.ginsburg@gmail.com>
"""
from .SpectralCube import Cube,CubeStack
|
LarsFronius/ansible | refs/heads/devel | lib/ansible/modules/cloud/amazon/efs.py | 51 | #!/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... |
CyanogenMod/motorola-kernel-stingray | refs/heads/cm-10.1 | 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,... |
nikushx/AlexaUrbanDictionaryWOTD | refs/heads/master | libraries/requests/utils.py | 177 | # -*- coding: utf-8 -*-
"""
requests.utils
~~~~~~~~~~~~~~
This module provides utility functions that are used within Requests
that are also useful for external consumption.
"""
import cgi
import codecs
import collections
import io
import os
import platform
import re
import sys
import socket
import struct
import wa... |
akatsoulas/mozillians | refs/heads/master | mozillians/users/migrations/0025_auto_20171011_0859.py | 3 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0024_auto_20171011_0320'),
]
operations = [
migrations.AddField(
model_name='idpprofile',
n... |
guewen/OpenUpgrade | refs/heads/master | addons/mass_mailing/models/mail_thread.py | 65 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# 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 o... |
conan-io/conan | refs/heads/develop | conan/tools/microsoft/msbuild.py | 1 | import os
from conans.errors import ConanException
def msbuild_verbosity_cmd_line_arg(conanfile):
verbosity = conanfile.conf["tools.microsoft.msbuild:verbosity"]
if verbosity:
if verbosity not in ("Quiet", "Minimal", "Normal", "Detailed", "Diagnostic"):
raise ConanException("Unknown msbui... |
xiaojunwu/crosswalk-test-suite | refs/heads/master | wrt/wrt-securitymanu-tizen-tests/inst.xpk.py | 187 | #!/usr/bin/env python
import os
import shutil
import glob
import time
import sys
import subprocess
import string
from optparse import OptionParser, make_option
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PKG_NAME = os.path.basename(SCRIPT_DIR)
PARAMETERS = None
XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=u... |
Planigle/planigle | refs/heads/master | node_modules/angular-cli/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py | 1284 | # Copyright (c) 2013 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import collections
import copy
import hashlib
import json
import multiprocessing
import os.path
import re
import signal
import subprocess
import sys
import gyp
imp... |
unicri/edx-platform | refs/heads/master | lms/djangoapps/notification_prefs/tests.py | 137 | import json
from django.contrib.auth.models import AnonymousUser
from django.core.exceptions import PermissionDenied
from django.http import Http404
from django.test import TestCase
from django.test.client import RequestFactory
from django.test.utils import override_settings
from mock import Mock, patch
from notifica... |
geokala/cloudify-agent | refs/heads/master | system_tests/resources/ssh-agent-blueprint/plugins/mock-plugin/mock_plugin/tasks.py | 5 | #########
# Copyright (c) 2013 GigaSpaces Technologies Ltd. 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... |
pabloborrego93/edx-platform | refs/heads/master | openedx/core/djangoapps/session_inactivity_timeout/middleware.py | 228 | """
Middleware to auto-expire inactive sessions after N seconds, which is configurable in
settings.
To enable this feature, set in a settings.py:
SESSION_INACTIVITY_TIMEOUT_IN_SECS = 300
This was taken from StackOverflow (http://stackoverflow.com/questions/14830669/how-to-expire-django-session-in-5minutes)
"""
fro... |
mne-tools/mne-python | refs/heads/main | mne/utils/fetching.py | 8 | # -*- coding: utf-8 -*-
"""File downloading functions."""
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
#
# License: BSD (3-clause)
import os
import shutil
import time
from .progressbar import ProgressBar
from .numerics import hashfunc
from .misc import sizeof_fmt
from ._logging import logger, verbose
... |
kenshay/ImageScripter | refs/heads/master | ProgramData/SystemFiles/Python/Lib/site-packages/pip/_vendor/chardet/langturkishmodel.py | 269 | # -*- coding: utf-8 -*-
######################## 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... |
spark0001/spark2.1.1 | refs/heads/master | examples/src/main/python/mllib/summary_statistics_example.py | 128 | #
# 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... |
kfoss/keras | refs/heads/master | keras/models.py | 1 | from __future__ import absolute_import
from __future__ import print_function
import theano
import theano.tensor as T
import numpy as np
import warnings, time, copy
from . import optimizers
from . import objectives
from . import regularizers
from . import constraints
from . import callbacks as cbks
import time, copy, p... |
EduTechLabs/reckon | refs/heads/master | rocken_project/rocken_project/wsgi.py | 1 | """
WSGI config for rocken_project project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/dev/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANG... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.