repo_name stringlengths 6 61 | path stringlengths 4 230 | copies stringlengths 1 3 | size stringlengths 4 6 | text stringlengths 1.01k 850k | license stringclasses 15
values | hash int64 -9,220,477,234,079,998,000 9,219,060,020B | line_mean float64 11.6 96.6 | line_max int64 32 939 | alpha_frac float64 0.26 0.9 | autogenerated bool 1
class | ratio float64 1.62 6.1 | config_test bool 2
classes | has_no_keywords bool 2
classes | few_assignments bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
indirectlylit/kolibri | packages/kolibri-tools/lib/i18n/fonts.py | 2 | 19713 | # -*- coding: utf-8 -*-
"""
For usage instructions, see:
https://kolibri-dev.readthedocs.io/en/develop/references/i18n.html
"""
from __future__ import unicode_literals
import argparse
import base64
import io
import json
import logging
import mimetypes
import os
import re
import sys
import tempfile
import noto_sou... | mit | -384,668,701,977,580,200 | 29.397218 | 89 | 0.644989 | false | 3.494492 | false | false | false |
silicon-mountain/github-users-africa | step3_extend_users.py | 4 | 7319 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim: ai ts=4 sts=4 et sw=4 nu
from __future__ import (unicode_literals, absolute_import,
division, print_function)
import os
import json
import time
from dateutil import parser as du_parser
from datetime import datetime
import StringIO
import logg... | apache-2.0 | -6,548,492,864,477,135,000 | 31.932432 | 77 | 0.565586 | false | 3.7705 | false | false | false |
cfoale/ILOCI | Receiver-OLED/pi/projects/OLEDPython/serial_graph.py | 1 | 15603 | #IFIc Version 2.4 corresponding to IFIb Version 2.3 3/8/16 - cmf
#changed oofthreshold = 16, and scalefactor = 31.
#log now collects the IFIb float value scaled by scalefactor
#IFIc Version 2.3 corresponding to IFIb Version 2.3 3/1/16 - cmf
#changed oofthreshold = 16, and scalefactor = 32
import serial
from serial... | gpl-3.0 | -3,365,956,879,989,339,000 | 33.596452 | 192 | 0.68192 | false | 3.02091 | false | false | false |
marco-lancini/Showcase | app_users/forms.py | 1 | 2023 | from django import forms
from django.forms import ModelForm
from django.contrib.auth.models import User
from app_users.models import UserProfile, Employment
from app_users.models_nn import CreativeFields
from app_collaborations.options import CREATIVE_FIELDS
#==========================================================... | mit | 4,450,801,757,472,050,700 | 28.75 | 101 | 0.562037 | false | 4.154004 | false | false | false |
thortex/rpi3-webiopi | webiopi_0.7.1/python/webiopi/devices/sensor/htu21d.py | 1 | 4904 | # Copyright 2014 Zoltán Zörgő <soltan.zorgo@gmail.com>
#
# 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 ap... | apache-2.0 | 123,592,174,051,203,000 | 34.258993 | 119 | 0.618037 | false | 3.318213 | false | false | false |
cynja/coffeenator | webinterface/lib/forms.py | 1 | 2284 | '''
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
(at your option) any later version.
This program is distributed in the hope that it will be... | gpl-3.0 | 6,848,134,421,853,217,000 | 38.396552 | 98 | 0.715849 | false | 4.206262 | false | false | false |
bitcraze/toolbelt | src/toolbelt/test/utils/test_subproc.py | 1 | 3487 | # -*- coding: utf-8 -*-
#
# || ____ _ __
# +------+ / __ )(_) /_______________ _____ ___
# | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \
# +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/
# || || /_____/_/\__/\___/_/ \__,_/ /___/\___/
#
# Toolbelt - a utility tu run tools in do... | gpl-3.0 | 8,343,372,510,744,517,000 | 30.7 | 77 | 0.591913 | false | 3.77381 | true | false | false |
myt00seven/svrg | svrg_bn/load_dataset.py | 1 | 3585 | import sys, os
import numpy as np
from sklearn.datasets import fetch_20newsgroups
from sklearn.feature_extraction.text import TfidfVectorizer
def load_dataset(if_data_shake):
if sys.version_info[0] == 2:
from urllib import urlretrieve
else:
from urllib.request import urlretrieve
def ... | mit | -7,397,487,427,911,664,000 | 33.471154 | 98 | 0.60251 | false | 3.244344 | true | false | false |
photoninger/ansible | lib/ansible/modules/network/aci/aci_encap_pool.py | 3 | 5468 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | gpl-3.0 | 5,317,981,478,543,609,000 | 27.479167 | 135 | 0.623811 | false | 3.614012 | false | false | false |
tbeckham/eutester | eutester/winrm_connection.py | 5 | 10249 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Software License Agreement (BSD License)
#
# Copyright (c) 2009-2011, Eucalyptus Systems, Inc.
# All rights reserved.
#
# Redistribution and use of this software in source and binary forms, with or
# without modification, are permitted provided that the following conditions
#... | bsd-2-clause | 8,636,401,823,043,342,000 | 40 | 170 | 0.591082 | false | 4.359422 | false | false | false |
chrisjsewell/ipymd | ipymd/plotting/animation_examples/multi_axes.py | 1 | 2903 | # -*- coding: utf-8 -*-
"""
Created on Sun Jul 17 22:02:16 2016
@author: cjs14
"""
#http://www.astrojack.com/tag/ipython-notebook/
#%matplotlib inline
from IPython.display import Image
import matplotlib.pyplot as plt
import numpy as np
from JSAnimation.IPython_display import display_animation
from matplotlib impo... | gpl-3.0 | 3,167,111,567,306,893,000 | 34.414634 | 102 | 0.635894 | false | 2.673112 | false | false | false |
tumi8/INSALATA | src/insalata/scanner/modules/XmlScanner.py | 1 | 22767 | from lxml import etree
from insalata.model.Location import Location
from insalata.model.Layer2Network import Layer2Network
from insalata.model.Layer3Network import Layer3Network
from insalata.model.Interface import Interface
def scan(graph, connectionInfo, logger, thread):
"""
Load the network topology given ... | apache-2.0 | -1,567,690,029,503,325,200 | 40.095668 | 162 | 0.663987 | false | 4.286763 | true | false | false |
jigarkb/CTCI | LeetCode/161-M-OneEditDistance.py | 2 | 1107 | # Given two strings s and t, determine if they are both one edit distance apart.
#
# Note:
#
# There are 3 possiblities to satisify one edit distance apart:
#
# Insert a character into s to get t
# Delete a character from s to get t
# Replace a character of s to get t
# Example 1:
#
# Input: s = "ab", t = "acb"
# Outpu... | mit | -4,647,372,064,380,227,000 | 21.16 | 80 | 0.550136 | false | 3 | false | false | false |
DjangoAdminHackers/django-multi-email-field | multi_email_field/tests.py | 1 | 1626 | from django.test import SimpleTestCase
from django.core.exceptions import ValidationError
from multi_email_field.forms import MultiEmailField as MultiEmailFormField
from multi_email_field.widgets import MultiEmailWidget
class MultiEmailFormFieldTest(SimpleTestCase):
def test_widget(self):
f = MultiEmail... | lgpl-3.0 | -7,006,287,341,023,695,000 | 36.813953 | 76 | 0.627921 | false | 3.807963 | true | false | false |
GbalsaC/bitnamiP | pika/setup.py | 1 | 1972 | # ***** BEGIN LICENSE BLOCK *****
#
# For copyright and licensing please refer to COPYING.
#
# ***** END LICENSE BLOCK *****
from setuptools import setup
import os
import platform
# Conditionally include additional modules for docs
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
requirements = list()
if on_rtd:... | agpl-3.0 | 2,402,531,165,235,268,600 | 36.207547 | 78 | 0.631339 | false | 3.836576 | true | false | false |
dudanogueira/llm | flight_options/models.py | 1 | 1327 | from django.db import models
class FlightOption(models.Model):
def __unicode__(self):
return "Flight Option #%s for %s" % (self.id, self.speaker)
speaker = models.ForeignKey('speakers.Speaker')
route_description = models.TextField(blank=True)
# arrival
arrival_date = models.Date... | gpl-3.0 | 4,251,486,541,388,065,000 | 39.53125 | 91 | 0.70309 | false | 3.846377 | false | false | false |
sravel/scripts | cluster/grepMotifFromAlignment.py | 1 | 8472 | #!/usr/local/bioinfo/python/3.4.3_build2/bin/python
# -*- coding: utf-8 -*-
# @package grepMotifFromAlignment.py
# @author Sebastien Ravel
"""
The grepMotifFromAlignment script
=================================
:author: Sebastien Ravel
:contact: sebastien.ravel@cirad.fr
:date: 08/07/2016
:version: 0.1
Script d... | gpl-3.0 | 4,766,587,580,376,903,000 | 31.702703 | 170 | 0.63412 | false | 3.108257 | false | false | false |
MSLNZ/msl-equipment | tests/test_connection_demo.py | 1 | 8679 | from msl.equipment.connection import Connection
from msl.equipment.connection_demo import ConnectionDemo
from msl.equipment.record_types import EquipmentRecord
from msl.equipment.resources.picotech.picoscope.picoscope import PicoScope
from msl.equipment.resources.picotech.picoscope.channel import PicoScopeChannel
cla... | mit | -131,559,629,135,997,980 | 23.797143 | 81 | 0.548911 | false | 3.742561 | false | false | false |
PushAMP/vcsserver | setup.py | 1 | 1100 | # coding=utf-8
"""
vcsserver-lib
-------------
vcsserver-lib is library for easy and fast creation of an ssh demon for popular VCSs (Mercurial and Git).
This library uses Twisted framework."""
from setuptools import setup
setup(
name='vcsserver',
version='0.3.1',
url='https://bitbucket.org/3f17/vcssshd-l... | gpl-3.0 | 167,791,150,197,428,740 | 28.72973 | 106 | 0.631818 | false | 3.873239 | false | false | false |
vyscond/tspjson | tsp2json.py | 1 | 1084 | import pathlib
import json
import collections
for f in pathlib.Path('tsp').iterdir():
if f.is_file() and str(f)[-3:] == 'tsp' :
tsp = ''.join(open(str(f))).split('\n')
j = collections.OrderedDict()
for i in range(5):
key, val = tsp[i].split(':')
j[key.strip()] = val.... | mit | 8,349,134,594,298,226,000 | 36.37931 | 69 | 0.458487 | false | 3.235821 | false | false | false |
ipanova/pulp_puppet | pulp_puppet_plugins/pulp_puppet/plugins/migrations/0002_puppet_publishing_directory_change.py | 3 | 1947 | # -*- coding: utf-8 -*-
# Migration script to move published repositories to the new location.
#
# Copyright © 2014 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public
# License as published by the Free Software Foundation; either version
# 2 of the License (GPLv2) or (at your option) any la... | gpl-2.0 | 7,662,015,652,387,057,000 | 41.304348 | 92 | 0.718397 | false | 3.281619 | false | false | false |
maweigert/spimagine | tests/test_rendering/volrender_tester.py | 1 | 2633 |
from __future__ import absolute_import
from __future__ import print_function
import os
import sys
import shutil
import numpy as np
from PyQt5 import QtGui, QtCore, QtWidgets
from spimagine.gui.mainwidget import MainWidget
from spimagine.models.data_model import DataModel, NumpyData
from gputools import OCLProgram
... | bsd-3-clause | -9,065,273,240,665,425,000 | 25.59596 | 97 | 0.566274 | false | 3.524766 | false | false | false |
Azure/azure-sdk-for-python | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_dedicated_hosts_operations.py | 1 | 28323 | # 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 may ... | mit | -5,693,794,811,606,255,000 | 49.129204 | 206 | 0.642481 | false | 4.248238 | true | false | false |
rishubil/sqlalchemy-fulltext-search | setup.py | 1 | 1279 | """
SQLAlchemy FullText Search
"""
from setuptools import setup, Command
setup(
name='SQLAlchemy-FullText-Search',
version='0.2.3',
url='https://github.com/mengzhuo/sqlalchemy-fulltext-search',
license='BSD',
author='Meng Zhuo, Alejandro Mesa',
author_email='mengzhuo12... | mit | -265,112,061,610,332,200 | 38.96875 | 99 | 0.52932 | false | 4.702206 | false | false | false |
erikryverling/twinkle-client | twinkle-client/client.py | 1 | 3369 | import sys
import getopt
import platform
import subprocess
from twisted.internet import reactor
from autobahn.websocket import WebSocketClientFactory, WebSocketClientProtocol, connectWS
STAR_REQUEST_TIMEOUT_IN_SECONDS = 3
DEFAULT_URL = "ws://localhost:9000"
STAR_REQUEST_MESSAGE = "twinkle:star"
ERROR_MESSAGE = "twin... | mit | -2,050,359,643,606,386,400 | 28.043103 | 94 | 0.620659 | false | 3.859107 | false | false | false |
PuchatekwSzortach/names_database_builder | names/main.py | 1 | 1461 | # -*- coding: utf-8 -*-
import logging
import sys
import sqlalchemy.orm
import database
import structures
def get_names_from_file(path):
with open(path) as file:
data_lines = file.read().splitlines()
names = []
for name_line in data_lines:
fields = name_line.split(",")
japane... | mit | 7,396,839,309,927,074,000 | 22.885246 | 102 | 0.671242 | false | 3.606436 | false | false | false |
arnaldorusso/PyPAM | PyPAM/etr_models.py | 1 | 6198 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
from rpy import r
def platt(light, etr, ini=None):
"""
Adjust a curve of best fit, following the Platt model.
Parameters
----------
light : arr
Generally PAR values. Where Photosynthetic Active Radiance
interfer on... | mit | -5,889,686,842,290,081,000 | 25.715517 | 78 | 0.556308 | false | 2.947218 | false | false | false |
smilix/TracMoinMoinAuth | tracmoinmoinauth/moinmoin_user_dir.py | 1 | 3917 | # -*- coding: utf-8 -*-
#
# Manages user accounts stored in MoinMoin user directory.
# Author: HolgerCremer@gmail.com
from os import listdir, stat
from os.path import join, exists
import re
from passlib.context import CryptContext
class MoinMoinUserDir():
USER_FILE_RE = re.compile(r'^[0-9\.]+$')
def __ini... | mit | -4,732,485,343,434,082,000 | 33.06087 | 129 | 0.551698 | false | 3.882061 | false | false | false |
otsuarez/beeping_exporter | files/beeping_exporter.py | 1 | 7851 | #!/usr/bin/env python
import re
import time
import requests
import argparse
from pprint import pprint
import ast
import os
from sys import exit
from prometheus_client import start_http_server
from prometheus_client.core import GaugeMetricFamily, REGISTRY
DEBUG = int(os.environ.get('DEBUG', '0'))
def must_env(var):
... | mit | -9,041,899,436,335,090,000 | 39.056122 | 135 | 0.575723 | false | 4.044822 | false | false | false |
google/tink | examples/python/streaming_aead/streaming_aead.py | 1 | 5686 | # 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 or agreed to in writing, ... | apache-2.0 | 2,217,489,472,260,567,300 | 33.047904 | 80 | 0.688181 | false | 3.803344 | false | false | false |
brandonrobertz/SenateVotingRecord2CSV | senatevotingrecord2csv.py | 1 | 5837 | #!/usr/bin/python
""" This tool loads Senate Data directly from the government's website, parses
thru the XML files, and converts into a usable CSV file.
by Brandon Roberts 2012 copyleft GPLv3+."""
import requests
import argparse
import xml.etree.ElementTree as ET
import csv
import re
def fetch( url):
headers = {"U... | gpl-3.0 | -4,388,949,927,277,576,000 | 32.745665 | 79 | 0.624293 | false | 3.303339 | false | false | false |
yijingping/loganalyzer | loganalyzer/settings/base.py | 1 | 3893 | """Base settings shared by all environments"""
# Import global settings to make it easier to extend settings.
from django.conf.global_settings import * # pylint: disable=W0614,W0401
#==============================================================================
# Generic Django project settings
#====================... | bsd-3-clause | 6,763,360,328,404,182,000 | 30.909836 | 79 | 0.469304 | false | 4.474713 | false | false | false |
robcarver17/pysystemtrade | sysdata/production/capital.py | 1 | 19453 | from copy import copy
import datetime
import pandas as pd
from syscore.objects import arg_not_supplied, failure, missing_data
from sysdata.production.timed_storage import (
listOfEntriesData,
)
from sysobjects.production.capital import capitalEntry, LIST_OF_COMPOUND_METHODS, totalCapitalUpdater
## All capital is... | gpl-3.0 | 6,900,970,793,772,945,000 | 36.053333 | 119 | 0.64242 | false | 3.817308 | false | false | false |
martinghunt/ariba | ariba/megares_data_finder.py | 2 | 2078 | import urllib.request
from bs4 import BeautifulSoup
from distutils.version import LooseVersion
class Error (Exception): pass
class MegaresDataFinder:
def __init__(self, version=None):
self.url_root = 'https://megares.meglab.org/download/'
self.index_url = self.url_root + 'index.php'
self... | gpl-3.0 | -762,424,034,836,680,800 | 29.558824 | 115 | 0.588547 | false | 3.928166 | false | false | false |
jdowns/Homer | dao.py | 2 | 2120 | from cuisine import res
class GradeDAO(object):
groupby = {"$group":
{"_id":
{"camis": "$CAMIS",
"dba": "$DBA",
"phone": "$PHONE",
"grade": "$CURRENTGRADE"},
"RECORDDATE": {"$max":"$RECORDDATE"}
}
}
borodict = {"manhattan": 1,
... | gpl-3.0 | -314,681,725,125,033,200 | 33.193548 | 61 | 0.447642 | false | 3.674177 | false | false | false |
Drake81/allris-scraper | allris/pipelines.py | 1 | 1750 | # -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
from scrapy.exceptions import DropItem
from scrapy.xlib.pydispatch import dispatcher
from scrapy import signals
from scrapy.con... | gpl-3.0 | 1,782,453,825,479,687,000 | 30.25 | 69 | 0.64 | false | 3.829322 | false | false | false |
pnprog/goreviewpartner | mss/__main__.py | 1 | 2427 | # coding: utf-8
"""
This is part of the MSS Python's module.
Source: https://github.com/BoboTiG/python-mss
"""
from __future__ import print_function
import os.path
import sys
from argparse import ArgumentParser
from . import __version__
from .exception import ScreenShotError
from .factory import mss
from .tools impo... | gpl-3.0 | 5,378,870,711,625,983,000 | 31.36 | 78 | 0.531108 | false | 4.018212 | false | false | false |
SilverStrange/Null-File-Detector | null/scan.py | 1 | 3933 | # -*- coding: utf-8 -*-
from functools import partial
from multiprocessing import Process
import multiprocessing as mp
import sys
import os
import platform
import unicodedata
# https://github.com/pyinstaller/pyinstaller/wiki/Recipe-Multiprocessing
# Module multiprocessing is organized differently in Python 3.4+
try:
... | mit | 5,311,685,533,779,778,000 | 27.294964 | 79 | 0.588863 | false | 4.013265 | false | false | false |
evernym/zeno | ledger/hash_stores/hash_store.py | 2 | 4941 | from abc import abstractmethod
from ledger.util import count_bits_set
from ledger.util import highest_bit_set
class HashStore:
"""
Store of nodeHashes and leafHashes mapped against their sequence numbers.
"""
@property
@abstractmethod
def is_persistent(self) -> bool:
pass
@abstra... | apache-2.0 | 9,138,596,346,540,573,000 | 26.915254 | 80 | 0.587128 | false | 4.427419 | false | false | false |
sylvchev/mdla | mdla/dict_metrics.py | 1 | 18435 | # -*- coding: utf-8 -*-
"""
The `dict_metrics` module implements utilities to compare
frames and dictionaries.
This module implements several criteria and metrics to compare different sets
of atoms. This module is primarily focused on multivariate kernels and
atoms.
"""
# Authors: Sylvain Chevallier <sylvain.chevalli... | gpl-3.0 | -3,847,988,425,288,959,000 | 32.763736 | 192 | 0.559371 | false | 2.951489 | false | false | false |
googleapis/python-bigtable | samples/hello/main.py | 1 | 4786 | #!/usr/bin/env python
# Copyright 2016 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | apache-2.0 | 4,320,992,909,016,135,700 | 35.815385 | 82 | 0.680318 | false | 3.822684 | false | false | false |
nakednamor/naked-python | Python Crash Course/chapter 9/e7.py | 1 | 1165 | class User():
def __init__(self, first_name, last_name, birthday, sex):
self.first_name = first_name
self.last_name = last_name
self.birthday = birthday
self.sex = sex
def describe_user(self):
print('first name: ' + self.first_name +
'\nlast name: ' + self... | mit | 687,815,997,546,875,500 | 24.326087 | 76 | 0.537339 | false | 3.396501 | false | false | false |
hrabcak/jsbsim | tests/TestEngineIndexedProps.py | 3 | 5832 | # TestEngineIndexedProps.py
#
# Check that indexed properties (where the engine number is replaced by '#) in
# engines XML definition are working.
#
# Copyright (c) 2016 Bertrand Coconnier
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as ... | lgpl-2.1 | 4,369,971,170,960,301,600 | 48.008403 | 99 | 0.597394 | false | 3.530266 | true | false | false |
ennoborg/gramps | gramps/plugins/gramplet/persondetails.py | 1 | 11025 | # Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2011 Nick Hall
# Copyright (C) 2013 Heinz Brinker <heinzbrinker@yahoo.de>
#
# 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; eith... | gpl-2.0 | 8,619,502,784,011,851,000 | 37.548951 | 86 | 0.557642 | false | 4.032553 | false | false | false |
mscuthbert/abjad | abjad/tools/tonalanalysistools/test/test_tonalanalysistools_TonalAnalysisAgent_analyze_chords.py | 2 | 4233 | # -*- encoding: utf-8 -*-
from abjad import *
def test_tonalanalysistools_TonalAnalysisAgent_analyze_chords_01():
r'''The three inversions of a C major triad.
'''
chord = Chord([0, 4, 7], (1, 4))
chord_class = tonalanalysistools.RootedChordClass('c', 'major', 'triad', 'root')
selection = tonalana... | gpl-3.0 | -6,901,460,588,497,738,000 | 38.943396 | 84 | 0.672573 | false | 2.899315 | false | false | false |
HMRecord/website | python/tests.py | 1 | 5702 | import os
import main
import unittest
import tempfile
from bson.json_util import loads, dumps
from pymongo import MongoClient
import base64
import copy
INVALID_ARTICLE = {"title": "B", "content": "afds", "sectionID": "23", "staffIDs": ["69"], "date": "Blah"}
STAFF = {"name": "Michael Truell", "position": "CTO"}
SECTI... | gpl-3.0 | 3,801,653,387,325,009,000 | 37.527027 | 149 | 0.631182 | false | 3.721932 | true | false | false |
openmotics/gateway | src/gateway/mappers/pulse_counter.py | 1 | 2003 | # Copyright (C) 2020 OpenMotics BV
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distribu... | agpl-3.0 | -6,871,252,857,676,801,000 | 40.729167 | 96 | 0.652521 | false | 4.104508 | false | false | false |
AndreLesa/simplesmsforms | simplesmsforms/smsform_fields.py | 1 | 5350 | import datetime
import re
from smsform_exceptions import (SMSFieldException, ChoiceException, InvalidDateException,
MissingRequiredFieldException)
from smsform_validators import multiple_choice_validator, single_choice_validator
# SMS FIELD
class GenericSMSField(object):
empty_va... | mit | 5,258,480,903,507,007,000 | 32.229814 | 118 | 0.593458 | false | 4.202671 | false | false | false |
purpleidea/puppet-cobbler | files/loaders/get-loaders.py | 1 | 1375 | #!/usr/bin/python
# get the loaders ahead of time so that cobbler can run in an isolated network!
# NOTE: see cobbler/action_dlcontent.py for the list of files it looks for...
import os
import sys
import urlgrabber
force = True
content_server = 'http://cobbler.github.com/loaders'
#dest = '/var/lib/cobbler/loaders'
d... | agpl-3.0 | 5,363,835,476,370,518,000 | 34.25641 | 79 | 0.660364 | false | 2.45975 | false | false | false |
enochd/RMG-Py | rmgpy/data/solvation.py | 1 | 36641 | #!/usr/bin/python
# -*- coding: utf-8 -*-
################################################################################
#
# RMG - Reaction Mechanism Generator
#
# Copyright (c) 2002-2010 Prof. William H. Green (whgreen@mit.edu) and the
# RMG Team (rmg_dev@mit.edu)
#
# Permission is hereby granted, free of c... | mit | 3,259,325,981,605,979,600 | 39.664817 | 194 | 0.567728 | false | 3.882895 | false | false | false |
theneverworks/Sam | tools/braincompiler.py | 1 | 2856 | ##########################################################################################
# Sam - Home and Office Automation SRAI
# (Sam Brain Compiler)
#
# Version 1.0
#
# Used to compile the brain file if needed.
#
# Credits:
# Many great works of many great people are included in Sam
# I have only stacked the leg... | mit | 6,410,904,014,709,480,000 | 26.209524 | 90 | 0.595588 | false | 3.42446 | false | false | false |
RNAcentral/rnacentral-import-pipeline | rnacentral_pipeline/cli/misc.py | 1 | 2480 | # -*- coding: utf-8 -*-
"""
Copyright [2009-2018] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by... | apache-2.0 | 3,810,839,930,345,933,000 | 38.365079 | 80 | 0.733871 | false | 3.746224 | false | false | false |
bierminen/ninkasi | app/queries.py | 1 | 2230 | #!env/bin/python
#queries.py
#
# Implements methods to answer users queries.
#
# Author: José Lopes de Oliveira Jr. <bierminen.com>
#
# 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 versi... | gpl-3.0 | -5,089,947,436,916,108,000 | 33.292308 | 78 | 0.633468 | false | 3.130618 | false | false | false |
nightflyer73/plugin.video.floptv | resources/lib/floptv.py | 1 | 2784 | import re
import urllib2
import json
from BeautifulSoup import BeautifulSoup
class FlopTV:
__USERAGENT = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:50.0) Gecko/20100101 Firefox/50.0"
__BASEURL = "http://www.floptv.tv"
def __init__(self):
opener = urllib2.build_opener()
# Use Firefox ... | gpl-3.0 | 4,364,514,896,675,708,400 | 36.133333 | 97 | 0.55819 | false | 3.965812 | false | false | false |
agentxan/nzbToMedia | libs/mutagen/mp4/__init__.py | 4 | 33798 | # -*- coding: utf-8 -*-
# Copyright (C) 2006 Joe Wreschnig
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
"""Read and write MPEG-4 audio files with iTunes metadata.
This module ... | gpl-3.0 | -4,780,732,970,170,729,000 | 32.038123 | 79 | 0.550831 | false | 3.760766 | false | false | false |
bitmovin/bitmovin-python | bitmovin/resources/models/encodings/muxings/mp4_muxing.py | 1 | 4217 | from bitmovin.errors import InvalidTypeError
from bitmovin.resources.models.encodings.muxings.time_code import TimeCode
from bitmovin.resources.enums.mp4_muxing_manifest_type import MP4MuxingManifestType
from .muxing import Muxing
class MP4Muxing(Muxing):
def __init__(self, streams, filename=None, outputs=None, ... | unlicense | -3,620,123,299,172,139,500 | 44.836957 | 117 | 0.630069 | false | 4.066538 | false | false | false |
opennode/nodeconductor-assembly-waldur | src/waldur_mastermind/zabbix_openstack/filters.py | 1 | 2541 | from django_filters.rest_framework import DjangoFilterBackend
from rest_framework import serializers
from waldur_core.core import serializers as core_serializers
from waldur_core.structure import models as structure_models
from waldur_zabbix.apps import ZabbixConfig
class LinkFilterBackend(DjangoFilterBackend):
... | mit | 5,400,995,361,679,140,000 | 43.578947 | 95 | 0.695789 | false | 4.636861 | false | false | false |
iilxy/ijandan | Freeze_py2exe.py | 1 | 2656 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Setup script for distributing SIFT as a stand-alone executable
from distutils.core import setup
import glob
import py2exe
import sys
import pkg_resources
# If run without args, build executables, in quiet mode.
if len(sys.argv) == 1:
sys.argv.append("... | apache-2.0 | -8,958,125,155,379,249,000 | 26.047059 | 180 | 0.588581 | false | 2.78271 | false | false | false |
WinawerLab/MRI_tools | preprocessing/to_freesurfer.py | 1 | 6411 | #! /usr/bin/env python
####################################################################################################
# Script to reorient volumes into anatomical orientation and to create surface time-series.
# This script is made for use with a registration file (in FreeSurfer's tkreg format) and
# a series of ... | gpl-3.0 | -6,402,878,796,139,789,000 | 49.480315 | 100 | 0.546873 | false | 3.845831 | false | false | false |
hakkeroid/lcconcept | tests/sources/test_etcdstore.py | 1 | 2919 | # -*- coding: utf-8 -*-
import pytest
from layeredconfig import EtcdStore
from layeredconfig.sources.etcdstore import EtcdConnector
try:
import requests
except:
# skip all tests when yaml is not installed
pytestmark = pytest.mark.skip(reason='Missing optional dependencies')
@pytest.fixture
def connecto... | bsd-3-clause | -8,357,687,103,487,166,000 | 23.325 | 76 | 0.523124 | false | 3.723214 | true | false | false |
XiaJieCom/change | stu103151/days24/stark/arya/needle/modules/base_module.py | 1 | 1074 | #!/usr/bin/env python3
from core.utils import MsgPrint
class BaseSaltModule(object):
def __init__(self,task_obj):
self.task_obj = task_obj
def process(self,module_data,*args,**kwargs):
section_name = module_data['raw_cmds']['section']
section_data = module_data['raw_cmds']['mod_data... | lgpl-2.1 | -355,915,979,643,375,700 | 26.368421 | 90 | 0.571154 | false | 3.219814 | false | false | false |
openwisp/nodeshot | nodeshot/ui/default/tests/django.py | 8 | 2526 | from __future__ import absolute_import
from django.core.urlresolvers import reverse
from django.test import TestCase
from nodeshot.core.base.tests import user_fixtures
from nodeshot.ui.default import settings as local_settings
class DefaultUiDjangoTest(TestCase):
fixtures = [
'initial_data.json',
... | gpl-3.0 | 4,067,982,266,221,205,000 | 39.741935 | 61 | 0.666271 | false | 3.92236 | true | false | false |
deisi/SFG2D | sfg2d/utils/detect_peaks.py | 1 | 8692 | """Detect peaks in data based on their amplitude and other features."""
from __future__ import division, print_function
import numpy as np
__author__ = "Marcos Duarte, https://github.com/demotu/BMC, Modified by Malte Deiseroth"
__version__ = "1.0.4.1"
__license__ = "MIT"
def detect_peaks(x, mph=None, mpd=1, thresho... | mit | -2,232,896,576,626,879,700 | 37.122807 | 151 | 0.573746 | false | 3.268898 | false | false | false |
andr-04/Telethon | telethon_examples/print_updates.py | 1 | 1612 | #!/usr/bin/env python3
# A simple script to print all updates received
from getpass import getpass
from os import environ
# environ is used to get API information from environment variables
# You could also use a config file, pass them as arguments,
# or even hardcode them (not recommended)
from telethon import Telegr... | mit | 7,799,248,620,090,208,000 | 34.043478 | 97 | 0.621588 | false | 4.275862 | false | false | false |
colmenero/Misc | MailAnalysis/script.py | 1 | 8755 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from os import listdir, path
import re
import copy
import datetime
import matplotlib.pyplot as plt
def get_mails(*folders):
""" Gets the filename of every mail to analyze
:param folders: Folders to analyze (comma separated arguments)
:return mails: List of a... | gpl-3.0 | -8,130,193,597,380,591,000 | 29.719298 | 108 | 0.525985 | false | 3.884206 | false | false | false |
aldanor/sidecar | src/sidecar/tags.py | 1 | 6977 | # -*- coding: utf-8 -*-
import collections
import keyword
import numbers
import re
import six
from sidecar.element import Element, expr
_TAGS = """
a abbr address area article aside audio b base bdi bdo big blockquote body br button
canvas caption cite code col colgroup data datalist dd del details dfn dialog div dl... | apache-2.0 | -8,047,939,656,042,221,000 | 52.669231 | 90 | 0.713057 | false | 4.76571 | false | false | false |
lafranceinsoumise/api-django | agir/groups/views.py | 1 | 26405 | import logging
from uuid import UUID
import ics
from django.conf import settings
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.core.exceptions import PermissionDenied, ValidationError
from django.core.paginator import Paginator
from django.core.validators imp... | agpl-3.0 | 4,024,145,903,745,246,000 | 32.830552 | 115 | 0.614556 | false | 4.013096 | false | false | false |
javiplx/cobbler-devel | django-webui/djangowebui/views.py | 1 | 25790 | from django.template.loader import get_template
from django.template import Context
from django.http import HttpResponse
from django.http import HttpResponseRedirect
import xmlrpclib, time
my_uri = "http://127.0.0.1/cobbler_api"
remote = xmlrpclib.Server(my_uri)
token = remote.login('testing', 'testing')
def index(r... | gpl-2.0 | -8,607,288,348,623,287,000 | 39.296875 | 381 | 0.647577 | false | 3.516978 | false | false | false |
mathLab/RBniCS | rbnics/problems/nonlinear_parabolic/nonlinear_parabolic_problem.py | 1 | 2210 | # Copyright (C) 2015-2021 by the RBniCS authors
#
# This file is part of RBniCS.
#
# SPDX-License-Identifier: LGPL-3.0-or-later
from rbnics.problems.base import NonlinearTimeDependentProblem
from rbnics.problems.nonlinear_elliptic import NonlinearEllipticProblem
from rbnics.backends import product, sum
NonlinearParab... | lgpl-3.0 | -2,181,995,800,380,480,500 | 47.043478 | 104 | 0.646606 | false | 3.9254 | false | false | false |
azami/torimotsu | src/torimotsu/notofication.py | 1 | 2207 | # -*- coding: utf-8 -*-
from enum import Enum
from slackclient import SlackClient
from torimotsu import settings
class SendError(Exception):
def __init__(self, message):
self.message = message
class MealTimeEmoji(Enum):
fork_and_knife = 1
doughnut = 2
ramen = 3
ice_cream = 4
sake =... | mit | -7,733,427,983,693,029,000 | 33.389831 | 85 | 0.54411 | false | 2.890313 | false | false | false |
the-raspberry-pi-guy/lidar | pi_approach/UI/lidar.py | 1 | 9853 | # lidar.py
# Code to control the touchscreen user interface subsystem
# Fully networked and touch enabled - with easy manipulation of generated maps
# Author: Matthew Timmons-Brown
# Import necessary libraries for control of different aspects
import socket
import math
import time
import sys
import subprocess
import th... | mit | 7,342,553,851,189,937,000 | 34.829091 | 118 | 0.727697 | false | 3.581607 | false | false | false |
pallets/jinja2 | docs/conf.py | 1 | 1795 | from pallets_sphinx_themes import get_version
from pallets_sphinx_themes import ProjectLink
# Project --------------------------------------------------------------
project = "Jinja"
copyright = "2007 Pallets"
author = "Pallets"
release, version = get_version("Jinja2")
# General -------------------------------------... | bsd-3-clause | -3,630,792,903,349,237,000 | 34.9 | 86 | 0.579944 | false | 3.582834 | false | true | false |
virtool/virtool | virtool/jobs/api.py | 2 | 3295 | import os
import virtool.api.utils
import virtool.http.routes
import virtool.jobs.db
import virtool.resources
import virtool.users.db
import virtool.utils
from virtool.api.response import conflict, json_response, no_content, not_found
routes = virtool.http.routes.Routes()
@routes.get("/api/jobs")
async def find(req... | mit | -2,214,268,685,578,211,800 | 22.535714 | 94 | 0.641882 | false | 3.479409 | false | false | false |
mattpatey/flash-card-generator | flashcardgenerator/generator.py | 1 | 3498 |
import argparse
import codecs
import logging
import os
import pickle
from pkg_resources import (
resource_string,
yield_lines,
)
import sys
import data
from rendering import CardRenderer
from translation import (
DictionaryParser,
NoTypeIndicatorException,
ParseException,
Translator,
... | gpl-2.0 | -6,273,199,768,317,407,000 | 30.513514 | 103 | 0.612922 | false | 4.318519 | false | false | false |
ntt-pf-lab/backup_keystone | keystone/test/functional/test_ext_raxkskey.py | 1 | 1053 | import unittest2 as unittest
from keystone.test.functional import common
class TestExtensions(common.ApiTestCase):
def test_extensions_json(self):
r = self.service_request(path='/extensions.json',
assert_status=200)
self.assertTrue('json' in r.getheader('Content-Type'))
content... | apache-2.0 | 2,277,020,078,303,646,700 | 34.1 | 67 | 0.613485 | false | 4.195219 | true | false | false |
dustinlacewell/loom | loom/system.py | 1 | 1864 | from fabric.api import run, settings, sudo, open_shell, cd, env, local
from fabric.operations import put, prompt, get
def gethostip(hostname):
"get ip of hostname"
output = run('gethostip ' + hostname, true)
parts = output.split(' ')
return parts[1]
def run_daemon_cmd(name, command):
"run a daemon... | mit | -2,859,233,683,230,947,300 | 32.285714 | 128 | 0.564914 | false | 3.859213 | false | false | false |
tundebabzy/frappe | frappe/data_migration/doctype/data_migration_plan/data_migration_plan.py | 11 | 2498 | # -*- coding: utf-8 -*-
# Copyright (c) 2017, Frappe Technologies and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.modules import get_module_path, scrub_dt_dn
from frappe.modules.export_file import export_to_files, create_init_py
from ... | mit | 6,248,976,653,685,031,000 | 30.225 | 92 | 0.716573 | false | 3.198464 | false | false | false |
aipescience/queryparser | src/queryparser/common/common.py | 1 | 36829 | # -*- coding: utf-8 -*-
# All listeners that are with minor modifications shared between PostgreSQL
# and MySQL.
from __future__ import (absolute_import, print_function)
import logging
import re
import antlr4
from antlr4.error.ErrorListener import ErrorListener
from ..exceptions import QueryError, QuerySyntaxError
... | apache-2.0 | 2,043,449,946,241,649,200 | 36.126008 | 79 | 0.486302 | false | 4.34663 | false | false | false |
aagusti/osipkd-json-rpc | jsonrpc/tools.py | 1 | 6381 | import os
import re
from types import (
StringType,
UnicodeType,
BooleanType,
LongType,
IntType,
)
from decimal import Decimal
from datetime import (
datetime,
timedelta,
date
)
import locale
import pytz
from pyramid.threadlocal import get_current_registry
kini = dateti... | lgpl-2.1 | -195,858,637,387,680,320 | 24.122047 | 79 | 0.51622 | false | 3.447326 | false | false | false |
jtoppins/beaker | IntegrationTests/src/bkr/inttest/server/selenium/test_csv_import.py | 1 | 19211 | # vim: set fileencoding=utf-8 :
# 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.
from bkr.inttest.server.selenium impor... | gpl-2.0 | 1,782,505,370,884,736,500 | 48.187179 | 116 | 0.593807 | false | 3.652513 | true | false | false |
university-gender-evolution/py-university-gender-dynamics-pkg | pyugend/abcComparisonPlot.py | 1 | 2906 | #!/usr/bin/python
"""
Abstract Base Class for building plots
"""
## MIT License
##
## Copyright (c) 2017, krishna bhogaonker
## 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 restri... | mit | -5,602,088,571,637,038,000 | 29.589474 | 463 | 0.703716 | false | 3.997249 | false | false | false |
xcoder123/KodiLatviesiem | plugin.video.filmaslatviski/fof.py | 1 | 12491 | # -*- coding: utf-8 -*-
import network
import sys
import re
import xbmc
import xbmcgui
import xbmcplugin
import urlresolver
import CommonFunctions
import kodi_func
import os
import codecs
common = CommonFunctions
common.plugin = "Filmas-Latviski-1.0.0"
mySourceId = 4
mainURL = 'http://www.fof.lv'
#indexed search
de... | gpl-3.0 | 3,629,454,792,757,261,300 | 40.682274 | 213 | 0.67223 | false | 2.782541 | false | false | false |
shifter/rekall | rekall-core/rekall/plugins/windows/dumpcerts.py | 4 | 6522 | # Volatility
# Copyright (C) 2007-2013 Volatility Foundation
# Copyright 2013 Google Inc. All Rights Reserved.
#
# Authors:
# Michael Hale Ligh <michael.ligh@mnin.org>
# Michael Cohen <scudette@google.com>
#
# Contributors/References:
# ## Based on sslkeyfinder: http://www.trapkit.de/research/sslkeyfinder/
# This pr... | gpl-2.0 | -8,258,718,768,978,003,000 | 31.61 | 79 | 0.565011 | false | 4.183451 | false | false | false |
giliam/sharbrary | discussion/migrations/0001_initial.py | 1 | 1166 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.Create... | gpl-2.0 | 5,704,729,064,769,348,000 | 43.846154 | 203 | 0.614923 | false | 3.993151 | false | false | false |
ambitioninc/newrelic-api | newrelic_api/servers.py | 1 | 10813 | from .base import Resource
class Servers(Resource):
"""
An interface for interacting with the NewRelic server API.
"""
def list(self, filter_name=None, filter_ids=None, filter_labels=None, page=None):
"""
This API endpoint returns a paginated list of the Servers
associated with... | mit | 4,022,822,439,138,506,000 | 30.524781 | 111 | 0.420235 | false | 4.831546 | false | false | false |
yongshengwang/hue | desktop/core/ext-py/tablib-0.10.0/tablib/packages/xlwt/Workbook.py | 57 | 20514 | # -*- coding: windows-1252 -*-
'''
Record Order in BIFF8
Workbook Globals Substream
BOF Type = workbook globals
Interface Header
MMS
Interface End
WRITEACCESS
CODEPAGE
DSF
TABID
FNGROUPCOUNT
Workbook Protection Block
WINDOWPROTECT
PRO... | apache-2.0 | 7,327,411,666,094,557,000 | 31.254717 | 109 | 0.522131 | false | 3.917128 | false | false | false |
Agicia/lpod-python | scripts/lpod-highlight.py | 1 | 4772 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
#
# Copyright (c) 2009-2010 Ars Aperta, Itaapy, Pierlis, Talend.
#
# Authors: Hervé Cauwelier <herve@itaapy.com>
#
# This file is part of Lpod (see: http://lpod-project.org).
# Lpod is free software; you can redistribute it and/or modify it under
# the terms of either:
#
# ... | apache-2.0 | -8,872,036,109,267,874,000 | 38.758333 | 76 | 0.642423 | false | 3.724434 | false | false | false |
jetyang2005/elastalert | elastalert/alerts_extend_db.py | 1 | 2277 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
#from __future__ import unicode_literals
import datetime
from alerts import Alerter, BasicMatchString
from util import elastalert_logger
from db_sqlconn import Mysql
'''
#################################################################
# 推送消息到数据库中,便于后继查询 ... | apache-2.0 | -2,756,643,408,934,341,000 | 25.566265 | 69 | 0.446712 | false | 3.958707 | false | false | false |
haphaeu/yoshimi | EulerProject/067_dag.py | 1 | 1839 | def dagTriang(m, size):
dist=[]
for i in range(size):
dist.append([])
for j in range(i+1):
dist[i].append(0)
#initial setup
dist[0][0]=m[0][0]
for icur in range(size):
for jcur in range(icur+1):
try:
#print icur, jcur
... | lgpl-3.0 | -3,430,795,768,939,448,000 | 26.462687 | 65 | 0.466014 | false | 2.665217 | false | false | false |
gklyne/annalist | src/annalist_root/annalist/models/collectiontypecache.py | 1 | 8754 | from __future__ import unicode_literals
from __future__ import absolute_import, division, print_function
"""
This module is used to cache per-collection type information.
"""
__author__ = "Graham Klyne (GK@ACM.ORG)"
__copyright__ = "Copyright 2017, G. Klyne"
__license__ = "MIT (http://opensource.org/licens... | mit | 4,731,550,999,440,760,000 | 35.173554 | 103 | 0.600069 | false | 4.106004 | false | false | false |
buffer/peepdf | peepdf/PDFCrypto.py | 1 | 13561 | #
# peepdf is a tool to analyse and modify PDF files
# http://peepdf.eternal-todo.com
# By Jose Miguel Esparza <jesparza AT eternal-todo.com>
#
# Copyright (C) 2011-2017 Jose Miguel Esparza
#
# This file is part of peepdf.
#
# peepdf is free software: you can redistribute it and/or modify
# ... | gpl-3.0 | -155,356,212,868,732,830 | 38.885294 | 171 | 0.600029 | false | 3.999115 | false | false | false |
vitkarpenko/rague | rague/entities/entity.py | 1 | 1423 | """This module provides main Entity class
used as a base for all other entities (through
subclassing or instantiation).
"""
from copy import deepcopy
from rague.components import Component
from rague.utils import to_snake_case
class EntityMeta(type):
"""Every entity should declare a set of "components" instances... | mit | 1,002,777,172,380,279,800 | 31.340909 | 88 | 0.623331 | false | 4.759197 | false | false | false |
cosmos/cosmos | atom_sim.py | 1 | 1306 | print "Compute atoms for validators and delegators over time"
import math
atomsVal = 0.000 # starting atoms for validator
atomsDel = 0.010 # starting atoms delegated to validator
atomsAll = 1.0 #
inflation = 0.3 # 30% inflation
inflationLg = math.log(1.0 + inflation) # for exponential
exponential = True... | mit | 5,159,716,723,795,485,000 | 38.575758 | 90 | 0.668453 | false | 3.131894 | false | false | false |
nayyarv/CorpusCleaners | IEMOCAP Sorter Script/Sorter.py | 1 | 1812 | #Sorter.py
import os
import shutil
from helper import mkdir, listdir
os.chdir("..")
currdir = os.getcwd()
print currdir
def fileParser(filePath):
emotionDict = {}
with open(filePath, 'r') as f:
for line in f:
tokens = line.split("\t")
if len(tokens) == 4:
utteranceID, emotion = line.split("\t"... | mit | -3,879,577,881,628,224,000 | 22.855263 | 85 | 0.669978 | false | 2.796296 | false | false | false |
sticilface/ESPmanager | buildmanifest.py | 1 | 2388 | #! /usr/bin/env python
import hashlib
import os
import json
import sys
def md5(fname):
hash_md5 = hashlib.md5()
with open(fname, "rb") as f:
for chunk in iter(lambda: f.read(4096), b""):
hash_md5.update(chunk)
return hash_md5.hexdigest()
# run py buildmanifest.py pathtobin
# place SPIFFS files in pathtobin/d... | lgpl-3.0 | 3,367,725,312,397,683,700 | 28.481481 | 109 | 0.511307 | false | 3.612708 | false | false | false |
onzag/vkcrypto | lib/python/pyvkcrypto.py | 2 | 2525 | import ctypes
import sys
DLL = ctypes.CDLL('/usr/local/lib/libvkcrypto.so')
VK_SCRYPT_HASH_LEN = 32
VK_SCRYPT_SALT_LEN = 16
VK_SCRYPT_LEN = 48
AES_BLOCK_SIZE = 16
def scrypt(plaintext,hard=False):
buffer = ctypes.create_string_buffer(DLL.getScryptSize())
status = DLL.scrypt(plaintext,len(plaintext),buffer,hard)
i... | mit | -5,353,230,014,360,499,000 | 29.421687 | 107 | 0.723168 | false | 2.908986 | false | false | false |
canvasnetworks/canvas | website/drawquest/apps/quests/migrations/0003_auto__add_quest__del_field_scheduledquest_comment__del_field_scheduled.py | 1 | 11270 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
depends_on = (
('canvas', '0013_add_comment_table'),
('canvas', '0074_create_category'),
('canvas', '0144_auto__add_field_comment_tit... | bsd-3-clause | -8,638,866,046,194,777,000 | 68.567901 | 195 | 0.56362 | false | 3.661468 | false | false | false |
jeoliva/hls-analyzer | m3u8/__init__.py | 2 | 2424 | # coding: utf-8
# Copyright 2014 Globo.com Player authors. All rights reserved.
# Use of this source code is governed by a MIT License
# license that can be found in the LICENSE file.
import sys
PYTHON_MAJOR_VERSION = sys.version_info
import os
import posixpath
try:
from cookielib import CookieJar
except ImportE... | mit | 2,797,641,510,060,910,000 | 27.186047 | 89 | 0.689356 | false | 3.4189 | false | false | false |
mcxiaoke/python-labs | archives/tk/lib.py | 1 | 1580 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author: mcxiaoke
# @Date: 2015-08-10 21:25:48
from __future__ import print_function
import sys
import os
from Tkinter import *
class ScrolledText(Frame):
def __init__(self, parent=None, text='', file=None):
Frame.__init__(self, parent)
# 自动扩展空间
... | apache-2.0 | 1,650,884,617,046,082,000 | 24.034483 | 56 | 0.563361 | false | 2.75 | false | false | false |
abadger/stellarmagnate | magnate/savegame/base_types.py | 1 | 5479 | # Stellar Magnate - A space-themed commodity trading game
# Copyright (C) 2018 Toshio Kuratomi <toshio@fedoraproject.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version ... | agpl-3.0 | 4,070,307,166,160,550,400 | 35.284768 | 100 | 0.688629 | false | 3.799584 | false | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.