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 |
|---|---|---|---|---|---|
lasr/orbital_elements | convert/mee_meeMl0.py | 1 | 1808 | import numpy as np
from .meefl_meeMl import meefl_meeMl
__author__ = "Nathan I. Budd"
__email__ = "nibudd@gmail.com"
__copyright__ = "Copyright 2017, LASR Lab"
__license__ = "MIT"
__version__ = "0.1"
__status__ = "Production"
__date__ = "27 Mar 2017"
def mee_meeMl0(T, meeMl0, mu=1.0):
"""Convert MEEs with mean l... | mit |
samthor/intellij-community | python/lib/Lib/gzip.py | 81 | 17411 | """Functions that read and write gzipped files.
The user of the file doesn't have to worry about the compression,
but random access is not allowed."""
# based on Andrew Kuchling's minigzip.py distributed with the zlib module
import struct, sys, time
import zlib
import __builtin__
__all__ = ["GzipFile","open"]
FTEX... | apache-2.0 |
minghuascode/pyj | examples/minesweeper/__main__.py | 8 | 1057 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
TARGETS = [
'minesweeper.py',
]
PACKAGE = {
'title': 'minesweeper',
'desc': 'minesweeper example',
}
def setup(targets):
'''Setup example for translation, MUST call util.setup(targets).'''
util.setup(targets)
def translate():
'''Translate exa... | apache-2.0 |
tsufiev/horizon | openstack_dashboard/dashboards/project/data_processing/data_plugins/tables.py | 51 | 1400 | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... | apache-2.0 |
ericlink/adms-server | playframework-dist/1.1-src/python/Lib/distutils/dep_util.py | 2 | 3665 | """distutils.dep_util
Utility functions for simple, timestamp-based dependency of files
and groups of files; also, function based entirely on such
timestamp dependency analysis."""
# This module should be kept compatible with Python 2.1.
__revision__ = "$Id: dep_util.py 37828 2004-11-10 22:23:15Z loewis $"
... | mit |
salivatears/ansible | contrib/inventory/abiquo.py | 39 | 8967 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
External inventory script for Abiquo
====================================
Shamelessly copied from an existing inventory script.
This script generates an inventory that Ansible can understand by making API requests to Abiquo API
Requires some python libraries, ensure ... | gpl-3.0 |
letuananh/puchikarui | docs/conf.py | 1 | 1903 | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | mit |
Azure/azure-sdk-for-python | sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/operations/_log_files_operations.py | 1 | 5652 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | mit |
qtproject/qtqa | scripts/generic/parse_build_log.py | 1 | 5630 | ############################################################################
##
## Copyright (C) 2019 The Qt Company Ltd.
## Contact: https://www.qt.io/licensing/
##
## This file is part of the Quality Assurance module of the Qt Toolkit.
##
## $QT_BEGIN_LICENSE:GPL-EXCEPT$
## Commercial License Usage
## Licensees holdi... | gpl-3.0 |
martydill/url_shortener | code/venv/lib/python2.7/site-packages/sqlalchemy/orm/dependency.py | 70 | 46073 | # orm/dependency.py
# Copyright (C) 2005-2015 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
"""Relationship dependencies.
"""
from .. import sql, util, exc as sa_exc
from .... | mit |
newerthcom/savagerebirth | libs/python-2.72/Lib/ctypes/test/test_prototypes.py | 81 | 6738 | from ctypes import *
import unittest
# IMPORTANT INFO:
#
# Consider this call:
# func.restype = c_char_p
# func(c_char_p("123"))
# It returns
# "123"
#
# WHY IS THIS SO?
#
# argument tuple (c_char_p("123"), ) is destroyed after the function
# func is called, but NOT before the result is actually built.
#
# If... | gpl-2.0 |
gangadharkadam/shfr | frappe/modules/export_file.py | 39 | 2353 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe, os, json
import frappe.model
from frappe.modules import scrub, get_module_path, lower_case_files_for, scrub_dt_dn
def export_doc(doc):
export_to_files([[doc.d... | mit |
levilucio/SyVOLT | t_core/Mutex/HKillRuleLHS.py | 1 | 8932 |
from core.himesis import Himesis, HimesisPreConditionPatternLHS
import cPickle as pickle
class HKillRuleLHS(HimesisPreConditionPatternLHS):
def __init__(self):
"""
Creates the himesis graph representing the AToM3 model HKillRuleLHS.
"""
# Create the himesis graph
... | mit |
nabsboss/CouchPotatoServer | libs/sqlalchemy/sql/operators.py | 12 | 15388 | # sql/operators.py
# Copyright (C) 2005-2012 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
# This module is part of SQLAlchemy and is released under
# the MIT License: http://w... | gpl-3.0 |
bdmod/extreme-subversion | BinarySourcce/subversion-1.6.17/build/getversion.py | 1 | 2153 | #!/usr/bin/env python
#
# getversion.py - Parse version numbers from C header files.
#
import os
import re
import sys
__all__ = ['Parser', 'Result']
class Result:
pass
class Parser:
def __init__(self):
self.patterns = {}
def search(self, define_name, value_name):
'Add the name of a define to the list... | gpl-2.0 |
amyvmiwei/kbengine | kbe/src/lib/python/Lib/socket.py | 74 | 18927 | # Wrapper module for _socket, providing some additional facilities
# implemented in Python.
"""\
This module provides socket operations and some related functions.
On Unix, it supports IP (Internet Protocol) and Unix domain sockets.
On other systems, it only supports IP. Functions specific for a
socket are available a... | lgpl-3.0 |
chanceraine/nupic | tests/integration/nupic/opf/opf_experiment_results_test.py | 12 | 15515 | #!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2014, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions ... | agpl-3.0 |
LarryHillyer/PoolHost | PoolHost/env/Lib/site-packages/pip/_vendor/appdirs.py | 327 | 22368 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2005-2010 ActiveState Software Inc.
# Copyright (c) 2013 Eddy Petrișor
"""Utilities for determining application-specific dirs.
See <http://github.com/ActiveState/appdirs> for details and usage.
"""
# Dev Notes:
# - MSDN on where to store app data files:
# ... | gpl-3.0 |
0k/OpenUpgrade | addons/hr_timesheet/report/hr_timesheet_report.py | 51 | 2704 |
from openerp import tools
from openerp.osv import fields,osv
from openerp.addons.decimal_precision import decimal_precision as dp
class hr_timesheet_report(osv.osv):
_name = "hr.timesheet.report"
_description = "Timesheet"
_auto = False
_columns = {
'date': fields.date('Date', readonly=True),
... | agpl-3.0 |
draugiskisprendimai/odoo | addons/mrp/report/price.py | 56 | 11687 | # -*- 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 |
ismailsunni/inasafe | safe/utilities/default_values.py | 11 | 2237 | # coding=utf-8
"""Helpers to get/set default values."""
from safe.definitions import GLOBAL, zero_default_value
from safe.definitions.utilities import definition
__copyright__ = "Copyright 2016, The InaSAFE Project"
__license__ = "GPL version 3"
__email__ = "info@inasafe.org"
__revision__ = '$Format:%H$'
def set_i... | gpl-3.0 |
sagiss/sardana | src/sardana/macroserver/macros/examples/funcs.py | 1 | 2397 | ##############################################################################
##
## This file is part of Sardana
##
## http://www.sardana-controls.org/
##
## Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain
##
## Sardana is free software: you can redistribute it and/or modify
## it under the terms of the GN... | lgpl-3.0 |
DESHRAJ/fjord | vendor/packages/translate-toolkit/translate/storage/placeables/__init__.py | 5 | 2036 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2008-2009 Zuza Software Foundation
#
# This file is part of the Translate Toolkit.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; e... | bsd-3-clause |
joernhees/scikit-learn | examples/linear_model/plot_sgd_iris.py | 58 | 2202 | """
========================================
Plot multi-class SGD on the iris dataset
========================================
Plot decision surface of multi-class SGD on iris dataset.
The hyperplanes corresponding to the three one-versus-all (OVA) classifiers
are represented by the dashed lines.
"""
print(__doc__)
... | bsd-3-clause |
username4gh/my-i3 | vim/vim-denite-codesearch/rplugin/python3/denite/source/csearch.py | 1 | 5026 | import shlex
import typing
from os.path import relpath
from denite import util, process
from denite.base.source import Base
from denite.util import Nvim, UserContext, Candidates, Candidate
def _candidate(result: typing.List[typing.Any], path: str) -> Candidate:
return {
'word': result[3],
'abbr':... | unlicense |
fxfitz/ansible | test/units/modules/cloud/google/test_gcp_url_map.py | 158 | 6086 | import unittest
from ansible.modules.cloud.google.gcp_url_map import _build_path_matchers, _build_url_map_dict
class TestGCPUrlMap(unittest.TestCase):
"""Unit tests for gcp_url_map module."""
params_dict = {
'url_map_name': 'foo_url_map_name',
'description': 'foo_url_map description',
... | gpl-3.0 |
Samuc/Proyecto-IV | lib/python2.7/site-packages/setuptools/command/develop.py | 477 | 6447 | from setuptools.command.easy_install import easy_install
from distutils.util import convert_path, subst_vars
from pkg_resources import Distribution, PathMetadata, normalize_path
from distutils import log
from distutils.errors import DistutilsError, DistutilsOptionError
import os, sys, setuptools, glob
class develop(ea... | gpl-2.0 |
40223139/203739test | static/Brython3.1.0-20150301-090019/Lib/sre_constants.py | 692 | 7172 | #
# Secret Labs' Regular Expression Engine
#
# various symbols used by the regular expression engine.
# run this script to update the _sre include files!
#
# Copyright (c) 1998-2001 by Secret Labs AB. All rights reserved.
#
# See the sre.py file for information on usage and redistribution.
#
"""Internal support modul... | gpl-3.0 |
blrm/openshift-tools | openshift/installer/vendored/openshift-ansible-3.9.14-1/roles/lib_openshift/src/lib/base.py | 7 | 21696 | # pylint: skip-file
# flake8: noqa
# pylint: disable=too-many-lines
# noqa: E301,E302,E303,T001
class OpenShiftCLIError(Exception):
'''Exception class for openshiftcli'''
pass
ADDITIONAL_PATH_LOOKUPS = ['/usr/local/bin', os.path.expanduser('~/bin')]
def locate_oc_binary():
''' Find and return oc binar... | apache-2.0 |
rohitwaghchaure/erpnext_develop | erpnext/stock/doctype/stock_entry/stock_entry_utils.py | 2 | 3215 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
import frappe, erpnext
from frappe.utils import cint, flt
@frappe.whitelist()
def make_stock_entry(**args):
'''Helper function to make a Stock Entry
:item_code: Item to be moved
:qty: Qty to be moved
:from_warehouse: Optional
... | gpl-3.0 |
TiVoMaker/boto | boto/mws/response.py | 152 | 23191 | # Copyright (c) 2012-2014 Andy Davidoff http://www.disruptek.com/
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy... | mit |
weaver-viii/subuser | logic/subuserlib/resolve.py | 2 | 5115 | #!/usr/bin/env python
# This file should be compatible with both Python 2 and 3.
# If it is not, please file a bug report.
"""
This module is used to parse the image source identifiers used to identify image sources during instalation. For more information see the image-source-identifiers section of the subuser stand... | lgpl-3.0 |
Code4SA/mma-dexter | dexter/processing/extractors/calais.py | 1 | 5007 | import requests
import json
from .base import BaseExtractor
from ...models import DocumentEntity, Entity, Utterance, DocumentTaxonomy
import logging
log = logging.getLogger(__name__)
class CalaisExtractor(BaseExtractor):
""" Use the OpenCalais API to extract entities and other
useful goodies from a document... | apache-2.0 |
Sing-Li/go-buildpack | builds/runtimes/python-2.7.6/lib/python2.7/mimetypes.py | 11 | 20981 | """Guess the MIME type of a file.
This module defines two useful functions:
guess_type(url, strict=1) -- guess the MIME type and encoding of a URL.
guess_extension(type, strict=1) -- guess the extension for a given MIME type.
It also contains the following, for tuning the behavior:
Data:
knownfiles -- list of fil... | mit |
micmn/shogun | applications/asp/genomic.py | 31 | 5794 | #
# 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.
#
# Written (W) 2006-2009 Soeren Sonnenburg
# Written (W) 2006-2007 Mi... | gpl-3.0 |
wy65701436/harbor | tests/apitests/python/test_verify_metrics_enabled.py | 2 | 2029 | # coding: utf-8
from __future__ import absolute_import
import unittest
import requests
import testutils
class TestMetricsExist(unittest.TestCase):
golang_basic_metrics = ["go_gc_duration_seconds", "go_goroutines", "go_info", "go_memstats_alloc_bytes"]
metrics = {
'core': golang_basic_metrics + [
... | apache-2.0 |
eaplatanios/tensorflow | tensorflow/python/kernel_tests/array_ops_test.py | 2 | 48609 | # 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 |
suriya/rasikapriya | rasikapriya/admin.py | 1 | 1655 |
import autocomplete_light
from django import forms
from django.contrib import admin
from .models import (Instrument, Artist, Venue, Organization, Festival,
Concert, Performance)
from .widgets import PlacesAutocompleteWidget
class VenueForm(forms.ModelForm):
class Meta:
model = Venue
widget... | mit |
jomolinare/kobocat | onadata/apps/api/tests/viewsets/test_xform_submission_api.py | 5 | 16178 | import os
from django.core.files.uploadedfile import InMemoryUploadedFile
from django.test import TransactionTestCase
from django_digest.test import DigestAuth
from django.contrib.auth.models import AnonymousUser
import simplejson as json
from onadata.apps.api.tests.viewsets.test_abstract_viewset import\
TestAbst... | bsd-2-clause |
TiaLuna/Nexus_S_kernel | tools/perf/scripts/python/syscall-counts-by-pid.py | 11180 | 1927 | # system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os, sys
sys.path.append(os.env... | gpl-2.0 |
aajtodd/zipline | zipline/sources/data_source.py | 33 | 1611 | from abc import (
ABCMeta,
abstractproperty
)
from six import with_metaclass
from zipline.protocol import DATASOURCE_TYPE
from zipline.protocol import Event
class DataSource(with_metaclass(ABCMeta)):
@property
def event_type(self):
return DATASOURCE_TYPE.TRADE
@property
def mapping... | apache-2.0 |
edbrannin/robotframework | atest/testresources/listeners/OldListenAll.py | 28 | 1591 | import os
class OldListenAll:
def __init__(self, *path):
if not path:
path = os.path.join(os.getenv('TEMPDIR'), 'listen_all.txt')
else:
path = ':'.join(path)
self.outfile = open(path, 'w')
def start_suite(self, name, doc):
self.outfile.write("SUITE STA... | apache-2.0 |
pkilambi/ceilometer | ceilometer/tests/alarm/evaluator/test_threshold.py | 2 | 27889 | #
# 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 License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | apache-2.0 |
kubeflow/fairing | containerregistry/client/v1/save_.py | 2 | 3111 | # Copyright 2017 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 |
xen0l/ansible | lib/ansible/modules/network/protocol/net_lldp.py | 104 | 1224 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Ansible by Red Hat, inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
kenshay/ImageScripter | ProgramData/SystemFiles/Python/Lib/site-packages/setuptools/ssl_support.py | 104 | 8220 | import os
import socket
import atexit
import re
import functools
from setuptools.extern.six.moves import urllib, http_client, map, filter
from pkg_resources import ResolutionError, ExtractionError
try:
import ssl
except ImportError:
ssl = None
__all__ = [
'VerifyingHTTPSHandler', 'find_ca_bundle', 'is_a... | gpl-3.0 |
yland/mailman3 | src/mailman/model/tests/test_member.py | 7 | 4281 | # Copyright (C) 2011-2015 by the Free Software Foundation, Inc.
#
# This file is part of GNU Mailman.
#
# GNU Mailman is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
# Software Foundation, either version 3 of the License, or (at you... | gpl-2.0 |
nilmini20s/gem5-2016-08-13 | src/mem/slicc/ast/PairAST.py | 92 | 1810 | # Copyright (c) 2009 The Hewlett-Packard Development Company
# 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... | bsd-3-clause |
georgemarshall/bigcouch | couchjs/scons/scons-local-2.0.1/SCons/Tool/CVS.py | 61 | 2912 | """SCons.Tool.CVS.py
Tool-specific initialization for CVS.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation
#
# ... | apache-2.0 |
kevinr/750book-web | 750book-web-env/lib/python2.7/site-packages/django/contrib/gis/gdal/layer.py | 401 | 8489 | # Needed ctypes routines
from ctypes import c_double, byref
# Other GDAL imports.
from django.contrib.gis.gdal.base import GDALBase
from django.contrib.gis.gdal.envelope import Envelope, OGREnvelope
from django.contrib.gis.gdal.error import OGRException, OGRIndexError, SRSException
from django.contrib.gis.gdal.feature... | mit |
indera/redi | redi/batch.py | 1 | 9666 | """
Functions related to the RediBatch database
"""
__author__ = "University of Florida CTS-IT Team"
__copyright__ = "Copyright 2014, University of Florida"
__license__ = "BSD 3-Clause"
import datetime
import hashlib
import logging
import os
import sqlite3 as lite
import stat
import sys
import time
from lxml import ... | bsd-3-clause |
memtoko/django | django/views/decorators/debug.py | 712 | 2627 | import functools
from django.http import HttpRequest
def sensitive_variables(*variables):
"""
Indicates which variables used in the decorated function are sensitive, so
that those variables can later be treated in a special way, for example
by hiding them when logging unhandled exceptions.
Two f... | bsd-3-clause |
dojemooh/dojecoin | contrib/bitrpc/bitrpc.py | 2348 | 7835 | from jsonrpc import ServiceProxy
import sys
import string
# ===== BEGIN USER SETTINGS =====
# if you do not set these you will be prompted for a password for every command
rpcuser = ""
rpcpass = ""
# ====== END USER SETTINGS ======
if rpcpass == "":
access = ServiceProxy("http://127.0.0.1:8332")
else:
access = Ser... | mit |
aaltinisik/OCBAltinkaya | addons/account_analytic_default/account_analytic_default.py | 57 | 9022 | # -*- 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 GN... | agpl-3.0 |
wfxiang08/changes | tests/changes/api/test_command_details.py | 2 | 5046 | from __future__ import absolute_import
from mock import Mock, patch
from changes.buildsteps.base import BuildStep
from changes.constants import Result, Status
from changes.expanders.base import Expander
from changes.models import (
Command, CommandType, FutureCommand, FutureJobStep, JobStep
)
from changes.testuti... | apache-2.0 |
40023154/2015cd_midterm | static/Brython3.1.1-20150328-091302/Lib/atexit.py | 743 | 1049 | """allow programmer to define multiple exit functions to be executedupon normal program termination.
Two public functions, register and unregister, are defined.
"""
class __loader__(object):
pass
def _clear(*args,**kw):
"""_clear() -> None
Clear the list of previously registered exit functions."""
... | gpl-2.0 |
morenopc/edx-platform | common/lib/xmodule/xmodule/tests/test_error_module.py | 3 | 5975 | """
Tests for ErrorModule and NonStaffErrorModule
"""
import unittest
from xmodule.tests import get_test_system
from xmodule.error_module import ErrorDescriptor, ErrorModule, NonStaffErrorDescriptor
from xmodule.modulestore.xml import CourseLocationGenerator
from xmodule.modulestore.locations import SlashSeparatedCours... | agpl-3.0 |
UQ-UQx/edx-platform_lti | lms/djangoapps/bulk_email/tests/test_tasks.py | 21 | 20659 | """
Unit tests for LMS instructor-initiated background tasks.
Runs tasks on answers to course problems to validate that code
paths actually work.
"""
import json
from uuid import uuid4
from itertools import cycle, chain, repeat
from mock import patch, Mock
from smtplib import SMTPServerDisconnected, SMTPDataError, SM... | agpl-3.0 |
aikonbrasil/ns3-20 | src/core/examples/sample-simulator.py | 85 | 2094 | # -*- Mode:Python; -*-
# /*
# * Copyright (c) 2010 INRIA
# *
# * This program is free software; you can redistribute it and/or modify
# * it under the terms of the GNU General Public License version 2 as
# * published by the Free Software Foundation;
# *
# * This program is distributed in the hope that it will b... | gpl-2.0 |
eblossom/gnuradio | gr-channels/python/channels/__init__.py | 54 | 1350 | #
# Copyright 2012-2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version... | gpl-3.0 |
maestrano/openerp | openerp/addons/hr_timesheet_invoice/hr_timesheet_invoice.py | 8 | 18345 | # -*- 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 |
jhd/spunout | venv/lib/python2.7/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... | gpl-3.0 |
wshallum/ansible | lib/ansible/modules/network/f5/bigip_vlan.py | 32 | 13440 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2016 F5 Networks 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 |
hojel/calibre | src/calibre/gui2/device_drivers/configwidget.py | 15 | 7661 | # -*- coding: utf-8 -*-
__license__ = 'GPL 3'
__copyright__ = '2012, Kovid Goyal <kovid at kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import textwrap
from PyQt5.Qt import (QWidget, QListWidgetItem, Qt, QLabel,
QLineEdit, QCheckBox, QComboBox)
from calibre.gui2 import error_dialog, question_dialo... | gpl-3.0 |
with-git/tensorflow | tensorflow/contrib/graph_editor/tests/transform_test.py | 26 | 8575 | # 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 |
sampepose/flownet2-tf | src/utils.py | 1 | 1593 | import tensorflow as tf
# Thanks, https://github.com/tensorflow/tensorflow/issues/4079
def LeakyReLU(x, leak=0.1, name="lrelu"):
with tf.variable_scope(name):
f1 = 0.5 * (1.0 + leak)
f2 = 0.5 * (1.0 - leak)
return f1 * x + f2 * abs(x)
def average_endpoint_error(labels, predictions):
... | mit |
bwasti/caffe2 | caffe2/python/mkl/convnet_benchmarks.py | 1 | 21125 | ## @package convnet_benchmarks
# Module caffe2.python.convnet_benchmarks
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
"""
Benchmark for common convnets.
Speed on Titan X, with 10 warmup steps and 10 main steps and w... | apache-2.0 |
mbr0wn/gnuradio | gr-trellis/python/trellis/qa_trellis.py | 5 | 4351 | #!/usr/bin/env python
#
# Copyright 2004,2010,2012 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
import math
import os
from gnuradio import gr, gr_unittest, trellis, digital, analog, blocks
fsm_args = {"awgn1o2_4": [2, 4, 4,
... | gpl-3.0 |
rockstor/rockstor-core | src/rockstor/storageadmin/models/config_backup.py | 2 | 1317 | """
Copyright (c) 2012-2020 RockStor, Inc. <http://rockstor.com>
This file is part of RockStor.
RockStor 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 la... | gpl-3.0 |
TRESCLOUD/odoopub | addons/l10n_pl/__init__.py | 340 | 1155 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# l10n_pl module improved for Poland
# by Grzegorz Grzelak grzegorz.g... | agpl-3.0 |
davy39/eric | Preferences/ConfigurationPages/EditorSpellCheckingPage.py | 1 | 5027 | # -*- coding: utf-8 -*-
# Copyright (c) 2008 - 2014 Detlev Offenbach <detlev@die-offenbachs.de>
#
"""
Module implementing the Editor Spellchecking configuration page.
"""
from __future__ import unicode_literals
from PyQt5.QtCore import pyqtSlot
from E5Gui.E5Completers import E5FileCompleter
from E5Gui import E5Fil... | gpl-3.0 |
minhphung171093/GreenERP | openerp/addons/website_forum_doc/controllers/main.py | 54 | 3424 | # -*- coding: utf-8 -*-
from openerp import http
from openerp.http import request
from openerp.addons.website.models.website import slug
class WebsiteDoc(http.Controller):
@http.route(['/forum/how-to', '/forum/how-to/<model("forum.documentation.toc"):toc>'], type='http', auth="public", website=True)
def toc... | gpl-3.0 |
aurelijusb/arangodb | 3rdParty/V8-4.3.61/third_party/python_26/Lib/site-packages/win32comext/shell/demos/browse_for_folder.py | 47 | 1661 | # A couple of samples using SHBrowseForFolder
import sys, os
from win32com.shell import shell, shellcon
import win32gui
# A callback procedure - called by SHBrowseForFolder
def BrowseCallbackProc(hwnd, msg, lp, data):
if msg== shellcon.BFFM_INITIALIZED:
win32gui.SendMessage(hwnd, shellcon.BFFM_SETSELECTIO... | apache-2.0 |
msingh172/youtube-dl | test/test_jsinterp.py | 104 | 3483 | #!/usr/bin/env python
from __future__ import unicode_literals
# Allow direct execution
import os
import sys
import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from youtube_dl.jsinterp import JSInterpreter
class TestJSInterpreter(unittest.TestCase):
def test_basic(se... | unlicense |
XiaosongWei/blink-crosswalk | Tools/Scripts/webkitpy/common/system/systemhost_mock.py | 46 | 3089 | # Copyright (c) 2011 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... | bsd-3-clause |
ndingwall/scikit-learn | sklearn/linear_model/_ridge.py | 2 | 77132 | """
Ridge regression
"""
# Author: Mathieu Blondel <mathieu@mblondel.org>
# Reuben Fletcher-Costin <reuben.fletchercostin@gmail.com>
# Fabian Pedregosa <fabian@fseoane.net>
# Michael Eickenberg <michael.eickenberg@nsup.org>
# License: BSD 3 clause
from abc import ABCMeta, abstractmethod
impor... | bsd-3-clause |
jriehl/numba | examples/blackscholes/blackscholes.py | 2 | 2059 | #! /usr/bin/env python
from __future__ import print_function
import time
import numpy as np
RISKFREE = 0.02
VOLATILITY = 0.30
def cnd(d):
A1 = 0.31938153
A2 = -0.356563782
A3 = 1.781477937
A4 = -1.821255978
A5 = 1.330274429
RSQRT2PI = 0.39894228040143267793994605993438
K = 1.0 / (1.0 +... | bsd-2-clause |
ionutbalutoiu/ironic | ironic/drivers/modules/oneview/management.py | 5 | 6510 | #
# Copyright 2015 Hewlett Packard Development Company, LP
# Copyright 2015 Universidade Federal de Campina Grande
#
# 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://... | apache-2.0 |
ddy88958620/lib | Python/scrapy/petsafe/amazoncom_petsafe.py | 2 | 1919 | from csv import DictReader
from petsafeconfig import CSV_FILENAME
from scrapy.spider import BaseSpider
from scrapy.selector import HtmlXPathSelector
from scrapy.http import Request
from product_spiders.items import Product, ProductLoader
import logging
class AmazonComPetsafeSpider(BaseSpider):
name = 'amazon.c... | apache-2.0 |
direvus/ansible | test/units/playbook/test_playbook.py | 119 | 2239 | # (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 |
xaxa89/mitmproxy | test/mitmproxy/addons/test_readfile.py | 1 | 1691 | from mitmproxy.addons import readfile
from mitmproxy.test import taddons
from mitmproxy.test import tflow
from mitmproxy import io
from mitmproxy import exceptions
from unittest import mock
import pytest
def write_data(path, corrupt=False):
with open(path, "wb") as tf:
w = io.FlowWriter(tf)
for i... | mit |
oliverlee/sympy | sympy/core/tests/test_function.py | 2 | 24032 | from sympy import (Lambda, Symbol, Function, Derivative, Subs, sqrt,
log, exp, Rational, Float, sin, cos, acos, diff, I, re, im,
E, expand, pi, O, Sum, S, polygamma, loggamma, expint,
Tuple, Dummy, Eq, Expr, symbols, nfloat)
from sympy.utilities.pytest import XFAIL, raises
from sympy.abc import ... | bsd-3-clause |
CCI-MOC/nova | nova/api/openstack/compute/legacy_v2/contrib/extended_ips.py | 79 | 3098 | # Copyright 2013 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 agreed to... | apache-2.0 |
openstack-hyper-v-python/numpy | numpy/lib/scimath.py | 17 | 14074 | """
Wrapper functions to more user-friendly calling of certain math functions
whose output data-type is different than the input data-type in certain
domains of the input.
For example, for functions like `log` with branch cuts, the versions in this
module provide the mathematically valid answers in the complex plane::... | bsd-3-clause |
camradal/ansible | lib/ansible/plugins/action/group_by.py | 130 | 1556 | # Copyright 2012, Jeroen Hoekx <jeroen@hoekx.be>
#
# 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 ve... | gpl-3.0 |
mbuesch/toprammer | libtoprammer/chips/microchip8/pic12f629dip8.py | 1 | 2446 | """
# TOP2049 Open Source programming suite
#
# Microchip PIC12F629 DIP8
#
# Copyright (c) 2013 Pavel Stemberk <stemberk@gmail.com>
#
# 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 Foundat... | gpl-2.0 |
Johnzero/OE7 | openerp/addons-modules/survey/report/survey_analysis_report.py | 15 | 28564 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... | agpl-3.0 |
liosha2007/temporary-groupdocs-python3-sdk | groupdocs/models/CreateQuestionnaireResult.py | 2 | 1105 | #!/usr/bin/env python
"""
Copyright 2012 GroupDocs.
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... | apache-2.0 |
saddingtonbaynes/rez | src/rez/cli/search.py | 2 | 7666 | """
Search for packages.
"""
# these are package fields that can be printed using the --format option.
# It's a hardcoded list because some fields, even though they can be printed,
# aren't very useful to see here.
fields = sorted((
'pre_commands', 'tools', 'uuid', 'build_requires', 'version', 'timestamp',
'r... | gpl-3.0 |
subtek/axiomk | 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 |
eduNEXT/edunext-platform | common/djangoapps/student/management/tests/test_transfer_students.py | 3 | 6331 | """
Tests the transfer student management command
"""
import unittest
import ddt
from django.conf import settings
from django.core.management import call_command
from mock import call, patch
from opaque_keys.edx import locator
from six import text_type
from course_modes.models import CourseMode
from shoppingcart.mo... | agpl-3.0 |
prculley/gramps | gramps/plugins/view/repoview.py | 4 | 10108 | # Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2001-2006 Donald N. Allingham
# Copyright (C) 2008 Gary Burton
#
# 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 v... | gpl-2.0 |
emilk/sproxel | distro/common/lib/xml/etree/ElementPath.py | 64 | 9778 | #
# ElementTree
# $Id: ElementPath.py 3375 2008-02-13 08:05:08Z fredrik $
#
# limited xpath support for element trees
#
# history:
# 2003-05-23 fl created
# 2003-05-28 fl added support for // etc
# 2003-08-27 fl fixed parsing of periods in element names
# 2007-09-10 fl new selection engine
# 2007-09-... | bsd-3-clause |
ganadist/chromium-trace | trace-viewer/third_party/pywebsocket/src/test/test_handshake_hybi.py | 29 | 17457 | #!/usr/bin/env python
#
# Copyright 2011, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | bsd-3-clause |
nocnokneo/ninja | misc/write_fake_manifests.py | 11 | 7551 | #!/usr/bin/env python
"""Writes large manifest files, for manifest parser performance testing.
The generated manifest files are (eerily) similar in appearance and size to the
ones used in the Chromium project.
Usage:
python misc/write_fake_manifests.py outdir # Will run for about 5s.
The program contains a hardc... | apache-2.0 |
shrutisingala/ns-3-dev-git-limited-slow-start | src/spectrum/bindings/modulegen__gcc_LP64.py | 16 | 539079 | from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warnings.warn("exception %r in wrapper %s" % (exception, wrapper))
... | gpl-2.0 |
mhaessig/servo | tests/wpt/css-tests/tools/pytest/_pytest/mark.py | 168 | 11093 | """ generic mechanism for marking and selecting python functions. """
import inspect
class MarkerError(Exception):
"""Error in use of a pytest marker/attribute."""
def pytest_namespace():
return {'mark': MarkGenerator()}
def pytest_addoption(parser):
group = parser.getgroup("general")
group._addo... | mpl-2.0 |
larsbutler/coveragepy | tests/test_python.py | 3 | 1065 | # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt
"""Tests of coverage/python.py"""
import os
import sys
from coverage.python import get_zip_bytes
from tests.coveragetest import CoverageTest
class GetZipBytesT... | apache-2.0 |
liangazhou/django-rdp | packages/PyDev/plugins/org.python.pydev.jython_4.4.0.201510052309/Lib/encodings/mac_romanian.py | 593 | 13917 | """ Python Character Mapping Codec mac_romanian generated from 'MAPPINGS/VENDORS/APPLE/ROMANIAN.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... | apache-2.0 |
jensreeder/scikit-bio | skbio/diversity/beta/__init__.py | 1 | 6898 | """
Beta diversity measures (:mod:`skbio.diversity.beta`)
=====================================================
.. currentmodule:: skbio.diversity.beta
This package contains helper functions for working with scipy's pairwise
distance (``pdist``) functions in scikit-bio, and will eventually be expanded
to contain pair... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.