repo_name
stringlengths
5
92
path
stringlengths
4
232
copies
stringclasses
19 values
size
stringlengths
4
7
content
stringlengths
721
1.04M
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
15
997
alpha_frac
float64
0.25
0.97
autogenerated
bool
1 class
PaddlePaddle/models
PaddleCV/tracking/pytracking/admin/environment.py
1
2051
import importlib import os class EnvSettings: def __init__(self): pytracking_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) self.results_path = '{}/tracking_results/'.format(pytracking_path) self.network_path = '{}/networks/'.format(pytracking_path) self.dat...
apache-2.0
5,295,043,297,320,136,000
38.442308
110
0.575329
false
ShaolongHu/Nitrate
tcms/testplans/tests.py
1
4490
# -*- coding: utf-8 -*- import unittest from django.test.client import Client class PlanTests(unittest.TestCase): def setUp(self): self.c = Client() self.plan_id = 2256 self.status_codes = [301, 302] def test_plans(self): response = self.c.get('/plans/') try: ...
gpl-2.0
3,678,989,214,991,336,400
33.015152
73
0.608018
false
czhengsci/veidt
veidt/utils/data_selection.py
1
4503
# coding: utf-8 # Copyright (c) Materials Virtual Lab # Distributed under the terms of the BSD License. from __future__ import division, print_function, unicode_literals, \ absolute_import import random import numpy as np import pandas as pd from copy import copy from pymatgen import Structure class MonteCarloS...
bsd-3-clause
-7,386,989,554,089,515,000
34.464567
88
0.593826
false
davygeek/vitess
test/vschema.py
1
4090
#!/usr/bin/env python # Copyright 2019 The Vitess 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 applica...
apache-2.0
-5,718,953,077,722,687,000
23.491018
92
0.645477
false
rolandgeider/wger
wger/manager/migrations/0010_auto_20210102_1446.py
1
1206
# Generated by Django 3.1.3 on 2021-01-02 13:46 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('manager', '0009_auto_20201202_1559'), ] operations = [ migrations.AlterField( model_name='setting', name='rir', ...
agpl-3.0
8,143,447,409,504,964,000
37.903226
95
0.360697
false
vrsys/avangong
examples/sound/openal/openal-test.py
1
4058
# -*- Mode:Python -*- ########################################################################## # # # This file is part of AVANGO. # # ...
lgpl-3.0
-8,545,645,918,670,794,000
35.232143
76
0.62691
false
fccoelho/jogos_vorazes
estrategias/LeoRodrigues.py
1
2061
# -*- coding: utf8 -*- from .jogadores import Jogador class MeuJogador(Jogador): def percent(self,data,percentil): data = sorted(data) n = len(data) if n == 0: pass #print ("Lista vazia") else: return int(round(percentil*n+1)) ...
mit
8,636,253,855,674,421,000
47.571429
197
0.594608
false
dwadler/QGIS
python/plugins/processing/algs/qgis/PointDistance.py
1
13351
# -*- coding: utf-8 -*- """ *************************************************************************** PointDistance.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com *************************...
gpl-2.0
4,954,009,398,125,861,000
46.176678
197
0.565126
false
JohanComparat/pySU
spm/bin_spiders/spiders_last_burst_vs_radius.py
1
5578
import astropy.cosmology as co aa=co.Planck15 import astropy.io.fits as fits import astropy.units as u from astropy.coordinates import angles #import AngularSeparation from astropy import coordinates as coord import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as p import numpy as n import os import sys ...
cc0-1.0
-8,053,327,241,965,627,000
32.202381
166
0.661527
false
OpenDataPolicingNC/Traffic-Stops
traffic_stops/base_views.py
1
3014
from django.core.exceptions import ImproperlyConfigured from django.shortcuts import redirect, Http404 from django.views.generic import DetailView, ListView, TemplateView from django.views.generic.edit import ProcessFormView, FormMixin from traffic_stops.utils import get_chunks from collections import defaultdict cla...
mit
6,739,473,892,686,787,000
36.675
86
0.639681
false
alfredodeza/execnet
execnet/gateway_bootstrap.py
1
3067
# -*- coding: utf-8 -*- """ code to initialize the remote side of a gateway once the io is created """ import inspect import os import execnet from execnet import gateway_base from execnet.gateway import Gateway importdir = os.path.dirname(os.path.dirname(execnet.__file__)) class HostNotFound(Exception): pass ...
mit
8,197,248,749,936,590,000
27.137615
79
0.580698
false
CaptainDesAstres/Blender-Render-Manager
TaskList/TaskLog/FrameLog.py
1
1368
#!/usr/bin/python3.4 # -*-coding:Utf-8 -* '''module to manage task Frame log''' import xml.etree.ElementTree as xmlMod import datetime from usefullFunctions import * class FrameLog: '''class to manage task frame log''' def __init__(self, xml = None, frame = None, date = None, computingTime = Non...
mit
1,593,360,718,712,065,800
19.358209
69
0.629765
false
ctberthiaume/keggannot
keggannot/annot.py
1
16296
import os, sys from decimal import Decimal import gzip from collections import OrderedDict import logging def blast_result_iterator(blast_file): _ = blast_file.readline() # burn header for line in blast_file: if not line.startswith("#"): yield BlastHit(line) class BlastHit(object): ""...
apache-2.0
2,386,312,616,748,014,000
37.8
100
0.510371
false
ryanpbrewster/SciVis-2015
examples/sdf_example.py
1
2689
""" The Example is from http://darksky.slac.stanford.edu/scivis2015/examples.html """ from sdfpy import load_sdf from thingking import loadtxt prefix = "../data/" # Load N-body particles from a = 1.0 dataset. Particles have positions with # units of proper kpc, and velocities with units of km/s. particles = load_sdf...
mit
9,184,363,794,019,417,000
43.081967
83
0.706582
false
rhcarvalho/kombu
kombu/tests/async/http/test_curl.py
1
5102
# -*- coding: utf-8 -*- from __future__ import absolute_import from kombu.async.http.curl import READ, WRITE, CurlClient from kombu.tests.case import ( HubCase, Mock, call, patch, case_requires, set_module_symbol, ) @case_requires('pycurl') class test_CurlClient(HubCase): class Client(CurlClient): ...
bsd-3-clause
-1,647,547,606,994,934,000
37.074627
78
0.555076
false
iut-ibk/DynaMind-UrbanSim
3rdparty/opus/src/urbansim/zone/home_access_to_employment_DDD.py
2
6081
# Opus/UrbanSim urban simulation software. # Copyright (C) 2005-2009 University of Washington # See opus_core/LICENSE from abstract_zone_access_variable import Abstract_Zone_Access_Variable class home_access_to_employment_DDD(Abstract_Zone_Access_Variable): """The accessibility for the households in the g...
gpl-2.0
208,771,490,386,531,070
50.439655
138
0.549416
false
Azure/azure-sdk-for-python
sdk/graphrbac/azure-graphrbac/azure/graphrbac/models/application_create_parameters.py
1
8780
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
-113,552,795,501,562,910
53.875
114
0.685877
false
diamondman/pys3streamer
s3streamer/streamer.py
1
4416
from __future__ import unicode_literals from __future__ import print_function from boto.s3.connection import S3Connection class S3Streamer(object): #def __init__(self, bucket_name, *key_names, s3_connection=None, key_is_prefix=False): def __init__(self, bucket_name, *key_names, **kwargs): """Create a...
mit
-8,990,907,671,535,923,000
34.328
305
0.55933
false
Duroktar/cookbook
AIML Files/ALICE/ALICE_bot.py
1
1830
# - LINKS - ALICE Bot # # By: traBpUkciP (2016) import aiml # AI-Markup Language library import datetime import time import urllib # library for dealing with web stuff through Python import sys, os path = os.path.dirname(os.path.abspath(sys.argv[0])) BRAIN_FILE = path + "/bot_brain_ALICE.brn" k = aiml.Kerne...
gpl-3.0
-182,710,782,391,264,220
18.0625
114
0.553005
false
opadron/girder
girder/api/v1/resource.py
1
21286
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### # Copyright 2013 Kitware 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 cop...
apache-2.0
4,512,090,057,241,301,500
44.482906
80
0.558677
false
twiindan/selenium_lessons
01_Introducción/02_tools_and_environment.py
1
2414
#=============================================================================== # - CPython is the real name of default standard Python implementation # - Implemented in C # - There are Python implementations in other languages: # - Jython: Python 2.5 interpreter written in Java which runs bytecode in the JVM # ...
apache-2.0
-6,505,159,516,177,435,000
44.566038
99
0.42792
false
wangyang59/tf_models
video_prediction/prediction_train_flo_learn_ip_sintel_test.py
1
30243
# # 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 # Copyright 2016 The TensorFlow Authors All Rights Reserved. # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
apache-2.0
5,854,912,422,827,126,000
44.753404
173
0.606289
false
andrewsomething/digitalocean-indicator
digitalocean_indicator/__init__.py
1
1487
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- ### BEGIN LICENSE # 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 Software Foundation. # # This program is distributed in the hop...
gpl-3.0
8,986,540,471,270,268,000
31.326087
75
0.702757
false
vandorjw/django-template-project
project/project_name/views.py
1
1288
from django.views.generic import TemplateView from django.views.generic.edit import FormView from blog.models import Article from django.core.mail import send_mail from {{project_name}}.forms import ContactForm class HomePageView(TemplateView): template_name="index.html" def get_context_data(self, **kwargs): ...
mit
2,950,621,827,330,681,000
32.025641
76
0.697205
false
a25kk/aha
src/aha.sitecontent/aha/sitecontent/browser/pagesection.py
1
7060
# -*- coding: utf-8 -*- """Module providing views for a contentpage section""" from AccessControl import Unauthorized from Acquisition import aq_inner from Acquisition import aq_parent from plone import api from plone.api.exc import InvalidParameterError from plone.protect.utils import addTokenToUrl from Products.CMFPl...
mit
-960,660,328,584,240,100
31.837209
77
0.585694
false
dylanninin/schema
test_schema.py
1
18858
from __future__ import with_statement from collections import defaultdict, namedtuple from operator import methodcaller import os from pytest import raises from schema import Schema, Use, And, Or, Optional, SchemaError, JSONSchema try: basestring except NameError: basestring = str # Python 3 does not have ...
mit
-8,319,315,173,465,126,000
33.039711
99
0.561724
false
arashn/senior-project
server/create_mission.py
1
2187
# This is a script to create a mission from a start # location to an end location and upload the mission # to the vehicle. The script uses the Google Maps # Directions API to obtain directions from the start # location to the end location, and uses the points # received as waypoints in the mission. import googlemaps fr...
gpl-3.0
8,425,306,509,460,994,000
39.5
150
0.692273
false
j08lue/poppy
poppy/ts_flux_budget.py
1
6682
import numpy as np import warnings from oceanpy.fluxbudget import budget_over_region_2D from oceanpy.stats import central_differences def _fill0(a): return np.ma.filled(a,0.) def _warn_virtual_salt_flux_units(): warnings.warn('Output units are kg SALT s-1!',) warnings.filterwarnings("once") def fluxbudge...
gpl-2.0
-7,507,726,245,566,721,000
32.41
98
0.564801
false
tkem/mopidy-podcast-itunes
mopidy_podcast_itunes/__init__.py
1
4677
import pathlib import pkg_resources from mopidy import config, ext, httpclient __version__ = pkg_resources.get_distribution("Mopidy-Podcast").version CHARTS = ["podcasts", "audioPodcasts", "videoPodcasts"] COUNTRIES = [ "AD", "AE", "AF", "AG", "AI", "AL", "AM", "AO", "AQ", "...
apache-2.0
-5,865,417,700,428,691,000
13.707547
70
0.39876
false
FlightGear/flightgear
utils/Modeller/yasim_import.py
1
30696
#!BPY # """ # Name: 'YASim (.xml)' # Blender: 245 # Group: 'Import' # Tooltip: 'Loads and visualizes a YASim FDM geometry' # """ __author__ = "Melchior FRANZ < mfranz # aon : at >" __url__ = ["http://www.flightgear.org/", "http://cvs.flightgear.org/viewvc/source/utils/Modeller/yasim_import.py"] __version__ = "0.2" __...
gpl-2.0
1,149,373,334,458,743,400
36.117291
139
0.627769
false
sahat/bokeh
examples/plotting/server/remote_image.py
1
1468
import numpy as np from bokeh.plotting import * from bokeh.objects import Range1d, ServerDataSource """ In order to run this example, you have to execute ./bokeh-server -D remotedata the remote data directory in the bokeh checkout has the sample data for this example In addition, you must install ArrayManagement from...
bsd-3-clause
-9,210,181,709,916,321,000
27.784314
84
0.50545
false
kg-bot/SupyBot
plugins/Variables/test.py
1
3088
### # Copyright (c) 2011, Valentin Lorentz # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, # this list of conditi...
gpl-3.0
8,128,141,146,548,841,000
45.787879
79
0.710168
false
utkarsh-goswami/erpnext
erpnext/accounts/doctype/pricing_rule/pricing_rule.py
1
13027
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt # For license information, please see license.txt from __future__ import unicode_literals import frappe import json import copy from frappe import throw, _ from frappe.utils import flt, cint from frappe.model.document ...
gpl-3.0
7,289,619,787,295,705,000
34.693151
131
0.68834
false
openstack/designate
designate/tests/test_hookpoints.py
1
4338
# Copyright 2015 Rackspace Hosting. # # Author: Eric Larson <eric.larson@rackspace.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 # #...
apache-2.0
806,856,279,180,164,100
28.917241
79
0.644076
false
saleemjaveds/https-github.com-openstack-nova
nova/virt/hyperv/driver.py
1
9980
# Copyright (c) 2010 Cloud.com, Inc # Copyright (c) 2012 Cloudbase Solutions Srl # # 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....
apache-2.0
-6,918,559,753,360,435,000
43.159292
79
0.584469
false
CARPEM/GalaxyDocker
config/configShinyApp/checkContainerTime.py
1
1124
import sys import datetime from subprocess import Popen, PIPE import json #container ID extraction container_id = sys.argv[1] print("Check :"+container_id) cmd=['docker', 'inspect', "--format='{{json .State}}'", container_id] print(cmd) process = Popen(cmd, stdout=PIPE, stderr=PIPE) stdout, stderr = process.communic...
mit
8,542,311,203,721,124,000
25.761905
100
0.736655
false
mnick/qutebrowser
qutebrowser/browser/commands.py
1
39927
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2014-2015 Florian Bruhin (The Compiler) <mail@qutebrowser.org> # # This file is part of qutebrowser. # # qutebrowser 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 S...
gpl-3.0
7,033,561,843,097,685,000
37.764078
79
0.567586
false
prataprc/tayra
tayra/test/stdttl/ref/useinterface.ttl.py
1
2558
import imp from io import StringIO from pluggdapps.plugin import Plugin, implements from tayra import BaseTTLPlugin def __traceback_decorator__( frames ): from copy import deepcopy from os.path import basename def _map2ttl( frame ): filename = frame.fil...
gpl-3.0
4,534,265,095,234,785,000
31.794872
134
0.538702
false
asiersarasua/QGIS
python/plugins/db_manager/layer_preview.py
1
5023
# -*- coding: utf-8 -*- """ /*************************************************************************** Name : DB Manager Description : Database manager plugin for QGIS Date : May 23, 2011 copyright : (C) 2011 by Giuseppe Sucameli email : brush.tyler@...
gpl-2.0
151,934,034,634,910,370
36.207407
118
0.516624
false
swayf/pyLoad
module/plugins/accounts/FilesonicCom.py
1
2796
# -*- coding: utf-8 -*- """ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in...
agpl-3.0
-295,136,709,200,270,100
38.380282
109
0.620529
false
Imperat/SSU-Courses
ssu-formal-languages/pda/pda.py
1
1105
import pda_exceptions as e class PDA(object): def __init__(self, rules, input_alphabet, states, initial_state, terminate_states): self.rules = rules self.input_alphabet = input_alphabet self.states = states self.state = initial_state self.terminate_states =...
apache-2.0
1,192,358,845,135,127,600
30.571429
55
0.540271
false
caedesvvv/pynoded
pynoded/graph.py
1
4291
""" Base graph objects """ from evh.base import EvHandler,EvStack from math import * class Drawable(object): """ Base class for drawable objects. """ def __init__(self,x,y,scale=1.0): self.x=x self.y=y self.scale=scale def Draw(self,ctx): ctx.save() ctx.sca...
gpl-3.0
-4,142,430,700,984,500,700
23.66092
87
0.563505
false
wadobo/congressus
congressus/tickets/templatetags/tickets.py
1
1531
import re from django import template from django.utils.translation import ugettext as _ from django.utils.html import mark_safe register = template.Library() @register.simple_tag def ticket_seat_class(session, layout, seat, row, col): row = str(row) col = str(col) if seat == 'R': return 'seat...
agpl-3.0
2,939,241,391,327,671,000
21.514706
93
0.614631
false
michaelkirk/QGIS
python/plugins/processing/algs/lidar/lastools/lasnoise.py
1
3645
# -*- coding: utf-8 -*- """ *************************************************************************** lasnoise.py --------------------- Date : September 2013 Copyright : (C) 2013 by Martin Isenburg Email : martin near rapidlasso point com ****************...
gpl-2.0
-8,790,487,615,896,949,000
42.915663
82
0.590672
false
pirate/bookmark-archiver
archivebox/extractors/readability.py
1
4294
__package__ = 'archivebox.extractors' from pathlib import Path from tempfile import NamedTemporaryFile from typing import Optional import json from ..index.schema import Link, ArchiveResult, ArchiveError from ..system import run, atomic_write from ..util import ( enforce_types, download_url, is_static_fi...
mit
4,898,612,251,076,805,000
30.807407
110
0.622729
false
tysonholub/twilio-python
twilio/rest/taskrouter/v1/workspace/workspace_statistics.py
1
10107
# coding=utf-8 r""" This code was generated by \ / _ _ _| _ _ | (_)\/(_)(_|\/| |(/_ v1.0.0 / / """ from twilio.base import serialize from twilio.base import values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.l...
mit
-1,229,389,616,420,329,200
34.588028
132
0.646977
false
awsdocs/aws-doc-sdk-examples
python/example_code/rekognition/rekognition_collections.py
1
13421
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ Purpose Shows how to use the AWS SDK for Python (Boto3) with Amazon Rekognition to create a collection that contains faces indexed from a series of images. The collection is then searched for faces that matc...
apache-2.0
4,713,168,682,652,689,000
38.12828
102
0.617167
false
atarax82/lotto-project
project/monitor.py
1
2948
import os import sys #import time import signal import threading import atexit import queue _interval = 1.0 _times = {} _files = [] _running = False _queue = queue.Queue() _lock = threading.Lock() def _restart(path): _queue.put(True) prefix = 'monitor (pid=%d):' % os.getpid() print('%s Change detected to...
gpl-3.0
-7,386,364,848,896,357,000
25.097345
76
0.585142
false
ESSolutions/ESSArch_Core
ESSArch_Core/agents/documents.py
1
1455
from elasticsearch_dsl import Date, InnerDoc, Keyword, Nested, Text from ESSArch_Core.agents.models import Agent from ESSArch_Core.search.documents import DocumentBase from ESSArch_Core.tags.documents import autocomplete_analyzer class AgentNameDocument(InnerDoc): main = Text() part = Text() description ...
gpl-3.0
3,981,038,037,303,409,700
23.661017
81
0.57457
false
MasterGowen/moonrain
moonrain/projects/views.py
1
3432
import json from django.shortcuts import render, redirect from django.views.generic.edit import UpdateView, DeleteView from .models import Project from ..videos.models import Video, VideosSequence from ..videos.views import new_sequence, get_sequence from django.contrib.auth.decorators import login_required from django...
gpl-2.0
8,194,564,417,942,022,000
32.656863
119
0.648893
false
harisbal/pandas
pandas/tests/arrays/categorical/test_missing.py
1
3078
# -*- coding: utf-8 -*- import collections import numpy as np import pytest from pandas.compat import lrange from pandas.core.dtypes.dtypes import CategoricalDtype from pandas import Categorical, Index, isna import pandas.util.testing as tm class TestCategoricalMissing(object): def test_na_flags_int_categori...
bsd-3-clause
-2,132,304,201,633,114,000
34.37931
73
0.547109
false
tbetcke/PyBEM2D
examples/circscatt.py
1
1272
import pybem2d.core.bases as pcb import pybem2d.core.segments as pcs import pybem2d.core.quadrules as pcq import pybem2d.core.kernels as pck import pybem2d.core.mesh as pcm import pybem2d.core.assembly as pca import pybem2d.core.evaluation as pce import pybem2d.core.visualization as pcv import numpy as np k=10 nelem...
mit
7,395,326,172,782,290,000
22.127273
100
0.750786
false
sertansenturk/tomato
tests/test_converter.py
1
1334
import numpy as np import pytest from tomato.converter import Converter def test_hz_to_cent_negative_hz_track(): # GIVEN hz_track = np.array([-50]) ref_freq = np.float(25.0) # WHEN; THEN with pytest.raises(ValueError): Converter.hz_to_cent(hz_track, ref_freq) def test_hz_to_cent_negati...
agpl-3.0
-5,201,118,722,165,138,000
21.233333
63
0.618441
false
mjafin/bcbio-nextgen
bcbio/variation/bedutils.py
1
7691
"""Utilities for manipulating BED files. """ import os import shutil import sys import subprocess import toolz as tz from bcbio import utils from bcbio.bam import ref from bcbio.distributed.transaction import file_transaction from bcbio.pipeline import config_utils from bcbio.pipeline import datadict as dd from bcbio...
mit
-970,185,428,665,828,700
41.727778
115
0.606683
false
openqt/algorithms
leetcode/python/lc331-verify-preorder-serialization-of-a-binary-tree.py
1
1578
# coding=utf-8 import unittest """331. Verify Preorder Serialization of a Binary Tree https://leetcode.com/problems/verify-preorder-serialization-of-a-binary-tree/description/ One way to serialize a binary tree is to use pre-order traversal. When we encounter a non-null node, we record the node's value. If it is a nu...
gpl-3.0
4,291,146,712,371,423,000
19.486842
89
0.586819
false
JeroenZegers/Nabu-MSSS
nabu/neuralnetworks/loss_computers/ms_loss.py
1
2597
"""@file ms_loss.py contains the MsLoss. Temporary naming of file and class""" import loss_computer import tensorflow as tf class MsLoss(loss_computer.LossComputer): """A loss computer that calculates the loss""" def __call__(self, targets, logits, seq_length): # target is actually only required for it's shape...
mit
8,943,644,888,906,579,000
32.727273
115
0.672699
false
ikosenn/cray-cray
fummy.py
1
2626
""" Author: ikosenn This is a program to eliminate stale git branches. It checks last commits and based on the staleness threshold eliminates all stale branches Another CL function is provided to eliminate all available branches. You can also remove all branches that have already been merged ...
mit
-3,121,794,362,118,456,300
25
76
0.639756
false
jairglez/intel-iot-refkit
meta-iotqa/lib/oeqa/runtime/connectivity/bluetooth/bluetooth.py
1
11137
import time import os import string from oeqa.utils.helper import shell_cmd_timeout class BTFunction(object): """ @class BTFunction """ log = "" def __init__(self, target): self.target = target # un-block software rfkill lock self.target.run('rfkill unblock all') sel...
mit
-8,955,407,898,348,415,000
35.276873
128
0.56227
false
AutorestCI/azure-sdk-for-python
azure-mgmt-monitor/azure/mgmt/monitor/operations/action_groups_operations.py
1
19086
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
-7,601,957,632,301,776,000
46.125926
152
0.648643
false
molly/women-social-reformers-on-wikipedia
gather.py
1
2451
# Copyright (c) 2015–2016 Molly White # # 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, # di...
mit
6,424,813,447,681,501,000
36.692308
116
0.665578
false
plin1112/pysimm
pysimm/cassandra.py
1
67253
# ****************************************************************************** # pysimm.cassandra module # ****************************************************************************** # # ****************************************************************************** # License # *************************************...
mit
-1,943,103,293,411,142,400
45.063699
123
0.549686
false
Changron/NTHUOJ_web
nthuoj/settings.py
1
4448
#-*- encoding=UTF-8 -*- """ Django settings for nthuoj project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ # Build paths inside the project like this: os.path...
mit
-6,440,279,533,526,277,000
25.795181
99
0.704586
false
chop-dbhi/varify-data-warehouse
vdw/samples/migrations/0008_force_migrate_default_cohort_and_project.py
1
23232
# encoding: utf-8 import datetime from south.db import db from south.v2 import DataMigration from django.db import models from vdw.samples.models import DEFAULT_COHORT_NAME, DEFAULT_PROJECT_NAME class Migration(DataMigration): def forwards(self, orm): "Write your forwards methods here." Project ...
bsd-2-clause
-32,546,773,490,712,990
78.835052
192
0.544594
false
kingtaurus/cs224d
assignment1/q3_word2vec_sol.py
1
7778
import numpy as np import random from q1_softmax_sol import softmax_sol as softmax from q2_gradcheck import gradcheck_naive from q2_sigmoid_sol import sigmoid_sol as sigmoid from q2_sigmoid_sol import sigmoid_grad_sol as sigmoid_grad def normalizeRows_sol(x): """ Row normalization function """ # Implement a...
mit
4,524,440,371,980,069,400
43.193182
120
0.576369
false
taxpon/sverchok
ui/sv_icons.py
1
1302
import bpy import os import glob import bpy.utils.previews # custom icons dictionary _icon_collection = {} def custom_icon(name): load_custom_icons() # load in case they custom icons not already loaded custom_icons = _icon_collection["main"] default = lambda: None # for no icon with given name will r...
gpl-3.0
1,090,800,781,951,556,500
23.111111
76
0.667435
false
rzr/synapse
synapse/handlers/presence.py
1
46696
# -*- coding: utf-8 -*- # Copyright 2014, 2015 OpenMarket Ltd # # 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
2,773,154,445,091,974,700
35.030864
85
0.580992
false
mushtaqak/edx-platform
lms/djangoapps/commerce/tests/test_views.py
1
17521
""" Tests for commerce views. """ import json from uuid import uuid4 from nose.plugins.attrib import attr import ddt from django.conf import settings from django.core.urlresolvers import reverse from django.test import TestCase from django.test.utils import override_settings import mock from xmodule.modulestore.tests...
agpl-3.0
3,068,241,254,103,954,400
41.016787
120
0.662919
false
romeotestuser/glimsol_report
report/billing_statement.py
1
2348
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
gpl-2.0
385,092,275,381,778,500
32.557143
165
0.57879
false
b-carter/numpy
numpy/core/tests/test_multiarray.py
1
260744
from __future__ import division, absolute_import, print_function import collections import tempfile import sys import shutil import warnings import operator import io import itertools import functools import ctypes import os import gc from contextlib import contextmanager if sys.version_info[0] >= 3: import builti...
bsd-3-clause
3,085,100,826,705,004,500
36.366581
588
0.50084
false
bilke/OpenSG-1.8
SConsLocal/scons-local-0.96.1/SCons/Platform/irix.py
2
1555
"""SCons.Platform.irix Platform-specific initialization for SGI IRIX systems. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Platform.Platform() selection method. """ # # Copyright (c) 2001, 2002, 2003, 2004 The SCons Foundation # # Permiss...
lgpl-2.1
-25,476,674,456,146,590
39.921053
125
0.771704
false
nash-x/hws
neutron/plugins/l2_proxy/agent/clients.py
1
9765
# Copyright 2014, Huawei, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by...
apache-2.0
659,710,628,943,577,700
30.704545
79
0.603277
false
sibskull/synaptiks
synaptiks/monitors/mouses.py
1
8959
# -*- coding: utf-8 -*- # Copyright (c) 2011, Sebastian Wiesner <lunaryorn@googlemail.com> # All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above...
bsd-2-clause
-3,596,675,670,361,718,300
35.717213
79
0.650854
false
snoopycrimecop/openmicroscopy
components/tools/OmeroPy/test/integration/gatewaytest/test_get_objects.py
1
45419
#!/usr/bin/env python # -*- coding: utf-8 -*- """ gateway tests - Testing the gateway.getObject() and deleteObjects() methods Copyright 2013-2015 Glencoe Software, Inc. All rights reserved. Use is subject to license terms supplied in LICENSE.txt pytest fixtures used as defined in conftest.py: - gatewa...
gpl-2.0
-8,658,934,620,634,377,000
39.918018
79
0.615381
false
WA4OSH/Learn_Python
oldLady.py
1
2383
#------------------------------------------------------------------------------- # Name: oldLady.py # Purpose: Demo of program control, loops, branches, etc. # # Author: Konrad Roeder, adapted from the nusery rhyme # There was an Old Lady song from the # Secret History of Nurse...
cc0-1.0
2,651,610,528,392,757,000
33.536232
80
0.579522
false
linsalrob/EdwardsLab
patric/parse_gto.py
1
2770
""" Parse a GTO object """ import os import sys import argparse from roblib import bcolors import json def list_keys(gto, verbose=False): """ List the primary keys in the patric file :param gto: the json gto :param verbose: more output :return: """ print("{}".format("\n".join(gto.keys())...
mit
-2,918,537,910,248,930,000
27.556701
107
0.558123
false
lcpt/xc
verif/tests/elements/spring_test_01.py
1
2830
# -*- coding: utf-8 -*- # home made test __author__= "Luis C. Pérez Tato (LCPT) and Ana Ortega (AOO)" __copyright__= "Copyright 2015, LCPT and AOO" __license__= "GPL" __version__= "3.0" __email__= "l.pereztato@gmail.com" K= 1000 # Spring constant l= 100 # Distance between nodes F= 1 # Force magnitude import xc_base ...
gpl-3.0
-5,412,932,095,904,627,000
25.439252
68
0.7462
false
BenKettlewell/Livestreamer-Command-Line-Generator
livestreamerCLG.py
1
2267
''' Parses crunchyroll URLs and provides a string command line argument to download them. Utilizing youtube-dl to split sub and video files but livestreamer functionality can be added with minimal effort -h, --help Output this help document -u, --url Provide a single url -f, --file Provide location of...
gpl-2.0
-2,636,595,250,218,402,000
31.385714
89
0.613586
false
root-mirror/root
tutorials/roofit/rf604_constraints.py
11
2705
## \file ## \ingroup tutorial_roofit ## \notebook -nodraw ## Likelihood and minimization: fitting with constraints ## ## \macro_code ## ## \date February 2018 ## \authors Clemens Lange, Wouter Verkerke (C++ version) from __future__ import print_function import ROOT # Create model and dataset # ----------------------...
lgpl-2.1
5,271,455,174,840,602,000
28.402174
96
0.621072
false
mgagne/nova
nova/tests/unit/api/openstack/compute/contrib/test_quota_classes.py
1
6260
# Copyright 2012 OpenStack Foundation # 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 requ...
apache-2.0
2,523,223,996,149,545,500
41.297297
78
0.548722
false
szrlee/AIPS
RouteApp.py
1
1995
#!/usr/bin python2 # -*- coding: UTF-8 -*- # """def get_tree_graph(): #return graph pass According to POX wiki ,method spanning_tree returns it as dictionary like {s1:([(s2,port1),(s3,port2),...]),s2:([(s1,port),...]),...} #port refers to the port of s1 which connects to s2 A graph example for path searc...
apache-2.0
1,809,886,606,186,799,000
29.227273
92
0.502757
false
valdur55/py3status
py3status/modules/keyboard_locks.py
1
2349
r""" Display NumLock, CapsLock, and ScrLock keys. Configuration parameters: cache_timeout: refresh interval for this module (default 1) format: display format for this module *(default '[\?if=num_lock&color=good NUM|\?color=bad NUM] ' '[\?if=caps_lock&color=good CAPS|\?color=bad CAPS] ' ...
bsd-3-clause
-3,356,702,791,891,390,500
26.635294
88
0.57301
false
MaxIV-KitsControls/netspot
netspot/ts_lib.py
1
5698
#!/usr/bin/python -tt """Junos Interface Troubleshooting library.""" import re import warnings import helpers from napalm import get_network_driver from jnpr.junos.exception import ConnectRefusedError, ConnectAuthError # JUNOS MAC table RE RE_VLAN = r'\s+([\w\d-]+)\s+' RE_MAC = r'\s?([*\w\d:]+)\s+' RE_TYPE = r'\s?(...
mit
-7,438,312,396,324,293,000
26.931373
107
0.586697
false
ndaniels/Ammolite
scripts/figure-generators/smsdIsoCompare.py
1
1534
import matplotlib.pyplot as plt from pylab import polyfit, poly1d, show, savefig import sys def isNumber( s): try: float(s) return True except ValueError: return False def makeGraph(X,Y, xName, yName, name="NoName"): fig = plt.figure() ax = fig.add_subplot(111) superName = "Comparison of {} and {}".format(...
gpl-2.0
7,310,710,760,138,721,000
22.96875
95
0.634289
false
Frencil/box-python-sdk
test/unit/object/test_events.py
1
8316
# coding: utf-8 from __future__ import unicode_literals from itertools import chain import json from mock import Mock import pytest from requests.exceptions import Timeout from six.moves import map # pylint:disable=redefined-builtin from six.moves.urllib.parse import urlencode, urlunsplit # pylint:disable=import-...
apache-2.0
-5,183,375,154,726,981,000
29.686347
138
0.684343
false
alexisVallet/anime-bgrm
objectSegmentation.py
1
3095
import disjointSetForest as dsj import cv2 import numpy as np def toRowMajor(cols, i, j): return i * cols + j def fromRowMajor(cols, idx): return (idx / cols, idx % cols) class ObjectsSegmentation: """ Disjoint set forest, with the additional semantic element of an image to segment into backgroun...
gpl-2.0
-6,634,703,475,703,437,000
35.845238
88
0.555412
false
hguemar/cinder
cinder/utils.py
1
26017
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # Copyright 2011 Justin Santa Barbara # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance wi...
apache-2.0
1,572,447,231,465,571,000
32.876302
79
0.597379
false
crypto101/arthur
arthur/test/test_util.py
1
4581
from arthur.util import MultiDeferred from twisted.internet import defer from twisted.trial import unittest class MultiDeferredTests(unittest.SynchronousTestCase): """ Tests for L{defer.MultiDeferred}, except now in Arthur. See tm.tl/6365. """ def setUp(self): self.multiDeferred = MultiDe...
isc
-7,686,488,387,015,034,000
31.956835
84
0.629993
false
OffenesJena/JenLoRa
LoPy/LoAirRohr01/lib/DHT22RinusW.py
1
2355
from machine import enable_irq, disable_irq import time # this onewire protocol code tested with Pycom LoPy device and AM2302/DHT22 sensor def getval(pin): ms = [1]*700 # needs long sample size to grab all the bits from the DHT time.sleep(1) pin(0) time.sleep_us(10000) pin(1) irqf = dis...
apache-2.0
6,041,025,592,553,690,000
33.632353
248
0.546072
false
Ilias95/lib389
lib389/tests/dseldif_test.py
1
4107
# --- BEGIN COPYRIGHT BLOCK --- # Copyright (C) 2017 Red Hat, Inc. # All rights reserved. # # License: GPL (version 3 or any later version). # See LICENSE for details. # --- END COPYRIGHT BLOCK --- # import logging import pytest from lib389._constants import * from lib389.dseldif import DSEldif from lib389.topologies ...
gpl-3.0
5,447,008,069,091,832,000
30.592308
75
0.661066
false
darbaga/simple_compiler
virtual_machine.py
1
2139
class VirtualMachine: def __init__(self, ram_size=512, executing=True): self.data = {i: None for i in range(ram_size)} self.stack = [] self.executing = executing self.pc = 0 self.devices_start = 256 def push(self, value): """Push something onto the stack.""" ...
bsd-3-clause
2,304,611,489,600,544,300
34.65
103
0.610566
false
gladgod/zhiliao
zhiliao/twitter/defaults.py
1
2296
""" Default settings for the ``mezzanine.twitter`` app. Each of these can be overridden in your project's settings module, just like regular Django settings. The ``editable`` argument for each controls whether the setting is editable via Django's admin. Thought should be given to how a setting is actually used before ...
bsd-3-clause
6,396,643,095,361,620,000
29.613333
78
0.708624
false
nmmmnu/MessageQueue
protocols/memcachedhandler.py
1
4321
# # Memcached protocol implementation # Nikolay Mihaylov nmmm@nmmm.nu # # For Memcached telnet protocol see: # http://blog.elijaa.org/?post/2010/05/21/Memcached-telnet-command-summary import asynchat import time try: from cStringIO import StringIO except ImportError: from StringIO import StringIO class Memca...
gpl-3.0
3,332,516,228,514,705,400
15.123134
74
0.585744
false
pandysong/dxf2kicad_mod
dxf2kicad_mod.py
1
4880
# refer to http://pythonhosted.org/dxfgrabber/# # Note that there must not a line or shape overlapped import sys import math import functools from itertools import groupby import dxfgrabber import kicad_mod_format as kf def _arc_point(center, radius, angle_degree): ''' point defined by arc cen...
gpl-3.0
8,028,408,619,376,183,000
31.197279
79
0.518648
false
cidles/poio-api
src/poioapi/io/graf.py
1
18028
# -*- coding: utf-8 -*- # # Poio Tools for Linguists # # Copyright (C) 2009-2013 Poio Project # Author: António Lopes <alopes@cidles.eu> # URL: <http://media.cidles.eu/poio/> # For license information, see LICENSE.TXT """ This document contain the responsible methods to write and parse the GrAF files. The p...
apache-2.0
-3,918,818,425,620,900,400
28.818803
80
0.568758
false
brain-research/mirage-rl-qprop
sandbox/rocky/tf/q_functions/continuous_mlp_q_function.py
1
6100
from sandbox.rocky.tf.q_functions.base import QFunction import numpy as np from rllab.core.serializable import Serializable from sandbox.rocky.tf.core.layers_powered import LayersPowered from sandbox.rocky.tf.core.layers import batch_norm from sandbox.rocky.tf.policies.base import StochasticPolicy from sandbox.rocky.t...
mit
-6,248,511,351,676,138,000
40.216216
107
0.562787
false
blockstack/blockstack-server
integration_tests/blockstack_integration_tests/scenarios/name_import_expire_pre_reg_expire_pay2ns_multi.py
1
8928
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Blockstack ~~~~~ copyright: (c) 2014-2015 by Halfmoon Labs, Inc. copyright: (c) 2016 by Blockstack.org This file is part of Blockstack Blockstack is free software: you can redistribute it and/or modify it under the terms of the GNU General...
gpl-3.0
-6,916,285,018,192,869,000
35.292683
230
0.660506
false
diefenbach/django-cba
cba/layouts.py
1
1576
from . base import Component class Grid(Component): """A CSS grid layout. A grid consists arbitrary rows and 16 columns per row. see http://semantic-ui.com/collections/grid.html for more. """ template = "cba/layouts/grid.html" class Column(Component): """A column of a grid. width ...
bsd-3-clause
7,044,278,349,596,012,000
28.185185
107
0.607234
false
tvotyakov/codeeval
easy/one-zero-two-zeros/code.py
1
1832
#!python3 def count_of_zeros(num): ''' (int) -> int Returns count of zero bits in the binary representation of the given integer num. >>> count_of_zeros(0) 1 >>> count_of_zeros(1) 0 >>> count_of_zeros(2) 1 >>> count_of_zeros(4) 2 >>> count_of_zero...
gpl-2.0
-1,047,781,085,113,638,800
18.606742
59
0.504367
false
jan-lugfl/lugfl-members
lugflmembers/wsgi.py
1
1443
""" WSGI config for lugflmembers project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLICATI...
mit
-7,515,940,728,358,359,000
44.09375
79
0.795565
false
lekston/ardupilot
Tools/autotest/autotest.py
1
18930
#!/usr/bin/env python """ APM automatic test suite Andrew Tridgell, October 2011 """ from __future__ import print_function import atexit import fnmatch import glob import optparse import os import shutil import signal import sys import time import traceback from apmrover2 import * from arducopter import * from quadp...
gpl-3.0
-2,348,797,625,056,130,600
31.414384
148
0.609245
false