repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
ctk3b/InterMol | intermol/forces/nonlinear_bond_type.py | 1 | 1553 | import simtk.unit as units
from intermol.decorators import accepts_compatible_units
from intermol.forces.abstract_bond_type import AbstractBondType
class NonlinearBondType(AbstractBondType):
__slots__ = ['epsilon', 'r0', 'lamda', 'order', 'c']
@accepts_compatible_units(None, None,
... | mit |
pravsripad/mne-python | mne/time_frequency/_stft.py | 8 | 6793 | from math import ceil
import numpy as np
from ..fixes import _import_fft
from ..utils import logger, verbose
@verbose
def stft(x, wsize, tstep=None, verbose=None):
"""STFT Short-Term Fourier Transform using a sine window.
The transformation is designed to be a tight frame that can be
perfectly inverted.... | bsd-3-clause |
ricardogsilva/QGIS | python/plugins/processing/core/ProcessingLog.py | 7 | 3689 | # -*- coding: utf-8 -*-
"""
***************************************************************************
ProcessingLog.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
*************************... | gpl-2.0 |
immo/pyTOM | df/df_volume_control.py | 1 | 1322 | # coding: utf-8
#
# drums-backend a simple interactive audio sampler that plays vorbis samples
# Copyright (C) 2009 C.D. Immanuel Albrecht
#
# 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 Fou... | gpl-3.0 |
bonnetb/sqoop | src/scripts/relnotes.py | 11 | 7442 | #!/usr/bin/env/python
#
# Copyright 2011 The Apache Software Foundation
#
# 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 ... | apache-2.0 |
ZeitOnline/zeit.content.article | src/zeit/content/article/browser/form.py | 1 | 4236 | from zeit.cms.checkout.interfaces import ILocalContent
from zeit.content.article.i18n import MessageFactory as _
import gocept.form.grouped
import uuid
import zeit.cms.browser.form
import zeit.cms.content.browser.form
import zeit.cms.interfaces
import zeit.cms.settings.interfaces
import zeit.content.article.interfaces
... | bsd-3-clause |
TaliesinSkye/evennia | wintersoasis-master/objects/examples/player.py | 1 | 3539 | """
Template module for Players
Copy this module up one level and name it as you like, then
use it as a template to create your own Player class.
To make the default account login default to using a Player
of your new type, change settings.BASE_PLAYER_TYPECLASS to point to
your new class, e.g.
settings.BASE_PLAYER_... | bsd-3-clause |
gibiansky/tensorflow | tensorflow/python/layers/layers.py | 19 | 2378 | # 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... | apache-2.0 |
JavML/django | tests/messages_tests/test_fallback.py | 330 | 6950 | from django.contrib.messages import constants
from django.contrib.messages.storage.fallback import (
CookieStorage, FallbackStorage,
)
from django.test import SimpleTestCase
from .base import BaseTests
from .test_cookie import set_cookie_data, stored_cookie_messages_count
from .test_session import set_session_data... | bsd-3-clause |
nizox/circuits | examples/node/increment/server.py | 3 | 1603 | #!/usr/bin/env python
from optparse import OptionParser
from circuits.node import Node
from circuits import Component, Debugger, handler
__version__ = "0.0.1"
USAGE = "%prog [options]"
VERSION = "%prog v" + __version__
def parse_options():
parser = OptionParser(usage=USAGE, version=VERSION)
parser.add_o... | mit |
songjun54cm/ml_idiot | nn/theano_nn/models/BasicModel.py | 1 | 3684 | __author__ = 'SongJun-Dell'
import logging
import numpy as np
import theano
import theano.tensor as T
from collections import OrderedDict
class BasicModel(object):
def __init__(self, state):
self.state = state
self.floatX = theano.config.floatX
self.layers = list()
self.params = lis... | gpl-3.0 |
40223239/cdb0622 | static/Brython3.1.1-20150328-091302/Lib/os.py | 635 | 35582 | r"""OS routines for Mac, NT, or Posix depending on what system we're on.
This exports:
- all functions from posix, nt, os2, or ce, e.g. unlink, stat, etc.
- os.path is either posixpath or ntpath
- os.name is either 'posix', 'nt', 'os2' or 'ce'.
- os.curdir is a string representing the current directory ('.' or... | gpl-3.0 |
ryan-williams/eggo | DELETE_ME/spark_ec2.py | 3 | 3273 | # Licensed to Big Data Genomics (BDG) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The BDG licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file ... | apache-2.0 |
aleaxit/pysolper | latrop/lib/dist/jinja2/_markupsafe/_constants.py | 1535 | 4795 | # -*- coding: utf-8 -*-
"""
markupsafe._constants
~~~~~~~~~~~~~~~~~~~~~
Highlevel implementation of the Markup string.
:copyright: (c) 2010 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
HTML_ENTITIES = {
'AElig': 198,
'Aacute': 193,
'Acirc': 194,
'Agrave': 1... | apache-2.0 |
evro/CouchPotatoServer | libs/xmpp/auth.py | 196 | 15633 | ## auth.py
##
## Copyright (C) 2003-2005 Alexey "Snake" Nezhdanov
##
## 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, or (at your option)
## any later version.
##... | gpl-3.0 |
lief-project/LIEF | tests/vdex/vdex_test.py | 1 | 3828 | #!/usr/bin/env python
import json
import logging
import os
import pprint
import unittest
from unittest import TestCase
import lief
from utils import get_sample
CURRENT_DIR = os.path.abspath(os.path.dirname(__file__))
lief.logging.set_level(lief.logging.LOGGING_LEVEL.DEBUG)
class TestVDEX(TestCase):
def setUp(s... | apache-2.0 |
ecosoft-odoo/odoo | addons/stock/wizard/__init__.py | 323 | 1149 | # -*- 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... | agpl-3.0 |
patriciolobos/desa8 | openerp/addons/product_margin/__openerp__.py | 261 | 1851 | # -*- 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... | agpl-3.0 |
eblossom/gnuradio | gr-digital/python/digital/qa_ofdm_insert_preamble.py | 57 | 5665 | #!/usr/bin/env python
#
# Copyright 2007,2010-2013 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 you... | gpl-3.0 |
tmeits/pybrain | examples/rl/valuebased/td.py | 30 | 1972 | #!/usr/bin/env python
__author__ = 'Thomas Rueckstiess, ruecksti@in.tum.de'
""" This example demonstrates how to use the discrete Temporal Difference
Reinforcement Learning algorithms (SARSA, Q, Q(lambda)) in a classical
fully observable MDP maze task. The goal point is the top right free
field. """
from scipy import... | bsd-3-clause |
MwanzanFelipe/rockletonfortune | lib/django/contrib/gis/gdal/envelope.py | 477 | 7009 | """
The GDAL/OGR library uses an Envelope structure to hold the bounding
box information for a geometry. The envelope (bounding box) contains
two pairs of coordinates, one for the lower left coordinate and one
for the upper right coordinate:
+----------o Upper right; (max_x, max_y)
... | bsd-3-clause |
rschenck/Capsid_IDP_Classifier | development/tuning_and_validating.py | 1 | 9852 | #!/usr/bin/env python
import sys
import operator
import pandas as pd
import numpy as np
from sklearn import cross_validation
from sklearn.ensemble import ExtraTreesClassifier
from sklearn.cross_validation import train_test_split
from sklearn.preprocessing import label_binarize
from sklearn.metrics import roc_curve, au... | gpl-2.0 |
aaronorosen/nox | src/nox/netapps/tests/pyunittests/ipv4_parse_test.py | 10 | 3032 | # Copyright 2008 (C) Nicira, Inc.
#
# This file is part of NOX.
#
# NOX 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.
#
# NOX is d... | gpl-3.0 |
40223119/2015w13-1 | static/Brython3.1.0-20150301-090019/Lib/site-packages/pygame/surface.py | 603 | 3844 | from browser import document, html, window
from javascript import console, JSConstructor
from .rect import Rect
#import pygame.rect
canvas_ID=1
_canvas_id=None
class Surface:
def __init__(self, dim=[], depth=16, surf=None):
if surf is None:
self._depth=depth
self._canvas=html.CANVAS(width=... | gpl-3.0 |
ryangallen/django | tests/template_tests/syntax_tests/test_filter_syntax.py | 221 | 8844 | # coding: utf-8
from __future__ import unicode_literals
from django.template import TemplateSyntaxError
from django.test import SimpleTestCase
from ..utils import SomeClass, SomeOtherException, UTF8Class, setup
class FilterSyntaxTests(SimpleTestCase):
@setup({'filter-syntax01': '{{ var|upper }}'})
def test... | bsd-3-clause |
oberstet/autobahn-python | examples/twisted/wamp/rpc/timeservice/backend.py | 3 | 2196 | ###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Crossbar.io Technologies GmbH
#
# 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 ... | mit |
mollstam/UnrealPy | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Twisted-15.2.1/twisted/test/proto_helpers.py | 31 | 20230 | # -*- test-case-name: twisted.test.test_stringtransport -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Assorted functionality which is commonly useful when writing unit tests.
"""
from __future__ import division, absolute_import
from socket import AF_INET, AF_INET6
from io import Byt... | mit |
mzdaniel/oh-mainline | vendor/packages/distribute/setuptools/command/test.py | 68 | 5110 | from setuptools import Command
from distutils.errors import DistutilsOptionError
import sys
from pkg_resources import *
from unittest import TestLoader, main
class ScanningLoader(TestLoader):
def loadTestsFromModule(self, module):
"""Return a suite of all tests cases contained in the given module
... | agpl-3.0 |
MattsFleaMarket/python-for-android | python3-alpha/python3-src/Lib/test/test_macpath.py | 62 | 4985 | import macpath
from test import support, test_genericpath
import unittest
class MacPathTestCase(unittest.TestCase):
def test_abspath(self):
self.assertEqual(macpath.abspath("xx:yy"), "xx:yy")
def test_isabs(self):
isabs = macpath.isabs
self.assertTrue(isabs("xx:yy"))
self.ass... | apache-2.0 |
zchking/odoo | addons/base_action_rule/tests/base_action_rule_test.py | 395 | 7455 | from openerp import SUPERUSER_ID
from openerp.tests import common
from .. import test_models
class base_action_rule_test(common.TransactionCase):
def setUp(self):
"""*****setUp*****"""
super(base_action_rule_test, self).setUp()
cr, uid = self.cr, self.uid
self.demo = self.registry(... | agpl-3.0 |
anakinsolo/backend | Lib/encodings/cp1006.py | 593 | 13824 | """ Python Character Mapping Codec cp1006 generated from 'MAPPINGS/VENDORS/MISC/CP1006.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,errors... | mit |
jkandasa/integration_tests | cfme/js.py | 17 | 6870 | # -*- coding: utf-8 -*-
from jsmin import jsmin
xpath = """\
function xpath(root, xpath) {
if(root == null)
root = document;
var nt = XPathResult.ANY_UNORDERED_NODE_TYPE;
return document.evaluate(xpath, root, null, nt, null).singleNodeValue;
}
"""
in_flight = jsmin("""
function isHidden(el) {if(el... | gpl-2.0 |
crosswalk-project/crosswalk-test-suite | webapi/tct-csp-w3c-tests/csp-py/csp_img-src_self_allowed-manual.py | 30 | 2481 | def main(request, response):
import simplejson as json
f = file('config.json')
source = f.read()
s = json.JSONDecoder().decode(source)
url1 = "http://" + s['host'] + ":" + str(s['ports']['http'][1])
url2 = "http://" + s['host'] + ":" + str(s['ports']['http'][0])
response.headers.set("Content... | bsd-3-clause |
Edraak/edraak-platform | lms/djangoapps/instructor_task/migrations/0002_gradereportsetting.py | 25 | 1167 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('instruct... | agpl-3.0 |
ostcar/OpenSlides | server/openslides/users/migrations/0001_initial.py | 9 | 3981 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-03-06 14:33
from __future__ import unicode_literals
from django.db import migrations, models
import openslides.utils.models
class Migration(migrations.Migration):
initial = True
dependencies = [
("auth", "0006_require_contenttypes_0002"),... | mit |
mdecourse/2017springvcp | plugin/summary/test_summary.py | 339 | 2634 | # -*- coding: utf-8 -*-
import unittest
from jinja2.utils import generate_lorem_ipsum
# generate one paragraph, enclosed with <p>
TEST_CONTENT = str(generate_lorem_ipsum(n=1))
TEST_SUMMARY = generate_lorem_ipsum(n=1, html=False)
from pelican.contents import Page
import summary
class TestSummary(unittest.TestCase... | agpl-3.0 |
jelmer/samba | python/samba/tests/dcerpc/bare.py | 24 | 1722 | # -*- coding: utf-8 -*-
#
# Unix SMB/CIFS implementation.
# Copyright © Jelmer Vernooij <jelmer@samba.org> 2008
#
# 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,... | gpl-3.0 |
zzzombat/lucid-python-django | tests/modeltests/force_insert_update/tests.py | 92 | 1336 | from django.db import transaction, IntegrityError, DatabaseError
from django.test import TestCase
from models import Counter, WithCustomPK
class ForceTests(TestCase):
def test_force_update(self):
c = Counter.objects.create(name="one", value=1)
# The normal case
c.value = 2
c.save... | bsd-3-clause |
pyjs/pyjs | pyjs/lib_trans/pyparser/driver.py | 7 | 3768 | # Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
# Modifications:
# Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Parser driver.
This provides a high-level interface to parse a file into a synta... | apache-2.0 |
ychen820/microblog | y/google-cloud-sdk/.install/.backup/lib/googlecloudsdk/dns/dnstools/changes/get.py | 4 | 1992 | # Copyright 2013 Google Inc. All Rights Reserved.
"""'dns changes get' command."""
from apiclient import errors
from googlecloudsdk.calliope import base
from googlecloudsdk.calliope import exceptions
from googlecloudsdk.core import properties
from googlecloudsdk.dns.lib import util
class Get(base.Command):
"""Ge... | bsd-3-clause |
davidlt/openloops | scons-local/scons-local-2.3.0/SCons/Options/BoolOption.py | 11 | 2015 | #
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 The SCons Foundation
#
# 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, incl... | gpl-3.0 |
HackerTool/httpie | tests/test_unicode.py | 49 | 3276 | # coding=utf-8
"""
Various unicode handling related tests.
"""
from utils import http, HTTP_OK
from fixtures import UNICODE
class TestUnicode:
def test_unicode_headers(self, httpbin):
# httpbin doesn't interpret utf8 headers
r = http(httpbin.url + '/headers', u'Test:%s' % UNICODE)
assert... | bsd-3-clause |
imsparsh/python-for-android | python3-alpha/python3-src/Lib/test/test_module.py | 51 | 2720 | # Test the module type
import unittest
from test.support import run_unittest, gc_collect
import sys
ModuleType = type(sys)
class ModuleTests(unittest.TestCase):
def test_uninitialized(self):
# An uninitialized module has no __dict__ or __name__,
# and __doc__ is None
foo = ModuleType.__new... | apache-2.0 |
cwaldbieser/txcas | txcas/couchdb_ticket_store.py | 1 | 29177 |
# Standard library
from __future__ import print_function
import datetime
from functools import partial
import json
import random
import string
import sys
from textwrap import dedent
import uuid
from xml.sax.saxutils import escape as xml_escape
# Application modules
from txcas.ca_trust import createCustomPolicyFactoryF... | gpl-3.0 |
InsightSoftwareConsortium/ITKExamples | src/Core/Common/StreamAPipeline/Code.py | 1 | 1786 | #!/usr/bin/env python
# Copyright NumFOCUS
#
# 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.txt
#
# Unless required by applicable law or ... | apache-2.0 |
saltastro/timDIMM | analyze_cube.py | 1 | 2145 | #!/usr/bin/env python
import sys
import numpy as np
from find_boxes import rfits, daofind
pixel_scale = 1.22
dx = pixel_scale / 206265.0
rd = 0.13
d = 0.06
lamb = 0.65e-6
def moments(data):
"""Returns (height, x, y, width_x, width_y)
the gaussian parameters of a 2D distribution by calculating its
moment... | bsd-3-clause |
Chuban/moose | python/chigger/filters/TransformFilter.py | 5 | 1979 | #pylint: disable=missing-docstring
#################################################################
# DO NOT MODIFY THIS HEADER #
# MOOSE - Multiphysics Object Oriented Simulation Environment #
# #
# (c) 2010... | lgpl-2.1 |
nrz/ylikuutio | external/bullet3/examples/pybullet/examples/sleeping.py | 2 | 1235 | import pybullet as p
import time
useMaximalCoordinates = False
flags = p.URDF_ENABLE_SLEEPING
import pybullet_data
p.connect(p.GUI)
p.setAdditionalSearchPath(pybullet_data.getDataPath())
p.configureDebugVisualizer(p.COV_ENABLE_RENDERING, 0)
p.loadURDF("plane100.urdf", flags=flags, useMaximalCoordinates=useMaximalCo... | agpl-3.0 |
protomouse/Flexget | flexget/plugins/modify/torrent.py | 11 | 4597 | from __future__ import unicode_literals, division, absolute_import
import logging
import os
from flexget import plugin
from flexget.event import event
from flexget.utils.bittorrent import Torrent, is_torrent_file
log = logging.getLogger('modif_torrent')
class TorrentFilename(object):
"""
Makes sure that... | mit |
jazkarta/edx-platform-for-isc | cms/djangoapps/contentstore/management/commands/delete_course.py | 56 | 1302 | ###
### Script for cloning a course
###
from django.core.management.base import BaseCommand, CommandError
from .prompt import query_yes_no
from contentstore.utils import delete_course_and_groups
from opaque_keys.edx.keys import CourseKey
from opaque_keys import InvalidKeyError
from opaque_keys.edx.locations import Slas... | agpl-3.0 |
mboman/vxcage-jobs | job-filemagic.py | 1 | 2312 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import logging
import time
import tempfile
from pymongo import MongoClient
import gridfs
try:
import magic
except ImportError:
pass
from utils import get_file, clean_data, get_type, Config
JOBNAME = 'FILEMAGIC'
SLEEPTIME = 1
# create logger
logger = logging.getLo... | bsd-3-clause |
sbalde/edx-platform | lms/djangoapps/django_comment_client/forum/views.py | 17 | 21854 | """
Views handling read (GET) requests for the Discussion tab and inline discussions.
"""
from functools import wraps
import json
import logging
import xml.sax.saxutils as saxutils
from django.contrib.auth.decorators import login_required
from django.conf import settings
from django.core.context_processors import csr... | agpl-3.0 |
yunfeilu/scikit-learn | sklearn/utils/sparsefuncs.py | 220 | 11424 | # Authors: Manoj Kumar
# Thomas Unterthiner
# License: BSD 3 clause
import scipy.sparse as sp
import numpy as np
from .fixes import sparse_min_max, bincount
from .sparsefuncs_fast import csr_mean_variance_axis0 as _csr_mean_var_axis0
from .sparsefuncs_fast import csc_mean_variance_axis0 as _csc_mean_var_axis... | bsd-3-clause |
CouchPotato/CouchPotatoServer | libs/git/ref_container.py | 122 | 2242 | # Copyright (c) 2009, Rotem Yaari <vmalloc@gmail.com>
# 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 li... | gpl-3.0 |
aisipos/django | django/template/loaders/base.py | 199 | 3759 | import warnings
from django.template import Origin, Template, TemplateDoesNotExist
from django.utils.deprecation import RemovedInDjango20Warning
from django.utils.inspect import func_supports_parameter
class Loader(object):
def __init__(self, engine):
self.engine = engine
def __call__(self, templat... | bsd-3-clause |
OpenUpgrade/OpenUpgrade | addons/mail/controllers/main.py | 383 | 1733 | import base64
import psycopg2
import openerp
from openerp import SUPERUSER_ID
from openerp import http
from openerp.http import request
from openerp.addons.web.controllers.main import content_disposition
import mimetypes
class MailController(http.Controller):
_cp_path = '/mail'
@http.route('/mail/download_a... | agpl-3.0 |
blueyed/coveragepy | coverage/parser.py | 1 | 45600 | # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt
"""Code parsing for coverage.py."""
import ast
import collections
import os
import re
import token
import tokenize
from coverage import env
from coverage.backward... | apache-2.0 |
PokemonGoF/PokemonGo-Bot-Desktop | build/pywin/Lib/idlelib/idle_test/test_idlehistory.py | 37 | 5467 | import unittest
from test.test_support import requires
import Tkinter as tk
from Tkinter import Text as tkText
from idlelib.idle_test.mock_tk import Text as mkText
from idlelib.IdleHistory import History
from idlelib.configHandler import idleConf
line1 = 'a = 7'
line2 = 'b = a'
class StoreTest(unittest.TestCase):
... | mit |
MatChung/color-emoji.skia | tools/copyright/fileparser.py | 232 | 2883 | '''
Copyright 2011 Google Inc.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
'''
import datetime
import re
def CreateParser(filepath):
"""Returns a Parser as appropriate for the file at this filepath.
"""
if (filepath.endswith('.cpp') or
filepat... | bsd-3-clause |
endlessm/chromium-browser | third_party/chromite/api/gen/test_platform/steps/execute/build_pb2.py | 1 | 2541 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: test_platform/steps/execute/build.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf i... | bsd-3-clause |
pelikanchik/edx-platform | common/lib/xmodule/xmodule/stringify.py | 275 | 1065 | # -*- coding: utf-8 -*-
from lxml import etree
def stringify_children(node):
'''
Return all contents of an xml tree, without the outside tags.
e.g. if node is parse of
"<html a="b" foo="bar">Hi <div>there <span>Bruce</span><b>!</b></div><html>"
should return
"Hi <div>there <span>Bruce... | agpl-3.0 |
n0m4dz/odoo | addons/hr_gamification/models/gamification.py | 388 | 4836 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013 OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the ... | agpl-3.0 |
mistercrunch/airflow | airflow/providers/amazon/aws/sensors/glue_catalog_partition.py | 5 | 3760 | #
# 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... | apache-2.0 |
jiangzhuo/kbengine | kbe/src/lib/python/Lib/lib2to3/fixes/fix_map.py | 170 | 3058 | # Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Fixer that changes map(F, ...) into list(map(F, ...)) unless there
exists a 'from future_builtins import map' statement in the top-level
namespace.
As a special case, map(None, X) is changed into list(X). (This is
... | lgpl-3.0 |
timwee/emacs-starter-kit-mr-flip-forked | vendor/rope/rope/base/oi/doa.py | 59 | 5037 | import cPickle as pickle
import marshal
import os
import socket
import subprocess
import sys
import tempfile
import threading
class PythonFileRunner(object):
"""A class for running python project files"""
def __init__(self, pycore, file_, args=None, stdin=None,
stdout=None, analyze_data=None... | gpl-3.0 |
hryamzik/ansible | test/units/plugins/lookup/test_conjur_variable.py | 46 | 4726 | # -*- coding: utf-8 -*-
# (c) 2018, Jason Vanderhoof <jason.vanderhoof@cyberark.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... | gpl-3.0 |
tmpgit/intellij-community | python/helpers/pydev/_pydev_imports_tipper.py | 52 | 12642 | import os.path
import inspect
import sys
from _pydev_tipper_common import DoFind
try:
xrange
except:
xrange = range
#completion types.
TYPE_IMPORT = '0'
TYPE_CLASS = '1'
TYPE_FUNCTION = '2'
TYPE_ATTR = '3'
TYPE_BUILTIN = '4'
TYPE_PARAM = '5'
def _imp(name, log=None):
try:
return __import__(name)... | apache-2.0 |
siemens/rpyc | rpyc/lib/__init__.py | 14 | 1094 | """
A library of various helpers functions and classes
"""
import sys
import logging
class MissingModule(object):
__slots__ = ["__name"]
def __init__(self, name):
self.__name = name
def __getattr__(self, name):
if name.startswith("__"): # issue 71
raise AttributeError("module %... | mit |
ashhher3/pyDatasets | pydatasets/wafer.py | 2 | 2120 | import os
import re
from pandas import DataFrame
class WaferRun:
def __init__(self, run_id, wafer_id, label, measurements):
self.run_id = int(run_id)
self.wafer_id = int(wafer_id)
self.label = int(label)
self.measurements = DataFrame(measurements)
self.measurements.sort(a... | apache-2.0 |
BeiLuoShiMen/nupic | tests/integration/nupic/opf/opf_checkpoint_test/experiments/temporal_anomaly/base.py | 31 | 14970 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2012-2015, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This p... | agpl-3.0 |
SlateScience/MozillaJS | js/src/testing/mozbase/mozdevice/mozdevice/devicemanagerSUT.py | 3 | 36267 | # 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/.
import mozlog
import select
import socket
import time
import os
import re
import posixpath
import subprocess
import Stri... | mpl-2.0 |
gilgil1973/googletest | test/gtest_color_test.py | 3259 | 4911 | #!/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... | bsd-3-clause |
mozilla/captain | vendor/lib/python/django/contrib/gis/gdal/tests/test_envelope.py | 114 | 3741 | from django.contrib.gis.gdal import Envelope, OGRException
from django.utils import unittest
class TestPoint(object):
def __init__(self, x, y):
self.x = x
self.y = y
class EnvelopeTest(unittest.TestCase):
def setUp(self):
self.e = Envelope(0, 0, 5, 5)
def test01_init(self):
... | mpl-2.0 |
m1ssou/zulip | tools/run-dev.py | 113 | 3499 | #!/usr/bin/env python
import optparse
import subprocess
import signal
import traceback
import sys
import os
from twisted.internet import reactor
from twisted.web import proxy, server, resource
# Monkey-patch twisted.web.http to avoid request.finish exceptions
# https://trac.zulip.net/ticket/1728
from twisted.web... | apache-2.0 |
atplanet/ansible-modules-core | network/junos/junos_command.py | 15 | 7937 | #!/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... | gpl-3.0 |
fayf/pyload | module/plugins/hooks/ExpertDecoders.py | 14 | 3007 | # -*- coding: utf-8 -*-
from __future__ import with_statement
import pycurl
import uuid
from base64 import b64encode
from module.network.HTTPRequest import BadHeader
from module.network.RequestFactory import getRequest as get_request
from module.plugins.internal.Hook import Hook, threaded
class ExpertDecoders(Hoo... | gpl-3.0 |
Bulochkin/tensorflow_pack | tensorflow/python/platform/control_imports.py | 154 | 1105 | # 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... | apache-2.0 |
sushramesh/lwc | lib/python2.7/site-packages/django/conf/locale/zh_CN/formats.py | 634 | 1810 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'Y年n月j日' # 2016年9月5... | mit |
rvraghav93/scikit-learn | examples/neighbors/plot_nearest_centroid.py | 38 | 1817 | """
===============================
Nearest Centroid Classification
===============================
Sample usage of Nearest Centroid classification.
It will plot the decision boundaries for each class.
"""
print(__doc__)
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.colors import ListedColormap
f... | bsd-3-clause |
sajeeshcs/nested_projects_keystone | keystone/common/sql/migrate_repo/versions/053_endpoint_to_region_association.py | 8 | 5362 | # Copyright (c) 2013 Hewlett-Packard Development Company, L.P
#
# 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 applic... | apache-2.0 |
tejasjadhav/android_kernel_mocha | tools/perf/scripts/python/failed-syscalls-by-pid.py | 11180 | 2058 | # failed system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide failed system call totals, broken down by pid.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.pa... | gpl-2.0 |
whitepyro/debian_server_setup | lib/hachoir_core/field/seekable_field_set.py | 90 | 6130 | from lib.hachoir_core.field import Field, BasicFieldSet, FakeArray, MissingField, ParserError
from lib.hachoir_core.tools import makeUnicode
from lib.hachoir_core.error import HACHOIR_ERRORS
from itertools import repeat
import lib.hachoir_core.config as config
class RootSeekableFieldSet(BasicFieldSet):
def __init_... | gpl-3.0 |
Letractively/kay-framework | kay/utils/datastructures.py | 10 | 8203 | # -*- coding: utf-8 -*-
"""
kay.utils.datastructures
~~~~~~~~~~~~~~~~~~~~~~~~~
Various data structures.
:Copyright: (c) 2009 Accense Technology, Inc. All rights reserved.
:copyright: (c) 2009 by the Zine Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
This file originally derives fr... | bsd-3-clause |
Jobava/pootle | pootle/apps/pootle_translationproject/migrations/0001_initial.py | 10 | 1525 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import pootle.core.mixins.treeitem
class Migration(migrations.Migration):
dependencies = [
('pootle_app', '0001_initial'),
('pootle_project', '0001_initial'),
('pootle_language', '000... | gpl-3.0 |
amcdunn/CloudMining | cloudmining/lib/utils.py | 2 | 3775 | __author__ = 'Alex Ksikes <alex.ksikes@gmail.com>'
import datetime
import urlparse
import simplejson
import fnmatch
import urllib
import web
import imp
import os
import hashlib
import collections
json_encode = simplejson.dumps
urlunquote = urllib.unquote_plus
def homedomain():
return web.ctx.get('homedomain', '... | agpl-3.0 |
alexshepard/aledison | contacts.py | 1 | 1436 | #!/usr/bin/python
import os.path
import pickle
import yaml
config = yaml.safe_load(open("config.yml"))
contacts_filename = config["contacts"]["filename"]
class Contacts:
"""An address book, with entries for people."""
def get_contacts(self):
if (os.path.isfile(contacts_filename)):
return pickle.load(op... | mit |
GauravSahu/odoo | addons/l10n_at/__init__.py | 438 | 1050 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) conexus.at
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public ... | agpl-3.0 |
mpurg/qtools | packages/Qpyl/core/qstructure.py | 1 | 13331 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# MIT License
#
# Copyright (c) 2018 Miha Purg <miha.purg@gmail.com>
#
# 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, in... | mit |
britcey/ansible | lib/ansible/cli/__init__.py | 4 | 32844 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2016, Toshio Kuratomi <tkuratomi@ansible.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, eithe... | gpl-3.0 |
somic/paasta | tests/autoscaling/test_autoscaling_cluster_lib.py | 1 | 82470 | # Copyright 2015-2016 Yelp 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 or agreed to in writin... | apache-2.0 |
dongjoon-hyun/spark | examples/src/main/python/mllib/multi_label_metrics_example.py | 158 | 2277 | #
# 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... | apache-2.0 |
asedunov/intellij-community | python/lib/Lib/xml/parsers/expat.py | 73 | 21923 | # coding: utf-8
#------------------------------------------------------------------------------
# Copyright (c) 2008 Sébastien Boisgérault
#
# 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 w... | apache-2.0 |
tensorflow/quantum | tensorflow_quantum/core/ops/tfq_simulate_ops.py | 1 | 6879 | # Copyright 2020 The TensorFlow Quantum 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... | apache-2.0 |
zverevalexei/trex-http-proxy | trex_client/external_libs/pyyaml-3.11/python3/yaml/emitter.py | 189 | 42954 |
# Emitter expects events obeying the following grammar:
# stream ::= STREAM-START document* STREAM-END
# document ::= DOCUMENT-START node DOCUMENT-END
# node ::= SCALAR | sequence | mapping
# sequence ::= SEQUENCE-START node* SEQUENCE-END
# mapping ::= MAPPING-START (node node)* MAPPING-END
__all__ = ['Emitter', 'Emi... | mit |
crcox/NEXT | next/broker/celery_app/tasks.py | 2 | 3624 | from __future__ import absolute_import
from .celery_broker import app
import time
import json
import traceback
# import next.logging_client.LoggerHTTP as ell
from next.database_client.DatabaseAPI import DatabaseAPI
db = DatabaseAPI()
from next.logging_client.LoggerAPI import LoggerAPI
ell = LoggerAPI()
import next.ut... | apache-2.0 |
census-instrumentation/opencensus-python | contrib/opencensus-ext-stackdriver/opencensus/ext/stackdriver/stats_exporter/__init__.py | 1 | 17658 | # Copyright 2018, OpenCensus 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 law or agreed to in w... | apache-2.0 |
fevxie/odoo | addons/payment_adyen/tests/test_adyen.py | 378 | 4314 | # -*- coding: utf-8 -*-
from lxml import objectify
import urlparse
from openerp.addons.payment.models.payment_acquirer import ValidationError
from openerp.addons.payment.tests.common import PaymentAcquirerCommon
from openerp.addons.payment_adyen.controllers.main import AdyenController
from openerp.osv.orm import exce... | agpl-3.0 |
mezz64/home-assistant | homeassistant/components/rainbird/sensor.py | 22 | 2005 | """Support for Rain Bird Irrigation system LNK WiFi Module."""
import logging
from pyrainbird import RainbirdController
from homeassistant.helpers.entity import Entity
from . import (
DATA_RAINBIRD,
RAINBIRD_CONTROLLER,
SENSOR_TYPE_RAINDELAY,
SENSOR_TYPE_RAINSENSOR,
SENSOR_TYPES,
)
_LOGGER = log... | apache-2.0 |
gregdek/ansible | lib/ansible/module_utils/network/edgeos/edgeos.py | 73 | 4609 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | gpl-3.0 |
bloodhod/FreeNetCable-Repo | script.ftvguide/ResetDatabase.py | 8 | 2224 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2014 Sean Poyser and Richard Dean (write2dixie@gmail.com)
#
# Modified for FTV Guide (09/2014 onwards)
# by Thomas Geppert [bluezed] - bluezed.apps@gmail.com
#
# This Program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Gener... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.