repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
jocave/snapcraft | refs/heads/master | snaps_tests/demos_tests/test_java_hello_world.py | 9 | # -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2015, 2016 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in... |
Havate/havate-openstack | refs/heads/master | proto-build/gui/config/urls.py | 1 | from django.conf.urls import patterns, include, url
from config.views import HomePageView, SettingsView, NodeDiscoveryView, ScenarioDiscoveryView, SubmitSettingsView, SettingsTextView
urlpatterns = patterns('',
# url(r'^$', 'app_name.views.home', name='home'),
# url(r'^openstack_installer/', include('opensta... |
lizardsystem/lizard-workspace | refs/heads/master | lizard_workspace/migrations/0016_auto__add_field_wmsserver_is_local_server.py | 1 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'WmsServer.is_local_server'
db.add_column('lizard_workspace_wmsserver', 'is_local_server', ... |
danalec/dotfiles | refs/heads/master | sublime/.config/sublime-text-3/Packages/pygments/all/pygments/styles/native.py | 50 | # -*- coding: utf-8 -*-
"""
pygments.styles.native
~~~~~~~~~~~~~~~~~~~~~~
pygments version of my "native" vim theme.
:copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.style import Style
from pygments.token import Keyword, ... |
SANDEISON/The-Huxley | refs/heads/master | Python/Invertido.py | 3 | num2 = int(input ())
invert = 0
while num2 > 0:
invert *= 10
invert += num2 % 10
num2 //= 10
print (invert)
|
warriorYosemite/colorBrick | refs/heads/master | cocos2d/plugin/tools/toolsForGame/modifyProject.py | 255 | import sys, string, os
from xml.etree import ElementTree as ET
from xml.dom import minidom
projFile = sys.argv[1]
targetPath = sys.argv[2]
def getLinkElement():
global targetPath
ret = ET.Element('link')
nameEle = ET.Element('name')
nameEle.text = 'plugin-x'
typeEle = ET.Element('type')
typeEl... |
lsqtongxin/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... |
healthchecks/healthchecks | refs/heads/master | hc/accounts/migrations/0032_auto_20200819_0757.py | 2 | # Generated by Django 3.1 on 2020-08-19 07:57
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('accounts', '0031_auto_20200803_1413'),
]
operations = [
migrations.AddConstraint(
model_name='member',
constraint=mode... |
gasman/shortcrust | refs/heads/master | setup.py | 2 | from distutils.core import setup
setup(
name='Shortcrust',
version='0.1dev',
packages=['shortcrust',],
license='MIT',
long_description=open('README.txt').read(),
)
|
clarkperkins/readthedocs.org | refs/heads/master | readthedocs/projects/migrations/0002_add_importedfile_model.py | 36 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('builds', '0001_initial'),
('projects', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='I... |
XiaodunServerGroup/ddyedx | refs/heads/master | common/djangoapps/edxmako/template.py | 30 | # Copyright (c) 2008 Mikeal Rogers
#
# 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 agre... |
jamespcole/home-assistant | refs/heads/master | homeassistant/components/nx584/__init__.py | 36 | """Support for NX584 alarm control panels."""
|
joydeeps/googletest | refs/heads/master | test/gtest_list_tests_unittest.py | 1898 | #!/usr/bin/env python
#
# Copyright 2006, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... |
Dragnalith/googletest | refs/heads/master | test/gtest_list_tests_unittest.py | 1898 | #!/usr/bin/env python
#
# Copyright 2006, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... |
gautam1858/tensorflow | refs/heads/master | tensorflow/python/ops/image_ops_impl.py | 2 | # 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... |
SamuelMarks/kubernetes | refs/heads/master | build/json-extractor.py | 413 | #!/usr/bin/env python
# Copyright 2014 The Kubernetes Authors All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unle... |
jswope00/griffinx | refs/heads/master | pavelib/paver_tests/test_paver_bok_choy_cmds.py | 8 |
import os
import unittest
from pavelib.utils.test.suites.bokchoy_suite import BokChoyTestSuite
REPO_DIR = os.getcwd()
class TestPaverBokChoyCmd(unittest.TestCase):
def setUp(self):
self.request = BokChoyTestSuite('')
def _expected_command(self, expected_text_append, expected_default_store=None):
... |
SaschaMester/delicium | refs/heads/master | build/android/gyp/pack_relocations.py | 34 | #!/usr/bin/env python
#
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Pack relocations in a library (or copy unchanged).
If --enable-packing and --configuration-name=='Release', invoke the
relocation... |
AOSPU/external_chromium_org | refs/heads/android-5.0/py3 | build/android/pylib/perf/cache_control.py | 8 | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from pylib import android_commands
from pylib.device import device_utils
class CacheControl(object):
_DROP_CACHES = '/proc/sys/vm/drop_caches'
def __in... |
riemarc/pyinduct | refs/heads/develop | pyinduct/examples/rad_eq_diri_fem.py | 3 | import numpy as np
import pyinduct as pi
import pyinduct.parabolic as parabolic
def run(show_plots):
n_fem = 17
T = 1
l = 1
y0 = -1
y1 = 4
param = [1, 0, 0, None, None]
# or try these:
# param = [1, -0.5, -8, None, None] # :)))
a2, a1, a0, _, _ = param
temp_domain = pi.Dom... |
kshedstrom/pyroms | refs/heads/master | examples/Arctic_HYCOM/make_bdry_file.py | 1 | import matplotlib
matplotlib.use('Agg')
import subprocess
import os
import sys
import commands
import numpy as np
from multiprocessing import Pool
#import pdb
#increase the maximum number of open files allowed
#import resource
#resource.setrlimit(resource.RLIMIT_NOFILE, (3000,-1))
import pyroms
import pyroms_toolbox... |
sikmir/QGIS | refs/heads/master | python/plugins/processing/algs/grass7/ext/r_li_mps.py | 45 | # -*- coding: utf-8 -*-
"""
***************************************************************************
r_li_mps.py
-----------
Date : February 2016
Copyright : (C) 2016 by Médéric Ribreux
Email : medspx at medspx dot fr
************************************... |
andim/scipy | refs/heads/master | scipy/linalg/blas.py | 4 | """
Low-level BLAS functions (:mod:`scipy.linalg.blas`)
===================================================
This module contains low-level functions from the BLAS library.
.. versionadded:: 0.12.0
.. warning::
These functions do little to no error checking.
It is possible to cause crashes by mis-using them,
... |
harikvpy/crud | refs/heads/master | crud/wsgi.py | 1 | """
WSGI config for crud 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/1.8/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS... |
ViDA-NYU/reprozip | refs/heads/1.0.x | reprounzip/reprounzip/signals.py | 1 | # Copyright (C) 2014-2017 New York University
# This file is part of ReproZip which is released under the Revised BSD License
# See file LICENSE for full license details.
"""Signal system.
Emitting and subscribing to these signals is the framework for the plugin
infrastructure.
"""
from __future__ import division, p... |
Qusic/ycmd | refs/heads/master | cpp/ycm/tests/gmock/gtest/scripts/upload_gtest.py | 1963 | #!/usr/bin/env python
#
# Copyright 2009, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... |
robin-banks/android_kernel_htc_msm8974 | refs/heads/cm-12.1 | tools/perf/python/twatch.py | 7370 | #! /usr/bin/python
# -*- python -*-
# -*- coding: utf-8 -*-
# twatch - Experimental use of the perf python interface
# Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com>
#
# This application is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License... |
awagnon/maraschino | refs/heads/new | lib/rtorrent/lib/xmlrpc/basic_auth.py | 95 | #
# Copyright (c) 2013 Dean Gardiner, <gardiner91@gmail.com>
#
# 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, mod... |
NikNitro/Python-iBeacon-Scan | refs/heads/master | sympy/matrices/expressions/matadd.py | 8 | from __future__ import print_function, division
from sympy.core.compatibility import reduce
from operator import add
from sympy.core import Add, Basic, sympify
from sympy.functions import adjoint
from sympy.matrices.matrices import MatrixBase
from sympy.matrices.expressions.transpose import transpose
from sympy.strat... |
protatremy/buildbot | refs/heads/master | master/buildbot/test/unit/test_schedulers_timed_Periodic.py | 4 | # 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... |
dparshin/phantomjs | refs/heads/master | src/qt/qtwebkit/Tools/Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py | 118 | # Copyright (C) 2010 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... |
pbfy0/visvis.dev | refs/heads/master | examples/volumes.py | 8 | #!/usr/bin/env python
import visvis as vv
import numpy as np
app = vv.use()
vv.clf()
# create volume
vol = vv.aVolume(size=64)
# set labels
vv.xlabel('x axis')
vv.ylabel('y axis')
vv.zlabel('z axis')
# show
t = vv.volshow(vol, renderStyle='mip')
# try the differtent render styles, for examample
# "t.renderStyle='i... |
DFoly/Blogg | refs/heads/master | app/__init__.py | 5 | from flask import Flask
from flask_bootstrap import Bootstrap
from flask_mail import Mail
from flask_moment import Moment
from flask_sqlalchemy import SQLAlchemy
from flask_login import LoginManager
from flask_pagedown import PageDown
from config import config
bootstrap = Bootstrap()
mail = Mail()
moment = Moment()
db... |
DiCarloLab-Delft/PycQED_py3 | refs/heads/develop | pycqed/analysis_v2/VQE_EVC_2.py | 1 | import time
import numpy as np
from pycqed.analysis import analysis_toolbox as a_tools
import pycqed.analysis_v2.base_analysis as ba
# import dataprep for tomography module
# import tomography module
# using the data prep module of analysis V2
# from pycqed.analysis_v2 import tomography_dataprep as dataprep
from pycqed... |
c0hen/django-venv | refs/heads/master | lib/python3.4/site-packages/django/http/request.py | 23 | from __future__ import unicode_literals
import copy
import re
import sys
from io import BytesIO
from itertools import chain
from django.conf import settings
from django.core import signing
from django.core.exceptions import (
DisallowedHost, ImproperlyConfigured, RequestDataTooBig,
)
from django.core.files import... |
Yukarumya/Yukarum-Redfoxes | refs/heads/master | testing/web-platform/tests/tools/serve/__init__.py | 458 | import serve
|
DevriesL/HeroQLTE_ImageBreaker | refs/heads/master | tools/perf/scripts/python/sctop.py | 1996 | # 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,... |
dlazz/ansible | refs/heads/devel | test/integration/targets/wait_for/files/testserver.py | 222 | import sys
if __name__ == '__main__':
if sys.version_info[0] >= 3:
import http.server
import socketserver
PORT = int(sys.argv[1])
Handler = http.server.SimpleHTTPRequestHandler
httpd = socketserver.TCPServer(("", PORT), Handler)
httpd.serve_forever()
else:
... |
Fkawala/gcloud-python | refs/heads/master | bigquery/google/__init__.py | 194 | # 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, ... |
fighterCui/L4ReFiascoOC | refs/heads/master | l4/pkg/python/contrib/Lib/pyclbr.py | 182 | """Parse a Python module and describe its classes and methods.
Parse enough of a Python file to recognize imports and class and
method definitions, and to find out the superclasses of a class.
The interface consists of a single function:
readmodule_ex(module [, path])
where module is the name of a Python modu... |
gitisaac/gitinspector | refs/heads/master | gitinspector/format.py | 46 | # coding: utf-8
#
# Copyright © 2012-2014 Ejwa Software. All rights reserved.
#
# This file is part of gitinspector.
#
# gitinspector 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 Lic... |
elena/django | refs/heads/master | tests/apps/explicit_default_config_mismatch_app/apps.py | 21 | from django.apps import AppConfig
class ImplicitDefaultConfigMismatch(AppConfig):
name = 'apps.explicit_default_config_mismatch_app'
|
dahlstrom-g/intellij-community | refs/heads/master | python/testData/resolve/multiFile/pkgResourcesNamespaceWithDocstring/root1/pkg/a.py | 64 | import pkg.second
# <ref>
|
MalloyPower/parsing-python | refs/heads/master | front-end/testsuite-python-lib/Python-2.4.3/Lib/plat-mac/Carbon/AH.py | 82 | from _AH import *
|
igemsoftware2017/USTC-Software-2017 | refs/heads/master | tests/core/files/test_views.py | 1 | from rest_framework.test import APITestCase
from django.urls import reverse
from django.test import override_settings
from biohub.accounts.models import User
from ._utils import open_sample
@override_settings(DEBUG=True)
class Test(APITestCase):
def test_upload_fail(self):
url = reverse('default:files:... |
gregorv/sipm_analyse | refs/heads/master | extract_pulse_spectrum.py | 1 | # -*- coding: utf-8 -*-
import platform
if platform.python_implementation() == "PyPy":
import numpypy
else:
import matplotlib.pyplot as plt
from scipy.optimize import leastsq
fig = plt.figure()
import numpy as np
#import scipy
import datafile
import sys
import os
import time
import argparse
from pulse ... |
manashmndl/LearningPyQt | refs/heads/master | ML/ProjectEEESwissKnife/ProjectEEESwissKnife/ProjectEEESwissKnife.py | 1 | from ui_plottercreator import *
import sys
class PlotterCreator(QtGui.QDialog):
def __init__(self, parent = None):
QtGui.QWidget.__init__(self, parent)
self.ui = Ui_PlotterCreator()
self.ui.setupUi(self)
QtCore.QObject.connect(self.ui.noOfDataLineEdit, QtCore.SIGNAL('textEdited(QStr... |
Communities-Communications/cc-odoo | refs/heads/master | addons/website_report/report.py | 257 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2014-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... |
vermpy/thespotlight | refs/heads/master | src/interviews/templatetags/order_by.py | 1 | from django.template import Library
register = Library()
@register.filter_function
def order_by(queryset, args):
args = [x.strip() for x in args.split(',')]
return queryset.order_by(*args)
|
SerCeMan/intellij-community | refs/heads/master | python/helpers/docutils/parsers/rst/languages/pl.py | 56 | # $Id$
# Author: Robert Wojciechowicz <rw@smsnet.pl>
# Copyright: This module has been placed in the public domain.
# New language mappings are welcome. Before doing a new translation, please
# read <http://docutils.sf.net/docs/howto/i18n.html>. Two files must be
# translated for each language: one in docutils/langu... |
cyanna/edx-platform | refs/heads/master | common/djangoapps/cors_csrf/helpers.py | 162 | """Helper methods for CORS and CSRF checks. """
import logging
import urlparse
import contextlib
from django.conf import settings
log = logging.getLogger(__name__)
def is_cross_domain_request_allowed(request):
"""Check whether we should allow the cross-domain request.
We allow a cross-domain request only i... |
marceloomens/appointments | refs/heads/master | appointments/apps/timeslots/migrations/0004_auto_20141103_0840.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('timeslots', '0003_auto_20141102_0853'),
]
operations = [
migrations.AlterField(
model_name='holiday',
... |
hmen89/odoo | refs/heads/master | addons/sale_margin/sale_margin.py | 65 | ##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public L... |
buhii/tomato | refs/heads/master | tomato/__init__.py | 1 | from tomato.swf_processor import Swf
from tomato.swf_image_replacer import SwfImage
from tomato.swf_injector import create_swf
|
Jollytown/Garuda | refs/heads/master | server/garuda/lib/python2.7/site-packages/setuptools/tests/test_find_packages.py | 151 | """Tests for setuptools.find_packages()."""
import os
import sys
import shutil
import tempfile
import platform
import pytest
import setuptools
from setuptools import find_packages
find_420_packages = setuptools.PEP420PackageFinder.find
# modeled after CPython's test.support.can_symlink
def can_symlink():
TESTFN... |
aidanlister/django | refs/heads/master | django/contrib/auth/migrations/0003_alter_user_email_max_length.py | 586 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('auth', '0002_alter_permission_name_max_length'),
]
operations = [
migrations.AlterField(
model_name='user',
... |
bzennn/blog_flask | refs/heads/master | python/lib/python3.5/site-packages/pip/commands/show.py | 344 | from __future__ import absolute_import
from email.parser import FeedParser
import logging
import os
from pip.basecommand import Command
from pip.status_codes import SUCCESS, ERROR
from pip._vendor import pkg_resources
from pip._vendor.packaging.utils import canonicalize_name
logger = logging.getLogger(__name__)
c... |
rebstar6/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/py/testing/root/test_py_imports.py | 163 | import py
import types
import sys
def checksubpackage(name):
obj = getattr(py, name)
if hasattr(obj, '__map__'): # isinstance(obj, Module):
keys = dir(obj)
assert len(keys) > 0
print (obj.__map__)
for name in list(obj.__map__):
assert hasattr(obj, name), (obj, name)
... |
zahari/samba | refs/heads/master | ctdb/tests/takeover/simulation/nondet_path_01.py | 31 | #!/usr/bin/env python
# This is a contrived example that makes the balancing algorithm fail
# for nondeterministic IPs (run with "-dv --nd" to see the failure).
from ctdb_takeover import Cluster, Node, process_args
process_args()
addresses1 = ['A', 'B', 'C', 'D']
addresses2 = ['B', 'E', 'F']
c = Cluster()
for i i... |
ibmsoe/tensorflow | refs/heads/master | tensorflow/python/ops/script_ops.py | 32 | # 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... |
willingc/oh-mainline | refs/heads/master | mysite/profile/migrations/0059_delete_blank_tags.py | 17 | # This file is part of OpenHatch.
# Copyright (C) 2009 OpenHatch, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later v... |
null--/graviton | refs/heads/master | code/external/upx/src/stub/src/arch/i086/wdis2gas.py | 1 | #! /usr/bin/env python
## vim:set ts=4 sw=4 et: -*- coding: utf-8 -*-
#
# wdis2gas.py --
#
# This file is part of the UPX executable compressor.
#
# Copyright (C) 1996-2013 Markus Franz Xaver Johannes Oberhumer
# All Rights Reserved.
#
# UPX and the UCL library are free software; you can redistribute them
# and/o... |
quasiben/bokeh | refs/heads/master | bokeh/server/exceptions.py | 17 | ''' Provide named exceptions having to do with Bokeh Server operation.
'''
from __future__ import absolute_import
class MessageError(Exception):
''' Indicate an error in constructing a Bokeh Message object.
'''
pass
class ProtocolError(Exception):
''' Indicate an error in processing wire protocol fr... |
LethusTI/supportcenter | refs/heads/master | vendor/django/django/contrib/staticfiles/views.py | 98 | """
Views and functions for serving static files. These are only to be used during
development, and SHOULD NOT be used in a production setting.
"""
import os
import posixpath
import urllib
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.http import Http404
from dja... |
akionakamura/scikit-learn | refs/heads/master | examples/model_selection/randomized_search.py | 201 | """
=========================================================================
Comparing randomized search and grid search for hyperparameter estimation
=========================================================================
Compare randomized search and grid search for optimizing hyperparameters of a
random forest.
... |
pavlova-marina/QGIS | refs/heads/master | python/plugins/processing/algs/qgis/FieldsCalculator.py | 4 | # -*- coding: utf-8 -*-
"""
***************************************************************************
FieldsCalculator.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
**********************... |
illicitonion/givabit | refs/heads/master | lib/sdks/google_appengine_1.7.1/google_appengine/lib/django_0_96/django/middleware/transaction.py | 447 | from django.db import transaction
class TransactionMiddleware(object):
"""
Transaction middleware. If this is enabled, each view function will be run
with commit_on_response activated - that way a save() doesn't do a direct
commit, the commit is done when a successful response is created. If an
exc... |
pandaxcl/gyp | refs/heads/master | test/win/linker-flags/update_pgd.py | 106 | #!/usr/bin/env python
# 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.
from optparse import OptionParser
import glob
import os
import subprocess
parser = OptionParser()
parser.add_option('--exe', dest='exe')
pa... |
csuttles/utils | refs/heads/master | python/todo-api/flask/lib/python2.7/site-packages/pkg_resources/_vendor/packaging/_compat.py | 901 | # Copyright 2014 Donald Stufft
#
# 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, so... |
accentgan/iclr2018 | refs/heads/master | main.py | 1 | from __future__ import print_function
import tensorflow as tf
import numpy as np
from model import SEGAN, SEAE
from gru_model import GRUGAN
from ddpg_model import DDPGGAN
import os
from tensorflow.python.client import device_lib
from scipy.io import wavfile
from data_loader import pre_emph
devices = devic... |
tbabej/astropy | refs/heads/master | astropy/utils/tests/data/test_package/__init__.py | 4 | from astropy.utils.data import get_pkg_data_filename
def get_data_filename():
return get_pkg_data_filename('data/foo.txt')
|
mbayon/TFG-MachineLearning | refs/heads/master | venv/lib/python3.6/site-packages/pandas/tests/indexes/datetimes/test_formats.py | 15 | from pandas import DatetimeIndex
import numpy as np
import pandas.util.testing as tm
import pandas as pd
def test_to_native_types():
index = DatetimeIndex(freq='1D', periods=3, start='2017-01-01')
# First, with no arguments.
expected = np.array(['2017-01-01', '2017-01-02',
'201... |
endlessm/chromium-browser | refs/heads/master | tools/swarming_client/third_party/depot_tools/git_number.py | 1 | #!/usr/bin/env vpython3
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Usage: %prog [options] [<commitref>]*
If no <commitref>'s are supplied, it defaults to HEAD.
Calculates the generation number fo... |
pgleeson/TempRepo3 | refs/heads/master | pythonnC/Ex2_SaveProject.py | 5 | #
#
# A file which opens a neuroConstruct project, changes the value of the
# amplitude in the electrical stimulation to a random value, then saves the project
#
# Author: Padraig Gleeson
#
# This file has been developed as part of the neuroConstruct project
# This work has been funded by the Medical... |
mgit-at/ansible | refs/heads/devel | lib/ansible/modules/storage/netapp/netapp_e_auth.py | 5 | #!/usr/bin/python
# (c) 2016, NetApp, Inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... |
mohsraspi/mhscs14 | refs/heads/master | robert/pyramid2.py | 1 | import minecraft as minecraft
import time
mc= minecraft.Minecraft.create()
friendgame = minecraft.Minecraft.create("10.52.4.54")
#position = friendgame.player.getTilePos()
#x = position.x
#y = position.y
#z = position.z
x = 110
y = 33
z = -70
base = 5
x1 = x
x2 = x + base
z1 = z
z2 = z + base
while x2 - x1>=0:
fr... |
ver007/Beebeeto-framework | refs/heads/master | demo/utils/payload/webshell/php.py | 20 | #author: fyth
from webshell import *
class PhpShell(Webshell):
_password = 'cmd'
_content = "<?php var_dump(md5(123));@assert($_REQUEST['{0}']);?>"
_check_statement = 'var_dump(md5(123));'
_keyword = '202cb962ac59075b964b07152d234b70'
class PhpVerify(VerifyShell):
_content = "<?php var_dump(md... |
leeping/mdtraj | refs/heads/master | mdtraj/testing/docscrape.py | 17 | """Extract reference documentation from the NumPy source tree.
"""
# This code is copied directly from numpy
# numpy / doc / sphinxext / docscrape.py
# Copyright (c) 2005-2011, NumPy Developers.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted ... |
RasmusD/SiRe | refs/heads/master | SiReData/txt2lmscore.py | 1 | ##########################################################################
#Copyright 2015 Rasmus Dall #
# #
#Licensed under the Apache License, Version 2.0 (the "License"); #
#you may not use thi... |
mbauskar/helpdesk-erpnext | refs/heads/master | erpnext/patches/v5_0/convert_stock_reconciliation.py | 104 | import frappe, json
def execute():
# stock reco now amendable
frappe.db.sql("""update tabDocPerm set `amend` = 1 where parent='Stock Reconciliation' and submit = 1""")
frappe.reload_doc("stock", "doctype", "stock_reconciliation_item")
frappe.reload_doctype("Stock Reconciliation")
if frappe.db.has_column("Stock... |
OptiPop/external_chromium_org | refs/heads/opti-5.1 | content/test/gpu/page_sets/PRESUBMIT.py | 52 | # Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import re
import sys
def _GetTelemetryPath(input_api):
return os.path.join(
os.path.dirname(os.path.dirname(os.path.dirname(os.path.di... |
timokoola/hslbot | refs/heads/master | docutils/utils/code_analyzer.py | 86 | #!/usr/bin/python
# coding: utf-8
"""Lexical analysis of formal languages (i.e. code) using Pygments."""
# :Author: Georg Brandl; Felix Wiemann; Günter Milde
# :Date: $Date: 2011-12-20 15:14:21 +0100 (Die, 20. Dez 2011) $
# :Copyright: This module has been placed in the public domain.
from docutils import Applicatio... |
chaowyc/youtube-dl | refs/heads/master | youtube_dl/extractor/drbonanza.py | 109 | from __future__ import unicode_literals
import json
import re
from .common import InfoExtractor
from ..utils import (
int_or_none,
parse_iso8601,
)
class DRBonanzaIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?dr\.dk/bonanza/(?:[^/]+/)+(?:[^/])+?(?:assetId=(?P<id>\d+))?(?:[#&]|$)'
_TESTS = [{... |
mogeiwang/nest | refs/heads/master | pynest/examples/HillTononi/ht_poisson.py | 4 | # -*- coding: utf-8 -*-
#
# ht_poisson.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST 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
... |
simion/django-trampoline | refs/heads/develop | tests/test_paginator.py | 2 | """
Test paginator for trampoline.
"""
from elasticsearch_dsl import Index
from elasticsearch_dsl import Search
from trampoline.paginator import ESSearchPaginator
from tests.base import BaseTestCase
from tests.models import Token
from tests.views import PaginatedContentView
class TestPaginator(BaseTestCase):
d... |
rbaumg/trac | refs/heads/trunk | trac/admin/test.py | 1 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2004-2019 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://trac.edgewall.org/wiki/TracLicense.
#
# This software consi... |
simbha/GAE-appswell | refs/heads/master | appspot/framework/vendor/google_api/atom/mock_service.py | 277 | #!/usr/bin/python
#
# Copyright (C) 2008 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 ... |
guncoin/guncoin | refs/heads/master | test/functional/test_framework/test_node.py | 3 | #!/usr/bin/env python3
# Copyright (c) 2017-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Class for bitcoind node under test"""
import contextlib
import decimal
import errno
from enum import E... |
Eseoghene/bite-project | refs/heads/master | deps/gdata-python-client/samples/apps/adminsettings_example.py | 41 | #!/usr/bin/python
#
# Copyright 2009 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... |
yaroslavvb/tensorflow | refs/heads/master | tensorflow/python/kernel_tests/spacetodepth_op_test.py | 90 | # 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... |
AsimmHirani/ISpyPi | refs/heads/master | tensorflow/contrib/tensorflow-master/tensorflow/python/util/future_api_test.py | 173 | # 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... |
masayukig/tempest | refs/heads/master | tempest/api/compute/images/test_list_image_filters.py | 2 | # Copyright 2012 OpenStack Foundation
# 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 requ... |
GarethNelson/distcc | refs/heads/master | test/comfychair.py | 24 | #! /usr/bin/env python
# Copyright (C) 2002, 2003 by Martin Pool <mbp@samba.org>
# Copyright (C) 2003 by Tim Potter <tpot@samba.org>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either ver... |
noamelf/Open-Knesset | refs/heads/master | hashnav/__init__.py | 14 | from functools import wraps, update_wrapper
from base import View
from list import ListView
from detail import DetailView
def method_decorator(decorator):
"""
Converts a view function decorator into a method decorator.
the special thing about view decorators is that they expect
'request' to be their f... |
Mozta/pagina-diagnostijuego | refs/heads/master | venv/lib/python2.7/site-packages/django/middleware/locale.py | 32 | "This is the locale selecting middleware that will look at accept headers"
from django.conf import settings
from django.conf.urls.i18n import is_language_prefix_patterns_used
from django.http import HttpResponseRedirect
from django.urls import get_script_prefix, is_valid_path
from django.utils import translation
from ... |
hthompson6/contrail-controller | refs/heads/master | src/base/factory_macros.py | 15 | #!/usr/bin/python
#
# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
#
def generate_header(file):
header = """//
// Generated by base/factory_macros.py
//
"""
file.write(header)
macro_tmpl = """#define FACTORY_TYPE_N%(cardinality)d(_Module, _T%(comma)s%(argument_types)s)
public:
templa... |
samuelshaner/openmc | refs/heads/develop | tests/test_trigger_batch_interval/test_trigger_batch_interval.py | 8 | #!/usr/bin/env python
import os
import sys
sys.path.insert(0, os.pardir)
from testing_harness import TestHarness
if __name__ == '__main__':
harness = TestHarness('statepoint.15.*', True)
harness.main()
|
gdhungana/desispec | refs/heads/master | py/desispec/io/brick.py | 2 | """
desispec.io.brick
=================
I/O routines for working with per-brick files.
See ``doc/DESI_SPECTRO_REDUX/SPECPROD/bricks/BRICKID/*-BRICKID.rst`` in desidatamodel
for a description of the relevant data models.
See :doc:`coadd` and `DESI-doc-1056 <https://desi.lbl.gov/DocDB/cgi-bin/private/ShowDocument?doci... |
proxysh/Safejumper-for-Desktop | refs/heads/master | buildlinux/env32/local/lib/python2.7/ntpath.py | 16 | # Module 'ntpath' -- common operations on WinNT/Win95 pathnames
"""Common pathname manipulations, WindowsNT/95 version.
Instead of importing this module directly, import os and refer to this
module as os.path.
"""
import os
import sys
import stat
import genericpath
import warnings
from genericpath import *
__all__ ... |
gis4dis/poster | refs/heads/master | apps/importing/admin.py | 1 | import logging
from functools import update_wrapper
from django.contrib import admin
from django.db.models import Count, DateTimeField, Min, Max
from django.db.models.functions import Trunc
from .models import Provider, ProviderLog, ReadonlyProviderLog
logger = logging.getLogger(__name__)
# noinspection PyAttribut... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.