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
bealdav/OCB
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...
agpl-3.0
google-research/google-research
meta_reward_learning/semantic_parsing/nsm/executor_factory.py
1
35727
# coding=utf-8 # Copyright 2021 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
apache-2.0
wzbozon/scikit-learn
sklearn/tests/test_learning_curve.py
225
10791
# Author: Alexander Fabisch <afabisch@informatik.uni-bremen.de> # # License: BSD 3 clause import sys from sklearn.externals.six.moves import cStringIO as StringIO import numpy as np import warnings from sklearn.base import BaseEstimator from sklearn.learning_curve import learning_curve, validation_curve from sklearn.u...
bsd-3-clause
Vladimirek/DPexamples
omronDemo/py/www2plc.py
1
1278
from dataplicity.client.task import Task, onsignal from omronTcpFins import OmronPLC class Www2plc(Task): """PLC data writer""" def pre_startup(self): """Called prior to running the project""" # self.conf contains the data- constants from the conf self.livecfg = self.conf.get('valsetco...
mit
bitifirefly/edx-platform
lms/djangoapps/mobile_api/course_info/views.py
80
3082
""" Views for course info API """ from django.http import Http404 from rest_framework import generics from rest_framework.response import Response from courseware.courses import get_course_info_section_module from static_replace import make_static_urls_absolute, replace_static_urls from openedx.core.lib.xblock_utils i...
agpl-3.0
ravindrapanda/tensorflow
tensorflow/contrib/tensorboard/plugins/__init__.py
148
1069
# Copyright 2016 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
lanyuwen/openthread
tools/harness-automation/cases_R140/router_9_2_12.py
18
1879
#!/usr/bin/env python # # Copyright (c) 2016, The OpenThread Authors. # 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 # notic...
bsd-3-clause
deparkes/gds2ecp
seidel.py
1
21210
# # Poly2Tri # Copyright (c) 2009, Mason Green # http://code.google.com/p/poly2tri/ # # 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 co...
gpl-2.0
FireWRT/OpenWrt-Firefly-Libraries
staging_dir/target-mipsel_1004kc+dsp_uClibc-0.9.33.2/usr/lib/python2.7/test/test_uuid.py
14
22527
import unittest from test import test_support import io import os import uuid def importable(name): try: __import__(name) return True except: return False class TestUUID(unittest.TestCase): last_node = None source2node = {} def test_UUID(self): equal = self.assertE...
gpl-2.0
deepfield/ibis
ibis/sql/postgres/tests/conftest.py
1
1926
# Copyright 2015 Cloudera 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, so...
apache-2.0
shlevy/ghc
utils/checkUniques/check-uniques.py
17
1513
#!/usr/bin/env python3 from __future__ import print_function import os.path import sys import re import glob import io from collections import defaultdict # keyed on unique type, values are lists of (unique, name) pairs def find_uniques(source_files): uniques = defaultdict(lambda: defaultdict(lambda: set())) ...
bsd-3-clause
nuagenetworks/vspk-python
vspk/v6/nubridgeinterface.py
1
24029
# -*- coding: utf-8 -*- # # Copyright (c) 2015, Alcatel-Lucent Inc, 2017 Nokia # 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
tombtc/dashman
lib/pycoin/tests/chainfinder_test.py
22
5931
from pycoin.blockchain.ChainFinder import ChainFinder class BHO(object): def __init__(self, h, previous_block_hash=None, difficulty=10): self.h = h if previous_block_hash is None: previous_block_hash = h-1 self.previous_block_hash = previous_block_hash self.difficulty ...
mit
zvezdan/pip
src/pip/_vendor/urllib3/packages/ordered_dict.py
2040
8935
# Backport of OrderedDict() class that runs on Python 2.4, 2.5, 2.6, 2.7 and pypy. # Passes Python2.7's test suite and incorporates all the latest updates. # Copyright 2009 Raymond Hettinger, released under the MIT License. # http://code.activestate.com/recipes/576693/ try: from thread import get_ident as _get_iden...
mit
kustodian/ansible
lib/ansible/modules/cloud/azure/azure_rm_iothubconsumergroup.py
21
4854
#!/usr/bin/python # # Copyright (c) 2019 Yuwei Zhou, <yuwzho@microsoft.com> # # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
pasqualguerrero/django
django/core/handlers/base.py
234
13346
from __future__ import unicode_literals import logging import sys import types import warnings from django import http from django.conf import settings from django.core import signals, urlresolvers from django.core.exceptions import ( MiddlewareNotUsed, PermissionDenied, SuspiciousOperation, ) from django.db impo...
bsd-3-clause
miptliot/edx-platform
common/djangoapps/xblock_django/api.py
40
2336
""" API methods related to xblock state. """ from xblock_django.models import XBlockConfiguration, XBlockStudioConfiguration def deprecated_xblocks(): """ Return the QuerySet of deprecated XBlock types. Note that this method is independent of `XBlockStudioConfigurationFlag` and `XBlockStudioConfiguration...
agpl-3.0
shubhamdhama/zulip
zproject/default_settings.py
1
16423
from typing import TYPE_CHECKING, Any, Dict, List, Optional if TYPE_CHECKING: from django_auth_ldap.config import LDAPSearch from typing_extensions import TypedDict from .config import DEVELOPMENT, PRODUCTION, get_secret if PRODUCTION: from .prod_settings import EXTERNAL_HOST, ZULIP_ADMINISTRATOR else: ...
apache-2.0
cctaylor/googleads-python-lib
examples/adwords/v201409/advanced_operations/add_ad_customizer.py
1
8099
#!/usr/bin/python # # 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 b...
apache-2.0
valkjsaaa/sl4a
python/src/Lib/test/string_tests.py
55
59642
""" Common tests shared by test_str, test_unicode, test_userstring and test_string. """ import unittest, string, sys, struct from test import test_support from UserList import UserList class Sequence: def __init__(self, seq='wxyz'): self.seq = seq def __len__(self): return len(self.seq) def __getitem__(se...
apache-2.0
jackkiej/SickRage
lib/sqlalchemy/testing/requirements.py
75
17798
# testing/requirements.py # Copyright (C) 2005-2014 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 """Global database feature support policy. Provides decorators to mark tests ...
gpl-3.0
mcardillo55/django
django/contrib/admin/actions.py
395
3316
""" Built-in, globally-available admin actions. """ from django.contrib import messages from django.contrib.admin import helpers from django.contrib.admin.utils import get_deleted_objects, model_ngettext from django.core.exceptions import PermissionDenied from django.db import router from django.template.response impo...
bsd-3-clause
minhtuancn/odoo
openerp/workflow/workitem.py
294
14389
############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2014 OpenERP S.A. (<http://openerp.com). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General P...
agpl-3.0
tersmitten/ansible
test/runner/lib/cloud/vcenter.py
6
5233
"""VMware vCenter plugin for integration tests.""" from __future__ import absolute_import, print_function import os from lib.cloud import ( CloudProvider, CloudEnvironment, CloudEnvironmentConfig, ) from lib.util import ( find_executable, display, ) from lib.docker_util import ( docker_run, ...
gpl-3.0
oceanobservatories/mi-instrument
mi/dataset/parser/test/test_flord_l_wfp_sio.py
7
3522
#!/usr/bin/env python """ @package mi.dataset.parser.test @file marine-integrations/mi/dataset/parser/test/test_flord_l_wfp.py @author Maria Lutz, Mark Worden @brief Test code for a flord_l_wfp_sio data parser """ import os from nose.plugins.attrib import attr from mi.core.exceptions import UnexpectedDataException f...
bsd-2-clause
wenhuizhang/neutron
neutron/db/migration/__init__.py
39
5405
# Copyright 2012 New Dream Network, LLC (DreamHost) # # 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 a...
apache-2.0
ymotongpoo/restroom
0x7d8/RSSReader/mailto.py
1
2150
# -*- coding: utf-8; encoding: utf-8; -*-; """ mailto.py http://labs.unoh.net/2007/06/python_2.html Known issue: - need some change for exceptions """ __author__ = "ymotongpoo <ymotongpoo@gmail.com>" __date__ = "21 Nov. 2008" __credits__ = "0x7d8 -- programming training" __version__ = "$Revision: 0.10" import...
apache-2.0
abtreece/ansible
lib/ansible/utils/module_docs_fragments/asa.py
2
3986
# # (c) 2016, Peter Sprygada <psprygada@ansible.com> # (c) 2016, Patrick Ogenstad <@ogenstad> # # 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 th...
mit
ARG-TLQ/Red-DiscordBot
redbot/cogs/audio/audio_dataclasses.py
3
25683
import contextlib import glob import logging import ntpath import os import posixpath import re from pathlib import Path, PosixPath, WindowsPath from typing import ( AsyncIterator, Callable, Final, Iterator, MutableMapping, Optional, Pattern, Tuple, Union, ) from urllib.parse import...
gpl-3.0
chuijiaolianying/robotx
robotx/core/fabworker.py
4
1400
"""fabric ops""" import os from fabric.api import cd from fabric.api import env from fabric.api import get from fabric.api import put from fabric.api import run from fabric.api import shell_env import robotx # env.user = 'root' env.password = os.environ['all_slave_password'] # env.hosts = ['192.168.122.56', '192....
mit
qgis/QGIS
tests/src/python/test_qgsrelationeditwidget.py
17
17770
# -*- coding: utf-8 -*- """QGIS Unit tests for edit widgets. .. note:: 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. """ __au...
gpl-2.0
stewartsmith/bzr
bzrlib/tests/test_symbol_versioning.py
2
12854
# Copyright (C) 2006-2011 Canonical Ltd # # 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 distribute...
gpl-2.0
Perferom/android_external_chromium_org
tools/symsrc/pdb_fingerprint_from_img.py
179
2017
#!/usr/bin/env python # Copyright (c) 2011 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """This will retrieve a PDBs "fingerprint" from it's corresponding executable image (.dll or .exe). This is used when retrieving t...
bsd-3-clause
GitHublong/hue
desktop/core/ext-py/pysaml2-2.4.0/example/idp2_repoze/modules/login.mako.py
31
2690
# -*- encoding:utf-8 -*- from mako import runtime, filters, cache UNDEFINED = runtime.UNDEFINED __M_dict_builtin = dict __M_locals_builtin = locals _magic_number = 6 _modified_time = 1367126126.936375 _template_filename='htdocs/login.mako' _template_uri='login.mako' _template_cache=cache.Cache(__name__, _modified_time)...
apache-2.0
ryanbauman/bulkioInterfaces
libsrc/testing/components/multiout_attachable/python/multiout_attachable.py
2
9155
#!/usr/bin/env python # # This file is protected by Copyright. Please refer to the COPYRIGHT file # distributed with this source distribution. # # This file is part of REDHAWK bulkioInterfaces. # # REDHAWK bulkioInterfaces is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser Ge...
lgpl-3.0
hiyoku/ccd10
src/ui/projectSettingsWindow/settingsWindow.py
2
3319
from PyQt5 import QtWidgets from src.business.configuration.configProject import ConfigProject from src.business.consoleThreadOutput import ConsoleThreadOutput from src.ui.commons.layout import set_hbox, set_lvbox from src.ui.projectSettingsWindow.widgetsGeography import WidgetsGeography from src.ui.projectSettingsWin...
gpl-3.0
kenwmitchell/ansible-modules-core
utilities/logic/wait_for.py
9
20324
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 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 Licens...
gpl-3.0
stack-of-tasks/rbdlpy
tutorial/lib/python2.7/site-packages/OpenGLContext/scenegraph/box.py
2
5301
"""Box node for use in geometry attribute of Shapes""" from vrml import cache from OpenGLContext.arrays import array from OpenGL.arrays import vbo from OpenGL.GL import * from vrml.vrml97 import basenodes from vrml import protofunctions class Box( basenodes.Box ): """Simple Box object of given size centered about ...
lgpl-3.0
hickford/youtube-dl
youtube_dl/extractor/giantbomb.py
172
2655
from __future__ import unicode_literals import re import json from .common import InfoExtractor from ..utils import ( unescapeHTML, qualities, int_or_none, ) class GiantBombIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?giantbomb\.com/videos/(?P<display_id>[^/]+)/(?P<id>\d+-\d+)' _TEST = {...
unlicense
MrSenko/Kiwi
kiwi_lint/dunder_attributes.py
2
1555
# Copyright (c) 2018 Alexander Todorov <atodorov@MrSenko.com> # Licensed under the GPL 2.0: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html import astroid from pylint import checkers, interfaces from pylint.checkers import utils class DunderClassAttributeChecker(checkers.BaseChecker): __implements__ = (i...
gpl-2.0
dianarg/conlang-util
generator/map/map_gen.py
1
5467
#!/usr/bin/env python # Toy Terrain Generator import sys # import and init pygame import pygame import random pygame.init() class PixelGrid: def __init__(self, size, scale): self.points = [] self.size = size self.scale = scale for i in range(size): self.points.append([...
mit
rdipietro/tensorflow
tensorflow/python/framework/op_def_library_test.py
21
65553
# 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
tjsavage/sfcsdatabase
django/forms/extras/widgets.py
35
4446
""" Extra HTML Widget classes """ import time import datetime import re from django.forms.widgets import Widget, Select from django.utils import datetime_safe from django.utils.dates import MONTHS from django.utils.safestring import mark_safe from django.utils.formats import get_format from django.conf import setting...
bsd-3-clause
anirudhSK/chromium
third_party/tlslite/tlslite/integration/ClientHelper.py
86
6851
""" A helper class for using TLS Lite with stdlib clients (httplib, xmlrpclib, imaplib, poplib). """ from tlslite.Checker import Checker class ClientHelper: """This is a helper class used to integrate TLS Lite with various TLS clients (e.g. poplib, smtplib, httplib, etc.)""" def __init__(self, ...
bsd-3-clause
defionscode/ansible
lib/ansible/constants.py
16
7696
# Copyright: (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.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 import os from ast import l...
gpl-3.0
FHannes/intellij-community
python/helpers/py3only/docutils/languages/fi.py
52
1958
# $Id: fi.py 4564 2006-05-21 20:44:42Z wiemann $ # Author: Asko Soukka <asko.soukka@iki.fi> # Copyright: This module has been placed in the public domain. # New language mappings are welcome. Before doing a new translation, please # read <http://docutils.sf.net/docs/howto/i18n.html>. Two files must be # translated f...
apache-2.0
pgmpy/pgmpy
pgmpy/utils/sets.py
2
1145
from collections.abc import Iterable from itertools import combinations, chain def _variable_or_iterable_to_set(x): """ Convert variable, set, or iterable x to a frozenset. If x is None, returns the empty set. Parameters --------- x : None, str or Iterable[str] Returns ------- f...
mit
jjas0nn/solvem
tensorflow/lib/python2.7/site-packages/numpy/core/einsumfunc.py
31
35539
""" Implementation of optimized einsum. """ from __future__ import division, absolute_import, print_function from numpy.core.multiarray import c_einsum from numpy.core.numeric import asarray, asanyarray, result_type __all__ = ['einsum', 'einsum_path'] einsum_symbols = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRST...
mit
mkim48/TensorDB
tensordb_pkg/algorithms/tucker.py
2
11252
#!/usr/bin/python # # tucker.py runs Tucker Decomposition. Given the input tensor, perform the tucker decomposition. The Tucker decomposition takes HOSVD of the input tensor as the initial factor matrices and core. HOSVD of the input tensor is obtained by running dta_full.py without an old tensor. # # Parameters # - t...
agpl-3.0
BinPy/BinPy
BinPy/examples/source/ic/Series_4000/IC4002.py
5
1249
# -*- coding: utf-8 -*- # <nbformat>3.0</nbformat> # <headingcell level=2> # Usage of IC 4002 # <codecell> from __future__ import print_function from BinPy import * # <codecell> # Usage of IC 4002: ic = IC_4002() print(ic.__doc__) # <codecell> # The Pin configuration is: inp = {2: 0, 3: 0, 4: 0, 5: 0, 7: 0, ...
bsd-3-clause
epidataio/epidata-community
ipython/home/tutorials/sensor_data_query.py
1
5017
############################ # Import Required Modules # ############################ import argparse import base64 from datetime import datetime, timedelta import httplib import json import numpy as np from pytz import UTC, timezone import random from decimal import Decimal import struct import time from time import ...
apache-2.0
khink/xhtml2pdf
xhtml2pdf/w3c/cssDOMElementInterface.py
79
4201
#!/usr/bin/env python ##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ##~ Copyright (C) 2002-2004 TechGame Networks, LLC. ##~ ##~ This library is free software; you can redistribute it and/or ##~ modify it under the terms of the BSD style License as found in the ##~ LICENSE file included with this distribution....
apache-2.0
unt-libraries/coda
coda/coda_mdstore/tests/test_urls.py
1
3321
from django.contrib import sitemaps from django.urls import resolve from django.conf import settings import pytest from coda_mdstore import resourcesync from coda_mdstore import views def test_index(): assert resolve('/').func == views.index def test_all_bags(): assert resolve('/bag/').func == views.all_b...
bsd-3-clause
eeshangarg/oh-mainline
vendor/packages/Django/django/contrib/auth/tests/models.py
94
5106
from django.conf import settings from django.contrib.auth import get_user_model from django.contrib.auth.models import (Group, User, SiteProfileNotAvailable, UserManager) from django.contrib.auth.tests.utils import skipIfCustomUser from django.test import TestCase from django.test.utils import override_settings fro...
agpl-3.0
Donkyhotay/MoonPy
zope/app/publisher/browser/tests/testi18nfileresource.py
1
5545
############################################################################## # # Copyright (c) 2001, 2002 Zope Corporation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # T...
gpl-3.0
irblsensitivity/irblsensitivity
scripts/analysis/MWU_Project_EMSE.py
1
9231
#-*- coding: utf-8 -*- ''' Created on 2017. 02. 12 Updated on 2017. 02. 12 ''' from __future__ import print_function import os import re import matplotlib # Force matplotlib to not use any Xwindows backend. matplotlib.use('Agg') from scipy.stats import mannwhitneyu, pearsonr from ExpBase import ExpBase ...
apache-2.0
epam/DLab
infrastructure-provisioning/src/general/lib/aws/meta_lib.py
1
37481
# ***************************************************************************** # # Copyright (c) 2016, EPAM SYSTEMS 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.apac...
apache-2.0
bestvibes/neo4j-social-network
env/lib/python2.7/encodings/mac_turkish.py
593
13769
""" Python Character Mapping Codec mac_turkish generated from 'MAPPINGS/VENDORS/APPLE/TURKISH.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,input...
mit
icic13/IntroductiontoComputerScienceandProgrammingSpring2011
Problem Set 1: Paying Off Credit Card Debt/Problem Set 1.py
1
1075
#Rana principal = float( raw_input('Enter the outstanding balance on your credit card: ')) print(principal) interest_rate = float( raw_input('Enter the annual credit card interest rate as decimal: ')) print(interest_rate) min_monthly_payment_rate = float( raw_input('Enter the minimal monthly payment rate as...
gpl-3.0
acq4/acq4
acq4/analysis/modules/pbm_ImageAnalysis/ctrlPhysiologyTemplate.py
3
10355
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'acq4/analysis/modules/pbm_ImageAnalysis/ctrlPhysiologyTemplate.ui' # # Created by: PyQt4 UI code generator 4.11.4 # # WARNING! All changes made in this file will be lost! from acq4.util import Qt try: _fromUtf8 = Qt.QString.fromUtf8 ex...
mit
minzhang28/docker-py
tests/helpers.py
1
3669
import os import os.path import shutil import tarfile import tempfile import unittest import docker import six BUSYBOX = 'busybox:buildroot-2014.02' EXEC_DRIVER = [] def make_tree(dirs, files): base = tempfile.mkdtemp() for path in dirs: os.makedirs(os.path.join(base, path)) for path in files:...
apache-2.0
morpheby/levelup-by
common/lib/xmodule/xmodule/modulestore/tests/test_xml.py
16
1779
import os.path from nose.tools import assert_raises, assert_equals # pylint: disable=E0611 from xmodule.course_module import CourseDescriptor from xmodule.modulestore.xml import XMLModuleStore from xmodule.modulestore import XML_MODULESTORE_TYPE from .test_modulestore import check_path_to_location from xmodule.test...
agpl-3.0
iABC2XYZ/abc
DM_RFGAP/GenPartilces.py
1
3025
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Wed Jul 26 12:23:48 2017 @author: A """ import tensorflow as tf import numpy as np from BetaGammaC import * from RFCal import * from ConstPhysics import * def GenGammaT5Twiss(alphaT2D,betaT2D): gammaT2D=tf.div(1.+tf.square(alphaT2D),betaT2D) retur...
gpl-3.0
redhat-openstack/neutron
neutron/agent/linux/ovs_lib.py
2
22922
# Copyright 2011 VMware, 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 ...
apache-2.0
cjaymes/pyscap
src/scap/model/oval_5/defs/linux/SlackwarePkgInfoObjectElement.py
1
1047
# Copyright 2016 Casey Jaymes # This file is part of PySCAP. # # PySCAP 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. # # PySCAP is ...
gpl-3.0
alanfranz/duplicity
duplicity/collections.py
3
43704
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright 2002 Ben Escoto <ben@emerose.org> # Copyright 2007 Kenneth Loafman <kenneth@loafman.com> # # This file is part of duplicity. # # Duplicity is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License...
gpl-2.0
fmfn/UnbalancedDataset
examples/under-sampling/plot_illustration_tomek_links.py
2
3180
""" ============================================== Illustration of the definition of a Tomek link ============================================== This example illustrates what is a Tomek link. """ # Authors: Guillaume Lemaitre <g.lemaitre58@gmail.com> # License: MIT # %% print(__doc__) import matplotlib.pyplot as pl...
mit
junh1024/Reaper-Surround
Scripts/mutagen/_util.py
2
14731
# Copyright 2006 Joe Wreschnig # # 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. """Utility classes for Mutagen. You should not rely on the interfaces here being stable. They are int...
gpl-3.0
prutseltje/ansible
lib/ansible/executor/action_write_locks.py
140
1911
# (c) 2016 - Red Hat, Inc. <info@ansible.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later versi...
gpl-3.0
MakMukhi/grpc
src/python/grpcio/grpc/framework/common/__init__.py
901
1528
# Copyright 2015, 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 f...
bsd-3-clause
mparus/android_kernel_huawei_msm8916-caf
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/SchedGui.py
12980
5411
# SchedGui.py - Python extension for perf script, basic GUI code for # traces drawing and overview. # # Copyright (C) 2010 by Frederic Weisbecker <fweisbec@gmail.com> # # This software is distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. ...
gpl-2.0
imcomking/Convolutional-GRU-keras-extension-
examples/mnist_mlp.py
7
1724
from __future__ import absolute_import from __future__ import print_function import numpy as np np.random.seed(1337) # for reproducibility from keras.datasets import mnist from keras.models import Sequential from keras.layers.core import Dense, Dropout, Activation from keras.optimizers import SGD, Adam, RMSprop from ...
mit
ddayguerrero/blogme
flask/lib/python3.4/site-packages/whoosh/query/__init__.py
96
1843
# Copyright 2012 Matt Chaput. 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...
mit
CyanogenMod/android_kernel_motorola_msm8974
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/SchedGui.py
12980
5411
# SchedGui.py - Python extension for perf script, basic GUI code for # traces drawing and overview. # # Copyright (C) 2010 by Frederic Weisbecker <fweisbec@gmail.com> # # This software is distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. ...
gpl-2.0
justathoughtor2/atomicApe
cygwin/lib/python2.7/optparse.py
47
61205
"""A powerful, extensible, and easy-to-use option parser. By Greg Ward <gward@python.net> Originally distributed as Optik. For support, use the optik-users@lists.sourceforge.net mailing list (http://lists.sourceforge.net/lists/listinfo/optik-users). Simple usage example: from optparse import OptionParser pa...
gpl-3.0
taedla01/MissionPlanner
Lib/encodings/cp866.py
93
35350
""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP866.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_map) def decode(self,input,errors=...
gpl-3.0
aaronr/Quantum-GIS
python/plugins/fTools/tools/doGeoprocessing.py
1
64763
# -*- coding: utf-8 -*- #----------------------------------------------------------- # # fTools # Copyright (C) 2008-2011 Carson Farmer # EMAIL: carson.farmer (at) gmail.com # WEB : http://www.ftools.ca/fTools.html # # A collection of data management and analysis tools for vector data # # Geoprocessing functions adap...
gpl-2.0
OPM/opm-cmake
python/pybind11/tests/test_iostream.py
17
5268
from pybind11_tests import iostream as m import sys from contextlib import contextmanager try: # Python 3 from io import StringIO except ImportError: # Python 2 try: from cStringIO import StringIO except ImportError: from StringIO import StringIO try: # Python 3.4 from con...
gpl-3.0
mallconnectionorg/openerp
rrhh/currency_rate_update/__openerp__.py
3
3672
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (c) 2008 Camtocamp SA # @author JB Aubort, Nicolas Bessi, Joel Grand-Guillaume # European Central Bank and Polish National Bank invented by Grzegorz Grzelak # Ported to OpenERP 7.0 by Lorenzo...
agpl-3.0
karies/root
bindings/pyroot_experimental/cppyy/cppyy/test/test_regression.py
3
4532
import py, os, sys from pytest import raises from .support import setup_make class TestREGRESSION: helpout = [] def setup_class(cls): import cppyy def stringpager(text, cls=cls): cls.helpout.append(text) import pydoc pydoc.pager = stringpager def test01_kdcr...
lgpl-2.1
yedidiaklein/local_video_directory
classes/task/googleSpeech/google/protobuf/python/google/protobuf/descriptor_database.py
19
6295
# Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # https://developers.google.com/protocol-buffers/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redi...
gpl-3.0
yjhjstz/gyp
test/actions/gyptest-default.py
53
2338
#!/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 simple actions when using the default build target. """ import TestGyp test = TestGyp.TestGyp(workdir='workarea_default') te...
bsd-3-clause
umayrh/sketchy-polytopes
python/evolvingdag/setup.py
1
5286
from __future__ import print_function from glob import glob from os.path import basename from os.path import splitext import os import sys import pkg_resources import platform from setuptools import setup, find_packages, Command from setuptools.command.install_egg_info import install_egg_info as _install_egg_info fr...
gpl-3.0
indera/titanium_mobile
node_modules/ioslib/node_modules/node-ios-device/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
AdaptivePELE/AdaptivePELE
AdaptivePELE/tests/testAtomset.py
1
29178
from __future__ import absolute_import, division, print_function, unicode_literals from io import open import os import unittest import mdtraj import numpy as np import AdaptivePELE.atomset.atomset as atomset from AdaptivePELE.atomset import RMSDCalculator from AdaptivePELE.atomset import SymmetryContactMapEvaluator as...
mit
infobloxopen/infoblox-netmri
infoblox_netmri/api/remote/models/device_disk_utilization_remote.py
1
2708
from ..remote import RemoteModel from infoblox_netmri.utils.utils import check_api_availability class DeviceDiskUtilizationRemote(RemoteModel): """ This table list out entries of Device Disk Utilization | ``HRStorageID:`` The internal NetMRI identifier of the high rate storage in the device disk utiliz...
apache-2.0
elba7r/frameworking
frappe/tests/test_filemanager.py
70
2927
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe import os import unittest from frappe.utils.file_manager import save_file, get_file, get_files_path test_content1 = 'Hello' test_content2 = 'Hello World' def make...
mit
waylonflinn/bquery
bquery/benchmarks/bench_groupby.py
2
2465
from __future__ import print_function # bench related imports import numpy as np import shutil import bquery import pandas as pd import itertools as itt import cytoolz import cytoolz.dicttoolz from toolz import valmap, compose from cytoolz.curried import pluck import blaze as blz # other imports import contextlib impor...
bsd-3-clause
christophlsa/odoo
addons/sale_stock/report/sale_report.py
231
2100
# -*- 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...
agpl-3.0
crosswalk-project/chromium-crosswalk-efl
tools/telemetry/telemetry/value/summary.py
58
6381
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from collections import defaultdict from telemetry.value import failure from telemetry.value import merge_values from telemetry.value import skip class Su...
bsd-3-clause
johren/RackHD
test/tests/api/redfish_1_0/schema_tests.py
15
4301
from config.redfish1_0_config import * from modules.logger import Log from on_http_redfish_1_0 import RedfishvApi as redfish from on_http_redfish_1_0 import rest from datetime import datetime from proboscis.asserts import assert_equal from proboscis.asserts import assert_false from proboscis.asserts import assert_raise...
apache-2.0
dwightgunning/django
django/templatetags/tz.py
277
5572
from datetime import datetime, tzinfo from django.template import Library, Node, TemplateSyntaxError from django.utils import six, timezone try: import pytz except ImportError: pytz = None register = Library() # HACK: datetime is an old-style class, create a new-style equivalent # so we can define additio...
bsd-3-clause
luceatnobis/youtube-dl
youtube_dl/extractor/fxnetworks.py
47
2564
# coding: utf-8 from __future__ import unicode_literals from .adobepass import AdobePassIE from ..utils import ( update_url_query, extract_attributes, parse_age_limit, smuggle_url, ) class FXNetworksIE(AdobePassIE): _VALID_URL = r'https?://(?:www\.)?(?:fxnetworks|simpsonsworld)\.com/video/(?P<id>...
unlicense
hoettges/QKan
qkan/tools/dialogs/__init__.py
1
3551
import logging import os from typing import TYPE_CHECKING, Optional from qgis.PyQt.QtWidgets import QDialog, QFileDialog, QLineEdit, QPushButton, QWidget from qkan.database.dbfunc import DBConnection logger = logging.getLogger("QKan.tools.dialogs") if TYPE_CHECKING: from qkan.plugin import QKanPlugin class QKa...
gpl-3.0
Niektory/fifengine
engine/python/fife/extensions/pychan/widgets/widget.py
1
34152
# -*- coding: utf-8 -*- # #################################################################### # Copyright (C) 2005-2013 by the FIFE team # http://www.fifengine.net # This file is part of FIFE. # # FIFE is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public #...
lgpl-2.1
jart/tensorflow
tensorflow/contrib/constrained_optimization/python/constrained_optimizer.py
13
8208
# Copyright 2018 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
jj-umn/tools-iuc
tools/query_tabular/filters.py
12
6738
#!/usr/binsenv python from __future__ import print_function import re import sys class LineFilter(object): def __init__(self, source, filter_dict): self.source = source self.filter_dict = filter_dict self.func = lambda i, l: l.rstrip('\r\n') if l else None self.src_lines = [] ...
mit
blisseth/ThinkStats2
code/cumulative.py
67
6252
"""This file contains code used in "Think Stats", by Allen B. Downey, available from greenteapress.com Copyright 2010 Allen B. Downey License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html """ from __future__ import print_function, division import numpy as np import nsfg import first import thinkstats2 import thi...
gpl-3.0
israeleriston/scientific-week
backend/venv/lib/python3.5/site-packages/sqlalchemy/engine/strategies.py
32
9462
# engine/strategies.py # Copyright (C) 2005-2017 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 """Strategies for creating new instances of Engine types. These are semi-priva...
mit
moniker-dns/debian-beaver
beaver/tests/test_transport_config.py
4
2499
# -*- coding: utf-8 -*- import fakeredis import logging import mock import tempfile import unittest import beaver from beaver.config import BeaverConfig from beaver.transports import create_transport from beaver.transports.base_transport import BaseTransport class DummyTransport(BaseTransport): pass with mock....
mit