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
weolar/miniblink49
v8_5_1/tools/testrunner/local/testsuite.py
6
11182
# Copyright 2012 the V8 project 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: # # * Redistributions of source code must retain the above copyright # notice, this list of conditi...
apache-2.0
comocheng/RMG-Py
convertFAME.py
4
18608
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Convert a FAME input file to a MEASURE input file. """ import argparse import logging import numpy import os.path from rmgpy.molecule import Molecule import rmgpy.constants as constants from rmgpy.quantity import Quantity, Energy from rmgpy.cantherm.main import CanT...
mit
whs/django
tests/auth_tests/test_signals.py
9
4459
from django.apps import apps from django.contrib.auth import authenticate, signals from django.contrib.auth.models import User from django.core.exceptions import FieldDoesNotExist from django.test import TestCase, override_settings from django.test.client import RequestFactory from .models import MinimalUser @overri...
bsd-3-clause
cleesmith/sentdex_scikit_machine_learning_tutorial_for_investing
p06.py
2
1516
import pandas as pd import os import time from datetime import datetime # path = "X:/Backups/intraQuarter" # for Windows with X files :) # if git clone'ed then use relative path, # assuming you extracted the downloaded zip into this project's folder: path = "intraQuarter" def Key_Stats(gather="Total Debt/Equity (mrq)...
mit
nyrocron/eve-wspace
evewspace/API/cache_handler.py
10
1496
# Eve W-Space # Copyright 2014 Andrew Austin and contributors # # 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 requi...
apache-2.0
liaorubei/depot_tools
third_party/boto/ecs/item.py
89
5148
# Copyright (c) 2010 Chris Moyer http://coredumped.org/ # # 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, modify, ...
bsd-3-clause
morpheby/levelup-by
lms/djangoapps/open_ended_grading/tests.py
2
13802
""" Tests for open ended grading interfaces ./manage.py lms --settings test test lms/djangoapps/open_ended_grading """ import json from mock import MagicMock, patch, Mock from django.core.urlresolvers import reverse from django.contrib.auth.models import Group, User from django.conf import settings from mitxmako.sho...
agpl-3.0
jvrsantacruz/XlsxWriter
xlsxwriter/test/comparison/test_chart_area04.py
8
1523
############################################################################### # # Tests for XlsxWriter. # # Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org # from ..excel_comparsion_test import ExcelComparisonTest from ...workbook import Workbook class TestCompareXLSXFiles(ExcelComparisonTest): """...
bsd-2-clause
pwong-mapr/private-hue
desktop/core/ext-py/Django-1.4.5/django/contrib/localflavor/pl/pl_administrativeunits.py
433
13194
# -*- coding: utf-8 -*- """ Polish administrative units as in http://pl.wikipedia.org/wiki/Podzia%C5%82_administracyjny_Polski """ ADMINISTRATIVE_UNIT_CHOICES = ( ('wroclaw', u'Wrocław'), ('jeleniagora', u'Jelenia Góra'), ('legnica', u'Legnica'), ('boleslawiecki', u'bolesławiecki'), ('dzierzoniows...
apache-2.0
boundarydevices/android_external_chromium_org
build/android/gyp/generate_v14_compatible_resources.py
14
13731
#!/usr/bin/env python # # Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Convert Android xml resources to API 14 compatible. There are two reasons that we cannot just use API 17 attributes, so we are ge...
bsd-3-clause
UBERTC/binutils
gdb/python/lib/gdb/__init__.py
26
4609
# Copyright (C) 2010-2016 Free Software Foundation, Inc. # 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 progr...
gpl-2.0
desmovalvo/virtualsib-part2
tools/explo2/SS_HelloWorld_reactiveNode.py
5
1712
import Node import time import sys # Create a node instance # Programmer can give any name # The infrastucture will assign unigue names ??? node = Node.ParticipantNode("HelloWorld reactive") # Discover Smart Spaces around you # Use the technologies used at the "vertical business domain" # E.g. mDNS, UPnP, UDDI, B...
lgpl-3.0
livingbio/weather-parser
src/weather/settings/local.py
2
1978
from .base import * # NOQA import sys import logging.config # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True # Turn off debug while imported by Celery with a workaround # See http://stackoverflow.com/a/4806384 if "celery" in sys.argv[0]: DEBUG = False # Django Debug Tool...
mit
nkiraly/koadstation
tiledraweru14/provisioning/roles/maptile-import-tools/files/populate.py
1
16836
#!/usr/bin/env python from os import chdir, remove from sys import stderr, stdout from optparse import OptionParser from subprocess import Popen, PIPE from xml.etree.ElementTree import parse, SubElement from os.path import dirname, basename, splitext, join from urlparse import urlparse, urljoin from tempfile import mk...
bsd-2-clause
suhe/odoo
addons/hr_payroll_account/hr_payroll_account.py
17
10205
#-*- coding:utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from openerp import api from openerp.osv import fields, osv from openerp.tools import float_compare, float_is_zero from openerp.tools.translate import _ from openerp.exceptions import UserError class hr_payslip_line(osv.o...
gpl-3.0
sanjuro/RCJK
vendor/django/core/files/utils.py
901
1230
class FileProxyMixin(object): """ A mixin class used to forward file methods to an underlaying file object. The internal file object has to be called "file":: class FileProxy(FileProxyMixin): def __init__(self, file): self.file = file """ encoding = property(la...
apache-2.0
axbaretto/beam
sdks/python/.tox/docs/lib/python2.7/site-packages/pyasn1_modules/rfc2437.py
127
2378
# # PKCS#1 syntax # # ASN.1 source from: # ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-1/pkcs-1v2.asn # # Sample captures could be obtained with "openssl genrsa" command # from pyasn1.type import tag, namedtype, namedval, univ, constraint from pyasn1_modules.rfc2459 import AlgorithmIdentifier pkcs_1 = univ.ObjectIdentifie...
apache-2.0
rest-of/the-deck
lambda/lib/python2.7/site-packages/pip/commands/search.py
64
4777
from __future__ import absolute_import import logging import sys import textwrap from pip.basecommand import Command, SUCCESS from pip.download import PipXmlrpcTransport from pip.models import PyPI from pip.utils import get_terminal_size from pip.utils.logging import indent_log from pip.exceptions import CommandError...
mit
CroatianMeteorNetwork/RMS
RMS/Astrometry/CheckFit.py
1
25717
""" Automatic refining of astrometry calibration. The initial astrometric calibration is needed, which will be refined by using all stars from a given night. """ from __future__ import print_function, division, absolute_import import os import sys import copy import shutil import random import argparse import n...
gpl-3.0
kernelmilowill/PDMQBACKTEST
vn.trader/sgitGateway/sgitGateway_4.1/sgitGateway.py
12
35456
# encoding: UTF-8 ''' vn.sgit的gateway接入 飞鼠接口的委托数据更新是分散在多个推送里的: 1. 下单后,通过onRtnOrder通知是否成功,没有ErrorID说明委托到了交易所 2. 后续的成交状态,通过onRtnTrade通知,用户自行累加 3. 撤单的确认,通过onRspOrderAction通知 为了获取实时的委托状态,需要用户自行把这三个数据合并起来, 因此在TdApi中维护了一个委托数据的缓存字典,对vn.trader系统中推送的是本地委托号, 在Gateway中和委托系统号对应起来 飞鼠的撤单需要使用:交易所代码+交易所的系统委托号,撤单时从缓存中 获取委托的系统编号 '''...
mit
multikatt/CouchPotatoServer
libs/suds/umx/core.py
199
7575
# This program is free software; you can redistribute it and/or modify # it under the terms of the (LGPL) GNU Lesser 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 distributed in the hope that it will ...
gpl-3.0
MISL-EBU-System-SW/lsp-public
tools/perf/tests/attr.py
1266
9424
#! /usr/bin/python import os import sys import glob import optparse import tempfile import logging import shutil import ConfigParser class Fail(Exception): def __init__(self, test, msg): self.msg = msg self.test = test def getMsg(self): return '\'%s\' - %s' % (self.test.path, self.msg)...
gpl-2.0
indictranstech/tele-erpnext
erpnext/accounts/doctype/account/chart_of_accounts/import_from_openerp.py
87
8747
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt """ Import chart of accounts from OpenERP sources """ from __future__ import unicode_literals import os, json import ast from xml.etree import ElementTree as ET from frappe.utils.csvutils imp...
agpl-3.0
utsav2601/cmpe295A
tools/arm_gem5/O3_ARM_v7a.py
9
6472
# Copyright (c) 2012 The Regents of The University of Michigan # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: redistributions of source code must retain the above copyright # notice, this list ...
mit
zedr/django
django/core/checks/model_checks.py
6
1857
# -*- coding: utf-8 -*- from __future__ import unicode_literals from itertools import chain import types from django.apps import apps from . import Error, register @register('models') def check_all_models(app_configs=None, **kwargs): errors = [model.check(**kwargs) for model in apps.get_models() ...
bsd-3-clause
liaorubei/depot_tools
third_party/gsutil/gslib/wildcard_iterator.py
50
20828
# Copyright 2010 Google Inc. All Rights Reserved. # # 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, modify, merge,...
bsd-3-clause
trondhindenes/ansible-modules-extras
cloud/amazon/sqs_queue.py
30
7858
#!/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 distributed...
gpl-3.0
mahendra-r/edx-platform
lms/djangoapps/instructor/tests/test_ecommerce.py
44
14997
""" Unit tests for Ecommerce feature flag in new instructor dashboard. """ import datetime import pytz from django.core.urlresolvers import reverse from nose.plugins.attrib import attr from course_modes.models import CourseMode from student.roles import CourseFinanceAdminRole from shoppingcart.models import Coupon,...
agpl-3.0
uwafsl/MissionPlanner
Lib/rfc822.py
58
34306
"""RFC 2822 message manipulation. Note: This is only a very rough sketch of a full RFC-822 parser; in particular the tokenizing of addresses does not adhere to all the quoting rules. Note: RFC 2822 is a long awaited update to RFC 822. This module should conform to RFC 2822, and is thus mis-named (it's not wort...
gpl-3.0
martinribelotta/micropython
tests/basics/string_rsplit.py
55
1413
# default separator (whitespace) print("a b".rsplit()) #print(" a b ".rsplit(None)) #print(" a b ".rsplit(None, 1)) #print(" a b ".rsplit(None, 2)) #print(" a b c ".rsplit(None, 1)) #print(" a b c ".rsplit(None, 0)) #print(" a b c ".rsplit(None, -1)) # empty separator should fail...
mit
jsilter/scipy
scipy/special/tests/test_logit.py
110
2925
from __future__ import division, print_function, absolute_import import numpy as np from numpy.testing import (TestCase, assert_equal, assert_almost_equal, assert_allclose) from scipy.special import logit, expit class TestLogit(TestCase): def check_logit_out(self, dtype, expected): a = np.linspac...
bsd-3-clause
fuselock/odoo
addons/hr_payroll/wizard/__init__.py
442
1159
#-*- coding:utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved # d$ # # This program is free software: you can redistribute it and/or modify # it ...
agpl-3.0
turbokongen/home-assistant
homeassistant/components/ring/__init__.py
9
9817
"""Support for Ring Doorbell/Chimes.""" import asyncio from datetime import timedelta from functools import partial import logging from pathlib import Path from typing import Optional from oauthlib.oauth2 import AccessDeniedError import requests from ring_doorbell import Auth, Ring from homeassistant.const import __v...
apache-2.0
akshaybabloo/gollahalli-com
gollahalli_cms/editor/tests/test_models.py
1
26159
import datetime import os import shutil import unittest.mock as mock from io import BytesIO import pytz from PIL import Image from django.conf import settings from django.core.files.uploadedfile import InMemoryUploadedFile from django.core.files.uploadedfile import SimpleUploadedFile from django.test import TestCase ...
mit
Microvellum/Fluid-Designer
win64-vc/2.78/python/lib/encodings/zlib_codec.py
202
2204
"""Python 'zlib_codec' Codec - zlib compression encoding. This codec de/encodes from bytes to bytes. Written by Marc-Andre Lemburg (mal@lemburg.com). """ import codecs import zlib # this codec needs the optional zlib module ! ### Codec APIs def zlib_encode(input, errors='strict'): assert errors == 'strict' ...
gpl-3.0
boto/botocore
tests/functional/test_iot_data.py
2
1629
# Copyright 2015 Amazon.com, Inc. or its affiliates. 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. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file accompa...
apache-2.0
mwx1993/TACTIC
src/tactic/ui/cgapp/app_init_wdg.py
6
7053
########################################################### # # Copyright (c) 2005, Southpaw Technology # All Rights Reserved # # PROPRIETARY INFORMATION. This software is proprietary to # Southpaw Technology, and is not to be reproduced, transmitted, # or disclosed in any way without written permi...
epl-1.0
seem-sky/kbengine
kbe/src/lib/python/Lib/test/test_with.py
84
26503
"""Unit tests for the with statement specified in PEP 343.""" __author__ = "Mike Bland" __email__ = "mbland at acm dot org" import sys import unittest from collections import deque from contextlib import _GeneratorContextManager, contextmanager from test.support import run_unittest class MockContextManager(_Genera...
lgpl-3.0
abusse/cinder
cinder/volume/drivers/vmware/exceptions.py
2
1459
# Copyright (c) 2015 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...
apache-2.0
jonhadfield/linkchecker
third_party/dnspython/dns/update.py
108
10163
# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED "...
gpl-2.0
xjw1001001/IGCexpansion
test/Ancestral_reconstruction/PAML/parse reconstructed fasta.py
1
7314
# -*- coding: utf-8 -*- """ Created on Thu Aug 10 08:23:33 2017 @author: xjw1001001 """ #only when PAML in desktop is available,the yeast version only from Bio import Seq, SeqIO, AlignIO from Bio.Phylo.PAML import codeml, baseml import numpy as np paralog_list = [['YLR406C', 'YDL075W'], ['YER131W', 'YGL189C'], ['YML...
gpl-3.0
qinjian623/dlnotes
tutorials/tensorflow/mnist_softmax.py
1
2619
# 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...
gpl-3.0
dimasad/numpy
setup.py
21
8298
#!/usr/bin/env python """NumPy: array processing for numbers, strings, records, and objects. NumPy is a general-purpose array-processing package designed to efficiently manipulate large multi-dimensional arrays of arbitrary records without sacrificing too much speed for small multi-dimensional arrays. NumPy is built ...
bsd-3-clause
Maratyszcza/NNPACK
src/x86_64-fma/blas/conv1x1.py
3
9327
from __future__ import absolute_import from __future__ import division mr, nr = 2, 4 arg_input_channels = Argument(size_t, "input_channels") arg_image_size = Argument(size_t, "image_size") arg_input = Argument(ptr(const_float_), "input") arg_kernel = Argument(ptr(const_float_), "kernel") arg_output = Argument(ptr...
bsd-2-clause
Acidburn0zzz/servo
tests/wpt/web-platform-tests/tools/third_party/h2/test/test_complex_logic.py
39
21420
# -*- coding: utf-8 -*- """ test_complex_logic ~~~~~~~~~~~~~~~~ More complex tests that try to do more. Certain tests don't really eliminate incorrect behaviour unless they do quite a bit. These tests should live here, to keep the pain in once place rather than hide it in the other parts of the test suite. """ import...
mpl-2.0
cfg2015/EPT-2015-2
addons/project_issue/report/__init__.py
442
1084
# -*- 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
ojengwa/grr
server/data_server/auth_test.py
5
4768
#!/usr/bin/env python """Test the authentication facilities of the data servers.""" from grr.lib import config_lib from grr.lib import flags from grr.lib import test_lib from grr.lib import utils from grr.server.data_server import auth class AuthTest(test_lib.GRRBaseTest): """Tests the authentication package of...
apache-2.0
sidzan/netforce
netforce_product/netforce_product/models/product_attribute_value.py
4
1579
# Copyright (c) 2012-2015 Netforce Co. Ltd. # # 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, modify, merge, publ...
mit
GbalsaC/bitnamiP
edx-ora2/openassessment/assessment/api/self.py
6
12139
""" Public interface for self-assessment. """ import logging from django.db import DatabaseError, transaction from dogapi import dog_stats_api from submissions.api import get_submission_and_student, SubmissionNotFoundError from openassessment.assessment.serializers import ( InvalidRubric, full_assessment_dict, rub...
agpl-3.0
Eigenstate/dabble
dabble/test/dor_abssel/test_dor_absolute_sel.py
1
1915
""" Tests absolute box size with ignored selection """ import os import pytest dir = os.path.dirname(__file__) + "/" #============================================================================== @pytest.mark.skip(reason="Missing input file") def test_absolute_box(tmpdir): """ Tests the absolute box size for...
gpl-2.0
polux/webPLM
public/javascripts/closure-library-read-only/closure/bin/labs/code/generate_jsdoc.py
222
4318
#!/usr/bin/env python # # Copyright 2013 The Closure Library 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 ...
agpl-3.0
rinigus/osmscout-server
scripts/import/prepare_distribution.py
1
5119
#!/usr/bin/env python # This script prepares files before uploading them for distribution # This has to be run after all imports are finished import json, pickle, os, stat, shutil from mapbox_country_pack import world_pack as mapboxgl_world_pack root_dir = "distribution" bucket = open("bucket_name", "r").read().stri...
gpl-3.0
ceibal-tatu/sugar-toolkit-gtk3
src/sugar3/__init__.py
5
1048
# Copyright (C) 2006-2007, Red Hat, Inc. # Copyright (C) 2007-2008, One Laptop Per Child # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your o...
lgpl-2.1
Microsoft/PTVS
Python/Product/Miniconda/Miniconda3-x64/Lib/site-packages/pip/_vendor/chardet/jpcntx.py
289
19643
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights R...
apache-2.0
jose-caballero/cvmfsreplica
cvmfsreplica/cvmfsreplicaex.py
1
1122
#! /usr/bin/env python # # exception classes for cvmfsreplica project class ServiceConfigurationFailure(Exception): """ Exception to be raised when basic service configuration cannot be read """ def __init__(self, value): self.value = value def __str__(self): return repr(self.v...
gpl-3.0
klothe/pymssql
tests/test_threaded.py
6
3066
import sys import threading import time import unittest from _mssql import MSSQLDatabaseException from .helpers import mssqlconn, StoredProc, mark_slow error_sproc = StoredProc( "pymssqlErrorThreadTest", args=(), body="SELECT unknown_column FROM unknown_table") class _TestingThread(threading.Thread): ...
lgpl-2.1
Cryptophobia/ansible
lib/ansible/cli/adhoc.py
5
7095
# (c) 2012, 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) any lat...
gpl-3.0
wrigri/compute-image-packages
packages/python-google-compute-engine/google_compute_engine/instance_setup/instance_config.py
6
6415
#!/usr/bin/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 required by appli...
apache-2.0
mwmuni/LIGGGHTS_GUI
OpenGL/GL/APPLE/flush_buffer_range.py
9
1911
'''OpenGL extension APPLE.flush_buffer_range This module customises the behaviour of the OpenGL.raw.GL.APPLE.flush_buffer_range to provide a more Python-friendly API Overview (from the spec) APPLE_flush_buffer_range expands the buffer object API to allow greater performance when a client application only needs ...
gpl-3.0
MQQiang/kbengine
kbe/res/scripts/common/Lib/site-packages/pip/_vendor/requests/packages/chardet/constants.py
3008
1335
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
lgpl-3.0
compiteing/flask-ponypermission
venv/lib/python2.7/site-packages/setuptools/depends.py
462
6370
import sys import imp import marshal from imp import PKG_DIRECTORY, PY_COMPILED, PY_SOURCE, PY_FROZEN from distutils.version import StrictVersion from setuptools import compat __all__ = [ 'Require', 'find_module', 'get_module_constant', 'extract_constant' ] class Require: """A prerequisite to building or inst...
mit
mehdidc/scikit-learn
examples/gaussian_process/plot_gp_regression.py
253
4054
#!/usr/bin/python # -*- coding: utf-8 -*- r""" ========================================================= Gaussian Processes regression: basic introductory example ========================================================= A simple one-dimensional regression exercise computed in two different ways: 1. A noise-free cas...
bsd-3-clause
AICP/external_chromium_org
tools/json_schema_compiler/ppapi_generator.py
37
10976
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import collections import datetime import os.path import sys import code import cpp_util import model try: import jinja2 except ImportError: sys.path.a...
bsd-3-clause
axbaretto/beam
sdks/python/apache_beam/runners/worker/statesampler.py
5
5922
# # 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
lohner/Praktomat
src/tasks/views.py
1
5082
# -*- coding: utf-8 -*- import tempfile import zipfile from django.contrib.auth.decorators import login_required from django.contrib.admin.views.decorators import staff_member_required from django.shortcuts import render, get_object_or_404 from django.http import Http404 from django.http import HttpResponseRedirect, ...
gpl-2.0
SchulzLab/SOS
install_script.py
1
11581
#!/usr/bin/env python import os from optparse import OptionParser import subprocess import sys #import commands class install_script(): def __init__(self): self.prog_installed = [] def obtaining_tar(self, prog, path): if (prog == 6): os.chdir(path) #Before obtaining tha tar file of the corresponding tool,...
mit
zhuwenping/python-for-android
python-modules/twisted/twisted/test/test_task.py
56
20565
# Copyright (c) 2001-2007 Twisted Matrix Laboratories. # See LICENSE for details. from twisted.python.compat import set from twisted.trial import unittest from twisted.internet import interfaces, task, reactor, defer, error # Be compatible with any jerks who used our private stuff Clock = task.Clock from twisted.p...
apache-2.0
liuliwork/django
django/middleware/csrf.py
155
8477
""" Cross Site Request Forgery Middleware. This module provides a middleware that implements protection against request forgeries from other sites. """ from __future__ import unicode_literals import logging import re from django.conf import settings from django.core.urlresolvers import get_callable from django.utils...
bsd-3-clause
r41p41/snippets
mbae_Bypass.py
2
29684
import binascii import sys filename = "finalOutput.DOC" import struct # CVE-2010-3333, builder picked from some random forum. # modified to work on windows xp-8, office 2007 (enforced DEP) # rop chain first moves NULL into 2 offsets of mbae internal structs, then changes stack to RWX using mona.py # working as of Apri...
mit
spirali/elphie
elphie/textparser.py
1
1946
def normalize_tokens(tokens): # Remove empty texts tokens = [kv for kv in tokens if kv[0] != "text" or kv[1]] # Merge lines i = 1 while i < len(tokens): token_name, value = tokens[i] if token_name == "newline" and tokens[i - 1][0] == "newline": value2 = tokens[i - 1][1]...
bsd-2-clause
kennethgillen/ansible
lib/ansible/modules/database/misc/riak.py
70
8254
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, James Martin <jmartin@basho.com>, Drew Kerrigan <dkerrigan@basho.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 Fou...
gpl-3.0
beiko-lab/gengis
bin/Lib/lib-tk/tkMessageBox.py
9
3821
# tk common message boxes # # this module provides an interface to the native message boxes # available in Tk 4.2 and newer. # # written by Fredrik Lundh, May 1997 # # # options (all have default values): # # - default: which button to make default (one of the reply codes) # # - icon: which icon to displa...
gpl-3.0
whitewhim2718/python-qinfer
src/qinfer/_lib/__init__.py
3
1155
#!/usr/bin/python # -*- coding: utf-8 -*- ## # _lib/: Copies of external libraries used by QInfer, such as docopt. # Note that all other files in this directory are copyrighted and # licensed as described within each file, or by the corresponding # LICENSE and/or COPYING files. ## # © 2012 Chris Fe...
agpl-3.0
fosfataza/protwis
ligand/migrations/0001_initial.py
3
6236
# Generated by Django 2.0.1 on 2018-01-17 13:57 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ('common', '0001_initial'), ] operations = [ migrations.CreateModel( name='As...
apache-2.0
abacuspix/NFV_project
Build_Web_With_Flask/Building web applications with Flask_Code/chapter08/ex05.py
1
1529
# coding:utf-8 from flask import Flask, render_template, session, flash from flask.ext.sqlalchemy import SQLAlchemy app = Flask(__name__) # strong secret key!! app.config['SECRET_KEY'] = '\xa6\xb5\x0e\x7f\xd3}\x0b-\xaa\x03\x03\x82\x10\xbe\x1e0u\x93,{\xd4Z\xa3\x8f' app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///e...
mit
brijeshkesariya/odoo
addons/payment_buckaroo/controllers/main.py
325
1270
# -*- coding: utf-8 -*- try: import simplejson as json except ImportError: import json import logging import pprint import werkzeug from openerp import http, SUPERUSER_ID from openerp.http import request _logger = logging.getLogger(__name__) class BuckarooController(http.Controller): _return_url = '/pa...
agpl-3.0
DeepThoughtTeam/tensorflow
tensorflow/python/kernel_tests/tensor_array_ops_test.py
1
16965
# 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
Bismarrck/pymatgen
pymatgen/apps/battery/tests/test_insertion_battery.py
9
4792
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. from __future__ import unicode_literals """ Created on Jan 25, 2012 """ __author__ = "Anubhav Jain, Shyue Ping Ong" __copyright__ = "Copyright 2012, The Materials Project" __version__ = "0.1" __maintainer__ =...
mit
vipul-sharma20/oh-mainline
vendor/packages/celery/celery/tests/test_events/test_events_snapshot.py
18
3412
from __future__ import absolute_import from __future__ import with_statement from celery.app import app_or_default from celery.events import Events from celery.events.snapshot import Polaroid, evcam from celery.tests.utils import unittest class TRef(object): active = True called = False def __call__(sel...
agpl-3.0
esi-mineset/spark
examples/src/main/python/ml/min_hash_lsh_example.py
52
3222
# # 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
mozilla/bztools
auto_nag/history.py
1
16781
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. from pprint import pprint from libmozdata.bugzilla import Bugzilla from auto_nag import logger class History(object)...
bsd-3-clause
econ-ark/HARK
HARK/ConsumptionSaving/tests/test_SmallOpenEconomy.py
1
1397
import copy from HARK import distribute_params from HARK.ConsumptionSaving.ConsAggShockModel import ( AggShockConsumerType, SmallOpenEconomy, init_cobb_douglas, ) from HARK.distribution import Uniform import numpy as np import unittest class testSmallOpenEconomy(unittest.TestCase): def test_small_open...
apache-2.0
sephii/django
tests/template_tests/filter_tests/test_pluralize.py
430
1200
from decimal import Decimal from django.template.defaultfilters import pluralize from django.test import SimpleTestCase class FunctionTests(SimpleTestCase): def test_integers(self): self.assertEqual(pluralize(1), '') self.assertEqual(pluralize(0), 's') self.assertEqual(pluralize(2), 's')...
bsd-3-clause
shantanu561993/volatility
volatility/plugins/linux/process_hollow.py
14
4604
# Volatility # Copyright (C) 2007-2013 Volatility Foundation # # This file is part of Volatility. # # Volatility 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. You may not use, modify or # distribu...
gpl-2.0
cscorley/doc2vec-feature-location
scripts/boxplots.py
2
1180
# coding: utf-8 # In[1]: import numpy as np import matplotlib.pyplot as plt import gensim import src.main # In[2]: def get_all_ranks(project): r_lda = [x for x,y,z in src.main.read_ranks(project, 'release_lda')] r_lsi = [x for x,y,z in src.main.read_ranks(project, 'release_lsi')] c_lda = [x for x,y,z ...
bsd-3-clause
a-nai/django-wiki
wiki/plugins/haystack/search_indexes.py
16
1113
from __future__ import absolute_import from __future__ import unicode_literals from haystack import indexes from wiki import models class ArticleIndex(indexes.SearchIndex, indexes.Indexable): text = indexes.CharField(document=True, use_template=True) created = indexes.DateTimeField(model_attr='created') m...
gpl-3.0
kostajaitachi/shogun
examples/undocumented/python_modular/preprocessor_sortulongstring_modular.py
26
1464
#!/usr/bin/env python from tools.load import LoadMatrix lm=LoadMatrix() traindna = lm.load_dna('../data/fm_train_dna.dat') testdna = lm.load_dna('../data/fm_test_dna.dat') parameter_list = [[traindna,testdna,4,0,False,False],[traindna,testdna,3,0,False,False]] def preprocessor_sortulongstring_modular (fm_train_dna=t...
gpl-3.0
appsembler/edx-platform
lms/djangoapps/grades/config/models.py
12
3085
""" Models for configuration of the feature flags controlling persistent grades. """ from config_models.models import ConfigurationModel from django.conf import settings from django.db.models import BooleanField, IntegerField, TextField from opaque_keys.edx.django.models import CourseKeyField from six import text_type ...
agpl-3.0
Aravinthu/odoo
odoo/addons/base/ir/ir_filters.py
16
7285
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import ast from odoo import api, fields, models, tools, _ from odoo.exceptions import UserError class IrFilters(models.Model): _name = 'ir.filters' _description = 'Filters' _order = 'model_id, name, id des...
agpl-3.0
byterom/android_external_chromium_org
components/tools/metrics/browser_components_metrics.py
89
2137
#!/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. """Generates the metrics collected weekly for the Browser Components project. See http://www.chromium.org/developers/design-docume...
bsd-3-clause
power12317/weblate
weblate/trans/tests/__init__.py
1
1330
# -*- coding: utf-8 -*- # # Copyright © 2012 - 2013 Michal Čihař <michal@cihar.com> # # This file is part of Weblate <http://weblate.org/> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, eithe...
gpl-3.0
rduivenvoorde/QGIS
tests/src/python/test_provider_postgres.py
2
134441
# -*- coding: utf-8 -*- """QGIS Unit tests for the postgres provider. Note: to prepare the DB, you need to run the sql files specified in tests/testdata/provider/testdata_pg.sh Read tests/README.md about writing/launching tests with PostgreSQL. Run with ctest -V -R PyQgsPostgresProvider .. note:: This program is fr...
gpl-2.0
mazaclub/p2pool
SOAPpy/Errors.py
294
3002
""" ################################################################################ # # SOAPpy - Cayce Ullman (cayce@actzero.com) # Brian Matthews (blm@actzero.com) # Gregory Warnes (Gregory.R.Warnes@Pfizer.com) # Christopher Blunck (blunck@gst.com) # ##########################...
gpl-3.0
jmetzen/scikit-learn
examples/svm/plot_iris.py
225
3252
""" ================================================== Plot different SVM classifiers in the iris dataset ================================================== Comparison of different linear SVM classifiers on a 2D projection of the iris dataset. We only consider the first 2 features of this dataset: - Sepal length - Se...
bsd-3-clause
fotinakis/sentry
src/sentry/web/frontend/organization_member_settings.py
6
4160
from __future__ import absolute_import from django.contrib import messages from django.core.urlresolvers import reverse from django.db.models import Q from django.utils.translation import ugettext_lazy as _, ugettext from sentry import roles from sentry.models import OrganizationMember, OrganizationMemberTeam, \ ...
bsd-3-clause
CXQERP/ODOOERP
addons/decimal_precision/decimal_precision.py
233
3728
# -*- 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 the G...
agpl-3.0
janekg89/flutype_webapp
flutype/urls.py
1
4288
from django.conf.urls import url from django.contrib import admin from django.conf.urls import url, include from . import views urlpatterns = [ url(r'^$', views.studies_view, name='index'), url(r'^admin/', include(admin.site.urls), name='admin'), url(r'^mystudies/$', views.my_studies_view, name='my_studi...
lgpl-3.0
zzzombat/lucid-python-django
django/db/backends/postgresql/operations.py
229
9420
import re from django.db.backends import BaseDatabaseOperations # This DatabaseOperations class lives in here instead of base.py because it's # used by both the 'postgresql' and 'postgresql_psycopg2' backends. class DatabaseOperations(BaseDatabaseOperations): def __init__(self, connection): super(Databas...
bsd-3-clause
ZhangXinNan/tensorflow
tensorflow/python/keras/datasets/__init__.py
62
1264
# 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
biodrone/plex-desk
desk/flask/lib/python3.4/site-packages/pip/req/req_file.py
85
5511
from __future__ import absolute_import import os import re from pip._vendor.six.moves.urllib import parse as urllib_parse from pip.download import get_file_content from pip.req.req_install import InstallRequirement from pip.utils import normalize_name _scheme_re = re.compile(r'^(http|https|file):', re.I) def pars...
mit