repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
ndingwall/scikit-learn | refs/heads/master | sklearn/gaussian_process/_gpr.py | 2 | """Gaussian processes regression."""
# Authors: Jan Hendrik Metzen <jhm@informatik.uni-bremen.de>
# Modified by: Pete Green <p.l.green@liverpool.ac.uk>
# License: BSD 3 clause
import warnings
from operator import itemgetter
import numpy as np
from scipy.linalg import cholesky, cho_solve, solve_triangular
import scip... |
wonjunetai/pulse | refs/heads/master | preprocess/filtermap.py | 1 | import time
def p_beg_end(p_start, pend, p_length):
phend = (pend + THRESHOLD / 3 > p_length)
phbeg = (p_start - THRESHOLD / 3 < 1)
return [phbeg, phend]
def m_beg_end(n_start, n_end, n_length, backwards):
if backwards:
temp = n_start
n_start = n_end
n_end = temp
mhend = ... |
kenshay/ImageScripter | refs/heads/master | ProgramData/SystemFiles/Python/Lib/encodings/email/__init__.py | 262 | # Copyright (C) 2001-2006 Python Software Foundation
# Author: Barry Warsaw
# Contact: email-sig@python.org
"""A package for parsing, handling, and generating email messages."""
__version__ = '4.0.3'
__all__ = [
# Old names
'base64MIME',
'Charset',
'Encoders',
'Errors',
'Generator',
'Head... |
JackDandy/SickGear | refs/heads/master | sickbeard/providers/ettv.py | 2 | # coding=utf-8
#
# This file is part of SickGear.
#
# SickGear 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.
#
# SickGear is distribu... |
TNick/pyl2extra | refs/heads/master | pyl2extra/scripts/datasets/tests/test_imagenet.py | 1 | """
Tests for adjusters.
"""
__authors__ = "Nicu Tofan"
__copyright__ = "Copyright 2015, Nicu Tofan"
__credits__ = ["Nicu Tofan"]
__license__ = "3-clause BSD"
__maintainer__ = "Nicu Tofan"
__email__ = "nicu.tofan@gmail.com"
import functools
import unittest
from mock import patch, Mock
import os
import shutil
import ... |
helenst/django | refs/heads/master | django/contrib/gis/forms/widgets.py | 39 | from __future__ import unicode_literals
import logging
from django.conf import settings
from django.contrib.gis import gdal
from django.contrib.gis.geos import GEOSGeometry, GEOSException
from django.forms.widgets import Widget
from django.template import loader
from django.utils import six
from django.utils import t... |
le9i0nx/ansible | refs/heads/devel | lib/ansible/modules/network/f5/bigip_monitor_http.py | 5 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2017 F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... |
shanglt/youtube-dl | refs/heads/master | youtube_dl/extractor/niconico.py | 34 | # encoding: utf-8
from __future__ import unicode_literals
import re
import json
import datetime
from .common import InfoExtractor
from ..compat import (
compat_urllib_parse,
compat_urllib_request,
compat_urlparse,
)
from ..utils import (
encode_dict,
ExtractorError,
int_or_none,
parse_dura... |
andnovar/networkx | refs/heads/master | networkx/readwrite/tests/test_graph6.py | 54 | #!/usr/bin/env python
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
from nose.tools import *
import networkx as nx
import networkx.readwrite.graph6 as g6
class TestGraph6Utils(object):
def test_n_data_n_conversion(self):
for i in [0, 1, 42, 62, 63, 64, 258047, 2580... |
huobaowangxi/scikit-learn | refs/heads/master | sklearn/neural_network/rbm.py | 206 | """Restricted Boltzmann Machine
"""
# Authors: Yann N. Dauphin <dauphiya@iro.umontreal.ca>
# Vlad Niculae
# Gabriel Synnaeve
# Lars Buitinck
# License: BSD 3 clause
import time
import numpy as np
import scipy.sparse as sp
from ..base import BaseEstimator
from ..base import TransformerMixi... |
MichaelQQ/Wireshark-PE | refs/heads/master | tools/wireshark_be.py | 30 | # -*- python -*-
#
# File : wireshark_be.py
#
# Author : Frank Singleton (frank.singleton@ericsson.com)
#
# Copyright (C) 2001 Frank Singleton, Ericsson Inc.
#
# This file is a backend to "omniidl", used to generate "Wireshark"
# dissectors from IDL descriptions. The output language generated
# is "... |
claymation/pystogram | refs/heads/master | setup.py | 1 | import sys
from setuptools import setup
from setuptools.command.test import test as TestCommand
class PyTest(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
self.test_suite = True
def run_tests(self):
#import here, cause outside ... |
glgerard/MDBN | refs/heads/master | src/archived/mdbn_v1.py | 1 | import numpy as np
import theano
from theano import tensor
from src.archived.rbm_v1 import GRBM
from src.archived.rbm_v1 import RBM
from src.utils import zscore
def importdata(file):
with open(file) as f:
ncols = len(f.readline().split('\t'))
return (ncols-1,
np.loadtxt(file,
... |
ramyfarid922/Quiz-Program | refs/heads/master | vendor/bundle/ruby/2.2.0/gems/libv8-3.16.14.7/vendor/gyp/test/win/gyptest-link-entrypointsymbol.py | 342 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Make sure entrypointsymbol setting is extracted properly.
"""
import TestGyp
import sys
if sys.platform == 'win32':
test = TestGyp.... |
leilihh/nova | refs/heads/stable/icehouse | nova/tests/api/openstack/compute/contrib/test_extended_volumes.py | 13 | # Copyright 2013 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... |
wdm0006/sklearn-extensions | refs/heads/master | examples/kernel_regression/example.py | 1 | """
Example from: https://raw.githubusercontent.com/jmetzen/kernel_regression/master/plot_kernel_regression.py
========================================================================
Comparison of kernel regression (KR) and support vector regression (SVR)
==============================================================... |
windofthesky/ansible | refs/heads/devel | test/units/template/__init__.py | 7690 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... |
bikong2/scikit-learn | refs/heads/master | examples/linear_model/plot_ransac.py | 250 | """
===========================================
Robust linear model estimation using RANSAC
===========================================
In this example we see how to robustly fit a linear model to faulty data using
the RANSAC algorithm.
"""
import numpy as np
from matplotlib import pyplot as plt
from sklearn import ... |
machinaut/gym | refs/heads/master | examples/agents/tabular_q_agent.py | 7 | class TabularQAgent(object):
"""
Agent implementing tabular Q-learning.
"""
def __init__(self, observation_space, action_space, **userconfig):
if not isinstance(observation_space, discrete.Discrete):
raise UnsupportedSpace('Observation space {} incompatible with {}. (Only supports D... |
herow/planning_qgis | refs/heads/master | python/plugins/processing/algs/qgis/ExtentFromLayer.py | 6 | # -*- coding: utf-8 -*-
"""
***************************************************************************
ExtentFromLayer.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
***********************... |
sbromley07/example-app | refs/heads/master | lib/flask/blueprints.py | 773 | # -*- coding: utf-8 -*-
"""
flask.blueprints
~~~~~~~~~~~~~~~~
Blueprints are the recommended way to implement larger or more
pluggable applications in Flask 0.7 and later.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from functools import update_wrap... |
spock1104/android_kernel_zte_msm8930 | refs/heads/stockmod | scripts/build-all.py | 1182 | #! /usr/bin/env python
# Copyright (c) 2009-2011, The Linux Foundation. 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
# ... |
infoxchange/lettuce | refs/heads/master | tests/integration/lib/Django-1.3/tests/regressiontests/inspectdb/tests.py | 52 | from StringIO import StringIO
from django.core.management import call_command
from django.test import TestCase, skipUnlessDBFeature
class InspectDBTestCase(TestCase):
@skipUnlessDBFeature('can_introspect_foreign_keys')
def test_attribute_name_not_python_keyword(self):
out = StringIO()
call_c... |
sfromm/snmpryte | refs/heads/master | lib/netspryte/commands/rrdtune.py | 2 | # Written by Stephen Fromm <stephenf nero net>
# Copyright (C) 2015-2017 University of Oregon
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your opt... |
dchaplinsky/pep.org.ua | refs/heads/master | pepdb/core/migrations/0149_auto_20180910_1922.py | 1 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.10 on 2018-09-10 16:22
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_depend... |
mgax/czl-scrape | refs/heads/master | sanatate/scrapy_proj/helpers/romanian.py | 5 | # -*- coding: utf-8 -*-
class RomanianHelper(object):
@staticmethod
def englishize_romanian(string):
symbols = (u"țţȚŢșşȘŞăǎĂîÎâÂ",
u"ttTTssSSaaAiIaA")
tr = {ord(a):ord(b) for a, b in zip(*symbols)}
return string.translate(tr)
@staticmethod
def beautify_rom... |
drukhil/frappe | refs/heads/master | frappe/patches/v6_16/feed_doc_owner.py | 32 | from __future__ import unicode_literals
import frappe
def execute():
frappe.reload_doctype("Communication")
for doctype, name in frappe.db.sql("""select distinct reference_doctype, reference_name
from `tabCommunication`
where
(reference_doctype is not null and reference_doctype != '')
and (reference_name ... |
saimn/astropy | refs/heads/main | astropy/io/tests/test_registry_help.py | 8 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from io import StringIO
from astropy.table import Table
from astropy.nddata import CCDData
def test_table_read_help_fits():
"""
Test dynamically created documentation help via the I/O registry for 'fits'.
"""
out = StringIO()
Table.... |
luiseduardohdbackup/odoo | refs/heads/8.0 | openerp/addons/test_documentation_examples/delegation.py | 366 | # -*- coding: utf-8 -*-
from openerp import models, fields
class Child0(models.Model):
_name = 'delegation.child0'
field_0 = fields.Integer()
class Child1(models.Model):
_name = 'delegation.child1'
field_1 = fields.Integer()
class Delegating(models.Model):
_name = 'delegation.parent'
_inh... |
alajara/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/pywebsocket/src/test/test_endtoend.py | 449 | #!/usr/bin/env python
#
# Copyright 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... |
gepd/uPiotMicroPythonTool | refs/heads/develop | commands/list_files.py | 1 | # This file is part of the uPiot project, https://github.com/gepd/upiot/
#
# MIT License
#
# Copyright (c) 2017 GEPD
#
# 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, inc... |
nealtodd/django | refs/heads/master | django/db/backends/postgresql/client.py | 346 | import os
import subprocess
from django.core.files.temp import NamedTemporaryFile
from django.db.backends.base.client import BaseDatabaseClient
from django.utils.six import print_
def _escape_pgpass(txt):
"""
Escape a fragment of a PostgreSQL .pgpass file.
"""
return txt.replace('\\', '\\\\').replace... |
aksaxena80/test | refs/heads/master | tensorflow/python/ops/image_ops.py | 5 | # pylint: disable=g-short-docstring-punctuation
"""## Encoding and Decoding
TensorFlow provides Ops to decode and encode JPEG and PNG formats. Encoded
images are represented by scalar string Tensors, decoded images by 3-D uint8
tensors of shape `[height, width, channels]`.
The encode and decode Ops apply to one imag... |
Carlosaarodrigues/orpsoc | refs/heads/master | orpsoc/utils.py | 1 | import subprocess
class Launcher:
def __init__(self, cmd, args=[], shell=False, cwd=None, stderr=None, errormsg=None):
self.cmd = cmd
self.args = args
self.shell = shell
self.cwd = cwd
self.stderr = stderr
self.errormsg = errormsg
def run(self... |
sigma-geosistemas/django-river | refs/heads/master | river/management/__init__.py | 98 | __author__ = 'cenk'
|
d0ugal/readthedocs.org | refs/heads/master | readthedocs/builds/migrations/0015_add_privacy.py | 5 | # -*- coding: 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):
# Adding field 'Version.privacy_level'
db.add_column('builds_version', 'privacy_level',
... |
enolfc/oauthenticator | refs/heads/master | oauthenticator/tests/test_globus.py | 1 | from pytest import fixture, mark, raises
from tornado import web, gen
from unittest.mock import Mock
from globus_sdk import ConfidentialAppAuthClient
from ..globus import GlobusOAuthenticator, GlobusLogoutHandler
from .mocks import setup_oauth_mock, no_code_test, mock_handler
def user_model(username):
"""Retur... |
frugalware/pacman-g2 | refs/heads/master | pactest/tests/remove021.py | 1 | self.description = "Remove a package, with a modified file marked for backup (--nosave)"
p1 = pmpkg("dummy")
p1.files = ["etc/dummy.conf*"]
p1.backup = ["etc/dummy.conf"]
self.addpkg2db("local", p1)
self.args = "-Rn dummy"
self.addrule("!PKG_EXIST=dummy")
self.addrule("!FILE_EXIST=etc/dummy.conf")
self.addrule("!FI... |
justnom/ansible-modules-core | refs/heads/devel | cloud/amazon/iam_cert.py | 102 | #!/usr/bin/python
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed... |
zhengbomo/python_practice | refs/heads/master | project/PaipaiDai/Database.py | 1 | #!/usr/bin/python
# -*- coding:utf-8 -*-
import sqlite3
import MySQLdb
import warnings
# 忽略警告
warnings.filterwarnings("ignore")
class ErrorType:
PageList = 1
User = 2
Detail = 3
class Database(object):
def __init__(self):
try:
self.conn = MySQLdb.connect(host="127.0.0.1", user="... |
kevinr/750book-web | refs/heads/master | _750bookweb/manage.py | 26 | #!/usr/bin/env python
import sys
from os.path import abspath, dirname, join
try:
import pinax
except ImportError:
sys.stderr.write("Error: Can't import Pinax. Make sure you are in a virtual environment that has\nPinax installed or create one with pinax-boot.py.\n")
sys.exit(1)
from django.conf import set... |
makinacorpus/odoo | refs/heads/8.0 | addons/l10n_ar/__openerp__.py | 260 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 Cubic ERP - Teradata SAC (<http://cubicerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the... |
yongtang/tensorflow | refs/heads/master | tensorflow/python/keras/optimizer_v2/nadam.py | 5 | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
jsoref/django | refs/heads/master | tests/validation/test_validators.py | 320 | from __future__ import unicode_literals
from . import ValidationTestCase
from .models import ModelToValidate
class TestModelsWithValidators(ValidationTestCase):
def test_custom_validator_passes_for_correct_value(self):
mtv = ModelToValidate(number=10, name='Some Name', f_with_custom_validator=42)
... |
klausman/scion | refs/heads/master | python/test/lib/topology_test.py | 1 | # Copyright 2015 ETH Zurich
# Copyright 2018 ETH Zurich, Anapaya Systems
#
# 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... |
tersmitten/ansible | refs/heads/devel | lib/ansible/modules/cloud/vultr/vultr_server.py | 10 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2017, René Moser <mail@renemoser.net>
# 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',
... |
jasonseminara/OpenSourceFinal | refs/heads/master | myvenv/lib/python3.5/site-packages/django/contrib/postgres/signals.py | 548 | from psycopg2 import ProgrammingError
from psycopg2.extras import register_hstore
from django.utils import six
def register_hstore_handler(connection, **kwargs):
if connection.vendor != 'postgresql':
return
try:
if six.PY2:
register_hstore(connection.connection, globally=True, un... |
catcosmo/froide | refs/heads/master | froide/foirequest/south_migrations/0032_auto__add_field_foirequest_resolution.py | 6 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
from froide.helper.auth_migration_util import USER_DB_NAME
APP_MODEL, APP_MODEL_NAME = 'account.User', 'account.user'
class Migration(SchemaMigration):
def forwards(self, orm):
... |
ipmobiletech/owncloud-ios | refs/heads/develop | automation_Test/loginTest.py | 14 | # -*- coding: utf-8 -*-
#!/usr/bin/env python
from appium import webdriver
import time
import os
import unittest
from time import sleep
import constants as const
import loginView
import filesView
import settingsView
import actions
class loginTest(unittest.TestCase):
def setUp(self):
# set up appium
... |
raccoongang/edx-platform | refs/heads/ginkgo-rg | common/djangoapps/student/urls.py | 14 | """
URLs for student app
"""
from django.conf import settings
from django.conf.urls import patterns, url
from student.views import LogoutView
urlpatterns = (
'student.views',
url(r'^logout$', LogoutView.as_view(), name='logout'),
# TODO: standardize login
# login endpoint used by cms.
url(r'^l... |
sklam/numba | refs/heads/master | numba/cuda/tests/cudapy/test_alignment.py | 1 | import numpy as np
from numba import from_dtype, cuda
from numba.cuda.testing import skip_on_cudasim, CUDATestCase
import unittest
class TestAlignment(CUDATestCase):
def test_record_alignment(self):
rec_dtype = np.dtype([('a', 'int32'), ('b', 'float64')], align=True)
rec = from_dtype(rec_dtype)
... |
myarjunar/QGIS | refs/heads/master | python/plugins/processing/algs/grass7/ext/i_pansharpen.py | 2 | # -*- coding: utf-8 -*-
"""
***************************************************************************
i_pansharpen.py
---------------
Date : March 2016
Copyright : (C) 2016 by Médéric Ribreux
Email : medspx at medspx dot fr
*******************************... |
lmesz/compose | refs/heads/master | tests/unit/config_test.py | 3 | from __future__ import print_function
import os
import shutil
import tempfile
from operator import itemgetter
from .. import mock
from .. import unittest
from compose.config import config
from compose.config.errors import ConfigurationError
def make_service_dict(name, service_dict, working_dir, filename=None):
... |
reyrodrigues/EU-SMS | refs/heads/master | temba/public/tests.py | 1 | from __future__ import unicode_literals
from django.test import TestCase
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from temba.orgs.models import Org
from smartmin.tests import SmartminTest, _CRUDLTest
from .models import *
from .views import VideoCRUDL
class PublicTest(S... |
sti-lyneos/shop | refs/heads/master | softwarecenter/region.py | 3 | # Copyright (C) 2012 Canonical
#
# Authors:
# Michael Vogt
#
# 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; version 3.
#
# This program is distributed in the hope that it will be useful, but W... |
habnabit/pip | refs/heads/develop | pip/utils/ui.py | 316 | from __future__ import absolute_import
from __future__ import division
import itertools
import sys
from signal import signal, SIGINT, default_int_handler
from pip.compat import WINDOWS
from pip.utils import format_size
from pip.utils.logging import get_indentation
from pip._vendor import six
from pip._vendor.progress... |
mshafiq9/django | refs/heads/master | tests/admin_inlines/test_templates.py | 285 | from __future__ import unicode_literals
from django.template.loader import render_to_string
from django.test import SimpleTestCase
class TestTemplates(SimpleTestCase):
def test_javascript_escaping(self):
context = {
'inline_admin_formset': {
'formset': {'prefix': 'my-prefix'},... |
vicky2135/lucious | refs/heads/master | lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/utf8prober.py | 2918 | ######################## 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... |
wangmiao1981/PredictionIO | refs/heads/develop | examples/experimental/scala-parallel-recommendation-entitymap/data/send_query.py | 48 | """
Send sample query to prediction engine
"""
import predictionio
engine_client = predictionio.EngineClient(url="http://localhost:8000")
print engine_client.send_query({"user": "uid1", "num": 4})
|
nju520/PyMySQL | refs/heads/master | pymysql/tests/__init__.py | 8 | from pymysql.tests.test_issues import *
from pymysql.tests.test_basic import *
from pymysql.tests.test_nextset import *
from pymysql.tests.test_DictCursor import *
from pymysql.tests.test_connection import *
from pymysql.tests.test_SSCursor import *
from pymysql.tests.test_load_local import *
from pymysql.tests.thirdp... |
robovm/robovm-studio | refs/heads/master | python/testData/completion/noParensForDecorator.after.py | 83 | def my_decorator(f):
return f
@my_decorator<caret> |
luoxufeiyan/python | refs/heads/master | ailurus1991/0011/main.py | 40 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'jinyang'
def readFile(filePath):
file = open(filePath, 'r')
words = []
for word in file.readlines():
# print word.strip('\n')
words.append(word.strip('\n'))
return words
def check(testWord):
realWords = readFile('filtere... |
bamos/parsec-benchmark | refs/heads/master | pkgs/libs/glib/src/gobject/gobject.py | 85 | import gdb
import glib
import gdb.backtrace
import gdb.command.backtrace
# This is not quite right, as local vars may override symname
def read_global_var (symname):
return gdb.selected_frame().read_var(symname)
def g_type_to_name (gtype):
def lookup_fundamental_type (typenode):
if typenode == 0:
... |
lexus42/40223242test | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/token.py | 743 | """Token constants (from "token.h")."""
__all__ = ['tok_name', 'ISTERMINAL', 'ISNONTERMINAL', 'ISEOF']
# This file is automatically generated; please don't muck it up!
#
# To update the symbols in this file, 'cd' to the top directory of
# the python source tree after building the interpreter and run:
#
# ./pyth... |
mconley99/themis_tritonsort | refs/heads/master | src/scripts/themis/cloud/check_cluster_status.py | 2 | #!/usr/bin/env python
import argparse, sys, redis, os
from instance_utils import get_cluster_status
SCRIPT_DIR = os.path.abspath(os.path.dirname(__file__))
sys.path.append(os.path.abspath(os.path.join(SCRIPT_DIR, os.pardir)))
import utils
def check_cluster_status(cluster_ID, redis_client):
provider = redis_cli... |
GeekTrainer/Flask | refs/heads/master | Work/Trivia - Module 5/env/Lib/site-packages/pip/_vendor/distlib/resources.py | 191 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Vinay Sajip.
# Licensed to the Python Software Foundation under a contributor agreement.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
from __future__ import unicode_literals
import bisect
import io
import logging
import os
import pkgutil
import shutil
import sys
import types... |
sebrandon1/neutron | refs/heads/master | neutron/tests/unit/extensions/test_servicetype.py | 2 | # Copyright 2012 OpenStack Foundation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... |
thevirtualfer/c172p-detailed | refs/heads/master | Models/Interior/Panel/Instruments/asi/asi.py | 15 | #!/usr/bin/env python
from svginstr import *
import sys
__author__ = "Melchior FRANZ < mfranz # aon : at >"
__url__ = "http://gitorious.org/svginstr/"
__version__ = "0.2"
__license__ = "GPL v2+"
__doc__ = """
"""
try:
a = Instrument("asi.svg", 512, 512, "test face; " + __version__)
a.disc(98, color = 'black')
a.... |
sdrogers/ms2ldaviz | refs/heads/master | ms2ldaviz/basicviz/migrations/0025_vizoptions_colour_topic_by_score.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('basicviz', '0024_extrausers'),
]
operations = [
migrations.AddField(
model_name='vizoptions',
name='... |
GoogleCloudPlatform/PerfKitBenchmarker | refs/heads/master | tests/providers/openstack/os_virtual_machine_test.py | 1 | """Tests for perfkitbenchmarker.providers.openstack.os_virtual_machine_test."""
import unittest
from absl import flags
import mock
from perfkitbenchmarker import benchmark_spec
from perfkitbenchmarker import configs
from perfkitbenchmarker import errors
from perfkitbenchmarker import linux_benchmarks
from perfkitbench... |
openstack/glance_store | refs/heads/master | doc/source/conf.py | 1 | # Copyright 2010-2011 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... |
DICL/cassandra | refs/heads/trunk | pylib/cqlshlib/test/test_cqlsh_parsing.py | 86 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
andela-ifageyinbo/django | refs/heads/master | django/utils/deprecation.py | 34 | from __future__ import absolute_import
import inspect
import warnings
class RemovedInDjango20Warning(PendingDeprecationWarning):
pass
RemovedInNextVersionWarning = DeprecationWarning
class warn_about_renamed_method(object):
def __init__(self, class_name, old_method_name, new_method_name, deprecation_warn... |
VHAINNOVATIONS/DmD | refs/heads/master | scrubber/MIST_2_0_4/src/CherryPy-3.1.2/cherrypy/process/servers.py | 13 | """Adapt an HTTP server."""
import time
class ServerAdapter(object):
"""Adapter for an HTTP server.
If you need to start more than one HTTP server (to serve on multiple
ports, or protocols, etc.), you can manually register each one and then
start them all with bus.start:
s1 = Server... |
totto82/opm-common | refs/heads/master | python/tests/test_emodel.py | 5 |
import unittest
import sys
import numpy as np
from opm.util import EModel
try:
from tests.utils import test_path
except ImportError:
from utils import test_path
class TestEModel(unittest.TestCase):
def test_open_model(self):
refArrList = ["PORV", "CELLVOL", "DEPTH", "DX", "DY", "DZ", "PORO", "... |
angelapper/edx-platform | refs/heads/master | lms/djangoapps/courseware/features/registration.py | 5 | # pylint: disable=missing-docstring
import time
from lettuce import step, world
from lettuce.django import django_url
@step('I register for the course "([^"]*)"$')
def i_register_for_the_course(_step, course):
url = django_url('courses/%s/about' % world.scenario_dict['COURSE'].id.to_deprecated_string())
wor... |
resmo/ansible | refs/heads/devel | lib/ansible/modules/network/fortimanager/fmgr_script.py | 39 | #!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distribut... |
skulldreamz/bullhead_kernel | refs/heads/master | tools/perf/python/twatch.py | 7370 | #! /usr/bin/python
# -*- python -*-
# -*- coding: utf-8 -*-
# twatch - Experimental use of the perf python interface
# Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com>
#
# This application is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License... |
norayr/unisubs | refs/heads/staging | apps/videos/migrations/0151_rename_pal_to_palc.py | 5 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
db.rename_column('videos_video', 'primary_audio_language',
'primary_audio_language_code')
... |
be-cloud-be/horizon-addons | refs/heads/9.0 | partner-contact/base_location/models/better_zip.py | 26 | # -*- coding: utf-8 -*-
#
#
# Author: Nicolas Bessi. Copyright Camptocamp SA
# Contributor: Pedro Manuel Baeza <pedro.baeza@serviciosbaeza.com>
# Ignacio Ibeas <ignacio@acysos.com>
# Alejandro Santana <alejandrosantana@anubia.es>
#
# This program is free software: you can redist... |
nzavagli/UnrealPy | refs/heads/master | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/django-1.8.2/tests/fixtures/models.py | 128 | """
Fixtures.
Fixtures are a way of loading data into the database in bulk. Fixure data
can be stored in any serializable format (including JSON and XML). Fixtures
are identified by name, and are stored in either a directory named 'fixtures'
in the application directory, or in one of the directories named in the
``FIX... |
vladmm/intellij-community | refs/heads/master | python/helpers/pydev/third_party/pep8/lib2to3/lib2to3/fixes/fix_getcwdu.py | 327 | """
Fixer that changes os.getcwdu() to os.getcwd().
"""
# Author: Victor Stinner
# Local imports
from .. import fixer_base
from ..fixer_util import Name
class FixGetcwdu(fixer_base.BaseFix):
BM_compatible = True
PATTERN = """
power< 'os' trailer< dot='.' name='getcwdu' > any* >
""... |
drayanaindra/inasafe | refs/heads/develop | safe_qgis/batch/__init__.py | 246 | __author__ = 'timlinux'
|
sycurfriend00/ghost | refs/heads/master | node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-2.7/pygments/lexers/web.py | 197 | # -*- coding: utf-8 -*-
"""
pygments.lexers.web
~~~~~~~~~~~~~~~~~~~
Lexers for web-related languages and markup.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
import copy
from pygments.lexer import RegexLexer, ExtendedReg... |
mrfuxi/django | refs/heads/master | tests/migrations/test_migrations_squashed_complex/1_auto.py | 1155 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
operations = [
migrations.RunPython(migrations.RunPython.noop)
]
|
garbled1/ansible | refs/heads/devel | lib/ansible/plugins/lookup/mongodb.py | 19 | # (c) 2016, Marcos Diez <marcos@unitron.com.br>
# https://github.com/marcosdiez/
#
# 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... |
jdramani/servo | refs/heads/master | components/script/dom/bindings/codegen/parser/tests/test_dictionary.py | 134 | def WebIDLTest(parser, harness):
parser.parse("""
dictionary Dict2 : Dict1 {
long child = 5;
Dict1 aaandAnother;
};
dictionary Dict1 {
long parent;
double otherParent;
};
""")
results = parser.finish()
dict1 = results[1];
dict2 = results[0];
... |
julot/sphinxcontrib-dd | refs/heads/master | tests/database-diagram/relationship.py | 1 | from sphinxcontrib.dd.database_diagram import Relationship
def test():
relations = {
'E1 |--| E2': (
'"E1" -> "E2" '
'[dir="both", arrowhead="nonetee", arrowtail="nonetee"]'
),
'E1 ||--|| E2': (
'"E1" -> "E2" '
'[dir="both", arrowhead="nonete... |
ktan2020/legacy-automation | refs/heads/master | win/Lib/site-packages/nose-1.2.1-py2.7.egg/nose/plugins/base.py | 8 | import os
import textwrap
from optparse import OptionConflictError
from warnings import warn
from nose.util import tolist
class Plugin(object):
"""Base class for nose plugins. It's recommended but not *necessary* to
subclass this class to create a plugin, but all plugins *must* implement
`options(self, par... |
rocopartners/django-oscar | refs/heads/master | src/oscar/apps/dashboard/reviews/views.py | 23 | import datetime
from django.views import generic
from django.conf import settings
from django.db.models import Q
from django.utils.translation import ugettext_lazy as _
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from oscar.views.generic import BulkEditMixin
from oscar.ap... |
kawamon/hue | refs/heads/master | desktop/core/ext-py/Django-1.11.29/tests/staticfiles_tests/test_management.py | 5 | from __future__ import unicode_literals
import codecs
import datetime
import os
import shutil
import tempfile
import unittest
from admin_scripts.tests import AdminScriptTestCase
from django.conf import settings
from django.contrib.staticfiles import storage
from django.contrib.staticfiles.management.commands import ... |
sznekol/django-cms | refs/heads/develop | cms/test_utils/project/placeholderapp/migrations/0004_auto_20150503_1749.py | 50 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('placeholderapp', '0003_example1_publish'),
]
operations = [
migrations.AlterModelOptions(
name='multilingualexam... |
ErcOne/kernel-3-4-projek-n7000 | refs/heads/android-exynos-3.4 | Documentation/target/tcm_mod_builder.py | 4981 | #!/usr/bin/python
# The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD
#
# Copyright (c) 2010 Rising Tide Systems
# Copyright (c) 2010 Linux-iSCSI.org
#
# Author: nab@kernel.org
#
import os, sys
import subprocess as sub
import string
import re
import optparse
tcm_dir = ""
fabric_ops... |
midnightradio/gensim | refs/heads/develop | gensim/test/test_nmf.py | 2 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2018 Timofey Yefimov <anotherbugmaster@gmail.com>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
Automated tests for checking transformation algorithms (the models package).
"""
import unittest
import copy
import logging
... |
widowild/messcripts | refs/heads/master | exercice/python2/solutions/exercice_7_15.py | 1 | #! /usr/bin/env python
# -*- coding: Latin-1 -*-
def volBoite(x1 =-1, x2 =-1, x3 =-1):
"Volume d'une boîte parallélipipédique"
if x1 == -1 :
return x1 # aucun argument n'a été fourni
elif x2 == -1 :
return x1**3 # un seul argument -> boîte cubique
elif x3 == -1 :
... |
mabelcalim/tide-app | refs/heads/master | kivy/test8/.buildozer/venv/lib/python2.7/site-packages/setuptools/tests/test_packageindex.py | 377 | """Package Index Tests
"""
import sys
import os
import unittest
import pkg_resources
from setuptools.compat import urllib2, httplib, HTTPError, unicode, pathname2url
import distutils.errors
import setuptools.package_index
from setuptools.tests.server import IndexServer
class TestPackageIndex(unittest.TestCase):
d... |
renegelinas/mi-instrument | refs/heads/master | mi/instrument/wetlabs/fluorometer/flort_d/test/sample_data.py | 11 | from mi.instrument.wetlabs.fluorometer.flort_d.driver import NEWLINE
SAMPLE_MNU_RESPONSE = "Ser BBFL2W-993" + NEWLINE + \
"Ver Triplet5.20" + NEWLINE + \
"Ave 1" + NEWLINE + \
"Pkt 0" + NEWLINE + \
"M1d 0" + NEWLINE + \
... |
stack-of-tasks/rbdlpy | refs/heads/master | tutorial/lib/python2.7/site-packages/OpenGLContext/passes/_flat.py | 1 | """Flat rendering passes (base implementation)
"""
from OpenGLContext.scenegraph import nodepath,switch,boundingvolume
from OpenGL.GL import *
from OpenGLContext.arrays import array, dot, allclose
from OpenGLContext import frustum
from OpenGLContext.debug.logs import getTraceback
from vrml.vrml97 import nodetypes
from ... |
b-me/django | refs/heads/master | tests/template_backends/test_dummy.py | 306 | # coding: utf-8
from __future__ import unicode_literals
from django.forms import CharField, Form, Media
from django.http import HttpRequest
from django.middleware.csrf import CsrfViewMiddleware, get_token
from django.template import TemplateDoesNotExist, TemplateSyntaxError
from django.template.backends.dummy import ... |
vanpact/scipy | refs/heads/master | scipy/odr/setup.py | 128 | #!/usr/bin/env python
from __future__ import division, print_function, absolute_import
from os.path import join
def configuration(parent_package='', top_path=None):
import warnings
from numpy.distutils.misc_util import Configuration
from numpy.distutils.system_info import get_info, BlasNotFoundError
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.