repo_name
stringlengths
5
92
path
stringlengths
4
232
copies
stringclasses
19 values
size
stringlengths
4
7
content
stringlengths
721
1.04M
license
stringclasses
15 values
hash
int64
-9,223,277,421,539,062,000
9,223,102,107B
line_mean
float64
6.51
99.9
line_max
int64
15
997
alpha_frac
float64
0.25
0.97
autogenerated
bool
1 class
duboviy/pybenchmark
pybenchmark/gprofiler.py
1
3896
""" Module for visualizing Python code profiles using the Chrome developer tools. Example usage: >>> profiler = Profiler() >>> profiler.start() >>> my_expensive_code() >>> profiler.stop() >>> with open('my.cpuprofile', 'w') as f: ... f.write(profiler.output()) In a gevented environnment, context switches can make t...
mit
4,730,682,478,425,819,000
27.647059
90
0.545688
false
federicoviola/alpha
wsgi/migrations/versions/42caf438dcdf_.py
1
3965
"""empty message Revision ID: 42caf438dcdf Revises: None Create Date: 2015-05-15 13:14:21.980616 """ # revision identifiers, used by Alembic. revision = '42caf438dcdf' down_revision = None from alembic import op import sqlalchemy as sa def upgrade(): ### commands auto generated by Alembic - please adjust! ###...
mit
-6,533,818,527,457,595,000
41.634409
91
0.653216
false
jkyeung/XlsxWriter
xlsxwriter/test/xmlwriter/test_xmlwriter.py
1
4972
############################################################################### # # Tests for XlsxWriter. # # Copyright (c), 2013-2016, John McNamara, jmcnamara@cpan.org # import unittest from ...compatibility import StringIO from ...xmlwriter import XMLwriter class TestXMLwriter(unittest.TestCase): """ Test...
bsd-2-clause
-3,393,517,108,779,341,000
24.895833
79
0.527554
false
PeterCP/Genera-Flask
migrations/versions/f90d3b386518_add_columns_to_event_model.py
1
1289
"""Add columns to Event model Columns added: location_name latitude longitude price and max_attendants Revision ID: f90d3b386518 Revises: 1150136bf0ab Create Date: 2016-08-08 11:30:45.154593 """ # revision identifiers, used by Alembic. revision = 'f90d3b386518' down_revision = '1150136bf0ab' fro...
gpl-3.0
-9,144,359,881,202,681,000
31.225
101
0.686579
false
devonjones/PSRD-Parser
src/psrd/extensions/table/weapon.py
1
2927
#import pprint from BeautifulSoup import BeautifulSoup from psrd.extensions.table.general import add_additional_fields, fix_cost, set_subtype, clear_nbsp def set_damage(weapon): damage = { "see text": ('see text', 'see text'), "special": ('special', 'special'), "Special": ('Special', 'Special'), "1d2": ('&mda...
gpl-3.0
4,741,995,699,257,910,000
26.35514
98
0.594465
false
INCF/BIDS2ISATab
setup.py
1
2176
from setuptools import setup import os here = os.path.abspath(os.path.dirname(__file__)) setup( name="BIDS2ISATab", # Versions should comply with PEP440. For a discussion on single-sourcing # the version across setup.py and the project code, see # http://packaging.python.org/en/latest/tutorial.html#...
apache-2.0
-2,931,770,675,141,887,500
33
119
0.641085
false
lkundrak/scraperwiki
web/api/viewshandlers.py
1
31419
import urllib import urllib2 from django.contrib.sites.models import Site from django.conf import settings from django.template import RequestContext, loader, Context from django.http import HttpResponseRedirect, HttpResponse, Http404, HttpResponseNotFound from django.shortcuts import render_to_response from django.s...
agpl-3.0
-3,396,897,372,369,275,400
39.593023
160
0.62529
false
npardington/fabric-bolt
fabric_bolt/task_runners/channels/consumers.py
1
3109
import json import subprocess from importlib import import_module import ansiconv import sys from channels import Group from channels.auth import channel_session_user_from_http from channels.sessions import channel_session from django.conf import settings from fabric_bolt.projects.models import Project, Deployment f...
mit
-7,930,746,221,363,774,000
29.782178
106
0.677067
false
gobstones/PyGobstones
pygobstones/gui/mainWindow.py
1
26321
# -*- coding: utf-8 -*- from views.gobstonesMain import * from PyQt4 import QtGui from PyQt4 import QtCore import datetime from views.qDesigner.interactive import * sys.path.append('..') from .fileOption import FileOption from .preferencesWindow import PreferencesWindow from .editOption import EditOption from .boardOp...
gpl-3.0
9,027,376,901,329,861,000
37.368805
111
0.616808
false
teodorch85/teir
python/script.py
1
1551
import webiopi import datetime GPIO = webiopi.GPIO #LIGHT = 17 # GPIO pin using BCM numbering VALVE1 = 2 VALVE2 = 3 VALVE3 = 7 VALVE4 = 8 VALVE5 = 9 VALVE6 = 10 VALVE7 = 11 VALVE8 = 18 #HOUR_ON = 8 # Turn Light ON at 08:00 #HOUR_OFF = 18 # Turn Light OFF at 18:00 # setup function is automatically called at WebIOP...
mit
1,581,921,889,849,100,500
25.288136
59
0.694391
false
PaloAltoNetworks-BD/autofocus-client-library
autofocus/config.py
1
1373
import logging try: from .gsrt_config import GSRTConfig except ImportError: from gsrt_config import GSRTConfig def get_logger(): """ To change log level from calling code, use something like logging.getLogger("autofocus").setLevel(logging.DEBUG) """ logger = logging.getLogger("autofocus")...
isc
-221,946,744,656,364,380
26.46
108
0.689002
false
cklein/wtforms
tests/fields.py
1
35845
from __future__ import unicode_literals import sys from datetime import date, datetime from decimal import Decimal, ROUND_UP, ROUND_DOWN from unittest import TestCase from wtforms import validators, widgets, meta from wtforms.fields import * from wtforms.fields import Label, Field, SelectFieldBase, html5 from wtform...
bsd-3-clause
-6,197,012,358,329,186,000
37.173589
150
0.581113
false
HugoMMRabson/fonsa
src/my/oledhat/interface.py
1
12780
''' my.oledhat.interface This library contains the high-level functions for drawing on the MyOled class (the means of publishing new images onto the NanoHat OLED device). Key functions:- prompt_for_keyboard_text display keyboard; let user enter a phrase; return the phrase choose_from_list ...
gpl-3.0
7,816,275,130,026,679,000
32.899204
113
0.514397
false
giserh/pysparkling
pysparkling/rdd.py
1
44048
""" Provides a Python implementation of RDDs. """ from __future__ import (division, absolute_import, print_function, unicode_literals) import io import sys import copy import pickle import random import logging import functools import itertools import subprocess from collections import defaul...
mit
-438,791,647,940,619,650
25.376048
79
0.509649
false
robjwells/adventofcode-solutions
2015/python/2015-07.py
1
3324
#!/usr/bin/env python3 """Advent of Code 2015, Day 7: Some Assembly Required""" class Circuit: """A set of wires connected with bitwise logic gates""" def __init__(self, instructions): """Parse instructions into a circuit layout instructions should be the text from the puzzle input without ...
mit
-3,761,301,647,110,829,000
30.657143
74
0.552647
false
charanpald/sandbox
sandbox/predictors/edge/EgoEdgeLabelPredictor.py
1
4133
import logging import gc from apgl.predictors.AbstractPredictor import AbstractPredictor from exp.sandbox.predictors.edge.AbstractEdgeLabelPredictor import AbstractEdgeLabelPredictor from sandbox.util.Util import Util from sandbox.util.Parameter import Parameter from apgl.data import * import numpy class EgoEdgeL...
gpl-3.0
-4,064,797,585,648,417,300
36.572727
100
0.639487
false
Lynn-015/NJU_DMRG
dmrg/hgen.py
1
4476
import numpy as np from scipy.sparse import kron,identity from copy import copy,deepcopy from ops import Z,Zs from utils import index_map class HGen(object): def __init__(self,terms,L,d=2,part='left',fermi=False,sfermi=False,sectors=np.array([0.5,-0.5])): self.l=1;self.d=d;self.D=self.d self.H=np.zeros([self.d,s...
mit
-1,375,554,513,258,585,600
36.613445
105
0.669571
false
tinfoilboy/Tiger
Tiger/shader_build.py
1
2471
import json import os import textwrap import re import sys BASE_DIR = os.path.dirname(__file__) # Global defines for the file paths shaders_path = "shaders/" shader_builder_class_path = "FileFragments/Shader/ShaderBuilderClass.part" shader_method_path = "FileFragments/Shader/ShaderMethod.part" shader_builder_header_...
mit
-2,424,530,186,793,516,000
34.826087
121
0.718737
false
c-PRIMED/puq
puq/sweep.py
1
13705
""" This file is part of PUQ Copyright (c) 2013 PUQ Authors See LICENSE file for terms. """ from __future__ import absolute_import, division, print_function import time, os, re, h5py, sys, string import numpy as np from puq.testprogram import TestProgram from numpy import ndarray from puq.hdf import get_output_names f...
mit
-7,390,847,280,369,197,000
34.78329
111
0.503977
false
dpshelio/sunpy
sunpy/map/sources/iris.py
2
2106
import numpy as np from sunpy.map import GenericMap __all__ = ['SJIMap'] class SJIMap(GenericMap): """ A 2D IRIS Slit Jaw Imager Map. The Interface Region Imaging Spectrograph (IRIS) small explorer spacecraft provides simultaneous spectra and images of the photosphere, chromosphere, transition ...
bsd-2-clause
-1,119,281,357,650,623,600
37.290909
79
0.662393
false
Smile-SA/odoo_addons
smile_access_control/tests/test_users.py
1
3193
# -*- coding: utf-8 -*- # (C) 2011 Smile (<http://www.smile.fr>) # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl). from odoo.tests.common import TransactionCase from odoo.exceptions import ValidationError class TestUsers(TransactionCase): def setUp(self): super(TestUsers, self).setUp() ...
agpl-3.0
2,554,910,866,651,053,000
34.477778
75
0.537426
false
all-of-us/raw-data-repository
rdr_service/lib_fhir/fhirclient_4_0_0/models/contactpoint.py
1
2156
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/ContactPoint) on 2019-05-07. # 2019, SMART Health IT. from . import element class ContactPoint(element.Element): """ Details of a Technology mediated contact point (phone, fax, email,...
bsd-3-clause
6,030,556,860,741,067,000
32.169231
109
0.579314
false
andrewebdev/tehblog
src/tehblog/templatetags/tehblog_tags.py
1
3510
# -*- coding: utf-8 -*- # © Copyright 2009 Andre Engelbrecht. All Rights Reserved. # This script is licensed under the BSD Open Source Licence # Please see the text file LICENCE for more information # If this script is distributed, it must be accompanied by the Licence import re from django import template from djan...
bsd-3-clause
5,456,668,170,593,911,000
26.421875
74
0.667142
false
nzmm/granite
pages/admin.py
1
1080
from django.contrib import admin from django.contrib.auth.models import User from reversion.admin import VersionAdmin from pages.models import ( Template, Page, ) from pages.forms import ( TemplateAdminForm, PageAdminForm ) @admin.register(Template) class TemplateAdmin(VersionAdmin): list_display ...
gpl-3.0
-411,300,705,075,125,440
30.764706
91
0.668519
false
JungWinter/HongikFood
app/message.py
1
3222
from .keyboard import Keyboard from json import loads, dumps class Message: # Message클래스를 생성할 때 기본적인 틀만 구현하고 # 값들은 던져주면 알아서 메시지를 리턴한다 baseKeyboard = { "type": "buttons", "buttons": Keyboard.buttons, } baseMessage = { "message": { "text": "", }, ...
mit
7,895,352,751,004,431,000
25.964912
84
0.576448
false
hendrikx-itc/python-minerva
tests/storage/test_outputdescriptor.py
1
1255
import unittest from minerva.storage.valuedescriptor import ValueDescriptor from minerva.storage.outputdescriptor import OutputDescriptor from minerva.storage import datatype class TestOutputDescriptor(unittest.TestCase): def test_constructor(self): value_descriptor = ValueDescriptor( 'x', ...
gpl-3.0
-4,890,449,870,164,517,000
27.522727
70
0.610359
false
commtrack/temp-aquatest
apps/buildmanager/api/resources.py
1
5466
import os import bz2 import sys import logging import traceback import cStringIO import tempfile from django.conf import settings from django.http import HttpResponse, HttpResponseBadRequest from django.core.servers.basehttp import FileWrapper from django.core import serializers from buildmanager.models ...
bsd-3-clause
6,441,088,789,940,433,000
38.205882
99
0.655507
false
vponomaryov/rally
rally/plugins/openstack/scenarios/ceilometer/samples.py
1
1179
# All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
apache-2.0
1,822,927,607,369,197,000
35.84375
78
0.731976
false
ocefpaf/cartopy
lib/cartopy/io/img_tiles.py
1
22922
# (C) British Crown Copyright 2011 - 2019, Met Office # # This file is part of cartopy. # # cartopy is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by the # Free Software Foundation, either version 3 of the License, or # (at your option)...
lgpl-3.0
-7,582,404,670,517,037,000
35.097638
79
0.563345
false
hobson/pug-dj
pug/dj/sqlserver.py
1
7833
from django.db import connections #, transaction from collections import OrderedDict, namedtuple from django.conf import settings from django.db import DatabaseError from traceback import print_exc from ansi.constants import field_type_name def dictfetchall(cursor): """Returns all rows from a cursor as a dict (r...
mit
-6,840,538,291,162,996,000
40.231579
275
0.650198
false
rajathkumarmp/robocomp
tools/rcmaster/test/test.py
1
6886
import pexpect, sys from os import environ , path from time import sleep from copy import deepcopy import unittest class Comp: def __init__(self, name, cmd): self.init_name = name self.name = self.init_name self.cmd = cmd self.staus = 0 self.output = '' self.extra_p...
gpl-3.0
-3,446,347,255,780,175,000
34.132653
120
0.58176
false
cmcantalupo/geopm
integration/test/test_geopmagent.py
1
6341
#!/usr/bin/env python # # Copyright (c) 2015 - 2021, Intel Corporation # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistributions of source code must retain the above copyright # notice, thi...
bsd-3-clause
-3,058,918,124,092,099,000
43.65493
93
0.579246
false
shaftoe/home-assistant
homeassistant/components/zwave/node_entity.py
1
5871
"""Entity class that represents Z-Wave node.""" import logging from homeassistant.core import callback from homeassistant.const import ATTR_BATTERY_LEVEL, ATTR_WAKEUP from homeassistant.helpers.entity import Entity from homeassistant.util import slugify from .const import ATTR_NODE_ID, DOMAIN, COMMAND_CLASS_WAKE_UP f...
apache-2.0
-6,447,722,180,573,683,000
32.169492
79
0.616931
false
saullocastro/compmech
theory/func/bardell/print_bardell_integrals_to_fortran.py
2
2549
import os import glob from ast import literal_eval import numpy as np import sympy from sympy import pi, sin, cos, var var('xi1, xi2') var('x1t, x1r, x2t, x2r') var('y1t, y1r, y2t, y2r') subs = { } def List(*e): return list(e) printstr_12 = '' printstr_full = '' for i, filepath in enumerate( glo...
bsd-3-clause
-3,921,367,220,447,581,700
35.942029
117
0.511573
false
yausern/stlab
devices/Keithley_6430.py
1
1068
import visa import numpy as np from stlab.devices.instrument import instrument import time class keithley6430(instrument): def __init__(self,addr = "TCPIP::192.168.1.212::1470::SOCKET", reset = True, verb=True, read_termination='\r\n'): #Needs \r\n line termination super().__init__(addr,reset...
gpl-3.0
1,634,099,699,270,036,200
30.411765
117
0.63015
false
tliron/ronin
examples/installing/build.py
1
1465
#!/usr/bin/env python # # Installing Example # # build.py # # Requirements: # # Ubuntu: sudo apt install gcc ccache # # To install your build, use the Copy executor and set "inputs_from=" to the generating phase, # as well as "output_strip_prefix_from=" if you want to strip the original output path. # # Run with th...
apache-2.0
-8,915,936,785,964,512,000
27.72549
99
0.664164
false
mandoku/mdweb
app/main/errors.py
1
1045
# -*- coding: utf-8 -*- from flask import render_template, request, jsonify from . import main @main.app_errorhandler(403) def forbidden(e): if request.accept_mimetypes.accept_json and \ not request.accept_mimetypes.accept_html: response = jsonify({'error': 'forbidden'}) response.st...
mit
-4,551,379,110,060,904,000
30.666667
62
0.662201
false
auto-mat/klub
apps/aklub/autocom.py
1
6964
# -*- coding: utf-8 -*- # Author: Hynek Hanke <hynek.hanke@auto-mat.cz> # # Copyright (C) 2010 o.s. Auto*Mat # # 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...
gpl-3.0
9,162,069,310,918,358,000
37.263736
133
0.597071
false
opennode/waldur-mastermind
src/waldur_core/structure/tests/unittests/test_handlers.py
1
5755
from unittest import mock from django.test import TestCase from waldur_core.structure import models as structure_models from waldur_core.structure.tests import factories, fixtures class LogProjectSaveTest(TestCase): @mock.patch('waldur_core.structure.handlers.event_logger') def test_logger_called_once_on_pr...
mit
251,253,752,996,053,730
38.689655
108
0.563684
false
bonus-tm/euforia
events/distribute.py
1
2523
# Распределение зерна на еду и на посев import re import data, ask, act from event import Event class Distribute(Event): """Распределение зерна""" # def start(self): """docstring for start""" self.min_for_food = data.resources['peasant'] + data.resources['soldier'] + 1 self.min...
mit
-968,450,527,075,147,000
31.2
104
0.501775
false
Yelp/dumb-init
tests/exit_status_test.py
1
1237
import signal import sys from subprocess import Popen import pytest @pytest.mark.parametrize('exit_status', [0, 1, 2, 32, 64, 127, 254, 255]) @pytest.mark.usefixtures('both_debug_modes', 'both_setsid_modes') def test_exit_status_regular_exit(exit_status): """dumb-init should exit with the same exit status as the...
mit
9,069,085,403,994,106,000
29.925
88
0.645109
false
challenge19/conpy
classify/classify_node.py
1
2070
#!/usr/bin/env python # -*- coding: utf-8 -*- # import networkx as nx import numpy as np import random import Lib_gen_Graph as lig import Lib_cal_control as lcc import classify_by_add_node as can import classify_by_renorm.classify_by_renorm_undirected as cru #import StructuralRenorm.package.Lib_struct_renorm as lsr ...
mit
2,258,245,540,786,862,300
32.387097
123
0.584541
false
algorhythms/LeetCode
527 Word Abbreviation.py
1
1679
#!/usr/bin/python3 """ premium question """ from typing import List from collections import defaultdict class Solution: def wordsAbbreviation(self, words: List[str]) -> List[str]: """ Sort the word, check prefix and last word Group by first and last char, group by prefix and last char ...
mit
-8,415,701,674,983,687,000
27.948276
206
0.481834
false
katrielalex/rate-equations-odeint
redirect_std.py
1
1258
# http://stackoverflow.com/a/22434262/398968 import os import sys import contextlib def fileno(file_or_fd): fd = getattr(file_or_fd, 'fileno', lambda: file_or_fd)() if not isinstance(fd, int): raise ValueError("Expected a file (`.fileno()`) or a file descriptor") return fd @contextlib.contextmana...
gpl-3.0
9,220,618,834,503,481,000
36
80
0.628776
false
ksetyadi/Sahana-Eden
models/06_supply.py
1
5661
# -*- coding: utf-8 -*- """ Supply @author: Michael Howden (michael@sahanafoundation.org) @date-created: 2010-08-16 Generic Supply functionality such as catalogs and items that will be used across multiple modules """ module = "supply" if deployment_settings.has_module("logs"): #================...
mit
-1,531,580,686,840,160,000
43.574803
207
0.512454
false
falcondai/svcrawl
models.py
1
2640
# description: download Google StreetViews images and save them # the Google StreeView API is documented here: # https://developers.google.com/maps/documentation/streetview/ # author: Falcon Dai import cStringIO import mongoengine as me from PIL import Image from google_streetview_api import * class Pano(me.Document...
mit
8,110,197,922,455,155,000
31.195122
141
0.625758
false
mike10004/adventofcode2016
advent14_otp.py
1
6772
#!/usr/bin/env python import sys import re import hashlib import logging from collections import defaultdict _log = logging.getLogger('a14otp') _PATT3 = re.compile(r'(?:(\w)\1\1)') _PATT5 = re.compile(r'(?:(\w)\1\1\1\1)') _MAX_CURSOR = 10000000 # 10 million def clean(items, predicate): assert isinstance(items,...
mit
-6,330,920,249,477,197,000
36.832402
166
0.562906
false
sdanielf/dictate
setup.py
1
5131
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2013 S. Daniel Francis <francis@sugarlabs.org> # # 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, ...
gpl-3.0
951,621,605,844,470,300
37.871212
78
0.573572
false
mhoffman/kmos
kmos/cli.py
1
16514
#!/usr/bin/env python """Entry point module for the command-line interface. The kmos executable should be on the program path, import this modules main function and run it. To call kmos command as you would from the shell, use :: kmos.cli.main('...') Every command can be shortened as long as...
gpl-3.0
-7,991,788,097,576,638,000
31.253906
142
0.548504
false
gperciva/artifastring
interactive/tuning_pitch.py
1
1587
#!/usr/bin/env python ## # Copyright 2010--2013 Graham Percival # This file is part of Artifastring. # # Artifastring 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...
gpl-3.0
-3,633,596,735,271,529,000
27.339286
65
0.612476
false
ondrejch/FSM
scripts/mk1/surfaces.py
1
2678
#!/usr/bin/env python3 # # Generate surfaces, pins, and lattice for FastDrum Serpent deck # Ondrej Chvala, ochvala@utk.edu # 2016-08-02 import math def write_surfaces(N, r, refl): '''Function to write material cards for Serpent input deck. Inputs: N: size of the N x N checkerboard lattice ...
gpl-3.0
-1,026,238,962,245,229,800
34.236842
115
0.533607
false
pegasus-isi/pegasus
packages/pegasus-python/src/Pegasus/service/monitoring/errors.py
1
1894
import logging from flask import make_response from sqlalchemy.orm.exc import NoResultFound from Pegasus.service._query import InvalidQueryError from Pegasus.service._serialize import jsonify from Pegasus.service._sort import InvalidSortError from Pegasus.service.base import ErrorResponse, InvalidJSONError from Pegas...
apache-2.0
-8,742,466,944,660,014,000
23.921053
86
0.683738
false
samuelbustamante/dirinfo
tickets/models.py
1
2476
# coding=utf-8 from django.db import models from django.contrib.auth.models import User from django.core.urlresolvers import reverse STATUS_OPEN = 0 STATUS_ON_HOLD = 1 STATUS_BELATED = 2 STATUS_RESOLVED = 3 STATUS_CLOSED = 4 PRIORITY_LOW = 0 PRIORITY_NORMAL = 1 PRIORITY_HIGHT = 2 PERMISSION_CAN_ASSIGNED = "can_assign...
apache-2.0
-6,085,948,790,724,800,000
30.341772
73
0.620355
false
nhmc/LAE
python_modules/cloudy/utils.py
1
11349
from barak.utilities import between from barak.io import parse_config, readtxt from scipy.integrate import simps import numpy as np from barak.constants import Ryd_Ang, pi, hplanck import os def get_data_path(): """ Return the path to the data directory for this package. """ return os.path.abspath(__file_...
mit
-1,258,561,087,993,598,200
28.025575
76
0.573707
false
beni55/rinohtype
rinoh/inline.py
1
1880
# This file is part of RinohType, the Python document preparation system. # # Copyright (c) Brecht Machiels. # # Use of this source code is subject to the terms of the GNU Affero General # Public License v3. See the LICENSE file or http://www.gnu.org/licenses/. from .element import DocumentElement from .flowable impo...
agpl-3.0
4,611,793,927,843,337,000
23.736842
76
0.678191
false
HuimingCheng/AutoGrading
learning/number recognization/network.py
1
12668
# # Written for Theano 0.6 and 0.7, needs some changes for more recent # # versions of Theano. # # # #### Libraries # # Standard library # import cPickle # import gzip # # # Third-party libraries # import numpy as np # import theano # import theano.tensor as T # from theano.tensor.nnet import conv # from ...
mit
-1,141,172,397,960,328,700
43.25
92
0.558573
false
cfehring/slack-onnow
slack-onnow.py
1
6863
''' This function handles a Slack slash command named "/onnow" and echoes the details back to the Slack user. Follow these steps to configure the slash command in Slack: 1. Navigate to https://<your-team-domain>.slack.com/services/new 2. Search for and select "Slash Commands". 3. Enter a name for your command...
gpl-3.0
-218,650,652,733,150,340
35.897849
369
0.641556
false
ubernostrum/akismet
src/akismet.py
1
8707
import os import sys import textwrap from typing import Optional import requests __version__ = "1.1" class AkismetError(Exception): """ Base exception class for Akismet errors. """ pass class UnknownArgumentError(AkismetError): """ Indicates an unknown argument was used as part of an API...
bsd-3-clause
7,653,013,120,406,950,000
28.316498
87
0.576777
false
Yelp/paasta
paasta_tools/adhoc_tools.py
1
4751
# Copyright 2015-2016 Yelp 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 agreed to in writin...
apache-2.0
-39,066,044,855,018,150
32.457746
85
0.651652
false
doutib/lobpredict
lobpredictrst/execute_model.py
1
5878
import sys import imp import yaml import csv import pandas as pd import re from rf import * from svm import * modl = imp.load_source('read_model_yaml', 'read_model_yaml.py') # Parse the YAML file location as the first parameter inp_yaml = sys.argv[1] def write_results_txt(filename, result): """ Write results ...
isc
987,665,203,610,103,800
34.409639
98
0.514631
false
leiferikb/bitpop
src/tools/telemetry/telemetry/core/platform/power_monitor/android_ds2784_power_monitor.py
1
4983
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import logging import os from telemetry import decorators from telemetry.core.platform.profiler import android_prebuilt_profiler_helper import telemetry.cor...
gpl-3.0
-5,266,683,894,114,779,000
38.23622
79
0.645595
false
reinbach/finance
api/finance/views/account.py
1
3764
import json from flask import abort, jsonify, request, Response from flask.views import MethodView import config from finance import utils, db from finance.forms.account import AccountForm from finance.models.account import Account from finance.stats import STATS class AccountAPI(MethodView): """Account Views"...
bsd-3-clause
152,536,387,370,015,520
32.607143
77
0.529224
false
FRESNA/vresutils
test/test_transfer.py
1
1167
from __future__ import absolute_import import pytest import numpy as np from numpy.testing import assert_allclose import scipy.sparse as sparse from vresutils import transfer @pytest.fixture def orig(): return np.array(((0., 0.), (1., 1.))) @pytest.fixture def dest(): return np.array(((1.5, 1.), (0., 0.5),...
gpl-3.0
-2,421,937,108,105,041,400
28.175
70
0.537275
false
hep-gc/panda-autopyfactory
bin/factory.py
1
6335
#! /usr/bin/env python # # Simple(ish) python condor_g factory for panda pilots # # $Id$ # # # Copyright (C) 2007,2008,2009 Graeme Andrew Stewart # # 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 Founda...
gpl-3.0
-1,333,859,866,517,586,400
45.580882
137
0.679084
false
gandalfcode/gandalf
tests/paper_tests/binaryorbit.py
1
3711
#============================================================================== # freefalltest.py # Run the freefall collapse test using initial conditions specified in the # file 'freefall.dat'. #============================================================================== from gandalf.analysis.facade import * from g...
gpl-2.0
-3,695,500,023,174,493,700
27.992188
101
0.618971
false
asayler/tutamen-pytutamen
pytutamen/base.py
1
5612
# -*- coding: utf-8 -*- # Andy Sayler # 2015 # pytutamen Package # Tutamen Client Library ### Imports ### from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import from future import standard_library standard_library.install...
lgpl-2.1
6,913,057,864,763,884,000
27.343434
95
0.590164
false
pombredanne/https-git.fedorahosted.org-git-kobo
kobo/http.py
1
4351
# -*- coding: utf-8 -*- # based on: http://code.activestate.com/recipes/146306/ import httplib import mimetypes import os from kobo.shortcuts import random_string class POSTTransport(object): """ POST transport. USAGE: >>> import kobo.http t = kobo.http.POSTTransport() t.add_vari...
lgpl-2.1
-2,957,594,066,260,830,000
29.215278
112
0.535969
false
2Guys1Python/Project-Cacophonum
data/states/player_menu.py
1
2099
""" This is the state where the player can look at his inventory, equip items and check stats. Most of the logic is in menugui.MenuGUI() """ import pygame as pg from .. import tools, setup, menugui from .. import constants as c class Player_Menu(object): def __init__(self, game_data, level): inventory = g...
mit
-6,648,040,916,525,575,000
30.80303
67
0.608861
false
evangelistalab/forte
forte/solvers/active_space_solver.py
1
6737
from forte.core import flog from forte.solvers.solver import Feature, Solver from forte.forte import ForteOptions from forte import to_state_nroots_map from forte import forte_options from forte.forte import make_active_space_ints, make_active_space_solver class ActiveSpaceSolver(Solver): """ A class to dia...
lgpl-3.0
-2,397,025,364,970,134,000
39.584337
138
0.620751
false
jhamman/mtclim5
mtclim/share.py
1
3374
''' share.py ''' # Mountain Climate Simulator, meteorological forcing disaggregator # Copyright (C) 2015 Joe Hamman # 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
7,141,067,628,994,798,000
38.694118
71
0.613219
false
davidak/satzgenerator
python/satzgenerator.py
1
1797
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Satzgenerator Referenzimplementierung """ import sys import random as r # Textdateien einlesen, Zeilen in Liste vornamen_m = open('../data/vornamen_m.txt', 'r').read().splitlines() vornamen_w = open('../data/vornamen_w.txt', 'r').read().splitlines() vornamen = vorna...
gpl-3.0
4,652,005,081,419,994,000
27.492063
143
0.594986
false
cheddartv/stockstream.live
webapp/stockstream/api.py
1
5316
import config import robinhood import time import httputil import json def get_api_request(request): return httputil.get_json_object_from_url(config.SS_API_ENDPOINT + request) def post_api_request(request, obj): return httputil.post_object_to_url(config.SS_API_ENDPOINT + request, json.dumps(obj)) def get_...
mit
-351,231,517,994,377,860
25.187192
89
0.668548
false
loganasherjones/python-logstash-async
logstash_async/memory_cache.py
1
3382
# -*- coding: utf-8 -*- # # This software may be modified and distributed under the terms # of the MIT license. See the LICENSE file for details. import uuid from logging import getLogger as get_logger from datetime import datetime, timedelta from logstash_async.cache import Cache class MemoryCache(Cache): """B...
mit
-257,946,098,770,652,860
40.753086
126
0.512714
false
topnotchgeek/capnlog
apps/www/behaviors.py
1
1759
import markdown from django.db import models from django.utils.text import slugify from conf import settings class Permalinkable(models.Model): slug = models.SlugField() class Meta: abstract = True def get_url_kwargs(self, **kwargs): kwargs.update(getattr(self, 'url_kwargs', {})) ...
apache-2.0
4,012,738,729,876,496,400
22.453333
106
0.641842
false
TheTimmy/spack
var/spack/repos/builtin/packages/r-htmltools/package.py
1
1623
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
-2,519,248,564,218,370,600
42.864865
78
0.666667
false
zimolzak/poker-experiments
pokermodules/convenience_hole.py
1
11895
import numpy from convenience import reduce_h, find_pcts_multi from deuces.deuces import Deck, Card from itertools import combinations, product import random all52 = Deck.GetFullDeck() all_hole_explicit = [] for h in combinations(all52, 2): all_hole_explicit += [list(h)] deck_choose_2 = len(all_hole_explicit) asse...
mit
6,878,339,368,544,250,000
33.181034
110
0.479781
false
matejc/searx
tests/unit/engines/test_qwant.py
1
9798
from collections import defaultdict import mock from searx.engines import qwant from searx.testing import SearxTestCase class TestQwantEngine(SearxTestCase): def test_request(self): query = 'test_query' dicto = defaultdict(dict) dicto['pageno'] = 0 dicto['language'] = 'fr-FR' ...
agpl-3.0
4,041,793,583,514,509,000
29.908517
77
0.423046
false
machinalis/django-srd20
srd20/migrations/0005_auto__chg_field_spell_altname.py
1
3803
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Changing field 'Spell.altname' db.alter_column('spell', 'altname', self.gf('django.db.models.fields.Slug...
bsd-3-clause
1,010,940,833,213,747,000
59.365079
124
0.556929
false
murat1985/bagpipe-bgp
bagpipe/bgp/engine/__init__.py
2
7221
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # encoding: utf-8 # Copyright 2014 Orange # # 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 # # Un...
apache-2.0
-6,958,950,871,063,271,000
32.430556
79
0.595485
false
SkySchermer/uweclang
uweclang/query/grammar/QueryLexer.py
1
6565
# Generated from java-escape by ANTLR 4.5 # encoding: utf-8 from __future__ import print_function from antlr4 import * from io import StringIO def serializedATN(): with StringIO() as buf: buf.write(u"\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\2") buf.write(u"\27\u00a4\b\1\4\2\t\2\4\3\t\3\4...
mit
-2,795,009,675,822,149,000
49.5
103
0.527494
false
qguv/config
weechat/plugins/python/weestreamer.py
1
4152
# Copyright (c) 2015 by Miblo <miblodelcarpio@gmail.com> # All rights reserved # # 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 ...
gpl-3.0
-2,907,162,474,371,489,300
38.542857
104
0.622592
false
daviur/py-cracking-the-coding-interview
trees-and-graphs/tg_traversal.py
1
4187
# The MIT License (MIT) # # Copyright (c) 2016 David I Urbina # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, mo...
mit
412,412,928,509,585,800
25.333333
80
0.567471
false
jar398/tryphy
tests/test_sl_eol_get_links.py
1
2532
# 10. sl/eol/get_links # Parameter: list of species # Result: # input_species - repeats input (issue: flush this) # message, status_code as usual # meta_data - not very useful # species - list of blobs about species # eol_id # matched_name - contains authority # searched_name - presumably wha...
bsd-2-clause
1,020,772,690,744,866,700
31.883117
100
0.636256
false
weechat/weechat.org
weechat/about/views.py
1
5180
# # Copyright (C) 2003-2021 Sébastien Helleu <flashcode@flashtux.org> # # This file is part of WeeChat.org. # # WeeChat.org 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 #...
gpl-3.0
-5,936,908,681,836,201,000
31.36875
77
0.595289
false
Kyria/LazyBlacksmith
lbcmd/sde_import.py
1
4863
# -*- encoding: utf-8 -*- import bz2 import os import sqlite3 import requests from flask_script import Command, Option from lazyblacksmith.models import db from lbcmd.importer import Importer class SdeImport(Command): """ Manage SDE Data in lazyblacksmith. If all flags are specified, "clear" action is ...
bsd-3-clause
7,020,513,401,039,638,000
32.308219
79
0.522517
false
mne-tools/mne-tools.github.io
0.15/_downloads/plot_custom_inverse_solver.py
1
6931
# -*- coding: utf-8 -*- """ ================================================ Source localization with a custom inverse solver ================================================ The objective of this example is to show how to plug a custom inverse solver in MNE in order to facilate empirical comparison with the methods M...
bsd-3-clause
-3,530,687,313,560,286,000
37.505556
79
0.633386
false
PADAS/django-raster
raster/formulas.py
1
9578
import numpy from pyparsing import CaselessLiteral, Combine, Forward, Literal, Optional, Word, ZeroOrMore, alphas, nums from django.contrib.gis.gdal import GDALRaster from .const import ALGEBRA_PIXEL_TYPE_GDAL, ALGEBRA_PIXEL_TYPE_NUMPY class FormulaParser(object): """ Deconstruct mathematical algebra expres...
bsd-3-clause
-4,398,534,353,883,407,400
32.256944
125
0.54479
false
roopali8/tempest
tempest/api/identity/admin/v3/test_projects.py
1
7635
# Copyright 2013 OpenStack, LLC # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
apache-2.0
4,873,065,670,767,485,000
41.653631
78
0.634578
false
Netflix/sketchy
setup-nflx.py
1
1460
# Copyright 2014 Netflix, 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...
apache-2.0
8,699,107,894,296,933,000
30.73913
78
0.573973
false
aptivate/invite-registration
registration/views.py
1
3680
from django.conf import settings from django.contrib import messages from django.contrib.auth.views import password_change from django.core.urlresolvers import reverse from django.http import HttpResponseRedirect from django.shortcuts import get_object_or_404 from django.views.generic import FormView, RedirectView fro...
gpl-3.0
-4,675,061,321,014,097,000
36.938144
85
0.595924
false
beernarrd/gramps
gramps/plugins/export/exportftree.py
1
6827
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2003-2006, 2008 Donald N. Allingham # Copyright (C) 2008 Brian G. Matherly # Copyright (C) 2010 Jakim Friant # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as...
gpl-2.0
-8,773,447,639,689,746,000
33.135
94
0.461989
false
iCarto/siga
extScripting/scripts/jython/console/jintrospect.py
1
5168
"""Extend introspect.py for Java based Jython classes.""" from introspect import * import string __author__ = "Don Coleman <dcoleman@chariotsolutions.com>" __cvsid__ = "$Id$" def getAutoCompleteList(command='', locals=None, includeMagic=1, includeSingle=1, includeDouble=1): """Return lis...
gpl-3.0
-3,568,753,556,987,604,500
31.708861
109
0.583978
false
edunham/toys
utilities/packingblocks.py
1
2505
#! /usr/bin/env python # From IRC: # # "I was thinking about a toy idea for my kid to teach multiplication through # area representation. 2x3 is a two-inch-by-three-inch slab of something with # lines on it, etc. I'd need 45 pieces (since AxB = BxA, you can drop almost # half) but if I wanted to put it away in almos...
mit
3,056,071,601,932,460,500
35.838235
130
0.678643
false
wlawski/libmots
tests/monkeyrunner-tests/t0037-shared-elem-avoid-long-press-landscape.py
1
1970
# # The MIT License (MIT) # # Copyright (c) 2014 Wiktor Lawski <wiktor.lawski@gmail.com> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation th...
mit
950,680,015,119,411,700
34.818182
79
0.784264
false
Maplecroft/Magellan
magellan/deps_utils.py
1
36288
import os import operator from pkg_resources import parse_version from pkg_resources import resource_filename as pkg_res_resource_filename from pprint import pformat import requests import json import logging # from terminaltables import AsciiTable as OutputTableType from terminaltables import SingleTable as OutputTab...
mit
1,562,727,707,134,273,500
35.543807
81
0.553351
false
conates/my_site
frontend/templatetags/set_var.py
1
1670
from django import template register = template.Library() from backend.models import * slider_principal = WpPosts.objects.all().filter( post_status="publish", post_type="post", wptermrelationships__term_taxonomy__term__name="Slider Principal", ) slider_principal.filter(wppostmeta__meta_key__in=["data-icon","da...
apache-2.0
3,951,004,240,805,934,600
29.381818
158
0.756287
false
ryanraaum/african-mtdna
popdata_sources/coelho2009/process.py
1
2502
from oldowan.mtconvert import seq2sites, sites2seq, str2sites from string import translate import pandas as pd import sys sys.path.append('../../scripts') from utils import * ## load metadata metadata = pd.read_csv('metadata.csv', index_col=0) regionparts = metadata.ix[0,'SeqRange'].split(';') region1 = range2region...
cc0-1.0
-2,315,007,006,943,837,000
27.770115
70
0.660671
false
maximeolivier/pyCAF
pycaf/architecture/devices/server_features/file.py
1
2897
#| This file is part of pyCAF. | #| | #| pyCAF is free so...
gpl-3.0
-6,448,453,920,463,100,000
62
150
0.338281
false
tyndyll/py-morsecode
docs/source/conf.py
1
8359
# -*- coding: utf-8 -*- # # MorseCode documentation build configuration file, created by # sphinx-quickstart on Tue Nov 26 16:14:19 2013. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # #...
bsd-2-clause
-8,813,911,432,137,333,000
30.424812
79
0.707501
false
praveenkumar/dorrie
dorrie/comps/models.py
1
1663
# Dorrie - Web interface for building Fedora Spins/Remixes. # Copyright (C) 2009 Red Hat Inc. # Author: Shreyank Gupta <sgupta@redhat.com> # 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...
agpl-3.0
-1,699,943,516,922,952,700
37.674419
74
0.72279
false