repo_name stringlengths 5 92 | path stringlengths 4 232 | copies stringclasses 19
values | size stringlengths 4 7 | content stringlengths 721 1.04M | 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 15 997 | alpha_frac float64 0.25 0.97 | autogenerated bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|
mpi2/PhenotypeData | external_tools/src/main/python/images/DeleteFilesNotInSolr.py | 1 | 8714 | #!/usr/bin/python
"""Delete file not in Solr ..."""
import os
import requests
import json
import sys
import os.path
import sys
import argparse
import shutil
from common import splitString
from DirectoryWalker import DirectoryWalker
import itertools
from OmeroPropertiesParser import OmeroPropertiesParser
responseFail... | apache-2.0 | -614,075,374,023,222,100 | 48.511364 | 337 | 0.697269 | false |
sajeeshcs/nested_projects_keystone | keystone/token/controllers.py | 1 | 20208 | # Copyright 2013 OpenStack Foundation
#
# 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 ... | apache-2.0 | 5,148,647,474,886,089,000 | 37.491429 | 79 | 0.566657 | false |
alshedivat/kgp | kgp/models.py | 1 | 8412 | """Gaussian Process models for Keras 2."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from keras.models import Model as KerasModel
from keras.engine.topology import _to_list
from keras.engine.training import _standardize_input_data
from .callbacks imp... | mit | -4,385,918,913,147,216,400 | 34.344538 | 83 | 0.551236 | false |
dstlmrk/catcher | catcher/api/middleware.py | 1 | 3340 | #!/usr/bin/python
# coding=utf-8
import falcon
import ujson
import json
from catcher import models
import datetime
from playhouse.shortcuts import model_to_dict
import logging
from catcher.models import User, NullUser
import peewee
class PeeweeConnection(object):
def process_request(self, req, resp):
mo... | mit | -6,470,274,050,978,394,000 | 29.372727 | 114 | 0.580539 | false |
CharlesGarrocho/MCC | computacao_movel/DTN/server.py | 1 | 2035 | import os
import json
import time
import socket
from threading import Thread
IPS = []
def trata_cliente(conexao, endereco):
requisicao = conexao.recv(1024)
print requisicao
if requisicao == 'LIST':
arqs = os.listdir('/etc/black/garagem/arquivos/')
conexao.send(json.dumps(arqs))
elif re... | apache-2.0 | 7,516,643,370,373,497,000 | 29.848485 | 86 | 0.58231 | false |
KE-works/pykechain | pykechain/models/property.py | 1 | 22270 | from typing import Any, List, Dict, Optional, Text, Union, Tuple, Iterable, TypeVar
import requests
from jsonschema import validate
from pykechain.defaults import API_EXTRA_PARAMS
from pykechain.enums import Category
from pykechain.exceptions import APIError, IllegalArgumentError
from pykechain.models import Base, Ba... | apache-2.0 | -9,096,772,522,678,147,000 | 41.098299 | 118 | 0.613022 | false |
jkyeung/XlsxWriter | xlsxwriter/test/comparison/test_chart_format08.py | 1 | 1699 | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2016, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparsion_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""... | bsd-2-clause | -4,284,780,156,729,032,000 | 24.742424 | 79 | 0.527369 | false |
ChantyTaguan/zds-site | zds/forum/tests.py | 1 | 34223 | # coding: utf-8
from django.conf import settings
from django.test import TestCase
from django.core.urlresolvers import reverse
from zds.utils import slugify
from zds.forum.factories import CategoryFactory, ForumFactory, \
TopicFactory, PostFactory
from zds.member.factories import ProfileFactory, StaffProfileFact... | gpl-3.0 | 6,291,033,389,545,015,000 | 38.102857 | 111 | 0.594272 | false |
allrod5/extra-trees | benchmarks/classification/decision_surface.py | 1 | 4826 | print(__doc__)
# Code source: Gaël Varoquaux
# Andreas Müller
# Modified for MCZA015-13 class project by Rodrigo Martins de Oliveira
# License: BSD 3 clause
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.colors import ListedColormap
from sklearn.datasets import make_circles
from skle... | mit | 2,900,732,538,703,332,000 | 31.375839 | 78 | 0.63806 | false |
KonradBreitsprecher/espresso | samples/load_checkpoint.py | 1 | 1891 | from __future__ import print_function
import espressomd
from espressomd import checkpointing
checkpoint = checkpointing.Checkpointing(checkpoint_id="mycheckpoint")
checkpoint.load()
# necessary for using e.g. system.actors, since explicit checkpointing of actors is not implemented yet
system = espressomd.System(box_l... | gpl-3.0 | -1,866,564,892,776,036,400 | 35.365385 | 135 | 0.712322 | false |
F483/gravur | gravur/common/abstractscrollview.py | 1 | 1148 | # coding: utf-8
# Copyright (c) 2015 Fabian Barkhau <fabian.barkhau@gmail.com>
# License: MIT (see LICENSE file)
from kivy.uix.gridlayout import GridLayout
from kivy.uix.scrollview import ScrollView
class AbstractScrollView(ScrollView):
def __init__(self, *args, **kwargs):
# Setup scroll view
... | mit | 1,983,399,102,228,169,200 | 29.210526 | 65 | 0.568815 | false |
reetawwsum/Machine-Translation | utils/batchGenerator.py | 1 | 2290 | from __future__ import print_function
from __future__ import absolute_import
import random
import numpy as np
import config
from utils.dataset import Dataset
class BatchGenerator():
'''Generate Batches'''
def __init__(self):
self.batch_size = config.FLAGS.batch_size
self.buckets = buckets = config.BUCKETS
se... | mit | -3,227,155,912,839,335,000 | 34.78125 | 138 | 0.706114 | false |
mattgrogan/ledmatrix | sensor_ui/rotary_encoder.py | 1 | 3290 | from gpiozero import Button
class RotaryEncoder:
"""
Decode mechanical rotary encoder pulses.
The following example will print a Rotary Encoder change direction
from gpiozero import RotaryEncoder
def change(value):
if value == 1:
print("clockwise")... | mit | -656,385,531,200,333,000 | 30.254902 | 85 | 0.419149 | false |
dougbenjamin/panda-harvester | pandaharvester/harvestercore/db_proxy.py | 1 | 241342 | """
database connection
"""
import os
import re
import sys
import copy
import random
import inspect
import time
import datetime
import threading
from future.utils import iteritems
from .command_spec import CommandSpec
from .job_spec import JobSpec
from .work_spec import WorkSpec
from .file_spec import FileSpec
from ... | apache-2.0 | 825,545,955,905,895,200 | 44.390634 | 119 | 0.493884 | false |
Remi-C/LOD_ordering_for_patches_of_points | script/test_octree_LOD.py | 1 | 7481 | # -*- coding: utf-8 -*-
"""
Created on Tue Dec 2 22:08:22 2014
@author: remi
"""
#trying to order points by octree with python
from numpy import random, sqrt
from sklearn import preprocessing
import matplotlib.pyplot as plt
#defining a dummy entry :a random 3D pointcloud
pointcloud = random.rand(16*16,2);
index =... | lgpl-3.0 | 6,503,298,321,312,166,000 | 31.672489 | 137 | 0.586285 | false |
maxive/erp | addons/mail/models/update.py | 12 | 5056 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import datetime
import logging
import requests
import werkzeug.urls
from ast import literal_eval
from odoo import api, release, SUPERUSER_ID
from odoo.exceptions import UserError
from odoo.models import AbstractModel
... | agpl-3.0 | -3,973,846,673,264,079,000 | 40.442623 | 140 | 0.584652 | false |
mgr01/antfs-cli | setup.py | 1 | 2385 | # antfs-cli distutils setup script
#
# Copyright (c) 2012, Gustav Tiger <gustav@tiger.name>
#
# 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... | mit | -6,343,828,656,502,855,000 | 38.098361 | 85 | 0.67631 | false |
sclaggett/NetworkMonitor | src/PingThread.py | 1 | 5327 | """ PingThread.py
Thread that pings the target server """
# Imports
import NetworkMonitor
import re
import ThreadBase
import time
import subprocess
class PingThread(ThreadBase.ThreadBase):
def __init__(self, platform, targetServer, interval, logFile, outputFile):
"""Constructor"""
# Initialize va... | cc0-1.0 | 8,206,923,105,654,178,000 | 47.427273 | 177 | 0.575934 | false |
ZeitOnline/zeit.cms | src/zeit/cms/workingcopy/workingcopy.py | 1 | 5395 | import grokcore.component
import z3c.traverser.interfaces
import zeit.cms.workingcopy.interfaces
import zope.app.container.btree
import zope.app.security.interfaces
import zope.component
import zope.dublincore.interfaces
import zope.interface
import zope.publisher.interfaces
import zope.security.interfaces
import zope.... | bsd-3-clause | -4,825,881,447,363,589,000 | 34.032468 | 78 | 0.653383 | false |
joaduo/mepinta | plugins/c_and_cpp/k3dv1/plugins_tests/inotify_tests/SelectFaceByNumber_test.py | 1 | 2567 | # -*- coding: utf-8 -*-
'''
Mepinta
Copyright (c) 2011-2012, Joaquin G. Duo
This file is part of Mepinta.
Mepinta 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 opti... | gpl-3.0 | 727,680,934,833,170,600 | 37.893939 | 102 | 0.721465 | false |
adamwiggins/cocos2d | cocos/actions/interval_actions.py | 2 | 20878 | # ----------------------------------------------------------------------------
# cocos2d
# Copyright (c) 2008 Daniel Moisset, Ricardo Quesada, Rayentray Tappa, Lucio Torre
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the follow... | bsd-3-clause | -743,601,364,381,472,400 | 27.757576 | 101 | 0.563943 | false |
tiagocoutinho/bliss | bliss/controllers/lima/__init__.py | 1 | 6837 | # -*- coding: utf-8 -*-
#
# This file is part of the bliss project
#
# Copyright (c) 2016 Beamline Control Unit, ESRF
# Distributed under the GNU LGPLv3. See LICENSE for more info.
import importlib
from bliss.common.tango import DeviceProxy
from bliss.config import settings
from .bpm import Bpm
from .roi import Roi, Ro... | lgpl-3.0 | 6,689,777,223,001,568,000 | 32.028986 | 92 | 0.539857 | false |
reinhrst/aio-s3 | aios3/bucket.py | 1 | 14612 | import datetime
import hmac
import base64
import hashlib
import asyncio
from xml.etree.ElementTree import fromstring as parse_xml
from xml.etree.ElementTree import tostring as xml_tostring
from xml.etree.ElementTree import Element, SubElement
from functools import partial
from urllib.parse import quote
import aiohttp
... | mit | 5,031,407,894,351,788,000 | 32.981395 | 88 | 0.536408 | false |
mendersoftware/integration | testutils/infra/container_manager/docker_manager.py | 1 | 1777 | # Copyright 2021 Northern.tech AS
#
# 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 ag... | apache-2.0 | 3,428,999,405,347,108,000 | 33.843137 | 84 | 0.642656 | false |
jmesteve/openerpseda | openerp/addons_extra/point_of_sale/__openerp__.py | 1 | 4171 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 | 6,856,412,445,368,254,000 | 36.241071 | 157 | 0.61544 | false |
shirtsgroup/pygo | package/writetopdb.py | 1 | 4226 | import numpy
import pdb
'''This module contains various I/O helper methods'''
def get_coord(filename):
f = file(filename,'r')
# first count number of atoms to instantiate coord array
n = 0
for line in f:
if 'ATOM' in line:
n += 1
coord = numpy.empty((n,3))
pdb_text = [] # w... | gpl-2.0 | -6,812,921,427,290,016,000 | 27.554054 | 103 | 0.561524 | false |
MobinRanjbar/hue | desktop/libs/notebook/src/notebook/management/commands/notebook_setup.py | 1 | 1828 | #!/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,704,254,534,951,915,800 | 34.843137 | 102 | 0.745077 | false |
suyashphadtare/test | erpnext/accounts/report/financial_statements.py | 1 | 7698 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _, _dict
from frappe.utils import (flt, getdate, get_first_day, get_last_day,
add_months, add_days, formatdate)
de... | agpl-3.0 | -3,243,688,243,815,596,500 | 29.426877 | 112 | 0.669654 | false |
wgong/open_source_learning | learn_stem/python/utilities/nb2to3.py | 1 | 2569 | #!/usr/bin/env python3
"""
To run: python3 nb2to3.py notebook-or-directory
"""
# Authors: Thomas Kluyver, Fernando Perez
# See: https://gist.github.com/takluyver/c8839593c615bb2f6e80
# found at https://stackoverflow.com/questions/20651502/ipython-code-migration-from-python-2-to-python-3
import argparse
impo... | apache-2.0 | 8,255,359,468,792,053,000 | 29.353659 | 104 | 0.571818 | false |
duncanwp/cis_plugins | hadgem_unknown_vars.py | 1 | 2736 | __author__ = 'watson-parris'
from cis.data_io.products.HadGEM import HadGEM_PP
import logging
class HadGEM_unknown_vars(HadGEM_PP):
def get_variable_names(self, filenames, data_type=None):
import iris
import cf_units as unit
from cis.utils import single_warnings_only
# Removes war... | lgpl-3.0 | -1,136,911,862,083,071,600 | 43.129032 | 116 | 0.595395 | false |
frigg/frigg-settings | setup.py | 1 | 1053 | # -*- encoding: utf8 -*-
import re
from setuptools import find_packages, setup
def _read_long_description():
try:
import pypandoc
return pypandoc.convert('README.md', 'rst', format='markdown')
except Exception:
return None
version = ''
with open('frigg_settings/__init__.py', 'r') as... | mit | 5,776,911,896,159,276,000 | 23.488372 | 76 | 0.598291 | false |
puttarajubr/commcare-hq | corehq/ex-submodules/phonelog/models.py | 1 | 1259 | from dimagi.ext.couchdbkit import Document
from django.db import models
COUCH_UUID_MAX_LEN = 50
class DeviceReportEntry(models.Model):
xform_id = models.CharField(max_length=COUCH_UUID_MAX_LEN, db_index=True)
i = models.IntegerField()
msg = models.TextField()
type = models.CharField(max_length=32, db... | bsd-3-clause | 4,064,221,458,120,337,000 | 33.972222 | 87 | 0.683082 | false |
abacuspix/NFV_project | Instant_Flask_Web_Development/sched/forms.py | 1 | 1083 | """Forms to render HTML input & validate request data."""
from wtforms import Form, BooleanField, DateTimeField, PasswordField
from wtforms import TextAreaField, TextField
from wtforms.validators import Length, required
class AppointmentForm(Form):
"""Render HTML input for Appointment model & validate submission... | mit | 1,323,436,043,198,504,700 | 36.344828 | 77 | 0.722068 | false |
sgraham/nope | tools/telemetry/telemetry/core/browser_options.py | 1 | 15297 | # Copyright 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import copy
import logging
import optparse
import os
import shlex
import socket
import sys
from telemetry.core import browser_finder
from telemetry.core imp... | bsd-3-clause | -5,856,942,632,231,719,000 | 36.038741 | 80 | 0.642675 | false |
czcorpus/kontext | lib/corplib/fallback.py | 1 | 3332 | # Copyright (c) 2013 Institute of the Czech National Corpus
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; version 2
# dated June, 1991.
#
# This program is distributed in the hope that it wi... | gpl-2.0 | -8,455,687,116,255,003,000 | 21.066225 | 82 | 0.602941 | false |
phantomii/restalchemy | restalchemy/tests/functional/restapi/ra_based/microservice/routes.py | 1 | 1858 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2016 Eugene Frolov <eugene@frolov.net.ru>
#
# 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
#
# ... | apache-2.0 | 4,405,113,161,361,378,300 | 31.034483 | 78 | 0.708827 | false |
Joshuaalbert/IonoTomo | src/ionotomo/tomography/linear_operators.py | 1 | 4255 | import tensorflow as tf
import numpy as np
from ionotomo.settings import TFSettings
from ionotomo.tomography.interpolation import RegularGridInterpolator
from ionotomo.tomography.integrate import simps
class RayOp(object):
r"""Linear operator that performs for any v(x)
h[i1,...,ir] = \int_R[i1,...,ir]... | apache-2.0 | 3,722,212,576,356,630,000 | 38.398148 | 103 | 0.601175 | false |
keflavich/pyspeckit-obsolete | examples/sn_example.py | 1 | 6163 | """
Example demonstrating how to fit a complex H-alpha profile after subtracting off a satellite line
(in this case, He I 6678.151704)
"""
import pyspeckit
sp = pyspeckit.OpticalSpectrum('sn2009ip_halpha.fits')
# start by plotting a small region around the H-alpha line
sp.plotter(xmin=6100,xmax=7000,ymax=2.23,ymin=0... | mit | 3,298,661,510,037,429,000 | 46.775194 | 170 | 0.727568 | false |
miha-skalic/ITEKA | qt_design/twosubstr/load_data_ds.py | 1 | 8845 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'load_data_ds.ui'
#
# Created: Fri Jun 12 17:18:39 2015
# by: PyQt4 UI code generator 4.11.3
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except A... | gpl-3.0 | 7,131,237,885,029,008,000 | 52.932927 | 103 | 0.705483 | false |
jor-/scipy | scipy/optimize/minpack.py | 1 | 34280 | from __future__ import division, print_function, absolute_import
import threading
import warnings
from . import _minpack
import numpy as np
from numpy import (atleast_1d, dot, take, triu, shape, eye,
transpose, zeros, prod, greater, array,
all, where, isscalar, asarray, inf, abs,... | bsd-3-clause | 6,488,476,498,677,419,000 | 36.423581 | 91 | 0.587456 | false |
ARUNSOORAJPS/flipkart_gridlock | src/main.py | 1 | 2686 | # -*- coding: utf-8 -*-
# @Author: chandan
# @Date: 2017-07-08 00:32:09
# @Last Modified by: chandan
# @Last Modified time: 2017-07-08 11:13:46
from data_utils import read_file
from config import DATA_DIR, SCORE_COLUMNS
import os
from model import train_model, test_model
import pandas as pd
import numpy as np
fr... | mit | 2,656,051,572,428,761,000 | 23.87963 | 63 | 0.657856 | false |
Altoidnerd/paradichlorobenzene5 | 17.volume_dependence/creation_of_volume_aletered_pwis/experimental/matrix.dev.py | 1 | 15350 | #!/usr/bin/env python3
#################################################################################
# #
# Copyright (c) 2016 Allen Majewski (altoidnerd) #
# Permission is hereby granted, free of charge, to any person obtaining a #
# copy of this software and associated documentation files (the "Softw... | gpl-3.0 | -2,822,358,396,394,891,300 | 26.264654 | 153 | 0.587752 | false |
felix021/mixo | mixo.py | 1 | 6871 | #!/usr/bin/python
import sys
import struct
import random
import signal
try:
import gevent
from gevent import socket
from gevent.server import StreamServer
from gevent.socket import create_connection, gethostbyname
except:
print >>sys.stderr, "please install gevent first!"
sys.exit(1)
import ... | unlicense | -23,230,266,414,420,976 | 29.537778 | 90 | 0.569495 | false |
MMunibas/FittingWizard | scripts/esp-fit/src/pun2charmmlpun.py | 1 | 2045 | #!/usr/bin/env python
#
# Copyright 2013 Tristan Bereau and Christian Kramer
#
# 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... | bsd-3-clause | -4,360,621,419,761,082,000 | 25.558442 | 89 | 0.652323 | false |
franklingu/leetcode-solutions | questions/largest-rectangle-in-histogram/Solution.py | 1 | 1401 | """
Given n non-negative integers representing the histogram's bar height where the width of each bar is 1, find the area of largest rectangle in the histogram.

Above is a histogram where width of each bar is 1, given height = [2,1,5,6,2,3].
![... | mit | -5,462,530,115,053,818,000 | 27.591837 | 156 | 0.532477 | false |
Hearen/OnceServer | pool_management/bn-xend-core/xend/NetworkMonitor.py | 1 | 1832 | import logging
log = logging.getLogger("network")
log.setLevel(logging.DEBUG)
file_handle = logging.FileHandler("/var/log/xen/network.log")
log.addHandler(file_handle)
def test_ip(ip):
import os
import subprocess
cmd = 'ping -w 3 %s' % ip
re = subprocess.call(cmd, shell=True)
if re:
return ... | mit | -6,437,564,913,411,883,000 | 28.548387 | 111 | 0.540393 | false |
andigena/payloadbf | docs/conf.py | 1 | 1332 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'sphinx.ext.coverage',
'sphinx.ext.extlinks',
'sphinx.ext.ifconfig',
'sphinx.ext.napoleon',
'sphinx.ext.todo',
'sphinx.ext.viewcode',
]
if os.getenv... | mit | 2,928,228,183,442,226,000 | 24.615385 | 70 | 0.652402 | false |
anthraxx/diffoscope | tests/comparators/test_tar.py | 1 | 2690 | # -*- coding: utf-8 -*-
#
# diffoscope: in-depth comparison of files, archives, and directories
#
# Copyright © 2015 Jérémy Bobbio <lunar@debian.org>
#
# diffoscope 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 | 6,385,787,016,016,936,000 | 36.319444 | 88 | 0.747674 | false |
tertychnyy/rrcki-backup | lib/rrckibackup/BKPSite.py | 1 | 1514 | import json
import sys
from BKPLogger import BKPLogger
def getJSON(filepath):
json_data = open(filepath)
data = json.load(json_data)
json_data.close()
return data
class BKPSite:
def __init__(self, path):
#logger
_logger = BKPLogger().getLogger('BKPSite')
s... | gpl-2.0 | 6,836,492,775,590,052,000 | 25.103448 | 69 | 0.5 | false |
tomasbasham/ratelimit | ratelimit/decorators.py | 1 | 4409 | '''
Rate limit public interface.
This module includes the decorator used to rate limit function invocations.
Additionally this module includes a naive retry strategy to be used in
conjunction with the rate limit decorator.
'''
from functools import wraps
from math import floor
import time
import sys
import threading
... | mit | -1,125,524,861,554,458,100 | 35.438017 | 98 | 0.629621 | false |
hightower8083/chimeraCL | chimeraCL/frame.py | 1 | 2133 | import numpy as np
class Frame():
def __init__(self, configs_in, comm=None):
self._process_configs(configs_in)
def _process_configs(self, configs_in):
self.Args = configs_in
if 'Steps' not in self.Args:
self.Args['Steps'] = 1.
if 'Velocity' not in self.Args:
... | gpl-3.0 | 7,726,507,622,837,051,000 | 32.328125 | 75 | 0.532583 | false |
mice-software/maus | bin/analyze_data_online.py | 1 | 14624 | #!/usr/bin/env python
# This file is part of MAUS: http://micewww.pp.rl.ac.uk:8080/projects/maus
#
# MAUS 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 op... | gpl-3.0 | 3,474,413,742,253,010,000 | 35.019704 | 80 | 0.594434 | false |
verilylifesciences/purplequery | purplequery/statement_grammar.py | 1 | 1486 | # Copyright 2019 Verily Life Sciences LLC
#
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
"""Grammar for BigQuery statements."""
from .grammar import expression, query_expression
from .query_helper import separated_sequence
from .statements import CreateTable, Cr... | bsd-3-clause | -110,670,517,762,715,200 | 31.304348 | 71 | 0.595559 | false |
palankai/dddcrud | app/handlers.py | 1 | 1175 | from .events import ContactCreated, ContactUpdated, ContactDeleted
from .policy import policy, PhoneNumberLongEnough
@policy(PhoneNumberLongEnough())
class CreateContactHandler:
def __init__(self, repo, bus):
self.repo = repo
self.bus = bus
def __call__(self, cmd):
self.repo.create(cm... | mit | -8,243,245,142,680,655,000 | 22.039216 | 72 | 0.629787 | false |
servetus/pycofi | pycofi/queries.py | 1 | 1056 | from numpy import matrix, asarray, apply_along_axis
from numpy.linalg import norm
import simplejson
def get_top_items(user_index, items, Theta, X, item_mean=None, R_filter=None):
if R_filter == None:
R_filter = set([])
scores = X[user_index,:] * Theta
if(item_mean != None):
scores = mat... | mit | 5,900,448,722,124,836,000 | 24.756098 | 78 | 0.632576 | false |
igurrutxaga/tvalacarta | python/main-classic/platformcode/xbmctools.py | 1 | 44101 | # -*- coding: utf-8 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# XBMC Tools
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#------------------------------------------------------------
import urllib, urllib2
import xbmc
import xbmcgui
import xbmcplugin
im... | gpl-3.0 | 4,295,399,911,927,702,000 | 49.429553 | 514 | 0.624713 | false |
boisde/Greed_Island | openapi_doc/lazy_cat_open_api_pick_up.py | 1 | 5348 | # coding=utf-8
def auth():
"""
@apiDefine AuthHeader
@apiHeaderExample Auth-Header-Example
{
"Authorization": "token 5b42e18555c11dbf2c31403ea6b706a6"
}
@apiHeader {string} Authorization 验证身份,格式为"token <token>",注意"token"后面需要一个空格, 请联系我们取得测试token.
... | mit | 2,032,496,956,239,848,700 | 34.435484 | 114 | 0.569413 | false |
robiame/AndroidGeodata | pil/ImageColor.py | 1 | 7665 | #
# The Python Imaging Library
# $Id$
#
# map CSS3-style colour description strings to RGB
#
# History:
# 2002-10-24 fl Added support for CSS-style color strings
# 2002-12-15 fl Added RGBA support
# 2004-03-27 fl Fixed remaining int() problems for Python 1.5.2
# 2004-07-19 fl Fixed gray/grey spelling ... | mit | -670,456,465,135,821,300 | 27.144487 | 73 | 0.515982 | false |
INSEBRE/lanparty.iesebre.com | test/fcgi/fcgi.py | 1 | 15432 | #!/usr/bin/python
#------------------------------------------------------------------------
# Copyright (c) 1998 by Total Control Software
# All Rights Reserved
#------------------------------------------------------------------------
#
# Module Name: fcgi.py
#
# Descripti... | gpl-2.0 | 788,579,133,595,370,900 | 33.072727 | 91 | 0.463971 | false |
W4ngatang/DocumentSummarizer | postprocess/gen_preds.py | 1 | 3663 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Create the data for the LSTM.
"""
import os
import sys
import argparse
import numpy as np
import h5py
import itertools
import pdb
import re
from collections import defaultdict
def gen_preds(args, gold=0):
if not gold:
try:
k = args.k
... | mit | -3,497,275,557,048,698,400 | 41.103448 | 123 | 0.568387 | false |
letouriste001/SmartForest_2.0 | python3.4Smartforest/lib/python3.4/site-packages/django/utils/encoding.py | 1 | 10090 | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals
import codecs
import datetime
import locale
from decimal import Decimal
from django.utils import six
from django.utils.functional import Promise
from django.utils.six.moves.urllib.parse import quote, unquote
if six.PY3:
from urllib.parse import un... | mit | 3,089,730,319,248,334,000 | 34.900356 | 81 | 0.619151 | false |
DavidHHShao/slack | tests/unit/files/test_list.py | 2 | 1462 | # Copyright (c) 2014 Katsuya Noguchi
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish, dis... | mit | 7,748,754,576,475,866,000 | 37.473684 | 74 | 0.743502 | false |
eirannejad/pyRevit | pyrevitlib/pyrevit/output/__init__.py | 1 | 23733 | """Provide access to output window and its functionality.
This module provides access to the output window for the currently running
pyRevit command. The proper way to access this wrapper object is through
the :func:`get_output` of :mod:`pyrevit.script` module. This method, in return
uses the `pyrevit.output` module t... | gpl-3.0 | 1,745,673,272,930,747,100 | 32.008345 | 102 | 0.577845 | false |
KirarinSnow/Google-Code-Jam | World Finals 2010/D.py | 1 | 1649 | #!/usr/bin/env python
#
# Problem: Travel Plan
# Language: Python
# Author: KirarinSnow
# Usage: python thisfile.py <input.in >output.out
for case in range(int(raw_input())):
n = int(raw_input())
x = map(int, raw_input().split())
f = int(raw_input())
x.sort()
if 2*(x[n-1]-x[0]) > f:
... | gpl-3.0 | -9,187,201,303,024,424,000 | 25.596774 | 65 | 0.299576 | false |
smogol66/radiopy | settingsjson.py | 1 | 2432 | import json
settings_json = json.dumps([
{'type': 'title',
'title': 'Base title'},
{'type': 'numeric',
'title': 'Startup volume',
'desc': 'Default volume at boot',
'section': 'Base',
'key': 'startupvolume'},
{'type': 'path',
'title': 'Media path',
'desc': 'Path to the mus... | gpl-3.0 | 5,109,011,461,259,409,000 | 29.4 | 106 | 0.521382 | false |
pulsar-chem/Pulsar-Core | test/system/TestAtom.py | 1 | 1937 | import pulsar as psr
def run_test():
tester=psr.PyTester("Testing the Atom class")
H, H2=psr.create_atom([0.0,0.0,0.0],1), psr.create_atom([0.0,0.0,0.0],1,1)
tester.test_return("create_atom works",True,True,H.__eq__,H2)
tester.test_equal("correct Z",1,H.Z)
tester.test_equal("correct isotope",1,H.i... | bsd-3-clause | 1,443,255,930,028,945,400 | 46.243902 | 80 | 0.68921 | false |
Harvard-ATG/media_management_lti | media_manager/urls.py | 1 | 1193 | """media_manager URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/{{ docs_version }}/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, na... | bsd-3-clause | -1,802,701,804,387,765,000 | 40.137931 | 77 | 0.69321 | false |
gymnasium/edx-platform | common/djangoapps/student/views/management.py | 1 | 59233 | """
Student Views
"""
import datetime
import json
import logging
import uuid
import warnings
from collections import namedtuple
import analytics
import dogstats_wrapper as dog_stats_api
from bulk_email.models import Optout
from courseware.courses import get_courses, sort_by_announcement, sort_by_start_date
from djang... | agpl-3.0 | 8,491,777,773,612,389,000 | 39.850345 | 126 | 0.656864 | false |
rajashreer7/autotest-client-tests | linux-tools/nss_pam_ldapd/nss_pam_ldapd.py | 3 | 1154 | #!/bin/python
import os, subprocess
import logging
from autotest.client import test
from autotest.client.shared import error
class nss_pam_ldapd(test.test):
"""
Autotest module for testing basic functionality
of nss_pam_ldapd
@author
"""
version = 1
nfail = 0
path = ''
def init... | gpl-2.0 | -7,909,553,592,994,969,000 | 23.553191 | 96 | 0.551127 | false |
tectronics/brahms-md | analysisScripts/general/getAverageProfile.py | 1 | 1548 | #!/usr/bin/python2
# Julien Michel june 2007
# usage is getAverageProfile.py file1.dat file2.dat file3.dat
# where fileX can be an electron density profile, or a lateral pressure profile.
# can probably be used for other outputs like electron pressure profile etc...
import os,sys
averages = []
resized = False
for f... | gpl-3.0 | -5,348,391,275,696,439,000 | 24.377049 | 80 | 0.540698 | false |
gsnedders/Template-Python | t/directory_test.py | 1 | 5161 | import os
from template.test import TestCase, main
class DirectoryTest(TestCase):
def testDirectory(self):
vars = { 'cwd': os.getcwd(),
'dir': 'test/dir',
'dot': '../..' }
self.Expect(DATA, None, vars)
# The final test is commented out, due to lack of VIEW support.
DATA = r"""
-... | artistic-2.0 | 2,206,214,656,264,825,000 | 19.726908 | 88 | 0.450494 | false |
crypotex/taas | taas/user/forms.py | 1 | 4141 | from django import forms
from django.contrib.auth import forms as auth_forms, get_user_model
from django.utils.translation import ugettext_lazy as _
class UserCreationForm(auth_forms.UserCreationForm):
required_css_class = 'required'
password1 = forms.CharField(label=_("Password"), min_length=8, max_length=6... | gpl-2.0 | 6,816,467,417,513,750,000 | 39.203883 | 118 | 0.602753 | false |
zhaochao/fuel-web | nailgun/nailgun/objects/role.py | 1 | 3212 | # -*- coding: utf-8 -*-
# Copyright 2015 Mirantis, 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 requi... | apache-2.0 | 5,119,622,813,998,003,000 | 29.884615 | 78 | 0.665006 | false |
apache/airflow | airflow/contrib/operators/sqoop_operator.py | 2 | 1140 | #
# 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 | 3,177,801,697,294,219,000 | 39.714286 | 98 | 0.769298 | false |
marmyshev/transitions | openlp/plugins/songs/forms/songmaintenancedialog.py | 1 | 9854 | # -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# ------------------------------------------------------... | gpl-2.0 | 908,024,984,709,142,800 | 62.153846 | 106 | 0.68717 | false |
jia-kai/hearv | disp_freq.py | 1 | 1942 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
# $File: disp_freq.py
# $Date: Sun Nov 23 12:45:25 2014 +0800
# $Author: jiakai <jia.kai66@gmail.com>
import matplotlib.pyplot as plt
import numpy as np
import argparse
import json
def main():
parser = argparse.ArgumentParser()
parser.add_argument('fpath', help=... | unlicense | 6,850,090,640,253,229,000 | 29.34375 | 77 | 0.57827 | false |
pu6ki/elsyser | elsyser/settings.py | 1 | 4974 | """
Django settings for elsyser project.
Generated by 'django-admin startproject' using Django 1.10.2.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/
"""
import os... | mit | -2,167,837,604,075,419,100 | 23.502463 | 91 | 0.681946 | false |
moertle/pyaas | pyaas/web/auth/facebook.py | 1 | 2166 |
import datetime
import pyaas
import tornado.auth
#
# Facebook Authentication
#
FBURL = '%s://%s/login/facebook?next=%s'
class Facebook(tornado.web.RequestHandler, tornado.auth.FacebookGraphMixin):
@tornado.web.asynchronous
def get(self):
redir = tornado.escape.url_escape(self.get_argument('next',... | mit | -3,376,014,447,902,641,000 | 29.942857 | 78 | 0.519391 | false |
ansp-2015/arquea | protocolo/forms.py | 1 | 13060 | # -*- coding: utf-8 -*-
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from django import forms
from django.forms.utils import ErrorList
from django.utils.translation ... | mpl-2.0 | 6,822,829,020,151,119,000 | 44.582456 | 120 | 0.589331 | false |
Agrajag-Petunia/existential-romantic-novel | run.py | 1 | 1939 | from datetime import datetime
from src.textgenerator import TextGenerator
from src.utils import extract_project_gutenberg_novel, remove_titles
# The source files to use
# NOTE: Ulysses makes the generated text just a little too weird.
files = [
'./data/life_and_amours.txt',
'./data/memoirs_of_fanny_hill.txt',... | mit | -3,681,694,281,724,751,400 | 31.316667 | 74 | 0.636411 | false |
vshandubey/movie-database | ui/home/MovieTable.py | 1 | 2833 |
from PyQt4 import QtGui, QtCore
from core.repository import MovieRepository
import core.Constants as Constants
class MovieTable(QtGui.QTableWidget):
def __init__(self, mainWindow):
self.mainWindow = mainWindow
super(MovieTable, self).__init__()
#Init database
se... | apache-2.0 | 7,562,268,095,940,497,000 | 35.320513 | 92 | 0.606777 | false |
gbugaisky/bimm_185_conotoxin | wip-scripts_data/kNNProc.py | 1 | 1321 | #!usr/bin/env/python
import numpy as np
import pylab as pl
from matplotlib.colors import ListedColormap
from sklearn import neighbors
def kNNGen(trainfile, testfile):
features = np.genfromtxt(trainfile, delimiter=' ', usecols=(0, 1, 2))
labels = np.genfromtxt(trainfile, delimiter=' ', usecols=(-1))
tests = np.genf... | gpl-2.0 | 6,156,723,284,375,252,000 | 33.789474 | 118 | 0.695685 | false |
jeromekelleher/msprime | msprime/ancestry.py | 1 | 80216 | #
# Copyright (C) 2015-2021 University of Oxford
#
# This file is part of msprime.
#
# msprime 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 v... | gpl-3.0 | 7,967,172,415,019,972,000 | 41.040881 | 89 | 0.657279 | false |
aggelgian/algorithmic-library | python/data_structures/binary_indexed_tree.py | 1 | 1365 | # -*- coding: utf-8 -*-
"""
Binary Indexed Tree
-------------------
Based on the proposed C/C++ implementation by
Yannis Chatzimichos @ https://git.softlab.ntua.gr/public/pdp-camp/blob/master/2013/advanced_data_structures.pdf
Supports the operations
- ADD S X
Add X to the sum at posit... | mpl-2.0 | -6,951,622,506,403,230,000 | 25.764706 | 115 | 0.52381 | false |
qedsoftware/commcare-hq | corehq/apps/repeaters/models.py | 1 | 20914 | import base64
from collections import namedtuple
from datetime import datetime, timedelta
import logging
import urllib
import urlparse
from django.utils.translation import ugettext_lazy as _
from requests.exceptions import Timeout, ConnectionError
from corehq.apps.cachehq.mixins import QuickCachedDocumentMixin
from co... | bsd-3-clause | -7,446,610,611,473,382,000 | 33.973244 | 114 | 0.639572 | false |
iffy/ppo | ppo/parse_plugins/sqlite_plugin.py | 1 | 2316 | # Copyright (c) The ppo team
# See LICENSE for details.
import tempfile
import os
from ppo import plugins
from structlog import get_logger
try:
from pysqlite2 import dbapi2 as sqlite
except ImportError:
import sqlite3 as sqlite
class SQLite3Parser(plugins.ParserPlugin):
"""
I parse SQLite database... | apache-2.0 | -7,123,455,095,867,599,000 | 29.473684 | 89 | 0.536269 | false |
chippey/gaffer | python/GafferUI/UIEditor.py | 1 | 57874 | ##########################################################################
#
# Copyright (c) 2014, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistrib... | bsd-3-clause | 1,587,227,539,915,710,200 | 31.422409 | 180 | 0.67431 | false |
clessor88/trigrams | trigrams.py | 1 | 2164 | """Trigram analysis text generator."""
import sys
from random import randint
import io
def create_word_bank(word_list):
"""Create a dictionary with keys of 2 word pairs."""
word_bank = {}
for i, word in enumerate(word_list):
key = word + ' ' + word_list[i + 1]
if i < len(word_list) - 2:
... | mit | 2,701,385,325,316,454,000 | 28.643836 | 68 | 0.554067 | false |
peeyush-tm/check_mk | modules/notify.py | 1 | 82627 | #!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
# +------------------------------------------------------------------+
# | ____ _ _ __ __ _ __ |
# | / ___| |__ ___ ___| | __ | \/ | |/ / |
# | | | | '_ \ / _ \/ __| |/ /... | gpl-2.0 | 4,618,191,767,830,784,000 | 40.583795 | 134 | 0.534765 | false |
SeismicPi/SeismicPi | GUI/configParse.py | 1 | 1112 | import re
def fileToDic(configFile):
def isAlphaNumUnder(s):
return s.isalpha() or s == '_' or s.isdigit()
keyValueDict = {}
for line in configFile:
if(line[0] == '#'):
pass
else:
foundKey = False
foundSeparator = False
foundValue = False
lineKey = ""
lineValue = ""
for currentChar i... | mit | -5,345,107,037,231,477,000 | 19.218182 | 63 | 0.619604 | false |
intip/da-apps | applications/da_horoscopo/site.py | 1 | 3784 | # -*- encoding: LATIN1 -*-
#
# Copyright 2009 Prima Tech.
#
# Licensed under the Environ License, Version 1.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.intip.com.br/licenses/ENVIRON-LICENSE-1.0
#
# Unless required by ... | gpl-2.0 | -6,958,432,567,843,381,000 | 30.272727 | 78 | 0.496564 | false |
BackupTheBerlios/espressopp | testsuite/pickle_potential/testwarmup.py | 1 | 1313 | import espresso
from espresso import Real3D
d = 0.85
Nchains = 10
Mmonomers = 10
N = Nchains * Mmonomers
L = pow(N/d, 1.0/3)
system, integrator = espresso.standard_system.PolymerMelt(Nchains, Mmonomers,(10,10,10), dt = 0.005, temperature=1.0)
print "starting warmup"
org_dt = integrator.dt
pot = system.getInteracti... | gpl-3.0 | 5,970,155,635,582,008,000 | 22.446429 | 117 | 0.740289 | false |
muffato/pyEnsemblRest | read_config.py | 1 | 9452 | #!/usr/bin/env python3
import re
import sys
import glob
import os.path
import xml.etree.ElementTree as ET
# Command-line arguments
config_root = ET.parse(sys.argv[1]).getroot()
rest_checkout = sys.argv[2]
main_namespace = sys.argv[3]
# Will keep the content of all the files we're generating
files = {}
# The templ... | apache-2.0 | -7,438,585,885,973,545,000 | 34.939163 | 206 | 0.603999 | false |
avain/claripy | claripy/__init__.py | 1 | 2002 | #!/usr/bin/env python
# pylint: disable=F0401,W0401,W0603,
import os
import sys
import socket
import logging
l = logging.getLogger("claripy")
l.addHandler(logging.NullHandler())
_all_backends = [ ]
_eager_backends = [ ]
_model_backends = [ ]
from .errors import *
from . import operations
from . import ops as _all_o... | bsd-2-clause | 3,187,415,920,999,431,700 | 18.821782 | 103 | 0.713786 | false |
chrisxue815/leetcode_python | problems/test_0127_two_end_bfs.py | 1 | 1561 | import collections
import unittest
from typing import List
import utils
# O(n) time. O(n) space. Two-end BFS.
class Solution:
def ladderLength(self, beginWord: str, endWord: str, wordList: List[str]) -> int:
if endWord not in wordList:
return 0
graph = collections.defaultdict(set)
... | unlicense | 5,822,229,832,422,557,000 | 25.913793 | 85 | 0.48943 | false |
sveetch/DjangoSveetchies | settings.py | 1 | 11061 | # -*- coding: utf-8 -*-
"""
Django settings for DjangoSveetchies development
This is the version for development environnment only. For production usage you should
create a new settings file like "prod_settings.py" where you import these settings and
overwrite the required ones like PROJECT_DIR, ADMINS, DATABASES, S... | mit | 6,801,798,735,232,977,000 | 32.515152 | 217 | 0.689421 | false |
CS4098/GroupProject | src/test/uitest/uitest.py | 1 | 3665 | import unittest
from selenium import webdriver
from selenium.common.exceptions import TimeoutException
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_condit... | mit | -7,975,876,089,453,846,000 | 31.149123 | 117 | 0.660846 | false |
InUrSys/PescArt2.0 | src/srcPlus/GenericCalculoEstim.py | 1 | 8058 | '''
Created on 24/11/2017
@author: chernomirdinmacuvele
'''
from PyQt5.Qt import QDialog, QStandardItemModel, QStandardItem, QComboBox,\
QModelIndex
import mixedModel
import QT_tblViewUtility
import CustomWidgets
import FuncSQL
import searchSimple
import pprint
class GenericCalculoEstim(QDialog):
def CBTe... | gpl-3.0 | 2,110,455,335,392,600,800 | 39.094527 | 167 | 0.542194 | false |
wmaciel/crowd-sketch-filter | src/splitter.py | 1 | 1854 | import sys
import os
import shutil
from PIL import Image
def generate_1d_box_limits(dim, num_divs):
'''
Generates the limits of a crop box in a single dimension
Example, if dim is 512 pixels and num_divs is 5, it should return:
[(0, 103), (103, 206), (206, 308), (308, 410), (410, 512)]
'''
ass... | mit | -5,730,984,335,753,049,000 | 26.671642 | 103 | 0.552319 | false |
jrbainter/netana | netana/equations.py | 1 | 1464 | from griddialog import *
from wequ import wequ
import pickle
from tkinter.messagebox import showerror
class Equations():
def cleanup(self,dig):
if dig.status == "Save":
self.Mat = dig.get()
self.SaveEquations()
if dig.top: dig.top.destroy()
def SaveEquations(self):
# Save Mat Equations to file
if len... | gpl-3.0 | 7,628,883,418,903,884,000 | 21.181818 | 69 | 0.68306 | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.