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 |
|---|---|---|---|---|---|
srikantbmandal/ansible | lib/ansible/modules/system/timezone.py | 29 | 22062 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Shinichi TAMURA (@tmshn)
#
# 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
... | gpl-3.0 |
MTASZTAKI/ApertusVR | plugins/physics/bulletPhysics/3rdParty/bullet3/examples/pybullet/gym/pybullet_envs/minitaur/agents/tools/attr_dict.py | 8 | 1795 | # Copyright 2017 The TensorFlow Agents 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 ag... | mit |
ds-hwang/chromium-crosswalk | testing/chromoting/download_test_files.py | 57 | 1757 | # Copyright (c) 2015 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.
"""A script to download files required for Remoting integration tests from GCS.
The script expects 2 parameters:
input_files: a file containing t... | bsd-3-clause |
tmenjo/cinder-2015.1.1 | cinder/tests/test_migrations.py | 6 | 39748 | # 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
# d... | apache-2.0 |
sanuj/shogun | examples/undocumented/python_modular/distribution_histogram_modular.py | 26 | 1198 | #!/usr/bin/env python
from tools.load import LoadMatrix
lm=LoadMatrix()
traindna = lm.load_dna('../data/fm_train_dna.dat')
parameter_list = [[traindna,3,0,False],[traindna,4,0,False]]
def distribution_histogram_modular (fm_dna=traindna,order=3,gap=0,reverse=False):
from modshogun import StringWordFeatures, StringCh... | gpl-3.0 |
j0057/ansible-1 | lib/ansible/utils/plugins.py | 1 | 9861 | # (c) 2012, Daniel Hokka Zakrisson <daniel@hozac.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any lat... | gpl-3.0 |
yatinkumbhare/openstack-nova | nova/tests/unit/api/openstack/compute/test_servers.py | 6 | 138547 | # Copyright 2010-2011 OpenStack Foundation
# Copyright 2011 Piston Cloud Computing, Inc.
# All Rights Reserved.
# Copyright 2013 Red Hat, 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 Li... | apache-2.0 |
cyrilMargaria/tornado | tornado/test/httpserver_test.py | 68 | 41032 | #!/usr/bin/env python
from __future__ import absolute_import, division, print_function, with_statement
from tornado import netutil
from tornado.escape import json_decode, json_encode, utf8, _unicode, recursive_unicode, native_str
from tornado import gen
from tornado.http1connection import HTTP1Connection
from tornado... | apache-2.0 |
marcelocure/django | tests/forms_tests/tests/test_forms.py | 84 | 148223 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import copy
import datetime
import json
import uuid
from django.core.exceptions import NON_FIELD_ERRORS
from django.core.files.uploadedfile import SimpleUploadedFile
from django.core.validators import RegexValidator
from django.forms import (
Boolean... | bsd-3-clause |
wooga/airflow | tests/providers/google/cloud/operators/test_presto_to_gcs_system.py | 1 | 6439 | #
# 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 |
aaxelb/SHARE | share/transform/chain/utils.py | 2 | 5850 | import re
from lxml import etree
import logging
from share.transform.chain import exceptions
logger = logging.getLogger(__name__)
def format_address(address1='', address2='', city='', state_or_province='', postal_code='', country=''):
if address1 and address2 and city and state_or_province and postal_code and ... | apache-2.0 |
kmonsoor/python-for-android | python3-alpha/extra_modules/gdata/blogger/__init__.py | 125 | 6395 | #!/usr/bin/python
#
# Copyright (C) 2007, 2008 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 applicabl... | apache-2.0 |
daeseokyoun/youtube-dl | youtube_dl/extractor/kamcord.py | 53 | 2262 | from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import compat_str
from ..utils import (
int_or_none,
qualities,
)
class KamcordIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?kamcord\.com/v/(?P<id>[^/?#&]+)'
_TEST = {
'url': 'https://www.kamcord.co... | unlicense |
AnselCmy/ARPS | ML_model/test/report_classifier.py | 1 | 2434 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
from __future__ import print_function
import sys
reload(sys)
sys.setdefaultencoding('utf8')
import pymongo as pm
sys.path.append('..')
from model.main import Multi_Label_Model
def check_contain_chinese(check_str):
for ch in check_str.decode('utf-8'):
if u'\u4e00' <= ch ... | mit |
Vassy/odoo | addons/claim_from_delivery/__init__.py | 374 | 1053 | ##############################################################################
#
# 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 Affero General Publ... | agpl-3.0 |
teamCarel/EyeTracker | src/capture/eye.py | 1 | 20620 | '''
(*)~---------------------------------------------------------------------------
Pupil - eye tracking platform
Copyright (C) 2012-2017 Pupil Labs
Distributed under the terms of the GNU
Lesser General Public License (LGPL v3.0).
See COPYING and COPYING.LESSER for license details.
---------------------------... | lgpl-3.0 |
bigswitch/horizon | openstack_dashboard/test/test_data/swift_data.py | 8 | 4741 | # 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 License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | apache-2.0 |
abhishekgahlot/youtube-dl | youtube_dl/extractor/kuwo.py | 22 | 11149 | # coding: utf-8
from __future__ import unicode_literals
import re
import itertools
from .common import InfoExtractor
from ..utils import (
get_element_by_id,
clean_html,
ExtractorError,
remove_start,
)
class KuwoBaseIE(InfoExtractor):
_FORMATS = [
{'format': 'ape', 'ext': 'ape', 'prefere... | unlicense |
Mitchkoens/sympy | sympy/series/kauers.py | 94 | 1807 | from __future__ import print_function, division
def finite_diff(expression, variable, increment=1):
"""
Takes as input a polynomial expression and the variable used to construct
it and returns the difference between function's value when the input is
incremented to 1 and the original function value. I... | bsd-3-clause |
slisson/intellij-community | python/lib/Lib/site-packages/django/utils/autoreload.py | 135 | 4239 | # Autoreloading launcher.
# Borrowed from Peter Hunt and the CherryPy project (http://www.cherrypy.org).
# Some taken from Ian Bicking's Paste (http://pythonpaste.org/).
#
# Portions copyright (c) 2004, CherryPy Team (team@cherrypy.org)
# All rights reserved.
#
# Redistribution and use in source and binary forms, with ... | apache-2.0 |
calfonso/ansible | lib/ansible/plugins/cliconf/aireos.py | 38 | 2766 | #
# (c) 2017 Red Hat Inc.
#
# 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 d... | gpl-3.0 |
matiasb/django | django/utils/deprecation.py | 51 | 2897 | from __future__ import absolute_import
import inspect
import warnings
class RemovedInDjango20Warning(PendingDeprecationWarning):
pass
class RemovedInNextVersionWarning(DeprecationWarning):
pass
class warn_about_renamed_method(object):
def __init__(self, class_name, old_method_name, new_method_name, d... | bsd-3-clause |
giggsey/SickRage | lib/ndg/httpsclient/test/__init__.py | 93 | 1077 | """Unit tests package for ndg_httpsclient
PyOpenSSL utility to make a httplib-like interface suitable for use with
urllib2
"""
__author__ = "P J Kershaw (STFC)"
__date__ = "05/01/12"
__copyright__ = "(C) 2012 Science and Technology Facilities Council"
__license__ = "BSD - see LICENSE file in top-level directory"
__co... | gpl-3.0 |
mandeepdhami/horizon | openstack_dashboard/dashboards/project/data_processing/wizard/views.py | 23 | 3399 | # 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 Li... | apache-2.0 |
cogeorg/BlackRhino | networkx/drawing/nx_pylab.py | 1 | 32861 | # Copyright (C) 2004-2016 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
#
# Author: Aric Hagberg (hagberg@lanl.gov)
"""
**********
Matplotlib
**********
Draw networks with matplotlib.
See Also
--------
m... | gpl-3.0 |
jjscarafia/server-tools | users_ldap_populate/model/populate_wizard.py | 43 | 1787 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2012 Therp BV (<http://therp.nl>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | agpl-3.0 |
slank/ansible | lib/ansible/modules/network/ldap_entry.py | 10 | 9628 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Peter Sagerson <psagers@ignorare.net>
# (c) 2016, Jiri Tyr <jiri.tyr@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free So... | gpl-3.0 |
pepetreshere/odoo | addons/purchase/models/product.py | 3 | 4510 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models, _
from odoo.addons.base.models.res_partner import WARNING_MESSAGE, WARNING_HELP
from odoo.tools.float_utils import float_round
from dateutil.relativedelta import relativedelta
clas... | agpl-3.0 |
nubjs/nubjs | tools/gyp/pylib/gyp/generator/eclipse.py | 1825 | 17014 | # 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.
"""GYP backend that generates Eclipse CDT settings files.
This backend DOES NOT generate Eclipse CDT projects. Instead, it generates XML
files that can be importe... | mit |
svidela/pyzcasp | pyzcasp/asp/adapters.py | 1 | 3307 | # Copyright (c) 2014, Santiago Videla
#
# This file is part of pyzcasp.
#
# caspo 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.
#
# c... | gpl-3.0 |
kalhartt/pycclone | pycclone/source.py | 1 | 6074 | """
#pycclone.source
Provides a class for handling source files. The primary goal is to create a
generator yielding (docs, code) tuples from a source file.
"""
import logging
import re
import os
import pycclone.utils as utils
import pycclone.languages as languages
try:
from StringIO import StringIO
except ImportE... | mit |
Instagram/django | django/contrib/gis/geos/geometry.py | 230 | 24281 | """
This module contains the 'base' GEOSGeometry object -- all GEOS Geometries
inherit from this object.
"""
# Python, ctypes and types dependencies.
import re
import warnings
from ctypes import addressof, byref, c_double, c_size_t
# super-class for mutable list behavior
from django.contrib.gis.geos.mutable_list imp... | bsd-3-clause |
nicecapj/crossplatfromMmorpgServer | ThirdParty/boost_1_61_0/libs/python/pyste/src/Pyste/SmartFile.py | 54 | 1870 | # Copyright Bruno da Silva de Oliveira 2003. Use, modification and
# distribution is subject to the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
import os
import md5
#=================================================================... | mit |
cube2matrix/Krypton | test/networkx/readwrite/tests/test_gexf.py | 40 | 11473 | #!/usr/bin/env python
from nose.tools import *
from nose import SkipTest
import networkx as nx
import io
class TestGEXF(object):
@classmethod
def setupClass(cls):
try:
import xml.etree.ElementTree
except ImportError:
raise SkipTest('xml.etree.ElementTree not available.')... | gpl-2.0 |
bfontaine/alfred-pp | alp/request/bs4/builder/__init__.py | 2 | 11112 | from collections import defaultdict
import itertools
import sys
from alp.request.bs4.element import (
CharsetMetaAttributeValue,
ContentMetaAttributeValue,
whitespace_re
)
__all__ = [
'HTMLTreeBuilder',
'SAXTreeBuilder',
'TreeBuilder',
'TreeBuilderRegistry',
]
# Some useful feature... | mit |
mavit/ansible | lib/ansible/modules/monitoring/zabbix/zabbix_maintenance.py | 50 | 12826 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Alexander Bulimov <lazywolf0@gmail.com>
# 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.... | gpl-3.0 |
KaranToor/MA450 | google-cloud-sdk/.install/.backup/lib/surface/app/create.py | 6 | 2388 | # Copyright 2016 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 |
googleapis/googleapis-gen | google/ads/googleads/v8/googleads-py/google/ads/googleads/v8/enums/types/campaign_serving_status.py | 1 | 1207 | # -*- 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 |
openstack/congress | thirdparty/antlr3-antlr-3.5/runtime/Python3/ez_setup.py | 103 | 15757 | #!python
"""Bootstrap distribute installation
If you want to use setuptools in your package's setup.py, just include this
file in the same directory with it, and add this to the top of your setup.py::
from distribute_setup import use_setuptools
use_setuptools()
If you want to require a specific version of se... | apache-2.0 |
takis/odoo | addons/product_visible_discount/__openerp__.py | 260 | 2082 | ##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public L... | agpl-3.0 |
kenshay/ImageScript | ProgramData/SystemFiles/Python/tcl/tix8.4.3/pref/WmDefault.py | 66 | 3501 | # -*- mode: python; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
#
# $Id: WmDefault.py,v 1.2 2001/12/09 05:03:09 idiscovery Exp $
#
"""One of the bad things about Tk/Tkinter is that it does not pick up
the current color and font scheme from the prevailing CDE/KDE/GNOME/Windows
window manager scheme.
... | gpl-3.0 |
zmarano/compute-image-packages | packages/python-google-compute-engine/google_compute_engine/distro_lib/el_7/tests/utils_test.py | 6 | 6925 | #!/usr/bin/python
# Copyright 2018 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 appli... | apache-2.0 |
kawamon/hue | desktop/core/ext-py/boto-2.46.1/boto/ec2/instancestatus.py | 181 | 6854 | # Copyright (c) 2012 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2012 Amazon.com, Inc. or its affiliates.
# All Rights Reserved
#
# 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... | apache-2.0 |
yavalvas/yav_com | build/matplotlib/lib/matplotlib/dviread.py | 11 | 33923 | """
An experimental module for reading dvi files output by TeX. Several
limitations make this not (currently) useful as a general-purpose dvi
preprocessor, but it is currently used by the pdf backend for
processing usetex text.
Interface::
dvi = Dvi(filename, 72)
# iterate over pages (but only one page is support... | mit |
Razzeee/xbmc | lib/gtest/test/gtest_xml_outfiles_test.py | 2526 | 5340 | #!/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-2.0 |
XXLRay/linux-2.6.32-rhel6.x86_64 | scripts/tracing/draw_functrace.py | 14676 | 3560 | #!/usr/bin/python
"""
Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com>
Licensed under the terms of the GNU GPL License version 2
This script parses a trace provided by the function tracer in
kernel/trace/trace_functions.c
The resulted trace is processed into a tree to produce a more human
view of the call ... | gpl-2.0 |
jcassee/django-geckoboard | django_geckoboard/decorators.py | 1 | 18337 | """
Geckoboard decorators.
"""
from __future__ import absolute_import
from collections import OrderedDict
from functools import wraps
from hashlib import md5
from xml.dom.minidom import Document
import base64
import json
from Crypto import Random
from Crypto.Cipher import AES
from django.conf import settings
from dja... | mit |
jmighion/ansible | lib/ansible/modules/cloud/ovirt/ovirt_mac_pools.py | 73 | 5430 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 Red Hat, Inc.
#
# 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
#... | gpl-3.0 |
jasimpson/gnuradio-jasimpson | gnuradio-examples/python/multi-antenna/multi_scope.py | 10 | 4945 | #!/usr/bin/env python
from gnuradio import gr, gru, eng_notation
from gnuradio import usrp
from gnuradio.eng_option import eng_option
from gnuradio import eng_notation
from gnuradio import optfir
from optparse import OptionParser
from gnuradio.wxgui import stdgui2, fftsink2, waterfallsink2, scopesink2, form, slider
im... | gpl-3.0 |
GeyerA/android_external_chromium_org | tools/clang/scripts/update.py | 83 | 1186 | #!/usr/bin/env python
# Copyright (c) 2012 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.
"""Windows can't run .sh files, so this is a small python wrapper around
update.sh.
"""
import os
import subprocess
import sys
d... | bsd-3-clause |
jart/tensorflow | tensorflow/contrib/eager/python/evaluator.py | 26 | 13672 | # Copyright 2017 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 |
eukaryote/asn1crypto | asn1crypto/_win/_ws2_32.py | 1 | 2000 | # coding: utf-8
from __future__ import unicode_literals, division, absolute_import, print_function
import socket
from .._ffi import (
buffer_from_bytes,
bytes_from_buffer,
cast_void_p,
FFIEngineError,
is_null,
string_from_buffer,
unicode_buffer,
)
try:
from ._ws2_32_cffi import ws2_32... | mit |
PLOS/allofplos | allofplos/elements/license.py | 1 | 5138 | import lxml.etree as et
import re
# Creative Commons links
xlink_href = '{http://www.w3.org/1999/xlink}href'
cc_by_4_link = 'https://creativecommons.org/licenses/by/4.0/'
cc_by_3_link = 'https://creativecommons.org/licenses/by/3.0/'
cc0_link = 'https://creativecommons.org/publicdomain/zero/1.0/'
cc_by_3_igo_link = 'ht... | mit |
JuezUN/INGInious | inginious/frontend/pages/course_admin/aggregation_info.py | 1 | 2947 | # -*- coding: utf-8 -*-
#
# This file is part of INGInious. See the LICENSE and the COPYRIGHTS files for
# more information about the licensing of this file.
import web
from bson.objectid import ObjectId
from inginious.frontend.pages.course_admin.utils import make_csv, INGIniousAdminPage
class CourseAggregationInf... | agpl-3.0 |
2mny/mylar | lib/js2py/legecy_translators/constants.py | 53 | 10888 | from string import ascii_lowercase, digits
##################################
StringName = u'PyJsConstantString%d_'
NumberName = u'PyJsConstantNumber%d_'
RegExpName = u'PyJsConstantRegExp%d_'
##################################
ALPHAS = set(ascii_lowercase+ ascii_lowercase.upper())
NUMS = set(digits)
IDENTIFIER_START = ... | gpl-3.0 |
ajtowns/bitcoin | test/functional/wallet_import_with_label.py | 43 | 4728 | #!/usr/bin/env python3
# Copyright (c) 2018-2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the behavior of RPC importprivkey on set and unset labels of
addresses.
It tests different cases ... | mit |
edxnercel/edx-platform | lms/djangoapps/instructor/tests/test_access.py | 46 | 6280 | """
Test instructor.access
"""
from nose.tools import raises
from nose.plugins.attrib import attr
from student.tests.factories import UserFactory
from xmodule.modulestore.tests.factories import CourseFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from student.roles import CourseBetaTes... | agpl-3.0 |
andoma/PSL1GHT | tools/PS3Py/fself.py | 6 | 7334 | #!/usr/bin/env python
from __future__ import with_statement
from Struct import Struct
import struct
import getopt
import sys
"""
This is a quick and dirty implementation of make_fself based on the
documentation collected here:
http://ps3wiki.lan.st/index.php/Self_file_format
It's not ment to look pretty, or be we... | mit |
crowdresearch/crowdsource-platform | crowdsourcing/viewsets/message.py | 3 | 8166 | import ast
import json
from django.db.models import Q
from django.utils import timezone
from rest_framework import status, viewsets, mixins, serializers
from rest_framework.decorators import list_route, detail_route
from rest_framework.permissions import IsAuthenticated
from rest_framework.response import Response
fro... | mit |
KDAB/KDAB-Creator | src/libs/3rdparty/botan/doc/scripts/primes.py | 14 | 1164 | #!/usr/bin/env python
import sys
def gcd(x,y):
if x <= 0 or y <= 0:
raise ValueError, "Arguments must be positive integers"
g = y
while x > 0:
g = x
x = y % x
y = g
return g
def gen_primes():
primes = [2,3,5,7,11]
# Primes < 11351 fit into less than 256x64 bit... | lgpl-2.1 |
signed/intellij-community | python/testData/inspections/PyUnresolvedReferencesInspection/importExceptImportError.py | 61 | 1352 | # PY-3639
def f(x):
from <error descr="Unresolved reference 'foo'">foo</error> import <error descr="Unresolved reference 'StringIO'">StringIO</error>
return StringIO(x)
def f(x):
try:
from <error descr="Unresolved reference 'foo'">foo</error> import <warning descr="Module 'StringIO' not found">Stri... | apache-2.0 |
akash1808/nova | nova/tests/unit/scheduler/filters/test_ram_filters.py | 38 | 4123 | # 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
# d... | apache-2.0 |
ajaybhat/scikit-image | skimage/filters/tests/test_thresholding.py | 3 | 11224 | import numpy as np
from numpy.testing import (assert_equal,
assert_almost_equal,
assert_raises)
import skimage
from skimage import data
from skimage._shared._warnings import expected_warnings
from skimage.filters.thresholding import (threshold_adaptive,
... | bsd-3-clause |
l11x0m7/Paper | Modulation/code/signal_analysis.py | 1 | 7322 | # -*- encoding:utf-8 -*-
import os
import sys
import logging
from copy import deepcopy
from matplotlib import pyplot as plt
import numpy as np
from sklearn.model_selection import train_test_split
reload(sys)
def drawModulation(dirpath, rownum=200):
"""信号文件绘图
:param filepath: 需要显示绘图的信号文件路径
:return: None
... | apache-2.0 |
ilsawa/p2pool-dgb-groestl | SOAPpy/Errors.py | 294 | 3002 | """
################################################################################
#
# SOAPpy - Cayce Ullman (cayce@actzero.com)
# Brian Matthews (blm@actzero.com)
# Gregory Warnes (Gregory.R.Warnes@Pfizer.com)
# Christopher Blunck (blunck@gst.com)
#
##########################... | gpl-3.0 |
synmnstr/flexx | flexx/ui/_panel.py | 21 | 1321 | """
Simple example:
.. UIExample:: 100
with ui.Panel(title='This is a panel'):
with ui.VBox():
ui.ProgressBar(value=0.2)
ui.Button(text='click me')
Interactive example:
.. UIExample:: 100
from flexx import app, ui, react
class Example(ui.Panel):
def ini... | bsd-2-clause |
newerthcom/savagerebirth | libs/python-2.72/Lib/encodings/iso8859_10.py | 593 | 13845 | """ Python Character Mapping Codec iso8859_10 generated from 'MAPPINGS/ISO8859/8859-10.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... | gpl-2.0 |
Andrew-Katcha/storyteller | env/lib/python3.4/site-packages/pip/utils/glibc.py | 350 | 2939 | from __future__ import absolute_import
import re
import ctypes
import platform
import warnings
def glibc_version_string():
"Returns glibc version string, or None if not using glibc."
# ctypes.CDLL(None) internally calls dlopen(NULL), and as the dlopen
# manpage says, "If filename is NULL, then the retur... | mit |
Ethan-Zhang/mownfish | mownfish/util/commonutils.py | 2 | 1042 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2012 Ethan Zhang<http://github.com/Ethan-Zhang>
#
# 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/licen... | apache-2.0 |
areski/django | django/utils/version.py | 16 | 2448 | from __future__ import unicode_literals
import datetime
import os
import subprocess
from django.utils.lru_cache import lru_cache
def get_version(version=None):
"Returns a PEP 386-compliant version number from VERSION."
version = get_complete_version(version)
# Now build the two parts of the version num... | bsd-3-clause |
ddy88958620/lib | Python/scrapy/outillage/debonix_spider.py | 2 | 3683 | import re
import json
import urllib
from scrapy.spider import BaseSpider
from scrapy.selector import HtmlXPathSelector
from scrapy.http import Request, FormRequest, HtmlResponse
from scrapy.utils.response import get_base_url
from scrapy.utils.url import urljoin_rfc
from scrapy import log
from productloader import lo... | apache-2.0 |
karllessard/tensorflow | tensorflow/python/dlpack/dlpack.py | 9 | 2150 | # Copyright 2020 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 |
dana-i2cat/felix | ofam/src/src/foam/sfa/rspecs/sfa_rspec_converter.py | 3 | 4170 | #!/usr/bin/python
from foam.sfa.util.xrn import hrn_to_urn
from foam.sfa.rspecs.rspec import RSpec
from foam.sfa.rspecs.version_manager import VersionManager
class SfaRSpecConverter:
@staticmethod
def to_pg_rspec(rspec, content_type = None):
if not isinstance(rspec, RSpec):
sfa_rspec = RS... | apache-2.0 |
sergeLabo/wikikIRC3 | irc/client.py | 16 | 45821 | # -*- coding: utf-8 -*-
# Copyright (C) 1999-2002 Joel Rosdahl
# Copyright © 2011-2013 Jason R. Coombs
"""
Internet Relay Chat (IRC) protocol client library.
This library is intended to encapsulate the IRC protocol at a quite
low level. It provides an event-driven IRC client framework. It has
a fairly thorough su... | gpl-2.0 |
gbadali/dark-geography-726 | lib/flask/sessions.py | 348 | 12882 | # -*- coding: utf-8 -*-
"""
flask.sessions
~~~~~~~~~~~~~~
Implements cookie based sessions based on itsdangerous.
:copyright: (c) 2012 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import uuid
import hashlib
from datetime import datetime
from werkzeug.http import http_date, ... | apache-2.0 |
centricular/meson | mesonbuild/dependencies.py | 1 | 52213 | # Copyright 2013-2015 The Meson development team
# 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 agree... | apache-2.0 |
11mariom/sensu-checks | unifi/unifi-get-stats.py | 1 | 1510 | #!/usr/bin/env python
#
# Get stats from a Unifi AP controller using the API
#
# Requires the unifi python module
#
import argparse
import json
from unifi.controller import Controller
parser = argparse.ArgumentParser()
parser.add_argument('-c', '--controller', default='unifi', help='the controller address (default "... | gpl-2.0 |
ChinaQuants/Finance-Python | PyFin/tests/testSuite.py | 2 | 2696 | # -*- coding: utf-8 -*-
u"""
Created on 2015-7-13
@author: cheng.li
"""
from simpleutils import add_parent_path
add_parent_path(__file__, 3)
from simpleutils import TestRunner
from simpleutils import CustomLogger
import PyFin.tests.api as api
import PyFin.tests.Analysis as Analysis
import PyFin.tests.CashFlows as C... | mit |
philvoyer/ANI2012A17 | Module09/EXE04/ANI2012A17_Locator.py | 1 | 6945 | # ANI2102A17_Locator.py | Programmation Python avec Maya | coding=utf-8
# Génération d'une représentation visuelle d'un localisateur à partir d'une arborescence de primitives géométriques (sphère, cylindre, cube).
print "\n<début de l'exécution>\n"
# paramètres du programme
# facteur de dimensionnement
scaleFactor =... | mit |
attakei/hieroglyph | src/hieroglyph/__init__.py | 1 | 2964 | import unicodedata
from hieroglyph import builder
from hieroglyph import directives
from hieroglyph import html
from hieroglyph import slides
def version():
"""Return the installed package version."""
import pkg_resources
return pkg_resources.get_distribution('hieroglyph').version
def setup(app):
... | bsd-3-clause |
grantila/q | 3rdparty/gtest-1.8.0/test/gtest_filter_unittest.py | 364 | 21325 | #!/usr/bin/env python
#
# Copyright 2005 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... | apache-2.0 |
rajalokan/keystone | keystone/token/persistence/backends/sql.py | 1 | 12167 | # 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... | apache-2.0 |
marcusrehm/serenata-de-amor | research/src/fetch_cnpj_info.py | 2 | 12631 | from concurrent import futures
import json
import argparse
import time
import random
import itertools
import numpy as np
import os.path
import sys
import pandas as pd
import shutil
import requests
import requests.exceptions
import re
import logging
import json
from datetime import datetime, timedelta
LOGGER_NAME = 'fe... | mit |
decebel/librosa | librosa/filters.py | 2 | 24021 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Filters
=======
Filter bank construction
------------------------
.. autosummary::
:toctree: generated/
dct
mel
chroma
constant_q
Miscellaneous
-------------
.. autosummary::
:toctree: generated/
constant_q_lengths
cq_to_chroma
wi... | isc |
yohanko88/gem5-DC | src/cpu/testers/memtest/MemTest.py | 40 | 3761 | # Copyright (c) 2015 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the functionality ... | bsd-3-clause |
leereilly/django-1 | django/contrib/gis/admin/widgets.py | 10 | 4344 | from django.forms.widgets import Textarea
from django.template import loader, Context
from django.templatetags.static import static
from django.utils import translation
from django.contrib.gis.gdal import OGRException
from django.contrib.gis.geos import GEOSGeometry, GEOSException
# Creating a template context that c... | bsd-3-clause |
smdabdoub/phylotoast | bin/filter_ambiguity.py | 2 | 3638 | '''
Created on Dec 6, 2012
Author: Shareef M. Dabdoub
'''
import sys
try:
from Bio import SeqIO
except ImportError as ie:
sys.exit('Import Error. Please install missing module: {}'.format(ie))
import argparse
from Bio import SeqIO
from Bio.Seq import Seq
def filter_ambiguity(records, percent=0.5): # , repea... | mit |
it-depends/CPSG-ML | books/PCI/Original/PCI_Code/chapter10/clusters.py | 4 | 6568 | import random
import math
from math import sqrt
from PIL import Image,ImageDraw,ImageFont
# Returns the Pearson correlation coefficient for p1 and p2
def pearson(v1,v2):
# Simple sums
sum1=sum(v1)
sum2=sum(v2)
# Sums of the squares
sum1Sq=sum([pow(v,2) for v in v1])
sum2Sq=sum([pow(v,2) for v in v2])
... | mit |
jmesteve/openerp | openerp/addons/account_balance_reporting/account_balance_reporting_report.py | 1 | 21960 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP - Account balance reporting engine
# Copyright (C) 2009 Pexego Sistemas Informáticos. All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# it... | agpl-3.0 |
resamsel/dbnavigator | src/dbmanagr/command/executer/args.py | 2 | 3129 | # -*- coding: utf-8 -*-
#
# Copyright © 2014 René Samselnig
#
# This file is part of Database Navigator.
#
# Database Navigator 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 |
jinnykoo/christmas | src/oscar/apps/dashboard/ranges/south_migrations/0001_initial.py | 17 | 17668 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
from oscar.core.compat import AUTH_USER_MODEL, AUTH_USER_MODEL_NAME
class Migration(SchemaMigration):
depends_on = (
('catalogue', '0001_initial'),
('offer', '0001_initial'),... | bsd-3-clause |
Microvellum/Fluid-Designer | win64-vc/2.78/scripts/presets/keyconfig/3dsmax.py | 4 | 135259 | # Configuration 3dsmax
import bpy
wm = bpy.context.window_manager
kc = wm.keyconfigs.new('3dsmax')
# Map Window
km = kc.keymaps.new('Window', space_type='EMPTY', region_type='WINDOW', modal=False)
kmi = km.keymap_items.new('wm.window_duplicate', 'W', 'PRESS', ctrl=True, alt=True)
kmi = km.keymap_items.new('wm.read_h... | gpl-3.0 |
richardotis/pycalphad-fitting | fit.py | 1 | 2193 | """
Automated fitting script.
"""
import os
import sys
import fnmatch
import argparse
import logging
import multiprocessing
from paramselect import fit, load_datasets
from distributed import Client, LocalCluster
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument(
"--dask-scheduler",
met... | mit |
carlosdiazsuarez/movierecommender | MovieRecommender/connectors/virtuoso/virtuoso_connector2.py | 1 | 18109 | '''
Created on Apr 14, 2015
@author: Jaime
'''
from SPARQLWrapper import SPARQLExceptions
from SPARQLWrapper.Wrapper import SPARQLWrapper, POST
import urllib2
import sparql
class virtuoso_connector(object):
'''
classdocs
'''
global VIRTUOSO_SPARQL_ENDPOINT
global handler
global opener
... | gpl-2.0 |
kevin8909/xjerp | openerp/addons/procurement/__openerp__.py | 62 | 2870 | # -*- 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 |
timkrentz/SunTracker | IMU/VTK-6.2.0/ThirdParty/Twisted/twisted/internet/_pollingfile.py | 2 | 9194 | # -*- test-case-name: twisted.internet.test.test_pollingfile -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Implements a simple polling interface for file descriptors that don't work with
select() - this is pretty much only useful on Windows.
"""
from zope.interface import im... | mit |
pam-bot/SMSQuery | lib/jinja/utils.py | 7 | 19304 | # -*- coding: utf-8 -*-
"""
jinja.utils
~~~~~~~~~~~
Utility functions.
**license information**: some of the regular expressions and
the ``urlize`` function were taken from the django framework.
:copyright: 2007 by Armin Ronacher, Lawrence Journal-World.
:license: BSD, see LICENSE for more... | gpl-2.0 |
hyqneuron/pylearn2-maxsom | pylearn2/scripts/datasets/browse_norb.py | 44 | 15741 | #!/usr/bin/env python
"""
A browser for the NORB and small NORB datasets. Navigate the images by
choosing the values for the label vector. Note that for the 'big' NORB
dataset, you can only set the first 5 label dimensions. You can then cycle
through the 3-12 images that fit those labels.
"""
import sys
import os
imp... | bsd-3-clause |
JeremyMorgan/Raspberry_Pi_Temperature | temp-humidity.py | 1 | 1864 | import os
import glob
import subprocess
import calendar
import time
import urllib2
import json
import Adafruit_DHT
#initialize
os.system('modprobe w1-gpio')
os.system('modprobe w1-therm')
sensor = Adafruit_DHT.DHT22
pin = 8
#Temperature device
base_dir = '/sys/bus/w1/devices/'
device_folder = glob.glob(base_dir + '28... | gpl-2.0 |
cnsoft/kbengine-cocos2dx | kbe/src/lib/python/Lib/unittest/test/_test_warnings.py | 51 | 2314 | # helper module for test_runner.Test_TextTestRunner.test_warnings
"""
This module has a number of tests that raise different kinds of warnings.
When the tests are run, the warnings are caught and their messages are printed
to stdout. This module also accepts an arg that is then passed to
unittest.main to affect the b... | lgpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.