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 |
|---|---|---|---|---|---|
amaivsimau/electrum-ltc | lib/util.py | 1 | 6321 | import os, sys, re, json
import platform
import shutil
from datetime import datetime
is_verbose = False
class MyEncoder(json.JSONEncoder):
def default(self, obj):
from transaction import Transaction
if isinstance(obj, Transaction):
return obj.as_dict()
return super(MyEncoder, s... | gpl-3.0 |
prolativ/IoBlocks | public/lib/blockly/i18n/common.py | 204 | 7619 | #!/usr/bin/python
# Code shared by translation conversion scripts.
#
# Copyright 2013 Google Inc.
# https://developers.google.com/blockly/
#
# 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
#
#... | mit |
amperka/ino | ino/commands/upload.py | 15 | 4956 | # -*- coding: utf-8; -*-
from __future__ import absolute_import
import os.path
import subprocess
import platform
from time import sleep
from serial import Serial
from serial.serialutil import SerialException
from ino.commands.base import Command
from ino.exc import Abort
class Upload(Command):
"""
Upload ... | mit |
nekulin/arangodb | 3rdParty/V8-4.3.61/third_party/python_26/Lib/test/test_grammar.py | 56 | 30479 | # Python test set -- part 1, grammar.
# This just tests whether the parser accepts them all.
# NOTE: When you run this test as a script from the command line, you
# get warnings about certain hex/oct constants. Since those are
# issued by the parser, you can't suppress them by adding a
# filterwarnings() call to this... | apache-2.0 |
amwelch/a10sdk-python | a10sdk/core/slb/slb_template_ftp.py | 2 | 1949 | from a10sdk.common.A10BaseClass import A10BaseClass
class Ftp(A10BaseClass):
"""Class Description::
FTP template.
Class ftp supports CRUD Operations and inherits from `common/A10BaseClass`.
This class is the `"PARENT"` class for this module.`
:param uuid: {"description": "uuid of the object... | apache-2.0 |
franckverrot/live-note | waveapi/util_test.py | 4 | 4847 | #!/usr/bin/python
#
# Copyright (C) 2009 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | gpl-3.0 |
jumpstarter-io/neutron | neutron/tests/unit/ml2/test_type_flat.py | 17 | 4889 | # Copyright (c) 2014 Thales Services SAS
# 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 r... | apache-2.0 |
apache/airflow | scripts/ci/pre_commit/pre_commit_check_provider_yaml_files.py | 3 | 14227 | #!/usr/bin/env python3
# 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
# "L... | apache-2.0 |
keo/bitcoin | qa/rpc-tests/mempool_resurrect_test.py | 2 | 3417 | #!/usr/bin/env python2
# Copyright (c) 2014-2015 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test resurrection of mined transactions when
# the blockchain is re-organized.
#
from test_framework... | mit |
mclaughlin6464/pylearn2 | pylearn2/sandbox/cuda_convnet/filter_acts.py | 46 | 13967 | """
A theano / pylearn2 wrapper for cuda-convnet's convFilterActs function.
"""
__authors__ = "Ian Goodfellow"
__copyright__ = "Copyright 2010-2012, Universite de Montreal"
__credits__ = ["Ian Goodfellow", "David Warde-Farley"]
__license__ = "3-clause BSD"
__maintainer__ = "LISA Lab"
__email__ = "pylearn-dev@googlegrou... | bsd-3-clause |
Scille/parsec-cloud | tests/open_tcp_stream_mock_wrapper.py | 1 | 3874 | # Parsec Cloud (https://parsec.cloud) Copyright (c) AGPLv3 2016-2021 Scille SAS
from contextlib import contextmanager
from unittest.mock import patch
import inspect
import trio
from parsec.core.types import BackendAddr
def addr_to_netloc(addr):
assert isinstance(addr, BackendAddr)
return f"{addr.hostname}:{... | agpl-3.0 |
titansgroup/python-phonenumbers | python/phonenumbers/data/region_BL.py | 11 | 1517 | """Auto-generated file, do not edit by hand. BL metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_BL = PhoneMetadata(id='BL', country_code=590, international_prefix='00',
general_desc=PhoneNumberDesc(national_number_pattern='[56]\\d{8}', possible_number_pattern='\\... | apache-2.0 |
vmora/QGIS | python/plugins/db_manager/db_plugins/connector.py | 6 | 7594 | # -*- coding: utf-8 -*-
"""
/***************************************************************************
Name : DB Manager
Description : Database manager plugin for QGIS
Date : May 23, 2011
copyright : (C) 2011 by Giuseppe Sucameli
email : brush.tyler@... | gpl-2.0 |
yindaz/pbrs | mitsuba-af602c6fd98a/data/scons/qt4.py | 2 | 16795 |
"""SCons.Tool.qt
Tool-specific initialization for Qt.
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 The SCons Foundation
#
# Permission is hereby... | mit |
bev-a-tron/pledge_service | build/mailchimp/requests/packages/urllib3/filepost.py | 551 | 2512 | # urllib3/filepost.py
# Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt)
#
# This module is part of urllib3 and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
import codecs
import mimetypes
from uuid import uuid4
from io import BytesIO
from .packages ... | apache-2.0 |
codebhendi/alfred-bot | test_data_record.py | 1 | 1024 | import pyaudio
import wave
import time
from os import path
CHUNK = 1024
FORMAT = pyaudio.paInt16
CHANNELS = 1
RATE = 16000
RECORD_SECONDS = 3
WAVE_OUTPUT_FILENAME = ".wav"
count = 1
modeldir = "off_data"
while (count <= 100):
p = pyaudio.PyAudio()
stream = p.open(format=FORMAT,
channels=C... | mit |
leighpauls/k2cro4 | third_party/WebKit/Tools/Scripts/webkitpy/common/checkout/diff_parser_unittest.py | 1 | 4770 | # Copyright (C) 2009 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | bsd-3-clause |
junhuac/MQUIC | src/tools/perf/third_party/davclient/davclient.py | 161 | 12281 | # Copyright (c) 2006-2007 Open Source Applications Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | mit |
harlequin/sickbeard | lib/hachoir_parser/video/fourcc.py | 186 | 13511 | #
# fourcc are codes to specify the encoding method a audio or video string
# in RIFF file (.avi and .wav).
#
# The following lists come from mmpython project:
# file: mmpython/video/fourcc.py
# url: http://sourceforge.net/projects/mmpython/
#
# List of codecs with no compression (compression rate=1.0)
UNCOMPRE... | gpl-3.0 |
mementum/backtrader | tests/test_ind_emaosc.py | 1 | 1612 | #!/usr/bin/env python
# -*- coding: utf-8; py-indent-offset:4 -*-
###############################################################################
#
# Copyright (C) 2015-2020 Daniel Rodriguez
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License a... | gpl-3.0 |
spirrello/spirrello-pynet-work | applied_python/lib/python2.7/site-packages/pygal/table.py | 2 | 5885 | # -*- coding: utf-8 -*-
# This file is part of pygal
#
# A python svg graph plotting library
# Copyright © 2012-2015 Kozea
#
# This library is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the Free
# Software Foundation, either version... | gpl-3.0 |
heatonjb/hc | hc/config/wsgi.py | 53 | 1464 | """
WSGI config for project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` setting... | bsd-3-clause |
bowlofstew/Impala | tests/custom_cluster/test_session_expiration.py | 15 | 2377 | # Copyright (c) 2012 Cloudera, 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 o... | apache-2.0 |
JoeWoo/grpc | src/python/grpcio/grpc/_adapter/_types.py | 14 | 12178 | # 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 |
awatts/boto | boto/codedeploy/__init__.py | 113 | 1663 | # Copyright (c) 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights ... | mit |
bop/hybrid | lib/python2.6/site-packages/pip/vendor/html5lib/treebuilders/etree.py | 79 | 12620 | from __future__ import absolute_import, division, unicode_literals
from pip.vendor.six import text_type
import re
from . import _base
from .. import ihatexml
from .. import constants
from ..constants import namespaces
from ..utils import moduleFactoryFactory
tag_regexp = re.compile("{([^}]*)}(.*)")
def getETreeBui... | gpl-2.0 |
makinacorpus/pygal | pygal/graph/graph.py | 2 | 19039 | # -*- coding: utf-8 -*-
# This file is part of pygal
#
# A python svg graph plotting library
# Copyright © 2012-2014 Kozea
#
# This library is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the Free
# Software Foundation, either version... | lgpl-3.0 |
georgecpr/openthread | tools/harness-automation/cases/router_5_7_1.py | 16 | 1875 | #!/usr/bin/env python
#
# Copyright (c) 2016, The OpenThread Authors.
# 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 copyright
# notic... | bsd-3-clause |
ofer43211/unisubs | apps/externalsites/migrations/0010_create_openid_connect_link.py | 4 | 29919 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'OpenIDConnectLink'
db.create_table('externalsites_openidconnectlink', (
('sub', ... | agpl-3.0 |
punitvanjani/test1 | api/v1/endpoint_status.py | 1 | 1593 | from flask import request, jsonify, g
from ..models import db, Hub, hub_schema, EndpointStatus, endpoint_status_schema, endpoint_status_schemas
from . import api
from datetime import datetime
from ..auth import auth
from ..decorators import hub_active
# from ..common import unique_endpoint, endpoint_validation
from ..e... | mit |
ahb0327/intellij-community | python/helpers/pydev/pydevd_attach_to_process/winappdbg/process.py | 100 | 183637 | #!~/.wine/drive_c/Python25/python.exe
# -*- coding: utf-8 -*-
# Copyright (c) 2009-2014, Mario Vilas
# 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 ... | apache-2.0 |
kenshay/ImageScripter | ProgramData/SystemFiles/Python/Lib/site-packages/OpenGL/raw/GL/ARB/matrix_palette.py | 9 | 1708 | '''Autogenerated by xml_generate script, do not edit!'''
from OpenGL import platform as _p, arrays
# Code generation uses this
from OpenGL.raw.GL import _types as _cs
# End users want this...
from OpenGL.raw.GL._types import *
from OpenGL.raw.GL import _errors
from OpenGL.constant import Constant as _C
import ctypes
_... | gpl-3.0 |
kadjarT/android_kernel_samsung_cs02 | tools/perf/scripts/python/net_dropmonitor.py | 4235 | 1554 | # Monitor the system for dropped packets and proudce a report of drop locations and counts
import os
import sys
sys.path.append(os.environ['PERF_EXEC_PATH'] + \
'/scripts/python/Perf-Trace-Util/lib/Perf/Trace')
from perf_trace_context import *
from Core import *
from Util import *
drop_log = {}
kallsyms = []
def... | gpl-2.0 |
suminb/tldr-web | web/main/__init__.py | 1 | 3185 | import json
import os
from flask import Blueprint, render_template, request
import requests
from werkzeug.exceptions import BadRequest
main_module = Blueprint('main', __name__, template_folder='templates')
@main_module.route('/', methods=['GET', 'POST'])
def text():
text = request.form.get('text')
sample =... | bsd-3-clause |
rwatson/chromium-capsicum | third_party/tlslite/tlslite/utils/cryptomath.py | 172 | 11559 | """cryptomath module
This module has basic math/crypto code."""
import os
import math
import base64
import binascii
import sha
from compat import *
# **************************************************************************
# Load Optional Modules
# ****************************************************************... | bsd-3-clause |
muntaza/Open_Persediaan | persediaan5/setwan/admin.py | 1 | 4483 | from django.contrib import admin
from kabupaten.models import Provinsi, Kabupaten, LokasiBidang, SKPD, SUBSKPD, JenisBarang
from kabupaten.models import Satuan, Barang, JenisTransaksi, StatusPegawai, Pegawai, PihakKetiga
from kabupaten.models import Transaksi, Persediaan, Keluar, Masuk, PersediaanMasuk, PersediaanKelu... | bsd-2-clause |
MyKings/xunfeng | vulscan/vuldb/smb/SMBProtocol.py | 3 | 23465 |
import os, logging, time
from twisted.internet import reactor, defer
from twisted.internet.protocol import ClientFactory, Protocol
from smb_constants import *
from smb_structs import *
from base import SMB, NotConnectedError, NotReadyError, SMBTimeout
__all__ = [ 'SMBProtocolFactory', 'NotConnectedError', 'NotReadyE... | gpl-3.0 |
mattcaldwell/pip | pip/_vendor/distlib/util.py | 190 | 51230 | #
# Copyright (C) 2012-2013 The Python Software Foundation.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
import codecs
from collections import deque
import contextlib
import csv
from glob import iglob as std_iglob
import io
import json
import logging
import os
import py_compile
import re
import shutil
import socket
import... | mit |
meizuosc/m75 | mediatek/build/tools/FindDummyRes.py | 29 | 5093 | #!/usr/bin/python
import sys,os
import re
import getopt
import subprocess
from subprocess import *
from optparse import OptionParser
from os.path import join, getsize
def build_search_list(folder):
list = []
for src in os.listdir(folder):
srcpath = os.path.join(folder,src)
for root, dirs, files... | gpl-2.0 |
ankur-gupta91/horizon-net-ip | horizon/test/test_dashboards/dogs/puppies/tables.py | 20 | 1617 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | apache-2.0 |
keisuke-umezawa/chainer | chainermn/extensions/allreduce_persistent.py | 2 | 1615 | import chainer
import chainer.training.extension
def _namedpersistents(model):
assert isinstance(model, chainer.Link)
for lname, link in model.namedlinks():
for pname in link._persistent:
yield lname + '/' + pname, link.__dict__[pname]
class AllreducePersistent(chainer.training.extensio... | mit |
ogenstad/ansible | lib/ansible/modules/windows/win_security_policy.py | 45 | 3678 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# this is a windows documentation stub, actual code lives in the .ps1
# file of the same name
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview']... | gpl-3.0 |
WSDC-NITWarangal/django | django/contrib/gis/db/backends/mysql/introspection.py | 700 | 1771 | from MySQLdb.constants import FIELD_TYPE
from django.contrib.gis.gdal import OGRGeomType
from django.db.backends.mysql.introspection import DatabaseIntrospection
class MySQLIntrospection(DatabaseIntrospection):
# Updating the data_types_reverse dictionary with the appropriate
# type for Geometry fields.
... | bsd-3-clause |
django-nonrel/django | django/contrib/gis/utils/layermapping.py | 109 | 26913 | # LayerMapping -- A Django Model/OGR Layer Mapping Utility
"""
The LayerMapping class provides a way to map the contents of OGR
vector files (e.g. SHP files) to Geographic-enabled Django models.
For more information, please consult the GeoDjango documentation:
http://geodjango.org/docs/layermapping.html
"""
impo... | bsd-3-clause |
byt3bl33d3r/CrackMapExec | cme/modules/get_netdomaincontroller.py | 2 | 3377 | from cme.helpers.powershell import *
from cme.helpers.logger import write_log, highlight
from datetime import datetime
from io import StringIO
class CMEModule:
name = 'get_netdomaincontroller'
description = "Enumerates all domain controllers"
supported_protocols = ['smb', 'mssql']
opsec_safe = True
... | bsd-2-clause |
boyuegame/kbengine | kbe/res/scripts/common/Lib/site-packages/pip/_vendor/requests/packages/urllib3/filepost.py | 551 | 2512 | # urllib3/filepost.py
# Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt)
#
# This module is part of urllib3 and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
import codecs
import mimetypes
from uuid import uuid4
from io import BytesIO
from .packages ... | lgpl-3.0 |
bentley-historical-library/migration-tools | ead/agents/no_source_report.py | 2 | 1524 | '''
first things first, import what we need'''
# lxml is a powerful xml document parser, you'll need to download it
from lxml import etree
# os provides a portable way of using operating system dependent functionality
import os
from os.path import join
'''
setup'''
# where are the eads?
ead_folder = 'C:/Users/ecka... | cc0-1.0 |
guanxin0206/dice_crawler | dice/dice_Xin.py | 1 | 1078 | #!/usr/bin/env python -tt
# -*- coding: iso-8859-15 -*-
import requests,urllib,re,math,datetime,sys
from bs4 import BeautifulSoup
import argparse
input_keyword_file = "input.txt"
#with open(input_keyword_file) as f:
#试试中文
def main():
parser = argparse.ArgumentParser(description='Xin\'s dice.com crawler')
parser.... | bsd-2-clause |
ligyxy/DictMySQL | setup.py | 2 | 1310 | #!/usr/bin/python
# -*-coding: utf-8 -*-
from setuptools import setup
from os import path
here = path.abspath(path.dirname(__file__))
with open('README.rst') as f:
long_description = f.read()
setup(name='dictmysql',
version='0.6.8',
description='A MySQL class for more convenient database manipulat... | mit |
andmos/ansible | test/units/modules/network/edgeos/test_edgeos_command.py | 68 | 4241 | # (c) 2018 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 dis... | gpl-3.0 |
wangyou/XX-Net | code/default/python27/1.0/lib/uu.py | 251 | 6555 | #! /usr/bin/env python
# Copyright 1994 by Lance Ellinghouse
# Cathedral City, California Republic, United States of America.
# All Rights Reserved
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# provide... | bsd-2-clause |
balanced/PyXB | tests/trac/test-trac-0046.py | 5 | 1096 | # -*- coding: utf-8 -*-
import logging
if __name__ == '__main__':
logging.basicConfig()
_log = logging.getLogger(__name__)
import pyxb.binding.generate
import pyxb.binding.datatypes as xs
import pyxb.binding.basis
import pyxb.utils.domutils
import os.path
schema_path = os.path.abspath(os.path.join(os.path.dirname(... | apache-2.0 |
Paczesiowa/youtube-dl | youtube_dl/extractor/ndr.py | 74 | 4573 | # encoding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
ExtractorError,
int_or_none,
qualities,
parse_duration,
)
class NDRBaseIE(InfoExtractor):
def _real_extract(self, url):
mobj = re.match(self._VALID_URL, url)
... | unlicense |
rhelmer/socorro-lib | socorro/cron/jobs/serverstatus.py | 10 | 3681 | #!/usr/bin/python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
"""
This job populates the server_status table for RabbitMQ and processors.
The following fields are ... | mpl-2.0 |
benthomasson/behave | setuptools_behave.py | 15 | 4832 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Setuptools command for behave.
.. code-block:: console
python setup.py behave_test
python setup.py behave_test --format=progress3
python setup.py behave_test --args=features/one.feature
python setup.py behave_test --tags=-xfail --args=features
.. seea... | bsd-2-clause |
cselis86/edx-platform | common/test/acceptance/pages/lms/progress.py | 182 | 3827 | """
Student progress page
"""
from .course_page import CoursePage
class ProgressPage(CoursePage):
"""
Student progress page.
"""
url_path = "progress"
def is_browser_on_page(self):
is_present = (
self.q(css='div.course-info').present and
self.q(css='div#grade-deta... | agpl-3.0 |
snnn/tensorflow | tensorflow/python/debug/cli/readline_ui.py | 62 | 4152 | # 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 |
Widiot/simpleblog | venv/lib/python3.5/site-packages/wheel/archive.py | 62 | 2376 | """
Archive tools for wheel.
"""
import os
import os.path
import time
import zipfile
from distutils import log
def archive_wheelfile(base_name, base_dir):
"""Archive all files under `base_dir` in a whl file and name it like
`base_name`.
"""
olddir = os.path.abspath(os.curdir)
base_name = os.path.... | mit |
Akshay0724/scikit-learn | examples/linear_model/lasso_dense_vs_sparse_data.py | 348 | 1862 | """
==============================
Lasso on dense and sparse data
==============================
We show that linear_model.Lasso provides the same results for dense and sparse
data and that in the case of sparse data the speed is improved.
"""
print(__doc__)
from time import time
from scipy import sparse
from scipy ... | bsd-3-clause |
plilja/adventofcode | 2020/day09/day09.py | 1 | 1109 | import sys
from collections import deque, Counter
def step1(nums):
q = deque()
counter = Counter()
for i, num in enumerate(nums):
if i >= 25:
good = False
for x in q:
rem = num - x
if rem == num:
if counter[rem] == 2:
... | gpl-3.0 |
mandx/pyrax | pyrax/__init__.py | 5 | 30185 | # -*- coding: utf-8 -*-
# Copyright (c)2012 Rackspace US, 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/LICE... | apache-2.0 |
cmvelo/ansible-modules-core | system/hostname.py | 52 | 17507 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Hiroaki Nakamura <hnakamur@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... | gpl-3.0 |
kmonsoor/python-for-android | python-build/python-libs/gdata/tests/module_test_runner.py | 132 | 2146 | #!/usr/bin/python
#
# Copyright (C) 2006 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | apache-2.0 |
robin-lai/scikit-learn | examples/svm/plot_custom_kernel.py | 171 | 1546 | """
======================
SVM with custom kernel
======================
Simple usage of Support Vector Machines to classify a sample. It will
plot the decision surface and the support vectors.
"""
print(__doc__)
import numpy as np
import matplotlib.pyplot as plt
from sklearn import svm, datasets
# import some data... | bsd-3-clause |
ai-ku/langvis | jython-2.1/Lib/multifile.py | 4 | 4932 | """A readline()-style interface to the parts of a multipart message.
The MultiFile class makes each part of a multipart message "feel" like
an ordinary file, as long as you use fp.readline(). Allows recursive
use, for nested multipart messages. Probably best used together
with module mimetools.
Suggested use... | mit |
varunarya10/tempest | tempest/api_schema/response/compute/v2_1/tenant_networks.py | 40 | 1471 | # Copyright 2015 NEC Corporation. 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 ... | apache-2.0 |
adlai/p2pool | p2pool/web.py | 61 | 25376 | from __future__ import division
import errno
import json
import os
import sys
import time
import traceback
from twisted.internet import defer, reactor
from twisted.python import log
from twisted.web import resource, static
import p2pool
from bitcoin import data as bitcoin_data
from . import data as p2pool_data, p2p
... | gpl-3.0 |
drpngx/tensorflow | tensorflow/examples/adding_an_op/cuda_op.py | 192 | 1062 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
frankvdp/django | tests/generic_views/urls.py | 22 | 13119 | from django.contrib.auth import views as auth_views
from django.contrib.auth.decorators import login_required
from django.urls import path, re_path
from django.views.decorators.cache import cache_page
from django.views.generic import TemplateView
from . import views
from .models import Book
urlpatterns = [
# Temp... | bsd-3-clause |
baylee/django | tests/custom_managers/tests.py | 8 | 24163 | from __future__ import unicode_literals
from django.db import models
from django.test import TestCase
from django.utils import six
from .models import (
Book, Car, CustomManager, CustomQuerySet, DeconstructibleCustomManager,
FastCarAsBase, FastCarAsDefault, FunPerson, OneToOneRestrictedModel,
Person, Pers... | bsd-3-clause |
openhatch/oh-mainline | vendor/packages/Pygments/pygments/lexers/asm.py | 71 | 13285 | # -*- coding: utf-8 -*-
"""
pygments.lexers.asm
~~~~~~~~~~~~~~~~~~~
Lexers for assembly languages.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, include, bygroups, using, DelegatingL... | agpl-3.0 |
SCOAP3/invenio | invenio/legacy/refextract/engine.py | 15 | 53609 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2014 CERN.
#
# Invenio is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of th... | gpl-2.0 |
rkq/cxxexp | third-party/src/thrift-0.9.1/test/py.tornado/test_suite.py | 10 | 6355 | #!/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. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "L... | mit |
ChanderG/scikit-learn | examples/linear_model/plot_omp.py | 385 | 2263 | """
===========================
Orthogonal Matching Pursuit
===========================
Using orthogonal matching pursuit for recovering a sparse signal from a noisy
measurement encoded with a dictionary
"""
print(__doc__)
import matplotlib.pyplot as plt
import numpy as np
from sklearn.linear_model import OrthogonalM... | bsd-3-clause |
ice9js/servo | tests/wpt/web-platform-tests/tools/webdriver/webdriver/client.py | 49 | 10870 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import urlparse
import transport
element_key = "element-6066-11e4-a52e-4f735466cecf"
def command(func):
def inn... | mpl-2.0 |
PXke/invenio | invenio/legacy/oairepository/scripts/oairepositoryupdater.py | 4 | 1121 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2009, 2010, 2011, 2013 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or ... | gpl-2.0 |
manojhirway/ExistingImagesOnNFS | cinder/tests/unit/test_hp3par.py | 7 | 243290 | #
# (c) Copyright 2013 Hewlett-Packard Development Company, L.P.
# 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/licens... | apache-2.0 |
niceban/django-command-extensions | django_extensions/management/commands/runjobs.py | 11 | 3479 | from django.core.management.base import LabelCommand
from optparse import make_option
from django_extensions.management.jobs import get_jobs, print_jobs
class Command(LabelCommand):
option_list = LabelCommand.option_list + (
make_option('--list', '-l', action="store_true", dest="list_jobs",
hel... | mit |
mfherbst/spack | var/spack/repos/builtin/packages/pango/package.py | 5 | 3196 | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 |
yiqingj/airflow | airflow/operators/mysql_to_hive.py | 39 | 4782 | # -*- coding: utf-8 -*-
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
... | apache-2.0 |
ikaee/bfr-attendant | facerecognitionlibrary/jni-build/jni/include/tensorflow/contrib/tensor_forest/data/data_ops.py | 7 | 7643 | # 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 |
CEG-FYP-OpenStack/scheduler | nova/objects/migration.py | 16 | 8501 | # Copyright 2013 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | apache-2.0 |
vibhorag/scikit-learn | examples/linear_model/plot_bayesian_ridge.py | 248 | 2588 | """
=========================
Bayesian Ridge Regression
=========================
Computes a Bayesian Ridge Regression on a synthetic dataset.
See :ref:`bayesian_ridge_regression` for more information on the regressor.
Compared to the OLS (ordinary least squares) estimator, the coefficient
weights are slightly shift... | bsd-3-clause |
ettm2012/MissionPlanner | Lib/site-packages/scipy/stats/rv.py | 58 | 1481 |
from numpy import vectorize
from numpy.random import random_sample
__all__ = ['randwppf', 'randwcdf']
# XXX: Are these needed anymore?
#####################################
# General purpose continuous
######################################
def randwppf(ppf, args=(), size=None):
"""returns an array of randomly... | gpl-3.0 |
ajdawson/numpy | numpy/lib/__init__.py | 114 | 1146 | from __future__ import division, absolute_import, print_function
import math
from .info import __doc__
from numpy.version import version as __version__
from .type_check import *
from .index_tricks import *
from .function_base import *
from .nanfunctions import *
from .shape_base import *
from .stride_tricks import *... | bsd-3-clause |
wangjun/docker-pinry | pinry/settings/__init__.py | 2 | 2611 | import os
from django.contrib.messages import constants as messages
SITE_ROOT = os.path.join(os.path.realpath(os.path.dirname(__file__)), '../../')
# Set to False to disable people from creating new accounts.
ALLOW_NEW_REGISTRATIONS = False
# Set to False to force users to login before seeing any pins.
PUBLIC = ... | bsd-2-clause |
x3omdax/penbox | src/Info.py | 1 | 6932 | #!/usr/bin/python3
#
# PenBox: A Penetration Testing Framework , The Hacker’s Repo
#
# [+] Coded BY Mohamed Nour & Fedy Wesleti [+]
# [+] FB/mohamed.zeus.0 ~~ FB/CEH.tN [+]
# [+] Improved by: Chiheb Nexus [+]
# [+] FB/chihebnexuss ... | mit |
DuCorey/bokeh | bokeh/util/serialization.py | 2 | 11282 | '''
Functions for helping with serialization and deserialization of
Bokeh objects.
Certain NunPy array dtypes can be serialized to a binary format for
performance and efficiency. The list of supported dtypes is:
{binary_array_types}
'''
from __future__ import absolute_import
import logging
log = logging.getLogger(_... | bsd-3-clause |
devananda/ironic | ironic/drivers/modules/oneview/common.py | 4 | 10910 | #
# Copyright 2015 Hewlett Packard Development Company, LP
# Copyright 2015 Universidade Federal de Campina Grande
#
# 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://... | apache-2.0 |
stratton-oakcoin/oakcoin | test/functional/wallet-hd.py | 1 | 4432 | #!/usr/bin/env python3
# Copyright (c) 2016 The Oakcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test Hierarchical Deterministic wallet function."""
from test_framework.test_framework import OakcoinTestFr... | mit |
shifter/rekall | rekall-core/rekall/plugins/windows/ssdt.py | 4 | 3557 | # Rekall Memory Forensics
# Copyright 2014 Google Inc. All Rights Reserved.
#
# Authors:
# Michael Cohen <scudette@gmail.com>
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of... | gpl-2.0 |
anbangleo/NlsdeWeb | Python-3.6.0/Lib/test/test_xml_etree.py | 1 | 112200 | # IMPORTANT: the same tests are run from "test_xml_etree_c" in order
# to ensure consistency between the C implementation and the Python
# implementation.
#
# For this purpose, the module-level "ET" symbol is temporarily
# monkey-patched when running the "test_xml_etree_c" test suite.
import copy
import html
import io... | mit |
kawasaki2013/python-for-android-x86 | python3-alpha/extra_modules/gdata/acl/data.py | 98 | 1893 | #!/usr/bin/python
#
# Copyright (C) 2009 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | apache-2.0 |
tempbottle/ironpython3 | Src/StdLib/Lib/lib2to3/fixes/fix_exitfunc.py | 140 | 2497 | """
Convert use of sys.exitfunc to use the atexit module.
"""
# Author: Benjamin Peterson
from lib2to3 import pytree, fixer_base
from lib2to3.fixer_util import Name, Attr, Call, Comma, Newline, syms
class FixExitfunc(fixer_base.BaseFix):
keep_line_order = True
BM_compatible = True
PATTERN = """
... | apache-2.0 |
rahulk98/fosswebsite | achievements/forms.py | 8 | 1620 | from django import forms
from .models import *
class ContestForm(forms.ModelForm):
contest_id = forms.IntegerField(label='Contest id', help_text='Enter your contest id',
widget=forms.NumberInput(attrs={'placeholder': 'Contest id'}))
title = forms.CharField(label='Contest n... | mit |
sszlm/MissionPlanner | Lib/ctypes/macholib/dylib.py | 59 | 2107 | ######################################################################
# This file should be kept compatible with Python 2.3, see PEP 291. #
######################################################################
"""
Generic dylib path manipulation
"""
import re
__all__ = ['dylib_info']
DYLIB_RE = re.comp... | gpl-3.0 |
cvast/arches | tests/test_settings.py | 1 | 2605 | '''
ARCHES - a program developed to inventory and manage immovable cultural heritage.
Copyright (C) 2013 J. Paul Getty Trust and World Monuments Fund
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Founda... | agpl-3.0 |
kevinastone/sentry | src/sentry/migrations/0060_fill_filter_key.py | 36 | 19256 | # -*- coding: utf-8 -*-
import 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: Remember to use orm['appname.ModelName'] rather than "from appname.mo... | bsd-3-clause |
stackforge/poppy | poppy/provider/cloudfront/driver.py | 2 | 2484 | # Copyright (c) 2014 Rackspace, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | apache-2.0 |
josephcslater/scipy | scipy/linalg/_interpolative_backend.py | 143 | 44935 | #******************************************************************************
# Copyright (C) 2013 Kenneth L. Ho
#
# 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 t... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.