repo_name
stringlengths
5
100
path
stringlengths
4
294
copies
stringclasses
990 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
guangquanwang/cuda-convnet2
python_util/data.py
180
7803
# Copyright 2014 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
apache-2.0
MicroTrustRepos/microkernel
src/l4/pkg/python/contrib/Lib/lib2to3/fixer_base.py
49
6215
# Copyright 2006 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Base class for fixers (optional, but recommended).""" # Python imports import logging import itertools # Local imports from .patcomp import PatternCompiler from . import pygram from .fixer_util import does_tree_imp...
gpl-2.0
jbkopecky/housebot
models/neural_net.py
1
3417
from pipelines import ItemSelector from pipelines import MyOneHotEncoder from pipelines import FindReplace from pipelines import ReplaceNaN from utils import plot_results from utils import make_xy_data from sklearn.metrics import mean_squared_error from sklearn.preprocessing import Imputer from sklearn.cross_validation...
mit
lifeinoppo/littlefishlet-scode
RES/REF/python_sourcecode/ipython-master/IPython/terminal/tests/test_interactivshell.py
20
11321
# -*- coding: utf-8 -*- """Tests for the key interactiveshell module. Authors ------- * Julian Taylor """ #----------------------------------------------------------------------------- # Copyright (C) 2011 The IPython Development Team # # Distributed under the terms of the BSD License. The full license is in # th...
gpl-2.0
Rav3nPL/PLNcoin
qa/rpc-tests/test_framework/siphash.py
107
2022
#!/usr/bin/env python3 # Copyright (c) 2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # siphash.py - Specialized SipHash-2-4 implementations # # This implements SipHash-2-4 for 256-bit integers....
mit
wangjun/wakatime
wakatime/packages/pygments_py2/pygments/lexers/ml.py
72
27891
# -*- coding: utf-8 -*- """ pygments.lexers.ml ~~~~~~~~~~~~~~~~~~ Lexers for ML family languages. :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, include, bygroups, default, words from...
bsd-3-clause
jmp0xf/raven-python
raven/utils/ssl_match_hostname.py
38
3598
"""The match_hostname() function from Python 3.2, essential when using SSL.""" from __future__ import absolute_import import re __version__ = '3.2.2' class CertificateError(ValueError): pass def _dnsname_match(dn, hostname, max_wildcards=1): """Matching according to RFC 6125, section 6.4.3 http://to...
bsd-3-clause
freeflightsim/ffs-app-engine
google_appengine/lib/yaml/lib/yaml/events.py
985
2445
# Abstract classes. class Event(object): def __init__(self, start_mark=None, end_mark=None): self.start_mark = start_mark self.end_mark = end_mark def __repr__(self): attributes = [key for key in ['anchor', 'tag', 'implicit', 'value'] if hasattr(self, key)] argu...
gpl-2.0
bertucho/epic-movie-quotes-quiz
dialogos/build/cryptography/tests/test_utils.py
3
163841
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function import binascii import os import textwrap import pretend import pytest ...
mit
billygoo/dev-365
python/flask/minitwit/venv/Lib/site-packages/flask/exthook.py
783
5087
# -*- coding: utf-8 -*- """ flask.exthook ~~~~~~~~~~~~~ Redirect imports for extensions. This module basically makes it possible for us to transition from flaskext.foo to flask_foo without having to force all extensions to upgrade at the same time. When a user does ``from flask.ext.foo import...
gpl-2.0
josephbisch/the-blue-alliance
helpers/data_fetchers/team_details_data_fetcher.py
11
1731
import datetime from google.appengine.ext import ndb from database import award_query, event_query, match_query, team_query class TeamDetailsDataFetcher(object): @classmethod def fetch(self, team, year, return_valid_years=False): """ returns: events_sorted, matches_by_event_key, awards_by_ev...
mit
pong3489/TEST_Mission
Lib/site-packages/numpy/distutils/command/config.py
89
17058
# Added Fortran compiler support to config. Currently useful only for # try_compile call. try_run works but is untested for most of Fortran # compilers (they must define linker_exe first). # Pearu Peterson import os, signal import warnings import sys from distutils.command.config import config as old_config from dist...
gpl-3.0
ejspina/Gene_expression_tools
Python/mirtarbaseOrtho_GtoP.py
1
1040
#------------------------------------------------------------------------------- # Name: module1 # Purpose: # # Author: Eli # # Created: 26/03/2014 # Copyright: (c) Eli 2014 # Licence: <your licence> #------------------------------------------------------------------------------- def m...
gpl-2.0
Apreche/Presentoh
utils/simplejson/tests/test_decode.py
35
2930
import decimal from unittest import TestCase from StringIO import StringIO import simplejson as json from simplejson import OrderedDict class TestDecode(TestCase): if not hasattr(TestCase, 'assertIs'): def assertIs(self, a, b): self.assertTrue(a is b, '%r is %r' % (a, b)) def test_decimal...
mit
drjova/zenodo
zenodo/modules/accessrequests/helpers.py
2
3248
# -*- coding: utf-8 -*- # # This file is part of Zenodo. # Copyright (C) 2015 CERN. # # Zenodo 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 v...
gpl-3.0
hanicker/odoo
addons/stock_invoice_directly/__openerp__.py
260
1618
# -*- 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
ycaihua/kbengine
kbe/res/scripts/common/Lib/test/test_thread.py
84
8285
import os import unittest import random from test import support thread = support.import_module('_thread') import time import sys import weakref from test import lock_tests NUMTASKS = 10 NUMTRIPS = 3 _print_mutex = thread.allocate_lock() def verbose_print(arg): """Helper function for printing out debugging outp...
lgpl-3.0
bjmnbraun/icestick_fastio
thirdparty/magma/magma/ref.py
1
1895
__all__ = ['AnonRef', 'InstRef', 'DefnRef', 'ArrayRef', 'TupleRef'] class Ref: def __str__(self): return self.qualifiedname() class AnonRef(Ref): def __init__(self, name=None): self.name = name def qualifiedname(self, sep='.'): return str(self.name) if self.name else "" def a...
mit
Eid010n/pysecdump
wpc/cache.py
6
6700
from wpc.sd import sd import win32net import win32netcon import win32security import wpc.file #from wpc.file import file as wpcfile # Basically a huge hash of all lookups # # There should be only one instance of the cache which is started when the script is initialised # All classes are hard-coded to use this instanc...
gpl-3.0
KiCad/kicad-python
kicad/pcbnew/board.py
2
5335
# Copyright 2014 Piers Titus van der Torren <pierstitus@gmail.com> # Copyright 2015 Miguel Angel Ajo <miguelangel@ajo.es> # # 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 2 ...
gpl-2.0
Ramin8or/back-end-conference
utils.py
384
1576
import json import os import time import uuid from google.appengine.api import urlfetch from models import Profile def getUserId(user, id_type="email"): if id_type == "email": return user.email() if id_type == "oauth": """A workaround implementation for getting userid.""" auth = os.ge...
apache-2.0
pombredanne/kunai-1
test/kunai_test.py
3
1071
#!/usr/bin/env python import sys import time import datetime import os import string import re import random import unittest import copy # import the kunai library from the parent directory import __import_kunai del __import_kunai import kunai from kunai.log import logger class __DUMMY: def add(self, obj): ...
mit
uranusjr/django
tests/forms_tests/field_tests/test_datetimefield.py
98
5103
import datetime from django.forms import DateTimeField, ValidationError from django.test import SimpleTestCase class DateTimeFieldTest(SimpleTestCase): def test_datetimefield_1(self): f = DateTimeField() self.assertEqual(datetime.datetime(2006, 10, 25, 0, 0), f.clean(datetime.date(2006, 10, 25))...
bsd-3-clause
ejolly/pymer4
examples/example_04_simulating_data.py
2
5447
""" 4. Simulating Data ================== :code:`pymer4` comes with some easy-to-use functions for simulating data that can be modeled with :code:`Lm` and multi-level data that can be modeled with :code:`Lmer` or :code:`Lm2`. These functions can be found in the :code:`pymer4.simulate` module and are aptly named: :code:...
mit
knutfrode/opendrift
examples/example_entrainment_rate_oil_types.py
1
3035
#!/usr/bin/env python from datetime import datetime, timedelta from opendrift.models.openoil3D import OpenOil3D import matplotlib.pyplot as plt import numpy as np ###################################################### # Li et al. (2017) entrainment rate (light vs. heavy oil) #########################################...
gpl-2.0
urms/pfBgMrgr
pfBgMrgr.py
1
6965
#/usr/bin/python # -*- coding: utf-8 -*- #------------------------------------------------------------------- # Copyright 2012, Ulf Röttger # This file is part of pyBgMrgr.py. # pyBgMrgr.py is free software: you can redistribute it # and/or modify it under the terms of the GNU General Public License # as published b...
gpl-3.0
mheap/ansible
lib/ansible/plugins/action/pause.py
7
10221
# Copyright 2012, Tim Bielawa <tbielawa@redhat.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...
gpl-3.0
TangXT/GreatCatMOOC
lms/djangoapps/instructor/tests/test_email.py
17
6658
""" Unit tests for email feature flag in new instructor dashboard. Additionally tests that bulk email is always disabled for non-Mongo backed courses, regardless of email feature flag, and that the view is conditionally available when Course Auth is turned on. """ from django.test.utils import override_settings from d...
agpl-3.0
nchammas/spark
python/pyspark/mllib/stat/_statistics.py
22
14081
# # 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
themylogin/flask-security
tests/test_common.py
4
10713
# -*- coding: utf-8 -*- """ test_common ~~~~~~~~~~~ Test common functionality """ import base64 from utils import authenticate, json_authenticate, logout try: from cookielib import Cookie except ImportError: from http.cookiejar import Cookie def test_login_view(client): response = client.g...
mit
317070/kaggle-heart
configurations/je_ss_jonisc64_360_leaky_convroll.py
2
8669
"""Single slice vgg with normalised scale. """ import functools import lasagne as nn import numpy as np import theano import theano.tensor as T import data_loader import deep_learning_layers import image_transform import layers import preprocess import postprocess import objectives import theano_printer import update...
mit
brianwoo/django-tutorial
build/Django/tests/gis_tests/test_measure.py
325
7363
""" Distance and Area objects to allow for sensible and convenient calculation and conversions. Here are some tests. """ import unittest from django.contrib.gis.measure import A, D, Area, Distance class DistanceTest(unittest.TestCase): "Testing the Distance object" def testInit(self): "Testing init...
gpl-3.0
rs2/bokeh
bokeh/events.py
2
14547
''' Represent granular events that can be used to trigger callbacks. Bokeh documents and applications are capable of supporting various kinds of interactions. These are often associated with events, such as mouse or touch events, interactive downsampling mode activation, widget or tool events, and others. The classes ...
bsd-3-clause
jeffery-do/Vizdoombot
doom/lib/python3.5/site-packages/skimage/measure/tests/test_moments.py
27
2536
from numpy.testing import assert_equal, assert_almost_equal, assert_raises import numpy as np from skimage.measure import (moments, moments_central, moments_normalized, moments_hu) def test_moments(): image = np.zeros((20, 20), dtype=np.double) image[14, 14] = 1 image[15, 15]...
mit
ryfeus/lambda-packs
pytorch/source/torchvision/datasets/utils.py
2
2688
import os import os.path import hashlib import errno def check_integrity(fpath, md5): if not os.path.isfile(fpath): return False md5o = hashlib.md5() with open(fpath, 'rb') as f: # read in 1MB chunks for chunk in iter(lambda: f.read(1024 * 1024), b''): md5o.update(chunk...
mit
asm-products/movie-database-service
ani/lib/python2.7/site-packages/Crypto/SelfTest/Hash/test_SHA256.py
116
3663
# -*- coding: utf-8 -*- # # SelfTest/Hash/test_SHA256.py: Self-test for the SHA-256 hash function # # Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net> # # =================================================================== # The contents of this file are dedicated to the public domain. To # the extent that...
agpl-3.0
ds-hwang/chromium-crosswalk
tools/mb/mb.py
2
40380
#!/usr/bin/env python # Copyright 2015 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """MB - the Meta-Build wrapper around GYP and GN MB is a wrapper script for GYP and GN that can be used to generate build files for se...
bsd-3-clause
JuEeHa/hynneflip
line_handling.py
1
3175
import threading import constants import botcmd class LineParsingError(Exception): None # parse_line(line) → prefix, command, arguments # Split the line into its component parts def parse_line(line): def read_byte(): # Read one byte and advance the index nonlocal line, index if eol(): raise LineParsingEr...
unlicense
markhice/ghost-casper
node_modules_bak/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-3.3/pygments/formatters/rtf.py
364
4536
# -*- coding: utf-8 -*- """ pygments.formatters.rtf ~~~~~~~~~~~~~~~~~~~~~~~ A formatter that generates RTF files. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.formatter import Formatter __all__ = ['RtfFormatter'] ...
mit
smarkwell/asuswrt-merlin
release/src/router/samba-3.0.25b/examples/scripts/shares/python/smbparm.py
55
28620
###################################################################### ## ## autogenerated file of smb.conf parameters ## generate_parm_table <..../param/loadparm.c> ## ## Copyright (C) Gerald Carter 2004. ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the...
gpl-2.0
lisa-lab/pylearn2
pylearn2/linear/matrixmul.py
43
5758
""" .. todo:: WRITEME """ __authors__ = "Ian Goodfellow" __copyright__ = "Copyright 2010-2012, Universite de Montreal" __credits__ = ["Ian Goodfellow"] __license__ = "3-clause BSD" __maintainer__ = "LISA Lab" __email__ = "pylearn-dev@googlegroups" from theano.compat.six.moves import xrange from theano import tens...
bsd-3-clause
mklinker/ardupilot3.2
Tools/autotest/arduplane.py
29
16847
# fly ArduPlane in SIL import util, pexpect, sys, time, math, shutil, os from common import * from pymavlink import mavutil import random # get location of scripts testdir=os.path.dirname(os.path.realpath(__file__)) HOME_LOCATION='-35.362938,149.165085,585,354' WIND="0,180,0.2" # speed,direction,variance homeloc =...
gpl-3.0
swcarpentry/amy
amy/workshops/migrations/0043_auto_20150903_1508.py
3
5198
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django_countries.fields class Migration(migrations.Migration): dependencies = [ ('workshops', '0042_merge'), ] operations = [ migrations.CreateModel( name='DataAna...
mit
arthurhsliu/distcc
include_server/include_analyzer_memoizing_node.py
25
26782
#! /usr/bin/python2.4 # Copyright 2007 Google Inc. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program i...
gpl-2.0
hgiemza/DIRAC
Core/Workflow/WorkflowReader.py
5
4858
""" This is a comment """ #try: # this part to import as part of the DIRAC framework import xml.sax from xml.sax.handler import ContentHandler from DIRAC.Core.Workflow.Parameter import * from DIRAC.Core.Workflow.Module import * from DIRAC.Core.Workflow.Step import * from DIRAC.Core.Workflow.Workflow import Workf...
gpl-3.0
jcpowermac/ansible
lib/ansible/modules/network/avi/avi_ipaddrgroup.py
41
4969
#!/usr/bin/python # # @author: Gaurav Rastogi (grastogi@avinetworks.com) # Eric Anderson (eanderson@avinetworks.com) # module_check: supported # Avi Version: 17.1.1 # # Copyright: (c) 2017 Gaurav Rastogi, <grastogi@avinetworks.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses...
gpl-3.0
dmitry-vinogradov/kodi-addons
script.module.iptv/lib/iptv/gui/channel.py
1
1310
from collections import OrderedDict from iptv.common.utils import normalize, time_now from iptv.gui import Model class Channel(Model): LOGO_URL_FORMAT = "https://raw.githubusercontent.com/dmitry-vinogradov/kodi-addons/master/icons/channels/%s.png" cache = OrderedDict() def __init__(self, data): ...
lgpl-3.0
trentm/node-gyp
gyp/test/escaping/gyptest-colon.py
58
1416
#!/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. """ Tests that filenames that contain colons are handled correctly. (This is important for absolute paths on Windows.) """ import os import...
mit
imallett/MOSS
source/x86/_run_virtualbox.py
1
1253
import os from subprocess import call from scripts import _paths def main(): ## #VirtualBox has a weird thing where it crashes if the UUID of the new hard drive is not what it expects. ## #The line in _install_vb makes the UUID all zeros, apparently, but we can fix that by removing the disk ## #and...
mit
calvingit21/h2o-2
py/testdir_multi_jvm/test_parse_bounds_csv_fvec.py
9
8883
import unittest import random, sys, time, os, math sys.path.extend(['.','..','../..','py']) import h2o, h2o_cmd, h2o_browse as h2b, h2o_import as h2i DO_MEAN = False DO_NAN = False def write_syn_dataset(csvPathname, rowCount, colCount, SEED): r1 = random.Random(SEED) dsf = open(csvPathname, "w+") # write ...
apache-2.0
RyanYoung25/tensorflow
tensorflow/g3doc/how_tos/adding_an_op/zero_out_op_1.py
16
1041
# Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
apache-2.0
3dfxmadscientist/CBSS
addons/analytic_contract_hr_expense/analytic_contract_hr_expense.py
47
7877
# -*- 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
RevolutionMC/Revolution
plugin.video.PsychoTV/resources/lib/resolvers/movpod.py
23
1399
# -*- coding: utf-8 -*- ''' Specto Add-on Copyright (C) 2015 lambda 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 l...
gpl-2.0
hrashk/sympy
sympy/core/tests/test_arit.py
3
45950
from __future__ import division from sympy import (Symbol, sin, cos, exp, sqrt, Rational, Float, re, pi, sympify, Add, Mul, Pow, Mod, I, log, S, Max, Or, symbols, oo, Integer, sign, im ) from sympy.core.compatibility import long from sympy.utilities.pytest import XFAIL, raises from sympy.utilities.rand...
bsd-3-clause
rachitrawat/Vengeance-Kernel-MSM7x27-Nanhu
tools/perf/scripts/python/sctop.py
11180
1924
# 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
OpenOil-UG/aleph
aleph/model/role.py
1
4430
from uuid import uuid4 from flask import current_app from aleph.core import db, url_for from aleph.notify import send_welcome_mail from aleph.model.schema_model import SchemaModel from aleph.model.common import SoftDeleteModel, IdModel from passlib.apps import custom_app_context as pwd_context class Role(db.Model, I...
mit
BastiTee/robota
bptbx/b_daemon.py
1
1434
r"""This module contains an extendable daemon implementation.""" import logging from threading import Lock, Thread from time import sleep class Daemon: interval = 30.0 stopped = False lock = Lock() daemon_locked = False main_thread = None def __init__(self, interval): self.interval =...
gpl-3.0
marcuskelly/recover
Lib/site-packages/setuptools/command/build_ext.py
130
13026
import os import sys import itertools import imp from distutils.command.build_ext import build_ext as _du_build_ext from distutils.file_util import copy_file from distutils.ccompiler import new_compiler from distutils.sysconfig import customize_compiler, get_config_var from distutils.errors import DistutilsError from d...
bsd-2-clause
SIFTeam/enigma2
lib/python/Components/TunerInfo.py
20
4240
from GUIComponent import GUIComponent from enigma import eLabel, eSlider, iFrontendInformation from math import log class TunerInfo(GUIComponent): SNR = 0 AGC = 1 BER = 2 LOCK = 3 SNR_PERCENTAGE = 0 SNR_DB = 1 AGC_PERCENTAGE = 2 BER_VALUE = 3 SNR_BAR = 4 AGC_BAR = 5 BER_BAR = 6 LOCK_STATE = 7 SYNC_STATE...
gpl-2.0
crdoconnor/pexpect
tests/test_pxssh.py
20
1555
#!/usr/bin/env python import os import unittest from pexpect import pxssh class SSHTestBase(unittest.TestCase): def setUp(self): self.orig_path = os.environ.get('PATH') fakessh_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), 'fakessh')) os.environ['PATH'] = fakessh_dir + \ ...
isc
ikoula/cloudstack
test/integration/component/test_browse_templates2.py
3
7378
# 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...
gpl-2.0
Sweetgrassbuffalo/ReactionSweeGrass-v2
.meteor/local/dev_bundle/python/Lib/site-packages/pip/_vendor/requests/packages/chardet/universaldetector.py
1776
6840
######################## 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...
gpl-3.0
ric2b/Vivaldi-browser
chromium/tools/clang/scripts/build_clang_tools_extra.py
1
2834
#!/usr/bin/env python # Copyright 2019 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """A script for fetching LLVM monorepo and building clang-tools-extra binaries. Example: build clangd and clangd-indexer tools/clan...
bsd-3-clause
georgefrank/ansible-modules-extras
system/puppet.py
51
6731
#!/usr/bin/python # Copyright (c) 2015 Hewlett-Packard Development Company, L.P. # # This module 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 late...
gpl-3.0
Neozaru/depot_tools
third_party/gsutil/gslib/commands/chacl.py
50
19415
# Copyright 2013 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
bsd-3-clause
le9i0nx/ansible
lib/ansible/modules/monitoring/sensu_handler.py
49
9609
#!/usr/bin/python # (c) 2017, Red Hat Inc. # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
gpl-3.0
home-assistant/home-assistant
homeassistant/components/nest/device_info.py
2
2046
"""Library for extracting device specific information common to entities.""" from google_nest_sdm.device import Device from google_nest_sdm.device_traits import InfoTrait from .const import DOMAIN DEVICE_TYPE_MAP = { "sdm.devices.types.CAMERA": "Camera", "sdm.devices.types.DISPLAY": "Display", "sdm.devic...
apache-2.0
openhdf/enigma2-wetek
lib/python/Components/PluginList.py
24
2717
from MenuList import MenuList from Tools.Directories import resolveFilename, SCOPE_ACTIVE_SKIN from Components.MultiContent import MultiContentEntryText, MultiContentEntryPixmapAlphaBlend from enigma import eListboxPythonMultiContent, gFont, BT_SCALE, BT_KEEP_ASPECT_RATIO from Tools.LoadPixmap import LoadPixmap impor...
gpl-2.0
mayfield/ecmcli
ecmcli/commands/accounts.py
1
10177
""" Manage ECM Accounts. """ import collections import shellish from . import base class Formatter(object): terse_table_fields = ( (lambda x: x['name'], 'Name'), (lambda x: x['id'], 'ID'), (lambda x: len(x['groups']), 'Groups'), (lambda x: x['customer']['customer_name'], 'Custome...
mit
arjun372/namebench
nb_third_party/jinja2/utils.py
189
26319
# -*- coding: utf-8 -*- """ jinja2.utils ~~~~~~~~~~~~ Utility functions. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ import re import sys import errno try: from thread import allocate_lock except ImportError: from dummy_thread import allocate_lo...
apache-2.0
adishjain/youtube-dl
devscripts/generate_aes_testdata.py
129
1136
from __future__ import unicode_literals import codecs import subprocess import os import sys sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from youtube_dl.utils import intlist_to_bytes from youtube_dl.aes import aes_encrypt, key_expansion secret_msg = b'Secret message goes here' ...
unlicense
ChanduERP/odoo
addons/membership/wizard/__init__.py
432
1071
# -*- 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
eduardostalinho/django-shop
shop/views/cart.py
1
5691
# -*- coding: utf-8 -*- from django.core.urlresolvers import reverse from django.http import HttpResponse, HttpResponseRedirect from shop.models.cartmodel import CartItem from shop.models.productmodel import Product from shop.util.cart import get_or_create_cart from shop.views import ShopView, ShopTemplateResponseMixin...
bsd-3-clause
eaplatanios/tensorflow
tensorflow/python/ops/distributions/util.py
1
51400
# 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
larsoner/mne-python
mne/tests/test_import_nesting.py
6
1371
# Author: Eric Larson <larson.eric.d@gmail.com> # # License: BSD (3-clause) import sys from mne.utils import run_subprocess run_script = """ import sys import mne out = set() # check scipy ok_scipy_submodules = set(['scipy', 'numpy', # these appear in old scipy 'fftpack', 'lib', 'linalg...
bsd-3-clause
Byron/bcore
src/python/bsemantic/inference.py
1
14791
#-*-coding:utf-8-*- """ @package from bsemantic.inference @brief Module with implementations for ElementNodeList inference. These algrithms allow to infer the NodeList and its data used to create a previously generated name, based on sample ruleset. @author Sebastian Thiel @copyright [GNU Lesser General Public Licens...
lgpl-3.0
sahitya-pavurala/luigi
test/contrib/spark_test.py
43
11040
# -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify AB # # 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...
apache-2.0
gsathya/arm
src/cli/connections/descriptorPopup.py
3
7832
""" Popup providing the raw descriptor and consensus information for a relay. """ import math import curses import cli.popups import cli.connections.connEntry from util import panel, torTools, uiTools # field keywords used to identify areas for coloring LINE_NUM_COLOR = "yellow" HEADER_COLOR = "cyan" HEADER_PREFIX ...
gpl-3.0
ResearchSoftwareInstitute/MyHPOM
myhpom/tests/test_profile_edit_user_details_form.py
1
2696
from django.test import TestCase from myhpom.tests.factories import UserFactory from myhpom.forms.profile import EditUserDetailsForm from myhpom.models import State from myhpom.models.user_details import GENDER_CHOICES from datetime import date class EditProfileUserDetailsFormTestCase(TestCase): """ * nothing...
bsd-3-clause
rhlrjv/HBaseboard
tests/hbase_wrapper_unit_test.py
2
2077
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Unit Tests for `hbase_wraqpper` module. """ from mock import Mock import pytest from HBaseBoard.hbase_wrapper import HBaseWrapper @pytest.fixture(autouse=True) def no_requests(monkeypatch): monkeypatch.setattr("happybase.Connection", Mock()) @pytest.mark.unitt...
bsd-3-clause
online-behaviour/find-journalists
tweets2hours.py
1
2022
#!/usr/bin/python -W all """ tweets2hours: store tweets from stdin to hourly files usage: tweets2hours < file 20170404 erikt(at)xs4all.nl """ import time import json import re import sys # constants COMMAND = sys.argv[0] # hours to subtract/add to get real time from GMT in tweets DELTAHOURS = 2 # list wit...
apache-2.0
eerorika/ansible
lib/ansible/module_utils/known_hosts.py
1
7490
# 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
stevekuznetsov/ansible
lib/ansible/modules/remote_management/ipmi/ipmi_power.py
18
3967
#!/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
mrkm4ntr/incubator-airflow
tests/providers/google/cloud/operators/test_bigquery_system.py
10
2537
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
apache-2.0
ama-jharrison/agdc
agdc/api/source/test/python/datacube/api/workflow/cell_dataset_band_test.py
1
4164
#!/usr/bin/env python # =============================================================================== # Copyright 2015 Geoscience Australia # # 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 ...
apache-2.0
apanda/phantomjs-intercept
src/breakpad/src/third_party/protobuf/protobuf/python/google/protobuf/internal/text_format_test.py
252
22615
#! /usr/bin/python # # Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # http://code.google.com/p/protobuf/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # ...
bsd-3-clause
diydrones/MissionPlanner
ExtLibs/Mavlink/pymavlink/generator/mavparse.py
3
23204
#!/usr/bin/env python ''' mavlink python parse functions Copyright Andrew Tridgell 2011 Released under GNU GPL version 3 or later ''' from __future__ import print_function from builtins import range from builtins import object import errno import operator import os import sys import time import xml.parsers.expat PRO...
gpl-3.0
ganeshgore/myremolab
server/src/weblab/core/coordinator/redis/externals/ilab_batch_scheduler.py
3
7529
#!/usr/bin/env python #-*-*- encoding: utf-8 -*-*- # # Copyright (C) 2005 onwards University of Deusto # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. # # This software consists of contributions made by many individual...
bsd-2-clause
rismalrv/edx-platform
lms/djangoapps/foldit/tests.py
104
14019
"""Tests for the FoldIt module""" import json import logging from functools import partial from django.test import TestCase from django.test.client import RequestFactory from django.core.urlresolvers import reverse from foldit.views import foldit_ops, verify_code from foldit.models import PuzzleComplete, Score from s...
agpl-3.0
blacklin/kbengine
kbe/src/lib/python/Lib/test/test_enum.py
60
56713
import enum import inspect import pydoc import unittest from collections import OrderedDict from enum import Enum, IntEnum, EnumMeta, unique from io import StringIO from pickle import dumps, loads, PicklingError, HIGHEST_PROTOCOL # for pickle tests try: class Stooges(Enum): LARRY = 1 CURLY = 2 ...
lgpl-3.0
emper0r/IVAO-status
modules/SQL_queries.py
1
16568
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2011 by Antonio (emper0r) Peña Diaz <emperor.cu@gmail.com> # # GNU General Public Licence (GPL) # # 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 # Fo...
gpl-3.0
ThiagoGarciaAlves/intellij-community
python/helpers/pydev/pydevd_plugins/extensions/types/pydevd_plugin_numpy_types.py
9
2969
from _pydevd_bundle.pydevd_extension_api import TypeResolveProvider from _pydevd_bundle.pydevd_resolver import defaultResolver, MAX_ITEMS_TO_HANDLE, TOO_LARGE_ATTR, TOO_LARGE_MSG from .pydevd_helpers import find_mod_attr # ===============================================================================================...
apache-2.0
mybios/angle
src/tests/deqp_support/generate_case_lists.py
4
1684
#!/usr/bin/python # # Copyright 2015 The ANGLE Project Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # # generate_case_lists.py: # Helper script for updating the dEQP case list files, stored in the repo. # Generally only used when...
bsd-3-clause
shekkbuilder/CapTipper
storage/Cuckoo Analysis Package/pcap.py
7
5329
# # CapTipper is a malicious HTTP traffic explorer tool # By Omri Herscovici <omriher AT gmail.com> # http://omriher.com # @omriher # # This file is part of CapTipper # # CapTipper is a free software under the GPLv3 License # # This file belongs to the C...
gpl-3.0
shaufi/odoo
addons/base_report_designer/plugin/openerp_report_designer/bin/script/Expression.py
384
4146
######################################################################### # # Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com # Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>). # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser Gene...
agpl-3.0
bincentvaret/bsd-cloudinit
cloudbaseinit/osutils/freebsd.py
3
6903
from cloudbaseinit.osutils import base from subprocess import CalledProcessError import subprocess import datetime import os import os.path class FreeBSDUtils(base.BaseOSUtils): def reboot(self): if ( os.system('reboot') != 0 ): raise Exception('Reboot failed') def user_exists(self, usern...
apache-2.0
felixfontein/ansible
lib/ansible/module_utils/service.py
35
9153
# 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
sinharrajesh/dbtools
twitter-analysis/examples/shorten_url.py
6
4894
#!/usr/bin/env python # Copyright 2007-2016 The Python-Twitter Developers # 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 a...
apache-2.0
FlorianLudwig/odoo
doc/_extensions/odoo/translator.py
207
26718
# -*- coding: utf-8 -*- import os.path import posixpath import re import urllib from docutils import nodes from sphinx import addnodes, util from sphinx.locale import admonitionlabels def _parents(node): while node.parent: node = node.parent yield node class BootstrapTranslator(nodes.NodeVisitor...
agpl-3.0
to-bee/members_python
web/api/admin.py
1
13083
from django import forms from django.contrib import admin from django.db.models import Q from actions.admin import MemberNotifierMixin from api.forms import PostAdminForm from api.models import Task, Org, Type, Category, Migration, User, TYPES admin.site.register(Task) admin.site.register(Type) @admin.register(Migra...
lgpl-3.0