repo_name stringlengths 5 92 | path stringlengths 4 221 | copies stringclasses 19
values | size stringlengths 4 6 | content stringlengths 766 896k | license stringclasses 15
values | hash int64 -9,223,277,421,539,062,000 9,223,102,107B | line_mean float64 6.51 99.9 | line_max int64 32 997 | alpha_frac float64 0.25 0.96 | autogenerated bool 1
class | ratio float64 1.5 13.6 | config_test bool 2
classes | has_no_keywords bool 2
classes | few_assignments bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
chrisdickinson/multipart | setup.py | 1 | 1572 | from distutils.core import setup
import os
# Stolen from django-registration
# Compile the list of packages available, because distutils doesn't have
# an easy way to do this.
packages, data_files = [], []
root_dir = os.path.dirname(__file__)
if root_dir:
os.chdir(root_dir)
for dirpath, dirnames, filenames in os.... | bsd-3-clause | -832,142,934,570,517,000 | 32.446809 | 90 | 0.637405 | false | 4.030769 | false | false | false |
agepoly/mezzanine | mezzanine/twitter/models.py | 1 | 6766 | from __future__ import unicode_literals
from future.builtins import str
from datetime import datetime, timedelta
import re
from time import timezone
try:
from urllib.parse import quote
except ImportError:
# Python 2
from urllib import quote
from django.db import models
from django.utils.encoding import p... | bsd-2-clause | 3,241,061,509,415,992,300 | 39.035503 | 79 | 0.585427 | false | 3.736057 | false | false | false |
arcolife/scholarec | corpus/dumps/data_handler.py | 1 | 2830 | #!/usr/bin/python
import os
import sys
import json
from subprocess import call
# path of directory containing all .json files
PATH_SOURCE = './data_arxiv_json/'
PATH_DEST = './sharded/'
def __write_json_files(path_source, path_dest, keyword):
'''
Create json chunks from a previous db dump (.json)
'''
... | gpl-3.0 | -9,152,104,286,490,961,000 | 30.098901 | 101 | 0.579152 | false | 3.600509 | false | false | false |
caspahouzer/TiShineLabel | build.py | 1 | 8791 | #!/usr/bin/env python
#
# Appcelerator Titanium Module Packager
#
#
import os, subprocess, sys, glob, string, optparse, subprocess
import zipfile
from datetime import date
cwd = os.path.abspath(os.path.dirname(sys._getframe(0).f_code.co_filename))
os.chdir(cwd)
required_module_keys = ['name','version','moduleid','desc... | mit | 4,717,175,354,227,685,000 | 30.967273 | 135 | 0.694574 | false | 2.963924 | true | false | false |
hall1467/wikidata_usage_tracking | python_analysis_scripts/longitudinal_misalignment/alignment_and_misalignment_table_pre_processor.py | 1 | 2373 | """
Preprocess alignment and misalignment data so that it can be imported into
Postgres
Usage:
alignment_and_misalignment_table_pre_processor (-h|--help)
alignment_and_misalignment_table_pre_processor <output> <input_alignment_data>...
[--debug]
... | mit | -126,529,642,722,674,400 | 26.275862 | 85 | 0.585335 | false | 3.62844 | false | false | false |
NeCTAR-RC/cinder | cinder/backup/api.py | 1 | 11074 | # Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICEN... | apache-2.0 | -4,439,977,846,825,401,300 | 39.123188 | 78 | 0.559689 | false | 4.503457 | false | false | false |
zestedesavoir/Python-ZMarkdown | zmarkdown/extensions/urlize.py | 1 | 2230 | # Inspired by https://github.com/r0wb0t/markdown-urlize/blob/master/urlize.py
from __future__ import unicode_literals
from zmarkdown.inlinepatterns import Pattern as InlinePattern, sanitize_url, MAIL_RE
from zmarkdown import Extension, util
try: # pragma: no cover
from urllib.parse import urlparse
except I... | bsd-3-clause | -4,029,473,678,313,161,700 | 30.794118 | 102 | 0.54574 | false | 3.36858 | false | false | false |
paritoshsingh/konehack | read_and_send_msg.py | 1 | 2879 | #!/usr/bin/python
import smbus
import math
import paho.mqtt.client as mqtt
# Power management registers
power_mgmt_1 = 0x6b
power_mgmt_2 = 0x6c
def read_byte(adr):
return bus.read_byte_data(address, adr)
def read_word(adr):
high = bus.read_byte_data(address, adr)
low = bus.read_byte_data(address, adr+1)... | mit | 6,383,770,058,486,674,000 | 27.22549 | 97 | 0.674192 | false | 2.67814 | false | false | false |
ActiveState/code | recipes/Python/440657_Determine_functiexecutitime_Pythonic/recipe-440657.py | 1 | 2051 | """
Determine function execution time.
>>> def f():
... return sum(range(10))
...
>>> pytime(f)
(Time to execute function f, including function call overhead).
>>> 1.0/pytime(f)
(Function calls/sec, including function call overhead).
>>> 1.0/pytime_statement('sum(range(10))')
(Statements/sec, does not include... | mit | -7,438,097,726,899,165,000 | 25.294872 | 70 | 0.601658 | false | 3.401327 | false | false | false |
jucacrispim/mongomotor | mongomotor/connection.py | 1 | 3842 | # -*- coding: utf-8 -*-
# Copyright 2016 Juca Crispim <juca@poraodojuca.net>
# This file is part of mongomotor.
# mongomotor 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, ... | gpl-3.0 | 4,309,757,562,831,834,600 | 34.906542 | 75 | 0.682457 | false | 4.176087 | false | false | false |
thinkxl/mentions | mentions/mentions.py | 1 | 3175 | # -*- coding: utf-8 -*-
"""
This module contains the primary objects that power Mention.
"""
import json
import requests
from bs4 import BeautifulSoup
headers = {'User-Agent': 'Karma v0.1.0', 'From': '@thinkxl'}
# Facebook
def get_facebook_data(method, url):
try:
facebook_url = 'https://api.facebook.com... | mit | 7,374,464,425,110,252,000 | 29.238095 | 83 | 0.596535 | false | 3.410311 | false | false | false |
kpolimis/kpolimis.github.io-src | pelicanconf.py | 1 | 3979 | #!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
import os
#from utils import filters
AUTHOR = u'Kivan Polimis'
SITENAME = u'Kivan Polimis'
# SITESUBTITLE = u'my personal musings and attempts to apply \
# and share some programming tips'
INDEX_SAVE_AS = 'pages/home.html'
PATH = ... | gpl-3.0 | 2,233,683,985,221,732,400 | 28.474074 | 95 | 0.688615 | false | 2.923586 | false | false | false |
libvirt/libvirt-test-API | libvirttestapi/repos/storage/dir_vol_upload.py | 1 | 5210 | # Copyright (C) 2010-2012 Red Hat, Inc.
# This work is licensed under the GNU GPLv2 or later.
# dir storage volume upload testing, only raw format volume is
# supported, other format might fail. offset and length can
# only be chosen in 0 and 1048576.
import os
import string
import sys
from xml.dom import minidom
fro... | gpl-2.0 | 4,381,108,374,907,106,000 | 29.647059 | 79 | 0.605758 | false | 3.681979 | true | false | false |
olingrobin/test | day1/user.py | 1 | 1087 |
error_name = open("namefile.txt","a")
error_name.close()
list = {"jin":"123","tom":"456","jak":"789","aimi":"012"}
count = 0
status = False
while True:
user_name = input("请输入用户名:")
error_name = open("namefile.txt","r")
for name in error_name:
if user_name == name.strip():
status = True... | gpl-3.0 | -9,159,499,533,204,680,000 | 22.642857 | 57 | 0.512588 | false | 3.152381 | false | false | false |
DeveloperJose/Vision-Rat-Brain | feature_matching_v3/util_sift.py | 1 | 1540 | # Author: Jose G Perez
# Version 1.0
# Last Modified: January 31, 2018
import numpy as np
import cv2
import os
SIFT = cv2.xfeatures2d.SIFT_create(contrastThreshold=0.05, edgeThreshold=100, sigma=2)
def kp_to_array(kp):
array = np.zeros((len(kp), 7), dtype=np.float32)
for idx in range(array.shape[0]):
k... | mit | -6,412,502,763,211,562,000 | 30.44898 | 109 | 0.597403 | false | 2.745098 | false | false | false |
wd8rde/genesis_g59_py | setup.py | 1 | 1416 | #!/usr/bin/env python
#The MIT License (MIT)
#
#Copyright (c) 2015 Robert Anthony Bouterse, WD8RDE
#
#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 limita... | mit | -5,464,127,228,988,461,000 | 43.25 | 79 | 0.75565 | false | 3.933333 | false | false | false |
Dangetsu/vnr | Frameworks/Sakura/py/libs/vnragent/engine.py | 1 | 2147 | # coding: utf8
# engine.py
# 5/3/2014 jichi
# The logic in this file must be consistent with that in vnragent.dll.
if __name__ == '__main__': # DEBUG
import sys
sys.path.append("..")
import os
from glob import glob
from sakurakit.skdebug import dprint
from sakurakit.skfileio import escapeglob
class Engine:
def... | gpl-3.0 | -3,036,005,952,833,670,000 | 23.965116 | 87 | 0.615277 | false | 3.413355 | false | false | false |
gmimano/commcaretest | corehq/apps/reports/filters/select.py | 1 | 5848 | import datetime
import calendar
from django.conf import settings
from django.utils.translation import ugettext_noop
from django.utils.translation import ugettext as _
from casexml.apps.case.models import CommCareCase, CommCareCaseGroup
from corehq.apps.app_manager.models import Application
from corehq.apps.domain.model... | bsd-3-clause | 2,471,994,198,075,688,000 | 31.131868 | 107 | 0.612859 | false | 4.075261 | false | false | false |
django-erp/django-erp | djangoerp/menus/migrations/0002_initial_fixture.py | 1 | 3421 | from django.db import models, migrations
from django.utils.translation import ugettext_noop as _
from django.urls import reverse
from ..utils import create_detail_actions, create_detail_navigation
def install(apps, schema_editor):
# Models.
User = apps.get_model('core.User')
Group = apps.get_model('core.... | mit | -8,335,009,606,325,166,000 | 30.1 | 104 | 0.602455 | false | 3.604847 | false | false | false |
DazWorrall/ansible | contrib/inventory/azure_rm.py | 1 | 32749 | #!/usr/bin/env python
#
# Copyright (c) 2016 Matt Davis, <mdavis@ansible.com>
# Chris Houseknecht, <house@redhat.com>
#
# This file is part of Ansible
#
# Ansible 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 ... | gpl-3.0 | 7,014,954,423,921,944,000 | 39.834165 | 157 | 0.602156 | false | 4.268639 | true | false | false |
cria/microSICol | update_external_db.py | 1 | 6512 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author:Renato Arnellas Coelho renatoac at gmail dot com
#
# Script to update Sicol database
#
# Warning:
# 1 - Add MySQL executable directory to system's PATH environment variable
# 2 - This script _MUST_ be executed on root directory
def updateDB(full_mode=True)... | gpl-2.0 | 2,520,255,957,991,356,000 | 38.447205 | 181 | 0.555129 | false | 3.465673 | false | false | false |
trolldbois/python-haystack-reverse | haystack/reverse/cli.py | 1 | 4337 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
"""Entry points related to reverse. """
import os
import sys
from haystack import argparse_utils
from haystack import cli
from haystack.reverse import api
# the description of the function
REVERSE_DESC = 'Reverse the data structure... | gpl-3.0 | 3,501,183,569,568,600,600 | 30.889706 | 102 | 0.682038 | false | 3.602159 | false | false | false |
torchingloom/edx-platform | lms/djangoapps/bulk_email/models.py | 1 | 11002 | """
Models for bulk email
WE'RE USING MIGRATIONS!
If you make changes to this model, be sure to create an appropriate migration
file and check it in at the same time as your model changes. To do that,
1. Go to the edx-platform dir
2. ./manage.py lms schemamigration bulk_email --auto description_of_your_change
3. Add... | agpl-3.0 | 351,640,386,097,499,400 | 38.153025 | 121 | 0.668606 | false | 4.14076 | false | false | false |
xsteadfastx/subsonic-xbmc-addon | plugin.audio.subsonic/addon.py | 1 | 11859 | from operator import itemgetter
import sys
import urllib
import urlparse
sys.path.append('./resources/lib')
import requests
def build_url(query):
return base_url + '?' + urllib.urlencode(dict([k.encode('utf-8'),unicode(v).encode('utf-8')] for k,v in query.items()))
class Subsonic(object):
def __init__(self... | mit | 1,125,825,423,453,675,600 | 34.71988 | 123 | 0.559912 | false | 3.752848 | false | false | false |
CCallahanIV/PyChart | pychart/pychart_datarender/urls.py | 1 | 1210 | """Url patterns for data render app."""
from django.conf.urls import url
from pychart_datarender.views import (
GalleryView,
DataDetailView,
RenderDetailView,
DataLibraryView,
EditDataView,
EditRenderView,
AddDataView,
AddRenderView,
retrieve_data,
render_data,
save_render,
... | mit | -4,373,423,737,442,494,000 | 36.8125 | 85 | 0.628099 | false | 3.192612 | false | false | false |
lemming52/white_pawn | leetcode/q015/solution.py | 1 | 1080 | """
Given an array nums of n integers, are there elements a, b, c in nums such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.
Note:
The solution set must not contain duplicate triplets.
"""
from typing import Dict, List
class Solution:
def threeSum(self, nums... | mit | 6,733,637,827,880,332,000 | 27.243243 | 161 | 0.39537 | false | 4.42623 | false | false | false |
jbassen/edx-platform | lms/djangoapps/courseware/tabs.py | 1 | 10813 | """
This module is essentially a broker to xmodule/tabs.py -- it was originally introduced to
perform some LMS-specific tab display gymnastics for the Entrance Exams feature
"""
from django.conf import settings
from django.utils.translation import ugettext as _, ugettext_noop
from courseware.access import has_access
f... | agpl-3.0 | 6,793,054,819,562,622,000 | 30.896755 | 114 | 0.638121 | false | 3.950676 | false | false | false |
openpolis/op-verify | project/verify/admin.py | 1 | 2315 | from django.contrib import admin
from django.core.management import call_command, CommandError
from django.http import StreamingHttpResponse
from .models import Rule, Verification
__author__ = 'guglielmo'
def run_verification(request, id):
response = StreamingHttpResponse(stream_generator(request, id), content_ty... | bsd-3-clause | -7,814,162,677,733,859,000 | 35.746032 | 116 | 0.638013 | false | 3.639937 | false | false | false |
googleads/google-ads-python | google/ads/googleads/v8/services/services/ad_schedule_view_service/client.py | 1 | 18238 | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | apache-2.0 | -5,497,888,377,128,880,000 | 40.45 | 132 | 0.621943 | false | 4.550399 | false | false | false |
francoricci/sapspid | lib/response.py | 1 | 4278 | #import jsonlib2
import globalsObj
import logging
import traceback
import tornado.web
#import ujson
#import simplejson
import jsonpickle
import uuid
class Result(object):
def __init__(self, **kwargs):
#self.rootLogger = logging.getLogger('root')
for name, value in kwargs.items():
exec(... | mit | -6,579,047,088,402,858,000 | 31.907692 | 119 | 0.605423 | false | 4.032045 | false | false | false |
tatianass/goodreads2 | goodreads/request.py | 1 | 1066 | import requests
import xmltodict
import json
class GoodreadsRequestException(Exception):
def __init__(self, error_msg, url):
self.error_msg = error_msg
self.url = url
def __str__(self):
return self.url, ':', self.error_msg
class GoodreadsRequest():
def __init__(self, client, pat... | mit | -593,627,982,775,317,100 | 30.352941 | 80 | 0.61257 | false | 3.933579 | false | false | false |
gem/sidd | ui/dlg_result.py | 1 | 7317 | # Copyright (c) 2011-2013, ImageCat Inc.
#
# 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... | agpl-3.0 | 7,166,657,375,103,733,000 | 37.708108 | 138 | 0.569906 | false | 4.117614 | false | false | false |
certik/sfepy | sfepy/mechanics/matcoefs.py | 1 | 3273 | from sfepy.base.base import *
##
# c: 22.07.2008
def youngpoisson_to_lame( young, poisson, plane = 'stress' ):
if plane == 'stress':
lam = young*poisson/(1.0 - poisson*poisson)
mu = young/(2.0*(1.0 + poisson))
elif plane == 'strain':
lam = young*poisson/((1.0 + poisson)*(1.0 - 2.0*pois... | bsd-3-clause | 2,795,579,541,998,849,000 | 32.060606 | 81 | 0.486709 | false | 2.748111 | false | false | false |
oneconvergence/group-based-policy | gbpservice/neutron/db/grouppolicy/group_policy_mapping_db.py | 1 | 18294 | # 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, software
# d... | apache-2.0 | 7,347,120,841,103,044,000 | 47.142105 | 79 | 0.552586 | false | 3.970914 | false | false | false |
uwcirg/true_nth_usa_portal | portal/migrations/versions/4456ad5faf86_.py | 1 | 2041 | """empty message
Revision ID: 4456ad5faf86
Revises: 521aa70e0617
Create Date: 2015-09-03 19:40:53.744703
"""
# revision identifiers, used by Alembic.
revision = '4456ad5faf86'
down_revision = '521aa70e0617'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - ... | bsd-3-clause | 5,831,843,187,538,724,000 | 36.796296 | 76 | 0.55757 | false | 3.829268 | false | false | false |
Sult/evetool | populate/misc.py | 1 | 1848 | import eveapi
from apies.models import CallGroup, Call, Api
from characters.models import RefType
api = eveapi.EVEAPIConnection()
data = api.API.CallList()
def call_groups():
for group in data.callGroups:
try:
CallGroup.objects.create(
groupid=group.groupID,
na... | mit | 1,425,303,682,853,979,000 | 26.58209 | 70 | 0.551407 | false | 3.948718 | false | false | false |
EJH2/ViralBot-Discord | bot/utils/over.py | 1 | 7167 | # coding=utf-8
"""Overrides for Discord.py classes"""
import contextlib
import inspect
import io
import itertools
import re
import discord
from discord.ext.commands import HelpFormatter as HelpF, Paginator, Command
from bot.utils import polr, privatebin
from bot.utils.args import ArgParseConverter as ArgPC
def crea... | gpl-3.0 | 2,864,970,659,438,636,000 | 35.380711 | 120 | 0.596205 | false | 4.090753 | false | false | false |
makelove/OpenCV-Python-Tutorial | ch05-视频/5.VideoPlay.py | 1 | 1329 | import numpy as np
import cv2
cap = cv2.VideoCapture('../data/vtest.avi')
# cap = cv2.VideoCapture('output.avi')
# cap = cv2.VideoCapture('Minions_banana.mp4')
# 帧率
fps = cap.get(cv2.CAP_PROP_FPS) # 25.0
print("Frames per second using video.get(cv2.CAP_PROP_FPS) : {0}".format(fps))
# 总共有多少帧
num_frames = cap.get(cv2... | mit | 7,165,087,056,115,826,000 | 25.733333 | 78 | 0.666667 | false | 2.110526 | false | false | false |
ziima/pyvmd | pyvmd/tests/test_analyzer.py | 1 | 2785 | """
Tests for trajectory analysis utilities.
"""
import VMD
from mock import sentinel
from pyvmd.analyzer import Analyzer
from pyvmd.molecules import Molecule
from .utils import data, PyvmdTestCase
class TestAnalyzer(PyvmdTestCase):
"""
Test `Analyzer` class.
"""
def setUp(self):
self.mol = ... | gpl-3.0 | 6,988,987,339,418,595,000 | 38.225352 | 113 | 0.627289 | false | 3.234611 | true | false | false |
mercycorps/tola | htdocs/silo/serializers.py | 1 | 1231 | from django.forms import widgets
from rest_framework import serializers
from silo.models import Silo, Read, ReadType, LabelValueStore, Tag
from django.contrib.auth.models import User
import json
class SiloSerializer(serializers.HyperlinkedModelSerializer):
data = serializers.SerializerMethodField()
class Meta:... | gpl-2.0 | -2,326,723,832,163,240,000 | 29.04878 | 112 | 0.671812 | false | 4.036066 | false | false | false |
eighilaza/bouraka | bouraka-django/bouraka/views.py | 1 | 1815 | from django.shortcuts import render, get_object_or_404
from django.http import HttpResponse
from django.template import RequestContext, loader
from news.models import News
from slides.models import Slide
from django.http import HttpResponseRedirect
def home(request):
latest_news_list = News.objects.order_by('-publ... | lgpl-3.0 | -63,468,116,221,537,944 | 33.903846 | 69 | 0.722865 | false | 3.336397 | false | false | false |
beakman/caquitv | external_apps/djangoratings/models.py | 1 | 2158 | from django.db import models
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes import generic
from django.contrib.auth.models import User
import datetime
from managers import VoteManager
class Vote(models.Model):
content_type = models.ForeignKey(ContentType, related_n... | agpl-3.0 | -277,736,686,817,290,900 | 35.576271 | 91 | 0.645042 | false | 3.90942 | false | false | false |
alexbiehl/SublimeLinter-stack-ghc | linter.py | 1 | 1410 | #
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Jon Surrell
# Copyright (c) 2013 Jon Surrell
#
# License: MIT
#
"""This module exports the Stack Ghc plugin class."""
from SublimeLinter.lint import Linter, util
from os.path import basename
class StackGhc(Linter)... | mit | -9,104,684,087,554,022,000 | 26.115385 | 87 | 0.600709 | false | 3.414044 | false | false | false |
walshjon/openmc | openmc/capi/error.py | 1 | 1950 | from ctypes import c_int, c_char
from warnings import warn
from . import _dll
class OpenMCError(Exception):
"""Root exception class for OpenMC."""
class GeometryError(OpenMCError):
"""Geometry-related error"""
class InvalidIDError(OpenMCError):
"""Use of an ID that is invalid."""
class AllocationEr... | mit | 8,463,138,787,818,959,000 | 25.351351 | 77 | 0.663077 | false | 3.931452 | false | false | false |
vivaxy/algorithms | python/problems/validate_stack_sequences.py | 1 | 1434 | """
https://leetcode.com/problems/validate-stack-sequences/
https://leetcode.com/submissions/detail/218117451/
"""
from typing import List
class Solution:
def validateStackSequences(self, pushed: List[int], popped: List[int]) -> bool:
if pushed == popped:
return True
a = []
w... | mit | 2,056,916,776,801,924,600 | 25.072727 | 83 | 0.505579 | false | 3.695876 | true | false | false |
ojousima/asylum | project/ndaparser/admin.py | 1 | 2753 | from django.contrib import admin
from django.core.exceptions import PermissionDenied, ImproperlyConfigured
from django.conf.urls import url
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext_lazy as _
from django.shortcuts import get_object_or_404, render
from django.utils.text i... | mit | 8,746,984,828,914,234,000 | 40.712121 | 108 | 0.668362 | false | 4.102832 | false | false | false |
ArkaneMoose/BotBot | botbot/main.py | 1 | 3722 | import sys
import re
import json
import argparse
import euphoria as eu
from .botbot import BotBot
from . import euphutils
from . import snapshot
room_name = 'testing'
password = None
nickname = 'BotBot'
help_text = '''\
@BotBot is a bot for Euphoria created by @myhandsaretypingwords that creates
other bots.
Usage
... | mit | -5,159,026,592,452,285,000 | 36.979592 | 201 | 0.671145 | false | 3.645446 | true | false | false |
sirca/bdkd_datastore | datastore/tests/unit/bdkd/datastore/util/test_copy_move.py | 1 | 3291 | # Copyright 2015 Nicta
#
# 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, softwa... | apache-2.0 | -4,339,567,989,079,044,000 | 40.658228 | 83 | 0.675175 | false | 3.710259 | true | false | false |
HIIT/mediacollection | sites/helsinginuutiset.py | 1 | 1658 | # -*- coding: utf-8 -*-
import requests
from bs4 import BeautifulSoup
import processor
from datetime import datetime
def parse( url ):
r = requests.get( url )
if r.status_code == 404:
return processor.create_dictionary('', url, r.status_code, [u''], [u''], u'', u'', u'', u'', [u''], [u''])
r.encoding = 'UTF-8'... | mit | 8,901,220,503,216,206,000 | 36.681818 | 147 | 0.670084 | false | 2.883478 | false | false | false |
flrvm/cobratoolbox | .github/github_stats.py | 1 | 1459 | from github import Github
g = Github("cobrabot", "dd31ac21736aeeaeac764ce1192c17e370679a25")
cobratoolbox = g.get_user("opencobra").get_repo("cobratoolbox")
contributors = {}
for contributor in cobratoolbox.get_stats_contributors():
a = 0
d = 0
c = 0
for week in contributor.weeks:
a += week.... | gpl-3.0 | 1,395,502,001,221,579,800 | 40.685714 | 137 | 0.58122 | false | 2.838521 | false | false | false |
marios-zindilis/musicbrainz-django-models | _build/model.py | 1 | 3430 | #!/usr/bin/env python3
import sys
try:
MODEL_NAME = sys.argv[1]
except IndexError:
print('Model Name Not Provided')
exit(1)
MODEL_NAME_TITLE = MODEL_NAME.title().replace('_', ' ')
MODEL = 'musicbrainz_django_models/models/{}.py'.format(MODEL_NAME)
INIT = 'musicbrainz_django_models/models/__init__.py'
SQL ... | gpl-2.0 | -6,831,984,093,304,596,000 | 26.66129 | 91 | 0.6 | false | 3.298077 | false | false | false |
sunqm/pyscf | pyscf/eph/test/test_uhf.py | 1 | 2089 | #!/usr/bin/env python
# Copyright 2014-2020 The PySCF Developers. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# U... | apache-2.0 | -3,297,742,572,155,970,000 | 36.981818 | 114 | 0.632839 | false | 2.97155 | true | false | false |
noskill/virt-manager | virtManager/config.py | 1 | 25087 | #
# Copyright (C) 2006, 2012-2014 Red Hat, Inc.
# Copyright (C) 2006 Daniel P. Berrange <berrange@redhat.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 version 2 of the License, o... | gpl-2.0 | -5,542,892,643,271,892,000 | 35.148415 | 79 | 0.604775 | false | 3.603936 | true | false | false |
armsky/Algorithms | Data Structure/trie.py | 1 | 1534 | class TrieNode:
# Initialize your data structure here.
def __init__(self):
self.children = {}
self.is_word = False
class Trie:
def __init__(self):
self.root = TrieNode()
# @param {string} word
# @return {void}
# Inserts a word into the trie.
def insert(self, word):... | apache-2.0 | -8,049,908,019,752,421,000 | 25.448276 | 47 | 0.508475 | false | 4.191257 | false | false | false |
felixrieseberg/lets-encrypt-preview | letsencrypt/le_util.py | 1 | 2392 | """Utilities for all Let's Encrypt."""
import collections
import errno
import os
import stat
from letsencrypt import errors
Key = collections.namedtuple("Key", "file pem")
# Note: form is the type of data, "pem" or "der"
CSR = collections.namedtuple("CSR", "file data form")
def make_or_verify_dir(directory, mode=0... | apache-2.0 | 6,374,653,857,685,918,000 | 27.47619 | 78 | 0.629599 | false | 3.921311 | false | false | false |
salimfadhley/jenkinsapi | jenkinsapi/utils/manifest.py | 3 | 3306 | """
This module enables Manifest file parsing.
Copied from
https://chromium.googlesource.com/external/googleappengine/python/+/master
/google/appengine/tools/jarfile.py
"""
import zipfile
_MANIFEST_NAME = 'META-INF/MANIFEST.MF'
class InvalidJarError(Exception):
"""
InvalidJar exception class
"""
pas... | mit | -2,833,017,234,510,234,000 | 33.082474 | 79 | 0.659407 | false | 4.190114 | false | false | false |
rogerthat-platform/rogerthat-backend | src/rogerthat/templates/__init__.py | 1 | 3596 | # -*- coding: utf-8 -*-
# Copyright 2017 GIG Technology NV
#
# 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... | apache-2.0 | -4,756,188,799,871,613,000 | 38.955556 | 113 | 0.666574 | false | 3.866667 | false | false | false |
shub0/algorithm-data-structure | python/ugly_nums.py | 1 | 1800 | '''
Write a program to check whether a given number is an ugly number.
Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. For example, 6, 8 are ugly while 14 is not ugly since it includes another prime factor 7.
Note that 1 is typically treated as an ugly number.
'''
class Solution(object):
... | bsd-3-clause | 8,164,448,989,103,989,000 | 26.272727 | 165 | 0.436111 | false | 3.73444 | false | false | false |
dabrahams/zeroinstall | zeroinstall/injector/config.py | 1 | 4191 | """
Holds user settings and various helper objects.
"""
# Copyright (C) 2011, Thomas Leonard
# See the README file for details, or visit http://0install.net.
from zeroinstall import _
import os
from logging import info, warn
import ConfigParser
from zeroinstall import zerostore
from zeroinstall.injector.model import... | lgpl-2.1 | 1,600,320,682,563,970,000 | 31.238462 | 117 | 0.715581 | false | 3.199237 | true | false | false |
cjmathy/ode_model | ode_modeler/plot.py | 1 | 3666 | import os
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages
def plot_all_queries(species, queries, out_dir, out_format,
plot_species, ttot, **kwargs):
'''
Description:
This method creates plots for each species, plotting timeco... | apache-2.0 | 3,636,057,399,998,828,000 | 30.333333 | 78 | 0.533824 | false | 4.091518 | false | false | false |
Iwan-Zotow/runEGS | XcIO/names_helper.py | 1 | 2104 | # -*- coding: utf-8 -*-
EGSPHAN_EXT = ".egsphant"
EGSINP_EXT = ".egsinp"
EGSPHSF_EXT = ".egsphsp1"
def make_cup_prefix(radUnit, outerCup, innerCupSer, innerCupNum):
"""
Makes filename prefix given RU, OC, IC info
Parameters
----------
radUnit: string
radiation unit
oute... | apache-2.0 | 574,515,979,374,324,900 | 21.147368 | 101 | 0.565589 | false | 3.140299 | false | false | false |
openstack/manila | manila/db/migrations/alembic/versions/344c1ac4747f_add_share_instance_access_rules_status.py | 1 | 4287 | # 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, software
# distributed under the Li... | apache-2.0 | 2,971,264,081,608,974,300 | 31.477273 | 76 | 0.642641 | false | 3.99534 | false | false | false |
michaelgichia/WeideShop | weideshop/products/views.py | 1 | 3232 | # -*- coding: utf-8 -*-
# Third party stuff
from django.shortcuts import render, get_object_or_404
from django.views.generic import ListView, DetailView
from django.views.generic.base import TemplateView
# Our stuff
from .models import Product, Subcategory, Category
class CategoryListView(ListView):
"""
Browse a... | bsd-2-clause | 3,212,083,904,628,984,000 | 23.671756 | 108 | 0.716584 | false | 3.409283 | false | false | false |
lcrees/knife | knife/_active.py | 1 | 6481 | # -*- coding: utf-8 -*-
'''active knives'''
from threading import local
from collections import deque
from contextlib import contextmanager
from stuf.utils import clsname
from knife._compat import loads, optimize
class _ActiveMixin(local):
'''active knife mixin'''
def __init__(self, *things, **kw):
... | bsd-3-clause | -5,760,023,825,560,073,000 | 28.193694 | 72 | 0.569511 | false | 4.314913 | false | false | false |
agingrasc/StrategyIA | ai/STA/Strategy/StrategyBook.py | 1 | 1930 | # Under MIT license, see LICENSE.txt
""" Livre des stratégies. """
from .HumanControl import HumanControl
from .SimpleDefense import SimpleDefense
from .SimpleOffense import SimpleOffense
from .DoNothing import DoNothing
class StrategyBook(object):
"""
Cette classe est capable de récupérer les stratégies ... | mit | -4,660,321,697,038,851,000 | 33.321429 | 126 | 0.631634 | false | 3.674952 | false | false | false |
s-macke/Kerasimo | models/snake.py | 1 | 1336 | from keras.models import Sequential, load_model
from keras.layers import *
from qlearning4k.games import Snake
from keras.optimizers import *
from qlearning4k import Agent
from lib import kerasimo
grid_size = 10
nb_frames = 4
nb_actions = 5
snake = Snake(grid_size)
model = load_model('models/snake.hdf5')
#model = Se... | mit | -1,961,486,161,902,618,600 | 28.688889 | 96 | 0.719311 | false | 2.656064 | false | false | false |
tasleson/lsm-ci | testing/github_event_gen.py | 1 | 2009 | """
Used for testing the service locally
"""
import argparse
import hashlib
import hmac
import os
import requests
import json
GIT_SECRET = os.getenv("GIT_SECRET", "")
PORT_NUM = os.getenv("PORT_NUM", "43301")
IP_ADDRESS = os.getenv("IP_ADDRESS", "127.0.0.1")
def gen_signature(data):
"""
Generate the signatu... | apache-2.0 | -6,225,019,245,875,923,000 | 24.75641 | 80 | 0.599303 | false | 3.337209 | false | false | false |
mfa/weight-app | weight/manage.py | 1 | 1205 | #!/usr/bin/env python
""" Part of weight_app
:copyright: (c) 2012 by Andreas Madsack.
:license: BSD, see LICENSE for more details.
"""
from flask.ext.script import Manager
from main import create_app, db
from utils import new_pw, get_emailaddress
# flask-Script
manager = Manager(create_app)
@manager.command... | bsd-3-clause | -5,661,920,201,830,214,000 | 23.591837 | 69 | 0.651452 | false | 3.554572 | false | false | false |
jlgoldman/writetogov | database/db_models.py | 1 | 4654 | from geoalchemy2 import Geography
from sqlalchemy.dialects import postgresql
from database import db
from util import fips
from util import text
SRID = 4326
# This table is auto-generated by shp2sql based on the TIGER shapefile
# tl_2016_us_cd115.zip (https://www.census.gov/cgi-bin/geo/shapefiles/index.php?year=2016... | bsd-3-clause | 6,247,504,885,244,312,000 | 37.783333 | 136 | 0.68049 | false | 3.026008 | false | false | false |
zbraniecki/pyast | pyast/typedlist.py | 1 | 4961 | import sys
import re
# Temporary solution for string/unicode in py2 vs py3
if sys.version >= '3':
basestring = str
class TypedList(list):
"""Strongly typed list
All elements of the list must be one of the given types.
Attributes:
init - initial values
types - allowed types
n... | bsd-3-clause | -4,534,332,588,961,025,000 | 33.93662 | 89 | 0.549083 | false | 3.994364 | false | false | false |
CKehl/pylearn2 | pylearn2/models/mlp.py | 1 | 166462 | """
Multilayer Perceptron
"""
__authors__ = "Ian Goodfellow"
__copyright__ = "Copyright 2012-2013, Universite de Montreal"
__credits__ = ["Ian Goodfellow", "David Warde-Farley"]
__license__ = "3-clause BSD"
__maintainer__ = "LISA Lab"
import logging
import math
import operator
import sys
import warnings
import numpy ... | bsd-3-clause | -8,657,553,449,295,059,000 | 33.730232 | 79 | 0.554054 | false | 4.164048 | false | false | false |
mganeva/mantid | scripts/Muon/GUI/MuonAnalysis/load_widget/load_widget_model.py | 1 | 1513 | # Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source
# & Institut Laue - Langevin
# SPDX - License - Identifier: GPL - 3.0 +
from __future__ import (absolute_import, divi... | gpl-3.0 | 1,026,091,008,242,188,000 | 32.622222 | 113 | 0.693985 | false | 3.708333 | false | false | false |
maemre/rasim | sim.py | 1 | 10863 | #!/usr/bin/env python
# Holy import!
from __future__ import division
from numpy import *
from matplotlib import pyplot as P
from agent import OptHighestSNR, RandomChannel, IndividualQ, FixChannel
from channel.simple import SimpleChannel
from traffic.simple import SimpleTraffic
from environment import Environment
impo... | apache-2.0 | 5,194,816,224,260,189,000 | 38.220217 | 137 | 0.58308 | false | 3.309872 | false | false | false |
alfa-jor/addon | plugin.video.alfa/channels/sxyprn.py | 1 | 6787 | # -*- coding: utf-8 -*-
#------------------------------------------------------------
import urlparse,re
from platformcode import config, logger
from core import scrapertools
from core.item import Item
from core import servertools
from core import httptools
host = 'https://www.sxyprn.com'
def mainlist(item):
log... | gpl-3.0 | 4,249,873,821,578,241,500 | 55.082645 | 167 | 0.620395 | false | 2.770927 | false | false | false |
cmin764/cloudbase-init | cloudbaseinit/metadata/services/osconfigdrive/windows.py | 1 | 8485 | # Copyright 2012 Cloudbase Solutions Srl
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | apache-2.0 | -5,127,092,252,806,962,000 | 37.568182 | 78 | 0.576429 | false | 3.941013 | true | false | false |
WhatDo/FlowFairy | examples/sine_fix/gglu_nopool.py | 1 | 3674 | import tensorflow as tf
import tensorflow.contrib.slim as slim
from flowfairy.conf import settings
from util import lrelu, conv2d, maxpool2d, embedding, avgpool2d, GLU, causal_GLU
from functools import partial
import ops
discrete_class = settings.DISCRETE_CLASS
batch_size = settings.BATCH_SIZE
samplerate = sr = settin... | mit | 6,973,295,967,363,852,000 | 31.803571 | 149 | 0.605335 | false | 3.06934 | false | false | false |
inguma/bokken | ui/graph.py | 1 | 6901 | # graph.py
#
# Copyright 2011 Hugo Teso <hugo.teso@gmail.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 version 2 of the License, or
# (at your... | gpl-2.0 | 5,638,959,716,393,014,000 | 37.769663 | 139 | 0.605564 | false | 3.528119 | false | false | false |
maurodoglio/taarweb | taarweb/users/provider.py | 1 | 1486 | from allauth.socialaccount.app_settings import QUERY_EMAIL
from allauth.socialaccount.providers.google.provider import (GoogleAccount,
GoogleProvider,
Scope)
class TaarGoogleAccount(GoogleAccount)... | mpl-2.0 | -2,247,812,986,946,630,000 | 34.380952 | 87 | 0.617766 | false | 4.435821 | false | false | false |
dmanev/ArchExtractor | ArchExtractor/umlgen/Specific/STK/StkParser/StkJilFileCriteria/StkJilDataCriteria.py | 1 | 2829 |
import re
import PortInterface.ProvidedPort
import PortInterface.RequiredPort
import PortInterface.SenderReceiverInterface
import Datatype.ArrayDataType
import PortInterface.DataElement
import StkParser.StkPortCriteria
import Components.IComponent
import Parser.IPortCriteria
class StkJilDataCriteria(StkParser.StkPort... | gpl-3.0 | 6,982,030,154,229,971,000 | 47.775862 | 92 | 0.537292 | false | 4.570275 | false | false | false |
andreweskeclarke/reinforcement_learning | src/agents.py | 1 | 5084 | import math
import random
class Agent:
def __init__(self, actions, options={}):
self.rgen = random.SystemRandom() # cryptographically secure, unlike random
self.actions = actions
self.last_action = None
def __choose_exploitative_action__(self):
raise Exception('Not implemented!... | mit | -68,055,493,988,964,190 | 35.84058 | 107 | 0.635917 | false | 3.765926 | false | false | false |
escsun/radio-shop | catalog/views.py | 1 | 1793 | from django.shortcuts import render, get_object_or_404
from .models import Category, Product, Value
from django.contrib import messages
from django.core.paginator import Paginator, PageNotAnInteger, EmptyPage
from django.core.exceptions import ObjectDoesNotExist
from cart.forms import CartAddProductForm
def catalog_i... | gpl-3.0 | 3,052,322,435,605,630,000 | 34.36 | 81 | 0.664969 | false | 4.015909 | false | false | false |
niacdoial/blemd | pseudobones.py | 1 | 21031 | from mathutils import Vector, Euler, Matrix
import bpy
import math
import re
from .common import dict_get_set
from . import common
from .Matrix44 import rotation_part
# import weakref
import logging
log = logging.getLogger('bpy.ops.import_mesh.bmd.pseudobones')
NtoB = Matrix([[1,0,0,0],
[0,0... | gpl-3.0 | 5,015,250,740,609,675,000 | 39.481262 | 111 | 0.53735 | false | 3.21035 | false | false | false |
CFIS-Octarine/octarine | validate/gui/views/errorhandling.py | 1 | 5325 | __author__ = "David Rusk <drusk@uvic.ca>"
import wx
class CertificateDialog(wx.Dialog):
def __init__(self, parent, handler, error_message):
super(CertificateDialog, self).__init__(parent, title="Certificate Error")
self.handler = handler
self.error_message = error_message
self._... | gpl-3.0 | -8,906,130,566,601,220,000 | 36.244755 | 95 | 0.604131 | false | 3.622449 | false | false | false |
firebase/grpc-SwiftPM | src/python/grpcio_tests/tests_aio/unit/init_test.py | 1 | 1698 | # Copyright 2019 The gRPC Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | apache-2.0 | -660,082,624,246,504,200 | 32.294118 | 102 | 0.717314 | false | 4.023697 | true | false | false |
aggrent/cab | cab/migrations/0002_migrate_ratings.py | 1 | 7081 | # encoding: utf-8
from south.v2 import DataMigration
from django.contrib.contenttypes.models import ContentType
from django.db.models import signals
from ratings.models import RatedItem, SimilarItem
class Migration(DataMigration):
def forwards(self, orm):
signals.post_save.disconnect(sender=RatedItem, ... | bsd-3-clause | -4,519,894,992,598,839,300 | 63.963303 | 163 | 0.551758 | false | 3.756499 | false | false | false |
integeruser/on-pwning | 2017-csaw-quals/Zone/zone.py | 1 | 3639 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
from pwn import *
context(arch='amd64', os='linux', aslr=True, terminal=['tmux', 'neww'])
if args['GDB']:
elf, libc = ELF('./zone-amd64-2.23-0ubuntu9'), ELF('libs/amd64/2.23/0ubuntu9/libc-2.23.so')
io = gdb.debug('./zone-amd64-2.23-0ubuntu9', gdbscript='''\
... | mit | 7,253,582,822,140,688,000 | 30.921053 | 108 | 0.663094 | false | 2.663982 | false | false | false |
apbard/scipy | scipy/constants/tests/test_constants.py | 2 | 3115 | from __future__ import division, print_function, absolute_import
from numpy.testing import assert_equal, assert_allclose
from scipy._lib._numpy_compat import suppress_warnings
import scipy.constants as sc
def test_convert_temperature():
assert_equal(sc.convert_temperature(32, 'f', 'Celsius'), 0)
assert_equal... | bsd-3-clause | 973,531,989,903,674,900 | 38.43038 | 79 | 0.608026 | false | 3.000963 | true | false | false |
longaccess/longaccess-client | lacli/upload.py | 1 | 8840 | from lacli.exceptions import PauseEvent
from lacli.pool import MPUpload
from lacli.source.chunked import ChunkedFile
from lacore.storage.s3 import MPConnection
from lacore.api import UploadState as BaseUploadState
from contextlib import contextmanager
from lacli.log import getLogger
from lacli.progress import queueHand... | apache-2.0 | 7,196,664,246,178,638,000 | 33.131274 | 79 | 0.552262 | false | 4.337586 | false | false | false |
MukunthanAlagarsamy/UCC_attempt1 | app.py | 1 | 1772 | #!/usr/bin/env python
import urllib
import json
import os
from flask import Flask
from flask import request
from flask import make_response
# Flask app should start in global layout
app = Flask(__name__)
@app.route('/webhook', methods=['POST'])
def webhook():
req = request.get_json(silent=True, force=True)
... | apache-2.0 | 590,739,204,705,281,700 | 25.447761 | 116 | 0.597065 | false | 3.508911 | false | false | false |
ProstoKSI/django-weed | djweed/db_fields.py | 1 | 2767 | from django.contrib.contenttypes.models import ContentType
try:
from django.core.urlresolvers import reverse
except ImportError: # Django 2.0
from django.urls import reverse
from django.db.models.fields.files import FieldFile, FileField
from django.utils import six
from .storage import WeedFSStorage
class W... | mit | 4,202,618,077,747,209,000 | 32.743902 | 92 | 0.641128 | false | 3.924823 | false | false | false |
COCS4950G7/COSC4950 | Resources/Tkinter Examples/Tkinter_example.py | 1 | 1256 |
#import Tkinter
#l = Tkinter.Label(text = "***************************See me?*************************")
#l.pack()
#l.mainloop()
#print("Howdy")
#omfg
#print("dostuff")
# http://www.ferg.org/thinking_in_tkinter/all_programs.html
from Tkinter import *
class MyApp:
def __init__(self, parent):
... | gpl-3.0 | 5,148,761,549,873,680,000 | 19.95 | 88 | 0.57086 | false | 3.305263 | false | false | false |
barthoekstra/Orographic-Landscape-Navigator | gisactions.py | 1 | 1466 | #!/usr/bin/python
# This code is simply a wrapper for running gdal commands, without MATLAB
# causing issues with dependencies, etc.
import sys
import os
print(sys.argv[0])
action = sys.argv[1]
targetfile = sys.argv[2]
if action == "merge":
print('Mergeing...')
# gdalbuildvrt merged.vrt r14bn2.wgs84.tif r1... | gpl-3.0 | -5,237,369,659,882,149,000 | 35.65 | 182 | 0.697817 | false | 2.745318 | false | false | false |
MaxTyutyunnikov/lino | obsolete/src/lino/apps/pizzeria/services.py | 1 | 2711 | ## Copyright 2003-2007 Luc Saffre
## This file is part of the Lino project.
## Lino 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... | gpl-3.0 | 4,601,415,181,698,994,000 | 27.536842 | 80 | 0.694947 | false | 3.242823 | false | false | false |
cwoebker/relo | relo/core/backend/redisdb.py | 1 | 1633 | #!/usr/bin/env python
# encoding: utf-8
import sys
import os
import redis
from relo.core.log import logger
dirname = os.path.dirname(os.path.abspath(__file__))
up_dir = os.path.dirname(dirname)
sys.path.append(up_dir)
from relo.core.interfaces import Backend
class REDISDB(Backend):
name = "redis"
expiretime... | bsd-3-clause | -2,834,990,471,099,505,700 | 32.346939 | 122 | 0.644213 | false | 3.589011 | false | false | false |
KanoComputing/kano-video | kano_video/logic/player.py | 1 | 4469 | # player.py
#
# Copyright (C) 2014-2016 Kano Computing Ltd.
# License: http://www.gnu.org/licenses/gpl-2.0.txt GNU GPL v2
#
# Manages playing of videos
import sys
import os
from kano.utils import is_installed, run_bg, get_volume, percent_to_millibel
from kano.logging import logger
from .youtube import get_video_file... | gpl-2.0 | 4,278,216,597,469,036,500 | 28.596026 | 96 | 0.590065 | false | 3.872617 | false | false | false |
amenonsen/ansible | lib/ansible/modules/network/fortios/fortios_firewall_DoS_policy6.py | 1 | 16272 | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Lic... | gpl-3.0 | 4,463,918,872,802,416,600 | 33.621277 | 157 | 0.505101 | false | 4.785882 | false | false | false |
fbcom/project-euler | 072_counting_fractions.py | 1 | 1188 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# A Solution to "Counting fractions" – Project Euler Problem No. 72
# by Florian Buetow
#
# Sourcecode: https://github.com/fbcom/project-euler
# Problem statement: https://projecteuler.net/problem=72
def get_distinct_prime_factors(n):
ret = []
if n > 1:
... | mit | -8,231,899,438,116,633,000 | 23.708333 | 81 | 0.572513 | false | 3.112861 | false | false | false |
aolindahl/epicea | straighten_lines.py | 1 | 4479 | # -*- coding: utf-8 -*-
"""
Created on Wed Jul 29 15:34:36 2015
@author: antlin
"""
import numpy as np
import matplotlib.pyplot as plt
import lmfit
import epicea
import electron_calibration_data
import plt_func
line_model = epicea.electron_calibration_helper.n_line_fit_model
line = 'voigt'
data_list = electron_cal... | gpl-2.0 | 8,085,153,324,896,847,000 | 35.120968 | 78 | 0.553472 | false | 3.03661 | false | false | false |
siberianisaev/NeutronBarrel | Neutrons preprocessing/neutron_preprocessing.py | 1 | 5365 | import pandas as pd
import numpy as np
class ExpProcessing:
"""
class for preprocessed neutrons experiment data
"""
def __init__(self, counts_measured):
"""
Input : counts_measured - list (or any numpy convertible type)
Method creates a data frame with experimental... | mit | -5,235,752,218,111,256,000 | 38.954198 | 97 | 0.555266 | false | 4.076748 | false | false | false |
Rafael-Cheng/MovieReviewCrawlers | broad crawler/MovieReview/MovieReview/spiders/MovieReviewSpider.py | 1 | 4028 | # -*- encoding:utf-8 -*-
import sys
import scrapy
from MovieReview.items import MoviereviewItem
from scrapy_redis.spiders import RedisSpider
from scrapy.http import Request, HtmlResponse
from scrapy.linkextractors import LinkExtractor
from scrapy.selector import Selector
from bs4 import BeautifulSoup
from obtain_date i... | gpl-3.0 | 8,782,475,459,918,302,000 | 35.563636 | 91 | 0.55644 | false | 3.724074 | false | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.