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 |
|---|---|---|---|---|---|
lgscofield/odoo | addons/crm_partner_assign/report/crm_lead_report.py | 309 | 5104 | # -*- 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 |
FusionSP/android_external_chromium_org | third_party/cython/src/Cython/Compiler/TreePath.py | 102 | 7538 | """
A simple XPath-like language for tree traversal.
This works by creating a filter chain of generator functions. Each
function selects a part of the expression, e.g. a child node, a
specific descendant or a node that holds an attribute.
"""
import re
import sys
path_tokenizer = re.compile(
"("
"'[^']*'|\"... | bsd-3-clause |
txemi/ansible | lib/ansible/utils/module_docs_fragments/openstack.py | 133 | 3961 | # Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
#
# 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... | gpl-3.0 |
elfnor/sverchok | old_nodes/blenddata_to_svdata.py | 3 | 2591 | # ##### BEGIN GPL LICENSE BLOCK #####
#
# 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 (at your option) any later version.
#
# This program is distrib... | gpl-3.0 |
sanketloke/scikit-learn | examples/model_selection/plot_confusion_matrix.py | 47 | 2495 | """
================
Confusion matrix
================
Example of confusion matrix usage to evaluate the quality
of the output of a classifier on the iris data set. The
diagonal elements represent the number of points for which
the predicted label is equal to the true label, while
off-diagonal elements are those that ... | bsd-3-clause |
eharney/nova | nova/openstack/common/fixture/mockpatch.py | 51 | 1628 | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2013 Hewlett-Packard Development Company, L.P.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except i... | apache-2.0 |
nikoonia/gem5v | tests/configs/simple-timing-ruby.py | 10 | 3141 | # 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 |
topxiaoke/myedx | common/lib/xmodule/xmodule/tests/test_export.py | 3 | 12191 | """
Tests of XML export
"""
import ddt
import lxml.etree
import mock
import os
import pytz
import shutil
import tarfile
import unittest
import uuid
from datetime import datetime, timedelta, tzinfo
from fs.osfs import OSFS
from path import path
from tempfile import mkdtemp
from textwrap import dedent
from xblock.core... | agpl-3.0 |
JioCloud/cinder | cinder/db/sqlalchemy/migrate_repo/versions/048_add_allocated_in_quotas.py | 20 | 1163 | # Copyright 2015 Yahoo 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 ... | apache-2.0 |
ch3ll0v3k/scikit-learn | sklearn/linear_model/coordinate_descent.py | 37 | 74167 | # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Fabian Pedregosa <fabian.pedregosa@inria.fr>
# Olivier Grisel <olivier.grisel@ensta.org>
# Gael Varoquaux <gael.varoquaux@inria.fr>
#
# License: BSD 3 clause
import sys
import warnings
from abc import ABCMeta, abstractmethod
import n... | bsd-3-clause |
Sebbyastian/openfaction | vendor/freetype/src/tools/docmaker/docbeauty.py | 877 | 2642 | #!/usr/bin/env python
#
# DocBeauty (c) 2003, 2004, 2008 David Turner <david@freetype.org>
#
# This program is used to beautify the documentation comments used
# in the FreeType 2 public headers.
#
from sources import *
from content import *
from utils import *
import utils
import sys, os, time, string, getopt
... | gpl-3.0 |
fedepad/espressopp | contrib/mpi4py/mpi4py-2.0.0/demo/reductions/test_reductions.py | 9 | 6307 | #import mpi4py
#mpi4py.profile("mpe")
from mpi4py import MPI
import unittest
import sys, os
sys.path.insert(0, os.path.dirname(__file__))
from reductions import Intracomm
del sys.path[0]
class BaseTest(object):
def test_reduce(self):
rank = self.comm.rank
size = self.comm.size
for root i... | gpl-3.0 |
Gitlab11/odoo | addons/mail/update.py | 221 | 4668 | # -*- coding: utf-8 -*-
from ast import literal_eval
import datetime
from functools import partial
import logging
import werkzeug.urls
import urllib2
from openerp import release, SUPERUSER_ID
from openerp.models import AbstractModel
from openerp.osv import osv
from openerp.tools.translate import _
from openerp.tools.c... | agpl-3.0 |
diyclassics/cltk | src/cltk/corpora/grc/tlg/work_numbers.py | 4 | 332835 | WORK_NUMBERS = {
"0001": {"001": "Argonautica", "002": "Fragmenta", "003": "Epigramma"},
"0002": {
"001": "Elegiae",
"002": "Fragmenta sedis incertae",
"003": "Fragmenta dubia",
"004": "Epigrammata",
},
"0003": {"001": "Historiae", "002": "Epigramma"},
"0004": {"001":... | mit |
eldipa/Hydra | src/py/processInfoRecolector.py | 2 | 3365 | import psutil
import threading
import publish_subscribe.eventHandler
from time import sleep
class ProcessInfoRecolector(threading.Thread):
def __init__(self):
threading.Thread.__init__(self)
self.ev = publish_subscribe.eventHandler.EventHandler(name="ProcessInfoRecolector")
self.salir... | gpl-2.0 |
okolisny/integration_tests | cfme/tests/infrastructure/test_snapshot.py | 1 | 15608 | # -*- coding: utf-8 -*-
import fauxfactory
import pytest
from widgetastic.exceptions import NoSuchElementException
from cfme import test_requirements
from cfme.automate.explorer.domain import DomainCollection
from cfme.automate.simulation import simulate
from cfme.common.vm import VM
from cfme.infrastructure.provider.... | gpl-2.0 |
keedio/keedio-stacks | KEEDIO/1.2/services/SPARK/package/scripts/params.py | 2 | 2485 | #!/usr/bin/env python
"""
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");... | apache-2.0 |
johnnycakes79/SpiceyPy | getspice.py | 3 | 2619 | #!/usr/bin/env python3
__author__ = 'AndrewAnnex'
# Sources: mostly from DaRasch, spiceminer/getcspice.py,
# with edits as needed for python2/3 compatibility
# https://github.com/DaRasch/spiceminer/blob/master/getcspice.py
import os
import sys
import platform
from six.moves import urllib
import io
import zipfile
impor... | mit |
sivel/ansible-modules-extras | system/alternatives.py | 48 | 5534 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Ansible module to manage symbolic link alternatives.
(c) 2014, Gabe Mulley <gabe.mulley@gmail.com>
(c) 2015, David Wittman <dwittman@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 Gene... | gpl-3.0 |
cprogrammer1994/ModernGL | examples/old-examples/GLWindow/particle_system_2.py | 1 | 1794 | import math
import random
import struct
import GLWindow
import ModernGL
# Window & Context
wnd = GLWindow.create_window()
ctx = ModernGL.create_context()
prog = ctx.program(
ctx.vertex_shader('''
#version 330
uniform vec2 Screen;
in vec2 vert;
void main() {
gl_Posit... | mit |
rliskovenko/DataRobot | app/test.py | 1 | 3085 | import random
import string
import app
import json
import unittest
from datetime import datetime
App = app.app
testSet = {
True : [
'''[{"date": "2015-05-12T14:36:00.451765",
"md5checksum": "e8c83e232b64ce94fdd0e4539ad0d44f",
"name": "John Doe",
"uid": "1"},
... | bsd-2-clause |
tanzer/ls-emacs | scripts/lse_compile_language.py | 1 | 3736 | # -*- coding: utf-8 -*-
# Copyright (C) 1994-2017 Mag. Christian Tanzer. All rights reserved
# Glasauergasse 32, A--1130 Wien, Austria. tanzer@swing.co.at
#
#++
# Name
# lse_compile_language
#
# Purpose
# Compile emacs language definition
#
# Revision Dates
# 14-Nov-2007 (MG) Creation (ported from bash script)... | gpl-2.0 |
thfield/sf-base-election-data | venv/lib/python3.4/site-packages/pip/_vendor/html5lib/treebuilders/etree.py | 915 | 12621 | from __future__ import absolute_import, division, unicode_literals
from pip._vendor.six import text_type
import re
from . import _base
from .. import ihatexml
from .. import constants
from ..constants import namespaces
from ..utils import moduleFactoryFactory
tag_regexp = re.compile("{([^}]*)}(.*)")
def getETreeBu... | bsd-3-clause |
tectronics/gpo2py | languages/ru-ru.py | 21 | 5227 | # coding: utf8
{
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"Изменить" - необязательное выражение вида "field1=\'новое значение\'". Результаты операции JOIN нельзя изменить или удалить.',
'%Y-%m-%d': '%Y-%m-%d',
'%Y-%m-%d %H:%M:%S': '%Y-%m-%d %H:... | agpl-3.0 |
bartoldeman/easybuild-framework | test/framework/filetools.py | 1 | 75056 | # #
# Copyright 2012-2018 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be),
# Flemish Research Foundation (... | gpl-2.0 |
mitmproxy/mitmproxy | mitmproxy/tools/console/flowlist.py | 4 | 3508 | import urwid
from mitmproxy.tools.console import common
from mitmproxy.tools.console import layoutwidget
import mitmproxy.tools.console.master # noqa
class FlowItem(urwid.WidgetWrap):
def __init__(self, master, flow):
self.master, self.flow = master, flow
w = self.get_text()
urwid.Widget... | mit |
stevenewey/django | tests/migrations/test_commands.py | 20 | 42029 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import codecs
import importlib
import os
from django.apps import apps
from django.core.management import CommandError, call_command
from django.db import DatabaseError, connection, models
from django.test import ignore_warnings, mock, override_settings
f... | bsd-3-clause |
wrouesnel/ansible | lib/ansible/modules/cloud/cloudstack/cs_instance.py | 25 | 34806 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2015, René Moser <mail@renemoser.net>
# 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 |
NikNitro/Python-iBeacon-Scan | sympy/polys/orthopolys.py | 87 | 8382 | """Efficient functions for generating orthogonal polynomials. """
from __future__ import print_function, division
from sympy import Dummy
from sympy.utilities import public
from sympy.polys.constructor import construct_domain
from sympy.polys.polytools import Poly, PurePoly
from sympy.polys.polyclasses import DMP
... | gpl-3.0 |
dcroc16/skunk_works | google_appengine/lib/webapp2-2.5.1/webapp2_extras/config.py | 67 | 7380 | # -*- coding: utf-8 -*-
"""
webapp2_extras.config
=====================
Configuration object for webapp2.
This module is deprecated. See :class:`webapp2.WSGIApplication.config`.
:copyright: 2011 by tipfy.org.
:license: Apache Sotware License, see LICENSE for details.
"""
from __future__ impor... | mit |
Cadair/solarbextrapolation | solarbextrapolation/analyticalmodels/base.py | 1 | 8605 | # -*- coding: utf-8 -*-
"""
Created on Mon Sep 28 19:30:22 2015
@author: alex_
"""
# General Imports
import matplotlib as mpl
mpl.use('TkAgg') # Force mpl backend not to use qt. Else we have a conflict.
import numpy as np
#import pickle
import time
from datetime import datetime
#from collections import namedtuple
imp... | mit |
RNAcentral/rnacentral-import-pipeline | rnacentral_pipeline/rnacentral/r2dt/parser.py | 1 | 3852 | # -*- coding: utf-8 -*-
"""
Copyright [2009-2018] EMBL-European Bioinformatics Institute
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 |
yqm/sl4a | python-build/python-libs/gdata/samples/oauth/oauth_on_appengine/appengine_utilities/cache.py | 129 | 9763 | # -*- coding: utf-8 -*-
"""
Copyright (c) 2008, appengine-utilities project
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
... | apache-2.0 |
varuntiwari27/rally | todo-api/flask/lib/python2.7/encodings/mac_latin2.py | 647 | 8565 | """ Python Character Mapping Codec generated from 'LATIN2.TXT' with gencodec.py.
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
(c) Copyright 2000 Guido van Rossum.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,erro... | apache-2.0 |
keras-team/autokeras | examples/automodel_with_cnn.py | 1 | 1358 | # Library import
import numpy as np
import tensorflow as tf
import autokeras as ak
# Prepare example Data - Shape 1D
num_instances = 100
num_features = 5
x_train = np.random.rand(num_instances, num_features).astype(np.float32)
y_train = np.zeros(num_instances).astype(np.float32)
y_train[0 : int(num_instances / 2)] = ... | apache-2.0 |
krzkaczor/antlr4 | runtime/Python2/src/antlr4/tree/ParseTreePattern.py | 14 | 3903 | #
# [The "BSD license"]
# Copyright (c) 2013 Terence Parr
# Copyright (c) 2013 Sam Harwell
# Copyright (c) 2014 Eric Vergnaud
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributio... | bsd-3-clause |
vathpela/seabios | scripts/vgafixup.py | 11 | 3613 | #!/usr/bin/env python
# Work around x86emu bugs by replacing problematic instructions.
#
# Copyright (C) 2012 Kevin O'Connor <kevin@koconnor.net>
#
# This file may be distributed under the terms of the GNU GPLv3 license.
# The x86emu code widely used in Linux distributions when running Xorg
# in vesamode is known to ... | gpl-3.0 |
aburan28/blaze | blaze/catalog/blaze_url.py | 13 | 3712 | from __future__ import absolute_import, division, print_function
__all__ = ['split_array_base', 'add_indexers_to_url', 'slice_as_string',
'index_tuple_as_string']
from pyparsing import (Word, Regex, Optional, ZeroOrMore,
StringStart, StringEnd, alphas, alphanums)
from ..py2help impor... | bsd-3-clause |
Chilledheart/chromium | tools/telemetry/third_party/typ/typ/__init__.py | 81 | 3167 | # Copyright 2014 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... | bsd-3-clause |
ColOfAbRiX/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 |
yelongyu/chihu | venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/connection.py | 26 | 5821 | # urllib3/connection.py
# Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt)
#
# This module is part of urllib3 and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
import socket
from socket import timeout as SocketTimeout
try: # Python 3
from http.cli... | gpl-3.0 |
tsileo/camlipy | camlipy/rollsum.py | 2 | 3870 | # This file was automatically generated by SWIG (http://www.swig.org).
# Version 2.0.7
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info
if version_info >= (2,6,0):
def swig_import_helper():
from os.path import ... | mit |
jeremy-miller/life-python | life/display.py | 1 | 1176 | """This module displays the Life 'grid'."""
import numpy
class DisplayClass(object): # pylint: disable=R0903
"""This class displays the Life 'grid'.
No OpenGL or Matplotlib UI is used since this program is being executed
in a Docker container. The 'curses' Python package is also not used
since it also has... | mit |
40223114/w16b_test | static/Brython3.1.3-20150514-095342/Lib/VFS_import.py | 738 | 3059 | import os
from browser import doc
#_scripts=doc.createElement('script')
#_scripts.src="/src/py_VFS.js"
#_scripts.type="text/javascript"
#doc.get(tag='head')[0].appendChild(_scripts)
VFS=dict(JSObject(__BRYTHON__.py_VFS))
class VFSModuleFinder:
def __init__(self, path_entry):
print("in VFSModuleFinder")
... | agpl-3.0 |
Observer-Wu/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/style/checkers/xml_unittest.py | 124 | 3716 | # Copyright (C) 2010 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:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | bsd-3-clause |
Aaron1992/tornado | tornado/auth.py | 102 | 61853 | #!/usr/bin/env python
#
# Copyright 2009 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... | apache-2.0 |
ATIX-AG/ansible | lib/ansible/plugins/connection/winrm.py | 7 | 28961 | # (c) 2014, Chris Church <chris@ninemoreminutes.com>
# Copyright (c) 2017 Ansible Project
# 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
DOCUMENTATION = """
author: Ansible Core Te... | gpl-3.0 |
rosenvladimirov/odoo-fixes | account_analytic_plans/__openerp__.py | 264 | 3114 | # -*- 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 |
axiom-data-science/paegan-transport | paegan/transport/shoreline.py | 2 | 19501 | import os
import math
import numpy as np
import requests
try:
from urlparse import urlparse
except ImportError:
from urllib.parse import urlparse
from xml.etree import ElementTree as ET
import fiona
from shapely import wkt
from shapely.geometry import asShape, box
from shapely.geometry import LineString
from ... | gpl-3.0 |
telefonicaid/murano | murano/packages/versions/mpl_v1.py | 5 | 2169 | # Copyright (c) 2014 Mirantis 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 writ... | apache-2.0 |
sachinkum/Bal-Aveksha | WebServer/BalAvekshaEnv/lib/python3.5/site-packages/django/core/mail/backends/filebased.py | 558 | 2771 | """Email backend that writes messages to a file."""
import datetime
import os
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.core.mail.backends.console import \
EmailBackend as ConsoleEmailBackend
from django.utils import six
class EmailBackend(ConsoleEmailB... | gpl-3.0 |
zorojean/scikit-learn | examples/ensemble/plot_adaboost_regression.py | 311 | 1529 | """
======================================
Decision Tree Regression with AdaBoost
======================================
A decision tree is boosted using the AdaBoost.R2 [1] algorithm on a 1D
sinusoidal dataset with a small amount of Gaussian noise.
299 boosts (300 decision trees) is compared with a single decision tr... | bsd-3-clause |
rlr/fjord | fjord/translations/migrations/0001_initial.py | 7 | 2786 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import datetime
class Migration(migrations.Migration):
dependencies = [
('contenttypes', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='GengoJob',
... | bsd-3-clause |
antoviaque/edx-platform | openedx/core/djangoapps/safe_sessions/tests/test_safe_cookie_data.py | 7 | 7579 | # pylint: disable=protected-access
"""
Unit tests for SafeCookieData
"""
import ddt
from django.test import TestCase
import itertools
from mock import patch
from time import time
from ..middleware import SafeCookieData, SafeCookieError
from .test_utils import TestSafeSessionsLogMixin
@ddt.ddt
class TestSafeCookieDa... | agpl-3.0 |
edmundgentle/schoolscript | SchoolScript/bin/Debug/pythonlib/Lib/test/test_pipes.py | 1 | 7288 | import pipes
import os
import string
import unittest
from test.support import TESTFN, run_unittest, unlink, reap_children
if os.name != 'posix':
raise unittest.SkipTest('pipes module only works on posix')
TESTFN2 = TESTFN + "2"
# tr a-z A-Z is not portable, so make the ranges explicit
s_command = 'tr... | gpl-2.0 |
kelseyoo14/Wander | venv_2_7/lib/python2.7/site-packages/numpy/matlib.py | 161 | 9584 | from __future__ import division, absolute_import, print_function
import numpy as np
from numpy.matrixlib.defmatrix import matrix, asmatrix
# need * as we're copying the numpy namespace
from numpy import *
__version__ = np.__version__
__all__ = np.__all__[:] # copy numpy namespace
__all__ += ['rand', 'randn', 'repmat... | artistic-2.0 |
ProfessionalIT/professionalit-webiste | sdk/google_appengine/google/appengine/ext/django/main.py | 8 | 1818 | #!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | lgpl-3.0 |
leohmoraes/weblate | weblate/trans/management/commands/lock_translation.py | 10 | 1103 | # -*- coding: utf-8 -*-
#
# Copyright © 2012 - 2015 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <http://weblate.org/>
#
# 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, eithe... | gpl-3.0 |
npmccallum/sssd | src/sbus/codegen/sbus_DataType.py | 4 | 2986 | #
# Authors:
# Pavel Brezina <pbrezina@redhat.com>
#
# Copyright (C) 2017 Red Hat
#
# 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 |
eldabbagh/gae-boilerplate | bp_includes/external/wtforms/ext/django/fields.py | 66 | 3498 | """
Useful form fields for use with the Django ORM.
"""
from __future__ import unicode_literals
import operator
from wtforms import widgets
from wtforms.compat import string_types
from wtforms.fields import SelectFieldBase
from wtforms.validators import ValidationError
__all__ = (
'ModelSelectField', 'QuerySetS... | lgpl-3.0 |
ahmedaljazzar/edx-platform | common/lib/xmodule/xmodule/tests/test_validation.py | 13 | 8741 | """
Test xblock/validation.py
"""
import unittest
import pytest
from xmodule.validation import StudioValidationMessage, StudioValidation
from xblock.validation import Validation, ValidationMessage
class StudioValidationMessageTest(unittest.TestCase):
"""
Tests for `ValidationMessage`
"""
shard = 1
... | agpl-3.0 |
GbalsaC/bitnamiP | lms/djangoapps/courseware/tests/test_model_data.py | 19 | 19786 | """
Test for lms courseware app, module data (runtime data storage for XBlocks)
"""
import json
from mock import Mock, patch
from nose.plugins.attrib import attr
from functools import partial
from courseware.model_data import DjangoKeyValueStore
from courseware.model_data import InvalidScopeError, FieldDataCache
from ... | agpl-3.0 |
jeffsilverm/presentation | SeaGL-2018/network_stats_result_2_csv.py | 1 | 3115 | #! /usr/bin/python3
# -*- coding: utf-8 -*-
import csv
import datetime
import sys
def str_to_time_delta(string) -> datetime.timedelta:
"""
:param string: Input in format 0:01:37.083557
:return: datetime.timedelta
"""
flds = string.split(":")
hours = flds[0]
minutes = flds[1]
second... | gpl-2.0 |
40223121/2015cd_midterm | static/Brython3.1.1-20150328-091302/Lib/xml/sax/xmlreader.py | 824 | 12612 | """An XML Reader is the SAX 2 name for an XML parser. XML Parsers
should be based on this code. """
from . import handler
from ._exceptions import SAXNotSupportedException, SAXNotRecognizedException
# ===== XMLREADER =====
class XMLReader:
"""Interface for reading an XML document using callbacks.
XMLReade... | gpl-3.0 |
scripnichenko/nova | nova/tests/unit/virt/libvirt/test_utils.py | 12 | 28974 | # Copyright 2012 NTT Data. All Rights Reserved.
# Copyright 2012 Yahoo! 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/li... | apache-2.0 |
floydhub/dockerfiles | dl/pytorch/tests/0.3.1/mnist.py | 1 | 5122 | # MNIST from official PyTorch Docs
from __future__ import print_function
import argparse
import torch
import torchvision
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import psutil
from torchvision import datasets, transforms
from torch.autograd import Variable
# Training settings
... | apache-2.0 |
diagramsoftware/odoomrp-wip | partner_risk_insurance/models/res_partner.py | 29 | 2789 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of th... | agpl-3.0 |
bcgsc/ProbeGenerator | probe_generator/reference.py | 1 | 2779 | """Parse and extract base pair sequences from an Ensembl reference genome.
"""
from probe_generator import sequence
from probe_generator.exceptions import NonFatalError
def bases(sequence_range, genome):
"""Return the bases from a SequenceRange object.
"""
raw_bases = _raw_bases(
sequence_range.c... | gpl-3.0 |
yewang15215/django | tests/admin_views/urls.py | 55 | 1024 | from django.conf.urls import include, url
from . import admin, custom_has_permission_admin, customadmin, views
urlpatterns = [
url(r'^test_admin/admin/doc/', include('django.contrib.admindocs.urls')),
url(r'^test_admin/admin/secure-view/$', views.secure_view, name='secure_view'),
url(r'^test_admin/admin/s... | bsd-3-clause |
bakhtout/odoo-educ | addons/openeducat_erp/op_course/__init__.py | 1 | 1082 | # -*- coding: utf-8 -*-
#/#############################################################################
#
# Tech-Receptives Solutions Pvt. Ltd.
# Copyright (C) 2004-TODAY Tech-Receptives(<http://www.tech-receptives.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under th... | agpl-3.0 |
crackinglandia/pype32 | setup.py | 1 | 4235 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2013, Nahuel Riva
# 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 copyrigh... | bsd-3-clause |
ruben2020/codequery | scintilla/scripts/HFacer.py | 5 | 2003 | #!/usr/bin/env python
# HFacer.py - regenerate the Scintilla.h and SciLexer.h files from the Scintilla.iface interface
# definition file.
# Implemented 2000 by Neil Hodgson neilh@scintilla.org
# Requires Python 2.5 or later
import sys
import os
import Face
from FileGenerator import UpdateFile, Generate, Regenerate, U... | mpl-2.0 |
myvoice-nigeria/myvoice | myvoice/clinics/migrations/0013_auto__chg_field_visit_service.py | 1 | 13197 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'Visit.service'
db.alter_column(u'clinics_visit', 'serv... | bsd-2-clause |
m00nlight/hackerrank | algorithm/contests/Counter-Code-2015/C.py | 1 | 1148 | from __future__ import division
from sys import stdin
def solve(n, m):
if n % 2 == 0:
if m % n == 0:
return n // 2 + 1
elif m % n % 2 == 1:
return (m % n + 1) // 2
else:
return n + 1 - m % n // 2
else:
idx = m % (2 * n)
if idx == 0:
... | gpl-2.0 |
tempbottle/cjdns | node_build/dependencies/libuv/build/gyp/test/cflags/gyptest-cflags.py | 90 | 1750 | #!/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.
"""
Verifies the use of the environment during regeneration when the gyp file
changes, specifically via build of an executable with C prepro... | gpl-3.0 |
Bezoar/surrender-rides | bp_includes/handlers.py | 1 | 64168 | # -*- coding: utf-8 -*-
"""
A real simple app for using webapp2 with auth and session.
It just covers the basics. Creating a user, login, logout
and a decorator for protecting certain handlers.
Routes are setup in routes.py and added in main.py
"""
# standard library imports
import logging
import jso... | mit |
devendermishrajio/nova | nova/tests/unit/virt/vmwareapi/stubs.py | 52 | 2525 | # Copyright (c) 2011 Citrix Systems, Inc.
# Copyright 2011 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... | apache-2.0 |
pylixm/sae-django-demo | django1.7-sae/site-packages/django/contrib/sitemaps/__init__.py | 59 | 5403 | from django.apps import apps as django_apps
from django.core import urlresolvers, paginator
from django.core.exceptions import ImproperlyConfigured
from django.utils.six.moves.urllib.parse import urlencode
from django.utils.six.moves.urllib.request import urlopen
PING_URL = "http://www.google.com/webmasters/tools/pin... | apache-2.0 |
Epirex/android_external_chromium_org | tools/telemetry/telemetry/page/page_filter.py | 25 | 2627 | # 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 optparse
import re
def HasLabelIn(obj, labels):
for label in labels:
if hasattr(obj, label) and getattr(obj, label):
return True
ret... | bsd-3-clause |
saurabh6790/alert-med-app | hr/report/monthly_salary_register/monthly_salary_register.py | 15 | 4061 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import webnotes
from webnotes.utils import flt, cstr
from webnotes import msgprint, _
def execute(filters=None):
if not filters: filters = {}
sa... | agpl-3.0 |
lbk0116/NTDP | setup/package.py | 180 | 22070 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
#... | apache-2.0 |
40223141/w16b_test | static/Brython3.1.1-20150328-091302/Lib/unittest/test/test_assertions.py | 738 | 15398 | import datetime
import warnings
import unittest
from itertools import product
class Test_Assertions(unittest.TestCase):
def test_AlmostEqual(self):
self.assertAlmostEqual(1.00000001, 1.0)
self.assertNotAlmostEqual(1.0000001, 1.0)
self.assertRaises(self.failureException,
... | gpl-3.0 |
metamx/Diamond | src/collectors/websitemonitor/test/testwebsitemonitor.py | 35 | 1887 | #!/usr/bin/python
# coding=utf-8
########################################################################
from test import CollectorTestCase
from test import get_collector_config
from mock import patch
from diamond.collector import Collector
from websitemonitor import WebsiteMonitorCollector
#######################... | mit |
nanolearning/edx-platform | i18n/transifex.py | 13 | 2594 | #!/usr/bin/env python
from __future__ import print_function
import sys
from polib import pofile
import argparse
from i18n.config import CONFIGURATION
from i18n.execute import execute
from i18n.extract import EDX_MARKER
TRANSIFEX_HEADER = u'edX community translations have been downloaded from {}'
TRANSIFEX_URL = 'http... | agpl-3.0 |
cysnake4713/odoo | addons/anonymization/__openerp__.py | 119 | 2235 | # -*- encoding: 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 |
gormanb/mongo-python-driver | bson/min_key.py | 21 | 1260 | # Copyright 2010-2015 MongoDB, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | apache-2.0 |
linsalrob/PhageHosts | code/codon_distance.py | 1 | 2853 | '''
Calculate the distance between two codon usages.
We have two files, the first with just the phages and the second
with their hosts. Then we need to calculate which of the hosts is
closest
'''
import os
import sys
sys.path.append('/home3/redwards/bioinformatics/Modules')
import numpy as np
import scipy
remove_am... | mit |
markeTIC/OCB | addons/gamification/wizard/grant_badge.py | 280 | 2230 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013 OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the ... | agpl-3.0 |
jmccarty3/kubernetes | hooks/boilerplate.py | 6 | 3158 | #!/usr/bin/env python
# Copyright 2015 The Kubernetes 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
#
# Unle... | apache-2.0 |
abs0/tapiriik | tapiriik/services/SportTracks/sporttracks.py | 2 | 29291 | from tapiriik.settings import WEB_ROOT, SPORTTRACKS_OPENFIT_ENDPOINT, SPORTTRACKS_CLIENT_ID, SPORTTRACKS_CLIENT_SECRET
from tapiriik.services.service_base import ServiceAuthenticationType, ServiceBase
from tapiriik.services.interchange import UploadedActivity, ActivityType, ActivityStatistic, ActivityStatisticUnit, W... | apache-2.0 |
eagleeyetom/android_kernel_oppo_msm8974 | tools/perf/scripts/python/sctop.py | 11180 | 1924 | # system call top
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Periodically displays system-wide system call totals, broken down by
# syscall. If a [comm] arg is specified, only syscalls called by
# [comm] are displayed. If an [interval] arg is specified,... | gpl-2.0 |
MTgeophysics/mtpy | tests/analysis/test_pt.py | 1 | 7128 | # -*- coding: utf-8 -*-
"""
TEST mtpy.core.mt.MT
@author: YG
"""
from unittest import TestCase
# -*- coding: utf-8 -*-
"""
Created on Tue Oct 31 13:19:35 2017
@author: u64125
Alison.Kirkby@ga.gov.au
"""
import os
import numpy as np
from mtpy.core.mt import MT
from tests import TEST_MTPY_ROOT
import mtpy.analysis.ge... | gpl-3.0 |
luiseduardohdbackup/odoo | addons/hr_payroll/wizard/hr_payroll_payslips_by_employees.py | 337 | 3443 | # -*- 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 |
BerserkerTroll/root | interpreter/llvm/src/utils/opt-viewer/optrecord.py | 6 | 5775 | #!/usr/bin/env python2.7
from __future__ import print_function
import yaml
# Try to use the C parser.
try:
from yaml import CLoader as Loader
except ImportError:
print("For faster parsing, you may want to install libYAML for PyYAML")
from yaml import Loader
import functools
from collections import defaul... | lgpl-2.1 |
edmundgentle/schoolscript | SchoolScript/bin/Debug/pythonlib/Lib/test/test_pickle.py | 3 | 3240 | import pickle
import io
from test import support
from test.pickletester import AbstractPickleTests
from test.pickletester import AbstractPickleModuleTests
from test.pickletester import AbstractPersistentPicklerTests
from test.pickletester import AbstractPicklerUnpicklerObjectTests
try:
import _pickle
... | gpl-2.0 |
gnmiller/craig-bot | craig-bot/lib/python3.6/site-packages/discord/ext/commands/context.py | 1 | 10694 | # -*- coding: utf-8 -*-
"""
The MIT License (MIT)
Copyright (c) 2015-2019 Rapptz
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 u... | mit |
saurabh-hirani/jsonchecker | jsonalyzer/callbacks.py | 2 | 2784 | import string
import json
def get_output_template(json_ds):
return {
'ds': json_ds,
'msg': '',
'status': 'OK'
}
def no_op(json_ds, **kwargs):
output = get_output_template(json_ds)
output['msg'] = 'OK'
return output
def check_has_key(json_ds, **kwargs):
output = get_output_template(json_ds)
... | gpl-2.0 |
jmighion/ansible | test/units/modules/packaging/utils.py | 26 | 1379 | import json
from ansible.compat.tests.mock import patch
from ansible.module_utils import basic
from ansible.module_utils.six.moves import xmlrpc_client
from ansible.module_utils._text import to_bytes
def set_module_args(args):
args = json.dumps({'ANSIBLE_MODULE_ARGS': args})
basic._ANSIBLE_ARGS = to_bytes(ar... | gpl-3.0 |
pombredanne/teamwork | w2/static/Brython2.0.0-20140209-164925/Lib/copy.py | 113 | 8787 | """Generic (shallow and deep) copying operations.
Interface summary:
import copy
x = copy.copy(y) # make a shallow copy of y
x = copy.deepcopy(y) # make a deep copy of y
For module specific errors, copy.Error is raised.
The difference between shallow and deep copying is only relev... | gpl-2.0 |
jindongh/boto | boto/cognito/identity/exceptions.py | 135 | 1125 | # The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL-
# ITY, FITNESS FOR A PARTICULAR PURPOS... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.