repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
andim27/magiccamp | refs/heads/master | src/MagicCamp/datasite/admin.py | 1 | from django.contrib import admin
from MagicCamp.datasite.models import *
class ServicesAdmin(admin.ModelAdmin):
list_display = ('lng','title','season','desc','date_out','date_in','price')
search_fields = ('desc',)
list_filter = ('date_out',)
ordering = ('date_out',)
fields = ... |
sujeetv/incubator-hawq | refs/heads/master | tools/bin/ext/figleaf/annotate_cover.py | 35 | import figleaf
import os
import re
from annotate import read_exclude_patterns, filter_files, logger
def report_as_cover(coverage, exclude_patterns=[], ):
### now, output.
keys = coverage.keys()
info_dict = {}
for k in filter_files(keys):
try:
pyfile = open(k, 'rU')
... |
PascalSteger/gravimage | refs/heads/master | programs/plotting/glselect_run.py | 2 | #!/usr/bin/env ipython3
##
# @file
# select a completed or still running MCMC run for plotting
# (c) 2015 ETHZ, Pascal Steger, pascal@steger.aero
import os
import glob
import shutil
import pdb
import re
import numpy as np
import gi_base as gb
def bufcount(filename):
f = open(filename)
lines = 0
buf_siz... |
12wang3/python | refs/heads/master | kamen/0013/get_photo.py | 38 | from urllib import urlopen
from bs4 import BeautifulSoup
f = urlopen('http://tieba.baidu.com/p/2166231880').read()
#print f
s = BeautifulSoup(f)
s_imgs = s.find_all('img', pic_type='0')
#print s_img
i=1
for s_img in s_imgs:
img_url = s_img['src']
img_content = urlopen(img_url).read()
print img_url
file... |
richardnpaul/FWL-Website | refs/heads/master | lib/python2.7/site-packages/PIL/MspImagePlugin.py | 18 | #
# The Python Imaging Library.
# $Id$
#
# MSP file handling
#
# This is the format used by the Paint program in Windows 1 and 2.
#
# History:
# 95-09-05 fl Created
# 97-01-03 fl Read/write MSP images
#
# Copyright (c) Secret Labs AB 1997.
# Copyright (c) Fredrik Lundh 1995-97.
#
# See the README fi... |
airbnb/airflow | refs/heads/master | tests/dags/test_subdag.py | 5 | #
# 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... |
billonahill/heron | refs/heads/master | heron/tools/tracker/src/python/handlers/defaulthandler.py | 10 | # Copyright 2016 Twitter. 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 agree... |
atuljain/odoo | refs/heads/master | addons/event/report/report_event_registration.py | 35 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
adedayo/intellij-community | refs/heads/master | python/testData/highlighting/jython/CallableStaticMethod.py | 83 | from java.util import Collections
x = Collections.emptyList()
s = x.size()
|
j-griffith/cinder | refs/heads/master | cinder/tests/unit/test_exception.py | 3 |
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# 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... |
DropMuse/DropMuse | refs/heads/master | app/audio.py | 1 | import numpy as np
import librosa
from six.moves.urllib.request import urlretrieve
def audio_fingerprint(y):
return np.average(y ** 2) * 100
def extract_max(pitches, magnitudes, shape):
new_pitches = []
new_magnitudes = []
for i in range(0, shape[1]):
new_pitches.append(float(np.max(pitches[... |
pculture/mirocommunity-saas | refs/heads/master | mirocommunity_saas/admin/approve_reject_views.py | 1 | from functools import wraps
from django.conf import settings
from django.http import HttpResponse
from django.shortcuts import get_object_or_404
from localtv.models import Video, SiteSettings
from localtv.decorators import require_site_admin
from localtv.admin.approve_reject_views import (
approve_video as _appro... |
oliverlee/sympy | refs/heads/master | sympy/solvers/decompogen.py | 30 | from sympy.core import Function, Pow, sympify
from sympy.polys import Poly, decompose
def decompogen(f, symbol):
"""
Computes General functional decomposition of ``f``.
Given an expression ``f``, returns a list ``[f_1, f_2, ..., f_n]``,
where::
f = f_1 o f_2 o ... f_n = f_1(f_2(... f_n))... |
unaizalakain/django | refs/heads/master | django/db/migrations/graph.py | 351 | from __future__ import unicode_literals
import warnings
from collections import deque
from functools import total_ordering
from django.db.migrations.state import ProjectState
from django.utils.datastructures import OrderedSet
from django.utils.encoding import python_2_unicode_compatible
from .exceptions import Circu... |
inspyration/odoo | refs/heads/master | addons/hr_holidays/__openerp__.py | 52 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
snnn/tensorflow | refs/heads/master | tensorflow/python/tools/print_selective_registration_header_test.py | 24 | # 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... |
daemonchen/node-gyp | refs/heads/master | gyp/test/subdirectory/gyptest-top-all.py | 240 | #!/usr/bin/env python
# Copyright (c) 2009 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 building a target and a subsidiary dependent target from a
.gyp file in a subdirectory, without specifying an explicit output b... |
leiserfg/flask-restplus | refs/heads/master | tests/test_payload.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import json
import flask_restplus as restplus
from . import TestCase
class PayloadTestCase(TestCase):
def post(self, url, data):
with self.app.test_client() as client:
return client.post(url, data=json.dumps(data),
... |
blademainer/intellij-community | refs/heads/master | python/lib/Lib/site-packages/django/conf/locale/es_AR/formats.py | 232 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = r'j N Y'
TIME_FORMAT = r'H:i:s'
DATETIME_FORMAT = r'j N Y H:i:s'
YEAR_MONT... |
NamelessRom/android_external_skia | refs/heads/n-2.1 | platform_tools/android/tests/ordered_set_tests.py | 145 | #!/usr/bin/python
# Copyright 2014 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Test OrderedSet.
"""
import sys
import test_variables
import unittest
sys.path.append(test_variables.GYP_GEN_DIR)
from vars_dict_lib import OrderedSet
def cre... |
eranroz/revscoring | refs/heads/master | revscoring/datasources/tests/test_site.py | 2 | from nose.tools import eq_
from .. import site
|
AL1DEV/dieta4u | refs/heads/master | sites/all/vendor/guzzlehttp/guzzle/docs/conf.py | 233 | import sys, os
from sphinx.highlighting import lexers
from pygments.lexers.web import PhpLexer
lexers['php'] = PhpLexer(startinline=True, linenos=1)
lexers['php-annotations'] = PhpLexer(startinline=True, linenos=1)
primary_domain = 'php'
extensions = []
templates_path = ['_templates']
source_suffix = '.rst'
master_d... |
rapidpro/tracpro | refs/heads/develop | tracpro/msgs/tests/__init__.py | 37694 | from __future__ import unicode_literals
|
RafaelTorrealba/odoo | refs/heads/8.0 | addons/project/tests/test_project_base.py | 197 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2013-TODAY OpenERP S.A. <http://www.openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms... |
wangyongtan/H5 | refs/heads/master | common/test11/demo-1.py | 1 | #import urllib.request
#request = urllib.request.Request('https://zhuanlan.zhihu.com/p/20413828')
#response = urllib.request.urlopen(request)
#buff = response.read()
#html = buff.decode("utf8")
#print(html)
import re
import urllib.request
import urllib
from collections import deque
#使用队列存放url
queue = deque()
#使用vi... |
xbmc/xbmc-antiquated | refs/heads/master | lib/freetype/src/tools/docmaker/formatter.py | 515 | # Formatter (c) 2002, 2004, 2007, 2008 David Turner <david@freetype.org>
#
from sources import *
from content import *
from utils import *
# This is the base Formatter class. Its purpose is to convert
# a content processor's data into specific documents (i.e., table of
# contents, global index, and individual API... |
ESS-LLP/erpnext | refs/heads/develop | erpnext/patches/v8_0/fix_status_for_invoices_with_negative_outstanding.py | 41 | # Copyright (c) 2017, Frappe and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
for dt, status in [["Sales Invoice", "Credit Note Issued"], ["Purchase Invoice", "Debit Note Issued"]]:
invoices = frappe.db.sql("""
select... |
botstory/botstory | refs/heads/develop | botstory/ast/users.py | 2 | import logging
from .. import di
from ..integrations.mocktracker import tracker as tracker_module
logger = logging.getLogger(__name__)
@di.desc(reg=False)
class Users:
def __init__(self):
self._tracker = tracker_module.MockTracker()
@di.inject()
def add_tracker(self, tracker):
logger.deb... |
TangHao1987/intellij-community | refs/heads/master | python/testData/refactoring/move/dunderAllSingleElementTuple/before/src/a.py | 79 | __all__ = 'func',
def func():
pass
class C:
pass |
EricSB/nupic | refs/heads/master | src/nupic/research/TP10X2.py | 5 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... |
JohnGriffiths/dipy | refs/heads/master | doc/examples/reconst_gqi.py | 12 | """
===============================================
Reconstruct with Generalized Q-Sampling Imaging
===============================================
We show how to apply Generalized Q-Sampling Imaging [Yeh2010]_
to diffusion MRI datasets. You can think of GQI as an analytical version of
DSI orientation distribution fun... |
nvazquez/Turtlebots | refs/heads/master | plugins/arduino/pyfirmata/boards.py | 8 | BOARDS = {
'arduino' : {
'digital' : tuple(x for x in range(14)),
'analog' : tuple(x for x in range(6)),
'pwm' : (3, 5, 6, 9, 10, 11),
'use_ports' : True,
'disabled' : (0, 1) # Rx, Tx, Crystal
},
'arduino_mega' : {
'digital' : tuple(x for x in range(54)),
... |
rosudrag/Freemium-winner | refs/heads/master | VirtualEnvironment/Lib/site-packages/selenium/webdriver/support/abstract_event_listener.py | 71 | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... |
mr-karan/coala | refs/heads/master | tests/results/result_actions/OpenEditorActionTest.py | 11 | import os
import subprocess
import tempfile
import unittest
from coalib.results.Diff import Diff
from coalib.results.Result import Result
from coalib.results.result_actions.OpenEditorAction import OpenEditorAction
from coalib.results.result_actions.ApplyPatchAction import ApplyPatchAction
from coalib.settings.Section ... |
kenshay/ImageScript | refs/heads/master | ProgramData/SystemFiles/Python/Lib/formatter.py | 252 | """Generic output formatting.
Formatter objects transform an abstract flow of formatting events into
specific output events on writer objects. Formatters manage several stack
structures to allow various properties of a writer object to be changed and
restored; writers need not be able to handle relative changes nor an... |
ykaneko/neutron | refs/heads/bug/1198917 | neutron/tests/unit/midonet/test_midonet_lib.py | 4 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (C) 2012 Midokura Japan K.K.
# Copyright (C) 2013 Midokura PTE 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 th... |
spxtr/bazel | refs/heads/master | third_party/py/mock/tests/testpatch.py | 72 | # Copyright (C) 2007-2012 Michael Foord & the mock team
# E-mail: fuzzyman AT voidspace DOT org DOT uk
# http://www.voidspace.org.uk/python/mock/
import os
import sys
from tests import support
from tests.support import unittest2, inPy3k, SomeClass, is_instance, callable
from mock import (
NonCallableMock, Callab... |
dvarrazzo/logbook | refs/heads/master | logbook/_fallback.py | 11 | # -*- coding: utf-8 -*-
"""
logbook._fallback
~~~~~~~~~~~~~~~~~
Fallback implementations in case speedups is not around.
:copyright: (c) 2010 by Armin Ronacher, Georg Brandl.
:license: BSD, see LICENSE for more details.
"""
import threading
from itertools import count
from thread import get_ident ... |
sevein/archivematica | refs/heads/dev/mcpserver-json-workflow | src/dashboard/src/settings/test.py | 1 | from __future__ import absolute_import
from .common import *
########## IN-MEMORY TEST DATABASE
DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": ":memory:",
"USER": "",
"PASSWORD": "",
"HOST": "",
"PORT": "",
},
}
LOGGING = {
'versi... |
shubhdev/openedx | refs/heads/master | common/test/acceptance/tests/lms/test_lms_instructor_dashboard.py | 7 | # -*- coding: utf-8 -*-
"""
End-to-end tests for the LMS Instructor Dashboard.
"""
from nose.plugins.attrib import attr
from ..helpers import UniqueCourseTest, get_modal_alert, EventsTestMixin
from ...pages.common.logout import LogoutPage
from ...pages.lms.auto_auth import AutoAuthPage
from ...pages.lms.instructor_da... |
shelfworthy/django-bouncer | refs/heads/master | bouncer/admin.py | 1 | from django.contrib import admin
from .models import *
from .functions import add_invite
def send_invites(modeladmin, request, queryset):
for waitlist in queryset.filter(date_invited=None):
add_invite(waitlist.email)
send_invites.short_description = "Send invites to selected users"
class WaitListAdm... |
Centre-Alt-Rendiment-Esportiu/att | refs/heads/master | old_project/Python/win_libs/scipy/fftpack/benchmarks/bench_pseudo_diffs.py | 18 | """ Benchmark functions for fftpack.pseudo_diffs module
"""
from __future__ import division, print_function, absolute_import
import sys
from numpy import arange, sin, cos, pi, exp, tanh, sign
from numpy.testing import *
from scipy.fftpack import diff, fft, ifft, tilbert, hilbert, shift, fftfreq
def random(size):
... |
chubbymaggie/CuckooSploit | refs/heads/master | modules/signatures/DetectStackPivot.py | 6 | import subprocess
from lib.cuckoo.common.abstracts import Signature
from subprocess import Popen, PIPE
class DetectStackPivot(Signature):
name = "detect_stack_pivot"
description = "Detects a stack pivot"
severity = 3
categories = ["exploit", "rop"]
authors = ["Ilana Marcus"]
minimum = "1.2"
... |
Chris-Annin/Annin-Robot-Project | refs/heads/master | Software Source Code/setup.py | 1 | from distutils.core import setup
import py2exe, sys, os
sys.argv.append('py2exe')
setup(
options = {'py2exe': {'optimize': 2}},
windows = [{'script': "Annin Robot.py","icon_resources": [(1, "ARbot.ico")]}],
zipfile = "shared.lib",
) |
HyperloopTeam/FullOpenMDAO | refs/heads/master | lib/python2.7/site-packages/requests-2.2.1-py2.7.egg/requests/packages/chardet/sjisprober.py | 1182 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... |
mudbungie/NetExplorer | refs/heads/master | env/lib/python3.4/site-packages/networkx/linalg/graphmatrix.py | 30 | """
Adjacency matrix and incidence matrix of graphs.
"""
# Copyright (C) 2004-2015 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
import networkx as nx
__author__ = "\n".join(['Aric Hagberg (hagberg@lanl.gov... |
mquandalle/rethinkdb | refs/heads/next | external/v8_3.30.33.16/build/gyp/test/actions-bare/gyptest-bare.py | 401 | #!/usr/bin/env python
# Copyright (c) 2009 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 actions which are not depended on by other targets get executed.
"""
import TestGyp
test = TestGyp.TestGyp()
test.run_gyp('b... |
kajgan/stbgui | refs/heads/master | lib/python/Components/Harddisk.py | 1 | import os
import time
from Tools.CList import CList
from SystemInfo import SystemInfo
from Components.Console import Console
from boxbranding import getBoxType, getMachineBuild
import Task
def readFile(filename):
file = open(filename)
data = file.read().strip()
file.close()
return data
def getProcMounts():
try:
... |
egenerat/flight-manager | refs/heads/master | app/test/airport/test_airport_parser.py | 2 | # -*- coding: utf-8 -*-
from app.airport.airports_parsers import get_country, get_money, get_kerosene_supply, get_kerosene_capacity, \
get_engines_supply, get_planes_capacity, get_airport_name
from app.common.http_methods_unittests import get_request
from app.common.target_urls import MY_AIRPORT
import unittest
... |
ourren/pyspider | refs/heads/master | pyspider/libs/base_handler.py | 51 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8:
# Author: Binux<i@binux.me>
# http://binux.me
# Created on 2014-02-16 23:12:48
import sys
import inspect
import functools
import fractions
import six
from six import add_metaclass, iteritems
from pyspider.libs.ur... |
vijaysbhat/incubator-airflow | refs/heads/master | tests/www/api/experimental/__init__.py | 880 | # -*- coding: utf-8 -*-
#
# 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, software
... |
Lessica/StatusHub | refs/heads/master | hello_app/admin.py | 1 | from django.contrib import admin
from hello_app.models import *
# Register your models here.
class SiteConfigCategoryAdmin(admin.ModelAdmin):
list_display = ('name', 'description', 'created_at')
admin.site.register(SiteConfigCategoryModel, SiteConfigCategoryAdmin)
class SiteConfigAdmin(admin.ModelAdmin):
l... |
p0psicles/SickGear | refs/heads/master | lib/guessit/transfo/guess_bonus_features.py | 21 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
#
# GuessIt - A library for guessing information from filenames
# Copyright (c) 2012 Nicolas Wack <wackou@gmail.com>
#
# GuessIt is free software; you can redistribute it and/or modify it under
# the terms of the Lesser GNU General Public License as published by
# the Free... |
Busybee-io/django-oscar-stripe | refs/heads/master | oscar_stripe/apps/shipping/methods.py | 1 | from decimal import Decimal as D
from django.utils.translation import ugettext_lazy as _
from .base import Base
class Free(Base):
code = 'pick-up'
name = _('Pick up from Busybee')
is_tax_known = True
charge_incl_tax = charge_excl_tax = D('0.00')
class NoShippingRequired(Free):
"""
This is a... |
poojavade/Genomics_Docker | refs/heads/master | Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/apache_libcloud-0.15.1-py2.7.egg/libcloud/common/abiquo.py | 4 | # 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 ... |
steelman/systemd | refs/heads/master | tools/xml_helper.py | 119 | # -*- Mode: python; coding: utf-8; indent-tabs-mode: nil -*- */
#
# This file is part of systemd.
#
# Copyright 2012-2013 Zbigniew Jędrzejewski-Szmek
#
# systemd 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 Softwar... |
afaheem88/tempest_neutron | refs/heads/master | tempest/api_schema/response/compute/v2/security_group_default_rule.py | 15 | # Copyright 2014 NEC Corporation. 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 ... |
smurpheus/sneakyfloat | refs/heads/master | steamtest.py | 1 | import logging
from getpass import getpass
logging.basicConfig(format='[%(asctime)s] %(levelname)s %(name)s: %(message)s', level=logging.DEBUG)
from steam import SteamClient
from steam.enums import EResult
from steam.enums.emsg import EMsg
from steam.client.gc import GameCoordinator
client = SteamClient()
# client... |
ZhangXFeng/hadoop | refs/heads/master | share/hadoop/mapreduce1/contrib/hod/testing/testHod.py | 182 | #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 thi... |
our-city-app/oca-backend | refs/heads/master | src/rogerthat/pages/mdp.py | 1 | # -*- coding: utf-8 -*-
# Copyright 2020 Green Valley Belgium NV
#
# 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 appl... |
swent10/support-tools | refs/heads/master | googlecode-issues-exporter/github_issue_converter.py | 90 | # Copyright 2013 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 applicable law or a... |
seberg/numpy | refs/heads/ufunc-refactor-2021-normal | benchmarks/benchmarks/bench_linalg.py | 7 | from .common import Benchmark, get_squares_, get_indexes_rand, TYPES1
import numpy as np
class Eindot(Benchmark):
def setup(self):
self.a = np.arange(60000.0).reshape(150, 400)
self.ac = self.a.copy()
self.at = self.a.T
self.atc = self.a.T.copy()
self.b = np.arange(240000.... |
BurtBiel/azure-cli | refs/heads/master | src/command_modules/azure-cli-storage/azure/cli/command_modules/storage/__init__.py | 1 | #---------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
#---------------------------------------------------------------------... |
simonwydooghe/ansible | refs/heads/devel | lib/ansible/modules/cloud/xenserver/xenserver_guest.py | 11 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2018, Bojan Vitnik <bvitnik@mainstream.rs>
# 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_versi... |
MissionCriticalCloud/marvin | refs/heads/master | marvin/cloudstackAPI/createVpnConnection.py | 1 | """Create site to site vpn connection"""
from baseCmd import *
from baseResponse import *
class createVpnConnectionCmd (baseCmd):
typeInfo = {}
def __init__(self):
self.isAsync = "true"
"""id of the customer gateway"""
"""Required"""
self.s2scustomergatewayid = None
se... |
p0cisk/Quantum-GIS | refs/heads/master | python/ext-libs/pygments/lexers/prolog.py | 25 | # -*- coding: utf-8 -*-
"""
pygments.lexers.prolog
~~~~~~~~~~~~~~~~~~~~~~
Lexers for Prolog and Prolog-like languages.
:copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, bygroups
from pyg... |
fa18swiss/LDM | refs/heads/master | colorama/winterm.py | 442 | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
from . import win32
# from wincon.h
class WinColor(object):
BLACK = 0
BLUE = 1
GREEN = 2
CYAN = 3
RED = 4
MAGENTA = 5
YELLOW = 6
GREY = 7
# from wincon.h
class WinStyle(object):
NORMAL ... |
Priya663/PI-controller-in-ns-3 | refs/heads/master | src/dsr/bindings/modulegen__gcc_ILP32.py | 34 | from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warnings.warn("exception %r in wrapper %s" % (exception, wrapper))
... |
Stavitsky/neutron | refs/heads/master | neutron/tests/unit/agent/l3/test_dvr_fip_ns.py | 13 | # Copyright (c) 2015 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 ... |
joernhees/scikit-learn | refs/heads/master | doc/sphinxext/sphinx_issues.py | 45 | # -*- coding: utf-8 -*-
"""A Sphinx extension for linking to your project's issue tracker.
Copyright 2014 Steven Loria
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, includi... |
bdaroz/the-blue-alliance | refs/heads/master | tests/test_usfirst_event_list_parser.py | 4 | import unittest2
from consts.district_type import DistrictType
from consts.event_type import EventType
from datafeeds.usfirst_event_list_parser import UsfirstEventListParser
@unittest2.skip
class TestUsfirstEventListParser(unittest2.TestCase):
def test_parse_2012(self):
with open('test_data/usfirst_html/... |
rtindru/django | refs/heads/master | tests/extra_regress/tests.py | 207 | from __future__ import unicode_literals
import datetime
from collections import OrderedDict
from django.contrib.auth.models import User
from django.test import TestCase
from .models import Order, RevisionableModel, TestObject
class ExtraRegressTests(TestCase):
def setUp(self):
self.u = User.objects.cr... |
pantsbuild/pants | refs/heads/2.6.x | src/python/pants/pantsd/pants_daemon.py | 3 | # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import annotations
import logging
import os
import sys
import time
import warnings
from pathlib import PurePath
from typing import Any
from setproctitle import setproctit... |
yukoba/sympy | refs/heads/master | sympy/functions/elementary/piecewise.py | 69 | from __future__ import print_function, division
from sympy.core import Basic, S, Function, diff, Tuple
from sympy.core.relational import Equality, Relational
from sympy.functions.elementary.miscellaneous import Max, Min
from sympy.logic.boolalg import (And, Boolean, distribute_and_over_or, Not, Or,
true, false)
fr... |
baylee/django | refs/heads/master | django/db/models/fields/related.py | 3 | from __future__ import unicode_literals
import warnings
from functools import partial
from django import forms
from django.apps import apps
from django.core import checks, exceptions
from django.db import connection, router
from django.db.backends import utils
from django.db.models import Q
from django.db.models.dele... |
hellhovnd/django | refs/heads/master | django/core/management/__init__.py | 6 | import collections
import os
import sys
from optparse import OptionParser, NO_DEFAULT
import imp
import warnings
from django.core.exceptions import ImproperlyConfigured
from django.core.management.base import BaseCommand, CommandError, handle_default_options
from django.core.management.color import color_style
from dj... |
bansalvarun/Drome | refs/heads/master | allauth/socialaccount/providers/evernote/tests.py | 59 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from allauth.socialaccount.tests import create_oauth_tests
from allauth.tests import MockedResponse
from allauth.socialaccount.providers import registry
from .provider import EvernoteProvider
class EvernoteTests(create_oauth_tests(registry.by_id(Everno... |
Pennebaker/wagtail | refs/heads/master | wagtail/wagtailadmin/urls/password_reset.py | 19 | from django.conf.urls import url
from django.contrib.auth import views as django_auth_views
from wagtail.wagtailadmin.forms import PasswordResetForm
urlpatterns = [
url(
r'^$', django_auth_views.password_reset, {
'template_name': 'wagtailadmin/account/password_reset/form.html',
'e... |
Gillu13/scipy | refs/heads/master | scipy/optimize/tests/test_trustregion.py | 105 | """
Unit tests for trust-region optimization routines.
To run it in its simplest form::
nosetests test_optimize.py
"""
from __future__ import division, print_function, absolute_import
import numpy as np
from scipy.optimize import (minimize, rosen, rosen_der, rosen_hess,
rosen_hess_prod)... |
arth-co/shoop | refs/heads/master | shoop/admin/modules/contacts/views/detail.py | 4 | # -*- coding: utf-8 -*-
# This file is part of Shoop.
#
# Copyright (c) 2012-2015, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import unicode_literals
from django.conf import settings
fr... |
lobachevzky/NLP-Project | refs/heads/master | env/lib/python2.7/site-packages/pip/_vendor/colorama/initialise.py | 474 | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
import atexit
import sys
from .ansitowin32 import AnsiToWin32
orig_stdout = sys.stdout
orig_stderr = sys.stderr
wrapped_stdout = sys.stdout
wrapped_stderr = sys.stderr
atexit_done = False
def reset_all():
AnsiToWin32(orig_stdout).rese... |
wvangeit/python-mode | refs/heads/master | pymode/libs/pylama/lint/pylama_pyflakes/__init__.py | 5 | """ Check Pyflakes. """
import sys
from os import path as op
from .. import Linter as BaseLinter
# Use local version of pyflakes
path = op.dirname(op.abspath(__file__))
sys.path.insert(0, path)
from pyflakes import checker
class Linter(BaseLinter):
""" Pyflakes code check. """
def __init__(self):
... |
alexallah/django | refs/heads/master | django/middleware/gzip.py | 85 | import re
from django.utils.cache import patch_vary_headers
from django.utils.deprecation import MiddlewareMixin
from django.utils.text import compress_sequence, compress_string
re_accepts_gzip = re.compile(r'\bgzip\b')
class GZipMiddleware(MiddlewareMixin):
"""
Compress content if the browser allows gzip c... |
dufferzafar/picard | refs/heads/master | picard/ui/options/cover.py | 1 | # -*- coding: utf-8 -*-
#
# Picard, the next-generation MusicBrainz tagger
# Copyright (C) 2006 Lukáš Lalinský
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License... |
sandrafig/addons | refs/heads/master | purchase_quotation/__openerp__.py | 1 | # -*- coding: utf-8 -*-
# © <2015> <SANDRA FIGUEROA VARELA sandrafigvar@gmail.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Purchase Quotation",
"summary": "This module modifies the existing purchase order report.",
"version": "8.0.1.0.0",
"category": "Purchase",
"a... |
Rizowski-Projects/Poo.pi | refs/heads/master | poo.py | 1 | import time
import socket
import RPi.GPIO as io
io.setmode(io.BCM)
door_pin = 23
last_status = False
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind(('localhost', 8000))
s.listen(5)
io.setup(door_pin, io.IN, pull_up_down=io.PUD_UP)
(client, address) = s.accept()
while True:
if io.input(door_pin):
... |
JurassicWordExcel/core | refs/heads/master | pyuno/demo/swriter.py | 7 | # -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# ... |
OPM/opm-common | refs/heads/master | python/tests/test_esmry.py | 6 | import unittest
import sys
import numpy as np
import datetime
from opm.io.ecl import ESmry
try:
from tests.utils import test_path
except ImportError:
from utils import test_path
class TestEclFile(unittest.TestCase):
def test_base_runs(self):
with self.assertRaises(RuntimeError):
ES... |
kawasaki2013/python-for-android-x86 | refs/heads/master | python3-alpha/python3-src/Parser/asdl.py | 47 | """An implementation of the Zephyr Abstract Syntax Definition Language.
See http://asdl.sourceforge.net/ and
http://www.cs.princeton.edu/research/techreps/TR-554-97
Only supports top level module decl, not view. I'm guessing that view
is intended to support the browser and I'm not interested in the
browser.
Changes... |
WASPACDC/hmdsm.repository | refs/heads/master | plugin.video.live.magellan-2.7.4/websocket/__init__.py | 48 | """
websocket - WebSocket client library for Python
Copyright (C) 2010 Hiroki Ohtani(liris)
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 2.1 of the License, ... |
LikeMyBread/Saylua | refs/heads/master | saylua/modules/adventure/dungeons/Dungeon.py | 1 | from saylua.modules.adventure.models.db import DungeonEntity, DungeonTile
from . import map_list
import random
class Dungeon:
def __init__(self, type="random", options=None):
# Determine our Dungeon type
if type == "random":
map_types = list(map_list.keys())
self.type = ran... |
hurricanerix/swift-inspector | refs/heads/master | swift_inspector/__init__.py | 1 | import gettext
#: Version information (major, minor, revision[, 'dev']).
version_info = (0, 0, 1)
#: Version string 'major.minor.revision'.
version = __version__ = ".".join(map(str, version_info))
gettext.install('swift_inspector')
|
rbarlow/pulp | refs/heads/master | nodes/common/pulp_node/manifest.py | 17 | # Copyright (c) 2013 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public
# License as published by the Free Software Foundation; either version
# 2 of the License (GPLv2) or (at your option) any later version.
# There is NO WARRANTY for this software, express or implied,
# including the impl... |
seawaywen/vim-config | refs/heads/master | bundle/python-mode/pymode/libs/pylama/lint/pylama_pylint/astroid/bases.py | 17 | # copyright 2003-2013 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# This file is part of astroid.
#
# astroid 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
#... |
vladmm/intellij-community | refs/heads/master | python/testData/completion/noInitForSubmodules/a.after.py | 83 | import p1
p1._ |
acmyonghua/eucalyptus | refs/heads/master | clc/eucadmin/eucadmin/generic.py | 7 | #!/usr/bin/python
#
# Copyright 2011-2012 Eucalyptus Systems, Inc.
#
# Redistribution and use of this software 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... |
moyaproject/moya | refs/heads/master | moya/tools.py | 1 | from __future__ import unicode_literals
from __future__ import print_function
from time import time
from datetime import datetime
from contextlib import contextmanager
from random import choice
from functools import reduce
from calendar import timegm
from os.path import abspath, dirname, join, isfile, basename
import... |
Qalthos/ansible | refs/heads/devel | lib/ansible/modules/cloud/amazon/cloudwatchevent_rule.py | 65 | #!/usr/bin/python
# Copyright: 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
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... |
jigpu/mutter | refs/heads/wip/tablet-protocol-hack | tools/release-wrangler.py | 10 | #!/usr/bin/python
#
# release-wrangler.py - very basic release system, primarily for
# Metacity, might be useful for others. In very early stages of
# development.
#
# Copyright (C) 2008 Thomas Thurman
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Publ... |
teslaji/homebase | refs/heads/master | venv/HomeBase/lib/python3.5/site-packages/django/core/files/temp.py | 33 | """
The temp module provides a NamedTemporaryFile that can be reopened in the same
process on any platform. Most platforms use the standard Python
tempfile.NamedTemporaryFile class, but Windows users are given a custom class.
This is needed because the Python implementation of NamedTemporaryFile uses the
O_TEMPORARY f... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.