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
burbucoin/burbucoin
contrib/spendfrom/spendfrom.py
792
10053
#!/usr/bin/env python # # Use the raw transactions API to spend bitcoins received on particular addresses, # and send any change back to that same address. # # Example usage: # spendfrom.py # Lists available funds # spendfrom.py --from=ADDRESS --to=ADDRESS --amount=11.00 # # Assumes it will talk to a bitcoind or Bit...
mit
hrashk/sympy
sympy/core/tests/test_exprtools.py
2
13341
"""Tests for tools for manipulating of large commutative expressions. """ from sympy import (S, Add, sin, Mul, Symbol, oo, Integral, sqrt, Tuple, I, Interval, O, symbols, simplify, collect, Sum, Basic, Dict, root, exp) from sympy.abc import a, b, t, x, y, z from sympy.core.exprtoo...
bsd-3-clause
wetdesert/rad2py
ide2py/debugger.py
8
29950
#!/usr/bin/env python # coding:utf-8 "Integrated Debugger Frontend for qdb" __author__ = "Mariano Reingart (reingart@gmail.com)" __copyright__ = "Copyright (C) 2011 Mariano Reingart" __license__ = "GPL 3.0" # initally based on idle, inspired by pythonwin implementation from multiprocessing.connection import Listene...
gpl-3.0
nibrahim/PlasTeX
plasTeX/Packages/textcomp.py
8
2219
#!/usr/bin/env python from plasTeX import Command from plasTeX.Base.LaTeX import Accents class textonequarter(Command): unicode = u'\u00BC' class textonehalf(Command): unicode = u'\u00BD' class textthreequarters(Command): unicode = u'\u00BE' class textzerooldstyle(Command): unicode = '0' class tex...
mit
meisterkleister/erpnext
erpnext/selling/page/sales_funnel/sales_funnel.py
56
1473
# 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 @frappe.whitelist() def get_funnel_data(from_date, to_date): active_leads = frappe.db.sql("""select count(*) from `tabLead` where (dat...
agpl-3.0
erscott/Wellderly
SWGR_v1.0/masterVar_chr_split.py
1
3344
''' Splits Complete Genomics masterVar files into chromosome specific masterVar files when given an input file path and an output directory path. e.g. >python masterVar_chr_split.py -i /path/to/masterVar.tsv.bz2 -o /path/to/output_dir/ Python package dependencies: pandas, numpy python 2.7 for argparse module ''' ...
bsd-3-clause
mith1979/ansible_automation
applied_python/applied_python/lib/python2.7/site-packages/django/middleware/cache.py
106
7315
""" Cache middleware. If enabled, each Django-powered page will be cached based on URL. The canonical way to enable cache middleware is to set ``UpdateCacheMiddleware`` as your first piece of middleware, and ``FetchFromCacheMiddleware`` as the last:: MIDDLEWARE_CLASSES = [ 'django.middleware.cache.UpdateCa...
apache-2.0
JoshWu/linux-at91
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py
1891
3300
# Core.py - Python extension for perf script, core functions # # 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. from collections import defaultdict def aut...
gpl-2.0
g19-hs/personfinder
app/pytz/zoneinfo/Iran.py
9
2106
'''tzinfo timezone information for Iran.''' from pytz.tzinfo import DstTzInfo from pytz.tzinfo import memorized_datetime as d from pytz.tzinfo import memorized_ttinfo as i class Iran(DstTzInfo): '''Iran timezone definition. See datetime.tzinfo for details''' zone = 'Iran' _utc_transition_times = [ d(1,1,...
apache-2.0
pymo/pymo
symbian/PythonForS60/module-repo/dev-modules/messaging/messaging.py
4
2816
# # messaging.py # # Copyright (c) 2005 - 2007 Nokia Corporation # # 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 appl...
mit
npmccallum/sssd
src/tests/intg/test_ldap.py
2
76749
# # LDAP integration test # # Copyright (c) 2015 Red Hat, Inc. # Author: Nikolai Kondrashov <Nikolai.Kondrashov@redhat.com> # # 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 ...
gpl-3.0
StefanoRaggi/Lean
Algorithm.Python/ScheduledQueuingAlgorithm.py
3
2956
# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals. # Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation. # # 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 Licen...
apache-2.0
andyxhadji/incubator-airflow
airflow/ti_deps/deps/prev_dagrun_dep.py
19
3587
# -*- 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
akash-dev-github/Transactions
transactions/transactions/settings.py
1
3101
import os # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = 'mkxdrp%^@nc##a#b(rkzk)agha065$ng5g%=1v(b-d2n36ptbl' # SECURITY WARNING: don't run w...
mit
yanweifu/chainer
chainer/functions/concat.py
11
1589
import numpy from chainer import cuda from chainer import function from chainer.utils import type_check class Concat(function.Function): """Concatenate multiple tensors towards specified axis.""" # concat along the channel dimension by default def __init__(self, axis=1): self.axis = axis d...
mit
larssono/synapsePythonClient
synapseclient/lock.py
1
3587
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from builtins import str import argparse import errno import inspect import os import shutil import sys import time from datetime import timedelta from synapseclient.exce...
apache-2.0
kinshuk4/MoocX
misc/deep_learning_notes/Proj_Neural_Programmer_Interpreter/keras_NPI_2/src/npi/core.py
2
3316
# coding: utf-8 import json from copy import copy import numpy as np MAX_ARG_NUM = 3 ARG_DEPTH = 10 # 0~9 digit. one-hot. PG_CONTINUE = 0 PG_RETURN = 1 class IntegerArguments: depth = ARG_DEPTH max_arg_num = MAX_ARG_NUM size_of_arguments = depth * max_arg_num def __init__(self, args: list=None,...
mit
erickt/hue
desktop/core/ext-py/six-1.9.0/six.py
878
29664
"""Utilities for writing code that runs on Python 2 and 3""" # Copyright (c) 2010-2015 Benjamin Peterson # # 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 with...
apache-2.0
lepture/burglar
test_burglar.py
1
1421
# coding: utf-8 import os import shutil import tempfile from burglar import daily from burglar import zhuanlan from burglar import weixin from burglar import Burglar def test_daily(): rv = daily.parse(False) count = len(rv['entries']) rv = daily.parse() assert count == len(rv['entries']) def test_...
bsd-3-clause
Theer108/invenio
invenio/legacy/bibcheck/plugins/files.py
13
2221
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2013 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 # License, or (at your option) any later...
gpl-2.0
HarrySonghurst/Playing-Falldown-with-a-DQN
train.py
1
4946
from game import falldown import Q_network from collections import deque import random import numpy as np from keras.optimizers import Adam import os.path import pickle #from PIL import Image as im # initialize the neural network if os.path.isfile("model.h5"): model = Q_network.construct_model() model.load_wei...
mit
zsjohny/jumpserver
apps/ops/urls/view_urls.py
1
1156
# ~*~ coding: utf-8 ~*~ from __future__ import unicode_literals from django.urls import path from .. import views __all__ = ["urlpatterns"] app_name = "ops" urlpatterns = [ # Resource Task url path('task/', views.TaskListView.as_view(), name='task-list'), path('task/<uuid:pk>/', views.TaskDetailView.as_...
gpl-2.0
petrjasek/superdesk-server
superdesk/signals.py
10
1081
# -*- coding: utf-8; -*- # # This file is part of Superdesk. # # Copyright 2013, 2014 Sourcefabric z.u. and contributors. # # For the full copyright and license information, please see the # AUTHORS and LICENSE files distributed with this source code, or # at https://www.sourcefabric.org/superdesk/license import blin...
agpl-3.0
hoatle/odoo
openerp/tools/parse_version.py
380
4462
# -*- 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...
agpl-3.0
eort/OpenSesame
libqtopensesame/items/qtstructure_item.py
3
1915
#-*- coding:utf-8 -*- """ This file is part of OpenSesame. OpenSesame 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. OpenSesame is distri...
gpl-3.0
bdacode/hoster
hoster/dfiles_eu.py
1
5727
# -*- coding: utf-8 -*- """Copyright (C) 2013 COLDWELL AG This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is dist...
gpl-3.0
nikesh-mahalka/nova
nova/tests/unit/api/openstack/compute/test_used_limits.py
18
10522
# Copyright 2012 OpenStack Foundation # 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 requ...
apache-2.0
btrzecia/AliPhysics
PWGJE/EMCALJetTasks/macros/JetQA/plotPWGJEQA.py
27
87685
#! /usr/bin/env python # Macro to plot PWGJE QA histograms, using AliAnalysisTaskPWGJEQA. # # It automatically detects what to plot, based on the content of your analysis output file: # whether to do track/calo/jet/event QA, as well as MC vs. data, PbPb vs. pp, Run1 vs. Run2, Phos vs. no Phos. # # To run: # python...
bsd-3-clause
familug/FAMILUG
Python/trello.py
1
1183
#!/usr/bin/env python # Author: Hung Nguyen Viet <hvn@familug.org> # Code for Trello.com job at developer position # Fri Jul 25 17:50:58 ICT 2014 import logging logging.basicConfig(level=logging.INFO) log = logging.getLogger(__name__) LETTERS = 'acdegilmnoprstuw' def trello(s): h = 7 letters = LETTERS l...
bsd-2-clause
neumerance/deploy
scheduler/migrations/0001_initial.py
2
1866
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'Schedules' db.create_table(u'scheduler_schedules', ( (u'id', self.gf('django.db....
apache-2.0
benthomasson/ansible
lib/ansible/modules/system/lvg.py
7
9704
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Alexander Bulimov <lazywolf0@gmail.com> # based on lvol module by Jeroen Hoekx <jeroen.hoekx@dsquare.be> # 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 _...
gpl-3.0
pelson/conda-build-all
versioneer.py
1
73152
# Version: 0.15+dev """The Versioneer - like a rocketeer, but for versions. The Versioneer ============== * like a rocketeer, but for versions! * https://github.com/warner/python-versioneer * Brian Warner * License: Public Domain * Compatible With: python2.6, 2.7, 3.2, 3.3, 3.4, and pypy * [![Latest Version] (https...
bsd-3-clause
HwisooSo/gemV-update
src/arch/x86/isa/insts/simd128/floating_point/compare/compare_and_write_minimum_or_maximum.py
91
5873
# Copyright (c) 2007 The Hewlett-Packard Development Company # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implemen...
bsd-3-clause
weidongxu84/info-gatherer
django/middleware/transaction.py
447
1090
from django.db import transaction class TransactionMiddleware(object): """ Transaction middleware. If this is enabled, each view function will be run with commit_on_response activated - that way a save() doesn't do a direct commit, the commit is done when a successful response is created. If an exc...
mit
dhp-denero/LibrERP
stock_product_zero/report/__init__.py
3
1430
#-*- coding: utf-8 -*- ############################################################################## # # Copyright (c) 2010 Camptocamp SA (http://www.camptocamp.com) # All Right Reserved # # Author : Ferdinand Gassauer (Camptocamp Austria) # # WARNING: This program as such is intended to be used by professional # pro...
agpl-3.0
rackerlabs/python-proboscis
proboscis/compatability/__init__.py
2
1932
# Copyright (c) 2011 Rackspace # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by...
apache-2.0
Icenowy/MissionPlanner
Lib/nturl2path.py
60
2437
"""Convert a NT pathname to a file URL and vice versa.""" def url2pathname(url): """OS-specific conversion from a relative URL of the 'file' scheme to a file system path; not recommended for general use.""" # e.g. # ///C|/foo/bar/spam.foo # becomes # C:\foo\bar\spam.foo import stri...
gpl-3.0
kronenpj/python-for-android
pythonforandroid/recipes/libtorrent/__init__.py
1
5964
from pythonforandroid.toolchain import Recipe, shprint, shutil, current_directory from multiprocessing import cpu_count from os.path import join, basename from os import listdir, walk import sh # This recipe builds libtorrent with Python bindings # It depends on Boost.Build and the source of several Boost libraries pr...
mit
yanchen036/tensorflow
tensorflow/contrib/opt/python/training/elastic_average_optimizer.py
20
14670
# 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
caramucho/ns3-ndnsim
src/applications/bindings/modulegen__gcc_ILP32.py
22
700463
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers import pybindgen.settings import warnings class ErrorHandler(pybindgen.settings.ErrorHandler): def handle_error(self, wrapper, exception, traceback_): warnings.warn("exception %r in wrapper %s" % (exception, wrapper)) ...
gpl-2.0
sander76/home-assistant
tests/components/almond/test_init.py
6
4074
"""Tests for Almond set up.""" from time import time from unittest.mock import patch import pytest from homeassistant import config_entries, core from homeassistant.components.almond import const from homeassistant.config import async_process_ha_core_config from homeassistant.const import EVENT_HOMEASSISTANT_START fr...
apache-2.0
ToonBoxEntertainment/rez
src/rez/vendor/distlib/_backport/sysconfig.py
765
26958
# -*- coding: utf-8 -*- # # Copyright (C) 2012 The Python Software Foundation. # See LICENSE.txt and CONTRIBUTORS.txt. # """Access to Python's configuration information.""" import codecs import os import re import sys from os.path import pardir, realpath try: import configparser except ImportError: import Conf...
lgpl-3.0
emedinaa/contentbox
third_party/django/contrib/gis/geoip/prototypes.py
76
3969
from ctypes import c_char_p, c_float, c_int, string_at, Structure, POINTER from django.contrib.gis.geoip.libgeoip import lgeoip, free #### GeoIP C Structure definitions #### class GeoIPRecord(Structure): _fields_ = [('country_code', c_char_p), ('country_code3', c_char_p), ('country...
apache-2.0
Branlala/docker-sickbeardfr
sickbeard/lib/hachoir_parser/image/common.py
90
1433
from lib.hachoir_core.field import FieldSet, UserVector, UInt8 class RGB(FieldSet): color_name = { ( 0, 0, 0): "Black", (255, 0, 0): "Red", ( 0, 255, 0): "Green", ( 0, 0, 255): "Blue", (255, 255, 255): "White", } static_size = 24 def createFields(...
mit
oculusstorystudio/kraken
Python/kraken/core/objects/components/component_input.py
1
1044
"""Kraken - objects.components.component_input module. Classes: ComponentInput -- ComponentInput representation. """ from kraken.core.objects.object_3d import Object3D class ComponentInput(Object3D): """ComponentInput object.""" def __init__(self, name, parent=None, metaData=None): super(Component...
bsd-3-clause
LouisPlisso/visemo
rtmplite/amf.py
8
24282
# Copyright (c) 2011, Kundan Singh. All rights reserved. see README for details. # # Implementation of # http://opensource.adobe.com/wiki/download/attachments/1114283/amf0_spec_121207.pdf # http://opensource.adobe.com/wiki/download/attachments/1114283/amf3_spec_121207.pdf import struct, datetime, time, types from St...
gpl-3.0
raychorn/knowu
django/djangononrelsample2/django/db/backends/postgresql_psycopg2/creation.py
107
4139
import psycopg2.extensions from django.db.backends.creation import BaseDatabaseCreation from django.db.backends.util import truncate_name class DatabaseCreation(BaseDatabaseCreation): # This dictionary maps Field objects to their associated PostgreSQL column # types, as strings. Column-type strings can conta...
lgpl-3.0
cloud9ers/gurumate
environment/lib/python2.7/site-packages/IPython/core/tests/test_handlers.py
3
6544
"""Tests for input handlers. """ #----------------------------------------------------------------------------- # Module imports #----------------------------------------------------------------------------- # third party import nose.tools as nt # our own packages from IPython.core import autocall from IPython.testin...
lgpl-3.0
PongPi/isl-odoo
addons/l10n_br/__init__.py
430
1403
# -*- encoding: utf-8 -*- ############################################################################### # # # Copyright (C) 2009 Renato Lima - Akretion # # ...
agpl-3.0
sahildua2305/eden
modules/test_utils/run.py
44
4473
#!python # capture web2py environment before doing anything else web2py_environment = dict(globals()) __doc__ = """This script is run from the nose command in the application being tested: e.g. python2.6 ./applications/eden/tests/nose.py <nose arguments> web2py runs a file which: 1. Sets up a plugin. This plugi...
mit
MikeAmy/django
django/contrib/auth/urls.py
568
1036
# The views used below are normally mapped in django.contrib.admin.urls.py # This URLs file is used to provide a reliable view deployment for test purposes. # It is also provided as a convenience to those who want to deploy these URLs # elsewhere. from django.conf.urls import url from django.contrib.auth import views ...
bsd-3-clause
DGrady/pandas
pandas/io/date_converters.py
10
1827
"""This module is designed for community supported date conversion functions""" from pandas.compat import range, map import numpy as np import pandas._libs.lib as lib def parse_date_time(date_col, time_col): date_col = _maybe_cast(date_col) time_col = _maybe_cast(time_col) return lib.try_parse_date_and_ti...
bsd-3-clause
jgeskens/django
django/contrib/gis/gdal/geomtype.py
219
3001
from django.contrib.gis.gdal.error import OGRException from django.utils import six #### OGRGeomType #### class OGRGeomType(object): "Encapulates OGR Geometry Types." wkb25bit = -2147483648 # Dictionary of acceptable OGRwkbGeometryType s and their string names. _types = {0 : 'Unknown', ...
bsd-3-clause
payeldillip/django
django/utils/log.py
51
5244
from __future__ import unicode_literals import logging import logging.config # needed when logging_config doesn't start with logging.config import sys import warnings from copy import copy from django.conf import settings from django.core import mail from django.core.mail import get_connection from django.utils.depr...
bsd-3-clause
ujjvala-addsol/addsol_hr
openerp/addons/account_payment/account_move_line.py
73
2707
# -*- 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
enaut/Minecraft-Overviewer
docs/conf.py
4
7041
# -*- coding: utf-8 -*- # # Overviewer documentation build configuration file, created by # sphinx-quickstart on Thu Sep 22 10:19:03 2011. # # 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. # # ...
gpl-3.0
joachimmetz/l2tdevtools
l2tdevtools/download_helpers/project.py
2
4904
# -*- coding: utf-8 -*- """Download helper object implementations.""" import abc import logging import os from l2tdevtools.download_helpers import interface class ProjectDownloadHelper(interface.DownloadHelper): """Helps in downloading a project.""" def __init__(self, download_url): """Initializes a downlo...
apache-2.0
ULHPC/easybuild-framework
easybuild/toolchains/gpsmpi.py
3
1394
## # Copyright 2012-2017 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be), # Flemish Research Foundation (F...
gpl-2.0
quantezza/kafka
system_test/system_test_runner.py
46
9001
# 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
benfinkelcbt/CPD200
CPD200-Lab05-Python/pyasn1/codec/der/encoder.py
160
1139
# DER encoder from pyasn1.type import univ from pyasn1.codec.cer import encoder from pyasn1 import error class SetOfEncoder(encoder.SetOfEncoder): def _cmpSetComponents(self, c1, c2): tagSet1 = isinstance(c1, univ.Choice) and \ c1.getEffectiveTagSet() or c1.getTagSet() tagSet2 = i...
gpl-3.0
kalyons11/kevin
kevin/tests/leet/test_add_two_numbers.py
1
1743
""" LeetCode two sum test script. """ from unittest import TestCase from kevin.leet import add_two_numbers class TestAddTwoNumbers(TestCase): def check_add_two_numbers_numerical(self, v1, v2, expected): l1 = self.convert_number_to_linked_list(v1) l2 = self.convert_number_to_linked_list(v2) ...
mit
suiyuan2009/tensorflow
tensorflow/contrib/boosted_trees/python/kernel_tests/quantile_ops_test.py
5
14642
# Copyright 2017 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
JFriel/honours_project
venv/lib/python2.7/site-packages/nltk/classify/naivebayes.py
7
9995
# Natural Language Toolkit: Naive Bayes Classifiers # # Copyright (C) 2001-2016 NLTK Project # Author: Edward Loper <edloper@gmail.com> # URL: <http://nltk.org/> # For license information, see LICENSE.TXT """ A classifier based on the Naive Bayes algorithm. In order to find the probability for a label, this algorithm...
gpl-3.0
evanweible-wf/thrift
test/crossrunner/util.py
55
1057
# # 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
newrocknj/horizon
openstack_dashboard/dashboards/project/data_processing/clusters/tables.py
10
5388
# 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 # distributed under the...
apache-2.0
75651/kbengine_cloud
kbe/res/scripts/common/Lib/idlelib/Debugger.py
76
16347
import os import bdb from tkinter import * from idlelib.WindowList import ListedToplevel from idlelib.ScrolledList import ScrolledList from idlelib import macosxSupport class Idb(bdb.Bdb): def __init__(self, gui): self.gui = gui bdb.Bdb.__init__(self) def user_line(self, frame): if s...
lgpl-3.0
tiagormk/gem5-hmp
src/mem/slicc/symbols/Event.py
92
1754
# Copyright (c) 1999-2008 Mark D. Hill and David A. Wood # Copyright (c) 2009 The Hewlett-Packard Development Company # 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 co...
bsd-3-clause
moijes12/oh-mainline
mysite/search/migrations/0024_hit_count_cache.py
17
4283
# This file is part of OpenHatch. # Copyright (C) 2009 OpenHatch, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later v...
agpl-3.0
karthik339/Agni
MainDemo/flask/lib/python2.7/site-packages/sqlalchemy/dialects/sybase/base.py
36
15306
# sybase/base.py # Copyright (C) 2010-2011 the SQLAlchemy authors and contributors <see AUTHORS file> # get_select_precolumns(), limit_clause() implementation # copyright (C) 2007 Fisch Asset Management # AG http://www.fam.ch, with coding by Alexander Houben # alexander.houben@thor-solutions.ch # # This module is part ...
apache-2.0
fhedberg/ardupilot
Tools/scripts/generate_manifest.py
6
21862
#!/usr/bin/env python from __future__ import print_function import sys import json import os import re import fnmatch import gen_stable import subprocess if sys.version_info[0] < 3: running_python3 = False else: running_python3 = True FIRMWARE_TYPES = ["AntennaTracker", "Copter", "Plane", "Rover", "Sub", "A...
gpl-3.0
dangillet/cocos
utest/runner1.py
6
1642
from __future__ import division, print_function, unicode_literals #py.test script must be in the path #you must set cocos_utest to 1 in the environment before running import sys import os def usage(): cmd = os.path.basename(sys.argv[0]) print(""" Usage: %s filename filename: points to a file whic...
bsd-3-clause
pygeek/django
tests/regressiontests/decorators/tests.py
48
9040
import warnings from functools import wraps from django.contrib.admin.views.decorators import staff_member_required from django.contrib.auth.decorators import login_required, permission_required, user_passes_test from django.http import HttpResponse, HttpRequest, HttpResponseNotAllowed from django.middleware.clickjack...
bsd-3-clause
tkdrg/-tg-station
tools/dmm2tgm/Source/dmm2tgm.py
149
3726
import sys # .dmm format converter, by RemieRichards # Version 2.0 # Converts the internal structure of a .dmm file to a syntax # that git can better handle conflicts-wise, it's also fairly human readable! # Processes Boxstation (tgstation.2.1.3) almost instantly def convert_map(map_file): #CHECK FOR PREVIO...
agpl-3.0
aajtodd/zipline
zipline/algorithm.py
4
46969
# # Copyright 2014 Quantopian, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wr...
apache-2.0
olfa-lab/DmdLib
dmdlib/randpatterns/old/multisparse.py
1
2394
import numpy as np from dmdlib.randpatterns.utils import run_presentations, parser from dmdlib.randpatterns.old.sparsenoise import sparsenoise_function_generator import os if os.name == 'nt': appdataroot = os.environ['APPDATA'] appdatapath = os.path.join(appdataroot, 'dmdlib') def main(): parser.descripti...
mit
Khushbu27/Tutorial
swift/account/utils.py
17
4423
# Copyright (c) 2010-2013 OpenStack Foundation # # 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 agree...
apache-2.0
prazumovsky/weekly-update
weekly_update/main.py
1
8271
# 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 # distributed under the ...
apache-2.0
huijunwu/heron
integration_test/src/python/integration_test/topology/fields_grouping/fields_grouping.py
5
1756
#!/usr/bin/env python # -*- encoding: 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...
apache-2.0
dstanek/keystone
keystone/catalog/schema.py
14
2387
# 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 # distributed under the Li...
apache-2.0
nmercier/linux-cross-gcc
linux/lib/python2.7/dist-packages/Crypto/SelfTest/Protocol/test_chaffing.py
120
2972
# # Test script for Crypto.Protocol.Chaffing # # Part of the Python Cryptography Toolkit # # Written by Andrew Kuchling and others # # =================================================================== # The contents of this file are dedicated to the public domain. To # the extent that dedication to the public domain...
bsd-3-clause
dhuang/incubator-airflow
airflow/operators/pig_operator.py
16
2278
# -*- 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
WSDC-NITWarangal/django
django/utils/feedgenerator.py
183
17059
""" Syndication feed generation library -- used for generating RSS, etc. Sample usage: >>> from django.utils import feedgenerator >>> feed = feedgenerator.Rss201rev2Feed( ... title="Poynter E-Media Tidbits", ... link="http://www.poynter.org/column.asp?id=31", ... description="A group Weblog by the sharpes...
bsd-3-clause
leighpauls/k2cro4
third_party/WebKit/Tools/Scripts/webkitpy/tool/steps/editchangelog.py
130
1851
# 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 th...
bsd-3-clause
mozilla/captain
vendor/lib/python/django/utils/dateparse.py
229
2817
"""Functions to parse datetime objects.""" # We're using regular expressions rather than time.strptime because: # - They provide both validation and parsing. # - They're more flexible for datetimes. # - The date/datetime/time constructors produce friendlier error messages. import datetime import re from django.utils ...
mpl-2.0
henningpohl/Arduino
arduino-core/src/processing/app/i18n/python/requests/packages/charade/__init__.py
168
1055
######################## BEGIN LICENSE BLOCK ######################## # 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.1 of the License, or (at your option) any later ve...
lgpl-2.1
donspaulding/adspygoogle
examples/adspygoogle/dfp/v201206/create_teams.py
2
1659
#!/usr/bin/python # # Copyright 2012 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
apache-2.0
kionetworks/openstack-dashboard-havana
openstack_dashboard/dashboards/project/network_topology/ports/tables.py
10
1101
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2013 NTT Innovation Institute 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...
apache-2.0
grani/grpc
src/python/grpcio_tests/tests/interop/__init__.py
901
1528
# Copyright 2015, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
bsd-3-clause
AsherYang/ThreeLine
server/ffstore/db/DbAttribute.py
1
1457
#! /usr/bin/python # -*- coding:utf-8 -*- """ Author: AsherYang Email: ouyangfan1991@gmail.com Date: 2018/5/6 Desc: 属性类,包括分类属性,商品详情属性 _id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, cate_id VARCHAR(50), goods_id VARCHAR(50), attr_market_year VARCHAR(20), attr_size VARCHAR(5), attr_color VARCHAR(10), foreign key (goo...
apache-2.0
OpenUpgrade-dev/OpenUpgrade
addons/l10n_gr/__openerp__.py
170
1883
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2009 P. Christeas <p_christ@hol.gr>. All Rights Reserved # $Id$ # # This program is free software: you can redistribute it and/or modify # ...
agpl-3.0
pkainz/pylearn2
pylearn2/sandbox/lisa_rl/bandit/gaussian_bandit.py
49
1542
__author__ = "Ian Goodfellow" import numpy as np from theano import config from theano import function from theano import tensor as T from pylearn2.sandbox.lisa_rl.bandit.environment import Environment from pylearn2.utils import sharedX from pylearn2.utils.rng import make_np_rng, make_theano_rng class GaussianBand...
bsd-3-clause
schroeder-/pyssps
src/byte_compiler.py
1
7692
from err import GenError ARG_BIT_VAL = 1 ARG_CALL = 2 ARG_MEM_BIT = 3 ARG_MEM_VAL = 4 ARG_NONE = 5 ARG_TAG = 6 ARG_VALUE = 7 ARG_STRING = 8 OP_BIT = 0 OP_MEM = 1 OP_MEM_ADDR = 2 OP_BOOL = 3 OP_STRING = 4 OP_INT = 5 OP_NONE = 6 OP_BIT_ADDR = 7 #@TODO Check vm memory class Compiler(GenError): #Erzeugt aus dennen vom Pa...
mit
JasonSanchez/w261
week2/NaiveBayes.py
2
1625
import sys import re from mrjob.job import MRJob from mrjob.step import MRStep from mrjob.protocol import TextProtocol, TextValueProtocol # Prevents broken pipe errors from using ... | head from signal import signal, SIGPIPE, SIG_DFL signal(SIGPIPE,SIG_DFL) def sum_hs(counts): h_total, s_total = 0, 0 for h,...
mit
moreati/django
django/contrib/sessions/base_session.py
348
1623
""" This module allows importing AbstractBaseSession even when django.contrib.sessions is not in INSTALLED_APPS. """ from __future__ import unicode_literals from django.db import models from django.utils.encoding import python_2_unicode_compatible from django.utils.translation import ugettext_lazy as _ class BaseSes...
bsd-3-clause
ZhijieWang/DIGITS
tools/create_db.py
2
20860
#!/usr/bin/env python # Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved. import sys import os.path import time import argparse import logging import re import shutil import math import random from collections import Counter import threading import Queue try: import digits except ImportError: ...
bsd-3-clause
atlashealth/ansible
v1/ansible/module_utils/redhat.py
324
10219
# This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the author of the module, and may assign their own license # to the complete wo...
gpl-3.0
juvoinc/airflow
airflow/contrib/operators/bigquery_check_operator.py
38
4633
# -*- 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
Og192/Python
machine-learning-algorithms/memoryNN/memNN_ExactTest.py
2
7973
import numpy as np import tensorflow as tf import os import matplotlib.pyplot as plt corpusSize = 1977#2358 testDataSize = 49 testMaxLength = 82 batchSize = 1 vectorLength = 50 sentMaxLength = 82 hopNumber = 3 classNumber = 4 num_epoches = 2000 weightDecay = 0.001 trainDatasetPath = "/home/laboratory/memoryCorpus/tra...
gpl-2.0
Emergya/icm-openedx-educamadrid-platform-basic
lms/djangoapps/shoppingcart/context_processor.py
173
1679
""" This is the shoppingcart context_processor module. Currently the only context_processor detects whether request.user has a cart that should be displayed in the navigation. We want to do this in the context_processor to 1) keep database accesses out of templates (this led to a transaction bug with user email change...
agpl-3.0
ninja-ide/ninja-ide
ninja_ide/gui/explorer/tabs/web_inspector.py
1
2247
# -*- coding: utf-8 -*- # # This file is part of NINJA-IDE (http://ninja-ide.org). # # NINJA-IDE 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 # any later version. # # NIN...
gpl-3.0