repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
repotvsupertuga/tvsupertuga.repository | refs/heads/master | instal/script.module.resolveurl/lib/resolveurl/plugins/holavid.py | 2 | """
OVERALL CREDIT TO:
t0mm0, Eldorado, VOINAGE, BSTRDMKR, tknorris, smokdpi, TheHighway
resolveurl XBMC Addon
Copyright (C) 2011 t0mm0
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 Sof... |
nelango/ViralityAnalysis | refs/heads/master | model/lib/nltk/corpus/reader/rte.py | 10 | # Natural Language Toolkit: RTE Corpus Reader
#
# Copyright (C) 2001-2015 NLTK Project
# Author: Ewan Klein <ewan@inf.ed.ac.uk>
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
"""
Corpus reader for the Recognizing Textual Entailment (RTE) Challenge Corpora.
The files were taken from the RTE1, RT... |
jordanemedlock/psychtruths | refs/heads/master | temboo/Library/Foursquare/Venues/SearchVenues.py | 5 | # -*- coding: utf-8 -*-
###############################################################################
#
# SearchVenues
# Obtain a list of venues near the current location.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may ... |
nathanielvarona/airflow | refs/heads/master | airflow/providers/microsoft/azure/example_dags/example_azure_cosmosdb.py | 10 | #
# 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... |
leoc/home-assistant | refs/heads/dev | homeassistant/components/browser.py | 55 | """
Provides functionality to launch a web browser on the host machine.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/browser/
"""
import voluptuous as vol
DOMAIN = "browser"
SERVICE_BROWSE_URL = "browse_url"
ATTR_URL = 'url'
ATTR_URL_DEFAULT = 'http... |
scifiswapnil/Project-LoCatr | refs/heads/master | lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/sjisprober.py | 1776 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... |
richstoner/incf_engine | refs/heads/master | virtuoso/tovirtuoso.py | 1 | __author__ = 'satra'
import hashlib
import os
import rdflib
import requests
def hash_infile(afile, crypto=hashlib.sha512, chunk_len=8192):
""" Computes hash of a file using 'crypto' module"""
hex = None
if os.path.isfile(afile):
crypto_obj = crypto()
fp = file(afile, 'rb')
while T... |
openstack/rally | refs/heads/master | tests/unit/task/test_engine.py | 1 | # Copyright 2013: Mirantis Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... |
gangadhar-kadam/nassimapp | refs/heads/master | patches/october_2013/p02_set_communication_status.py | 30 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import webnotes
def execute():
webnotes.reload_doc("core", "doctype", "communication")
webnotes.conn.sql("""update tabCommunication
set sent_... |
bguillot/OpenUpgrade | refs/heads/master | addons/account_test/__init__.py | 441 | import account_test
import report
|
bhargav/scikit-learn | refs/heads/master | sklearn/linear_model/tests/test_omp.py | 272 | # Author: Vlad Niculae
# Licence: BSD 3 clause
import numpy as np
from sklearn.utils.testing import assert_raises
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_array_almost_equa... |
bibxpert/bibxpert | refs/heads/master | operations/search/arxiv.py | 1 | #!/usr/bin/env python
#
# Copyright 2015 Rafael Ferreira da Silva
# http://www.rafaelsilva.com/tools
#
# 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... |
humangeo/rawes | refs/heads/master | tests/integration/connection_pool_integration_tests.py | 1 | import unittest
from mock import patch, MagicMock
from rawes.elastic import Elastic
from requests.models import Response
from rawes.http_connection import HttpConnection
class TestConnectionPooling(unittest.TestCase):
"""Connection pooling was added on top of Rawes, it wasn't designed from
the beggingin. We ... |
Rapptz/discord.py | refs/heads/master | discord/player.py | 1 | """
The MIT License (MIT)
Copyright (c) 2015-present Rapptz
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, merg... |
davide-romanini/ComicStreamer | refs/heads/master | libs/rumps/__init__.py | 6 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# rumps: Ridiculously Uncomplicated Mac os x Python Statusbar apps.
# Copyright: (c) 2013, Jared Suttles. All rights reserved.
# License: BSD, see LICENSE for details.
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
"""
rumps: Ridiculously... |
HyperBaton/ansible | refs/heads/devel | lib/ansible/executor/module_common.py | 14 | # (c) 2013-2014, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2015 Toshio Kuratomi <tkuratomi@ansible.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... |
ychen820/microblog | refs/heads/master | y/google-cloud-sdk/lib/googlecloudsdk/sql/tools/__init__.py | 2 | # Copyright 2013 Google Inc. All Rights Reserved.
"""The super-group for the sql CLI.
The fact that this is a directory with
an __init__.py in it makes it a command group. The methods written below will
all be called by calliope (though they are all optional).
"""
import argparse
import os
import re
from googleclou... |
Radium-Devices/Radium_taoshan | refs/heads/cm-12.1 | tools/perf/scripts/python/sctop.py | 11180 | # system call top
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Periodically displays system-wide system call totals, broken down by
# syscall. If a [comm] arg is specified, only syscalls called by
# [comm] are displayed. If an [interval] arg is specified,... |
getredash/redash | refs/heads/master | redash/handlers/embed.py | 3 | from flask import request
from .authentication import current_org
from flask_login import current_user, login_required
from redash import models
from redash.handlers import routes
from redash.handlers.base import get_object_or_404, org_scoped_rule, record_event
from redash.handlers.static import render_index
from reda... |
Ant-OS/android_packages_apps_OTAUpdates | refs/heads/master | jni/boost_1_57_0/tools/build/test/load_dir.py | 64 | #!/usr/bin/python
"""
Traverses a directory and output the code that would create the same directory
structure during testing. Assumes that the instance of Tester is called 't'.
"""
import sys
import os
import stat
import string
def usage():
print "usage: load_dir.py directory"
def remove_first_component(path)... |
asedunov/intellij-community | refs/heads/master | python/testData/completion/moduleDotPy/a.py | 83 | from shazam import *
xy<caret> |
ironman771/xbmc | refs/heads/master | lib/gtest/scripts/pump.py | 2471 | #!/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... |
knowsis/django | refs/heads/nonrel-1.6 | django/contrib/messages/__init__.py | 311 | from __future__ import absolute_import
from django.contrib.messages.api import *
from django.contrib.messages.constants import *
|
SlashDK/OpenCV-simplestuff | refs/heads/master | vendors/google.py | 1 | import base64
import json
import requests
def _convert_image_to_base64(image_filename):
with open(image_filename, 'rb') as image_file:
encoded_string = base64.b64encode(image_file.read()).decode()
return encoded_string
def call_vision_api(image_filename, api_keys):
api_key = api_keys['google']
... |
izonder/intellij-community | refs/heads/master | python/testData/MockSdk3.4/Lib/collections/abc.py | 274 | from _collections_abc import *
from _collections_abc import __all__
|
YJango/tensorflow | refs/heads/master | Py_version/FNNs_Demo/demoLV2.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2018/6/15 13:17
# @Author : zzy824
# @File : demoLV2.py
import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
tf.set_random_seed(55)
np.random.seed(55)
""" add some branched based on demoLV1 """
class FNN(object):
"""Build a gene... |
Bismarrck/tensorflow | refs/heads/master | tensorflow/contrib/layers/python/layers/initializers.py | 23 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
iffy/AutobahnPython | refs/heads/master | doc/conf.py | 10 | # -*- coding: utf-8 -*-
import os
import sys
import sphinx_bootstrap_theme
# only needed for Autobahn|Python
sys.path.insert(0, os.path.abspath('./_extensions'))
sys.path.insert(0, os.path.abspath('..'))
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.intersphinx',
's... |
natoinet/seoscraper | refs/heads/master | seocheck.py | 1 | import argparse
from datetime import datetime
from envparse import env
import psycopg2
import scrapy
from scrapy.utils.project import get_project_settings
from scrapy.utils.log import configure_logging
from scrapy.crawler import CrawlerProcess, CrawlerRunner
from core.base import delete_table, db_to_csv
env.read_env... |
mitchrule/Miscellaneous | refs/heads/master | Django_Project/django/Lib/site-packages/django/contrib/gis/geos/prototypes/predicates.py | 103 | """
This module houses the GEOS ctypes prototype functions for the
unary and binary predicate operations on geometries.
"""
from ctypes import c_char, c_char_p, c_double
from django.contrib.gis.geos.libgeos import GEOM_PTR
from django.contrib.gis.geos.prototypes.errcheck import check_predicate
from django.contrib.gi... |
Arcanemagus/SickRage | refs/heads/master | lib/hachoir_parser/misc/mstask.py | 74 | """
ms task/job file parser
Author: Jeff Bryner
Creation date: 2010-11
References:
http://msdn.microsoft.com/en-us/library/cc248286%28v=PROT.13%29.aspx
http://msdn.microsoft.com/en-us/library/cc248287%28v=PROT.13%29.aspx
http://technet.microsoft.com/en-us/library/bb490996.aspx
"""
from hachoir_parser import Parser
... |
szeged/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/third_party/h2/examples/twisted/head_request.py | 25 | # -*- coding: utf-8 -*-
"""
head_request.py
~~~~~~~~~~~~~~~
A short example that demonstrates a client that makes HEAD requests to certain
websites.
This example is intended as a reproduction of nghttp2 issue 396, for the
purposes of compatibility testing.
"""
from __future__ import print_function
from twisted.inter... |
thebruce87/Photobooth | refs/heads/master | src/button.py | 2 | import RPi.GPIO as GPIO
isInit = False
def init(mode = GPIO.BCM):
GPIO.setmode(mode)
global isInit
isInit = True
class Button:
def __init__(self, gpio, direction = GPIO.IN):
self.gpio = gpio
self.direction = direction
GPIO.setup(self.gpio, self.direction)
def isPressed(self):
return not GPIO.input(se... |
davidyezsetz/kuma | refs/heads/master | vendor/packages/nose/functional_tests/support/idp/tests.py | 10 | import unittest
def test_a():
pass
def test_b():
raise TypeError("I am typeless")
def test_c():
assert False, "I am contrary"
def test_gen():
def tryit(i):
pass
for i in range(0, 4):
yield tryit, i
class TestCase(unittest.TestCase):
def test_a(self):
pass
d... |
stefanv/aandete | refs/heads/master | app/lib/waitress/buffers.py | 6 | ##############################################################################
#
# Copyright (c) 2001-2004 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THI... |
run2/citytour | refs/heads/master | 4symantec/Scripts/activate_this.py | 1076 | """By using execfile(this_file, dict(__file__=this_file)) you will
activate this virtualenv environment.
This can be used when you must use an existing Python interpreter, not
the virtualenv bin/python
"""
try:
__file__
except NameError:
raise AssertionError(
"You must run this like execfile('path/to/... |
P1d0f/encryptGen | refs/heads/master | encryption-generator.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# encryption-generator.py
#
# Copyright 2016 Netuser <zorgonteam@gmail.com>
#
# 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 v... |
matuu/pyafipws | refs/heads/master | wsfev1.py | 4 | #!/usr/bin/python
# -*- coding: latin-1 -*-
# 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, or (at your option) any later
# version.
#
# This program is distributed in the hope... |
benjaminmgross/asset_class | refs/heads/master | docs/conf.py | 1 | # -*- coding: utf-8 -*-
#
# Asset Class documentation build configuration file, created by
# sphinx-quickstart on Mon May 19 02:02:37 2014.
#
# 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.
#... |
mikewiebe-ansible/ansible | refs/heads/devel | lib/ansible/plugins/action/pause.py | 69 | # Copyright 2012, Tim Bielawa <tbielawa@redhat.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 later... |
AlexandreProenca/django-elasticsearch | refs/heads/master | django_elasticsearch/tests/test_restframework.py | 1 | # -*- coding: utf-8 -*-
import mock
from rest_framework import status
from rest_framework import VERSION
from rest_framework.settings import api_settings
from rest_framework.test import APIClient
from django.test import TestCase
from django.db.models.query import QuerySet
from django.contrib.auth.models import User
... |
ahuarte47/QGIS | refs/heads/master | python/console/console_compile_apis.py | 59 | # -*- coding:utf-8 -*-
"""
/***************************************************************************
Module to generate prepared APIs for calltips and auto-completion.
-------------------
begin : 2012-09-10
copyright : (C) 2012 Larry Shaffer
email ... |
alfie-max/Publish | refs/heads/master | setup.py | 1 | from setuptools import setup, find_packages
setup(
name = 'python-publish',
version = '1.0.0',
author = 'Alfred Dominic, Shahul Hameed',
author_email = 'alfie.2012@gmail.com',
packages = find_packages(exclude=[]),
scripts = ['publish'],
url = 'https://github.com/alfie-max/publish',
desc... |
G0retZ/pjproject | refs/heads/master | tests/pjsua/scripts-pesq/201_codec_speex_8000.py | 42 | # $Id$
#
from inc_cfg import *
# Call with Speex/8000 codec
test_param = TestParam(
"PESQ codec Speex NB (RX side uses snd dev)",
[
InstanceParam("UA1", "--max-calls=1 --add-codec speex/8000 --clock-rate 8000 --play-file wavs/input.8.wav --null-audio"),
InstanceParam("UA2", "--max-calls=1 --add-codec speex/8... |
veltzer/demos-python | refs/heads/master | src/examples/short/dictionaries/popitem_is_atomic.py | 1 | #!/usr/bin/env python
"""
This example shows d.popitem()
The main point is that this method is atomic and can be used
to distribute values of a dictionary between threads or processess
in a multi-threaded or multi-processed pythong application.
"""
d = {
"one": 1,
"two": 2,
"three": 3,
"four": 4,
}
w... |
specdb/uvqs | refs/heads/master | uvqs/fuv.py | 1 | """ Module to ingest SDSS III (aka BOSS) data products
"""
from __future__ import print_function, absolute_import, division, unicode_literals
import numpy as np
import os, json
import pdb
from astropy.table import Table, Column, vstack
from astropy.time import Time
from astropy.io import fits
from linetools import ... |
hellodata/hellodate | refs/heads/master | 2/site-packages/django/utils/html_parser.py | 79 | from django.utils.six.moves import html_parser as _html_parser
import re
import sys
current_version = sys.version_info
use_workaround = (
(current_version < (2, 7, 3)) or
(current_version >= (3, 0) and current_version < (3, 2, 3))
)
HTMLParseError = _html_parser.HTMLParseError
if not use_workaround:
if ... |
buckinha/gravity | refs/heads/master | optimize_ML.py | 1 | import MDP, MDP_opt, os
def optimize_ML(starting_policy_filename, objective_fn="J3"):
"""This function repeats short gradient decents until new pathways need to be generated.
"""
#Load the two pathway sets
print("")
print("Loading training and holdout sets...")
holdout_set = load_pathwa... |
Backspace-Dev/x920d-jp | refs/heads/master | tools/perf/util/setup.py | 4998 | #!/usr/bin/python2
from distutils.core import setup, Extension
from os import getenv
from distutils.command.build_ext import build_ext as _build_ext
from distutils.command.install_lib import install_lib as _install_lib
class build_ext(_build_ext):
def finalize_options(self):
_build_ext.finalize_optio... |
assassinen/python_training | refs/heads/master | data/groups.py | 1 | __author__ = 'NovikovII'
from model.group import Group
import random
import string
constant = [
Group(name="name1", header="header1", footer="footer1"),
]
def random_string(prefix, maxlen):
symbols = string.ascii_letters + string.digits #+ string.punctuation + " "*10
return prefix + "".join([random.cho... |
Alex-Just/gymlog | refs/heads/dev | gymlog/users/urls.py | 57 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django.conf.urls import url
from . import views
urlpatterns = [
url(
regex=r'^$',
view=views.UserListView.as_view(),
name='list'
),
url(
regex=r'^~redirect/$',
view=views.UserRedi... |
JaDogg/__py_playground | refs/heads/master | reference/examples-v3/java/python/tests/t2.py | 3 | a = []
b = 3 # test end of line
# two in a row
# bar
# all by itself
# before stmt
a = 3
a = 4
# after
|
nelson-liu/scikit-learn | refs/heads/master | sklearn/utils/tests/test_estimator_checks.py | 3 | import scipy.sparse as sp
import numpy as np
import sys
from sklearn.externals.six.moves import cStringIO as StringIO
from sklearn.base import BaseEstimator, ClassifierMixin
from sklearn.utils.testing import assert_raises_regex, assert_true
from sklearn.utils.estimator_checks import check_estimator
from sklearn.utils.... |
taohungyang/cloud-custodian | refs/heads/master | tests/test_report.py | 1 | # Copyright 2015-2017 Capital One Services, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... |
andela-earinde/bellatrix-py | refs/heads/master | app/js/lib/lib/modules/test/test_userdict.py | 119 | # Check every path through every method of UserDict
from test import test_support, mapping_tests
import UserDict
d0 = {}
d1 = {"one": 1}
d2 = {"one": 1, "two": 2}
d3 = {"one": 1, "two": 3, "three": 5}
d4 = {"one": None, "two": None}
d5 = {"one": 1, "two": 1}
class UserDictTest(mapping_tests.TestHashMappingProtocol):... |
ChenJunor/hue | refs/heads/master | desktop/core/ext-py/boto-2.38.0/boto/ec2/autoscale/tag.py | 173 | # Copyright (c) 2012 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# 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 ... |
naziris/HomeSecPi | refs/heads/master | venv/lib/python2.7/site-packages/werkzeug/testsuite/compat.py | 146 | # -*- coding: utf-8 -*-
"""
werkzeug.testsuite.compat
~~~~~~~~~~~~~~~~~~~~~~~~~
Ensure that old stuff does not break on update.
:copyright: (c) 2014 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import unittest
import warnings
from werkzeug.testsuite import WerkzeugTestCase
... |
jasonwee/asus-rt-n14uhp-mrtg | refs/heads/master | tmp/ve_asus-rt-n14uhp-mrtg/lib/python3.4/site-packages/pip/pep425tags.py | 79 | """Generate and work with PEP 425 Compatibility Tags."""
from __future__ import absolute_import
import re
import sys
import warnings
import platform
import logging
import ctypes
try:
import sysconfig
except ImportError: # pragma nocover
# Python < 2.7
import distutils.sysconfig as sysconfig
import distut... |
llhe/tensorflow | refs/heads/master | tensorflow/contrib/distributions/python/kernel_tests/distribution_util_test.py | 9 | # 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... |
yoghadj/or-tools | refs/heads/master | data/nonogram_regular/nonogram_car.py | 74 | # Copyright 2010 Hakan Kjellerstrand hakank@bonetmail.com
#
# 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... |
Daniel-CA/odoo-addons | refs/heads/8.0 | stock_inventory_line_ext/models/__init__.py | 8 | # -*- coding: utf-8 -*-
# © 2015 Esther Martín - AvanzOSC
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from . import stock
|
tekulvw/Squid-Plugins | refs/heads/master | emotes/emotes.py | 1 | import discord
from discord.ext import commands
import aiohttp
from cogs.utils import checks
from cogs.utils.dataIO import fileIO
import os
from __main__ import send_cmd_help
from io import BytesIO
try:
import PIL.Image as Image
except Exception as e:
raise RuntimeError("You must `pip3 install pillow` to use e... |
CrimeaCoin/p2pool | refs/heads/master | p2pool/util/logging.py | 287 | import codecs
import datetime
import os
import sys
from twisted.python import log
class EncodeReplacerPipe(object):
def __init__(self, inner_file):
self.inner_file = inner_file
self.softspace = 0
def write(self, data):
if isinstance(data, unicode):
try:
data... |
sarahgrogan/scikit-learn | refs/heads/master | sklearn/externals/joblib/pool.py | 237 | """Custom implementation of multiprocessing.Pool with custom pickler
This module provides efficient ways of working with data stored in
shared memory with numpy.memmap arrays without inducing any memory
copy between the parent and child processes.
This module should not be imported if multiprocessing is not
available... |
msebire/intellij-community | refs/heads/master | python/helpers/pydev/pydevd_attach_to_process/winappdbg/search.py | 102 | #!~/.wine/drive_c/Python25/python.exe
# -*- coding: utf-8 -*-
# Process memory finder
# Copyright (c) 2009-2014, Mario Vilas
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributi... |
koobonil/Boss2D | refs/heads/master | Boss2D/addon/tensorflow-1.2.1_for_boss/tensorflow/python/kernel_tests/large_concat_op_test.py | 133 | # 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... |
praba230890/frappe | refs/heads/develop | frappe/core/page/modules_setup/modules_setup.py | 42 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
@frappe.whitelist()
def update(ml):
"""update modules"""
frappe.db.set_global('hidden_modules', ml)
frappe.msgprint(frappe._('Updated'))
frappe.clear_cache()
|
Peddle/hue | refs/heads/master | desktop/core/ext-py/Django-1.6.10/django/contrib/comments/signals.py | 311 | """
Signals relating to comments.
"""
from django.dispatch import Signal
# Sent just before a comment will be posted (after it's been approved and
# moderated; this can be used to modify the comment (in place) with posting
# details or other such actions. If any receiver returns False the comment will be
# discarded a... |
dwf/numpy | refs/heads/master | numpy/polynomial/tests/test_hermite_e.py | 5 | """Tests for hermite_e module.
"""
from __future__ import division
import numpy as np
import numpy.polynomial.hermite_e as herme
from numpy.polynomial.polynomial import polyval
from numpy.testing import *
He0 = np.array([ 1 ])
He1 = np.array([ 0 , 1 ])
He2 = np.array([ -1 ,0 , 1 ])
He3 = np.array([ 0 , -3 ,0 , 1 ])
... |
Airphrame/mapnik | refs/heads/master | deps/mapnik/build.py | 8 | import os
from glob import glob
Import('env')
subdirs = {
'sparsehash':'sparsehash',
'sparsehash/internal':'sparsehash/internal',
'../agg/include':'agg',
'../clipper/include':'agg'
}
if 'install' in COMMAND_LINE_TARGETS:
for k,v in subdirs.items():
pathdir = os.path.join(k,'*')
includes ... |
40223101/w17test | refs/heads/master | static/Brython3.1.3-20150514-095342/Lib/_dummy_thread.py | 742 | """Drop-in replacement for the thread module.
Meant to be used as a brain-dead substitute so that threaded code does
not need to be rewritten for when the thread module is not present.
Suggested usage is::
try:
import _thread
except ImportError:
import _dummy_thread as _thread
"""
# Exports ... |
bgris/ODL_bgris | refs/heads/master | lib/python3.5/site-packages/networkx/algorithms/isomorphism/isomorph.py | 30 | """
Graph isomorphism functions.
"""
import networkx as nx
from networkx.exception import NetworkXError
__author__ = """\n""".join(['Aric Hagberg (hagberg@lanl.gov)',
'Pieter Swart (swart@lanl.gov)',
'Christopher Ellison cellison@cse.ucdavis.edu)'])
# Copyright... |
balloob/home-assistant | refs/heads/dev | homeassistant/components/mobile_app/const.py | 12 | """Constants for mobile_app."""
DOMAIN = "mobile_app"
STORAGE_KEY = DOMAIN
STORAGE_VERSION = 1
CONF_CLOUDHOOK_URL = "cloudhook_url"
CONF_REMOTE_UI_URL = "remote_ui_url"
CONF_SECRET = "secret"
CONF_USER_ID = "user_id"
DATA_BINARY_SENSOR = "binary_sensor"
DATA_CONFIG_ENTRIES = "config_entries"
DATA_DELETED_IDS = "dele... |
morucci/repoxplorer | refs/heads/master | bin/bench/fake-commit-gen.py | 1 | #!/usr/bin/python
# Copyright 2016, Fabien Boucher
#
# 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... |
gravyboat/streamlink | refs/heads/master | tests/plugins/test_goltelevision.py | 7 | import unittest
from streamlink.plugins.goltelevision import GOLTelevision
class TestPluginEuronews(unittest.TestCase):
def test_can_handle_url(self):
# should match
self.assertTrue(GOLTelevision.can_handle_url("http://www.goltelevision.com/live"))
self.assertTrue(GOLTelevision.can_handle... |
abhi12ravi/newflaskapp | refs/heads/master | routes.py | 1 | from flask import Flask, render_template
app = Flask(__name__)
@app.route('/')
def home():
return render_template('home.html')
@app.route('/about')
def about():
return render_template('about.html')
if __name__ == '__main__':
app.run(debug=True) |
mramire8/active | refs/heads/master | datautil/load_data.py | 1 | __author__ = 'mramire8'
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.datasets import load_files
from sklearn.datasets import fetch_20newsgroups
from sklearn.cross_validation import train_test_split, ShuffleSplit
import numpy as np
import xml.etree.ElementTree as ET
from xml.etree.ElementTr... |
MuffinMedic/CloudBot | refs/heads/TechSupport | cloudbot/event.py | 3 | import asyncio
import concurrent.futures
import enum
import logging
import sys
import warnings
from functools import partial
from cloudbot.util.parsers.irc import Message
logger = logging.getLogger("cloudbot")
@enum.unique
class EventType(enum.Enum):
message = 0
action = 1
# TODO: Do we actually want to... |
Drooids/odoo | refs/heads/8.0 | addons/website_google_map/__init__.py | 1350 | import controllers
|
KaranToor/MA450 | refs/heads/master | google-cloud-sdk/lib/googlecloudsdk/third_party/appengine/datastore/datastore_v4_pb.py | 6 | # Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... |
forifelse/fispTools | refs/heads/master | assimp/contrib/gtest/scripts/pump.py | 2471 | #!/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... |
VishvajitP/readthedocs.org | refs/heads/master | readthedocs/rtd_tests/tests/test_backend.py | 30 | from os.path import exists
from django.contrib.auth.models import User
from readthedocs.projects.models import Project
from readthedocs.rtd_tests.base import RTDTestCase
from readthedocs.rtd_tests.utils import make_test_git, make_test_hg
class TestGitBackend(RTDTestCase):
def setUp(self):
git_repo = ma... |
smnslwl/project_euler | refs/heads/master | 50/50.py | 1 | """
The prime 41, can be written as the sum of six consecutive primes:
41 = 2 + 3 + 5 + 7 + 11 + 13
This is the longest sum of consecutive primes that adds to a prime below
one-hundred.
The longest sum of consecutive primes below one-thousand that adds to a
prime, contains 21... |
EvanK/ansible | refs/heads/devel | lib/ansible/modules/web_infrastructure/ansible_tower/tower_inventory.py | 14 | #!/usr/bin/python
# coding: utf-8 -*-
# (c) 2017, Wayne Witzel III <wayne@riotousliving.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... |
rehandalal/standup | refs/heads/master | standup/migrations/versions/004_add_many_to_many_helper_table_for_teams_and_users.py | 3 | from sqlalchemy import *
meta = MetaData()
team_users = Table('team_users', meta,
Column('team_id', Integer, ForeignKey('team.id')),
Column('user_id', Integer, ForeignKey('user.id')))
def upgrade(migrate_engine):
# Upgrade operations go here. Don't create your own engine;... |
lafranceinsoumise/api-django | refs/heads/master | agir/events/actions/__init__.py | 1 | from .export import *
|
Niranjan-K/andes | refs/heads/master | modules/andes-core/perftests/bin/processing/processTests.py | 25 | #!/usr/bin/env python
#
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... |
pacificclimate/modelmeta | refs/heads/master | mm_cataloguer/associate_ensemble.py | 1 | import logging
import traceback
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from modelmeta import DataFile, DataFileVariable, \
Ensemble, EnsembleDataFileVariables
formatter = logging.Formatter(
'%(asctime)s %(levelname)s: %(message)s', "%Y-%m-%d %H:%M:%S")
handler = logging... |
computersalat/ansible | refs/heads/devel | test/units/compat/builtins.py | 115 | # (c) 2014, Toshio Kuratomi <tkuratomi@ansible.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 later... |
jbonaiuto/perceptual-choice-hysteresis | refs/heads/master | src/python/perceptchoice/experiment/analysis.py | 1 | from datetime import datetime
import os
from matplotlib.mlab import normpdf
from matplotlib.patches import Rectangle
import numpy as np
import pandas as pd
import statsmodels.api as sm
from scipy.stats import wilcoxon, norm, mannwhitneyu
from sklearn.linear_model import LinearRegression
import matplotlib.pyplot as plt
... |
kwikadi/orange3 | refs/heads/master | Orange/widgets/tests/test_owselectcolumns.py | 11 | from unittest import TestCase
from unittest.mock import Mock
from Orange.data import ContinuousVariable, DiscreteVariable, Domain
from Orange.widgets.data.contexthandlers import \
SelectAttributesDomainContextHandler
from Orange.widgets.settings import ContextSetting
from Orange.widgets.utils import vartype
Conti... |
mirac/msite2 | refs/heads/master | msite2/settings.py | 1 | """
Django settings for msite2 project.
Generated by 'django-admin startproject' using Django 1.8.3.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build paths... |
camilonova/sentry | refs/heads/master | src/sentry/api/endpoints/group_markseen.py | 1 | from __future__ import absolute_import
from django.utils import timezone
from rest_framework.response import Response
from sentry.api.base import Endpoint
from sentry.api.permissions import assert_perm
from sentry.db.models import create_or_update
from sentry.models import Project, Group, GroupSeen
from sentry.utils.... |
Suninus/NewsBlur | refs/heads/master | apps/analyzer/tests.py | 19 | from django.test.client import Client
from apps.rss_feeds.models import MStory
from django.test import TestCase
from django.core import management
# from apps.analyzer.classifier import FisherClassifier
import nltk
from itertools import groupby
from apps.analyzer.tokenizer import Tokenizer
from vendor.reverend.thomas i... |
sbryan12144/BeastMode-Elite | refs/heads/master | scripts/build-all.py | 1250 | #! /usr/bin/env python
# Copyright (c) 2009-2011, Code Aurora Forum. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# n... |
HoliestCow/ece692_deeplearning | refs/heads/master | project5/gru/crnn.py | 1 |
import tensorflow as tf
import numpy as np
import time
import h5py
# import matplotlib.pyplot as plt
# from sklearn.metrics import confusion_matrix
# import itertools
# from copy import deepcopy
# import os
# import os.path
from collections import OrderedDict
# import pickle
from itertools import islice
# NOTE: For ... |
webrecorder/webrecorder | refs/heads/master | webrecorder/test/test_no_anon.py | 1 | import os
from .testutils import BaseWRTests
import pytest
# ============================================================================
@pytest.fixture(params=['/record/http://example.com/',
'/_new/foo/rec-sesh/record/http://example.com/',
'/_new/foo/rec-sesh/record/m... |
tushar7795/MicroBlog | refs/heads/master | flask/lib/python2.7/site-packages/babel/dates.py | 8 | # -*- coding: utf-8 -*-
"""
babel.dates
~~~~~~~~~~~
Locale dependent formatting and parsing of dates and times.
The default locale for the functions in this module is determined by the
following environment variables, in that order:
* ``LC_TIME``,
* ``LC_ALL``, and
* ``LANG``
... |
tinchoss/Python_Android | refs/heads/master | python/src/Misc/BeOS-setup.py | 24 | # Autodetecting setup.py script for building the Python extensions
#
# Modified for BeOS build. Donn Cave, March 27 2001.
__version__ = "special BeOS after 1.37"
import sys, os
from distutils import sysconfig
from distutils import text_file
from distutils.errors import *
from distutils.core import Extension, setup
f... |
abetusk/bostontraintrack | refs/heads/release | experimental/protob/protobuf-2.6.1/python/google/protobuf/internal/descriptor_pool_test.py | 73 | #! /usr/bin/python
#
# Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# https://developers.google.com/protocol-buffers/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.