repo_name
stringlengths
5
100
path
stringlengths
4
375
copies
stringclasses
991 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
sgp715/python_speaks
sr/__main__.py
6
1181
import speech_recognition as sr r = sr.Recognizer() m = sr.Microphone() try: print("A moment of silence, please...") with m as source: r.adjust_for_ambient_noise(source) print("Set minimum energy threshold to {}".format(r.energy_threshold)) while True: print("Say something!") with m as...
gpl-2.0
admiyo/python-nss
test/test_cipher.py
1
6260
#!/usr/bin/python import sys import os import unittest import nss.nss as nss #------------------------------------------------------------------------------- verbose = False mechanism = nss.CKM_DES_CBC_PAD plain_text = "Encrypt me!" key = "e8:a7:7c:e2:05:63:6a:31" iv = "e4:bb:3b:d3:c3:71:2e:58" in_filename = sys.ar...
gpl-2.0
edawine/fatools
fatools/scripts/fautil.py
2
3181
import sys, argparse, yaml, os from fatools.lib.utils import cout, cerr, cexit def init_argparser(): p = argparse.ArgumentParser('fautil') p.add_argument('--info', default=False, action='store_true', help = 'get information on FA assay') p.add_argument('--view', default=False, action='store_t...
lgpl-3.0
ericzolf/ansible
lib/ansible/playbook/role/include.py
83
2605
# (c) 2014 Michael DeHaan, <michael@ansible.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later ve...
gpl-3.0
AlexJF/pelican-autostatic
autostatic.py
1
9114
#!/usr/bin/env python # encoding: utf-8 from __future__ import unicode_literals, print_function import logging import os import re import shutil # For html escaping/unescaping import HTMLParser try: from html import escape as html_escape # py3 except ImportError: from cgi import escape as html_escape # py2 ...
apache-2.0
wouwei/PiLapse
picam/picamEnv/Lib/site-packages/pip/_vendor/requests/packages/chardet/sbcsgroupprober.py
2936
3291
######################## 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...
apache-2.0
elopezga/ErrorRate
ivi/agilent/agilentDSOX4054A.py
7
1689
""" Python Interchangeable Virtual Instrument Library Copyright (c) 2014 Alex Forencich 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 righ...
mit
tboyce021/home-assistant
tests/components/rest/test_switch.py
3
8431
"""The tests for the REST switch platform.""" import asyncio import aiohttp import homeassistant.components.rest.switch as rest from homeassistant.components.switch import DOMAIN as SWITCH_DOMAIN from homeassistant.const import ( CONF_HEADERS, CONF_NAME, CONF_PARAMS, CONF_PLATFORM, CONF_RESOURCE, ...
apache-2.0
decipher-survey-programming/utility-scripts
scripts/generatevariables.py
1
1142
#!/usr/bin/env hpython import hstub, sys, argparse from hermes import Survey, Results, misc def generate(survey): iterExtra = Results.Results(survey.path, format=None, readOnly=True).iterExtra(survey) while True: try: record = iterExtra.next() l = [str(int(record[1])), recor...
mit
wwjiang007/flink
flink-python/pyflink/fn_execution/beam/beam_boot.py
15
4093
#!/usr/bin/env python ################################################################################# # 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....
apache-2.0
errx/django
django/utils/html_parser.py
8
5051
from django.utils.six.moves import html_parser as _html_parser import re import sys current_version = sys.version_info use_workaround = ( (current_version < (2, 7, 3)) or (current_version >= (3, 0) and current_version < (3, 2, 3)) ) HTMLParseError = _html_parser.HTMLParseError if not use_workaround: if ...
bsd-3-clause
matrogers/pylearn2
pylearn2/devtools/run_pyflakes.py
44
3360
""" Can be run as a script or imported as a module. Module exposes the run_pyflakes method which returns a dictionary. As a script: python run_pyflakes.py <no_warnings> prints out all the errors in the library """ __authors__ = "Ian Goodfellow" __copyright__ = "Copyright 2010-2012, Universite de Montreal" _...
bsd-3-clause
aifil/odoo
openerp/report/render/render.py
72
1567
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. # Why doing some multi-thread instead of using OSE capabilities ? # For progress bar. # # Add a transparant multi-thread layer to all report rendering layers # # TODO: method to stock on the disk class render(object): ...
gpl-3.0
CameronLonsdale/sec-tools
python2/lib/python2.7/site-packages/click/__init__.py
135
2858
# -*- coding: utf-8 -*- """ click ~~~~~ Click is a simple Python module that wraps the stdlib's optparse to make writing command line scripts fun. Unlike other modules, it's based around a simple API that does not come with too much magic and is composable. In case optparse ever gets removed ...
mit
alxgu/ansible-modules-core
cloud/openstack/_keystone_user.py
32
14115
#!/usr/bin/python # -*- coding: utf-8 -*- # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # ...
gpl-3.0
shivanikhosa/browserscope
static_mode/richtext_0.py
9
21963
(dp0 VPlayStation p1 (dp2 S'summary_display' p3 S'0/149' p4 sS'total_runs' p5 L3L sS'summary_score' p6 I0 sS'results' p7 (dp8 S'unapply' p9 (dp10 S'score' p11 I0 sS'raw_score' p12 I0 sS'display' p13 S'0/26' p14 ssS'apply' p15 (dp16 g11 I0 sg12 I0 sg13 S'0/41' p17 ssS'change' p18 (dp19 g11 I0 sg12 I0 sg13 S'0/17' p20 ss...
apache-2.0
RoelAdriaans-B-informed/website
website_blog_facebook_comment/controllers/main.py
27
2016
# -*- coding: utf-8 -*- # Python source code encoding : https://www.python.org/dev/peps/pep-0263/ ############################################################################## # # This module copyright : # (c) 2015 Antiun Ingenieria, SL (Madrid, Spain, http://www.antiun.com) # Endika Iglesias...
agpl-3.0
cloudmesh/cloudmesh.docker
cloudmesh/api/docker_client.py
2
17317
#!/usr/bin/env python # Docker class to connect to docker server box and perform docker operations from __future__ import print_function import cloudmesh import docker import os import requests import json import sys from cloudmesh.common.console import Console from cloudmesh.common.Printer import Printer import json f...
apache-2.0
2014c2g2/2014c2
w2/static/Brython2.0.0-20140209-164925/Lib/base64.py
733
13975
#! /usr/bin/env python3 """RFC 3548: Base16, Base32, Base64 Data Encodings""" # Modified 04-Oct-1995 by Jack Jansen to use binascii module # Modified 30-Dec-2003 by Barry Warsaw to add full RFC 3548 support # Modified 22-May-2007 by Guido van Rossum to use bytes everywhere import re import struct import binascii _...
gpl-2.0
angr/angr
tests/test_accuracy.py
1
3876
import nose import angr import os test_location = os.path.join(os.path.dirname(os.path.realpath(str(__file__))), '..', '..', 'binaries', 'tests') arch_data = { # (steps, [hit addrs], finished) 'x86_64': (330, (0x1021c20, 0x1021980, 0x1021be0, 0x4004b0, 0x400440, 0x400570), True), 'i386': (425, (0x90198e0,...
bsd-2-clause
Denisolt/IEEE-NYIT-MA
local/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/escprober.py
2936
3187
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org 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 Reserved. # # Con...
gpl-3.0
wilecoyote2015/VerySharp
FlowCalculator.py
1
9780
# -*- coding: utf-8 -*- """ This file is part of verysharp, copyright (c) 2016 Björn Sonnenschein. verysharp 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...
gpl-3.0
hamishwillee/ardupilot
Tools/autotest/param_metadata/htmlemit.py
13
3279
#!/usr/bin/env python """ Emit docs in a form acceptable to the old Ardupilot wordpress docs site """ from param import known_param_fields, known_units from emit import Emit import cgi class HtmlEmit(Emit): def __init__(self): Emit.__init__(self) html_fname = 'Parameters.html' self.f = o...
gpl-3.0
bud4/samba
third_party/dnspython/examples/zonediff.py
79
10711
#!/usr/bin/env python # # Small library and commandline tool to do logical diffs of zonefiles # ./zonediff -h gives you help output # # Requires dnspython to do all the heavy lifting # # (c)2009 Dennis Kaarsemaker <dennis@kaarsemaker.net> # # Permission to use, copy, modify, and distribute this software and its # docu...
gpl-3.0
PaulStoffregen/Arduino-1.6.5r4-Teensyduino
arduino-core/src/processing/app/i18n/python/requests/compat.py
289
2433
# -*- coding: utf-8 -*- """ pythoncompat """ from .packages import charade as chardet import sys # ------- # Pythons # ------- # Syntax sugar. _ver = sys.version_info #: Python 2.x? is_py2 = (_ver[0] == 2) #: Python 3.x? is_py3 = (_ver[0] == 3) #: Python 3.0.x is_py30 = (is_py3 and _ver[1] == 0) #: Python 3.1....
lgpl-2.1
msumit/qds-sdk-py
tests/test_app.py
6
5993
from __future__ import print_function import sys import os if sys.version_info > (2, 7, 0): import unittest else: import unittest2 as unittest from mock import Mock sys.path.append(os.path.join(os.path.dirname(__file__), '../bin')) import qds from qds_sdk.connection import Connection from test_base import pri...
apache-2.0
Michael-Tu/tools
markdown_to_json/blog-content-json-generator.py
1
7563
import argparse import json import re common_unicode_conversion = { "\u2018": "'", "\u2019": "'" } # regex for different styles style = { "link": "\[([^\(\)\[\]\!]+)\]\(([^\(\)\[\]\!]+)\)", "image": "!\[([^\(\)\[\]\!]*)\]\(([^\(\)\[\]\!]+)\)", "bold": "(?:\*{2}([^\s].*?[^\s]|[^\s])\*{2})|(?:_{2}([^\s].*?[^\s]|[^\...
mit
ygol/odoo
addons/account/wizard/account_financial_report.py
345
5505
# -*- 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
richardw347/roboclaw_python
src/roboclaw_python/roboclaw.py
1
34451
import random import serial import struct import time class Roboclaw: 'Roboclaw Interface Class' def __init__(self, comport, rate, timeout=0.01, retries=3): self.comport = comport self.rate = rate self.timeout = timeout self._trystimeout = retries self._crc = 0 # ...
bsd-2-clause
mammadori/pyglet
contrib/layout/layout/Plex/Scanners.py
32
11656
#======================================================================= # # Python Lexical Analyser # # # Scanning an input stream # #======================================================================= import Errors from Regexps import BOL, EOL, EOF class Scanner: """ A Scanner is used to read tokens fro...
bsd-3-clause
mmmavis/lightbeam-bedrock-website
vendor-local/packages/chardet/chardet/big5freq.py
323
82588
######################## 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 ...
mpl-2.0
mikelj/h-store
tools/hstore/fabric/abstractfabric.py
9
22585
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------- # Copyright (C) 2013 by H-Store Project # Brown University # Massachusetts Institute of Technology # Yale University # # http://hstore.cs.brown.edu/ # # Permission is hereby granted, free of charge, to any person obtaini...
gpl-3.0
tombstone/models
official/nlp/configs/bert_test.py
1
2476
# Lint as: python3 # Copyright 2020 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 ...
apache-2.0
samuelhavron/heroku-buildpack-python
Python-3.4.3/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...
mit
markstoehr/spectral_features
filters/transforms.py
1
12901
from __future__ import division import numpy as np import filterbank as fb from scipy.ndimage.filters import maximum_filter, convolve from nitime.algorithms.spectral import dpss_windows def preemphasis(x,preemph=.95): return np.append( (x[1:] - .95*x[:-1])[::-1],x[0])[::-1] def process_wav(x): return x.astype...
gpl-3.0
NullSoldier/django
tests/template_tests/test_logging.py
210
2286
from __future__ import unicode_literals import logging from django.template import Engine, Variable, VariableDoesNotExist from django.test import SimpleTestCase class TestHandler(logging.Handler): def __init__(self): super(TestHandler, self).__init__() self.log_record = None def emit(self, ...
bsd-3-clause
gunan/tensorflow
tensorflow/python/keras/layers/preprocessing/text_vectorization.py
1
36301
# Copyright 2019 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
keisukefukuda/wrenchset
wrenchset.py
1
16308
#!env python #-*- coding: utf-8 -*- import sys,os,os.path,re import glob import shutil from os.path import join as join from subprocess import Popen, PIPE, check_call import copy VERSION_MAJOR=0 VERSION_MINOR=1 VERSION_PATCH=0 VERSION="%d.%d.%d" % (VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH) Config = { 'HOME' :...
mit
jakevdp/networkx
networkx/tests/test_relabel.py
29
6842
#!/usr/bin/env python from nose.tools import * from networkx import * from networkx.convert import * from networkx.algorithms.operators import * from networkx.generators.classic import barbell_graph,cycle_graph from networkx.testing import * class TestRelabel(): def test_convert_node_labels_to_integers(self): ...
bsd-3-clause
Diacamma2/financial
diacamma/accounting/views_budget.py
1
13598
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.utils.translation import ugettext_lazy as _ from django.db.models import Q from lucterios.framework.xferadvance import TITLE_MODIFY, TITLE_ADD, TITLE_DELETE, TITLE_PRINT, TITLE_OK, TITLE_CANCEL,\ XferSave from lucterios.framework.xferadva...
gpl-3.0
sutartmelson/girder
plugins/worker/server/constants.py
2
1196
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### # Copyright Kitware 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 ...
apache-2.0
thaim/ansible
test/units/module_utils/basic/test_filesystem.py
113
5190
# -*- coding: utf-8 -*- # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # (c) 2016 Toshio Kuratomi <tkuratomi@ansible.com> # (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function ...
mit
casselineau/Tracer
tracer/tracer_engine_mp.py
1
6013
import time import numpy as N from pathos.multiprocessing import ProcessingPool as Pool from tracer.sources import * from tracer.tracer_engine import * from tracer.assembly import * from copy import copy class TracerEngineMP(TracerEngine): ''' Famework for multi-processing using the tracer engine as is. Requires p...
gpl-3.0
dillonjerry/aws
AWS-ElasticBeanstalk-CLI-2.6.2/eb/macosx/python3/lib/aws/requests/structures.py
230
2329
# -*- coding: utf-8 -*- """ requests.structures ~~~~~~~~~~~~~~~~~~~ Data structures that power Requests. """ import os from itertools import islice class IteratorProxy(object): """docstring for IteratorProxy""" def __init__(self, i): self.i = i # self.i = chain.from_iterable(i) def __...
gpl-2.0
40223114/w16
static/Brython3.1.1-20150328-091302/Lib/select.py
730
9440
""" borrowed from jython https://bitbucket.org/jython/jython/raw/28a66ba038620292520470a0bb4dc9bb8ac2e403/Lib/select.py """ #import java.nio.channels.SelectableChannel #import java.nio.channels.SelectionKey #import java.nio.channels.Selector #from java.nio.channels.SelectionKey import OP_ACCEPT, OP_CONNECT, OP_WRITE, ...
agpl-3.0
imsplitbit/nova
nova/api/openstack/compute/contrib/security_groups.py
8
26909
# Copyright 2011 OpenStack Foundation # Copyright 2012 Justin Santa Barbara # 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/l...
apache-2.0
VielSoft/odoo
openerp/addons/base/__openerp__.py
336
3703
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # Copyright (C) 2010-2012 OpenERP s.a. (<http://openerp.com>). # # This program is free software: you ca...
agpl-3.0
yinsu/grpc
src/python/grpcio_test/grpc_test/framework/interfaces/base/__init__.py
1496
1530
# 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
netscaler/horizon
horizon/utils/fields.py
7
4625
from django.core.exceptions import ValidationError # noqa from django.forms import forms from django.forms import widgets from django.utils.encoding import force_unicode # noqa from django.utils.functional import Promise # noqa from django.utils.html import conditional_escape # noqa from django.utils.html import es...
apache-2.0
cloudera/hue
desktop/core/ext-py/Babel-2.5.1/babel/messages/jslexer.py
10
6329
# -*- coding: utf-8 -*- """ babel.messages.jslexer ~~~~~~~~~~~~~~~~~~~~~~ A simple JavaScript 1.5 lexer which is used for the JavaScript extractor. :copyright: (c) 2013 by the Babel Team. :license: BSD, see LICENSE for more details. """ from collections import namedtuple import re from babel._...
apache-2.0
TheDegree0/menescraper
menescraper/menescraper/lib/python2.7/site-packages/setuptools/tests/test_egg_info.py
333
5401
import os import sys import tempfile import shutil import unittest import pkg_resources import warnings from setuptools.command import egg_info from setuptools import svn_utils from setuptools.tests import environment, test_svn from setuptools.tests.py26compat import skipIf ENTRIES_V10 = pkg_resources.resource_strin...
gpl-2.0
inejc/nnlib
tests/test_optimizers.py
1
2727
from unittest import TestCase from nnlib.layers import Layer, ParamGradNames from nnlib.optimizers import SGD, SGDMomentum class DummyLayer(Layer): def __init__(self): self.dummy_param0 = 10 self.dummy_grad0 = 2 self.dummy_param1 = 5 self.dummy_grad1 = 1 def forward(self): ...
mit
jonasrk/volunteer_planner
blueprint/views.py
7
2391
# coding: utf-8 import json from django.http.response import HttpResponse from django.views.generic import TemplateView from django.utils.decorators import method_decorator from django.contrib.auth.decorators import user_passes_test from dateutil.parser import parse from scheduler.models import Location, Need from ...
agpl-3.0
antonve/s4-project-mooc
common/djangoapps/course_about/tests/test_api.py
19
1861
""" Tests the logical Python API layer of the Course About API. """ import ddt import json import unittest from django.core.urlresolvers import reverse from rest_framework.test import APITestCase from rest_framework import status from django.conf import settings from xmodule.modulestore.tests.django_utils import Modu...
agpl-3.0
10clouds/edx-platform
lms/djangoapps/branding/__init__.py
22
3065
""" EdX Branding package. Provides a way to retrieve "branded" parts of the site. This module provides functions to retrieve basic branded parts such as the site visible courses, university name and logo. """ from xmodule.modulestore.django import modulestore from xmodule.course_module import CourseDescriptor from d...
agpl-3.0
gisce/OCB
openerp/report/printscreen/__init__.py
77
1239
# -*- 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
cantora/mozz
mozz/session.py
1
16225
# Copyright 2013 anthony cantor # This file is part of mozz. # # mozz 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. # # mozz is di...
gpl-3.0
gustavofonseca/scielo-manager
scielomanager/journalmanager/migrations/0022_fix_nulls_in_notes.py
3
33496
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import DataMigration from django.db import models class Migration(DataMigration): def forwards(self, orm): "Write your forwards methods here." # Note: Don't use "from appname.models imp...
bsd-2-clause
raggesilver/PyIDE
modules/autoBracket.py
1
2199
import gi gi.require_version('Gtk', '3.0') gi.require_version('Gdk', '3.0') gi.require_version('GtkSource', '3.0') from gi.repository import Gtk, Gdk, GtkSource class AutoBracket: def __init__(self, parent): self.parent = parent self.sview = parent.sview self.sbuff = parent.sbuff ...
mit
kurikuri99/xen_study
tools/xm-test/tests/vtpm/06_vtpm-susp_res_pcrs.py
21
3565
#!/usr/bin/python # Copyright (C) International Business Machines Corp., 2006 # Author: Stefan Berger <stefanb@us.ibm.com> # Positive Test: create domain with virtual TPM attached at build time, # extend a pcr # check list of pcrs; suspend and resume the domain and # check...
gpl-2.0
astrofimov/limbo-android
jni/qemu/roms/seabios/tools/layoutrom.py
42
21567
#!/usr/bin/env python # Script to analyze code and arrange ld sections. # # Copyright (C) 2008-2010 Kevin O'Connor <kevin@koconnor.net> # # This file may be distributed under the terms of the GNU GPLv3 license. import sys # LD script headers/trailers COMMONHEADER = """ /* DO NOT EDIT! This is an autogenerated file....
gpl-2.0
timhuanggithub/MyPOX
pox/openflow/libopenflow_01.py
1
131719
# Copyright 2011,2012 James McCauley # # 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 ...
apache-2.0
codinguser/gnucash
src/python/pycons/ishell.py
14
4561
#! /usr/bin/env python # # Adapted from: # # Backend to the console plugin. # @author: Eitan Isaacson # @organization: IBM Corporation # @copyright: Copyright (c) 2007 IBM Corporation # @license: BSD # # All rights reserved. This program and the accompanying materials are made # available under the terms of the BSD wh...
gpl-2.0
pducks32/intergrala
python/sympy/sympy/matrices/expressions/hadamard.py
24
2455
from __future__ import print_function, division from sympy.core import Mul, Basic, sympify from sympy.strategies import unpack, flatten, sort, condition, exhaust, do_one from sympy.matrices.expressions.matexpr import MatrixExpr, ShapeError def hadamard_product(*matrices): """ Return the elementwise (aka Hada...
mit
conwayje/ase-python
ase/gui/images.py
2
16006
from math import sqrt import numpy as np from ase.data import covalent_radii from ase.atoms import Atoms from ase.calculators.singlepoint import SinglePointCalculator from ase.io import read, write, string2index from ase.constraints import FixAtoms from ase.gui.defaults import read_defaults from ase.quaternions impor...
gpl-2.0
jostep/tensorflow
tensorflow/contrib/tensorboard/plugins/projector/__init__.py
97
2351
# 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
openstack-hyper-v-python/numpy
numpy/doc/indexing.py
12
14353
""" ============== Array indexing ============== Array indexing refers to any use of the square brackets ([]) to index array values. There are many options to indexing, which give numpy indexing great power, but with power comes some complexity and the potential for confusion. This section is just an overview of the v...
bsd-3-clause
Livefyre/django-cms
cms/south_migrations/0053_auto__add_field_title_published__add_field_title_publisher_is_draft__a.py
63
20404
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Title.published' db.add_column(u'cms_title', 'published',...
bsd-3-clause
unreal666/youtube-dl
youtube_dl/extractor/vidbit.py
64
2917
from __future__ import unicode_literals from .common import InfoExtractor from ..compat import compat_urlparse from ..utils import ( int_or_none, js_to_json, remove_end, unified_strdate, ) class VidbitIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?vidbit\.co/(?:watch|embed)\?.*?\bv=(?P<id>[...
unlicense
xzh86/scikit-learn
sklearn/externals/joblib/__init__.py
86
4795
""" Joblib is a set of tools to provide **lightweight pipelining in Python**. In particular, joblib offers: 1. transparent disk-caching of the output values and lazy re-evaluation (memoize pattern) 2. easy simple parallel computing 3. logging and tracing of the execution Joblib is optimized to be **fast*...
bsd-3-clause
gmariotti/lassim
source/core/core_system.py
1
5422
from sortedcontainers import SortedDict, SortedSet __author__ = "Guido Pio Mariotti" __copyright__ = "Copyright (C) 2016 Guido Pio Mariotti" __license__ = "GNU General Public License v3.0" __version__ = "0.1.0" # TODO - consider the possibility of a factory method for creating a new # CoreSystem starting from the ma...
gpl-3.0
hefen1/chromium
third_party/mojo/src/mojo/public/third_party/jinja2/environment.py
614
47244
# -*- coding: utf-8 -*- """ jinja2.environment ~~~~~~~~~~~~~~~~~~ Provides a class that holds runtime and parsing time options. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ import os import sys from jinja2 import nodes from jinja2.defaults import BLOCK_S...
bsd-3-clause
LucasFeliciano21/BeagleBoard-Stable_Linux
arch/ia64/scripts/unwcheck.py
13143
1714
#!/usr/bin/python # # Usage: unwcheck.py FILE # # This script checks the unwind info of each function in file FILE # and verifies that the sum of the region-lengths matches the total # length of the function. # # Based on a shell/awk script originally written by Harish Patil, # which was converted to Perl by Matthew Ch...
gpl-2.0
neerajvashistha/pa-dude
lib/python2.7/site-packages/numpy/polynomial/legendre.py
75
56240
""" Legendre Series (:mod: `numpy.polynomial.legendre`) =================================================== .. currentmodule:: numpy.polynomial.polynomial This module provides a number of objects (mostly functions) useful for dealing with Legendre series, including a `Legendre` class that encapsulates the usual arith...
mit
chewable/django
django/db/models/related.py
23
2090
class BoundRelatedObject(object): def __init__(self, related_object, field_mapping, original): self.relation = related_object self.field_mappings = field_mapping[related_object.name] def template_name(self): raise NotImplementedError def __repr__(self): return repr(self.__d...
bsd-3-clause
kostoulhs/android_kernel_samsung_msm8930-common
tools/perf/scripts/python/syscall-counts.py
11181
1522
# system call counts # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide system call totals, broken down by syscall. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.path.append(os.envir...
gpl-2.0
pajod/django-import-export
tests/core/tests/instance_loaders_tests.py
7
1165
from __future__ import unicode_literals import tablib from django.test import TestCase from import_export import instance_loaders from import_export import resources from core.models import Book class CachedInstanceLoaderTest(TestCase): def setUp(self): self.resource = resources.modelresource_factory...
bsd-2-clause
jiangxb1987/spark
examples/src/main/python/ml/binarizer_example.py
121
1521
# # 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
scrollback/kuma
vendor/packages/ipython/IPython/__init__.py
6
2849
# -*- coding: utf-8 -*- """ IPython -- An enhanced Interactive Python One of Python's nicest features is its interactive interpreter. This allows very fast testing of ideas without the overhead of creating test files as is typical in most programming languages. However, the interpreter supplied with the standard Pytho...
mpl-2.0
junhuac/MQUIC
depot_tools/third_party/coverage/collector.py
209
13412
"""Raw data collector for Coverage.""" import os, sys, threading try: # Use the C extension code when we can, for speed. from coverage.tracer import CTracer # pylint: disable=F0401,E0611 except ImportError: # Couldn't import the C extension, maybe it isn't built. if os.getenv('COVERAGE_TEST_TR...
mit
goldeneye-source/ges-python
lib/test/test_curses.py
67
12003
# # Test script for the curses module # # This script doesn't actually display anything very coherent. but it # does call every method and function. # # Functions not tested: {def,reset}_{shell,prog}_mode, getch(), getstr(), # init_color() # Only called, not tested: getmouse(), ungetmouse() # import sys, tempfile, os ...
gpl-3.0
dharmabumstead/ansible
test/units/modules/network/ios/test_ios_vrf.py
38
7526
# # (c) 2016 Red Hat Inc. # # 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 d...
gpl-3.0
WillianPaiva/1flow
oneflow/core/admin/website.py
2
2295
# -*- coding: utf-8 -*- u""" Copyright 2013-2014 Olivier Cortès <oc@1flow.io>. This file is part of the 1flow project. 1flow 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...
agpl-3.0
hainm/numpy
numpy/distutils/fcompiler/pathf95.py
229
1209
from __future__ import division, absolute_import, print_function from numpy.distutils.fcompiler import FCompiler compilers = ['PathScaleFCompiler'] class PathScaleFCompiler(FCompiler): compiler_type = 'pathf95' description = 'PathScale Fortran Compiler' version_pattern = r'PathScale\(TM\) Compiler Suit...
bsd-3-clause
scriptotek/vortex-mail-notifier
run.py
1
1789
# encoding=utf-8 import easywebdav from ConfigParser import ConfigParser from datetime import datetime import json import os import requests import rollbar config = ConfigParser() config.read('config.ini') rollbar.init(config.get('rollbar', 'token'), 'production') # access_token, environment try: year = dateti...
mit
ArcaniteSolutions/truffe2
truffe2/logistics/migrations/0015_auto__add_field_supply_price__chg_field_supplyreservation_contact_phon.py
2
18305
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Supply.price' db.alter_column(u'logistics_supply', 'price...
bsd-2-clause
endlessm/chromium-browser
base/third_party/libevent/event_rpcgen.py
296
45502
#!/usr/bin/env python # # Copyright (c) 2005 Niels Provos <provos@citi.umich.edu> # All rights reserved. # # Generates marshaling code based on libevent. import sys import re # _NAME = "event_rpcgen.py" _VERSION = "0.1" _STRUCT_RE = '[a-z][a-z_0-9]*' # Globals line_count = 0 white = re.compile(r'^\s+') cppcomment =...
bsd-3-clause
leandrotoledo/python-telegram-bot
tests/test_helpers.py
2
16200
#!/usr/bin/env python # # A library that provides a Python interface to the Telegram Bot API # Copyright (C) 2015-2021 # Leandro Toledo de Souza <devs@python-telegram-bot.org> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser Public License as published by #...
lgpl-3.0
saurabh6790/med_new_app
stock/doctype/warehouse/warehouse.py
18
5226
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import webnotes from webnotes.utils import cint, validate_email_add from webnotes import msgprint, _ class DocType: def __init__(self, doc, doclist...
agpl-3.0
prutseltje/ansible
lib/ansible/modules/packaging/language/yarn.py
17
11746
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017 David Gunter <david.gunter@tivix.com> # Copyright (c) 2017 Chris Hoffman <christopher.hoffman@gmail.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function _...
gpl-3.0
tersmitten/ansible
lib/ansible/modules/system/cron.py
14
25562
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2012, Dane Summers <dsummers@pinedesk.biz> # Copyright: (c) 2013, Mike Grozak <mike.grozak@gmail.com> # Copyright: (c) 2013, Patrick Callahan <pmc@patrickcallahan.com> # Copyright: (c) 2015, Evan Kaufman <evan@digitalflophouse.com> # Copyright: (c) 2015, Luca...
gpl-3.0
Adai0808/scikit-learn
sklearn/ensemble/tests/test_gradient_boosting.py
127
37672
""" Testing for the gradient boosting module (sklearn.ensemble.gradient_boosting). """ import warnings import numpy as np from sklearn import datasets from sklearn.base import clone from sklearn.ensemble import GradientBoostingClassifier from sklearn.ensemble import GradientBoostingRegressor from sklearn.ensemble.grad...
bsd-3-clause
sodexis/odoo
openerp/addons/base/tests/test_ir_actions.py
291
20121
import unittest2 from openerp.osv.orm import except_orm import openerp.tests.common as common from openerp.tools import mute_logger class TestServerActionsBase(common.TransactionCase): def setUp(self): super(TestServerActionsBase, self).setUp() cr, uid = self.cr, self.uid # Models ...
agpl-3.0
HKUST-SING/tensorflow
tensorflow/python/training/server_lib_sparse_job_test.py
133
1605
# 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
epam-mooc/edx-platform
common/djangoapps/track/contexts.py
78
1504
"""Generates common contexts""" import logging from opaque_keys.edx.locations import SlashSeparatedCourseKey from opaque_keys.edx.keys import CourseKey from opaque_keys import InvalidKeyError from util.request import COURSE_REGEX log = logging.getLogger(__name__) def course_context_from_url(url): """ Extrac...
agpl-3.0
vitan/hue
desktop/core/ext-py/Django-1.6.10/tests/admin_views/customadmin.py
58
2166
""" A second, custom AdminSite -- see tests.CustomAdminSiteTests. """ from __future__ import absolute_import from django.conf.urls import patterns from django.contrib import admin from django.http import HttpResponse from django.contrib.auth.models import User from django.contrib.auth.admin import UserAdmin from . im...
apache-2.0
missionpinball/mpf-mc
mpfmc/tests/MpfIntegrationTestCase.py
1
8859
import logging import os import sys import mpf.core os.environ['KIVY_NO_FILELOG'] = '1' os.environ['KIVY_NO_CONSOLELOG'] = '1' os.environ["KIVY_NO_ARGS"] = "1" from queue import Queue import time from kivy.config import Config from kivy.logger import Logger from kivy.base import runTouchApp, EventLoop from kivy.clo...
mit
KanchanChauhan/erpnext
erpnext/stock/doctype/delivery_note/test_delivery_note.py
5
19129
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import unittest import frappe import json import frappe.defaults from frappe.utils import cint, nowdate, nowtime, cstr, add_days, flt, today from erpne...
gpl-3.0
EttusResearch/gnuradio
gr-digital/examples/narrowband/benchmark_add_channel.py
41
4246
#!/usr/bin/env python # # Copyright 2010,2011 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at your opt...
gpl-3.0
ChristinaZografou/sympy
sympy/functions/elementary/hyperbolic.py
6
35314
from __future__ import print_function, division from sympy.core import S, sympify, cacheit from sympy.core.function import Function, ArgumentIndexError, _coeff_isneg from sympy.functions.elementary.miscellaneous import sqrt from sympy.functions.elementary.exponential import exp, log from sympy.functions.combinatoria...
bsd-3-clause