repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
lmzintgraf/MultiMAuS
refs/heads/master
simulator/customers.py
1
import numpy as np from pytz import timezone, country_timezones from simulator.customer_abstract import AbstractCustomer class BaseCustomer(AbstractCustomer): def __init__(self, transaction_model, fraudster): """ Base class for customers/fraudsters that support uni-modal authentication. :p...
felipenaselva/felipe.repository
refs/heads/master
script.module.liveresolver/lib/js2py/test.py
31
import js2py c = js2py.EvalJs() # c.execute('a = {d:4,f:function k() {return 1}}') # c.execute('function k(a) {console.log(a);console.log(this)}') # c.execute('f = function (){}') a = r''' Number( Date()) ''' #c.execute(a) res = js2py.translate_js(a) with open('test_res.py', 'wb') as f: f.write(res) def f(a, b,...
rlishtaba/py-algorithms
refs/heads/master
py_algorithms/data_structures/heap.py
1
import sys from typing import Any from typing import Callable from typing import List from typing import Union from ..utils import test_iterable class _HeapNode: def __init__(self, key: Any, value: Any): self.key = key self.value = value self.degree = 0 self.marked = False ...
mayblue9/bokeh
refs/heads/master
bokeh/charts/builder/tests/test_heatmap_builder.py
33
""" This is the Bokeh charts testing interface. """ #----------------------------------------------------------------------------- # Copyright (c) 2012 - 2014, Continuum Analytics, Inc. All rights reserved. # # Powered by the Bokeh Development Team. # # The full license is in the file LICENSE.txt, distributed with thi...
michael2012z/myKernel
refs/heads/master
tools/power/pm-graph/analyze_suspend.py
84
#!/usr/bin/python # # Tool for analyzing suspend/resume timing # Copyright (c) 2013, Intel Corporation. # # This program is free software; you can redistribute it and/or modify it # under the terms and conditions of the GNU General Public License, # version 2, as published by the Free Software Foundation. # # This prog...
aptana/Pydev
refs/heads/development
bundles/org.python.pydev.jython/Lib/CGIHTTPServer.py
8
"""CGI-savvy HTTP Server. This module builds on SimpleHTTPServer by implementing GET and POST requests to cgi-bin scripts. If the os.fork() function is not present (e.g. on Windows), os.popen2() is used as a fallback, with slightly altered semantics; if that function is not present either (e.g. on Macintosh), only Py...
ryfeus/lambda-packs
refs/heads/master
Keras_tensorflow/source/numpy/distutils/fcompiler/lahey.py
229
from __future__ import division, absolute_import, print_function import os from numpy.distutils.fcompiler import FCompiler compilers = ['LaheyFCompiler'] class LaheyFCompiler(FCompiler): compiler_type = 'lahey' description = 'Lahey/Fujitsu Fortran 95 Compiler' version_pattern = r'Lahey/Fujitsu Fortran...
glmcdona/meddle
refs/heads/master
examples/base/Lib/json/tool.py
113
r"""Command-line tool to validate and pretty-print JSON Usage:: $ echo '{"json":"obj"}' | python -m json.tool { "json": "obj" } $ echo '{ 1.2:3.4}' | python -m json.tool Expecting property name: line 1 column 2 (char 2) """ import sys import json def main(): if len(sys.argv) == 1: ...
syci/account-financial-tools
refs/heads/8.0
account_asset_management/wizard/account_asset_remove.py
19
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # # Copyright (C) 2010-2012 OpenERP s.a. (<http://openerp.com>). # Copyright (c) 2014 Noviat nv/sa (www.noviat.com). All rights reserved. # # This program is ...
BorgERP/borg-erp-6of3
refs/heads/master
l10n_coa/l10n_at/__init__.py
438
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) conexus.at # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public ...
PaddlePaddle/Paddle
refs/heads/develop
python/paddle/fluid/tests/unittests/test_precision_recall_op.py
7
# 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 app...
s0undt3ch/powerline
refs/heads/develop
setup.py
1
#!/usr/bin/env python # vim:fileencoding=utf-8:noet from __future__ import (unicode_literals, division, absolute_import, print_function) import os import sys import subprocess import logging import shlex from traceback import print_exc from setuptools import setup, find_packages CURRENT_DIR = os.path.abspath(os.pat...
botherder/volatility
refs/heads/master
volatility/fmtspec.py
45
# Volatility # # 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 as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # Volatility is dist...
andythigpen/home-assistant
refs/heads/master
tests/config/custom_components/light/test.py
7
""" custom_components.light.test ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Provides a mock switch platform. Call init before using it in your tests to ensure clean test data. """ from homeassistant.const import STATE_ON, STATE_OFF from tests.helpers import MockToggleDevice DEVICES = [] def init(empty=False): """ (re-)ini...
mpuccio/AliPhysics
refs/heads/master
PWGJE/EMCALJetTasks/Tracks/analysis/plots/__init__.py
369
#************************************************************************** #* Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. * #* * #* Author: The ALICE Off-line Project. * #* Contributors ...
inclement/vispy
refs/heads/master
vispy/visuals/volume.py
6
# -*- coding: utf-8 -*- # Copyright (c) 2015, Vispy Development Team. # Distributed under the (new) BSD License. See LICENSE.txt for more info. """ About this technique -------------------- In Python, we define the six faces of a cuboid to draw, as well as texture cooridnates corresponding with the vertices of the cu...
codesmart-co/bit
refs/heads/master
connectors/google_adwords/datasources/drive.py
1
# system import json import logging import zipfile from io import BytesIO from datetime import timedelta from dateutil import parser # superset from superset import app # BIT from bit.models.datasource import DataSource config = app.config class GoogleDriveDataSource(DataSource): def __init__(self, storage, pa...
lem8r/website-themes
refs/heads/master
theme_erpu/__openerp__.py
1
# -*- coding: utf-8 -*- { 'name': 'ERP Ukraine theme', 'description': 'Theme for erp.co.ua site.', 'website': 'https://erp.co.ua', 'version': '1.3', 'author': 'ERP Ukraine', 'data': [ 'views/templates.xml' ], 'depends': [ 'website', 'website_blog', ], }
initialed85/mac_os_scripts
refs/heads/master
mac_os_scripts_tests/enable_security_logging_test.py
1
import unittest from hamcrest import assert_that, equal_to from mock import MagicMock, call from mac_os_scripts.enable_security_logging import SecurityLoggingEnabler from mac_os_scripts.utils import RunCommandOutput _TEST_ENABLE_SECURITY_LOGGING = RunCommandOutput( stdout='/System/Library/LaunchDaemons/com.apple...
jriehl/numba
refs/heads/master
numba/cuda/simulator/reduction.py
7
from numba.six.moves import reduce as pyreduce def Reduce(func): def reduce_wrapper(seq, res=None, init=0): r = pyreduce(func, seq, init) if res is not None: res[0] = r return None else: return r return reduce_wrapper reduce = Reduce
sonaht/ansible
refs/heads/devel
lib/ansible/modules/packaging/os/pacman.py
21
#!/usr/bin/python -tt # -*- coding: utf-8 -*- # (c) 2012, Afterburn <http://github.com/afterburn> # (c) 2013, Aaron Bull Schaefer <aaron@elasticdog.com> # (c) 2015, Indrajit Raychaudhuri <irc+code@indrajit.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it un...
gibtang/CCNSCoding
refs/heads/master
external/emscripten/third_party/ply/example/BASIC/basinterp.py
166
# This file provides the runtime support for running a basic program # Assumes the program has been parsed using basparse.py import sys import math import random class BasicInterpreter: # Initialize the interpreter. prog is a dictionary # containing (line,statement) mappings def __init__(self,prog): ...
nelango/ViralityAnalysis
refs/heads/master
model/lib/sklearn/feature_extraction/stop_words.py
290
# This list of English stop words is taken from the "Glasgow Information # Retrieval Group". The original list can be found at # http://ir.dcs.gla.ac.uk/resources/linguistic_utils/stop_words ENGLISH_STOP_WORDS = frozenset([ "a", "about", "above", "across", "after", "afterwards", "again", "against", "all", "almo...
YeelerG/twilio-python
refs/heads/master
twilio/rest/resources/connect_apps.py
51
from . import InstanceResource, ListResource from six import iteritems class ConnectApp(InstanceResource): """ An authorized connect app """ pass class ConnectApps(ListResource): """ A list of Connect App resources """ name = "ConnectApps" instance = ConnectApp key = "connect_apps" def...
Lautitia/newfies-dialer
refs/heads/master
newfies/mod_mailer/admin.py
4
# # Newfies-Dialer License # http://www.newfies-dialer.org # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. # # Copyright (C) 2011-2014 Star2Billing S.L. # # The Initia...
matpow2/cuwo
refs/heads/master
cuwo/strings.py
1
# Copyright (c) Mathias Kaerlev 2013-2017. # # This file is part of cuwo. # # cuwo 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. # # ...
dracos/django
refs/heads/master
tests/migrations/test_add_many_to_many_field_initial/0001_initial.py
133
from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Project', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=Fa...
syci/ingadhoc-odoo-addons
refs/heads/8.0
portal_account_distributor/product.py
2
# -*- coding: utf-8 -*- from openerp import models, fields class product_template(models.Model): _inherit = 'product.template' standard_price = fields.Float( groups='base.group_user,base.group_portal_distributor')
pigmej/uwsgi_no_pp
refs/heads/master
plugins/graylog2/uwsgiplugin.py
21
NAME = 'graylog2' CFLAGS = [] LDFLAGS = [] LIBS = ['-lz'] GCC_LIST = ['graylog2_plugin']
redhat-openstack/python-ironicclient
refs/heads/master-patches
ironicclient/openstack/common/apiclient/fake_client.py
3
# -*- coding: utf-8 -*- # # Copyright 2013 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICE...
bobcyw/django
refs/heads/master
django/core/mail/backends/dummy.py
835
""" Dummy email backend that does nothing. """ from django.core.mail.backends.base import BaseEmailBackend class EmailBackend(BaseEmailBackend): def send_messages(self, email_messages): return len(list(email_messages))
edeposit/edeposit.amqp
refs/heads/master
edeposit/amqp/settings.py
1
#! /usr/bin/env python # -*- coding: utf-8 -*- """ Module is containing all necessary global variables for package. Module also has ability to read user-defined data from two paths: $HOME/:attr:`SETTINGS_PATH` and /etc/:attr:`SETTINGS_PATH`. Note: If the first path is found, other is ignored. Example of the conf...
skg-net/ansible
refs/heads/devel
lib/ansible/modules/cloud/vmware/vcenter_license.py
27
#!/usr/bin/python # Copyright: (c) 2017, Dag Wieers (@dagwieers) <dag@wieers.com> # 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', ...
misakwa/thriftpy
refs/heads/develop
tests/test_parser.py
1
# -*- coding: utf-8 -*- import pytest from thriftpy.thrift import TType from thriftpy.parser import load from thriftpy.parser.exc import ThriftParserError, ThriftGrammerError def test_comments(): load('parser-cases/comments.thrift') def test_constants(): thrift = load('parser-cases/constants.thrift') a...
raajitr/django_hangman
refs/heads/master
env/lib/python2.7/site-packages/setuptools/depends.py
336
import sys import imp import marshal from distutils.version import StrictVersion from imp import PKG_DIRECTORY, PY_COMPILED, PY_SOURCE, PY_FROZEN from .py33compat import Bytecode __all__ = [ 'Require', 'find_module', 'get_module_constant', 'extract_constant' ] class Require: """A prerequisite to building o...
Lilykos/invenio
refs/heads/master
invenio/modules/upgrader/upgrades/invenio_2013_12_05_new_index_doi.py
15
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2012, 2013 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 # License, or (at your option) any...
bregman-arie/ansible
refs/heads/devel
lib/ansible/modules/system/aix_inittab.py
46
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, Joris Weijters <joris.weijters@gmail.com> # 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...
aam-at/tensorflow
refs/heads/master
tensorflow/lite/tools/convert_image_to_csv_test.py
17
# Lint as: python2, python3 # Copyright 2018 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 # ...
huhongbo/dd-agent
refs/heads/master
aggregator.py
34
# stdlib import logging from time import time # project from checks.metric_types import MetricTypes log = logging.getLogger(__name__) # This is used to ensure that metrics with a timestamp older than # RECENT_POINT_THRESHOLD_DEFAULT seconds (or the value passed in to # the MetricsAggregator constructor) get discard...
coderhaoxin/tornado
refs/heads/master
tornado/queues.py
46
# Copyright 2015 The Tornado Authors # # 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 w...
lalanza808/lalanza808.github.io
refs/heads/master
vendor/bundle/ruby/2.3.0/gems/pygments.rb-0.6.3/vendor/pygments-main/pygments/styles/paraiso_dark.py
126
# -*- coding: utf-8 -*- """ pygments.styles.paraiso_dark ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Paraíso (Dark) by Jan T. Sott Pygments template by Jan T. Sott (https://github.com/idleberg) Created with Base16 Builder by Chris Kempson (https://github.com/chriskempson/base16-builder). :copyright: Cop...
hazrpg/calibre
refs/heads/master
src/calibre/library/field_metadata.py
3
''' Created on 25 May 2010 @author: charles ''' import traceback from collections import OrderedDict from calibre.utils.config_base import tweaks category_icon_map = { 'authors' : 'user_profile.png', 'series' : 'series.png', 'formats' : 'book.png'...
000paradox000/django-dead-users
refs/heads/master
dead_users/forms/signup.py
1
from django.contrib.auth import get_user_model from django import forms class SignupForm(forms.ModelForm): def __init__(self, *args, **kwargs): super(SignupForm, self).__init__(*args, **kwargs) class Meta: model = get_user_model() fields = ['first_name', 'last_name',] def signup(...
dav1x/ansible
refs/heads/devel
contrib/inventory/packet_net.py
16
#!/usr/bin/env python ''' Packet.net external inventory script ================================= Generates inventory that Ansible can understand by making API request to Packet.net using the Packet library. NOTE: This script assumes Ansible is being executed where the environment variable needed for Packet API Token...
mearns/slider
refs/heads/master
slider/__main__.py
1
#! /usr/bin/env python # vim: set fileencoding=utf-8: set encoding=utf-8: from slider import PresentationGenerator if __name__ == '__main__': import codecs import sys with open('test.html', 'w') as ofile: PresentationGenerator().markdown_to_html(codecs.open("test.md", mode='r', encoding='utf...
karthik339/Agni
refs/heads/master
MainDemo/flask/lib/python2.7/site-packages/openid/consumer/html_parse.py
167
""" This module implements a VERY limited parser that finds <link> tags in the head of HTML or XHTML documents and parses out their attributes according to the OpenID spec. It is a liberal parser, but it requires these things from the data in order to work: - There must be an open <html> tag - There must be an open...
loisaidasam/gensim
refs/heads/develop
gensim/models/atmodel.py
4
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2016 Radim Rehurek <radimrehurek@seznam.cz> # Copyright (C) 2016 Olavur Mortensen <olavurmortensen@gmail.com> # Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html """ Author-topic model in Python. This module trains the author-topi...
alfredodeza/boto
refs/heads/develop
boto/file/connection.py
153
# Copyright 2010 Google Inc. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, dis- # trib...
bjacquet/cardndice
refs/heads/master
polls/urls.py
1
from django.conf.urls.defaults import * from cardndice.polls.models import Poll info_dict = { 'queryset': Poll.objects.all(), } urlpatterns = patterns('', (r'^$', 'django.views.generic.list_detail.object_list', info_dict), (r'^(?P<object_id>\d+)/$', 'django.views.generic.list_detail.object_detail', info_...
hyiltiz/youtube-dl
refs/heads/master
youtube_dl/extractor/sina.py
107
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import ( compat_urllib_request, compat_urllib_parse, ) class SinaIE(InfoExtractor): _VALID_URL = r'''(?x)https?://(.*?\.)?video\.sina\.com\.cn/ ( ...
matbra/bokeh
refs/heads/master
sphinx/source/docs/user_guide/source_examples/styling_glyph_properties.py
24
from bokeh.plotting import figure, output_file, show output_file("axes.html") p = figure(plot_width=400, plot_height=400) p.circle([1,2,3,4,5], [2,5,8,2,7], name="mycircle") glyph = p.select(name="mycircle")[0].glyph glyph.size = 60 glyph.fill_alpha = 0.2 glyph.line_color = "firebrick" glyph.line_dash = [6, 3] glyph...
betoesquivel/fil2014
refs/heads/master
filenv/lib/python2.7/site-packages/django/contrib/gis/gdal/prototypes/geom.py
219
from ctypes import c_char_p, c_double, c_int, c_void_p, POINTER from django.contrib.gis.gdal.envelope import OGREnvelope from django.contrib.gis.gdal.libgdal import lgdal from django.contrib.gis.gdal.prototypes.errcheck import check_bool, check_envelope from django.contrib.gis.gdal.prototypes.generation import (const_s...
vollov/net-audit
refs/heads/master
src/pymongo/errors.py
2
# Copyright 2009-2012 10gen, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
Maximilian-Reuter/SickRage
refs/heads/master
lib/guessit/date.py
33
#!/usr/bin/env python # -*- coding: utf-8 -*- # # GuessIt - A library for guessing information from filenames # Copyright (c) 2013 Nicolas Wack <wackou@gmail.com> # # GuessIt is free software; you can redistribute it and/or modify it under # the terms of the Lesser GNU General Public License as published by # the Free ...
AOKPSaber/android_external_chromium
refs/heads/jb-mr1
testing/gmock/scripts/gmock_doctor.py
66
#!/usr/bin/env python # # Copyright 2008, 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...
Belxjander/Kirito
refs/heads/master
Python-3.5.0-Amiga/Tools/pybench/Arithmetic.py
92
from pybench import Test class SimpleIntegerArithmetic(Test): version = 2.0 operations = 5 * (3 + 5 + 5 + 3 + 3 + 3) rounds = 120000 def test(self): for i in range(self.rounds): a = 2 b = 3 c = 3 c = a + b c = b + c c ...
matmutant/sl4a
refs/heads/master
python/gdata/tests/atom_tests/auth_test.py
128
#!/usr/bin/env python # # Copyright (C) 2009 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by...
jolyonb/edx-platform
refs/heads/master
lms/djangoapps/badges/migrations/0001_initial.py
14
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models import jsonfield.fields import badges.models from django.conf import settings import django.utils.timezone from model_utils import fields from opaque_keys.edx.django.models import CourseKeyField class Migration(m...
yk5/incubator-airflow
refs/heads/master
airflow/contrib/hooks/__init__.py
2
# -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the #...
android-ia/platform_external_gtest
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...
pgmillon/ansible
refs/heads/devel
lib/ansible/modules/network/aci/mso_schema_template_anp_epg.py
15
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2018, Dag Wieers (@dagwieers) <dag@wieers.com> # 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_ve...
suhussai/youtube-dl
refs/heads/master
test/helper.py
63
from __future__ import unicode_literals import errno import io import hashlib import json import os.path import re import types import sys import youtube_dl.extractor from youtube_dl import YoutubeDL from youtube_dl.utils import ( compat_str, preferredencoding, write_string, ) def get_params(override=No...
henryprescott/portfolio
refs/heads/master
node_modules/sqlite3/deps/extract.py
775
import sys import tarfile import os tarball = os.path.abspath(sys.argv[1]) dirname = os.path.abspath(sys.argv[2]) tfile = tarfile.open(tarball,'r:gz'); tfile.extractall(dirname) sys.exit(0)
steedos/odoo7
refs/heads/master
openerp/tools/test_config.py
456
# -*- coding: utf-8 -*- """ Tests for the configuration file/command-line arguments. """ # This test should be run from its directory. # TODO A configmanager object cannot parse multiple times a config file # and/or the command line, preventing to 'reload' a configuration. import os import config config_file_00 =...
sbinet-staging/pyrame
refs/heads/master
getapi/unit_test.py
1
#!/usr/bin/env python2 # -*- coding: utf-8 -*- # # Copyright 2012-2015 Frédéric Magniette, Miguel Rubio-Roy # This file is part of Pyrame. # # Pyrame 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, ei...
herow/planning_qgis
refs/heads/master
python/plugins/processing/gui/CreateNewScriptAction.py
6
# -*- coding: utf-8 -*- """ *************************************************************************** CreateNewScriptAction.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com *****************...
M157q/django-localflavor
refs/heads/master
localflavor/sk/forms.py
7
""" Slovak-specific form helpers """ from __future__ import absolute_import, unicode_literals from django.forms.fields import Select, RegexField from django.utils.translation import ugettext_lazy as _ from .sk_districts import DISTRICT_CHOICES from .sk_regions import REGION_CHOICES class SKRegionSelect(Select): ...
0Rick0/Fontys-DS-GCD
refs/heads/master
Original Assignments/week 5/example.py
1
#!/usr/bin/env python3 import mincemeat import glob import traceback import sys import operator def mapfn(k, v: str): import string from stopwords import allStopWords stopwords = allStopWords.keys() trans = str.maketrans('', '', string.punctuation) for w in v.split(): w = w.lower() ...
clef/python-social-auth
refs/heads/master
setup.py
47
# -*- coding: utf-8 -*- """Setup file for easy installation""" import sys import os from os.path import join, dirname, split from setuptools import setup PY3 = os.environ.get('BUILD_VERSION') == '3' or sys.version_info[0] == 3 version = __import__('social').__version__ LONG_DESCRIPTION = """ Python Social Auth is a...
partofthething/home-assistant
refs/heads/dev
homeassistant/components/vlc/media_player.py
16
"""Provide functionality to interact with vlc devices on the network.""" import logging import vlc import voluptuous as vol from homeassistant.components.media_player import PLATFORM_SCHEMA, MediaPlayerEntity from homeassistant.components.media_player.const import ( MEDIA_TYPE_MUSIC, SUPPORT_PAUSE, SUPPOR...
dkuner/example-modules
refs/heads/master
modules/modeling/spark/hero_cos_matc_spark/main.py
2
#!/usr/bin/env python # -*- coding: utf-8 -*- import os from specparser import HadoopRuntime def main(): hr = HadoopRuntime() settings = hr.settings match_result_output_dir = hr.get_hdfs_working_dir("match_result") settings.Output.match_result.val = match_result_output_dir match_analysis_output_d...
alvaroaleman/ansible
refs/heads/devel
lib/ansible/module_utils/facts.py
7
# (c) 2012, 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) any lat...
flippym/spytify-server
refs/heads/master
Scripts/album-strip.py
1
from argparse import ArgumentParser, RawDescriptionHelpFormatter from os import listdir, path, popen, remove, rmdir from shutil import copytree, Error, move from sys import argv from textwrap import dedent def Parse(): parser = ArgumentParser(prog=path.basename(__file__.rpartition('.')[0]), add_help=False, forma...
eadgarchen/tensorflow
refs/heads/master
tensorflow/contrib/labeled_tensor/python/ops/core.py
32
# 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...
hackerbolt-freelancer/jhv
refs/heads/master
Modules/connection.py
3
#coding utf-8 import sys reload(sys) sys.setdefaultencoding("utf-8") import sqlite3 from time import gmtime, strftime from os import getcwd connect = sqlite3.connect(str(getcwd()) +"/Database/database.db") connect.text_factory = str c = connect.cursor() facebook = [] gmail = [] def create_tables(): c.execute("CREA...
garg10may/youtube-dl
refs/heads/master
youtube_dl/extractor/movieclips.py
126
from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import ( compat_str, ) from ..utils import ( ExtractorError, clean_html, ) class MovieClipsIE(InfoExtractor): _VALID_URL = r'https?://movieclips\.com/(?P<id>[\da-zA-Z]+)(?:-(?P<display_id>[\da-z-]+))?' ...
kmoocdev/edx-platform
refs/heads/kmooc.rc0
common/lib/i18n/tests/test_extract_and_generate.py
27
""" This test tests that i18n extraction (`paver i18n_extract -v`) works properly. """ from datetime import datetime, timedelta import os import sys import string # pylint: disable=deprecated-module import random import re from unittest import TestCase from mock import patch from polib import pofile from pytz import ...
kartikp1995/gnuradio
refs/heads/master
gr-analog/python/analog/qa_simple_squelch.py
47
#!/usr/bin/env python # # Copyright 2012,2013 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 optio...
strogo/bigcouch
refs/heads/master
couchjs/scons/scons-local-2.0.1/SCons/compat/_scons_dbm.py
61
# # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 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 restriction, including # without li...
timoschwarzer/blendworks
refs/heads/master
BlendWorks Server/python/Lib/site-packages/pip/_vendor/html5lib/filters/optionaltags.py
1727
from __future__ import absolute_import, division, unicode_literals from . import _base class Filter(_base.Filter): def slider(self): previous1 = previous2 = None for token in self.source: if previous1 is not None: yield previous2, previous1, token previous2...
aimas/TuniErp-8.0
refs/heads/master
addons/base_report_designer/plugin/openerp_report_designer/bin/script/AddAttachment.py
384
######################################################################### # # Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com # Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>). # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser Gene...
roopali8/tempest
refs/heads/master
tempest/api_schema/response/compute/v2_1/servers.py
25
# Copyright 2014 NEC Corporation. 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 ...
ghmajx/asuswrt-merlin
refs/heads/374.43_2-update
release/src/router/samba-3.0.25b/source/tdb/swig/Tdb.py
52
"""Provide a more Pythonic and object-oriented interface to tdb.""" # # Swig interface to Samba # # Copyright (C) Tim Potter 2006 # # 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...
mshafiq9/django
refs/heads/master
tests/m2m_signals/models.py
448
from django.db import models from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class Part(models.Model): name = models.CharField(max_length=20) class Meta: ordering = ('name',) def __str__(self): return self.name @python_2_unicode_compatible cla...
hangarunderground/hendrix
refs/heads/master
performance-tools/perf_client1.py
3
import requests counter = 0 for counter in range(5000): r = requests.get('http://localhost:8000/fib/%s' % counter) print "%s - %s" % (counter, r)
nicecapj/crossplatfromMmorpgServer
refs/heads/master
ThirdParty/boost_1_61_0/libs/mpi/test/python/scatter_test.py
64
# Copyright (C) 2006 Douglas Gregor <doug.gregor -at- gmail.com>. # Use, modification and distribution is subject to the Boost Software # License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) # Test scatter() collective. import boost.parallel.mpi as mpi from ...
40023247/W17test
refs/heads/master
static/Brython3.1.1-20150328-091302/Lib/sysconfig.py
726
"""Access to Python's configuration information.""" #well emulate this module since it does with settings very close to the #OS and metal variables={'TANH_PRESERVES_ZERO_SIGN': 0, 'WITH_DOC_STRINGS': 0} def get_config_var(var): if var in variables: return variables[var] raise NotImplementedError("sys...
liavkoren/djangoDev
refs/heads/master
django/db/transaction.py
10
from functools import wraps from django.db import ( connections, DEFAULT_DB_ALIAS, DatabaseError, Error, ProgrammingError) from django.utils.decorators import available_attrs class TransactionManagementError(ProgrammingError): """ This exception is thrown when transaction management is used improperl...
elmerdpadilla/iv
refs/heads/8.0
addons/pos_discount/__openerp__.py
312
# -*- 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...
sunny-wyb/xen-4.1.2
refs/heads/master
dist/install/usr/lib/python2.7/site-packages/xen/util/acmpolicy.py
44
#============================================================================ # This library is free software; you can redistribute it and/or # modify it under the terms of version 2.1 of the GNU Lesser General Public # License as published by the Free Software Foundation. # # This library is distributed in the hope th...
lambder/bigcouch
refs/heads/master
couchjs/scons/scons-local-2.0.1/SCons/Tool/packaging/src_tarbz2.py
61
"""SCons.Tool.Packaging.tarbz2 The tarbz2 SRC packager. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 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 d...
JeremiahDJordan/cassandra
refs/heads/trunk
pylib/cqlshlib/util.py
30
# 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...
spartonia/saleor
refs/heads/master
saleor/order/migrations/0001_initial.py
26
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django.db.models.deletion from django.conf import settings import django.utils.timezone import django_prices.models import django.core.validators import satchless.item class Migration(migrations.Migration)...
jw84/gallant
refs/heads/master
saleor/order/migrations/0001_initial.py
26
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django.db.models.deletion from django.conf import settings import django.utils.timezone import django_prices.models import django.core.validators import satchless.item class Migration(migrations.Migration)...
dsprenkels/servo
refs/heads/master
tests/wpt/web-platform-tests/tools/py/doc/conf.py
218
# -*- coding: utf-8 -*- # # py documentation build configuration file, created by # sphinx-quickstart on Thu Oct 21 08:30:10 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. # # All conf...
H1ghT0p/kitsune
refs/heads/master
kitsune/upload/models.py
15
from django.conf import settings from django.contrib.auth.models import User from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes import generic from django.db import models from kitsune.sumo.helpers import reverse from kitsune.sumo.models import ModelBase from kitsune.sumo.utils...
gnuhub/intellij-community
refs/heads/master
python/helpers/profiler/thrift/TTornado.py
105
# # 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...
laperry1/android_external_chromium_org
refs/heads/cm-12.1
tools/cr/cr/autocomplete.py
103
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Bash auto completion support. Contains the special mode that returns lists of possible completions for the current command line. """ import cr def Com...
wackywendell/numpy
refs/heads/master
numpy/polynomial/tests/test_classes.py
66
"""Test inter-conversion of different polynomial classes. This tests the convert and cast methods of all the polynomial classes. """ from __future__ import division, absolute_import, print_function import operator as op from numbers import Number import numpy as np from numpy.polynomial import ( Polynomial, Leg...
magudev17/gifsta
refs/heads/master
gifspool/protection.py
2
import re import random import string import hashlib import hmac USERNAME_RE = re.compile(r"^[a-zA-Z0-9_-]{3,20}$") PASSWORD_RE = re.compile(r"^.{3,20}$") EMAIL_RE = re.compile(r'^[\S]+@[\S]+\.[\S]+$') USERNAME_ERROR = "That's not a valid username." PASSWORD_ERROR = "That wasn't a valid password." V_PAS...