repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
jjhelmus/scipy | refs/heads/master | scipy/_lib/setup.py | 15 | #!/usr/bin/env python
from __future__ import division, print_function, absolute_import
import os
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('_lib', parent_package, top_path)
config.add_data_files('tests/*.py')
inclu... |
WZQ1397/automatic-repo | refs/heads/master | project/urlfetchANDcolor/zachcrwallib.py | 1 | import gzip
def defeatblock(i):
headers=['Mozilla/5.0 (Windows NT 6.1; WOW64; rv:23.0) Gecko/20130406 Firefox/23.0',
'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:18.0) Gecko/20100101 Firefox/18.0',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/533+ \(KHTML, like Gecko) Element Br... |
draklaw/lair | refs/heads/master | bin/tmx_to_ldl.py | 1 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2018 Simon Boyé
#
# This file is part of lair.
#
# lair 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
# (... |
Isendir/brython | refs/heads/master | www/src/Lib/test/badsyntax_pep3120.py | 181 | print("böse")
|
wilebeast/FireFox-OS | refs/heads/master | B2G/gecko/python/mach/mach/commands/settings.py | 2 | # 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/.
from __future__ import print_function, unicode_literals
from textwrap import TextWrapper
from mozbuild.base import Moz... |
Roy1993sun/shadowsocks | refs/heads/master | tests/graceful_cli.py | 977 | #!/usr/bin/python
import socks
import time
SERVER_IP = '127.0.0.1'
SERVER_PORT = 8001
if __name__ == '__main__':
s = socks.socksocket()
s.set_proxy(socks.SOCKS5, SERVER_IP, 1081)
s.connect((SERVER_IP, SERVER_PORT))
s.send(b'test')
time.sleep(30)
s.close()
|
DirtyUnicorns/android_external_chromium_org | refs/heads/lollipop | third_party/tlslite/tlslite/integration/pop3_tls.py | 115 | # Author: Trevor Perrin
# See the LICENSE file for legal information regarding use of this file.
"""TLS Lite + poplib."""
import socket
from poplib import POP3, POP3_SSL_PORT
from tlslite.tlsconnection import TLSConnection
from tlslite.integration.clienthelper import ClientHelper
class POP3_TLS(POP3, ClientHelper):
... |
abramovpav/abraworld_backend | refs/heads/master | music_library/admin.py | 1 | from django.contrib import admin
# Register your models here.
from music_library.models import Album, Track
admin.site.register(Album)
admin.site.register(Track)
|
chenkovsky/recpy | refs/heads/master | test.py | 1 | __author__ = 'chenkovsky'
import pandas as pd
import numpy as np
from . import knn
from sklearn.neighbors import KDTree
class TestRecommender:
def setUp(self):
data = {1: {1: 3.0, 2: 4.0, 3: 3.5, 4: 5.0, 5: 3.0},
2: {1: 3.0, 2: 4.0, 3: 2.0, 4: 3.0, 5: 3.0, 6: 2.0},
3: {2: 3.5, 3: 2.5, 4: ... |
markus-oberhumer/gcc | refs/heads/master | gcc/testsuite/g++.dg/gcov/gcov.py | 2 | import gzip
import json
import os
def gcov_from_env():
# return parsed JSON content a GCOV_PATH file
json_filename = os.environ['GCOV_PATH'] + '.gcov.json.gz'
json_data = gzip.open(json_filename).read()
return json.loads(json_data)
|
AutorestCI/azure-sdk-for-python | refs/heads/master | azure-mgmt-datalake-analytics/azure/mgmt/datalake/analytics/account/models/capability_information.py | 1 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... |
jessicalucci/NovaOrc | refs/heads/master | nova/cells/__init__.py | 28 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2012 Rackspace Hosting
#
# 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... |
ayoubg/gem5-graphics | refs/heads/master | gem5/util/minorview/__init__.py | 55 | # Copyright (c) 2013 ARM Limited
# All rights reserved
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the functionality o... |
treejames/erpnext | refs/heads/develop | erpnext/accounts/doctype/shipping_rule/test_shipping_rule.py | 97 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
import unittest
from erpnext.accounts.doctype.shipping_rule.shipping_rule import FromGreaterThanToError, ManyBlankToValuesError, Overlappi... |
Doctor-Andonuts/taskwarriorandroid | refs/heads/master | cli/test/basetest/__init__.py | 3 | # -*- coding: utf-8 -*-
from .task import Task
from .taskd import Taskd
from .testing import TestCase, ServerTestCase
# flake8:noqa
# vim: ai sts=4 et sw=4
|
endlessm/chromium-browser | refs/heads/master | third_party/catapult/telemetry/third_party/modulegraph/modulegraph_tests/testdata/nspkg/src/child/namedpkg/slave.py | 92 | """ slave packages """
import os
|
elba7r/builder | refs/heads/master | frappe/core/doctype/report/__init__.py | 1829 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
|
bdh1011/wau | refs/heads/master | venv/lib/python2.7/site-packages/nbconvert/preprocessors/convertfigures.py | 4 | """Module containing a preprocessor that converts outputs in the notebook from
one format to another.
"""
#-----------------------------------------------------------------------------
# Copyright (c) 2013, the IPython Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license ... |
40123151ChengYu/2015cd_midterm2 | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/unittest/test/testmock/testhelpers.py | 737 | import unittest
from unittest.mock import (
call, _Call, create_autospec, MagicMock,
Mock, ANY, _CallList, patch, PropertyMock
)
from datetime import datetime
class SomeClass(object):
def one(self, a, b):
pass
def two(self):
pass
def three(self, a=None):
pass
class AnyT... |
ovnicraft/edx-platform | refs/heads/master | common/djangoapps/edxmako/management/commands/preprocess_assets.py | 46 | """
Preprocess templatized asset files, enabling asset authors to use
Python/Django inside of Sass and CoffeeScript. This preprocessing
will happen before the invocation of the asset compiler (currently
handled by the assets paver file).
For this to work, assets need to be named with the appropriate
template extension... |
ahb0327/intellij-community | refs/heads/master | python/testData/resolve/multiFile/importPrivateNameWithStar/ImportPrivateNameWithStar.py | 83 | from b import *
class Public(__Private): pass
# <ref> |
credativ/pulp | refs/heads/master | server/pulp/server/db/migrations/0015_load_content_types.py | 15 | """
This migration loads the content types into the database. Part of the process includes dropping
of search indexes and their recreation.
"""
import logging
from pulp.plugins.loader.api import load_content_types
_logger = logging.getLogger(__name__)
def migrate(*args, **kwargs):
"""
Perform the migration ... |
jjx02230808/project0223 | refs/heads/master | sklearn/ensemble/bagging.py | 14 | """Bagging meta-estimator."""
# Author: Gilles Louppe <g.louppe@gmail.com>
# License: BSD 3 clause
from __future__ import division
import itertools
import numbers
import numpy as np
from warnings import warn
from abc import ABCMeta, abstractmethod
from ..base import ClassifierMixin, RegressorMixin
from ..externals.... |
DrMeers/django | refs/heads/master | tests/null_fk_ordering/models.py | 165 | """
Regression tests for proper working of ForeignKey(null=True). Tests these bugs:
* #7512: including a nullable foreign key reference in Meta ordering has un
xpected results
"""
from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
... |
ReubenAbrams/Chrubix | refs/heads/master | src/chrubix/__init__.py | 1 | #!/usr/local/bin/python3
import sys
import os
import pickle
import binascii
import time
import subprocess
import getopt
import hashlib
import base64
from chrubix.utils import call_binary, read_oneliner_file, write_oneliner_file, call_binary_and_show_progress, \
wget, failed, logme
from chrubi... |
Si-elegans/Web-based_GUI_Tools | refs/heads/master | wiki/views/article.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import difflib
import logging
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.db.models import Q
from django.db import transaction
from django.shortcuts import render_to_response, redirect, get_obj... |
Northshoot/maestro | refs/heads/master | client/request_sender.py | 1 | #!/usr/bin/python
'''
Created on 1 may 2013
Script that send a simulation request to a CCMD server
Use this python program for the Benchmark oriented client
@author: Laurynas Riliskis
'''
import socket
from threading import Lock
import sys
CCMD_PORT = 22087
DEFAULT_CONFIGURATION_FILES_DIRECTORY = 'cfgFiles' # dir... |
gskachkov/phantomjs | refs/heads/master | src/qt/qtwebkit/Tools/Scripts/webkitpy/common/net/unittestresults.py | 155 | # 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... |
mattattack7/canvas-contrib | refs/heads/master | API_Examples/import_outcomes/python/outcomes_importer.py | 4 | #!/usr/bin/env python
domain = "<yourdomain>.instructure.com"
token = "<token>"
####################################################################################################
####################################################################################################
############### Don't edit anything a... |
rahul67/hue | refs/heads/master | apps/oozie/src/oozie/migrations/0022_auto__chg_field_mapreduce_node_ptr__chg_field_start_node_ptr.py | 37 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'Mapreduce.node_ptr'
db.alter_column('oozie_mapreduce', 'node_ptr_id', self.gf('django.db.models.... |
kenonelah/etherpad-lite | refs/heads/master | src/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/easy_xml_test.py | 2698 | #!/usr/bin/env python
# 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.
""" Unit tests for the easy_xml.py file. """
import gyp.easy_xml as easy_xml
import unittest
import StringIO
class TestSequenceFunctions(... |
TheTypoMaster/chromium-crosswalk | refs/heads/master | tools/perf/benchmarks/thread_times.py | 6 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from core import perf_benchmark
from benchmarks import silk_flags
from measurements import thread_times
import page_sets
from telemetry import benchmark
cl... |
rhololkeolke/apo-website-devin | refs/heads/master | src/werkzeug/useragents.py | 92 | # -*- coding: utf-8 -*-
"""
werkzeug.useragents
~~~~~~~~~~~~~~~~~~~
This module provides a helper to inspect user agent strings. This module
is far from complete but should work for most of the currently available
browsers.
:copyright: (c) 2011 by the Werkzeug Team, see AUTHORS for more deta... |
drjeep/django | refs/heads/master | tests/flatpages_tests/settings.py | 514 | import os
FLATPAGES_TEMPLATES = [{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(os.path.dirname(__file__), 'templates')],
'OPTIONS': {
'context_processors': (
'django.contrib.auth.context_processors.auth',
),
},
}]
|
xujun10110/Hammer | refs/heads/master | lib/knock/modules/dns/node.py | 49 | # Copyright (C) 2001-2007, 2009-2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED "... |
th0mmeke/toyworld | refs/heads/master | util/expand_energy_factorial.py | 1 | import config
import csv
import sys
import os
import string
"""Experiment, Repeat, Partition Start, Partition End, Dimensionality, Energy, Number of cycles, Length of longest cycle, Count of most common cycle
to:
Experiment, Repeat, Partition Start, Partition End, Energy, Number of cycles, Length of longest cycle, Co... |
virtus80/python_training | refs/heads/master | generator/contact.py | 1 | from model.contact import Contact
import random
import string
import os.path
import jsonpickle
import getopt
import sys
try:
opts, args = getopt.getopt(sys.argv[1:], "n:f:", ["number of contacts", "file"])
except getopt.GetoptError as err:
getopt.usage()
sys.exit(2)
n = 1
f = "data/contacts.json"
for o,... |
zbqf109/goodo | refs/heads/master | openerp/addons/test_inherits/__openerp__.py | 357 | # -*- coding: utf-8 -*-
{
'name': 'test-inherits',
'version': '0.1',
'category': 'Tests',
'description': """A module to verify the inheritance using _inherits.""",
'author': 'Camptocamp',
'website': 'http://www.camptocamp.com',
'depends': ['base'],
'data': [
'ir.model.access.csv'... |
tectronics/cortex-vfx | refs/heads/master | test/IECoreHoudini/ops/parameters/compoundParameters/compoundParameters-1.py | 12 | ##########################################################################
#
# Copyright 2010 Dr D Studios Pty Limited (ACN 127 184 954) (Dr. D Studios),
# its affiliates and/or its licensors.
#
# Copyright (c) 2010-2011, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary ... |
xflows/clowdflows-backend | refs/heads/master | workflows/api/tests.py | 1 | from django.contrib.auth.models import User
from rest_framework.reverse import reverse
from rest_framework import status
from rest_framework.test import APITestCase
from workflows.models import Workflow, Widget, Input
TEST_USERNAME = 'testuser'
TEST_PASSWORD = '123'
# Test workflow ids
TEST_WORKFLOW_USERS_PK = 2
TES... |
suda/micropython | refs/heads/master | tests/bytecode/pylib-tests/pty.py | 34 | """Pseudo terminal utilities."""
# Bugs: No signal handling. Doesn't set slave termios and window size.
# Only tested on Linux.
# See: W. Richard Stevens. 1992. Advanced Programming in the
# UNIX Environment. Chapter 19.
# Author: Steen Lumholt -- with additions by Guido.
from select import select
imp... |
pangtouyu/flasky | refs/heads/master | app/api_1_0/users.py | 104 | from flask import jsonify, request, current_app, url_for
from . import api
from ..models import User, Post
@api.route('/users/<int:id>')
def get_user(id):
user = User.query.get_or_404(id)
return jsonify(user.to_json())
@api.route('/users/<int:id>/posts/')
def get_user_posts(id):
user = User.query.get_or... |
louistin/fullstack | refs/heads/master | Python/basic/string_20161211.py | 1 | #!/usr/bin/env python
# encoding: utf-8
test_str = '''
hehehe,
hahhah,
%s,
heihei
''' % 'louis'
print test_str
|
valexandersaulys/prudential_insurance_kaggle | refs/heads/master | venv/lib/python2.7/site-packages/numpy/__init__.py | 79 | """
NumPy
=====
Provides
1. An array object of arbitrary homogeneous items
2. Fast mathematical operations over arrays
3. Linear Algebra, Fourier Transforms, Random Number Generation
How to use the documentation
----------------------------
Documentation is available in two forms: docstrings provided
with the c... |
madhusudancs/pytask | refs/heads/master | pytask/helpers/__init__.py | 1 | #!/usr/bin/env python
#
# Copyright 2011 Authors of PyTask.
#
# This file is part of PyTask.
#
# PyTask is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your opt... |
Jumpscale/web | refs/heads/master | pythonlib/gdata/contacts/data.py | 81 | #!/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 applicable ... |
alexrudy/Zeeko | refs/heads/master | zeeko/utils/sandwich.py | 1 | # -*- coding: utf-8 -*-
import sys
PY2 = (sys.version_info[0] == 2)
__all__ = ['sandwich_unicode', 'unsandwich_unicode']
def sandwich_unicode(value, encoding='utf-8'):
"""Sandwich unicode values.
This function always returns bytes.
"""
if isinstance(value, bytes):
return value
else:... |
Lektorium-LLC/edx-platform | refs/heads/master | openedx/core/djangoapps/embargo/middleware.py | 10 | """Middleware for embargoing site and courses.
IMPORTANT NOTE: This code WILL NOT WORK if you have a misconfigured proxy
server. If you are configuring embargo functionality, or if you are
experiencing mysterious problems with embargoing, please check that your
reverse proxy is setting any of the well known client IP... |
manashmndl/kivy | refs/heads/master | examples/widgets/lists/list_simple_in_kv.py | 52 | from kivy.uix.modalview import ModalView
from kivy.uix.listview import ListView
from kivy.uix.gridlayout import GridLayout
from kivy.lang import Builder
Builder.load_string("""
<ListViewModal>:
size_hint: None,None
size: 400,400
ListView:
size_hint: .8,.8
item_strings: [str(index) for index... |
google/starthinker | refs/heads/master | dags/dbm_dag.py | 1 | ###########################################################################
#
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/l... |
sergmelikyan/murano | refs/heads/master | murano/tests/functional/api/v1/test_services.py | 2 | # Copyright (c) 2014 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 required by applicable law... |
muntasirsyed/intellij-community | refs/heads/master | python/testData/refactoring/extractmethod/MethodContext.after.py | 71 | class C:
def foo(self):
self.bar()
def bar(self):
for x in [1, 2]:
print x |
sometallgit/AutoUploader | refs/heads/master | Python27/Lib/sqlite3/test/factory.py | 8 | #-*- coding: ISO-8859-1 -*-
# pysqlite2/test/factory.py: tests for the various factories in pysqlite
#
# Copyright (C) 2005-2007 Gerhard Häring <gh@ghaering.de>
#
# This file is part of pysqlite.
#
# This software is provided 'as-is', without any express or implied
# warranty. In no event will the authors be held liab... |
rossant/qtools | refs/heads/master | qtools/__init__.py | 1 | from qtpy import *
from utils import *
from tasks import *
from garbagecollector import * |
fnouama/intellij-community | refs/heads/master | python/testData/refactoring/introduceVariable/substringBeforeFormatTuple.py | 83 | print("<selection>Hello</selection> %s" % ("World",)) |
wreckJ/intellij-community | refs/heads/master | python/helpers/pydev/pydev_ipython/inputhookgtk3.py | 106 | # encoding: utf-8
"""
Enable Gtk3 to be used interacive by IPython.
Authors: Thomi Richards
"""
#-----------------------------------------------------------------------------
# Copyright (c) 2012, the IPython Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the ... |
SravanthiSinha/edx-platform | refs/heads/master | common/djangoapps/cache_toolbox/model.py | 239 | """
Caching model instances
-----------------------
``cache_model`` adds utility methods to a model to obtain ``ForeignKey``
instances via the cache.
Usage
~~~~~
::
from django.db import models
from django.contrib.auth.models import User
class Foo(models.Model):
name = models.CharField(length=2... |
wolverineav/horizon | refs/heads/master | openstack_dashboard/test/integration_tests/pages/project/compute/access_and_security/securitygroupspage.py | 10 | # 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, software
# d... |
bcostm/mbed-os | refs/heads/master | tools/test/examples/examples.py | 31 | """ import and bulid a bunch of example programs """
from argparse import ArgumentParser
import os
from os.path import dirname, abspath, basename
import os.path
import sys
import subprocess
import json
ROOT = abspath(dirname(dirname(dirname(dirname(__file__)))))
sys.path.insert(0, ROOT)
from tools.utils import argpa... |
livioribeiro/project-euler | refs/heads/master | python/p010.py | 1 | UP_TO = 2000000
import math
def is_prime(num):
if num <= 2:
return True
if num % 2 == 0:
return False
for i in range(3, math.ceil(math.sqrt(num)) + 1, 2):
if num % i == 0:
return False
return True
if __name__ == '__main__':
total = 2 + sum((i for i in range(... |
StrellaGroup/erpnext | refs/heads/develop | erpnext/selling/doctype/sales_order_item/sales_order_item.py | 33 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
from erpnext.controllers.print_settings import print_settings_for_item_table
class SalesOrder... |
luipir/QTraffic | refs/heads/master | ui/qtraffic_select_layer_ui.py | 1 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'ui/qtraffic_select_layer.ui'
#
# Created: Tue Sep 8 18:01:38 2015
# by: PyQt4 UI code generator 4.11.2
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromU... |
chylli/phantomjs | refs/heads/master | src/qt/qtwebkit/Tools/Scripts/webkitpy/port/qt.py | 113 | # Copyright (C) 2010 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... |
gofortargets/CNN_brandsafety | refs/heads/master | knx/text/tokenizer/default_tokenizer.py | 1 | from BS.knx.text.tokenizer import treebank_tokenizer
def tokenize(text):
return treebank_tokenizer.tokenize(text)
|
RonnyPfannschmidt/django-classy-settings | refs/heads/master | example/settings/__init__.py | 5 |
import os
import cbs
mode = os.environ.get('DJANGO_MODE', 'Local')
cbs.apply('settings.{}.{}Settings'.format(mode.lower(), mode.title()), globals())
|
jlegendary/youtube-dl | refs/heads/master | youtube_dl/extractor/varzesh3.py | 120 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
class Varzesh3IE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?video\.varzesh3\.com/(?:[^/]+/)+(?P<id>[^/]+)/?'
_TEST = {
'url': 'http://video.varzesh3.com/germany/bundesliga/5-%D9%88%D8%A7%DA%A9%D9%86%D8%B4... |
iut-ibk/DynaMind-UrbanSim | refs/heads/master | 3rdparty/opus/src/urbansim_parcel/models/subarea_distribute_unplaced_jobs_model.py | 2 | # Opus/UrbanSim urban simulation software.
# Copyright (C) 2005-2009 University of Washington
# See opus_core/LICENSE
from numpy import where
from urbansim_parcel.models.subarea_scaling_jobs_model import SubareaScalingJobsModel
class SubareaDistributeUnplacedJobsModel(SubareaScalingJobsModel):
"""This ... |
windyuuy/opera | refs/heads/master | chromium/src/third_party/trace-viewer/third_party/pywebsocket/src/mod_pywebsocket/memorizingfile.py | 680 | #!/usr/bin/env python
#
# Copyright 2011, 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... |
jrydberg/edgy | refs/heads/master | src/edgy/xml/xmlbuilder.py | 1 | """ElementBuilder.py - construct ElementTrees with friendly syntax
(C) 2005 Oren Tirosh. Released under the terms of the MIT License.
http://www.opensource.org/licenses/mit-license.php
* Extended Element factory
Backward-compatible with the standard ElementTree Element factory with
the following extensions:
Su... |
pkleimert/hrpt | refs/heads/master | apps/pollster/models_2012_11_21.py | 2 | # -*- coding: utf-8 -*-
import warnings
from django.db import models, connection, transaction, IntegrityError, DatabaseError
from django.contrib.auth.models import User
from django.forms import ModelForm
from django.core.validators import RegexValidator
from cms.models import CMSPlugin
from xml.etree import ElementTre... |
pschella/scipy | refs/heads/master | scipy/stats/_constants.py | 40 | """
Statistics-related constants.
"""
from __future__ import division, print_function, absolute_import
import numpy as np
# The smallest representable positive number such that 1.0 + _EPS != 1.0.
_EPS = np.finfo(float).eps
# The largest [in magnitude] usable floating value.
_XMAX = np.finfo(float).max
# The log o... |
pombredanne/cliques | refs/heads/master | invite_only/adapter.py | 1 | from allauth.account.adapter import DefaultAccountAdapter
from invite_only.models import InviteCode
import logging
logger = logging.getLogger(__name__)
class InviteOnlyAccountAdapter(DefaultAccountAdapter):
def is_open_for_signup(self, request):
if request.method == 'GET':
logger.info("is oep... |
allanino/nupic | refs/heads/master | tests/integration/nupic/engine/vector_file_sensor_test.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 ... |
alejandro-mc/trees | refs/heads/master | nodesVsSPRSeq.py | 1 | #randSPRwalk.py
#writes random SPR walks to files
#calls GTP on each SPR random walk file to get
#the ditances between each tree and the first tree of the sequence
#the results are written to csv files with lines delimited by \t
from tree_utils import *
import os
import sys
def randSPRwalk(size,steps,runs,seed):
... |
iDTLabssl/account-invoicing | refs/heads/8.0 | stock_picking_invoicing/__init__.py | 33 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2013-15 Agile Business Group sagl (<http://www.agilebg.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public Li... |
pmclanahan/pytest-progressive | refs/heads/master | noseprogressive/bar.py | 4 | from __future__ import with_statement
from itertools import cycle
from signal import signal, SIGWINCH
__all__ = ['ProgressBar', 'NullProgressBar']
class ProgressBar(object):
_is_dodging = 0 # Like a semaphore
def __init__(self, max_value, term, filled_color=8, empty_color=7):
"""``max_value`` is t... |
shingonoide/odoo | refs/heads/deverp_8.0 | addons/payment_ogone/tests/test_ogone.py | 430 | # -*- coding: utf-8 -*-
from lxml import objectify
import time
import urlparse
from openerp.addons.payment.models.payment_acquirer import ValidationError
from openerp.addons.payment.tests.common import PaymentAcquirerCommon
from openerp.addons.payment_ogone.controllers.main import OgoneController
from openerp.tools i... |
js0701/chromium-crosswalk | refs/heads/master | testing/chromoting/chromoting_test_utilities.py | 7 | # 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.
"""Utility script to run tests on the Chromoting bot."""
import hashlib
import os
from os.path import expanduser
import re
import shutil
import socket
impor... |
jendap/tensorflow | refs/heads/master | tensorflow/python/debug/cli/cli_config_test.py | 68 | # Copyright 2017 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... |
jamespcole/home-assistant | refs/heads/master | homeassistant/components/homematic/switch.py | 1 | """Support for HomeMatic switches."""
import logging
from homeassistant.components.switch import SwitchDevice
from homeassistant.const import STATE_UNKNOWN
from . import ATTR_DISCOVER_DEVICES, HMDevice
_LOGGER = logging.getLogger(__name__)
DEPENDENCIES = ['homematic']
def setup_platform(hass, config, add_entities... |
erwilan/ansible | refs/heads/devel | lib/ansible/plugins/terminal/asa.py | 57 | #
# (c) 2016 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is d... |
fevxie/odoo | refs/heads/8.0 | addons/l10n_fr_hr_payroll/report/fiche_paye.py | 303 | #!/usr/bin/env python
#-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# d$
#
# This program is free software: you can redistribute it... |
scpeters/catkin | refs/heads/indigo-devel | test/utils.py | 11 | from __future__ import print_function
from sys import version_info
import os
import shutil
import subprocess
import unittest
import tempfile
# import platform
# ubuntudist = platform.dist()[2]
PYTHON_INSTALL_PATH = os.path.join('lib',
'python%u.%u' % (version_info[0],
... |
brain-tec/account-invoicing | refs/heads/8.0 | account_invoice_supplierinfo_update_on_validate/tests/test_account_invoice_supplierinfo_update.py | 6 | # -*- coding: utf-8 -*-
# © 2016 Chafique DELLI @ Akretion
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp.tests.common import TransactionCase
class Tests(TransactionCase):
def setUp(self):
super(Tests, self).setUp()
self.wizard_obj = self.env['wizard.update.inv... |
ClearCorp/server-tools | refs/heads/9.0 | base_view_inheritance_extension/__init__.py | 12 | # -*- coding: utf-8 -*-
# © 2016 Therp BV <http://therp.nl>
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
from . import models
|
mkoistinen/django-cms | refs/heads/develop | cms/utils/setup.py | 7 | from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from cms.utils.compat.dj import is_installed as app_is_installed
def validate_dependencies():
"""
Check for installed apps, their versions and configuration options
"""
if not app_is_installed('treebeard'):
... |
e-schumann/proxy_doodle | refs/heads/master | external/boost/tools/build/src/build/project.py | 8 | # Status: ported.
# Base revision: 64488
# Copyright 2002, 2003 Dave Abrahams
# Copyright 2002, 2005, 2006 Rene Rivera
# Copyright 2002, 2003, 2004, 2005, 2006 Vladimir Prus
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1... |
openfun/edx-platform | refs/heads/master | common/lib/xmodule/xmodule/fields.py | 144 | import time
import logging
import re
from xblock.fields import JSONField
import datetime
import dateutil.parser
from pytz import UTC
log = logging.getLogger(__name__)
class Date(JSONField):
'''
Date fields know how to parse and produce json (iso) compatible formats. Converts to tz aware datetimes.
'''
... |
aberle/recipeasy | refs/heads/master | lib/werkzeug/debug/__init__.py | 310 | # -*- coding: utf-8 -*-
"""
werkzeug.debug
~~~~~~~~~~~~~~
WSGI application traceback debugger.
:copyright: (c) 2013 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import json
import mimetypes
from os.path import join, dirname, basename, isfile
... |
agusmakmun/Some-Examples-of-Simple-Python-Script | refs/heads/master | StringLace/StringLace.py | 1 | """
Name : String Lace
Created By : Agus Makmun (Summon Agus)
Blog : bloggersmart.net - python.web.id
License : GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007
Documentation : https://github.com/agusmakmun/Some-Examples-of-Simple-Python-Script/
Powered : Python-2.7
... |
asfaltboy/GitSavvy | refs/heads/master | core/commands/cherry_pick.py | 1 | import sublime
from sublime_plugin import TextCommand
from .log import GsLogByBranchCommand
from ...common import util
class GsCherryPickCommand(GsLogByBranchCommand):
def log(self, **kwargs):
return super().log(cherry=True, start_end=("", self._selected_branch), **kwargs)
def do_action(self, commi... |
SeanHayes/python-social-auth | refs/heads/master | social/apps/pyramid_app/utils.py | 76 | import warnings
from functools import wraps
from pyramid.threadlocal import get_current_registry
from pyramid.httpexceptions import HTTPNotFound, HTTPForbidden
from social.utils import setting_name, module_member
from social.strategies.utils import get_strategy
from social.backends.utils import get_backend, user_bac... |
andersle/virtualsimlab | refs/heads/master | test.py | 1 | # -*- coding: utf-8 -*-
"""This is just an example for the virtual simulation lab."""
from __future__ import print_function
values = [i**2 for i in range(10)]
values.append(10 * 10)
values.append(2**3)
for val in values:
print(val)
|
aricchen/openHR | refs/heads/master | openerp/addons/account/report/account_aged_partner_balance.py | 27 | # -*- 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... |
yiyocx/django-rest-framework | refs/heads/master | tests/test_serializer.py | 64 | # coding: utf-8
from __future__ import unicode_literals
import pickle
import pytest
from rest_framework import serializers
from rest_framework.compat import unicode_repr
from .utils import MockObject
# Tests for core functionality.
# -----------------------------
class TestSerializer:
def setup(self):
... |
windskyer/mvpn | refs/heads/master | mvpn/api/openstack/radius/versions.py | 1 |
from mvpn.api.openstack import wsgi
from mvpn.api.openstack.mvpn.views import versions as views_versions
LINKS = {
'v2.0': {
'pdf': 'http://docs.flftuu.com/'
'api/openstack-compute/2/os-compute-devguide-2.pdf',
'wadl': 'http://docs.flftuu.com/'
... |
jdfekete/progressivis | refs/heads/master | widgets/progressivis_nb_widgets/nbwidgets/__init__.py | 1 | from ._version import version_info, __version__
from .scatterplot import *
from .module_graph import *
from .control_panel import *
from .psboard import *
from .sensitive_html import *
from .json_html import *
from .data_table import *
from .sparkline_progressbar import *
from .plotting_progressbar import *
from .util... |
nrwahl2/ansible | refs/heads/devel | lib/ansible/modules/cloud/ovirt/ovirt_host_networks.py | 25 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 Red Hat, Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
#... |
mgoulish/qpid-dispatch | refs/heads/master | python/qpid_dispatch_internal/management/qdrouter.py | 3 | #
# 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... |
bjlittle/iris | refs/heads/pre-commit-ci-update-config | lib/iris/tests/test_file_load.py | 5 | # Copyright Iris contributors
#
# This file is part of Iris and is released under the LGPL license.
# See COPYING and COPYING.LESSER in the root of the repository for full
# licensing details.
"""
Test the file loading mechanism.
"""
# import iris tests first so that some things can be initialised before importing an... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.