repo_name
stringlengths
5
100
path
stringlengths
4
294
copies
stringclasses
990 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
ahmadio/edx-platform
common/djangoapps/student/tests/test_userstanding.py
106
3869
""" These are tests for disabling and enabling student accounts, and for making sure that students with disabled accounts are unable to access the courseware. """ import unittest from student.tests.factories import UserFactory, UserStandingFactory from student.models import UserStanding from django.conf import setting...
agpl-3.0
schleichdi2/OPENNFR-6.1-CORE
bitbake/lib/bb/ui/uievent.py
4
5163
# ex:ts=4:sw=4:sts=4:et # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- # # Copyright (C) 2006 - 2007 Michael 'Mickey' Lauer # Copyright (C) 2006 - 2007 Richard Purdie # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License versi...
gpl-2.0
yugang/crosswalk-test-suite
misc/wrt-androidarm-UA-tests/inst.wgt.py
136
6856
#!/usr/bin/env python import os import shutil import glob import time import sys import subprocess import string from optparse import OptionParser, make_option SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) PKG_NAME = os.path.basename(SCRIPT_DIR) PARAMETERS = None #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=...
bsd-3-clause
SeaFalcon/Musicool_Pr
lib/sqlalchemy/testing/warnings.py
33
1682
# testing/warnings.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 from __future__ import absolute_import import warnings from .. import exc as sa...
apache-2.0
skyscrapers/monitoring-plugins
check_elb.py
1
1132
#!/usr/bin/env python # Written by filip@skyscrape.rs # 2014-04-29 import json import os import sys from pprint import pprint import commands paramList = sys.argv if len(paramList) <= 1: print "USAGE " + paramList[0] + " <ELB name>" sys.exit(2) elbName = paramList[1] cmd = "/usr/local/bin/aws --profile nag...
gpl-3.0
jayvdb/mwparserfromhell
src/mwparserfromhell/nodes/comment.py
2
1655
# Copyright (C) 2012-2020 Ben Kurtovic <ben.kurtovic@gmail.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
sappjw/gourmet
gourmet/gglobals.py
6
6335
import os, os.path, gobject, re, gtk import tempfile from gdebug import debug from OptionParser import args from util import windows tmpdir = tempfile.gettempdir() if args.gourmetdir: gourmetdir = args.gourmetdir debug("User specified gourmetdir %s"%gourmetdir,0) else: if os.name =='nt': # Under W...
gpl-2.0
GiedriusM/openthread
tools/spinel-cli/spinel/config.py
5
3527
# # 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 # notice, this list of ...
bsd-3-clause
ctiller/grpc
tools/run_tests/xds_k8s_test_driver/framework/xds_flags.py
5
3275
# Copyright 2020 gRPC authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing...
apache-2.0
thomasbarillot/DAQ
HHGMonitor/ADQ14_FWDAQ_streaming_example.py
1
10160
#!/usr/bin/env python3 # # Copyright 2015 Signal Processing Devices Sweden AB. All rights reserved. # # Description: ADQ14 FWDAQ streaming example # Documentation: # import numpy as np import ctypes as ct import matplotlib.pyplot as plt import sys import time import os sys.path.insert(1, os.path.dirname(os.path.re...
mit
caesar2164/edx-platform
common/djangoapps/third_party_auth/tests/test_views.py
13
6457
""" Test the views served by third_party_auth. """ import ddt from lxml import etree from onelogin.saml2.errors import OneLogin_Saml2_Error import unittest from django.conf import settings from .testutil import AUTH_FEATURE_ENABLED, SAMLTestCase # Define some XML namespaces: from third_party_auth.tasks import SAML_...
agpl-3.0
ytanay/thinglang
setup.py
1
1198
"""A setuptools based setup module. See: https://packaging.python.org/en/latest/distributing.html https://github.com/pypa/sampleproject """ # To use a consistent encoding from codecs import open from os import path # Always prefer setuptools over distutils from setuptools import setup, find_packages here = path.abs...
mit
Lujeni/ansible
lib/ansible/modules/network/cloudengine/ce_vrf.py
13
10999
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
gpl-3.0
SkyLined/headsup
decode/GIF_EXTENSION_COMMENT.py
1
1171
# Copyright 2010 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 or agreed to ...
apache-2.0
tudorvio/nova
nova/virt/hyperv/vmutils.py
18
32674
# Copyright (c) 2010 Cloud.com, Inc # Copyright 2012 Cloudbase Solutions Srl / Pedro Navarro Perez # 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 # # ...
apache-2.0
setminami/TokageUtil
util/vectorutil.py
1
6987
from __future__ import absolute_import from __future__ import division from __future__ import print_function import os, traceback, glob, threading import datetime as dt import numpy as np from . import printutil as pu DEFAULTVECTOR_DIR = os.path.expanduser('~/workspace/img-buff/motions/vector') MACROSQURE = 16 # 人間が...
apache-2.0
dfunckt/django
tests/forms_tests/field_tests/test_timefield.py
42
2043
from __future__ import unicode_literals import datetime from django.forms import TimeField, ValidationError from django.test import SimpleTestCase from . import FormFieldAssertionsMixin class TimeFieldTest(FormFieldAssertionsMixin, SimpleTestCase): def test_timefield_1(self): f = TimeField() s...
bsd-3-clause
lebauce/artub
gouzi/__init__.py
1
12352
# Glumol - An adventure game creator # Copyright (C) 1998-2008 Sylvain Baubeau & Alexis Contour # This file is part of Glumol. # Glumol 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 th...
gpl-2.0
Starch/paperwork
scripts/simulate-workdir_3d.py
2
8178
#!/usr/bin/env python3 import csv import os import multiprocessing import multiprocessing.pool import sys import tempfile import traceback import threading import gi gi.require_version('Gdk', '3.0') gi.require_version('PangoCairo', '1.0') gi.require_version('Poppler', '0.18') from paperwork_backend import config fro...
gpl-3.0
beernarrd/gramps
gramps/gen/filters/rules/note/__init__.py
4
1568
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2002-2006 Donald N. Allingham # Copyright (C) 2007 Brian G. Matherly # # 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; ...
gpl-2.0
toobaz/pandas
pandas/core/groupby/generic.py
1
62983
""" Define the SeriesGroupBy and DataFrameGroupBy classes that hold the groupby interfaces (and some implementations). These are user facing as the result of the ``df.groupby(...)`` operations, which here returns a DataFrameGroupBy object. """ from collections import OrderedDict, abc, namedtuple import copy import fun...
bsd-3-clause
googlearchive/titan
titan/files/mixins/versions.py
1
61817
#!/usr/bin/env python # Copyright 2012 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 ...
apache-2.0
Zhongqilong/kbengine
kbe/src/lib/python/Lib/lib2to3/fixes/fix_renames.py
203
2221
"""Fix incompatible renames Fixes: * sys.maxint -> sys.maxsize """ # Author: Christian Heimes # based on Collin Winter's fix_import # Local imports from .. import fixer_base from ..fixer_util import Name, attr_chain MAPPING = {"sys": {"maxint" : "maxsize"}, } LOOKUP = {} def alternates(members): re...
lgpl-3.0
lenstr/rethinkdb
external/v8_3.30.33.16/testing/gtest/scripts/pump.py
2471
23673
#!/usr/bin/env python # # Copyright 2008, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list...
agpl-3.0
lseyesl/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/layout_tests/reftests/extract_reference_link.py
196
2272
# 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
zoggn/kernel_tcl_msm8610
Documentation/target/tcm_mod_builder.py
4981
41422
#!/usr/bin/python # The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD # # Copyright (c) 2010 Rising Tide Systems # Copyright (c) 2010 Linux-iSCSI.org # # Author: nab@kernel.org # import os, sys import subprocess as sub import string import re import optparse tcm_dir = "" fabric_ops...
gpl-2.0
RazielSun/juma-editor
editor/lib/juma/SearchView/ArrayView.py
2
3871
#!/usr/bin/env python from PySide import QtGui, QtCore from PySide.QtCore import Qt, QEventLoop, QEvent, QObject from juma.core import * from juma.core.ModelManager import * from juma.qt.helpers import addWidgetWithLayout, restrainWidgetToScreen from juma.qt.IconCache import getIcon from ui.array_view_container...
mit
miguelparaiso/PracticaOdoo
addons/base_report_designer/plugin/openerp_report_designer/bin/script/Expression.py
384
4146
######################################################################### # # Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com # Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>). # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser Gene...
agpl-3.0
redhawkci/omniEvents
test/EventChannelAdmin_idl.py
2
2945
# Python stubs generated by omniidl from ../idl/EventChannelAdmin.idl import omniORB, _omnipy from omniORB import CORBA, PortableServer _0_CORBA = CORBA _omnipy.checkVersion(2,0, __file__) # #include "CosNaming.idl" import CosNaming_idl _0_CosNaming = omniORB.openModule("CosNaming") _0_CosNaming__POA = omniORB.openM...
lgpl-2.1
vincent-noel/SigNetSim
signetsim/json/validators/__init__.py
2
1148
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2014-2017 Vincent Noel (vincent.noel@butantan.gov.br) # # This file is part of libSigNetSim. # # libSigNetSim 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 Fou...
agpl-3.0
roadmapper/ansible
lib/ansible/modules/cloud/vmware/vmware_tag.py
10
8738
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2018, Ansible Project # Copyright: (c) 2018, Abhijeet Kasurde <akasurde@redhat.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__ = ty...
gpl-3.0
lattwood/phantomjs
src/breakpad/src/tools/gyp/test/builddir/gyptest-default.py
147
2348
#!/usr/bin/env python # Copyright (c) 2009 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. """ Verify the settings that cause a set of programs to be created in a specific build directory, and that no intermediate built files get c...
bsd-3-clause
michalkurka/h2o-3
h2o-py/tests/testdir_parser/pyunit_load_sparse.py
6
1288
#!/usr/bin/env python from __future__ import division import sys; sys.path.insert(1, "../..") import h2o from tests import pyunit_utils def test_load_sparse(): try: import scipy.sparse as sp except ImportError: return A = sp.csr_matrix([[1, 2, 0, 5.5], [0, 0, 3, 6.7], [4, 0, 5, 0]]) f...
apache-2.0
lafranceinsoumise/api-django
agir/system_pay/soap_client.py
1
5607
import uuid from datetime import datetime import hmac from base64 import b64encode from django.conf import settings from django.utils import timezone from zeep import Client, xsd from agir.payments.models import Subscription from agir.system_pay import SystemPayError from agir.system_pay.utils import get_recurrence_r...
agpl-3.0
belltailjp/scikit-learn
sklearn/datasets/base.py
196
18554
""" Base IO code for all datasets """ # Copyright (c) 2007 David Cournapeau <cournape@gmail.com> # 2010 Fabian Pedregosa <fabian.pedregosa@inria.fr> # 2010 Olivier Grisel <olivier.grisel@ensta.org> # License: BSD 3 clause import os import csv import shutil from os import environ from os.pa...
bsd-3-clause
TrentHouliston/VisualMesh
learning/test.py
1
3050
#!/usr/bin/env python3 import os import re import math import json import yaml import numpy as np import tensorflow as tf from . import dataset def test(sess, network, mesh_type, mesh_size, model_dir, input_path, output_path): # Initialise global variables ...
mit
aliyun/aliyun-spark-deploy-tool
bin/core/nginx.py
2
1545
#!/usr/bin/python #coding=utf-8 import sys import os import utils from core.common import GlobalVar from config_nginx import generate_config_file def copy_file(opts, src_file, ip, dst): try: os.system("sshpass -p %s scp -r %s %s %s@%s:%s" % (opts.pwd, " ".join(utils.ssh_args()), src_file, opts.user, ip, ds...
artistic-2.0
ruud-v-a/rhythmbox
plugins/rbzeitgeist/rbzeitgeist.py
1
6528
# -.- coding: utf-8 -.- # Copyright © 2009 Markus Korn <thekorn@gmx.de> # Copyright © 2010 Laszlo Pandy <laszlok2@gmail.com> # Copyright © 2011 Michal Hruby <michal.mhr@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 publishe...
gpl-2.0
DenniFurst3/Dennis
py/openage/convert/fix_data.py
46
1296
# data fixing script # # as you can imagine, the data entries may contain some semi-correct # values, which we need to adapt. this is done in this file. def fix_data(data): """ updates given input with modifications. input: empiresdat object, vanilla, fully read. output: empiresdat object, fixed. ...
gpl-3.0
lizan/envoy
source/extensions/filters/network/kafka/protocol/generator.py
4
25849
#!/usr/bin/python # Main library file containing all the protocol generation logic. def generate_main_code(type, main_header_file, resolver_cc_file, metrics_header_file, input_files): """ Main code generator. Takes input files and processes them into structures representing a Kafka message (request or respo...
apache-2.0
cldershem/osf.io
website/addons/dropbox/model.py
11
11235
# -*- coding: utf-8 -*- import os import base64 import logging import pymongo from modularodm import fields from framework.auth import Auth from website.addons.base import exceptions from website.addons.base import AddonUserSettingsBase, AddonNodeSettingsBase, GuidFile from website.addons.base import StorageAddonBas...
apache-2.0
maximon93/fabric-bolt
fabric_bolt/web_hooks/tests/test_hooks.py
10
5201
""" This file demonstrates writing tests using the unittest module. These will pass when you run "manage.py test". Replace this with more appropriate tests for your application. """ from django.core.urlresolvers import reverse from django.test import TestCase from django.test.utils import override_settings from django...
mit
jeffzheng1/tensorflow
tensorflow/python/kernel_tests/embedding_ops_test.py
3
26642
# 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
steelcowboy/PyFlowChart
pyflowchart/interface/modify_interface.py
1
11599
import gi gi.require_version('Gtk', '3.0') from gi.repository import Gtk from collections import OrderedDict GRID_MARGIN = 5 ICON_SIZE = Gtk.IconSize.MENU class ModifyGrid(Gtk.Grid): def __init__(self): Gtk.Grid.__init__(self) self.generate_labels() self.generate_entries() self.at...
bsd-3-clause
YoannDupont/SEM
sem/IO/keyIO.py
1
3886
# -*- coding: utf-8 -*- """ file: keyIO.py Description: an IO module for CoNLL-formatted files when column identifiers are available. author: Yoann Dupont MIT License Copyright (c) 2018 Yoann Dupont Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated docume...
mit
Thoshh/wapad
lib/python2.7/site-packages/django/contrib/postgres/fields/hstore.py
151
2771
import json from django.contrib.postgres import forms, lookups from django.contrib.postgres.fields.array import ArrayField from django.core import exceptions from django.db.models import Field, TextField, Transform from django.utils import six from django.utils.translation import ugettext_lazy as _ __all__ = ['HStore...
mit
jpetto/olympia
src/olympia/zadmin/decorators.py
7
1616
import functools from django.core.exceptions import PermissionDenied from olympia.access.acl import action_allowed from olympia.amo.decorators import login_required def admin_required(reviewers=False, theme_reviewers=False): """ Admin, or someone with AdminTools:View, required. If reviewers=True ...
bsd-3-clause
solintegra/addons
portal/tests/__init__.py
261
1078
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
agpl-3.0
rintoj/ai
demo/valueIterationAgents.py
1
3503
# valueIterationAgents.py # ----------------------- # Licensing Information: Please do not distribute or publish solutions to this # project. You are free to use and extend these projects for educational # purposes. The Pacman AI projects were developed at UC Berkeley, primarily by # John DeNero (denero@cs.berkeley.edu...
mit
MISP/misp-modules
misp_modules/modules/import_mod/cuckooimport.py
2
26979
import json import base64 import io import logging import posixpath import stat import tarfile import zipfile from pymisp import MISPEvent, MISPObject, MISPAttribute from pymisp.tools import make_binary_objects from collections import OrderedDict log = logging.getLogger(__name__) misperrors = {'error': 'Error'} modu...
agpl-3.0
kswiat/django
django/db/migrations/migration.py
29
6933
from __future__ import unicode_literals from django.db.transaction import atomic class Migration(object): """ The base class for all migrations. Migration files will import this from django.db.migrations.Migration and subclass it as a class called Migration. It will have one or more of the follow...
bsd-3-clause
jmcarbo/openerp7
openerp/addons/stock_location/__init__.py
68
1101
# -*- 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...
agpl-3.0
acrosby/pyoos
setup.py
1
1593
from __future__ import with_statement import sys from setuptools import setup, find_packages from setuptools.command.test import test as TestCommand from pyoos import __version__ def readme(): with open('README.md') as f: return f.read() reqs = [line.strip() for line in open('requirements.txt')] class ...
gpl-3.0
ramsateesh/designate
designate/backend/agent_backend/base.py
7
1619
# Copyright 2014 Rackspace Inc. # # Author: Tim Simmons <tim.simmons@rackspace.com> # # 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 # # Unl...
apache-2.0
jaddison/ansible
lib/ansible/plugins/action/patch.py
67
2387
# (c) 2015, Brian Coca <briancoca+dev@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) any later v...
gpl-3.0
amiguez/youtube-dl
youtube_dl/extractor/ndr.py
74
4573
# encoding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( ExtractorError, int_or_none, qualities, parse_duration, ) class NDRBaseIE(InfoExtractor): def _real_extract(self, url): mobj = re.match(self._VALID_URL, url) ...
unlicense
IDSIA/sacred
sacred/config/config_summary.py
1
2228
#!/usr/bin/env python # coding=utf-8 from sacred.utils import iter_prefixes, join_paths class ConfigSummary(dict): def __init__( self, added=(), modified=(), typechanged=(), ignored_fallbacks=(), docs=() ): super().__init__() self.added = set(added) self.modified = set(modifie...
mit
lucienfostier/gaffer
python/GafferCortex/ObjectReader.py
11
3001
########################################################################## # # Copyright (c) 2011-2012, John Haddon. All rights reserved. # Copyright (c) 2013-2014, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted prov...
bsd-3-clause
liukaijv/XlsxWriter
xlsxwriter/test/comparison/test_default_date_format01.py
8
3099
############################################################################### # # Tests for XlsxWriter. # # Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org # from ..excel_comparsion_test import ExcelComparisonTest from datetime import datetime from ...workbook import Workbook class TestCompareXLSXFiles...
bsd-2-clause
lucienfostier/gaffer
python/GafferUITest/CompoundEditorTest.py
8
3593
########################################################################## # # Copyright (c) 2013, Image Engine Design 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: # # * Redistrib...
bsd-3-clause
karstenw/nodebox-pyobjc
examples/Extended Application/matplotlib/examples/event_handling/data_browser.py
1
3261
""" ============ Data Browser ============ """ import numpy as np import matplotlib.pyplot as plt # nodebox section if __name__ == '__builtin__': # were in nodebox import os import tempfile W = 800 inset = 20 size(W, 600) plt.cla() plt.clf() plt.close('all') def tempimage(): ...
mit
atomic-labs/zulip
zerver/management/commands/create_stream.py
9
1146
from __future__ import absolute_import from __future__ import print_function from django.core.management.base import BaseCommand from zerver.lib.actions import do_create_stream from zerver.models import Realm, get_realm import sys class Command(BaseCommand): help = """Create a stream, and subscribe all active u...
apache-2.0
frogleg/lightblue-0.4
src/series60/_lightbluecommon.py
179
10831
# Copyright (c) 2009 Bea Lam. All rights reserved. # # This file is part of LightBlue. # # LightBlue is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any l...
gpl-3.0
RafaelTorrealba/odoo
addons/decimal_precision/__init__.py
450
1128
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of t...
agpl-3.0
rabitt/mir_eval
mir_eval/melody.py
3
27199
# CREATED:2014-03-07 by Justin Salamon <justin.salamon@nyu.edu> ''' Melody extraction algorithms aim to produce a sequence of frequency values corresponding to the pitch of the dominant melody from a musical recording. For evaluation, an estimated pitch series is evaluated against a reference based on whether the voic...
mit
woodymit/millstone_accidental_source
genome_designer/main/startup.py
1
1068
"""Actions to run at server startup. """ from django.db import connection from django.db import transaction def run(): """Call this from manage.py or tests. """ _add_custom_mult_agg_function() def _add_custom_mult_agg_function(): """Make sure the Postgresql database has a custom function array_agg_...
mit
fabaff/ansible
lib/ansible/plugins/connection/jail.py
13
8005
# Based on local.py (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # and chroot.py (c) 2013, Maykel Moya <mmoya@speedyrails.com> # (c) 2013, Michael Scherer <misc@zarb.org> # (c) 2015, Toshio Kuratomi <tkuratomi@ansible.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it...
gpl-3.0
h2oai/h2o-2
py/testdir_single_jvm/test_speedrf_params_rand2.py
9
3800
import unittest, random, sys, time sys.path.extend(['.','..','../..','py']) import h2o, h2o_cmd, h2o_rf, h2o_import as h2i, h2o_util paramDict = { # 2 new 'destination_key': ['model_keyA', '012345', '__hello'], 'cols': [None, None, None, None, None, '0,1,2,3,4,5,6,7,8','C1,C2,C3,C4,C5,C6,C7,C8'], # exc...
apache-2.0
tjanez/ansible
test/units/parsing/test_splitter.py
181
3734
# coding: utf-8 # (c) 2015, Toshio Kuratomi <tkuratomi@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 o...
gpl-3.0
samliu/servo
tests/wpt/css-tests/css-text-decor-3_dev/xhtml1print/support/generate-text-emphasis-position-property-tests.py
841
3343
#!/usr/bin/env python # - * - coding: UTF-8 - * - """ This script generates tests text-emphasis-position-property-001 ~ 006 which cover all possible values of text-emphasis-position property with all combination of three main writing modes and two orientations. Only test files are generated by this script. It also out...
mpl-2.0
NetApp/cinder
cinder/tests/unit/api/contrib/test_snapshot_unmanage.py
6
4940
# Copyright (c) 2015 Huawei Technologies Co., Ltd. # # 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 applic...
apache-2.0
MagicStack/MagicPython
test/statements/for1.py
1
1062
for a, b, c in b: pass else: 1/0 for : keyword.control.flow.python, source.python : source.python a : source.python , : punctuation.separator.element.python, source.python : source.python b : source.python , : punctuation.s...
mit
michael-pacheco/dota2-predictor
visualizing/dataset_stats.py
2
3746
import numpy as np from tools.metadata import get_hero_dict import operator import pandas as pd import plotly.graph_objs as go import plotly.plotly as py def winrate_statistics(dataset_df, mmr_info): x_data, y_data = dataset_df wins = np.zeros(114) games = np.zeros(114) winrate = np.zeros(114) ...
mit
Aloomaio/googleads-python-lib
examples/ad_manager/v201808/user_service/get_user_by_email_address.py
1
1937
#!/usr/bin/env python # # Copyright 2016 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
apache-2.0
beeftornado/sentry
tests/sentry/similarity/backends/base.py
3
8478
from __future__ import absolute_import import abc class MinHashIndexBackendTestMixin(object): __meta__ = abc.ABCMeta @abc.abstractproperty def index(self): pass def test_basic(self): self.index.record("example", "1", [("index", "hello world")]) self.index.record("example", "...
bsd-3-clause
mikma/tmtp
standalone/Jeans.py
1
30844
#!/usr/bin/env python # Jeans.py # Jeans Foundation #4 # Designer: Helen Joseph-Armstrong # PatternMaker: Susan Spencer Conklin # # This pattern contains a design for a pair of jeans from tmtpl.constants import * from tmtpl.pattern import * from tmtpl.document import * from tmtpl.client import Client #Project specifi...
gpl-3.0
raoulbq/scipy
scipy/signal/_arraytools.py
91
5145
""" Functions for acting on a axis of an array. """ from __future__ import division, print_function, absolute_import import numpy as np def axis_slice(a, start=None, stop=None, step=None, axis=-1): """Take a slice along axis 'axis' from 'a'. Parameters ---------- a : numpy.ndarray The array ...
bsd-3-clause
ivano666/tensorflow
tensorflow/python/kernel_tests/summary_image_op_test.py
15
3949
# Copyright 2015 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 a...
apache-2.0
jup3/hots
example.py
1
1077
db1 = {"Database": {"Raynor": { "Raynor-Counter": ["Tracer", "Uther", "Zeratul"], "Raynor-Synergize": ["Who", "It" , "is"] }, "Stitches" : { "Stiches-Counter": ["What", "ever", "it",], "Stiches-Synergize":["What", "name", "is"] } } } d...
mit
zhaodelong/django
tests/m2m_multiple/tests.py
227
2370
from __future__ import unicode_literals from datetime import datetime from django.test import TestCase from .models import Article, Category class M2MMultipleTests(TestCase): def test_multiple(self): c1, c2, c3, c4 = [ Category.objects.create(name=name) for name in ["Sports", "N...
bsd-3-clause
PrivacyScore/PrivacyScore
privacyscore/backend/management/commands/rescanscanlist.py
1
2152
# Copyright (C) 2018 PrivacyScore Contributors # # 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 your option) any later version. # # This program is dis...
gpl-3.0
pyload/pyload
src/pyload/plugins/accounts/OboomCom.py
1
2033
# -*- coding: utf-8 -*- import json from binascii import b2a_hex from beaker.crypto.pbkdf2 import pbkdf2 from pyload.core.network.request_factory import get_url from ..base.account import BaseAccount class PBKDF2: def __init__(self, passphrase, salt, iterations=1000): self.passphrase = passphrase ...
agpl-3.0
lmtierney/selenium
py/selenium/webdriver/common/action_chains.py
5
12419
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
apache-2.0
himmih/cluedo
venv/lib/python2.7/site-packages/pip/req/req_set.py
246
27444
from __future__ import absolute_import from collections import defaultdict import functools import itertools import logging import os from pip._vendor import pkg_resources from pip._vendor import requests from pip.download import (url_to_path, unpack_url) from pip.exceptions import (InstallationError, BestVersionAlr...
apache-2.0
kzys/buildbot
buildbot/changes/pb.py
1
4662
# -*- test-case-name: buildbot.test.test_changes -*- from twisted.python import log from buildbot.pbutil import NewCredPerspective from buildbot.changes import base, changes class ChangePerspective(NewCredPerspective): def __init__(self, changemaster, prefix): self.changemaster = changemaster se...
gpl-2.0
juliusbierk/scikit-image
skimage/restoration/deconvolution.py
19
14315
# -*- coding: utf-8 -*- # deconvolution.py --- Image deconvolution """Implementations restoration functions""" from __future__ import division import numpy as np import numpy.random as npr from scipy.signal import convolve2d from . import uft __keywords__ = "restoration, image, deconvolution" def wiener(image, p...
bsd-3-clause
mjg2203/edx-platform-seas
lms/djangoapps/dashboard/management/commands/git_add_course.py
9
1525
""" Script for importing courseware from git/xml into a mongo modulestore """ import os import re import StringIO import subprocess import logging from django.core import management from django.core.management.base import BaseCommand, CommandError from django.utils.translation import ugettext as _ import dashboard.g...
agpl-3.0
ZHAW-INES/rioxo-uClinux-dist
user/python/python-2.4.4/Mac/scripts/buildpkg.py
5
15904
#!/usr/bin/env python """buildpkg.py -- Build OS X packages for Apple's Installer.app. This is an experimental command-line tool for building packages to be installed with the Mac OS X Installer.app application. It is much inspired by Apple's GUI tool called PackageMaker.app, that seems to be part of the OS X develo...
gpl-2.0
euri10/zipline
tests/test_algorithm_gen.py
18
7339
# # Copyright 2014 Quantopian, 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 wr...
apache-2.0
gechr/ansible-modules-extras
system/locale_gen.py
40
7666
#!/usr/bin/python # -*- coding: utf-8 -*- # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. ...
gpl-3.0
mKeRix/home-assistant
homeassistant/components/html5/notify.py
7
18756
"""HTML5 Push Messaging notification service.""" from datetime import datetime, timedelta from functools import partial import json import logging import time from urllib.parse import urlparse import uuid from aiohttp.hdrs import AUTHORIZATION import jwt from py_vapid import Vapid from pywebpush import WebPusher impor...
mit
af1rst/bite-project
deps/gdata-python-client/samples/apps/marketplace_sample/gdata/tlslite/utils/Cryptlib_AES.py
359
1364
"""Cryptlib AES implementation.""" from cryptomath import * from AES import * if cryptlibpyLoaded: def new(key, mode, IV): return Cryptlib_AES(key, mode, IV) class Cryptlib_AES(AES): def __init__(self, key, mode, IV): AES.__init__(self, key, mode, IV, "cryptlib") sel...
apache-2.0
KohlsTechnology/ansible
lib/ansible/modules/packaging/os/svr4pkg.py
95
7684
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, Boyd Adamson <boyd () boydadamson.com> # # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1...
gpl-3.0
holmes/intellij-community
python/helpers/docutils/parsers/rst/directives/parts.py
41
4241
# $Id: parts.py 6385 2010-08-13 12:17:01Z milde $ # Authors: David Goodger <goodger@python.org>; Dmitry Jemerov # Copyright: This module has been placed in the public domain. """ Directives for document parts. """ __docformat__ = 'reStructuredText' from docutils import nodes, languages from docutils.transforms impor...
apache-2.0
TRESCLOUD/odoopub
addons/base_gengo/res_company.py
24
1784
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
Hackplayers/Empire-mod-Hpys-tests
lib/modules/python/situational_awareness/network/port_scan.py
2
5624
from lib.common import helpers class Module: def __init__(self, mainMenu, params=[]): # metadata info about the module, not modified during runtime self.info = { # name for the module that will appear in module menus 'Name': 'Port Scanner.', # list of one or m...
bsd-3-clause
ecederstrand/django
tests/view_tests/tests/py3_test_debug.py
335
1849
""" Since this file contains Python 3 specific syntax, it's named without a test_ prefix so the test runner won't try to import it. Instead, the test class is imported in test_debug.py, but only on Python 3. This filename is also in setup.cfg flake8 exclude since the Python 2 syntax error (raise ... from ...) can't be...
bsd-3-clause
h8rift/android_kernel_htc_msm8960_evita-h8x
Documentation/target/tcm_mod_builder.py
3119
42754
#!/usr/bin/python # The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD # # Copyright (c) 2010 Rising Tide Systems # Copyright (c) 2010 Linux-iSCSI.org # # Author: nab@kernel.org # import os, sys import subprocess as sub import string import re import optparse tcm_dir = "" fabric_ops...
gpl-2.0
safwanrahman/mozillians
mozillians/settings/base.py
1
10137
# -*- coding: utf-8 -*- # Django settings for the mozillians project. import logging import os.path import sys from funfactory.manage import path from funfactory.settings_base import * # noqa from funfactory.settings_base import JINJA_CONFIG as funfactory_JINJA_CONFIG from urlparse import urljoin from django.utils....
bsd-3-clause
madj4ck/ansible
lib/ansible/utils/hashing.py
202
3125
# (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