repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
0x7678/openbts-
refs/heads/master
RRLP/tests/runtest.py
2
#!/usr/bin/python from __future__ import with_statement import sys import os import struct executable='rrlpconverter' def binary(x): n = bin(x)[2:] if len(n)%8 != 0: n = '0'*(8 - len(n)%8) + n return n def hex2str(h): """ h is a string of hexadecimal chars returns a string whose hexadec...
nhicher/ansible
refs/heads/devel
lib/ansible/modules/cloud/spotinst/spotinst_aws_elastigroup.py
8
#!/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) from __future__ import (absolute_import, division, print_function) ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
blueyed/django-autocomplete-light
refs/heads/master
autocomplete_light/autocomplete/list.py
1
from __future__ import unicode_literals from django.utils.encoding import force_text __all__ = ('AutocompleteList',) class AutocompleteList(object): """ Simple Autocomplete implementation which expects :py:attr:`choices` to be a list of string choices. .. py:attribute:: choices List of str...
qizenguf/MLC-STT
refs/heads/master
ext/ply/example/BASIC/basiclex.py
166
# An implementation of Dartmouth BASIC (1964) from ply import * keywords = ( 'LET','READ','DATA','PRINT','GOTO','IF','THEN','FOR','NEXT','TO','STEP', 'END','STOP','DEF','GOSUB','DIM','REM','RETURN','RUN','LIST','NEW', ) tokens = keywords + ( 'EQUALS','PLUS','MINUS','TIMES','DIVIDE','POWER', 'LPAREN...
RichardLitt/wyrd-django-dev
refs/heads/master
tests/modeltests/get_object_or_404/tests.py
50
from __future__ import absolute_import from django.http import Http404 from django.shortcuts import get_object_or_404, get_list_or_404 from django.test import TestCase from .models import Author, Article class GetObjectOr404Tests(TestCase): def test_get_object_or_404(self): a1 = Author.objects.create(na...
mazhekin/node-workshop
refs/heads/master
challenge6/finished/node_modules/browserify/node_modules/module-deps/node_modules/detective/node_modules/esprima-six/tools/generate-unicode-regex.py
341
#!/usr/bin/python # -*- coding: utf-8 -*- # By Yusuke Suzuki <utatane.tea@gmail.com> # Modified by Mathias Bynens <http://mathiasbynens.be/> # http://code.google.com/p/esprima/issues/detail?id=110 import sys import string import re class RegExpGenerator(object): def __init__(self, detector): self.de...
springcoil/euroscipy_proceedings
refs/heads/master
publisher/tempita/__init__.py
34
""" A small templating language This implements a small templating language. This language implements if/elif/else, for/continue/break, expressions, and blocks of Python code. The syntax is:: {{any expression (function calls etc)}} {{any expression | filter}} {{for x in y}}...{{endfor}} {{if x}}x{{elif y}}y...
applicationdevm/XlsxWriter
refs/heads/master
examples/chart_pie.py
8
####################################################################### # # An example of creating Excel Pie charts with Python and XlsxWriter. # # The demo also shows how to set segment colours. It is possible to # define chart colors for most types of XlsxWriter charts # via the add_series() method. However, Pie/Doug...
miminus/youtube-dl
refs/heads/master
youtube_dl/extractor/googlesearch.py
168
from __future__ import unicode_literals import itertools import re from .common import SearchInfoExtractor from ..compat import ( compat_urllib_parse, ) class GoogleSearchIE(SearchInfoExtractor): IE_DESC = 'Google Video search' _MAX_RESULTS = 1000 IE_NAME = 'video.google:search' _SEARCH_KEY = 'g...
leekchan/django_test
refs/heads/master
django/contrib/gis/db/backends/base.py
8
""" Base/mixin classes for the spatial backend database operations and the `<Backend>SpatialRefSys` model. """ from functools import partial import re from django.contrib.gis import gdal from django.utils import six from django.utils.encoding import python_2_unicode_compatible class BaseSpatialFeatures(object): ...
noelbk/neutron-juniper
refs/heads/master
neutron/plugins/nicira/nsxlib/__init__.py
34
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2013 VMware, 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/lic...
guncoin/guncoin
refs/heads/master
share/qt/extract_strings_qt.py
24
#!/usr/bin/env python3 # Copyright (c) 2012-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. ''' Extract _("...") strings for translation and convert to Qt stringdefs so that they can be picked up by...
aps-sids/zulip
refs/heads/master
tools/emoji_dump/emoji_dump.py
114
#!/usr/bin/env python import os import shutil import subprocess import json from PIL import Image, ImageDraw, ImageFont class MissingGlyphError(Exception): pass def color_font(name, code_point): in_name = 'bitmaps/strike1/uni{}.png'.format(code_point) out_name = 'out/unicode/{}.png'.format(code_point) ...
wehkamp/ansible
refs/heads/devel
test/units/plugins/__init__.py
7690
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) an...
alset333/NetworkedLearningChatbot
refs/heads/master
PeterMaar-NetLrnChatBot/Client/PeterMaarNetworkedChatClientGUI.app/Contents/Resources/__boot__.py
1
def _reset_sys_path(): # Clear generic sys.path[0] import sys, os resources = os.environ['RESOURCEPATH'] while sys.path[0] == resources: del sys.path[0] _reset_sys_path() """ sys.argv emulation This module starts a basic event loop to collect file- and url-open AppleEvents. Those get converte...
r3tard/BartusBot
refs/heads/master
lib/protorpc/test_util.py
24
#!/usr/bin/env python # # Copyright 2010 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 o...
gordon-elliott/glod
refs/heads/master
src/glod/model/tax_rebate_submission.py
1
__copyright__ = 'Copyright(c) Gordon Elliott 2020' """ """ from enum import IntEnum from a_tuin.metadata import ( ObjectFieldGroupBase, Collection, IntEnumField, DecimalField, IntField, DateField, DescriptionField, StringField ) class SubmissionStatus(IntEnum): Preparing = 1 Posted = 2 Revoked...
Johnzero/erp
refs/heads/fga
openerp/addons/point_of_sale/wizard/pos_close_statement.py
9
# -*- 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...
dayatz/taiga-back
refs/heads/stable
taiga/projects/tagging/fields.py
1
# -*- coding: utf-8 -*- # Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz> # Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com> # Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net> # This program is free software: you can r...
3dfxmadscientist/CBSS
refs/heads/master
addons/account_test/report/account_test_report.py
44
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved # $Id$ # # This program is free software: you can redistribute it and/or modify #...
mientuma/shop
refs/heads/master
vendor/doctrine/orm/docs/en/conf.py
2448
# -*- coding: utf-8 -*- # # Doctrine 2 ORM documentation build configuration file, created by # sphinx-quickstart on Fri Dec 3 18:10:24 2010. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. ...
kpkhxlgy0/SublimeText3
refs/heads/master
Packages/Python PEP8 Autoformat/libs/py26/lib2to3/fixes/fix_metaclass.py
7
"""Fixer for __metaclass__ = X -> (metaclass=X) methods. The various forms of classef (inherits nothing, inherits once, inherints many) don't parse the same in the CST so we look at ALL classes for a __metaclass__ and if we find one normalize the inherits to all be an arglist. For one-liner classes ('c...
helldorado/ansible
refs/heads/devel
lib/ansible/module_utils/network/cnos/cnos.py
38
# This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by # Ansible still belong to the author of the module, and may assign their own # license to the complete wo...
jmartinm/invenio
refs/heads/master
modules/bibformat/lib/elements/bfe_authority_author.py
18
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 CERN. ## ## Invenio 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 ## ...
jbenden/ansible
refs/heads/devel
lib/ansible/modules/network/netscaler/netscaler_cs_vserver.py
7
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2017 Citrix Systems # 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 = {'status': ['preview'], ...
mozilla/kitsune
refs/heads/master
kitsune/dashboards/models.py
1
import logging from datetime import date, timedelta from django.conf import settings from django.db import connection, close_old_connections from django.db import models from django.utils.translation import ugettext_lazy as _lazy from kitsune.dashboards import LAST_7_DAYS, LAST_30_DAYS, LAST_90_DAYS, ALL_TIME, PERIOD...
Jacobinski/SaltBot
refs/heads/master
website/interface.py
1
''' The interface module for SaltBot ''' from bs4 import BeautifulSoup import requests import time import json URL_JSON = "http://www.saltybet.com/state.json" class interface: def __init__(self, session, request): # Match session self.session = session self.request = request self.m...
tomevans/spectroscopy
refs/heads/master
setup.py
2
from distutils.core import setup setup( name='spectroscopy', version='0.0.1', description='A Python package for extracting spectra from single slit and multiple slit spectroscopy frames.', author='Tom Evans', author_email='tom.evans@astro.ox.ac.uk', url='https://github.com/tomevans/...
krkeegan/insteon-mngr
refs/heads/master
insteon_mngr/sequences/modem.py
3
from insteon_mngr.trigger import PLMTrigger from insteon_mngr.sequences.common import WriteALDBRecord class WriteALDBRecordModem(WriteALDBRecord): def _perform_write(self): super()._perform_write() if self.in_use is True: self.data1 = self._linked_group.device.dev_cat ...
bhairavmehta95/flashcard-helper-alexa-skill
refs/heads/master
sqlalchemy/engine/default.py
10
# engine/default.py # Copyright (C) 2005-2016 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 """Default implementations of per-dialect sqlalchemy.engine classes. These are se...
jicksy/oneanddone_test
refs/heads/master
vendor-local/lib/python/requests/packages/charade/latin1prober.py
50
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer....
Dandandan/wikiprogramming
refs/heads/master
jsrepl/build/extern/python/closured/lib/python2.7/unittest/runner.py
109
"""Running tests""" import sys import time from . import result from .signals import registerResult __unittest = True class _WritelnDecorator(object): """Used to decorate file-like objects with a handy 'writeln' method""" def __init__(self,stream): self.stream = stream def __getattr__(self, at...
muelli/mysql-proxy-python
refs/heads/master
lib/rw_splitting.py
2
# LICENSE BEGIN # # Copyright (c) 2010 Ysj.Ray # # 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 program is dis...
mbernasocchi/inasafe
refs/heads/develop
safe/gis/processing_tools.py
1
# coding=utf-8 """Processing utilities and tools.""" import processing from qgis.core import ( QgsApplication, QgsFeatureRequest, QgsProcessingContext, QgsProcessingFeedback, QgsProject) from qgis.analysis import QgsNativeAlgorithms __copyright__ = "Copyright 2018, The InaSAFE Project" __license...
rajashreer7/autotest-client-tests
refs/heads/master
linux-tools/prelink/prelink.py
3
#!/bin/python import os, subprocess import logging from autotest.client import test from autotest.client.shared import error, software_manager sm = software_manager.SoftwareManager() class prelink(test.test): """ Autotest module for testing basic functionality of prelink @author Athira Rajeev <atraj...
easytaxibr/redash
refs/heads/master
redash/handlers/queries.py
2
from flask import request from flask_restful import abort from flask_login import login_required import sqlparse from funcy import distinct, take from itertools import chain from redash.handlers.base import routes, org_scoped_rule, paginate from redash.handlers.query_results import run_query from redash import models...
InfoAgeTech/django-core
refs/heads/master
django_core/views/mixins/csrf.py
1
from __future__ import unicode_literals from django.utils.decorators import method_decorator from django.views.decorators.csrf import csrf_exempt class CsrfExemptViewMixin(object): """Mixin for the csrf_exempt decorator.""" @method_decorator(csrf_exempt) def dispatch(self, *args, **kwargs): retu...
zhangtao11/scrapy
refs/heads/master
scrapy/squeue.py
144
import warnings from scrapy.exceptions import ScrapyDeprecationWarning warnings.warn("Module `scrapy.squeue` is deprecated, " "use `scrapy.squeues` instead", ScrapyDeprecationWarning, stacklevel=2) from scrapy.squeues import *
showerst/openstates
refs/heads/master
openstates/az/__init__.py
1
import datetime import lxml.html from billy.utils.fulltext import text_after_line_numbers, pdfdata_to_text from .bills import AZBillScraper from .legislators import AZLegislatorScraper from .committees import AZCommitteeScraper from .events import AZEventScraper metadata = dict( name='Arizona', abbreviation='a...
jean/sentry
refs/heads/master
src/sentry/web/frontend/auth_provider_login.py
38
from __future__ import absolute_import, print_function from django.core.urlresolvers import reverse from sentry.auth.helper import AuthHelper from sentry.web.frontend.base import BaseView class AuthProviderLoginView(BaseView): auth_required = False def handle(self, request): helper = AuthHelper.get...
fentas/phantomjs
refs/heads/master
src/qt/qtwebkit/Tools/Scripts/webkitpy/common/net/unittestresults_unittest.py
124
# Copyright (c) 2012, 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...
zeha/multiapt
refs/heads/master
extlib/paramiko-1.7.3/paramiko/util.py
3
# Copyright (C) 2003-2007 Robey Pointer <robey@lag.net> # # This file is part of paramiko. # # Paramiko is free software; you can redistribute it and/or modify it under the # terms of the GNU Lesser General Public License as published by the Free # Software Foundation; either version 2.1 of the License, or (at your op...
Intel-tensorflow/tensorflow
refs/heads/master
tensorflow/python/keras/engine/node_test.py
5
# 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...
HKUST-SING/tensorflow
refs/heads/master
tensorflow/contrib/bayesflow/python/kernel_tests/stochastic_variables_test.py
80
# 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...
SwordGO/SwordGO_app
refs/heads/master
example/kivymap/.buildozer/android/app/_applibs/requests/packages/chardet/hebrewprober.py
2928
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Shy Shalom # Portions created by the Initial Developer are Copyright (C) 2005 # the Initial Developer. All Rights Reserved. #...
russellb/nova
refs/heads/master
nova/tests/api/openstack/compute/test_images.py
1
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 OpenStack LLC. # 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/...
kkdd/arangodb
refs/heads/devel
3rdParty/V8-4.3.61/third_party/python_26/Tools/scripts/linktree.py
101
#! /usr/bin/env python # linktree # # Make a copy of a directory tree with symbolic links to all files in the # original tree. # All symbolic links go to a special symbolic link at the top, so you # can easily fix things if the original source tree moves. # See also "mkreal". # # usage: mklinks oldtree newtree import...
haosdent/rbtools
refs/heads/master
rbtools/clients/tests.py
2
from __future__ import print_function, unicode_literals import os import re import sys import time from hashlib import md5 from functools import wraps from random import randint from tempfile import mktemp from textwrap import dedent from nose import SkipTest from six.moves import cStringIO as StringIO from rbtools....
yoyojacky/upm
refs/heads/master
examples/python/grovelight.py
19
# Author: Sarah Knepper <sarah.knepper@intel.com> # Copyright (c) 2014 Intel Corporation. # # 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...
ingokegel/intellij-community
refs/heads/master
python/testData/resolve/multiFile/pkgResourcesNamespace/root1/pkg/a.py
64
import pkg.second # <ref>
harshaneelhg/scikit-learn
refs/heads/master
sklearn/decomposition/base.py
313
"""Principal Component Analysis Base Classes""" # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Olivier Grisel <olivier.grisel@ensta.org> # Mathieu Blondel <mathieu@mblondel.org> # Denis A. Engemann <d.engemann@fz-juelich.de> # Kyle Kastner <kastnerkyle@gmail.com> # # Licen...
neuromat/abraco
refs/heads/master
faca_parte/views.py
1
from django.core.urlresolvers import reverse from django.contrib import messages from django.http import HttpResponseRedirect from django.shortcuts import render from django.utils.translation import ugettext_lazy as _ from models import Person from forms import PersonForm def registration(request, template_name="fac...
ales-erjavec/orange
refs/heads/master
Orange/testing/unit/tests/test_distance.py
6
try: import unittest2 as unittest except: import unittest from Orange.testing import testing from Orange.testing.testing import datasets_driven, test_on_data from Orange.distance import * @datasets_driven class TestEuclideanDistance(testing.DistanceTestCase): DISTANCE_CONSTRUCTOR = Euclidean() @datasets_...
bdubertret/uwsgi
refs/heads/master
plugins/xslt/uwsgiplugin.py
13
import os NAME='xslt' CFLAGS = os.popen('xslt-config --cflags').read().rstrip().split() LDFLAGS = [] LIBS = os.popen('xslt-config --libs').read().rstrip().split() GCC_LIST = ['xslt']
nexdatas/writer
refs/heads/develop
test/ClientFieldTagWriterH5Cpp_test.py
1
#!/usr/bin/env python # This file is part of nexdatas - Tango Server for NeXus data writer # # Copyright (C) 2012-2017 DESY, Jan Kotanski <jkotan@mail.desy.de> # # nexdatas is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the ...
cmouse/buildbot
refs/heads/master
master/buildbot/test/fake/fakestats.py
5
# 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...
odooindia/odoo
refs/heads/master
addons/event/report/__init__.py
435
# -*- 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...
dntt1/youtube-dl
refs/heads/master
youtube_dl/__main__.py
90
#!/usr/bin/env python from __future__ import unicode_literals # Execute with # $ python youtube_dl/__main__.py (2.6+) # $ python -m youtube_dl (2.7+) import sys if __package__ is None and not hasattr(sys, 'frozen'): # direct call of __main__.py import os.path path = os.path.realpath(os.path.absp...
VladKha/CodeWars
refs/heads/master
6 kyu/Decode the Morse code/solve.py
1
MORSE_CODE = { '.-': 'A', '-...': 'B', '-.-.': 'C', '-..': 'D', '.': 'E', '..-.': 'F', '--.': 'G', '....': 'H', '..': 'I', '.---': 'G', '-.-': 'K', '.-..': 'L', '--': 'M', '-.': 'N', '---': 'O', '.--.': 'P', '--.-': 'Q', '.-.': 'R', '...': 'S', '-': 'T', '..-': 'U', '...-': 'V', '.--': '...
robin-pt/learning_note_pyGuessNumber
refs/heads/master
pyGuestNumber/settings.py
1
""" Django settings for pyGuestNumber project. Generated by 'django-admin startproject' using Django 1.11.5. For more information on this file, see https://docs.djangoproject.com/en/1.11/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.11/ref/settings/ """ imp...
yongshengwang/hue
refs/heads/master
desktop/core/ext-py/thrift-0.9.1/src/TMultiplexedProcessor.py
146
# # 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...
m2dsupsdlclass/lectures-labs
refs/heads/master
labs/01_keras/solutions/keras_adam.py
1
# %load solutions/keras_adam_and_adadelta.py model = Sequential() model.add(Dense(hidden_dim, input_dim=input_dim, activation="relu")) model.add(Dense(hidden_dim, activation="relu")) model.add(Dense(output_dim, activation="softmax")) optimizer = optimizers.Adam(lr=0.001) model.compile(optimizer=optimiz...
Azulinho/ansible
refs/heads/devel
lib/ansible/modules/network/f5/bigip_hostname.py
6
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2017 F5 Networks 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', ...
lidabing/xgyp
refs/heads/master
gyp/test/msvs/config_attrs/gyptest-config_attrs.py
297
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Verifies that msvs_configuration_attributes and msbuild_configuration_attributes are applied by using them to set the OutputDirectory. "...
denis-pitul/django
refs/heads/master
django/core/files/uploadhandler.py
149
""" Base file upload handler classes, and the built-in concrete subclasses """ from __future__ import unicode_literals from io import BytesIO from django.conf import settings from django.core.files.uploadedfile import ( InMemoryUploadedFile, TemporaryUploadedFile, ) from django.utils.encoding import python_2_uni...
pierrebaque/EM
refs/heads/master
retrainGaussian.py
2
from GaussianNet import gaussianNet from net_functions import * import os os.environ["THEANO_FLAGS"] = "device=gpu2, floatX=float32" from PIL import Image import pickle import time import json import MyConfig class gaussian2(gaussianNet): def __init__(self): gaussianNet.__init__(self) self.trainI...
mou4e/zirconium
refs/heads/master
tools/perf/measurements/draw_properties.py
4
# Copyright 2015 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 telemetry.core.platform import tracing_category_filter from telemetry.core.platform import tracing_options from telemetry.page import page_test from tel...
adamchau/essay_simulation
refs/heads/master
MAS/plot_mas.py
1
# -*- coding: utf-8 -*- """ Created on Wed Oct 22 09:07:07 2014 @author: ydzhao """ from ev_tr import * if __name__=="__main__": ''' mas consensus ''' plt.figure() for i in range(MAS1.agent_num): agent1_var=[data[i] for data in MAS1.status_his] plt.p...
samithaj/headphones
refs/heads/master
lib/cherrypy/lib/auth_digest.py
49
# This file is part of CherryPy <http://www.cherrypy.org/> # -*- coding: utf-8 -*- # vim:ts=4:sw=4:expandtab:fileencoding=utf-8 __doc__ = """An implementation of the server-side of HTTP Digest Access Authentication, which is described in :rfc:`2617`. Example usage, using the built-in get_ha1_dict_plain function which...
nmartensen/pandas
refs/heads/master
asv_bench/benchmarks/panel_methods.py
7
from .pandas_vb_common import * class PanelMethods(object): goal_time = 0.2 def setup(self): self.index = date_range(start='2000', freq='D', periods=1000) self.panel = Panel(np.random.randn(100, len(self.index), 1000)) def time_pct_change_items(self): self.panel.pct_change(1, axi...
mancoast/CPythonPyc_test
refs/heads/master
cpython/253_test_urllibnet.py
19
#!/usr/bin/env python import unittest from test import test_support import socket import urllib import sys import os import mimetools class URLTimeoutTest(unittest.TestCase): TIMEOUT = 10.0 def setUp(self): socket.setdefaulttimeout(self.TIMEOUT) def tearDown(self): socket.setdefaulttim...
yavuzovski/playground
refs/heads/master
python/django/RESTTest/.venv/lib/python3.4/site-packages/django/db/backends/sqlite3/features.py
49
from __future__ import unicode_literals from django.db import utils from django.db.backends.base.features import BaseDatabaseFeatures from django.utils import six from django.utils.functional import cached_property from .base import Database class DatabaseFeatures(BaseDatabaseFeatures): # SQLite cannot handle u...
poepublic/shareabouts-bikesharela
refs/heads/master
src/flavors/bikesharela/scripts/index_images.py
2
#!/usr/bin/env python """ This script is just used to write the image index. To actually resize the images you could use a command like: # Resize JPGs in current folder to height=600 mogrify -geometry x600 *.JPG """ from __future__ import print_function, unicode_literals import json import os from os.path ...
bitifirefly/edx-platform
refs/heads/master
lms/envs/test.py
8
# -*- coding: utf-8 -*- """ This config file runs the simplest dev environment using sqlite, and db-based sessions. Assumes structure: /envroot/ /db # This is where it'll write the database file /edx-platform # The location of this repo /log # Where we're going to write log files """ # We ...
noisemaster/AdamTestBot
refs/heads/master
telegram/userprofilephotos.py
2
#!/usr/bin/env python # # A library that provides a Python interface to the Telegram Bot API # Copyright (C) 2015-2016 # Leandro Toledo de Souza <devs@python-telegram-bot.org> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser Public License as publish...
HwisooSo/gemV-update
refs/heads/gemV
ext/ply/test/yacc_badargs.py
174
# ----------------------------------------------------------------------------- # yacc_badargs.py # # Rules with wrong # args # ----------------------------------------------------------------------------- import sys sys.tracebacklimit = 0 sys.path.insert(0,"..") import ply.yacc as yacc from calclex import tokens # P...
lmazuel/ansible
refs/heads/devel
test/integration/targets/uri/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: ...
liangjiaxing/sympy
refs/heads/master
sympy/polys/domains/pythonrationalfield.py
117
"""Implementation of :class:`PythonRationalField` class. """ from __future__ import print_function, division from sympy.polys.domains.rationalfield import RationalField from sympy.polys.domains.groundtypes import PythonInteger, PythonRational, SymPyRational from sympy.polys.polyerrors import CoercionFailed from symp...
wwfifi/uliweb
refs/heads/master
uliweb/manage.py
1
#!/usr/bin/env python import sys, os import logging import inspect from optparse import make_option import uliweb from uliweb.core.commands import Command, CommandManager from uliweb.core import SimpleFrame apps_dir = 'apps' __commands__ = {} log = logging.getLogger('uliweb.console') def get_commands(g...
apple/llvm-project
refs/heads/llvm.org/main
lldb/test/API/functionalities/breakpoint/hardware_breakpoints/hardware_breakpoint_on_multiple_threads/TestHWBreakMultiThread.py
7
""" Test hardware breakpoints for multiple threads. """ import lldb from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil from functionalities.breakpoint.hardware_breakpoints.base import * class HardwareBreakpointMultiThreadTestCase(HardwareBreakpointTest...
cliqz/socorro
refs/heads/master
socorro/unittest/external/fs/test_tar_crashstore.py
9
from nose.tools import eq_, ok_, assert_raises from mock import Mock, patch from datetime import datetime import json from configman.dotdict import DotDict from socorro.external.fs.crashstorage import ( TarFileCrashStore, ) from socorro.external.crashstorage_base import CrashIDNotFound from socorro.unittest.test...
hortonworks/hortonworks-sandbox
refs/heads/master
desktop/core/ext-py/django-extensions-0.5/django_extensions/management/commands/describe_form.py
30
from django.core.management.base import LabelCommand, CommandError from django.utils.encoding import force_unicode class Command(LabelCommand): help = "Outputs the specified model as a form definition to the shell." args = "[app.model]" label = 'application name and model name' requires_model_vali...
vmarkovtsev/django
refs/heads/master
tests/indexes/tests.py
321
from unittest import skipUnless from django.db import connection from django.test import TestCase from .models import Article, ArticleTranslation, IndexTogetherSingleList class SchemaIndexesTests(TestCase): """ Test index handling by the db.backends.schema infrastructure. """ def test_index_name_ha...
windyuuy/opera
refs/heads/master
chromium/src/testing/PRESUBMIT.py
134
# 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. """Top-level presubmit script for testing. See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for details on the presubmit API ...
sonofeft/DigiPlot
refs/heads/master
digiplot/plot_area.py
1
#!/usr/bin/env python # -*- coding: ascii -*- from __future__ import absolute_import from __future__ import print_function import math import sys from PIL import Image, ImageTk, ImageFont, ImageDraw try: from PIL import ImageGrab HAS_IMAGEGRAB = True except: HAS_IMAGEGRAB = False if sys.version_info < (3...
colossalbit/cssypy
refs/heads/master
cssypy/functions/functions.py
1
from .base import register_builtin from .. import errors, datatypes def _rgb_arg(x): if isinstance(x, datatypes.Percentage): return 255. * x.p / 100. elif isinstance(x, datatypes.Number): return x.n else: raise errors.CSSValueError() @register_builtin def rgb(r, g, b): rgb = tu...
mwrlabs/veripy
refs/heads/master
contrib/rfc2473/tn_6in6/packet_processing.py
1
from scapy.all import * from veripy import util from veripy.assertions import * from veripy.models import ComplianceTestCase class EncapsulatingHopLimitDecrementedTestCase(ComplianceTestCase): """ Encapsulating Hop Limit Decremented (6in6) Verifies that an intermediate node decrements the hop limit of the...
rtrigoso/ghost-somepolymath
refs/heads/master
node_modules/pygmentize-bundled/vendor/pygments/pygments/formatters/terminal.py
363
# -*- coding: utf-8 -*- """ pygments.formatters.terminal ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Formatter for terminal output with ANSI sequences. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import sys from pygments.formatter import Format...
UniversalMasterEgg8679/ansible
refs/heads/devel
lib/ansible/modules/windows/win_group.py
56
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2014, Chris Hoffman <choffman@chathamfinancial.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 ...
DryFlyRyan/BrewsBrothersChillerFrontEnd
refs/heads/master
node_modules/node-gyp/gyp/pylib/gyp/generator/gypsh.py
2779
# Copyright (c) 2011 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. """gypsh output module gypsh is a GYP shell. It's not really a generator per se. All it does is fire up an interactive Python session with a few local variables...
areteix/powerline
refs/heads/develop
tools/generate_gradients.py
32
#!/usr/bin/env python # vim:fileencoding=utf-8:noet '''Gradients generator ''' from __future__ import (unicode_literals, division, absolute_import, print_function) import sys import json import argparse from itertools import groupby from colormath.color_objects import sRGBColor, LabColor from colormath.color_conve...
Onirik79/aaritmud
refs/heads/master
data/proto_mobs/mfdonald/mfdonald_mob_unicorno-azzurro.py
1
# -*- coding: utf-8 -*- #= IMPORT ====================================================================== import random from src.defer import defer_random_time from src.log import log from src.utility import is_prefix, multiple_arguments, random_marks from src.commands.command_say import command_say #= FUNZ...
michath/ConMonkey
refs/heads/master
media/webrtc/trunk/tools/gyp/test/make/gyptest-noload.py
362
#!/usr/bin/env python # Copyright (c) 2010 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. """ Tests the use of the NO_LOAD flag which makes loading sub .mk files optional. """ # Python 2.5 needs this for the with statement. from ...
mdavid/zulip
refs/heads/master
zproject/urls.py
109
from django.conf import settings from django.conf.urls import patterns, url, include from django.views.generic import TemplateView, RedirectView import os.path import zerver.forms # NB: There are several other pieces of code which route requests by URL: # # - runtornado.py has its own URL list for Tornado views. Se...
naslanidis/ansible
refs/heads/devel
lib/ansible/modules/network/nxos/nxos_snmp_host.py
8
#!/usr/bin/python # # 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 distribut...
AlCutter/googletest-fbsd
refs/heads/master
test/gtest_break_on_failure_unittest.py
2140
#!/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...
grimmjow8/ansible
refs/heads/devel
test/integration/targets/module_utils/module_utils/qux1/quux.py
298
data = 'qux1'
hyperized/ansible
refs/heads/devel
test/units/module_utils/hwc/test_dict_comparison.py
23
# -*- coding: utf-8 -*- # 2018.07.26 --- use DictComparison instead of GcpRequest # # (c) 2016, Tom Melendez <tom@supertom.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 ...
chineyting/lab4-Info3180
refs/heads/master
server/lib/werkzeug/local.py
310
# -*- coding: utf-8 -*- """ werkzeug.local ~~~~~~~~~~~~~~ This module implements context-local objects. :copyright: (c) 2013 by the Werkzeug Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from functools import update_wrapper from werkzeug.wsgi import ClosingIt...
brett-patterson/pyface
refs/heads/master
pyface/wx/scrolled_message_dialog.py
5
#------------------------------------------------------------------------------ # Copyright (c) 2005, Enthought, Inc. # All rights reserved. # # This software is provided without warranty under the terms of the BSD # license included in enthought/LICENSE.txt and may be redistributed only # under the conditions describe...