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 |
|---|---|---|---|---|---|
desirable-objects/hotwire-shell | hotwire/builtins/cp.py | 3 | 2832 | # This file is part of the Hotwire Shell project API.
# Copyright (C) 2007 Colin Walters <walters@verbum.org>
# 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, includin... | gpl-2.0 |
spivachuk/sovrin-node | indy_client/test/agent/test_restore_agent_wallets_from_mgl.py | 2 | 2261 | import os
import shutil
from indy_client.agent.walleted_agent import WalletedAgent
from indy_client.anon_creds.indy_issuer import IndyIssuerWalletInMemory
from indy_client.anon_creds.indy_public_repo import IndyPublicRepo
from indy_client.client.wallet.wallet import Wallet
from indy_client.test.client.TestClient impor... | apache-2.0 |
40223114/2015cd_midterm | static/Brython3.1.0-20150301-090019/Lib/unittest/test/testmock/testmagicmethods.py | 737 | 12145 | import unittest
import inspect
import sys
from unittest.mock import Mock, MagicMock, _magics
class TestMockingMagicMethods(unittest.TestCase):
def test_deleting_magic_methods(self):
mock = Mock()
self.assertFalse(hasattr(mock, '__getitem__'))
mock.__getitem__ = Mock()
self.asser... | gpl-3.0 |
ligo-cbc/pycbc | pycbc/fft/cuda_pyfft.py | 14 | 2283 | # Copyright (C) 2012 Andrew Miller
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 3 of the License, or (at your
# option) any later version.
#
# This program is distributed in... | gpl-3.0 |
xrg/django-static-gitified | tests/modeltests/custom_managers/models.py | 125 | 1870 | """
23. Giving models a custom manager
You can use a custom ``Manager`` in a particular model by extending the base
``Manager`` class and instantiating your custom ``Manager`` in your model.
There are two reasons you might want to customize a ``Manager``: to add extra
``Manager`` methods, and/or to modify the initial... | bsd-3-clause |
idbedead/RNA-sequence-tools | qpcr.py | 2 | 4407 | import pandas as pd
from pprint import pprint
import itertools
import numpy as np
import os
import seaborn as sns
import matplotlib.pyplot as plt
qpcr_file ='/Users/idriver/Downloads/2016-04-19_ITGA8_1_6_7_8.txt'
qpcr_df = pd.DataFrame.from_csv(qpcr_file, sep= '\t')
samples = list(set(qpcr_df['Sample Name']))
targets... | mit |
ptoraskar/django | tests/model_inheritance/tests.py | 283 | 17419 | from __future__ import unicode_literals
from operator import attrgetter
from django.core.exceptions import FieldError, ValidationError
from django.core.management import call_command
from django.db import connection
from django.test import TestCase, TransactionTestCase
from django.test.utils import CaptureQueriesCont... | bsd-3-clause |
michaelaye/scikit-image | skimage/io/_plugins/skivi.py | 38 | 7886 | '''
Skivi is written/maintained/developed by:
S. Chris Colbert - sccolbert@gmail.com
Skivi is free software and is part of the scikit-image project.
Skivi is governed by the licenses of the scikit-image project.
Please report any bugs to the author.
The skivi module is not meant to be used directly.
Use skimage.i... | bsd-3-clause |
johnnycakes79/pyops | pyops/orbit.py | 1 | 2735 | """
This module processes mission analysis orbit files.
"""
import os
import logging
import numpy as np
from scipy import linalg
from spice import et2utc
from spice import furnsh
def orbitkernel(infile, outfile, cbody):
"""
Make an SPK from the Mission Analysis Orbit file.
"""
pass
def transform(f... | bsd-3-clause |
babycaseny/audacity | lib-src/lv2/lilv/waflib/Tools/xlcxx.py | 330 | 1222 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
from waflib.Tools import ccroot,ar
from waflib.Configure import conf
@conf
def find_xlcxx(conf):
cxx=conf.find_program(['xlc++_r','xlc++'],var='CXX')
cxx=conf.cmd_to_list(cx... | gpl-2.0 |
misli/cmsplugin-survey | setup.py | 1 | 1299 | # -*- coding: utf-8 -*-
from setuptools import setup, find_packages
setup(
name = 'cmsplugin-survey',
version = '1.3.0',
description = 'django CMS plugin to show simple surveys',
author = 'Jakub Dorňák',
author_email = 'jakub.dornak@misli.cz',
license ... | bsd-3-clause |
nanditav/15712-TensorFlow | tensorflow/python/kernel_tests/atrous_convolution_test.py | 13 | 8037 | # 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 |
yexihu/volatility | volatility/plugins/machoinfo.py | 58 | 1502 | # Volatility
# Copyright (C) 2009-2013 Volatility Foundation
#
# This file is part of Volatility.
#
# Volatility 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 o... | gpl-2.0 |
baloo/shinken | shinken/log.py | 1 | 3981 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2009-2011 :
# Gabes Jean, naparuba@gmail.com
# Gerhard Lausser, Gerhard.Lausser@consol.de
# Gregory Starck, g.starck@gmail.com
# Hartmut Goebel, h.goebel@goebel-consult.de
#
# This file is part of Shinken.
#
# Shinken is free software: you ... | agpl-3.0 |
jmighion/ansible | lib/ansible/module_utils/vyos.py | 14 | 4939 | # 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 |
youprofit/servo | tests/wpt/web-platform-tests/dom/nodes/Document-createElement-namespace-tests/generate.py | 226 | 2091 | #!/usr/bin/python
import os
import sys
THIS_NAME = "generate.py"
# Note: these lists must be kept in sync with the lists in
# Document-createElement-namespace.html, and this script must be run whenever
# the lists are updated. (We could keep the lists in a shared JSON file, but
# seems like too much effort.)
FILES =... | mpl-2.0 |
shail2810/nova | nova/tests/functional/api_sample_tests/test_networks_associate.py | 2 | 3389 | # Copyright 2012 Nebula, Inc.
# Copyright 2014 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... | apache-2.0 |
SchumyHao/rt-thread | bsp/dm365/rtconfig.py | 11 | 2124 | import os
# toolchains options
ARCH = 'arm'
CPU = 'dm36x'
TextBase = '0x80000000'
CROSS_TOOL = 'gcc'
if os.getenv('RTT_CC'):
CROSS_TOOL = os.getenv('RTT_CC')
if CROSS_TOOL == 'gcc':
PLATFORM = 'gcc'
#EXEC_PATH = '/opt/arm-2010q1/bin'
EXEC_PATH = r'D:\arm-2013.11\bin'
elif CROSS_TOOL == 'keil':
PLAT... | gpl-2.0 |
erdincay/pjsip-project | tests/pjsua/scripts-recvfrom/208_reg_good_retry_nonce_ok.py | 42 | 1029 | # $Id$
import inc_sip as sip
import inc_sdp as sdp
pjsua = "--null-audio --id=sip:CLIENT --registrar sip:127.0.0.1:$PORT " + \
"--realm=python --user=username --password=password " + \
"--auto-update-nat=0"
req1 = sip.RecvfromTransaction("Initial request", 401,
include=["REGISTER sip"],
exclude=["Authoriza... | gpl-2.0 |
ibmsoe/ImpalaPPC | shell/ext-py/sqlparse-0.1.14/tests/test_grouping.py | 21 | 13751 | # -*- coding: utf-8 -*-
import pytest
import sqlparse
from sqlparse import sql
from sqlparse import tokens as T
from tests.utils import TestCaseBase
class TestGrouping(TestCaseBase):
def test_parenthesis(self):
s = 'select (select (x3) x2) and (y2) bar'
parsed = sqlparse.parse(s)[0]
se... | apache-2.0 |
jteehan/cfme_tests | cfme/configure/access_control.py | 1 | 44483 | from navmazing import NavigateToSibling, NavigateToAttribute
from widgetastic_manageiq import UpDownSelect, SummaryFormItem
from widgetastic_patternfly import (
BootstrapSelect, Button, Input, Tab, CheckableBootstrapTreeview,
BootstrapSwitch, CandidateNotFound, Dropdown)
from widgetastic.utils import VersionPic... | gpl-2.0 |
rat4/p2pool-blackcoin | wstools/Namespaces.py | 292 | 9396 | # Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISC... | gpl-3.0 |
vicky2135/lucious | oscar/lib/python2.7/site-packages/django/conf/locale/de/formats.py | 504 | 1100 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j. F Y'
TIME_FORMAT = 'H:i'
DATET... | bsd-3-clause |
fentas/phantomjs | src/qt/qtwebkit/Tools/gtk/common.py | 116 | 4728 | #!/usr/bin/env python
# Copyright (C) 2011 Igalia S.L.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This... | bsd-3-clause |
mlarouche/LegacySPC | gmock/gtest/scripts/gen_gtest_pred_impl.py | 412 | 21984 | #!/usr/bin/env python
#
# Copyright 2006, 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... | gpl-2.0 |
bolkedebruin/airflow | airflow/providers/presto/operators/presto_check.py | 1 | 4784 | # -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... | apache-2.0 |
adrienbrault/home-assistant | tests/components/template/test_init.py | 2 | 8843 | """The test for the Template sensor platform."""
from datetime import timedelta
from os import path
from unittest.mock import patch
from homeassistant import config
from homeassistant.components.template import DOMAIN
from homeassistant.helpers.reload import SERVICE_RELOAD
from homeassistant.setup import async_setup_c... | mit |
dayatz/taiga-back | taiga/users/migrations/0002_auto_20140903_0916.py | 1 | 2206 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.contrib.postgres.fields
class Migration(migrations.Migration):
dependencies = [
('users', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Ro... | agpl-3.0 |
jorik041/pyspider | pyspider/libs/rabbitmq.py | 2 | 3945 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8:
# Author: Binux<17175297.hk@gmail.com>
# http://binux.me
# Created on 2012-11-15 17:27:54
import time
import umsgpack
import Queue as BaseQueue
import socket
import select
import threading
import pika
import pika.e... | apache-2.0 |
uclouvain/osis | base/models/student_specific_profile.py | 1 | 3504 | ##############################################################################
#
# OSIS stands for Open Student Information System. It's an application
# designed to manage the core business of higher education institutions,
# such as universities, faculties, institutes and professional schools.
# The core ... | agpl-3.0 |
omaralvarez/movit | frontend/models.py | 1 | 1186 | from __future__ import unicode_literals
from django.db import models
# Create your models here.
class TVShow(models.Model):
name = models.CharField(max_length=200)
episode_count = models.IntegerField(default=1)
trakt_id = models.SlugField(max_length=255, blank=True, null=True)
last_date = models.Date... | gpl-3.0 |
switchboardOp/ansible | lib/ansible/playbook/__init__.py | 30 | 4400 | # (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 |
zestrada/nova-cs498cc | nova/tests/compute/test_multiple_nodes.py | 4 | 7172 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2012 NTT DOCOMO, 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.apach... | apache-2.0 |
transitland/mapzen-gtfs | mzgtfs/frequency.py | 3 | 1712 | """GTFS Frequency."""
import datetime
import entity
import geom
import util
import widetime
import validation
class Frequency(entity.Entity):
REQUIRED = [
'trip_id',
'start_time',
'end_time',
'headway_secs'
]
OPTIONAL = [
'exact_times'
]
def start(self):
return widetime.WideTime.fro... | mit |
cxcsds/ciao-contrib | ciao_contrib/stacklib.py | 1 | 2340 |
# Python35Support
#
# Copyright (C) 2011, 2012, 2016, 2019 Smithsonian Astrophysical Observatory
#
#
# 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
# ... | gpl-3.0 |
t0mm0/youtube-dl | youtube_dl/extractor/moviezine.py | 164 | 1402 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import re
from .common import InfoExtractor
class MoviezineIE(InfoExtractor):
_VALID_URL = r'https?://www\.moviezine\.se/video/(?P<id>[^?#]+)'
_TEST = {
'url': 'http://www.moviezine.se/video/205866',
'info_dict': {
... | unlicense |
physion/ovation-neo-importer | ovation_neo/test_axon_mapping.py | 1 | 11705 | import logging
from neo import Event, EventArray, SpikeTrain
import numpy as np
import quantities as pq
from nose.tools import istest, assert_equals, assert_sequence_equal, assert_true
import neo.core.epoch
from neo.io import AxonIO
from ovation import DateTime, Maps
from ovation.conversion import iterable
from ovati... | gpl-3.0 |
Linux-Wii-Mod/linux-wii-2.6.32 | 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 |
pinterb/st2contrib | packs/twitter/sensors/twitter_search_sensor.py | 6 | 3371 | from TwitterSearch import TwitterSearch
from TwitterSearch import TwitterSearchOrder
from st2reactor.sensor.base import PollingSensor
__all__ = [
'TwitterSearchSensor'
]
BASE_URL = 'https://twitter.com'
class TwitterSearchSensor(PollingSensor):
def __init__(self, sensor_service, config=None, poll_interval=... | apache-2.0 |
jfpla/odoo | openerp/tests/common.py | 56 | 14002 | # -*- coding: utf-8 -*-
"""
The module :mod:`openerp.tests.common` provides unittest2 test cases and a few
helpers and classes to write tests.
"""
import errno
import glob
import json
import logging
import os
import select
import subprocess
import threading
import time
import itertools
import unittest2
import urllib2
... | agpl-3.0 |
barnsnake351/nova | nova/tests/functional/api_sample_tests/test_floating_ip_pools.py | 4 | 1824 | # Copyright 2014 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 agreed t... | apache-2.0 |
mathspace/libcloud | libcloud/loadbalancer/drivers/rackspace.py | 5 | 56134 | # 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 use ... | apache-2.0 |
Parbhat/echildcare | events/tasks.py | 1 | 2945 | from celery.task.schedules import crontab
from celery.decorators import periodic_task
from celery.utils.log import get_task_logger
from datetime import date
from rapidsms.router import send
from rapidsms.models import Connection
from rapidsms.models import Contact
from events.models import GeneralEvent, ScheduledEve... | mit |
benjaminjkraft/django | django/contrib/auth/admin.py | 18 | 8727 | from django.conf import settings
from django.conf.urls import url
from django.contrib import admin, messages
from django.contrib.admin.options import IS_POPUP_VAR
from django.contrib.admin.utils import unquote
from django.contrib.auth import update_session_auth_hash
from django.contrib.auth.forms import (
AdminPass... | bsd-3-clause |
MaDKaTZe/phantomjs | src/qt/qtwebkit/Tools/QueueStatusServer/config/messages.py | 119 | 1677 | # Copyright (C) 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:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... | bsd-3-clause |
RPGOne/scikit-learn | sklearn/neighbors/unsupervised.py | 11 | 4757 | """Unsupervised nearest neighbors learner"""
from .base import NeighborsBase
from .base import KNeighborsMixin
from .base import RadiusNeighborsMixin
from .base import UnsupervisedMixin
class NearestNeighbors(NeighborsBase, KNeighborsMixin,
RadiusNeighborsMixin, UnsupervisedMixin):
"""Unsu... | bsd-3-clause |
shea256/secret-sharing | unit_tests.py | 3 | 3207 | # -*- coding: utf-8 -*-
"""
Secret Sharing
~~~~~
:copyright: (c) 2014 by Halfmoon Labs
:license: MIT, see LICENSE for more details.
"""
import random
import unittest
from test import test_support
from utilitybelt import base64_chars
from secretsharing import secret_int_to_points, points_to_secret_int,... | mit |
NCI-Cloud/horizon | openstack_dashboard/openstack/common/_i18n.py | 18 | 1441 | # 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 |
mrkm4ntr/incubator-airflow | tests/providers/google/cloud/operators/test_dataprep_system.py | 8 | 1959 | #
# 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 |
titasakgm/brc-stock | openerp/addons/report_geraldo/lib/geraldo/site/newsite/django_1_0/tests/regressiontests/bug639/tests.py | 10 | 1384 | """
Tests for file field behavior, and specifically #639, in which Model.save() gets
called *again* for each FileField. This test will fail if calling an
auto-manipulator's save() method causes Model.save() to be called more than once.
"""
import os
import unittest
from regressiontests.bug639.models import Photo
from ... | agpl-3.0 |
gopal1cloud/neutron | neutron/openstack/common/cache/backends.py | 31 | 8152 | # Copyright 2013 Red Hat, 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 agre... | apache-2.0 |
martyngigg/pyqt-msvc | examples/dialogs/configdialog/configdialog_rc3.py | 7 | 74022 | # -*- coding: utf-8 -*-
# Resource object code
#
# Created: Wed Mar 20 12:31:25 2013
# by: The Resource Compiler for PyQt (Qt v4.8.4)
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore
qt_resource_data = b"\
\x00\x00\x1b\x93\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\... | gpl-3.0 |
gustavotorresm/PCS3746 | tools/perf/scripts/python/check-perf-trace.py | 11214 | 2503 | # perf script event handlers, generated by perf script -g python
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# This script tests basic functionality such as flag and symbol
# strings, common_xxx() calls back into perf, begin, end, unhandled
# events, etc. ... | gpl-3.0 |
maxime-beck/compassion-modules | partner_communication_revision/wizards/install_revisions.py | 4 | 1349 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2018 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Emanuel Cino <ecino@compassion.ch>
#
# The licence is in the file __manifest__.py... | agpl-3.0 |
plq/spyne | spyne/model/primitive/_base.py | 2 | 3917 |
#
# spyne - Copyright (C) Spyne contributors.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This libra... | lgpl-2.1 |
weiting-chen/manila | manila/tests/share/drivers/hds/test_sop.py | 1 | 27747 | # Copyright (c) 2015 Hitachi Data Systems.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... | apache-2.0 |
akrherz/iem | scripts/dbutil/clean_unknown_hads.py | 1 | 1500 | """
I look at the unknown HADS table and see if any of these stations exist
in the mesosite database, if so, then I set online to true!
Run from RUN_2AM.sh
"""
from pyiem.util import get_dbconn
def main():
"""Go Main Go"""
hads = get_dbconn("hads")
mesosite = get_dbconn("mesosite")
hcursor = hads.cu... | mit |
wzbozon/scikit-learn | sklearn/cluster/__init__.py | 364 | 1228 | """
The :mod:`sklearn.cluster` module gathers popular unsupervised clustering
algorithms.
"""
from .spectral import spectral_clustering, SpectralClustering
from .mean_shift_ import (mean_shift, MeanShift,
estimate_bandwidth, get_bin_seeds)
from .affinity_propagation_ import affinity_propagati... | bsd-3-clause |
amyshi188/osf.io | api/base/filters.py | 3 | 17360 | import re
import functools
import operator
from dateutil import parser as date_parser
import datetime
from django.core.exceptions import ValidationError
from modularodm import Q
from modularodm.query import queryset as modularodm_queryset
from rest_framework.filters import OrderingFilter
from rest_framework import ser... | apache-2.0 |
OSSystems/lava-server | lava_scheduler_daemon/worker.py | 1 | 5711 | # Copyright (C) 2014 Linaro Limited
#
# Author: Senthil Kumaran <senthil.kumaran@linaro.org>
#
# This file is part of LAVA Scheduler.
#
# LAVA Scheduler is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License version 3 as
# published by the Free Software Fou... | agpl-3.0 |
Aravind-Sundararajan/kongcoin | test/functional/listtransactions.py | 25 | 10476 | #!/usr/bin/env python3
# Copyright (c) 2014-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.
"""Test the listtransactions API."""
from test_framework.test_framework import BitcoinTestFramework
from ... | mit |
kisskys/incubator-asterixdb | asterixdb/asterix-examples/src/main/resources/tweetbook-demo/bottle.py | 5 | 129145 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Bottle is a fast and simple micro-framework for small web applications. It
offers request dispatching (Routes) with url parameter support, templates,
a built-in HTTP Server and adapters for many third party WSGI/HTTP-server and
template engines - all in a single file an... | apache-2.0 |
hgrecco/pyvisa | pyvisa/resources/gpib.py | 2 | 5321 | # -*- coding: utf-8 -*-
"""
pyvisa.resources.gpib
~~~~~~~~~~~~~~~~~~~~~
High level wrapper for GPIB resources.
This file is part of PyVISA.
:copyright: 2014 by PyVISA Authors, see AUTHORS for more details.
:license: MIT, see LICENSE for more details.
"""
from __future__ import division, unic... | mit |
jpgerke/bds-files | chapter-13-out-of-memory/code-examples/load_variants.py | 9 | 1387 | import sys
import sqlite3
from collections import OrderedDict
# the filename of this SQLite database
db_filename = "variants.db"
# initialize database connection
conn = sqlite3.connect(db_filename)
c = conn.cursor()
## Load Data
# columns (other than id, which is automatically incremented
tbl_cols = OrderedDict([("c... | mit |
simongoffin/website_version | openerp/addons/base/workflow/workflow_report.py | 106 | 8980 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
gspeedtech/Audacity-2 | lib-src/lv2/lv2/plugins/eg-amp.lv2/waflib/Tools/kde4.py | 275 | 2007 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
import os,sys,re
from waflib import Options,TaskGen,Task,Utils
from waflib.TaskGen import feature,after_method
@feature('msgfmt')
def apply_msgfmt(self):
for lang in self.to_... | gpl-2.0 |
Passtechsoft/TPEAlpGen | blender/scons/scons-local/SCons/Tool/javac.py | 6 | 8586 | """SCons.Tool.javac
Tool-specific initialization for javac.
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 - 2014 The SCons Foundation
#
# Permission is hereby granted, free of charge... | gpl-3.0 |
ychfan/tensorflow | tensorflow/python/keras/_impl/keras/testing_utils.py | 25 | 6178 | # 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 |
Johannes-Sahlmann/pygacs | pygacs/public/publicAccessTools.py | 1 | 3385 | """
Tools to query GACS using non-authenticated and synchronous access.
Some example capabilities are:
- send a query to GACS and retrieve the resulting table
References
----------
Compiled on the basis of the 'Help' section of the GACS web pages,
located at http://archives.esac.esa.int/gaia/
"""
from __future__... | lgpl-3.0 |
Axelio/pruebas_camelot | virtualenv/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/connection.py | 319 | 1348 | from socket import error as SocketError
try:
from select import poll, POLLIN
except ImportError: # `poll` doesn't exist on OSX and other platforms
poll = False
try:
from select import select
except ImportError: # `select` doesn't exist on AppEngine.
select = False
def is_connection_dr... | gpl-3.0 |
uwdata/termite-treetm | server_src/modules/readers/LDAReader.py | 2 | 3279 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
class LDAReader(object):
"""
lda_db = a SQLite3 database
"""
TOP_TERMS = 25
TOP_DOCS = 50
def __init__(self, lda_db):
self.logger = logging.getLogger('termite')
self.db = lda_db.db
self.termList = []
self.termTopicMatrix = []
self.docList =... | bsd-3-clause |
leggitta/mne-python | mne/datasets/megsim/megsim.py | 15 | 6566 | # Author: Eric Larson <larson.eric.d@gmail.com>
# License: BSD Style.
import os
from os import path as op
import zipfile
from sys import stdout
from ...utils import _fetch_file, _url_to_local_path, verbose
from ..utils import _get_path, _do_path_update
from .urls import (url_match, valid_data_types, valid_data_format... | bsd-3-clause |
lowks/angr | tests/broken_loop.py | 15 | 1615 | #!/usr/bin/env python
import logging
l = logging.getLogger("angr_tests")
import nose
import angr
# load the tests
import os
test_location = str(os.path.dirname(os.path.realpath(__file__)))
loop_nolibs = None
def setup_module():
global loop_nolibs
loop_nolibs = angr.Project(test_location + "/blob/x86_64/loop... | bsd-2-clause |
mxOBS/deb-pkg_trusty_chromium-browser | tools/gyp/test/compiler-override/gyptest-compiler-env.py | 100 | 3337 | #!/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.
"""
Verifies that the user can override the compiler and linker using CC/CXX/LD
environment variables.
"""
import TestGyp
import os
import co... | bsd-3-clause |
Vogeltak/pauselan | lib/python3.4/site-packages/pycparser/c_generator.py | 42 | 13570 | #------------------------------------------------------------------------------
# pycparser: c_generator.py
#
# C code generator from pycparser AST nodes.
#
# Copyright (C) 2008-2015, Eli Bendersky
# License: BSD
#------------------------------------------------------------------------------
from . import c_ast
class... | gpl-2.0 |
whitgroves/taskmap | .venvs/python3.6.0/lib/python3.6/site-packages/pip/_vendor/html5lib/filters/optionaltags.py | 354 | 10534 | from __future__ import absolute_import, division, unicode_literals
from . import base
class Filter(base.Filter):
def slider(self):
previous1 = previous2 = None
for token in self.source:
if previous1 is not None:
yield previous2, previous1, token
previous2 =... | unlicense |
ArthurWulfWhite/team-Mea-peer2peer | BitTornado/BT1/Uploader.py | 15 | 4789 | # Written by Bram Cohen
# see LICENSE.txt for license information
from BitTornado.CurrentRateMeasure import Measure
try:
True
except:
True = 1
False = 0
class Upload:
def __init__(self, connection, ratelimiter, totalup, choker, storage,
picker, config):
self.connection = conn... | mit |
dwightgunning/django | tests/defer_regress/tests.py | 31 | 13191 | from __future__ import unicode_literals
from operator import attrgetter
from django.apps import apps
from django.apps.registry import Apps
from django.contrib.contenttypes.models import ContentType
from django.contrib.sessions.backends.db import SessionStore
from django.db import models
from django.db.models import C... | bsd-3-clause |
hevalberknevruz/oclapi | django-nonrel/ocl/oclapi/utils.py | 5 | 9708 | import json
import os
import tarfile
import tempfile
import gzip
from boto.s3.key import Key
from boto.s3.connection import S3Connection
from haystack.utils import loading
from rest_framework.reverse import reverse
from rest_framework.utils import encoders
from django.conf import settings
from django.core.urlresolvers... | mpl-2.0 |
davidfather/TizenRT | external/protobuf/python/google/protobuf/internal/containers.py | 40 | 20888 | # Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# https://developers.google.com/protocol-buffers/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redi... | apache-2.0 |
rex-xxx/mt6572_x201 | external/webkit/Tools/QueueStatusServer/model/queuestatus.py | 19 | 2103 | # 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... | gpl-2.0 |
OldHuntsman/DefilerWings | game/pythoncode/characters/fighter.py | 2 | 8018 | # coding=utf-8
import random
from pythoncode import data
from pythoncode.utils import tuples_sum
from talker import Talker
from mortal import Mortal
class Fighter(Talker, Mortal):
"""
Базовый класс для всего, что способно драться.
Декоратор нужен чтобы реализовывать эффекты вроде иммунитета или ядовит... | bsd-3-clause |
Teamxrtc/webrtc-streaming-node | third_party/webrtc/src/chromium/src/third_party/scons-2.0.1/engine/SCons/Debug.py | 61 | 6766 | """SCons.Debug
Code for debugging SCons internal things. Shouldn't be
needed by most users.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documen... | mit |
stephawe/kerrokantasi | democracy/views/user.py | 2 | 1101 | from django.contrib.auth import get_user_model
from rest_framework import permissions, serializers, viewsets
class ForeignKeyListSerializer(serializers.ReadOnlyField):
def to_representation(self, value):
return value.all().values_list('pk', flat=True)
class UserDataSerializer(serializers.ModelSerialize... | mit |
MobinRanjbar/hue | desktop/core/ext-py/sasl-0.1.1/sasl/saslwrapper.py | 76 | 4375 | # This file was automatically generated by SWIG (http://www.swig.org).
# Version 1.3.36
#
# Don't modify this file, modify the SWIG interface instead.
# This file is compatible with both classic and new-style classes.
import _saslwrapper
import new
new_instancemethod = new.instancemethod
try:
_swig_property = prop... | apache-2.0 |
rht/zulip | zerver/tests/test_urls.py | 1 | 7349 | # -*- coding: utf-8 -*-
import importlib
import os
import ujson
import django.urls.resolvers
from django.test import TestCase, Client
from typing import List, Optional
from zerver.lib.test_classes import ZulipTestCase
from zerver.lib.test_runner import slow
from zerver.models import Stream
from zproject import urls
... | apache-2.0 |
312v/openmano | openvim/utils/definitionsClass.py | 3 | 2825 | # -*- coding: utf-8 -*-
##
# Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U.
# This file is part of openmano
# 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 ... | apache-2.0 |
proxysh/Safejumper-for-Desktop | buildlinux/env32/lib/python2.7/site-packages/Crypto/SelfTest/Util/test_number.py | 115 | 12900 | # -*- coding: utf-8 -*-
#
# SelfTest/Util/test_number.py: Self-test for parts of the Crypto.Util.number module
#
# Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net>
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# th... | gpl-2.0 |
fossfreedom/rhythmbox-spectrum | spectrum_prefs.py | 1 | 6590 | # -*- Mode: python; coding: utf-8; tab-width: 4; indent-tabs-mode: nil; -*-
#
# Copyright (C) 2015 - fossfreedom
#
# 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, or (at your o... | gpl-3.0 |
jbedorf/tensorflow | tensorflow/contrib/tensor_forest/hybrid/python/hybrid_model.py | 5 | 4854 | # 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 |
ThePletch/ansible | lib/ansible/modules/cloud/amazon/ec2_lc.py | 25 | 12371 | #!/usr/bin/python
# 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 distributed... | gpl-3.0 |
Jorge-Rodriguez/ansible | lib/ansible/modules/cloud/amazon/iam_role.py | 13 | 24058 | #!/usr/bin/python
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = '''
---
module: iam_role
short_description: Manage ... | gpl-3.0 |
benhc123/p2pool | p2pool/util/variable.py | 270 | 2541 | import itertools
import weakref
from twisted.internet import defer, reactor
from twisted.python import failure, log
class Event(object):
def __init__(self):
self.observers = {}
self.id_generator = itertools.count()
self._once = None
self.times = 0
def run_and_watch(self, f... | gpl-3.0 |
leftbrainstrain/Arduino-ESP8266 | arduino-core/src/processing/app/i18n/python/transifex.py | 75 | 2038 | #!/usr/bin/env python
#vim:set fileencoding=utf-8 sw=2 expandtab
import update
import requests
import json
class Transifex(object):
def __init__(self, user, passwd):
self.auth_ = (user, passwd)
r = requests.get(
'http://www.transifex.com/api/2/project/'
'arduino-ide-15/resource/ide-15/?deta... | lgpl-2.1 |
eomerdws/aeneas | aeneas/tests/test_cdtw.py | 5 | 1902 | #!/usr/bin/env python
# coding=utf-8
# aeneas is a Python/C library and a set of tools
# to automagically synchronize audio and text (aka forced alignment)
#
# Copyright (C) 2012-2013, Alberto Pettarin (www.albertopettarin.it)
# Copyright (C) 2013-2015, ReadBeyond Srl (www.readbeyond.it)
# Copyright (C) 2015-2017, A... | agpl-3.0 |
cpaasch/mptcp-net-next | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/SchedGui.py | 12980 | 5411 | # SchedGui.py - Python extension for perf script, basic GUI code for
# traces drawing and overview.
#
# Copyright (C) 2010 by Frederic Weisbecker <fweisbec@gmail.com>
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
... | gpl-2.0 |
gzd888/artisan | artisanlib/list_ports_osx.py | 9 | 6908 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# list_ports_osx.py
#
# Copyright (c) 2013, Paul Holleis, Marko Luther
# All rights reserved.
#
#
# LICENSE
#
# 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 |
witcxc/scipy | scipy/signal/_arraytools.py | 25 | 5105 | """
Functions for acting on a axis of an array.
"""
from __future__ import division, print_function, absolute_import
import numpy as np
def axis_slice(a, start=None, stop=None, step=None, axis=-1):
"""Take a slice along axis 'axis' from 'a'.
Parameters
----------
a : numpy.ndarray
The array ... | bsd-3-clause |
fkenghagho/RobotVQA | tools/robotVQAConfig.py | 1 | 6718 | """
#@Author: Frankln Kenghagho
#@Date: 04.04.2019
#@Project: RobotVA
#Extends the work below Mask R-CNN
"""
"""
Mask R-CNN
Common utility functions and classes.
Copyright (c) 2017 Matterport, Inc.
Licensed under the MIT License (see LICENSE for details)
Written by Waleed Abdulla
"""
#This program manages the... | bsd-2-clause |
x2Ident/x2Ident | mitmproxy/pathod/language/base.py | 2 | 15334 | import operator
import os
import abc
import pyparsing as pp
import six
from six.moves import reduce
from netlib import strutils
from netlib import human
from . import generators, exceptions
class Settings(object):
def __init__(
self,
is_client=False,
staticdir=None,
... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.