repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
LinusU/fbthrift | refs/heads/master | thrift/test/py/TestCppServer.py | 1 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
# this interferes with ServiceRouter/SWIG
# @lint-avoid-python-3-compatibility-imports
#from __future__ import unicode_literals
import json
import math
import multiprocessing
import os
import sys
import tempfil... |
CGenie/sorl-thumbnail | refs/heads/master | tests/thumbnail_tests/test_parsers.py | 17 | # -*- coding: utf-8 -*-
import unittest
from sorl.thumbnail.helpers import ThumbnailError
from sorl.thumbnail.parsers import parse_crop, parse_geometry
class CropParserTestCase(unittest.TestCase):
def test_alias_crop(self):
crop = parse_crop('center', (500, 500), (400, 400))
self.assertEqual(crop... |
chacoroot/planetary | refs/heads/master | addons/mail/__init__.py | 382 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2009-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... |
tumbl3w33d/ansible | refs/heads/devel | lib/ansible/modules/windows/win_group.py | 52 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2014, Chris Hoffman <choffman@chathamfinancial.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# this is a windows documentation stub. actual code lives in the .ps1
# file of the same name
ANSIBLE_METADATA =... |
da1z/intellij-community | refs/heads/master | python/testData/intentions/googleDocStubInlineFunctionBodyNoSpaceBefore_after.py | 96 | def f(x, y):
"""
Args:
x:
y:
Returns:
"""
return 42 |
z0by/django | refs/heads/master | django/core/management/base.py | 83 | # -*- coding: utf-8 -*-
"""
Base classes for writing management commands (named commands which can
be executed through ``django-admin`` or ``manage.py``).
"""
from __future__ import unicode_literals
import os
import sys
import warnings
from argparse import ArgumentParser
from optparse import OptionParser
import djang... |
sbuss/voteswap | refs/heads/master | lib/django/contrib/admin/models.py | 184 | from __future__ import unicode_literals
from django.conf import settings
from django.contrib.admin.utils import quote
from django.contrib.contenttypes.models import ContentType
from django.core.urlresolvers import NoReverseMatch, reverse
from django.db import models
from django.utils import timezone
from django.utils.... |
rozap/aircooledrescue | refs/heads/master | buspeople/middleware.py | 1 | import traceback
import sys
class ProcessExceptionMiddleware(object):
def process_exception(self, request, exception):
print exception # or log, or whatever.
# print traceback
print '\n'.join(traceback.format_exception(*sys.exc_info())) |
gweintraub/SerialSculpt | refs/heads/master | node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/engine.io-parser/node_modules/utf8/tests/generate-test-data.py | 1788 | #!/usr/bin/env python
import re
import json
# https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
# http://stackoverflow.com/a/13436167/96656
def unisymbol(codePoint):
if codePoint >= 0x0000 and codePoint <= 0xFFFF:
return unichr(codePoint)
elif codePoint >= 0x010000 and codePoint <= 0x10FFFF:
... |
bradmontgomery/django-avatar | refs/heads/master | tests/settings.py | 71 | from django.conf.urls.defaults import patterns, include, handler500, handler404
DEFAULT_CHARSET = 'utf-8'
DATABASE_ENGINE = 'sqlite3'
DATABASE_NAME = ':memory:'
ROOT_URLCONF = 'settings'
STATIC_URL = '/site_media/static/'
SITE_ID = 1
INSTALLED_APPS = (
'django.contrib.sessions',
'django.contrib.auth',
... |
kblin/supybot-gsoc | refs/heads/stable | plugins/Reply/config.py | 15 | ###
# Copyright (c) 2005, Daniel DiPaolo
# 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 condition... |
fedorpatlin/ansible | refs/heads/devel | lib/ansible/plugins/connection/lxc.py | 89 | # (c) 2015, Joerg Thalheim <joerg@higgsboson.tk>
#
# 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 ve... |
poiesisconsulting/openerp-restaurant | refs/heads/master | purchase_double_validation/__init__.py | 441 | # -*- 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... |
pombredanne/NearPy | refs/heads/master | nearpy/tests/__init__.py | 2 | # -*- coding: utf-8 -*-
# Copyright (c) 2013 Ole Krause-Sparmann
# 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,... |
bnjmnhndrsn/lunchmove | refs/heads/master | moves/serializers.py | 2 | from .models import Move, Spot
from rest_framework import serializers
class MoveSerializer(serializers.ModelSerializer):
class Meta:
model = Move
fields = ('spot', 'user', 'id', 'uuid', 'time')
class SpotSerializer(serializers.ModelSerializer):
class Meta:
model = Spot
fields ... |
fo2rist/infra-strike | refs/heads/master | backend/venv/Lib/site-packages/pip/_vendor/requests/packages/chardet/constants.py | 3007 | ######################## 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... |
p0cisk/Quantum-GIS | refs/heads/master | python/ext-libs/nose2/sphinxext.py | 12 | import types
from docutils import nodes
from docutils.statemachine import ViewList
from docutils.parsers.rst import Directive, directives
from nose2 import events, session, util
AD = u'<autodoc>'
__unittest = True
class AutoPlugin(Directive):
required_arguments = 1
optional_arguments = 1
final_argumen... |
zhaochl/python-utils | refs/heads/master | sug/demo/tree_builder.py | 1 | #!/usr/bin/env python
# coding=utf-8
from data_util import *
from tire_tree import *
import pygraphviz as pgv
import json
import os
PROJECT_BATCH_SIZE = 100
def build_tree(pid = 0):
while True:
projs = DataUtil.get_project_term(pid, PROJECT_BATCH_SIZE)
for proj in projs:
title = proj[... |
yorkerlin/shogun | refs/heads/develop | examples/undocumented/python_modular/kernel_simple_locality_improved_string_modular.py | 26 | #!/usr/bin/env python
from tools.load import LoadMatrix
lm=LoadMatrix()
traindat = lm.load_dna('../data/fm_train_dna.dat')
testdat = lm.load_dna('../data/fm_test_dna.dat')
parameter_list = [[traindat,testdat,5,5,1],[traindat,testdat,5,3,2]]
def kernel_simple_locality_improved_string_modular (fm_train_dna=traindat,fm_... |
tmpgit/intellij-community | refs/heads/master | python/testData/inspections/PyArgumentListInspection/dictFromKeys.py | 52 | print(dict.fromkeys(<warning descr="Parameter 'seq' unfilled">)</warning>)
print(dict.fromkeys(['foo', 'bar']))
|
samdowd/drumm-farm | refs/heads/master | drumm_env/lib/python2.7/site-packages/django/forms/widgets.py | 106 | """
HTML Widget classes
"""
from __future__ import unicode_literals
import copy
import datetime
import re
from itertools import chain
from django.conf import settings
from django.forms.utils import flatatt, to_current_timezone
from django.utils import datetime_safe, formats, six
from django.utils.datastructures impo... |
krikru/tensorflow-opencl | refs/heads/master | tensorflow/python/summary/writer/event_file_writer.py | 36 | # 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... |
bplancher/odoo | refs/heads/9.0 | openerp/addons/base/tests/test_mimetypes.py | 12 | import base64
import unittest
from openerp.tools.mimetypes import guess_mimetype
PNG = 'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAADElEQVQI12P4//8/AAX+Av7czFnnAAAAAElFTkSuQmCC'
GIF = "R0lGODdhAQABAIAAAP///////ywAAAAAAQABAAACAkQBADs="
BMP = """Qk1+AAAAAAAAAHoAAABsAAAAAQAAAAEAAAABABgAAAAAAAQAAAATCwAAEwsAAAAAAAAAAA... |
40223210/w16b_test | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/unittest/test/_test_warnings.py | 858 | # helper module for test_runner.Test_TextTestRunner.test_warnings
"""
This module has a number of tests that raise different kinds of warnings.
When the tests are run, the warnings are caught and their messages are printed
to stdout. This module also accepts an arg that is then passed to
unittest.main to affect the b... |
rmcgibbo/scipy | refs/heads/master | scipy/special/_ellip_harm.py | 80 | from __future__ import division, print_function, absolute_import
import threading
import numpy as np
from ._ufuncs import _ellip_harm
from ._ellip_harm_2 import _ellipsoid, _ellipsoid_norm
# the functions _ellipsoid, _ellipsoid_norm use global variables, the lock
# protects them if the function is called from multi... |
noironetworks/horizon | refs/heads/master | openstack_dashboard/urls.py | 1 | # Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the... |
azide0x37/modocDB | refs/heads/master | venv/lib/python2.7/site-packages/setuptools/command/develop.py | 477 | from setuptools.command.easy_install import easy_install
from distutils.util import convert_path, subst_vars
from pkg_resources import Distribution, PathMetadata, normalize_path
from distutils import log
from distutils.errors import DistutilsError, DistutilsOptionError
import os, sys, setuptools, glob
class develop(ea... |
0x0all/nupic | refs/heads/master | tests/integration/py2/nupic/swarming/experiments/spatial_classification/description.py | 1 | # ----------------------------------------------------------------------
# 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... |
subodhchhabra/airflow | refs/heads/master | airflow/utils/asciiart.py | 9 | # -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... |
phanikiran2/Extending-RED-qdisc-in-ns3-to-support--NLRED | refs/heads/master | bindings/python/rad_util.py | 212 | # Copyright (c) 2007 RADLogic
#
# 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, publish, distribut... |
pmisik/buildbot | refs/heads/master | master/buildbot/test/util/fuzz.py | 6 | # This file is part of Buildbot. Buildbot 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, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... |
317070/Twitch-plays-LSD-neural-net | refs/heads/master | mat2npy.py | 6 | import numpy as np
import scipy.io
data = scipy.io.loadmat("data/imagenet-vgg-verydeep-16.mat")
print data.keys()
idxs = [0,2,5,7,10,12,14,17,19,21,24,26,28,31,33,35]
params = []
for i in idxs:
W = data['layers'][0][i][0][0][0][0][0]
W = np.transpose(W, (3,2,0,1))
b = data['layers'][0][i][0][0][0][0][... |
kantlove/flask-simple-page | refs/heads/master | Lib/site-packages/pip/_vendor/cachecontrol/compat.py | 317 | try:
from urllib.parse import urljoin
except ImportError:
from urlparse import urljoin
try:
import cPickle as pickle
except ImportError:
import pickle
from pip._vendor.requests.packages.urllib3.response import HTTPResponse
from pip._vendor.requests.packages.urllib3.util import is_fp_closed
|
doduytrung/odoo-8.0 | refs/heads/master | addons/account/wizard/account_report_print_journal.py | 378 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
williamluke4/Examenable | refs/heads/master | node_modules/sitemap/env/lib/python2.7/site-packages/setuptools/tests/test_upload_docs.py | 522 | """build_ext tests
"""
import sys, os, shutil, tempfile, unittest, site, zipfile
from setuptools.command.upload_docs import upload_docs
from setuptools.dist import Distribution
SETUP_PY = """\
from setuptools import setup
setup(name='foo')
"""
class TestUploadDocsTest(unittest.TestCase):
def setUp(self):
... |
ObsidianBlk/GemRB--Unofficial- | refs/heads/master | gemrb/GUIScripts/bg1/GUICG10.py | 3 | # GemRB - Infinity Engine Emulator
# Copyright (C) 2003 The GemRB Project
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later versi... |
xjnny/NRPhoto | refs/heads/master | node_modules/node-gyp/gyp/pylib/gyp/MSVSUserFile.py | 2710 | # 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.
"""Visual Studio user preferences file writer."""
import os
import re
import socket # for gethostname
import gyp.common
import gyp.easy_xml as easy_xml
#------... |
davidwilson-85/easymap | refs/heads/master | graphic_output/Pillow-4.2.1/Tests/test_image_toqimage.py | 1 | from helper import unittest, PillowTestCase, hopper
from test_imageqt import PillowQtTestCase
from PIL import ImageQt, Image
if ImageQt.qt_is_installed:
from PIL.ImageQt import QImage
try:
from PyQt5 import QtGui
from PyQt5.QtWidgets import QWidget, QHBoxLayout, QLabel, QApplication
... |
anhstudios/swganh | refs/heads/develop | data/scripts/templates/object/tangible/furniture/cheap/shared_coffee_table_s01.py | 2 | #### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/furniture/cheap/shared_coffee_table_s01.iff"
result.attribute_templ... |
cloudera/avro | refs/heads/trunk | lang/c++/scripts/gen-cppcode.py | 28 | #!/usr/bin/python
license = '''/**
* 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, Ver... |
Phil9l/cosmos | refs/heads/master | code/computational_geometry/src/area_of_triangle/area_of_triangle.py | 3 | #! /usr/local/bin/python3
# Part of Cosmos by OpenGenus Foundation
# Programmer: Amariah Del Mar
# Date Written: October 6th, 2017
# Function to find area of a triangle using three different vertices.
class MyPoint:
def __init__(self, x=0, y=0):
self.x = x
self.y = y
def area_of_triangle(a, b, ... |
jeremiahyan/odoo | refs/heads/master | addons/website_forum/tests/test_forum.py | 12 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from .common import KARMA, TestForumCommon
from odoo.exceptions import UserError, AccessError
from odoo.tools import mute_logger
from psycopg2 import IntegrityError
class TestForum(TestForumCommon):
def test_crud_... |
aferr/LatticeMemCtl | refs/heads/master | src/python/m5/SimObject.py | 6 | # Copyright (c) 2012 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the functionality ... |
hammerlab/immuno_research | refs/heads/master | Mar18_no_mincount.py | 1 | # Copyright (c) 2014. Mount Sinai School of Medicine
#
# 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... |
acshi/osf.io | refs/heads/develop | api_tests/applications/views/test_application_detail.py | 6 | import mock
from nose.tools import * # flake8: noqa
from website.models import ApiOAuth2Application, User
from website.util import api_v2_url
from tests.base import ApiTestCase
from osf_tests.factories import ApiOAuth2ApplicationFactory, AuthUserFactory
def _get_application_detail_route(app):
path = "applicat... |
texttochange/vusion-backend | refs/heads/develop | transports/africastalking_uganda/__init__.py | 5 | from .mtech_kenya import MTechKenyaTransport, MTechKenyaTransportV2
__all__ = ['MTechKenyaTransport', 'MTechKenyaTransportV2']
|
yupengyan/python-oauth2 | refs/heads/master | oauth2/__init__.py | 37 | """
The MIT License
Copyright (c) 2007 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel
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 right... |
xiaoshaozi52/ansible | refs/heads/devel | lib/ansible/parsing/utils/__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... |
hechaoyuyu/swinst | refs/heads/master | src/wubi/frontends/win32/cd_finish_page.py | 2 | # Copyright (c) 2008 Agostino Russo
#
# Written by Agostino Russo <agostino.russo@gmail.com>
#
# This file is part of Wubi the Win32 Ubuntu Installer.
#
# Wubi is free software; you can redistribute it and/or modify
# it under 5the terms of the GNU Lesser General Public License as
# published by the Free Software Found... |
rajalokan/nova | refs/heads/master | nova/db/sqlalchemy/api_migrations/migrate_repo/versions/006_build_request.py | 25 | # 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
# d... |
turbokongen/home-assistant | refs/heads/dev | homeassistant/components/speedtestdotnet/__init__.py | 12 | """Support for testing internet speed via Speedtest.net."""
from datetime import timedelta
import logging
import speedtest
import voluptuous as vol
from homeassistant.config_entries import SOURCE_IMPORT
from homeassistant.const import (
CONF_MONITORED_CONDITIONS,
CONF_SCAN_INTERVAL,
EVENT_HOMEASSISTANT_ST... |
RefugeeMatchmaking/HackZurich | refs/heads/master | refugee_matchmaking/users/tests.py | 1 | from django.test import TestCase
from django.test import Client
from .models import *
# Create your tests here.
client=Client()
#Test to check if the input form is working correctly
class Matchmaking_Test(TestCase):
def test_user_submission(self):
resp=self.client.post('/',{'refugee_or_local': 'L', 'first_name':... |
kohnle-lernmodule/palama | refs/heads/master | exe/__init__.py | 14 | # ===========================================================================
# __init__.py
# Copyright 2004-2006, University of Auckland
#
# This is a placeholder
#
# 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
# th... |
userzimmermann/robotframework | refs/heads/python3 | utest/model/test_itemlist.py | 1 | from six import text_type as unicode
import unittest
from robot.utils.asserts import (assert_equal, assert_true, assert_raises,
assert_raises_with_msg)
from robot.model.itemlist import ItemList
class Object(object):
attr = 1
def __init__(self, id=None):
self.id = id
... |
Venturi/cms | refs/heads/master | env/lib/python2.7/site-packages/phonenumbers/data/alt_format_62.py | 11 | """Auto-generated file, do not edit by hand. 62 metadata"""
from ..phonemetadata import NumberFormat
PHONE_ALT_FORMAT_62 = [NumberFormat(pattern='(\\d{2})(\\d{3,4})(\\d{4})', format='\\1 \\2', leading_digits_pattern=['2[124]|[36]1'])]
|
thomnico/DNS-Charm | refs/heads/master | contrib/tests/test_zone.py | 1 | import unittest
from mock import patch, Mock
import sys
from bind.zone import Zone
class TestZone(unittest.TestCase):
def test_dictionary(self):
z = Zone()
self.assertTrue(hasattr(z, 'contents'))
def test_a_getset(self):
z = Zone()
record = {'ttl': 300, 'addr': '10.0.0.1', '... |
motion2015/edx-platform | refs/heads/master | lms/djangoapps/bulk_email/migrations/0007_load_course_email_template.py | 182 | # -*- coding: utf-8 -*-
from south.v2 import DataMigration
class Migration(DataMigration):
def forwards(self, orm):
"Load data from fixture."
from django.core.management import call_command
call_command("loaddata", "course_email_template.json")
def backwards(self, orm):
"Perf... |
burnpanck/traits | refs/heads/master | traits/adaptation/tests/test_global_adaptation_manager.py | 1 | """ Test the setting/getting/resetting/using the global adaptation manager. """
from traits.adaptation.api import adapt, AdaptationError, AdaptationManager, \
AdaptationOffer, get_global_adaptation_manager, provides_protocol, \
register_factory, register_provides, register_offer, \
reset_global_adaptation_... |
russellb/nova | refs/heads/master | nova/network/quantum/melange_ipam_lib.py | 1 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 Nicira Networks, 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.apach... |
JeisonPacateque/Asphalt-Mixtures-Aging-Simulator | refs/heads/master | app/ui/configure_simulation.py | 1 | '''
Copyright (C) 2015 Jeison Pacateque, Santiago Puerto, Wilmar Fernandez
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Thi... |
shinyChen/browserscope | refs/heads/master | bin/local_scores.py | 9 | #!/usr/bin/python2.5
#
# Copyright 2009 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 ... |
nirvn/QGIS | refs/heads/master | python/plugins/processing/tests/ModelerTest.py | 10 | # -*- coding: utf-8 -*-
"""
***************************************************************************
ModelerTest
---------------------
Date : November 2016
Copyright : (C) 2016 by Nyall Dawson
Email : nyall dot dawson at gmail dot com
*******************... |
pepeportela/edx-platform | refs/heads/master | lms/djangoapps/django_comment_client/tests/mock_cs_server/mock_cs_server.py | 23 | import json
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
from logging import getLogger
logger = getLogger(__name__)
class MockCommentServiceRequestHandler(BaseHTTPRequestHandler):
'''
A handler for Comment Service POST requests.
'''
protocol = "HTTP/1.0"
def do_POST(self):
... |
ArnossArnossi/django | refs/heads/master | django/contrib/gis/utils/srs.py | 450 | from django.contrib.gis.gdal import SpatialReference
from django.db import DEFAULT_DB_ALIAS, connections
def add_srs_entry(srs, auth_name='EPSG', auth_srid=None, ref_sys_name=None,
database=None):
"""
This function takes a GDAL SpatialReference system and adds its information
to the `spa... |
Cat5TV/nems-migrator | refs/heads/master | data/1.6/nagios/plugins/check_esxi_hardware.py | 2 | #!/usr/bin/python
# -*- coding: UTF-8 -*-
#
# Script for checking global health of host running VMware ESX/ESXi
#
# Licence : GNU General Public Licence (GPL) http://www.gnu.org/
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published ... |
kenorb/wp_site | refs/heads/master | sites/all/modules/contributions/[wysiwyg]/fckeditor/fckeditor/editor/filemanager/connectors/py/connector.py | 44 | #!/usr/bin/env python
"""
FCKeditor - The text editor for Internet - http://www.fckeditor.net
Copyright (C) 2003-2009 Frederico Caldeira Knabben
== BEGIN LICENSE ==
Licensed under the terms of any of the following licenses at your
choice:
- GNU General Public License Version 2 or later (the "GPL")
h... |
suneeth51/neutron | refs/heads/master | neutron/db/migration/alembic_migrations/mlnx_init_ops.py | 32 | # Copyright 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 ... |
IvanJobs/play | refs/heads/master | ceph/swift/auth_get.py | 1 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import urllib
from urllib.request import Request
import hmac
import hashlib
import base64
import datetime
import sys
# demouserid
#access_key = 'Z2ETKC4RQFTR4XBQ1A72'
#secret_key = 'vqdQGtmruGW855mduffA8lsLx+ot9iXIb9QTtT2I'
#host_port = '172.16.6.81:7480'
#host_port = '... |
skylerberg/third-party-ci-tools | refs/heads/master | monitoring/ciwatch/ciwatch/db.py | 1 | # Copyright (c) 2015 Tintri. 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 app... |
yedivanseven/LPDE | refs/heads/master | lpde/geometry/grid.py | 1 |
class Grid:
def __init__(self, x: int, y: int) -> None:
self.__x = self.__integer_type_and_range_checked(x)
self.__y = self.__integer_type_and_range_checked(y)
@property
def x(self) -> int:
return self.__x
@property
def y(self) -> int:
return self.__y
@static... |
kisonecat/sequences-and-series | refs/heads/master | quizzes/multiplyPowerSeries/__init__.py | 3 | from questions import *
class Question(RandomizedQuestion):
module = __file__
video = 'multiply-power-series'
forum = 10160
title = 'multiply two power series'
def good_enough(self):
return True
def perturb(self):
x = var('x')
self.x = x
nn = var('n')
s... |
bsipocz/astropy | refs/heads/hacking | astropy/coordinates/tests/test_frames.py | 1 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from copy import deepcopy
import numpy as np
from astropy import units as u
from astropy.tests.helper import (catch_warnings, pytest,
assert_quantity_allclose as assert_allclose)
from astropy.utils im... |
Bennson/Projects | refs/heads/master | Project Euler/008 - Largest Product in a series/Largest_Product_in_a_series.py | 1 | string = "7316717653133062491922511967442657474235534919493496983520312774506326239578318016984801869478851843858615607891129494954595017379583319528532088055111254069874715852386305071569329096329522744304355766896648950445244523161731856403098711121722383113622298934233803081353362766142828064444866452387493035890729... |
edx/edx-enterprise | refs/heads/master | integrated_channels/degreed/migrations/0008_auto_20191001_0742.py | 1 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.23 on 2019-10-01 07:42
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('degreed', '0007_auto_20190925_0730'),
]
operations = [
migrations.AddField(
model_name='degreedenterp... |
lllcho/CAPTCHA-breaking | refs/heads/master | keras-master/keras/layers/normalization.py | 22 | from ..layers.core import Layer
from ..utils.theano_utils import shared_zeros
from .. import initializations
import theano.tensor as T
class BatchNormalization(Layer):
'''
Reference:
Batch Normalization: Accelerating Deep Network Training by Reducing Internal Covariate Shift
ht... |
MER-GROUP/intellij-community | refs/heads/master | python/testData/intentions/removeLeadingU_after.py | 83 | a = "text" |
evanson/yowsup | refs/heads/master | yowsup/layers/protocol_presence/__init__.py | 70 | from .layer import YowPresenceProtocolLayer
|
jeroenj/CouchPotatoServer | refs/heads/master | libs/pyasn1/__init__.py | 193 | import sys
# http://www.python.org/dev/peps/pep-0396/
__version__ = '0.1.7'
if sys.version_info[:2] < (2, 4):
raise RuntimeError('PyASN1 requires Python 2.4 or later')
|
makinacorpus/django | refs/heads/master | tests/fixtures_model_package/__init__.py | 45382 | |
iphoting/healthchecks | refs/heads/heroku | hc/api/migrations/0071_check_manual_resume.py | 2 | # Generated by Django 3.0.4 on 2020-06-02 07:35
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('api', '0070_auto_20200411_1310'),
]
operations = [
migrations.AddField(
model_name='check',
name='manual_resume',
... |
evildmp/django-cms | refs/heads/master | cms/test_utils/project/sampleapp/migrations/0001_initial.py | 66 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import cms.models.fields
class Migration(migrations.Migration):
dependencies = [
('cms', '0002_auto_20140816_1918'),
]
operations = [
migrations.CreateModel(
name='Catego... |
OAPDF/oapdftools | refs/heads/master | oapdf/jrecord.py | 2 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
from bs4 import BeautifulSoup
######################## Part3: Journal Record #############################
############### General Journal Record class ###############################
class Jrecord(object):
'''Basic journal record information'''
def __init__(self):
... |
dceoy/fract | refs/heads/master | fract/util/kalmanfilter.py | 1 | #!/usr/bin/env python
import logging
import os
import numpy as np
import pandas as pd
from scipy.optimize import minimize_scalar
class KalmanFilter(object):
def __init__(self, x0=0, v0=1e-8, q=1e-8, r=1e-8, keep_history=False):
self.x = np.array([x0]) # estimate of x
self.v = np.... |
Alisa-lisa/FinReporter | refs/heads/master | core/visualizing/OnlinePlotting.py | 1 | """ Basically small util to visualize the graphs """
from core.utils.Aggregators import Approach, Aggregators, PlotTypes
from core.db_style.basic_functions import PostgresDBUnit
from core.pandas_style.basic_functions import PandasUtil
import plotly
from typing import List, Tuple
import plotly.graph_objs as go
from co... |
noironetworks/nova | refs/heads/master | nova/tests/unit/api/openstack/compute/test_extended_ips.py | 33 | # Copyright 2013 Nebula, 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 ... |
rogerhu/django | refs/heads/master | django/contrib/gis/geos/io.py | 114 | """
Module that holds classes for performing I/O operations on GEOS geometry
objects. Specifically, this has Python implementations of WKB/WKT
reader and writer classes.
"""
from django.contrib.gis.geos.geometry import GEOSGeometry
from django.contrib.gis.geos.prototypes.io import _WKTReader, _WKBReader, WKBWriter, WK... |
mrkeng/alerta | refs/heads/master | alerta/plugins/normalise.py | 3 |
from alerta.plugins import PluginBase
class NormaliseAlert(PluginBase):
def pre_receive(self, alert):
alert.text = '%s: %s' % (alert.severity.upper(), alert.text)
return alert
def post_receive(self, alert):
return
|
kashifmin/KKernel_yu_msm8916 | refs/heads/cm-12.0 | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/EventClass.py | 4653 | # EventClass.py
#
# This is a library defining some events types classes, which could
# be used by other scripts to analyzing the perf samples.
#
# Currently there are just a few classes defined for examples,
# PerfEvent is the base class for all perf event sample, PebsEvent
# is a HW base Intel x86 PEBS event, and use... |
w1ll1am23/home-assistant | refs/heads/dev | homeassistant/components/alexa/logbook.py | 19 | """Describe logbook events."""
from homeassistant.core import callback
from .const import DOMAIN, EVENT_ALEXA_SMART_HOME
@callback
def async_describe_events(hass, async_describe_event):
"""Describe logbook events."""
@callback
def async_describe_logbook_event(event):
"""Describe a logbook event.... |
gangadharkadam/saloon_erp | refs/heads/master | erpnext/accounts/doctype/shipping_rule_country/shipping_rule_country.py | 83 | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class ShippingRuleCountry(Document):
pass
|
frivoal/presto-testo | refs/heads/master | core/standards/scripts/opjsunit/harness/jsshells.py | 4 | import killableprocess
import subprocess
import os
import tempfile
class JSShell(object):
exec_name = None #Default name of the shell executable
default_repetitions = 1
def __init__(self, path, verbose=False):
self.path = path
self.verbose = verbose
def getCommand(self, filenames, *arg... |
safwanrahman/kitsune | refs/heads/master | kitsune/gallery/tests/test_api.py | 7 | from nose.tools import eq_
from kitsune.sumo.urlresolvers import reverse
from kitsune.sumo.tests import TestCase
class TestImageListView(TestCase):
def test_it_works(self):
url = reverse('image-list')
res = self.client.get(url)
eq_(res.status_code, 200)
|
rew4332/tensorflow | refs/heads/rew4332-patch-1 | tensorflow/models/image/cifar10/cifar10_input_test.py | 34 | # 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... |
racitup/djangoshop-subscribe | refs/heads/master | shop_subscribe/templatetags/subscribe_tags.py | 1 | # -*- coding: utf-8 -*-
from django import template
register = template.Library()
@register.simple_tag(takes_context=True)
def subscribe_form(context):
"Get an empty subscription form. Added form context variable is only valid within the block scope."
from ..forms import SubscribeForm
context['form'] = Su... |
beswarm/django-allauth | refs/heads/master | allauth/socialaccount/providers/facebook/tests.py | 48 | try:
from mock import patch
except ImportError:
from unittest.mock import patch
import json
from django.core.urlresolvers import reverse
from django.test.utils import override_settings
from django.test.client import RequestFactory
from allauth.socialaccount.tests import create_oauth2_tests
from allauth.tests ... |
persandstrom/home-assistant | refs/heads/master | tests/helpers/test_init.py | 45 | """Test component helpers."""
# pylint: disable=protected-access
from collections import OrderedDict
import unittest
from homeassistant import helpers
from tests.common import get_test_home_assistant
class TestHelpers(unittest.TestCase):
"""Tests homeassistant.helpers module."""
# pylint: disable=invalid-n... |
mcrowson/django | refs/heads/master | django/contrib/gis/gdal/prototypes/geom.py | 450 | from ctypes import POINTER, c_char_p, c_double, c_int, c_void_p
from django.contrib.gis.gdal.envelope import OGREnvelope
from django.contrib.gis.gdal.libgdal import lgdal
from django.contrib.gis.gdal.prototypes.errcheck import check_envelope
from django.contrib.gis.gdal.prototypes.generation import (
const_string_... |
CuonDeveloper/cuon | refs/heads/master | cuon_client/cuon_newclient/bin/cuon/Garden/SingleBotanyDivisio.py | 2 | # -*- coding: utf-8 -*-
##Copyright (C) [2003] [Jürgen Hamel, D-32584 Löhne]
##This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as
##published by the Free Software Foundation; either version 3 of the License, or (at your option) any later versio... |
mluke93/osf.io | refs/heads/develop | api/licenses/urls.py | 23 | from django.conf.urls import url
from api.licenses import views
urlpatterns = [
url(r'^$', views.LicenseList.as_view(), name=views.LicenseList.view_name),
url(r'^(?P<license_id>\w+)/$', views.LicenseDetail.as_view(), name=views.LicenseDetail.view_name),
]
|
VoIPGRID/PJSIP | refs/heads/master | tests/pjsua/scripts-sipp/uas-answer-200-update-without-sdp.py | 70 | # $Id$
#
import inc_const as const
PJSUA = ["--null-audio --max-calls=1 $SIPP_URI"]
PJSUA_EXPECTS = [[0, const.STATE_CONFIRMED, "U"]]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.