repo_name stringlengths 5 100 | path stringlengths 4 375 | copies stringclasses 991
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
loco-odoo/localizacion_co | openerp/addons-extra/ifrs_report-8.0.0.6/ifrs_report/wizard/ifrs_report_wizard.py | 3 | 8661 | # -*- 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 |
pkoutsias/SickRage | lib/bs4/diagnose.py | 39 | 6618 | """Diagnostic functions, mainly for use when doing tech support."""
__license__ = "MIT"
import cProfile
from StringIO import StringIO
from HTMLParser import HTMLParser
import bs4
from bs4 import BeautifulSoup, __version__
from bs4.builder import builder_registry
import os
import pstats
import random
import tempfile
... | gpl-3.0 |
poparteu/openMVG | docs/sphinx/rst/conf.py | 2 | 10639 | # -*- coding: utf-8 -*-
#
# openMVG documentation build configuration file, created by
# sphinx-quickstart on Wed Oct 30 11:05:58 2013.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# A... | mit |
Dhivyap/ansible | lib/ansible/modules/network/f5/bigip_message_routing_route.py | 23 | 16527 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2019, 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',
... | gpl-3.0 |
jvictor0/TiaraBoom | sharat/nlpclasses.py | 1 | 7526 |
import unidecode
class Opt:
def __init__(self, tp):
self.tp = tp
def IsPrimitive(val):
return isinstance(val,str) or isinstance(val,int) or isinstance(val,bool) or val == None
def ValidateNonRecursive(schema, json):
for k in schema.keys():
if k in json and isinstance(json[k], uni... | mit |
onitake/Uranium | UM/Math/LineSegment.py | 1 | 3205 | # Copyright (c) 2015 Ultimaker B.V.
# Uranium is released under the terms of the AGPLv3 or higher.
from UM.Math.Float import Float # For fuzzy comparison of edge cases.
## Represents a line segment in 2D.
#
# The line segment is represented by two endpoints.
class LineSegment(object):
## Creates a new line ... | agpl-3.0 |
loretoparisi/nupic | nupic/regions/CLAClassifierRegion.py | 3 | 9033 | #!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013-15, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditio... | agpl-3.0 |
singhj/locality-sensitive-hashing | lsh/lsh/lsh_jaccard.py | 2 | 10016 | from lsh.lsh.lsh_base import LshBase
from lsh.utils.similarity import jaccard_similarity
from lsh.utils.similarity import compute_positive_hash
from lsh.models.documents.jaccard_document import JaccardDocument
import copy
def _get_documents(hash_code, band_dict):
if hash_code and band_dict:
return band_dic... | mit |
dzolnierz/percona-server | libevent/event_rpcgen.py | 159 | 45222 | #!/usr/bin/env python
#
# Copyright (c) 2005 Niels Provos <provos@citi.umich.edu>
# All rights reserved.
#
# Generates marshaling code based on libevent.
import sys
import re
#
_NAME = "event_rpcgen.py"
_VERSION = "0.1"
_STRUCT_RE = '[a-z][a-z_0-9]*'
# Globals
line_count = 0
white = re.compile(r'^\s+')
cppcomment =... | gpl-2.0 |
jkimlab/mySyntenyPortal | src/third_party/lastz/tools/hsx_file.py | 6 | 9905 | #!/usr/bin/env python
"""
"Hashed sequence index" (hsx) file reader (for a fasta file)
-------------------------------------------------------------------
offset 0x00: D2 52 70 95 big endian magic number
.. (95 70 52 D2 => little endian)
offset 0x04: 00 00 01 xx version 1.0 (see note 1)
offset 0x... | gpl-3.0 |
jbellis/hadoop-common | src/contrib/hod/hodlib/Common/miniHTMLParser.py | 182 | 1402 | #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 use thi... | apache-2.0 |
ThiagoGarciaAlves/intellij-community | python/lib/Lib/site-packages/django/core/management/__init__.py | 145 | 17405 | import os
import sys
from optparse import OptionParser, NO_DEFAULT
import imp
import django
from django.core.management.base import BaseCommand, CommandError, handle_default_options
from django.utils.importlib import import_module
# For backwards compatibility: get_version() used to be in this module.
get_version = d... | apache-2.0 |
tody411/ImageViewerFramework | ivf/scene/gl3d/camera.py | 1 | 2183 |
# -*- coding: utf-8 -*-
## @package ivf.scene.3d.camera
#
# ivf.scene.3d.camera utility package.
# @author tody
# @date 2016/02/01
# Numpy module
import numpy as np
# OpenGL modules
from OpenGL.GL import *
from OpenGL.GLU import *
## Perspective camera
class PerspectiveCamera:
## Constructor
... | mit |
arangodb/arangodb | 3rdParty/immer/v0.6.2/doc/conf.py | 2 | 12710 | # -*- coding: utf-8 -*-
#
# immer documentation build configuration file, created by
# sphinx-quickstart on Thu Oct 27 18:10:24 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All... | apache-2.0 |
imply/chuu | third_party/libxml/src/genUnicode.py | 337 | 12985 | #!/usr/bin/python -u
#
# Original script modified in November 2003 to take advantage of
# the character-validation range routines, and updated to the
# current Unicode information (Version 4.0.1)
#
# NOTE: there is an 'alias' facility for blocks which are not present in
# the current release, but are needed for ABI com... | bsd-3-clause |
mcanthony/node-gyp | gyp/pylib/gyp/common.py | 366 | 19638 | # 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.
from __future__ import with_statement
import collections
import errno
import filecmp
import os.path
import re
import tempfile
import sys
# A minimal memoizing d... | mit |
axinging/chromium-crosswalk | tools/memory_inspector/classification_rules/default/nheap-android.py | 106 | 1764 | # 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.
# This is a generic rule-tree for classifying native heaps on Android. It is a
# simple hierarchical python data structure (list of dictionaries). Some rules... | bsd-3-clause |
openstack/ironic-inspector | ironic_inspector/conf/default.py | 1 | 5269 | # 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 writing, software
# distributed under the... | apache-2.0 |
movmov/cc | vendor/boto/boto/vpc/__init__.py | 8 | 17893 | # Copyright (c) 2009 Mitch Garnaat http://garnaat.org/
#
# 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, m... | apache-2.0 |
rigmar/idapython | pywraps/py_notifywhen.py | 16 | 2229 | # -----------------------------------------------------------------------
# Standalone and testing code
import sys
try:
import pywraps
pywraps_there = True
print "Using pywraps"
except:
pywraps_there = False
print "Not using pywraps"
try:
import _idaapi
except:
print "Please t... | bsd-3-clause |
JCA-Developpement/Odoo | addons/crm_partner_assign/wizard/crm_forward_to_partner.py | 377 | 10606 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... | agpl-3.0 |
hectormartinez/rougexstem | taln2016/icsisumm-primary-sys34_v1/nltk/nltk-0.9.2/nltk_contrib/fsa.py | 9 | 19337 | # Natural Language Toolkit: Finite State Automata
#
# Copyright (C) 2001-2006 University of Pennsylvania
# Authors: Steven Bird <sb@ldc.upenn.edu>
# Rob Speer <rspeer@mit.edu>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
"""
A module for finite state automata.
Operations are based o... | apache-2.0 |
yarikoptic/pystatsmodels | statsmodels/datasets/utils.py | 2 | 9940 | import sys
import shutil
import pickle
from os import environ
from os import makedirs
from os.path import basename
from os.path import expanduser
from os.path import exists
from os.path import expanduser
from os.path import join
from StringIO import StringIO
import time
from urllib2 import urlopen, HTTPError
import nu... | bsd-3-clause |
rananda/cfme_tests | cfme/tests/cloud/test_cloud_events.py | 1 | 4118 | # -*- coding: utf-8 -*-
"""This module tests only cloud specific events"""
import pytest
import re
from cfme.common.vm import VM
from cfme.cloud.provider.azure import AzureProvider
from utils import testgen
from utils.appliance import get_or_create_current_appliance
from utils.events import EventBuilder
from utils.gen... | gpl-2.0 |
adwiputra/LUMENS-repo | processing/grass/GrassAlgorithmProvider.py | 4 | 4320 | # -*- coding: utf-8 -*-
"""
***************************************************************************
GrassAlgorithmProvider.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
****************... | gpl-2.0 |
slaweet/autoskola | main/geography/management/commands/update_maps.py | 1 | 1555 | # -*- coding: utf-8 -*-
from django.core.management.base import BaseCommand
from geography.management import MapUpdater
from django.db import connection
import csv
import settings
class Command(BaseCommand):
help = u"""Add new places"""
def handle(self, *args, **options):
u = MapUpdater()
u.u... | mit |
jansohn/pyload | module/lib/Getch.py | 43 | 2048 | class Getch:
"""
Gets a single character from standard input. Does not echo to
the screen.
"""
def __init__(self):
try:
self.impl = _GetchWindows()
except ImportError:
try:
self.impl = _GetchMacCarbon()
except(AttributeError, Impo... | gpl-3.0 |
meganchen1996/beat-drop | bower_components/bootstrap/node_modules/npm-shrinkwrap/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_ninja.py | 1789 | 10585 | # Copyright (c) 2014 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.
"""Xcode-ninja wrapper project file generator.
This updates the data structures passed to the Xcode gyp generator to build
with ninja instead. The Xcode project i... | mit |
carnell69/kuma | vendor/packages/translate/storage/placeables/test_terminology.py | 24 | 2449 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2009 Zuza Software Foundation
#
# This file is part of the Translate Toolkit.
#
# 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... | mpl-2.0 |
nioinnovation/python-xbee | xbee/helpers/dispatch/tests/test_dispatch.py | 2 | 3241 | """
test_dispatch.py
By Paul Malmsten, 2010
pmalmsten@gmail.com
Tests the Dispatch module.
"""
import unittest
from xbee.helpers.dispatch import Dispatch
from xbee.helpers.dispatch.tests.fake import FakeXBee
class CallbackCheck(object):
def __init__(self):
self.called = False
def call(self, name, d... | mit |
dgquintas/grpc | src/python/grpcio_tests/tests/testing/_time_test.py | 14 | 6050 | # Copyright 2017 gRPC 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 writing... | apache-2.0 |
koniiiik/django | tests/admin_views/custom_has_permission_admin.py | 380 | 1089 | """
A custom AdminSite for AdminViewPermissionsTest.test_login_has_permission().
"""
from __future__ import unicode_literals
from django.contrib import admin
from django.contrib.auth import get_permission_codename
from django.contrib.auth.forms import AuthenticationForm
from . import admin as base_admin, models
PERM... | bsd-3-clause |
apache/thrift | lib/py/src/transport/THttpClient.py | 9 | 7283 | #
# 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... | apache-2.0 |
lupyuen/RaspberryPiImage | home/pi/GrovePi/Software/Python/others/temboo/Library/Google/Plus/Domains/Circles/RemovePeople.py | 5 | 6745 | # -*- coding: utf-8 -*-
###############################################################################
#
# RemovePeople
# Removes a person from a circle.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file ex... | apache-2.0 |
runekaagaard/django-contrib-locking | tests/null_fk_ordering/tests.py | 24 | 2012 | from __future__ import unicode_literals
from django.test import TestCase
from .models import Author, Article, SystemInfo, Forum, Post, Comment
class NullFkOrderingTests(TestCase):
def test_ordering_across_null_fk(self):
"""
Regression test for #7512
ordering across nullable Foreign Key... | bsd-3-clause |
nicobustillos/odoo | addons/auth_signup/res_users.py | 90 | 14710 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2012-today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | agpl-3.0 |
apache/airflow | airflow/providers/amazon/aws/hooks/s3.py | 2 | 33707 | #
# 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 |
camptocamp/odoo | openerp/addons/__init__.py | 378 | 1537 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2011 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you ca... | agpl-3.0 |
jabez1314/youtube-dl | youtube_dl/extractor/espn.py | 106 | 1940 | from __future__ import unicode_literals
from .common import InfoExtractor
class ESPNIE(InfoExtractor):
_VALID_URL = r'https?://espn\.go\.com/(?:[^/]+/)*(?P<id>[^/]+)'
_WORKING = False
_TESTS = [{
'url': 'http://espn.go.com/video/clip?id=10365079',
'info_dict': {
'id': 'FkYWtma... | unlicense |
xen0l/ansible | lib/ansible/utils/module_docs_fragments/k8s_name_options.py | 80 | 2450 | #
# Copyright 2018 Red Hat | Ansible
#
# 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.
#
# ... | gpl-3.0 |
victorbergelin/cpp-project-template | thirdparty/gmock-1.7.0/scripts/generator/cpp/gmock_class.py | 268 | 8241 | #!/usr/bin/env python
#
# Copyright 2008 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | bsd-3-clause |
steynovich/ansible-modules-extras | network/cloudflare_dns.py | 15 | 24585 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016 Michael Gruener <michael.gruener@chaosmoon.net>
#
# 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... | gpl-3.0 |
x303597316/hue | desktop/core/ext-py/djangosaml2-0.13.0/djangosaml2/views.py | 35 | 14787 | # Copyright (C) 2010-2013 Yaco Sistemas (http://www.yaco.es)
# Copyright (C) 2009 Lorenzo Gil Sanchez <lorenzo.gil.sanchez@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ... | apache-2.0 |
jmesteve/openerp | openerp/tests/test_ir_sequence.py | 29 | 7996 | # -*- coding: utf-8 -*-
# Run with one of these commands:
# > OPENERP_ADDONS_PATH='../../addons/trunk' OPENERP_PORT=8069 \
# OPENERP_DATABASE=yy PYTHONPATH=. python tests/test_ir_sequence.py
# > OPENERP_ADDONS_PATH='../../addons/trunk' OPENERP_PORT=8069 \
# OPENERP_DATABASE=yy nosetests tests/test_ir_se... | agpl-3.0 |
EKiefer/edge-starter | py34env/Lib/site-packages/django/contrib/gis/db/backends/postgis/const.py | 528 | 1484 | """
PostGIS to GDAL conversion constant definitions
"""
# Lookup to convert pixel type values from GDAL to PostGIS
GDAL_TO_POSTGIS = [None, 4, 6, 5, 8, 7, 10, 11, None, None, None, None]
# Lookup to convert pixel type values from PostGIS to GDAL
POSTGIS_TO_GDAL = [1, 1, 1, 3, 1, 3, 2, 5, 4, None, 6, 7, None, None]
# ... | mit |
nugget/home-assistant | tests/components/dyson/test_init.py | 5 | 8144 | """Test the parent Dyson component."""
import unittest
from unittest import mock
from homeassistant.components import dyson
from tests.common import get_test_home_assistant
def _get_dyson_account_device_available():
"""Return a valid device provide by Dyson web services."""
device = mock.Mock()
device.se... | apache-2.0 |
Shaswat27/scipy | scipy/optimize/tests/test_regression.py | 110 | 1214 | """Regression tests for optimize.
"""
from __future__ import division, print_function, absolute_import
import numpy as np
from numpy.testing import TestCase, run_module_suite, assert_almost_equal, \
assert_raises
import scipy.optimize
class TestRegression(TestCase):
def test_newton_x0_is_0(self):
... | bsd-3-clause |
jlukacs/aqua | lib/assimp/contrib/gtest/xcode/Scripts/versiongenerate.py | 3088 | 4536 | #!/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... | mit |
Aeronautics/aero | aero/cache.py | 1 | 2118 | # -*- coding: utf-8 -*-
__author__ = 'nickl-'
from __version__ import __version__
class CacheProvider():
data = {}
def seen(self, key, val=False):
try:
for k, v in key.items():
self.data[k] = v
return
except AttributeError:
pass
if... | bsd-3-clause |
google-code-export/tipfy | examples/auth/bootstrap.py | 16 | 10065 | ##############################################################################
#
# Copyright (c) 2006 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOF... | bsd-3-clause |
candy7393/VTK | Filters/General/Testing/Python/edgePoints.py | 20 | 1711 | #!/usr/bin/env python
import vtk
from vtk.test import Testing
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
def GetRGBColor(colorName):
'''
Return the red, green and blue components for a
color as doubles.
'''
rgb = [0.0, 0.0, 0.0] # black
vtk.vtkNamedColors... | bsd-3-clause |
mvlabat/GamedevMathProblems | lib/gtest-1.7.0/xcode/Scripts/versiongenerate.py | 3088 | 4536 | #!/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... | gpl-3.0 |
SgnJp/SMAC3 | smac/epm/rf_with_instances.py | 1 | 7341 | import numpy as np
import logging
import pyrfr.regression
from smac.epm.base_epm import AbstractEPM
__author__ = "Aaron Klein"
__copyright__ = "Copyright 2015, ML4AAD"
__license__ = "3-clause BSD"
__maintainer__ = "Aaron Klein"
__email__ = "kleinaa@cs.uni-freiburg.de"
__version__ = "0.0.1"
class RandomForestWithI... | bsd-3-clause |
ooici/coi-services | ion/services/sa/test/test_activate_instrument.py | 1 | 27271 | #!/usr/bin/env python
from gevent.event import AsyncResult
import unittest, os
from nose.plugins.attrib import attr
import gevent
from mock import patch
import time
from pyon.util.int_test import IonIntegrationTestCase
from pyon.util.containers import DotDict
from pyon.util.poller import poll
from pyon.core.bootstra... | bsd-2-clause |
kizniche/Mycodo | mycodo/inputs/atlas_pressure.py | 1 | 5702 | # coding=utf-8
import copy
from flask_babel import lazy_gettext
from mycodo.inputs.base_input import AbstractInput
from mycodo.utils.atlas_calibration import setup_atlas_device
from mycodo.utils.system_pi import str_is_float
# Measurements
measurements_dict = {
0: {
'measurement': 'pressure',
'uni... | gpl-3.0 |
kartoffelsup/mangos-tbc | contrib/mmap/mmap_extract.py | 21 | 2401 | #!/usr/bin/python
"""
This file is part of the CMaNGOS Project. See AUTHORS file for Copyright information
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... | gpl-2.0 |
Bulochkin/tensorflow_pack | tensorflow/python/kernel_tests/conditional_accumulator_test.py | 133 | 15457 | # 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 |
pmediano/jidt | demos/python/example2TeMultidimBinaryData.py | 3 | 2974 | ##
## Java Information Dynamics Toolkit (JIDT)
## Copyright (C) 2012, Joseph T. Lizier
##
## 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 yo... | gpl-3.0 |
chanderbgoel/pybrain | pybrain/rl/environments/flexcube/tasks.py | 25 | 8629 | __author__ = 'Frank Sehnke, sehnke@in.tum.de'
#########################################################################
# The tasks availabele in the FlexCube Environment
#
# The FlexCube Environment is a Mass-Spring-System composed of 8 mass points.
# These resemble a cube with flexible edges.
#
# Tasks available are... | bsd-3-clause |
JacobPorter/BisPin | Utilities/ExtractRescoredAlignments.py | 1 | 1990 | #!/usr/bin/python
import datetime
import sys
import optparse
import random
import IndentedHelpFormatterWithNL
import SeqIterator
import Constants
"""
@author: Jacob Porter
"""
def extract(sam_file):
sam_input = SeqIterator.SeqIterator(sam_file, file_type=Constants.SAM)
sam_writer = SeqIterator.SeqWriter(sys.s... | gpl-3.0 |
fsys/alembic | tests/test_command.py | 4 | 2975 | import unittest
from . import clear_staging_env, staging_env, \
_sqlite_testing_config, \
three_rev_fixture, eq_
from alembic import command
from io import TextIOWrapper, BytesIO
from alembic.script import ScriptDirectory
class StdoutCommandTest(unittest.TestCase):
@classmethod
def setup_class(cls):... | mit |
ghjm/ansible | lib/ansible/module_utils/common/validation.py | 8 | 17430 | # -*- coding: utf-8 -*-
# Copyright (c) 2019 Ansible Project
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
import os
import re
from ast import literal_eval
from ansible.m... | gpl-3.0 |
Rujuta25/testrepo | node_modules/node-gyp/gyp/pylib/gyp/easy_xml_test.py | 2698 | 3270 | #!/usr/bin/env python
# Copyright (c) 2011 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.
""" Unit tests for the easy_xml.py file. """
import gyp.easy_xml as easy_xml
import unittest
import StringIO
class TestSequenceFunctions(... | mit |
ldong/vim_youcompleteme | python/ycm/tests/base_test.py | 5 | 4800 | #!/usr/bin/env python
#
# 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 you... | gpl-3.0 |
lrowe/rdflib | rdflib/extras/cmdlineutils.py | 25 | 1795 | import sys
import time
import getopt
import rdflib
import codecs
from rdflib.util import guess_format
def _help():
sys.stderr.write("""
program.py [-f <format>] [-o <output>] [files...]
Read RDF files given on STDOUT - does something to the resulting graph
If no files are given, read from stdin
-o specifies file... | bsd-3-clause |
DempDemp/nautilus | core/tracker.py | 1 | 8675 | import time
from core import base
from core.utils import split_address
class Network(object):
name = None
options = None
prefix = None
my_modes = ''
def __init__(self, bot_id):
self.channels = []
self.users = []
self.bot_id = bot_id
def get_channel(self, name):
... | agpl-3.0 |
bestvibes/neo4j-social-network | mac_env/lib/python2.7/site-packages/werkzeug/script.py | 318 | 11249 | # -*- coding: utf-8 -*-
r'''
werkzeug.script
~~~~~~~~~~~~~~~
.. admonition:: Deprecated Functionality
``werkzeug.script`` is deprecated without replacement functionality.
Python's command line support improved greatly with :mod:`argparse`
and a bunch of alternative modules.
Most ... | mit |
xin3liang/platform_external_chromium_org_third_party_WebKit | Tools/Scripts/webkitpy/layout_tests/port/test.py | 2 | 30314 | # Copyright (C) 2010 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 of conditions and the ... | bsd-3-clause |
martonw/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/layout_tests/views/buildbot_results_unittest.py | 122 | 4562 | #!/usr/bin/env python
# Copyright (C) 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 ... | bsd-3-clause |
wnoc-drexel/gem5-stable | tests/long/se/10.mcf/test.py | 83 | 1781 | # Copyright (c) 2006-2007 The Regents of The University of Michigan
# 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 ... | bsd-3-clause |
metabrainz/listenbrainz-server | listenbrainz/db/stats.py | 2 | 18823 | """This module contains functions to insert and retrieve statistics
calculated from Apache Spark into the database.
"""
# listenbrainz-server - Server for the ListenBrainz project.
#
# Copyright (C) 2017 MetaBrainz Foundation Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under t... | gpl-2.0 |
NENO7/GENERAL | tg/tg-test.py | 199 | 1450 | import tgl
import pprint
from functools import partial
our_id = 0
pp = pprint.PrettyPrinter(indent=4)
binlog_done = False;
def on_binlog_replay_end():
binlog_done = True;
def on_get_difference_end():
pass
def on_our_id(id):
our_id = id
return "Set ID: " + str(our_id)
def msg_cb(success, msg):
... | gpl-2.0 |
Phoenix1369/site | judge/pdf_problems.py | 1 | 4614 | import errno
import io
import json
import os
import shutil
import subprocess
import tempfile
import uuid
from django.conf import settings
from django.utils.translation import ugettext
HAS_PHANTOMJS = os.access(getattr(settings, 'PHANTOMJS', ''), os.X_OK)
HAS_WKHTMLTOPDF = os.access(getattr(settings, 'WKHTMLTOPDF', ''... | agpl-3.0 |
jiangzhuo/kbengine | kbe/src/lib/python/Lib/unittest/loader.py | 83 | 16378 | """Loading unittests."""
import os
import re
import sys
import traceback
import types
import functools
from fnmatch import fnmatch
from . import case, suite, util
__unittest = True
# what about .pyc or .pyo (etc)
# we would need to avoid loading the same tests multiple times
# from '.py', '.pyc' *and* '.pyo'
VALID... | lgpl-3.0 |
astaninger/speakout | venv/lib/python3.6/site-packages/pip/_vendor/chardet/escsm.py | 289 | 10510 | ######################## 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... | mit |
noox-/stbgui-1 | lib/python/Screens/Rc.py | 9 | 2608 | from Components.Pixmap import MovingPixmap, MultiPixmap
from Tools.Directories import resolveFilename, SCOPE_SKIN
from xml.etree.ElementTree import ElementTree
from Components.config import config, ConfigInteger
from Components.RcModel import rc_model
config.misc.rcused = ConfigInteger(default = 1)
class Rc:
def __i... | gpl-2.0 |
grzes/djangae | djangae/crc64.py | 21 | 7136 | from __future__ import print_function
# Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
# (Any use permitted, subject to terms of PostgreSQL license; see.)
# If we have a 64-bit integer type, then a 64-bit CRC looks just like the
# usual sort of implementation. (See Ross Williams' excellent intr... | bsd-3-clause |
cnsoft/kbengine-cocos2dx | kbe/src/lib/python/Lib/test/test_pyclbr.py | 39 | 6960 | '''
Test cases for pyclbr.py
Nick Mathewson
'''
from test.support import run_unittest
import sys
from types import FunctionType, MethodType, BuiltinFunctionType
import pyclbr
from unittest import TestCase
StaticMethodType = type(staticmethod(lambda: None))
ClassMethodType = type(classmethod(lambda c: None))
# H... | lgpl-3.0 |
StyXman/GitPython | git/objects/fun.py | 14 | 7503 | """Module with functions which are supposed to be as fast as possible"""
from stat import S_ISDIR
from git.compat import (
byte_ord,
defenc,
xrange,
text_type,
bchr
)
__all__ = ('tree_to_stream', 'tree_entries_from_data', 'traverse_trees_recursive',
'traverse_tree_recursive')
def tree_... | bsd-3-clause |
jayansenaratne/aston | setup.py | 3 | 6486 | #!/usr/bin/env python
# Copyright 2011-2014 Roderick Bovee
#
# This file is part of Aston.
#
# Aston 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... | gpl-3.0 |
googleapis/python-video-transcoder | google/cloud/video/transcoder_v1beta1/types/__init__.py | 1 | 1914 | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | apache-2.0 |
bcb/qutebrowser | qutebrowser/browser/network/schemehandler.py | 10 | 1605 | # vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2016 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# Based on the Eric5 helpviewer,
# Copyright (c) 2009 - 2014 Detlev Offenbach <detlev@die-offenbachs.de>
#
# This file is part of qutebrowser.
#
# qutebrowser is free software: you can redist... | gpl-3.0 |
repotvsupertuga/tvsupertuga.repository | script.module.xbmcswift2/lib/xbmcswift2/plugin.py | 17 | 12906 | '''
xbmcswift2.plugin
-----------------
This module contains the Plugin class. This class handles all of the url
routing and interaction with XBMC for a plugin.
:copyright: (c) 2012 by Jonathan Beluch
:license: GPLv3, see LICENSE for more details.
'''
import os
import sys
import pickle
import ... | gpl-2.0 |
liqueur/jieba | jieba/posseg/viterbi.py | 71 | 1610 | import sys
import operator
MIN_FLOAT = -3.14e100
MIN_INF = float("-inf")
if sys.version_info[0] > 2:
xrange = range
def get_top_states(t_state_v, K=4):
return sorted(t_state_v, key=t_state_v.__getitem__, reverse=True)[:K]
def viterbi(obs, states, start_p, trans_p, emit_p):
V = [{}] # tabular
mem_p... | mit |
cslzchen/osf.io | tests/framework_tests/test_modular_templates.py | 6 | 7064 | # -*- coding: utf-8 -*-
'''Unit tests for the modular template system.
These require a test db because they use Session objects.
'''
import json
import unittest
import os
import flask
from lxml.html import fragment_fromstring
import werkzeug.wrappers
from rest_framework import status as http_status
from framework.ex... | apache-2.0 |
ttyangf/gyp | test/make/gyptest-noload.py | 362 | 2023 | #!/usr/bin/env python
# Copyright (c) 2010 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.
"""
Tests the use of the NO_LOAD flag which makes loading sub .mk files
optional.
"""
# Python 2.5 needs this for the with statement.
from ... | bsd-3-clause |
chamikaramj/beam | sdks/python/apache_beam/transforms/display.py | 2 | 10980 | #
# 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 |
ns950/calibre | src/calibre/ebooks/markdown/preprocessors.py | 43 | 14278 | """
PRE-PROCESSORS
=============================================================================
Preprocessors work on source text before we start doing anything too
complicated.
"""
from __future__ import absolute_import
from __future__ import unicode_literals
from . import util
from . import odict
import re
def b... | gpl-3.0 |
open-synergy/purchase-workflow | purchase_multi_picking/purchase.py | 26 | 3190 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2012-2013 Agile Business Group sagl
# (<http://www.agilebg.com>)
# Copyright (C) 2012 Domsense srl (<http://www.domsense.com>)
#
# This program is free software: you can redistribute it a... | agpl-3.0 |
xtiankisutsa/MARA_Framework | tools/qark/qark/lib/html5lib/filters/lint.py | 500 | 4208 | from __future__ import absolute_import, division, unicode_literals
from . import _base
from ..constants import cdataElements, rcdataElements, voidElements
from ..constants import spaceCharacters
spaceCharacters = "".join(spaceCharacters)
class LintError(Exception):
pass
class Filter(_base.Filter):
def __i... | lgpl-3.0 |
loulich/Couchpotato | libs/pyutil/test/out_of_shape/test_cache.py | 106 | 16980 | #!/usr/bin/env python
# Copyright (c) 2002-2010 Zooko "Zooko" Wilcox-O'Hearn
# This file is part of pyutil; see README.rst for licensing terms.
import random, unittest
from pyutil.assertutil import _assert
from pyutil.humanreadable import hr
from pyutil import memutil
from pyutil import cache
class Bencher:
... | gpl-3.0 |
nicoTrombon/DjangoPolls | env/Lib/site-packages/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 |
Kingclove/info3180project2 | server/lib/werkzeug/__init__.py | 296 | 7210 | # -*- coding: utf-8 -*-
"""
werkzeug
~~~~~~~~
Werkzeug is the Swiss Army knife of Python web development.
It provides useful classes and functions for any WSGI application to make
the life of a python web developer much easier. All of the provided
classes are independent from each other so yo... | apache-2.0 |
jwhonce/openshift-ansible | roles/lib_openshift/src/class/oc_adm_csr.py | 18 | 8783 | # pylint: skip-file
# flake8: noqa
class OCcsr(OpenShiftCLI):
''' Class to wrap the oc adm certificate command line'''
kind = 'csr'
# pylint: disable=too-many-arguments
def __init__(self,
nodes=None,
approve_all=False,
service_account=None,
... | apache-2.0 |
acsone/website | website_sale_survey/controllers/main.py | 5 | 1422 | # -*- coding: utf-8 -*-
from openerp import SUPERUSER_ID
from openerp import http
from openerp.http import request
class website_sale_survey(http.Controller):
@http.route(['/shop/survey'], type='http', auth="public", website=True)
def shop_survey(self, **post):
cr, uid, context = request.cr, request.... | agpl-3.0 |
wagtail/wagtail | wagtail/admin/views/reports/locked_pages.py | 5 | 1515 | import datetime
import django_filters
from django.core.exceptions import PermissionDenied
from django.utils.translation import gettext_lazy as _
from wagtail.admin.filters import DateRangePickerWidget, WagtailFilterSet
from wagtail.core.models import Page, UserPagePermissionsProxy
from .base import PageReportView
... | bsd-3-clause |
hlieberman/debian-ansible | lib/ansible/inventory/expand_hosts.py | 18 | 4323 | # (c) 2012, Zettar Inc.
# Written by Chin Fang <fangchin@zettar.com>
#
# This file is part of Ansible
#
# This module 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 y... | gpl-3.0 |
google-research/google-research | hipi/utils.py | 1 | 11426 | # coding=utf-8
# Copyright 2021 The Google Research 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 applicab... | apache-2.0 |
foreni-packages/hachoir-core | hachoir_core/stream/output.py | 21 | 5459 | from cStringIO import StringIO
from hachoir_core.endian import BIG_ENDIAN
from hachoir_core.bits import long2raw
from hachoir_core.stream import StreamError
from errno import EBADF
MAX_READ_NBYTES = 2 ** 16
class OutputStreamError(StreamError):
pass
class OutputStream(object):
def __init__(self, output, file... | gpl-2.0 |
JackSullivan/bazel | tools/build_defs/docker/rewrite_json.py | 14 | 8084 | # Copyright 2015 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.