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
aakash-cr7/zulip
zerver/management/commands/runtornado.py
32
4794
from __future__ import absolute_import from __future__ import print_function from django.conf import settings settings.RUNNING_INSIDE_TORNADO = True # We must call zerver.tornado.ioloop_logging.instrument_tornado_ioloop # before we import anything else from our project in order for our # Tornado load logging to work; ...
apache-2.0
bhavin04890/finaldashboard
controllers/dvr.py
8
1813
# -*- coding: utf-8 -*- module = request.controller resourcename = request.function if not settings.has_module(module): raise HTTP(404, body="Module disabled: %s" % module) # ----------------------------------------------------------------------------- def index(): """ Module's Home Page """ module_name...
mit
Akylas/CouchPotatoServer
libs/jinja2/testsuite/lexnparse.py
8
14120
# -*- coding: utf-8 -*- """ jinja2.testsuite.lexnparse ~~~~~~~~~~~~~~~~~~~~~~~~~~ All the unittests regarding lexing, parsing and syntax. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ import sys import unittest from jinja2.testsuite import JinjaTestCase ...
gpl-3.0
Endika/c2c-rd-addons
account_financial_report_chricar/wizard/wizard_print_journal_entries.py
5
4154
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (c) 2009 Zikzakmedia S.L. (http://zikzakmedia.com) All Rights Reserved. # Jordi Esteve <jesteve@zikzakmedia.com> # $Id$...
agpl-3.0
danhooper/sandbox
pinball/attract.py
1
2386
from procgame import * class Mode(game.Mode): def __init__(self, game): super(Mode, self).__init__(game, 1) highscore_categories = [] cat = highscore.HighScoreCategory() cat.game_data_key = "HighScores" cat.titles = [ "Grand Champion", "High Score 1"...
mit
userzimmermann/robotframework-python3
src/robot/utils/text.py
1
3235
# Copyright 2008-2014 Nokia Solutions and Networks # # 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
trondhindenes/ansible
lib/ansible/template/template.py
156
1632
# (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
cntnboys/410Lab6
build/django/django/middleware/transaction.py
54
2703
import warnings from django.core.exceptions import MiddlewareNotUsed from django.db import connection, transaction from django.utils.deprecation import RemovedInDjango18Warning class TransactionMiddleware(object): """ Transaction middleware. If this is enabled, each view function will be run with commit_...
apache-2.0
dagoaty/eve-wspace
evewspace/core/management/commands/defaultsettings.py
9
1570
# Eve W-Space # Copyright (C) 2013 Andrew Austin and other 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...
gpl-3.0
chromium/chromium
build/util/lib/common/chrome_test_server_spawner.py
6
16817
# Copyright 2017 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. """A "Test Server Spawner" that handles killing/stopping per-test test servers. It's used to accept requests from the device to spawn and kill instances of ...
bsd-3-clause
Tomtomgo/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/common/net/unittestresults.py
155
2347
# Copyright (c) 2012, 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
adamjmcgrath/glancydesign
src/django-nonrel/tests/regressiontests/comment_tests/tests/__init__.py
88
3272
from django.contrib.auth.models import User from django.contrib.comments.forms import CommentForm from django.contrib.comments.models import Comment from django.contrib.contenttypes.models import ContentType from django.contrib.sites.models import Site from django.test import TestCase from regressiontests.comment_tests...
bsd-3-clause
sohkis/leanKernel-shamu
tools/perf/util/setup.py
2079
1438
#!/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
jbking/demo-appengine-django-golang
myproject/django/utils/autoreload.py
110
5262
# Autoreloading launcher. # Borrowed from Peter Hunt and the CherryPy project (http://www.cherrypy.org). # Some taken from Ian Bicking's Paste (http://pythonpaste.org/). # # Portions copyright (c) 2004, CherryPy Team (team@cherrypy.org) # All rights reserved. # # Redistribution and use in source and binary forms, with ...
mit
onyxfish/votersdaily_web
api/couchdb/log_views.py
1
2166
import couchdb from couchdb.design import ViewDefinition """ This module defines a collection of functions which accept a CouchDB database as an argument, are named with a 'make_views_*' convention, and return a list of generated CouchDB ViewDefinitions. The 'syncviews' management command dynamically executes each me...
gpl-3.0
Deepakpatle/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/steps/createbug.py
125
2563
# 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 ...
bsd-3-clause
antsmc2/mics
survey/tests/services/test_simple_indicator_service.py
2
12529
from random import randint from rapidsms.contrib.locations.models import LocationType, Location from survey.models import Backend, Investigator, QuestionModule, Question, QuestionOption, Indicator, Formula, Household, HouseholdHead, Batch, MultiChoiceAnswer, HouseholdMemberGroup, Survey, GroupCondition, EnumerationArea...
bsd-3-clause
phobson/statsmodels
statsmodels/datasets/randhie/data.py
3
2650
"""RAND Health Insurance Experiment Data""" __docformat__ = 'restructuredtext' COPYRIGHT = """This is in the public domain.""" TITLE = __doc__ SOURCE = """ The data was collected by the RAND corporation as part of the Health Insurance Experiment (HIE). http://www.rand.org/health/projects/hie.html This ...
bsd-3-clause
arnedesmedt/dotfiles
.config/sublime-text-3/Packages.symlinkfollow/pygments/all/pygments/lexers/pawn.py
47
8094
# -*- coding: utf-8 -*- """ pygments.lexers.pawn ~~~~~~~~~~~~~~~~~~~~ Lexers for the Pawn languages. :copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.lexer import RegexLexer from pygments.token import Text, Comment, Opera...
mit
grlee77/nipype
nipype/interfaces/slicer/filtering/tests/test_auto_MaskScalarVolume.py
9
1256
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT from nipype.testing import assert_equal from nipype.interfaces.slicer.filtering.arithmetic import MaskScalarVolume def test_MaskScalarVolume_inputs(): input_map = dict(InputVolume=dict(argstr='%s', position=-3, ), MaskVolume=dict(argstr='%s', po...
bsd-3-clause
yiqingj/airflow
airflow/executors/__init__.py
9
1759
# -*- coding: utf-8 -*- # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software ...
apache-2.0
gsnbng/erpnext
erpnext/patches/v11_0/move_item_defaults_to_child_table_for_multicompany.py
10
3389
# Copyright (c) 2018, Frappe and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe def execute(): ''' Fields to move from the item to item defaults child table [ default_warehouse, buying_cost_center, expense_account, selling_cost_center, ...
agpl-3.0
pr-omethe-us/PyKED
pyked/chemked.py
1
44185
""" Main ChemKED module """ # Standard libraries from os.path import exists from collections import namedtuple from warnings import warn from copy import deepcopy import xml.etree.ElementTree as etree import xml.dom.minidom as minidom from itertools import chain import numpy as np # Local imports from .validation imp...
bsd-3-clause
bjornaa/ladim
ladim/state.py
1
6096
""" Class for the state of the model """ import sys import os import importlib import logging from typing import Any, Dict, Sized # mypy import numpy as np from netCDF4 import Dataset, num2date from .tracker import Tracker from .gridforce import Grid, Forcing # ------------------------ Config = Dict[str, Any] c...
mit
Anvil/maestro-ng
maestro/loader.py
1
2758
# Copyright (C) 2015 SignalFx, Inc. All rights reserved. # # Docker container orchestration utility. import jinja2 import os import sys import yaml from . import exceptions class MaestroYamlConstructor(yaml.constructor.Constructor): """A PyYAML object constructor that errors on duplicate keys in YAML mappin...
apache-2.0
bollu/sandhi
modules/gr36/docs/sphinx/hieroglyph/test/test_comments.py
72
24669
import unittest from hieroglyph.hieroglyph import parse_hieroglyph_text from hieroglyph.errors import HieroglyphError class CommentTests(unittest.TestCase): def test_comment1(self): source = """Fetches rows from a Bigtable. This is a continuation of the opening paragraph. Retrieves rows ...
gpl-3.0
bootstraponline/testdroid_device_finder
device_finder.py
1
4900
# -*- coding: utf-8 -*- # from: https://github.com/bitbar/testdroid-samples/blob/03fc043ba98235b9ea46a0ab8646f3b20dd1960e/appium/sample-scripts/python/device_finder.py import os, sys, requests, json, time, httplib from optparse import OptionParser from urlparse import urljoin from datetime import datetime class Devi...
apache-2.0
eyalfa/spark
examples/src/main/python/ml/logistic_regression_with_elastic_net.py
123
2029
# # 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
OTWillems/GEO1005
SpatialDecision/external/networkx/algorithms/centrality/eigenvector.py
20
6965
# coding=utf8 """ Eigenvector centrality. """ # Copyright (C) 2004-2015 by # Aric Hagberg <hagberg@lanl.gov> # Dan Schult <dschult@colgate.edu> # Pieter Swart <swart@lanl.gov> # All rights reserved. # BSD license. import networkx as nx __author__ = "\n".join(['Aric Hagberg (aric.hagberg@gmail.com)', ...
gpl-2.0
soulshake/readthedocs.org
readthedocs/builds/version_slug.py
34
5991
"""Contains logic for handling version slugs. Handling slugs for versions is not too straightforward. We need to allow some characters which are uncommon in usual slugs. They are dots and underscores. Usually we want the slug to be the name of the tag or branch corresponding VCS version. However we need to strip url-d...
mit
icgc/icgc-get
tests/test_ega.py
1
1474
# # Copyright (c) 2016 The Ontario Institute for Cancer Research. All rights reserved. # # This program and the accompanying materials are made available under the terms of the GNU Public License v3.0. # You should have received a copy of the GNU General Public License along with # this program. If not, see <http://www...
gpl-3.0
timothycrosley/webelements_site
DynamicForm/AppEngine.py
4
1742
""" Defines an AppEngine compatible version of DynamicForm """ import webapp2 from . import HTTP, PageControls from .DynamicForm import DynamicForm as BaseDynamicForm class DynamicForm(webapp2.RequestHandler, BaseDynamicForm): """ Overrides handler methods of the DynamicForm class to enable it to run ...
mit
mistercrunch/panoramix
tests/superset_test_config_thumbnails.py
3
2665
# 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 u...
apache-2.0
saurabh6790/test-erp
erpnext/patches/v4_0/update_custom_print_formats_for_renamed_fields.py
119
1265
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe import re def execute(): # NOTE: sequence is important fields_list = ( ("amount", "base_amount"), ("ref_rate", "price_list_rate"), ...
agpl-3.0
AutorestCI/azure-sdk-for-python
azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/provider_resource_type.py
2
1829
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
vighneshbirodkar/scikit-image
skimage/util/tests/test_apply_parallel.py
8
1976
from __future__ import absolute_import import numpy as np from numpy.testing import assert_array_almost_equal from numpy.testing.decorators import skipif from skimage.filters import threshold_adaptive, gaussian from skimage.util.apply_parallel import apply_parallel, dask_available @skipif(not dask_available) def te...
bsd-3-clause
yashodhank/frappe
frappe/desk/calendar.py
10
1155
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe from frappe import _ import json @frappe.whitelist() def update_event(args, field_map): """Updates Event (called via calendar) based on passed `field_map`""" arg...
mit
sikmir/QGIS
python/PyQt/PyQt5/QtWidgets.py
45
1111
# -*- coding: utf-8 -*- """ *************************************************************************** QtWidgets.py --------------------- Date : November 2015 Copyright : (C) 2015 by Matthias Kuhn Email : matthias at opengis dot ch ************************...
gpl-2.0
spring-week-topos/nova-week
nova/tests/compute/test_compute_cells.py
15
8527
# Copyright (c) 2012 Rackspace Hosting # 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 req...
apache-2.0
jbenden/ansible
lib/ansible/modules/network/system/net_system.py
8
3065
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, Ansible by Red Hat, inc # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.0', ...
gpl-3.0
roderickvd/nzbToMedia
libs/unidecode/x0a4.py
252
4437
data = ( 'qiet', # 0x00 'qiex', # 0x01 'qie', # 0x02 'qiep', # 0x03 'quot', # 0x04 'quox', # 0x05 'quo', # 0x06 'quop', # 0x07 'qot', # 0x08 'qox', # 0x09 'qo', # 0x0a 'qop', # 0x0b 'qut', # 0x0c 'qux', # 0x0d 'qu', # 0x0e 'qup', # 0x0f 'qurx', # 0x10 'qur', # 0x11 ...
gpl-3.0
romain-li/edx-platform
lms/djangoapps/commerce/migrations/0002_commerceconfiguration.py
59
1477
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('commerce...
agpl-3.0
mcanthony/rethinkdb
test/interface/stat.py
3
14876
#!/usr/bin/env python # Copyright 2010-2015 RethinkDB, all rights reserved. # This file tests the `rethinkdb.stats` admin table. # The scenario works by starting a cluster of two servers and two tables. The tables are # then sharded across the two servers (no replicas), and populated with 100 rows. # A small read/writ...
agpl-3.0
nzavagli/UnrealPy
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/django-1.8.2/tests/validation/test_picklable.py
576
2010
import pickle from unittest import TestCase from django.core.exceptions import ValidationError class PickableValidationErrorTestCase(TestCase): def test_validationerror_is_picklable(self): original = ValidationError('a', code='something') unpickled = pickle.loads(pickle.dumps(original)) ...
mit
mdrumond/tensorflow
tensorflow/python/ops/control_flow_grad.py
16
9130
# 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
taedori81/wagtail
wagtail/wagtailimages/tests/test_rich_text.py
13
2051
from django.test import TestCase from bs4 import BeautifulSoup from mock import patch from wagtail.wagtailimages.rich_text import ImageEmbedHandler class TestImageEmbedHandler(TestCase): def test_get_db_attributes(self): soup = BeautifulSoup( '<b data-id="test-id" data-format="test-format" d...
bsd-3-clause
bolkedebruin/airflow
tests/providers/datadog/hooks/test_datadog.py
1
4769
# -*- coding: utf-8 -*- # # 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 #...
apache-2.0
wbrefvem/github3.py
tests/test_notifications.py
5
3078
import github3 import datetime from tests.utils import BaseCase, load class TestThread(BaseCase): def __init__(self, methodName='runTest'): super(TestThread, self).__init__(methodName) self.thread = github3.notifications.Thread(load('notification')) self.api = ("https://api.github.com/noti...
bsd-3-clause
chrisfilda/edx_platform
lms/envs/common.py
1
51252
# -*- coding: utf-8 -*- """ This is the common settings file, intended to set sane defaults. If you have a piece of configuration that's dependent on a set of feature flags being set, then create a function that returns the calculated value based on the value of FEATURES[...]. Modules that extend this one can change th...
agpl-3.0
mathjazz/pontoon
pontoon/db/tests/test_lookups.py
3
1775
""" Collation lookups allow a user to set text-collation to search queries. """ import pytest from pontoon.db import IContainsCollate # noqa from pontoon.base.models import Entity from pontoon.base.tests import EntityFactory @pytest.fixture @pytest.mark.django_db def collation_entities(): # Create a list of ins...
bsd-3-clause
chen0031/Dato-Core
src/unity/python/graphlab/test/test_sarray_sketch.py
13
11788
''' Copyright (C) 2015 Dato, Inc. All rights reserved. This software may be modified and distributed under the terms of the BSD license. See the DATO-PYTHON-LICENSE file for details. ''' # from nose import with_setup # -*- coding: utf-8 -*- from graphlab.data_structures.sarray import SArray import pandas as pd import ...
agpl-3.0
PawarPawan/h2o-v3
py2/testdir_rapids/test_rapids_basic.py
21
10673
import unittest, random, sys, time sys.path.extend(['.','..','../..','py']) import h2o2 as h2o import h2o_browse as h2b, h2o_exec as h2e, h2o_import as h2i # ! is only needed if there is no indexing initList = [ # weird cases with lhs # can only index v if it already exists. is the lhs addition befor...
apache-2.0
shravan-shandilya/web3.py
tests/utilities/test_abi_filtering_by_argument_name.py
2
1462
import pytest from web3.utils.abi import ( filter_by_argument_name, ) ABI = [ { "constant": False, "inputs": [], "name": "func_1", "outputs": [], "type": "function", }, { "constant": False, "inputs": [ {"name": "a", "type": "uint256"}...
mit
atlassian/boto
boto/datapipeline/exceptions.py
235
1471
# Copyright (c) 2012 Amazon.com, Inc. or its affiliates. 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 ...
mit
synmnstr/flexx
flexx/webruntime/chromeapp.py
12
2788
""" Web runtime based on a chrome app In contrast to running in the chrome browser, this makes the app have more the look and feel of a desktop app. """ import os import sys from .common import DesktopRuntime # todo: icon, sizing, etc. def get_chrome_exe(): """ Get the path of the Chrome executable If...
bsd-2-clause
perkinslr/pypyjs
website/js/pypy.js-0.2.0/lib/modules/_marshal.py
11
17225
"""Internal Python object serialization This module contains functions that can read and write Python values in a binary format. The format is specific to Python, but independent of machine architecture issues (e.g., you can write a Python value to a file on a PC, transport the file to a Sun, and read it back there). ...
mit
ric2b/Vivaldi-browser
chromium/third_party/mako/examples/bench/basic.py
58
6913
# basic.py - basic benchmarks adapted from Genshi # Copyright (C) 2006 Edgewall Software # 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 ...
bsd-3-clause
netroby/percona-xtrabackup
storage/innobase/xtrabackup/test/python/iso8601/test_iso8601.py
92
3044
import iso8601 def test_iso8601_regex(): assert iso8601.ISO8601_REGEX.match("2006-10-11T00:14:33Z") def test_timezone_regex(): assert iso8601.TIMEZONE_REGEX.match("+01:00") assert iso8601.TIMEZONE_REGEX.match("+00:00") assert iso8601.TIMEZONE_REGEX.match("+01:20") assert iso8601.TIMEZONE_REGEX.mat...
gpl-2.0
liorvh/raspberry_pwn
src/pentest/voiper/torturer/replay.py
8
12177
''' This file is part of VoIPER. VoIPER is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version. VoIPER is distributed in the hope that it will be u...
gpl-3.0
computersalat/ansible
lib/ansible/plugins/httpapi/__init__.py
33
3146
# (c) 2018 Red Hat Inc. # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type from abc import abstractmethod from ansible.plugins import AnsiblePlugin class HttpApiBase(AnsiblePlugin): ...
gpl-3.0
neerajvashistha/pa-dude
lib/python2.7/site-packages/django/conf/__init__.py
135
7622
""" Settings and configuration for Django. Values will be read from the module specified by the DJANGO_SETTINGS_MODULE environment variable, and then from django.conf.global_settings; see the global settings file for a list of all possible variables. """ import importlib import os import time import warnings from dj...
mit
pwns4cash/vivisect
envi/qt/memwrite.py
5
8919
import string import envi.memory as e_mem import envi.memcanvas as e_canvas import envi.memcanvas.renderers as e_render from PyQt4 import QtGui, QtCore class VQLineEdit(QtGui.QLineEdit): ''' Has an additional signal to emit a signal on release of every keypress. ''' keyReleased = QtCore.pyqtSignal(Qt...
apache-2.0
wfxiang08/jieba
jieba/posseg/__init__.py
57
9232
from __future__ import absolute_import, unicode_literals import os import re import sys import jieba import marshal from .._compat import * from .viterbi import viterbi PROB_START_P = "prob_start.p" PROB_TRANS_P = "prob_trans.p" PROB_EMIT_P = "prob_emit.p" CHAR_STATE_TAB_P = "char_state_tab.p" re_han_detail = re.comp...
mit
tomlof/scikit-learn
examples/plot_digits_pipe.py
65
1652
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= Pipelining: chaining a PCA and a logistic regression ========================================================= The PCA does an unsupervised dimensionality reduction, while the logistic regression does the predictio...
bsd-3-clause
was4444/chromium.src
tools/perf/measurements/v8_gc_times.py
5
9627
# 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_test from telemetry.timeline.model import TimelineModel from telemetry.timeline import tracing_config from telemetry.util imp...
bsd-3-clause
iABC2XYZ/abc
DM_RFGAP_5/From ~4/RFGap.py
3
1368
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Jul 31 22:10:38 2017 Author: Peiyong Jiang : jiangpeiyong@impcas.ac.cn Function: RFGap __________________________________________________ K,dE=RFGap() """ from InputBeam import qParticle,massMeV,mParticle,energyInMeV from Constants import p...
gpl-3.0
jdogewow/gamercoin
contrib/pyminer/pyminer.py
1257
6438
#!/usr/bin/python # # Copyright (c) 2011 The Bitcoin developers # Distributed under the MIT/X11 software license, see the accompanying # file license.txt or http://www.opensource.org/licenses/mit-license.php. # import time import json import pprint import hashlib import struct import re import base64 import httplib im...
mit
Iv4n3r0h1n/2chcoin_wallet
contrib/pyminer/pyminer.py
385
6434
#!/usr/bin/python # # Copyright (c) 2011 The Bitcoin developers # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # import time import json import pprint import hashlib import struct import re import base64 import httplib import...
mit
Filechaser/nzbToMedia
libs/unidecode/x0c2.py
253
4710
data = ( 'syon', # 0x00 'syonj', # 0x01 'syonh', # 0x02 'syod', # 0x03 'syol', # 0x04 'syolg', # 0x05 'syolm', # 0x06 'syolb', # 0x07 'syols', # 0x08 'syolt', # 0x09 'syolp', # 0x0a 'syolh', # 0x0b 'syom', # 0x0c 'syob', # 0x0d 'syobs', # 0x0e 'syos', # 0x0f 'syoss', #...
gpl-3.0
yoer/hue
desktop/core/ext-py/pyasn1-0.1.8/test/codec/cer/test_encoder.py
23
6061
from pyasn1.type import namedtype, univ, useful from pyasn1.codec.cer import encoder from pyasn1.compat.octets import ints2octs from pyasn1.error import PyAsn1Error from sys import version_info if version_info[0:2] < (2, 7) or \ version_info[0:2] in ( (3, 0), (3, 1) ): try: import unittest2 as unittest ...
apache-2.0
AlanD88/website
web2py/gluon/contrib/pyrtf/Renderer.py
44
26038
from types import StringType, ListType, TupleType from copy import deepcopy from Elements import * DEFAULT_TAB_WIDTH = 720 ParagraphAlignmentMap = { ParagraphPropertySet.LEFT : 'ql', ParagraphPropertySet.RIGHT : 'qr', ParagraphPropertySet.CENTER : 'qc...
mit
spcui/tp-qemu
qemu/tests/sr_iov_boot_negative.py
7
1327
import logging from autotest.client.shared import error from virttest import env_process @error.context_aware def run(test, params, env): """ KVM boot with negative parameter test: 1) Try to boot VM with negative parameters. 2) Verify that qemu could handle the negative parameters. Check the ne...
gpl-2.0
hybrideagle/django
tests/schema/models.py
237
4275
from django.apps.registry import Apps from django.db import models from django.utils.encoding import python_2_unicode_compatible # Because we want to test creation and deletion of these as separate things, # these models are all inserted into a separate Apps so the main test # runner doesn't migrate them. new_apps = ...
bsd-3-clause
redhat-cip/python-tripleo-wrapper
rdomhelper/ssh.py
1
11391
# -*- coding: utf-8 -*- # # Copyright (C) 2016 Red Hat, Inc # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
apache-2.0
johndpope/tensorflow
tensorflow/python/kernel_tests/distributions/dirichlet_multinomial_test.py
15
18254
# 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
bigdatauniversity/edx-platform
lms/djangoapps/discussion_api/tests/test_views.py
14
52323
""" Tests for Discussion API views """ from datetime import datetime import json from urlparse import urlparse import ddt import httpretty import mock from pytz import UTC from django.core.urlresolvers import reverse from rest_framework.parsers import JSONParser from rest_framework.test import APIClient from xmodule...
agpl-3.0
hermestrimegiste/patchtgtel
patchConnectionTogotelecom.py
1
2031
#-*- coding:utf-8 -*- __author__ = 'hermes' import socket from os import system from time import sleep from datetime import datetime global connectionName connectionName = 'TOGOTELECOM' # Definir le nom de votre reseau def is_connected(): # http://stackoverflow.com/questions/20913411/test-if-an-internet-connectio...
gpl-2.0
ATIX-AG/ansible
lib/ansible/modules/windows/win_whoami.py
52
5530
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2017, 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
InAnimaTe/CouchPotatoServer
libs/bs4/builder/_htmlparser.py
412
8839
"""Use the HTMLParser library to parse HTML files that aren't too bad.""" __all__ = [ 'HTMLParserTreeBuilder', ] from HTMLParser import ( HTMLParser, HTMLParseError, ) import sys import warnings # Starting in Python 3.2, the HTMLParser constructor takes a 'strict' # argument, which we'd like to s...
gpl-3.0
nigelb/SerialGrabber
serial_grabber/cli.py
1
2827
#!/usr/bin/env python # SerialGrabber reads data from a serial port and processes it with the # configured processor. # Copyright (C) 2012 NigelB # # 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 Foundatio...
gpl-2.0
Tianhao-Gu/kb_uploadmethods
lib/installed_clients/ConditionUtilsClient.py
2
5789
# -*- coding: utf-8 -*- ############################################################ # # Autogenerated by the KBase type compiler - # any changes made here will be overwritten # ############################################################ from __future__ import print_function # the following is a hack to get the basec...
mit
mdhaber/scipy
scipy/optimize/_lsq/least_squares.py
12
39190
"""Generic interface for least-squares minimization.""" from warnings import warn import numpy as np from numpy.linalg import norm from scipy.sparse import issparse, csr_matrix from scipy.sparse.linalg import LinearOperator from scipy.optimize import _minpack, OptimizeResult from scipy.optimize._numdiff import approx...
bsd-3-clause
martinwoodward/coreclr
src/pal/automation/util.py
154
2814
import sys import getopt import os import subprocess import shutil import logging as log def Initialize(platform): print "Initializing Workspace" global workspace workspace = os.environ['WORKSPACE'] if platform == "windows": # Jenkins puts quotes in the path, which is wrong. Remove quotes. ...
mit
seanwestfall/django
django/http/request.py
50
19501
from __future__ import unicode_literals import copy import re import sys from io import BytesIO from itertools import chain from django.conf import settings from django.core import signing from django.core.exceptions import DisallowedHost, ImproperlyConfigured from django.core.files import uploadhandler from django.h...
bsd-3-clause
shubhdev/openedx
common/test/acceptance/pages/studio/html_component_editor.py
115
1139
from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.action_chains import ActionChains from component_editor import ComponentEditorView class HtmlComponentEditorView(ComponentEditorView): """ Represents the rendered view of an HTML component editor. """ def set_content_and_sa...
agpl-3.0
MERegistro/meregistro
django/views/generic/simple.py
76
1634
from django.template import loader, RequestContext from django.http import HttpResponse, HttpResponseRedirect, HttpResponsePermanentRedirect, HttpResponseGone def direct_to_template(request, template, extra_context=None, mimetype=None, **kwargs): """ Render a given template with any extra URL parameters in the...
bsd-3-clause
x111ong/django
tests/model_regress/test_pickle.py
271
3804
import datetime import os import pickle import subprocess import sys import warnings from django.core.files.temp import NamedTemporaryFile from django.db import DJANGO_VERSION_PICKLE_KEY, models from django.test import TestCase, mock from django.utils._os import npath, upath from django.utils.encoding import force_tex...
bsd-3-clause
xundaokeji/three.js
utils/exporters/blender/addons/io_three/exporter/base_classes.py
72
3264
from . import utilities from .. import constants, exceptions class BaseClass(constants.BASE_DICT): """Base class which inherits from a base dictionary object.""" _defaults = {} def __init__(self, parent=None, type=None): constants.BASE_DICT.__init__(self) self._type = type self....
mit
otherness-space/myProject
my_project_001/lib/python2.7/site-packages/django/contrib/flatpages/tests/middleware.py
207
6861
import os from django.conf import settings from django.contrib.auth.models import User from django.contrib.auth.tests.utils import skipIfCustomUser from django.contrib.flatpages.models import FlatPage from django.test import TestCase from django.test.utils import override_settings @override_settings( LOGIN_URL='/...
mit
alrifqi/django
tests/csrf_tests/tests.py
152
19350
# -*- coding: utf-8 -*- from __future__ import unicode_literals import logging from django.conf import settings from django.http import HttpRequest, HttpResponse from django.middleware.csrf import ( CSRF_KEY_LENGTH, CsrfViewMiddleware, get_token, ) from django.template import RequestContext, Template from django....
bsd-3-clause
nickmoline/feedsanitizer
djangoappengine/tests/filter.py
5
20149
from ..db.utils import get_cursor, set_cursor from .testmodels import FieldsWithOptionsModel, EmailModel, DateTimeModel, \ OrderedModel, BlobModel from django.db.models import Q from django.db.utils import DatabaseError from django.test import TestCase from django.utils import unittest from google.appengine.api.dat...
mit
Hybrid-Cloud/badam
patches_tool/aws_patch/aws_deps/libcloud/compute/drivers/vultr.py
1
6023
# 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 ...
apache-2.0
gabbayo/git-repo
subcmds/diffmanifests.py
3
7574
# -*- coding:utf-8 -*- # # Copyright (C) 2014 The Android Open Source Project # # 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 re...
apache-2.0
endlessm/chromium-browser
third_party/skia/tools/skp/page_sets/skia_gmail_desktop.py
8
1699
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # pylint: disable=W0401,W0614 import os from page_sets.login_helpers import google_login from telemetry import story from telemetry.page import page as pag...
bsd-3-clause
Bloodyaugust/pongsugarlabcpp
lib/boost/tools/build/src/util/path.py
6
30017
# Status: this module is ported on demand by however needs something # from it. Functionality that is not needed by Python port will # be dropped. # Copyright (C) Vladimir Prus 2002. Permission to copy, use, modify, sell and # distribute this software is granted provided this copyright notice appears in # al...
gpl-2.0
tfhq/googletest
test/gtest_help_test.py
2968
5856
#!/usr/bin/env python # # Copyright 2009, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list...
bsd-3-clause
YourCyborg/Sun-RPI
src/objects/admin.py
1
5428
# # This sets up how models are displayed # in the web admin interface. # from django import forms from django.conf import settings from django.contrib import admin from src.objects.models import ObjAttribute, ObjectDB, ObjectNick, Alias from src.utils.utils import mod_import class ObjAttributeInline(adm...
bsd-3-clause
shimlee/mptcp_magw
tools/perf/scripts/python/net_dropmonitor.py
2669
1738
# Monitor the system for dropped packets and proudce a report of drop locations and counts import os import sys sys.path.append(os.environ['PERF_EXEC_PATH'] + \ '/scripts/python/Perf-Trace-Util/lib/Perf/Trace') from perf_trace_context import * from Core import * from Util import * drop_log = {} kallsyms = [] def...
gpl-2.0
dgutman/ADRCPathViewer
api/routes/v1/Tile.py
1
1783
from flask_restful import Resource from flask import Response from bson.objectid import ObjectId from bson.json_util import dumps from utils.deepzoom import get_slide, PILBytesIO class Tile(Resource): def __init__(self, db, config): """initialize DeepZoom resource Args: db: mongo db connection config: appl...
mit
NikolaYolov/invenio_backup
modules/bibconvert/lib/bibconvert_bfx_engine.py
17
10494
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 CERN. ## ## Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## ...
gpl-2.0