repo_name
stringlengths
5
100
path
stringlengths
4
375
copies
stringclasses
991 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
wdurhamh/statsmodels
statsmodels/sandbox/pca.py
33
7098
#Copyright (c) 2008 Erik Tollerud (etolleru@uci.edu) from statsmodels.compat.python import zip import numpy as np from math import pi class Pca(object): """ A basic class for Principal Component Analysis (PCA). p is the number of dimensions, while N is the number of data points """ _colors=('r','...
bsd-3-clause
sandbender/toolz
doc/source/conf.py
25
9229
# -*- coding: utf-8 -*- # # Toolz documentation build configuration file, created by # sphinx-quickstart on Sun Sep 22 18:06:00 2013. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All c...
bsd-3-clause
mgraupe/acq4
acq4/pyqtgraph/graphicsItems/BarGraphItem.py
43
4828
from ..Qt import QtGui, QtCore from .GraphicsObject import GraphicsObject from .. import getConfigOption from .. import functions as fn import numpy as np __all__ = ['BarGraphItem'] class BarGraphItem(GraphicsObject): def __init__(self, **opts): """ Valid keyword options are: x, x0, x1, y...
mit
tpratama/warkop-TC
assets/node_modules/gulp-sass/node_modules/node-sass/node_modules/pangyp/gyp/pylib/gyp/easy_xml_test.py
2698
3270
#!/usr/bin/env python # Copyright (c) 2011 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Unit tests for the easy_xml.py file. """ import gyp.easy_xml as easy_xml import unittest import StringIO class TestSequenceFunctions(...
mit
glogiotatidis/snippets-service
snippets/base/tests/test_middleware.py
3
1721
from unittest.mock import Mock, patch from django.test import RequestFactory from snippets.base.middleware import FetchSnippetsMiddleware from snippets.base.tests import TestCase class FetchSnippetsMiddlewareTests(TestCase): def setUp(self): self.get_response_mock = Mock() self.middleware = Fetc...
mpl-2.0
mesonbuild/meson
mesonbuild/mcompile.py
1
12972
# Copyright 2020 The Meson development team # 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
fernandopso/python_koans
python2/libs/colorama/initialise.py
484
1297
# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. import atexit import sys from .ansitowin32 import AnsiToWin32 orig_stdout = sys.stdout orig_stderr = sys.stderr wrapped_stdout = sys.stdout wrapped_stderr = sys.stderr atexit_done = False def reset_all(): AnsiToWin32(orig_stdout).rese...
mit
zentralopensource/zentral
zentral/conf/params.py
1
1492
import logging import requests logger = logging.getLogger("zentral.conf.params") class AWSSSMClient: platform = "AWS" def __init__(self): import boto3 sts = boto3.client("sts") sts.get_caller_identity() self._client = boto3.client('ssm') def get(self, key): retu...
apache-2.0
coderbone/SickRage-alt
lib/past/__init__.py
34
2948
# coding=utf-8 """ past: compatibility with Python 2 from Python 3 =============================================== ``past`` is a package to aid with Python 2/3 compatibility. Whereas ``future`` contains backports of Python 3 constructs to Python 2, ``past`` provides implementations of some Python 2 constructs in Pytho...
gpl-3.0
gkyriakou/doodle_class_scheduler
without_tones_of_comments/best_doodle.py
1
4831
#!/usr/bin/python import csv import copy import operator import sys d = {} fraidy_list = [] with open('doodle.csv', 'rb') as csvfile: spamreader = csv.reader(csvfile, delimiter=' ', quotechar='"') for row in spamreader: bef_split = ','.join(row) after_split = bef_split.split(',') fraid...
gpl-2.0
ridethepenguin/MapStore
mapcomposer/app/static/externals/openlayers/tests/selenium/remotecontrol/test_ol.py
254
2873
from selenium import selenium import time import sys from ConfigParser import ConfigParser MAX_TEST_LENGTH = 300 if len(sys.argv) > 2: filename = sys.argv[2] else: filename = "config.cfg" c = ConfigParser() c.read(filename) targets = {} server = c.get('config', 'server') url= c.get('config', 'url') if c.h...
gpl-3.0
topic2k/EventGhost
eg/Classes/ActionWithStringParameter.py
1
2191
# -*- coding: utf-8 -*- # # This file is part of EventGhost. # Copyright © 2005-2019 EventGhost Project <http://www.eventghost.org/> # # EventGhost 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 versio...
gpl-2.0
bjzhang/xen_arm
tools/python/xen/web/httpserver.py
49
10765
#============================================================================ # This library is free software; you can redistribute it and/or # modify it under the terms of version 2.1 of the GNU Lesser General Public # License as published by the Free Software Foundation. # # This library is distributed in the hope th...
gpl-2.0
google-research/google-research
simulation_research/tf_risk/payoffs.py
1
5621
# 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
hevvieevvie/osmc
package/mediacenter-skin-osmc/files/usr/share/kodi/addons/script.module.unidecode/lib/unidecode/x078.py
252
4648
data = ( 'Dang ', # 0x00 'Ma ', # 0x01 'Sha ', # 0x02 'Dan ', # 0x03 'Jue ', # 0x04 'Li ', # 0x05 'Fu ', # 0x06 'Min ', # 0x07 'Nuo ', # 0x08 'Huo ', # 0x09 'Kang ', # 0x0a 'Zhi ', # 0x0b 'Qi ', # 0x0c 'Kan ', # 0x0d 'Jie ', # 0x0e 'Fen ', # 0x0f 'E ', # 0x10 'Ya ', ...
gpl-2.0
heke123/chromium-crosswalk
tools/perf/page_sets/tough_image_decode_cases.py
30
1546
# Copyright 2015 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from telemetry.page import page as page_module from telemetry.page import shared_page_state from telemetry import story class ToughImageDecodeCasesPage(page_...
bsd-3-clause
dvliman/jaikuengine
.google_appengine/lib/httplib2/httplib2/test/functional/test_proxies.py
305
2965
import unittest import errno import os import signal import subprocess import tempfile import nose import httplib2 from httplib2 import socks from httplib2.test import miniserver tinyproxy_cfg = """ User "%(user)s" Port %(port)s Listen 127.0.0.1 PidFile "%(pidfile)s" LogFile "%(logfile)s" MaxClients 2 StartServers 1...
apache-2.0
DazWorrall/ansible
lib/ansible/modules/database/misc/redis.py
14
10672
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright: 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 ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
lanking520/Digital_China
backup4.py
1
56211
import cookielib import urllib2 import urllib import json import time # Default Settings for a system to keep cookies, please add it before testing cj = cookielib.CookieJar() opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj)) urllib2.install_opener(opener) # Let the single cookie system override the curren...
mit
Eksmo/django-tastypie
tastypie/api.py
10
7189
from __future__ import unicode_literals import warnings from django.conf.urls import url, include from django.core.exceptions import ImproperlyConfigured from django.core.urlresolvers import reverse from django.http import HttpResponse, HttpResponseBadRequest from tastypie.exceptions import NotRegistered, BadRequest fr...
bsd-3-clause
ademmers/ansible
lib/ansible/playbook/role/__init__.py
5
22308
# (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
ArcherCraftStore/ArcherVMPeridot
Python/Lib/lib2to3/fixer_util.py
71
15256
"""Utility functions, node construction macros, etc.""" # Author: Collin Winter from itertools import islice # Local imports from .pgen2 import token from .pytree import Leaf, Node from .pygram import python_symbols as syms from . import patcomp ########################################################### ### Common...
apache-2.0
fabiansinz/datajoint-python
datajoint/__init__.py
1
3221
""" DataJoint for Python is a high-level programming interface for MySQL databases to support data processing chains in science labs. DataJoint is built on the foundation of the relational data model and prescribes a consistent method for organizing, populating, and querying data. DataJoint is free software under the ...
lgpl-2.1
msincenselee/vnpy
vnpy/api/easytrader/ricequant_follower.py
1
4413
# -*- coding: utf-8 -*- from datetime import datetime from threading import Thread from .follower import BaseFollower from .log import logger class RiceQuantFollower(BaseFollower): def __init__(self): super().__init__() self.client = None def login(self, user=None, password=None, **kwargs):...
mit
alephu5/Soundbyte
environment/lib/python3.3/site-packages/IPython/kernel/inprocess/ipkernel.py
9
6881
"""An in-process kernel""" #----------------------------------------------------------------------------- # Copyright (C) 2012 The IPython Development Team # # Distributed under the terms of the BSD License. The full license is in # the file COPYING, distributed as part of this software. #------------------------...
gpl-3.0
vlebedynskyi/Automator
tools/vk_auth.py
1
4818
""" Copyright 2014 Vitalii Lebedynskyi 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, soft...
apache-2.0
1st/django
tests/template_tests/syntax_tests/test_comment.py
521
3667
from django.test import SimpleTestCase from ..utils import setup class CommentSyntaxTests(SimpleTestCase): @setup({'comment-syntax01': '{# this is hidden #}hello'}) def test_comment_syntax01(self): output = self.engine.render_to_string('comment-syntax01') self.assertEqual(output, 'hello') ...
bsd-3-clause
takaaptech/sky_engine
testing/scripts/mojo_apptests.py
29
1216
#!/usr/bin/env python # Copyright 2015 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import json import os import sys import common def main_run(args): runner = os.path.join(common.SRC_DIR, 'mojo', 'tools', 'apptes...
bsd-3-clause
omg-insa/server
django/conf/locale/pt/formats.py
232
1532
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = r'j \de F \de Y' TIME_FORMAT = 'H:i:s' DATETIME_FORMAT = r'j \de F \de Y à...
bsd-3-clause
ppericard/matamog
scripts/evaluation/coverage/build_coverage_comparaison_df.py
3
2619
#!/usr/bin/env python3 import os import sys import re import random import argparse import math import logging CURRENT_DIR = os.path.dirname(os.path.abspath(__file__)) SCRIPTS_DIR = os.path.join(CURRENT_DIR, '..', '..') sys.path.append(SCRIPTS_DIR) from sample_sam_by_coverage import * logger = logging.getLogger(__n...
agpl-3.0
leppa/home-assistant
homeassistant/components/elkm1/__init__.py
4
10154
"""Support the ElkM1 Gold and ElkM1 EZ8 alarm/integration panels.""" import logging import re import elkm1_lib as elkm1 from elkm1_lib.const import Max import voluptuous as vol from homeassistant.const import ( CONF_EXCLUDE, CONF_HOST, CONF_INCLUDE, CONF_PASSWORD, CONF_TEMPERATURE_UNIT, CONF_U...
apache-2.0
pirata-cat/mieli
mieli/management/commands/mieli_load_csv.py
1
1620
from django.core.management.base import CommandError from mieli.cli import MieliCommand from django.core import management from mieli.api import user import logging import copy import ast import csv import sys class Command(MieliCommand): def __init__(self): super(self.__class__, self).__init__() s...
agpl-3.0
TREX-ROM/android_kernel_lge_hammerheadcaf
scripts/build-all.py
1474
10189
#! /usr/bin/env python # Copyright (c) 2009-2013, The Linux Foundation. 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 # ...
gpl-2.0
bubichain/blockchain
src/3rd/src/jsoncpp/scons-2.1.0/engine/SCons/Tool/gfortran.py
21
2315
"""SCons.Tool.gfortran Tool-specific initialization for gfortran, the GNU Fortran 95/Fortran 2003 compiler. 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, 200...
apache-2.0
lll9p/XRD_reporter
app.py
1
4826
#!/usr/bin/env python # -*- coding: utf-8 -*- import openpyxl import re import os import logging import time from collections import Counter import tkinter as tk import tkinter.ttk as ttk import tkinter.filedialog as filedialog import tkinter.messagebox as messagebox import configparser from lib import png_from_xps, tr...
gpl-3.0
ville-k/tensorflow
tensorflow/python/training/gradient_descent_test.py
81
11045
# 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
dongjoon-hyun/tensorflow
tensorflow/python/kernel_tests/distributions/special_math_test.py
9
17325
# 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
CANTUS-Project/pysolr-tornado
tests/admin.py
1
1484
# -*- coding: utf-8 -*- from __future__ import unicode_literals from pysolrtornado import SolrCoreAdmin, json try: import unittest2 as unittest except ImportError: import unittest class SolrCoreAdminTestCase(unittest.TestCase): def setUp(self): super(SolrCoreAdminTestCase, self).setUp() ...
bsd-3-clause
chauhanhardik/populo_2
openedx/core/djangoapps/credit/views.py
13
13669
""" Views for the credit Django app. """ import json import datetime import logging from django.conf import settings from django.http import ( HttpResponse, HttpResponseBadRequest, HttpResponseForbidden, Http404 ) from django.utils.decorators import method_decorator from django.views.decorators.csrf im...
agpl-3.0
miguelparaiso/OdooAccessible
addons/purchase/edi/__init__.py
448
1069
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2011 OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GN...
agpl-3.0
TDR/Xoom
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py
12527
1935
# Util.py - Python extension for perf script, miscellaneous utility code # # Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com> # # This software may be distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. import errno, os FUTEX_WAIT = 0...
gpl-2.0
VishvajitP/Django-facebook
docs/docs_env/Lib/UserDict.py
117
5729
"""A more or less complete user-defined wrapper around dictionary objects.""" class UserDict: def __init__(self, dict=None, **kwargs): self.data = {} if dict is not None: self.update(dict) if len(kwargs): self.update(kwargs) def __repr__(self): return repr(self.d...
bsd-3-clause
m3z/HT
openstack_dashboard/dashboards/project/access_and_security/security_groups/urls.py
10
1112
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # no...
apache-2.0
ojengwa/osmc
package/mediacenter-skin-osmc/files/usr/share/kodi/addons/script.module.unidecode/lib/unidecode/x023.py
165
4341
data = ( '[?]', # 0x00 '[?]', # 0x01 '[?]', # 0x02 '^', # 0x03 '[?]', # 0x04 '[?]', # 0x05 '[?]', # 0x06 '[?]', # 0x07 '[?]', # 0x08 '[?]', # 0x09 '[?]', # 0x0a '[?]', # 0x0b '[?]', # 0x0c '[?]', # 0x0d '[?]', # 0x0e '[?]', # 0x0f '[?]', # 0x10 '[?]', # 0x11 '[?]', ...
gpl-2.0
jelugbo/ddi
common/lib/capa/capa/checker.py
123
5899
#!/usr/bin/env python """ Commandline tool for doing operations on Problems """ from __future__ import unicode_literals import argparse import logging import sys from path import path from cStringIO import StringIO from calc import UndefinedVariable from capa.capa_problem import LoncapaProblem from mako.lookup impor...
agpl-3.0
mileswwatkins/python-opencivicdata-django
opencivicdata/models/jurisdiction.py
1
1359
from django.db import models from djorm_pgarray.fields import ArrayField from ..common import JURISDICTION_CLASSIFICATION_CHOICES, SESSION_CLASSIFICATION_CHOICES from .base import OCDBase, OCDIDField, RelatedBase from .division import Division class Jurisdiction(OCDBase): id = OCDIDField(ocd_type='jurisdiction')...
bsd-3-clause
nagyistoce/netzob
test/src/test_netzob/test_UI/test_UI.py
1
2672
# -*- coding: utf-8 -*- #+---------------------------------------------------------------------------+ #| 01001110 01100101 01110100 01111010 01101111 01100010 | #| | #| Netzob : Inferring communication protocol...
gpl-3.0
bakhtout/odoo-educ
addons/account/project/wizard/account_analytic_inverted_balance_report.py
378
2045
# -*- 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
MoritzS/django
tests/sitemaps_tests/test_http.py
5
10856
import os from datetime import date from unittest import skipUnless from django.apps import apps from django.conf import settings from django.contrib.sitemaps import GenericSitemap, Sitemap from django.contrib.sites.models import Site from django.core.exceptions import ImproperlyConfigured from django.test import modi...
bsd-3-clause
victor-gonzalez/AliPhysics
PWGJE/EMCALJetTasks/Tracks/analysis/base/struct/JetContainer.py
41
6236
#************************************************************************** #* Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. * #* * #* Author: The ALICE Off-line Project. * #* Contributors ...
bsd-3-clause
wavelets/pandashells
pandashells/bin/p_lomb_scargle.py
7
2664
#! /usr/bin/env python # standard library imports import argparse import textwrap import sys # noqa from pandashells.lib import arg_lib, io_lib, lomb_scargle_lib def main(): msg = textwrap.dedent( """ Computes a spectrogram using the lomb-scargle algorithm provided by the gatspy module....
bsd-2-clause
Danielhiversen/home-assistant
homeassistant/components/media_player/sisyphus.py
4
5674
""" Support for track controls on the Sisyphus Kinetic Art Table. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/media_player.sisyphus/ """ import logging from homeassistant.components.media_player import ( SUPPORT_NEXT_TRACK, SUPPORT_PAUSE, SUPPORT...
mit
ossdemura/django-miniblog
src/Lib/site-packages/pip/_vendor/requests/packages/chardet/hebrewprober.py
2929
13359
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Shy Shalom # Portions created by the Initial Developer are Copyright (C) 2005 # the Initial Developer. All Rights Reserved. #...
mit
cpenv/cpenv
cpenv/vendor/shotgun_api3/lib/httplib2/python3/socks.py
5
19701
"""SocksiPy - Python SOCKS module. Version 1.00 Copyright 2006 Dan-Haim. 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 ...
mit
bibsian/database-development
poplerGUI/logiclayer/class_dictionarydataframe.py
1
2473
#!/usr/bin/env python from pandas import DataFrame __all__ = ['DictionaryDataframe'] class DictionaryDataframe(): ''' Class that takes 'x' number of columns with covariate information, converts records in each column (x) into a string with containing the records for all columns (x), in the row of ...
mit
grap/OCB
addons/account_report_company/report/account_invoice_report.py
52
1643
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2013 OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GN...
agpl-3.0
Azure/azure-sdk-for-python
tools/azure-sdk-tools/devtools_testutils/powershell_preparer.py
1
3736
# -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- import os...
mit
iansf/engine
sky/tools/webkitpy/layout_tests/port/base_unittest.py
11
22459
# Copyright (C) 2010 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
meteorcloudy/bazel
scripts/generate_fish_completion.py
6
11536
# Copyright 2020 The Bazel 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 applicable law...
apache-2.0
msduketown/xbmc
addons/service.xbmc.versioncheck/lib/common.py
82
7008
# -*- coding: utf-8 -*- # # Copyright (C) 2013 Team-XBMC # # 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 versio...
gpl-2.0
Ernesto99/odoo
addons/crm/wizard/crm_lead_to_opportunity.py
146
13701
# -*- 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
MTASZTAKI/ApertusVR
plugins/languageAPI/jsAPI/3rdParty/nodejs/10.1.0/source/deps/v8/tools/node/build_gn.py
1
3127
#!/usr/bin/env python # Copyright 2017 the V8 project authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Use this script to build libv8_monolith.a as dependency for Node.js Required dependencies can be fetched with fetch_deps.py. Usa...
mit
benrudolph/commcare-hq
corehq/apps/smsbillables/generator.py
1
8043
import random import datetime import string from decimal import Decimal from corehq.apps.sms.mixin import SMSBackend from dimagi.utils.data import generator as data_gen from corehq.apps.accounting.models import Currency from corehq.apps.sms.models import INCOMING, OUTGOING, SMSLog from corehq.apps.sms.util import get_...
bsd-3-clause
technologiescollege/s2a_fr
s2a/Python/Lib/distutils/tests/test_bdist_wininst.py
99
1044
"""Tests for distutils.command.bdist_wininst.""" import unittest from test.test_support import run_unittest from distutils.command.bdist_wininst import bdist_wininst from distutils.tests import support class BuildWinInstTestCase(support.TempdirManager, support.LoggingSilencer, ...
gpl-3.0
moshe742/openbudgets
openbudgets/apps/contexts/models.py
2
3470
from django.db import models from django.utils.translation import ugettext_lazy as _ from jsonfield import JSONField from openbudgets.apps.entities.models import Domain, Entity from openbudgets.commons.mixins.models import PeriodicMixin, TimeStampedMixin, \ ClassMethodMixin, UUIDPKMixin class ContextManager(model...
bsd-3-clause
mlperf/training_results_v0.7
SIAT/benchmarks/resnet/implementations/mindspore_open_src/mlperf_logging/package_checker/package_checker.py
4
5422
''' Runs a set of checks on an organization's submission package. ''' from __future__ import print_function import argparse import glob import os import sys from ..compliance_checker import mlp_compliance _ALLOWED_BENCHMARKS = [ 'bert', 'dlrm', 'gnmt', 'maskrcnn', 'minigo', 'resnet', 'ssd...
apache-2.0
abloomston/sympy
sympy/matrices/__init__.py
86
1069
"""A module that handles matrices. Includes functions for fast creating matrices like zero, one/eye, random matrix, etc. """ from .matrices import (DeferredVector, ShapeError, NonSquareMatrixError, MatrixBase) from .dense import ( GramSchmidt, Matrix, casoratian, diag, eye, hessian, jordan_cell, list2nump...
bsd-3-clause
hugoruscitti/irobotgame
lib/pyglet/font/base.py
2
12024
# ---------------------------------------------------------------------------- # pyglet # Copyright (c) 2006-2008 Alex Holkner # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistribu...
gpl-3.0
rpmcpp/Audacity
lib-src/lv2/lv2/plugins/eg01-amp.lv2/waflib/Tools/ccroot.py
70
12917
#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file import os,re from waflib import Task,Utils,Node,Errors from waflib.TaskGen import after_method,before_method,feature,taskgen_method,extension from waflib.Tools import c_aliase...
gpl-2.0
PyQuake/earthquakemodels
code/gaModel/parallelGAModelP_AVR.py
1
6277
""" This GA code creates the gaModel with a circular island model """ from operator import attrgetter # import sys from deap import base, creator, tools import numpy from csep.loglikelihood import calcLogLikelihood as loglikelihood from models.mathUtil import calcNumberBins import models.model import random import arr...
bsd-3-clause
hpk42/pytest
_pytest/junitxml.py
1
13513
""" report test results in JUnit-XML format, for use with Jenkins and build integration servers. Based on initial code from Ross Lawley. """ # Output conforms to https://github.com/jenkinsci/xunit-plugin/blob/master/ # src/main/resources/org/jenkinsci/plugins/xunit/types/model/xsd/junit-10.xsd import py impo...
mit
ProfessorX/Config
.PyCharm30/system/python_stubs/-1247972723/samba/dcerpc/drsuapi/DsReplicaObjectListItemEx.py
1
1613
# encoding: utf-8 # module samba.dcerpc.drsuapi # from /usr/lib/python2.7/dist-packages/samba/dcerpc/drsuapi.so # by generator 1.135 """ drsuapi DCE/RPC """ # imports import dcerpc as __dcerpc import talloc as __talloc class DsReplicaObjectListItemEx(__talloc.Object): # no doc def __init__(self, *args, **kwa...
gpl-2.0
atosorigin/ansible
test/lib/ansible_test/_data/sanity/pylint/plugins/string_format.py
68
3117
# (c) 2018, Matt Martz <matt@sivel.net> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # -*- coding: utf-8 -*- from __future__ import (absolute_import, division, print_function) __metaclass__ = type import sys import six import astroid from pylint.interfaces import IAstr...
gpl-3.0
tkinz27/ansible-modules-core
cloud/rackspace/rax_cdb_database.py
157
4848
#!/usr/bin/python -tt # 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 distrib...
gpl-3.0
gfyoung/scipy
scipy/integrate/_bvp.py
61
39966
"""Boundary value problem solver.""" from __future__ import division, print_function, absolute_import from warnings import warn import numpy as np from numpy.linalg import norm, pinv from scipy.sparse import coo_matrix, csc_matrix from scipy.sparse.linalg import splu from scipy.optimize import OptimizeResult EPS =...
bsd-3-clause
gilbertron/whidbeysci
boilerplate/lib/utils.py
4
7368
# *-* coding: UTF-8 *-* # standard library imports import os import re import random import hashlib import logging import string import unicodedata from datetime import datetime, timedelta import Cookie import webapp2 def random_string(size=6, chars=string.ascii_letters + string.digits): """ Generate random stri...
lgpl-3.0
datapolitan/niceridestatus
code/niceridestatus.py
1
2105
''' Script to tweet the status of docks ''' import requests import collections import datetime import psycopg2 from pgconnect import pgconnect db = pgconnect['db'] user = pgconnect['user'] host = pgconnect['host'] def get_id_city(): ''' Get the city for each dock status_id and populate the id_city_dict ...
mit
INNUENDOCON/INNUca
src/SPAdes-3.11.0-Linux/share/spades/joblib2/memory.py
13
22947
""" A context object for caching a function's return value each time it is called with the same input arguments. """ # Author: Gael Varoquaux <gael dot varoquaux at normalesup dot org> # Copyright (c) 2009 Gael Varoquaux # License: BSD Style, 3 clauses. import os import shutil import time import pydoc try: impo...
gpl-3.0
40223231/2015cd_midterm
static/Brython3.1.1-20150328-091302/Lib/sre_compile.py
630
16898
# # Secret Labs' Regular Expression Engine # # convert template to internal format # # Copyright (c) 1997-2001 by Secret Labs AB. All rights reserved. # # See the sre.py file for information on usage and redistribution. # """Internal support module for sre""" import sys import _sre import sre_parse from sre_constan...
gpl-3.0
mifl/android_kernel_pantech_oscar
tools/perf/util/setup.py
4998
1330
#!/usr/bin/python2 from distutils.core import setup, Extension from os import getenv from distutils.command.build_ext import build_ext as _build_ext from distutils.command.install_lib import install_lib as _install_lib class build_ext(_build_ext): def finalize_options(self): _build_ext.finalize_optio...
gpl-2.0
mbayon/TFG-MachineLearning
vbig/lib/python2.7/site-packages/scipy/io/tests/test_fortran.py
23
4975
''' Tests for fortran sequential files ''' import tempfile import shutil from os import path, unlink from glob import iglob import re from numpy.testing import assert_equal, assert_allclose import numpy as np from scipy.io import FortranFile, _test_fortran DATA_PATH = path.join(path.dirname(__file__), 'data') de...
mit
rikima/spark
examples/src/main/python/ml/naive_bayes_example.py
123
2017
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
apache-2.0
cyberark-bizdev/ansible
lib/ansible/modules/messaging/rabbitmq_queue.py
39
10166
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Manuel Sousa <manuel.sousa@gmail.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
moksha11/xen-hv
tools/xm-test/tests/vcpu-disable/01_vcpu-disable_basic_pos.py
42
2218
#!/usr/bin/python # Copyright (C) International Business Machines Corp., 2005 # Authors: Dan Smith <danms@us.ibm.com> # Ryan Harper <ryanh@us.ibm.com> # 1) Make sure we have a multi cpu system # 2) Create a test domain with 2 VCPUs # 3) Verify that both VCPUs are alive # 4) Disable DOM VCPU1 by setting the V...
gpl-2.0
abadjanier/myweb
assets/global/plugins/jquery-file-upload/server/gae-python/main.py
245
5845
# -*- coding: utf-8 -*- # # jQuery File Upload Plugin GAE Python Example 2.2.0 # https://github.com/blueimp/jQuery-File-Upload # # Copyright 2011, Sebastian Tschan # https://blueimp.net # # Licensed under the MIT license: # http://www.opensource.org/licenses/MIT # from __future__ import with_statement from google.appe...
mit
nerzhul/ansible
contrib/inventory/softlayer.py
150
6108
#!/usr/bin/env python """ SoftLayer external inventory script. The SoftLayer Python API client is required. Use `pip install softlayer` to install it. You have a few different options for configuring your username and api_key. You can pass environment variables (SL_USERNAME and SL_API_KEY). You can also write INI fil...
gpl-3.0
mahabs/nitro
nssrc/com/citrix/netscaler/nitro/resource/config/filter/filterpolicy.py
1
10121
# # Copyright (c) 2008-2015 Citrix 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.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
apache-2.0
joshimio/blog
node_modules/pygmentize-bundled/vendor/pygments/build-3.3/pygments/lexers/_stan_builtins.py
292
6457
# -*- coding: utf-8 -*- """ pygments.lexers._stan_builtins ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This file contains the names of functions for Stan used by ``pygments.lexers.math.StanLexer. :copyright: Copyright 2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ KEYWORDS = ['else', 'for', '...
mit
cosurgi/trunk
examples/qm/1d-coulomb-eigen-wavefunction.py
1
5449
#!/usr/bin/python # -*- coding: utf-8 -*- dimensions= 1 size1d = 120 halfSize = [size1d,0.1,0.1]# must be three components, because yade is inherently 3D and uses Vector3r. Remaining components will be used for AABB GRIDSIZE = 2**13 # potential parameters potentialCenter = [ -size1d+(2.0*size1d/GRIDSIZE)*(1...
gpl-2.0
christophlsa/odoo
openerp/addons/base/module/wizard/base_update_translations.py
447
2931
# -*- coding: 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 the GNU...
agpl-3.0
JamesHyunKim/myhdl
hdlmake/tools/aldec/aldec.py
1
3541
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2013, 2014 CERN # Author: Pawel Szostek (pawel.szostek@cern.ch) # Multi-tool support by Javier D. Garcia-Lasheras (javier@garcialasheras.com) # # This file is part of Hdlmake. # # Hdlmake is free software: you can redistribute it and/or modify # it under the t...
gpl-3.0
computersalat/ansible
test/support/windows-integration/plugins/modules/win_find.py
57
11073
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2016, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # this is a windows documentation stub. actual code lives in the .ps1 # file of the same name ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
dfalt974/SickRage
lib/github/Plan.py
10
3578
# -*- coding: utf-8 -*- # ########################## Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> # # Copyright 2012 Zearin <zearin@gonk.net> ...
gpl-3.0
RichardLitt/wyrd-django-dev
tests/modeltests/custom_columns/models.py
114
1396
""" 17. Custom column/table names If your database column name is different than your model attribute, use the ``db_column`` parameter. Note that you'll use the field's name, not its column name, in API usage. If your database table name is different than your model name, use the ``db_table`` Meta attribute. This has...
bsd-3-clause
NickRuiz/wikitrans-pootle
pootle/scripts/history/convert/po2monopo.py
3
1729
#!/usr/bin/env python # po2amo.py # Converts .po files to AMO .po files using standard translation-tookit methods # Usage: ./po2amo po-file amo-output # Author: Dan Schafer <dschafer@mozilla.com> # Date: 11 Jun 2008 from translate.storage import po class po2amo: def convertstore(self, thepofile): """...
gpl-2.0
mitchmahan/pyeapi
test/system/test_api_system.py
4
4779
# # Copyright (c) 2014, Arista Networks, 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 condit...
bsd-3-clause
sebmarchand/syzygy
third_party/numpy/files/numpy/doc/creation.py
94
5411
""" ============== Array Creation ============== Introduction ============ There are 5 general mechanisms for creating arrays: 1) Conversion from other Python structures (e.g., lists, tuples) 2) Intrinsic numpy array array creation objects (e.g., arange, ones, zeros, etc.) 3) Reading arrays from disk, either from...
apache-2.0
hchen1202/django-react
virtualenv/lib/python3.6/site-packages/pip/_vendor/distlib/wheel.py
412
39115
# -*- coding: utf-8 -*- # # Copyright (C) 2013-2016 Vinay Sajip. # Licensed to the Python Software Foundation under a contributor agreement. # See LICENSE.txt and CONTRIBUTORS.txt. # from __future__ import unicode_literals import base64 import codecs import datetime import distutils.util from email import message_from...
mit
darktears/chromium-crosswalk
native_client_sdk/src/tools/oshelpers.py
33
17671
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Utility script for emulating common unix commands.""" from __future__ import print_function import argparse import fnmatch imp...
bsd-3-clause
GNOME/orca
test/keystrokes/helpcontent/load_sayall.py
3
4548
#!/usr/bin/python """Test of learn mode.""" from macaroon.playback import * import utils sequence = MacroSequence() sequence.append(KeyPressAction(0, None, "KP_Insert")) sequence.append(TypeAction("h")) sequence.append(KeyReleaseAction(0, None, "KP_Insert")) sequence.append(PauseAction(2000)) sequence.append(util...
lgpl-2.1