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
iohannez/gnuradio
gr-blocks/python/blocks/stream_to_vector_decimator.py
6
3246
from __future__ import unicode_literals # # Copyright 2008 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 (...
gpl-3.0
raiden-network/raiden
raiden/raiden_service.py
1
69488
# pylint: disable=too-many-lines import os import random import time from collections import defaultdict from enum import Enum from typing import Any, Dict, List, NamedTuple, Set, Tuple, cast from uuid import UUID import click import filelock import gevent import structlog from eth_utils import to_hex from gevent impo...
mit
Cojacfar/Maker
comm/lib/python2.7/site-packages/django/contrib/gis/tests/relatedapp/tests.py
58
14918
from __future__ import absolute_import from django.contrib.gis.geos import HAS_GEOS from django.contrib.gis.tests.utils import HAS_SPATIAL_DB, mysql, oracle, no_mysql, no_oracle, no_spatialite from django.test import TestCase from django.utils.unittest import skipUnless if HAS_GEOS: from django.contrib.gis.db.mod...
gpl-2.0
azov3902/linguinesim
linguineglobals.py
1
2551
################################################################################ # # File: linguineglobals.py # Author: Anna Zovaro # Email: anna.zovaro@anu.edu.au # # Description: # Some useful constants. # # Copyright (C) 2016 Anna Zovaro # ########################################################################...
gpl-3.0
fraxen/nordpil_arcpy
python/extractwoa.py
1
2118
import sys,os # {{{ HANDLE PARAMETERS try: if len(sys.argv) < 2: raise inFile = sys.argv[1] if (len(sys.argv) == 2): outFile = 'outgrid' else: outFile = sys.argv[2] if (not os.path.exists(inFile)): raise if (os.path.exists(outFile)): raise except: print "\nPlease verify the input arguments:\n" + sys.argv[0...
apache-2.0
girving/tensorflow
tensorflow/contrib/distributions/python/kernel_tests/batch_reshape_test.py
25
21843
# Copyright 2018 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
iandd0824/ri-app
web/django_mongoengine/mongo_auth/models.py
1
14304
from django.utils.encoding import smart_str from django.utils.translation import ugettext_lazy as _ from django.utils import timezone from django.contrib.auth.models import _user_has_perm, _user_get_all_permissions, _user_has_module_perms from django.db import models from django.contrib.contenttypes.models import Conte...
apache-2.0
MikeAmy/django
django/contrib/sessions/backends/cached_db.py
231
2861
""" Cached, database-backed sessions. """ import logging from django.conf import settings from django.contrib.sessions.backends.db import SessionStore as DBStore from django.core.cache import caches from django.core.exceptions import SuspiciousOperation from django.utils import timezone from django.utils.encoding imp...
bsd-3-clause
40223246/w16b_test
static/Brython3.1.1-20150328-091302/Lib/xml/dom/__init__.py
873
4019
"""W3C Document Object Model implementation for Python. The Python mapping of the Document Object Model is documented in the Python Library Reference in the section on the xml.dom package. This package contains the following modules: minidom -- A simple implementation of the Level 1 DOM with namespace sup...
agpl-3.0
Kiiv/Sick-Beard
lib/requests/packages/chardet2/euctwprober.py
2994
1676
######################## 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
maxdeliso/elevatorSim
Lib/functools.py
15
12285
"""functools.py - Tools for working with functions and callable objects """ # Python module wrapper for _functools C module # to allow utilities written in Python to be added # to the functools module. # Written by Nick Coghlan <ncoghlan at gmail.com> # and Raymond Hettinger <python at rcn.com> # Copyright (C) 2006-2...
bsd-2-clause
kamenim/samba
third_party/waf/wafadmin/Tools/unittestw.py
32
9789
#!/usr/bin/env python # encoding: utf-8 # Carlos Rafael Giani, 2006 """ Unit tests run in the shutdown() method, and for c/c++ programs One should NOT have to give parameters to programs to execute In the shutdown method, add the following code: >>> def shutdown(): ... ut = UnitTest.unit_test() ... ut.run() ......
gpl-3.0
neilLasrado/erpnext
erpnext/regional/report/datev/datev.py
1
14705
# coding: utf-8 """ Provide a report and downloadable CSV according to the German DATEV format. - Query report showing only the columns that contain data, formatted nicely for dispay to the user. - CSV download functionality `download_datev_csv` that provides a CSV file with all required columns. Used to import th...
gpl-3.0
LCOGT/valhalla
valhalla/userrequests/target_helpers.py
1
4432
from django.utils.translation import ugettext as _ from numbers import Number class BaseTargetHelper(object): """ These helper classes take a dictionary representation of a target and performs validation specific to the target type Sidereal, NonSidereal, Satellite. The dictionary it returns will also ...
gpl-3.0
pinball1973b/git_work_slide
node_modules/node-gyp/gyp/pylib/gyp/win_tool.py
1417
12751
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Utility functions for Windows builds. These functions are executed via gyp-win-tool when using the ninja generator. """ import os impor...
mit
cpennington/edx-platform
common/djangoapps/student/tests/test_enrollment.py
4
14815
""" Tests for student enrollment. """ import unittest import ddt import six from django.conf import settings from django.urls import reverse from mock import patch from course_modes.models import CourseMode from course_modes.tests.factories import CourseModeFactory from openedx.core.djangoapps.embargo.test_utils im...
agpl-3.0
gfyoung/pandas
pandas/tests/indexes/test_engines.py
4
8656
import re import numpy as np import pytest from pandas._libs import algos as libalgos, index as libindex import pandas as pd import pandas._testing as tm @pytest.fixture( params=[ (libindex.Int64Engine, np.int64), (libindex.Int32Engine, np.int32), (libindex.Int16Engine, np.int16), ...
bsd-3-clause
GraemeFulton/job-search
docutils-0.12/build/lib/docutils/languages/nl.py
200
1865
# $Id: nl.py 4564 2006-05-21 20:44:42Z wiemann $ # Author: Martijn Pieters <mjpieters@users.sourceforge.net> # Copyright: This module has been placed in the public domain. # New language mappings are welcome. Before doing a new translation, please # read <http://docutils.sf.net/docs/howto/i18n.html>. Two files must ...
gpl-2.0
hurricup/intellij-community
python/lib/Lib/site-packages/django/contrib/sites/models.py
387
2867
from django.db import models from django.utils.translation import ugettext_lazy as _ SITE_CACHE = {} class SiteManager(models.Manager): def get_current(self): """ Returns the current ``Site`` based on the SITE_ID in the project's settings. The ``Site`` object is cached the first ...
apache-2.0
rgommers/statsmodels
statsmodels/sandbox/regression/tests/test_gmm_poisson.py
31
13338
''' TestGMMMultTwostepDefault() has lower precision ''' from statsmodels.compat.python import lmap import numpy as np from numpy.testing.decorators import skipif import pandas import scipy from scipy import stats from statsmodels.regression.linear_model import OLS from statsmodels.sandbox.regression import gmm fro...
bsd-3-clause
Louiiiss/ros_asr
src/grammar/mit_g2p_tools/g2p/Evaluation.py
4
6540
from __future__ import division __author__ = 'Maximilian Bisani' __version__ = '$LastChangedRevision: 1668 $' __date__ = '$LastChangedDate: 2007-06-02 18:14:47 +0200 (Sat, 02 Jun 2007) $' __copyright__ = 'Copyright (c) 2004-2005 RWTH Aachen University' __license__ = """ This program is free software; you ...
gpl-2.0
sergio-incaser/bank-payment
account_banking_pain_base/__init__.py
11
1104
# -*- encoding: utf-8 -*- ############################################################################## # # PAIN Base module for Odoo # Copyright (C) 2013 Akretion (http://www.akretion.com) # @author: Alexis de Lattre <alexis.delattre@akretion.com> # # This program is free software: you can redistribute it...
agpl-3.0
TeamBliss-LP/android_external_skia
gm/rebaseline_server/results.py
66
11097
#!/usr/bin/python """ Copyright 2013 Google Inc. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. Repackage expected/actual GM results as needed by our HTML rebaseline viewer. """ # System-level imports import fnmatch import os import re # Imports from within Skia i...
bsd-3-clause
bikashgupta11/javarobot
src/main/resources/jython/Lib/selenium/webdriver/support/abstract_event_listener.py
61
2033
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
gpl-3.0
fastflo/emma
emmalib/dialogs/ExecuteQueryFromDisk.py
1
11103
""" Execute Query From Disk Dialog """ import gc import bz2 import time import datetime from stat import * import gtk import gtk.glade from emmalib.Query import * from emmalib.dialogs import * class ExecuteQueryFromDisk: """ @param emma: Emma """ def __init__(self, emma): self.emma = emma ...
gpl-2.0
163gal/Time-Line
specs/CategorySorter.py
2
1614
# Copyright (C) 2009, 2010, 2011 Rickard Lindberg, Roger Lindberg # # This file is part of Timeline. # # Timeline 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...
gpl-3.0
senior-zero/metanet
metanet/datasets/xor.py
1
2138
""" Copyright (C) 2015 Evtushenko Georgy Authors: Evtushenko Georgy This file is part of MetaNet. MetaNet 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, ...
gpl-3.0
artas360/pythran
pythran/transformations/remove_nested_functions.py
1
3162
""" RemoveNestedFunctions turns nested function into top-level functions. """ from pythran.analyses import GlobalDeclarations, ImportedIds from pythran.passmanager import Transformation from pythran.tables import MODULES import ast class _NestedFunctionRemover(Transformation): def __init__(self, pm, ctx): ...
bsd-3-clause
nutsboard/linux-am335x
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
redmi/android_kernel_HM2014811
tools/perf/scripts/python/failed-syscalls-by-pid.py
11180
2058
# failed system call counts, by pid # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide failed system call totals, broken down by pid. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.pa...
gpl-2.0
googleapis/googleapis-gen
google/cloud/talent/v4beta1/talent-v4beta1-py/google/cloud/talent_v4beta1/services/tenant_service/pagers.py
1
5775
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # 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...
apache-2.0
bjolivot/ansible
lib/ansible/executor/playbook_executor.py
57
12811
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) an...
gpl-3.0
blockstack/blockstack-server
integration_tests/blockstack_integration_tests/scenarios/name_pre_regup_subdomain_seq_xfer_pending.py
1
12369
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Blockstack ~~~~~ copyright: (c) 2014-2015 by Halfmoon Labs, Inc. copyright: (c) 2016 by Blockstack.org This file is part of Blockstack Blockstack is free software: you can redistribute it and/or modify it under the terms of the GNU General...
gpl-3.0
caphrim007/ansible
lib/ansible/plugins/action/ce_config.py
27
4239
# # Copyright 2015 Peter Sprygada <psprygada@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...
gpl-3.0
Codefans-fan/odoo
openerp/addons/base/module/wizard/base_export_language.py
269
3648
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2004-2012 OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of t...
agpl-3.0
mpdehaan/ansible
lib/ansible/module_utils/facts.py
4
103392
# (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
minxuancao/shogun
examples/undocumented/python_modular/features_string_char_compressed_modular.py
24
3676
#!/usr/bin/env python parameter_list = [['features_string_char_compressed_modular.py']] def features_string_char_compressed_modular (fname): from modshogun import StringCharFeatures, StringFileCharFeatures, RAWBYTE from modshogun import UNCOMPRESSED,SNAPPY,LZO,GZIP,BZIP2,LZMA, MSG_DEBUG from modshogun import Decomp...
gpl-3.0
jmahler/linux-next
tools/perf/scripts/python/event_analyzing_sample.py
4719
7393
# event_analyzing_sample.py: general event handler in python # # Current perf report is already very powerful with the annotation integrated, # and this script is not trying to be as powerful as perf report, but # providing end user/developer a flexible way to analyze the events other # than trace points. # # The 2 dat...
gpl-2.0
NullNoname/dolphin
Externals/scons-local/scons-local-2.0.1/SCons/Tool/f90.py
61
2041
"""engine.SCons.Tool.f90 Tool-specific initialization for the generic Posix f90 Fortran compiler. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2...
gpl-2.0
tst2005googlecode/shcov
setup.py
2
1262
###################################################################### ## ## Copyright (C) 2008, Simon Kagstrom ## ## Filename: setup.py ## Author: Simon Kagstrom <simon.kagstrom@gmail.se> ## Description: Installation script (from Dissy) ## ## $Id:$ ## ####################################################...
gpl-2.0
poffuomo/spark
examples/src/main/python/sql/basic.py
56
6270
# # 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
nwchandler/ansible
lib/ansible/modules/monitoring/zabbix_maintenance.py
35
12164
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Alexander Bulimov <lazywolf0@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 t...
gpl-3.0
newmanne/kaggle_clickthrough_rate
hash_to_int.py
1
3078
import os from collections import Counter import numpy as np import pandas as pd COLS_TO_TRANLSATE = "site_id,site_domain,site_category,app_id,app_domain,app_category,device_id,device_ip,device_model,C1,C14,C15,C16,C17,C18,C19,C20,C21".split(",") COLS = "id,click,day,hour,C1,banner_pos,site_id,site_domain,site_categ...
apache-2.0
sharifulgeo/google-appengine-wx-launcher
launcher/addnew_controller.py
28
6957
#!/usr/bin/env python # # Copyright 2008 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 requir...
apache-2.0
weboo/kernel-nexus-s
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py
802
2710
# Core.py - Python extension for perf trace, 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 auto...
gpl-2.0
UO-CAES/paparazzi
sw/tools/parrot/bebop.py
26
8380
#!/usr/bin/env python # # Copyright (C) 2012-2014 The Paparazzi Team # # This file is part of Paparazzi. # # Paparazzi 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, or (at your option) # an...
gpl-2.0
cesargtz/YecoraOdoo
addons/l10n_fr/report/compute_resultant_report.py
374
4004
# -*- coding: utf-8 -*- # # # Copyright (c) 2008 JAILLET Simon - CrysaLEAD - www.crysalead.fr # # WARNING: This program as such is intended to be used by professional # programmers who take the whole responsability of assessing all potential # consequences resulting from its eventual inadequacies and bugs # End users w...
agpl-3.0
eenchev/idea-note-taking-app
env/lib/python2.7/site-packages/gunicorn/_compat.py
35
8719
import sys from gunicorn import six PY26 = (sys.version_info[:2] == (2, 6)) PY33 = (sys.version_info >= (3, 3)) def _check_if_pyc(fname): """Return True if the extension is .pyc, False if .py and None if otherwise""" from imp import find_module from os.path import realpath, dirname, basename, splite...
mit
ClustyROM/Galaxy_Note
tools/perf/scripts/python/sctop.py
895
1936
# system call top # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Periodically displays system-wide system call totals, broken down by # syscall. If a [comm] arg is specified, only syscalls called by # [comm] are displayed. If an [interval] arg is specified,...
gpl-2.0
lafayette/JBTT
framework/python/Lib/encodings/iso8859_7.py
593
13100
""" Python Character Mapping Codec iso8859_7 generated from 'MAPPINGS/ISO8859/8859-7.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,input,errors='...
mit
xin3liang/platform_external_chromium_org
chrome/common/extensions/docs/server2/path_canonicalizer.py
16
4879
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from collections import defaultdict import posixpath from future import Future from path_util import SplitParent from special_paths import SITE_VERIFICATION...
bsd-3-clause
briceburg/airflow
airflow/executors/base_executor.py
30
3817
from builtins import range from builtins import object import logging from airflow.utils import State from airflow.configuration import conf PARALLELISM = conf.getint('core', 'PARALLELISM') class BaseExecutor(object): def __init__(self, parallelism=PARALLELISM): """ Class to derive in order to ...
apache-2.0
alxgu/ansible
lib/ansible/modules/cloud/hcloud/hcloud_floating_ip_facts.py
3
4929
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2019, Hetzner Cloud GmbH <info@hetzner-cloud.de> # 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 = { "met...
gpl-3.0
CollinsIchigo/hdx_2
venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/gb2312freq.py
3132
36011
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights R...
mit
mottosso/deplish
deplish/util.py
1
10218
# # Depends # Copyright (C) 2014 by Andrew Gardner & Jonas Unger. All rights reserved. # BSD license (LICENSE.txt for details). # import os import re import imp import sys import glob import inspect import node """ A utility module for the Depends software. Much of the functionality relates to plugin loading, but...
bsd-3-clause
joariasl/odoo
addons/l10n_fr_hr_payroll/report/__init__.py
424
1091
#-*- coding:utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved # d$ # # This program is free software: you can redistribute it and/or modify # it...
agpl-3.0
etherkit/OpenBeacon2
client/macos/venv/lib/python3.8/site-packages/pip/_internal/req/req_file.py
11
19448
""" Requirements file parsing """ from __future__ import absolute_import import optparse import os import re import shlex import sys from pip._vendor.six.moves.urllib import parse as urllib_parse from pip._internal.cli import cmdoptions from pip._internal.exceptions import ( InstallationError, RequirementsF...
gpl-3.0
kressi/erpnext
erpnext/selling/report/customer_acquisition_and_loyalty/customer_acquisition_and_loyalty.py
96
2099
# 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 from frappe import _ from frappe.utils import getdate, cint import calendar def execute(filters=None): # key yyyy-mm new_customers_in =...
gpl-3.0
dlazz/ansible
lib/ansible/modules/cloud/amazon/s3_website.py
39
10634
#!/usr/bin/python # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
gpl-3.0
johnraz/faker
faker/providers/python/__init__.py
8
4613
# coding=utf-8 from __future__ import unicode_literals from decimal import Decimal import sys from faker.providers.lorem.la import Provider as Lorem from .. import BaseProvider if sys.version_info[0] == 2: string_types = (basestring,) elif sys.version_info[0] == 3: string_types = (str, bytes) else: ra...
mit
mgedmin/ansible
lib/ansible/plugins/terminal/iosxr.py
5
2002
# # (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
ysekky/chainer
chainer/functions/util/forget.py
4
4081
from chainer import cuda from chainer import function from chainer import variable class _DummyFunction(function.Function): def __init__(self, grads): self.grads = grads def forward(self, inputs): xp = cuda.get_array_module(*inputs) return xp.array(0), def backward(self, inputs,...
mit
Henning-Klatt/Robot
Application/PiVideoStream.py
1
3226
#!/usr/bin/python3 import socket import struct import pickle import time from PIL import Image, ImageTk try: import tkinter as tk from tkinter import messagebox except ImportError: import Tkinter as tk from Tkinter import messagebox class PiVideoStream(object): def __init__(self, gui, host='127.0...
gpl-3.0
fabianp/scikit-learn
examples/applications/wikipedia_principal_eigenvector.py
233
7819
""" =============================== Wikipedia principal eigenvector =============================== A classical way to assert the relative importance of vertices in a graph is to compute the principal eigenvector of the adjacency matrix so as to assign to each vertex the values of the components of the first eigenvect...
bsd-3-clause
liorvh/raspberry_pwn
src/pentest/metagoofil/hachoir_core/field/basic_field_set.py
21
4746
from hachoir_core.field import Field, FieldError from hachoir_core.stream import InputStream from hachoir_core.endian import BIG_ENDIAN, LITTLE_ENDIAN from hachoir_core.event_handler import EventHandler class ParserError(FieldError): """ Error raised by a field set. @see: L{FieldError} """ pass c...
gpl-3.0
BT-jmichaud/account-invoicing
account_invoice_rounding/account.py
10
10110
# -*- coding: utf-8 -*- ############################################################################## # # Author: Yannick Vaucher # Copyright 2013 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # pub...
agpl-3.0
UQ-UQx/edx-platform_lti
lms/djangoapps/courseware/features/common.py
14
7888
# pylint: disable=missing-docstring # pylint: disable=redefined-outer-name from __future__ import absolute_import import time from lettuce import world, step from lettuce.django import django_url from django.contrib.auth.models import User from django.core.urlresolvers import reverse from student.models import Cours...
agpl-3.0
rickerc/ceilometer_audit
ceilometer/publisher/test.py
8
1227
# -*- encoding: utf-8 -*- # # Copyright © 2013 eNovance # # Author: Julien Danjou <julien@danjou.info> # # 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
apaleyes/mxnet
example/speech_recognition/stt_layer_fc.py
4
5311
import mxnet as mx from stt_layer_batchnorm import batchnorm def fc(net, num_hidden, act_type, weight=None, bias=None, no_bias=False, name=None ): # when weight and bias doesn't have specific name if weight is None and bias is None: net = mx.sym.FullyC...
apache-2.0
zofuthan/edx-platform
cms/djangoapps/contentstore/features/component_settings_editor_helpers.py
38
9441
# disable missing docstring # pylint: disable=missing-docstring from lettuce import world from nose.tools import assert_equal, assert_in # pylint: disable=no-name-in-module from terrain.steps import reload_the_page from common import type_in_codemirror from selenium.webdriver.common.keys import Keys @world.absorb d...
agpl-3.0
danieljabailey/FreeCAD
src/Mod/PartDesign/InitGui.py
17
3817
# PartDesign gui init module # (c) 2003 Juergen Riegel # # Gathering all the information to start FreeCAD # This is the second one of three init scripts, the third one # runs when the gui is up #*************************************************************************** #* (c) Juergen Riegel (juergen.riegel@...
lgpl-2.1
deKupini/erp
openerp/addons/test_impex/tests/test_export.py
158
19124
# -*- coding: utf-8 -*- import itertools import openerp.modules.registry import openerp from openerp.tests import common class CreatorCase(common.TransactionCase): model_name = False def __init__(self, *args, **kwargs): super(CreatorCase, self).__init__(*args, **kwargs) self.model = None ...
agpl-3.0
austinvernsonger/metagoofil
hachoir_parser/misc/bplist.py
84
11670
""" Apple/NeXT Binary Property List (BPLIST) parser. Also includes a .createXML() function which produces an XML representation of the object. Note that it will discard unknown objects, nulls and fill values, but should work for most files. Documents: - CFBinaryPList.c http://src.gnu-darwin.org/DarwinSourceArchive/...
gpl-2.0
salfab/CouchPotatoServer
libs/sqlalchemy/orm/__init__.py
18
66714
# orm/__init__.py # Copyright (C) 2005-2013 the SQLAlchemy authors and contributors <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """ Functional constructs for ORM configuration. See the SQLAlchemy object relational...
gpl-3.0
petosegan/scikit-learn
sklearn/metrics/__init__.py
214
3440
""" The :mod:`sklearn.metrics` module includes score functions, performance metrics and pairwise metrics and distance computations. """ from .ranking import auc from .ranking import average_precision_score from .ranking import coverage_error from .ranking import label_ranking_average_precision_score from .ranking imp...
bsd-3-clause
NiklasRosenstein/pydoc-markdown
pydoc-markdown/src/test/test_processors/test_sphinx.py
1
1153
from . import assert_processor_result from pydoc_markdown.contrib.processors.sphinx import SphinxProcessor def test_sphinx_processor(processor=None): assert_processor_result(processor or SphinxProcessor(), ''' :param s: A string. :param b: An int. :return: Something funny. ''', ''' **Arguments**: ...
mit
openprocurement/reports
reports/tests/invoices_tests.py
1
5864
import unittest from copy import copy from reports.tests.base import BaseInvoicesUtilityTest from reports.utilities.invoices import NEW_ALG_DATE from reports.helpers import prepare_result_file_name test_bids_valid = [ [{ "id": "bid_id", "status": "active", "date": "2017-12-01T00:00:00Z", ...
apache-2.0
mottosso/mindbender-setup
bin/windows/python36/Lib/reprlib.py
46
5336
"""Redo the builtin repr() (representation) but with limits on most sizes.""" __all__ = ["Repr", "repr", "recursive_repr"] import builtins from itertools import islice try: from _thread import get_ident except ImportError: from _dummy_thread import get_ident def recursive_repr(fillvalue='...'): 'Decorato...
mit
alirizakeles/tendenci
tendenci/apps/versions/models.py
1
2293
# models.py from dateutil.parser import parse from django.db import models from django.contrib.auth.models import User from django.contrib.contenttypes.models import ContentType from django.utils.translation import ugettext_lazy as _ from django.contrib.contenttypes.fields import GenericForeignKey import json from te...
gpl-3.0
yiannist/ganeti
lib/cmdlib/instance_migration.py
1
49981
# # # Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 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: # # 1. Redistributions of source code must retain the above copyri...
bsd-2-clause
robobrobro/ballin-octo-shame
lib/Python-3.4.3/Lib/idlelib/EditorWindow.py
9
66988
import importlib import importlib.abc import importlib.util import os import platform import re import string import sys from tkinter import * import tkinter.simpledialog as tkSimpleDialog import tkinter.messagebox as tkMessageBox import traceback import webbrowser from idlelib.MultiCall import MultiCallCreator from i...
mit
boonchu/pykickstart
pykickstart/handlers/f19.py
10
4960
# # Chris Lumens <clumens@redhat.com> # # Copyright 2013 Red Hat, Inc. # # This copyrighted material is made available to anyone wishing to use, modify, # copy, or redistribute it subject to the terms and conditions of the GNU # General Public License v.2. This program is distributed in the hope that it # will be usef...
gpl-2.0
openconnectome/open-connectome
django/resource/channelview.py
2
2523
# Copyright 2014 NeuroData (http://neurodata.io) # # 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 ag...
apache-2.0
hassanabidpk/django
tests/flatpages_tests/test_middleware.py
290
8134
from django.conf import settings from django.contrib.auth.models import User from django.contrib.flatpages.models import FlatPage from django.contrib.sites.models import Site from django.test import TestCase, modify_settings, override_settings from .settings import FLATPAGES_TEMPLATES class TestDataMixin(object): ...
bsd-3-clause
SlimRoms/kernel_samsung_smdk4412
scripts/tracing/draw_functrace.py
14676
3560
#!/usr/bin/python """ Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com> Licensed under the terms of the GNU GPL License version 2 This script parses a trace provided by the function tracer in kernel/trace/trace_functions.c The resulted trace is processed into a tree to produce a more human view of the call ...
gpl-2.0
dongguangming/django-filebrowser
filebrowser/templatetags/fb_versions.py
13
5502
# coding: utf-8 # PYTHON IMPORTS import os import re from time import gmtime # DJANGO IMPORTS from django.template import Library, Node, Variable, VariableDoesNotExist, TemplateSyntaxError from django.conf import settings from django.core.files import File # FILEBROWSER IMPORTS from filebrowser.settings import VERS...
bsd-3-clause
divya-csekar/flask-microblog-server
flask/Lib/site-packages/whoosh/lang/snowball/bases.py
96
4874
# Base classes class _ScandinavianStemmer(object): """ This subclass encapsulates a method for defining the string region R1. It is used by the Danish, Norwegian, and Swedish stemmer. """ def _r1_scandinavian(self, word, vowels): """ Return the region R1 that is used by the Scan...
bsd-3-clause
wanghongjuan/meta-iotqa-1
lib/oeqa/runtime/sensor/test_gyro_mpu6050.py
2
2458
""" @file test_gyro_mpu6050.py """ ## # @addtogroup soletta sensor # @brief This is sensor test based on soletta app # @brief test sensor mpu6050 on Galileo/MinnowMax/Edison ## import os import time from oeqa.utils.helper import shell_cmd from oeqa.oetest import oeRuntimeTest from oeqa.runtime.sensor.EnvirSetup import ...
mit
Giftingnation/GN-Oscar-Custom
oscar/apps/dashboard/views.py
4
7404
from datetime import timedelta from decimal import Decimal as D, ROUND_UP from django.utils.timezone import now from django.views.generic import TemplateView from django.db.models.loading import get_model from django.db.models import Avg, Sum, Count from oscar.core.compat import get_user_model from oscar.apps.promoti...
bsd-3-clause
argonemyth/sentry
src/sentry/web/forms/invite_organization_member.py
4
1598
from __future__ import absolute_import from django import forms from django.db import transaction, IntegrityError from sentry.models import ( AuditLogEntry, AuditLogEntryEvent, OrganizationMember, OrganizationMemberType ) class InviteOrganizationMemberForm(forms.ModelForm): class Meta: fields = ...
bsd-3-clause
edx/js-test-tool
js_test_tool/result_report.py
3
7720
""" Generate report of test results. """ from abc import ABCMeta, abstractmethod from collections import defaultdict from jinja2 import Environment, PackageLoader from xml.sax.saxutils import escape, quoteattr import logging LOGGER = logging.getLogger(__name__) # Set up the template environment TEMPLATE_LOADER = P...
apache-2.0
denisff/python-for-android
python-modules/twisted/twisted/internet/threads.py
49
3861
# Copyright (c) 2001-2010 Twisted Matrix Laboratories. # See LICENSE for details. """ Extended thread dispatching support. For basic support see reactor threading API docs. Maintainer: Itamar Shtull-Trauring """ import Queue from twisted.python import failure from twisted.internet import defer def deferToThreadP...
apache-2.0
mirzawaqasahmed/avocado-vt
examples/tests/ls_disk.py
35
1224
""" Shows all existing disk partitions. This test requires test-provider to be qemu. Try this test without config, than put ls_disk.cfg into $tests/cfg/ directory and see the difference. Additionally you might put ls_disk_v2.cfg into $tests/cfg/ directory and execute ls_disk_v2 test (which also uses this script!) and...
gpl-2.0
guke001/QMarkdowner
markdown/util.py
30
4224
# -*- coding: utf-8 -*- from __future__ import unicode_literals import re import sys """ Python 3 Stuff ============================================================================= """ PY3 = sys.version_info[0] == 3 if PY3: string_type = str text_type = str int2str = chr else: string_type = basestri...
mit
jw2100/beginning.github.io
DeepLearning/wuenda/01_NeuralNetworksAndDeepLearning/week2-02.py
1
12615
import numpy as np import matplotlib.pyplot as plt import h5py import scipy from PIL import Image from scipy import ndimage from lr_utils import load_dataset %matplotlib inline # Loading the data (cat/non-cat) train_set_x_orig, train_set_y, test_set_x_orig, test_set_y, classes = load_dataset() # Example...
gpl-3.0
aashish24/tangelo
data-processing/charitynet-fixup.py
1
2153
import sys import pymongo geonames = pymongo.Connection("mongo")["xdata"]["geonames"] donors = pymongo.Connection("mongo")["xdata"]["charitynet.normalized.donors"] pr = 0 city_country_state = 0 alternate_city_country_state = 0 not_found = 0 count = 0 for donor in donors.find(): if (count > 0 and count % 1000 == 0...
apache-2.0
joymarquis/mscc
projects/swtec/utils/fwdl/lib-python/pexpect-4.0.1/tests/test_ansi.py
19
11822
#!/usr/bin/env python ''' PEXPECT LICENSE This license is approved by the OSI and FSF as GPL-compatible. http://opensource.org/licenses/isc-license.txt Copyright (c) 2012, Noah Spurrier <noah@noah.org> PERMISSION TO USE, COPY, MODIFY, AND/OR DISTRIBUTE THIS SOFTWARE FOR ANY PURPOSE WITH OR WIT...
gpl-3.0
grimmjow8/ansible
lib/ansible/playbook/conditional.py
5
10147
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) an...
gpl-3.0
devdelay/home-assistant
homeassistant/components/zone.py
12
4624
""" Support for the definition of zones. For more details about this component, please refer to the documentation at https://home-assistant.io/components/zone/ """ import logging from homeassistant.const import ( ATTR_HIDDEN, ATTR_ICON, ATTR_LATITUDE, ATTR_LONGITUDE, CONF_NAME) from homeassistant.helpers import e...
mit
eayunstack/fuel-ostf
fuel_health/tests/smoke/test_neutron_actions.py
2
5679
# Copyright 2014 Mirantis, 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