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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
joshmoore/zeroc-ice | py/test/Ice/info/Client.py | 1 | 1142 | #!/usr/bin/env python
# **********************************************************************
#
# Copyright (c) 2003-2011 ZeroC, Inc. All rights reserved.
#
# This copy of Ice is licensed to you under the terms described in the
# ICE_LICENSE file included in this distribution.
#
# *************************************... | gpl-2.0 | 3,822,398,164,370,931,000 | 23.826087 | 72 | 0.596322 | false | 3.732026 | true | false | false |
google/ehr-predictions | ehr_prediction_modeling/utils/label_utils.py | 1 | 2694 | # coding=utf-8
# Copyright 2020 Google Health Research.
#
# 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 la... | apache-2.0 | -7,459,397,773,896,663,000 | 35.405405 | 79 | 0.720861 | false | 3.427481 | false | false | false |
heromod/migrid | state/sss_home/MiG-SSS/mig_xsss.py | 1 | 1992 | #!/usr/bin/env python
import os
import time
MiG_DIR = "~/MiG-SSS"
G_XSCREENSAVER_COMMAND = "/usr/X11R6/bin/xscreensaver-command -watch"
G_GPIDFILE = "/tmp/mig_xsss_job.gpid"
# Returns Group ID of running job
def getRunningGPID( param_sGPIDFile ):
iGPID = -1
if ( os.path.isfile( param_sGPIDFile ) ):
input = o... | gpl-2.0 | 7,651,162,478,310,294,000 | 24.87013 | 105 | 0.63002 | false | 2.634921 | false | false | false |
RPGroup-PBoC/gist_pboc_2017 | code/inclass/phase_portrait_in_class.py | 1 | 1286 | # Duhhhh
import numpy as np
import matplotlib.pyplot as plt
import seaborn
plt.close('all')
# Define the parameters
r = 20 # the production rate
gamma = 1 / 30 # the degradation rate
k = 200 # in units of concentration
max_R = 1000 # maximum number of R1 and R2
R1 = np.linspace(0, max_R, 500)
R2 = np.linspace(0, m... | mit | -3,922,817,809,920,688,000 | 21.172414 | 48 | 0.600311 | false | 2.325497 | false | false | false |
lincolnloop/django-jsonit | jsonit/encoder.py | 1 | 2054 | import datetime
import json
from django.conf import settings
from django.contrib.messages.storage.base import Message
from django.utils.functional import Promise
from django.utils import six
def encode_message(message):
return {'class': message.tags, 'message': message.message}
class JsonitEncoder(json.JSONEnc... | bsd-3-clause | -6,261,254,148,897,235,000 | 33.813559 | 79 | 0.658228 | false | 4.297071 | false | false | false |
stplaydog/OPTKIT | scripts/process_data_pattern.py | 1 | 3246 | #
# Copy right YMSys, 2015,2016 Zhaoming Yin
#
# @brief 1) This script do some sanity check of the data, and remove the
# corrupted data;
# 2) This script separate difffernt crime types.
#
# MODIFIED (MM/DD/YY)
# stplaydog 08/24/16 - Stats calculation
# stplaydog 08/06/16 - Additio... | gpl-3.0 | 7,054,453,880,571,916,000 | 29.914286 | 116 | 0.475354 | false | 3.145349 | false | false | false |
FrontSide/Sizun | sizun/controllers/inspectors/inspection.py | 1 | 5266 |
"""
Sizun
MIT License
(C) 2015 David Rieger
"""
from abc import ABCMeta
from enum import IntEnum, unique
from sizun.controllers.aghandler import AGHandler
from sizun.controllers.pmdhandler import PMDHandler
from sizun.controllers.syntaxhandler import SyntaxHandler
from sizun.controllers.linegrabber import LineGrabber... | mit | 4,828,805,411,688,617,000 | 30.532934 | 118 | 0.627991 | false | 4.032159 | false | false | false |
jellis18/emcee3 | emcee3/model.py | 1 | 1839 | # -*- coding: utf-8 -*-
from __future__ import division, print_function
__all__ = ["Model"]
import numpy as np
from .state import State
class Model(object):
def __init__(self, lnlikefn=None, lnpriorfn=None, args=tuple()):
if lnpriorfn is None:
lnpriorfn = _default_lnprior_function
... | mit | -4,614,568,854,339,946,000 | 27.292308 | 68 | 0.574769 | false | 3.52975 | false | false | false |
dknlght/dkodi | src/script.module.urlresolver/lib/urlresolver/plugins/__generic_resolver__.py | 1 | 2035 | """
Plugin for URLResolver
Copyright (C) 2016 script.module.urlresolver
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) a... | gpl-2.0 | -373,994,545,689,759,040 | 34.701754 | 110 | 0.650123 | false | 4.021739 | false | false | false |
mgagne/nova | nova/tests/unit/virt/libvirt/fakelibvirt.py | 1 | 34902 | # Copyright 2010 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | apache-2.0 | 8,469,707,087,257,902,000 | 28.036606 | 78 | 0.577388 | false | 3.652747 | false | false | false |
impredicative/gcam | src/__main__.py | 1 | 54173 | #!/usr/bin/env python3
# GPFS Current Activity Monitor
# Run with -h to print help and allowable arguments.
# See params.py for more customizations.
import argparse, collections, curses, datetime, functools, inspect
import itertools, locale, logging, signal, subprocess, sys, threading, time
# Local imports
import co... | agpl-3.0 | 6,257,922,069,138,471,000 | 38.312772 | 88 | 0.530799 | false | 4.26257 | false | false | false |
Azure/azure-sdk-for-python | sdk/signalr/azure-mgmt-signalr/tests/test_cli_mgmt_signalr.py | 1 | 4604 | # 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.
#----------------------------------------------------------------------... | mit | 5,051,266,051,244,888,000 | 32.605839 | 153 | 0.544961 | false | 3.931682 | true | false | false |
baroquebobcat/pants | contrib/node/tests/python/pants_test/contrib/node/tasks/test_node_bundle_integration.py | 1 | 5851 | # coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
from conte... | apache-2.0 | 8,449,368,400,863,214,000 | 39.075342 | 96 | 0.70176 | false | 3.403723 | true | false | false |
rp-/honstats | provider.py | 1 | 10448 | """
This file is part of honstats.
honstats 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.
honstats is distributed in the hope that it wil... | gpl-3.0 | 140,861,126,853,115,950 | 34.178451 | 116 | 0.553025 | false | 3.791001 | false | false | false |
ValyrianTech/BitcoinSpellbook-v0.3 | darwin/genome.py | 1 | 2090 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from darwin.chromosome import Chromosome
import hashlib
import binascii
import simplejson
class Genome(object):
def __init__(self):
self.chromosomes = {}
self.fitness = None
# def add_chromosome(self, chromosome):
# if not isinstance(chr... | gpl-3.0 | -4,451,533,938,911,407,600 | 32.174603 | 128 | 0.615311 | false | 3.591065 | false | false | false |
sam-m888/gprime | gprime/plugins/lib/librecords.py | 1 | 20750 | # encoding:utf-8
#
# gPrime - A web-based genealogy program - Records plugin
#
# Copyright (C) 2008-2011 Reinhard Müller
# Copyright (C) 2010 Jakim Friant
# Copyright (C) 2013-2016 Paul Franklin
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public ... | gpl-2.0 | -3,168,658,341,514,602,000 | 41.002024 | 96 | 0.565521 | false | 3.937192 | false | false | false |
diego-d5000/MisValesMd | env/lib/python2.7/site-packages/django/conf/locale/ca/formats.py | 1 | 1049 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = r'j \d\e F \d\e Y'
TIME_FO... | mit | -3,880,304,409,747,797,500 | 29.787879 | 77 | 0.590086 | false | 2.497619 | false | true | false |
MaxTyutyunnikov/lino | lino/management/commands/show.py | 1 | 1890 | # -*- coding: UTF-8 -*-
## Copyright 2013 Luc Saffre
## This file is part of the Lino project.
## Lino 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 op... | gpl-3.0 | -5,115,309,132,442,897,000 | 33.660377 | 81 | 0.621164 | false | 4.237668 | false | false | false |
botswana-harvard/getresults-label | getresults_label/classes/client_printer.py | 1 | 1707 | import socket
from ..exceptions import LabelPrinterError
from ..models import Client, LabelPrinter
from .printer import Printer
class ClientPrinter(Printer):
"""Sets up the printer by selecting an instance of the
Client model for a given IP address.
Args:
* client_addr: ip_address or hostname. cl... | gpl-2.0 | 5,627,137,073,316,461,000 | 43.921053 | 98 | 0.629174 | false | 4.354592 | false | false | false |
kernsuite-debian/obit | bin/obitinclude.py | 1 | 1077 | #!python
# Script to run gcc preprocessor on files whose name ends in "Def.h"
# or echo the file contents otherwise
# File name is only argument
import os, sys
# Routine to recursively read include
def parseInclude(lline):
fname = lline.split()[1].replace('"','')
infil = os.getenv("OBIT")+"include/"+fname
... | gpl-2.0 | -7,073,445,046,572,088,000 | 27.342105 | 74 | 0.615599 | false | 3.614094 | false | false | false |
nvictus/23andCSB | apps/api/views.py | 1 | 3339 | from django.http import HttpResponse
from django.shortcuts import redirect
import json
import logging
log = logging.getLogger("apidemo")
# import our OAuth client
from . import client
# view decorator
def requires_login(view_fcn):
def wrapper(request, *args, **kwargs):
if client.OAUTH_KEY in request.sess... | bsd-2-clause | 5,066,159,913,403,948,000 | 33.42268 | 83 | 0.65289 | false | 3.777149 | false | false | false |
pyload/pyload | src/pyload/plugins/base/xfs_account.py | 1 | 7673 | # -*- coding: utf-8 -*-
import locale
import re
import time
import urllib.parse
from pyload.core.utils import parse
from ..helpers import parse_html_form, set_cookie, search_pattern
from .account import BaseAccount
class XFSAccount(BaseAccount):
__name__ = "XFSAccount"
__type__ = "account"
__version__ ... | agpl-3.0 | 3,073,557,959,690,170,000 | 30.191057 | 119 | 0.512707 | false | 3.849975 | false | false | false |
brianrogers/TCEmailConnector | main.py | 1 | 1540 | #!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | mit | -7,863,133,173,778,177,000 | 33.222222 | 125 | 0.632468 | false | 3.908629 | false | false | false |
jakobkolb/MayaSim | mayasim/model/ModelCore.py | 1 | 66303 | from __future__ import print_function
import datetime
import operator
import os
import sys
import traceback
import warnings
from itertools import compress
import networkx as nx
import numpy as np
import pandas
import pkg_resources
import scipy.ndimage as ndimage
import scipy.sparse as sparse
try:
import cPickle ... | gpl-3.0 | 4,912,365,931,477,879,000 | 38.209344 | 101 | 0.523777 | false | 4.030333 | false | false | false |
tapomayukh/projects_in_python | rapid_categorization/haptic_map/outlier/hmm_crossvalidation_force.py | 1 | 19066 | # Hidden Markov Model Implementation
import pylab as pyl
import numpy as np
import matplotlib.pyplot as pp
#from enthought.mayavi import mlab
import scipy as scp
import scipy.ndimage as ni
import roslib; roslib.load_manifest('sandbox_tapo_darpa_m3')
import rospy
#import hrl_lib.mayavi2_util as mu
import hrl_lib.viz ... | mit | 6,581,055,320,970,993,000 | 41.844944 | 133 | 0.48993 | false | 2.451273 | false | false | false |
rksaxena/hacker_ramp | scoring.py | 1 | 2740 | import find_overlap
scores = {
'zara': 0.5,
'vogue': 0.5,
'google': 0.5
}
def find_keyword_occurences_in_source(map, source):
freq = 0
for key, value in map.iteritems():
for k, v in value.iteritems():
if v['source'] == source:
freq += 1
# print freq
ret... | apache-2.0 | 3,741,584,056,191,492,600 | 32.024096 | 90 | 0.587956 | false | 3.030973 | false | false | false |
Wengex/PyDirectory | pydirectory/activedirectory/objects/types.py | 1 | 3640 | from pydirectory.ldap.objects import types
class object(types.object):
_type = {}
class user(object):
_type = {
'objectClass' : [b'top', b'person', b'organizationalPerson', b'user']
}
@property
def is_enable(self):
mod = int(self.useraccountcontrol.value) % 8
if mod == 0:
return True
else:
return F... | gpl-2.0 | 3,301,856,316,181,458,400 | 25 | 110 | 0.698901 | false | 3.087362 | false | false | false |
wsyzxcn/tornado | tornado/ioloop.py | 1 | 42597 | #!/usr/bin/env python
#
# Copyright 2009 Facebook
#
# 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 a... | apache-2.0 | 2,620,420,939,369,841,000 | 37.61922 | 93 | 0.597272 | false | 4.593164 | false | false | false |
shearichard/spellsplash | splsplsh_project/splsplsh_project/settings/HIDE_s_e_t_t_i_n_g_s.py | 1 | 2002 | """
Django settings for splsplsh_project project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR... | gpl-3.0 | 7,098,006,736,481,004,000 | 23.414634 | 71 | 0.722278 | false | 3.208333 | false | false | false |
cristian99garcia/agubrowser-activity | Modulos/Pantalla_Completa.py | 1 | 3372 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
# Arma una pantalla completa con la ventana de AguBrowse
# Pantalla_Completa.py por:
# Agustin Zuiaga <aguszs97@gmail.com>
# Python Joven - Utu Rafael Peraza
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Ge... | gpl-2.0 | -8,409,454,308,710,824,000 | 33.060606 | 106 | 0.658956 | false | 3.273786 | false | false | false |
dav-stott/phd-thesis | spectra_thesis_ais.py | 1 | 70177 | # -*- coding: utf-8 -*-
"""
Created on Fri Jul 25 08:48:28 2014
@author: david
"""
#*************** IMPORT DEPENDANCIES*******************************************
import numpy as np
#import spec_gdal4 as spg
from osgeo import gdal
import os
import csv
#import h5py
import datetime
import numpy.ma as ma
#from StringIO ... | mit | 2,521,095,999,925,145,000 | 38.961845 | 116 | 0.457732 | false | 3.784489 | false | false | false |
TheAlgorithms/Python | project_euler/problem_006/sol4.py | 1 | 1038 | """
Project Euler Problem 6: https://projecteuler.net/problem=6
Sum square difference
The sum of the squares of the first ten natural numbers is,
1^2 + 2^2 + ... + 10^2 = 385
The square of the sum of the first ten natural numbers is,
(1 + 2 + ... + 10)^2 = 55^2 = 3025
Hence the difference between the sum of... | mit | -9,040,634,359,307,308,000 | 24.317073 | 72 | 0.620424 | false | 3.274448 | false | false | false |
awbirdsall/popmodel | src/popmodel/absprofile.py | 1 | 3828 | '''popmodel module for AbsProfile class
'''
from __future__ import division
from . import ohcalcs as oh
import logging
import numpy as np
from scipy.constants import k as kb
from scipy.constants import c
class AbsProfile(object):
'''absorbance line profile, initially defined in __init__ by a center
wavenumber... | mit | -1,456,483,203,360,930,300 | 38.061224 | 79 | 0.605799 | false | 3.790099 | false | false | false |
jcrocholl/nxdom | tests/views.py | 1 | 2372 | from datetime import datetime, timedelta
from ragendja.template import render_to_response
from ragendja.dbutils import get_object_or_404
from tests.models import Comparison
def statistics(path):
results = {'path': path}
missing = []
seconds1 = []
seconds2 = []
total = errors = failures = 0
q... | mit | 6,682,742,311,232,221,000 | 33.376812 | 71 | 0.636172 | false | 3.966555 | false | false | false |
omanor/MUSiCC | tests/test_musicc.py | 1 | 5038 | #!/usr/bin/env python
"""
This is the testing unit for MUSiCC
"""
# to comply with both Py2 and Py3
from __future__ import absolute_import, division, print_function
import unittest
import os
import pandas as pd
import musicc
from musicc.core import correct_and_normalize
class MUSiCCTestCase(unittest.TestCase):
... | bsd-3-clause | 6,936,621,393,585,861,000 | 53.76087 | 144 | 0.641921 | false | 3.436562 | true | false | false |
aktech/codeplay | playcode/views.py | 1 | 1029 | from django.shortcuts import render
from django.http import HttpResponse, HttpResponseRedirect
from django.http import JsonResponse
import requests
# Constants
RUN_URL = u'https://api.hackerearth.com/v3/code/run/'
CLIENT_SECRET = 'cd70993ac2dbee9e7c7b2c533a104a7d621632fa'
def home(request):
if request.method ==... | mit | 249,148,959,412,249,570 | 30.181818 | 68 | 0.578231 | false | 3.825279 | false | false | false |
inveniosoftware/invenio-pages | tests/test_rest.py | 1 | 1969 | from invenio_pages import InvenioPagesREST
from invenio_pages.rest import blueprint
# mock the rest API url prefix
blueprint.url_prefix = '/api/{}'.format(blueprint.url_prefix)
def test_page_content(pages_fixture):
"""Test page content."""
app = pages_fixture
app.register_blueprint(blueprint)
with a... | gpl-2.0 | 9,188,939,193,106,529,000 | 31.278689 | 68 | 0.499238 | false | 4.180467 | true | false | false |
Wireless-Innovation-Forum/Spectrum-Access-System | src/harness/reference_models/geo/census_tract.py | 1 | 1899 | # Copyright 2018 SAS Project 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 requ... | apache-2.0 | 1,746,755,792,508,643,600 | 40.282609 | 99 | 0.7109 | false | 3.446461 | false | false | false |
Wasper256/locallibrary | catalog/views.py | 1 | 6065 | """Main file that describes all of views."""
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
from django.contrib.auth.decorators import permission_required
from django.contrib.auth.mixins import (LoginRequiredMixin,
PermissionRequiredMixin)
from ... | gpl-3.0 | 3,097,310,997,405,115,000 | 29.943878 | 79 | 0.66249 | false | 4.00066 | false | false | false |
lmazuel/azure-sdk-for-python | azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_update_network_configuration.py | 1 | 2800 | # 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 | 2,217,715,932,702,342,000 | 48.122807 | 125 | 0.671429 | false | 4.334365 | true | false | false |
trilan/stencil | stencil/variables.py | 1 | 1115 | import os
from optparse import make_option
class Variable(object):
def __init__(self, name, default=None, environ=None, help=None,
metavar=None, prompt=None):
self.name = name
if environ:
self.default = os.environ.get(environ, default)
else:
self.d... | bsd-2-clause | 6,171,686,205,864,813,000 | 29.972222 | 75 | 0.552466 | false | 4.12963 | false | false | false |
echonesis/mAiLab_Class | mAiLab_0002/RandomNumber.py | 1 | 1753 | #!/usr/bin/python
def simpleGenRandomNumber(n, llimit=0, ulimit=1):
import random
result = [random.uniform(llimit, ulimit) for i in xrange(n)]
return result
if __name__ == '__main__':
# For basic questions
# Basic #1
# In this part, the built-in Python functions would be used.
num_random =... | mit | 6,842,228,498,127,733,000 | 27.737705 | 100 | 0.64575 | false | 2.809295 | false | false | false |
Akasurde/virt-manager | virtinst/devicedisk.py | 1 | 33899 | #
# Classes for building disk device xml
#
# Copyright 2006-2008, 2012-2014 Red Hat, Inc.
# Jeremy Katz <katzj@redhat.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 t... | gpl-2.0 | 6,410,544,415,410,951,000 | 32.39803 | 79 | 0.553291 | false | 4.093093 | false | false | false |
Taffer/cryptopals | cryptopals/scoring.py | 1 | 3026 | # -*- coding: utf-8 -*-
''' Methods for scoring the relative goodness of strings.
Note that scores are relative to other scores *from the same method*.
Score from one method have no relation to scores from a different method.
Created on Feb 10, 2015
@author: Chris
'''
from __future__ import absolute_im... | mit | 5,847,930,100,003,295,000 | 29.852632 | 83 | 0.656642 | false | 3.879487 | false | false | false |
MockyJoke/numbers | ex11/code/reddit_relative_hint.py | 1 | 1921 | import sys
from pyspark.sql import SparkSession, functions, types
spark = SparkSession.builder.appName('reddit relative scores').getOrCreate()
assert sys.version_info >= (3, 4) # make sure we have Python 3.4+
assert spark.version >= '2.1' # make sure we have Spark 2.1+
schema = types.StructType([ # commented-out fie... | mit | 8,161,441,920,440,513,000 | 40.76087 | 76 | 0.690265 | false | 3.610902 | false | false | false |
steveYeah/amqpeek | tests/unit/cli/test_format_queues.py | 1 | 1706 | """Tests for the correct reading of the queue config."""
from copy import deepcopy
from amqpeek.cli import build_queue_data
class TestFormatQueues:
"""Tests parsing of queue config."""
def test_dedup_queue_config(self, config_data: dict) -> None:
"""Tests handling of duplicate config entries in diff... | mit | 3,850,180,313,175,439,400 | 31.807692 | 75 | 0.627198 | false | 4.120773 | true | false | false |
Stefan-Korner/SpacePyLibrary | UTIL/BCH.py | 1 | 4660 | #******************************************************************************
# (C) 2018, Stefan Korner, Austria *
# *
# The Space Python Library is free software; you can redistribute it and/or *
... | mit | 9,777,268,574,965,220 | 47.041237 | 79 | 0.441845 | false | 4.498069 | false | false | false |
UoA-eResearch/saga-gis | saga-gis/src/scripting/python/examples/06_xyz2shp.py | 1 | 2459 | #! /usr/bin/env python
import saga_api, sys, os
##########################################
def xyz2shp(fTable):
table = saga_api.SG_Get_Data_Manager().Add_Table()
if table.Create(saga_api.CSG_String(fTable)) == 0:
table.Add_Field(saga_api.CSG_String('X'), saga_api.SG_DATATYPE_Double)
table.A... | gpl-3.0 | -6,035,837,658,102,959,000 | 34.637681 | 133 | 0.537617 | false | 2.862631 | false | false | false |
akrherz/iem | htdocs/plotting/auto/scripts100/p153.py | 1 | 6880 | """Highest hourly values"""
from collections import OrderedDict
import datetime
import pandas as pd
from pandas.io.sql import read_sql
from matplotlib.font_manager import FontProperties
from pyiem.util import get_autoplot_context, get_dbconn
from pyiem.plot.use_agg import plt
from pyiem.exceptions import NoDataFound
... | mit | -6,262,800,647,354,188,000 | 28.029536 | 76 | 0.5125 | false | 3.351193 | false | false | false |
rahulsekar/iplytics | app/detl.py | 1 | 4587 | import requests
import json
import os.path
import csv
def master_csv():
return 'data/master.csv'
def download_scorecard(year, game, redo=False):
fname = 'data/extracts/%d-%02d.json' % (year, game)
if os.path.isfile(fname) and not redo:
return fname
url = 'http://datacdn.... | mit | -1,113,001,072,501,218,300 | 26.303571 | 117 | 0.514279 | false | 3.504202 | false | false | false |
NilsJPWerner/Sublet-Uchicago | accounts/forms.py | 1 | 3140 | from django import forms
from .models import ExtendedUser
from allauth.account.forms import UserForm, PasswordField, SetPasswordField
from allauth.account import app_settings
from allauth.account.adapter import get_adapter
from allauth.account.models import EmailAddress
from allauth.account.utils import filter_users_b... | gpl-2.0 | 1,834,477,134,348,089,900 | 40.88 | 124 | 0.577707 | false | 4.479315 | false | false | false |
karllark/dust_extinction | dust_extinction/helpers.py | 1 | 1863 | from __future__ import absolute_import, print_function, division
import warnings
import numpy as np
import astropy.units as u
__all__ = ["_get_x_in_wavenumbers", "_test_valid_x_range"]
def _get_x_in_wavenumbers(in_x):
"""
Convert input x to wavenumber given x has units.
Otherwise, assume x is in wavene... | bsd-3-clause | -973,880,790,089,943,900 | 26 | 79 | 0.595276 | false | 3.603482 | false | false | false |
yugangw-msft/azure-cli | src/azure-cli/azure/cli/command_modules/security/_help.py | 2 | 39766 | # 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.
# -----------------------------------------------------... | mit | -4,440,880,175,984,025,600 | 39.371574 | 503 | 0.744832 | false | 3.806452 | false | false | false |
ComputoCienciasUniandes/MetodosComputacionalesLaboratorio | 2017-1/lab8_EJ3/lab8SOL_eJ3/spring_mass.py | 1 | 1084 | import numpy as np
import matplotlib.pyplot as plt
N = 5000 #number of steps to take
xo = 0.2 #initial position in m
vo = 0.0 #initial velocity
tau = 4.0 #total time for the simulation in s .
dt = tau/float(N) # time step
k = 42.0 #spring constant in N/m
m = 0.25 #mass in kg
g = 9.8 #in m/ s ^2
mu = 0.15 #friction coe... | mit | -9,078,993,478,934,890,000 | 20.27451 | 61 | 0.631919 | false | 2.618357 | false | false | false |
leonevo/euao | BaseAdapter/BaseAdapter.py | 1 | 39358 | #-*- coding: utf-8 -*-
from optparse import OptionParser
import sys
import os
root_dir=os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
sys.path.append(root_dir)
import CommonDefinition
import subprocess, os, time, signal
import telnetlib
import paramiko
from os import linesep
import re
from tim... | apache-2.0 | 7,493,101,361,177,667,000 | 41.631929 | 217 | 0.530618 | false | 4.481439 | false | false | false |
ximepa/docp | planning/migrations/0001_initial.py | 1 | 2739 | # -*- 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 model 'PlanningConnections'
db.create_table(u'planning_planningc... | gpl-3.0 | 8,479,388,373,723,343,000 | 48.818182 | 123 | 0.560058 | false | 3.656876 | false | false | false |
jansel/gridea | network.py | 1 | 7182 | # encoding: utf-8
# Broadcast protocol used to build a distributed cluster of solver processes.
#
# This code uses the twisted event driven networking framework:
# http://twistedmatrix.com/documents/13.0.0/core/howto/servers.html
#
import json
import logging
import threading
import time
import twisted
from twisted.i... | mit | 5,373,871,410,311,807,000 | 33.528846 | 79 | 0.627123 | false | 4.310924 | false | false | false |
helix84/activae | src/CTK_trunk/CTK/ToggleButton.py | 1 | 4484 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2010 CENATIC: Centro Nacional de Referencia de
# Aplicacion de las TIC basadas en Fuentes Abiertas, Spain.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# Redistribution... | bsd-3-clause | -6,415,709,346,895,044,000 | 31.258993 | 80 | 0.617306 | false | 3.660408 | false | false | false |
pocin/kbc-mailchimp-writer | tests/test_cleaning_tags.py | 1 | 2758 | import pytest
from mcwriter.exceptions import MissingFieldError, CleaningError
from mcwriter.cleaning import clean_and_validate_tags_data, _clean_tags_options
def test_cleaning_tags_minimal_example():
data = {
'name': 'My custom tag',
'list_id': 'abc01234',
'type': 'text',
}
expect... | mit | 103,546,474,157,596,140 | 22.982609 | 79 | 0.565265 | false | 3.482323 | true | false | false |
tobias-d-oe/plugin.program.tvhighlights | default.py | 1 | 21271 | #!/usr/bin/python
###########################################################################
#
# FILE: plugin.program.tvhighlights/default.py
#
# AUTHOR: Tobias D. Oestreicher
#
# LICENSE: GPLv3 <http://www.gnu.org/licenses/gpl.txt>
# VERSION: 0.1.5
# CREATED: 05.02.2016
#
######... | gpl-3.0 | 1,174,358,839,341,263,600 | 41.037549 | 181 | 0.608669 | false | 3.511225 | false | false | false |
radish-bdd/radish | src/radish/hookregistry.py | 1 | 12567 | """
radish
~~~~~~
The root from red to green. BDD tooling for Python.
:copyright: (c) 2019 by Timo Furrer <tuxtimo@gmail.com>
:license: MIT, see LICENSE for more details.
"""
import inspect
import bisect
import tagexpressions
from radish.errors import HookExecError
class HookImpl:
"""Represent a single Hook ... | mit | 3,404,934,900,386,662,000 | 34.4 | 111 | 0.505928 | false | 4.789253 | false | false | false |
gpanders/Janitor | src/pushbroom/console.py | 1 | 4525 | """
Pushbroom entry point
"""
import argparse
import configparser
import fnmatch
import logging
import os
import re
import sys
from pathlib import Path
from typing import Dict
from pushbroom import __version__, sweep
def run() -> None:
"""Main entry point"""
args = parse_args()
setup_logging(args)
co... | mit | -6,263,718,687,116,045,000 | 31.553957 | 86 | 0.62232 | false | 3.834746 | true | false | false |
tombstone/models | research/skip_thoughts/skip_thoughts/vocabulary_expansion.py | 1 | 7375 | # Copyright 2017 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 | -7,316,208,268,084,766,000 | 35.330049 | 80 | 0.70739 | false | 3.700452 | false | false | false |
liosha2007/temporary-groupdocs-python-sdk | groupdocs/models/AddCollaboratorResponse.py | 1 | 1165 | #!/usr/bin/env python
"""
Copyright 2012 GroupDocs.
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... | apache-2.0 | -8,842,829,589,295,494,000 | 29.657895 | 77 | 0.649785 | false | 4.463602 | false | false | false |
shoyer/xray | xarray/core/utils.py | 1 | 18865 | """Internal utilties; not for external use
"""
import contextlib
import functools
import itertools
import os.path
import re
import warnings
from collections import OrderedDict
from typing import (
AbstractSet, Any, Callable, Container, Dict, Hashable, Iterable, Iterator,
Mapping, MutableMapping, MutableSet, Opt... | apache-2.0 | -7,918,667,577,346,718,000 | 29.825163 | 79 | 0.608958 | false | 3.940058 | false | false | false |
cyrta/sandbox | ml/pytorch/two_layer_net_custom_function.py | 1 | 2350 | # Code in file autograd/two_layer_net_custom_function.py
import torch
from torch.autograd import Variable
class MyReLU(torch.autograd.Function):
"""
We can implement our own custom autograd Functions by subclassing
torch.autograd.Function and implementing the forward and backward passes
which operate on Tensor... | unlicense | -2,534,284,823,519,713,300 | 33.057971 | 80 | 0.712766 | false | 3.544495 | false | false | false |
korepwx/tfsnippet | tfsnippet/examples/utils/jsonutils.py | 1 | 5598 | import json
from base64 import b64encode, b64decode
from datetime import datetime
import numpy as np
import six
__all__ = [
'JsonBinary', 'JsonEncoder', 'JsonDecoder',
]
class JsonBinary(object):
"""
Wrapper class for binary objects.
In Python2, ordinary strings are binary strings, thus we cannot e... | mit | -2,111,988,705,628,866,800 | 32.722892 | 80 | 0.566274 | false | 3.903766 | false | false | false |
utcoupe/coupe18 | ros_ws/src/processing_belt_interpreter/src/belt_parser.py | 1 | 2839 | #!/usr/bin/env python
import xml.etree.ElementTree as ET
import rospy
class BeltParser(object):
"""Class used to parse the definition XML"""
def __init__(self, file):
super(BeltParser, self).__init__()
rospy.logdebug("Parsing belt definition...")
root = ET.parse(file).getroot()
... | gpl-3.0 | 5,276,671,905,392,511,000 | 36.853333 | 126 | 0.549489 | false | 4.25 | false | false | false |
spencerpomme/coconuts-on-fire | DSA/ArrayQueue.py | 1 | 2810 | # python implemented queue ADT
# A new exception class defined for handling empty errors
class Empty(Exception):
'''
Error attempting to access an element from an empty container.
'''
pass
class ArrayQueue:
'''FIFO queue implementation using a python list as underlying storage.'''
DEFAULT_CAPA... | apache-2.0 | 7,368,616,952,017,347,000 | 38.027778 | 91 | 0.484698 | false | 4.652318 | false | false | false |
renatosamperio/context_task_queue | Tools/create_service.py | 1 | 21855 | #!/usr/bin/env python
# -*- coding: latin-1 -*-
import sys, os
from optparse import OptionParser, OptionGroup
import xml.etree.ElementTree as ET
## Importing Utils from parent path
file_path = os.path.dirname(__file__)
join_path = os.path.join(file_path, '../Utils')
abs_path = os.path.abspath(join_path)
sys.path.app... | gpl-3.0 | -4,830,159,946,343,961,000 | 33.418898 | 101 | 0.666941 | false | 3.766155 | true | false | false |
rojinva/Email-classifier | Text classification with probability.py | 1 | 2058 |
__author__="rojin.varghese"
__date__ ="$Nov 8, 2013 8:48:18 PM$"
import os
from xlrd import open_workbook
import re
import xlwt
j = os.path.join
def train(text):
c = {}
lastword = ""
line = re.sub('[\-#*>]', '', text)
line = re.sub('[\n]', '', line)
for word in line.split():
word = word.l... | unlicense | -6,348,697,365,323,838,000 | 26.44 | 112 | 0.556365 | false | 3.200622 | false | false | false |
huertatipografica/huertatipografica-fl-scripts | AT_Compatibility/AT_Compatible.py | 1 | 1585 | #FLM: AT Compatibility check
#Check compatibility of selected glyphs between the current font and declared fontCompare (Postcrit Full Name)
# By Andres Torresi
# http://www.huertatipografica.com
#fullName of font you want to compare with current font
fontCompare='ABBvoice Bold';
colorCompatible=150
colorIncompatible=... | apache-2.0 | -4,392,702,551,218,769,000 | 23.384615 | 110 | 0.681388 | false | 2.979323 | false | false | false |
jzahedieh/django-tennis-ladder | tennis/settings.py | 1 | 6946 | # Django settings for tennis project.
import os
SETTINGS_DIR = os.path.abspath(os.path.dirname(__file__))
DEBUG = os.environ.get("DEBUG_VALUE") == 'True'
ADMINS = (
('Admin User', 'admin@highgate-ladder.co.uk'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
... | mit | 8,503,064,163,933,158,000 | 32.080952 | 85 | 0.670746 | false | 3.665435 | false | false | false |
drewokane/xray | xarray/core/groupby.py | 1 | 20086 | import functools
import numpy as np
import pandas as pd
from . import ops
from .combine import concat
from .common import (
ImplementsArrayReduce, ImplementsDatasetReduce, _maybe_promote,
)
from .pycompat import zip
from .utils import peek_at, maybe_wrap_array, safe_cast_to_index
from .variable import as_variable,... | apache-2.0 | 8,235,435,103,712,422,000 | 37.478927 | 81 | 0.590959 | false | 4.50763 | false | false | false |
forkbong/qutebrowser | qutebrowser/config/configexc.py | 1 | 5505 | # vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2021 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 | -2,327,407,455,753,032,700 | 30.820809 | 75 | 0.581471 | false | 4.453883 | true | false | false |
hdemeyer/king-phisher | king_phisher/version.py | 1 | 3552 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# king_phisher/version.py
#
# 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 lis... | bsd-3-clause | 2,827,822,948,980,709,400 | 36.389474 | 92 | 0.739583 | false | 3.84 | false | false | false |
Vito2015/tcc3-portal | tcc3portal/api/users.py | 1 | 1150 | # coding:utf-8
"""
tcc3portal.api.users
~~~~~~~~~~~~~~~~~~~~
User endpoints.
:copyright: (c) 2015 by Vito.
:license: GNU, see LICENSE for more details.
"""
from flask import Blueprint, current_app
from flask_login import login_required
# from flask import json
# from . import route
from ..tcc_core ... | gpl-2.0 | 2,390,627,513,436,331,000 | 27.75 | 81 | 0.629565 | false | 3.285714 | false | false | false |
momahajogami/Prime-Numbers | practical_sieve.py | 1 | 1165 | def primes_in_block(small_primes, L, R, B):
# Algorithm 3.2.1 in Prime Numbers, A Computational Perspective.
# p. 122
# 0. Choose R>L even,
# L > P := int_sqrt(R),
# B|R-L
primes_in_range = []
# 1. Initialize offsets.
primes_with_offsets = []
for p in small_... | mit | 5,651,048,751,521,574,000 | 28.125 | 68 | 0.499571 | false | 2.820823 | false | false | false |
rafaellehmkuhl/OpenCV-Python-GUI | CvPyGui/PlotContainer.py | 1 | 2407 | import pandas as pd
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import (QWidget, QLabel, QHBoxLayout,
QVBoxLayout, QPushButton, QSlider,
QComboBox)
from matplotlib.backends.backend_qt4agg import NavigationToolbar2QT as NavigationToolbar
from matplotlib.bac... | mit | -3,096,640,997,540,342,000 | 30.671053 | 97 | 0.641047 | false | 3.8512 | false | false | false |
coolharsh55/hdd-indexer | hdd_indexer/views.py | 1 | 19442 | """Views for hdd-indexer
/ - homepage
/crawler [GET/POST] - crawler interactions
/loader [GET/POST] - loader interactions
/settings [POST] - settings
/setup [POST] - setup
"""
# TODO: refactor validations into separate methods
# TODO: make validation a method of class
# HDDRoot.validate(path): Tr... | mit | 745,216,335,649,311,700 | 29.81141 | 75 | 0.562031 | false | 3.886845 | false | false | false |
google/report2bq | application/classes/sa360_report_validation/visit.py | 1 | 1861 | """
Copyright 2020 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
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
di... | apache-2.0 | -4,312,721,375,928,980,500 | 25.225352 | 80 | 0.634605 | false | 4.002151 | false | false | false |
sudhirmishra/edx-dl | edx_dl/common.py | 1 | 4327 | # -*- coding: utf-8 -*-
"""
Common type definitions and constants for edx-dl
The classes in this module represent the structure of courses in edX. The
structure is:
* A Course contains Sections
* Each Section contains Subsections
* Each Subsection contains Units
Notice that we don't represent the full tree structu... | lgpl-3.0 | 7,304,929,588,988,307,000 | 26.916129 | 79 | 0.610354 | false | 4.117031 | false | false | false |
uc-cdis/cdis-python-utils | cdispyutils/profiling/profiler.py | 1 | 8064 | __all__ = ["Profiler"]
from collections import defaultdict
import cProfile
import datetime
import errno
import functools
import os
import time
from werkzeug.contrib.profiler import ProfilerMiddleware
def profile(category, *profiler_args, **profiler_kwargs):
"""
Decorate a function to run a profiler on the e... | apache-2.0 | 6,428,691,702,124,679,000 | 36.16129 | 88 | 0.598586 | false | 4.512591 | false | false | false |
jordanpotti/AWSBucketDump | AWSBucketDump.py | 1 | 7239 | #!/usr/bin/env python
# AWSBucketDump is a tool to quickly enumerate AWS S3 buckets to look for loot.
# It's similar to a subdomain bruteforcer but is made specifically to S3
# buckets and also has some extra features that allow you to grep for
# delicous files as well as download interesting files if you're not
# afr... | mit | 4,622,916,681,330,770,000 | 29.544304 | 160 | 0.629231 | false | 3.927835 | false | false | false |
greyshell/Exploit-Dev | find_safe_address/find_safe_address.py | 1 | 3098 | #!/usr/bin/env python3
# author: greyshell
# description: find safe return address
import argparse
import sys
from colorama import Fore
# global constant variable
PROGRAM_LOGO = """
___ __ __ ___ ___ __ __ __ ___ __ __
|__ | |\ | | \ /__` /\ |__ |__ /\ | \ | ... | mit | -1,507,579,297,391,570,400 | 25.478632 | 109 | 0.517431 | false | 3.71018 | false | false | false |
jokey2k/sentry | src/sentry/api/base.py | 1 | 5659 | from __future__ import absolute_import
__all__ = ['DocSection', 'Endpoint', 'StatsMixin']
import logging
from datetime import datetime, timedelta
from django.utils.http import urlquote
from django.views.decorators.csrf import csrf_exempt
from enum import Enum
from pytz import utc
from rest_framework.authentication i... | bsd-3-clause | -3,169,921,191,962,351,000 | 30.265193 | 97 | 0.604877 | false | 4.130657 | false | false | false |
symbolicdata/code | src/sdeval/classes/computationproblems/GB_Z_lp.py | 1 | 4721 | from ComputationProblem import ComputationProblem
import os
class GB_Z_lp(ComputationProblem):
"""
This computation problem represents the computation of a Groebner basis of a given polynomial system
(commutative) with integer coefficients and the lexicographical ordering.
.. moduleauthor:: Albert Hei... | gpl-3.0 | -7,154,972,848,801,620,000 | 41.918182 | 136 | 0.640119 | false | 4.847023 | false | false | false |
pombredanne/kitchen-1 | kitchen2/tests/test_i18n.py | 1 | 40979 | # -*- coding: utf-8 -*-
#
import unittest
from nose import tools
import os
import types
from kitchen import i18n
import base_classes
class TestI18N_UTF8(unittest.TestCase, base_classes.UnicodeTestData):
def setUp(self):
self.old_LC_ALL = os.environ.get('LC_ALL', None)
os.environ['LC_ALL'] = 'pt_... | gpl-2.0 | -4,151,479,420,773,446,700 | 48.97439 | 137 | 0.617389 | false | 3.12602 | true | false | false |
mholtrop/Phys605 | Python/RTC/ReadClock.py | 1 | 1380 | #!/usr/bin/env python
#
# The wiringPi requires you to run as sudo.
# This is needed for access to /dev/mem, which we don't use here.
# There is no way around this though, so we start this code as a root user.
#
#
import wiringpi as wp
#
# Define a function to decode BCD encoded numbers.
def decBCD(num):
return( (n... | gpl-3.0 | -5,986,468,438,403,868,000 | 27.75 | 118 | 0.675362 | false | 2.247557 | false | false | false |
hachreak/invenio-oauthclient | invenio_oauthclient/contrib/orcid.py | 1 | 7449 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2014, 2015, 2016, 2017 CERN.
#
# Invenio is free software; you can redistribute it
# and/or modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your... | gpl-2.0 | 46,624,260,302,116,430 | 30.969957 | 79 | 0.657404 | false | 3.728228 | false | false | false |
PyCQA/isort | tests/unit/test_place.py | 1 | 2623 | """Tests for the isort import placement module"""
from functools import partial
from isort import place, sections
from isort.settings import Config
def test_module(src_path):
place_tester = partial(place.module, config=Config(src_paths=[src_path]))
assert place_tester("isort") == sections.FIRSTPARTY
asse... | mit | 7,563,002,035,906,282,000 | 45.839286 | 100 | 0.700724 | false | 3.790462 | true | false | false |
Aravinthu/odoo | addons/maintenance/models/maintenance.py | 1 | 20858 | # -*- coding: utf-8 -*-
from datetime import date, datetime, timedelta
from odoo import api, fields, models, SUPERUSER_ID, _
from odoo.exceptions import UserError
from odoo.tools import DEFAULT_SERVER_DATE_FORMAT, DEFAULT_SERVER_DATETIME_FORMAT
class MaintenanceStage(models.Model):
""" Model for case stages. Th... | agpl-3.0 | 8,363,381,834,550,002,000 | 52.619537 | 195 | 0.651788 | false | 3.823648 | false | false | false |
lbarahona/UdacityProject4 | main.py | 1 | 2446 | #!/usr/bin/env python
"""
main.py -- Udacity conference server-side Python App Engine
HTTP controller handlers for memcache & task queue access
$Id$
created by wesc on 2014 may 24
"""
__author__ = 'wesc+api@google.com (Wesley Chun)'
import webapp2
from google.appengine.api import app_identity
from google.appe... | apache-2.0 | -2,527,707,062,007,526,000 | 37.825397 | 109 | 0.657809 | false | 3.809969 | false | false | false |
JohnSnowLabs/spark-nlp | python/tensorflow/lib/ner/ner_model.py | 1 | 21854 | import numpy as np
import tensorflow as tf
import random
import math
import sys
from sentence_grouper import SentenceGrouper
class NerModel:
# If session is not defined than default session will be used
def __init__(self, session=None, dummy_tags=None, use_contrib=True, use_gpu_device=0):
tf.disable_v... | apache-2.0 | -6,108,740,250,423,457,000 | 41.352713 | 167 | 0.541182 | false | 4.022455 | false | false | false |
vlegoff/tsunami | src/primaires/vehicule/force.py | 1 | 2990 | # -*-coding:Utf-8 -*
# Copyright (c) 2010-2017 DAVY Guillaume
# 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
#... | bsd-3-clause | -9,029,035,095,335,561,000 | 30.09375 | 79 | 0.669012 | false | 4.044715 | false | false | false |
KDE/pykde4 | examples/kdeuiExamples/kaboutapplicationdialog.py | 1 | 2937 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from PyQt4.QtCore import SIGNAL, Qt
from PyQt4.QtGui import QLabel, QSizePolicy
from PyKDE4.kdecore import i18n, ki18n, KAboutData
from PyKDE4.kdeui import KVBox, KHBox, KPushButton, KAboutApplicationDialog
helpText = """The KAboutApplicationDialog is normally displayed ... | gpl-2.0 | 8,162,753,217,201,841,000 | 30.580645 | 84 | 0.646578 | false | 3.717722 | false | false | false |
caesar0301/omnilab-misc | OmniperfTools/perf_aem.py | 1 | 1492 | #!/usr/bin/env python
# Evaluating Activity-Entity model
#
# By chenxm
#
import os
import sys
import groundtruth
from PyOmniMisc.model.aem import AEM
def print_usage():
print("Usage: python exHttp.py <omniperf_trace>")
cut_gap = 8 # sec
def modelAEM(etrs):
print("Modeling AEM ...")
# Modeling traffic wi... | gpl-2.0 | 667,371,110,707,126,800 | 22.328125 | 74 | 0.605228 | false | 3.002012 | false | false | false |
plotly/plotly.py | packages/python/plotly/plotly/validators/layout/xaxis/_categoryorder.py | 1 | 1151 | import _plotly_utils.basevalidators
class CategoryorderValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self, plotly_name="categoryorder", parent_name="layout.xaxis", **kwargs
):
super(CategoryorderValidator, self).__init__(
plotly_name=plotly_name,
... | mit | 5,048,350,118,352,210,000 | 32.852941 | 79 | 0.435274 | false | 5.642157 | false | false | false |
mercycorps/tola-activity | htdocs/activitydb/migrations/0035_auto_20151028_0057.py | 1 | 3568 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('activitydb', '0034_auto_20151027_1851'),
]
operations = [
migrations.AddField(
model_name='projectagreement',
... | gpl-2.0 | -8,942,267,121,895,962,000 | 41.47619 | 126 | 0.607623 | false | 4.324848 | false | false | false |
SolarLune/SolHelp | BGE/bghelper/time.py | 1 | 1469 | __author__ = 'SolarLune'
from bge import logic
# Time-based mechanics.
class TimerBank():
def __init__(self):
self.time = 0.0
self.timers = {}
def add(self, timer_name):
self.timers[timer_name] = Timer()
def set(self, timer_name, time):
self.timers[timer_name].set(... | mit | 7,765,912,870,802,807,000 | 16.081395 | 74 | 0.530293 | false | 3.448357 | false | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.