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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
MSLNZ/msl-equipment | msl/equipment/resources/thorlabs/kinesis/filter_flipper.py | 1 | 16157 | """
This module provides all the functionality required to control a
Filter Flipper (MFF101, MFF102).
"""
from ctypes import byref, c_int64
from msl.equipment.resources import register
from msl.equipment.resources.utils import WORD, DWORD
from msl.equipment.resources.thorlabs.kinesis.motion_control import MotionContro... | mit | -1,277,002,313,023,637,200 | 31.574597 | 111 | 0.594355 | false | 4.123788 | false | false | false |
Tailszefox/scrabblesolve | binaire.py | 1 | 6312 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import os.path
import sys
# Nœud de l'arbre contenant une lettre
class Noeud(object):
"""
Constructeur
lettre : lettre stockée dans le nœud
mot : True si le chemin représente un mot du dictionnaire, False sinon
fd : lettre située au même niveau et après dans l'ordre ... | cc0-1.0 | 6,933,392,178,072,535,000 | 23.625984 | 129 | 0.667306 | false | 2.429126 | false | false | false |
llvm/llvm-zorg | zorg/buildbot/builders/annotated/util.py | 1 | 3453 | from __future__ import print_function
import errno
import os
import re
import shutil
import subprocess
import sys
def clean_dir(path):
"""
Removes directory at path (and all its subdirectories) if it exists,
and creates an empty directory in its place.
"""
try:
rmtree(path)
except OSE... | apache-2.0 | -2,361,367,775,517,901,300 | 25.767442 | 78 | 0.631045 | false | 3.638567 | false | false | false |
manuvarkey/cmbautomiser | cmbautomiser/openpyxl/cell/read_only.py | 1 | 3984 | from __future__ import absolute_import
# Copyright (c) 2010-2018 openpyxl
import re
from openpyxl.compat import unicode, long
from openpyxl.cell import Cell
from openpyxl.utils import get_column_letter
from openpyxl.utils.datetime import from_excel
from openpyxl.styles import is_date_format
from openpyxl.styles.numb... | gpl-3.0 | 7,798,107,740,639,183,000 | 24.703226 | 84 | 0.591616 | false | 3.702602 | false | false | false |
enobayram/MHFlib | MHFPython/scripts/figures.py | 1 | 3219 | # -*- coding: utf-8 -*-
"""
Created on Wed Feb 1 11:30:49 2012
@author: eba
"""
from numpy import *
from scipy import *
from matplotlib.pyplot import *
from MHFPython import *
from plotGaussians import *
def rotate(x,y,rot):
return [x*rot[0,0]+y*rot[0,1],x*rot[1,0]+y*rot[1,1]]
theta = arange(-pi,pi,0.01)
r... | bsd-2-clause | -8,608,220,335,965,278,000 | 21.047945 | 67 | 0.680646 | false | 2.43679 | false | false | false |
mocnik-science/osm-python-tools | OSMPythonTools/internal/cacheObject.py | 1 | 4281 | import hashlib
import os
import time
import ujson
import urllib.request
import OSMPythonTools
class CacheObject:
def __init__(self, prefix, endpoint, cacheDir='cache', waitBetweenQueries=None, jsonResult=True):
self._prefix = prefix
self._endpoint = endpoint
self.__cacheDir = cacheDir
... | gpl-3.0 | -6,900,467,216,144,160,000 | 44.542553 | 165 | 0.61551 | false | 4.176585 | false | false | false |
blechta/dolfin-tape | dolfintape/hat_function.py | 1 | 4970 | # Copyright (C) 2015 Jan Blechta
#
# This file is part of dolfin-tape.
#
# dolfin-tape is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later ve... | gpl-3.0 | -4,066,114,395,403,508,000 | 30.858974 | 80 | 0.663179 | false | 3.495077 | false | false | false |
Acehaidrey/incubator-airflow | tests/cluster_policies/__init__.py | 1 | 2187 | #
# 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... | apache-2.0 | 1,157,787,360,719,644,000 | 33.171875 | 105 | 0.703704 | false | 3.857143 | false | false | false |
vondrejc/FFTHomPy | tutorials/03_exact_integration_simple.py | 1 | 4521 | from __future__ import division, print_function
print("""
Numerical homogenisation based on exact integration, which is described in
J. Vondrejc, Improved guaranteed computable bounds on homogenized properties
of periodic media by FourierGalerkin method with exact integration,
Int. J. Numer. Methods Eng., 2016.
This ... | mit | -5,727,445,794,444,432,000 | 38.657895 | 110 | 0.652068 | false | 2.673566 | false | false | false |
srio/shadow3-scripts | script1_ID26.py | 1 | 12878 |
import numpy
from orangecontrib.xoppy.util.xoppy_undulators import xoppy_calc_undulator_power_density, xoppy_calc_undulator_spectrum
from orangecontrib.xoppy.util.xoppy_xraylib_util import xpower_calc
from orangecontrib.xoppy.util.fit_gaussian2d import fit_gaussian2d, info_params, twoD_Gaussian
from srxraylib.plot.go... | mit | -5,591,580,236,130,774,000 | 44.34507 | 178 | 0.516773 | false | 3.136386 | false | false | false |
LxiaoGirl/sqlmapTamper | unicodetobypasswaf.py | 1 | 1384 | #!/usr/bin/env python
"""
Copyright (c) 2015 @xiaoL (http://xlixli.net/)
"""
import os
import string
from lib.core.enums import PRIORITY
from lib.core.common import singleTimeWarnMessage
__priority__ = PRIORITY.LOWEST
def dependencies():
singleTimeWarnMessage("tamper script '%s' is only meant to be run agains... | gpl-2.0 | 6,264,521,854,367,625,000 | 23.280702 | 90 | 0.537572 | false | 2.995671 | false | false | false |
kebarr/Geist | geist/backends/windows.py | 1 | 14357 | from __future__ import division, absolute_import, print_function
import numpy
import subprocess
import shlex
import ctypes
from ctypes import (
byref,
WINFUNCTYPE,
c_ubyte,
sizeof,
POINTER,
Structure,
)
from ctypes.wintypes import (
POINT,
RECT,
DWORD,
LPARAM,
... | mit | -8,654,186,419,630,648,000 | 25.451243 | 78 | 0.543498 | false | 3.578514 | false | false | false |
brentd-smith/smolkinsite | songs/migrations/0001_initial.py | 1 | 4209 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2017-04-13 19:46
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.Crea... | gpl-3.0 | 6,483,843,645,224,168,000 | 49.107143 | 281 | 0.552388 | false | 4.000951 | false | false | false |
pkgw/pwkit | pwkit/bblocks.py | 1 | 16546 | # -*- mode: python; coding: utf-8 -*-
# Copyright 2014 Peter Williams <peter@newton.cx> and collaborators.
# Licensed under the MIT License.
"""pwkit.bblocks - Bayesian Blocks analysis, with a few extensions.
Bayesian Blocks analysis for the "time tagged" case described by Scargle+
2013. Inspired by the bayesian_bloc... | mit | -3,543,484,899,377,232,400 | 36.265766 | 89 | 0.620513 | false | 3.614242 | false | false | false |
mganeva/mantid | scripts/Muon/GUI/Common/home_tab/home_tab_view.py | 1 | 1149 | # Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source
# & Institut Laue - Langevin
# SPDX - License - Identifier: GPL - 3.0 +
from __future__ import (absolute_import, divi... | gpl-3.0 | 5,541,721,634,874,385,000 | 27.725 | 68 | 0.652742 | false | 3.804636 | false | false | false |
snowflakedb/snowflake-connector-python | src/snowflake/connector/proxy.py | 1 | 1473 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2012-2021 Snowflake Computing Inc. All right reserved.
#
import os
def set_proxies(proxy_host, proxy_port, proxy_user=None, proxy_password=None):
"""Sets proxy dict for requests."""
PREFIX_HTTP = "http://"
PREFIX_HTTPS = "https://"
proxi... | apache-2.0 | 845,093,474,728,301,600 | 34.926829 | 84 | 0.552614 | false | 3.876316 | false | false | false |
smarterclayton/solum | solum/openstack/common/rpc/amqp.py | 1 | 23625 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# Copyright 2011 - 2012, Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
... | apache-2.0 | -6,104,428,898,525,230,000 | 36.146226 | 79 | 0.603513 | false | 4.065565 | false | false | false |
plusreed/foxpy | main3.py | 1 | 2910 | from discord.ext import commands
import discord
import datetime, re
import asyncio
import copy
import logging
import traceback
import sys
from collections import Counter
import config
description = """
I'm Fox, a multi-purpose and modular Discord bot.
"""
init_cogs = [
'plugins.admin.eval',
'plugins.admin.sh... | mit | -8,494,187,333,163,795,000 | 25.944444 | 108 | 0.657388 | false | 3.427562 | false | false | false |
Sirs0ri/PersonalAssistant | samantha/plugins/schedule_plugin.py | 1 | 8649 | """This plugin triggers schedules events.
The different commands are triggered:
* every 10 seconds
* at the start of every minute
* ..hour
* ..day
* ..month
* ..year
All these events are triggered as soon as possible, i.e. 'Day' will be
triggered at 0:00, month on the 1st at 0:00, etc.
"""
##... | mit | 360,726,340,552,907,840 | 36.441558 | 79 | 0.529194 | false | 3.998613 | false | false | false |
RaphaelNajera/Sunlight_Sensor | documentation/CENG355 Solar Capstone/firmware/Solar_Capstone_PV_v4.py | 1 | 5201 | #Retrieving from PV1, PV2, PV4
#Working on retrieving from PV3
#Solar Capstone
#Johnson, Raphael & Adrian
from bs4 import BeautifulSoup
from datetime import datetime
import urllib.request
import threading #Loop
import time
from ctypes import c_short
from ctypes import c_byte
from ctypes import c_ubyte
from time import ... | agpl-3.0 | -4,950,104,520,752,690,000 | 28.224719 | 101 | 0.614882 | false | 2.733053 | false | false | false |
seleniumbase/SeleniumBase | seleniumbase/translate/chinese.py | 1 | 22162 | # Chinese / 中文 - Translations - Python 3 Only!
from seleniumbase import BaseCase
from seleniumbase import MasterQA
class 硒测试用例(BaseCase): # noqa
def __init__(self, *args, **kwargs):
super(硒测试用例, self).__init__(*args, **kwargs)
self._language = "Chinese"
def 开启(self, *args, **kwargs):
... | mit | 8,168,400,214,733,496,000 | 33.495017 | 79 | 0.597419 | false | 2.927675 | false | false | false |
bolkedebruin/airflow | tests/providers/microsoft/azure/operators/test_azure_container_instances.py | 1 | 9083 | # -*- coding: utf-8 -*-
#
# 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
#... | apache-2.0 | 2,417,109,348,444,527,600 | 45.106599 | 97 | 0.594187 | false | 4.345933 | true | false | false |
alfred82santa/telebot | aiotelebot/formatters.py | 1 | 2590 | from json import dumps
from aiohttp.hdrs import CONTENT_TYPE
from aiohttp.multipart import MultipartWriter
from aiohttp.payload import get_payload
from multidict import CIMultiDict
from dirty_models.fields import ArrayField, ModelField
from dirty_models.models import BaseModel
from dirty_models.utils import ModelForm... | lgpl-3.0 | 2,767,400,065,749,186,000 | 30.975309 | 98 | 0.661004 | false | 4.345638 | false | false | false |
ActiveState/code | recipes/Python/578102_Nautilus_script_push_files_S3/recipe-578102.py | 1 | 1426 | #!/usr/bin/env python
import mimetypes
import os
import sys
import boto
from boto.s3.connection import S3Connection
from boto.s3.key import Key
def get_s3_conn():
return S3Connection()
def get_bucket(conn, name):
return conn.get_bucket(name)
og = os.environ.get
bucket_name = og('NAUTILUS_BUCKET_NAME', 'me... | mit | -6,771,188,464,086,638,000 | 28.708333 | 69 | 0.626928 | false | 3.293303 | false | false | false |
wmvanvliet/psychic | psychic/scalpplot.py | 1 | 3391 | import numpy as np
import matplotlib.pyplot as plt
from scipy import interpolate
from matplotlib.path import Path
from matplotlib.patches import PathPatch, Circle
from . import positions
def plot_scalp(densities, sensors, sensor_locs=None,
plot_sensors=True, plot_contour=True, cmap=None, clim=None, smark='k.', line... | bsd-3-clause | 607,890,273,072,048,300 | 32.245098 | 99 | 0.654969 | false | 2.861603 | false | false | false |
ShaguptaS/python | bigml/tests/create_evaluation_steps.py | 1 | 3119 | # -*- coding: utf-8 -*-
#!/usr/bin/env python
#
# Copyright 2012, 2015 BigML
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | apache-2.0 | 8,521,414,331,171,372,000 | 38.987179 | 90 | 0.702469 | false | 3.60578 | false | false | false |
miquelo/exectask | packages/exectask/context.py | 1 | 4804 | #
# This file is part of EXECTASK.
#
# EXECTASK is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# EXECTASK is distributed in the hope... | gpl-3.0 | -5,314,101,906,513,230,000 | 27.595238 | 70 | 0.667777 | false | 3.542773 | false | false | false |
VanceKingSaxbeA/MarketsEngine | src/bloombergquote.py | 1 | 1536 | /*Owner & Copyrights: Vance King Saxbe. A.*/""" Copyright (c) <2014> Author Vance King Saxbe. A, and contributors Power Dominion Enterprise, Precieux Consulting and other contributors. Modelled, Architected and designed by Vance King Saxbe. A. with the geeks from GoldSax Consulting and GoldSax Technologies email @vsaxb... | mit | -6,879,921,841,213,445,000 | 52 | 508 | 0.628255 | false | 3.859296 | false | false | false |
alekseyig/fusion | lib/pylibcurl/multi.py | 1 | 2883 | #coding=utf8
import ctypes
import lib
import const
import prototype
from pylibcurl.base import Base
### classes
class Multi(Base):
_pointer_type = ctypes.POINTER(const.CURLM)
_lib_init_func = lib.curl_multi_init
_lib_cleanup_func = lib.curl_multi_cleanup
def __init__(self, **kwargs):
self.... | mit | -3,252,982,349,766,039,000 | 26.990291 | 103 | 0.556712 | false | 4.072034 | false | false | false |
michalpravda/Anki_helpers | add-ons/export.py | 1 | 1192 | # import the main window object (mw) from ankiqt
from aqt import mw
# import the "show info" tool from utils.py
from aqt.utils import showInfo
# import all of the Qt GUI library
from aqt.qt import *
import re
# We're going to add a menu item below. First we want to create a function to
# be called when the menu item ... | mit | -2,603,656,548,504,197,600 | 33.057143 | 96 | 0.598154 | false | 3.455072 | false | false | false |
paulscherrerinstitute/pyscan | tests/helpers/scan_old.py | 1 | 38634 | from copy import deepcopy
from datetime import datetime
from time import sleep
import numpy as np
from tests.helpers.utils import TestPyScanDal
# This is just a dummy GUI class.
class DummyClass:
def __init__(self):
self.Progress = 1 # For Thomas!!
def showPanel(self, s):
pass
def emi... | gpl-3.0 | 2,175,520,377,062,554,000 | 41.689503 | 120 | 0.476523 | false | 4.1771 | false | false | false |
ankonzoid/Deep-Reinforcement-Learning-Tutorials | advanced_ML/model_tree/src/ModelTree.py | 1 | 13608 | """
ModelTree.py (author: Anson Wong / git: ankonzoid)
"""
import numpy as np
from copy import deepcopy
from graphviz import Digraph
class ModelTree(object):
def __init__(self, model, max_depth=5, min_samples_leaf=10,
search_type="greedy", n_search_grid=100):
self.model = model
... | mit | 7,199,203,135,097,981,000 | 37.769231 | 241 | 0.486846 | false | 4.155115 | false | false | false |
sevenian3/ChromaStarPy | KappasRaylGas.py | 1 | 10384 | # -*- coding: utf-8 -*-
"""
Created on Tue Apr 25 17:18:39 2017
@author: ishort
"""
import math
import Useful
import PartitionFn
import ToolBox
#import numpy
#/* Rayleigh scattering opacity routines taken from Moog (moogjul2014/, MOOGJUL2014.tar)
#Chris Sneden (Universtiy of Texas at Austin) and collabora... | mit | 1,023,656,047,883,678,600 | 33.2 | 149 | 0.510401 | false | 2.96347 | false | false | false |
ac-seguridad/ac-seguridad | project/manejador/cliente_entrada.py | 1 | 2574 |
# Este archivo es el encargado de recibir la placa leída y decidir si dejar
# pasar a un vehículo o no, dependiendo de la configuración de este. Además,
# busca si la placa está registrada en el sistema, en caso de estarlo, busca
# el usuario asociado al vehículo.
# Este archivo básicamente maneja las ... | apache-2.0 | 5,597,889,476,890,702,000 | 28.45977 | 95 | 0.712446 | false | 2.512745 | false | false | false |
open-synergy/opnsynid-stock-logistics-warehouse | stock_other_receipt_operation/tests/test_warehouse.py | 1 | 2104 | # -*- coding: utf-8 -*-
# © 2017 OpenSynergy Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from .base import BaseOtherReceiptOperation
import itertools
class TestWarehouse(BaseOtherReceiptOperation):
def test_warehouse_create(self):
reception_steps = [
"one_s... | agpl-3.0 | -107,100,302,950,765,000 | 29.478261 | 78 | 0.456015 | false | 4.005714 | false | false | false |
amerlyq/piony | piony/gstate.py | 1 | 3033 | from PyQt5.QtCore import QObject, pyqtSignal # , QRect, QPoint
# from PyQt5.QtWidgets import qApp
from piony import logger
from piony.config import ymlparser as yml
from piony.config.argparser import ArgParser
from piony.config.budparser import BudParser, BudError
from piony.config.keyparser import KeymapParser
cla... | gpl-3.0 | 6,719,100,791,870,633,000 | 33.465909 | 82 | 0.5727 | false | 3.53085 | false | false | false |
Quantia-Analytics/AzureML-Regression-Example | Python files/transform.py | 1 | 2490 | # -*- coding: utf-8 -*-
"""
Created on Tue Jul 21 12:49:06 2015
@author: Steve Elston
"""
## The main function with a single argument, a Pandas data frame
## from the first input port of the Execute Python Script module.
def azureml_main(BikeShare):
import pandas as pd
from sklearn import preprocessing
... | gpl-2.0 | -3,416,187,222,252,025,300 | 37.921875 | 97 | 0.562651 | false | 3.958665 | false | false | false |
nbsdx/abac | examples/python_tests/acme_rockets_rt0/query.py | 1 | 3122 | #!/usr/bin/env python
"""
Run the queries described in README
cmd: env keystore=`pwd` ./query.py
"""
import os
import ABAC
ctxt = ABAC.Context()
# Keystore is the directory containing the principal credentials.
# Load existing principals and/or policy credentials
if (os.environ.has_key("keystore")) :
keystore... | mit | -4,170,137,190,318,609,000 | 30.535354 | 92 | 0.601858 | false | 3.484375 | false | false | false |
shantanu561993/FAndR | docs/conf.py | 1 | 8415 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# FAR documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 9 22:26:36 2013.
#
# 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
# autogen... | bsd-3-clause | 2,237,559,652,515,695,600 | 29.6 | 76 | 0.7041 | false | 3.716873 | true | false | false |
volodymyrss/3ML | threeML/plugins/spectrum/binned_spectrum_set.py | 1 | 3209 | import numpy as np
from threeML.utils.time_interval import TimeIntervalSet
from threeML.plugins.spectrum.binned_spectrum import BinnedSpectrum
class BinnedSpectrumSet(object):
def __init__(self, binned_spectrum_list, reference_time=0.0, time_intervals=None):
"""
a set of binned spectra with optio... | bsd-3-clause | -6,567,661,062,073,182,000 | 25.303279 | 96 | 0.647554 | false | 4.103581 | false | false | false |
lowks/SDST | seqtools/demultiplexer.py | 1 | 7927 | import argparse
import subprocess
import os
import collections
import pylev
from seqtools.utils import revcomp,fileOpen
from seqtools.fastq import Fastq
def isIndexRevComp(indexfile,indexes,n=500000):
"""Determine if the indexes are reverse complemented or not
:param indexfile: filename of the Fastq ind... | mit | 2,461,416,735,547,084,000 | 37.110577 | 181 | 0.526303 | false | 3.529386 | false | false | false |
ragavvenkatesan/Convolutional-Neural-Networks | yann/core/conv.py | 1 | 10586 | """
``yann.core.conv.py`` is one file that contains all the convolution operators.
It contains two functions for performing either 2d convolution (``conv2d``) or 3d convolution
(``conv3d``).
These functions shall be called by every convolution layer from ``yann.layers.py``
TODO:
* Add 3D convolution support from ... | mit | 6,412,593,143,335,912,000 | 44.051064 | 100 | 0.573871 | false | 4.588643 | false | false | false |
moberweger/deep-prior-pp | src/trainer/optimizer.py | 1 | 4689 | """Basis for different optimization algorithms.
Optimizer provides interface for creating the update rules for gradient based optimization.
It includes SGD, NAG, RMSProp, etc.
Copyright 2015 Markus Oberweger, ICG,
Graz University of Technology <oberweger@icg.tugraz.at>
This file is part of DeepPrior.
DeepPrior is f... | gpl-3.0 | -5,467,339,482,598,829,000 | 39.076923 | 121 | 0.641288 | false | 3.546899 | false | false | false |
synw/django-mqueue | mqueue/signals.py | 1 | 2131 | from __future__ import print_function
from mqueue.models import MEvent
from mqueue.utils import get_user, get_url, get_admin_url, get_object_name
def mmessage_create(sender, instance, created, **kwargs):
if created is True:
# try to get the user
user = get_user(instance)
# try to get the o... | mit | 5,622,654,903,332,074,000 | 29.442857 | 74 | 0.56077 | false | 3.895795 | false | false | false |
rodgzilla/fractal_GAN | src/mandel_test.py | 1 | 5720 | import sys
import pygame
from pygame import gfxdraw
from pygame import Color
import cmath
import random
pygame.init()
# The small size will help for future generation.
unit = 75
width = 3 * unit
height = 2 * unit
# nb_sections represents the number of slice of each axis we are going
# to consider for the zoom. Th... | gpl-3.0 | 5,040,484,455,637,613,000 | 37.648649 | 109 | 0.597203 | false | 3.481436 | false | false | false |
hsoft/pdfmasher | ebooks/compression/palmdoc.py | 1 | 1892 | # Copyright 2008, Kovid Goyal <kovid at kovidgoyal.net>
# Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
#
# This software is licensed under the "GPL v3" License as described in the "LICENSE" file,
# which should be included with this package. The terms are also available at
# http://www.hardcoded.net/... | gpl-3.0 | -5,296,342,882,972,843,000 | 31.067797 | 91 | 0.426004 | false | 3.673786 | false | false | false |
markalansmith/draftmim | spider/nbadraft_net/nbadraft_net/spiders/nbadraft.py | 1 | 2465 | # -*- coding: utf-8 -*-
import scrapy
import urlparse
from urllib2 import quote
from nbadraft_net import PlayerItem
class NbadraftSpider(scrapy.Spider):
name = "nbadraft"
allowed_domains = ["nbadraft.net"]
start_urls = (
'http://www.nbadraft.net/2016mock_draft',
)
def parse(self, respons... | apache-2.0 | -2,331,472,478,925,752,000 | 41.5 | 145 | 0.586207 | false | 3.717949 | false | false | false |
ngageoint/scale | scale/recipe/configuration/json/recipe_config_v6.py | 1 | 8823 | """Manages the v6 recipe configuration schema"""
from __future__ import unicode_literals
from jsonschema import validate
from jsonschema.exceptions import ValidationError
from job.configuration.mount import HostMountConfig, VolumeMountConfig
from job.execution.configuration.volume import HOST_TYPE, VOLUME_TYPE
from r... | apache-2.0 | 5,617,838,189,864,306,000 | 37.030172 | 123 | 0.557067 | false | 4.7056 | true | false | false |
ekansa/open-context-py | opencontext_py/apps/ldata/arachne/api.py | 1 | 5134 | import json
import requests
from urllib.parse import urlparse, parse_qs
from opencontext_py.libs.general import LastUpdatedOrderedDict
from opencontext_py.libs.generalapi import GeneralAPI
class ArachneAPI():
""" Interacts with Arachne """
ARACHNE_SEARCH = 'arachne.dainst.org/search'
DEFAULT_API_BASE_URL ... | gpl-3.0 | 7,220,749,312,685,747,000 | 37.313433 | 109 | 0.553954 | false | 3.880574 | false | false | false |
tensorflow/graphics | tensorflow_graphics/image/transformer.py | 1 | 7541 | # Copyright 2020 The TensorFlow 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | apache-2.0 | -7,227,354,629,905,629,000 | 36.331683 | 79 | 0.670335 | false | 3.457588 | false | false | false |
buscarini/meta | templates/model/platforms/sql/Platform.py | 1 | 1689 | import sys
import os
import json
from meta.MetaProcessor import MetaProcessor
class Platform(MetaProcessor):
"""docstring for Platform"""
def preprocess_property(self,property,hash,hashes):
"""docstring for preprocess_property"""
property['_camelcase_'] = self.stringUtils.camelcase(st... | mit | -3,116,892,086,885,498,400 | 32.8 | 96 | 0.58733 | false | 4.825714 | false | false | false |
chrsbats/kvstore | kvstore/fs.py | 1 | 2352 | from __future__ import absolute_import
import traceback
import os, errno
import shutil
from .signal import interrupt_protect
class FileSystemAdapter(object):
def __init__(self, path, **kwargs):
# expand ~ or we'll end up creating a /~ directory
# abspath doesn't do this for us
self.path = ... | mit | 6,117,030,195,128,649,000 | 28.772152 | 61 | 0.528912 | false | 4.013652 | false | false | false |
UncleBarney/ochothon | images/portal/resources/toolset/toolset/commands/grep.py | 1 | 2581 | #
# Copyright (c) 2015 Autodesk Inc.
# All rights reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | apache-2.0 | 3,284,121,562,353,902,000 | 34.356164 | 141 | 0.532352 | false | 3.989181 | false | false | false |
windworship/kmeansds | clustered_ds.py | 1 | 17562 | # -*- coding: utf-8 -*-
#
# Author: huang
#
'''
The implementation of the framework of combining kmeans with distant supervision
'''
import argparse
import logging
import time
import random
import collections
from sklearn.cluster import MiniBatchKMeans, Birch
from sklearn.feature_extraction import FeatureHasher
fro... | mit | -1,580,487,062,954,818,800 | 31.643123 | 103 | 0.581597 | false | 3.894013 | false | false | false |
SwordYork/sequencing | sequencing_np/nn/rnn_cells/rnn.py | 1 | 2729 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Author: Sword York
# GitHub: https://github.com/SwordYork/sequencing
# No rights reserved.
#
from abc import ABCMeta, abstractmethod
from ..base import Layer
from ... import np, TIME_MAJOR
class RNN(Layer, metaclass=ABCMeta):
def __init__(self, init_state, ... | mit | -3,731,958,042,420,923,400 | 33.544304 | 83 | 0.5797 | false | 3.955072 | false | false | false |
olemb/mido | tests/test_syx.py | 1 | 1299 | from pytest import raises
from mido.messages import Message
from mido.syx import read_syx_file, write_syx_file
def test_read(tmpdir):
path = tmpdir.join("test.syx").strpath
msg = Message('sysex', data=(1, 2, 3))
with open(path, 'wb') as outfile:
outfile.write(msg.bin())
assert read_syx_file(... | mit | 8,884,796,596,589,155,000 | 27.23913 | 65 | 0.595843 | false | 3.137681 | true | false | false |
leanix/leanix-sdk-python | src/leanix/models/ProjectHasResource.py | 1 | 1781 | #!/usr/bin/env python
"""
The MIT License (MIT)
Copyright (c) 2017 LeanIX GmbH
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,... | mit | 5,855,163,189,732,606,000 | 37.717391 | 105 | 0.705783 | false | 4.441397 | false | false | false |
stormi/tsunami | src/primaires/vehicule/vecteur.py | 1 | 8948 | # -*-coding:Utf-8 -*
# Copyright (c) 2010 DAVY Guillaume
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list... | bsd-3-clause | 3,360,314,228,164,489,000 | 28.892617 | 79 | 0.554558 | false | 3.272594 | false | false | false |
musically-ut/python-glob2 | setup.py | 2 | 1227 | #!/usr/bin/env python
import os
from setuptools import setup, find_packages
# Figure out the version
import re
here = os.path.dirname(os.path.abspath(__file__))
version_re = re.compile(
r'__version__ = (\(.*?\))')
fp = open(os.path.join(here, 'glob2', '__init__.py'))
version = None
for line in fp:
match = ver... | bsd-2-clause | -5,408,287,253,185,717,000 | 28.214286 | 74 | 0.611247 | false | 3.858491 | false | false | false |
sammyshj/nyx | nyx/panel/header.py | 1 | 16295 | # Copyright 2009-2016, Damian Johnson and The Tor Project
# See LICENSE for licensing information
"""
Top panel for every page, containing basic system and tor related information.
This expands the information it presents to two columns if there's room
available.
"""
import os
import time
import stem
import stem.con... | gpl-3.0 | -6,505,644,122,368,500,000 | 31.076772 | 144 | 0.639828 | false | 3.259 | false | false | false |
nens/dpnetcdf | dpnetcdf/migrations/0050_auto__del_field_datasource_imported.py | 1 | 5366 | # -*- 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 'Datasource.imported'
db.delete_column('dpnetcdf_datasource', 'imported')
def backwar... | gpl-3.0 | -3,347,639,049,884,668,400 | 59.988636 | 162 | 0.547521 | false | 3.623228 | false | false | false |
antonxy/audiosync | gui.py | 1 | 5008 | import tkinter as tk
from tkinter.ttk import Progressbar
from tkinter import filedialog, messagebox
import os
import errno
from threading import Thread
import program_logic
def get_paths_in_dir(directory):
filenames = os.listdir(directory)
return [os.path.abspath(os.path.join(directory, name)) for name in fil... | mit | 6,802,534,413,358,462,000 | 33.784722 | 128 | 0.609425 | false | 3.516854 | false | false | false |
felipenaselva/felipe.repository | plugin.program.Build.Tools/resources/libs/skinSwitch.py | 1 | 9353 | ################################################################################
# Copyright (C) 2015 OpenELEQ #
# #
# This Program is free software; you can redistribute it and/or modify ... | gpl-2.0 | -3,929,239,323,546,178,600 | 40.207048 | 145 | 0.481664 | false | 3.576673 | false | false | false |
DLR-SC/prov-db-connector | provdbconnector/utils/converter.py | 1 | 3299 | from functools import reduce
from io import BufferedReader
from provdbconnector.exceptions.utils import ParseException, NoDocumentException
import six
from prov.model import ProvDocument
import logging
log = logging.getLogger(__name__)
def form_string(content):
"""
Take a string or BufferedReader as argumen... | apache-2.0 | -8,106,690,724,174,002,000 | 26.491667 | 92 | 0.678387 | false | 4.023171 | false | false | false |
fangxingli/hue | desktop/libs/indexer/src/indexer/smart_indexer_tests.py | 1 | 9419 | # Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file ex... | apache-2.0 | -8,800,027,289,137,888,000 | 31.818815 | 125 | 0.675656 | false | 3.622692 | true | false | false |
oVirt/ovirt-setup-lib | tests/commons.py | 1 | 1744 | #
# ovirt-setup-lib -- ovirt setup library
# Copyright (C) 2015 Red Hat, 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 req... | apache-2.0 | -5,747,025,881,998,846,000 | 31.90566 | 74 | 0.661697 | false | 3.799564 | false | false | false |
XiaodunServerGroup/medicalmooc | cms/djangoapps/contentstore/views/course.py | 1 | 55485 | # -*- coding: utf-8 -*-
#coding=utf-8
import Queue
import sys,os
from envs.common import PROJECT_ROOT
import xlrd
from student.views import do_institution_import_teacher_create_account,do_institution_import_student_create_account
import random
reload(sys)
sys.setdefaultencoding('utf8')
"""
Views related to operations... | agpl-3.0 | 6,436,884,706,447,725,000 | 38.430714 | 338 | 0.633716 | false | 3.935762 | false | false | false |
cuoretech/dowork | dowork/Model/Comment.py | 1 | 5452 | from database_config import *
from py2neo import neo4j, node
import json
# Class : Blog
# Methods:
# 1) db_init(self) - Private
# 2) getNode(self) - Returns the Comment Node
# 3) getName(self) - Returns name of Comment
# 4) setDescription(self, description) - Takes description as a st... | apache-2.0 | 5,440,216,274,128,202,000 | 29.458101 | 111 | 0.586574 | false | 3.850282 | false | false | false |
stormrose-va/xobox | xobox/utils/loader.py | 1 | 3215 | # -*- coding: utf-8 -*-
"""
xobox.utils.loader
~~~~~~~~~~~~~~~~~~
:copyright: Copyright 2017 by the Stormrose Project team, see AUTHORS.
:license: MIT License, see LICENSE for details.
"""
import importlib
import os
from xobox.utils import filters
def detect_class_modules(mod, parent=object):
"... | mit | -4,367,746,705,474,805,000 | 33.945652 | 100 | 0.63297 | false | 4.606017 | false | false | false |
hideaki-t/sqlite-fts-python | tests/test_many.py | 1 | 3058 | from __future__ import print_function, unicode_literals
import sqlite3
import os
import tempfile
from faker import Factory
import pytest
import sqlitefts as fts
from sqlitefts import fts5
igo = pytest.importorskip('igo')
fake = Factory.create('ja_JP')
class IgoTokenizer(fts.Tokenizer):
def __init__(self, path=N... | mit | 4,999,511,117,820,486,000 | 32.604396 | 79 | 0.581099 | false | 3.589202 | true | false | false |
kooksee/TIOT | test/project/src/app/proto/protocol/LightProtocol.py | 1 | 3560 | # encoding=utf-8
import binascii
import json
from twisted.internet.protocol import Protocol
class LightProtocol(Protocol):
def __init__(self):
self.ip = ''
self.port = ''
def connectionMade(self):
# import socket
#self.transport.socket._sock.setsockopt(socket.SOL_SOCKET, socket... | gpl-2.0 | -6,347,997,613,682,692,000 | 35.125 | 106 | 0.563437 | false | 3.118705 | false | false | false |
manuvarkey/cmbautomiser | cmbautomiser/openpyxl/descriptors/excel.py | 1 | 2252 | from __future__ import absolute_import
#copyright openpyxl 2010-2015
"""
Excel specific descriptors
"""
from openpyxl.xml.constants import REL_NS
from openpyxl.compat import safe_string
from openpyxl.xml.functions import Element
from . import (
MatchPattern,
MinMax,
Integer,
String,
Typed,
Se... | gpl-3.0 | -4,408,916,376,172,166,000 | 20.245283 | 110 | 0.596803 | false | 3.010695 | false | false | false |
abingham/yapga | setup.py | 1 | 1127 | import distribute_setup
distribute_setup.use_setuptools()
from setuptools import setup, find_packages
setup(
name='yapga',
version='1',
packages=find_packages(),
# metadata for upload to PyPI
author='Austin Bingham',
author_email='austin.bingham@gmail.com',
description="Yet Another Python... | mit | 5,641,950,641,626,381,000 | 25.209302 | 63 | 0.583851 | false | 3.954386 | false | false | false |
conradoplg/navi | libnavi/model/note.py | 1 | 1196 | from pubsub import pub
class Note(object):
def __init__(self, name, path):
self.name = name
self.path = path
def open(self, create=False):
self.text = u''
if self.path:
try:
with self.path.open('r') as f:
#TODO: detect enc... | mit | 5,750,002,080,750,410,000 | 29.692308 | 56 | 0.474916 | false | 4.803213 | false | false | false |
Fokko/incubator-airflow | airflow/sensors/external_task_sensor.py | 1 | 7096 | # -*- coding: utf-8 -*-
#
# 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
#... | apache-2.0 | 4,054,005,438,354,515,500 | 42.533742 | 103 | 0.609076 | false | 4.211276 | false | false | false |
stefanwebb/tensorflow-models | tensorflow_models/models/emvb_debug2.py | 1 | 9483 | # MIT License
#
# Copyright (c) 2017, Stefan Webb. All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to us... | mit | 9,025,626,535,856,672,000 | 49.71123 | 176 | 0.735949 | false | 3.076898 | false | false | false |
ingadhoc/stock | stock_ux/models/stock_warehouse_orderpoint.py | 1 | 2683 | ##############################################################################
# For copyright and license notices, see __manifest__.py file in module root
# directory
##############################################################################
from odoo import models, fields, api
class StockWarehouseOrderpoint(mo... | agpl-3.0 | 7,736,426,344,456,536,000 | 40.123077 | 78 | 0.5896 | false | 3.948301 | false | false | false |
EmilioK97/pydeepl | pydeepl/pydeepl.py | 1 | 3012 | import requests
BASE_URL = 'https://www2.deepl.com/jsonrpc'
LANGUAGES = {
'auto': 'Auto',
'DE': 'German',
'EN': 'English',
'FR': 'French',
'ES': 'Spanish',
'IT': 'Italian',
'NL': 'Dutch',
'PL': 'Polish'
}
JSONRPC_VERSION = '2.0'
class SplittingError(Exception):
def __init__(self... | mit | -3,052,785,514,397,001,000 | 26.888889 | 78 | 0.557437 | false | 4.075778 | false | false | false |
ehouarn-perret/EhouarnPerret.Python.HackerRank | 0 - Tutorials/30 Days of Code/Day 4 - Class vs. Instance.py | 1 | 1605 | """
In this challenge, we're going to learn about the difference between a class and an instance;
because this is an Object Oriented concept, it's only enabled in certain languages.
Task
Write a Person class with an instance variable, age, and a constructor that takes an integer, initial_age, as a parameter.
The const... | mit | -2,068,696,048,610,836,000 | 30.470588 | 126 | 0.694704 | false | 3.282209 | false | false | false |
RCMRD/geonode | geonode/documents/views.py | 1 | 16713 | import json
from guardian.shortcuts import get_perms
from django.shortcuts import render_to_response, get_object_or_404
from django.http import HttpResponse, HttpResponseRedirect, Http404
from django.template import RequestContext, loader
from django.utils.translation import ugettext as _
from django.contrib.auth.deco... | gpl-3.0 | -4,495,816,925,612,968,000 | 36.05765 | 113 | 0.569557 | false | 4.566393 | false | false | false |
intelxed/xed | tests/split-tests.py | 1 | 2317 | #!/usr/bin/env python
# -*- python -*-
#BEGIN_LEGAL
#
#Copyright (c) 2018 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
#
# http://www.apache.org/licenses/LICENSE-... | apache-2.0 | 1,102,383,340,792,462,800 | 32.1 | 86 | 0.482952 | false | 3.9811 | false | false | false |
ewdurbin/sentry-datadog-helpers | sentry_datadog_helpers/test/utils.py | 1 | 5855 | import sys
from functools import wraps
__all__ = ('surrogate', )
class surrogate(object):
"""
Originally Created by Kostia Balitsky
Contains Modifications by Griffin Smith
See:
https://github.com/ikostia/surrogate
and
https://github.com/glittershark/s... | bsd-3-clause | 1,469,070,899,879,551,500 | 33.040698 | 78 | 0.561913 | false | 4.292522 | false | false | false |
dagss/numpy_svn | numpy/polynomial/chebyshev.py | 1 | 38012 | """
Objects for dealing with Chebyshev series.
This module provides a number of objects (mostly functions) useful for
dealing with Chebyshev series, including a `Chebyshev` class that
encapsulates the usual arithmetic operations. (General information
on how this module represents and works with such polynomials is in... | bsd-3-clause | 4,376,316,724,196,033,500 | 28.466667 | 79 | 0.597154 | false | 3.458151 | false | false | false |
francielsilvestrini/soupport | controllers/attachments.py | 1 | 1465 | # -*- coding: utf-8 -*-
def attachments():
owner_table = getlist(request.args, 0)
owner_key = getlist(request.args, 1)
if not (owner_table and owner_key):
response.view = 'others/gadget_error.html'
return dict(msg='attachments dont work!')
delete_id = request.vars... | lgpl-3.0 | 645,892,210,916,495,400 | 33.731707 | 99 | 0.63959 | false | 3.737245 | false | false | false |
FDelporte/PiGameConsole | SlideShow.py | 1 | 2521 | import Tkinter as tk
from itertools import cycle
from Tkinter import *
from PIL import Image, ImageTk # pip install pillow + sudo apt-get install python-imaging-tk
# based on example found on
# https://raspberrypi.stackexchange.com/questions/18261/how-do-i-display-an-image-file-png-in-a-simple-window
class SlideSho... | apache-2.0 | 5,571,100,893,828,448,000 | 35.028571 | 109 | 0.603332 | false | 3.535764 | false | false | false |
bas-stringer/scry | log.py | 1 | 2549 | from __init__ import LOG_DIRECTORY
from utility import assert_dir
from os.path import join
from datetime import datetime
from shutil import copyfile
REQUEST_DIR = join(LOG_DIRECTORY,'requests')
RESPONSE_DIR = join(LOG_DIRECTORY,'responses')
assert_dir(REQUEST_DIR)
assert_dir(RESPONSE_DIR)
def log_request(reque... | mit | 8,292,879,116,061,946,000 | 33.931507 | 101 | 0.572381 | false | 3.421477 | false | false | false |
Krakn/learning | src/python/mit_opencourseware/6001x/wk02pset02/problem03.py | 1 | 1204 | def exactPayment(balance, annualInterestRate):
"""
The following variables contain values as described below:
balance - the outstanding balance on the credit card
annualInterestRate - annual interest rate as a decimal
valueLow - Balance without interest
valueHigh - Balance with f... | isc | 5,623,401,946,856,234,000 | 40.517241 | 70 | 0.658638 | false | 4.284698 | false | false | false |
massivezh/qmc | gui.py | 1 | 3955 | #!/usr/bin/env python
# Simple GUI for qmc.py
# FIXME Experimental - doesn't do any check on what is passed as input ;)
#
# Copyright (C) 2011 Marcello Pogliani
#
# 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 ... | apache-2.0 | -570,660,592,206,888,800 | 33.692982 | 77 | 0.636157 | false | 3.585675 | false | false | false |
jldbc/pybaseball | pybaseball/datahelpers/postprocessing.py | 1 | 7149 | import re
from datetime import datetime
from typing import Any, List, Union, Optional
import attr
import numpy as np
import pandas as pd
null_regexes = [
re.compile(r'^\s*$'),
re.compile(r'^null$', re.RegexFlag.IGNORECASE)
]
date_formats = [
# Standard statcast format
(re.compile(r'^\d{4}-\d{1,2}-\d{... | mit | 1,013,509,468,966,282,900 | 31.202703 | 116 | 0.608896 | false | 3.428777 | false | false | false |
ifsmirnov/jngen | build.py | 1 | 2593 | #!/usr/bin/python3
import re, os
HEADER_REGEX = re.compile('#include "(.*)"')
# This list may contain not all headers directly, but each jngen header
# must be among the dependencies of some file from here.
LIBRARY_HEADERS = [
"array.h",
"random.h",
"common.h",
"tree.h",
"graph.h",
"geometry... | mit | 101,050,475,562,257,710 | 24.421569 | 71 | 0.587736 | false | 3.371912 | false | false | false |
d0ugal/discode-server | discode_server/db.py | 1 | 4273 | import collections
import datetime
import hashlib
import logging
from sanic import exceptions
import aiopg.sa
import sqlalchemy as sa
from discode_server.utils import baseconv
from discode_server.utils import highlight
log = logging.getLogger(__file__)
meta = sa.MetaData()
paste = sa.Table(
'pastes', meta,
... | bsd-2-clause | 5,807,472,579,117,242,000 | 25.054878 | 79 | 0.646852 | false | 3.696367 | false | false | false |
shoyer/xarray | xarray/core/indexing.py | 1 | 51766 | import enum
import functools
import operator
from collections import defaultdict
from contextlib import suppress
from datetime import timedelta
from typing import Any, Callable, Iterable, Sequence, Tuple, Union
import numpy as np
import pandas as pd
from . import duck_array_ops, nputils, utils
from .npcompat import D... | apache-2.0 | -2,998,736,085,517,629,000 | 34.431896 | 98 | 0.60333 | false | 4.087327 | false | false | false |
liugangabc/ccs_web | tcpclient.py | 1 | 2137 | #!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
from tornado import ioloop, httpclient, gen
from tornado.gen import Task
import pdb, time, logging
import tornado.ioloop
import tornado.iostream
import socket
#Init logging
def init_logging():
logger = logging.getLogger()
logger.setLevel(logging.DEBUG)
sh = loggi... | apache-2.0 | -9,188,828,094,435,973,000 | 27.506667 | 110 | 0.613009 | false | 3.435691 | false | false | false |
atodorov/pykickstart | tests/commands/timezone.py | 1 | 6651 | #
# Chris Lumens <clumens@redhat.com>
#
# Copyright 2009 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use, modify,
# copy, or redistribute it subject to the terms and conditions of the GNU
# General Public License v.2. This program is distributed in the hope that it
# will be usef... | gpl-2.0 | -2,127,721,929,382,395,400 | 43.046358 | 121 | 0.658097 | false | 3.778977 | true | false | false |
scorpilix/Golemtest | apps/rendering/resources/imgcompare.py | 1 | 3797 | import logging
import math
from apps.rendering.resources.imgrepr import (EXRImgRepr, ImgRepr, load_img,
PILImgRepr)
logger = logging.getLogger("apps.rendering")
PSNR_ACCEPTABLE_MIN = 30
def check_size(file_, res_x, res_y):
img = load_img(file_)
if img is None:
... | gpl-3.0 | -3,704,521,870,128,538,000 | 32.307018 | 79 | 0.523045 | false | 3.2761 | false | false | false |
cloudedbats/cloudedbats_wurb | cloudedbats_wurb/wurb_raspberry_pi/control_by_gpio.py | 1 | 4508 | #!/usr/bin/python3
# -*- coding:utf-8 -*-
# Project: http://cloudedbats.org
# Copyright (c) 2016-2018 Arnold Andreasson
# License: MIT License (see LICENSE.txt or http://opensource.org/licenses/mit).
import time
import logging
import threading
# Check if GPIO is available.
gpio_available = True
try: import RPi.GPIO a... | mit | -5,799,279,537,577,791,000 | 34.496063 | 88 | 0.482919 | false | 4.017825 | false | false | false |
jabez007/Archons_Oracle | Oracle/Oracle.py | 1 | 5883 | #!/usr/bin/env python3
# https://theneuralperspective.com/2016/10/04/05-recurrent-neural-networks-rnn-part-1-basic-rnn-char-rnn/
# https://machinelearningmastery.com/text-generation-lstm-recurrent-neural-networks-python-keras/
# Larger LSTM Network to Generate Text for Last Hope LARP
import sys
import os
import numpy
... | mit | -5,439,092,132,026,910,000 | 38.442953 | 159 | 0.622767 | false | 3.506563 | false | false | false |
hydroffice/hyo_soundspeed | hyo2/soundspeed/formats/writers/abstract.py | 1 | 2150 | from abc import ABCMeta, abstractmethod # , abstractproperty
import os
import logging
logger = logging.getLogger(__name__)
from hyo2.soundspeed.base.files import FileManager
from hyo2.soundspeed.formats.abstract import AbstractFormat
class AbstractWriter(AbstractFormat, metaclass=ABCMeta):
""" Abstract data wr... | lgpl-2.1 | -3,848,063,316,767,106,600 | 27.289474 | 114 | 0.58 | false | 3.668942 | false | false | false |
Fluent-networks/floranet | floranet/web/rest/gateway.py | 1 | 7710 | import ipaddress
from flask_restful import Resource, reqparse, abort, inputs, fields, marshal
from flask_login import login_required
from twisted.internet.defer import inlineCallbacks, returnValue
from crochet import wait_for, TimeoutError
from floranet.models.gateway import Gateway
from floranet.log import log
# Cr... | mit | 563,634,068,682,700,800 | 34.045455 | 87 | 0.557717 | false | 4.482558 | false | false | false |
firelab/viirs_ba | misc_utils/run_fom.py | 1 | 1752 | #
# Script to run all of the figure of merit code for a single run back to back.
#
import viirs_fom as vf
import sys
def all_fom(database_name, workers=12) :
# I over U FOM
vf.calc_all_ioveru_fom('{}_schema_info.csv'.format(database_name),
'gt', 'burnmask13', workers=work... | cc0-1.0 | -7,760,519,851,290,668,000 | 36.933333 | 78 | 0.450913 | false | 4 | false | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.