repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
guillermooo-forks/dart-sublime-bundle | refs/heads/master | cmds_search.py | 3 | # Copyright (c) 2014, Guillermo López-Anglada. Please see the AUTHORS file for details.
# All rights reserved. Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.)
'''Search commands.
'''
import sublime
import sublime_plugin
from Dart.sublime_plugin_lib import PluginLo... |
Neamar/django | refs/heads/master | tests/migrations/test_migrations/0002_second.py | 846 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("migrations", "0001_initial"),
]
operations = [
migrations.DeleteModel("Tribble"),
migrations.RemoveField("Author",... |
wadobo/congressus | refs/heads/master | congressus/congressus/settings.py | 1 | """
Django settings for congressus project.
Generated by 'django-admin startproject' using Django 1.8.5.
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 p... |
TrimBiggs/calico-containers | refs/heads/master | tests/st/no_orchestrator/test_interfaces.py | 15 | # Copyright 2015 Metaswitch Networks
#
# 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... |
jojurajan/aiohttp | refs/heads/master | aiohttp/abc.py | 20 | import asyncio
from abc import ABCMeta, abstractmethod
class AbstractRouter(metaclass=ABCMeta):
@asyncio.coroutine # pragma: no branch
@abstractmethod
def resolve(self, request):
"""Return MATCH_INFO for given request"""
class AbstractMatchInfo(metaclass=ABCMeta):
@property # pragma: no ... |
xalt/xalt | refs/heads/master | proj_mgmt/check_entries_db.in.py | 1 | #!/usr/bin/env python3
# -*- python -*-
#
# Git Version: @git@
#-----------------------------------------------------------------------
# XALT: A tool to track the programs on a cluster.
# Copyright (C) 2013-2014 University of Texas at Austin
# Copyright (C) 2013-2014 University of Tennessee
#
# This library is free ... |
talon-one/talon_one.py | refs/heads/master | test/test_export.py | 1 | # coding: utf-8
"""
Talon.One API
The Talon.One API is used to manage applications and campaigns, as well as to integrate with your application. The operations in the _Integration API_ section are used to integrate with our platform, while the other operations are used to manage applications and campaigns. #... |
willharris/django | refs/heads/master | tests/shortcuts/urls.py | 252 | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^render_to_response/$', views.render_to_response_view),
url(r'^render_to_response/multiple_templates/$', views.render_to_response_view_with_multiple_templates),
url(r'^render_to_response/request_context/$', views.render_to_response... |
asm-products/pants-party | refs/heads/master | mailframework/mails.py | 1 | import requests, datetime
from django.core.mail import EmailMessage, EmailMultiAlternatives
from django.template.loader import render_to_string
from django.shortcuts import HttpResponse, render, get_object_or_404
def send_welcome_email(to):
msg_subj = "Welcome to the Party"
msg_body = render_to_string('mail/w... |
kobotoolbox/dkobo | refs/heads/master | dkobo/koboform/admin.py | 13848 | from django.contrib import admin
# Register your models here.
|
ymero/workin | refs/heads/master | workin/exts/admin/forms.py | 2 | #!/usr/bin/env python
# coding: utf-8
from wtforms import widgets
from wtforms.fields import SelectMultipleField, SelectField
from wtforms.widgets.core import HTMLString
from workin.forms import BaseForm
class SelectCheckbox(widgets.CheckboxInput):
def __call__(self, field, **kwargs):
kwargs.setdefault(... |
klenks/jobsportal | refs/heads/master | env/lib/python2.7/site-packages/pip/utils/logging.py | 516 | from __future__ import absolute_import
import contextlib
import logging
import logging.handlers
import os
try:
import threading
except ImportError:
import dummy_threading as threading
from pip.compat import WINDOWS
from pip.utils import ensure_dir
try:
from pip._vendor import colorama
# Lots of differen... |
backtou/longlab | refs/heads/master | gr-uhd/examples/python/usrp_nbfm_rcv.py | 8 | #!/usr/bin/env python
#
# Copyright 2005,2007,2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your ... |
HarryRybacki/osf.io | refs/heads/develop | website/project/metadata/schemas.py | 27 | import os
import json
def ensure_schema_structure(schema):
if 'pages' not in schema['schema']:
schema['schema'] = {
'pages': [
{
'id': 'page1',
'title': '',
'questions': schema['schema']['questions'],
}
... |
MartialD/hyperspy | refs/heads/RELEASE_next_minor | hyperspy/samfire_utils/local_strategies.py | 6 | # -*- coding: utf-8 -*-
# Copyright 2007-2016 The HyperSpy developers
#
# This file is part of HyperSpy.
#
# HyperSpy 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... |
fatihzkaratana/AutobahnPython | refs/heads/master | autobahn/autobahn/tests/test_wamp.py | 20 | ###############################################################################
##
## Copyright 2011,2012,2013 Tavendo GmbH
##
## 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
##
## ... |
elmon1987/lt-implement | refs/heads/master | Luby/gtest-1.6.0/test/gtest_test_utils.py | 397 | #!/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... |
stb-tester/stb-tester | refs/heads/master | tests/validate-ocr.py | 1 | #!/usr/bin/python
u"""
validate-ocr.py can be run on a corpus of test images reporting how good a job
stbt has done of reading the text. Thus it can be used to measure improvements
to the OCR algorithm and, more importantly, detect any regressions introduced.
The corpus consists of a set of images with corresponding... |
loic/django | refs/heads/master | tests/migrations/test_migrations_initial_false/0001_not_initial.py | 315 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = False
operations = [
migrations.CreateModel(
"Author",
[
("id", models.AutoField(primary_key=True)),
... |
suiyuan2009/tensorflow | refs/heads/master | tensorflow/contrib/linalg/python/kernel_tests/linear_operator_full_matrix_test.py | 41 | # 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... |
Asnelchristian/coala | refs/heads/master | tests/processes/section_executor_test_files/ProcessingLocalTestBear.py | 24 | import time
from coalib.bears.LocalBear import LocalBear
from coalib.results.Result import Result
class ProcessingLocalTestBear(LocalBear):
def run(self, filename, file):
# we need to test that the SectionExecutor holds back the global
# results until processing of all local ones is finished
... |
normtown/SickRage | refs/heads/master | lib/sqlalchemy/ext/__init__.py | 79 | # ext/__init__.py
# Copyright (C) 2005-2014 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
|
mortada/scipy | refs/heads/master | scipy/weave/standard_array_spec.py | 69 | from __future__ import absolute_import, print_function
from .c_spec import common_base_converter
from .c_spec import num_to_c_types
import numpy
num_typecode = {}
num_typecode['?'] = 'PyArray_BOOL'
num_typecode['b'] = 'PyArray_BYTE'
num_typecode['B'] = 'PyArray_UBYTE'
num_typecode['h'] = 'PyArray_SHORT'
num_typecode[... |
alrusdi/lettuce | refs/heads/master | tests/integration/lib/Django-1.2.5/tests/regressiontests/managers_regress/models.py | 92 | """
Various edge-cases for model managers.
"""
from django.db import models
class OnlyFred(models.Manager):
def get_query_set(self):
return super(OnlyFred, self).get_query_set().filter(name='fred')
class OnlyBarney(models.Manager):
def get_query_set(self):
return super(OnlyBarney, self).get_q... |
sinhrks/scikit-learn | refs/heads/master | sklearn/manifold/tests/test_t_sne.py | 8 | import sys
from sklearn.externals.six.moves import cStringIO as StringIO
import numpy as np
import scipy.sparse as sp
from sklearn.neighbors import BallTree
from sklearn.utils.testing import assert_less_equal
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_almost_equal
from skle... |
mesosphere/aws-cfn-resource-bridge | refs/heads/master | aws/cfn/bridge/vendored/botocore/session.py | 3 | # Copyright (c) 2012-2013 Mitch Garnaat http://garnaat.org/
# Copyright 2012-2014 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http... |
saradbowman/osf.io | refs/heads/develop | addons/mendeley/models.py | 13 | # -*- coding: utf-8 -*-
import time
from flask import has_app_context
from framework import sentry
import mendeley
from addons.base.models import BaseCitationsNodeSettings, BaseOAuthUserSettings
from django.db import models
from addons.base import exceptions
from framework.exceptions import HTTPError
from mendeley.ex... |
rcosnita/fantastico | refs/heads/master | fantastico/middleware/model_session_middleware.py | 1 | '''
Copyright 2013 Cosnita Radu Viorel
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, distribute... |
prarthitm/edxplatform | refs/heads/master | openedx/core/djangolib/fields.py | 15 | """
Custom Django fields.
"""
from django.db import models
class CharNullField(models.CharField):
"""CharField that stores NULL but returns ''"""
description = "CharField that stores NULL but returns ''"
def to_python(self, value):
"""Converts the value into the correct Python object."""
... |
StegSchreck/RatS | refs/heads/master | RatS/letterboxd/letterboxd_ratings_inserter.py | 1 | import datetime
import os
import sys
import time
from progressbar import ProgressBar
from selenium.common.exceptions import StaleElementReferenceException, ElementNotInteractableException, \
NoSuchElementException
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditio... |
yuexue/small_mathjax | refs/heads/master | small_mathjax.py | 1 | '''
A simple tool for reducing the size of MathJax.
Base on https://github.com/mathjax/MathJax-docs/wiki/Guide%3A-reducing-size-of-a-mathjax-installation
'''
import sys
import os
import commands
import ConfigParser
import getopt
CONFIG = {
'ROOT': 'MathJax',
'keep': {
'config': None,
'localizat... |
pstratem/bitcoin | refs/heads/master | test/get_previous_releases.py | 25 | #!/usr/bin/env python3
#
# Copyright (c) 2018-2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Download or build previous releases.
# Needs curl and tar to download a release, or the build depend... |
BT-astauder/odoo | refs/heads/8.0 | addons/l10n_be/wizard/l10n_be_partner_vat_listing.py | 302 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# Corrections & modifications by Noviat nv/sa, (http://www.noviat.be):
# - VAT listing based upon year... |
pombreda/libforensics | refs/heads/master | unittests/run_tests.py | 13 | # Copyright 2010 Michael Murr
#
# This file is part of LibForensics.
#
# LibForensics is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later ver... |
android-ia/platform_external_chromium_org_third_party_WebKit | refs/heads/master | Tools/Scripts/webkitpy/common/checkout/scm/svn.py | 13 | # Copyright (c) 2009, 2010, 2011 Google Inc. All rights reserved.
# Copyright (c) 2009 Apple 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 reta... |
feroda/django | refs/heads/master | tests/template_tests/syntax_tests/test_filter_tag.py | 521 | from django.template import TemplateSyntaxError
from django.test import SimpleTestCase
from ..utils import setup
class FilterTagTests(SimpleTestCase):
@setup({'filter01': '{% filter upper %}{% endfilter %}'})
def test_filter01(self):
output = self.engine.render_to_string('filter01')
self.ass... |
ArcherSys/ArcherSys | refs/heads/master | skulpt/test/run/t425.py | 1 | l = [1,2,3,4]
t = (1,2,3,4)
d = {1:2,3:4}
# lists
print "\nlists"
print sum([])
print sum([],5)
print sum([1,2,3,4])
print sum(l,5)
# tuples
print "\ntuples"
print sum(())
print sum((),5)
print sum((1,2,3,4))
print sum(t,5)
# dictionaries
print "\ndictionaries"
print sum({})
print sum({},5)
print sum({1:2,3:4})
prin... |
Ginkgo-Biloba/Misc-Python | refs/heads/master | Misc/AsciiPic.py | 1 | from PIL import Image
import argparse
# 70 个字符
ascChar = list(""" .\'`^",:;Il!i><~+_-?][}{1)(|\\/tfjrxnuvczXYUJCLQ0OZmwqpdbkhao*#MW&8%B@$""")
# 将256灰度映射到 70 个字符上
def rgb2char(r, g, b, alpha=255, ascChar=ascChar):
if (alpha == 0):
return ' '
grey = (0.2126 * r + 0.7152 * g + 0.0722 * b) * alpha / 255
... |
juliusbierk/scikit-image | refs/heads/master | setup.py | 11 | #! /usr/bin/env python
descr = """Image Processing SciKit
Image processing algorithms for SciPy, including IO, morphology, filtering,
warping, color manipulation, object detection, etc.
Please refer to the online documentation at
http://scikit-image.org/
"""
DISTNAME = 'scikit-image'
DESCRIPTION = 'Image processing... |
AlexanderFabisch/scikit-learn | refs/heads/master | examples/cluster/plot_kmeans_digits.py | 230 | """
===========================================================
A demo of K-Means clustering on the handwritten digits data
===========================================================
In this example we compare the various initialization strategies for
K-means in terms of runtime and quality of the results.
As the gr... |
Eivindbergman/Skrapa | refs/heads/master | libs/tornado/test/web_test.py | 18 | from __future__ import absolute_import, division, print_function
from tornado.concurrent import Future
from tornado import gen
from tornado.escape import json_decode, utf8, to_unicode, recursive_unicode, native_str, to_basestring
from tornado.httputil import format_timestamp
from tornado.ioloop import IOLoop
from torna... |
airbnb/airflow | refs/heads/master | airflow/providers/slack/hooks/__init__.py | 5130 | #
# 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... |
paulopperman/Hyperloop | refs/heads/master | src/hyperloop/run_cases.py | 9 | import numpy as np
import pylab as p
def mvr(assembly):
machs = []
tube_r = []
capsule_r = []
for m in np.arange(.781,.95, .01):
hl.Mach_pod_max = m
hl.run()
machs.append(m)
tube_r.append(hl.pod.radius_inlet_back_outer)
capsule_r.append(hl.flow_limit.radius_tube... |
YOTOV-LIMITED/kudu | refs/heads/master | Kudu.Core/Scripts/select_python_version.py | 19 | # Launch this script using the python.exe that is in the PATH
# Detects the version of Python to use:
# Version specified in runtime.txt in deployment source folder
# Version from site configuration -- currently executing Python (in PATH)
# Writes the detected version information to files in deployment temp folde... |
jhawkesworth/ansible | refs/heads/devel | lib/ansible/modules/network/netscaler/netscaler_gslb_vserver.py | 124 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2017 Citrix Systems
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... |
wllmtrng/ud032 | refs/heads/master | Lesson_2_Data_in_More_Complex_Formats/08-Handling_Attributes/authors.py | 1 | #!/usr/bin/env python
# Your task here is to extract data from xml on authors of an article
# and add it to a list, one item for an author.
# See the provided data structure for the expected format.
# The tags for first name, surname and email should map directly
# to the dictionary keys, but you have to extract the at... |
Duoxilian/home-assistant | refs/heads/dev | homeassistant/components/sensor/mhz19.py | 17 | """
Support for CO2 sensor connected to a serial port.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.mhz19/
"""
import logging
import voluptuous as vol
from homeassistant.const import CONF_NAME
from homeassistant.helpers.entity import Entity
im... |
cainmatt/django | refs/heads/master | tests/forms_tests/widget_tests/test_fileinput.py | 179 | from django.forms import FileInput
from .base import WidgetTest
class FileInputTest(WidgetTest):
widget = FileInput()
def test_render(self):
"""
FileInput widgets never render the value attribute. The old value
isn't useful if a form is updated or an error occurred.
"""
... |
GGoussar/scikit-image | refs/heads/master | skimage/graph/spath.py | 42 | import numpy as np
from . import _spath
def shortest_path(arr, reach=1, axis=-1, output_indexlist=False):
"""Find the shortest path through an n-d array from one side to another.
Parameters
----------
arr : ndarray of float64
reach : int, optional
By default (``reach = 1``), the shortest ... |
pmclanahan/django-celery-email | refs/heads/master | djcelery_email/__init__.py | 1 | from .__about__ import * # noqa
|
takeshineshiro/nova | refs/heads/master | nova/api/openstack/compute/schemas/remote_consoles.py | 51 | # 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 ... |
nvoron23/deepdive | refs/heads/master | examples/spouse_example/postgres/incremental/udf/ext_has_spouse.py | 15 | #! /usr/bin/env python
import csv
import os
import sys
from collections import defaultdict
APP_HOME = os.environ['APP_HOME']
# Load the spouse dictionary for distant supervision
spouses = defaultdict(lambda: None)
with open (APP_HOME + "/../../data/spouses.csv") as csvfile:
reader = csv.reader(csvfile)
for line ... |
rrooij/youtube-dl | refs/heads/master | youtube_dl/extractor/amp.py | 19 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
determine_ext,
ExtractorError,
int_or_none,
mimetype2ext,
parse_iso8601,
url_or_none,
)
class AMPIE(InfoExtractor):
# parse Akamai Adaptive Media Player feed
def _extract_fe... |
marco-lancini/Showcase | refs/heads/master | django/contrib/messages/storage/base.py | 399 | from django.conf import settings
from django.utils.encoding import force_unicode, StrAndUnicode
from django.contrib.messages import constants, utils
LEVEL_TAGS = utils.get_level_tags()
class Message(StrAndUnicode):
"""
Represents an actual message that can be stored in any of the supported
storage class... |
telerik/cloudbase-init | refs/heads/master | cloudbaseinit/tests/plugins/windows/test_sshpublickeys.py | 1 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 Cloudbase Solutions Srl
#
# 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/LICEN... |
perlygatekeeper/glowing-robot | refs/heads/master | Little_Alchemy_2/Scraper_python/env/lib/python3.7/site-packages/pip/_internal/commands/help.py | 30 | from __future__ import absolute_import
from pip._internal.cli.base_command import Command
from pip._internal.cli.status_codes import SUCCESS
from pip._internal.exceptions import CommandError
class HelpCommand(Command):
"""Show help for commands"""
name = 'help'
usage = """
%prog <command>"""
su... |
xiamike/stanford-ctc | refs/heads/master | ctc_fast/decoder/test/test_bg_lm.py | 2 | import numpy as np
from decoder_utils import load_data, load_nnet, decode, int_to_char,\
collapse_seq, load_char_map
if __name__ == '__main__':
print 'Loading data'
fnum = 1
data_dict, alis, keys = load_data(fnum)
print 'Loading neural net'
rnn = load_nnet()
data, labels = data_dict[ke... |
fangxingli/hue | refs/heads/master | apps/sqoop/src/sqoop/migrations/0001_initial.py | 38 | # 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):
pass
def backwards(self, orm):
pass
models = {
}
complete_app... |
aosingh/Regularization | refs/heads/master | Lp/Performance.py | 1 | import numpy as np
from Lp import Lp
import matplotlib.pyplot as plt
from sklearn.datasets.samples_generator import make_regression
# Define synthetic data-set constants. Change this to experiment with different data sets
NUM_OF_SAMPLES = 2000
NUM_OF_FEATURES = 2
NOISE = 10
# Define the number of iterations and learn... |
nivertech/duktape | refs/heads/master | tests/perf/test-prop-write.py | 10 | def test():
obj = { 'xxx1': 1, 'xxx2': 2, 'xxx3': 4, 'xxx4': 4, 'foo': 123 }
i = 0
while i < 1e8:
obj['foo'] = 234
i += 1
test()
|
barbuza/django | refs/heads/master | tests/i18n/test_percents.py | 222 | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals
import os
from django.template import Context, Template
from django.test import SimpleTestCase, override_settings
from django.utils._os import upath
from django.utils.encoding import force_text
from django.utils.translation import activate, get_languag... |
confpack/confpacker | refs/heads/master | tests/packagers/base/test_package.py | 1 | from __future__ import absolute_import
import os.path
from libconfpacker.packagers.base import Package
from ... import helpers
class TestPackage(helpers.ConfpackerTestCase):
def test_package_should_load_data_if_correct(self):
package = Package(
"nginx-conf",
os.path.join(helpers.CORRECT1_PATH, "p... |
Donkyhotay/MoonPy | refs/heads/master | twisted/names/test/__init__.py | 139 | "Tests for twisted.names"
|
h2oai/h2o-3 | refs/heads/master | h2o-py/tests/testdir_algos/kmeans/pyunit_init_err_casesKmeans.py | 2 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
import h2o
from h2o.estimators.kmeans import H2OKMeansEstimator
from h2o.exceptions import H2OTypeError, H2OResponseError
from tests import pyunit_utils
import random
def init_err_casesKmeans():
# Log.info("Importing benign.csv data...\n")
benign_h2o = h2o.impo... |
quickresolve/accel.ai | refs/heads/master | flask-aws/lib/python2.7/site-packages/setuptools/monkey.py | 18 | """
Monkey patching of distutils.
"""
import sys
import distutils.filelist
import platform
import types
import functools
import inspect
from .py26compat import import_module
from setuptools.extern import six
import setuptools
__all__ = []
"""
Everything is private. Contact the project team
if you think you need thi... |
ambimorph/malaprop | refs/heads/master | malaprop/error_insertion/real_word_error_inserter.py | 1 | # real_word_error_inserter.py
import codecs, StringIO, json
from recluse.nltk_based_segmenter_tokeniser import *
class RealWordErrorInserter():
def __init__(self, segmenter_tokeniser, vocabulary, error_channel):
self.segmenter_tokeniser = segmenter_tokeniser
self.vocabulary = vocabulary
... |
KvasirSGDevelopment/FlixBot | refs/heads/master | src/modules/kick.py | 2 | import src.permission as perm
import discord.utils as utils
Helper = {
'!kick':{'Help':'!kick [@User] [Message]', 'Description':'kicks the user from the server and sends him a message', 'Type':'Admin'}
}
async def kick(client, message, arg):
if await perm.have_permission(message.author) == 2:
string = a... |
publicscience/brain | refs/heads/master | app/brain/markov.py | 1 | from nltk.tokenize import sent_tokenize
import string, sys, random, pickle
from os import getcwd, path
__location__ = path.realpath(path.join(getcwd(), path.dirname(__file__)))
class Markov():
def __init__(self, ngram_size=1, max_chars=140, ramble=True, spasm=0.05, filepath=path.join(__location__, 'markov.pickle'... |
varunnaganathan/django | refs/heads/master | django/db/transaction.py | 238 | from django.db import (
DEFAULT_DB_ALIAS, DatabaseError, Error, ProgrammingError, connections,
)
from django.utils.decorators import ContextDecorator
class TransactionManagementError(ProgrammingError):
"""
This exception is thrown when transaction management is used improperly.
"""
pass
def get_... |
destinmoulton/squabble | refs/heads/master | pythonclient/venv/lib/python2.7/site-packages/setuptools/extension.py | 165 | import sys
import re
import functools
import distutils.core
import distutils.extension
from setuptools.dist import _get_unpatched
_Extension = _get_unpatched(distutils.core.Extension)
def have_pyrex():
"""
Return True if Cython or Pyrex can be imported.
"""
pyrex_impls = 'Cython.Distutils.build_ext',... |
mathspace/django | refs/heads/master | django/core/cache/backends/filebased.py | 73 | "File-based cache backend"
import errno
import glob
import hashlib
import io
import os
import random
import tempfile
import time
import zlib
from django.core.cache.backends.base import DEFAULT_TIMEOUT, BaseCache
from django.core.files.move import file_move_safe
from django.utils.encoding import force_bytes
try:
f... |
adedayo/intellij-community | refs/heads/master | python/lib/Lib/popen2.py | 110 | """Spawn a command with pipes to its stdin, stdout, and optionally stderr.
The normal os.popen(cmd, mode) call spawns a shell command and provides a
file interface to just the input or output of the process depending on
whether mode is 'r' or 'w'. This module provides the functions popen2(cmd)
and popen3(cmd) which r... |
Stavitsky/nova | refs/heads/master | nova/tests/unit/api/openstack/compute/test_consoles.py | 26 | # Copyright 2010-2011 OpenStack Foundation
# Copyright 2011 Piston Cloud Computing, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www... |
Flumotion/flumotion | refs/heads/master | flumotion/component/producers/pipeline/pipeline.py | 3 | # -*- Mode: Python -*-
# vi:si:et:sw=4:sts=4:ts=4
# Flumotion - a streaming media server
# Copyright (C) 2004,2005,2006,2007,2008,2009 Fluendo, S.L.
# Copyright (C) 2010,2011 Flumotion Services, S.A.
# All rights reserved.
#
# This file may be distributed and/or modified under the terms of
# the GNU Lesser General Pub... |
ejspina/Gene_expression_tools | refs/heads/master | Python/clustal_renameID.py | 1 | #-------------------------------------------------------------------------------
# Name: module1
# Purpose:
#
# Author: Eli
#
# Created: 05/04/2014
# Copyright: (c) Eli 2014
# Licence: <your licence>
#-------------------------------------------------------------------------------
def m... |
alxgu/ansible | refs/heads/devel | contrib/inventory/linode.py | 37 | #!/usr/bin/env python
'''
Linode external inventory script
=================================
Generates inventory that Ansible can understand by making API request to
Linode using the Chube library.
NOTE: This script assumes Ansible is being executed where Chube is already
installed and has a valid config at ~/.chube... |
chrisseto/osf.io | refs/heads/feature/reviews | website/settings/local-dist.py | 2 | # -*- coding: utf-8 -*-
'''Example settings/local.py file.
These settings override what's in website/settings/defaults.py
NOTE: local.py will not be added to source control.
'''
from . import defaults
DEV_MODE = True
DEBUG_MODE = True # Sets app to debug mode, turns off template caching, etc.
SECURE_MODE = not DEBU... |
isandlaTech/cohorte-devtools | refs/heads/master | qualifier/deploy/cohorte-home/repo/requests/packages/chardet/euckrprober.py | 2930 | ######################## 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... |
nagyistoce/edx-platform | refs/heads/master | pavelib/utils/test/suites/__init__.py | 120 | """
TestSuite class and subclasses
"""
from .suite import TestSuite
from .nose_suite import NoseTestSuite, SystemTestSuite, LibTestSuite
from .python_suite import PythonTestSuite
from .js_suite import JsTestSuite
from .acceptance_suite import AcceptanceTestSuite
from .bokchoy_suite import BokChoyTestSuite
|
zepheira/amara | refs/heads/master | test/xmlcore/test_write.py | 1 | import sys
import unittest
from cStringIO import StringIO
from amara import xml_print, tree
from amara.lib.treecompare import xml_compare
from amara.writers import lookup, register, XML_W, HTML_W, XHTML_W
from amara.test import KnownFailure
class Test_xml_write(unittest.TestCase):
"Test the new xml_write and xml... |
johnttaylor/Outcast | refs/heads/master | bin/scm/none/archive.py | 1 | """
Script that creates an archive file form the current SCM snapshot
===============================================================================
usage: evie [common-opts] archive [options] <pkgname> <tarname>
evie [common-opts] archive --list
Arguments:
<pkgname> Name of the package ... |
Swiftaim/simpleami | refs/heads/master | simpleami/ami_svc_handler.py | 1 | import socket
from .ami_action_templates import *
class AMISvcHandler:
"""AMISvcHandler provides a connection to the Asterisk AMI Manager interface.
The class also provides methods for passing commands to the AMI as well as
simplifying common tasks.
For more info on Asterisk AMI:
http://www.voip... |
manishpatell/erpcustomizationssaiimpex123qwe | refs/heads/master | addons/email_attachment_ept/__openerp__.py | 1 | {
'name': 'Email Attachment Ept',
'version': '1.6',
'category' : "Emipro Technologies",
'description': """ It will provide a facility where you can specify default attachment.""",
'author': 'Emipro',
'website': 'http://www.emiprotechnologies.com',
'depends': ['email_template','ir_actions_rep... |
quaddra/engage | refs/heads/master | python_pkg/engage/drivers/standard/postgres_database__9_x/driver.py | 1 |
"""Resource manager for postgres-database 9.x
"""
# Common stdlib imports
import sys
import os
import os.path
## import commands
# fix path if necessary (if running from source or running as test)
try:
import engage.utils
except:
sys.exc_clear()
dir_to_add_to_python_path = os.path.abspath((os.path.join(... |
BT-ojossen/odoo | refs/heads/8.0 | addons/web_calendar/__openerp__.py | 422 | {
'name': 'Web Calendar',
'category': 'Hidden',
'description':"""
OpenERP Web Calendar view.
==========================
""",
'author': 'OpenERP SA, Valentino Lab (Kalysto)',
'version': '2.0',
'depends': ['web'],
'data' : [
'views/web_calendar.xml',
],
'qweb': [
'stat... |
mgit-at/ansible | refs/heads/devel | lib/ansible/plugins/inventory/aws_rds.py | 31 | # Copyright (c) 2018 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
name: aws_rds
plugin_type: inventory
short_description: rds instance... |
el-ethan/kivy | refs/heads/master | kivy/tests/test_properties.py | 5 | '''
Test properties attached to a widget
'''
import unittest
from kivy.event import EventDispatcher
from functools import partial
class TestProperty(EventDispatcher):
pass
wid = TestProperty()
class PropertiesTestCase(unittest.TestCase):
def test_base(self):
from kivy.properties import Property
... |
luiseduardohdbackup/odoo | refs/heads/8.0 | addons/account/wizard/account_report_general_ledger.py | 267 | # -*- 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... |
tbinjiayou/Odoo | refs/heads/master | addons/account/wizard/account_fiscalyear_close_state.py | 297 | # -*- 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... |
caidongyun/pylearn2 | refs/heads/master | pylearn2/sandbox/cuda_convnet/tests/test_pool.py | 44 | from __future__ import print_function
import copy
import numpy
import theano
from theano.tensor import grad
from theano.tests import unittest_tools
import theano.sandbox.cuda as tcn
if not tcn.cuda_available:
from nose.plugins.skip import SkipTest
raise SkipTest('Optional package cuda disabled.')
from pylea... |
ipcamit/ipcamit.github.io | refs/heads/master | node_modules/pygmentize-bundled/vendor/pygments/build-2.7/pygments/styles/__init__.py | 364 | # -*- coding: utf-8 -*-
"""
pygments.styles
~~~~~~~~~~~~~~~
Contains built-in styles.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.plugin import find_plugin_styles
from pygments.util import ClassNotFound
#: Maps sty... |
neumerance/cloudloon2 | refs/heads/master | .venv/lib/python2.7/site-packages/pygments/styles/__init__.py | 364 | # -*- coding: utf-8 -*-
"""
pygments.styles
~~~~~~~~~~~~~~~
Contains built-in styles.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.plugin import find_plugin_styles
from pygments.util import ClassNotFound
#: Maps sty... |
karllessard/tensorflow | refs/heads/master | tensorflow/python/kernel_tests/sparse_reorder_op_test.py | 27 | # 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... |
kc4271/batch_downloader | refs/heads/master | eventlet/queue.py | 1 | # Copyright (c) 2009 Denis Bilenko, denis.bilenko at gmail com
# Copyright (c) 2010 Eventlet Contributors (see AUTHORS)
# and licensed under the MIT license:
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
#... |
emile2016/mezzanine | refs/heads/master | mezzanine/blog/management/commands/import_tumblr.py | 45 | from __future__ import print_function
from __future__ import unicode_literals
from future.builtins import int
from datetime import datetime
from json import loads
from optparse import make_option
from time import sleep
try:
from urllib.request import urlopen
except ImportError:
from urllib import urlopen
fro... |
project-ncl/repour | refs/heads/master | repour/auth/auth.py | 1 | # flake8: noqa
import logging
import aiohttp.web
from . import oauth2_jwt
logger = logging.getLogger(__name__)
# Middleware handlers for auth
def fail(request):
return aiohttp.web.Response(status=403)
def is_websocket(request):
websocket_upgrade = request.headers.get("Upgrade", None)
sec_websocket... |
qizenguf/MLC-STT | refs/heads/master | util/minorview/model.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... |
75651/kbengine_cloud | refs/heads/master | kbe/res/scripts/common/Lib/csv.py | 90 |
"""
csv.py - read/write/investigate CSV files
"""
import re
from _csv import Error, __version__, writer, reader, register_dialect, \
unregister_dialect, get_dialect, list_dialects, \
field_size_limit, \
QUOTE_MINIMAL, QUOTE_ALL, QUOTE_NONNUMERIC, QUOTE_NONE, \
... |
fbossy/SickRage | refs/heads/master | lib/sqlalchemy/dialects/postgresql/json.py | 79 | # postgresql/json.py
# Copyright (C) 2005-2014 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
from __future__ import absolute_import
import json
from .base import ischema_names... |
kgjamieson/NEXT | refs/heads/master | next/apps/App.py | 2 | """
This file collects common code for every app. It is general across all apps and
makes a call to the specified app in the appropriate place.
Apps are specified with a YAML file with a specific structure. A given instance
of an app is verified before creation.
"""
# TODO: include docstrings (copy and paste from Poo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.