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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Unicorn-rzl/pretix | src/pretix/control/middleware.py | 1 | 3347 | from urllib.parse import urlparse
from django.conf import settings
from django.core.urlresolvers import resolve, get_script_prefix
from django.utils.encoding import force_str
from django.shortcuts import resolve_url
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.http import HttpResponseNotFound
from dj... | apache-2.0 | 202,406,622,099,669,630 | 44.849315 | 103 | 0.603824 | false | 4.566166 | false | false | false |
jamiepg1/clojurehelper | setup.py | 1 | 1132 | from subprocess import call
from distutils.core import setup
from distutils.command.build import build
class build_lein_xml(build):
def run(self):
print "Building lein xml"
call('./build-lein-xml', shell=True)
build.run(self)
setup(
name='clojurehelper',
version='0.2',
script... | mit | -3,171,557,891,851,203,000 | 30.444444 | 78 | 0.617491 | false | 3.409639 | false | false | false |
uogbuji/akara | lib/resource/web.py | 1 | 3263 | #Useful: http://docs.python.org/library/wsgiref.html
#
import httplib
import sqlite3
from datetime import datetime
from wsgiref.util import shift_path_info, request_uri
from string import Template
from cStringIO import StringIO
from akara.resource import *
from akara.resource.repository import driver
from akara.resour... | apache-2.0 | -8,775,797,675,565,607,000 | 28.396396 | 82 | 0.609562 | false | 3.843345 | false | false | false |
adamfisk/littleshoot-client | server/appengine/littleshoot/jsonpickle/__init__.py | 1 | 2991 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2008 John Paulett (john -at- 7oars.com)
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
"""Python library for serializing any arbitrary object graph into JSON
>>> i... | gpl-2.0 | -2,917,782,080,440,255,000 | 24.945946 | 104 | 0.646606 | false | 3.603614 | false | false | false |
CS2014/USM | usm/communications/migrations/0001_initial.py | 1 | 8519 | # -*- 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 'TextMessage'
db.create_table(u'communications_textmessage... | mit | 5,974,675,831,424,042,000 | 66.619048 | 195 | 0.568963 | false | 3.61434 | false | false | false |
RussianOtter/networking | RoAIRC.py | 1 | 2810 | import sys, time, threading, RoA, string, random, socket
from random import randint
from binascii import hexlify
import DH
Ro = RoA.RoA(False)
port = 50000
key = "savsecro"*4
user = "[%s] " %raw_input("Username: ")
try:
socket.setdefaulttimeout(2)
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.conn... | gpl-3.0 | 7,521,344,470,537,331,000 | 23.867257 | 112 | 0.6 | false | 2.473592 | false | false | false |
gvanderheide/discreteMarkovChain | setup.py | 1 | 1495 | """A setuptools based setup module.
See:
https://packaging.python.org/en/latest/distributing.html
https://github.com/pypa/sampleproject
"""
from setuptools import setup, find_packages
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'READ... | mit | 773,850,345,115,588,600 | 31.977273 | 67 | 0.637458 | false | 3.997326 | false | true | false |
weaselkeeper/utils | AWS-utils/instance-report.py | 1 | 8003 | #!/usr/bin/env python
# vim: set expandtab:
# with thanks to https://github.com/bpennypacker/ec2-check-reserved-instances.git
# For the initial idea, and an idea of how to do this.
PROJECTNAME = 'ec2-check-reserved-instances'
import os
import sys
import ConfigParser
import logging
import boto
import boto.ec2
from p... | gpl-2.0 | 5,559,435,648,501,981,000 | 35.711009 | 154 | 0.591403 | false | 3.919197 | false | false | false |
itissid/gv | pygerrit/gerrit_api.py | 1 | 4985 | import os
import urlparse
import json
import vim
import requests
from requests.auth import HTTPDigestAuth
from pygerrit.salting import check_hash, AuthObject
# Until I can get the kerberos auth figured out,
# I made a SSH Tunnel and just do all the things I want to.
XSSI_STRING = ")]}'"
PROJECT_JSON_KEY = 'project'
B... | gpl-2.0 | -2,036,446,997,875,048,700 | 32.911565 | 87 | 0.694283 | false | 3.052664 | false | false | false |
utn-frm-si/reservas | reservas/settings/base.py | 1 | 4810 | # coding=utf-8
"""
Django settings for reservas project.
Generated by 'django-admin startproject' using Django 1.8.5.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
... | mit | 2,310,515,445,167,360,000 | 27.921687 | 98 | 0.684857 | false | 3.29739 | false | false | false |
stmobo/Machine-Learning | generative-waifu-network/discriminator_network.py | 1 | 7668 | import tensorflow as tf
import tensorflow.contrib.slim as slim
import numpy as np
import selu
from common import *
def discriminator_parameters(parser):
group = parser.add_argument_group('Discriminator Network Parameters', description='These parameters control the structure of the discriminator / critic network.'... | mit | -7,778,606,382,283,700,000 | 48.792208 | 168 | 0.64254 | false | 3.417112 | false | false | false |
letsmeet-click/letsmeet.click | letsmeet/tests/test_home.py | 1 | 1580 | generic_menu_items = [
'Home', 'All Communities', 'Contact', 'About/FAQ', 'Legal/Contact',
]
logged_out_menu_items = ['Login']
logged_in_menu_items = ['Logout']
advertisements = [
'No registration required',
'Organize your event attendees',
'Use your existing communication channels',
'It\'s free... | mit | 5,441,017,305,872,724,000 | 25.779661 | 71 | 0.672785 | false | 3.691589 | false | false | false |
glumu/django-redis-cluster | django_redis_cluster/cache.py | 1 | 4615 | #coding:utf8
import functools
import logging
from django.conf import settings
from django.core.cache.backends.base import BaseCache
from .utils import load_class
from .exceptions import ConnectionInterrupted
# 错误异常配置
DJANGO_REDIS_CLUSTER_IGNORE_EXCEPTIONS = getattr(settings, 'DJANGO_REDIS_CLUSTER_IGNORE_EXCEPTIONS'... | bsd-3-clause | 1,818,026,592,783,556,900 | 26.793939 | 117 | 0.604144 | false | 3.862679 | false | false | false |
ktarrant/options_csv | heatmap.py | 1 | 3194 | import plotly.plotly as py
import plotly.graph_objs as go
from options_csv import OUTPUT_FILENAME_PREFIX_FORMAT
import re
import os
import pandas as pd
def build_heatmap(openInt_df):
trace = go.Heatmap(z=openInt_df.fillna(0).as_matrix(),
x=openInt_df.columns,
y=openInt... | mit | 7,383,383,247,199,349,000 | 36.576471 | 194 | 0.520977 | false | 3.521499 | false | false | false |
exaroth/subrosa | subrosa/models/UserImagesModel.py | 1 | 2702 | # -*- coding: utf-8 -*-
"""
subrosa.models.ArticlesModel
=========================
Implements model and methods related to subrosa images
:copyright: (c) 2014 by Konrad Wasowicz
:license: MIT, see LICENSE for details.
"""
import datetime
from peewee import *
from subrosa.models.BaseModel impo... | gpl-3.0 | -7,331,649,137,862,401,000 | 26.55102 | 79 | 0.584815 | false | 4.147465 | false | false | false |
jlindenger/python-http-client | setup.py | 1 | 1244 | import sys
import os
from setuptools import setup
long_description = 'Please see our GitHub README'
if os.path.exists('README.txt'):
long_description = open('README.txt').read()
def getRequires():
deps = []
if (2, 6) <= sys.version_info < (2, 7):
deps.append('unittest2')
return deps
base_url ... | mit | -5,175,553,856,241,423,000 | 28.619048 | 79 | 0.614148 | false | 3.724551 | false | false | false |
rubennj/persistence | persistence.py | 1 | 9060 | # -*- coding: utf-8 -*-
"""
Created on Tue Jan 10 20:09:35 2017
@author: ruben
"""
import os
from functools import wraps
import pandas as pd
def persist_timeseries_to_file(filename_cache=None):
"""
Persits a Pandas DataFrame object returned by a function into cache file
using a decorator, s... | mit | -3,302,659,504,509,129,700 | 37.920705 | 93 | 0.528918 | false | 5.022173 | false | false | false |
mansonul/events | events/contrib/plugins/form_elements/fields/date_drop_down/base.py | 1 | 2604 | from __future__ import absolute_import
from django.forms.extras.widgets import SelectDateWidget
from django.forms.fields import DateField
from django.utils.translation import ugettext_lazy as _
from fobi.base import FormFieldPlugin, get_theme
from . import UID
from .forms import DateDropDownInputForm
__title__ = 'f... | mit | 6,885,615,648,063,343,000 | 32.384615 | 76 | 0.610983 | false | 3.773913 | false | false | false |
myt00seven/svrg | svrg_bn/draw_4_bndecay_smaller.py | 1 | 15643 | # This is used to draw three comparisons for SGD+BN, SVRG+BN and Streaming SVRG +BN
import matplotlib
import matplotlib.pyplot as plt
plt.switch_backend('agg')
import pylab
import numpy as np
import sys
# all the methods are with BN layers!!!
def deminish(a) :
end_factor=0.4
length = len(a)
for i in ... | mit | 5,457,736,702,800,827,000 | 43.189266 | 118 | 0.691364 | false | 2.453419 | true | false | false |
brachyprint/brachyprint | src/mesh/core/face.py | 1 | 4852 |
# Brachyprint -- 3D printing brachytherapy moulds
# Copyright (C) 2013-14 James Cranch, Martin Green and Oliver Madge
#
# 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 ve... | gpl-2.0 | 8,073,912,645,110,784,000 | 36.038168 | 159 | 0.566983 | false | 3.424135 | false | false | false |
Idealcoder/Magic-Wand | lib/wand.py | 1 | 1933 | import time
import RPi.GPIO as GPIO
from lib.font import loadFont
class wand():
#================================================ GLOBALS ===================================
font = loadFont()
delay = 0 #Delay per line when writing
#================================================= FUNCTIONS ================... | mit | -973,664,377,961,744,900 | 20.01087 | 98 | 0.585618 | false | 2.863704 | false | false | false |
linuxdeepin/deepin-ui | dtk/ui/volume_button.py | 1 | 23225 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2012 Deepin, Inc.
# 2012 Hailong Qiu
#
# Author: Hailong Qiu <356752238@qq.com>
# Maintainer: Hailong Qiu <356752238@qq.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General ... | gpl-3.0 | -3,288,997,962,322,264,000 | 40.504472 | 180 | 0.571139 | false | 3.665245 | false | false | false |
zkota/pyblio-1.3 | Legacy/GnomeUI/Document.py | 1 | 39739 | # -*- coding: utf-8 -*-
#
# This file is part of pybliographer
#
# Copyright (C) 1998-2004 Frederic GOBRY
# Email : gobry@pybliographer.org
#
# 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... | gpl-2.0 | -7,044,868,091,550,441,000 | 31.671875 | 163 | 0.524176 | false | 4.025636 | false | false | false |
IEEE-NITK/SummerProjects17 | Competitive-Coding/Assignment-2/Priyam/DFS.py | 1 | 1889 | class Vertex:
def __init__(self, n):
self.name = n
self.neighbors = list()
self.discovery = 0
self.finish = 0
self.color = 'black'
def add_neighbor(self, v):
if v not in self.neighbors:
self.neighbors.append(v)
self.neighbors.sort()
cla... | mit | 7,833,423,528,937,795,000 | 24.540541 | 113 | 0.523557 | false | 3.682261 | false | false | false |
stscieisenhamer/ginga | ginga/examples/gtk/example2_gtk.py | 1 | 8631 | #! /usr/bin/env python
#
# example2_gtk.py -- Simple, configurable FITS viewer.
#
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
from __future__ import print_function
import sys, os
import logging, logging.handlers
from ginga import AstroImage
from ginga.g... | bsd-3-clause | 7,025,757,477,024,090,000 | 29.715302 | 100 | 0.579771 | false | 3.594752 | false | false | false |
rcosnita/fantastico | fantastico/contrib/dynamic_menu/models/menus.py | 1 | 3240 | '''
Copyright 2013 Cosnita Radu Viorel
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute... | mit | -8,364,358,867,303,549,000 | 42.783784 | 126 | 0.723765 | false | 4.314248 | false | false | false |
ddietze/pyFSRS | core/FilePickerCtrl.py | 1 | 5078 | """
.. module: FilePickerCtrl
:platform: Windows
.. moduleauthor:: Daniel R. Dietze <daniel.dietze@berkeley.edu>
A simple file and path picker widget consisting of a text field and a button.
..
This file is part of the pyFSRS app.
This program is free software: you can redistribute it and/or modif... | gpl-3.0 | -5,094,602,708,831,065,000 | 30.551282 | 101 | 0.589011 | false | 3.930341 | false | false | false |
flashdagger/commandeur | commandeur/cmdtools.py | 1 | 1552 | """
Module docstring
"""
from collections import defaultdict
import re
def parse_doc_arg(line):
"""
parse a section of argument annotations
returns a dict with all values found
"""
assert isinstance(line, str)
info = dict()
pattern = re.compile(r"(.*?)(?:\((.*)\))?\s*:((?:.*\n?.+)+)... | mit | -2,259,209,158,375,754,200 | 21.171429 | 68 | 0.541237 | false | 4.10582 | false | false | false |
Tehsmash/networking-cisco | networking_cisco/plugins/ml2/drivers/cisco/nexus/constants.py | 1 | 1927 | # Copyright (c) 2011-2016 Cisco Systems, Inc.
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unl... | apache-2.0 | -4,350,822,669,582,887,400 | 23.392405 | 78 | 0.71562 | false | 2.69888 | false | false | false |
w0pke/oppgavegenerator | oppgavegen/views/game_views.py | 1 | 7835 | from django.contrib.auth.decorators import login_required
from django.shortcuts import render_to_response, redirect
from django.http import HttpResponseForbidden
from django.template import RequestContext
from oppgavegen.generation_folder.generation import generate_level
from oppgavegen.view_logic.rating import *
from... | bsd-3-clause | 2,966,183,766,129,237,500 | 44.017241 | 120 | 0.607635 | false | 3.882995 | false | false | false |
sebastianwebber/pgconfig-api | common/bytes.py | 1 | 3943 | #!/usr/bin/env python
import math
"""
Bytes-to-human / human-to-bytes converter.
Based on: http://goo.gl/kTQMs
Working with Python 2.x and 3.x.
Author: Giampaolo Rodola' <g.rodola [AT] gmail [DOT] com>
License: MIT
"""
# see: http://goo.gl/kTQMs
SYMBOLS = {
'customary' : ('B', 'KB', 'MB', 'GB', 'TB', 'PB', ... | bsd-2-clause | 5,092,341,793,858,649,000 | 26.774648 | 78 | 0.516104 | false | 3.012223 | false | false | false |
openstack/zaqar | zaqar/transport/validation.py | 1 | 29503 | # Copyright (c) 2013 Rackspace, Inc.
# Copyright (c) 2015 Catalyst IT Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | apache-2.0 | 3,048,376,038,165,915,600 | 40.729844 | 79 | 0.574789 | false | 4.348909 | false | false | false |
FabriceSalvaire/Musica | Musica/MusicXML/Pyxb/_xlink.py | 1 | 5773 | # ./_xlink.py
# -*- coding: utf-8 -*-
# PyXB bindings for NM:b43cd366527ddb6a0e58594876e07421e0148f30
# Generated 2017-10-09 18:48:41.313719 by PyXB version 1.2.6 using Python 3.6.2.final.0
# Namespace http://www.w3.org/1999/xlink [xmlns:xlink]
from __future__ import unicode_literals
import pyxb
from pyxb.binding.data... | gpl-3.0 | -5,277,354,413,599,819,000 | 46.319672 | 109 | 0.774467 | false | 3.323546 | false | false | false |
Wiredcraft/maestro-ng | maestro/lifecycle.py | 1 | 6661 | # Copyright (C) 2014 SignalFuse, Inc.
#
# Docker container orchestration utility.
import socket
import subprocess
import time
import requests
import re
from . import exceptions
class BaseLifecycleHelper:
"""Base class for lifecycle helpers."""
def test(self):
"""State helpers must implement this me... | lgpl-3.0 | 8,331,319,784,645,058,000 | 28.604444 | 79 | 0.556823 | false | 4.356442 | true | false | false |
TopherGopher/aws-infra.jenkins-scripts | jenkins-callback-wrapper.py | 1 | 3552 | #!/usr/bin/python
#from jenkinsapi.jenkins import Jenkins
#from jenkinsapi.custom_exceptions import JenkinsAPIException
#from jenkinsapi.constants import STATUS_SUCCESS
import jenkins
import jenkinspoll
import click
import os
import requests
@click.command()
@click.option('--jenkins-url', help="The URL of the Jenkins ... | mit | -7,938,456,413,074,036,000 | 48.347222 | 168 | 0.653435 | false | 3.869281 | false | false | false |
cvxgrp/cvxpylayers | cvxpylayers/tensorflow/cvxpylayer.py | 1 | 12651 | import cvxpy as cp
from cvxpy.reductions.solvers.conic_solvers.scs_conif import \
dims_to_solver_dict
import diffcp
import numpy as np
try:
import tensorflow as tf
except ImportError:
raise ImportError("Unable to import tensorflow. Please install "
"TensorFlow >= 2.0 (https://tensorfl... | apache-2.0 | -8,604,243,101,993,928,000 | 41.311037 | 79 | 0.539957 | false | 4.017466 | false | false | false |
evilhero/mylar | lib/comictaggerlib/autotagmatchwindow.py | 1 | 8516 | """A PyQT4 dialog to select from automated issue matches"""
# Copyright 2012-2014 Anthony Beville
# 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... | gpl-3.0 | -8,156,623,721,833,608,000 | 33.759184 | 80 | 0.62776 | false | 3.915402 | false | false | false |
xen0n/moehime | moehime/saimoe/datasource/livedoor_thread.py | 1 | 3107 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# moehime / saimoe / data source - livedoor - thread
#
# Copyright (C) 2012 Wang Xuerui <idontknw.wang@gmail.com>
#
# This file is part of moehime.
#
# moehime is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License ... | agpl-3.0 | -5,313,366,697,778,717,000 | 29.373737 | 77 | 0.597938 | false | 3.106405 | false | false | false |
pgjones/flake8-sql | flake8_sql/parser.py | 1 | 3054 | from typing import Any, Generator, List, Tuple
import sqlparse
from .keywords import ROOT_KEYWORDS
class Token:
def __init__(self, token: sqlparse.sql.Token, row: int, col: int, depth: int) -> None:
self._token = token
self.row = row
self.col = col
self.depth = depth
@prope... | mit | 4,637,596,389,222,792,000 | 29.54 | 95 | 0.584152 | false | 3.966234 | false | false | false |
yunohost-bot/apps | list_builder.py | 1 | 11421 | #!/usr/bin/env python2
import re
import os
import sys
import time
import json
import zlib
import argparse
import requests
from dateutil.parser import parse
# Regular expression patterns
re_commit_author = re.compile(
r'^author (?P<name>.+) <(?P<email>.+)> (?P<time>\d+) (?P<tz>[+-]\d+)$',
re.MULTILINE
)
# ... | gpl-3.0 | -4,528,834,335,519,708,700 | 33.504532 | 136 | 0.57762 | false | 3.783041 | false | false | false |
osrf/osrf_hw | kicad_scripts/check_component_availability.py | 1 | 1943 | #!/usr/bin/env python
from __future__ import print_function
import csv
import os
import sys
import urllib2
def import_csv(filename):
if not os.path.isfile(filename):
print('pinfile not found')
return
with open(filename, mode='r') as infile:
reader = csv.reader(infile)
part_dict... | apache-2.0 | 1,384,212,045,585,071,900 | 29.84127 | 74 | 0.587751 | false | 3.432862 | false | false | false |
jgamblin/btrecon | btrecon.py | 1 | 1501 |
#!/usr/bin/env python
# Name: btrecon.py
# Purpose: Bluetooth Scanner
# By: Jerry Gamblin
# Date: 02.11.15
# Modified 02.11.15
# Rev Level 0.5
# -----------------------------------------------
import os
import re
import time
import sys
import subprocess
import readline
def color(text, color_code):
... | mit | -6,145,480,689,312,573,000 | 20.753623 | 95 | 0.623584 | false | 2.709386 | false | false | false |
CGATOxford/CGATPipelines | CGATPipelines/PipelineWindows.py | 1 | 39870 | '''PipelineWindows - Tasks for window based read distribution analysis
======================================================================
Requirements:
* bedtools >= 2.21.0
* picardtools >= 1.106
* samtools >= 1.1
* MEDIPS >= 1.15.0
Reference
---------
'''
import os
import re
import collections
import pandas
i... | mit | -5,619,507,310,090,360,000 | 29.319392 | 82 | 0.561073 | false | 3.845857 | false | false | false |
greatmazinger/programming-interview-code | Python/no_repeating_digits.py | 1 | 1460 | import unittest
from collections import Counter
"""
No repeating digits problem:
Examples:
"""
limit = 98765432100
def no_repeating_digits(num):
num_str = str(num)
c = Counter(list(num_str))
most_common = c.most_common(1)
return most_common[0][1] == 1
def count_non_repeating_numbers(low, high)... | gpl-2.0 | -1,023,518,888,930,635,300 | 26.037037 | 109 | 0.559589 | false | 3.782383 | true | false | false |
gregreen/bayestar | scripts/compareColors.py | 1 | 10545 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# compareColors.py
#
# Copyright 2013 Greg Green <greg@greg-UX31A>
#
# 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 ... | gpl-2.0 | 327,697,341,319,020,540 | 28.704225 | 92 | 0.597345 | false | 2.611441 | false | false | false |
datawire/telepresence | ci/clean-cluster.py | 1 | 3179 | #!/usr/bin/env python3
"""
Delete old deployments and services with test-prefixed names. This is used to
clean up the Telepresence test cluster, as Telepresence tests currently leak.
"""
import argparse
import json
from datetime import datetime, timedelta, timezone
from subprocess import check_output, run
from typing ... | apache-2.0 | 619,881,604,613,905,700 | 26.643478 | 79 | 0.60648 | false | 3.872107 | false | false | false |
OpenTechFund/WebApp | opentech/public/projects/migrations/0002_projectfunding.py | 1 | 1302 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.8 on 2018-01-15 17:12
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import modelcluster.fields
class Migration(migrations.Migration):
dependencies = [
('wagtailcore', '0040_page_draft_t... | gpl-2.0 | -5,559,156,850,558,860,000 | 37.294118 | 154 | 0.593702 | false | 4.398649 | false | false | false |
nikcub/Sketch | sketch/util/gae.py | 1 | 2267 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim:ts=2:sw=2:expandtab
#
# Copyright (c) 2010-2011, Nik Cubrilovic. All rights reserved.
#
# <nikcub@gmail.com> <http://nikcub.appspot.com>
#
# Licensed under a BSD license. You may obtain a copy of the License at
#
# http://nikcub.appspot.com/bsd-license
#
"""
S... | bsd-2-clause | -1,236,930,795,368,294,700 | 29.24 | 148 | 0.698721 | false | 3.338733 | false | false | false |
ToonTownInfiniteRepo/ToontownInfinite | otp/ai/AIMsgTypes.py | 1 | 3083 | from otp.distributed.OtpDoGlobals import *
from direct.showbase.PythonUtil import invertDictLossless
OTP_SERVER_ROOT_DO_ID = 4007
CHANNEL_CLIENT_BROADCAST = 4014
BAD_CHANNEL_ID = 0
BAD_ZONE_ID = 0
BAD_DO_ID = 0
CONTROL_MESSAGE = 4001
CONTROL_SET_CHANNEL = 2001
CONTROL_REMOVE_CHANNEL = 2002
CONTROL_SET_CON_NAME = 2004
C... | mit | 8,465,867,581,276,243,000 | 37.5375 | 66 | 0.758028 | false | 2.713908 | false | false | false |
OpenBMP/openbmp-python-api-message | src/openbmp/api/parsed/message/UnicastPrefix.py | 1 | 5938 |
"""
Copyright (c) 2015-2016 Cisco Systems, Inc. and others. All rights reserved.
This program and the accompanying materials are made available under the
terms of the Eclipse Public License v1.0 which accompanies this distribution,
and is available at http:#www.eclipse.org/legal/epl-v10.html
"""
from ... | epl-1.0 | -5,826,643,891,727,278,000 | 36.1125 | 113 | 0.582688 | false | 3.901445 | false | false | false |
pyrocko/pyrocko | src/guts.py | 1 | 64588 | # -*- coding: utf-8 -*-
# http://pyrocko.org - GPLv3
#
# The Pyrocko Developers, 21st Century
# ---|P------/S----------~Lg----------
'''Lightweight declarative YAML and XML data binding for Python.'''
from __future__ import absolute_import, print_function
import datetime
import calendar
import re
import sys
import typ... | gpl-3.0 | 227,704,453,569,894,140 | 27.204367 | 79 | 0.520422 | false | 3.875202 | false | false | false |
Tanjay94/auxiclean | auxiclean/unittests/test_distributeur.py | 1 | 1987 | import unittest
import tempfile
import os
from auxiclean import Distributeur
class TestBase(unittest.TestCase):
# Cours (nom),Cours (code),Dispo,Programme
cours = {}
# Nom,Premier Choix,Deuxieme Choix,Troisieme Choix,Quatrieme Choix,
# Cinquieme Choix,Disponibilite,Tp_total,Schoplarite,Nobel,
# Pr... | mit | 1,499,030,532,619,302,700 | 35.796296 | 76 | 0.529945 | false | 3.367797 | true | false | false |
wkentaro/fcn | examples/voc/train_fcn16s.py | 1 | 2034 | #!/usr/bin/env python
import argparse
import datetime
import os
import os.path as osp
os.environ['MPLBACKEND'] = 'Agg' # NOQA
import chainer
import fcn
from train_fcn32s import get_data
from train_fcn32s import get_trainer
here = osp.dirname(osp.abspath(__file__))
def main():
parser = argparse.ArgumentPars... | mit | 2,136,855,453,675,468,800 | 26.12 | 78 | 0.648476 | false | 3.178125 | false | false | false |
ADEQUATeDQ/portalmonitor | odpw/utils/error_handling.py | 1 | 3597 | import traceback
from ast import literal_eval
from collections import defaultdict
import ckanapi
import exceptions
import requests
import urlnorm
import structlog
log =structlog.get_logger()
class TimeoutError(Exception):
def __init__(self, message, timeout):
# Call the base class constructor with the... | gpl-3.0 | -7,502,333,142,481,159,000 | 25.651852 | 92 | 0.591882 | false | 4.129736 | false | false | false |
tiancj/emesene | emesene/e3/papylib/papyon/papyon/msnp/notification.py | 1 | 39205 | # -*- coding: utf-8 -*-
#
# papyon - a python client library for Msn
#
# Copyright (C) 2005-2007 Ali Sabil <ali.sabil@gmail.com>
# Copyright (C) 2005-2006 Ole André Vadla Ravnås <oleavr@gmail.com>
# Copyright (C) 2007 Johann Prieur <johann.prieur@gmail.com>
#
# This program is free software; you can redistribute it and... | gpl-3.0 | 9,134,599,020,062,534,000 | 40.572641 | 95 | 0.563375 | false | 4.029914 | false | false | false |
olivierfriard/BORIS | boris/portion/dict.py | 1 | 11282 | from .const import Bound
from .interval import Interval, singleton
from collections.abc import MutableMapping, Mapping
from sortedcontainers import SortedDict
def _sort(i):
# Sort by lower bound, closed first
return (i[0].lower, i[0].left is Bound.OPEN)
class IntervalDict(MutableMapping):
"""
An I... | gpl-3.0 | -2,896,345,402,922,807,000 | 29.909589 | 89 | 0.564528 | false | 4.412202 | false | false | false |
larbibaraka/Bitly_clone | bitly_clone/bitly__clone_app/migrations/0001_initial.py | 1 | 1048 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-02-07 21:10
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='UrlSho... | gpl-3.0 | -7,644,237,825,253,766,000 | 36.428571 | 117 | 0.59542 | false | 4.030769 | false | false | false |
Fredehagelund92/Cheetax | cheetax/run_manager.py | 1 | 1120 |
from cheetax.exceptions import RuntimeException
class RunManager(object):
"""
RunManager is responsible for handling runners
based on its status.
"""
def __init__(self):
self.runners = []
self.total_time = 0
@property
def num_runners(self):
return len(self.runners)... | apache-2.0 | 5,339,509,767,290,848,000 | 22.333333 | 75 | 0.609821 | false | 4.087591 | false | false | false |
openhealthcare/sonar | innovation/projectmigrations/profiles/0004_remove_pseudonym.py | 1 | 5119 | # -*- coding: 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):
# Deleting field 'Profile.is_pseudonymous'
db.delete_column('profiles_profile', 'is_pseudonymous')
... | gpl-2.0 | -2,631,759,668,109,640,700 | 59.952381 | 182 | 0.556163 | false | 3.758443 | false | false | false |
ewels/MultiQC | multiqc/modules/deeptools/plotPCA.py | 1 | 2743 | #!/usr/bin/env python
""" MultiQC submodule to parse output from deepTools plotPCA """
import logging
from multiqc.plots import scatter
# Initialise the logger
log = logging.getLogger(__name__)
class plotPCAMixin:
def parse_plotPCA(self):
"""Find plotPCA output"""
self.deeptools_plotPCAData = ... | gpl-3.0 | -5,186,901,610,799,465,000 | 34.623377 | 140 | 0.487423 | false | 4.039764 | false | false | false |
stpierre/sponge | Sponge/sponge/forms/config.py | 1 | 1627 | from django import forms
from django.forms import widgets
from sponge.utils import config as config_utils
from sponge.utils import group as group_utils
class ConfigForm(forms.Form):
scheduler_username = forms.CharField(help_text="The username of a Pulp user who can modify all sync schedules. Granting 'read' and 'u... | gpl-2.0 | 8,748,941,539,162,094,000 | 53.233333 | 187 | 0.590658 | false | 4.622159 | true | false | false |
jabooth/menpodetect | menpodetect/tests/dlib_test.py | 2 | 1037 | from menpodetect.dlib import load_dlib_frontal_face_detector
import menpo.io as mio
takeo = mio.import_builtin_asset.takeo_ppm()
def test_frontal_face_detector():
takeo_copy = takeo.copy()
dlib_detector = load_dlib_frontal_face_detector()
pcs = dlib_detector(takeo_copy)
assert len(pcs) == 1
asser... | bsd-3-clause | -1,552,435,256,788,413,000 | 31.40625 | 60 | 0.684667 | false | 2.825613 | false | false | false |
moonfruit/yysite | polls/migrations/0001_initial.py | 1 | 1230 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2016-11-28 14:58
from __future__ import unicode_literals
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.Crea... | mit | 8,369,215,854,529,492,000 | 31.368421 | 114 | 0.569919 | false | 4.34629 | false | false | false |
watchdogpolska/django-mptt | setup.py | 1 | 1475 | #!/usr/bin/env python
from setuptools import find_packages, setup
setup(
name='django-mptt',
description='''Utilities for implementing Modified Preorder Tree Traversal
with your Django Models and working with trees of Model instances.''',
version=__import__('mptt').__version__,
author='Craig ... | mit | -2,403,173,726,046,439,400 | 33.302326 | 78 | 0.595932 | false | 4.325513 | false | false | false |
thenenadx/forseti-security | google/cloud/security/common/data_access/org_resource_rel_dao.py | 1 | 3106 | # Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | apache-2.0 | -3,991,928,533,554,824,700 | 35.116279 | 75 | 0.613973 | false | 4.691843 | false | false | false |
industrydive/mezzanine | mezzanine/generic/forms.py | 1 | 9451 | from __future__ import unicode_literals
from future.builtins import int, str, zip
from django import forms
from django_comments.forms import CommentSecurityForm, CommentForm
from django_comments.signals import comment_was_posted
from django.contrib.admin.templatetags.admin_static import static
from django.utils.safest... | bsd-2-clause | 398,190,695,416,197,300 | 40.091304 | 78 | 0.596022 | false | 4.412232 | false | false | false |
jmb/geopy | geopy/geocoders/tomtom.py | 1 | 7727 | from geopy.compat import quote, urlencode
from geopy.geocoders.base import DEFAULT_SENTINEL, Geocoder
from geopy.location import Location
from geopy.util import logger
__all__ = ("TomTom", )
class TomTom(Geocoder):
"""TomTom geocoder.
Documentation at:
https://developer.tomtom.com/search-api/search-... | mit | 1,211,560,324,719,296,800 | 34.122727 | 102 | 0.588068 | false | 4.285635 | false | false | false |
felixsch/trollolo | scripts/graph.py | 1 | 4099 | #!/usr/bin/env python
class Graph:
"Plot various graphs into burndown chart"
def __init__ (self, graph_data):
self.getGraphData(graph_data)
def getGraphData(self, graph_data):
self.x = graph_data['x']
self.y = graph_data['y']
self.xy_extra = 0
self.ymin = graph_data['ymin']
self.ymax = ... | gpl-3.0 | 1,062,859,525,571,218,000 | 34.336207 | 121 | 0.634545 | false | 3.131398 | false | false | false |
kernsuite-debian/lofar | LCS/MessageBus/src/noqpidfallback.py | 1 | 1097 | #!/usr/bin/env python3
import sys
print("QPID support NOT enabled! Will NOT connect to any broker, and messages will be lost!")
"""
Exceptions.
"""
class ProtonException(Exception):
pass
class SessionError(Exception):
pass
class Timeout(Exception):
pass
"""
Messages.
"""
class Message(object):
def ... | gpl-3.0 | 1,013,217,743,745,717,100 | 14.027397 | 93 | 0.654512 | false | 3.584967 | false | false | false |
cyberdelia/metrology | metrology/reporter/logger.py | 1 | 3203 | import logging
from metrology.instruments import (
Counter,
Gauge,
Histogram,
Meter,
Timer,
UtilizationTimer
)
from metrology.reporter.base import Reporter
class LoggerReporter(Reporter):
"""
A logging reporter that write metrics to a logger ::
reporter = LoggerReporter(level=l... | mit | -4,748,470,296,817,511,000 | 33.815217 | 75 | 0.505151 | false | 4.375683 | false | false | false |
YoungKwonJo/mlxtend | tests/tests_classifier/test_ensembleclassifier.py | 1 | 2352 | import numpy as np
from mlxtend.classifier import EnsembleClassifier
from sklearn.grid_search import GridSearchCV
from sklearn import cross_validation
from sklearn.linear_model import LogisticRegression
from sklearn.naive_bayes import GaussianNB
from sklearn.ensemble import RandomForestClassifier
import numpy as np
f... | bsd-3-clause | 1,804,529,685,603,916,500 | 30.783784 | 87 | 0.690051 | false | 3.37931 | false | false | false |
danakj/chromium | build/android/method_count.py | 1 | 3994 | #! /usr/bin/env python
# Copyright 2015 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 argparse
import collections
import os
import re
import shutil
import sys
import tempfile
import zipfile
import devil_chromium
... | bsd-3-clause | -6,493,615,248,931,155,000 | 29.96124 | 80 | 0.623185 | false | 3.284539 | false | false | false |
dominicrodger/tinyblog | tests/utils.py | 1 | 1274 | from datetime import datetime
import django
from django.core.management import call_command
import factory
from StringIO import StringIO
import sys
from tinyblog.models import Post, EmailSubscriber
class PostFactory(factory.Factory):
FACTORY_FOR = Post
title = factory.Sequence(lambda n: 'Post %s' % n)
sl... | bsd-3-clause | -1,978,692,103,374,146,600 | 22.163636 | 68 | 0.666405 | false | 3.714286 | false | false | false |
digitalocean/netbox | netbox/tenancy/forms.py | 1 | 3588 | from django import forms
from extras.forms import (
AddRemoveTagsForm, CustomFieldModelForm, CustomFieldBulkEditForm, CustomFieldFilterForm, CustomFieldModelCSVForm,
)
from extras.models import Tag
from utilities.forms import (
BootstrapMixin, CommentField, CSVModelChoiceField, CSVModelForm, DynamicModelChoice... | apache-2.0 | 2,559,112,276,505,185,000 | 22.761589 | 117 | 0.632664 | false | 4.054237 | false | false | false |
TAMU-CPT/galaxy-tools | tools/fasta/fasta_dedup.py | 1 | 1258 | #!/usr/bin/env python
import logging
import copy
import argparse
import StringIO
import hashlib
from Bio import SeqIO
logging.basicConfig(level=logging.INFO)
def dedup(fasta_file, mutation="mutate"):
records = list(SeqIO.parse(fasta_file, "fasta"))
output = StringIO.StringIO()
known_records = {}
ord... | gpl-3.0 | -5,770,532,780,688,824,000 | 27.590909 | 85 | 0.617647 | false | 3.656977 | false | false | false |
FenuaTabu/efenua | actions.py | 1 | 1708 | import csv
from django.http import HttpResponse
from django.utils.translation import ugettext_lazy as _
from efenua.decorators import action
def make_export_as_csv(fields=None, exclude=None, header=True):
"""
This function returns an export csv action
'fields' and 'exclude' work like in django Mo... | gpl-3.0 | 82,911,949,500,981,570 | 35.130435 | 109 | 0.604801 | false | 4.248756 | false | false | false |
berkmancenter/mediacloud | apps/topics-base/tests/python/topics_base/test_messages.py | 1 | 1355 | from topics_base.messages import TopicSpiderUpdateMessage
def test_topic_spider_update_email():
topic_name = 'Foo Bar Baz & <script></script>'
topic_url = 'https://topics.com/topic?ab=cd&ef=gh'
topic_spider_status = 'Abc def & <script></script>'
message = TopicSpiderUpdateMessage(
to='nowhere... | agpl-3.0 | 1,322,631,432,139,391,200 | 35.621622 | 81 | 0.695203 | false | 3.54712 | false | false | false |
joebullard/slack-doorbell-camera | main.py | 1 | 2043 | import argparse
import sys
import time
from doorbell import SlackDoorbell
from ringer import FaceDetectionDoorbellRinger
from visionapi import VisionAPIClient
def parse_args(argv):
parser = argparse.ArgumentParser()
parser.add_argument(
'--motion-output-dir',
required=True,
type=str,
... | gpl-3.0 | -4,388,402,259,583,009,300 | 26.608108 | 72 | 0.619677 | false | 3.891429 | false | false | false |
periscope-ps/unis | periscope/handlers/datahandler.py | 1 | 4785 | # =============================================================================
# periscope-ps (unis)
#
# Copyright (c) 2012-2016, Trustees of Indiana University,
# All rights reserved.
#
# This software may be modified and distributed under the terms of the BSD
# license. See the COPYING file for details.
#
# T... | bsd-3-clause | -5,861,323,693,186,295,000 | 38.221311 | 132 | 0.55674 | false | 4.279964 | false | false | false |
NervanaSystems/ngraph | test/ref_generators/generate_convolution_ref.py | 1 | 19772 | #!/usr/bin/env python
# ******************************************************************************
# Copyright 2017-2020 Intel Corporation
#
# 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
... | apache-2.0 | 1,861,128,612,188,194,300 | 43.133929 | 166 | 0.507789 | false | 3.008979 | true | false | false |
hovo1990/deviser | generator/cmake_files/CMakeFiles.py | 1 | 4088 | #!/usr/bin/env python
#
# @file CMakeFiles.py
# @brief class for generating the cmake files
# @author Frank Bergmann
# @author Sarah Keating
#
# <!--------------------------------------------------------------------------
#
# Copyright (c) 2013-2015 by the California Institute of Technology
# (California, USA), ... | lgpl-2.1 | -6,793,863,203,549,932,000 | 38.699029 | 78 | 0.640411 | false | 4.146045 | false | false | false |
magenta/magenta | magenta/pipelines/statistics.py | 1 | 8973 | # Copyright 2021 The Magenta Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | apache-2.0 | 4,317,756,786,415,895,600 | 31.988971 | 79 | 0.678034 | false | 4.020161 | false | false | false |
ryos36/polyphony-tutorial | Tutorial_1/root_2.py | 1 | 1177 | from polyphony import testbench
shift_n = 30
def round(x):
return x
def abs(x):
if x < 0 :
return -x
else:
return x
def i_mul_floor(x, y):
tmp = x * y
return tmp >> shift_n
def i_mul_ceil(x, y):
tmp = x * y
d = tmp & (1 << shift_n - 1)
tmp >>= shift_n
if d :
... | mit | 3,411,647,756,418,904,600 | 15.577465 | 67 | 0.451147 | false | 2.884804 | false | false | false |
llazzaro/packyou | packyou/py2.py | 1 | 10645 | # -*- coding: utf-8 -*-
import imp
import ipdb
import logging
from sys import modules, meta_path
from os import mkdir
from os.path import (
isdir,
abspath,
dirname,
exists,
join,
)
import encodings.idna
import requests
from git import Repo
from packyou import find_module_path_in_cloned_repos
from... | mit | -2,669,128,757,194,921,500 | 40.745098 | 133 | 0.589854 | false | 4.287153 | false | false | false |
amudalab/concept-graphs | keyphrase/keyphrase/extractgrams.py | 1 | 6091 | import os
import sys
from stopwords_video import vid_stopwords
from stop_words import stopword
import nltk
import re
from nltk import stem
stemmer = stem.PorterStemmer()
from operator import itemgetter
import math
try:
folder_name=sys.argv[1]
folder_name="output/"+folder_name.split(".txt")[0]
max_gram=sys.argv[2]
... | mit | 9,185,321,193,961,970,000 | 32.103261 | 195 | 0.482023 | false | 3.616983 | false | false | false |
xiaotaw/chembl | dnn_model/single_vs_chemdiv.py | 1 | 3682 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import sys
import time
import datetime
import numpy as np
import pandas as pd
import tensorflow as tf
from matplotlib import pyplot as plt
import dnn_model
sys.path.append("/home/scw4750/Documents... | apache-2.0 | -2,227,815,573,639,499,300 | 30.20339 | 122 | 0.626018 | false | 2.917591 | false | false | false |
dhazel/buck | bucking/stable/buck_1_4.py | 1 | 6187 | #
# based on Li = [0 0 0 0 0]
#
# while Li(1)
# check iteration number
# either load start lengh or decrease length by one value
# calculate length price
#
# while Li(2)
# check iteration number
# either load start lengh or decrease length by one value
# calculate length pri... | gpl-2.0 | 8,964,877,433,528,988,000 | 32.372222 | 127 | 0.431388 | false | 2.928064 | false | false | false |
cjolowicz/wald | wald/backend.py | 1 | 1673 | # pylint: disable=too-few-public-methods
'''Backends for documents.'''
from sqlalchemy import create_engine, Column, Integer, String, ForeignKey
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker, relationship, backref
__base_class__ = declarative_base()
class Node(__bas... | gpl-2.0 | 854,792,258,371,098,100 | 29.981481 | 80 | 0.62642 | false | 3.973872 | false | false | false |
zapcoop/vertex | vertex_api/service/tasks.py | 1 | 5959 | import email
from django.core.exceptions import PermissionDenied
from django.template import Context
from django.db import transaction
from django_mailbox.models import Message
import html2text
from vertex.celery import app
import vertex.rules
from service.models import Ticket, TicketSubscriber, Update, EmailTemplate
... | agpl-3.0 | 1,361,053,991,817,043,000 | 32.477528 | 100 | 0.633999 | false | 4.268625 | false | false | false |
kmee/pySigepWeb | pysigepweb/resposta_rastreamento.py | 1 | 3331 | # -*- coding: utf-8 -*-
# #############################################################################
#
# Brazillian Carrier Correios Sigep WEB
# Copyright (C) 2015 KMEE (http://www.kmee.com.br)
# @author: Michell Stuttgart <michell.stuttgart@kmee.com.br>
#
# Sponsored by Europestar www.europestar.com.br
... | agpl-3.0 | 1,957,256,924,137,587,700 | 31.339806 | 79 | 0.589613 | false | 3.551173 | false | false | false |
SKA-ScienceDataProcessor/integration-prototype | sip/tango_control/tango_master/app/sdp_master_ds.py | 1 | 1281 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""SIP SDP Tango Master Device server.
Run with:
```bash
python3 sdp_master_ds.py 1 -v4
```
"""
import sys
from tango import Database, DbDevInfo
from tango.server import run
from sdp_master_device import SDPMasterDevice
from sip_logging import init_logger
from release ... | bsd-3-clause | 7,163,578,524,767,934,000 | 26.255319 | 78 | 0.657299 | false | 3.276215 | false | false | false |
rdevon/cortex | cortex/built_ins/datasets/utils.py | 1 | 1457 | """
Extra functions for build-in datasets
"""
import torchvision.transforms as transforms
def build_transforms(normalize=True, center_crop=None, image_size=None,
random_crop=None, flip=None, random_resize_crop=None,
random_sized_crop=None, use_sobel=False):
"""
Args... | bsd-3-clause | 2,229,084,709,715,869,200 | 26.490566 | 75 | 0.638298 | false | 4.186782 | false | false | false |
ilyapatrushev/isimage | isimage/select_images/check_cleared.py | 1 | 1563 | """ Utility module for command line script select_images
"""
# Author: Ilya Patrushev ilya.patrushev@gmail.com
# License: GPL v2.0
import os
import numpy as np
import scipy.linalg as la
from cPickle import load
import cv2
def image_colour_distribution(img):
"""
Extract colour distribution parameters.
... | gpl-2.0 | 4,469,173,557,604,382,700 | 20.708333 | 70 | 0.544466 | false | 3.956962 | false | false | false |
codeWangHub/machineLearningAnywhere | neural network algorithm/1st_basic_knn/knn.py | 1 | 2797 | import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D # 绘制三维图需要这个工具包
# 加载数据集
def loadData(file):
with open(file) as f :
lines = f.readlines()
size = len(lines) # 获得文件的行数
data = np.zeros((size,3)) # 保存数据
labels = [] # 保存分类
# 解析行
index = 0
for line in lines:... | apache-2.0 | 8,553,475,345,737,452,000 | 20.034188 | 98 | 0.645672 | false | 2.101623 | false | false | false |
xnmp/lambdaquery | LambdaQuery/functions.py | 1 | 16156 | from functools import wraps
from LambdaQuery.query import *
def asExpr(value):
if isinstance(value, Columns):
if len(value) > 1:
raise TypeError(f"Can't convert Columns with more than one Expr to Expr: {value}")
return value.asExpr()
elif isinstance(value, ConstExpr.allowedTypes):
... | mit | 1,667,856,729,118,131,700 | 31.551867 | 141 | 0.590567 | false | 3.045419 | false | false | false |
eltonsantos/quokka | quokka/core/admin/__init__.py | 1 | 1953 | #!/usr/bin/env python
# -*- coding: utf-8 -*
import logging
from flask import request, session
from flask.ext.admin import Admin
from flask.ext.admin.contrib import fileadmin
from .models import ModelAdmin
from .views import IndexView
logger = logging.getLogger()
class QuokkaAdmin(Admin):
def register(self, mo... | mit | -2,768,285,031,541,726,700 | 24.363636 | 71 | 0.517665 | false | 4.245652 | false | false | false |
maleficarium/youtube-dl | youtube_dl/postprocessor/ffmpeg.py | 1 | 22575 | from __future__ import unicode_literals
import io
import os
import subprocess
import time
from .common import AudioConversionError, PostProcessor
from ..compat import (
compat_subprocess_get_DEVNULL,
)
from ..utils import (
encodeArgument,
encodeFilename,
get_exe_version,
is_outdated_version,
... | unlicense | 2,100,544,247,190,943,200 | 37.855422 | 157 | 0.558051 | false | 4.152106 | false | false | false |
uannight/reposan | plugin.video.tvalacarta/lib/youtube_dl/extractor/common.py | 1 | 118491 | # coding: utf-8
from __future__ import unicode_literals
import base64
import datetime
import hashlib
import json
import netrc
import os
import random
import re
import socket
import sys
import time
import math
from ..compat import (
compat_cookiejar,
compat_cookies,
compat_etree_fromstring,
compat_getp... | gpl-2.0 | -1,317,547,598,578,859,800 | 45.640945 | 163 | 0.526691 | false | 4.231 | false | false | false |
benedictpaten/marginPhase | toil/src/toil_marginphase/scripts/bam_stats.py | 1 | 26073 | #!/usr/bin/env python
from __future__ import print_function
import argparse
import glob
import sys
import numpy as np
import pysam
import math
# read keys
R_ID = "id"
R_START_POS = "start_pos"
R_END_POS = "end_pos"
R_LENGTH = "length"
R_SECONDARY = "secondary_alignment"
R_SUPPLEMENTARY = "supplementary_alignment"
R_MA... | mit | 792,703,284,669,462,400 | 41.395122 | 136 | 0.586699 | false | 3.568711 | false | false | false |
jorol/StoryMapJS | api.py | 1 | 26872 | from __future__ import division
from flask import Flask, request, session, redirect, url_for, \
render_template, jsonify, abort
from collections import defaultdict
import math
import os
import sys
import importlib
import traceback
import time
import datetime
import re
import json
from functools import wraps
import ... | mpl-2.0 | -3,265,961,351,194,360,000 | 28.89099 | 103 | 0.587563 | false | 3.573404 | false | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.