repo_name stringlengths 6 90 | path stringlengths 4 230 | copies stringlengths 1 4 | size stringlengths 4 7 | content stringlengths 734 985k | license stringclasses 15
values | hash int64 -9,223,303,126,770,100,000 9,223,233,360B | line_mean float64 3.79 99.6 | line_max int64 19 999 | alpha_frac float64 0.25 0.96 | autogenerated bool 1
class | ratio float64 1.5 8.06 | config_test bool 2
classes | has_no_keywords bool 2
classes | few_assignments bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Psycojoker/voltairine | authentification/views.py | 1 | 1433 | # encoding: utf-8
from django.contrib.auth.views import login as base_login
from django.contrib.auth import logout as auth_logout
from django.core.urlresolvers import reverse
from django.shortcuts import render
from django.conf import settings
from django.core.mail import send_mail
from django.http import HttpResponse... | agpl-3.0 | 1,640,969,643,476,472,800 | 33.095238 | 124 | 0.726955 | false | 3.859838 | false | false | false |
iaddict/mercurial.rb | vendor/mercurial/hgext/convert/filemap.py | 91 | 14767 | # Copyright 2007 Bryan O'Sullivan <bos@serpentine.com>
# Copyright 2007 Alexis S. L. Carvalho <alexis@cecm.usp.br>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
import posixpath
import shlex
from mercurial.i18n import _
from mer... | mit | 29,060,497,546,460,136 | 35.9175 | 78 | 0.561116 | false | 4.173827 | false | false | false |
maurozucchelli/dipy | dipy/viz/fvtk.py | 1 | 55032 | ''' Fvtk module implements simple visualization functions using VTK.
The main idea is the following:
A window can have one or more renderers. A renderer can have none, one or more actors. Examples of actors are a sphere, line, point etc.
You basically add actors in a renderer and in that way you can visualize the fore... | bsd-3-clause | 1,123,754,660,296,688,100 | 29.658496 | 191 | 0.590838 | false | 3.342566 | false | false | false |
ibethune/lammps | tools/moltemplate/moltemplate/nbody_Bonds.py | 5 | 1060 | try:
from .nbody_graph_search import Ugraph
except (ImportError, SystemError, ValueError):
# not installed as a package
from nbody_graph_search import Ugraph
# To find 2-body "bond" interactions, we would use this subgraph:
#
#
# *---* => one bond connects atoms 0 and 1
# 0 1
#
... | gpl-2.0 | -7,474,626,582,977,425,000 | 29.285714 | 77 | 0.629245 | false | 3.397436 | false | false | false |
lijianest/microblog_flasklearn | app/translate.py | 4 | 2454 | try:
import httplib # Python 2
except ImportError:
import http.client as httplib # Python 3
try:
from urllib import urlencode # Python 2
except ImportError:
from urllib.parse import urlencode # Python 3
import json
from app import app
from flask_babel import gettext
from config import MS_TRANSLATOR_... | bsd-3-clause | -5,315,591,220,041,316,000 | 36.753846 | 78 | 0.571312 | false | 4.11745 | false | false | false |
rgerkin/python-neo | neo/rawio/neuralynxrawio.py | 1 | 28472 | # -*- coding: utf-8 -*-
"""
Class for reading data from Neuralynx files.
This IO supports NCS, NEV, NSE and NTT file formats.
NCS contains signals for one channel
NEV contains events
NSE contains spikes and waveforms for mono electrodes
NTT contains spikes and waveforms for tetrodes
NCS can contains gaps that can b... | bsd-3-clause | 13,301,336,218,248,060 | 37.787466 | 99 | 0.539867 | false | 3.671653 | false | false | false |
MartinThoma/nntoolkit | nntoolkit/train.py | 1 | 4442 | #!/usr/bin/env python
"""Train a neural network."""
# Core Library modules
import logging
import os
from typing import Any, Dict, List
# Third party modules
import numpy as np
from keras import optimizers
# First party modules
import nntoolkit.utils as utils
logger = logging.getLogger(__name__)
def minibatch_gr... | mit | 8,221,419,496,392,743,000 | 22.256545 | 78 | 0.423458 | false | 4.291787 | false | false | false |
stefanfoulis/django-sendsms | sendsms/backends/bulksms.py | 1 | 1634 | # -*- coding: utf-8 -*-
from django.conf import settings
import requests
from sendsms.backends.base import BaseSmsBackend
BULKSMS_API_URL = "https://api.bulksms.com/v1/messages"
BULKSMS_TOKEN_ID = getattr(settings, "SENDSMS_BULKSMS_TOKEN_ID", "")
BULKSMS_TOKEN_SECRET = getattr(settings, "SENDSMS_BULKSMS_TOKEN_SECRE... | mit | -7,716,304,286,371,846,000 | 28.709091 | 88 | 0.600979 | false | 3.287726 | false | false | false |
WillemEerland/teetool | test/test_visual_2d.py | 1 | 2598 | """
<description>
"""
import pytest as pt
import numpy as np
import teetool as tt
def test_visual_2d():
"""
produce figures
"""
mdim = 2
mtraj = 20
# build world
world_1 = tt.World(name="Example 3D", ndim=2, resolution=100)
# extreme reduced resolution
#world_1.setResolution(xs... | mit | 8,124,276,088,296,475,000 | 21.205128 | 89 | 0.633179 | false | 3.235367 | false | false | false |
podiobooks/podiobooks | podiobooks/views.py | 1 | 2613 | """ Django Views for the Overall Site"""
from django.views.generic import RedirectView, TemplateView, View
from django.views.decorators.cache import never_cache
from django.http import HttpResponse, HttpResponseRedirect
from django.conf import settings
from django.http import Http404
import os
class AccelView(View):... | gpl-3.0 | -2,861,245,389,746,099,700 | 32.075949 | 106 | 0.623804 | false | 4.03864 | false | false | false |
feroda/lessons-itis | 2016-5BI/src/socket-e-thread/bancoserver_multi.py | 1 | 3599 | """
Server TCP che simula un bancomat
che ha a disposizione 100 banconote
e le distribuisce a chi le chiede.
Quando le ha finite risponde al client
che non ne ha più.
Questo servizio è multithread e si basa sull'utilizzo
di un contatore globale di banconote (num)
che viene decrementato in modo esclusivo da ogni thread... | agpl-3.0 | 1,857,528,912,491,343,000 | 29.709402 | 100 | 0.671305 | false | 3.024411 | false | false | false |
artificilabs/trelliolibs | trelliolibs/utils/base.py | 1 | 15820 | from asyncio import Task, ensure_future, gather
from asyncio.coroutines import iscoroutinefunction, coroutine
from functools import partial, wraps
from time import time
from types import MethodType, FunctionType
from asyncpg.exceptions import UniqueViolationError, UndefinedColumnError
from trellio import request, get,... | mit | -6,595,519,887,220,457,000 | 36.223529 | 119 | 0.589128 | false | 4.013191 | false | false | false |
excid3/keryx-1.0 | keryx/keryxconfig.py | 1 | 4245 | # -*- coding: utf-8 -*-
### BEGIN LICENSE
# Copyright (C) 2010 Chris Oliver <chris@excid3.com>
# mac9416 <mac9416@keryxproject.org>
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 3, as published
# by the Free Sof... | gpl-3.0 | -4,312,547,288,417,322,500 | 30.917293 | 80 | 0.608009 | false | 3.790179 | true | false | false |
schalkneethling/bedrock | bedrock/privacy/urls.py | 1 | 2595 | # 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/.
from django.conf.urls import url
from bedrock.mozorg.util import page
from bedrock.privacy import views
urlpatterns = ... | mpl-2.0 | 6,277,491,549,686,377,000 | 62.292683 | 97 | 0.707514 | false | 3.24375 | false | false | false |
RescueTime/cwmon-mysql | setup.py | 1 | 2361 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""It's the ``setup.py``; you know the drill."""
import io
import re
from glob import glob
from os.path import basename
from os.path import dirname
from os.path import join
from os.path import splitext
from setuptools import find_packages
from setuptools import setup
d... | bsd-2-clause | -7,426,922,701,251,741,000 | 27.792683 | 96 | 0.559509 | false | 3.82658 | false | false | false |
dbuse/pyheldenblatt | pyheldenblatt/heldenblatt.py | 1 | 5374 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals, print_function
from builtins import object, str
from collections import OrderedDict
from . import config
class ZeilenFeld(object):
def __init__(self, titel, weite, fontsize, text='', style='', align='', linie=False, font=config.FONT):
se... | apache-2.0 | 1,159,460,871,040,448,000 | 43.256198 | 119 | 0.592157 | false | 3.193202 | false | false | false |
chrisbarber/dask | dask/tests/test_base.py | 1 | 11545 | # -*- coding: utf-8 -*-
import os
import pytest
from operator import add, mul
import subprocess
import sys
import dask
from dask.base import (compute, tokenize, normalize_token, normalize_function,
visualize)
from dask.utils import tmpdir, tmpfile, ignoring
from dask.utils_test import inc, dec
... | bsd-3-clause | 3,495,560,221,747,358,000 | 29.699468 | 95 | 0.586503 | false | 3.027275 | true | false | false |
almarklein/scikit-image | skimage/filter/tests/test_denoise.py | 1 | 4510 | import numpy as np
from numpy.testing import run_module_suite, assert_raises, assert_equal
from skimage import filter, data, color, img_as_float
np.random.seed(1234)
lena = img_as_float(data.lena()[:256, :256])
lena_gray = color.rgb2gray(lena)
def test_denoise_tv_chambolle_2d():
# lena image
img = lena_g... | bsd-3-clause | 6,405,429,671,543,993,000 | 31.214286 | 80 | 0.643016 | false | 2.734991 | true | false | false |
manahl/arctic | arctic/_cache.py | 1 | 5715 | import logging
from datetime import datetime, timedelta
from pymongo.errors import OperationFailure
logger = logging.getLogger(__name__)
CACHE_COLL = 'cache'
CACHE_DB = 'meta_db'
CACHE_SETTINGS = 'settings'
CACHE_SETTINGS_KEY = 'cache'
"""
Sample cache_settings collection entry:
meta_db.cache_settings.insertOne({"ty... | lgpl-2.1 | 5,568,457,393,902,412,000 | 40.413043 | 137 | 0.594926 | false | 4.070513 | false | false | false |
Parallel-in-Time/pySDC | pySDC/implementations/problem_classes/VorticityVelocity_2D_FEniCS_periodic.py | 1 | 8067 |
import logging
import dolfin as df
import numpy as np
from pySDC.core.Errors import ParameterError
from pySDC.core.Problem import ptype
from pySDC.implementations.datatype_classes.fenics_mesh import fenics_mesh, rhs_fenics_mesh
# noinspection PyUnusedLocal
class fenics_vortex_2d(ptype):
"""
Example impleme... | bsd-2-clause | -913,748,338,139,894,900 | 32.197531 | 120 | 0.505888 | false | 3.292653 | false | false | false |
hilts-vaughan/cp467 | Comparison_main.py | 1 | 8185 | import os
import pprint
import operator
import pickle
import numpy as np
import matplotlib.pyplot as plt
from scipy import stats
from training.trainer import *
from training.training_container import *
__author__ = 'touma'
def listdir_fullpath(d):
return [os.path.join(d, f) for f in os.listdir(d)]
def compari... | lgpl-3.0 | -4,114,032,140,270,942,000 | 37.069767 | 192 | 0.563592 | false | 3.663832 | false | false | false |
pekrau/OrderPortal | orderportal/app_orderportal.py | 1 | 9715 | "OrderPortal web application server."
import logging
import os
import sys
import tornado.web
import tornado.ioloop
from orderportal import settings
from orderportal import utils
from orderportal import uimodules
from orderportal.requesthandler import RequestHandler
from orderportal.home import *
from orderportal.ad... | mit | -497,148,288,415,214,700 | 49.07732 | 80 | 0.583119 | false | 3.209448 | false | false | false |
M3nin0/supreme-broccoli | Web/Flask/site_/lib/python3.5/site-packages/sqlalchemy/dialects/postgresql/hstore.py | 3 | 12411 | # postgresql/hstore.py
# Copyright (C) 2005-2016 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
import re
from .base import ischema_names
from .array import ARRAY
from ... im... | apache-2.0 | -6,118,855,024,104,667,000 | 28.55 | 79 | 0.599307 | false | 3.933756 | true | false | false |
afaulconbridge/PyAChemKit | achemkit/tools/log_to_chem.py | 1 | 1953 | #! /usr/bin/python
"""
Produces a `.chem` output from a provided `.log` format input
For information in `.chem` files see :ref:`chem_file_format`.
Usage: chem_to_dot.py [options]
Options:
-h, --help Show a help message and exit
-i INFILE, --infile=INFILE Read from INFILE (if ommited, use... | bsd-3-clause | 4,591,875,086,347,585,000 | 35.849057 | 172 | 0.645673 | false | 3.518919 | false | false | false |
gautelinga/BERNAISE | utilities/mesh_scripts/porous.py | 1 | 1402 | """ porous script. """
import mshr
from common import info
import numpy as np
import dolfin as df
from generate_mesh import MESHES_DIR, store_mesh_HDF5
import os
import matplotlib.pyplot as plt
def description(**kwargs):
info("Make a porous mesh.")
def method(Lx=4., Ly=4., rad=0.2, R=0.3, N=24, n_segments=40, r... | mit | 1,531,357,351,070,390,500 | 25.961538 | 71 | 0.524251 | false | 2.832323 | false | false | false |
guthemberg/yanoama | yanoama/pilot/system/_linux.py | 1 | 4121 | #!/home/upmc_aren/python_env/bin/python
import subprocess
"""
run few command on remote node in yanoama
commands are coded two comma-separated
integers only
codes list:
0,0: update main sources
0,1: bootstrap
0,2: shutdown (kill pilot and amend)
0,3: start amen daemon
0,4: stop amen daemon
9,9: get date for testi... | bsd-3-clause | 640,304,343,113,523,300 | 38.247619 | 110 | 0.523659 | false | 4.188008 | false | false | false |
stephendade/MAVProxy | MAVProxy/modules/mavproxy_vicon.py | 2 | 10354 | """
use vicon data to provide VISION_POSITION_ESTIMATE and GPS_INPUT data
"""
import math
import threading
import time
from MAVProxy.modules.lib import mp_module
from MAVProxy.modules.lib import mp_settings
from MAVProxy.modules.lib import LowPassFilter2p
from pymavlink.rotmat import Vector3
from pymavlink import mav... | gpl-3.0 | 6,264,382,335,775,189,000 | 39.924901 | 127 | 0.498551 | false | 3.732516 | false | false | false |
Azure/azure-sdk-for-python | tools/azure-devtools/src/azure_devtools/perfstress_tests/system_perfstress/socket_http_get_test.py | 1 | 1182 | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | mit | -597,194,852,991,893,900 | 35.9375 | 102 | 0.577834 | false | 4.361624 | false | false | false |
JessieSalas/WatsonApp | navigationdrawer/__init__.py | 2 | 28265 | # Copyright (c) 2013 Alexander Taylor
# 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
# to use, copy, modify, merge, publish, dis... | mit | -5,302,263,904,971,861,000 | 39.669065 | 79 | 0.614258 | false | 3.885223 | false | false | false |
j-kato/gobgp | test/scenario_test/route_server_test.py | 3 | 8840 | # Copyright (C) 2015 Nippon Telegraph and Telephone Corporation.
#
# 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 appli... | apache-2.0 | 5,161,780,082,632,262,000 | 33.396887 | 101 | 0.553846 | false | 3.510723 | true | false | false |
nickmilon/mongo_vs_es | mongo_vs_es/mongo.py | 1 | 1083 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
'''
https://github.com/mongodb/mongo/tree/master/src/mongo/db/fts
# sc.find({ '$text': { '$search': 'browns', '$language': 'english' } })[0]
'''
import json
from mongo_vs_es.config import MONGO_CONF
from pymongo_ext import pymongo_ext as pmext
import io
CL=pmext.MdbClien... | apache-2.0 | 4,101,940,230,475,562,500 | 36.37931 | 113 | 0.625115 | false | 2.895722 | false | false | false |
talishte/ctigre | env/lib/python2.7/site-packages/future/tests/test_bytes.py | 1 | 13910 | # -*- coding: utf-8 -*-
"""
Tests for the backported bytes object
"""
from __future__ import absolute_import, unicode_literals, print_function
from future.builtins import *
from future import utils
from numbers import Integral
from future.tests.base import unittest
TEST_UNICODE_STR = u'ℝεα∂@ßʟ℮ ☂ℯṧт υηḯ¢☺ḓ℮'
# Tk i... | bsd-2-clause | 1,851,443,826,198,437,400 | 30.986175 | 294 | 0.557773 | false | 3.345866 | true | false | false |
pmghalvorsen/gramps_branch | gramps/gen/filters/rules/repository/_hasrepo.py | 2 | 3169 | #
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2002-2006 Donald N. Allingham
#
# 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 you... | gpl-2.0 | -9,064,723,408,271,512,000 | 32.712766 | 79 | 0.493847 | false | 4.779789 | false | false | false |
ryabina-krasnaya/kpk2016 | catch_the_ball/ball.py | 1 | 1928 | import tkinter
from random import choice, randint
ball_initial_number = 20
ball_min_R = 15
ball_max_R = 40
ball_available_colors = ['blue', 'red', '#FF00FF','#FFFFFF', '#FFFF00','gray']
def click_ball(event):
"""По клику мышкой на объекте - он исчезает"""
obj = canvas.find_closest(event.x,event.y)
x1, y1,... | gpl-3.0 | 1,186,932,016,808,836,900 | 28.368421 | 84 | 0.635983 | false | 2.307586 | false | false | false |
kylef/KFData.py | kfdata/parser/attributes.py | 1 | 2795 | from kfdata.attributes import Attribute, BooleanAttribute, StringAttribute, NumberAttribute, DefaultAttribute
class AttributeParser(object):
attribute_class = Attribute
@classmethod
def parse(cls, document):
attribute_type = document.getAttribute('attributeType')
return cls.attribute_type... | bsd-3-clause | 9,070,447,697,739,750,000 | 31.882353 | 109 | 0.660823 | false | 4.802405 | false | false | false |
adsabs/orcid-service | orcid_service/models.py | 1 | 7409 | # -*- coding: utf-8 -*-
"""
myads_service.models
~~~~~~~~~~~~~~~~~~~~~
Models for the users (users) of AdsWS
"""
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.ext.mutable import Mutable
from sqlalchemy.dialects.postgresql import JSON
from sqlalchemy import Column, String, Text
fro... | mit | 7,391,423,109,671,217,000 | 32.080357 | 104 | 0.594007 | false | 4.262946 | false | false | false |
foursquare/fsqio | src/python/fsqio/pants/node/tasks/webpack.py | 1 | 5293 | # coding=utf-8
# Copyright 2016 Foursquare Labs Inc. All Rights Reserved.
from __future__ import absolute_import, division, print_function, unicode_literals
import os.path
from pants.base.exceptions import TaskError
from pants.base.workunit import WorkUnitLabel
from pants.build_graph.resources import Resources as Ba... | apache-2.0 | -3,373,548,235,550,468,000 | 40.351563 | 120 | 0.72662 | false | 3.95 | false | false | false |
seize-the-dave/XlsxWriter | xlsxwriter/test/comparison/test_simple09.py | 8 | 1267 | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparsion_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""... | bsd-2-clause | -4,171,391,435,798,200,300 | 25.957447 | 79 | 0.578532 | false | 3.759644 | true | false | false |
timduru/platform-external-chromium_org | tools/telemetry/telemetry/core/chrome/desktop_browser_finder_unittest.py | 29 | 6927 | # Copyright (c) 2012 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.
import unittest
from telemetry.core import browser_options
from telemetry.core.chrome import desktop_browser_finder
from telemetry.unittest import system... | bsd-3-clause | 3,616,374,126,435,697,700 | 35.845745 | 78 | 0.651797 | false | 3.696371 | true | false | false |
ibid/ibid | ibid/plugins/dbus.py | 2 | 1935 | # Copyright (c) 2008-2010, Michael Gorven
# Released under terms of the MIT/X/Expat Licence. See COPYING for details.
import sys
import re
from traceback import print_exc
import ibid
from ibid.plugins import Processor
class Proxy(Processor):
autoload = False
def __init__(self, name):
Processor.__ini... | gpl-3.0 | 8,686,557,928,625,296,000 | 29.234375 | 86 | 0.602584 | false | 4.039666 | false | false | false |
akhani/FAST-TrIPs | Scripts/ft_walkingLinkGenerator.py | 2 | 3856 | ###################################################################################
# Transit Walking (Access and Transfer) Link Generator
# Created on May 24, 2012
# By Alireza Khani (akhani@email.arizona.edu)
# Reads ft_input_stops.dat, ft_input_zones.dat
# Writes ft_input_accessLinks.dat, ft_input_transfer... | apache-2.0 | -5,555,623,760,447,553,000 | 34.054545 | 183 | 0.500259 | false | 3.168447 | false | false | false |
ActiveState/code | recipes/Python/300019_Coroutines_in_Python/recipe-300019.py | 1 | 7160 | """
A coroutine implementation in Python.
Convert functions to iterator generators by replacing
return <expression>
with
yield <expression>
and function calls: f(*args, **kw) with for loops:
for i in f(*args, **kw):
pass
# the function value is in i now.
Unfortunately, you have to know which routine has been ... | mit | -1,620,040,461,225,506,800 | 25.6171 | 87 | 0.588268 | false | 3.993307 | false | false | false |
OTSimulation/otSim | 3rdparty/GeographicLib/python/geographiclib/test/test_geodesic.py | 1 | 26836 | import unittest
from geographiclib.geodesic import Geodesic
from geographiclib.geomath import Math
class GeodesicTest(unittest.TestCase):
testcases = [
[35.60777, -139.44815, 111.098748429560326,
-11.17491, -69.95921, 129.289270889708762,
8935244.5604818305, 80.50729714281974, 6273170.2055303837,
... | mit | 4,704,672,092,336,151,000 | 49.825758 | 76 | 0.67007 | false | 2.723361 | true | false | false |
PhloxAR/math3 | math3/objects/basecls.py | 1 | 7026 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import numpy as np
class NpProxy(object):
def __init__(self, index):
self._index = index
def __get__(self, obj, cls):
return obj[self._index]
def __set__(self, obj, value):
obj[self._index] = value
class BaseObject(... | bsd-3-clause | 2,282,558,705,621,611,500 | 25.613636 | 108 | 0.551096 | false | 4.077771 | false | false | false |
badlands-model/pyBadlands | badlands/badlands/surface/raster2TIN.py | 1 | 15184 | ##~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~##
## ##
## This file forms part of the Badlands surface processes modelling application. ##
## ... | gpl-3.0 | -6,543,940,770,181,162,000 | 36.955 | 149 | 0.575352 | false | 3.668036 | false | false | false |
kmee/kmee_odoo_brasil_addons | __unported__/hr_employee_checklist/model/hr_employee.py | 1 | 6649 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Brazillian Human Resources Employee module for OpenERP
# Copyright (C) 2014 KMEE (http://www.kmee.com.br)
# @author Rafael da Silva Lima <mileo@kmee.com.br>
#
# This program is free software: you can... | agpl-3.0 | -3,902,214,504,131,069,400 | 40.579618 | 121 | 0.606771 | false | 3.193738 | false | false | false |
ponderousmad/pyndent | improc.py | 1 | 12024 | from __future__ import print_function
import errno
import gzip
import math
import os
import numpy as np
import skimage.color
from scipy import ndimage
from six.moves import zip_longest
from six.moves import cPickle as pickle
def split(image):
"""Split the image data into the top and bottom half."""
split_he... | mit | -4,679,415,164,964,428,000 | 36.457944 | 110 | 0.613689 | false | 3.358659 | false | false | false |
tempbottle/pykafka | tests/pykafka/test_balancedconsumer.py | 1 | 4755 | import math
import time
import mock
import unittest2
from pykafka import KafkaClient
from pykafka.balancedconsumer import BalancedConsumer
from pykafka.test.utils import get_cluster, stop_cluster
def buildMockConsumer(num_partitions=10, num_participants=1, timeout=2000):
consumer_group = 'testgroup'
topic =... | apache-2.0 | -8,272,421,383,843,848,000 | 36.738095 | 138 | 0.607992 | false | 4.222913 | true | false | false |
wh1100717/tornado_skeleton | controller/UserController.py | 1 | 2453 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from util import MongoUtil
mongo_client = MongoUtil.MongoClient()
db = mongo_client.get_db()
user_collection = db.users
def register(username, password):
'''
##`用户注册`请求
1. 检查username格式是否合规
if 不合规
则说明username存在一些问题,包括是否有sql注入等行为 return
else
执行step 2
2. 判断... | mit | -9,153,127,923,235,122,000 | 18.728261 | 60 | 0.694766 | false | 1.791708 | false | false | false |
karstenw/nodebox-pyobjc | examples/Extended Application/matplotlib/examples/event_handling/path_editor.py | 1 | 5212 | """
===========
Path Editor
===========
"""
import numpy as np
import matplotlib.path as mpath
import matplotlib.patches as mpatches
import matplotlib.pyplot as plt
# nodebox section
if __name__ == '__builtin__':
# were in nodebox
import os
import tempfile
W = 800
inset = 20
size(W, 600)
... | mit | 1,436,821,255,442,766,000 | 26.57672 | 82 | 0.591328 | false | 3.424442 | false | false | false |
scottdanesi/earthshaker-aftershock | procgame/modes/replay.py | 3 | 3037 | from ..game import Mode
class Replay(Mode):
"""docstring for AttractMode"""
def __init__(self, game, priority):
super(Replay, self).__init__(game, priority)
self.replay_achieved = [False, False, False, False]
self.replay_scores = [500000,600000,700000,800000]
self.num_replay_levels = 1
self.replay_callback... | gpl-3.0 | -6,640,817,487,572,588,000 | 37.935897 | 120 | 0.667435 | false | 3.012897 | false | false | false |
mscuthbert/abjad | abjad/tools/scoretools/get_next_measure_from_component.py | 2 | 2703 | # -*- encoding: utf-8 -*-
from abjad.tools.topleveltools import iterate
def get_next_measure_from_component(component):
'''Get next measure from `component`.
When `component` is a voice, staff or other sequential context,
and when `component` contains a measure, return first measure
in `component`. T... | gpl-3.0 | -9,079,698,491,436,060,000 | 36.027397 | 84 | 0.642989 | false | 3.934498 | false | false | false |
GordonsBeard/Dokurobotto | plugins/youtube/search.py | 1 | 2644 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
This lets DR search YouTube by keyword.
- YouTubeSearch
A ton of this was stolen from the Google examples for YouTube search.
https://github.com/youtube/api-samples/blob/master/python/search.py
"""
import config, re
from ident import YouTubeIdent
from ircutils.events ... | mit | 8,289,968,228,135,414,000 | 33.337662 | 87 | 0.613843 | false | 3.893962 | false | false | false |
ceache/treadmill | lib/python/treadmill/cli/admin/ldap/tenant.py | 2 | 2073 | """Implementation of treadmill admin ldap CLI tenant plugin.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import click
from treadmill.admin import exc as admin_exceptions
from treadmill import cli
from treadm... | apache-2.0 | 6,847,850,562,796,000,000 | 27.013514 | 70 | 0.612156 | false | 4.017442 | false | false | false |
wallyworld/juju | acceptancetests/assess_mixed_images.py | 3 | 1889 | #!/usr/bin/env python3
"""Assess mixed deployment of images from two sets of simplestreams."""
from __future__ import print_function
import argparse
import logging
import sys
from deploy_stack import (
assess_juju_relations,
BootstrapManager,
)
from jujucharm import (
local_charm_path,
)
from utility imp... | agpl-3.0 | 8,330,153,916,421,725,000 | 27.19403 | 78 | 0.664373 | false | 3.591255 | false | false | false |
IITBinterns13/edx-platform-dev | cms/djangoapps/contentstore/views/course.py | 2 | 17299 | """
Views related to operations on course objects
"""
import json
from django.contrib.auth.decorators import login_required
from django_future.csrf import ensure_csrf_cookie
from django.conf import settings
from django.core.exceptions import PermissionDenied
from django.http import HttpResponse, HttpResponseBadRequest... | agpl-3.0 | 2,647,657,374,262,231,600 | 41.192683 | 168 | 0.646916 | false | 4.288299 | false | false | false |
ciudadanointeligente/votainteligente-portal-electoral | backend_candidate/migrations/0014_remove_suggesting_models.py | 1 | 1075 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.9 on 2018-03-09 20:40
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('backend_candidate', '0013_auto_20171117_1432'),
]
database_operations = [
migrations... | gpl-3.0 | -7,044,468,441,823,290,000 | 36.068966 | 133 | 0.72093 | false | 4.516807 | false | false | false |
frappe/erpnext | erpnext/projects/doctype/project/test_project.py | 2 | 6061 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe, unittest
from frappe.utils import getdate, nowdate, add_days
from erpnext.projects.doctype.project_template.test_project_template impor... | gpl-3.0 | 3,821,860,256,959,925,000 | 41.090278 | 155 | 0.727603 | false | 3.260355 | true | false | false |
epiphyte/freeradius | mods-config/python/utils/manage.py | 1 | 19663 | #!/usr/bin/python
"""Provides configuration management/handling for managing freeradius."""
import argparse
import os
import shutil
import hashlib
import json
import subprocess
import wrapper
import random
import string
import filecmp
import pwd
import urllib.parse
import urllib.request
import datetime
import ssl
REPO... | mit | -7,345,744,007,351,155,000 | 29.916667 | 77 | 0.520826 | false | 3.774813 | true | false | false |
illicitonion/givabit | lib/sdks/google_appengine_1.7.1/google_appengine/lib/google-api-python-client/oauth2client/client.py | 21 | 29300 | # Copyright (C) 2010 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 or agreed to in writ... | apache-2.0 | -4,644,838,545,094,304,000 | 30.37045 | 89 | 0.656758 | false | 4.09275 | false | false | false |
phoebe-project/phoebe2-docs | 2.1/tutorials/20_21_requiv.py | 1 | 1467 | #!/usr/bin/env python
# coding: utf-8
# 2.0 - 2.1 Migration: requiv
# ============================
# PHOEBE 2.0.x defined the size of a star by its polar radius, `rpole`. In addition, there was a constraint between `rpole` and the equipotential, `pot`, which could be reversed by the user so that `pot` defines the siz... | gpl-3.0 | -7,182,645,456,130,223,000 | 85.294118 | 623 | 0.744376 | false | 3.81039 | false | false | false |
shahbazn/neutron | neutron/db/l3_hascheduler_db.py | 46 | 3407 | # Copyright (C) 2014 eNovance SAS <licensing@enovance.com>
#
# 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 applicabl... | apache-2.0 | 2,054,340,540,476,066,300 | 40.54878 | 78 | 0.642501 | false | 3.764641 | false | false | false |
AntoineAugusti/katas | codingame/medium/indiana.py | 1 | 1384 | def exitDirection(roomType, enterPos):
if roomType in [1, 3, 7, 8, 9, 12, 13]:
return 'BOTTOM'
if roomType in [2, 6]:
if enterPos == 'LEFT':
return 'RIGHT'
else:
return 'LEFT'
if roomType == 4:
if enterPos == 'TOP':
return 'LEFT'
el... | mit | 6,257,156,601,985,853,000 | 27.244898 | 100 | 0.562139 | false | 3.468672 | false | false | false |
frank2/martinellis | lib/cidr.py | 1 | 20889 | #!/usr/bin/env python
import copy
import os
import random
import re
from hotmic import randiter, xrandrange
from martinellis import address, xlongrange
from martinellis.compat import *
class CIDRError(Exception):
'''
A general error that's raised when errors occur inside :py:class:`CIDR`
objects.'''
pass
... | gpl-3.0 | 5,335,981,248,540,678,000 | 33.356908 | 109 | 0.631146 | false | 3.906677 | false | false | false |
jubatus/jubakit | example/clustering_sklearn_wrapper.py | 1 | 1065 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
"""
Using Clustering
========================================
This is a simple example that illustrates Clustering service usage.
"""
from sklearn.datasets import make_blobs
from jubaki... | mit | -7,308,459,210,913,457,000 | 24.97561 | 82 | 0.649765 | false | 3.491803 | false | false | false |
rjhunter8285/nsc-cloudproject-s22016 | prototype/api/FlaskApp/FlaskApp/python_modules/flask_cors/decorator.py | 8 | 4916 | # -*- coding: utf-8 -*-
"""
flask_cors
~~~~
Flask-CORS is a simple extension to Flask allowing you to support cross
origin resource sharing (CORS) using a simple decorator.
:copyright: (c) 2014 by Cory Dolphin.
:license: MIT, see LICENSE for more details.
"""
from functools import update_wrappe... | apache-2.0 | -1,060,405,157,048,444,900 | 35.686567 | 80 | 0.662734 | false | 4.440831 | false | false | false |
crscardellino/dnnwsd | dnnwsd/pipeline/supervised.py | 1 | 5096 | # -*- coding: utf-8 -*-
import cPickle as pickle
import logging
import os
from sklearn import ensemble, linear_model, tree
from ..corpus import sensem, semeval
from ..experiment import results, supervised
from ..model import mlp, mfl
from ..processor import bowprocessor, vecprocessor
from ..utils.setup_logging impor... | bsd-3-clause | -3,776,247,624,523,305,000 | 39.125984 | 116 | 0.6146 | false | 3.854766 | false | false | false |
cbitterfield/JobCard | source/product.py | 1 | 13743 | '''
Created on Sep 30, 2017
@author: colin
'''
#===============================================================================
# Import
#===============================================================================
import os,glob
from string import Template
import shutil
import job
import logging
import subproce... | gpl-3.0 | -6,242,487,739,058,030,000 | 44.66113 | 197 | 0.536055 | false | 4.301408 | true | false | false |
jklukas/redshift_sqlalchemy | tests/test_copy_command.py | 1 | 3303 | import pytest
import sqlalchemy as sa
from redshift_sqlalchemy import dialect
from rs_sqla_test_utils.utils import clean, compile_query
access_key_id = 'IO1IWSZL5YRFM3BEW256'
secret_access_key = 'A1Crw8=nJwEq+9SCgnwpYbqVSCnfB0cakn=lx4M1'
creds = (
(
'aws_access_key_id={access_key_id}'
';aws_secr... | mit | -2,562,311,976,870,762,500 | 28.230088 | 78 | 0.632153 | false | 3.332997 | true | false | false |
CaliopeProject/CaliopeServer | src/cid/core/entities/generic_models/identification_document.py | 1 | 1521 | # -*- encoding: utf-8 -*-
"""
@authors: Andrés Felipe Calderón andres.calderon@correlibre.org
Sebastián Ortiz V. neoecos@gmail.com
@license: GNU AFFERO GENERAL PUBLIC LICENSE
SIIM Models are the data definition of SIIM2 Framework
Copyright (C) 2013 Infometrika Ltda.
This program is free software: you ... | agpl-3.0 | -8,721,913,453,313,323,000 | 35.142857 | 80 | 0.752964 | false | 3.942857 | false | false | false |
leiferikb/bitpop | build/scripts/tools/make_manhole.py | 3 | 1990 | #!/usr/bin/env python
# Copyright (c) 2011 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.
"""Generate a .manhole for all masters."""
import getpass
import os
import optparse
import subprocess
import sys
def check_outpu... | gpl-3.0 | -1,260,548,026,124,862,700 | 29.615385 | 80 | 0.657286 | false | 3.491228 | false | false | false |
blockstack/packaging | imported/future/src/libpasteurize/fixes/fix_add_all_future_builtins.py | 60 | 1270 | """
For the ``future`` package.
Adds this import line::
from builtins import (ascii, bytes, chr, dict, filter, hex, input,
int, list, map, next, object, oct, open, pow,
range, round, str, super, zip)
to a module, irrespective of whether each definition is used.... | gpl-3.0 | -7,345,221,367,281,167,000 | 32.421053 | 76 | 0.584252 | false | 3.981191 | false | false | false |
priestc/moneywagon | moneywagon/network_replay.py | 1 | 4358 | from __future__ import print_function
import random
from .crypto_data import crypto_data
from moneywagon import get_block, push_tx, get_single_transaction, watch_mempool
from .core import to_rawtx
from moneywagon.services import BitpayInsight, ChainSo, LocalBitcoinsChain, BlockDozer
class NetworkReplay(object):
d... | mit | 2,513,158,582,407,362,000 | 41.31068 | 136 | 0.615879 | false | 3.972653 | false | false | false |
who-ocr/ebola-dashboard | bin/epi-weeks-district.py | 1 | 3734 | import csv, sys
from datetime import date, timedelta
from itertools import groupby
import simplejson as json
inFile = "external_portal.csv"
today = date.today()
lastweek = today - timedelta(days=7)
# "","country","district","date","epiweek","EpiCaseDef","HCW"
# Open csv
data = csv.DictReader(open(inFile, 'rb'), del... | bsd-3-clause | 2,355,903,089,708,385,300 | 27.075188 | 135 | 0.658275 | false | 2.947119 | false | false | false |
seibert/blaze-core | blaze/module/qualname.py | 1 | 1381 | #------------------------------------------------------------------------
# Names
#------------------------------------------------------------------------
class Namespace(object):
def __init__(self, names):
self.names = names
def show(self):
return '.'.join(self.names)
class QualName(object)... | bsd-2-clause | 2,689,472,389,467,057,700 | 21.639344 | 73 | 0.391745 | false | 5.095941 | false | false | false |
jleclanche/fireplace | fireplace/actions.py | 1 | 41665 | import random
from collections import OrderedDict
from hearthstone.enums import (
BlockType, CardClass, CardType, Mulligan, PlayState, Step, Zone
)
from .dsl import LazyNum, LazyValue, Selector
from .entity import Entity
from .exceptions import InvalidAction
from .logging import log
from .utils import random_class
... | agpl-3.0 | -1,968,792,761,254,309,600 | 25.437183 | 91 | 0.690268 | false | 2.943483 | false | false | false |
2065983Y/spinner | objects.py | 1 | 6150 | from retrogamelib.util import load_image
from retrogamelib import gameobject
import pygame
from retrogamelib import button
from retrogamelib.constants import *
class Collidable(gameobject.Object):
def __init__(self):
gameobject.Object.__init__(self, self.groups)
self.offsetx = 0
self.offse... | cc0-1.0 | -2,957,446,565,656,670,700 | 28.430622 | 74 | 0.534472 | false | 3.371711 | false | false | false |
wendlers/pyscmpd | test-src/coreplayer.py | 1 | 4793 | import logging
import mpdserver
import soundcloud
import pyscmpd.scprovider as provider
import pyscmpd.gstplayer as coreplayer
mpd = None
player = None
scroot = None
class Play(mpdserver.Play):
def handle_args(self, songPos=0):
player.play(songPos)
class PlayId(mpdserver.PlayId):
def handle_args(self, s... | gpl-3.0 | 4,364,679,534,746,294,300 | 19.223629 | 74 | 0.65241 | false | 2.973325 | false | false | false |
ivanortegaalba/DAI_2014-2015 | Practica0/Ejercicios/Ejercicio2.py | 1 | 1485 | # -*- coding: utf-8 -*-
"""Ordena matrices unidimensionales aleatorias en funcion a un algoritmo elegido"""
import random;
def randomMatrix(n): #Crea un vector de n elementos aleatorios
random_vector = [];
for i in range(n):
random_vector.append(random.randint(0,100));
#print "vector["+str(i)+... | gpl-2.0 | 1,242,301,201,474,581,500 | 24.568966 | 88 | 0.559002 | false | 2.925049 | false | false | false |
Freeseer/freeseer | src/freeseer/plugins/videoinput/desktop/widget.py | 1 | 2226 | #!/usr/bin/python
# -*- coding: utf-8 -*-
'''
freeseer - vga/presentation capture software
Copyright (C) 2013 Free and Open Source Software Learning Centre
http://fosslc.org
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 ... | gpl-3.0 | -441,489,863,046,169,000 | 32.727273 | 102 | 0.722821 | false | 3.912127 | false | false | false |
cts2bu/hardy | count_unmarked_speaker_changes.py | 1 | 1391 | # -*- coding: utf-8 -*-
"""
Christopher Smith
King's College London 2017
"""
# This short file is used in Chapter 4 of my dissertation to help discuss the role of 'I' dialogue SVOs.
# It finds parts of the text where Hardy has two people talking but does not indicate a clear speaker change.
# These changes are import... | mit | 3,995,446,390,428,192,300 | 38.742857 | 116 | 0.660676 | false | 3.521519 | false | false | false |
brunosmmm/hbussd | hbussd/fakebus/hbus_fb.py | 1 | 26244 | # coding=utf-8
"""Fake bus for debugging without actual hardware connected
@package hbus_fb
@author Bruno Morais <brunosmmm@gmail.com>
@since 11/17/2014
@todo implement fake bus device structure
@todo load device configuration from files
"""
import configparser # #for fakebus device tree emulation
import l... | gpl-2.0 | -2,244,485,432,382,530,800 | 35.14876 | 131 | 0.52332 | false | 4.576112 | true | false | false |
ilastikdev/ilastik | ilastik/applets/carving/preprocess.py | 1 | 2166 | ###############################################################################
# ilastik: interactive learning and segmentation toolkit
#
# Copyright (C) 2011-2014, the ilastik developers
# <team@ilastik.org>
#
# This program is free software; you can redistribute it and/or
# mod... | gpl-3.0 | 103,088,480,244,754,380 | 30.852941 | 97 | 0.674515 | false | 3.30687 | false | false | false |
GNOME/transmageddon | src/udevdisco.py | 1 | 7827 | #! /usr/bin/env python3
# -.- coding: utf-8 -.-
"""
Arista Input Device Discovery
=============================
A set of tools to discover DVD-capable devices and Video4Linux devices that
emit signals when disks that contain video are inserted or webcames / tuner
cards are plugged in using udev.
... | lgpl-2.1 | 3,772,485,313,816,529,000 | 32.165254 | 82 | 0.584771 | false | 4.040785 | false | false | false |
chrisnorman7/gmp3 | gui/menus/file.py | 1 | 3781 | """File menu."""
import application, wx
from time import ctime
from .base import BaseMenu
from config import config
from ..create_playlist import CreatePlaylist
from ..internet_stream_frame import InternetStreamFrame
from ..genre_station import GenreStation
from functions.google import create_station, artist_... | mpl-2.0 | 2,796,154,888,292,483,000 | 56.169231 | 318 | 0.712245 | false | 3.520484 | false | false | false |
kidmaple/CoolWall | user/python/Demo/sgi/gl/kunst.py | 3 | 12545 | #! /usr/bin/env python
# Simulate the artwork in the hall.
# Jack Jansen, Feb 91.
from gl import *
from GL import *
from math import *
from DEVICE import *
import sys
import __main__
main_dict = __main__.__dict__
SPOTDIRECTION = 103
SPOTLIGHT = 104
#
# Make a cylinder paralel with the Z axis with center (X,Y,0)
# an... | gpl-2.0 | -2,046,946,415,437,634,800 | 28.448357 | 114 | 0.433559 | false | 2.996179 | false | false | false |
kosticlab/aether | lp/lp.py | 1 | 15631 | import subprocess
import os
import json
from scipy.optimize import linprog
import sys
import pickle
import math
import numpy
#from pandas import *
#this program will minimize cost per hour of distributed compute by utilizing Linear Programming to minimize cost/hour constrained by 1: minimum total cores desired at once... | mit | -8,093,024,960,960,471,000 | 54.038732 | 472 | 0.6759 | false | 3.159693 | false | false | false |
parenthetical-e/simfMRI | exp_examples.py | 1 | 3010 | """ Examples of how to subclass simfMRI.template.* classes. """
import numpy as np
import rl
import simfMRI
import simBehave
from simfMRI.expclass import Exp
from simBehave.trials import event_random
from simfMRI.misc import process_prng
class Simple(Exp):
""" A simple 1 condition experiment. """
def __in... | bsd-2-clause | 1,417,059,098,694,271,500 | 30.354167 | 77 | 0.556146 | false | 3.333333 | false | false | false |
praekelt/vumi-go | go/base/management/commands/go_list_accounts.py | 1 | 2326 | from optparse import make_option
from django.db.models import Q
from go.base.command_utils import (
BaseGoCommand, get_users, user_details_as_string)
class Command(BaseGoCommand):
help = """
List known accounts on Vumi Go. Allows for optional searching on the
username.
Usage:
./go-admin.sh... | bsd-3-clause | -7,048,922,290,474,083,000 | 34.242424 | 76 | 0.579966 | false | 3.794454 | false | false | false |
Per-Starke/MatchGame | src/assignLengthAndVictory.py | 1 | 2737 | __author__ = 'Per'
from Match_class import Match
from Player_class import Player
import random
numberOfPlayers = input("how many players? ")
def defineListOfPlayers(): # returs a list of Objects of Player_class, name = input
listOfPlayers = []
for i in range (0, numberOfPlayers):
playerName = r... | apache-2.0 | 1,302,924,172,720,339,000 | 29.422222 | 159 | 0.705517 | false | 3.49553 | false | false | false |
tensorflow/probability | tensorflow_probability/python/math/ode/dormand_prince.py | 1 | 27600 | # Copyright 2019 The TensorFlow Probability Authors.
#
# 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 | -5,059,797,122,007,331,000 | 38.71223 | 80 | 0.659094 | false | 3.628714 | false | false | false |
pytorch/vision | torchvision/ops/misc.py | 1 | 3316 | """
helper class that supports empty tensors on some nn functions.
Ideally, add support directly in PyTorch to empty tensors in
those functions.
This can be removed once https://github.com/pytorch/pytorch/issues/12013
is implemented
"""
import warnings
import torch
from torch import Tensor
from typing import List, O... | bsd-3-clause | 1,454,685,831,436,563,000 | 32.494949 | 95 | 0.616405 | false | 3.721661 | false | false | false |
asljivo1/802.11ah-ns3 | ns-3/.waf-1.8.12-f00e5b53f6bbeab1384a38c9cc5d51f7/waflib/fixpy2.py | 20 | 1086 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
import os
all_modifs={}
def fixdir(dir):
global all_modifs
for k in all_modifs:
for v in all_modifs[k]:
modif(os.path.join(dir,'waflib'),k,v)
def modif(dir,name,fun):
if name=='*':
lst=[]
... | gpl-2.0 | -5,775,268,170,740,209,000 | 19.490566 | 78 | 0.635359 | false | 2.386813 | false | false | false |
altaetran/bayesianoracle | tests/quadraticBayesianAveraging/quadraticBayesianAveragingTest1.py | 1 | 2787 | import numpy as np
import bayesianoracle as bo
def plot(bma, X, mode, k_fig):
""" Auxillary plotting function
Parameters
----------
bma : bayesianModelAveraging object to be plotted
X : The values that have been previously traversed
mode : mode = "predict" if the GaussianProcessEI predict... | apache-2.0 | 983,195,360,901,927,800 | 26.058252 | 79 | 0.569429 | false | 2.554537 | false | false | false |
Dev-Cloud-Platform/Dev-Cloud | dev_cloud/cc1/src/cm/utils/threads/image.py | 1 | 8639 | # -*- coding: utf-8 -*-
# @COPYRIGHT_begin
#
# Copyright [2010-2014] Institute of Nuclear Physics PAN, Krakow, Poland
#
# 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.apac... | apache-2.0 | 6,565,482,885,360,597,000 | 37.566964 | 114 | 0.573562 | false | 3.7205 | false | false | false |
adrienbrault/home-assistant | homeassistant/components/isy994/entity.py | 3 | 7946 | """Representation of ISYEntity Types."""
from pyisy.constants import (
COMMAND_FRIENDLY_NAME,
EMPTY_TIME,
EVENT_PROPS_IGNORED,
PROTO_GROUP,
PROTO_ZWAVE,
)
from pyisy.helpers import NodeProperty
from homeassistant.const import STATE_OFF, STATE_ON
from homeassistant.helpers.entity import Entity
from... | mit | 6,154,170,976,010,785,000 | 36.658768 | 88 | 0.585829 | false | 4.054082 | false | false | false |
tanghaibao/jcvi | jcvi/assembly/kmer.py | 1 | 39718 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
Deals with K-mers and K-mer distribution from reads or genome
"""
import os.path as op
import sys
import logging
import math
import numpy as np
from collections import defaultdict
from jcvi.graphics.base import (
plt,
adjust_spines,
asciiplot,
set_hum... | bsd-2-clause | -7,004,132,905,744,764,000 | 30.102584 | 128 | 0.533587 | false | 3.209535 | false | false | false |
lemiere/python-lecture | tp_aleatoire/correction/monte_carlo.py | 1 | 2661 | #!/usr/bin/python3.5
# -*- coding: utf-8 -*-
# Lemiere Yves
# Juillet 2017
import matplotlib.pyplot as plt
import random
import math
import numpy as np
def distance(x1,y1,x2,y2):
distance = 0
dx = (x2-x1)
dy = (y2-y1)
distance = math.sqrt(dx*dx + dy*dy)
return distance
def move(x1,y1):
n... | gpl-3.0 | 635,607,284,448,390,500 | 22.758929 | 98 | 0.455468 | false | 3.285185 | false | false | false |
zakuro9715/luka | luka/gui/qt.py | 1 | 4128 | import shutil
import os
from PySide.QtCore import *
from PySide.QtGui import *
import luka
def removeChildrenRecursive(item, i = 0):
if i > 50:
raise Exception()
while item.count() > 0:
child = item.itemAt(0)
layout, widget = child.layout(), child.widget()
if layout:
... | gpl-3.0 | -3,421,518,289,273,798,700 | 28.697842 | 86 | 0.628634 | false | 3.898017 | false | false | false |
acfogarty/espressopp | src/interaction/TabulatedAngular.py | 3 | 5631 | # Copyright (C) 2016
# Jakub Krajniak (jkrajniak at gmail.com)
# Copyright (C) 2012,2013
# Max Planck Institute for Polymer Research
# Copyright (C) 2008,2009,2010,2011
# Max-Planck-Institute for Polymer Research & Fraunhofer SCAI
#
# This file is part of ESPResSo++.
#
# ESPResSo++ is free softw... | gpl-3.0 | -6,712,838,251,019,995,000 | 38.93617 | 118 | 0.705026 | false | 3.528195 | false | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.