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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
sssstest/GameEditor | dejavu/driver.py | 1 | 1128 | #!/usr/bin/env python
from __future__ import print_function
class build_log():
def append(self, c):
print(c,end="")
def message(self, c):
print(c)
def percent(self, i):
print(i)
class error_printer():#error_stream
def __init__(self, log):
self.log=log
self.errors = 0
self.context = "<untitled>"
d... | gpl-3.0 | -8,586,504,180,212,668,000 | 20.283019 | 145 | 0.631206 | false | 2.666667 | false | false | false |
HybridF5/jacket | jacket/api/compute/openstack/compute/fping.py | 1 | 4989 | # Copyright 2011 Grid Dynamics
# Copyright 2011 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses... | apache-2.0 | -2,104,035,560,630,013,200 | 31.607843 | 87 | 0.585288 | false | 4.020145 | false | false | false |
mueckl/raspberry_nagios_alert | scripts/red.led.py | 1 | 1090 | import RPi.GPIO as GPIO
import os.path
from time import sleep
import sys
# use P1 header pin numbering convention
#GPIO.setmode(GPIO.BOARD)
GPIO.setmode(GPIO.BCM)
pin=23
# Set up the GPIO channels - one input and one output
#GPIO.setup(11, GPIO.IN)
GPIO.setup(pin, GPIO.OUT)
# Input from pin 11
#input_value = GPIO... | mit | -1,505,786,839,147,413,000 | 19.185185 | 60 | 0.640367 | false | 2.945946 | false | false | false |
oostende/openblachole | lib/python/Components/About.py | 2 | 4196 | from boxbranding import getImageVersion, getMachineBuild
from sys import modules
import socket, fcntl, struct
def getVersionString():
return getImageVersion()
def getFlashDateString():
try:
f = open("/etc/install","r")
flashdate = f.read()
f.close()
return flashdate
except:
return _("unknown")
def getEn... | gpl-2.0 | 9,068,916,219,085,860,000 | 25.225 | 106 | 0.651096 | false | 2.8294 | false | false | false |
PhE/dask | dask/utils.py | 1 | 8629 | from __future__ import absolute_import, division, print_function
from collections import Iterator
from contextlib import contextmanager
from errno import ENOENT
from functools import partial
import os
import sys
import shutil
import struct
import gzip
import tempfile
import inspect
from .compatibility import unicode,... | bsd-3-clause | -3,181,018,165,780,446,000 | 22.576503 | 80 | 0.560436 | false | 3.586451 | false | false | false |
moberweger/deep-prior | src/net/netbase.py | 1 | 17161 | """Provides NetBase class for generating networks from configurations.
NetBase provides interface for building CNNs.
It should be inherited by all network classes in order to provide
basic functionality, ie computing outputs, creating computational
graph, managing dropout, etc.
NetBaseParams is the parametrization of ... | gpl-3.0 | -8,016,346,717,327,464,000 | 37.740406 | 150 | 0.569489 | false | 4.16226 | false | false | false |
per9000/naiveplot | src/nplot.py | 1 | 5073 | #!/usr/bin/python
from argparse import ArgumentParser
from sys import stdin
from string import ascii_uppercase
from naiveplot import NaivePlot, Curve, Point, Line
class NaiveParserPlotter:
"""Class for reading and plotting"""
def __init__(self):
"""Setup place holders"""
self.args = None
... | gpl-3.0 | -1,404,144,900,113,913,000 | 32.156863 | 79 | 0.500099 | false | 4.131107 | false | false | false |
cpodlesny/lisbon | src/gallery/views.py | 1 | 7355 | from django.contrib import messages
from django.core.paginator import Paginator, PageNotAnInteger, EmptyPage
from django.core.urlresolvers import reverse
from django.shortcuts import render, redirect, get_object_or_404
from django.utils.translation import ugettext_lazy as _
from helpers.models import Helpers
from offe... | mit | 9,215,973,351,278,447,000 | 31.982063 | 89 | 0.55758 | false | 3.673826 | false | false | false |
ceos-seo/Data_Cube_v2 | agdc-v2/utils/usgslsprepare.py | 1 | 8328 | # coding=utf-8
"""
Ingest data from the command-line.
"""
from __future__ import absolute_import, division
import logging
import uuid
from xml.etree import ElementTree
import re
from pathlib import Path
import yaml
from dateutil import parser
from datetime import timedelta
import rasterio.warp
import click
from osgeo ... | apache-2.0 | 6,611,207,923,284,716,000 | 30.908046 | 131 | 0.570725 | false | 3.42716 | false | false | false |
3t1n/scripts | Python/LFI-Scan/lfiscan.py | 1 | 1102 | #!/usr/bin/env python
#coding: utf-8
#coded by et1m
__author__ = "et1m"
print' _ ______ _____ _____ _____ _ _ '
print'| | | ____|_ _| / ____|/ ____| /\ | \ | |'
print'| | | |__ | | | (___ | | / \ | \| |'
print'| | | __| | | \___ \| | / /\ \ | . ` |'
print... | cc0-1.0 | 2,690,219,767,311,702,000 | 31.352941 | 174 | 0.427273 | false | 2.682927 | false | false | false |
andreesg/bda.plone.shop | src/bda/plone/shop/dx.py | 1 | 14904 | # -*- coding: utf-8 -*-
from bda.plone.cart import CartItemDataProviderBase
from bda.plone.cart import CartItemPreviewAdapterBase
from bda.plone.cart.interfaces import ICartItemStock
from bda.plone.orders.interfaces import IBuyable
from bda.plone.orders.interfaces import ITrading
from bda.plone.shipping.interfaces impo... | bsd-3-clause | 5,413,968,990,627,828,000 | 26.651206 | 81 | 0.653784 | false | 3.932454 | false | false | false |
drix00/pymcxray | pymcxray/multipleloop.py | 1 | 3786 | #!/usr/bin/env python
"""
This module provides a tool for handling computer experiments with
of a set of input parameters, where each input parameter
is varied in a prescribed fashion.
In short, the parameters are held in a dictionary where the keys are
the names of the parameters and the values are the numerical, str... | apache-2.0 | -5,109,418,296,811,559,000 | 36.86 | 80 | 0.622557 | false | 3.59203 | false | false | false |
oas89/iktomi | iktomi/db/sqla/__init__.py | 1 | 1417 | # -*- coding: utf-8 -*-
import logging
from importlib import import_module
from sqlalchemy import orm, create_engine
from sqlalchemy.orm.query import Query
def multidb_binds(databases, package=None, engine_params=None):
'''Creates dictionary to be passed as `binds` parameter to
`sqlalchemy.orm.sessionmaker()... | mit | -3,956,359,092,296,895,000 | 41.939394 | 79 | 0.661962 | false | 4.36 | false | false | false |
vkuznet/rep | rep/data/storage.py | 1 | 5284 | """
This is wrapper for pandas.DataFrame, which allows you to define dataset for estimator in a simple way.
"""
from __future__ import division, print_function, absolute_import
import numbers
from numpy.random.mtrand import RandomState
import pandas
import numpy
from sklearn.utils import check_random_state
from ..uti... | apache-2.0 | -9,111,050,701,465,696,000 | 32.656051 | 119 | 0.609008 | false | 4.190325 | false | false | false |
JustinTulloss/harmonize.fm | fileprocess/fileprocess/actions/puidgenerator.py | 1 | 1905 | import logging
import os
import subprocess
from baseaction import BaseAction
from fileprocess.processingthread import na
from fileprocess.configuration import config
try:
import musicdns
except ImportError:
musicdns = None
import fileprocess
log = logging.getLogger(__name__)
class PuidGenerator(BaseAction):
... | mit | -1,684,215,555,034,553,600 | 27.863636 | 84 | 0.548556 | false | 4.087983 | false | false | false |
googleapis/python-datastore | google/cloud/datastore_v1/services/datastore/async_client.py | 1 | 28702 | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | apache-2.0 | 3,394,507,495,499,587,600 | 39.255259 | 93 | 0.602676 | false | 4.768566 | false | false | false |
takeflight/wagtailtestutils | tests/settings.py | 1 | 2498 | DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
}
}
SECRET_KEY = 'not needed'
ROOT_URLCONF = 'wagtail.tests.urls'
STATIC_URL = '/static/'
STATIC_ROOT = 'static/'
COMPRESS_ENABLED = False
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.A... | bsd-2-clause | 2,868,741,275,238,496,000 | 26.152174 | 112 | 0.665733 | false | 3.927673 | true | true | false |
sergiocallegari/PyDSM | cvxpy_tinoco/functions/abs.py | 1 | 2839 | #***********************************************************************#
# Copyright (C) 2010-2012 Tomas Tinoco De Rubira #
# #
# This file is part of CVXPY #
# ... | gpl-3.0 | -5,290,735,920,992,748,000 | 36.853333 | 78 | 0.450863 | false | 4.144526 | false | false | false |
cortical-io/retina-sdk.py | retinasdk/client/expressions_api.py | 1 | 8726 | """
/*******************************************************************************
* Copyright (c) cortical.io GmbH. All rights reserved.
*
* This software is confidential and proprietary information.
* You shall use it only in accordance with the terms of the
* license agreement you entered into with cortical... | bsd-2-clause | -2,128,285,797,401,714,700 | 43.520408 | 172 | 0.637062 | false | 4.298522 | false | false | false |
bluelightning32/coquille | autoload/coquille.py | 1 | 27276 | from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
import vim
import re
import xml.etree.ElementTree as ET
import coqtop as CT
import project_file
from collections import deque
import vimbufsync
vimbufsync.check_version([0,1,0], who="coquille")
# Define un... | isc | -3,639,177,339,411,047,000 | 36.778393 | 109 | 0.530356 | false | 3.887685 | false | false | false |
blink1073/image_inspector | setup.py | 1 | 1488 | """Setup script for image_inspector package.
"""
DISTNAME = 'iminspector'
DESCRIPTION = 'Image Interaction widgets and viewer.'
LONG_DESCRIPTION = open('README.rst', 'rb').read().decode('utf-8')
MAINTAINER = 'Steven Silvester'
MAINTAINER_EMAIL = 'steven.silvester@ieee.org'
URL = 'http://github.com/blink1073/imag... | mit | -5,003,442,439,908,984,000 | 27.76 | 66 | 0.66129 | false | 3.542857 | false | false | false |
vnleonenko/Influenza | experiments/draw_speedup.py | 1 | 2138 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Auxiliary script for paper, DGTS conference.
Draw speedup graph
"""
import json
import time
import matplotlib
import matplotlib.pyplot as plt
from common import RESULTS_PATH
SPEEDUP_FILE = RESULTS_PATH + '/dgts/speedup.json'
OUTPUT_FILE = RESULTS_PATH + '/d... | gpl-3.0 | 9,161,574,696,086,953,000 | 27.506667 | 88 | 0.581384 | false | 3.415335 | false | false | false |
fangxingli/hue | desktop/libs/notebook/src/notebook/connectors/hiveserver2.py | 1 | 19836 | #!/usr/bin/env python
# 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 ma... | apache-2.0 | -1,149,335,945,032,415,200 | 31.518033 | 190 | 0.661877 | false | 3.789112 | true | false | false |
LaurensScheldeman/TwitchBot | src/lib/gui.py | 1 | 2462 | import string
from datetime import datetime
import Tkinter as tk
import ttk
import tkFont
import webbrowser
import socket
import src.lib.fileHandler as fileHandler
import src.lib.twitchHandler as twitchHandler
from src.lib.irc import irc as irc_
from src.lib.variables import global_variables
from src.lib.gui_bots... | gpl-3.0 | 2,424,998,428,401,631,000 | 28.662651 | 126 | 0.632006 | false | 3.62592 | false | false | false |
janist7/udacity-movie-site-development | python/templates/template_main.py | 1 | 2546 | """Contains parts of the main template - head, nav and footer"""
#Uses code from this reposatory:
#https://github.com/adarsh0806/ud036_StarterCode/blob/master/fresh_tomatoes.py
def get_template():
'''Contains main template'''
# Styles and scripting for the page
main_page_head = '''
<!DOCTYPE html>
... | gpl-3.0 | -7,364,092,432,295,013,000 | 41.433333 | 139 | 0.584446 | false | 3.41745 | false | false | false |
lgiommi/root | documentation/doxygen/converttonotebook.py | 1 | 35395 | #!/usr/bin/env python
# Author: Pau Miquel i Mir <pau.miquel.mir@cern.ch> <pmm1g15@soton.ac.uk>>
# Date: July, 2016
#
# DISCLAIMER: This script is a prototype and a work in progress. Indeed, it is possible that
# it may not work for certain tutorials, and that it, or the tutorial, might need to be
# tweaked slightly to... | lgpl-2.1 | 7,401,523,947,888,513,000 | 41.389222 | 670 | 0.592965 | false | 3.84102 | false | false | false |
zqfan/leetcode | algorithms/306. Additive Number/solution.py | 1 | 1232 | class Solution(object):
def isAdditiveNumber(self, num):
"""
:type num: str
:rtype: bool
"""
def str_add(s1, s2):
res = []
carry = 0; i1 = len(s1)-1; i2 = len(s2)-1
while i1 >= 0 or i2 >=0:
if i1 >= 0:
ca... | gpl-3.0 | 5,049,437,436,025,781,000 | 30.589744 | 53 | 0.323052 | false | 3.571014 | false | false | false |
apeng2012/TimeSwitch4ModemRouter | SetTimer/switchTime.py | 1 | 5093 | import sys
import time
import serial
try:
import xml.etree.cElementTree as ET
except ImportError:
import xml.etree.ElementTree as ET
saveFileName = "SwitchTime.xml"
def list2xml(stList):
if len(stList) != 7:
print "DayOfWeek num error!"
return
weekname = "sunday", "monday", "tuesd... | gpl-2.0 | -8,980,545,949,764,376,000 | 28.275862 | 118 | 0.611427 | false | 3.320078 | false | false | false |
tiagovaz/saskatoon | saskatoon/harvest/migrations/0002_auto_20180507_1941.py | 1 | 4140 | # -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2018-05-07 23:41
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('harvest', '0001_initial'),
]
operations = [
migrations.AddField(
m... | agpl-3.0 | -6,729,985,459,804,566,000 | 42.578947 | 167 | 0.618599 | false | 4.466019 | false | false | false |
colour-science/colour | colour/examples/plotting/examples_volume_plots.py | 1 | 1465 | # -*- coding: utf-8 -*-
"""
Showcases colour models volume and gamut plotting examples.
"""
import numpy as np
from colour.plotting import (plot_RGB_colourspaces_gamuts, plot_RGB_scatter,
colour_style)
from colour.utilities import message_box
message_box('Colour Models Volume and Gamut P... | bsd-3-clause | 7,481,060,059,926,544,000 | 27.173077 | 77 | 0.612287 | false | 2.723048 | false | true | false |
nsubiron/SublimeSuricate | suricate/command_parser.py | 1 | 3785 | # Sublime Suricate, Copyright (C) 2013 N. Subiron
#
# This program comes with ABSOLUTELY NO WARRANTY. This is free software, and you
# are welcome to 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 (... | gpl-3.0 | -5,906,764,279,225,393,000 | 33.099099 | 97 | 0.575429 | false | 3.788789 | false | false | false |
arongdari/sparse-graph-prior | sgp/GGPrnd.py | 1 | 3729 | import numpy as np
from scipy.special import gamma, gammaln
def W(t, x, alpha, sigma, tau):
if tau > 0:
logout = np.log(alpha) + np.log(1. - np.exp(-tau * (x - t))) + (-1 - sigma) * np.log(t) + (-t * tau) - np.log(
tau) - gammaln(1. - sigma)
else:
logout = np.log(alpha) - gammaln(1... | mit | 3,136,497,266,407,477,000 | 33.211009 | 119 | 0.53875 | false | 3.179028 | false | false | false |
BrandonNowlin/RebirthItemTracker | src/view_controls/overlay.py | 1 | 2633 | """
This module deals with everything related to the overlay text generated,
as well as formating how to display stats
"""
from game_objects.item import ItemInfo
class Overlay(object):
"""The main class to handle output to overlay text files"""
def __init__(self, prefix, tracker_state):
self.state = t... | bsd-2-clause | 2,913,179,788,774,310,000 | 37.15942 | 90 | 0.602735 | false | 4.088509 | false | false | false |
icgc-dcc/SONG | song-python-sdk/overture_song/entities.py | 1 | 9524 | import json
from typing import Any, Type
from dataclasses import dataclass
from overture_song.validation import Validatable
from overture_song.utils import Builder, default_value
from typing import List
from dataclasses import is_dataclass, asdict
from overture_song.utils import check_type, check_state
class Entity... | gpl-3.0 | 3,801,246,344,196,846,000 | 27.011765 | 115 | 0.640487 | false | 3.927423 | false | false | false |
richardclegg/multiuservideostream | streamsim/src/streamOptions.py | 1 | 11399 | #!/usr/bin/env python
import json
import sys
import demandmodel.demandModel as demandModel
import networkmodel.networkModel as networkModel
import qoemodel.qoeModel as qoeModel
import routemodel.routeModel as routeModel
import servermodel.serverModel as serverModel
import sessionmodel.sessionModel as sessionModel
imp... | mpl-2.0 | 8,610,475,788,309,808,000 | 35.072785 | 89 | 0.547855 | false | 4.317803 | false | false | false |
jarus/git-wcount-diff | git_wcount_diff.py | 1 | 1753 | import sys
import subprocess
import re
files_re = re.compile(r"diff --git a/(.+?) b/.+?")
additions_re = re.compile(r"{\+(.*?)\+}")
deletions_re = re.compile(r"\[-(.*?)-\]")
word_re = re.compile(r"\S*")
def count(regex, source):
words = 0
characters = 0
for match in regex.findall(source):
for wor... | bsd-3-clause | -7,602,571,264,804,953,000 | 26.825397 | 74 | 0.572162 | false | 3.358238 | false | false | false |
Royal-Society-of-New-Zealand/NZ-ORCID-Hub | orcid_api_v3/models/research_resource_group_v30_rc2.py | 1 | 5775 | # coding: utf-8
"""
ORCID Member
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: Latest
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import si... | mit | 6,240,323,661,696,474,000 | 33.789157 | 122 | 0.629264 | false | 3.899392 | false | false | false |
gvpavlov/Insaniquarium | insaniquarium/gui/aquarium.py | 1 | 5488 | import os
import sys
from PyQt5.QtWidgets import QApplication, QWidget
from PyQt5 import QtCore
from PyQt5 import QtGui
current_directory = os.path.dirname(os.path.abspath(__file__))
parent_directory = os.path.abspath(os.path.join(current_directory, os.pardir))
resource_directory = os.path.join(current_directory, "re... | gpl-2.0 | -6,743,611,437,689,086,000 | 33.515723 | 78 | 0.579993 | false | 3.577575 | false | false | false |
OSGeoLabBp/tutorials | english/img_processing/code/image_equalize.py | 1 | 1689 | #!/usr/bin/env python3
# -*- coding: UTF-8 -*-
"""
Equalize images to the histogram of a reference image
Based on https://www.pyimagesearch.com/2021/02/08/histogram-matching-with-opencv-scikit-image-and-python/
"""
import argparse
import os
import sys
from skimage import exposure
import cv2
# command line para... | cc0-1.0 | -2,569,869,299,229,796,400 | 32.78 | 109 | 0.671995 | false | 3.540881 | false | false | false |
miaoski/bsideslv-plc-home | dummy.py | 1 | 1293 | # -*- coding: utf8 -*-
# Run ipython -i dummy.py if you don't want to run it on Raspberry Pi
from pymodbus.server.async import StartTcpServer
from pymodbus.datastore import ModbusSequentialDataBlock
from pymodbus.datastore import ModbusSlaveContext, ModbusServerContext
from identity import identity
import logging
log... | gpl-2.0 | 5,917,105,770,169,918,000 | 35.942857 | 85 | 0.688322 | false | 2.751064 | false | false | false |
IQSS/geoconnect | scripts/unmapped_row_test.py | 1 | 1633 | # ------------------------------
# Quick script to add insitutions and
# affiliate them with dataverse installations
#
# Only deletes redundant institutions to refresh their affiliation
# ------------------------------
import os, sys
from os.path import abspath, isdir, realpath, isfile
proj_paths = [abspath('../'), ab... | apache-2.0 | 2,044,353,086,420,126,000 | 29.811321 | 76 | 0.650949 | false | 3.319106 | false | false | false |
joferkington/mplstereonet | docs/conf.py | 1 | 9530 | # -*- coding: utf-8 -*-
#
# mplstereonet documentation build configuration file, created by
# sphinx-quickstart on Sun Jun 23 13:39:02 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
# autogenerated file.
#
... | mit | 6,082,613,948,636,367,000 | 30.452145 | 80 | 0.701889 | false | 3.690937 | true | false | false |
JonasT/miraclecrafter | src/miraclecrafterserver/onlinegame.py | 1 | 5858 |
"""
This file is part of the Miracle Crafter Server.
Miracle Crafter Server (C) 2014 The Miracle Crafter Team (see AUTHORS)
Miracle Crafter Server 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 Foundati... | gpl-3.0 | 9,010,634,835,741,574,000 | 38.581081 | 79 | 0.602253 | false | 4.32644 | false | false | false |
geoscixyz/em_examples | em_examples/FDEMpipe.py | 1 | 6739 | import numpy as np
import matplotlib.pyplot as plt
import scipy.io
import warnings
warnings.filterwarnings('ignore')
from ipywidgets import interactive, IntSlider, widget, FloatText, FloatSlider, Checkbox
def fempipeWidget(alpha, pipedepth):
respEW, respNS, X, Y = fempipe(alpha, pipedepth)
fig = plt.figure(... | mit | -2,975,767,107,371,324,000 | 36.859551 | 129 | 0.601425 | false | 2.54494 | false | false | false |
myles/mylesbraithwaite.org | source/_uploads/2016/05/20/itunes-playing/playing.py | 1 | 1806 | #!/usr/bin/env python3
import subprocess
def osascript(script):
"""
This is a bridge between Python and AppleScript using the `osascript`
comamnd line app.
"""
process = subprocess.run(['osascript', '-e', script],
stdout=subprocess.PIPE)
# Because the `subproces... | cc0-1.0 | -5,790,147,332,706,279,000 | 23.405405 | 78 | 0.616279 | false | 3.892241 | false | false | false |
jeffmacinnes/pyneal | utils/mkDummyMask.py | 1 | 2226 | """
Tool to quickly make a dummy mask with user-supplied dimensions
The resulting mask will be a rectangle (.25*xDim X .25*yDim) positioned in the
middle of the middle slice of the given volume dimensions
"""
import os
from os.path import join
import sys
import argparse
import nibabel as nib
import numpy as np
def ... | mit | -8,057,642,820,469,725,000 | 28.289474 | 79 | 0.602426 | false | 3.544586 | false | false | false |
GreatLakesEnergy/sesh-dash-beta | seshdash/migrations/0006_auto_20170117_1613.py | 1 | 2776 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2017-01-17 14:13
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('seshdash', '0005_remove_report_sent_report_date'),
]
... | mit | -3,634,531,187,939,472,000 | 41.707692 | 180 | 0.552954 | false | 3.751351 | false | false | false |
renner/spacewalk | client/tools/rhnpush/connection.py | 1 | 10533 | #
# Copyright (c) 2008--2017 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a c... | gpl-2.0 | 2,458,659,510,662,937,600 | 33.762376 | 95 | 0.58236 | false | 3.949381 | false | false | false |
dmytro-ignatenko/kuzenko | python-client/client.py | 1 | 2905 | import httplib2
import json
import urllib
from optparse import OptionParser
#from AptUrl.Parser import parse
h = httplib2.Http()
host = 'http://localhost:8080/kuzenko-ws/api/'
def setHost(hostName) :
global host
host = hostName
def setDatabaseName(name) :
resp, content = h.request(host + 'database/' + n... | mit | 8,205,013,659,229,442,000 | 28.948454 | 132 | 0.582788 | false | 3.466587 | false | false | false |
rosspalmer/PerformanceTrack | tracker.py | 1 | 3755 | import csv
import datetime
import pickle
import psutil
import os
import sys
# Locations for storage and export files
DATA_STORE_FILE = 'data.pik' # Add folder path for data pickle
SYSTEM_DATA_EXTRACT_FILE = 'system_log.csv' # Add folder path for system data CSV extract
PROCESS_DATA_EXTRACT_FILE = 'process_log.csv' # ... | apache-2.0 | -6,550,446,624,911,820,000 | 29.04 | 113 | 0.65273 | false | 3.65628 | false | false | false |
sdolemelipone/django-crypsis | crypsis_tests/migrations/0008_auto_20180117_1130.py | 1 | 1097 | # Generated by Django 2.0.1 on 2018-01-17 11:30
import crypsis.models
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('crypsis_tests', '0007_auto_20171222_1155'),
]
operations = [
migrations.AlterModelOptions... | gpl-3.0 | 2,773,212,821,536,557,600 | 31.264706 | 175 | 0.58979 | false | 4.062963 | false | false | false |
dasbruns/netzob | src/netzob/Inference/Grammar/AutomataFactories/OneStateAutomataFactory.py | 1 | 4587 | # -*- coding: utf-8 -*-
#+---------------------------------------------------------------------------+
#| 01001110 01100101 01110100 01111010 01101111 01100010 |
#| |
#| Netzob : Inferring communication protocol... | gpl-3.0 | 978,344,859,303,798,100 | 51.079545 | 154 | 0.491381 | false | 5.014223 | false | false | false |
paolotozzo/SDIPy | sdipy/sender.py | 1 | 7318 | """
sender.py
by Charles Fracchia, Copyright (c) 2013
Sender class module
This class defines data and methods for the sender in a packet
"""
import re, warnings
allowedAttributes = ["name","brand","model","modelNum"] #In future, this could be loaded dynamically from a reference JSON
class Sender(object):
"... | mit | 6,683,428,774,023,159,000 | 52.423358 | 148 | 0.595655 | false | 4.470373 | false | false | false |
tebeka/pythonwise | macapp/humblecalc.py | 1 | 1479 | #!/usr/bin/env python
# Very humble calculator, written as "Web Desktop Application"
__author__ = "Miki Tebeka <miki@mikitebeka.com>"
from __future__ import division
from math import *
from operator import isNumberType
from BaseHTTPServer import HTTPServer
from SimpleHTTPServer import SimpleHTTPRequestHandler
from u... | bsd-3-clause | -1,853,744,245,115,174,100 | 29.183673 | 78 | 0.615281 | false | 3.811856 | false | false | false |
AlexStarov/Shop | applications/product/templatetags/block_product.py | 1 | 1391 | # -*- coding: utf-8 -*-
from django_jinja import library
from django.template.loader import render_to_string
__author__ = 'AlexStarov'
@library.global_function()
def block_products(products, request, ):
from django.middleware.csrf import get_token
request_csrf_token = get_token(request, )
# request_csrf_... | apache-2.0 | -2,443,777,753,299,930,600 | 38.742857 | 93 | 0.561467 | false | 4.091176 | false | false | false |
maya70/GraphMirrors | scripts/database/setup.py | 1 | 4731 | #!/usr/bin/python
# Reads from mysql database into a local sqlite database.
import mysql.connector
import sqlite3
import re
# Create Tables.
target = sqlite3.connect('data.db')
tc = target.cursor()
tc.execute('CREATE TABLE components (entity_id, component_id, component_type)')
tc.execute('CREATE TABLE reactions (r... | bsd-3-clause | -8,242,140,934,111,858,000 | 38.425 | 138 | 0.617628 | false | 3.570566 | false | false | false |
houseurmusic/my-swift | swift/common/client.py | 1 | 33831 | # Copyright (c) 2010-2011 OpenStack, LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | apache-2.0 | -1,593,031,386,800,875,800 | 37.313703 | 79 | 0.593627 | false | 4.150534 | false | false | false |
opennode/waldur-mastermind | src/waldur_mastermind/analytics/views.py | 1 | 3899 | import collections
from datetime import timedelta
from django.contrib.contenttypes.models import ContentType
from django.db.models.expressions import OuterRef, Subquery
from rest_framework import status, viewsets
from rest_framework.response import Response
from waldur_core.quotas.models import Quota
from waldur_core... | mit | -5,358,902,503,370,012,000 | 35.783019 | 81 | 0.631957 | false | 4.192473 | false | false | false |
Rubisk/mcedit2 | src/mcedit2/rendering/chunkmeshes/entitymesh.py | 1 | 4131 | """
${NAME}
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import logging
import numpy
from mcedit2.rendering import renderstates, scenegraph
from mcedit2.rendering.blockmeshes import standardCubeTemplates
from mcedit2.rendering.blockmeshes import ChunkMeshBase
from mcedit2.r... | bsd-3-clause | 7,563,492,981,460,571,000 | 33.140496 | 115 | 0.595013 | false | 4.181174 | false | false | false |
CingHu/neutron-ustack | neutron/plugins/mlnx/rpc_callbacks.py | 1 | 4229 | # Copyright 2013 Mellanox Technologies, 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 required by applicable law or agreed t... | apache-2.0 | 123,379,875,097,202,480 | 40.460784 | 78 | 0.569402 | false | 4.031459 | false | false | false |
datapythonista/pandas | pandas/core/internals/construction.py | 1 | 31013 | """
Functions for preparing various inputs passed to the DataFrame or Series
constructors before passing them to a BlockManager.
"""
from __future__ import annotations
from collections import abc
from typing import (
TYPE_CHECKING,
Any,
Hashable,
Sequence,
)
import warnings
import numpy as np
import n... | bsd-3-clause | -271,554,817,022,136,300 | 30.013 | 88 | 0.585077 | false | 3.960286 | false | false | false |
christophercrouzet/hienoi | hienoi/gui.py | 1 | 20220 | """Graphical user interface."""
import collections
import ctypes
import sdl2
import hienoi.renderer
from hienoi._common import GLProfile, GraphicsAPI, ParticleDisplay, UserData
from hienoi._vectors import Vector2i, Vector2f, Vector4f
class NavigationAction(object):
"""Enumerator for the current nagivation acti... | mit | 9,104,025,055,639,628,000 | 34.851064 | 79 | 0.574233 | false | 3.823752 | false | false | false |
arthurmensch/modl | modl/input_data/tests/test_image.py | 1 | 1754 | import numpy as np
from modl.input_data.image import scale_patches
from modl.input_data.image_fast import clean_mask, fill
from numpy.testing import assert_array_almost_equal, assert_array_equal
from sklearn.feature_extraction.image import extract_patches
from sklearn.utils import check_random_state
def test_scale_pa... | bsd-2-clause | -5,648,527,415,653,365,000 | 32.730769 | 75 | 0.611745 | false | 2.749216 | false | false | false |
charre2017idv/MathDinamita | Math_Lib/Math_Lib/Math_Lib.py | 1 | 28504 | import math
import os
n=0
print ("MATHLIB (TM)2017")
print ("-"*50)
print ("Las funciones que puede realizar la libreria son las siguientes:")
print ("")
'''En esta parte se crea el menú principal'''
print ("FUNCIONES BASICAS:")
print ("")
print ("-(1) Suma ")
print ("-(2) Multiplicacion ")
print ("-(... | gpl-3.0 | 2,029,962,430,459,301,400 | 40.139053 | 153 | 0.612203 | false | 2.982618 | false | false | false |
palfrey/coherence | coherence/upnp/devices/binary_light_client.py | 1 | 2116 | # Licensed under the MIT license
# http://opensource.org/licenses/mit-license.php
# Copyright 2008, Frank Scholz <coherence@beebits.net>
from coherence.upnp.services.clients.switch_power_client import SwitchPowerClient
from coherence import log
import coherence.extern.louie as louie
class BinaryLightClient(log.Log... | mit | 4,234,525,556,472,552,400 | 38.185185 | 130 | 0.657845 | false | 3.933086 | false | false | false |
kasmith/cbmm-project-christmas | python-trials/batchMakeTrials.py | 1 | 6661 | from __future__ import division, print_function
from physicsTable import *
from physicsTable.constants import *
import threading
import pygame as pg
import random, os, sys
import numpy as np
import json
defVel = 300
# modified trial folder:
#trialfolder = os.path.join('..','public_html','trials')
trialfolder = os.path... | mit | 3,735,357,943,701,721,600 | 33.692708 | 136 | 0.545714 | false | 3.471079 | false | false | false |
ezbake/ezbake-frontend | ezReverseProxy/TSSLSocket/TGeventServer.py | 1 | 1758 | # Copyright (C) 2013-2014 Computer Sciences 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-2.0
#
# Unless required by a... | apache-2.0 | 8,150,297,926,331,764,000 | 34.16 | 76 | 0.663823 | false | 4.277372 | false | false | false |
fcbond/OMW | omw/bin/load-pwn.py | 1 | 18238 | #!/usr/bin/python3
# This script loads PWN in the new OMW schema
# It requires Python3 and NLTK3 installed
import sqlite3, sys, nltk
from nltk.corpus import wordnet as wn
from collections import defaultdict as dd
### ToDo: add antonyms as synset links (?)
### ToDo: examples are being loaded as synset examples, chan... | mit | -2,236,290,472,514,885,400 | 32.240367 | 333 | 0.54278 | false | 2.982058 | false | false | false |
Kha/flask-admin | flask_admin/base.py | 1 | 20999 | import os.path as op
from functools import wraps
from flask import Blueprint, current_app, render_template, abort, g, url_for
from flask_admin import babel
from flask_admin._compat import with_metaclass, as_unicode
from flask_admin import helpers as h
# For compatibility reasons import MenuLink
from flask_admin.menu... | bsd-3-clause | -4,105,701,313,336,007,000 | 32.437898 | 120 | 0.54455 | false | 4.672675 | false | false | false |
barentsen/iphas-dr2 | scripts/release-preparation/augment-image-metadata.py | 1 | 3046 | """Script to create a user-friendly index of IPHAS image meta data.
"""
import numpy as np
from astropy.table import Table
from astropy.table import Column
from dr2.constants import IPHASQC
# Index of images found by the DR2 pipeline
# ie. produced by dr2.images.prepare_images()
t = Table.read('iphas-images-pipeline.f... | mit | 7,983,065,310,120,781,000 | 37.0875 | 115 | 0.673342 | false | 2.857411 | false | false | false |
aio-libs/aiohttp | aiohttp/worker.py | 1 | 7750 | """Async gunicorn worker for aiohttp.web"""
import asyncio
import os
import re
import signal
import sys
from types import FrameType
from typing import Any, Awaitable, Callable, Optional, Union # noqa
from gunicorn.config import AccessLogFormat as GunicornAccessLogFormat
from gunicorn.workers import base
from aiohtt... | apache-2.0 | -3,391,215,136,565,814,000 | 31.291667 | 85 | 0.600129 | false | 3.938008 | false | false | false |
mbourqui/django-publications-bootstrap | publications_bootstrap/migrations/0004_catalog_fk_publication.py | 1 | 1253 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2017-07-04 09:18
from __future__ import unicode_literals
from __future__ import unicode_literals
from django.db import migrations
from django.db import models
app_label = 'publications_bootstrap'
def forwards(apps, schema_editor):
Catalog = apps.get_model(... | mit | 7,605,762,743,376,821,000 | 28.139535 | 109 | 0.652035 | false | 4.218855 | false | false | false |
undocume/undocume | home/migrations/0004_auto__add_field_service_city.py | 1 | 6463 | # -*- 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 field 'Service.city'
db.add_column(u'home_service', 'city',
... | mit | -1,723,778,893,577,949,000 | 64.292929 | 126 | 0.540771 | false | 3.688927 | false | false | false |
dchad/malware-detection | vs/unpack.py | 1 | 37916 | ##############################################################
# Python script to attempt automatic unpacking/decrypting of #
# malware samples using WinAppDbg. #
# #
# unpack.py v2016.01.25 #
# htt... | gpl-3.0 | -5,576,724,572,586,196,000 | 29.260176 | 227 | 0.600406 | false | 3.42945 | false | false | false |
MyRobotLab/pyrobotlab | home/CheekyMonkey/tracking-arduino.py | 1 | 2678 | # A script to test opencv tracking in MyRobotLab with an Arduino connected to a Raspberry Pi 3
# as at mrl development build version 2489
# a mashup of code taken from Mats:
# https://github.com/MyRobotLab/pyrobotlab/blob/master/home/Mats/Tracking.py
# and also from Grog:
# http://myrobotlab.org/content/tracking-result... | apache-2.0 | -6,644,644,271,138,608,000 | 25.514851 | 102 | 0.754668 | false | 2.85197 | false | false | false |
tomsercu/metarunlog | metarunlog/util.py | 1 | 1967 | # Metarunlog, experiment management tool.
# Author: Tom Sercu
# Date: 2015-01-23
import datetime
import subprocess
def nowstring(sec=True, ms= False):
tstr = datetime.datetime.now().isoformat()
if not ms:
tstr = tstr.split('.')[0]
if not sec:
tstr = tstr.rsplit(':',1)[0]
return tstr
d... | mit | -735,737,418,120,828,800 | 30.725806 | 153 | 0.582613 | false | 3.414931 | false | false | false |
Seedstars/python-iso8583 | ISO8583/ISO8583.py | 1 | 56605 | """
(C) Copyright 2009 Igor V. Custodio
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
any later version.
This program is distributed in the hope that it will b... | gpl-3.0 | -8,084,716,628,131,540,000 | 45.057771 | 193 | 0.478809 | false | 3.995553 | false | false | false |
prattl/teamfinder | api/teams/api/views.py | 1 | 6335 | from common.api.permissions import IsStaffOrTeamCaptain
from common.models import Interest, Language, Position, TeamMember, Region
from teams.api.serializers import EditableFlatTeamSerializer, TeamSerializer, PlayerMembershipSerializer
from teams.models import Team
from rest_framework import permissions, status, viewse... | apache-2.0 | 5,376,675,978,768,944,000 | 42.993056 | 119 | 0.64562 | false | 4.496097 | false | false | false |
eduble/SimpleFilesystems | taggerfs/id3library.py | 1 | 2766 | #!/usr/bin/env python
"""
This module implements a management library for your
collection of ID3-tagged mp3 files.
"""
import os
from os.path import join
from mutagen.easyid3 import EasyID3
class ID3Library:
"""Library of ID3-tagged mp3 files."""
def __init__(self):
"""Constructor."""
self._data = {}
def getT... | lgpl-3.0 | -6,175,146,277,138,132,000 | 28.741935 | 86 | 0.665944 | false | 3.281139 | false | false | false |
HugoMMRabson/fonsa | src/my/installer/__init__.py | 1 | 14952 | #!/usr/bin/python3
"""
my.installer.__init__
# TESTING "PHASE ONE", ONE LINE AT A TIME...
import os
from willywonka_installer import *
from my.installer import *
args = Object()
args.skipalltools = True
args.platform = 'RaspberryPi3'
args.debugip = '192.168.251.112'
args.usegzipo = True
args.outfile = '%s/testout.i... | gpl-3.0 | -8,482,496,389,659,124,000 | 47.07717 | 158 | 0.617442 | false | 3.209272 | false | false | false |
kichiki/stokes | python/stnc2pov.py | 1 | 25797 | # stokes-netcdf to pov converter
# Copyright (C) 2006-2008 Kengo Ichiki <kichiki@users.sourceforge.net>
# $Id: stnc2pov.py,v 1.9 2008/06/03 02:57:43 kichiki Exp $
#
# 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 So... | gpl-2.0 | 2,668,609,146,056,144,000 | 30.730627 | 79 | 0.43571 | false | 2.906377 | false | false | false |
Tanmay28/coala | coalib/output/dbus/BuildDbusService.py | 1 | 1436 | from distutils.core import Command
from distutils.errors import DistutilsOptionError
from coalib.misc.Constants import Constants
class BuildDbusService(Command):
"""
Add a `build_dbus` command to your setup.py.
To use this Command class add a command to call this class::
# For setuptools
... | agpl-3.0 | 1,617,566,290,701,137,700 | 27.72 | 76 | 0.571727 | false | 4.432099 | false | false | false |
jorgebaier/iic1103-s4-2016 | clase0830/suma_digitos_primos.py | 1 | 1132 | import math
def suma_digitos(numero):
suma = 0
while numero > 0:
suma = suma + numero%10
numero = numero // 10
return suma
def esPrimo(n):
i = 1
divisores = 0
while i <= n:
if n%i == 0:
divisores = divisores + 1
i = i + 1
return divisores == 2
... | unlicense | -9,141,152,381,898,231,000 | 16.6875 | 48 | 0.484982 | false | 3.118457 | false | false | false |
nsfmc/swatch | swatch/writer.py | 1 | 4463 | # encoding: utf-8
"""
swatch, a parser for adobe swatch exchange files
Copyright (c) 2014 Marcos A Ojeda http://generic.cx/
With notes from
http://iamacamera.org/default.aspx?id=109 and
http://www.colourlovers.com/ase.phps
All Rights Reserved
MIT Licensed, see LICENSE.TXT for details
"""
import logging
import struct
... | mit | -4,765,099,113,358,125,000 | 35.719008 | 79 | 0.622327 | false | 3.583065 | false | false | false |
amenonsen/ansible | lib/ansible/modules/network/fortios/fortios_system_replacemsg_nac_quar.py | 1 | 10019 | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Lic... | gpl-3.0 | -8,324,616,875,064,963,000 | 28.72997 | 113 | 0.584489 | false | 4.167637 | false | false | false |
SCSSoftware/BlenderTools | addon/io_scs_tools/internals/containers/sii.py | 1 | 7631 | # ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed ... | gpl-2.0 | -3,206,173,954,677,148,700 | 36.406863 | 117 | 0.68261 | false | 3.966216 | false | false | false |
hmpf/nav | python/nav/event2.py | 2 | 3807 | #
# Copyright (C) 2015 Uninett AS
#
# This file is part of Network Administration Visualized (NAV).
#
# NAV is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License version 3 as published by
# the Free Software Foundation.
#
# This program is distributed in the hope... | gpl-3.0 | -7,836,915,006,604,692,000 | 35.605769 | 79 | 0.628054 | false | 4.076017 | false | false | false |
frozflame/molbiox | molbiox/execute/relational.py | 1 | 3111 | #!/usr/bin/env python3
# coding: utf-8
from __future__ import unicode_literals, print_function
import sys
import itertools
from molbiox.frame.command import Command
from molbiox.io import blast, tabular
"""
If your results come from more than 2 columns, use a SQL database instead.
"""
class CommandAggregate(Command)... | gpl-2.0 | 1,638,024,055,608,239,600 | 32.095745 | 74 | 0.573449 | false | 4.04026 | false | false | false |
Azure/azure-sdk-for-python | sdk/cognitiveservices/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/rating.py | 1 | 2017 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | mit | -4,623,109,599,950,055,000 | 32.616667 | 79 | 0.584036 | false | 4.228512 | false | false | false |
Wang-Sen/bdmap-app | draw.py | 1 | 1436 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
import datetime
import matplotlib.pyplot as plt
import argparse
import os
if __name__=='__main__':
parser = argparse.ArgumentParser(description='Draw pictures based on the data of input file.')
parser.add_argument('-i', '--ifile', type=str, required=True)
parse... | gpl-3.0 | -5,511,461,292,612,271,000 | 34.02439 | 98 | 0.501393 | false | 3.402844 | false | false | false |
wcong/ants | ants/http/request/rpc.py | 1 | 1073 | """
This module implements the XmlRpcRequest class which is a more convenient class
(that Request) to generate xml-rpc requests.
See documentation in docs/topics/request-response.rst
"""
import xmlrpclib
from ants.http.request import Request
from ants.utils.python import get_func_args
DUMPS_ARGS = get_func_args(xml... | bsd-3-clause | 4,317,994,134,569,879,000 | 29.657143 | 79 | 0.661696 | false | 3.988848 | false | false | false |
tulsluper/sanscript | apps/da/apps.py | 1 | 2212 | import os
from django.apps import AppConfig
from django.apps import apps
def samevalues(names):
records = []
for name in names:
if type(name) == str:
records.append({key: name for key in ['label', 'model', 'title']})
return records
pages = [
{'label': 'capacity', 'view': 'capacit... | gpl-3.0 | -1,206,674,240,758,519,800 | 30.6 | 107 | 0.607595 | false | 3.429457 | true | false | false |
rst2pdf/rst2pdf | doc/assets/flowables.py | 1 | 38576 | # -*- coding: utf-8 -*-
# See LICENSE.txt for licensing terms
__docformat__ = 'reStructuredText'
from copy import copy
import re
import sys
from xml.sax.saxutils import unescape
from reportlab.lib.enums import TA_CENTER, TA_RIGHT
from reportlab.lib.styles import ParagraphStyle
from reportlab.lib.units import cm
from... | mit | 4,092,100,191,561,448,400 | 33.077739 | 91 | 0.495697 | false | 4.132405 | false | false | false |
scribblemaniac/RenderChan | renderchan/contrib/mp3.py | 1 | 2027 |
__author__ = 'Konstantin Dmitriev'
from renderchan.module import RenderChanModule
from renderchan.utils import which
import subprocess
import os
import re
import random
class RenderChanMp3Module(RenderChanModule):
def __init__(self):
RenderChanModule.__init__(self)
if os.name == 'nt':
... | bsd-3-clause | -5,324,836,554,297,819,000 | 32.229508 | 114 | 0.601381 | false | 3.839015 | false | false | false |
flosse/hello-xmpp | python/sleekxmpp/client.py | 1 | 1260 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import logging
import sleekxmpp
# Python versions before 3.0 do not use UTF-8 encoding
# by default. To ensure that Unicode is handled properly
# throughout SleekXMPP, we will set the default encoding
# ourselves to UTF-8.
if sys.version_info < (3, 0):
from... | mit | -9,118,855,012,749,246,000 | 25.25 | 80 | 0.642063 | false | 3.342175 | false | false | false |
tell-k/pypi-updates | tests/test_bot.py | 1 | 11603 | # -*- coding: utf-8 -*-
"""
unit test for PypiUpdatesBot
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:author: tell-k <ffk2005@gmail.com>
:copyright: tell-k. All Rights Reserved.
"""
import mock
import pytest
import logbook
class DummyMemcache(object):
def __init__(self):
self._data = {}... | mit | 1,637,907,340,961,301,500 | 34.719136 | 84 | 0.536421 | false | 3.818212 | true | false | false |
ALSchwalm/python-prompt-toolkit | prompt_toolkit/buffer.py | 1 | 40824 | """
Data structures for the Buffer.
It holds the text, cursor position, history, etc...
"""
from __future__ import unicode_literals
from .completion import Completer, Completion, CompleteEvent
from .document import Document
from .enums import IncrementalSearchDirection
from .history import History, InMemoryHistory
fro... | bsd-3-clause | -6,038,432,106,492,722,000 | 35.223602 | 120 | 0.588698 | false | 4.353631 | false | false | false |
davidyack/Xrm.Tools.CRMWebAPI | python/setup.py | 1 | 1265 | #!/usr/bin/env python
'''The setup and build script for the python-crmwebapi library.'''
import os
from setuptools import setup, find_packages
def read(*paths):
"""Build a file path from *paths* and return the contents."""
with open(os.path.join(*paths), 'r') as f:
return f.read()
setup(
name='... | mit | -3,837,700,705,353,445,400 | 30.625 | 71 | 0.621344 | false | 4.041534 | false | false | false |
facebookresearch/Detectron | tools/convert_coco_model_to_cityscapes.py | 1 | 4289 | #!/usr/bin/env python
# Copyright (c) 2017-present, Facebook, 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 a... | apache-2.0 | -572,377,124,243,045,500 | 32.507813 | 80 | 0.639543 | false | 3.433947 | false | false | false |
rousseab/pymatgen | pymatgen/io/abinitio/abiobjects.py | 1 | 42855 | # coding: utf-8
"""
Low-level objects providing an abstraction for the objects involved in the calculation.
"""
from __future__ import unicode_literals, division, print_function
import collections
import abc
import six
import numpy as np
import pymatgen.core.units as units
from pprint import pformat
from monty.design... | mit | -4,362,257,695,082,234,400 | 32.958003 | 118 | 0.570389 | false | 3.623489 | false | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.