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 |
|---|---|---|---|---|---|
xyguo/scikit-learn | examples/decomposition/plot_image_denoising.py | 70 | 6249 | """
=========================================
Image denoising using dictionary learning
=========================================
An example comparing the effect of reconstructing noisy fragments
of a raccoon face image using firstly online :ref:`DictionaryLearning` and
various transform methods.
The dictionary is fi... | bsd-3-clause |
PaulWay/insights-core | insights/parsers/date.py | 1 | 3048 | """
date - Command
==============
This module provides processing for the output of the ``date`` command.
The specs handled by this command inlude::
"date" : CommandSpec("/bin/date"),
"date_utc" : CommandSpec("/bin/date --utc"),
Class ``Date`` parses the output of the ``... | apache-2.0 |
spaceof7/QGIS | tests/src/python/test_qgsserver_wfst.py | 4 | 12268 |
# -*- coding: utf-8 -*-
"""
Tests for WFS-T provider using QGIS Server through qgis_wrapped_server.py.
This is an integration test for QGIS Desktop WFS-T provider and QGIS Server
WFS-T that check if QGIS can talk to and uderstand itself.
The test uses testdata/wfs_transactional/wfs_transactional.qgs and three
initia... | gpl-2.0 |
KellyChan/Python | python/data_science/NYC/analysis3_predictions.py | 3 | 3515 | import numpy as np
import pandas
def normalize_features(array):
"""
Normalize the features in our data set.
"""
array_normalized = (array-array.mean())/array.std()
mu = array.mean()
sigma = array.std()
return array_normalized, mu, sigma
def compute_cost(features, values, theta):
"""
Comp... | mit |
ihciah/xk-database | views/admin.py | 1 | 5958 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from flask import Blueprint
from flask import g, request, flash
from flask import render_template, redirect
from models import Student,Account,Course,Xk,Teacher
from forms import SearchStudentFrom,adminProfileForm,UserProfileForm,SearchForm,CourseEditForm,UseraddForm
from ... | gpl-2.0 |
xiang12835/python_web | py2_web2py/web2py/gluon/packages/dal/pydal/representers/postgre.py | 3 | 1368 | from ..adapters.postgres import Postgre, PostgreNew
from .base import SQLRepresenter, JSONRepresenter
from . import representers, before_type, for_type
from ..helpers.serializers import serializers
@representers.register_for(Postgre)
class PostgreRepresenter(SQLRepresenter, JSONRepresenter):
def _make_geoextra(se... | apache-2.0 |
PhilWhitehurst/long-distance | node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-2.7/pygments/lexers/_asybuiltins.py | 369 | 27319 | # -*- coding: utf-8 -*-
"""
pygments.lexers._asybuiltins
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This file contains the asy-function names and asy-variable names of
Asymptote.
Do not edit the ASYFUNCNAME and ASYVARNAME sets by hand.
TODO: perl/python script in Asymptote SVN similar to asy-list.pl but onl... | mit |
ccmbioinfo/mugqic_pipelines | bfx/trimmomatic.py | 1 | 3305 | #!/usr/bin/env python
################################################################################
# Copyright (C) 2014, 2015 GenAP, McGill University and Genome Quebec Innovation Centre
#
# This file is part of MUGQIC Pipelines.
#
# MUGQIC Pipelines is free software: you can redistribute it and/or modify
# it und... | lgpl-3.0 |
hstau/manifold-cryo | fit_1D_open_manifold_3D.py | 1 | 5015 | import numpy as np
import get_fit_1D_open_manifold_3D_param
import solve_d_R_d_tau_p_3D
import a
from scipy.io import loadmat
import matplotlib.pyplot as plt
#import matplotlib.pyplot as plt
'''
function [a,b,tau] = fit_1D_open_manifold_3D(psi)
%
% fit_1D_open_manifold_3D
%
% fit the eigenvectors for ... | gpl-2.0 |
mfriedenhagen/Diamond | src/collectors/diskusage/diskusage.py | 15 | 10468 | # coding=utf-8
"""
Collect IO Stats
Note: You may need to artificially generate some IO load on a disk/partition
before graphite will generate the metrics.
* http://www.kernel.org/doc/Documentation/iostats.txt
#### Dependencies
* /proc/diskstats
"""
import diamond.collector
import diamond.convertor
import time... | mit |
NotBobTheBuilder/cairocffi | utils/mkconstants.py | 2 | 2285 | # coding: utf8
import os
import sys
import re
import pycparser.c_generator
def parse_constant(node):
if isinstance(node, pycparser.c_ast.Constant):
return node.value
elif isinstance(node, pycparser.c_ast.UnaryOp) and node.op == '-':
return '-' + parse_constant(node.expr)
else:
rais... | bsd-3-clause |
tchellomello/home-assistant | homeassistant/components/dsmr/__init__.py | 1 | 1324 | """The dsmr component."""
import asyncio
from asyncio import CancelledError
import logging
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from .const import DATA_TASK, DOMAIN, PLATFORMS
_LOGGER = logging.getLogger(__name__)
async def async_setup(hass, config: dict... | apache-2.0 |
mxm/incubator-beam | .test-infra/metrics/sync/github/queries.py | 14 | 2707 | #
# 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 |
jmcarp/osf.io | scripts/analytics/addons.py | 21 | 2200 | # -*- coding: utf-8 -*-
import os
import re
import matplotlib.pyplot as plt
from framework.mongo import database
from website import settings
from website.app import init_app
from .utils import plot_dates, oid_to_datetime, mkdirp
log_collection = database['nodelog']
FIG_PATH = os.path.join(settings.ANALYTICS_PATH... | apache-2.0 |
farhaanbukhsh/junction | junction/proposals/migrations/0014_auto_20150729_0131.py | 6 | 2120 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import datetime
class Migration(migrations.Migration):
dependencies = [
('proposals', '0013_proposalcomment_vote'),
]
operations = [
migrations.RemoveField(
model_name='p... | mit |
tjmonsi/cmsc129-2016-repo | submissions/exercise4/pitargue/interpreter/syntax_analyzer.py | 1 | 33315 | from . import evaluate
class Parser():
def __init__(self, variables):
self.lexemes = []
self.lookahead = None
self.tokens = []
self.parse_tree = []
self.variables = variables
self.types = {
'TRUE_KEYWORD': 'boolean',
'FALSE_KEYWORD': 'boolean... | mit |
vvv1559/intellij-community | python/lib/Lib/site-packages/django/conf/global_settings.py | 73 | 20942 | # Default Django settings. Override these with settings in the module
# pointed-to by the DJANGO_SETTINGS_MODULE environment variable.
# This is defined here as a do-nothing function because we can't import
# django.utils.translation -- that module depends on the settings.
gettext_noop = lambda s: s
#################... | apache-2.0 |
avedaee/DIRAC | WorkloadManagementSystem/Client/JobState/CachedJobState.py | 7 | 13123 |
import types, copy, time
from DIRAC.Core.Utilities import Time, DEncode
from DIRAC import S_OK, S_ERROR, gLogger
from DIRAC.WorkloadManagementSystem.Client.JobState.JobState import JobState
from DIRAC.WorkloadManagementSystem.Client.JobState.JobManifest import JobManifest
class CachedJobState( object ):
log = gLog... | gpl-3.0 |
all-of-us/raw-data-repository | rdr_service/lib_fhir/fhirclient_4_0_0/models/activitydefinition_tests.py | 1 | 30643 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07.
# 2019, SMART Health IT.
import os
import io
import unittest
import json
from . import activitydefinition
from .fhirdate import FHIRDate
class ActivityDefinitionTests(unittest.TestCase):
def instantiate_from(... | bsd-3-clause |
akazakov/ansible-modules-core | windows/win_feature.py | 96 | 2770 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Paul Durivage <paul.durivage@rackspace.com>, Trond Hindenes <trond@hindenes.com> and others
#
# 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
#... | gpl-3.0 |
shuheik/dynet | examples/python-utils/util.py | 14 | 1731 | import mmap
class Vocab:
def __init__(self, w2i):
self.w2i = dict(w2i)
self.i2w = {i:w for w,i in w2i.items()}
@classmethod
def from_corpus(cls, corpus):
w2i = {}
for sent in corpus:
for word in sent:
w2i.setdefault(word, len(w2i))
return... | apache-2.0 |
ihipi/FreeCAD_drawing_dimensioning | crudeDebugger.py | 3 | 2537 | '''
Python Code for generating crude debugging functionality for the Dimensioning FreeCAD module.
'''
import os, sys
__dir__ = os.path.dirname(__file__)
debug_output_directory = os.path.join( __dir__ , 'crudeDebugger_output' )
if not os.path.exists(debug_output_directory):
os.mkdir(debug_output_directory)
sys.pa... | gpl-3.0 |
40223202/2015cdb_g2 | static/Brython3.1.1-20150328-091302/Lib/_sre.py | 622 | 51369 | # NOT_RPYTHON
"""
A pure Python reimplementation of the _sre module from CPython 2.4
Copyright 2005 Nik Haldimann, licensed under the MIT license
This code is based on material licensed under CNRI's Python 1.6 license and
copyrighted by: Copyright (c) 1997-2001 by Secret Labs AB
"""
MAXREPEAT = 2147483648
#import ar... | gpl-3.0 |
gdub/django | tests/custom_methods/models.py | 343 | 1265 | """
Giving models custom methods
Any method you add to a model will be available to instances.
"""
import datetime
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Article(models.Model):
headline = models.CharField(max_length=100)
... | bsd-3-clause |
nerzhul/ansible | lib/ansible/modules/cloud/cloudstack/cs_region.py | 39 | 5794 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2016, René Moser <mail@renemoser.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 3 of the Lice... | gpl-3.0 |
XiaosongWei/chromium-crosswalk | native_client_sdk/src/build_tools/build_projects.py | 6 | 11073 | #!/usr/bin/env python
# Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import argparse
import multiprocessing
import os
import posixpath
import sys
import urllib2
import buildbot_common
import build_ve... | bsd-3-clause |
gauribhoite/personfinder | tests/test_resources.py | 15 | 13978 | #!/usr/bin/python2.7
# encoding: utf-8
# Copyright 2011 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 ... | apache-2.0 |
icyflame/batman | tests/flow_tests.py | 1 | 7876 | # -*- coding: utf-8 -*-
"""Tests for the flow module."""
#
# (C) Pywikibot team, 2015
#
# Distributed under the terms of the MIT license.
#
from __future__ import absolute_import, unicode_literals
__version__ = '$Id$'
from pywikibot.exceptions import NoPage
from pywikibot.flow import Board, Topic, Post
from pywikibo... | mit |
rahulunair/nova | nova/api/openstack/compute/__init__.py | 10 | 1079 | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# 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 ... | apache-2.0 |
jimmykiselak/lbrycrd | qa/rpc-tests/maxblocksinflight.py | 1 | 3782 | #!/usr/bin/env python2
# Copyright (c) 2015 The Bitcoin Core developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
from test_framework.mininode import *
from test_framework.test_framework import BitcoinTestFramework
fro... | mit |
eerohele/sublime-lxml | st3_linux_x32/lxml/html/clean.py | 23 | 26363 | """A cleanup tool for HTML.
Removes unwanted tags and content. See the `Cleaner` class for
details.
"""
import re
import copy
try:
from urlparse import urlsplit
except ImportError:
# Python 3
from urllib.parse import urlsplit
from lxml import etree
from lxml.html import defs
from lxml.html import fromstr... | mit |
mxOBS/deb-pkg_trusty_chromium-browser | native_client/src/trusted/validator_mips/dgen/dgen_output.py | 10 | 6133 | #!/usr/bin/python
#
# Copyright (c) 2012 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Copyright 2012, Google Inc.
#
"""
Responsible for generating the decoder based on parsed table representations.
"""
import dg... | bsd-3-clause |
ddki/my_study_project | language/python/frameworks/flask/venv/lib/python2.7/site-packages/pip/_vendor/packaging/specifiers.py | 1107 | 28025 | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
import abc
import functools
import itertools
import re
from ._compat impo... | mit |
bgammill/namebench | nb_third_party/simplejson/encoder.py | 296 | 18214 | """Implementation of JSONEncoder
"""
import re
from decimal import Decimal
def _import_speedups():
try:
from simplejson import _speedups
return _speedups.encode_basestring_ascii, _speedups.make_encoder
except ImportError:
return None, None
c_encode_basestring_ascii, c_make_encoder = _im... | apache-2.0 |
Comunitea/l10n-spain | l10n_es_payment_order_confirming_popular/models/payment_mode.py | 5 | 1280 | # -*- coding: utf-8 -*-
# (c) 2016 Soluntec Proyectos y Soluciones TIC. - Rubén Francés , Nacho Torró
# (c) 2015 Serv. Tecnol. Avanzados - Pedro M. Baeza
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from openerp import models, fields, api
class PaymentMode(models.Model):
_inherit = "payment.m... | agpl-3.0 |
pe-suke/ansible | lib/ansible/vars/__init__.py | 3 | 16447 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | gpl-3.0 |
lonvia/waymarked-trails-site | db/routes_maptype.py | 2 | 6030 | # This file is part of the Waymarked Trails Map Project
# Copyright (C) 2018 Sarah Hoffmann
#
# This 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 any later version.
#
#... | gpl-3.0 |
StormTrooper/osmc | package/mediacenter-skin-osmc/files/usr/share/kodi/addons/script.module.unidecode/lib/unidecode/x098.py | 252 | 4645 | data = (
'Hu ', # 0x00
'Ye ', # 0x01
'Ding ', # 0x02
'Qing ', # 0x03
'Pan ', # 0x04
'Xiang ', # 0x05
'Shun ', # 0x06
'Han ', # 0x07
'Xu ', # 0x08
'Yi ', # 0x09
'Xu ', # 0x0a
'Gu ', # 0x0b
'Song ', # 0x0c
'Kui ', # 0x0d
'Qi ', # 0x0e
'Hang ', # 0x0f
'Yu ', # 0x10
'Wan '... | gpl-2.0 |
ChawalitK/odoo | addons/base_gengo/controller/gengo_callback.py | 362 | 2326 | # -*- coding: utf-8 -*-
import openerp
from openerp import SUPERUSER_ID
from openerp.addons.web import http
from openerp.addons.web.http import request
from werkzeug.wrappers import BaseResponse as Response
import json
class website_gengo(http.Controller):
def get_gengo_key(self, cr):
icp = request.re... | gpl-3.0 |
PierreBubu/site_web | node-v4.4.7-linux-x64/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja_test.py | 1843 | 1786 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
""" Unit tests for the ninja.py file. """
import gyp.generator.ninja as ninja
import unittest
import StringIO
import sys
import TestCommon
... | bsd-3-clause |
zestrada/nova-cs498cc | nova/tests/network/test_manager.py | 1 | 111961 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 Rackspace
# Copyright (c) 2011 X.commerce, a business unit of eBay 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 t... | apache-2.0 |
blackzw/openwrt_sdk_dev1 | staging_dir/target-mips_r2_uClibc-0.9.33.2/usr/lib/python2.7/test/test_abc.py | 119 | 7715 | # Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Unit tests for abc.py."""
import unittest, weakref
from test import test_support
import abc
from inspect import isabstract
class TestABC(unittest.TestCase):
def test_abstractmethod_basics(self):
@abc... | gpl-2.0 |
hanicker/odoo | addons/mrp/tests/test_multicompany.py | 374 | 2660 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | agpl-3.0 |
botify-labs/mangrove | mangrove/pool.py | 1 | 11546 | from abc import ABCMeta
from multiprocessing import cpu_count
from concurrent.futures import ThreadPoolExecutor
from boto import ec2
from mangrove.declarative import ServiceDeclaration, ServicePoolDeclaration
from mangrove.mappings import ConnectionsMapping
from mangrove.utils import get_boto_module
from mangrove.ex... | mit |
tehamalab/dgs | goals/models.py | 1 | 39889 | import json
from django.db import models
from django.db.models.signals import m2m_changed
from django.dispatch import receiver
from django.core.exceptions import ValidationError
from django.contrib.postgres.fields import HStoreField, ArrayField
from django.utils.translation import ugettext_lazy as _
from django.templat... | unlicense |
hpproliant/ironic | ironic/tests/unit/common/test_keystone.py | 8 | 8140 | # -*- encoding: utf-8 -*-
#
# 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... | apache-2.0 |
androidarmv6/android_external_chromium_org | chrome/common/extensions/docs/server2/schema_util.py | 23 | 3569 | # Copyright 2013 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.
from collections import defaultdict, Mapping
from third_party.json_schema_compiler import json_parse, idl_schema, idl_parser
def RemoveNoDocs(item):
'''... | bsd-3-clause |
woodpecker1/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/common/system/outputtee.py | 192 | 3142 | # Copyright (c) 2009, Google Inc. All rights reserved.
# Copyright (c) 2009 Apple 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 abov... | bsd-3-clause |
mlperf/training_results_v0.6 | NVIDIA/benchmarks/minigo/implementations/tensorflow/minigo/bootstrap.py | 7 | 1411 | # Copyright 2018 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 agreed to in writing, ... | apache-2.0 |
syhost/android_kernel_pantech_ef59l | tools/perf/scripts/python/check-perf-trace.py | 11214 | 2503 | # perf script event handlers, generated by perf script -g python
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# This script tests basic functionality such as flag and symbol
# strings, common_xxx() calls back into perf, begin, end, unhandled
# events, etc. ... | gpl-2.0 |
konstruktoid/ansible-upstream | lib/ansible/plugins/netconf/default.py | 79 | 2030 | #
# (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 |
ddico/odoo | setup/odoo-wsgi.example.py | 28 | 1731 | # WSGI Handler sample configuration file.
#
# Change the appropriate settings below, in order to provide the parameters
# that would normally be passed in the command-line.
# (at least conf['addons_path'])
#
# For generic wsgi handlers a global application is defined.
# For uwsgi this should work:
# $ uwsgi_python --... | agpl-3.0 |
atheendra/access_keys | keystone/tests/test_v3_federation.py | 1 | 58835 | # 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 t... | apache-2.0 |
yiliaofan/faker | faker/providers/person/en/__init__.py | 12 | 86768 | from __future__ import unicode_literals
from .. import Provider as PersonProvider
class Provider(PersonProvider):
formats_female = (
'{{first_name_female}} {{last_name}}',
'{{first_name_female}} {{last_name}}',
'{{first_name_female}} {{last_name}}',
'{{first_name_female}} {{last_na... | mit |
ice9js/servo | etc/servo_gdb.py | 233 | 4284 | # Copyright 2013 The Servo Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
#... | mpl-2.0 |
SravanthiSinha/edx-platform | lms/djangoapps/instructor/management/commands/openended_post.py | 86 | 4626 | """
Command to manually re-post open ended submissions to the grader.
"""
from django.contrib.auth.models import User
from django.core.management.base import BaseCommand
from optparse import make_option
from xmodule.modulestore.django import modulestore
from opaque_keys.edx.locations import SlashSeparatedCourseKey
fro... | agpl-3.0 |
luistorresm/odoo | addons/mail/static/scripts/openerp_mailgate.py | 316 | 7640 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-TODAY OpenERP S.A. (http://www.openerp.com)
#
# This program ... | agpl-3.0 |
RPI-OPENEDX/edx-platform | common/djangoapps/util/keyword_substitution.py | 148 | 2343 | """
keyword_substitution.py
Contains utility functions to help substitute keywords in a text body with
the appropriate user / course data.
Supported:
LMS:
- %%USER_ID%% => anonymous user id
- %%USER_FULLNAME%% => User's full name
- %%COURSE_DISPLAY_NAME%% => display name of the course
... | agpl-3.0 |
jstammers/EDMSuite | EDMScripts/EDMLoop.py | 1 | 21605 | # Import a whole load of stuff
from System.IO import *
from System.Drawing import *
from System.Runtime.Remoting import *
from System.Threading import *
from System.Windows.Forms import *
from System.Xml.Serialization import *
from System import *
from Analysis.EDM import *
from DAQ.Environment import *
fro... | mit |
newerthcom/savagerebirth | libs/python-2.72/Lib/test/test_curses.py | 63 | 8899 | #
# Test script for the curses module
#
# This script doesn't actually display anything very coherent. but it
# does call every method and function.
#
# Functions not tested: {def,reset}_{shell,prog}_mode, getch(), getstr(),
# init_color()
# Only called, not tested: getmouse(), ungetmouse()
#
import sys, tempfile, os
... | gpl-2.0 |
natanlailari/PennApps2015-Heartmates | venv/lib/python2.7/site-packages/werkzeug/posixemulation.py | 147 | 3543 | # -*- coding: utf-8 -*-
r"""
werkzeug.posixemulation
~~~~~~~~~~~~~~~~~~~~~~~
Provides a POSIX emulation for some features that are relevant to
web applications. The main purpose is to simplify support for
systems such as Windows NT that are not 100% POSIX compatible.
Currently this only imple... | apache-2.0 |
mikeschiano/SEVEN | node_modules/node-gyp/gyp/pylib/gyp/MSVSProject.py | 2736 | 6387 | # 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.
"""Visual Studio project reader/writer."""
import gyp.common
import gyp.easy_xml as easy_xml
#-------------------------------------------------------------------... | apache-2.0 |
bobisme/odoo | addons/hr_payroll_account/wizard/__init__.py | 433 | 1116 | #-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# d$
#
# This program is free software: you can redistribute it and/or modify
# ... | agpl-3.0 |
stefanw/django-cms | cms/tests/frontend.py | 11 | 17786 | # -*- coding: utf-8 -*-
import sys
import datetime
import os
import time
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Permission
from django.contrib.sites.models import Site
from django.core.cache import cache
from django.core.urlresolvers import clear_url_caches
from django.te... | bsd-3-clause |
miptliot/edx-platform | lms/djangoapps/lms_migration/management/commands/create_groups.py | 20 | 1794 | #!/usr/bin/python
#
# File: create_groups.py
#
# Create all staff_* groups for classes in data directory.
import os
from django.conf import settings
from django.contrib.auth.models import Group
from django.core.management.base import BaseCommand
from lxml import etree
from path import Path as path
def create_grou... | agpl-3.0 |
Fokko/incubator-airflow | airflow/operators/cassandra_to_gcs.py | 1 | 14378 | # -*- coding: utf-8 -*-
#
# 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
#... | apache-2.0 |
nshearer/etl | src/etl/EtlJoinProcessor.py | 1 | 5333 | '''
Created on Dec 28, 2012
@author: nshearer
'''
from abc import ABCMeta, abstractmethod
from EtlProcessor import EtlProcessor
class EtlJoinProcessor(EtlProcessor):
'''Join one set of records to another'''
def __init__(self):
super(EtlJoinProcessor, self).__init__()
se... | gpl-2.0 |
ULHPC/modules | easybuild/easybuild-easyblocks/easybuild/easyblocks/c/chimera.py | 15 | 1324 | # This file is an EasyBuild reciPY as per https://github.com/hpcugent/easybuild
# Author: Pablo Escobar Lopez
# Swiss Institute of Bioinformatics
# Biozentrum - University of Basel
"""
EasyBuild support for installing Chimera, implemented as an easyblock
"""
import os
from easybuild.framework.easyblock import EasyBlo... | mit |
mattduan/proof | util/UniqueList.py | 1 | 4847 | """
List with unique entries. UniqueList does not allow null nor duplicates.
"""
__version__= '$Revision: 11 $'[11:-2]
__author__ = "Duan Guoqiang (mattgduan@gmail.com)"
class UniqueList(list):
def __init__(self, initlist=[]):
# call super class
list.__init__(self)
# add initlist
... | bsd-3-clause |
paulczar/ursula | library/neutron_network.py | 9 | 10049 | #!/usr/bin/python
#coding: utf-8 -*-
# (c) 2013, Benno Joy <benno@ansibleworks.com>
#
# 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 your option) any l... | mit |
codelv/enaml-native | src/enamlnative/core/eventloop/interface.py | 1 | 2341 | #!/usr/bin/env python
#
# Copyright 2011 Facebook
#
# 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 a... | mit |
SartoNess/BitcoinUnlimited | qa/rpc-tests/merkle_blocks.py | 2 | 4041 | #!/usr/bin/env python2
# Copyright (c) 2014-2015 The Bitcoin Core developers
# Copyright (c) 2015-2016 The Bitcoin Unlimited developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test merkleblock fetch/validation
#
from ... | mit |
flopezag/fiware-backlog | kernel/DataBoard.py | 1 | 5593 | from kconfig import settings
from kconfig import enablersBook, helpdeskCompBook
from kconfig import trackersBook, workGroupBook
from kernel.DataFactory import DataFactory
__author__ = "Manuel Escriche <mev@tid.es>"
class Data:
@staticmethod
def getUrgentDeskUpcoming():
trackers = ','.join(trackersBo... | apache-2.0 |
hfp/tensorflow-xsmm | tensorflow/examples/adding_an_op/zero_out_op_2.py | 190 | 1132 | # 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 |
vvuk/servo | tests/wpt/update/tree.py | 167 | 6560 | # 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 re
import tempfile
from wptrunner import update as wptupdate
from wptrunner.update.tree import Commit, CommitMe... | mpl-2.0 |
nacl-webkit/chrome_deps | tools/code_coverage/croc.py | 178 | 23009 | #!/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.
"""Crocodile - compute coverage numbers for Chrome coverage dashboard."""
import optparse
import os
import platform
import re
impo... | bsd-3-clause |
pydata/numexpr | doc/conf.py | 2 | 10365 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# numexpr documentation build configuration file, created by
# sphinx-quickstart on Sat Feb 4 17:19:36 2017.
#
# 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
# au... | mit |
stanbellcom/webapp_politik | sites/all/modules/annotator/lib/store-plugin/pyenv/lib/python2.7/site-packages/pyes/tests/errors.py | 2 | 2806 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Unit tests for pyes. These require an es server with thrift plugin running on the default port (localhost:9500).
"""
import unittest
from pyes.tests import ESTestCase
import pyes.exceptions
class ErrorReportingTestCase(ESTestCase):
def setUp(self):
super(Error... | gpl-2.0 |
tecan/xchat-rt | plugins/scripts/Supybot-0.83.4.1-bitcoinotc-bot/plugins/Herald/plugin.py | 15 | 9980 | ###
# Copyright (c) 2002-2005, Jeremiah Fincher
# 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 co... | gpl-2.0 |
Tiglas/pickup-planner | request_handler/flask/lib/python2.7/site-packages/pip/utils/hashes.py | 517 | 2866 | from __future__ import absolute_import
import hashlib
from pip.exceptions import HashMismatch, HashMissing, InstallationError
from pip.utils import read_chunks
from pip._vendor.six import iteritems, iterkeys, itervalues
# The recommended hash algo of the moment. Change this whenever the state of
# the art changes; ... | mit |
george-hopkins/frn-py | frn/common/protocol.py | 1 | 2718 | from twisted.protocols import basic
from frn.utils import parse_dict
class InvalidServerResponse(Exception):
pass
class InvalidClientRequest(Exception):
pass
class LineReceiver(basic.LineReceiver):
def decodedLineReceived(self, line):
"""Override this for when each line is received."""
... | lgpl-3.0 |
eoconsulting/django-zoook | django_zoook/tag/views.py | 1 | 4455 | # -*- coding: utf-8 -*-
############################################################################################
#
# Zoook. OpenERP e-sale, e-commerce Open Source Management Solution
# Copyright (C) 2011 Zikzakmedia S.L. (<http://www.zikzakmedia.com>). All Rights Reserved
#
# Module Created: 03/05/2012
# ... | agpl-3.0 |
MathieuDuponchelle/gobject-introspection | giscanner/girparser.py | 1 | 26691 | # -*- Mode: Python -*-
# GObject-Introspection - a framework for introspecting GObject libraries
# Copyright (C) 2008 Johan Dahlin
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; eithe... | gpl-2.0 |
philanthropy-u/edx-platform | lms/djangoapps/courseware/views/index.py | 1 | 25792 | """
View for Courseware Index
"""
# pylint: disable=attribute-defined-outside-init
import logging
import urllib
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.auth.views import redirect_to_login
from django.urls import reverse
from django.http import Http404
from dja... | agpl-3.0 |
KaranToor/MA450 | google-cloud-sdk/platform/bq/third_party/rsa/__init__.py | 6 | 1427 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2011 Sybren A. Stüvel <sybren@stuvel.eu>
#
# 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/license... | apache-2.0 |
ljwolf/spvcm | spvcm/both_levels/se_se/sample.py | 1 | 1359 | import numpy as np
import scipy.linalg as scla
from ...utils import splogdet
from pysal.spreg.utils import spdot
def logp_rho_prec(state, val):
"""
This computes the logp of the spatial parameter using the precision, rather than the covariance. This results in fewer matrix operations in the case of a SE formul... | mit |
zeptonaut/catapult | third_party/WebOb/webob/byterange.py | 78 | 4738 | import re
__all__ = ['Range', 'ContentRange']
_rx_range = re.compile('bytes *= *(\d*) *- *(\d*)', flags=re.I)
_rx_content_range = re.compile(r'bytes (?:(\d+)-(\d+)|[*])/(?:(\d+)|[*])')
class Range(object):
"""
Represents the Range header.
"""
def __init__(self, start, end):
assert end is... | bsd-3-clause |
whitgroves/taskmap | .venvs/python3.6.0/lib/python3.6/site-packages/setuptools/namespaces.py | 54 | 2648 | import os
from distutils import log
import itertools
from setuptools.extern.six.moves import map
flatten = itertools.chain.from_iterable
class Installer:
nspkg_ext = '-nspkg.pth'
def install_namespaces(self):
nsp = self._get_all_ns_packages()
if not nsp:
return
filenam... | unlicense |
ds-hwang/chromium-crosswalk | build/toolchain/gcc_solink_wrapper.py | 19 | 4084 | #!/usr/bin/env python
# Copyright 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.
"""Runs 'ld -shared' and generates a .TOC file that's untouched when unchanged.
This script exists to avoid using complex shell comman... | bsd-3-clause |
schinke/solid-fortnight-ba | flask/venv/lib/python2.7/site-packages/flask/globals.py | 322 | 1645 | # -*- coding: utf-8 -*-
"""
flask.globals
~~~~~~~~~~~~~
Defines all the global objects that are proxies to the current
active context.
:copyright: (c) 2015 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from functools import partial
from werkzeug.local import LocalStack, ... | mit |
funkring/fdoo | addons-funkring/at_stock/__openerp__.py | 1 | 1542 | # -*- coding: utf-8 -*-
# -*- encoding: utf-8 -*-
#############################################################################
#
# Copyright (c) 2007 Martin Reisenhofer <martin.reisenhofer@funkring.net>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU G... | agpl-3.0 |
pjryan126/solid-start-careers | store/api/zillow/venv/lib/python2.7/site-packages/sqlalchemy/orm/relationships.py | 34 | 116992 | # orm/relationships.py
# Copyright (C) 2005-2016 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Heuristics related to join conditions as used in
:func:`.relationship`.
Pro... | gpl-2.0 |
eul-721/The-Perfect-Pokemon-Team-Balancer | libs/env/Lib/encodings/mac_centeuro.py | 593 | 14358 | """ Python Character Mapping Codec mac_centeuro generated from 'MAPPINGS/VENDORS/APPLE/CENTEURO.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,inp... | gpl-2.0 |
sanal-cem/heritago | heritago/heritages/tests/tests_models.py | 1 | 2021 | from django.test import TestCase
from heritages.models import Tag, Heritage, Multimedia, UserProfile, User
import os
testfile = "testfile.txt"
testfile2 = "testfile2.txt"
class ModelsTest(TestCase):
@classmethod
def setUpClass(cls):
Tag.objects.create(name="TAG_ancient")
title = "Test Mosque... | mit |
aaltinisik/OCBAltinkaya | addons/account/wizard/account_state_open.py | 341 | 1785 | # -*- 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 |
petricm/DIRAC | Interfaces/scripts/dirac-wms-select-jobs.py | 6 | 4161 | #!/usr/bin/env python
########################################################################
# File : dirac-wms-select-jobs
# Author : Stuart Paterson
########################################################################
"""
Select DIRAC jobs matching the given conditions
"""
__RCSID__ = "$Id$"
import DIRAC... | gpl-3.0 |
alejandro-perez/pyikev2 | ikesacontroller.py | 1 | 9354 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
""" This module defines the classes for the protocol handling.
"""
import json
import logging
import os
import socket
from ipaddress import ip_address, ip_network
from select import select
import xfrm
from ikesa import IkeSa
from message import (Message, TrafficSelector)... | gpl-3.0 |
masayukig/tempest | tempest/api/network/test_versions.py | 3 | 2114 | # Copyright 2016 VMware, 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 writing... | apache-2.0 |
python-cn/firefly | conftest.py | 9 | 1201 | # coding=utf-8
from __future__ import absolute_import
from flask import url_for
from flask_login import current_user
import pytest
from firefly.app import create_app
from firefly.ext import db
from firefly.models.user import User
@pytest.fixture
def app(request):
app = create_app('tests/settings.py')
db_nam... | mit |
evgenybf/pyXLWriter | tests/test_Worksheet.py | 1 | 3073 | #!/usr/bin/env python
__revision__ = """$Id: test_Worksheet.py,v 1.12 2004/08/17 07:22:38 fufff Exp $"""
import os, os.path
import unittest
import testsupport
from testsupport import read_file
from pyXLWriter.Worksheet import Worksheet
from pyXLWriter.Format import Format
class WorksheetTest(unittest.TestCase):
... | lgpl-2.1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.