repo_name stringlengths 5 92 | path stringlengths 4 221 | copies stringclasses 19
values | size stringlengths 4 6 | content stringlengths 766 896k | license stringclasses 15
values | hash int64 -9,223,277,421,539,062,000 9,223,102,107B | line_mean float64 6.51 99.9 | line_max int64 32 997 | alpha_frac float64 0.25 0.96 | autogenerated bool 1
class | ratio float64 1.5 13.6 | config_test bool 2
classes | has_no_keywords bool 2
classes | few_assignments bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
snahelou/awx | awx/wsgi.py | 1 | 1061 | # Copyright (c) 2015 Ansible, Inc.
# All Rights Reserved.
import logging
from awx import __version__ as tower_version
# Prepare the AWX environment.
from awx import prepare_env, MODE
prepare_env()
from django.core.wsgi import get_wsgi_application # NOQA
"""
WSGI config for AWX project.
It exposes the WSGI callabl... | apache-2.0 | -8,377,897,960,142,211,000 | 31.151515 | 129 | 0.717248 | false | 3.944238 | false | false | false |
hsogo/psychopy_tobii_controller | ptc_components/ptc_components/ptc_rec.py | 1 | 2309 | #
# Tobii controller for PsychoPy
#
# author: Hiroyuki Sogo
# Distributed under the terms of the GNU General Public License v3 (GPLv3).
#
from psychopy.experiment.components import BaseComponent, Param
from os import path
thisFolder = path.abspath(path.dirname(__file__))#the absolute path to the folder containing th... | gpl-3.0 | 115,762,942,494,212,050 | 44.27451 | 111 | 0.635773 | false | 3.718196 | false | false | false |
rananda/cfme_tests | cfme/storage/object_store.py | 1 | 1986 | # -*- coding: utf-8 -*-
from functools import partial
from navmazing import NavigateToSibling, NavigateToAttribute
from cfme.common import SummaryMixin, Taggable
from cfme.fixtures import pytest_selenium as sel
from cfme.web_ui import toolbar as tb
from cfme.web_ui import Quadicon, match_location, mixins
from utils.ap... | gpl-2.0 | 6,070,858,971,415,374,000 | 30.52381 | 90 | 0.680765 | false | 3.754253 | false | false | false |
Chilipp/nc2map | evaluators.py | 1 | 32393 | # -*- coding: utf-8 -*-
"""Evaluators module of the nc2map package.
This module (currently) contains two evaluators of MapBase instances plus the
base class.
Classes are:
- EvaluatorBase: (Subclass of MapsManager). Base class for all evaluators
(this class itself does nothing but provide the general framework... | gpl-2.0 | 6,665,268,643,128,033,000 | 46.491202 | 79 | 0.521257 | false | 4.376892 | false | false | false |
ales-erjavec/orange-canvas | orangecanvas/preview/previewdialog.py | 1 | 3876 | """
A dialog widget for selecting an item.
"""
from typing import Iterable, Optional, Any
from AnyQt.QtWidgets import (
QDialog, QWidget, QVBoxLayout, QDialogButtonBox, QSizePolicy
)
from AnyQt.QtCore import Qt, QStringListModel, QAbstractItemModel
from AnyQt.QtCore import pyqtSignal as Signal
from . import previ... | gpl-3.0 | 1,844,924,543,785,083,100 | 31.3 | 83 | 0.608617 | false | 4.167742 | false | false | false |
Turupawn/website | runners/migrations/0001_initial.py | 1 | 1722 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('platforms', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Runner',
fields=[
... | agpl-3.0 | -5,153,796,980,511,601,000 | 39.046512 | 158 | 0.533101 | false | 4.348485 | false | false | false |
ajmedford/catmap | catmap/parsers/table_parser.py | 1 | 17136 | import numpy as np
import catmap
from parser_base import *
string2symbols = catmap.string2symbols
Template = catmap.Template
class TableParser(ParserBase):
"""Parses attributes based on column headers and filters.
Additional functionality may be added by inheriting and defining
the parse_{header_name}... | gpl-3.0 | 238,050,990,544,195,740 | 47.681818 | 108 | 0.474907 | false | 4.75208 | false | false | false |
BiRG/Omics-Dashboard | omics/omics_dashboard/blueprints/api/analyses.py | 1 | 2789 | from flask import Blueprint, jsonify, request
from flask_login import login_required
import data_tools as dt
from helpers import get_current_user, handle_exception
analyses_api = Blueprint('analyses_api', __name__, url_prefix='/api/analyses')
@analyses_api.route('/', methods=['GET', 'POST'])
@login_required
def lis... | mit | -5,069,418,989,384,102,000 | 41.257576 | 117 | 0.622087 | false | 4.01295 | false | false | false |
kadrlica/ugali | ugali/candidate/associate.py | 1 | 16821 | #!/usr/bin/env python
import os,sys
from os.path import join,abspath,split
import inspect
from collections import OrderedDict as odict
import numpy as np
from numpy.lib.recfunctions import stack_arrays
import fitsio
import ugali.utils.projector
from ugali.utils.projector import gal2cel, cel2gal
import ugali.utils.idl... | mit | 6,533,313,649,244,551,000 | 34.562368 | 127 | 0.580584 | false | 3.030811 | false | false | false |
SalesforceFoundation/CumulusCI | cumulusci/tasks/metadata_etl/permissions.py | 1 | 4361 | from cumulusci.core.exceptions import TaskOptionsError
from cumulusci.tasks.metadata_etl import MetadataSingleEntityTransformTask
from cumulusci.utils.xml.metadata_tree import MetadataElement
class AddPermissionSetPermissions(MetadataSingleEntityTransformTask):
entity = "PermissionSet"
task_options = {
... | bsd-3-clause | 2,393,319,820,197,800,000 | 41.339806 | 299 | 0.579454 | false | 4.750545 | false | false | false |
ArchanjoJr/solid-robot | app.py | 1 | 2056 | import requests as re
from delete import *
import pprint
import json
import sys
langs = ['en-US', 'de-DE', 'es-ES', 'es-MX', 'fr-FR', 'it-IT', 'ja-JP', 'pl-PL', 'pt-BR', 'ru-RU']
index = 0
if len(sys.argv) > 0:
if sys.argv[1] in langs:
index = langs.index(sys.argv[1])
print("Getting a JSON for the " + lang... | mit | -6,035,645,404,594,599,000 | 31.634921 | 98 | 0.580253 | false | 2.97971 | false | false | false |
simvisage/oricreate | oricreate/factories/hexagonal_cp_factory.py | 1 | 6886 | # -------------------------------------------------------------------------
#
# Copyright (c) 2009, IMB, RWTH Aachen.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in simvisage/LICENSE.txt and may be redistributed only
# under the conditions describe... | gpl-3.0 | 5,428,420,417,678,322,000 | 27.221311 | 76 | 0.472117 | false | 2.757709 | false | false | false |
aerler/HGS-Tools | Python/geospatial/xarray_tools.py | 1 | 40502 | '''
Created on Feb. 23, 2019
Utility functions to extract data from xarray Dataset or DataArray classes.
@author: Andre R. Erler, GPL v3
'''
from warnings import warn
from datetime import datetime
import os
import numpy as np
import xarray as xr
import netCDF4 as nc
from dask.diagnostics import ProgressBar
# intern... | gpl-3.0 | -2,811,596,414,685,821,000 | 46.989336 | 150 | 0.616463 | false | 3.83687 | false | false | false |
kaushik94/sympy | sympy/physics/quantum/tests/test_boson.py | 2 | 1542 | from sympy import sqrt, exp, prod, Rational
from sympy.core.compatibility import range
from sympy.physics.quantum import Dagger, Commutator, qapply
from sympy.physics.quantum.boson import BosonOp
from sympy.physics.quantum.boson import (
BosonFockKet, BosonFockBra, BosonCoherentKet, BosonCoherentBra)
def test_bos... | bsd-3-clause | -4,047,575,561,741,689,000 | 33.266667 | 77 | 0.656939 | false | 2.714789 | false | false | false |
jenfly/monsoon-onset | scratchpad.py | 1 | 38032 | import sys
sys.path.append('/home/jwalker/dynamics/python/atmos-tools')
sys.path.append('/home/jwalker/dynamics/python/atmos-read')
import numpy as np
import xarray as xray
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
from pydap.client import open_url
import atmos as atm
import merra
import ... | mit | -1,380,522,120,908,778,200 | 32.099217 | 93 | 0.564145 | false | 2.678994 | false | false | false |
editxt/editxt | editxt/command/blame.py | 1 | 2967 | # -*- coding: utf-8 -*-
# EditXT
# Copyright 2007-2016 Daniel Miller <millerdev@gmail.com>
#
# This file is part of EditXT, a programmer's text editor for Mac OS X,
# which can be found at http://editxt.org/.
#
# EditXT is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Publ... | gpl-3.0 | -5,294,403,790,234,940,000 | 33.103448 | 78 | 0.640377 | false | 3.929801 | true | false | false |
sgkang/PhysPropIP | codes/ZarcFit2015-11-12.py | 1 | 4144 |
import numpy as np
import sys
from PyQt4 import QtGui
from PyQt4.uic import loadUiType
from matplotlib.figure import Figure
from matplotlib.backends.backend_qt4agg import (
FigureCanvasQTAgg as FigureCanvas,
NavigationToolbar2QT as NavigationToolbar)
Ui_MainWindow, QMainWindow = loadUiType('ZarcFit2015-11... | mit | 4,866,987,108,303,030,000 | 31.382813 | 89 | 0.645029 | false | 2.784946 | false | false | false |
FabriceSalvaire/Musica | Musica/Audio/Spectrum.py | 1 | 7542 | ####################################################################################################
#
# Musica - A Music Theory Package for Python
# Copyright (C) 2017 Fabrice Salvaire
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as pub... | gpl-3.0 | 2,083,419,971,255,120,400 | 30.037037 | 100 | 0.522806 | false | 4.17608 | false | false | false |
Vito2015/tcc3-portal | tcc3portal/tcc_core/middleware.py | 1 | 2480 | # coding:utf-8
"""
tcc3portal.tcc_core.middleware
~~~~~~~~~~~~~~~~~~~~~~~~~
tcc3portal tcc_core middleware module.
:copyright: (c) 2015 by Vito.
:license: GNU, see LICENSE for more details.
"""
from werkzeug.urls import url_decode
class HTTPMethodOverrideMiddleware(object):
"""The HTTPMethod... | gpl-2.0 | -5,644,159,451,796,110,000 | 40.333333 | 92 | 0.660887 | false | 4.182125 | false | false | false |
mattasmith/SCHEMA-RASPP | schemaenergy.py | 1 | 8117 | #! /usr/local/bin/python
"""Script for calculating SCHEMA energies.
******************************************************************
Copyright (C) 2005 Allan Drummond, California Institute of Technology
This program is free software: you can redistribute it and/or modify
it under the terms of the G... | gpl-3.0 | 2,953,055,289,161,466,000 | 34.138528 | 173 | 0.67488 | false | 2.859105 | false | false | false |
phorust/howmanygiven | 61a/trends/graphics.py | 1 | 7390 | """The graphics module implements a simple GUI library."""
import sys
import math
try:
import tkinter
except Exception as e:
print('Could not load tkinter: ' + str(e))
FRAME_TIME = 1/30
class Canvas(object):
"""A Canvas object supports drawing and animation primitives.
draw_* methods return the id ... | mit | 1,031,208,024,837,745,900 | 34.190476 | 100 | 0.579973 | false | 3.762729 | false | false | false |
michel-rodrigues/forum | source/comments/models.py | 1 | 1226 | from django.conf import settings
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.core.urlresolvers import reverse
from django.db import models
class CommentManager(models.Manager):
def filter_by_instance(self, instance):
... | gpl-3.0 | -4,633,203,222,845,435,000 | 31.236842 | 76 | 0.666939 | false | 4.422383 | false | false | false |
actlea/TopicalCrawler | TopicalCrawl/TopicalCrawl/TopicalCrawl/spiders/apprentice.py | 1 | 2542 | #!/usr/bin/env python
#-*- coding: utf-8 -*-
"""
@author: actlea
@file: apprentice.py
@time: 16-3-19 下午2:28
@description:
"""
from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor
from scrapy.contrib.spiders import CrawlSpider, Rule
from scrapy.http import Request
from TopicalCrawl.items import ResponseI... | gpl-3.0 | 6,758,932,857,458,104,000 | 27.681818 | 94 | 0.606181 | false | 3.329815 | false | false | false |
google-research-datasets/natural-questions | simplify_nq_data.py | 1 | 2567 | # coding=utf-8
# Copyright 2018 The Google AI Language Team 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 ... | apache-2.0 | 6,546,578,906,025,235,000 | 33.226667 | 95 | 0.676665 | false | 3.570236 | false | false | false |
WaterIsland/DLStudy | mln/CR/test-handwrite.py | 1 | 2342 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# This precision method refered by
# http://scikit-learn.org/stable/auto_examples/classification/plot_digits_classification.html
# https://github.com/sylvan5/PRML/blob/master/ch5/digits.py
#
import time
import cv2
import numpy as np
import Mln as mln
import dump as dp
i... | mit | 907,138,524,347,847,800 | 33.955224 | 163 | 0.60333 | false | 3.303244 | false | false | false |
mperignon/anuga-sedtransport | demo_files/run_raster_sed_transport_veg.py | 1 | 5666 | """
Example of use of sediment transport and vegetation drag operators over
a raster-derived topography
M. Perignon
perignon@colorado.edu
July 2014
"""
#------------------------------------------------------------------------------
# Import necessary modules
#-------------------------------------------... | gpl-2.0 | -5,832,266,252,321,722,000 | 31.146199 | 115 | 0.513237 | false | 4.153959 | false | false | false |
alexfalcucc/anaconda | anaconda_lib/autopep/autopep_wrapper.py | 1 | 1460 | # -*- coding: utf8 -*-
# Copyright (C) 2013 - Oscar Campos <oscar.campos@member.fsf.org>
# This program is Free Software see LICENSE file for details
"""
This file is a wrapper for autopep8 library.
"""
import os
import sys
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '../linting'))
import threading
f... | gpl-3.0 | -3,411,383,632,525,060,600 | 27.627451 | 76 | 0.599315 | false | 3.762887 | false | false | false |
DIvyanshu-Goel/Biped | biped/include/left_leg.py | 1 | 4723 | #!/usr/bin/env python
import sys
import rospy
import time
import numpy as np
from std_msgs.msg import *
from math import *
from dynamixel_msgs.msg import JointState
from biped.msg import *
from biped.srv import *
#for details on motor ids see Data_Server.py
start_pos = [0, 0 ,0 , 0, 0, 0];
motorid_LL = [19,20,21,22,23... | cc0-1.0 | 612,075,465,432,627,600 | 49.244681 | 198 | 0.584163 | false | 3.129887 | false | false | false |
HJLebbink/x86doc | Python/extract.py | 1 | 1292 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
import sys
from pdfminer.pdfdocument import PDFDocument
from pdfminer.pdfparser import PDFParser
from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter
from pdfminer.pdfpage import PDFPage
from pdfminer.layout import LAParams
from pdfminer.converter import P... | mit | -6,772,827,665,649,511,000 | 27.711111 | 83 | 0.729102 | false | 3.15122 | false | false | false |
FlightGear/flightgear | scripts/python/demo.py | 1 | 1204 | #! /usr/bin/env python3
# -*- coding: utf-8 -*-
from FlightGear import FlightGear
import time
def main():
fg = FlightGear('localhost', 5500)
# Wait five seconds for simulator to settle down
while 1:
if fg['/sim/time/elapsed-sec'] > 5:
break
time.sleep(1.0)
print(fg['/s... | gpl-2.0 | 6,510,073,827,120,023,000 | 23.571429 | 71 | 0.613787 | false | 2.92233 | false | false | false |
anish/buildbot | master/buildbot/test/util/db.py | 1 | 11486 | # This file is part of Buildbot. Buildbot 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, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | gpl-2.0 | 3,904,388,709,226,155,000 | 40.615942 | 104 | 0.628678 | false | 4.387319 | true | false | false |
stuart-knock/tvb-library | tvb/datatypes/mode_decompositions.py | 1 | 13929 | # -*- coding: utf-8 -*-
#
#
# TheVirtualBrain-Scientific Package. This package holds all simulators, and
# analysers necessary to run brain-simulations. You can use it stand alone or
# in conjunction with TheVirtualBrain-Framework Package. See content of the
# documentation-folder for more details. See also http://ww... | gpl-2.0 | -2,460,027,885,842,812,000 | 41.993827 | 116 | 0.635724 | false | 3.853112 | false | false | false |
EndingCredits/PyGame-Learning-Environment | ple/games/monsterkong/monsterPerson.py | 1 | 6130 | __author__ = 'Erilyth'
import pygame
import os
from person import Person
'''
This class defines all the Monsters present in our game.
Each Monster can only move on the top floor and cannot move vertically.
'''
class MonsterPerson(Person):
def __init__(self, raw_image, position, rng, dir, width=15, height=15):
... | mit | 3,208,077,670,063,567,000 | 43.744526 | 126 | 0.528222 | false | 3.892063 | false | false | false |
jordiguerrero/FresonCam | Fresonbot.py | 1 | 3705 | import Adafruit_BBIO.PWM as PWM
import Adafruit_BBIO.GPIO as GPIO
#import Adafruit_BBIO.ADC as ADC #IR
import subprocess
import math
import pinout
class Fresonbot(object):
ticksPerTurn = 12 *100 # 12 counts per revolution * 100:1 reduction gearbox
## you have to take this measures accurately
# WheelRadius ... | gpl-3.0 | -2,484,470,841,870,335,500 | 29.121951 | 99 | 0.633198 | false | 3.331835 | false | false | false |
SciViews/sciviewsk | pylib/cile_r.py | 1 | 4738 | #!/usr/bin/env python
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License
# Version 1.1 (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.mozil... | lgpl-2.1 | 2,992,210,303,469,165,000 | 35.446154 | 76 | 0.688898 | false | 3.707355 | false | false | false |
orionzhou/robin | formats/fastq.py | 1 | 37468 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Processing fastq files
"""
import os.path as op
import sys
import re
import logging
import json
import gzip
from itertools import islice
from Bio import SeqIO
from Bio.SeqIO.QualityIO import FastqGeneralIterator
from maize.formats.base import must_open, DictFile
fr... | gpl-2.0 | 7,219,325,160,960,035,000 | 30.14547 | 115 | 0.559678 | false | 3.416743 | false | false | false |
Justyer/NightHeartDataPlatform | firefly/app/doc/views.py | 1 | 3838 | from flask import jsonify, json
from flask import render_template, session, redirect, url_for, current_app, request
from .. import db
from ..models import Doc, DataSrc
from . import doc
from pymongo import MongoClient
#add a new doc without content
@doc.route('/doc/add', methods=['POST'])
def newDataSrc():
data = jso... | mit | 422,848,269,793,811,500 | 30.719008 | 99 | 0.670922 | false | 2.807608 | false | false | false |
kaushik94/sympy | sympy/solvers/pde.py | 2 | 36106 | """
This module contains pdsolve() and different helper functions that it
uses. It is heavily inspired by the ode module and hence the basic
infrastructure remains the same.
**Functions in this module**
These are the user functions in this module:
- pdsolve() - Solves PDE's
- classify_pde() - Classif... | bsd-3-clause | -722,910,946,330,786,300 | 34.294233 | 127 | 0.541517 | false | 3.604832 | false | false | false |
astokes/SynVinQR | etude/QR_here.py | 1 | 1432 | # QR_here.py displays the current URL encoded as a QR image.
import os, sys, inspect
#
# Much ugly bother to work with a local copy of pyqrcode
#
curpath = os.path.split(inspect.getfile(inspect.currentframe()))[0]
newpath = os.path.join(curpath, "../pyqrcode-read-only")
cmd_folder = os.path.realpath(os.path.abspath... | bsd-2-clause | 5,605,485,311,043,706,000 | 27.078431 | 93 | 0.687849 | false | 3.291954 | false | false | false |
sfu-fas/coursys | grad/importer/career.py | 1 | 12498 | from .parameters import SIMS_SOURCE, RELEVANT_PROGRAM_START, CMPT_CUTOFF
from .happenings import build_program_map, build_reverse_program_map
from .happenings import ProgramStatusChange, ApplProgramChange, GradResearchArea
from .tools import STRM_MAP
from coredata.queries import add_person
from grad.models import Grad... | gpl-3.0 | -4,438,936,686,740,990,500 | 43.635714 | 153 | 0.614898 | false | 3.504767 | true | false | false |
graik/biskit | archive_biskit2/scripts/Mod/setup_validation.py | 1 | 1908 | #!/usr/bin/env python
##
## Biskit, a toolkit for the manipulation of macromolecular structures
## Copyright (C) 2004-2018 Raik Gruenberg & Johan Leckner
##
## 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 Softwar... | gpl-3.0 | 2,084,467,221,445,404,400 | 27.909091 | 70 | 0.650419 | false | 3.733855 | false | false | false |
callofdutyops/YXH2016724098982 | eye_eval.py | 1 | 4555 | """Evaluation for eye.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import math
import time
from datetime import datetime
import numpy as np
import tensorflow as tf
import eye_model
FLAGS = tf.app.flags.FLAGS
tf.app.flags.DEFINE_string('eval_dir', ... | mit | 1,335,802,770,314,994,700 | 35.44 | 82 | 0.591218 | false | 3.940311 | false | false | false |
kayhayen/Nuitka | tests/basics/Classes34.py | 1 | 1298 | # Copyright 2021, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Python tests originally created or extracted from other peoples work. The
# parts were too small to be protected.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the ... | apache-2.0 | -3,027,807,181,180,732,400 | 25.489796 | 79 | 0.671032 | false | 3.92145 | false | false | false |
PainNarrativesLab/TextTools | NgramTools.py | 1 | 5758 | """
Previously in TextTools
Created by adam on 11/11/15
"""
__author__ = 'adam'
class NgramGetter(object):
"""
Abstract parent class for extracting ngrams.
Attributes:
collocation_finder: One of the nltk's collocation finder tools (e.g., BigramCollocationFinder)
top_likelihood_ratio:
... | mit | 7,105,661,231,997,221,000 | 35.910256 | 117 | 0.619833 | false | 3.973775 | false | false | false |
naoliv/osmose-backend | plugins/Source.py | 1 | 3739 | #-*- coding: utf-8 -*-
###########################################################################
## ##
## Copyrights Etienne Chové <chove@crans.org> 2010 ##
## ... | gpl-3.0 | -6,301,568,131,360,903,000 | 42.870588 | 158 | 0.472513 | false | 4.018319 | false | false | false |
ytsvetko/adjective_supersense_classifier | src/eval.py | 1 | 1937 | #!/usr/bin/env python2.7
from __future__ import division
import sys
import json
import argparse
import collections
parser = argparse.ArgumentParser()
parser.add_argument("--predicted_results", required=True)
parser.add_argument("--held_out_seed", required=True)
parser.add_argument("--out_file", default=None)
args ... | gpl-2.0 | 1,734,206,193,779,853,800 | 25.902778 | 88 | 0.662881 | false | 3.374564 | false | false | false |
OCA/partner-contact | partner_deduplicate_filter/tests/test_partner_deduplicate_filter.py | 1 | 3138 | # Copyright 2016 Tecnativa - Pedro M. Baeza
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo.tests import common
from odoo.tools.safe_eval import safe_eval
class TestDeduplicateFilter(common.TransactionCase):
def setUp(self):
super(TestDeduplicateFilter, self).setUp()
... | agpl-3.0 | 7,859,822,055,651,330,000 | 37.268293 | 78 | 0.555449 | false | 3.855037 | true | false | false |
opensim-org/opensim-core | OpenSim/Moco/Archive/Tests/plot_gait10dof18musc_activation.py | 1 | 3138 | # -------------------------------------------------------------------------- #
# OpenSim Moco: plot_gait10dof18musc_activation.py #
# -------------------------------------------------------------------------- #
# Copyright (c) 2017 Stanford University and the Authors #
# ... | apache-2.0 | -31,799,801,736,403,156 | 40.84 | 78 | 0.516571 | false | 3.478936 | false | false | false |
coleifer/peewee | examples/twitter/app.py | 1 | 11440 | import datetime
from flask import Flask
from flask import g
from flask import redirect
from flask import request
from flask import session
from flask import url_for, abort, render_template, flash
from functools import wraps
from hashlib import md5
from peewee import *
# config - aside from our database, the rest is f... | mit | 629,514,362,000,838,700 | 35.433121 | 89 | 0.658741 | false | 3.948913 | false | false | false |
stevei101/flask-neo4j | flask_neo4j.py | 1 | 5909 | from __future__ import print_function
import time
import logging
from py2neo import Graph,Node
from py2neo.ext import ogm
from py2neo.packages.httpstream.http import SocketError
log = logging.getLogger('flask.neo4j')
logging.basicConfig()
# Find the stack on which we want to store the GraphDatabaseService instance.
... | mit | 5,536,978,590,505,155,000 | 34.172619 | 103 | 0.594855 | false | 4.12928 | true | false | false |
RedHatSatellite/satellite-clone | library/parse_backup_metadata.py | 1 | 2177 | import yaml
import re
from ansible.module_utils.basic import *
# module: parse_backup_metadata
# description:
# - Return the Satellite version and Puppet version
# specified in a Satellite backup
# notes:
# - The Satellite version is determined from the Satellite rpm
# version using the backup's rpm l... | gpl-3.0 | 5,713,598,998,334,430,000 | 28.026667 | 86 | 0.62701 | false | 3.528363 | false | false | false |
liveaverage/baruwa | src/baruwa/reports/management/commands/sendpdfreports.py | 1 | 17166 | #
# Baruwa - Web 2.0 MailScanner front-end.
# Copyright (C) 2010-2012 Andrew Colin Kissa <andrew@topdog.za.net>
#
# 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... | gpl-2.0 | 2,146,115,334,760,439,300 | 39.968974 | 92 | 0.498078 | false | 4.167516 | false | false | false |
allanice001/RJ45 | plugins/op.py | 1 | 5033 | from util import hook
def mode_cmd(mode, text, inp, chan, conn, notice):
""" generic mode setting function """
split = inp.split(" ")
if split[0].startswith("#"):
channel = split[0]
target = split[1]
notice("Attempting to {} {} in {}...".format(text, target, channel))
conn.... | gpl-2.0 | 2,041,800,450,125,925,000 | 36.281481 | 80 | 0.588317 | false | 3.335321 | false | false | false |
NemoNessuno/SecretSanta | models.py | 1 | 4065 | from datetime import datetime
from sqlalchemy import Column, Integer, String, ForeignKey, Boolean, Date, Table, Enum
from sqlalchemy.orm import validates, relationship
from db_handler import Base
from password import Password
class User(Base):
__tablename__ = 'users'
email = Column(String(120), unique=True,... | mit | 8,756,999,794,135,497,000 | 30.511628 | 105 | 0.650431 | false | 3.977495 | false | false | false |
pybel/pybel | src/pybel/struct/query/seeding.py | 1 | 4933 | # -*- coding: utf-8 -*-
"""Query builder."""
import json
import logging
import random
from collections import UserList
from typing import Any, Dict, List, Set, TextIO, Union
from .constants import SEED_TYPE_ANNOTATION, SEED_TYPE_INDUCTION, SEED_TYPE_NEIGHBORS, SEED_TYPE_SAMPLE
from .selection import get_subgraph
fro... | mit | -4,059,376,988,022,714,000 | 29.263804 | 103 | 0.595986 | false | 3.921304 | false | false | false |
atumanov/ray | python/ray/tests/utils.py | 1 | 2682 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import subprocess
import sys
import tempfile
import time
import ray
def _pid_alive(pid):
"""Check if the process with this PID is alive or not.
Args:
pid: The pid to check.
Re... | apache-2.0 | -7,067,280,162,942,937,000 | 26.9375 | 78 | 0.636465 | false | 3.932551 | false | false | false |
ntoll/checklistDSL | checklistdsl/lex.py | 1 | 2961 | """
Tokeniser for a checklist DSL. (I was using Ply, but it sucked and this is a
*lot* simpler.)
(c) 2012 Nicholas H.Tollervey
"""
import re
class Token(object):
"""
Represents a token matched by the lexer.
"""
def __init__(self, token, value, roles=None, size=None):
"""
token - the t... | mit | 6,374,691,532,482,705,000 | 32.269663 | 79 | 0.504222 | false | 3.9375 | false | false | false |
jepler/linuxcnc-mirror | share/gscreen/skins/spartan/spartan_handler.py | 5 | 20745 | # This is a component of LinuxCNC
# Copyright 2013 Chris Morley <chrisinnanaimo@hotmail.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 the License, or
# (... | lgpl-2.1 | -4,601,279,397,498,643,000 | 43.326923 | 117 | 0.618752 | false | 3.253097 | false | false | false |
dufferzafar/mitmproxy | mitmproxy/console/master.py | 1 | 23553 | from __future__ import absolute_import, print_function, division
import mailcap
import mimetypes
import os
import os.path
import shlex
import signal
import stat
import subprocess
import sys
import tempfile
import traceback
import weakref
import six
import urwid
from typing import Optional # noqa
from mitmproxy impo... | mit | 3,386,347,636,308,486,700 | 29.273779 | 99 | 0.548295 | false | 3.867488 | false | false | false |
nel215/reinforcement-learning | rl/agent/td_lambda.py | 1 | 1026 | # coding: utf-8
class TDLambda(object):
def __init__(self, action_space, alpha=0.1, gamma=0.9, ld=0.5):
self.action_space = action_space
self.V = {}
self.E = {} # eligibility trace
self.alpha = alpha
self.gamma = gamma
self.ld = ld
self.obs = None
... | apache-2.0 | 209,233,239,150,808,030 | 26 | 100 | 0.542885 | false | 3.288462 | false | false | false |
saurabh6790/frappe | frappe/model/naming.py | 1 | 10734 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import now_datetime, cint, cstr
import re
from six import string_types
from frappe.model import log_types
def set_new_name(d... | mit | -6,251,812,142,639,861,000 | 28.98324 | 112 | 0.671325 | false | 3.080057 | false | false | false |
YunoHost/moulinette | moulinette/interfaces/cli.py | 1 | 17327 | # -*- coding: utf-8 -*-
import os
import sys
import getpass
import locale
import logging
from argparse import SUPPRESS
from collections import OrderedDict
from datetime import date, datetime
import argcomplete
from moulinette import msignals, m18n
from moulinette.core import MoulinetteError
from moulinette.interface... | agpl-3.0 | -4,121,375,827,570,136,000 | 31.087037 | 245 | 0.581347 | false | 4.229192 | false | false | false |
sethbrin/QM | version3/Xq2EFT/test_eft_calculator.py | 1 | 1468 | #!/usr/bin/env python2
import numpy as np
from time import time
from eft_calculator import EFT_calculator
import tools
def load_coordinates(name):
lines = open('random/'+name).readlines()[-7:-1]
coors = [[float(item) for item in line.split()[2:5]] for line in lines]
return np.array(coors)
def test_rand... | mit | 3,478,274,189,580,841,500 | 26.698113 | 79 | 0.56267 | false | 2.733706 | false | false | false |
lcharleux/abapy | abapy/future.py | 1 | 21311 | import numpy as np
import copy, math
from scipy.spatial import distance, Delaunay
def tri_area(vertices):
u = vertices[0]
v = vertices[1]
w = vertices[2]
return np.linalg.norm(np.cross( v-u, w-u)) / 2.
def tetra_volume(vertices):
u = vertices[0]
v = vertices[1]
w = vertices[2]
x = vertices[3]
re... | gpl-2.0 | 6,606,528,650,505,557,000 | 28.973277 | 92 | 0.483412 | false | 3.32154 | false | false | false |
lepisma/quint | quint/quint.py | 1 | 2711 | """
The main code implementing simple matrix Q-learning
"""
import numpy as np
import random
class quint:
"""
The class for creating a Q-learning system
"""
def __init__(self, reward_matrix, gamma, not_allowed_action = -1):
"""
Initializes a learner using the reward matrix
Reward Matrix structure
---... | mit | -6,707,977,200,800,861,000 | 24.828571 | 138 | 0.671708 | false | 3.410063 | false | false | false |
Petraea/jsonbot | jsb/lib/rest/server.py | 1 | 9836 | # jsb/socklib/rest/server.py
#
#
## jsb imports
from jsb.utils.exception import handle_exception, exceptionmsg
from jsb.utils.trace import calledfrom
from jsb.lib.persiststate import ObjectState
from jsb.lib.threads import start_new_thread
from jsb.version import version
## basic imports
from SocketServer import Ba... | mit | 3,100,006,748,161,896,000 | 34.128571 | 170 | 0.590077 | false | 4.001627 | false | false | false |
jkettleb/iris | lib/iris/tests/unit/experimental/regrid/test__CurvilinearRegridder.py | 1 | 4309 | # (C) British Crown Copyright 2015, Met Office
#
# This file is part of Iris.
#
# Iris 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 3 of the License, or
# (at your option) any later ve... | lgpl-3.0 | 5,790,575,823,600,031,000 | 35.516949 | 77 | 0.640288 | false | 3.475 | true | false | false |
lidavidm/sympy | sympy/liealgebras/type_b.py | 1 | 4610 | from __future__ import print_function, division
from sympy.core import Set, Dict, Tuple
from .cartan_type import Standard_Cartan
from sympy.matrices import eye
class TypeB(Standard_Cartan):
def __init__(self, n):
assert n >= 2
Standard_Cartan.__init__(self, "B", n)
def dimension(self):
... | bsd-3-clause | 1,039,584,278,923,336,400 | 25.959064 | 80 | 0.480477 | false | 3.492424 | false | false | false |
ruslanosipov/space | lib/ui.py | 1 | 6174 | MSG_COLORS = {
0: (100, 255, 100),
1: (100, 100, 100),
2: (200, 200, 200),
3: (200, 0, 0)}
UI_COLOR = (100, 100, 100)
SECONDARY_UI_COLOR = (165, 42, 42)
class UI(object):
global MSG_COLORS
global UI_COLOR
def __init__(self):
self.view_field = ''
self.colors = {}
... | gpl-2.0 | 5,297,271,675,530,443,000 | 30.181818 | 79 | 0.479268 | false | 3.717038 | false | false | false |
zepto/musio | musio/espeak_file.py | 1 | 9322 | #!/usr/bin/env python
# vim: sw=4:ts=4:sts=4:fdm=indent:fdl=0:
# -*- coding: UTF8 -*-
#
# A TTS module using the espeak library.
# Copyright (C) 2012 Josiah Gordon <josiahg@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 publi... | gpl-3.0 | 352,600,860,208,501,700 | 25.482955 | 90 | 0.536151 | false | 4.132092 | false | false | false |
Balannen/LSMASOMM | atom3/Kernel/LayoutModule/HierarchicalLayoutModule/CrossingModule/CrossingCounter.py | 1 | 2510 | """
CrossingCounter.py
By Denis Dube, 2005
"""
def countAllCrossings(levelDictionary):
"""
Returns all the edge crossings in the graph
Input: levelDictionary where each level is a list of NodeWrapper objects
Output: # of crossings between all the layers
"""
edgeCrossings = 0
for i in rang... | gpl-3.0 | 5,428,156,959,330,971,000 | 27.904762 | 77 | 0.652988 | false | 3.763118 | false | false | false |
NLeSC/embodied-emotions-scripts | embem/spellingnormalization/normalize_dataset.py | 1 | 3306 | """Create multilabel data set with normalized spelling.
The input consists of a directory of text files containing the dataset in
historic spelling.
The data set consists of:
<sentence id>\t<sentence>\tEmotie_Liefde (embodied emotions labels separated by
_)
<sentence id>\t<sentence>\tNone ('None' if no words were tagg... | apache-2.0 | 9,219,120,687,807,462,000 | 35.32967 | 79 | 0.569268 | false | 3.921708 | false | false | false |
shub0/algorithm-data-structure | python/bulls_cows.py | 1 | 1816 | '''
You are playing the following Bulls and Cows game with your friend: You write down a number and ask your friend to guess what the number is. Each time your friend makes a guess, you provide a hint that indicates how many digits in said guess match your secret number exactly in both digit and position (called "bulls... | bsd-3-clause | -4,210,370,346,375,803,000 | 46.789474 | 502 | 0.660793 | false | 3.831224 | false | false | false |
messense/wechatpy | wechatpy/work/replies.py | 1 | 1503 | # -*- coding: utf-8 -*-
from wechatpy import replies
from wechatpy.fields import IntegerField
REPLY_TYPES = {}
def register_reply(reply_type):
def register(cls):
REPLY_TYPES[reply_type] = cls
return cls
return register
@register_reply('text')
class TextReply(replies.TextReply):
agent... | mit | -2,669,429,921,473,059,000 | 21.772727 | 66 | 0.616101 | false | 3.893782 | false | false | false |
griffinfoster/pulsar-polarization-sims | scripts/fits2dat.py | 1 | 1233 | #!/usr/bin/env python
"""
Convert a PSR FITS file to a headerless dat text file of Stokes' values
"""
import pyfits as pf
import numpy as n
import os
import sys
if __name__ == "__main__":
from optparse import OptionParser
o = OptionParser()
o.set_usage('%prog [options] [FITS file]')
o.set_description(... | mit | -4,537,864,626,679,160,300 | 30.615385 | 117 | 0.634225 | false | 2.733925 | false | false | false |
hofmannedv/training-python | data-structures/double-list-deque.py | 1 | 1098 | # -----------------------------------------------------------
# demonstrates how to create and use a double-linked list
# using the collections module
#o
# (C) 2017 Frank Hofmann, Berlin, Germany
# Released under GNU Public License (GPL)
# email frank.hofmann@efho.de
# -------------------------------------------------... | gpl-2.0 | 2,345,776,736,003,069,400 | 20.96 | 61 | 0.629326 | false | 3.307229 | false | false | false |
bgshin/doc-classify-multi-gpu | src/cifar10/cifar10_multi_gpu_train.py | 1 | 10418 | # 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 | 1,322,780,122,425,422,600 | 37.161172 | 110 | 0.649165 | false | 3.73405 | false | false | false |
StamusNetworks/scirius | rules/backup.py | 1 | 7435 | """
Copyright(C) 2016, Stamus Networks
Written by Eric Leblond <eleblond@stamus-networks.com>
This file is part of Scirius.
Scirius is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License... | gpl-3.0 | 913,863,219,099,019,300 | 34.745192 | 112 | 0.627841 | false | 4.021092 | false | false | false |
ajkerr0/kappa | kappa/forcefield.py | 1 | 6117 | # -*- coding: utf-8 -*-
"""
Created on Mon Mar 21 13:16:37 2016
@author: Alex Kerr
Define general Forcefield class, and specific forcefields (AMBER, etc.) that inherit
the general one.
"""
import numpy as np
#forcefield class definitions
global_cutoff = 5.0 #angstroms
class Forcefield:
"""A classical forcefiel... | mit | -195,136,923,481,602,200 | 36.759259 | 90 | 0.510381 | false | 3.891221 | false | false | false |
spgill/python-spgill | spgill/printer/modules/formatting.py | 1 | 10499 | # stdlib imports
import contextlib
# vendor imports
# local imports
from spgill.printer import commands
class FormattingModule:
"""Mixin for text formatting functions."""
# Default flags
_flags = {
"encoding": None,
"inverted": False, # Flag for inverted text
"justification": 0... | mit | -5,918,906,474,870,654,000 | 27.843407 | 79 | 0.569197 | false | 4.313476 | false | false | false |
vgamula/asd | asd/projects/migrations/0001_initial.py | 1 | 4789 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Employee',
fields=[
('id', models.AutoField(ver... | mit | 5,522,352,361,105,949,000 | 40.643478 | 114 | 0.533514 | false | 4.438369 | false | false | false |
NicovincX2/Python-3.5 | Algorithmique/Mathématiques discrètes/Théorie de l'information/Théorie des codes/Distance de Levenshtein/levenshtein.py | 1 | 2428 | # -*- coding: utf-8 -*-
import os
"""
the operation ( =, -, +, * for respectively keep, delete, insert, substitute)
the coordinate in the first
and in the second string.
"""
def square_list(a, b, value=0):
return [[value, ] * b for j in range(a)]
def arg_min(* arg_list):
arg_s = None
for i, arg in enu... | gpl-3.0 | -1,356,546,386,466,508,500 | 23.525253 | 77 | 0.421746 | false | 2.715884 | false | false | false |
kdechant/eamon | player/migrations/0003_rating.py | 1 | 1049 | # Generated by Django 2.2.1 on 2019-07-04 04:49
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('adventure', '0058_auto_20190703_2149'),
('player', '0002_savedgame_created'),
]
operations = [
migr... | mit | 740,330,355,191,959,000 | 37.851852 | 144 | 0.597712 | false | 3.928839 | false | false | false |
lchsk/django-mongonaut | mongonaut/views.py | 1 | 12698 | # -*- coding: utf-8 -*-
"""
TODO move permission checks to the dispatch view thingee
"""
from django.contrib import messages
from django.core.urlresolvers import reverse
from django.forms import Form
from django.http import HttpResponseForbidden
from django.http import Http404
from django.views.generic.edit import Del... | mit | -7,187,152,953,296,645,000 | 37.478788 | 155 | 0.619704 | false | 3.983061 | false | false | false |
wmtprojectsteam/rivercontrolsystem | tests/test_solidstate_relay.py | 1 | 2034 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Solid-State-Relay test for the River System Control and Monitoring Software Version 0.9.2
# This file is part of the River System Control and Monitoring Software.
# Copyright (C) 2017-2018 Wimborne Model Town
# This program is free software: you can redistribute it and/or... | gpl-3.0 | -7,720,412,627,526,882,000 | 28.057143 | 138 | 0.670108 | false | 3.766667 | false | false | false |
racemidev/RegAdminForLinux | python/ctypeslib_extra/c_util/c_obj.py | 1 | 10559 |
import ctypes
import re
import exceptions
import inspect
class CObjException(exceptions.StandardError):
def __init__(self, msg, *args, **kwds):
exceptions.Exception(self, msg, *args, **kwds)
self.msg = msg
return
def __str__(self):
return "%s: %s" % (self, self.msg)
class CO... | gpl-2.0 | -8,758,843,443,152,185,000 | 30.900302 | 78 | 0.493229 | false | 3.903512 | false | false | false |
googleapis/python-texttospeech | samples/snippets/ssml_addresses.py | 1 | 3857 | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | apache-2.0 | -5,946,108,898,816,729,000 | 31.411765 | 79 | 0.692766 | false | 3.74466 | false | false | false |
jbalogh/zamboni | apps/devhub/helpers.py | 1 | 6396 | from collections import defaultdict
import urllib
import chardet
import jinja2
from jingo import register
from jingo.helpers import datetime
from tower import ugettext as _, ungettext as ngettext
import amo
from amo.urlresolvers import reverse
from amo.helpers import breadcrumbs, page_title
from access import acl
fro... | bsd-3-clause | 5,686,896,041,450,829,000 | 31.467005 | 76 | 0.653377 | false | 3.722934 | false | false | false |
tensorflow/models | official/modeling/optimization/lr_schedule_test.py | 1 | 3951 | # Copyright 2021 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 | 126,090,165,556,039,900 | 35.247706 | 80 | 0.61225 | false | 3.477993 | true | false | false |
quicksloth/source-code-recommendation-server | src/server.py | 1 | 3442 | import os
import flask
import time
from flask import Flask, request, json
from flask_socketio import SocketIO
import requests
# from logging.config import fileConfig
# import logging
from Controllers.EvaluatorController import EvaluatorController
# fileConfig('logging.conf')
# log = logging.getLogger(__name__)
from ... | apache-2.0 | -6,203,669,130,902,017,000 | 30.272727 | 121 | 0.655814 | false | 3.726977 | false | false | false |
niteoweb/libcloud | libcloud/dns/types.py | 1 | 4093 | # 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 | 4,471,243,542,061,305,300 | 24.265432 | 76 | 0.6301 | false | 3.300806 | false | false | false |
lduarte1991/edx-platform | common/lib/xmodule/xmodule/seq_module.py | 1 | 23961 | """
xModule implementation of a learning sequence
"""
# pylint: disable=abstract-method
import collections
import json
import logging
from datetime import datetime
from lxml import etree
from pkg_resources import resource_string
from pytz import UTC
from xblock.completable import XBlockCompletionMode
from xblock.core... | agpl-3.0 | 5,548,470,805,675,175,000 | 36.793375 | 117 | 0.611661 | false | 4.289474 | false | false | false |
jerryhongthreefoldphotos/messagebus-python-sdk | messagebus/samples/webhooks/deletewebhook.py | 1 | 1669 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Copyright 2014 Message Bus
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 requ... | apache-2.0 | -6,661,766,429,502,467,000 | 28.280702 | 75 | 0.696824 | false | 3.742152 | false | false | false |
h-mayorquin/camp_india_2016 | tutorials/LTPinnetworks2/Step3c_Zenke_etal_2014.py | 1 | 8540 | #!/usr/bin/env python
'''
Based on:
Zenke, Friedemann, Everton J. Agnes, and Wulfram Gerstner.
"Diverse Synaptic Plasticity Mechanisms Orchestrated to Form and Retrieve Memories in Spiking Neural Networks."
Nature Communications 6 (April 21, 2015).
Part of Zenke's rule embedded in modified Brunel 2000 / Ostojic 2014... | mit | -5,000,495,323,026,433,000 | 30.865672 | 112 | 0.586885 | false | 2.990196 | false | false | false |
mhnatiuk/phd_sociology_of_religion | scrapper/build/cffi/demo/readdir2.py | 1 | 1574 | # A Linux-only demo, using verify() instead of hard-coding the exact layouts
#
import sys
from cffi import FFI
if not sys.platform.startswith('linux'):
raise Exception("Linux-only demo")
ffi = FFI()
ffi.cdef("""
typedef ... DIR;
struct dirent {
unsigned char d_type; /* type of file; not s... | gpl-2.0 | -2,870,046,567,128,240,000 | 22.848485 | 76 | 0.562897 | false | 3.258799 | false | false | false |
B-MOOC/edx-platform | openedx/core/djangoapps/credit/migrations/0013_add_provider_status_url.py | 1 | 12404 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'CreditProvider.provider_status_url'
db.add_column('credit... | agpl-3.0 | -8,845,472,775,627,292,000 | 80.605263 | 212 | 0.567156 | false | 3.773654 | false | false | false |
CWSL/access-cm-tools | analyse/overall_mean.py | 1 | 1945 | #!/usr/bin/env python
from __future__ import print_function
import sys
import os
import argparse
import netCDF4 as nc
import numpy as np
from lib_mean import create_output_file, calc_overall_mean
"""
What this script does:
Calculate overall means.
How to run this script:
./overall_mean.py 01/ocean.nc 02/ocean.nc ... | apache-2.0 | -9,120,558,180,579,979,000 | 31.966102 | 113 | 0.6509 | false | 3.704762 | false | false | false |
aldwyn/effigia | apps/interactions/migrations/0001_initial.py | 1 | 2400 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-07-16 06:34
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import model_utils.fields
class Migration(migrations.Migration):
... | mit | 5,328,829,740,072,552,000 | 46.058824 | 149 | 0.625417 | false | 4.33213 | false | false | false |
markgw/jazzparser | src/jazzparser/taggers/segmidi/chordclass/train.py | 1 | 31904 | """Unsupervised EM training for chordclass HMM tagging model.
"""
"""
============================== License ========================================
Copyright (C) 2008, 2010-12 University of Edinburgh, Mark Granroth-Wilding
This file is part of The Jazz Parser.
The Jazz Parser is free software: you can redistr... | gpl-3.0 | 6,740,012,073,236,440,000 | 48.928013 | 95 | 0.524793 | false | 4.737749 | false | false | false |
eallik/spinoff | spinoff/tests/test_pattern_matching.py | 1 | 4162 | from spinoff.util.testing import assert_not_raises
from spinoff.util.pattern_matching import match, ANY, IGNORE, IS_INSTANCE, NOT
FLATTEN = True
def NO(outlen, pattern, data):
x = match(pattern, data, flatten=FLATTEN)
assert not x[0] if isinstance(x, tuple) else not x, x
if FLATTEN:
assert isin... | bsd-2-clause | 4,785,376,480,909,404,000 | 31.515625 | 110 | 0.481259 | false | 2.814064 | true | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.