repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
Krozark/django-zero | refs/heads/master | zero/website/urls.py | 1 | from django.conf.urls import patterns, include, url
from website.views import HomeView
urlpatterns = patterns('',
# Examples:
url(r'^$', HomeView.as_view(), name='home'),
#url(r'^/$', 'zero.views.home', name='home'),
)
|
GoogleCloudDataproc/cloud-dataproc | refs/heads/master | spark-tensorflow/setup.py | 1 | # Copyright 2017 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 l... |
oscar810429/mysql-5.6_facebook | refs/heads/mysql-5.6.11 | xtrabackup/test/kewpie/percona_tests/xtrabackup_disabled/ib_csm_csv_test.py | 24 | #! /usr/bin/env python
# -*- mode: python; indent-tabs-mode: nil; -*-
# vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
#
# Copyright (C) 2011 Patrick Crews
#
#
# 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 Softwar... |
Alberto-Beralix/Beralix | refs/heads/master | i386-squashfs-root/usr/lib/python2.7/dist-packages/ibus/inputcontext.py | 2 | ../../../../share/pyshared/ibus/inputcontext.py |
40223151/2014c2g9 | refs/heads/master | wsgi/static/Brython2.1.0-20140419-113919/Lib/_string.py | 107 | """string helper module"""
class __loader__(object):
pass
def formatter_field_name_split(*args,**kw):
"""split the argument as a field name"""
pass
def formatter_parser(*args,**kw):
"""parse the argument as a format string"""
pass
|
kkozarev/mwacme | refs/heads/master | src/catalog/local_hek_search.py | 1 | import json
import os
from sunpy.net import hek
from pprint import pprint
from datetime import datetime,timedelta
def load_cme_events(infile):
#This function loads the CME events from a previously prepared JSON file.
# Load the CME data
with open(infile) as json_data:
cmelist = json.load(json_data)
... |
pyfa-org/eos | refs/heads/master | tests/integration/calculator/mod_affectee_filter/affectee_domain/__init__.py | 89 | # ==============================================================================
# Copyright (C) 2011 Diego Duclos
# Copyright (C) 2011-2018 Anton Vorobyov
#
# This file is part of Eos.
#
# Eos is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as publi... |
ammarkhann/FinalSeniorCode | refs/heads/master | lib/python2.7/site-packages/sympy/plotting/pygletplot/plot_interval.py | 94 | from __future__ import print_function, division
from sympy import Symbol, Integer, sympify
from sympy.core.compatibility import range
class PlotInterval(object):
"""
"""
_v, _v_min, _v_max, _v_steps = None, None, None, None
def require_all_args(f):
def check(self, *args, **kwargs):
... |
deepankverma/badges.mozilla.org | refs/heads/master | badgus/settings/__init__.py | 2 | from .base import *
try:
from .local import *
except ImportError, exc:
pass
|
mahak/neutron | refs/heads/master | neutron/tests/unit/extensions/test_port_numa_affinity_policy.py | 2 | # Copyright (c) 2020 Red Hat, 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 ... |
JackDanger/sentry | refs/heads/master | src/sentry/utils/warnings.py | 6 | from __future__ import absolute_import
import collections
import six
import warnings
class UnsupportedBackend(RuntimeWarning):
pass
class DeprecatedSettingWarning(DeprecationWarning):
def __init__(self, setting, replacement, url=None, removed_in_version=None):
self.setting = setting
self.re... |
baberthal/CouchPotatoServer | refs/heads/master | libs/enzyme/language.py | 180 | # -*- coding: utf-8 -*-
# enzyme - Video metadata parser
# Copyright 2011-2012 Antoine Bertin <diaoulael@gmail.com>
# Copyright 2003-2006 Dirk Meyer <dischi@freevo.org>
#
# This file is part of enzyme.
#
# enzyme is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public Lice... |
matrix-org/synapse | refs/heads/master | synapse/rest/client/v2_alpha/relations.py | 1 | # Copyright 2019 New Vector Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... |
SebastianFM/HTC-Sensation-overclocked-kernel | refs/heads/master | scripts/build-all.py | 308 | #! /usr/bin/env python
# Copyright (c) 2009-2011, Code Aurora Forum. 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
# n... |
YixiaoLi/binutils-srec64 | refs/heads/master | gdb/testsuite/gdb.python/py-pp-re-notag.py | 46 | # Copyright (C) 2013-2015 Free Software Foundation, Inc.
# 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.
#
# This progr... |
Pluto-tv/chromium-crosswalk | refs/heads/master | media/tools/constrained_network_server/traffic_control_unittest.py | 187 | #!/usr/bin/env python
# Copyright (c) 2012 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.
"""Tests for traffic control library."""
import unittest
import traffic_control
class TrafficControlUnitTests(unittest.TestCase... |
McBawbaggings/HippieStation | refs/heads/master | hippiestation/tools/dmemerger/dmemerger.py | 4 | import argparse
parser = argparse.ArgumentParser(description='Merge two DME files together')
parser.add_argument('upstream_dme')
parser.add_argument('downstream_dme')
parser.add_argument('module_folder')
args = parser.parse_args()
search_tag_begin = "// BEGIN_INCLUDE"
search_tag_end = "// END_INCLUDE"
include_tag = ... |
theicfire/djangofun | refs/heads/master | djangotoolbox/admin.py | 81 | from django import forms
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from django.contrib.auth.models import User, Group
class UserForm(forms.ModelForm):
class Meta:
model = User
fields = ('username', 'email', 'first_name', 'last_name', 'is_active',
... |
SebasSBM/django | refs/heads/master | tests/file_uploads/uploadhandler.py | 449 | """
Upload handlers to test the upload API.
"""
from django.core.files.uploadhandler import FileUploadHandler, StopUpload
class QuotaUploadHandler(FileUploadHandler):
"""
This test upload handler terminates the connection if more than a quota
(5MB) is uploaded.
"""
QUOTA = 5 * 2 ** 20 # 5 MB
... |
tuturto/pyherc | refs/heads/master | src/herculeum/config/levels/configure_items.py | 1 | # -*- coding: utf-8 -*-
# Copyright (c) 2010-2017 Tuukka Turto
#
# 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,... |
analurandis/Tur | refs/heads/master | backend/venv/Lib/site-packages/jinja2/nodes.py | 623 | # -*- coding: utf-8 -*-
"""
jinja2.nodes
~~~~~~~~~~~~
This module implements additional nodes derived from the ast base node.
It also provides some node tree helper functions like `in_lineno` and
`get_nodes` used by the parser and translator in order to normalize
python and jinja nodes.
:... |
Teagan42/home-assistant | refs/heads/dev | tests/components/demo/test_init.py | 3 | """The tests for the Demo component."""
import json
import os
import pytest
from homeassistant.components import demo
from homeassistant.components.device_tracker.legacy import YAML_DEVICES
from homeassistant.helpers.json import JSONEncoder
from homeassistant.setup import async_setup_component
@pytest.fixture(autou... |
cristiana214/cristianachavez214-cristianachavez | refs/heads/master | python/src/Demo/pdist/cmptree.py | 42 | """Compare local and remote dictionaries and transfer differing files -- like rdist."""
import sys
from repr import repr
import FSProxy
import time
import os
def main():
pwd = os.getcwd()
s = raw_input("chdir [%s] " % pwd)
if s:
os.chdir(s)
pwd = os.getcwd()
host = ask("host", 'voorn.c... |
BlindHunter/django | refs/heads/master | django/contrib/admin/views/decorators.py | 638 | from django.contrib.auth import REDIRECT_FIELD_NAME
from django.contrib.auth.decorators import user_passes_test
def staff_member_required(view_func=None, redirect_field_name=REDIRECT_FIELD_NAME,
login_url='admin:login'):
"""
Decorator for views that checks that the user is logged in ... |
minhphung171093/GreenERP_V7 | refs/heads/master | openerp/addons/l10n_bo/__init__.py | 2120 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2011 Cubic ERP - Teradata SAC. (http://cubicerp.com).
#
# WARNING: This program as such is intended to be used by professional
# programmers who take t... |
philanthropy-u/edx-platform | refs/heads/master | openedx/core/djangoapps/theming/template_loaders.py | 3 | """
Theming aware template loaders.
"""
from django.template.loaders.filesystem import Loader as FilesystemLoader
from edxmako.makoloader import MakoLoader
from openedx.core.djangoapps.theming.helpers import get_all_theme_template_dirs, get_current_request, get_current_theme
class ThemeTemplateLoader(MakoLoader):
... |
daufinsyd/pglx | refs/heads/master | py_files/pglx_qt.py | 1 | #!/usr/bin/python3
from PyQt5 import QtCore, QtGui, QtWidgets
import os, sys, subprocess
import pickle
import readline
import linecache # lis les lignes spécifiques de fichier vs pas de global variables dans les class
import time
import getpass
import re
import string
import
path_to_pglx = "/home/Pompiers/Public/Rappor... |
hippysurfer/geotypes | refs/heads/master | tests/Box_Test.py | 1 |
################################################################################
# Copyright (c) QinetiQ Plc 2003
#
# Licensed under the LGPL. For full license details see the LICENSE file.
################################################################################
import unittest
import os
import TestConfig
i... |
amarandon/pinax | refs/heads/master | pinax/apps/signup_codes/models.py | 1 | import datetime
from django.conf import settings
from django.core.mail import send_mail
from django.db import models
from django.db.models.signals import post_save
from django.template.loader import render_to_string
from django.utils.hashcompat import sha_constructor
from django.contrib.auth.models import User
from d... |
tsmrachel/remo | refs/heads/master | setup.py | 8 | import os
from setuptools import setup, find_packages
setup(name='remo',
version='1.0',
description='Django application.',
long_description='',
author='',
author_email='',
license='',
url='',
include_package_data=True,
classifiers = [],
packages=find_packag... |
adoosii/edx-platform | refs/heads/master | lms/djangoapps/verify_student/tests/test_models.py | 2 | # -*- coding: utf-8 -*-
from datetime import timedelta, datetime
import ddt
import json
import requests.exceptions
import pytz
from django.conf import settings
from django.db.utils import IntegrityError
from django.test import TestCase
from mock import patch
from nose.tools import assert_is_none, assert_equals, assert... |
igemsoftware/SYSU-Software2013 | refs/heads/master | project/Python27/Lib/site-packages/pythonwin/pywin/scintilla/__init__.py | 46 | # package init. |
edwardbadboy/vdsm-ubuntu | refs/heads/master | vdsm/storage/iscsi.py | 1 | #
# Copyright 2009-2012 Red Hat, Inc.
#
# 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 version.
#
# This program is distributed ... |
GunoH/intellij-community | refs/heads/master | python/testData/inspections/PyRedundantParenthesesInspection/ParenthesizedTupleInReturn.py | 12 | def func(x):
return <weak_warning descr="Remove redundant parentheses">(x, x)</weak_warning>
|
zstackio/zstack-woodpecker | refs/heads/master | integrationtest/vm/mini/paths/path28.py | 1 | import zstackwoodpecker.test_state as ts_header
TestAction = ts_header.TestAction
def path():
return dict(initial_formation="template5", path_list=[
[TestAction.create_mini_vm, "vm1", 'data_volume=false', 'cpu=2', 'memory=2', 'provisiong=thick'],
[TestAction.destroy_vm, "vm1"],
[TestAction.r... |
dkubiak789/OpenUpgrade | refs/heads/8.0 | addons/base_report_designer/__openerp__.py | 110 | # -*- 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... |
dslomov/intellij-community | refs/heads/master | python/testData/refactoring/introduceParameter/localVariable1.py | 83 | def f():
a = 1
print <caret>a + 3 |
ivan-fedorov/intellij-community | refs/heads/master | python/helpers/pydev/pydev_override.py | 89 | def overrides(method):
'''
Initially meant to be used as
class B:
@overrides(A.m1)
def m1(self):
pass
but as we want to be compatible with Jython 2.1 where decorators have an uglier syntax (needing an assign
after the method), it should now be used witho... |
aeklant/scipy | refs/heads/master | scipy/special/_precompute/loggamma.py | 1 | """Precompute series coefficients for log-Gamma."""
try:
import mpmath
except ImportError:
pass
def stirling_series(N):
with mpmath.workdps(100):
coeffs = [mpmath.bernoulli(2*n)/(2*n*(2*n - 1))
for n in range(1, N + 1)]
return coeffs
def taylor_series_at_1(N):
coeffs =... |
dieterich-lab/FUCHS | refs/heads/master | GCB_testset/FUCHS/get_readnames_from_DCC.py | 1 | # python script to use CircRNACount file and Chimeric.out.junction of mate1/2 to extract readnames of circle spanning reads
# define function
def read_circRNA_count(infile):
I = open(infile)
circIDs = []
header = I.readline()
for line in I:
L = line.replace('\n', '').split('\t')
circIDs += [(L[0]... |
ramitalat/odoo | refs/heads/8.0 | addons/auth_signup/controllers/main.py | 165 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2012-today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... |
thaskell1/volatility | refs/heads/master | volatility/plugins/overlays/windows/hibernate_vtypes.py | 58 | # Volatility
# Copyright (c) 2008-2013 Volatility Foundation
#
# This file is part of Volatility.
#
# Volatility is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License Version 2 as
# published by the Free Software Foundation. You may not use, modify or
# distribu... |
manojpandey/fb-terminal | refs/heads/Shit | final_server.py | 1 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import os, requests, webbrowser, time, subprocess, threading
# Server imports
import SimpleHTTPServer
from SimpleHTTPServer import SimpleHTTPRequestHandler
from BaseHTTPServer import HTTPServer
# PORT to be used
PORT = 7777
class CustomHTTPHandler(SimpleHTTPServer.SimpleHTT... |
viraintel/OWASP-Nettacker | refs/heads/master | lib/payload/shellcode/encoder/linux_x86/__init__.py | 234 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
pass
|
IljaGrebel/OpenWrt-SDK-imx6_HummingBoard | refs/heads/master | staging_dir/host/lib/scons-2.3.5/SCons/__init__.py | 1 | """SCons
The main package for the SCons software construction utility.
"""
#
# Copyright (c) 2001 - 2015 The SCons Foundation
#
# 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 rest... |
xen0l/ansible | refs/heads/devel | lib/ansible/plugins/test/mathstuff.py | 64 | # (c) 2016, Ansible, Inc
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is di... |
SerCeMan/intellij-community | refs/heads/master | python/testData/inspections/PyUnresolvedReferencesInspection/ivarInDocstring.py | 80 |
class SomeClass(object):
""" Awesome class
@ivar someVar: great stuff
@type someVar: string
"""
def __init__(self):
self.someVar = None |
nyalldawson/QGIS | refs/heads/master | python/plugins/processing/algs/grass7/ext/r_li_mpa_ascii.py | 45 | # -*- coding: utf-8 -*-
"""
***************************************************************************
r_li_mpa_ascii.py
-----------------
Date : February 2016
Copyright : (C) 2016 by Médéric Ribreux
Email : medspx at medspx dot fr
************************... |
ctasims/Dive-Into-Python-3 | refs/heads/master | examples/stdout.py | 1 | import sys
class RedirectStdoutTo:
def __init__(self, out_new):
self.out_new = out_new
def __enter__(self):
self.out_old = sys.stdout
sys.stdout = self.out_new
def __exit__(self, *args):
sys.stdout = self.out_old
print('A')
with open('out.log', mode='w', encoding='utf-8')... |
uannight/reposan | refs/heads/master | plugin.video.tvalacarta/lib/youtube_dl/extractor/skylinewebcams.py | 42 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
class SkylineWebcamsIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?skylinewebcams\.com/[^/]+/webcam/(?:[^/]+/)+(?P<id>[^/]+)\.html'
_TEST = {
'url': 'https://www.skylinewebcams.com/it/webcam/italia/lazio/r... |
noroutine/ansible | refs/heads/devel | lib/ansible/modules/packaging/os/pacman.py | 22 | #!/usr/bin/python -tt
# -*- coding: utf-8 -*-
# Copyright: (c) 2012, Afterburn <http://github.com/afterburn>
# Copyright: (c) 2013, Aaron Bull Schaefer <aaron@elasticdog.com>
# Copyright: (c) 2015, Indrajit Raychaudhuri <irc+code@indrajit.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/lice... |
pengli09/Paddle | refs/heads/develop | python/paddle/v2/framework/tests/test_decayed_adagrad_op.py | 1 | import unittest
import numpy as np
from op_test import OpTest
class TestDecayedAdagradOp1(OpTest):
''' Test DecayedAdagrad operator with explicit attributes
'''
def setUp(self):
self.op_type = "decayed_adagrad"
param = np.random.random((123, 321)).astype("float32")
grad = np.rand... |
yan12125/youtube-dl | refs/heads/master | youtube_dl/extractor/myvi.py | 28 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from .vimple import SprutoBaseIE
class MyviIE(SprutoBaseIE):
_VALID_URL = r'''(?x)
(?:
https?://
(?:www\.)?
... |
varmarakesh/devops-toolbox | refs/heads/version1 | devops-toolbox/fabfile/aws_ops.py | 1 | from fabric.api import *
from fabric.api import env, put, run, sudo, task, cd, settings, prefix, shell_env
from fabric.contrib.files import exists
import time
from aws.ec2_operations import *
from aws.s3_operations import *
@task
def keys(access_key, secret_key):
"""
fab aws_ops.keys:access_key='*****',secret... |
nfco/netforce | refs/heads/master | netforce_mfg/netforce_mfg/models/barcode_validate_line.py | 4 | # Copyright (c) 2012-2015 Netforce Co. Ltd.
#
# 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, publi... |
xuanyuanking/spark | refs/heads/master | python/pyspark/sql/group.py | 23 | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... |
mmehdig/word-sense-modeling | refs/heads/master | src/python/combine_alignments.py | 1 | # -*- coding: utf-8 -*-
__author__ = 'mehdi'
import sys, os
if __name__ == "__main__":
if len(sys.argv) < 5:
sys.exit('Please set raw src file, parallel file, and both reverse and forward aligns, :\n %s <src_raw_file> <parallel_file> <forward.align> <reverse.align>' % sys.argv[0])
src_file_path = o... |
perror/hackingweek | refs/heads/master | hackingweek/models.py | 1 | import urllib
from datetime import datetime, timedelta
from django.contrib.auth.models import User
from django.contrib.sites.models import Site
from django.core.mail import send_mail
from django.core.urlresolvers import reverse, reverse_lazy
from django.db import models
from django.template.loader import render_to_str... |
rawdlite/mopidy | refs/heads/develop | mopidy/core/playlists.py | 3 | from __future__ import absolute_import, unicode_literals
import contextlib
import logging
import urlparse
from mopidy import exceptions
from mopidy.core import listener
from mopidy.internal import deprecation, validation
from mopidy.models import Playlist, Ref
logger = logging.getLogger(__name__)
@contextlib.conte... |
mylxiaoyi/mypyqtgraph-qt5 | refs/heads/master | examples/ROItypes.py | 1 | #!/usr/bin/python -i
# -*- coding: utf-8 -*-
## Add path to library (just for examples; you do not need this)
import initExample
from pyqtgraph.Qt import QtCore, QtGui, QtWidgets
import numpy as np
import pyqtgraph as pg
## create GUI
app = QtWidgets.QApplication([])
w = pg.GraphicsWindow(size=(800,800), border=Tru... |
rsyvarth/simple-blog | refs/heads/master | lib/flaskext/wtf/recaptcha/widgets.py | 27 | """
Custom widgets
"""
try:
import json
except ImportError:
import simplejson as json
from flask import current_app
from werkzeug import url_encode
# use flaskext.babel for translations, if available
try:
from flaskext.babel import gettext as _
except ImportError:
_ = lambda(s) : s
RECAPTCHA_API_SER... |
nurmd2/nurmd | refs/heads/master | addons/website_mail/tests/__init__.py | 47 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import test_controllers
|
t-tran/libcloud | refs/heads/trunk | libcloud/test/compute/test_nephoscale.py | 18 | # 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 ... |
chugunovyar/factoryForBuild | refs/heads/master | env/lib/python2.7/site-packages/matplotlib/delaunay/triangulate.py | 21 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
from six.moves import zip
import warnings
import numpy as np
from matplotlib._delaunay import delaunay
from .interpolate import LinearInterpolator, NNInterpolator
from matplotlib.cbook import war... |
kanagasabapathi/python-for-android | refs/heads/master | python3-alpha/extra_modules/gdata/apps/groups/service.py | 48 | #!/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... |
ThomasBollmeier/GObjectCreator3 | refs/heads/master | unit-test/performance_test.py | 1 | import os
import cProfile
from gobjcreator3.compiler import Compiler
from gobjcreator3.codegen.c_code_generator import CCodeGenerator, CGenConfig
from gobjcreator3.codegen.output import NullOut
_CURDIR = os.path.dirname(__file__)
goc3_filepath = _CURDIR + os.sep + "test.goc3"
model = Compiler().compile(goc3_filepath)... |
Distrotech/intellij-community | refs/heads/master | python/testData/quickFixes/PyAddSpecifierToFormatQuickFixTest/string.py | 80 | a = <warning descr="Format specifier character missing">"test<caret> %"</warning> % "x" |
endorphinl/horizon-fork | refs/heads/master | manage.py | 116 | #!/usr/bin/env python
# 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, softwar... |
factly/election-results-2017 | refs/heads/master | assam/assam/pipelines.py | 1 | # -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
class AssamPipeline(object):
def process_item(self, item, spider):
return item
|
cpennington/edx-platform | refs/heads/master | cms/djangoapps/contentstore/views/tests/test_library.py | 3 | """
Unit tests for contentstore.views.library
More important high-level tests are in contentstore/tests/test_libraries.py
"""
import ddt
import mock
from django.conf import settings
from mock import patch
from opaque_keys.edx.locator import CourseKey, LibraryLocator
from six import binary_type, text_type
from six.mo... |
jvehent/ajenti | refs/heads/master | plugins/network/nc_centos.py | 17 | import time
import os
from ajenti.com import *
from ajenti.utils import *
from ajenti.ui import *
from api import *
from nctp_linux import *
optionmap = {
'IPADDR': 'address',
'NETMASK': 'netmask',
'BROADCAST': 'broadcast',
'MACADDR': 'hwaddr',
}
class CentosNetworkConfig(LinuxIfconfig):
implem... |
tadatitam/info-flow-experiments | refs/heads/master | AdFisher/core/analysis/permutation_test.py | 1 | import numpy as np
import random # for random shuffles
from datetime import datetime # for getting times for computation
from scipy import stats # for confidence_interval computation
class UniqueElement:
def __init__(self,value,occurrences):
self.value = value
self.occurrenc... |
SoftwareMaven/django | refs/heads/master | tests/template_tests/filter_tests/test_timeuntil.py | 161 | from __future__ import unicode_literals
from datetime import datetime, timedelta
from django.template.defaultfilters import timeuntil_filter
from django.test import SimpleTestCase
from django.test.utils import requires_tz_support
from ..utils import setup
from .timezone_utils import TimezoneTestCase
class Timeunti... |
kw217/cpp-fqa | refs/heads/master | refresh.py | 2 | import os
import imp
f2h = imp.load_source('f2h','fqa2html.py')
h2toc=imp.load_source('h2toc','toc.py')
def doit():
fqa = [f for f in os.listdir('.') if f.endswith('.fqa')]
for f in fqa:
print f,'...'
f2h.doit(f[:-4])
f2h.singlepage('fqa.html')
tocs = {
'defective.html':'defect... |
intip/da-apps | refs/heads/master | applications/da_impresso/adm.py | 1 | # coding: utf-8
#
# Copyright 2009 Prima Tech Informatica Ltda.
#
# Licensed under the Environ License, Version 1.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.cmspublica.com.br/licenses/ENVIRON-LICENSE-1.0
#
# Unless r... |
brian-team/brian2genn | refs/heads/master | examples/simple_example.py | 1 | from brian2 import *
import brian2genn
set_device('genn', directory='simple_example')
N = 10000
tau = 10*ms
Iin = 0.11/ms
eqs = '''
dV/dt = -V/tau + Iin : 1
'''
G = NeuronGroup(N, eqs, threshold='V>1', reset='V=0', refractory=5 * ms)
run(10*ms) |
Salat-Cx65/python-for-android | refs/heads/master | python3-alpha/python3-src/Lib/encodings/utf_32_le.py | 744 | """
Python 'utf-32-le' Codec
"""
import codecs
### Codec APIs
encode = codecs.utf_32_le_encode
def decode(input, errors='strict'):
return codecs.utf_32_le_decode(input, errors, True)
class IncrementalEncoder(codecs.IncrementalEncoder):
def encode(self, input, final=False):
return codecs.utf_32_le_en... |
RuudBurger/CouchPotatoServer | refs/heads/master | libs/xmpp/commands.py | 200 | ## $Id: commands.py,v 1.17 2007/08/28 09:54:15 normanr Exp $
## Ad-Hoc Command manager
## Mike Albon (c) 5th January 2005
## 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 versio... |
sunqb/oa_qian | refs/heads/master | flask/Lib/site-packages/pip/_vendor/lockfile/symlinklockfile.py | 536 | from __future__ import absolute_import
import os
import time
from . import (LockBase, NotLocked, NotMyLock, LockTimeout,
AlreadyLocked)
class SymlinkLockFile(LockBase):
"""Lock access to a file using symlink(2)."""
def __init__(self, path, threaded=True, timeout=None):
# super(Symlin... |
mrbox/django | refs/heads/master | django/templatetags/static.py | 91 | from django import template
from django.apps import apps
from django.utils.encoding import iri_to_uri
from django.utils.six.moves.urllib.parse import urljoin
register = template.Library()
class PrefixNode(template.Node):
def __repr__(self):
return "<PrefixNode for %r>" % self.name
def __init__(self... |
mlperf/training_results_v0.6 | refs/heads/master | Fujitsu/benchmarks/resnet/implementations/mxnet/3rdparty/onnx-tensorrt/third_party/onnx/onnx/backend/test/case/model/__init__.py | 1 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import sys
import onnx.defs
import numpy as np # type: ignore
from onnx import ModelProto
from typing import List, Optional, Text, Sequence
from ..utils import import_r... |
idaholab/raven | refs/heads/devel | tests/framework/externalModel/Functions.py | 6 | # Copyright 2017 Battelle Energy Alliance, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... |
ramusus/django-vkontakte-photos | refs/heads/master | vkontakte_photos/migrations/0013_auto__add_field_photo_likes_count__add_field_photo_comments_count__add.py | 2 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as 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 'Photo.likes_count'
db.add_column(u'vkontakte_photos_photo... |
behzadnouri/numpy | refs/heads/master | numpy/core/code_generators/numpy_api.py | 11 | """Here we define the exported functions, types, etc... which need to be
exported through a global C pointer.
Each dictionary contains name -> index pair.
Whenever you change one index, you break the ABI (and the ABI version number
should be incremented). Whenever you add an item to one of the dict, the API
needs to ... |
bvernoux/micropython | refs/heads/master | tests/pyb/can.py | 3 | from pyb import CAN
import pyb
CAN.initfilterbanks(14)
can = CAN(1)
print(can)
can.init(CAN.LOOPBACK)
print(can)
print(can.any(0))
# Catch all filter
can.setfilter(0, CAN.MASK16, 0, (0, 0, 0, 0))
can.send('abcd', 123, timeout=5000)
print(can.any(0))
print(can.recv(0))
can.send('abcd', -1, timeout=5000)
print(can.r... |
aliyun/oss-ftp | refs/heads/master | python27/win32/Lib/sre_constants.py | 185 | #
# Secret Labs' Regular Expression Engine
#
# various symbols used by the regular expression engine.
# run this script to update the _sre include files!
#
# Copyright (c) 1998-2001 by Secret Labs AB. All rights reserved.
#
# See the sre.py file for information on usage and redistribution.
#
"""Internal support modul... |
akretion/odoo | refs/heads/12-patch-paging-100-in-o2m | odoo/addons/base/tests/test_res_users.py | 8 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.tests.common import TransactionCase
class TestUsers(TransactionCase):
def test_name_search(self):
""" Check name_search on user. """
User = self.env['res.users']
test_user = User.... |
paultcochrane/bokeh | refs/heads/master | examples/plotting/file/stocks.py | 41 | import numpy as np
from bokeh.sampledata.stocks import AAPL, FB, GOOG, IBM, MSFT
from bokeh.plotting import figure, show, output_file, vplot
output_file("stocks.html", title="stocks.py example")
p1 = figure(x_axis_type = "datetime")
p1.line(np.array(AAPL['date'], 'M64'), AAPL['adj_close'], color='#A6CEE3', legend='... |
sxend/FrameworkBenchmarks | refs/heads/master | toolset/benchmark/framework_test.py | 18 | import os
import traceback
from requests import ConnectionError, Timeout
from toolset.utils.output_helper import log
# Cross-platform colored text
from colorama import Fore, Style
class FrameworkTest:
def __init__(self, name, directory, benchmarker, runTests,
args):
'''
Construc... |
2015fallhw/user9999 | refs/heads/master | js/Brython3.2.2-20150927-180218/Lib/webbrowser.py | 735 | from browser import window
__all__ = ["Error", "open", "open_new", "open_new_tab"]
class Error(Exception):
pass
_target = { 0: '', 1: '_blank', 2: '_new' } # hack...
def open(url, new=0, autoraise=True):
"""
new window or tab is not controllable
on the client side. autoraise not available.
""... |
ljjehl-XHD/android_kernel_htc_msm8960 | refs/heads/lollipop | scripts/tracing/draw_functrace.py | 14679 | #!/usr/bin/python
"""
Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com>
Licensed under the terms of the GNU GPL License version 2
This script parses a trace provided by the function tracer in
kernel/trace/trace_functions.c
The resulted trace is processed into a tree to produce a more human
view of the call ... |
chiefspace/udemy-rest-api | refs/heads/master | udemy_rest_api_section6/env/lib/python3.4/site-packages/sqlalchemy/dialects/firebird/base.py | 33 | # firebird/base.py
# Copyright (C) 2005-2017 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
r"""
.. dialect:: firebird
:name: Firebird
Firebird Dialects
----------------... |
mikewiebe-ansible/ansible | refs/heads/devel | lib/ansible/modules/cloud/vmware/vmware_guest_find.py | 18 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2017, 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',
... |
gpoulin/luigi | refs/heads/master | test/rpc_test.py | 7 | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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... |
xyloeric/pi | refs/heads/master | piExp/users/views.py | 55 | # -*- coding: utf-8 -*-
# Import the reverse lookup function
from django.core.urlresolvers import reverse
# view imports
from django.views.generic import DetailView
from django.views.generic import RedirectView
from django.views.generic import UpdateView
from django.views.generic import ListView
# Only authenticated ... |
plastic-data/plastic-auth-ui | refs/heads/master | plastic_auth_ui/contexts.py | 1 | # -*- coding: utf-8 -*-
# Plastic-Auth-UI -- Accounts & authentication user interface
# By: Emmanuel Raviart <emmanuel@raviart.com>
#
# Copyright (C) 2014 Emmanuel Raviart
# https://github.com/plastic-data/plastic-auth-ui
#
# This file is part of Plastic-Auth-UI.
#
# Plastic-Auth-UI is free software; you can redistri... |
yichengq/kubernetes | refs/heads/master | cluster/saltbase/salt/_states/container_bridge.py | 29 | # Copyright 2014 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... |
prosthetichead/arcadia_admin | refs/heads/master | setup.py | 1 | import os
import sys
import datetime
from cx_Freeze import setup, Executable
def files_under_dir(dir_name):
file_list = []
for root, dirs, files in os.walk(dir_name):
for name in files:
file_list.append(os.path.join(root, name))
return file_list
includefiles = [ 'arcadia_admin/', 'conf... |
kikokubo/Sick-Beard-TPB | refs/heads/ThePirateBay | lib/hachoir_parser/program/elf.py | 90 | """
ELF (Unix/BSD executable file format) parser.
Author: Victor Stinner
Creation date: 08 may 2006
"""
from lib.hachoir_parser import Parser
from lib.hachoir_core.field import (FieldSet, ParserError,
UInt8, UInt16, UInt32, Enum,
String, Bytes)
from lib.hachoir_core.text_handler import textHandler, hexadecima... |
amarant/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/pytest/testing/test_recwarn.py | 174 | import warnings
import py
import pytest
from _pytest.recwarn import WarningsRecorder
def test_recwarn_functional(testdir):
reprec = testdir.inline_runsource("""
import warnings
oldwarn = warnings.showwarning
def test_method(recwarn):
assert warnings.showwarning != oldwarn
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.