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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
lunn/dsa-tests | tests/bridge_test.py | 1 | 48036 | #!/usr/bin/env python
"""Test the operation of a bridge on the SUT"""
import time
import unittest2
import xmlrunner
import params
import sut
import traffic
ZERO_STATS = {
'rx_pkts': 0L,
'tx_pkts': 0L,
}
TX_50_STATS = {
'rx_pkts': 0L,
'tx_pkts': 50L,
}
TX_100_STATS = {
'rx_pkts': 0L,
... | gpl-3.0 | 2,986,508,543,126,416,000 | 48.116564 | 77 | 0.611208 | false | 3.416015 | true | false | false |
brendan-w/python-OBD | setup.py | 1 | 1161 | #!/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
with open("README.md", "r") as readme:
long_description = readme.read()
setup(
name="obd",
version="0.7.1",
description=("Serial module for handling live sensor data from a vehicle's OBD-II port"),
long_descript... | gpl-2.0 | 4,863,762,380,717,813,000 | 33.147059 | 93 | 0.633075 | false | 3.697452 | false | false | false |
OpenDaisy/daisy-client | daisyclient/v1/config_files.py | 1 | 10477 | # 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 | -8,474,817,232,524,638,000 | 36.152482 | 98 | 0.565811 | false | 4.068738 | true | false | false |
villeneuvelab/vlpp | pipelines/templates/apply_pet2anat.py | 1 | 4250 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from glob import glob
from vlpp.utils import add_suffix, nfmap2dict, warn, run_shell, gzipd, run_matlab, TPL_PATH
from vlpp.registration import applyWarpImageMultiTransform, estimatePet2Anat
def main():
transitional = "${transitional}"
mode = "${config... | mit | 6,312,116,416,861,953,000 | 30.021898 | 91 | 0.502353 | false | 3.375695 | false | false | false |
dmanev/ArchExtractor | ArchExtractor/umlgen/Base/SwComponent/Components/BaseComponent.py | 1 | 1191 |
import Components.IComponent
import Infrastructure.PackageableElement
import PortInterface.IPort
class BaseComponent(Components.IComponent.IComponent, Infrastructure.PackageableElement.PackageableElement):
"""Represents the BaseComponent of the meta-model"""
def __init__(self, inpName):
super(BaseComp... | gpl-3.0 | -2,171,141,725,594,879,200 | 32.083333 | 108 | 0.652393 | false | 3.956811 | false | false | false |
saulpw/visidata | vgit/status.py | 1 | 9296 | import re
from visidata import *
from .git import GitSheet
from .diff import DifferSheet
option('vgit_show_ignored', False, '')
theme('color_vgit_staged_mod', 'green', 'files staged with modifications')
theme('color_vgit_staged_del', 'red', 'files staged for deletion')
theme('color_vgit_staged_add', 'green', 'files st... | gpl-3.0 | -8,376,459,956,011,101,000 | 44.346341 | 170 | 0.57003 | false | 3.375454 | false | false | false |
mitsuhiko/sentry | src/sentry/web/frontend/create_project.py | 1 | 3131 | from __future__ import absolute_import
from django import forms
from django.contrib import messages
from django.core.urlresolvers import reverse
from sentry.models import Project, Team
from sentry.web.forms.add_project import AddProjectForm
from sentry.web.frontend.base import OrganizationView
from sentry.utils.http ... | bsd-3-clause | -6,264,249,717,611,190,000 | 31.957895 | 95 | 0.603002 | false | 4.163564 | false | false | false |
pombredanne/TSP-CloudStack | src/it/tsp/cloudstack/pimf/extractVM.py | 1 | 3381 | # -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
# Copyright (C) 2011 Khaled Ben Bahri - Institut Telecom
#
# This library is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundati... | gpl-3.0 | -5,223,148,782,348,892,000 | 28.920354 | 109 | 0.625259 | false | 4.179234 | false | false | false |
vergecurrency/electrum-xvg | gui/qt/main_window.py | 1 | 116446 | #!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2012 thomasv@gitorious
#
# 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... | gpl-3.0 | 7,012,488,650,934,941,000 | 39.65852 | 448 | 0.582648 | false | 3.900124 | true | false | false |
ollitapa/MMP-TracerApi | Tests/jmTest1/jmTestDemo.py | 1 | 5288 | import clientConfig as cConf
from mmp_tracer_api import objID
from comsol_api import MMPComsolDummy
from mupif import *
import logging
logger = logging.getLogger()
import time as timeTime
start = timeTime.time()
logger.info('Timer started')
# locate nameserver
ns = PyroUtil.connectNameServer(
nshost=cConf.nshost,... | apache-2.0 | 3,206,724,938,421,233,000 | 33.562092 | 79 | 0.57205 | false | 3.905465 | false | true | false |
sbmlteam/deviser | generator/util/generateExamples.py | 1 | 4336 | #!/usr/bin/env python
#
# @file generateExamples.py
# @brief function for generating code examples
# @author Frank Bergmann
# @author Sarah Keating
#
# <!--------------------------------------------------------------------------
#
# Copyright (c) 2013-2018 by the California Institute of Technology
# (California,... | lgpl-2.1 | -8,368,955,377,446,168,000 | 36.37931 | 78 | 0.66536 | false | 4.025998 | false | false | false |
polyaxon/polyaxon | core/tests/test_polypod/test_pods/test_volumes.py | 1 | 40879 | #!/usr/bin/python
#
# Copyright 2018-2021 Polyaxon, 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 ... | apache-2.0 | -5,754,041,076,416,865,000 | 33.939316 | 94 | 0.484968 | false | 4.582848 | true | false | false |
no-net/gr-fhah | examples/simple_trx_mimo.py | 1 | 10607 | #!/usr/bin/env python
##################################################
# Gnuradio Python Flow Graph
# Title: Simple Trx
# Generated: Mon Apr 8 15:22:22 2013
##################################################
import os
from gnuradio import eng_notation
from gnuradio import gr
from gnuradio.eng_option import eng_opti... | gpl-3.0 | -5,906,956,174,358,391,000 | 33.891447 | 672 | 0.654002 | false | 2.673809 | false | false | false |
EPFL-LCN/neuronaldynamics-exercises | neurodynex3/hopfield_network/pattern_tools.py | 1 | 10903 | """
Functions to create 2D patterns.
Note, in the hopfield model, we define patterns as vectors. To make
the exercise more visual, we use 2D patterns (N by N ndarrays).
"""
# This file is part of the exercise code repository accompanying
# the book: Neuronal Dynamics (see http://neuronaldynamics.epfl.ch)
# located at ... | gpl-2.0 | -42,661,442,793,088,390 | 30.973607 | 113 | 0.625975 | false | 3.825614 | false | false | false |
charlietsai/catmap | catmap/analyze/scaling.py | 1 | 2227 | from analysis_base import *
class ScalingAnalysis(ScalingPlot, ReactionModelWrapper):
"""
.. todo:: __doc__
"""
def __init__(self, reaction_model):
self._rxm = reaction_model
self.scaling_mode = 'linear'
ScalingPlot.__init__(self, self.descriptor_names,
... | gpl-3.0 | 3,787,013,963,234,337,300 | 34.919355 | 76 | 0.464302 | false | 4.299228 | false | false | false |
xiaotiantiantian/IR_Final | Crawler/test.py | 1 | 4596 | import urllib2
import re
from bs4 import BeautifulSoup
from wheel.util import utf8
from crawler import response
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
response = urllib2.urlopen("http://www.flyertalk.com/forum/credit-card-programs-599")
html1=response.read()
soup=BeautifulSoup(html1,"lxml")
##use... | gpl-3.0 | 7,604,471,477,430,675,000 | 25.262857 | 89 | 0.627937 | false | 3.659236 | false | false | false |
be-hase/ghe-line-notify | app/models.py | 1 | 1374 | # -*- coding: utf-8 -*-
from .database import db
class Token(db.Model):
__tablename__ = 'token'
id = db.Column(db.Integer, primary_key=True, autoincrement=True)
token = db.Column(db.String(255), nullable=False)
code = db.Column(db.String(255), nullable=False, unique=True)
secret = db.Column(db.S... | mit | -458,871,174,544,800,260 | 34.230769 | 99 | 0.620087 | false | 3.435 | false | false | false |
bamford/astrobamf | convex_hull_2.py | 1 | 5015 | #!/usr/bin/env python
"""convexhull.py
Calculate the convex hull of a set of n 2D-points in O(n log n) time.
Taken from Berg et al., Computational Geometry, Springer-Verlag, 1997.
Prints output as EPS file.
When run from the command line it generates a random set of points
inside a square of given length and finds... | mit | 4,452,016,944,170,447,000 | 24.201005 | 71 | 0.505085 | false | 3.461008 | false | false | false |
BarraQDA/nvivotools | editProject.py | 1 | 4431 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2020 Jonathan Schultz
#
# 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 lat... | gpl-3.0 | -7,526,895,618,430,080,000 | 35.925 | 105 | 0.570526 | false | 4.457746 | false | false | false |
Guts/Metadator | modules/DocxMerger.py | 1 | 4363 | # -*- coding: UTF-8 -*-
#!/usr/bin/env python
from __future__ import unicode_literals
#-------------------------------------------------------------------------------
# Name : Word Joiner
# Purpose : Generate a Word file compiling all word files present in folder
# and subfolders according to a prefix filt... | gpl-3.0 | 3,043,063,256,413,885,000 | 34.169355 | 99 | 0.519606 | false | 4.326389 | false | false | false |
turbulenz/turbulenz_local | turbulenz_local/controllers/localv1/metrics.py | 1 | 7370 | # Copyright (c) 2010-2011,2013 Turbulenz Limited
import logging
import time
import os.path
from pylons import response
from pylons.controllers.util import abort
from turbulenz_local.decorators import jsonify
from turbulenz_local.controllers import BaseController
from turbulenz_local.models.metrics import MetricsSess... | mit | -2,455,173,198,483,915,000 | 32.5 | 119 | 0.526459 | false | 4.168552 | false | false | false |
mphe/pychatbot | chatbot/bot/plugins/tags.py | 1 | 1873 | # -*- coding: utf-8 -*-
import re
from chatbot.bot import BotPlugin
from chatbot import api
class Plugin(BotPlugin):
def __init__(self, oldme, bot):
super().__init__(oldme, bot)
self.register_command("tags", self._list, argc=0)
self.register_event_handler(api.APIEvents.Message, self._on_m... | mit | -7,472,892,091,013,163,000 | 35.607843 | 101 | 0.567756 | false | 3.748996 | false | false | false |
mark-burnett/filament-dynamics | actin_dynamics/primitives/file_readers/dat_files.py | 1 | 2311 | # Copyright (C) 2010 Mark Burnett
#
# 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 i... | gpl-3.0 | -5,681,701,504,263,376,000 | 35.109375 | 77 | 0.666811 | false | 4.012153 | false | false | false |
flags/Reactor-3 | pathfinding.py | 1 | 7722 | from copy import deepcopy
from globals import *
import zones as zns
import life as lfe
import render_los
import bad_numbers
import zones
import alife
import numpy
import tiles
import maps
import logging
import time
import sys
def astar(life, start, end, zones, chunk_mode=False, terraform=None, avoid_tiles=[], avoi... | mit | -5,896,159,042,898,822,000 | 28.818533 | 142 | 0.57783 | false | 2.613198 | false | false | false |
endlessm/chromium-browser | third_party/catapult/telemetry/telemetry/internal/backends/chrome/desktop_browser_backend.py | 1 | 14064 | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import datetime
import hashlib
import logging
import os
import os.path
import random
import re
import shutil
import signal
import subprocess as subprocess
im... | bsd-3-clause | -3,600,428,131,858,474,500 | 38.616901 | 80 | 0.685367 | false | 3.919732 | false | false | false |
thegricean/sinking-marbles | models/wonky_world/runUniformModel.py | 1 | 3451 | import os
import math
import subprocess
########################################
f = open("wonkyworld-uniform.church")
ch_model = [l.rstrip() for l in f.readlines()]
f.close()
pfile = open("smoothed_15marbles_priors.txt") # get smoothed priors (kernel density estimates)
#pfile = open("fourstep_15marbles_priors.txt"... | mit | 6,360,564,671,797,655,000 | 59.54386 | 363 | 0.598957 | false | 3.029851 | false | false | false |
plewis/phycas | src/python/readnexus/_NexusReader.py | 1 | 8119 | from _ReadNexusExt import *
from phycas.datamatrix._DataMatrix import DataMatrix
import re
_ROUND_TRIP_EVERY_NEXUS_READ = False
class FileFormats:
NEXUS, FASTA, PHYLIP, PDF, RAW_TEXT = range(5)
_names = ["NEXUS", "FASTA", "PHYLIP", "PDF", "RAW_TEXT"]
def to_str(v):
if v < 0 or v > len(FileFormats.... | mit | 1,303,482,039,117,997,000 | 34.3 | 116 | 0.539598 | false | 3.399916 | false | false | false |
NetflixDSE/python-saml | onelogin/saml/AuthRequest.py | 1 | 4251 | import zlib
import base64
import uuid
import urllib
from datetime import datetime
from lxml import etree
from lxml.builder import ElementMaker
def create(_clock=None, _uuid=None, _zlib=None, _base64=None,
_urllib=None, **kwargs):
"""Create a URL string which can be used to redirect a samlp:AuthnReques... | bsd-3-clause | 6,466,059,955,244,467,000 | 35.333333 | 100 | 0.629264 | false | 3.798928 | false | false | false |
337529542/dsf-utils | dsf_geom_define.py | 1 | 4956 | import bpy, bmesh
import logging
from array import array
class dsf_geom_define (object):
"""utility class for inserting mesh data into blender.
"""
log = logging.getLogger ('dsf_geom_define')
@classmethod
def create_vertex_groups (self, geom):
"""convert the face-groups to a map of vertex-groups.
""... | gpl-3.0 | 343,660,509,204,594,100 | 35.711111 | 80 | 0.631961 | false | 3.517388 | false | false | false |
KroligG/video-text-search | es.py | 1 | 1329 | from elasticsearch_dsl import DocType
from elasticsearch_dsl.connections import connections
from elasticsearch_dsl.field import InnerObjectWrapper, Nested, String, Integer, Float
class Timestamp(InnerObjectWrapper):
word = String()
time = Float()
class YoutubeVideo(DocType):
title = String()
duratio... | apache-2.0 | -4,828,888,172,021,435,000 | 27.891304 | 110 | 0.609481 | false | 4.003012 | false | false | false |
maposmatic/ocitysmap | ocitysmap/i18n.py | 1 | 48066 | # -*- coding: utf-8; mode: Python -*-
# ocitysmap, city map and street index generator from OpenStreetMap data
# Copyright (C) 2010 David Decotigny
# Copyright (C) 2010 Frédéric Lehobey
# Copyright (C) 2010 Pierre Mauduit
# Copyright (C) 2010 David Mentré
# Copyright (C) 2010 Maxime Petazzoni
# Copyright (C) 2010... | agpl-3.0 | -7,722,511,157,635,579,000 | 40.919929 | 94 | 0.530116 | false | 2.918427 | false | false | false |
neo5g/server-gsrp5 | server-gsrp5/managers/cockroachdbddlmanager.py | 1 | 17525 | # --*-- coding: utf-8 --*--
import logging
from managers.manager import Manager
from tools.translations import trlocal as _
_logger = logging.getLogger('listener.' + __name__)
class pgdbddl_exception(Exception): pass
class pgdbddlManager(Manager):
"""
Выполняет DDL манипуляции с реляционной базой данных POSTGRESQL... | agpl-3.0 | -262,507,639,175,188,220 | 43.940874 | 564 | 0.673493 | false | 2.89102 | false | false | false |
IsmaelRLG/simpbot | simpbot/control.py | 1 | 9302 | # -*- coding: utf-8 -*-
# Simple Bot (SimpBot)
# Copyright 2016-2017, Ismael Lugo (kwargs)
import time
import re
from six import string_types
from .envvars import ctrl
from .envvars import networks
from .bottools import text
from .bottools import dummy
from .bottools import irc
global_name = text.randphras()
simp = '(... | mit | -7,096,314,957,782,932,000 | 34.773077 | 84 | 0.466774 | false | 4.458293 | false | false | false |
bernard357/shellbot | tests/updaters/test_file.py | 1 | 3398 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
import gc
import logging
import mock
from multiprocessing import Process, Queue
import os
import sys
from shellbot import Context, Engine, Shell
from shellbot.events import Message
from shellbot.updaters import FileUpdater
my_engine = Engine()
my_path = o... | apache-2.0 | 3,768,117,642,002,138,600 | 23.623188 | 184 | 0.541201 | false | 3.5359 | true | false | false |
embisi-github/line-tracing | python/image_lib.py | 1 | 26871 | #a Imports
import PIL.Image
import PIL.ImageOps
import colorsys
import math
import array
import time
#a Classes
#c c_line_set
class c_line_set(object):
def __init__( self, w, h, min_distance=8 ):
self.w = w
self.h = h
self.distance_array = array.array('d',range(self.w*self.h))
for i... | apache-2.0 | -1,556,591,249,742,763,500 | 34.685259 | 160 | 0.486063 | false | 2.982022 | false | false | false |
p4u/hmdb | hmdb.py | 1 | 6895 | import imdb
import string
import os
import sys
import re
import time
execfile("hmdb.conf")
def print_help():
print "hmdb | [Home Media Data Base]"
print " use: %s <-n|-u|-c|-h>" %(sys.argv[0])
print " -n: Create a new database from scratch"
print " -u: Update an existing databse with only new files"
print ... | agpl-3.0 | 8,918,145,755,338,164,000 | 23.450355 | 116 | 0.610007 | false | 2.868136 | false | false | false |
gbarbosa4/WikimediaDataProject | WDLG/urls.py | 1 | 2140 | from django.conf.urls import include, url
from . import views
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^populated_cities', views.populated_cities_query, name ='populated_cities'),
url(r'^start_tour_cities', views.start_tour_cities, name ='start_tour_cities'),
url(r'^stop_tour_cities... | mit | 1,889,903,309,014,570,500 | 70.333333 | 104 | 0.699065 | false | 2.772021 | false | true | false |
daneoshiga/sentry-patrol | patrol/patrol.py | 1 | 1563 | import requests
from .sentry_api_client.api import get_api_instance
class Patrol:
def __init__(self, sentry_api_token, timeout=None):
self.headers = {"Authorization": "Bearer {}".format(sentry_api_token)}
self.timeout = timeout
self.api = get_api_instance(sentry_api_token, timeout)
d... | mit | -7,365,939,728,046,516,000 | 35.348837 | 82 | 0.65579 | false | 4.124011 | false | false | false |
Ouranosinc/Magpie | magpie/alembic/versions/2012-07-09_439766f6104d_add_lower_indexes.py | 1 | 1738 | """
add lower() indexes to pg.
Revision ID: 439766f6104d
Revises: 20671b28c538
Create Date: 2012-07-09 21:33:28.404627
"""
from __future__ import unicode_literals
from alembic import op
from alembic.context import get_context # noqa: F401
from sqlalchemy.dialects.postgresql.base import PGDialect
# revision identifi... | apache-2.0 | -4,262,945,400,469,265,000 | 27.491803 | 118 | 0.618527 | false | 3.968037 | false | false | false |
jacobian-archive/python-hdcloud | tests/test_jobs.py | 1 | 2001 | from __future__ import absolute_import
from hdcloud import Job
from .fakeserver import FakeHDCloud
from .utils import assert_isinstance
from nose.tools import assert_equal
hdcloud = FakeHDCloud()
def test_all():
hdcloud.jobs.all()
hdcloud.assert_called('GET', '/jobs.json?page=1')
hdcloud.jobs.all(page=2)... | bsd-3-clause | -1,438,714,858,891,404,500 | 29.333333 | 110 | 0.648176 | false | 2.925439 | true | false | false |
byaka/flaskJSONRPCServer | flaskJSONRPCServer/servBackend/useWerkzeug.py | 1 | 1843 | """
This module provide Serving backend, that use <werkzeug>.
"""
from ..utils import *
class servBackend:
"""
"""
_id='werkzeug'
_supportRawSocket=False
_supportGevent=True
_supportNative=True
_supportMultiple=False
def __init__(self, id=None):
#check importing
from werkzeug.ser... | apache-2.0 | 8,725,217,394,388,154,000 | 33.773585 | 135 | 0.676072 | false | 3.776639 | false | false | false |
dewtx29/python_ann | python/p1_mean_move/dew_sl_v1.py | 1 | 10127 | """
Pure Python implementation of a Back-Propagation Neural Network using the
hyperbolic tangent as the sigmoid squashing function.
Original Author: Neil Schemenauer <nas@arctrix.com>
Modified Author: James Howard <james.w.howard@gmail.com>
Modified to work for function regression and added option to use matplotlib
t... | gpl-3.0 | -8,739,066,525,994,809,000 | 25.100515 | 78 | 0.533129 | false | 3.428233 | true | false | false |
moreati/pydot-ng | pydot_ng/__init__.py | 1 | 59602 | # -*- coding: Latin-1 -*-
# Graphviz's dot language Python interface.
# This module provides with a full interface to create handle modify
# and process graphs in Graphviz's dot language.
# References:
# pydot Homepage: http://code.google.com/p/pydot/
# Graphviz: http://www.graphviz.org/
# DOT Language: http://... | mit | -1,778,603,842,485,955,300 | 30.468849 | 79 | 0.556089 | false | 4.101431 | false | false | false |
Abraxos/auto-converter | utils.py | 1 | 4408 | '''Includes various utility functions for the converter service'''
from re import compile as cmpl
from argparse import ArgumentParser, Action, ArgumentTypeError
import os
from constants import VIDEO_FILE_EXTENSIONS
def str2float(string):
'''Converts a string to a floating point value'''
return float(cmpl(r'[^\... | gpl-3.0 | -7,997,673,373,165,289,000 | 46.397849 | 146 | 0.571461 | false | 4.649789 | false | false | false |
sethll/etc | lan-ps.py | 1 | 1850 | #!/usr/env/python
#
# Note: root is required to send ICMP packets
#
# Dependencies:
# netifaces (pip install netifaces)
# ping (pip install ping)
import sys
from netifaces import interfaces, ifaddresses, AF_INET
import ping
def get_base_addresses():
base_addresses = []
for iface in interfaces():
... | mit | -6,007,912,632,750,091,000 | 29.327869 | 78 | 0.622162 | false | 3.846154 | false | false | false |
aglitke/mom | mom/Controllers/Balloon.py | 1 | 1776 | # Memory Overcommitment Manager
# Copyright (C) 2010 Adam Litke, IBM Corporation
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it ... | gpl-2.0 | -6,255,615,072,248,124,000 | 38.466667 | 74 | 0.672297 | false | 4.208531 | false | false | false |
I-sektionen/i-portalen | wsgi/iportalen_django/articles/models.py | 1 | 13933 | from django.core.mail import send_mail
from django.core.urlresolvers import reverse
from django.db import models, transaction
from django.utils import timezone
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import ugettext
from django.core.files.ba... | mit | -5,071,806,853,379,814,000 | 36.284182 | 120 | 0.544618 | false | 4.237355 | false | false | false |
diracdeltas/lets-encrypt-preview | letsencrypt/acme/messages.py | 1 | 12451 | """ACME protocol v00 messages.
.. warning:: This module is an implementation of the draft `ACME
protocol version 00`_, and not the "RESTified" `ACME protocol version
01`_ or later. It should work with `older Node.js implementation`_,
but will definitely not work with Boulder_. It is kept for reference
purposes... | apache-2.0 | 3,332,883,583,607,538,000 | 32.926431 | 90 | 0.665007 | false | 3.860775 | false | false | false |
eduNEXT/edunext-ecommerce | ecommerce/extensions/voucher/models.py | 1 | 6422 | from __future__ import absolute_import
import datetime
import logging
from django.core.exceptions import MultipleObjectsReturned, ObjectDoesNotExist
from django.db import models
from django.utils.translation import ugettext_lazy as _
from oscar.apps.voucher.abstract_models import ( # pylint: disable=ungrouped-import... | agpl-3.0 | 4,754,813,054,104,787,000 | 40.166667 | 172 | 0.669418 | false | 4.085242 | false | false | false |
macauleycheng/AOS_OF_Example | 00-table-group-unit-test/00-max-flow-test/Term_Flow_Max.py | 1 | 7482 | from ryu.base import app_manager
from ryu.controller import ofp_event
from ryu.controller import dpset
from ryu.controller.handler import CONFIG_DISPATCHER , MAIN_DISPATCHER, DEAD_DISPATCHER
from ryu.controller.handler import set_ev_cls
from ryu.ofproto import ofproto_v1_3
from ryu.lib import mac
import time
... | apache-2.0 | -2,582,546,888,808,210,400 | 42.011765 | 117 | 0.545977 | false | 3.960826 | false | false | false |
lukedeo/cross-domain | crossdomain/deepmodels.py | 1 | 11059 | import numpy as np
from scipy import sparse as S
from scipy.sparse.csr import csr_matrix
def sigmoid(x):
#return x*(x > 0)
#return numpy.tanh(x)
return 1.0/(1+numpy.exp(-x))
def d_sigmoid(z):
return np.multiply(z, 1 - z)
def identity(x):
return x
def d_identity(x):
return 1
def softmax(X)... | gpl-2.0 | 5,715,828,879,196,542,000 | 32.310241 | 157 | 0.574374 | false | 3.262242 | false | false | false |
bswartz/cinder | cinder/tests/unit/test_netapp.py | 1 | 59159 | # Copyright (c) 2012 NetApp, Inc.
# Copyright (c) 2015 Goutham Pacha Ravi. All rights reserved.
# 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
#
# ht... | apache-2.0 | 5,527,113,989,492,127,000 | 43.447032 | 79 | 0.583664 | false | 3.796624 | true | false | false |
sophilabs/learnregex | learnregex/capturing/__init__.py | 1 | 1119 | import string
from story.adventures import AdventureVerificationError, BaseAdventure
from story.translation import gettext as _
from ..utils import get_random_string, load_solution_function
class Adventure(BaseAdventure):
title = _('Capturing')
dictionary = string.ascii_lowercase + string.digits
def t... | mit | -6,527,417,013,011,121,000 | 36.3 | 75 | 0.629133 | false | 4.354086 | false | false | false |
VerosK/django-dbbackup | dbbackup/management/commands/dbbackup.py | 1 | 4224 | """
Save database.
"""
from __future__ import (absolute_import, division,
print_function, unicode_literals)
import os
import re
from datetime import datetime
import tempfile
from optparse import make_option
from django.conf import settings
from django.core.management.base import CommandError
... | bsd-3-clause | 8,440,216,439,752,929,000 | 43.463158 | 122 | 0.633759 | false | 4.104956 | false | false | false |
yfpeng/dcache | dcache/dcache.py | 1 | 2880 | import json
import os
import collections
import itertools
class DCache(object):
"""
DCache keeps a cache of files in the folder tree for efficiency and emergency purposes.
"""
def __init__(self):
self.root = None
self.cached_file = None
self.files = None
... | bsd-3-clause | 216,224,923,208,485,570 | 27.090909 | 105 | 0.587153 | false | 4.016736 | false | false | false |
walshjon/openmc | openmc/lattice.py | 1 | 49538 | from abc import ABCMeta
from collections import OrderedDict
from collections.abc import Iterable
from copy import deepcopy
from math import sqrt, floor
from numbers import Real, Integral
from xml.etree import ElementTree as ET
import numpy as np
import openmc.checkvalue as cv
import openmc
from openmc.mixin import ID... | mit | -6,604,508,558,982,221,000 | 34.009187 | 88 | 0.530784 | false | 4.076531 | false | false | false |
Ulauncher/Ulauncher | tests/search/shortcuts/test_ShortcutsDb.py | 1 | 1693 | import os
import pytest
from ulauncher.search.shortcuts.ShortcutsDb import ShortcutsDb
class TestShortcutsDb:
@pytest.fixture(autouse=True)
def get_default_shortcuts(self, mocker):
default = mocker.patch('ulauncher.search.shortcuts.ShortcutsDb.get_default_shortcuts')
default.return_value = []... | gpl-3.0 | -4,286,879,967,323,328,000 | 43.552632 | 120 | 0.625517 | false | 3.497934 | true | false | false |
sethmbaker/fewsn-web | sensor_net/migrations/0001_initial.py | 1 | 4570 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
from django.conf import settings
import django.contrib.gis.db.models.fields
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
... | apache-2.0 | 6,893,171,985,511,873,000 | 45.632653 | 166 | 0.570241 | false | 4.259087 | false | false | false |
Virako/authapi | authapi/api/urls.py | 1 | 2110 | from django.conf.urls import patterns, url, include
from django.conf import settings
urlpatterns = patterns('',
url(r'^acl/$', 'api.views.acl', name='acl'),
url(r'^acl/(?P<username>\w+)/(?P<object_type>\w+)/(?P<perm>\w+)/$', 'api.views.acl', name='acl'),
url(r'^acl/(?P<username>\w+)/(?P<object_type>\w+)/(?... | agpl-3.0 | 2,861,954,602,501,769,000 | 51.75 | 120 | 0.604265 | false | 2.934631 | false | false | false |
flavour/RedHat | languages/ne.py | 1 | 327292 | # -*- coding: utf-8 -*-
{
'# of International Staff': '# अन्तराष्ट्रिय स्टाफ',
'# of National Staff': '# राष्ट्रिय स्टाफ',
'# selected': '# छानियो',
'%(app)s not installed. Ask the Server Administrator to install on Server.': '%(app)s इन्स्टल हुन सकेन । सर्भरलाई इन्स्टल गर्नको निम्ति सर्भरको एडमिनिस्ट्राटरलाई सोध्नुहोस... | mit | -359,877,159,719,963,600 | 56.044527 | 477 | 0.599018 | false | 1.523574 | false | false | false |
JohnyEngine/CNC | voxelcut/run.py | 1 | 3146 | # main script file run by VoxelCut
from vc import *
import wx
import math
voxels_per_mm = float(0)
x = float(0)
y = float(0)
z = float(0)
rad = float(0)
def jump_to(nx, ny, nz):
global x
global y
global z
x, y, z = nx, ny, nz
def get_voxel_pos(nx, ny, nz):
global voxels_per_mm
vx = int(512 ... | apache-2.0 | 8,569,961,638,844,489,000 | 20.696552 | 122 | 0.524793 | false | 2.668363 | false | false | false |
siggame/webserver | webserver/settings/development.py | 1 | 2339 | """Settings file for project development.
These settings should **NOT** be used to deploy
"""
import webserver.settings.defaults as default_settings
from webserver.settings.defaults import *
# Choose which site we're using. initial_data.yaml installs some
# fixture data so that localhost:8000 has SIDE_ID == 1, and
# ... | bsd-3-clause | -494,897,536,788,591,900 | 24.703297 | 95 | 0.560496 | false | 3.666144 | false | false | false |
haipersist/webspider | da/GetSeridJobs.py | 1 | 3014 | #!/usr/bin/python
#-*-coding:utf-8 -*-
"""
It is used to get the detail and total number weekly job.
By default,the target date is cur day.of course,you can
set the date by you.
Usage:
job = SeridJob()
detailjobs = job.get_week_job()
total= job.total
"""
import cPickle
from datetime import date,timedelta... | mit | -1,576,928,142,904,545,500 | 33.643678 | 137 | 0.551095 | false | 3.484393 | false | false | false |
lookup/lu-dj-utils | runtests.py | 1 | 2495 | #!/usr/bin/env python
"""
source: https://github.com/carljm/django-model-utils/blob/f8a7c50/runtests.py
"""
import os
import sys
from django.conf import settings
import django
ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
LOGGING_CONFIG = {
'version': 1,
# 'disable_existing_loggers': True,
'di... | bsd-3-clause | -4,354,904,131,893,736,400 | 23.95 | 78 | 0.543086 | false | 3.797565 | true | false | false |
saulpw/visidata | visidata/clipboard.py | 1 | 8199 | from copy import copy, deepcopy
import shutil
import subprocess
import sys
import tempfile
import functools
from visidata import VisiData, vd, asyncthread, option, options
from visidata import Sheet, saveSheets, Path, Column
option('clipboard_copy_cmd', '', 'command to copy stdin to system clipboard', sheettype=None)... | gpl-3.0 | -3,602,529,352,007,750,000 | 40.201005 | 225 | 0.676058 | false | 3.458035 | false | false | false |
yinglanma/AI-project | tensorpack/dataflow/dataset/svhn.py | 1 | 2183 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
# File: svhn.py
# Author: Yuxin Wu <ppwwyyxx@gmail.com>
import os
import random
import numpy as np
from six.moves import range
from ...utils import logger, get_rng, get_dataset_path
from ..base import RNGDataFlow
try:
import scipy.io
__all__ = ['SVHNDigit']
excep... | apache-2.0 | 1,381,305,452,695,720,700 | 27.723684 | 91 | 0.569858 | false | 3.141007 | false | false | false |
kura/deiman | examples/simple-daemon.py | 1 | 1253 | # Need sys for exit status and argv
import sys
# Import Deiman
from deiman import Deiman
# Create a new instance of Deiman, passing in a PID file to use
# this only instantiates the class, nothing more.
d = Deiman("/tmp/deiman.pid")
# Check incoming argv values to see if we have start, stop or status
# command.
if ... | mit | -6,321,106,972,386,815,000 | 28.833333 | 72 | 0.691141 | false | 3.350267 | false | false | false |
GageGaskins/osf.io | website/project/views/comment.py | 1 | 4388 | # -*- coding: utf-8 -*-
import pytz
from datetime import datetime
from flask import request
from modularodm import Q
from framework.auth.decorators import must_be_logged_in
from website.addons.base.signals import file_updated
from website.files.models import FileNode
from website.notifications.constants import PROVID... | apache-2.0 | 5,136,711,377,464,489,000 | 37.156522 | 127 | 0.654284 | false | 3.946043 | false | false | false |
lmorchard/django-valet-keys | valet_keys/migrations/0001_initial.py | 1 | 4806 | # encoding: utf-8
import 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 'Key'
db.create_table('valet_keys_key', (
('id', self.gf('django.db.models.fiel... | bsd-3-clause | 307,804,631,770,826,400 | 61.415584 | 182 | 0.55618 | false | 3.682759 | false | false | false |
calum-chamberlain/EQcorrscan | eqcorrscan/utils/picker.py | 1 | 8269 | """
Functions to pick earthquakes detected by EQcorrscan.
Designed primarily locate stacks of detections to give family locations.
Extensions may later be written, not tested for accuracy, just simple wrappers.
:copyright:
EQcorrscan developers.
:license:
GNU Lesser General Public License, Version 3
(htt... | gpl-3.0 | 4,369,053,475,108,479,500 | 37.821596 | 79 | 0.616036 | false | 3.729815 | false | false | false |
endlessm/chromium-browser | third_party/blink/public/mojom/feature_policy/PRESUBMIT.py | 1 | 1928 | # Copyright 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Blink feature-policy presubmit script.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the presubmit AP... | bsd-3-clause | 3,901,718,381,927,677,400 | 31.677966 | 78 | 0.627593 | false | 4 | false | false | false |
TEDxBerkeley/TEDxBerkeley2016 | static/images/speakerPics/speakers.py | 1 | 1471 | from bs4 import BeautifulSoup
import urllib
from requests import get
def speakers(url, year):
url = url
year = year
soup = BeautifulSoup(get(url).content)
cards = soup.find_all(attrs={"class": "portfolio-it"})
d = {}
for card in cards:
# byline_url = card.a['href']
d.update({card.find('h4').string:card.a.img... | apache-2.0 | 2,747,425,655,314,492,400 | 33.209302 | 168 | 0.675731 | false | 2.65045 | false | false | false |
guardian/alerta | setup.py | 1 | 3205 | #!/usr/bin/env python
import os
import subprocess
from datetime import datetime
import setuptools
def read(filename):
return open(os.path.join(os.path.dirname(__file__), filename)).read()
try:
with open('alerta/build.py', 'w') as f:
build = """
BUILD_NUMBER = '{build_number}'
BUILD... | apache-2.0 | -3,910,090,734,893,711,400 | 33.462366 | 98 | 0.600624 | false | 3.617381 | false | false | false |
pythonprobr/pypratico | codigos/cp850_data.py | 1 | 1271 | cp850_high = [
0x00c7, 0x00fc, 0x00e9, 0x00e2, 0x00e4, 0x00e0, 0x00e5, 0x00e7,
0x00ea, 0x00eb, 0x00e8, 0x00ef, 0x00ee, 0x00ec, 0x00c4, 0x00c5,
0x00c9, 0x00e6, 0x00c6, 0x00f4, 0x00f6, 0x00f2, 0x00fb, 0x00f9,
0x00ff, 0x00d6, 0x00dc, 0x00f8, 0x00a3, 0x00d8, 0x00d7, 0x0192,
0x00e1, 0x00ed, 0x00f3, 0x00fa, 0x00f1, 0x00... | gpl-2.0 | -527,100,050,303,928,260 | 47.923077 | 64 | 0.712825 | false | 1.582814 | false | false | false |
frontrowed/slony-ansible-modules | slony_path.py | 1 | 6315 | #!/usr/bin/python
# -*- coding: utf-8 -*-
DOCUMENTATION = '''
---
module: slony_path
author: Alexandr Kurilin
version_added: "1.9"
short_description: Create / delete a slony path
requirements: [psycopg2, slonik]
description:
- Manage a Slony-I path
'''
EXAMPLES = '''
# Foo
- slony_path: name=TODO
'''
try:
im... | gpl-3.0 | -8,285,980,861,744,634,000 | 35.085714 | 138 | 0.624703 | false | 3.56176 | false | false | false |
PrzemekBurczyk/dalvik-compiler | src/sections/debug_info_item_section.py | 1 | 1158 | '''
Created on 5 cze 2014
@author: Przemek
'''
from src.items.bytes import Bytes
from src.items.bytes_array import BytesArray
from src.parser.measurable import Measurable
class DebugInfoItemSection(Measurable):
'''
Is it needed?
For sure!
'''
def __init__(self, parent):
'''
Cons... | mit | 7,418,228,222,209,296,000 | 28.717949 | 58 | 0.584629 | false | 3.03937 | false | false | false |
daniel-bulger/word-sense-disambiguator | disambiguator/get_similarities.py | 1 | 2627 | from nltk.corpus import brown
import sys
from graph import Graph,merge_graphs
from nltk.tree import ParentedTree
from stat_parser import Parser
parser = Parser()
user_sentence = sys.argv[1]
query = sys.argv[2]
trees = []
done = 0
# for sentence in brown.sents():
# if done >= 20:
# break
# if not query in sentence:... | mit | 606,864,693,524,672,000 | 37.647059 | 103 | 0.74115 | false | 3.227273 | false | false | false |
OpenPTV/openptv-python | pyptv_gui/code_editor.py | 1 | 2427 | """
Editor for editing the cameras ori files
"""
# Imports:
from traits.api \
import HasTraits, Code, Int, List, Str, Button, Float, Instance, Directory, File
from traitsui.api \
import Item, Group, View, Handler, Tabbed, ListEditor
from traitsui.menu import MenuBar, ToolBar, Menu, Action, OKCance... | mit | 3,810,351,604,759,892,000 | 28.721519 | 94 | 0.5274 | false | 3.852381 | false | false | false |
msteffeck/pyjsongooglechart | src/pyjsongooglechart/options.py | 1 | 1441 |
class Options(object):
_special_attrs = ('_value', '_attributes')
def __init__(self, value=None):
super(Options, self).__init__()
self._value = value
self._attributes = {}
def __getattr__(self, item):
if item in self._attributes:
return self._attributes[item]
... | bsd-3-clause | -4,393,793,780,021,981,700 | 30.326087 | 79 | 0.528799 | false | 4.755776 | false | false | false |
PlotWatt/sql_query_dict | sql_query_dict.py | 1 | 7724 | import six
import re
import types
import sys
# python 3 doesnt have long
if sys.version_info > (3,):
long = int
def quote_string(string):
return repr(str(string))
def mysql_list(l):
return ','.join(map(str, l))
def _escape(x):
if isinstance(x, six.string_types):
return quote_string(x)
... | apache-2.0 | -7,265,876,809,634,365,000 | 24.832776 | 76 | 0.572631 | false | 3.515703 | false | false | false |
jpush/jbox | Server/jbox/plugins/discourse.py | 1 | 3219 | import time
from flask import abort, Flask, jsonify, request
from . import plugins
from ..models import Developer, Integration
import jpush
from jpush import common
from .github import baseurl
@plugins.route('/discourse/<string:integration_id>/<string:token>/webhook', methods=['POST'])
def send_discourse_msg(integrat... | mit | 8,827,047,301,307,074,000 | 43.708333 | 120 | 0.607331 | false | 4.074684 | false | false | false |
bastibl/gnuradio | gr-digital/python/digital/utils/tagged_streams.py | 1 | 4718 | #!/usr/bin/env python
#
# Copyright 2013,2019 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your optio... | gpl-3.0 | -8,194,172,607,852,393,000 | 33.188406 | 93 | 0.606825 | false | 3.886326 | false | false | false |
brianr747/sfc_gui | sfc_gui/examples/scripts/ex_chart_plotter1.py | 1 | 1188 | # coding=utf-8
from sfc_models.objects import *
from sfc_gui.chart_plotter import ChartPlotterWindow2
register_standard_logs('output', __file__)
mod = Model()
# Create first country - Canada. (This model only has one country.)
can = Country(mod, 'Canada', 'CA')
# Create sectors
gov = DoNothingGovernment(can, 'Governme... | apache-2.0 | -8,434,227,409,840,256,000 | 38.6 | 95 | 0.712963 | false | 2.842105 | false | false | false |
Elastica/kombu | kombu/tests/mocks.py | 1 | 4266 | from __future__ import absolute_import, unicode_literals
from itertools import count
from kombu.transport import base
from kombu.utils import json
class Message(base.Message):
def __init__(self, *args, **kwargs):
self.throw_decode_error = kwargs.get('throw_decode_error', False)
super(Message, s... | bsd-3-clause | 8,775,963,037,663,428,000 | 28.020408 | 77 | 0.594468 | false | 4.051282 | false | false | false |
TAMU-CPT/galaxy-tools | tools/blast/blasttab_dice_filter.py | 1 | 1896 | #!/usr/bin/env python
import argparse
import logging
logging.basicConfig(level=logging.INFO)
log = logging.getLogger(name="blasttab2gff3")
__doc__ = """
Blast TSV files, when transformed to GFF3, do not normally show gaps in the
blast hits. This tool aims to fill that "gap".
"""
def blasttsv2gff3(blasttsv, min_dice... | gpl-3.0 | 3,668,589,618,051,283,000 | 30.081967 | 84 | 0.644515 | false | 3.604563 | false | false | false |
qedsoftware/commcare-hq | corehq/ex-submodules/couchforms/tests/test_meta.py | 1 | 6364 | from decimal import Decimal
import os
from datetime import date, datetime
from django.test import TestCase
from django.conf import settings
from corehq.util.test_utils import TestFileMixin
from couchforms.datatypes import GeoPoint
from couchforms.models import XFormInstance
from corehq.form_processor.tests.utils impo... | bsd-3-clause | -4,734,377,034,889,763,000 | 35.159091 | 87 | 0.585167 | false | 3.326712 | true | false | false |
damiancclarke/PhD | literature/scrape/paperScrape.py | 1 | 2022 | # paperScrape.py v0.00 damiancclarke yyyy-mm-dd:2015-05-29
#---|----1----|----2----|----3----|----4----|----5----|----6----|----7----|----8
#
# Scrapes econpapers for all titles, abstracts, etc from all JPE issues. Based
# on the url http://econpapers.repec.org/article/ucpjpolec/, and screen dump... | cc0-1.0 | 8,164,449,212,209,729,000 | 36.444444 | 90 | 0.47181 | false | 3.559859 | false | false | false |
santisiri/popego | envs/ALPHA-POPEGO/lib/python2.5/site-packages/twisted/web2/dav/method/report_expand.py | 1 | 4228 | # -*- test-case-name: twisted.web2.dav.test.test_report_expand -*-
##
# Copyright (c) 2005 Apple Computer, Inc. All rights reserved.
#
# 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 ... | bsd-3-clause | 9,010,070,239,299,831,000 | 35.765217 | 84 | 0.652318 | false | 4.390447 | false | false | false |
stopstalk/stopstalk-deployment | private/scripts/refresh-problem-details.py | 1 | 11532 | """
Copyright (c) 2015-2020 Raj Patel(raj454raj@gmail.com), StopStalk
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
... | mit | -7,190,744,046,631,491,000 | 37.697987 | 112 | 0.493843 | false | 4.913507 | false | false | false |
bartvanarnhem/phpscan | tests/greedy_satisfier/test_satisfier.py | 1 | 2818 | import pytest
import sys
sys.path.append('../..')
from phpscan.core import Scan, logger, verify_dependencies
from phpscan.satisfier.greedy import GreedySatisfier
def init_and_run_simple_scan(script):
scan = Scan(script, Scan.INPUT_MODE_SCRIPT)
scan.satisfier = GreedySatisfier()
scan.start()
retur... | mit | -1,015,796,034,086,174,300 | 23.719298 | 109 | 0.539035 | false | 3.043197 | true | false | false |
call-me-jimi/taskmanager | taskmanager/bin/py/hRunTaskDispatcher.py | 1 | 5796 | #!/usr/bin/env python
import sys
import argparse
import os
import textwrap
import ConfigParser
from datetime import datetime
import socket
import traceback
# get path to taskmanager. it is assumed that this script is in the bin/python directory of
# the taskmanager package.
tmpath = os.path.normpath( os.path.join( os... | gpl-2.0 | 5,551,663,612,076,823,000 | 39.25 | 222 | 0.563147 | false | 4.482599 | true | false | false |
infinidb/emtools | setup.py | 1 | 2023 | # Copyright (C) 2014 InfiniDB, Inc.
#
# 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; version 2 of
# the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOU... | gpl-2.0 | 6,634,771,927,670,332,000 | 29.19403 | 75 | 0.683638 | false | 3.753247 | false | false | false |
SasView/sasmodels | sasmodels/models/squarewell.py | 1 | 5100 | # Note: model title and parameter table are inserted automatically
r"""
Calculates the interparticle structure factor for a hard sphere fluid
with a narrow, attractive, square well potential. **The Mean Spherical
Approximation (MSA) closure relationship is used, but it is not the most
appropriate closure for an attract... | bsd-3-clause | 979,135,493,301,805,000 | 30.097561 | 80 | 0.648039 | false | 2.887882 | false | false | false |
mbauskar/helpdesk-erpnext | erpnext/selling/doctype/sales_order/sales_order.py | 1 | 21507 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
import json
import frappe.utils
from frappe.utils import cstr, flt, getdate, comma_and, cint
from frappe import _
from frappe.model.mapper... | agpl-3.0 | 3,443,995,718,184,364,500 | 33.192369 | 147 | 0.68294 | false | 3.047612 | false | false | false |
jfterpstra/bluebottle | bluebottle/utils/email_backend.py | 1 | 6000 | import logging
import re
import dkim
from django.core.mail.backends.smtp import EmailBackend
from django.db import connection
from django.utils import translation
from django.template.loader import get_template
from django_tools.middlewares import ThreadLocal
from bluebottle.clients.context import ClientContext
from... | bsd-3-clause | -1,504,317,757,381,597,200 | 32.149171 | 80 | 0.585667 | false | 4.424779 | true | false | false |
edeca/Electronics | Support/ProteusGerbersToOshpark.py | 1 | 2978 | import os
import re
import sys
import Tkinter, tkFileDialog
from zipfile import ZipFile, ZIP_DEFLATED
########
# Author: David <david@edeca.net>
# Date: 22nd February 2014
# URL: http://edeca.net
# Source: https://github.com/edeca/Electronics
#
# This script renames Proteus ARES output ZIP files so they are suita... | bsd-3-clause | -5,778,409,877,535,383,000 | 32.088889 | 115 | 0.645735 | false | 3.478972 | false | false | false |
Plexical/django-starter | setup.py | 1 | 1072 | # -*- coding: utf-8 -*-
"""
Installs <Django Project Name>
------------------------------
Copyright 2011-2012 Plexical. See LICENCE for permissions.
"""
import os
import sys
import subprocess
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
if 'boot' in sys.argv:
if ... | isc | 3,512,978,352,759,080,000 | 21.333333 | 62 | 0.641791 | false | 3.801418 | false | false | false |
cornell-cup/cs-minibot-platform | python-interface/src/MiniBotFramework/Sound/note_library.py | 1 | 2243 | import pygame.mixer as pm
from pygame_play_tone import Note
from time import sleep
#Default volume for Notes
DEFAULT_VOLUME=0.2
# Notes that can be called on, where C4 is middle C
C0 = 16.35
C0_SHARP = 17.32
D0 = 18.35
D0_SHARP = 19.45
E0 = 20.6
F0 = 21.83
F0_SHARP = 23.12
G0 = 24.5
G0_SHARP = 25.96
A0 = 27.5
A0_SHAR... | apache-2.0 | -5,067,704,781,658,738,000 | 17.385246 | 80 | 0.668301 | false | 2.128083 | false | false | false |
pkimber/stock | stock/forms.py | 1 | 1313 | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals
from base.form_utils import RequiredFieldForm
from .models import Product
#class BundleAddProductForm(forms.Form):
#
# product = forms.ModelChoiceField(Product.objects.all())
#
#
#class BundleForm(RequiredFieldForm):
#
# def __init__(self, *arg... | apache-2.0 | 2,041,019,894,887,921,700 | 21.637931 | 60 | 0.510282 | false | 3.647222 | false | false | false |
traildb/trck | trick/trick.py | 1 | 12330 |
import sys
import tempfile
import json
from collections import defaultdict, OrderedDict
from subprocess import Popen, PIPE
from itertools import product, count, izip, chain, cycle
MINUTE = 60
HOUR = 60 * MINUTE
DAY = 24 * HOUR
MONTH = 30 * DAY
MAX_WINDOW = MONTH + 2 * DAY
#
# States
#
class State(object):
def... | mit | 2,512,851,917,784,312,300 | 32.234501 | 81 | 0.498297 | false | 3.871272 | true | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.