repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
n-west/gnuradio
refs/heads/maint
gnuradio-runtime/lib/math/gen_sine_table.py
79
#!/usr/bin/env python # # Copyright 2004 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 option) # ...
fidencio/sssd
refs/heads/master
src/tests/intg/ent_test.py
2
# # ent.py module tests # # Copyright (c) 2015 Red Hat, Inc. # Author: Nikolai Kondrashov <Nikolai.Kondrashov@redhat.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 version 3 of th...
snakeleon/YouCompleteMe-x64
refs/heads/master
python/ycm/client/command_request.py
2
# Copyright (C) 2013 Google Inc. # # This file is part of YouCompleteMe. # # YouCompleteMe 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 vers...
Eficent/odoomrp-wip
refs/heads/8.0
procurement_orderpoint_no_confirm/__openerp__.py
27
# -*- encoding: utf-8 -*- ############################################################################## # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either version 3 of the...
jisqyv/p2pool
refs/heads/master
nattraverso/utils.py
288
""" Various utility functions used in the nattraverso package. @author: Raphael Slinckx @copyright: Copyright 2005 @license: LGPL @contact: U{raphael@slinckx.net<mailto:raphael@slinckx.net>} @version: 0.1.0 """ __revision__ = "$id" def is_rfc1918_ip(ip): """ Checks if the given ip address is a rfc1918 one. ...
OfficialMan/Sark
refs/heads/master
plugins/function_flow.py
4
import networkx as nx import idaapi from sark import get_codeblock, get_flowchart, get_block_start, get_nx_graph try: from sark.ui import ActionHandler use_new_ui = True except: use_new_ui = False COLOR_REACHABLE = 0x66EE11 COLOR_UNREACHABLE = 0x6611EE COLOR_REACHING = 0x11EE66 COLOR_NOT_REACHING = 0x1...
abhishekgahlot/kivy
refs/heads/master
kivy/tools/pep8checker/pep8kivy.py
17
import sys from os import walk from os.path import isdir, join, abspath, dirname import pep8 import time htmlmode = False pep8_ignores = ( 'E125', # continuation line does not # distinguish itself from next logical line 'E126', # continuation line over-indented for hanging indent 'E127', #...
mollyproject/mollyproject
refs/heads/master
molly/external_media/models.py
1
from __future__ import division import os.path import random import urllib from datetime import datetime try: from cStringIO import StringIO except ImportError: from StringIO import StringIO from PIL import Image from django.db import models from django.conf import settings from django.core.urlresolvers impo...
Mitali-Sodhi/CodeLingo
refs/heads/master
Dataset/python/test_sentinel.py
40
from __future__ import with_statement import pytest from redis import exceptions from redis.sentinel import (Sentinel, SentinelConnectionPool, MasterNotFoundError, SlaveNotFoundError) from redis._compat import next import redis.sentinel class SentinelTestClient(object): def __init__(s...
yuanzhao/gpdb
refs/heads/master
gpMgmt/bin/gppylib/db/dbconn.py
14
#!/usr/bin/env python # # Copyright (c) Greenplum Inc 2008. All Rights Reserved. # """ TODO: module docs """ import sys import os import stat try: from pygresql import pgdb from gppylib.commands.unix import UserId except ImportError, e: sys.exit('Error: unable to import module: ' + str(e)) from gppylib i...
seocam/django
refs/heads/master
tests/migrations/test_migrations_first/thefirst.py
2995
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): operations = [ migrations.CreateModel( "Author", [ ("id", models.AutoField(primary_key=True)), ("name",...
oliverlee/sympy
refs/heads/master
sympy/unify/tests/test_rewrite.py
59
from sympy.unify.rewrite import rewriterule from sympy import sin, Basic, Symbol, S from sympy.abc import x, y from sympy.strategies.rl import rebuild from sympy.assumptions import Q p, q = Symbol('p'), Symbol('q') def test_simple(): rl = rewriterule(Basic(p, 1), Basic(p, 2), variables=(p,)) assert list(rl(Ba...
tangrams/yaml-cpp
refs/heads/master
test/gtest-1.8.0/googlemock/test/gmock_output_test.py
986
#!/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...
zhjunlang/kbengine
refs/heads/master
kbe/res/scripts/common/Lib/glob.py
86
"""Filename globbing utility.""" import os import re import fnmatch __all__ = ["glob", "iglob"] def glob(pathname): """Return a list of paths matching a pathname pattern. The pattern may contain simple shell-style wildcards a la fnmatch. However, unlike fnmatch, filenames starting with a dot are spe...
NickelMedia/phantomjs
refs/heads/master
src/qt/qtwebkit/Tools/QueueStatusServer/__init__.py
6014
# Required for Python to search this directory for module files
yrobla/pyjuegos
refs/heads/master
pgzero/rect.py
1
# -*- coding: utf-8 -*- """ZRect This is a Python implementation of the pygame Rect class. Its raison d'être is to allow the coordinates to be floating point. All pygame functions which require a rect allow for an object with a "rect" attribute and whose coordinates will be converted to integers implictly. ...
opavader/fabric
refs/heads/master
sites/www/conf.py
31
# Obtain shared config values import sys import os from os.path import abspath, join, dirname sys.path.append(abspath(join(dirname(__file__), '..'))) from shared_conf import * # Releases changelog extension extensions.append('releases') releases_github_path = "fabric/fabric" # Intersphinx for referencing API/usage ...
sai16vicky/deepdive
refs/heads/master
examples/tutorial_example/step2-generic-features/udf/ext_people.py
161
#! /usr/bin/env python # Sample input data (piped into STDIN): ''' 118238@10 Sen.~^~Barack~^~Obama~^~and~^~his~^~wife~^~,~^~Michelle~^~Obama~^~,~^~have~^~released~^~eight~^~years~^~of~^~joint~^~returns~^~. O~^~PERSON~^~PERSON~^~O~^~O~^~O~^~O~^~PERSON~^~PERSON~^~O~^~O~^~O~^~DURATION~^~DURATION~^~O~^~O~^~O~^~O 118238@12...
NaPs/Kolekto
refs/heads/master
kolekto/commands/list.py
1
from kolekto.commands import Command from kolekto.printer import printer from kolekto.exceptions import KolektoRuntimeError from kolekto.pattern import parse_pattern from kolekto.datasources import MovieDatasource class ListingFormatWrapper(object): """ A wrapper used to customize how movies attributes are forma...
inova-tecnologias/jenova
refs/heads/master
src/jenova/resources/base.py
1
import jwt, base64, json from collections import namedtuple from werkzeug.exceptions import InternalServerError from flask_restful import reqparse, request, Resource, abort from functools import wraps from time import sleep from jenova.models import UserSchema, Scope from jenova.components import Security, InvalidCred...
hrvoojex/pipni2
refs/heads/master
pipni2.py
1
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Calculate telecomunication costs author: Hrvoje T last edited: February 2017 """ from mainwindow import * import sys import datetime #import string #import re # File for saving the result. Default 'output_pipni2.csv' if not explicitly named OUTPUT_FILE = "output_p...
Belxjander/Kirito
refs/heads/master
Python-3.5.0-main/Doc/includes/sqlite3/text_factory.py
51
import sqlite3 con = sqlite3.connect(":memory:") cur = con.cursor() AUSTRIA = "\xd6sterreich" # by default, rows are returned as Unicode cur.execute("select ?", (AUSTRIA,)) row = cur.fetchone() assert row[0] == AUSTRIA # but we can make sqlite3 always return bytestrings ... con.text_factory = bytes cur.execute("sel...
klahnakoski/esShardBalancer
refs/heads/master
jx_python/namespace/normal.py
2
# encoding: utf-8 # # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. # # Author: Kyle Lahnakoski (kyle@lahnakoski.com) # from __future__ import absolute_import from __f...
rtrigoso/ghost-somepolymath
refs/heads/master
node_modules/pygmentize-bundled/vendor/pygments/build-3.3/pygments/formatters/html.py
94
# -*- coding: utf-8 -*- """ pygments.formatters.html ~~~~~~~~~~~~~~~~~~~~~~~~ Formatter for HTML output. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import os import sys import os.path import io from pygments.formatter import For...
adlius/osf.io
refs/heads/develop
admin_tests/osf_groups/test_views.py
10
from admin.osf_groups.views import ( OSFGroupsView, OSFGroupsListView, OSFGroupsFormView ) from admin_tests.utilities import setup_log_view from nose import tools as nt from django.test import RequestFactory from tests.base import AdminTestCase from osf_tests.factories import UserFactory, ProjectFactory, O...
jobscore/sync-engine
refs/heads/master
inbox/util/concurrency.py
3
import sys import functools import random import gevent from backports import ssl from gevent import socket from redis import TimeoutError import _mysql_exceptions from sqlalchemy.exc import StatementError from inbox.models import Account from inbox.models.session import session_scope from nylas.logging import get_l...
emartonline/newfies-dialer
refs/heads/master
newfies/voice_app/migrations/0001_initialschema_voice_app.py
7
# -*- 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 model 'VoiceApp' db.create_table(u'voice_app', ( ('id', self.gf('django.db.models.field...
antoviaque/edx-platform
refs/heads/master
lms/djangoapps/shoppingcart/processors/__init__.py
215
""" Public API for payment processor implementations. The specific implementation is determined at runtime using Django settings: CC_PROCESSOR_NAME: The name of the Python module (in `shoppingcart.processors`) to use. CC_PROCESSOR: Dictionary of configuration options for specific processor implementations, ...
monospaced/paperback
refs/heads/master
melk/bs4/tests/test_htmlparser.py
433
"""Tests to ensure that the html.parser tree builder generates good trees.""" from bs4.testing import SoupTest, HTMLTreeBuilderSmokeTest from bs4.builder import HTMLParserTreeBuilder class HTMLParserTreeBuilderSmokeTest(SoupTest, HTMLTreeBuilderSmokeTest): @property def default_builder(self): return ...
rajsadho/django
refs/heads/master
django/contrib/messages/storage/__init__.py
827
from django.conf import settings from django.utils.module_loading import import_string def default_storage(request): """ Callable with the same interface as the storage classes. This isn't just default_storage = import_string(settings.MESSAGE_STORAGE) to avoid accessing the settings at the module lev...
glandium/git-cinnabar
refs/heads/master
cinnabar/cmd/__init__.py
1
from __future__ import absolute_import from .data import data # noqa: F401 from .fsck import fsck # noqa: F401 from .upgrade import upgrade # noqa: F401 from .reclone import reclone # noqa: F401 from .fetch import fetch # noqa: F401 from .convert import ( # noqa: F401 hg2git, git2hg, ) from .bundle import...
lubao/uju
refs/heads/master
Apps/GenForm/views.py
1
# Create your views here. from django.core.context_processors import csrf from django.http import HttpResponse from django import template from django.shortcuts import render_to_response from django.template.loader import render_to_string def show_op_form(request): if request.method == 'GET' : my_csrf = {}...
naglis/plugin.audio.ausis
refs/heads/master
resources/lib/__init__.py
14224
# -*- coding: utf-8 -*-
RO-ny9/python-for-android
refs/heads/master
python-modules/twisted/twisted/python/monkey.py
61
# -*- test-case-name: twisted.test.test_monkey -*- # Copyright (c) 2007 Twisted Matrix Laboratories. # See LICENSE for details. class MonkeyPatcher(object): """ Cover up attributes with new objects. Neat for monkey-patching things for unit-testing purposes. """ def __init__(self, *patches): ...
triveous/LearnFlask
refs/heads/master
flask/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/contrib/pyopenssl.py
304
'''SSL with SNI_-support for Python 2. Follow these instructions if you would like to verify SSL certificates in Python 2. Note, the default libraries do *not* do certificate checking; you need to do additional work to validate certificates yourself. This needs the following packages installed: * pyOpenSSL (tested wi...
marty331/jakesclock
refs/heads/master
flask/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/packages/ssl_match_hostname/__init__.py
2057
try: # Python 3.2+ from ssl import CertificateError, match_hostname except ImportError: try: # Backport of the function from a pypi module from backports.ssl_match_hostname import CertificateError, match_hostname except ImportError: # Our vendored copy from ._implementati...
threerings/farbot
refs/heads/master
farb/test/test_utils.py
1
# test_utils.py vi:ts=4:sw=4:expandtab: # # Copyright (c) 2006-2008 Three Rings Design, 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: # 1. Redistributions of source code must retain the a...
nacl-webkit/chrome_deps
refs/heads/master
ppapi/c/documentation/doxy_cleanup.py
177
#!/usr/bin/python # Copyright (c) 2011 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. '''This utility cleans up the html files as emitted by doxygen so that they are suitable for publication on a Google documentation sit...
gandrewstone/BitcoinUnlimited
refs/heads/master
contrib/testgen/base58.py
2139
''' Bitcoin base58 encoding and decoding. Based on https://bitcointalk.org/index.php?topic=1026.0 (public domain) ''' import hashlib # for compatibility with following code... class SHA256: new = hashlib.sha256 if str != bytes: # Python 3.x def ord(c): return c def chr(n): return byte...
alexmorozov/django
refs/heads/master
tests/template_tests/filter_tests/test_linebreaksbr.py
331
from django.template.defaultfilters import linebreaksbr from django.test import SimpleTestCase from django.utils.safestring import mark_safe from ..utils import setup class LinebreaksbrTests(SimpleTestCase): """ The contents in "linebreaksbr" are escaped according to the current autoescape setting. "...
Gabrielcarvfer/NS3
refs/heads/master
src/point-to-point/bindings/modulegen_customizations.py
376
def post_register_types(root_module): root_module.add_include('"ns3/queue.h"') root_module.add_include('"ns3/error-model.h"')
danieljaouen/ansible
refs/heads/devel
test/sanity/code-smell/replace-urlopen.py
61
#!/usr/bin/env python import os import re import sys def main(): skip = set([ 'test/sanity/code-smell/%s' % os.path.basename(__file__), 'lib/ansible/module_utils/six/__init__.py', 'lib/ansible/module_utils/urls.py', 'test/units/module_utils/urls/test_Request.py', 'test/uni...
wiltonlazary/arangodb
refs/heads/devel
3rdParty/boost/1.61.0/tools/build/test/preprocessor.py
58
#!/usr/bin/python # Copyright 2003 Vladimir Prus # Copyright 2011 Steven Watanabe # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) # Test the C/C++ preprocessor. import BoostBuild t = BoostBuild.Tester() t.write("jamroot....
stephentyrone/swift
refs/heads/master
utils/lldb/lldbToolBox.py
4
""" LLDB Helpers for working with the swift compiler. Load into LLDB with 'command script import /path/to/lldbToolBox.py' This will also import LLVM data formatters as well, assuming that llvm is next to the swift checkout. """ import argparse import os import shlex import subprocess import sys import tempfile impo...
mehmetkose/django-favorites
refs/heads/master
favorites/admin.py
1
from django.contrib import admin from models import * admin.site.register(Favorite)
hainm/scikit-learn
refs/heads/master
sklearn/decomposition/tests/test_fastica.py
272
""" Test the fastica algorithm. """ import itertools import warnings import numpy as np from scipy import stats from nose.tools import assert_raises from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_true from skl...
p0psicles/SickRage
refs/heads/master
sickrage/providers/__init__.py
18
# coding=utf-8 __all__ = []
bgris/ODL_bgris
refs/heads/master
lib/python3.5/site-packages/prompt_toolkit/filters/utils.py
23
from __future__ import unicode_literals from .base import Always, Never from .types import SimpleFilter, CLIFilter __all__ = ( 'to_cli_filter', 'to_simple_filter', ) _always = Always() _never = Never() def to_simple_filter(bool_or_filter): """ Accept both booleans and CLIFilters as input and tur...
RydrDojo/Ridr
refs/heads/master
pylotVenv/lib/python2.7/site-packages/sqlalchemy_utils/primitives/country.py
5
import six from .. import i18n from ..utils import str_coercible @str_coercible class Country(object): """ Country class wraps a 2 to 3 letter country code. It provides various convenience properties and methods. :: from babel import Locale from sqlalchemy_utils import Country, i18n...
gieseke/bufferkdtree
refs/heads/master
bufferkdtree/neighbors/util.py
1
# # Copyright (C) 2013-2016 Fabian Gieseke <fabian.gieseke@di.ku.dk> # License: GPL v2 # import math import time def compute_optimal_tree_depth(model, Xtrain, Xtest, target="test", tree_depths=None, verbose=1): """ Computes the optimal tree depth. Returns ------- opt_height : int The opti...
ayesandarmoe/microblog_flask_tutorial
refs/heads/master
flask/lib/python2.7/encodings/mac_roman.py
593
""" Python Character Mapping Codec mac_roman generated from 'MAPPINGS/VENDORS/APPLE/ROMAN.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,input,err...
StephenWeber/ansible
refs/heads/devel
test/units/modules/cloud/amazon/test_ec2_vpc_nat_gateway.py
41
import pytest import unittest boto3 = pytest.importorskip("boto3") botocore = pytest.importorskip("botocore") from collections import namedtuple from ansible.parsing.dataloader import DataLoader from ansible.vars import VariableManager from ansible.inventory import Inventory from ansible.playbook.play import Play fro...
auto-mat/klub
refs/heads/diakonie
local_migrations/migrations_helpdesk/0011_admin_related_improvements.py
4
# -*- coding: utf-8 -*- from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('helpdesk', '0010_remove_queuemembership'), ] operations = [ migrations.AlterField( model_name='queue', name='permission_name', fi...
pducks32/intergrala
refs/heads/master
python/sympy/sympy/functions/special/tests/test_error_functions.py
13
from sympy import ( symbols, expand, expand_func, nan, oo, Float, conjugate, diff, re, im, Abs, O, factorial, exp_polar, polar_lift, gruntz, limit, Symbol, I, integrate, S, sqrt, sin, cos, sinh, cosh, exp, log, pi, EulerGamma, erf, erfc, erfi, erf2, erfinv, erfcinv, erf2inv, gamma, uppergamma, l...
jjas0nn/solvem
refs/heads/master
tensorflow/lib/python2.7/site-packages/pip/_vendor/html5lib/treeadapters/genshi.py
356
from __future__ import absolute_import, division, unicode_literals from genshi.core import QName, Attrs from genshi.core import START, END, TEXT, COMMENT, DOCTYPE def to_genshi(walker): text = [] for token in walker: type = token["type"] if type in ("Characters", "SpaceCharacters"): ...
jpn--/pines
refs/heads/master
pines/streamers.py
1
class double_stream: def __init__(self, filename, mode='w'): self.file = open(filename, mode) def write(self, *args): self.file.write(*args) print(*args, end="") def flush(self): self.file.flush() def close(self): self.file.close() def __enter__(self): pass def __exit__(self, exc_type, exc_val, exc_...
google/uncertainty-baselines
refs/heads/main
uncertainty_baselines/models/movielens_test.py
1
# coding=utf-8 # Copyright 2021 The Uncertainty Baselines Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ap...
Debian/openjfx
refs/heads/master
modules/web/src/main/native/Tools/Scripts/webkitpy/layout_tests/models/test_run_results.py
2
# Copyright (C) 2010 Google Inc. All rights reserved. # Copyright (C) 2010 Gabor Rapcsanyi (rgabor@inf.u-szeged.hu), University of Szeged # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of so...
geminy/aidear
refs/heads/master
oss/qt/qt-everywhere-opensource-src-5.9.0/qtwebengine/src/3rdparty/chromium/tools/chrome_proxy/integration_tests/chrome_proxy_pagesets/safebrowsing.py
6
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import logging from common.chrome_proxy_shared_page_state import ChromeProxySharedPageState from telemetry.core import exceptions from telemetry.page import ...
harshita-gupta/Harvard-FRSEM-Catalog-2016-17
refs/heads/master
flask/lib/python2.7/site-packages/sqlalchemy/dialects/mysql/zxjdbc.py
55
# mysql/zxjdbc.py # Copyright (C) 2005-2016 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 """ .. dialect:: mysql+zxjdbc :name: zxjdbc for Jython :dbapi: zxjdbc :...
meabsence/python-for-android
refs/heads/master
python-build/python-libs/gdata/src/gdata/base/service.py
166
#!/usr/bin/python # # Copyright (C) 2006 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
hajicj/MUSCIMarker
refs/heads/develop
MUSCIMarker/merge_cropobject_lists.py
1
#!/usr/bin/env python """This is a simple script that merges a number of CropObject list files into one.""" from __future__ import print_function, unicode_literals import argparse import codecs import logging import time from muscima.cropobject import merge_cropobject_lists from muscima.io import parse_cropobject_lis...
wdzhou/mantid
refs/heads/master
scripts/AbinsModules/CalculatePowder.py
1
from __future__ import (absolute_import, division, print_function) import numpy as np import AbinsModules try: # noinspection PyUnresolvedReferences from pathos.multiprocessing import ProcessPool PATHOS_FOUND = True except ImportError: PATHOS_FOUND = False # noinspection PyMethodMayBeStatic class Calc...
azureplus/hue
refs/heads/master
desktop/core/ext-py/pytz-2015.2/pytz/lazy.py
514
from threading import RLock try: from UserDict import DictMixin except ImportError: from collections import Mapping as DictMixin # With lazy loading, we might end up with multiple threads triggering # it at the same time. We need a lock. _fill_lock = RLock() class LazyDict(DictMixin): """Dictionary popu...
jandom/rdkit
refs/heads/master
rdkit/Chem/BuildFragmentCatalog.py
1
# $Id$ # # Copyright (C) 2003-2008 Greg Landrum and Rational Discovery LLC # # @@ All Rights Reserved @@ # This file is part of the RDKit. # The contents are covered by the terms of the BSD license # which is included in the file license.txt, found at the root # of the RDKit source tree. # """ command line util...
DomainGroupOSS/luigi
refs/heads/master
luigi/mrrunner.py
65
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify AB # # 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...
axbaretto/beam
refs/heads/master
sdks/python/.tox/lint/lib/python2.7/site-packages/pip/_vendor/colorama/ansi.py
640
# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. ''' This module generates ANSI character codes to printing colors to terminals. See: http://en.wikipedia.org/wiki/ANSI_escape_code ''' CSI = '\033[' OSC = '\033]' BEL = '\007' def code_to_chars(code): return CSI + str(code) + 'm' def set...
HiLiph/wicd
refs/heads/master
wicd/networking.py
2
#!/usr/bin/env python # -*- coding: utf-8 -*- """ networking - Provides wrappers for common network operations This module provides wrappers of the common network tasks as well as threads to perform the actual connecting to networks. class Controller() -- Parent class to Wireless and Wired class ConnectThread() -- P...
nistormihai/superdesk-core
refs/heads/master
tests/io/io_tests.py
2
# -*- coding: utf-8; -*- # # This file is part of Superdesk. # # Copyright 2013, 2014 Sourcefabric z.u. and contributors. # # For the full copyright and license information, please see the # AUTHORS and LICENSE files distributed with this source code, or # at https://www.sourcefabric.org/superdesk/license import os im...
TheTypoMaster/evennia
refs/heads/master
evennia/contrib/gendersub.py
5
""" Gendersub Griatch 2015 This is a simple gender-aware Character class for allowing users to insert custom markers in their text to indicate gender-aware messaging. It relies on a modified msg() and is meant as an inspiration and starting point to how to do stuff like this. When in use, all messages being sent to ...
elena/django
refs/heads/master
tests/template_tests/syntax_tests/test_width_ratio.py
77
from django.template import TemplateSyntaxError from django.test import SimpleTestCase from ..utils import setup class WidthRatioTagTests(SimpleTestCase): libraries = {'custom': 'template_tests.templatetags.custom'} @setup({'widthratio01': '{% widthratio a b 0 %}'}) def test_widthratio01(self): ...
bdh1011/cupeye
refs/heads/master
venv/lib/python2.7/site-packages/pip/_vendor/requests/api.py
160
# -*- coding: utf-8 -*- """ requests.api ~~~~~~~~~~~~ This module implements the Requests API. :copyright: (c) 2012 by Kenneth Reitz. :license: Apache2, see LICENSE for more details. """ from . import sessions def request(method, url, **kwargs): """Constructs and sends a :class:`Request <Request>`. :par...
llambeau/finitio.py
refs/heads/master
finitio/types/type.py
1
from ..exceptions import DressError, UndressError from ..support.monad import Monad class Type(object): __slots__ = ['metadata'] def __init__(self, metadata): self.metadata = metadata @staticmethod def factor(_from): return _from[list(_from.keys())[0]] def to_factor(self): ...
mhdella/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...
rodrigods/keystone
refs/heads/master
keystone/routers.py
8
# Copyright 2012 OpenStack Foundation # # 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...
fh1ch/XMLTestExecutor
refs/heads/master
XMLTestExecutor.py
1
""" The MIT License (MIT) Copyright (c) 2014 fh1ch 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, publis...
Stane1983/xbmc
refs/heads/master
tools/EventClients/lib/python/ps3/__init__.py
909
# -*- coding: utf-8 -*- # File intentionally left blank
spisneha25/django
refs/heads/master
tests/logging_tests/logconfig.py
609
import logging from django.conf import settings from django.core.mail.backends.base import BaseEmailBackend class MyHandler(logging.Handler): def __init__(self): logging.Handler.__init__(self) self.config = settings.LOGGING class MyEmailBackend(BaseEmailBackend): def send_messages(self, ema...
katrid/django
refs/heads/master
tests/admin_widgets/tests.py
65
# -*- coding: utf-8 -*- from __future__ import unicode_literals import gettext import os from datetime import datetime, timedelta from importlib import import_module from unittest import skipIf from django import forms from django.conf import settings from django.contrib import admin from django.contrib.admin import ...
jigarkb/Programming
refs/heads/master
LeetCode/480-H-SlidingWindowMedian.py
2
# Median is the middle value in an ordered integer list. If the size of the list is even, there is no middle value. So # the median is the mean of the two middle value. # # Examples: # [2,3,4] , the median is 3 # # [2,3], the median is (2 + 3) / 2 = 2.5 # # Given an array nums, there is a sliding window of size k which...
gaapt/opencog
refs/heads/master
tests/cython/agents/test_agent_w_load_exception.py
35
raise TypeError
nmercier/linux-cross-gcc
refs/heads/master
linux/lib/python2.7/dist-packages/Crypto/SelfTest/Cipher/test_pkcs1_oaep.py
3
# -*- coding: utf-8 -*- # # SelfTest/Cipher/test_pkcs1_oaep.py: Self-test for PKCS#1 OAEP encryption # # =================================================================== # The contents of this file are dedicated to the public domain. To # the extent that dedication to the public domain is not available, # everyone...
koyuawsmbrtn/eclock
refs/heads/master
windows/Python27/Lib/site-packages/docutils/readers/pep.py
136
# $Id: pep.py 7320 2012-01-19 22:33:02Z milde $ # Author: David Goodger <goodger@python.org> # Copyright: This module has been placed in the public domain. """ Python Enhancement Proposal (PEP) Reader. """ __docformat__ = 'reStructuredText' from docutils.readers import standalone from docutils.transforms import pep...
tensorflow/tensor2tensor
refs/heads/master
tensor2tensor/models/neural_assistant.py
1
# coding=utf-8 # Copyright 2021 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
savanu/servo
refs/heads/master
tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/executors/executorservo.py
4
import base64 import hashlib import httplib import json import os import subprocess import tempfile import threading import traceback import urlparse import uuid from collections import defaultdict from mozprocess import ProcessHandler from .base import (ExecutorException, Protocol, ...
someorz/spark
refs/heads/master
examples/src/main/python/ml/train_validation_split.py
71
# # 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 us...
doozr/euler.py
refs/heads/master
p0021_amicable_numbers_test.py
1
""" Let d(n) be defined as the sum of proper divisors of n (numbers less than n which divide evenly into n). If d(a) = b and d(b) = a, where a != b, then a and b are an amicable pair and each of a and b are called amicable numbers. For example, the proper divisors of 220 are 1, 2, 4, 5, 10, 11, 20, 22, 44, 55 and 110;...
okfn/brand-manager
refs/heads/master
manager/apps/brand/migrations/0023_auto__add_field_brandproposalreview_valid.py
2
# -*- coding: utf-8 -*- from south.utils import datetime_utils as 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 'BrandProposalReview.valid' db.add_column(u'brand_proposal...
mtils/ems
refs/heads/master
ems/qt/layout/toolbararea.py
1
from ems.qt import QtCore, QtGui, QtWidgets Qt = QtCore.Qt QWidget = QtWidgets.QWidget QHBoxLayout = QtWidgets.QHBoxLayout QVBoxLayout = QtWidgets.QVBoxLayout QSpacerItem = QtWidgets.QSpacerItem QSizePolicy = QtWidgets.QSizePolicy QIcon = QtGui.QIcon QApplication = QtWidgets.QApplication QToolBar = QtWidgets.QToolBar...
jnewland/home-assistant
refs/heads/ci
homeassistant/components/nest/const.py
16
"""Constants used by the Nest component.""" DOMAIN = 'nest'
erikr/weerapi
refs/heads/master
weerapi/tests/test_knmidata.py
1
import os import unittest from weerapi.knmidata import KNMIData class KNMIDataTest(unittest.TestCase): def setUp(self): self.knmidata = KNMIData() def test_actueel(self): my_path = os.path.dirname(os.path.abspath(__file__)) input_data = open(my_path + '/actueel.html').read() ...
xshotD/pyglet
refs/heads/master
tests/graphics/IMMEDIATE.py
15
#!/usr/bin/env python """Tests immediate drawing. """ import unittest import pyglet from graphics_common import GraphicsGenericTestCase, get_feedback, GL_TRIANGLES __noninteractive = True class GraphicsImmediateTestCase(GraphicsGenericTestCase, unittest.TestCase): def get_feedback(self, data): return g...
srossross/stable.world
refs/heads/develop
stable_world/commands/ci.py
1
""" This is a command """ from __future__ import print_function import click from stable_world.interact.setup_bucket import setup_bucket from stable_world import utils, application @click.group() def main(): pass @main.command() @click.argument('key') @click.argument('value') @application.pass_app def set(app,...
doug-fish/horizon
refs/heads/master
openstack_dashboard/dashboards/project/images/snapshots/urls.py
54
# Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the...
macarthur-lab/xbrowse
refs/heads/master
xbrowse/analysis_modules/diagnostic_search.py
1
from xbrowse.core.variant_filters import VariantFilter class DiagnosticSearchSpec(): """ """ def __init__(self): self.analysis_module = 'diagnostic_search' self.project_id = None self.family_id = None self.gene_ids = None self.variant_filter = None def toJSON(s...
pquentin/django
refs/heads/stable/1.8.x
tests/template_tests/test_nodelist.py
22
from unittest import TestCase from django.template import Context, Template from django.template.base import VariableNode from django.test import override_settings class NodelistTest(TestCase): def test_for(self): template = Template('{% for i in 1 %}{{ a }}{% endfor %}') vars = template.nodelis...
v-i-s-h/Enocean-Py
refs/heads/master
EnoceanPy/eopy.py
1
# eopy.py -- Demo application for Enocean Py API # # Copyright 2014 Vishnu Raj <rajvishnu90@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 version 2 of the License, or ...
e-democracy/edem.profile.email.settings
refs/heads/master
edem/__init__.py
916
# See http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages try: __import__('pkg_resources').declare_namespace(__name__) except ImportError: from pkgutil import extend_path __path__ = extend_path(__path__, __name__)
trabacus-softapps/openerp-8.0-cc
refs/heads/master
openerp/addons/website/tests/__init__.py
3
# -*- coding: utf-8 -*- import test_views, test_converter, test_requests, test_ui checks = [ test_views, test_converter, ]
dragon788/wordfreq
refs/heads/master
wordfreq/chinese.py
1
from pkg_resources import resource_filename import jieba import msgpack import gzip DICT_FILENAME = resource_filename('wordfreq', 'data/jieba_zh.txt') SIMP_MAP_FILENAME = resource_filename('wordfreq', 'data/_chinese_mapping.msgpack.gz') SIMPLIFIED_MAP = msgpack.load(gzip.open(SIMP_MAP_FILENAME), encoding='utf-8') jieb...