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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
mprunell/utils | url_diff.py | 1 | 5578 | import sys
import getopt
import traceback
import urllib2
from urlparse import urljoin, urlparse, ParseResult
from BeautifulSoup import BeautifulSoup
def connect(conn, url):
assert conn is not None, 'Input connection must be valid'
assert url, 'Input old URL cannot be empty'
response = None
try:
... | mit | -2,697,641,972,369,733,000 | 33.220859 | 137 | 0.512191 | false | 4.172027 | false | false | false |
clawpack/clawpack-4.x | doc/sphinx/example-acoustics-1d/setplot_2.py | 2 | 2095 |
"""
Single figure and axes with two items
=======================================
Only the pressure q[0] is plotted.
In this example the line and points are plotted in different colors by
specifying a second item on the same axes.
"""
#--------------------------
def setplot(plotdata):
#--------------------------... | bsd-3-clause | 131,839,920,120,688,060 | 32.790323 | 74 | 0.609547 | false | 3.624567 | false | false | false |
yuanyelele/solfege | solfege/tracebackwindow.py | 1 | 4872 | # GNU Solfege - free ear training software
# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2007, 2008, 2011 Tom Cato Amundsen
#
# 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... | gpl-3.0 | -2,274,994,143,251,863,300 | 42.891892 | 185 | 0.609401 | false | 3.693707 | false | false | false |
alexkorovkov/TeXPreview | LaTexPreview.py | 1 | 4013 | import sublime, sublime_plugin
try: # python 3
from .functions import *
from .openfunctions import *
except ValueError: # python 2
from functions import *
from openfunctions import *
def plugin_loaded():
ENVIRON['PATH'] += str(
sublime.load_settings("TeXPreview.sublime... | gpl-3.0 | 4,334,221,548,284,516,000 | 27.260563 | 98 | 0.59083 | false | 4.352495 | false | false | false |
kd5bjo/icing | icing.py | 1 | 5109 | #!/usr/bin/env python
# icing.py
#
# Created by Eric Sumner on 2010-10-29.
# Copyright 2010 Haleret Productions. All rights reserved.
#
# See the file named "COPYING" in this directory for licensing information.
import sys
# Syntactic sugar for common object types:
#
# NSNumber: @42
# NSMutableArray: ... | bsd-2-clause | -6,088,098,910,970,394,000 | 29.592814 | 76 | 0.574868 | false | 3.731921 | false | false | false |
isfon/DjangoSales | DjangoSales/apps/users/migrations/0001_initial.py | 1 | 2405 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-06-10 19:56
from __future__ import unicode_literals
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0007_alter_validators_... | mit | -8,246,163,853,700,214,000 | 58.125 | 266 | 0.619958 | false | 4.234155 | false | false | false |
iric-soft/km | km/tools/find_report.py | 1 | 12904 | import sys
import re
from .. utils import common as uc
def print_line(sample, region, location, type_var, removed,
added, abnormal, normal, ratio, min_cov, min_exclu,
variant, target, info, var_seq, ref_seq):
line = "\t".join([sample, region, location, type_var, removed,
... | mit | 5,941,889,215,289,551,000 | 37.404762 | 106 | 0.483571 | false | 3.624719 | false | false | false |
brendanlong/compression | compression/huffman.py | 1 | 4277 | import bitstring
import collections
import heapq
class Node(object):
def __init__(self, left, right):
if left.weight is None:
self.weight = None
else:
self.weight = left.weight + right.weight
self.left = left
self.right = right
self.symbol = left.sym... | unlicense | -2,542,109,405,791,390,700 | 26.242038 | 77 | 0.582418 | false | 3.881125 | false | false | false |
suvit/speedydeploy | speedydeploy/project/django.py | 1 | 5549 | # -*- coding: utf-8 -*-
from __future__ import with_statement
import os
from fabric import api as fab
from fabric.contrib.files import uncomment, comment
from ..base import _
from ..utils import render_template, upload_template
from ..deployment import command
class DjangoProject(object):
namespace = 'django'
... | mit | -7,802,574,031,891,586,000 | 28.052356 | 85 | 0.565507 | false | 3.74174 | false | false | false |
santisiri/popego | envs/ALPHA-POPEGO/lib/python2.5/site-packages/numpy-1.0.4-py2.5-linux-x86_64.egg/numpy/lib/arraysetops.py | 1 | 9143 | """
Set operations for 1D numeric arrays based on sorting.
Contains:
ediff1d,
unique1d,
intersect1d,
intersect1d_nu,
setxor1d,
setmember1d,
union1d,
setdiff1d
All functions work best with integer numerical arrays on input (e.g. indices).
For floating point arrays, innacurate results may appear due to ... | bsd-3-clause | 7,430,667,529,558,364,000 | 26.960245 | 80 | 0.603959 | false | 3.493695 | false | false | false |
pagekite/PyPagekite | pagekite/ui/nullui.py | 1 | 10192 | """
This is a basic "Null" user interface which does nothing at all.
"""
##############################################################################
from __future__ import absolute_import
from __future__ import division
LICENSE = """\
This file is part of pagekite.py.
Copyright 2010-2020, the Beanstalks Project eh... | agpl-3.0 | 2,314,659,761,549,735,400 | 34.512195 | 81 | 0.586637 | false | 3.543811 | false | false | false |
scholer/cadnano2.5 | cadnano/strand/insertioncmd.py | 2 | 5135 | # -*- coding: utf-8 -*-
from cadnano.proxies.cnproxy import UndoCommand
from cadnano.decorators.insertion import Insertion
from cadnano.cntypes import (
StrandT
)
class AddInsertionCommand(UndoCommand):
def __init__(self, strand: StrandT, idx: int, length: int):
super(AddInsertionCommand, self).__init_... | mit | -6,313,271,576,578,294,000 | 36.481752 | 79 | 0.614216 | false | 3.789668 | false | false | false |
stevenwudi/Kernelized_Correlation_Filter | OBT_50_RNN_train.py | 1 | 6825 | """
author: DI WU
stevenwudi@gmail.com
"""
import getopt
import sys
# some configurations files for OBT experiments, originally, I would never do that this way of importing,
# it's simple way too ugly
from config import *
from scripts import *
from KCF_CNN_RNN import KCFTracker
def main(argv):
trackers = [KCFTr... | gpl-3.0 | -8,334,159,504,333,091,000 | 38.680233 | 105 | 0.488205 | false | 3.737678 | false | false | false |
lreis2415/SEIMS | seims/preprocess/sp_extraction.py | 1 | 1437 | """Extract spatial parameters for soil, landuse, and terrain related.
@author : Liangjun Zhu
@changelog:
- 16-12-07 lj - rewrite for version 2.0
- 17-06-23 lj - reorganize according to pylint and google style
- 18-02-08 lj - compatible with Python3.
"""
from __future__ import absolute_import,... | gpl-3.0 | -8,365,632,222,240,427,000 | 30.933333 | 72 | 0.713292 | false | 3.381176 | false | false | false |
hdemeyer/king-phisher | king_phisher/scrubber.py | 1 | 3276 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# king_phisher/scrubber.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 li... | bsd-3-clause | 4,907,353,813,057,486,000 | 36.227273 | 83 | 0.724054 | false | 3.366906 | false | false | false |
dicksontsai/sudoku | sudoku_checker.py | 1 | 1170 | import io, sys
class Sudoku():
def __init__(self, textfile):
puzzle = open(textfile).readlines()
class Position():
def __init__(self, row, column, box):
self.row = row
self.column = column
self.box = box
if __name__ == '__main__':
puzzle = open(sys.argv[1]).readlines()... | gpl-3.0 | -5,252,328,654,009,277,000 | 23.375 | 63 | 0.517949 | false | 3.259053 | false | false | false |
sharmaeklavya2/zulip | zerver/lib/ccache.py | 1 | 7539 | from __future__ import absolute_import
from typing import Any, Dict, Optional, Text
# This file is adapted from samples/shellinabox/ssh-krb-wrapper in
# https://github.com/davidben/webathena, which has the following
# license:
#
# Copyright (c) 2013 David Benjamin and Alan Huang
#
# Permission is hereby granted, free ... | apache-2.0 | -5,120,918,209,832,883,000 | 37.075758 | 98 | 0.613477 | false | 3.59171 | false | false | false |
qxcv/comp2560 | project/tests/test_pairwise_relations.py | 1 | 2409 | import numpy as np
from datasets import Joints
from pairwise_relations import from_dataset
def generate_fake_locations(num, means, stddev=5):
"""Generate a matrix with four rows (one for each "point") and three
columns (x-coord, y-coord and visibility). Means is a 3x2 matrix giving
mean locations for eac... | apache-2.0 | -8,136,137,840,983,608,000 | 33.414286 | 76 | 0.616853 | false | 3.617117 | false | false | false |
petterreinholdtsen/frikanalen | fkbeta/fk/models.py | 1 | 20257 | # Copyright (c) 2012-2013 Benjamin Bruheim <grolgh@gmail.com>
# This file is covered by the LGPLv3 or later, read COPYING for details.
import datetime
import os
import uuid
import pytz
from django.conf import settings
from django.contrib.auth.models import User
from django.core.exceptions import ObjectDoesNotExist
fro... | lgpl-3.0 | 90,916,170,762,672,200 | 34.601054 | 129 | 0.630646 | false | 3.967293 | false | false | false |
skosukhin/spack | var/spack/repos/builtin/packages/r-ggpubr/package.py | 1 | 1832 | ##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 | 4,993,525,382,914,049,000 | 43.682927 | 78 | 0.659389 | false | 3.57115 | false | false | false |
psinha/paparazzi | sw/ground_segment/python/move_waypoint_example.py | 1 | 1617 | #!/usr/bin/env python
from __future__ import print_function
import sys
from os import path, getenv
from time import sleep
# if PAPARAZZI_SRC not set, then assume the tree containing this
# file is a reasonable substitute
PPRZ_SRC = getenv("PAPARAZZI_SRC", path.normpath(path.join(path.dirname(path.abspath(__file__)),... | gpl-2.0 | 2,017,451,250,166,968,600 | 28.944444 | 111 | 0.621521 | false | 3.3 | false | false | false |
iut-ibk/DynaMind-ToolBox | DynaMind-GDALModules/scripts/Drainage/dm_importswmm.py | 1 | 17024 | # -*- coding: utf-8 -*-
"""
@file
@author Chrisitan Urich <christian.urich@gmail.com>
@version 1.0
@section LICENSE
This file is part of DynaMind
Copyright (C) 2015 Christian Urich
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as publishe... | gpl-2.0 | 8,308,265,447,512,826,000 | 37 | 97 | 0.523672 | false | 3.784793 | false | false | false |
kosystem/git-tree | gitTree/gitTree.py | 1 | 1927 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import subprocess
C_GREEN = '\033[92m'
C_BLUE = '\033[94m'
C_END = '\033[00m'
def grouping(fileList):
root = {}
for path in fileList:
current = root
for p in path.rstrip('\n').split('/'):
current.setdefault(p, {})
... | mit | 7,526,913,242,082,758,000 | 24.144737 | 66 | 0.552067 | false | 3.585366 | false | false | false |
apache/libcloud | libcloud/compute/drivers/linode.py | 2 | 60267 | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | apache-2.0 | -4,174,464,189,524,054,500 | 34.264482 | 84 | 0.551181 | false | 4.239975 | false | false | false |
CloudBrewery/duplicity-swiftkeys | duplicity/patchdir.py | 1 | 21607 | # -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright 2002 Ben Escoto <ben@emerose.org>
# Copyright 2007 Kenneth Loafman <kenneth@loafman.com>
#
# This file is part of duplicity.
#
# Duplicity is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License... | gpl-2.0 | -456,289,875,767,890,050 | 35.560068 | 87 | 0.582589 | false | 4.002779 | false | false | false |
keishi/chromium | tools/isolate/isolate_common_test.py | 1 | 2483 | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import cStringIO
import logging
import unittest
import sys
import isolate_common
class TraceInputs(unittest.TestCase):
def _te... | bsd-3-clause | 6,734,886,638,849,571,000 | 24.597938 | 72 | 0.391462 | false | 3.497183 | true | false | false |
MaxTyutyunnikov/lino | obsolete/html2odt/__init__.py | 1 | 2203 | # -*- coding: UTF-8 -*-
## Copyright 2012 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 option)... | gpl-3.0 | -918,762,337,038,523,100 | 29.597222 | 71 | 0.686791 | false | 3.384025 | true | false | false |
indro/t2c | apps/external_apps/swaps/views.py | 2 | 9884 | from django.shortcuts import render_to_response, get_object_or_404
from django.http import HttpResponseRedirect, Http404
from django.template import RequestContext
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext_lazy as _
from django.contrib.auth.models import User
from django... | mit | -4,431,117,786,967,901,700 | 40.704641 | 154 | 0.635269 | false | 3.788425 | false | false | false |
BiznetGIO/horizon | openstack_dashboard/dashboards/admin/instances/views.py | 1 | 9689 | # Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 OpenStack Foundation
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use t... | apache-2.0 | -8,192,718,020,581,848,000 | 36.996078 | 79 | 0.611931 | false | 4.372292 | false | false | false |
citrix-openstack-build/heat | heat/engine/resources/instance.py | 1 | 22792 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# 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 applicab... | apache-2.0 | 2,669,817,716,314,624,000 | 37.305882 | 79 | 0.524482 | false | 4.785219 | false | false | false |
COSMOGRAIL/COSMOULINE | pipe/4_norm_scripts/4c_fac_makecombipngmap_NU.py | 1 | 3080 | #
# Similar to the 1a_checkalistars, we draw the alignment stars, this time on the combi image (to make a "nice" map)
#
execfile("../config.py")
from kirbybase import KirbyBase, KBError
from variousfct import *
import star
#import shutil
import f2n
#from datetime import datetime, timedelta
# Read reference image i... | gpl-3.0 | -5,670,558,067,892,289,000 | 36.560976 | 150 | 0.721429 | false | 2.680592 | false | false | false |
MediaKraken/MediaKraken_Deployment | source/tools/rename_media_files.py | 1 | 2715 | """
Copyright (C) 2019 Quinn D Granfor <spootdev@gmail.com>
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 will be useful, but
... | gpl-3.0 | -2,735,211,053,386,424,300 | 46.631579 | 105 | 0.52523 | false | 4.295886 | false | false | false |
pauloschilling/sentry | src/sentry/models/user.py | 1 | 4560 | """
sentry.models.user
~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
import warnings
from django.contrib.auth.models import AbstractBaseUser, UserManager
from django.db import Inte... | bsd-3-clause | -6,004,456,506,088,527,000 | 34.348837 | 95 | 0.617105 | false | 4.359465 | false | false | false |
mikel-egana-aranguren/SADI-Galaxy-Docker | galaxy-dist/tools/filters/gtf_to_bedgraph_converter.py | 1 | 2931 | #!/usr/bin/env python
import os, sys, tempfile
assert sys.version_info[:2] >= ( 2, 4 )
def __main__():
# Read parms.
input_name = sys.argv[1]
output_name = sys.argv[2]
attribute_name = sys.argv[3]
# Create temp files.
tmp_name1 = tempfile.NamedTemporaryFile().name
tmp_name2 = tempfile... | gpl-3.0 | 92,477,252,772,895,820 | 35.6375 | 123 | 0.513477 | false | 3.786822 | false | false | false |
georgemarshall/django | tests/auth_tests/urls.py | 14 | 6515 | from django.contrib import admin
from django.contrib.auth import views
from django.contrib.auth.decorators import login_required, permission_required
from django.contrib.auth.forms import AuthenticationForm
from django.contrib.auth.urls import urlpatterns as auth_urlpatterns
from django.contrib.messages.api import info... | bsd-3-clause | 1,123,972,528,181,623,400 | 39.216049 | 114 | 0.698695 | false | 3.742102 | false | false | false |
PaddlePaddle/Paddle | python/paddle/fluid/contrib/slim/tests/test_imperative_qat_channelwise.py | 1 | 1457 | # copyright (c) 2018 paddlepaddle 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 app... | apache-2.0 | -7,447,396,531,800,148,000 | 29.354167 | 74 | 0.736445 | false | 3.597531 | true | false | false |
CityGenerator/Megacosm-Generator | tests/test_motivation.py | 1 | 1391 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"Fully test this module's functionality through the use of fixtures."
from megacosm.generators import Motivation
from megacosm.generators import NPC
import unittest2 as unittest
import fixtures
import fakeredis
from config import TestConfiguration
class TestMotivation(... | gpl-2.0 | -8,748,794,249,495,837,000 | 27.387755 | 73 | 0.64486 | false | 3.460199 | true | false | false |
pawelmhm/splash | splash/qwebpage.py | 1 | 6186 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from collections import namedtuple
import sip
from PyQt5.QtWebKitWidgets import QWebPage, QWebView
from PyQt5.QtCore import QByteArray
from twisted.python import log
import six
from splash.har_builder import HarBuilder
RenderErrorInfo = namedtuple('Rende... | bsd-3-clause | -3,589,351,583,061,082,000 | 32.803279 | 108 | 0.619787 | false | 4.146113 | false | false | false |
OpenDanbi/Sherlock | src/ClusterDialog.py | 1 | 2053 | from PySide.QtGui import QDialog, QDialogButtonBox, QVBoxLayout, QLabel, QLineEdit
from PySide import QtGui, QtCore
import Lifeline
class ClusterDialog(QDialog):
editClusterName = None
def __init__(self, lifeline, defaultName, parent = None):
super(ClusterDialog, self).__init__(parent)
s... | lgpl-2.1 | 5,314,989,252,790,974,000 | 33.216667 | 127 | 0.6566 | false | 4.139113 | false | false | false |
chatoooo/pbone-cloud | server.py | 1 | 1692 | from bottle import route, run, template, static_file, post, get, request, response
import urllib
import urllib2
from urllib2 import HTTPError
@route('/js/<filepath:path>')
def js(filepath):
return static_file(filepath, root='./js')
@route('/css/<filepath:path>')
def css(filepath):
return static... | mit | 6,883,486,318,180,225,000 | 25.770492 | 82 | 0.59279 | false | 3.694323 | false | false | false |
jalavik/inspire-next | inspire/modules/workflows/actions/hep_approval.py | 1 | 3652 | # -*- coding: utf-8 -*-
#
# This file is part of INSPIRE.
# Copyright (C) 2014, 2015 CERN.
#
# INSPIRE 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... | gpl-2.0 | 5,389,820,352,519,112,000 | 34.803922 | 79 | 0.597481 | false | 4.17849 | false | false | false |
LenzGr/DeepSea | srv/salt/_modules/purge.py | 1 | 2689 | # -*- coding: utf-8 -*-
"""
Cleanup related operations for resetting the Salt environment and removing
a Ceph cluster
"""
from __future__ import absolute_import
import logging
import os
import shutil
import pwd
import grp
import yaml
log = logging.getLogger(__name__)
def configuration():
"""
Purge all the n... | gpl-3.0 | -2,006,042,993,395,070,200 | 29.908046 | 81 | 0.628115 | false | 3.703857 | false | false | false |
facebook/mcrouter | mcrouter/test/test_noreply.py | 1 | 2998 | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from mcrouter.test.McrouterTestCase import McrouterTestCase
class TestNoReplyBase(McrouterTestCase):
config = '.... | mit | 6,223,384,078,401,246,000 | 38.973333 | 77 | 0.666444 | false | 3.434135 | true | false | false |
TaiSakuma/AlphaTwirl | tests/ROOT/compare_std_vector.py | 1 | 2236 | #!/usr/bin/env python
# Tai Sakuma <tai.sakuma@cern.ch>
##__________________________________________________________________||
import os, sys
import timeit
import array
import ROOT
from alphatwirl.roottree import Events, BEvents
##__________________________________________________________________||
inputPath = 'tree.... | bsd-3-clause | -5,530,343,492,700,515,000 | 35.064516 | 85 | 0.522361 | false | 3.594855 | false | false | false |
rhatto/boaspraticas | conf.py | 1 | 8046 | # -*- coding: utf-8 -*-
#
# Boas Práticas em Desenvolvimento documentation build configuration file, created by
# sphinx-quickstart on Sat Oct 31 19:44:44 2015.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# au... | gpl-3.0 | -4,072,515,261,222,713,000 | 32.090535 | 98 | 0.709738 | false | 3.670014 | true | false | false |
kvesteri/sqlalchemy-json-api | tests/conftest.py | 1 | 10864 | import warnings
import pytest
import sqlalchemy as sa
from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.ext.hybrid import hybrid_property
from sqlalchemy.orm import sessionmaker
from sqlalchemy_json_api import CompositeId, QueryBuilder
warnings.filterwarning... | bsd-3-clause | 381,387,033,388,502,140 | 26.296482 | 79 | 0.554308 | false | 4.004423 | true | false | false |
tmmgarcia/frac-turtle | runner.py | 1 | 1457 | from turtle import Turtle, colormode
from random import randint
import sys
def randColor():
return randint(0,255)
def drawTriangle(t,dist):
t.fillcolor(randColor(),randColor(),randColor())
t.down()
t.setheading(0)
t.begin_fill()
t.forward(dist)
t.left(120)
t.forward(dist)
... | mit | -4,172,545,080,756,532,700 | 21.555556 | 63 | 0.575154 | false | 3.188184 | true | false | false |
eswartz/panda3d-stuff | lib/utils/filesystem.py | 1 | 6149 | __author__ = 'ejs'
import errno
import glob
import logging
import inspect
import os
import sys
import platform
def mkdirP(path):
try:
os.makedirs(path)
except OSError as exc: # Python >2.5
if exc.errno == errno.EEXIST and os.path.isdir(path):
pass
else:
raise
... | mit | -939,937,366,241,566,100 | 29.142157 | 130 | 0.592942 | false | 3.916561 | false | false | false |
leon-lei/learning-materials | data_science/numpy_tutorials/numpy_practice1_array_random_reshape.py | 1 | 3008 | import numpy as np
# from numpy.random import randint
my_list = [1,2,3,4,5,6]
new_list = [[1,2,3], [4,5,6], [7,8,9]]
# 1D array
print('Casting a premade list into a 1D numpy array')
print(np.array(my_list))
# 2D array, note the extra brackets being displayed
print('\nCasting a list of lists into a 2D numpy array')
... | mit | 1,797,216,221,528,837,600 | 33.976744 | 99 | 0.721742 | false | 3.220557 | false | false | false |
theyosh/TerrariumPI | terrariumCollector.py | 1 | 24965 | # -*- coding: utf-8 -*-
import terrariumLogging
logger = terrariumLogging.logging.getLogger(__name__)
import sqlite3
import time
import copy
import os
from terrariumUtils import terrariumUtils
class terrariumCollector(object):
DATABASE = 'history.db'
# Store data every Xth minute. Except switches and doors
STO... | gpl-3.0 | 3,670,249,768,931,652,600 | 45.926692 | 325 | 0.576247 | false | 3.879565 | false | false | false |
DarthMaulware/EquationGroupLeaks | Leak #5 - Lost In Translation/windows/Resources/Dsz/PyScripts/Tasking/Mcl_Cmd_Banner_Tasking.py | 1 | 5237 | # uncompyle6 version 2.9.10
# Python bytecode 2.7 (62211)
# Decompiled from: Python 3.6.0b2 (default, Oct 11 2016, 05:27:10)
# [GCC 6.2.0 20161005]
# Embedded file name: Mcl_Cmd_Banner_Tasking.py
def TaskingMain(namespace):
import mcl.imports
import mcl.target
import mcl.tasking
from mcl.object.Messa... | unlicense | -4,678,044,798,674,551,000 | 38.089552 | 110 | 0.47088 | false | 3.914051 | false | false | false |
emi420/APIzza | mail.api/mail/settings-sample.py | 1 | 4268 | """
Django settings for the mail.api project.
Rename this file to settings.py and replace the
"CHANGEME" string in configuration options to use
these sample settings.
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
http... | gpl-3.0 | 4,870,246,465,533,267,000 | 29.056338 | 108 | 0.662605 | false | 3.71777 | false | false | false |
bradallred/gemrb | gemrb/GUIScripts/bg2/GUICG3.py | 1 | 3602 | # GemRB - Infinity Engine Emulator
# Copyright (C) 2003 The GemRB Project
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later versi... | gpl-2.0 | -7,012,643,100,263,473,000 | 29.786325 | 81 | 0.764575 | false | 3.083904 | false | false | false |
PaulMcInnis/JobPy | jobfunnel/resources/defaults.py | 1 | 1253 | """Default arguments for both JobFunnelConfigManager and CLI arguments.
NOTE: Not all defaults here are used, as we rely on YAML for demo and not kwargs
"""
import os
from pathlib import Path
from jobfunnel.resources.enums import (Locale, DelayAlgorithm, Provider, Remoteness)
DEFAULT_LOG_LEVEL_NAME = 'INFO'
DEFAULT_L... | mit | 7,973,866,357,179,708,000 | 34.8 | 84 | 0.757382 | false | 3.06357 | false | false | false |
770352/Dozer | dozer/cogs/general.py | 1 | 11619 | """General, basic commands that are common for Discord bots"""
import inspect
import discord
from discord.ext.commands import BadArgument, cooldown, BucketType, Group, has_permissions
from ._utils import *
from .. import db
class General(Cog):
"""General commands common to all Discord bots."""
@command()
... | gpl-3.0 | 4,882,674,967,214,114,000 | 48.866953 | 146 | 0.58542 | false | 4.111465 | false | false | false |
schneegor/WeatherServer | weather_server/show_weather/models.py | 1 | 2423 | # -*- coding: utf-8 -*-
"""
WeatherServer
Copyright (C) 2015 Full Stack Embedded
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later versio... | gpl-2.0 | 7,606,419,842,446,554,000 | 35.712121 | 75 | 0.704911 | false | 4.206597 | false | false | false |
metglobal/django-exchange | exchange/conversion.py | 1 | 4152 | from collections import namedtuple
from operator import itemgetter
from datetime import timedelta
from django.conf import settings
from exchange.adapters import BaseAdapter
from exchange.utils import import_class, memoize
from exchange.models import ExchangeRate
from exchange.cache import (update_rates_cached, get_ra... | mit | -6,385,014,705,637,827,000 | 28.034965 | 78 | 0.650048 | false | 4.050732 | false | false | false |
acigna/pywez | zsi/test/test_t2.py | 1 | 3220 | #!/usr/bin/env python
import sys
import unittest
from ZSI import TC, ParsedSoap, ParseException, FaultFromZSIException, FaultFromException, SoapWriter
class t2TestCase(unittest.TestCase):
"Test case wrapper for old ZSI t2 test case"
def checkt2(self):
try:
ps = ParsedSoap(IN)
e... | mit | 1,620,134,022,374,674,400 | 28.814815 | 101 | 0.557764 | false | 3.638418 | true | false | false |
tensorflow/deepmath | deepmath/deephol/utilities/proof_checker_lib.py | 1 | 10623 | """Exports proof logs to OCaml files to be loaded by HOL Light.
Processes multiple proof logs, but can generate at most one proof per theorem.
"""
from __future__ import absolute_import
from __future__ import division
# Import Type Annotations
from __future__ import print_function
import tensorflow as tf
from typing... | apache-2.0 | 2,743,703,238,344,068,600 | 36.013937 | 80 | 0.674574 | false | 3.357459 | false | false | false |
AuxinJeron/ACS-VRP | src/VRPCenter.py | 1 | 2479 | from AntColony import AntColony
from AntGraph import AntGraph
from TspPainter import tspPainter
import logging
logger = logging.getLogger("logger")
class VRPCenter:
def __init__(self, tspparser):
self.build_graph(tspparser)
def build_graph(self, tspparser):
self.antGraph = AntGraph(tspparser... | apache-2.0 | -708,314,445,237,468,300 | 37.75 | 135 | 0.595401 | false | 3.784733 | false | false | false |
kantai/passe-framework-prototype | django/middleware/server.py | 1 | 5329 | import os, Pyro4, new
import django.htoken.serializer
from django.utils.importlib import import_module
from django.analysis.persisted import mw_socket
from django.http import get_changeset
PYRO_NAME = 'middleware'
def pre_req(self, request, delta):
request = self.cereal.deserialize(request)
self.cereal.apply_... | bsd-3-clause | 833,321,002,150,552,200 | 39.992308 | 102 | 0.579658 | false | 4.543052 | false | false | false |
taigaio/taiga-contrib-gitlab-auth | back/taiga_contrib_gitlab_auth/services.py | 1 | 3705 | # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can redistribute it and/or mo... | agpl-3.0 | -6,168,161,143,944,050,000 | 38.817204 | 100 | 0.652984 | false | 3.914376 | false | false | false |
prophile/shipwreck | buildsim.py | 1 | 6017 | import random
buildings = []
current_turn = 0
queued_shipments = []
MAX_SHIPMENT = 10
from fractions import Fraction
messages = []
def queue_shipment(source, amount, target, turns):
messages.append("Shipping {0} from {1} to {2}".format(amount, source.name, target.name))
queued_shipments.append((amount, targ... | mit | -3,679,701,480,851,682,000 | 29.85641 | 138 | 0.580688 | false | 3.815472 | false | false | false |
malja/cvut-python | cviceni04/domaci_priprava.py | 1 | 2485 | # Zadání:
#########
#
# Implementujte následující úlohy:
#
# - swap(a,b), která navzájem vymění tyto dva prvky
# - Napište funkci, která vypisuje 1,-1,1,-1 …
# - Napište funkci, která vypisuje výsledek operace (−1)^k pro k=0,…,100.
# Zamyslete se nad rychlostem výpočtu, navrhněte alternativní postupy
# - Napište fun... | mit | 2,412,997,842,232,370,700 | 20.504505 | 79 | 0.557604 | false | 2.42335 | false | false | false |
bert/geda-gaf | xorn/tests/cpython/Setup.py | 1 | 2264 | # Copyright (C) 2013-2017 Roland Lutz
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed ... | gpl-2.0 | 2,625,262,142,088,456,700 | 24.727273 | 73 | 0.668286 | false | 3.266955 | false | false | false |
jonroberts/nasaMining | bak/textrank.py | 1 | 6131 | """
*** FROM https://github.com/davidadamojr/TextRank/blob/master/textrank.py ***
From this paper: http://acl.ldc.upenn.edu/acl2004/emnlp/pdf/Mihalcea.pdf
External dependencies: nltk, numpy, networkx
Based on https://gist.github.com/voidfiles/1646117
"""
import nltk
import itertools
from operator import itemgetter... | mit | 4,441,759,738,965,631,000 | 33.835227 | 160 | 0.672484 | false | 3.759044 | false | false | false |
Fenykepy/phiroom | src/api/contact/tests.py | 1 | 16072 | from django.core import mail
from django.test import TestCase
from django.core.cache import cache
from rest_framework.test import APIClient, APITestCase
from contact.models import Description, Message
from user.models import User
from stats.models import Hit
from user.tests import create_test_users, login
from phi... | agpl-3.0 | 5,686,901,337,456,591,000 | 33.339744 | 81 | 0.593678 | false | 4.000747 | true | false | false |
facekapow/runtime | deps/v8/tools/gen-postmortem-metadata.py | 2 | 23848 | #!/usr/bin/env python
#
# Copyright 2012 the V8 project authors. 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
# not... | apache-2.0 | -8,884,874,755,149,568,000 | 38.095082 | 119 | 0.543442 | false | 4.00672 | true | false | false |
maxterip/plugins.video.Movies-Online | resources/tools/server_rtmp.py | 1 | 5143 | # -*- coding: utf-8 -*-
#------------------------------------------------------------
# tvspot - XBMC Add-on by Juarrox (juarrox@gmail.com)
# Version 0.2.9 (18.07.2014)
#------------------------------------------------------------
# License: GPL (http://www.gnu.org/licenses/gpl-3.0.html)
# Gracias a la librería plugint... | gpl-2.0 | -3,087,301,862,750,812,000 | 40.096 | 235 | 0.599377 | false | 3.167078 | false | false | false |
DiCarloLab-Delft/PycQED_py3 | pycqed/tests/test_chevron_sim.py | 1 | 1198 | import numpy as np
from pycqed.simulations import chevron_sim as chs
class TestChevronSim:
@classmethod
def setup_class(cls):
cls.e_min = -0.0322
cls.e_max = 0.0322
cls.e_points = 20
cls.time_stop = 60
cls.time_step = 4
cls.bias_tee = lambda self, t, a, b, c: ... | mit | 2,995,853,736,358,412,000 | 32.277778 | 77 | 0.507513 | false | 3.273224 | false | false | false |
ISISComputingGroup/EPICS-inst_servers | server_common/channel_access.py | 1 | 11463 | from __future__ import absolute_import, print_function, unicode_literals, division
from time import sleep
# This file is part of the ISIS IBEX application.
# Copyright (C) 2012-2016 Science & Technology Facilities Council.
# All rights reserved.
#
# This program is distributed in the hope that it will be useful.
# Thi... | bsd-3-clause | -3,149,935,148,602,946,000 | 36.460784 | 121 | 0.634651 | false | 4.266096 | false | false | false |
lwahlmeier/python-litesockets | tests/sslTests.py | 1 | 3170 | from __future__ import print_function
import unittest, hashlib, logging
import litesockets, time
from . import utils
import os
try:
xrange(1)
except:
xrange=range
DIRNAME = os.path.dirname(__file__)
TEST_STRING = ("TEST"*100).encode('utf-8')
logging.basicConfig(format="%(asctime)s - %(levelname)s - %(name)s - %... | unlicense | 4,541,997,351,854,999,600 | 28.90566 | 116 | 0.679495 | false | 3.189135 | true | false | false |
tedunderwood/GenreProject | python/piketty/fifteenwordsnippets.py | 1 | 11248 | # fifteenwordsnippets.py
# A script that searches a HathiTrust corpus of 6,942 volumes (1700-1923), plus Hoyt & Richard's
# corpus of 808 vols (1923-1950), for words related to money. It takes seven words on either
# side of those words to create a snippet.
# In cases where the possibly-monetary word is ambiguous, e.... | mit | 1,693,274,650,786,676,000 | 33.460123 | 449 | 0.644205 | false | 3.639132 | false | false | false |
matthewnorman/chronosphere | cronparse.py | 1 | 7269 | import re
import time
import datetime
CRON_ORDER = ['minute', 'hour', 'day', 'month', 'dayofweek']
BOUNDS = {'minute': (0, 59), 'hour': (0, 23), 'day': (1, 31),
'month': (1, 12), 'dayofweek': (1, 7)}
def str_test(tester):
if isinstance(tester, str) or isinstance(tester, unicode):
return True
... | mit | 799,791,373,471,677,200 | 34.115942 | 78 | 0.500619 | false | 4.211472 | false | false | false |
DedMemez/ODS-August-2017 | battle/BattleProps.py | 1 | 13551 | # Fuck you Disyer. Stealing my fucking paypal. GET FUCKED: toontown.battle.BattleProps
from panda3d.core import NodePath, SequenceNode, Texture, VBase4
from direct.actor import Actor
from direct.directnotify import DirectNotifyGlobal
from otp.otpbase import OTPGlobals
import random
Props = ((5, 'partyBall', 'part... | apache-2.0 | -4,398,891,153,103,457,000 | 39.830247 | 396 | 0.551325 | false | 2.938842 | false | false | false |
open-switch/ops-cli | tests/test_vtysh_ct_bgp_router_cli.py | 1 | 10162 | #!/usr/bin/python
# (c) Copyright 2015 Hewlett Packard Enterprise Development LP
#
# GNU Zebra 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, or (at your option) any
# later version.
#
# GN... | gpl-2.0 | 7,163,407,321,694,720,000 | 35.952727 | 83 | 0.594666 | false | 3.718258 | true | false | false |
tulip-control/tulip-control | contrib/xml/xmlio.py | 1 | 23496 | # Copyright (c) 2014 by California Institute of Technology
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this... | bsd-3-clause | -2,195,090,474,921,197,600 | 24.73494 | 77 | 0.701311 | false | 2.816253 | false | false | false |
bitdagger/mtg-scanner | scanner.py | 1 | 8352 | from __future__ import print_function
import numpy as np
import cv2
import math
import json
import sys
import phash
import operator
import signal
import base64
from debugger import MTG_Debugger
from mtgexception import MTGException
from transformer import MTG_Transformer
"""Scanner module
This module is responsible... | mit | -6,063,127,265,762,515,000 | 36.452915 | 77 | 0.530771 | false | 4.442553 | false | false | false |
chrislit/abydos | abydos/distance/_baulieu_ii.py | 1 | 4475 | # Copyright 2019-2020 by Christopher C. Little.
# This file is part of Abydos.
#
# Abydos 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 versio... | gpl-3.0 | -737,164,622,069,967,200 | 28.248366 | 78 | 0.575419 | false | 3.874459 | false | false | false |
tgcmteam/tgcmlinux | src/tgcm/contrib/mobile-manager2/src/mobilemanager/devices/huawei/Modem.py | 1 | 2711 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Authors : David Castellanos <dcastellanos@indra.es>
#
# Copyright (c) 2012, Telefonica Móviles España S.A.U.
#
# This program 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... | gpl-2.0 | 5,042,313,276,414,435,000 | 36.625 | 79 | 0.578442 | false | 3.875536 | false | false | false |
csdms/bob | bob/build_environment.py | 1 | 1669 | import os
from ConfigParser import SafeConfigParser
import warnings
class BuilderEnvironment(object):
"""Set up environment
"""
required_options = set(['cmake', 'wget', 'pkg_config', 'tar', 'xz', 'svn'])
def __init__(self, cfg_file='bob.cfg', environ={}):
self._environ = environ
self.... | mit | -2,572,499,518,844,303,000 | 30.490566 | 79 | 0.55003 | false | 4.031401 | false | false | false |
saebyn/django-classifieds | classifieds/utils.py | 1 | 13685 | """
"""
from PIL import Image
import HTMLParser
import string
import re
import os.path
from django.utils.datastructures import SortedDict
from django.utils.translation import ugettext as _
from django.core.paginator import Paginator, InvalidPage
from django.template.loader import get_template
from django.template imp... | bsd-3-clause | -3,965,156,459,822,403,000 | 41.632399 | 304 | 0.628864 | false | 3.708672 | false | false | false |
rollasoul/ghosthugs | 8266_server/8266_complex_high.py | 1 | 3299 | import socket
import time
import machine
led1 = machine.Pin(5, machine.Pin.OUT)
led2 = machine.Pin(4, machine.Pin.OUT)
adc = machine.ADC(0)
s = socket.socket()
host = "To Do: Enter ip-address of remote server"
port = 12344
counter = 0
while True:
try:
while True:
s = socket.socket()
... | mit | 7,458,516,790,863,299,000 | 38.27381 | 71 | 0.35344 | false | 4.186548 | false | false | false |
blaze/dask | dask/dataframe/tests/test_indexing.py | 2 | 19852 | import pandas as pd
import numpy as np
import pytest
import dask
import dask.dataframe as dd
from dask.dataframe._compat import tm, PANDAS_GT_100
from dask.dataframe.indexing import _coerce_loc_index
from dask.dataframe.utils import assert_eq, make_meta, PANDAS_VERSION
dsk = {
("x", 0): pd.DataFrame({"a": [1, ... | bsd-3-clause | -2,490,895,421,420,393,500 | 30.511111 | 87 | 0.545487 | false | 2.655786 | true | false | false |
foursquare/pants | contrib/scrooge/tests/python/pants_test/contrib/scrooge/tasks/test_scrooge_gen_integration.py | 1 | 3904 | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import, division, print_function, unicode_literals
from pants_test.pants_run_integration_test import PantsRunIntegrationTest
class Scrooge... | apache-2.0 | -673,519,894,424,633,000 | 34.490909 | 99 | 0.587859 | false | 3.415573 | true | false | false |
opendatakosovo/bpo | app/mod_api/views.py | 1 | 4818 | from bson import json_util
from flask import Blueprint, render_template, request
from flask import Response
from datetime import datetime
from app import mongo
from app import utils
import json
mod_api = Blueprint('api', __name__, url_prefix='/api')
@mod_api.route('/', methods=['GET'])
def index():
''' Renders t... | cc0-1.0 | -4,381,790,031,525,156,000 | 29.5 | 125 | 0.512661 | false | 3.78179 | false | false | false |
tchakravarty/PythonExamples | Code/Miscellaneous/distribution_object_graph.py | 1 | 1713 | # ==============================================================================
# purpose: create statistical distribution objects, and find shortest paths
# author:
# created: 6/6/15
# revised:
# comments:
# 1. This is based on the object graph on Wikipedia.
# 2. The idea is to create a graph of the various continuo... | apache-2.0 | 154,036,799,461,104,830 | 30.722222 | 96 | 0.640981 | false | 4.059242 | false | false | false |
HybridF5/jacket | jacket/tests/compute/unit/api/openstack/compute/test_block_device_mapping_v1.py | 1 | 17001 | # Copyright (c) 2014 IBM Corp.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | apache-2.0 | -7,537,596,891,134,087,000 | 39.096698 | 80 | 0.593553 | false | 3.88772 | true | false | false |
cormoran/RaspberryPi | tests/Others/ultrasonicsensor.py | 1 | 3633 | #!/usr/bin/python
import time
import RPi.GPIO as GPIO
# remember to change the GPIO values below to match your sensors
# GPIO output = the pin that's connected to "Trig" on the sensor
# GPIO input = the pin that's connected to "Echo" on the sensor
def reading(sensor):
# Disable any warning message such as GP... | gpl-2.0 | -2,685,730,067,043,373,600 | 39.366667 | 72 | 0.629783 | false | 4.340502 | false | false | false |
smarttang/baseline_testing | plugins/t_varfile_mod.py | 1 | 1129 | #coding:utf-8
import re
import commands
###################################
#
# 测试系统日志是否做了权限限制
#
####################################
class TvarfileMod:
global results,sorce
results=[]
sorce=60
def setBaseline_main(self,baseline_main):
self.baseline_main=baseline_main
def start(self):
print "[*] Checking Tv... | gpl-2.0 | 6,226,643,696,517,116,000 | 26.525 | 125 | 0.624886 | false | 2.73201 | false | false | false |
apple/swift-lldb | packages/Python/lldbsuite/test/lang/swift/metatype/TestSwiftMetatype.py | 1 | 1815 | # TestSwiftMetatype.py
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See https://swift.org/LICENSE.txt for license information
# See https://swift.org/CONTRI... | apache-2.0 | -4,033,874,331,155,257,000 | 32 | 80 | 0.639118 | false | 3.46374 | true | false | false |
JoseTomasTocino/SiteUp | web/siteup_checker/monitoring/pport.py | 1 | 1113 | import socket
import logging
logger = logging.getLogger("debugging")
def check_port(host, port_number, content=None):
logger.info(u"Port check, host: %s, port: %s, content: '%s'" % (host, port_number, content))
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.settimeout(10)
# connect_ex retur... | gpl-2.0 | -2,188,741,097,909,394,000 | 26.825 | 96 | 0.57053 | false | 3.697674 | false | false | false |
JudgeGregg/Redmine-Importer | redmine_ldap.py | 1 | 1337 | #-*- encoding: utf8 -*-
"""Retrieve user id from ldap server."""
import logging
import sys
logging.basicConfig(level=logging.INFO)
LOGGER = logging.getLogger(__name__)
try:
import ldap
except ImportError, exception:
LOGGER.error(str(exception))
sys.exit()
LDAP_SERVER_URL = 'ldap://directory.lvl.intranet'... | gpl-3.0 | -7,550,749,679,225,353,000 | 27.446809 | 74 | 0.624533 | false | 3.653005 | false | false | false |
lopiola/cowboys_ai | src/supervised_learning/network.py | 1 | 2137 | #!/usr/bin/env python
# coding=utf-8
from pybrain.tools.shortcuts import buildNetwork
from pybrain.supervised.trainers import BackpropTrainer
from src.supervised_learning import dataset
from math import sqrt
import cPickle as pickle
def build(input_size, hidden_size, target_size):
return buildNetwork(input_size,... | mit | 3,967,700,485,640,788,000 | 26.050633 | 72 | 0.627515 | false | 3.652991 | false | false | false |
stereoboy/object_detection | utils.py | 1 | 1635 | import tensorflow as tf
import numpy as np
from PIL import Image
import os
def maybe_download(directory, filename, url):
print('Try to dwnloaded', url)
if not tf.gfile.Exists(directory):
tf.gfile.MakeDirs(directory)
filepath = os.path.join(directory, filename)
if not tf.gfile.Exists(filepath):
filepath... | mit | -3,746,810,476,708,794,000 | 26.25 | 87 | 0.674618 | false | 3.162476 | false | false | false |
dstl/ideaworks | backend/ideaworks/projectsapp/tests/project_tests.py | 1 | 112560 |
# (c) Crown Copyright 2014 Defence Science and Technology Laboratory UK
# Author: Rich Brantingham
import copy
import time
import json
import urlparse
import datetime
from xml.dom.minidom import parseString
from xml.parsers.expat import ExpatError
from django.test import TestCase
from django.core impor... | agpl-3.0 | -8,572,646,595,100,724,000 | 46.206424 | 306 | 0.551759 | false | 4.08107 | true | false | false |
baloo/shinken | shinken/objects/businessimpactmodulation.py | 1 | 2434 | #!/usr/bin/env python
#Copyright (C) 2009-2010 :
# Gabes Jean, naparuba@gmail.com
# Gerhard Lausser, Gerhard.Lausser@consol.de
# Gregory Starck, g.starck@gmail.com
# Hartmut Goebel, h.goebel@goebel-consult.de
#
#This file is part of Shinken.
#
#Shinken is free software: you can redistribute it and/or modify... | agpl-3.0 | -5,847,335,771,418,948,000 | 32.805556 | 133 | 0.689811 | false | 3.654655 | false | false | false |
adalke/rdkit | rdkit/Chem/UnitTestGraphDescriptors.2.py | 1 | 24477 | # $Id$
#
# Copyright (C) 2003-2006 Rational Discovery LLC
#
# @@ All Rights Reserved @@
# This file is part of the RDKit.
# The contents are covered by the terms of the BSD license
# which is included in the file license.txt, found at the root
# of the RDKit source tree.
#
"""unit testing code for graph-theoret... | bsd-3-clause | -2,990,828,470,993,036,300 | 30.829649 | 302 | 0.57981 | false | 2.496889 | true | false | false |
fraunhoferfokus/fixmycity | api/tasty.py | 1 | 10043 | '''
/*******************************************************************************
*
* Copyright (c) 2015 Fraunhofer FOKUS, All rights reserved.
*
* 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 Sof... | lgpl-3.0 | 2,120,749,673,092,615,000 | 36.755639 | 122 | 0.588967 | false | 4.158592 | false | false | false |
cernvm/cvmfs-monitor | cvmfsweb/cvmfsmon/migrations/0001_initial.py | 1 | 4140 | # -*- 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 'Stratum'
db.create_table('cvmfsmon_stratum', (
... | bsd-2-clause | 3,032,668,471,992,999,400 | 50.7625 | 170 | 0.595652 | false | 3.541488 | false | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.