repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
BadgerMaps/django-allauth
refs/heads/master
allauth/socialaccount/providers/facebook/migrations/0003_tosocialaccount.py
82
# encoding: utf-8 from south.v2 import DataMigration class Migration(DataMigration): depends_on = (('socialaccount', '0002_genericmodels'),) def forwards(self, orm): # Migrate FB apps app_id_to_sapp = {} for app in orm.FacebookApp.objects.all(): sapp = orm['socialaccount.S...
DavidNorman/tensorflow
refs/heads/master
tensorflow/python/kernel_tests/sparse_concat_op_test.py
24
# 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...
ContributeToScience/participant-booking-app
refs/heads/master
booking/booking/settings/__init__.py
14337
wasade/qiime
refs/heads/master
scripts/parallel_merge_otu_tables.py
1
#!/usr/bin/env python from __future__ import division __author__ = "Daniel McDonald" __copyright__ = "Copyright 2013, The QIIME Project" __credits__ = ["Daniel McDonald", "Greg Caporaso", "Jai Ram Rideout"] __license__ = "GPL" __version__ = "1.8.0-dev" __maintainer__ = "Daniel McDonald" __email__ = "mcdonadt@colorado...
Antiun/odoo
refs/heads/8.0
addons/l10n_ae/__init__.py
669
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2014 Tech Receptives (<http://techreceptives.com>). # # This program is free software: you can redistribute it and/or modify # it under the te...
ampax/edx-platform-backup
refs/heads/live
pavelib/utils/test/suites/bokchoy_suite.py
7
""" Class used for defining and running Bok Choy acceptance test suite """ from paver.easy import sh from pavelib.utils.test.suites import TestSuite from pavelib.utils.envs import Env from pavelib.utils.test import bokchoy_utils from pavelib.utils.test import utils as test_utils try: from pygments.console import c...
meletakis/collato
refs/heads/master
lib/python2.7/site-packages/PIL/McIdasImagePlugin.py
40
# # The Python Imaging Library. # $Id$ # # Basic McIdas support for PIL # # History: # 1997-05-05 fl Created (8-bit images only) # 2009-03-08 fl Added 16/32-bit support. # # Thanks to Richard Jones and Craig Swank for specs and samples. # # Copyright (c) Secret Labs AB 1997. # Copyright (c) Fredrik Lundh 1997. # # Se...
ClonedOne/pandalog_investigator
refs/heads/master
pandaloginvestigator/core/utils/string_utils.py
1
""" This module contains fixed string parameters used by different modules inside the application. """ # File extensions ext_investigator_clue = '_ss.txt' ext_pandalog_file = '.plog' # Paths relevant to the application. dir_unpacked_path = 'dir_unpacked' dir_translated_path = 'dir_translated' dir_results_path = 'di...
rnyberg/pyfibot
refs/heads/chanprot
pyfibot/modules/module_geoip.py
1
from __future__ import unicode_literals, print_function, division import pygeoip import os.path import sys import socket # http://dev.maxmind.com/geoip/legacy/geolite/ DATAFILE = os.path.join(sys.path[0], "GeoIP.dat") # STANDARD = reload from disk # MEMORY_CACHE = load to memory # MMAP_CACHE = memory using mmap gi4 =...
applicationdevm/XlsxWriter
refs/heads/master
xlsxwriter/test/worksheet/test_cond_format18.py
8
############################################################################### # # Tests for XlsxWriter. # # Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org # import unittest from ...compatibility import StringIO from ..helperfunctions import _xml_to_list from ...worksheet import Worksheet class TestAss...
baidu/Paddle
refs/heads/develop
python/paddle/fluid/tests/unittests/test_parallel_executor_dry_run.py
1
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
Axam/nsx-web
refs/heads/master
fuelmenu/fuelmenu/common/modulehelper.py
6
# -*- coding: utf-8 -*- # Copyright 2013 Mirantis, 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 requi...
tlevine/be
refs/heads/master
libbe/storage/util/settings_object.py
5
# Bugs Everywhere - a distributed bugtracker # Copyright (C) 2008-2012 Chris Ball <cjb@laptop.org> # Gianluca Montecchi <gian@grys.it> # W. Trevor King <wking@tremily.us> # # This file is part of Bugs Everywhere. # # Bugs Everywhere is free software: you can redistribute ...
balint256/gnuradio
refs/heads/master
gr-digital/python/digital/qpsk.py
49
# # Copyright 2005,2006,2011 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at your option) # any later ve...
GenericStudent/home-assistant
refs/heads/dev
script/translations/develop.py
14
"""Compile the current translation strings files for testing.""" import argparse import json from pathlib import Path import re from shutil import rmtree import sys from . import download, upload from .const import INTEGRATIONS_DIR from .util import get_base_arg_parser def valid_integration(integration): """Test...
samchrisinger/osf.io
refs/heads/develop
api/base/utils.py
4
# -*- coding: utf-8 -*- from modularodm import Q from modularodm.exceptions import NoResultsFound from rest_framework.exceptions import NotFound from rest_framework.reverse import reverse import furl from website import util as website_util # noqa from website import settings as website_settings from framework.auth i...
benjamindeleener/odoo
refs/heads/master
addons/mail/models/mail_shortcode.py
6
# -*- coding: utf-8 -*- import cgi import re from openerp import api, fields, models class MailShortcode(models.Model): """ Shortcode Canned Responses, allowing the user to defined shortcuts in its message. Should be applied before storing message in database. Emoji allowing replacing text with i...
atwilc3000/buildroot-at91
refs/heads/master
support/testing/infra/builder.py
3
import os import shutil import subprocess import infra class Builder(object): def __init__(self, config, builddir, logtofile): self.config = config self.builddir = builddir self.logfile = infra.open_log_file(builddir, "build", logtofile) def build(self): if not os.path.isdir(s...
zhangyanfa/yanfaz-php-buildpack
refs/heads/master
scripts/release.py
46
#!/usr/bin/env python # 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 "Lice...
damdam-s/OCB
refs/heads/8.0
addons/point_of_sale/report/pos_users_product.py
380
# -*- 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...
hsluo/youtube-dl
refs/heads/master
youtube_dl/extractor/xuite.py
60
# -*- coding: utf-8 -*- from __future__ import unicode_literals import base64 from .common import InfoExtractor from ..compat import compat_urllib_parse_unquote from ..utils import ( ExtractorError, parse_iso8601, parse_duration, ) class XuiteIE(InfoExtractor): IE_DESC = '隨意窩Xuite影音' _REGEX_BASE...
quasiben/bokeh
refs/heads/master
examples/plotting/file/lorenz.py
4
import numpy as np from scipy.integrate import odeint from bokeh.plotting import figure, show, output_file sigma = 10 rho = 28 beta = 8.0/3 theta = 3 * np.pi / 4 def lorenz(xyz, t): x, y, z = xyz x_dot = sigma * (y - x) y_dot = x * rho - x * z - y z_dot = x * y - beta* z return [x_dot, y_dot, z_...
sanjeevtripurari/hue
refs/heads/master
desktop/core/ext-py/python-openid-2.2.5/examples/djopenid/server/models.py
10644
from django.db import models # Create your models here.
ChaseSnapshot/smcity
refs/heads/master
seattle_slides/all_beats.py
1
#!/usr/bin/python import datetime import geojson import logging import logging.config from ConfigParser import ConfigParser from uuid import uuid4 print "Setting up the logging configuration..." logging.config.fileConfig('config/seattle_smcity.conf') logging.getLogger('boto').setLevel(logging.INFO) from smcity.anal...
EntilZha/docker-workshop
refs/heads/master
frontend/api/migrations/0001_initial.py
2
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Place', fields=[ ('id', models.AutoField(verbos...
bootphon/phonemizer
refs/heads/master
test/test_separator.py
1
# Copyright 2015-2021 Thomas Schatz, Xuan Nga Cao, Mathieu Bernard # # This file is part of phonemizer: 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. #...
alrusdi/lettuce
refs/heads/master
tests/integration/lib/Django-1.2.5/django/core/files/base.py
90
import os try: from cStringIO import StringIO except ImportError: from StringIO import StringIO from django.utils.encoding import smart_str, smart_unicode from django.core.files.utils import FileProxyMixin class File(FileProxyMixin): DEFAULT_CHUNK_SIZE = 64 * 2**10 def __init__(self, file, name=None)...
codeparticle/Tenable.io-SDK-for-Python
refs/heads/master
tenable_io/api/sc_test_jobs.py
2
from tenable_io.api.base import BaseApi from tenable_io.api.models import ScTestJob class ScTestJobsApi(BaseApi): def status(self, job_id): """Get the status of a test. :param job_id: The job ID. :raise TenableIOApiException: When API error is encountered. :return: An instance o...
loristissino/PythonDaZero
refs/heads/master
lezione6/try_except.py
1
#!/usr/bin/env python3 def title(s, level): if level>1: print() print(s) print(('=', '-')[level-1]*len(s)) title("Quarto esempio", 1) def qualcosa(v): a=None try: a=1/int(v) #raise ValueError("Something wrong") except ZeroDivisionError as err: print("Tentativo...
apark263/tensorflow
refs/heads/master
tensorflow/python/kernel_tests/reshape_op_test.py
10
# 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...
sysadminmatmoz/odoo-clearcorp
refs/heads/8.0
account_bank_balance_report/wizard/__init__.py
4
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Addons modules by CLEARCORP S.A. # Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>). # # This program is free software: you can redistribute...
timmontague/euler-solutions
refs/heads/master
101/optimum-polynomial.py
1
#!/usr/bin/env python3 import numpy def main(): total = 0 done = False x = list() y = list() for n in range(0,1000): x.append(n+1) y.append(1) for i in range(1,11): if i&1: y[n] -= pow(n+1,i) else: y[n] += pow(n+1,i) n = 0 while not done: n += 1 print("x: " + str(x[0:n])) print("y: "...
Dziolas/inspire-next
refs/heads/master
inspire/modules/forms/validators.py
1
# -*- coding: utf-8 -*- # # This file is part of INSPIRE. # Copyright (C) 2014, 2015 CERN. # # INSPIRE 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...
sperka/shogun
refs/heads/develop
examples/undocumented/python_modular/kernel_weighted_degree_string_modular.py
24
#!/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,3],[traindat,testdat,20]] def kernel_weighted_degree_string_modular (fm_train_dna=traindat,fm_test_dna=testdat...
mamachanko/lymph
refs/heads/master
lymph/core/trace.py
11
import logging import uuid import gevent from lymph.utils.gpool import NonBlockingPool logger = logging.getLogger(__name__) def get_trace(greenlet=None): greenlet = greenlet or gevent.getcurrent() if not hasattr(greenlet, '_lymph_trace'): greenlet._lymph_trace = {} return greenlet._lymph_trace...
thomas15v/easyadbpy
refs/heads/master
easy_adb/EasyAdbWindow.py
1
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- ### BEGIN LICENSE # Copyright (C) 2013 Thomas Vanmellaerts <tvanmellaerts@live.be> # 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 F...
Klaudit/wagtail
refs/heads/master
wagtail/wagtailredirects/wagtail_hooks.py
15
from django.core import urlresolvers from django.conf.urls import include, url from django.utils.translation import ugettext_lazy as _ from django.contrib.auth.models import Permission from wagtail.wagtailcore import hooks from wagtail.wagtailredirects import urls from wagtail.wagtailadmin.menu import MenuItem @hoo...
indictranstech/internal-erpnext
refs/heads/develop
erpnext/setup/doctype/sales_partner/__init__.py
37694
from __future__ import unicode_literals
jarshwah/django
refs/heads/master
django/db/backends/postgresql_psycopg2/client.py
465
from ..postgresql.client import * # NOQA
Infinidat/infi.pyutils
refs/heads/master
infi/pyutils/exceptions.py
1
class ReflectionException(Exception): pass class SignatureException(ReflectionException): pass class MissingArguments(SignatureException): pass class UnknownArguments(SignatureException): pass class InvalidKeywordArgument(ReflectionException): pass
camradal/ansible
refs/heads/devel
lib/ansible/modules/cloud/openstack/os_server_volume.py
29
#!/usr/bin/python #coding: utf-8 -*- # Copyright (c) 2014 Hewlett-Packard Development Company, L.P. # # This module is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at yo...
datawire/bakerstreet
refs/heads/master
_metadata_watson.py
2
# Copyright 2015 datawire. 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 agr...
actuaryzhang/spark
refs/heads/master
python/pyspark/accumulators.py
20
# # 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...
18padx08/PPTex
refs/heads/master
PPTexEnv_x86_64/lib/python2.7/site-packages/pip/__main__.py
558
import sys from .runner import run if __name__ == '__main__': exit = run() if exit: sys.exit(exit)
TobiasLohner/SkyLines
refs/heads/master
skylines/commands/users/merge.py
3
from flask.ext.script import Command, Option import sys from skylines.database import db from skylines.model import User, Club, IGCFile, Flight, TrackingFix class Merge(Command): """ Merge two user accounts """ option_list = ( Option('new_id', type=int, help='ID of the new user account'), O...
bclay/teamtechdraft
refs/heads/master
pygithub3/tests/services/test_orgs.py
8
# -*- encoding: utf-8 -*- import requests from mock import patch from pygithub3.services.orgs import Org, Members, Teams from pygithub3.tests.utils.base import (dummy_json, mock_response, mock_response_result) from pygithub3.tests.utils.core import TestCase from pygithub3.tests.utils.services import _ @dummy_js...
avorio/Neon.js
refs/heads/master
neonsrv/tornadoapi.py
1
import os from modifymei import ModifyDocument import tornado.web import json import conf ##################################################### # NEUME HANDLER CLASSES # ##################################################### class InsertNeumeHandler(tornado.web.RequestHandler): def p...
gskywolf/Firefly-RK3288-Kernel
refs/heads/master
tools/perf/scripts/python/event_analyzing_sample.py
4719
# event_analyzing_sample.py: general event handler in python # # Current perf report is already very powerful with the annotation integrated, # and this script is not trying to be as powerful as perf report, but # providing end user/developer a flexible way to analyze the events other # than trace points. # # The 2 dat...
tjsavage/full_nonrel_starter
refs/heads/master
django/db/backends/oracle/base.py
150
""" Oracle database backend for Django. Requires cx_Oracle: http://cx-oracle.sourceforge.net/ """ import datetime import sys import time from decimal import Decimal def _setup_environment(environ): import platform # Cygwin requires some special voodoo to set the environment variables # properly so that...
fancasy/final
refs/heads/master
lib/jinja2/meta.py
1
# -*- coding: utf-8 -*- """ jinja2.meta ~~~~~~~~~~~ This module implements various functions that exposes information about templates that might be interesting for various kinds of applications. :copyright: (c) 2010 by the Jinja Team, see AUTHORS for more details. :license: BSD, see L...
wei0831/fileorganizer
refs/heads/master
fileorganizer/fanhaorename.py
1
#!/usr/bin/python """ fanhaorename.py """ import os import os.path import logging import fileorganizer from fileorganizer import _helper from fileorganizer.replacename import _replacename __author__ = "Jack Chang <wei0831@gmail.com>" def _tagHelper(tag): """ TODO """ result = "" for c in tag: ...
Pluto-tv/chromium-crosswalk
refs/heads/master
tools/telemetry/third_party/modulegraph/modulegraph_tests/testpkg-relimport/pkg/subpkg/relative2.py
26
""" pkg.subpkg.relative """ from __future__ import absolute_import from ..relimport import __doc__ as doc
geopython/QGIS
refs/heads/master
scripts/qgis_fixes/fix_reduce.py
77
from lib2to3.fixes.fix_reduce import FixReduce
Pulgama/supriya
refs/heads/master
supriya/ugens/BLowCut.py
1
import collections from supriya import CalculationRate from supriya.ugens.BEQSuite import BEQSuite class BLowCut(BEQSuite): """ A low-cut filter. :: >>> source = supriya.ugens.In.ar(0) >>> blow_cut = supriya.ugens.BLowCut.ar( ... frequency=1200, ... max_order=5, ...
ptisserand/ansible
refs/heads/devel
contrib/inventory/landscape.py
405
#!/usr/bin/env python # (c) 2015, Marc Abramowitz <marca@surveymonkey.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 # (...
Tatsh/youtube-dl
refs/heads/master
youtube_dl/extractor/vodlocker.py
64
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( ExtractorError, NO_DEFAULT, sanitized_Request, urlencode_postdata, ) class VodlockerIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?vodlocker\.(?:com|city)/(?:embed-)?(?P<id>[0-9a-...
PappaPeppar/micropython
refs/heads/master
tests/basics/subclass_native2_tuple.py
102
class Base1: def __init__(self, *args): print("Base1.__init__", args) class Ctuple1(Base1, tuple): pass a = Ctuple1() print(len(a)) a = Ctuple1([1, 2, 3]) print(len(a)) print("---") class Ctuple2(tuple, Base1): pass a = Ctuple2() print(len(a)) a = Ctuple2([1, 2, 3]) print(len(a))
leafjungle/luigi
refs/heads/master
luigi/contrib/redis_store.py
74
# -*- 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...
HopeFOAM/HopeFOAM
refs/heads/master
ThirdParty-0.1/ParaView-5.0.1/VTK/IO/Geometry/Testing/Python/TestPlot3DMeta.py
20
#!/usr/bin/env python import vtk from vtk.test import Testing from vtk.util.misc import vtkGetDataRoot VTK_DATA_ROOT = vtkGetDataRoot() renWin = vtk.vtkRenderWindow() iren = vtk.vtkRenderWindowInteractor() iren.SetRenderWindow(renWin) r = vtk.vtkPlot3DMetaReader() r.SetFileName("%s/Data/test.p3d" % VTK_DATA_ROOT) ...
EHRI/rspub-core
refs/heads/master
setup.py
1
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from setuptools import setup from rspub import version setup( name='rspub-core', version=version.__version__, packages=['rspub.util', 'rspub.pluggable', 'rspub.core', 'rspub.cli'], url='https://github.com/EHRI/rspub-core', license='Apache License 2.0',...
Carrotsmile/CS428
refs/heads/master
steerstats/tools/deap/benchmarks/movingpeaks.py
19
# This file is part of DEAP. # # DEAP is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as # published by the Free Software Foundation, either version 3 of # the License, or (at your option) any later version. # # DEAP is distributed ...
nayas360/pyterm
refs/heads/main
bin/rem.py
1
# rem remarks def _help(): usage = ''' Usage: rem <remarks> -h print this help ''' print(usage) def main(argv): # rem just checked for -h # argv.pop(0) was never required if '-h' in argv: _help()
saurabh6790/aimobilize-lib-backup
refs/heads/master
webnotes/utils/email_lib/html2text.py
34
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt #!/usr/bin/env python from __future__ import unicode_literals """html2text: Turn HTML into equivalent Markdown-structured text.""" __version__ = "3.02" __author__ = "Aaron Swartz (me@aaronsw.com)" __copyright__ = "(...
takeshineshiro/keystone
refs/heads/master
keystone/tests/unit/test_policy.py
4
# Copyright 2011 Piston Cloud Computing, 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 # # Unle...
passiweinberger/nupic
refs/heads/master
tests/integration/nupic/algorithms/tp_segment_learning.py
34
#!/usr/bin/env python # ---------------------------------------------------------------------- # 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 ...
uberamd/NGECore2
refs/heads/master
scripts/object/tangible/item/entertainer_console/stage_generated_backdrop_09.py
85615
import sys def setup(core, object): return
Soya93/Extract-Refactoring
refs/heads/master
python/helpers/pockets/iterators.py
25
# -*- coding: utf-8 -*- # Copyright (c) 2015, by the Pockets team, see AUTHORS. # Licensed under the BSD License, see LICENSE for details. """A pocket full of useful iterators!""" from __future__ import absolute_import import collections import six __all__ = ["peek_iter", "modify_iter"] class peek_iter(object): ...
JetBrains/intellij-community
refs/heads/master
python/helpers/pydev/pydev_tests_python/test_save_locals.py
26
import inspect import sys import unittest from _pydevd_bundle.pydevd_save_locals import save_locals from _pydevd_bundle.pydevd_constants import IS_JYTHON, IS_IRONPYTHON import pytest def use_save_locals(name, value): """ Attempt to set the local of the given name to value, using locals_to_fast. """ f...
petrutlucian94/nova_dev
refs/heads/master
nova/tests/network/test_ipam_lib.py
27
# Copyright 2013 IBM Corp. # 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 ...
luzfcb/pylama
refs/heads/develop
pylama/lint/pylama_pyflakes/pyflakes/messages.py
34
""" Provide the class Message and its subclasses. """ class Message(object): message = '' message_args = () def __init__(self, filename, loc): self.filename = filename self.lineno = loc.lineno self.col = getattr(loc, 'col_offset', 0) def __str__(self): return '%s:%s: ...
dahlstrom-g/intellij-community
refs/heads/master
python/testData/quickFixes/PyRemoveParameterQuickFixTest/kwParam.py
80
def foo(r, **<caret>kwargs): def a(): pass x = 1 x = 2
manjunaths/tensorflow
refs/heads/master
tensorflow/python/summary/writer/writer_test.py
21
# 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...
mitocw/edx-platform
refs/heads/master
lms/djangoapps/verify_student/migrations/0003_auto_20151113_1443.py
5
# -*- coding: utf-8 -*- from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('verify_student', '0002_auto_20151124_1024'), ] operations = [ migrations.AlterField( model_name='historicalverificationdeadline', name='dea...
gameduell/duell
refs/heads/master
bin/mac/python2.7.9/lib/python2.7/idlelib/MultiCall.py
27
""" MultiCall - a class which inherits its methods from a Tkinter widget (Text, for example), but enables multiple calls of functions per virtual event - all matching events will be called, not only the most specific one. This is done by wrapping the event functions - event_add, event_delete and event_info. MultiCall r...
smolix/incubator-mxnet
refs/heads/master
tests/python/train/test_mlp.py
28
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
PengFeiLi/ns3
refs/heads/master
.waf-1.8.19-b1fc8f7baef51bd2db4c2971909a568d/waflib/Task.py
10
#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file import os,re,sys from waflib import Utils,Logs,Errors NOT_RUN=0 MISSING=1 CRASHED=2 EXCEPTION=3 SKIPPED=8 SUCCESS=9 ASK_LATER=-1 SKIP_ME=-2 RUN_ME=-3 COMPILE_TEMPLATE_SHELL=''' def f(tsk): env = tsk...
adfernandes/mbed
refs/heads/master
tools/host_tests/host_tests_plugins/module_copy_silabs.py
13
""" mbed SDK Copyright (c) 2011-2013 ARM Limited SPDX-License-Identifier: Apache-2.0 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 ...
micropython/micropython
refs/heads/master
tests/internal_bench/funcall-2-funcall.py
15
# Function call overhead test # Perform the same trivial operation as global function call import bench def f(x): return x + 1 def test(num): for i in iter(range(num)): a = f(i) bench.run(test)
openstack/networking-mlnx
refs/heads/master
networking_mlnx/eswitchd/cli/exceptions.py
4
# Copyright 2013 Mellanox Technologies, 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 t...
buptlsl/django-rest-framework
refs/heads/master
rest_framework/settings.py
68
""" Settings for REST framework are all namespaced in the REST_FRAMEWORK setting. For example your project's `settings.py` file might look like this: REST_FRAMEWORK = { 'DEFAULT_RENDERER_CLASSES': ( 'rest_framework.renderers.JSONRenderer', 'rest_framework.renderers.TemplateHTMLRenderer', ) ...
saurabh6790/med_new_lib
refs/heads/master
webnotes/utils/scheduler.py
32
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals """ Scheduler will call the following events from the module `startup.schedule_handler` and Control Panel (for server scripts) execute_always execute_daily execute_monthly ex...
6112/project-euler
refs/heads/master
problems/039.py
1
# encoding=utf-8 ## SOLVED 2013/12/25 ## 840 # If p is the perimeter of a right angle triangle with integral length sides, # {a,b,c}, there are exactly three solutions for p = 120. # {20,48,52}, {24,45,51}, {30,40,50} # For which value of p ≤ 1000, is the number of solutions maximised? import math MAX = 1000 def ...
Stub-O-Matic-BA/stubo-app
refs/heads/master
stubo/match/tests/test_request_matcher.py
5
#-*- coding: utf-8 -*- import unittest from hamcrest import * from stubo.match.request_matcher import ( has_method, body_contains, has_path, has_query_args, has_url_pattern, body_xpath, body_jsonpath, has_headers ) class Base(unittest.TestCase): def get_stubo_request(self, body=None, **kwargs): ...
inasafe/inasafe
refs/heads/develop
safe/gis/vector/reclassify.py
3
# coding=utf-8 """Reclassify a continuous vector layer.""" from qgis.core import QgsField from safe.common.exceptions import InvalidKeywordsForProcessingAlgorithm from safe.definitions.fields import hazard_class_field, hazard_value_field from safe.definitions.processing_steps import reclassify_vector_steps from safe...
vdmitriyev/pyorcid
refs/heads/master
examples/extracting_bibtex.py
1
# coding: utf-8 # importing module located in parent folder import sys sys.path.insert(0, '../') # main testing library import pyorcid as orcid # additional libraries import os import json import codecs # setting logging to the DEBUG mode import logging #logging.getLogger("#orcid#").setLevel(logging.DEBUG) logging...
antoinecarme/pyaf
refs/heads/master
tests/artificial/transf_Difference/trend_PolyTrend/cycle_5/ar_12/test_artificial_1024_Difference_PolyTrend_5_12_100.py
1
import pyaf.Bench.TS_datasets as tsds import tests.artificial.process_artificial_dataset as art art.process_dataset(N = 1024 , FREQ = 'D', seed = 0, trendtype = "PolyTrend", cycle_length = 5, transform = "Difference", sigma = 0.0, exog_count = 100, ar_order = 12);
valentin-krasontovitsch/ansible
refs/heads/devel
lib/ansible/modules/cloud/amazon/ec2_asg_lifecycle_hook.py
60
#!/usr/bin/python # Copyright: (c) 2017, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = {'status': ['preview'], 'supported_by': 'community', 'metadata_version': '1.1'} DOCUMENTATION = """ --- modu...
nickzuber/ClusterRunner
refs/heads/master
app/common/console_output.py
2
import collections import zipfile from typing import BinaryIO, Optional from app.common.console_output_segment import ConsoleOutputSegment from app.util.exceptions import BadRequestError class ConsoleOutput: """The console output of an atom""" @classmethod def from_plaintext(cls, path: str) -> 'Console...
ulope/django
refs/heads/master
tests/distinct_on_fields/tests.py
49
from __future__ import unicode_literals from django.db.models import Max from django.test import TestCase, skipUnlessDBFeature from django.test.utils import str_prefix from .models import Tag, Celebrity, Fan, Staff, StaffTag @skipUnlessDBFeature('can_distinct_on_fields') @skipUnlessDBFeature('supports_nullable_uniq...
gundalow/ansible-modules-extras
refs/heads/devel
remote_management/ipmi/ipmi_power.py
27
#!/usr/bin/python # -*- coding: utf-8 -*- # # 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. ...
aosingh/Regularization
refs/heads/master
LinfinityRegularization/MSE_Linfinity.py
1
import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt import matplotlib.patches as mpatches from sklearn.datasets.samples_generator import make_regression from mpl_toolkits.mplot3d import Axes3D from LinfinityRegularizerTester import start_Linfinity_regression # Define synthetic data-set constan...
Dockerizing/dockerizing-bootstrap
refs/heads/master
tests/__init__.py
1
import sure import sys from os import path as osp PROJECT_DIR = osp.dirname(osp.dirname(osp.realpath(__file__))) sys.path.append(osp.join(PROJECT_DIR, 'baselibs', 'python')) from dldbase.logutil import logging_init logging_init(osp.join(PROJECT_DIR, 'logs'))
obulpathi/poppy
refs/heads/master
poppy/dns/base/responder.py
3
# Copyright (c) 2014 Rackspace, 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 wr...
ShashaQin/frappe
refs/heads/develop
frappe/templates/includes/comments/comments.py
3
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe import frappe.utils from frappe.website.render import clear_cache from frappe import _ @frappe.whitelist(allow_guest=True) def add_comment(args=None): """ args ...
ciarakamahele/sasy
refs/heads/master
simulator/Tests/KitchenTestPlannerTest.py
1
# Copyright 2015 Ciara Kamahele-Sanfratello # # 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...
consulo/consulo-python
refs/heads/master
plugin/src/main/dist/helpers/pydev/pydevd_attach_to_process/winappdbg/win32/context_amd64.py
102
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2009-2014, Mario Vilas # 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...
navycrow/Sick-Beard
refs/heads/development
sickbeard/clients/generic.py
6
import re import time from hashlib import sha1 import sickbeard from sickbeard import logger from sickbeard.exceptions import ex from sickbeard.clients import http_error_code from lib.bencode import bencode, bdecode from lib import requests class GenericClient(object): def __init__(self, name, host=None, use...
UCL-CS35/incdb-poc
refs/heads/master
venv/share/doc/networkx-1.11/examples/graph/erdos_renyi.py
17
# -*- coding: utf-8 -*- #!/usr/bin/env python """ Create an G{n,m} random graph with n nodes and m edges and report some properties. This graph is sometimes called the Erdős-Rényi graph but is different from G{n,p} or binomial_graph which is also sometimes called the Erdős-Rényi graph. """ # Author: Aric Hagberg (hagb...
matmutant/sl4a
refs/heads/master
python-build/python-libs/gdata/src/gdata/tlslite/mathtls.py
273
"""Miscellaneous helper functions.""" from utils.compat import * from utils.cryptomath import * import hmac import md5 import sha #1024, 1536, 2048, 3072, 4096, 6144, and 8192 bit groups] goodGroupParameters = [(2,0xEEAF0AB9ADB38DD69C33F80AFA8FC5E86072618775FF3C0B9EA2314C9C256576D674DF7496EA81D3383B4813D692C6E0E0D5D...
whtsky/Gather
refs/heads/master
gather/app.py
1
# -*- coding:utf-8 -*- import os BASEDIR = os.path.dirname(os.path.abspath(__file__)) from flask import Flask, g, request from flask.ext.turbolinks import turbolinks from jinja2 import MemcachedBytecodeCache from gather.extensions import db, assets, mail, cache, api_manager from gather.settings import load_settings ...