repo_name
stringlengths
6
61
path
stringlengths
4
230
copies
stringlengths
1
3
size
stringlengths
4
6
text
stringlengths
1.01k
850k
license
stringclasses
15 values
hash
int64
-9,220,477,234,079,998,000
9,219,060,020B
line_mean
float64
11.6
96.6
line_max
int64
32
939
alpha_frac
float64
0.26
0.9
autogenerated
bool
1 class
ratio
float64
1.62
6.1
config_test
bool
2 classes
has_no_keywords
bool
2 classes
few_assignments
bool
1 class
oszi/collection-json.python
collection_json.py
1
16792
"""Classes for representing a Collection+JSON document.""" from __future__ import absolute_import, unicode_literals import json __version__ = '0.1.1' class ArrayProperty(object): """A descriptor that converts from any enumerable to a typed Array.""" def __init__(self, cls, name): """Constructs typ...
bsd-2-clause
-7,806,763,957,741,782,000
30.038817
108
0.548535
false
4.442328
false
false
false
Flaburgan/diaspora-hub
thefederation/apps.py
2
1049
import datetime import django_rq from django.apps import AppConfig class TheFederationConfig(AppConfig): name = "thefederation" verbose_name = "The Federation" def ready(self): from thefederation.social import make_daily_post from thefederation.tasks import aggregate_daily_stats ...
agpl-3.0
-5,405,463,045,591,289,000
26.605263
74
0.604385
false
4.407563
false
false
false
RobinQuetin/CAIRIS-web
cairis/cairis/PersonaCharacteristicPanel.py
1
5070
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may...
apache-2.0
8,992,763,075,810,244,000
47.285714
201
0.763116
false
3.528184
false
false
false
AaronYee/ufldl_tutorial
cnn.py
6
4479
import numpy as np import scipy.signal def sigmoid(x): return 1 / (1 + np.exp(-x)) def cnn_convolve(patch_dim, num_features, images, W, b, zca_white, patch_mean): """ Returns the convolution of the features given by W and b with the given images :param patch_dim: patch (feature) dimension :p...
mit
1,652,702,458,388,864,500
41.264151
110
0.620674
false
3.818414
false
false
false
DataONEorg/d1_python
test_utilities/src/d1_test/mock_api/ping.py
1
2010
#!/usr/bin/env python # This work was created by participants in the DataONE project, and is # jointly copyrighted by participating institutions in DataONE. For # more information on DataONE, see our web site at http://dataone.org. # # Copyright 2009-2019 DataONE # # Licensed under the Apache License, Version 2.0 (t...
apache-2.0
-175,475,432,308,310,720
30.84127
90
0.732802
false
3.377104
false
false
false
NPWR/Year-2042
genericFunctions.py
1
2725
import pygame as pg from pygame.locals import * from constants import * import sys AROUND = [[0,0], [1,0], [1,1], [0,1], [-1,1], [-1,0], [-1,-1], [0,-1], [1,-1]] def MOVE(cell,vec): return [cell[0]+vec[0],cell[1]+vec[1]] KEY_ON = { ...
gpl-2.0
6,854,233,328,337,062,000
19.801527
52
0.430826
false
3.164925
false
false
false
polltooh/TensorflowToolbox
utility/file_io.py
1
2817
import os import random import numpy as np import importlib def get_listfile(image_dir, extension=".jpg"): if not image_dir.endswith("/"): image_dir = image_dir + "/" image_list = os.listdir(image_dir) image_list = [image_dir + image for image in image_list if image.endswith(extension)] retur...
apache-2.0
2,384,068,973,960,488,400
24.151786
92
0.546326
false
3.226804
false
false
false
timbueno/longboxed
longboxed/manage/users.py
1
5632
# -*- coding: utf-8 -*- """ longboxed.manage.users ~~~~~~~~~~~~~~~~~~~~~ user management commands """ from flask import current_app from flask.ext.script import Command, Option, prompt, prompt_pass from flask.ext.security.forms import RegisterForm from flask.ext.security.registerable import register_user f...
mit
45,860,504,678,721,230
35.810458
123
0.585405
false
4.218727
false
false
false
plaidml/plaidml
plaidbench/plaidbench.py
1
8191
#!/usr/bin/env python # # Copyright 2018 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
apache-2.0
4,325,232,983,265,446,400
37.636792
96
0.579661
false
4.038955
false
false
false
ControlSystemStudio/org.csstudio.iter
products/org.csstudio.iter.css.product/demo/m-TEST/src/main/boy/mimics/scripts/valve_control.py
2
2794
from epics import caget, caput, camonitor from time import sleep # Settings for the performance test # open: OPEN THRESHOLD - 75% # close: CLOSE THRESHOLD - 25% open = caget('CTRL-SUP-BOY:VC101-COH.VAL') + 15 close = caget('CTRL-SUP-BOY:VC101-COL.VAL') - 15 start = caget('CTRL-SUP-BOY:PERF-SRT.VAL') init = 40 firstVa...
epl-1.0
-6,816,675,242,629,080,000
38.352113
65
0.581246
false
2.60149
false
false
false
FAIMS/FAIMS-Tools
generators/christian/util/xml.py
1
5339
from lxml import etree import hashlib import re from consts import * def parseXml(filename): parser = etree.XMLParser(strip_cdata=False) try: tree = etree.parse(filename, parser) except etree.XMLSyntaxError as e: print e exit() tree = tree.getroot() return tree def hasAtt...
gpl-2.0
8,943,742,031,703,865,000
26.101523
80
0.62596
false
3.699931
false
false
false
vdmann/cse-360-image-hosting-website
src/dragdrop/files.py
1
2581
# from django.contrib.contenttypes.models import ContentType # from django.contrib.auth.models import User # from django.db import models # # am I importing these session libraries correctly? # from django.contrib.sessions.models import Session # from django.contrib.sessions.backends.cached_db import SessionStore # fr...
mit
6,365,021,279,501,099,000
34.369863
83
0.566447
false
3.3827
false
false
false
klahnakoski/ActiveData-ETL
vendor/jx_base/expressions/es_nested_op.py
4
1491
# encoding: utf-8 # # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http:# mozilla.org/MPL/2.0/. # # Contact: Kyle Lahnakoski (kyle@lahnakoski.com) # """ # NOTE: THE self.lang[operator] PATTERN ...
mpl-2.0
1,376,558,340,162,270,200
28.82
80
0.668008
false
3.343049
false
false
false
ua-snap/downscale
examples.py
1
2325
# # # # # Examples of how to run downscaling with this new package. # this is hardwired junk unless you are on the SNAP servers at UAF. # # # # # AR5 if __name__ == '__main__': # import modules import downscale # minimum required arguments ar5_modeled = '/workspace/Shared/Tech_Projects/ESGF_Data_Access/projec...
mit
-3,292,598,839,910,450,700
48.468085
210
0.742796
false
2.543764
false
false
false
cardmagic/PyAMF
pyamf/adapters/_elixir.py
1
1209
# Copyright (c) 2007-2010 The PyAMF Project. # See LICENSE for details. """ Elixir adapter module. Elixir adds a number of properties to the mapped instances. @see: U{Elixir homepage (external)<http://elixir.ematia.de>} @since: 0.6 """ import elixir.entity import pyamf from pyamf import adapters adapter = adapters...
mit
621,109,237,464,353,300
25.888889
82
0.717122
false
3.524781
false
false
false
teodoran/TMM-4540
sublime-packages/AMLRepl/AMLRepl.py
1
6253
import sublime import sublime_plugin import subprocess import time import webbrowser from threading import Thread aml_manual_path = "" aml_start_path = "" aml_batch_file = "" repl_process = None output_lines = [] output_view = None class AmlReplCommand(sublime_plugin.TextCommand): def PrintStdout(self, edit, ...
bsd-2-clause
8,199,867,089,837,572,000
28.635071
106
0.568047
false
3.845633
false
false
false
dsoprea/PyZap
setup.py
1
1578
from setuptools import setup, find_packages from setuptools.command.install import install def _pre_install(): print("Verifying that the library is accessible.") import sys import os.path dev_path = os.path.dirname(__file__) sys.path.insert(0, dev_path) try: import pyz...
gpl-2.0
-4,752,078,199,824,638,000
29.346154
80
0.648923
false
3.76611
false
false
false
smarkets/marge-bot
marge/interval.py
1
4396
import operator from enum import Enum, unique import maya # pylint: disable=invalid-name @unique class WeekDay(Enum): Monday = 0 Tuesday = 1 Wednesday = 2 Thursday = 3 Friday = 4 Saturday = 5 Sunday = 6 _DAY_NAMES = {day.name.lower(): day for day in WeekDay} _DAY_NAMES.update((day.name....
bsd-3-clause
-4,779,240,821,705,119,000
29.741259
85
0.574158
false
3.802768
false
false
false
socketpair/asynqp
src/asynqp/serialisation.py
3
8653
import struct from .exceptions import AMQPError from datetime import datetime, timezone def rethrow_as(expected_cls, to_throw): def decorator(f): def wrapper(*args, **kwargs): try: return f(*args, **kwargs) except expected_cls as e: raise to_throw fr...
mit
2,299,834,258,204,521,500
23.582386
98
0.622905
false
3.310252
false
false
false
patta42/pySICM
scanmodes/readVIn.py
2
7823
# Copyright (C) 2015 Patrick Happel <patrick.happel@rub.de> # # This file is part of pySICM. # # pySICM 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 ...
gpl-3.0
-549,848,359,958,129,540
32.865801
109
0.589927
false
3.801263
true
false
false
plilja/adventofcode
2016/day25/day25.py
1
4104
import sys class Machine(): def __init__(self, a, b, c, d, pc): self.a = a self.b = b self.c = c self.d = d self.pc = pc def __hash__(self): return hash((self.a, self.b, self.c, self.d, self.pc)) def __eq__(self, other): return (self.a, self.b, s...
gpl-3.0
-8,875,775,524,525,946,000
23.57485
106
0.51462
false
3.355683
false
false
false
T3CHNOLOG1C/Zoidbot
addons/memes.py
1
8729
import discord from discord.ext import commands from sys import argv class Memes: """ Meme commands """ def __init__(self, bot): self.bot = bot print('Addon "{}" loaded'.format(self.__class__.__name__)) async def _meme(self, ctx, msg): author = ctx.message.author if...
apache-2.0
-7,467,788,534,429,937,000
34.741803
165
0.603715
false
3.055711
false
false
false
feketemihai/l10n-romania
l10n_ro_account_bank_statement/wizard/account_statement_from_invoice.py
2
3259
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
9,141,364,515,124,514,000
38.743902
113
0.573489
false
4.167519
false
false
false
mrmiguez/citrus
debug/FlaLD_DC.py
1
9796
#!/usr/bin/env python3 import re import sys import json import requests from lxml import etree from pymods import OAIReader from bs4 import BeautifulSoup sys.path.append('../assets') import assets tn = {'name': 'sobek', 'prefix': 'http://dpanther.fiu.edu/sobek/content'} nameSpace_default = { None: '{http://www.loc....
mit
-2,992,809,091,714,091,000
40.508475
87
0.459677
false
4.732367
false
false
false
abhisheksugam/Climate_Police
Climate_Police/tests/temp_map.py
1
1335
import plotly.offline as py py.init_notebook_mode() from temp_pre_process import temp_pre_process def temp_map(temp, year): # Pre-processes the temperature data so that it can be plotted by plotly. df2 = temp_pre_process(temp, year) #scl = [[0.0, 'rgb(242,240,247)'],[0.2, 'rgb(218,218,235)'],[0.4, 'rgb(188,189,...
mit
-5,169,399,646,883,258,000
30.023256
89
0.537481
false
3.073733
false
false
false
eduardoneira/SistemasDistribuidos_TPFinal
CentroMonitoreoCiudad/WebListener/modules/face_recognizer_client.py
1
2185
#!/bin/python3 import pika import json import logging class FaceRecognizerClient(object): def __init__(self,host,queue_send,queue_receive): self.queue_send = queue_send self.queue_receive = queue_receive self.host = host self.__connect() def __connect(self): self.connection = pika.BlockingCo...
gpl-3.0
-7,080,464,901,833,375,000
27.75
88
0.596796
false
4.076493
false
false
false
patrickm/chromium.src
chrome/common/extensions/docs/server2/path_canonicalizer.py
1
4304
# Copyright 2013 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. from collections import defaultdict import posixpath from future import Future from path_util import SplitParent from special_paths import SITE_VERIFICATION...
bsd-3-clause
-6,192,237,749,339,063,000
38.486239
80
0.659619
false
4.075758
false
false
false
rmcgibbo/psi4public
psi4/driver/p4util/numpy_helper.py
2
17628
# # @BEGIN LICENSE # # Psi4: an open-source quantum chemistry software package # # Copyright (c) 2007-2017 The Psi4 Developers. # # The copyrights for code used from other parties are included in # the corresponding files. # # This file is part of Psi4. # # Psi4 is free software; you can redistribute it and/or modify #...
lgpl-3.0
-7,813,364,256,415,750,000
28.331115
139
0.579306
false
3.634639
false
false
false
zhuoju36/StructEngPy
object_model/frame.py
1
11514
# -*- coding: utf-8 -*- """ Created on Thu Mar 29 10:09:44 2018 @author: Dell """ import uuid from sqlalchemy.sql import and_ from .orm import Config,Point,Frame,FrameSection,FrameLoadDistributed,FrameLoadConcentrated,FrameLoadTemperature,FrameLoadStrain import logger def add_frame(self,pt0_coor,pt1_coor,section,n...
mit
-6,769,975,149,060,318,000
31.43662
128
0.574344
false
3.255301
false
false
false
adrienbrault/home-assistant
homeassistant/components/vicare/sensor.py
3
14061
"""Viessmann ViCare sensor device.""" import logging import requests from homeassistant.components.sensor import SensorEntity from homeassistant.const import ( CONF_DEVICE_CLASS, CONF_ICON, CONF_NAME, CONF_UNIT_OF_MEASUREMENT, DEVICE_CLASS_ENERGY, DEVICE_CLASS_TEMPERATURE, ENERGY_KILO_WATT...
mit
1,140,110,783,300,486,400
34.961637
85
0.660053
false
3.189159
false
false
false
1Server/OneServer
oneserver/scheduler.py
1
9003
from datetime import datetime, timedelta import threading import time from heapq import heappush,heappop ## # The different states that the task can be in. States should # not be set manually. They should only be set by the scheduler. class TaskState: ## # Either unscheduled or scheduled and waiting to be run. PEND...
mit
-3,657,932,361,293,457,000
27.311321
123
0.704432
false
3.492242
false
false
false
pombo-lab/gamtools
lib/gamtools/tests/test_segregation.py
1
2934
from gamtools import segregation import io import pytest fixture_two_samples = io.StringIO( u"""chrom start stop Sample_A Sample_B chr1 0 50000 0 0 chr1 50000 100000 0 0 chr1 100000 150000 0 0 chr1 150000 200000 0 0 chr1 200000 250000 0 0 chr1 250000 300000 0 0 ch...
apache-2.0
8,695,599,764,419,689,000
36.139241
79
0.611111
false
3.509569
true
false
false
levilucio/SyVOLT
t_core/Mutex/STS.py
1
5702
from t_core.composer import Composer from tc_python.arule import ARule from tc_python.srule import SRule from tc_python.frule import FRule from HGiveRuleLHS import HGiveRuleLHS from HGiveRuleRHS import HGiveRuleRHS from HMountRuleLHS import HMountRuleLHS from HMountRuleRHS import HMountRuleRHS from HNewRuleLH...
mit
3,004,954,829,868,638,700
46.322034
150
0.647141
false
3.648113
false
false
false
dolphinziyo/LocalizarPatron
localizarPatron.py
1
6066
# coding=ISO-8859-1 ''' Creado el 10/06/2011 @autor: dolphinziyo http://twitter.com/dolphinziyo Web: http://tecnogame.org ''' # Este programa sirve para buscar ciertos patrones en archivos de texto plano, # Su forma de uso es muy sencilla, requiere de la introducción del patrón a buscar, # el directorio en el que ...
unlicense
-8,836,842,663,022,820,000
64.130435
189
0.54723
false
3.530937
false
false
false
eponvert/upparse
scripts/chunk-pattern-bench.py
1
1167
#!/usr/bin/env python import sys for line in sys.stdin: line = line.split() i = 0 n = len(line) print '(', while i < n: if line[i] == ';': i += 1 elif line[i] in ('DT','CD'): start = i i += 1 while i < n and line[i] == 'JJ': i += 1 while i < n and line[i...
apache-2.0
-3,052,442,185,311,247,000
16.41791
47
0.379606
false
2.969466
false
false
false
ndssl/zika_data_to_cdc
src/buzzfeed/clean_parsed_brazil.py
1
4095
"""Clean the Brazil data from BuzzFeed https://github.com/BuzzFeedNews/zika-data """ import os.path from glob import glob import re import pandas as pd import unicodedata import numpy as np def strip_accents(s): return(''.join(c for c in unicodedata.normalize('NFD', s) if unicodedata.categor...
mit
7,927,917,207,281,371,000
32.024194
78
0.58486
false
3.142748
false
false
false
scramblingbalam/Alta_Real
twit_auth.py
1
3762
# from: # http://piratefache.ch/twitter-streaming-api-with-tweepy/ # This is just a place folder all referennces to this code in other scripts # Will be changed to twit_auths but I have kept this in the repo for explication class authentication1: def __init__(self): self.consumer_key = "###################...
mit
-1,598,235,848,565,647,600
42.744186
83
0.475811
false
4.937008
false
false
false
hakuliu/inf552
hw3/fastmapblog.py
1
6167
#!/usr/bin/env python # This implements the FastMap algorithm # for mapping points where only the distance between them is known # to N-dimension coordinates. # The FastMap algorithm was published in: # # FastMap: a fast algorithm for indexing, data-mining and # visualization of traditional and multimedia datasets # b...
apache-2.0
6,542,593,122,165,147,000
29.98995
757
0.632398
false
3.435655
false
false
false
geosolutions-it/cread-workflows
publishMosaicGranule.py
1
1830
import requests import json # The data entry form ##Geoserver_URL=string http://host[:port]/geoserver # test -> ##Geoserver_URL=string http://192.168.50.171:8080/geoserver ##Username=string your_username ##Password=string your_password ##Image_mosaic_Store_Name=string a datastore name # ##Image_mosaic_Store_Name=strin...
apache-2.0
-168,081,882,520,736,580
32.272727
153
0.691257
false
3.05
false
false
false
FroggiesareFluffy/ForestOfSquirrels
forestofsquirrels/squirrels/squirrel.py
1
9147
import math import pygame import forestofsquirrels.trees pygame.init() class SpeechBubble(pygame.sprite.Sprite): font = pygame.font.Font("freesansbold.ttf", 20) topleft = pygame.image.load("forestofsquirrels/graphics/corner.png") topright = pygame.transform.flip(topleft, True, False) bottomleft = py...
unlicense
-4,934,933,280,678,695,000
40.202703
111
0.545971
false
3.722833
false
false
false
tomviner/micro-bit-examples
servo4.py
1
4885
import microbit def rescale(src_scale, dest_scale, x): """Map one number scale to another For example, to convert a score of 4 stars out of 5 into a percentage: >>> rescale((0, 5), (0, 100), 4) 80.0 Great for mapping different input values into LED pixel brightnesses! """ src_start, src_...
apache-2.0
7,517,846,798,904,603,000
30.490323
76
0.584921
false
3.226041
false
false
false
Remper/learningbyreading
src/disambiguation.py
1
3636
from babelfy import babelfy from ukb import wsd from candc import postag from spotlight import spotlight import ConfigParser import logging as log from mappings import bn2dbpedia, offset2bn, bn2offset from os.path import join, dirname # read configuration config = ConfigParser.ConfigParser() config.read(join(dirname(_...
gpl-2.0
8,635,342,172,460,265,000
35.727273
103
0.575358
false
3.672727
true
false
false
not-napoleon/mazes
braid.py
1
1536
import random import sys import copy from utils import Point, Box from walled_matrix import WalledMatrix from growing_tree import GrowingTreeMaze class BraidMaze(object): """Convert a perfect maze into a braided maze""" def __init__(self, x_max, y_max): self._x_max = x_max self._y_max = y_max...
mit
3,617,249,657,225,920,000
25.482759
74
0.520182
false
3.737226
false
false
false
wolffytom/tf_runet
train.py
1
2824
#!/usr/bin/env python3 import os, sys sys.path.append( os.path.dirname(__file__ ) ) from data.vot2016 import VOT2016_Data_Provider from config import cfg from model import Model import sklearn import tensorflow as tf import numpy as np from PIL import Image from meval import calc_auc, print_step_auc import text_hist...
gpl-3.0
5,646,010,547,158,332,000
31.090909
82
0.595609
false
3.456548
false
false
false
amolenaar/gaphas
gaphas/tool/zoom.py
1
1543
from gi.repository import Gtk from gaphas.view import GtkView class ZoomData: x0: int y0: int sx: float sy: float def zoom_tool(view: GtkView) -> Gtk.GestureZoom: """Create a zoom tool as a Gtk.Gesture. Note: we need to keep a reference to this gesture, or else it will be destroyed. ""...
lgpl-2.1
2,310,033,566,825,498,000
24.716667
84
0.614388
false
2.805455
false
false
false
sivel/turquoise
turquoise.py
1
4622
#!/usr/bin/env python import re import bson import logging from functools import wraps from happymongo import HapPyMongo from flask.ext.github import GitHub from flask import (Flask, session, g, request, url_for, redirect, flash, render_template, abort) try: from cPickle import dumps as pickle...
apache-2.0
-1,303,330,272,783,548,400
26.02924
78
0.598875
false
3.582946
false
false
false
mentii/mentii
Backend/mentii/user_ctrl.py
1
14654
import boto3 import re from flask import render_template from flask_mail import Message from boto3.dynamodb.conditions import Key, Attr from utils.ResponseCreation import ControllerResponse from utils import db_utils as dbUtils import utils.MentiiLogging as MentiiLogging import uuid import hashlib import class_ctrl as ...
mit
-6,239,574,435,839,098,000
34.567961
142
0.696806
false
3.867511
false
false
false
justinmuller/buck
third-party/py/pex/pex/sorter.py
55
1403
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from .package import EggPackage, SourcePackage, WheelPackage class Sorter(object): DEFAULT_PACKAGE_PRECEDENCE = ( WheelPackage, EggPackage, SourcePackage, ) @cla...
apache-2.0
4,735,634,698,640,328,000
36.918919
99
0.722737
false
4.251515
false
false
false
ngonzalvez/sentry
src/sentry/api/endpoints/organization_member_details.py
7
5209
from __future__ import absolute_import from django.db import transaction from rest_framework import serializers from rest_framework.response import Response from sentry.api.bases.organization import ( OrganizationEndpoint, OrganizationPermission ) from sentry.api.exceptions import ResourceDoesNotExist from sentry...
bsd-3-clause
7,032,361,661,708,778,000
34.195946
89
0.630639
false
4.553322
false
false
false
deepmind/android_env
android_env/environment.py
1
4381
# coding=utf-8 # Copyright 2021 DeepMind Technologies Limited. # # 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 applic...
apache-2.0
2,356,231,852,773,265,000
31.93985
79
0.679297
false
3.883865
true
false
false
e-koch/Phys-595
project_code/Machine Learning/hist2d.py
1
2361
''' My alterations of hist2d from the triangle package. ''' import numpy as np import matplotlib.pyplot as pl from matplotlib.colors import LinearSegmentedColormap import matplotlib.cm as cm def hist2d(x, y, *args, **kwargs): """ Plot a 2-D histogram of samples. """ ax = kwargs.pop("ax", pl.gca()) ...
mit
-2,448,166,880,161,317,400
31.805556
78
0.501482
false
3.135458
false
false
false
EconForge/dolo
dolo/misc/multimethod.py
1
10255
### The following originates from https://github.com/coady/multimethod # Copyright 2020 Aric Coady # # 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/lic...
bsd-2-clause
8,543,980,173,115,379,000
32.956954
88
0.59805
false
4.175489
false
false
false
h-mayorquin/competitive_and_selective_learning
test_scl.py
1
3092
""" This is the play """ import numpy as np import matplotlib.pyplot as plt import math from sklearn.datasets import make_blobs from functions import selection_algorithm, scl plot = True verbose = False tracking = False selection = True # Generate the data n_samples = 1500 random_state = 20 # Does not converge ran...
mit
6,980,486,067,870,916,000
24.553719
83
0.625809
false
2.98744
false
false
false
lmgichin/formations
python/Introspection.py
1
1247
# -*- coding: utf8 -*- class Personne: "Définition de la classe personne" # Pas de surcharge # Pas de polymorphisme direct ### Attributs statiques de classe ### ctr = 0 ### Attributs d'instance ### # Pas de définition préalable ### Méthode appelée avant la création de l'instance ###...
gpl-2.0
7,878,477,071,107,503,000
20.684211
108
0.579288
false
3.185567
false
false
false
HeqetLabs/dynaconfig
dynaconfig/endpoints.py
1
4418
import datetime import rethinkdb as r from flask import request from flask.ext.restful import Resource, abort from dynaconfig import db from time import time def config_id(user_id, config_name): return "{}-{}".format(user_id, config_name) class Config(Resource): def get(self, user_id, config_name): curren...
apache-2.0
5,752,779,282,069,932,000
35.512397
157
0.616569
false
3.59187
true
false
false
nomaro/SickBeard_Backup
sickbeard/providers/ethor.py
19
3033
# Author: Julien Goret <jgoret@gmail.com> # URL: https://github.com/sarakha63/Sick-Beard # # This file is based upon tvtorrents.py. # # This file is part of Sick Beard. # # Sick Beard is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Fre...
gpl-3.0
7,512,435,833,235,280,000
31.612903
120
0.665348
false
3.694275
false
false
false
sebbcn/django-secure-storage
models.py
1
2791
import pickle from django.db import models from .encryption import get_cipher_and_iv, padding from django.utils.timezone import now class EncryptedUploadedFileMetaData(models.Model): ''' Meta data for saved files. ''' # File uuid file_id = models.CharField(max_length=50, primary_key=True) encrypted_...
gpl-2.0
8,223,567,217,211,155,000
31.453488
77
0.612325
false
4.134815
false
false
false
RaphaelArkadyMeyer/LiveCoding
Server Side/build.py
1
1305
import os.path as path from sys import argv from json import load from os import system from subprocess import Popen def make_frankenstein(question_names, file_name): global server_directory global client_directory def read_json(file_name): with open(file_name) as input_file: return load(input...
mit
6,664,806,969,046,097,000
23.622642
58
0.614559
false
3.782609
true
false
false
jvanasco/facebook_utils
src/facebook_utils/api_versions.py
1
1661
# stdlib import datetime # ============================================================================== # last checked 2021/03/25 # https://developers.facebook.com/docs/graph-api/changelog/versions # Version: Release Date, Expiration Date _API_VERSIONS = { "10.0": ["Feb 23, 2021", None], "9.0": ["Nov 10, ...
bsd-3-clause
-4,182,697,686,540,373,000
35.911111
80
0.472607
false
2.583204
false
false
false
psiwczak/openstack
nova/compute/task_states.py
11
1841
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 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/...
apache-2.0
6,123,617,326,984,806,000
29.683333
79
0.750136
false
3.311151
false
false
false
Chiel92/graph-problems
lboolw_heuristic.py
1
3899
from bitset import iterate, size, subtract, contains, first from components import components from utils import Infinity def get_neighborhood(N, subset): result = 0 for v in iterate(subset): result |= N[v] return result def get_neighborhood_2(N, subset): result = get_neighborhood(N, subset) ...
mit
2,324,522,540,173,443,000
26.652482
81
0.565017
false
3.623606
false
false
false
s1341/pyg13
pyg13.py
1
5972
#!/usr/bin/env python import usb.core import usb.util import os import select import commands G13_VENDOR_ID = 0x046d G13_PRODUCT_ID = 0xc21c G13_KEY_ENDPOINT = 1 G13_LCD_ENDPOINT = 2 G13_REPORT_SIZE = 8 G13_LCD_BUFFER_SIZE = 0x3c0 G13_NUM_KEYS = 40 G13_NUM_MODES = 4 G13_KEYS = (["G%d" % x for x in range(1, 23)] + ...
apache-2.0
7,844,132,187,072,760,000
30.597884
89
0.548895
false
3.395111
false
false
false
mbdevpl/maildaemon
maildaemon/message.py
1
12738
"""Handling e-mail messages.""" import datetime import email.header import email.message import logging import typing as t import dateutil.parser from .connection import Connection _LOG = logging.getLogger(__name__) def recode_header(raw_data: t.Union[bytes, str]) -> str: """Normalize the header value.""" ...
apache-2.0
-3,272,470,753,199,274,000
37.36747
97
0.553776
false
3.935125
false
false
false
outpark/skeleton
migrations/versions/56a9f1dcf35_.py
1
2870
"""empty message Revision ID: 56a9f1dcf35 Revises: None Create Date: 2015-05-05 23:24:42.576471 """ # revision identifiers, used by Alembic. revision = '56a9f1dcf35' down_revision = None from alembic import op import sqlalchemy as sa def upgrade(): ### commands auto generated by Alembic - please adjust! ### ...
bsd-3-clause
2,298,538,285,896,855,600
35.794872
65
0.650523
false
3.462002
false
false
false
kevingu1003/python-pptx
tests/oxml/parts/test_presentation.py
4
1597
# encoding: utf-8 """ Test suite for pptx.oxml.presentation module """ from __future__ import absolute_import, print_function, unicode_literals import pytest from ..unitdata.presentation import a_sldId, a_sldIdLst class DescribeCT_SlideIdList(object): def it_can_add_a_sldId_element_as_a_child(self, add_fixtu...
mit
-559,583,534,860,502,140
31.591837
72
0.572949
false
3.071154
false
false
false
nla/jvmctl
logduct/tests/test_logduct.py
1
1864
#!/usr/bin/env python2 import os, re, tempfile, shutil, time, signal, unittest, sys from subprocess import Popen, check_call def slurp(file): with open(file) as f: return f.read() def wait_until_exists(file, timeout=1, delay=0.02): start = time.time() while time.time() < start + timeout: i...
mit
-7,207,820,850,151,245,000
30.066667
114
0.571888
false
3.117057
true
false
false
pvtodorov/indra
indra/sources/sofia/make_sofia_ontology.py
2
1626
import sys import json from os.path import join, dirname, abspath from rdflib import Graph, Namespace, Literal from indra.sources import sofia # Note that this is just a placeholder, it doesn't resolve as a URL sofia_ns = Namespace('http://cs.cmu.edu/sofia/') indra_ns = 'http://sorger.med.harvard.edu/indra/' indra_re...
bsd-2-clause
6,992,427,790,364,819,000
33.595745
76
0.600246
false
3.085389
false
false
false
jkroll20/tlgbackend
filtermodules/recent.py
2
1920
#!/usr/bin/python # -*- coding:utf-8 -*- import time from tlgflaws import * ## Ein Filter, der alle Seiten findet, die heute geändert wurden. class FRecentlyChanged(FlawFilter): shortname= 'RecentlyChanged' # Name, der den Filter identifiziert (nicht übersetzen!) label= _('Recently Changed') ...
gpl-3.0
-4,140,035,752,873,094,000
38.020408
116
0.638075
false
3.476364
false
false
false
googleapis/googleapis-gen
google/cloud/retail/v2/retail-v2-py/google/cloud/retail_v2/services/catalog_service/transports/grpc_asyncio.py
1
13035
# -*- 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
-6,470,185,758,696,912,000
44.897887
87
0.612582
false
4.700685
false
false
false
yarsanich/openprocurement.tender.belowthreshold
openprocurement/tender/belowthreshold/views/tender.py
1
6695
# -*- coding: utf-8 -*- from openprocurement.api.utils import context_unpack, json_view, APIResource from openprocurement.tender.core.utils import ( save_tender, optendersresource, apply_patch ) from openprocurement.tender.belowthreshold.utils import ( check_status, ) from openprocurement.tender.core.validat...
apache-2.0
-4,368,081,525,457,636,000
35.882022
160
0.436405
false
4.313403
false
false
false
atlassian/dd-agent
checks.d/ntp.py
34
1756
# 3p import ntplib # project from checks import AgentCheck from utils.ntp import get_ntp_args, set_user_ntp_settings DEFAULT_OFFSET_THRESHOLD = 60 # in seconds class NtpCheck(AgentCheck): DEFAULT_MIN_COLLECTION_INTERVAL = 900 # in seconds def check(self, instance): service_check_msg = None ...
bsd-3-clause
7,355,940,819,758,120,000
34.12
130
0.617312
false
4.027523
false
false
false
pichillilorenzo/JavaScriptEnhancements
src/listeners/show_flow_errors.py
1
10428
import sublime, sublime_plugin import cgi, time, os from ..libs import NodeJS from ..libs import FlowCLI from ..libs import flow from ..libs import util from ..libs.popup_manager import popup_manager from .wait_modified_async import JavascriptEnhancementsWaitModifiedAsyncViewEventListener show_flow_errors_css = "" wit...
mit
-838,735,255,108,730,000
33.305921
237
0.625623
false
3.565128
false
false
false
dimara/synnefo
snf-astakos-app/astakos/im/views/target/redirect.py
7
4777
# Copyright (C) 2010-2014 GRNET S.A. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed i...
gpl-3.0
-4,838,227,677,632,817,000
36.614173
79
0.65313
false
4.358577
false
false
false
ruchee/vimrc
vimfiles/bundle/vim-python/submodules/astroid/astroid/__pkginfo__.py
1
1947
# Copyright (c) 2006-2014 LOGILAB S.A. (Paris, FRANCE) <contact@logilab.fr> # Copyright (c) 2014-2020 Claudiu Popa <pcmanticore@gmail.com> # Copyright (c) 2014 Google, Inc. # Copyright (c) 2015-2017 Ceridwen <ceridwenv@gmail.com> # Copyright (c) 2015 Florian Bruhin <me@the-compiler.org> # Copyright (c) 2015 Radosław Ga...
mit
9,205,893,398,048,571,000
45.261905
87
0.726711
false
2.625676
false
false
false
PROSIC/prosic-evaluation
scripts/plot-fdr-control.py
1
1781
from itertools import product import matplotlib matplotlib.use("agg") from matplotlib import pyplot as plt import seaborn as sns import pandas as pd import common import numpy as np MIN_CALLS = 100 colors = common.get_colors(snakemake.config) props = product(snakemake.params.callers, snakemake.param...
mit
1,726,927,584,657,452,300
25.984848
96
0.606401
false
3.232305
false
false
false
RedHatInsights/insights-core
insights/parsers/tests/test_jboss_standalone_main_conf.py
1
3625
from insights.parsers.jboss_standalone_main_conf import JbossStandaloneConf from insights.tests import context_wrap from insights.parsers import jboss_standalone_main_conf import doctest JBOSS_STANDALONE_CONFIG = """ <?xml version='1.0' encoding='UTF-8'?> <server xmlns="urn:jboss:domain:1.7"> <management> ...
apache-2.0
-3,273,449,470,013,918,000
42.674699
136
0.586207
false
4.200463
true
false
false
churchill-lab/qtl-viewer
qtlviewer/test_cache.py
1
1606
import requests def split_url(url): """Splits the given URL into a tuple of (protocol, host, uri)""" proto, rest = url.split(':', 1) rest = rest[2:].split('/', 1) host, uri = (rest[0], rest[1]) if len(rest) == 2 else (rest[0], "") return (proto, host, uri) def parse_url(url): """Parses out R...
gpl-3.0
-3,121,924,115,229,837,000
28.740741
88
0.602117
false
3.352818
false
false
false
AntaresConsulting/odoo-marble
product_marble/models/_common.py
1
12388
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
gpl-2.0
1,740,580,119,350,780,200
27.090703
105
0.557233
false
2.941121
false
false
false
geoenvo/opendims
opendims/reports/templatetags/reports_tags.py
1
1822
from django import template from django.db.models import Sum from reports.models import Event register = template.Library() @register.simple_tag def get_event_statistics(disaster, month, year): """ Return monthly summary of a disaster category and its impact. """ events_with_impacts = Event.objects....
gpl-3.0
4,937,029,646,918,345,000
34.72549
83
0.670143
false
3.651303
false
false
false
wzguo/youker-assistant
backends/youker-assistant-daemon/src/policykit/dbusproxy.py
1
2364
#!/usr/bin/python # -*- coding: utf-8 -*- ### BEGIN LICENSE # Copyright (C) 2007-2011 Tualatrix Chou <tualatrix@gmail.com> # Copyright (C) 2013 ~ 2014 National University of Defense Technology(NUDT) & Kylin Ltd # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU Genera...
gpl-3.0
-3,449,178,230,094,685,700
32.295775
181
0.677242
false
3.7824
false
false
false
Caleb-Shepard/Scripts
Scripts_General/tulz/xml_to_json.py
1
9544
# Script to recurse through all subdirectories from pandas.io.json import json_normalize import flatten_json import xmltodict import argparse import zipfile import shutil import pandas import tqdm import json import os import re ''' ------------------------------ CONSTANTS ------------------------------ ''' JSON_WORKB...
gpl-2.0
-1,757,348,847,603,331,000
39.961373
145
0.621542
false
4.103181
false
false
false
PaddlePaddle/Paddle
python/paddle/fluid/tests/unittests/ascend_group.py
2
5388
# Copyright (c) 2019 PaddlePaddle Authors. 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 appli...
apache-2.0
-1,859,342,429,792,507,600
32.259259
92
0.645323
false
3.523872
false
false
false
metajack/skia
third_party/harfbuzz/contrib/tables/mirroring-parse.py
53
1658
import sys # http://www.unicode.org/Public/UNIDATA/auxiliary/BidiMirroring.txt # This parses a file in the format of the above file and outputs a table # suitable for bsearch(3). This table maps Unicode code points to their # 'mirror'. (Mirroring is used when rendering RTL characters, see the Unicode # standard). By ...
bsd-3-clause
-7,345,047,434,276,346,000
32.16
90
0.627262
false
3.176245
false
false
false
ardoi/datajuicer
lsjuicer/ui/windows/start.py
1
3101
from PyQt5 import QtGui as QG from PyQt5 import QtWidgets as QW from PyQt5 import QtCore as QC from constants import Constants class StartUI(QW.QDialog): mode_set = QC.pyqtSignal(int) """Main user interface window""" def __init__(self, parent = None): super(StartUI, self).__init__(parent) ...
gpl-3.0
4,742,097,940,841,553,000
35.916667
70
0.643341
false
3.5
false
false
false
openstack/octavia
octavia/tests/unit/amphorae/backends/utils/test_haproxy_query.py
1
6881
# Copyright 2015 Hewlett-Packard Development Company, L.P. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
apache-2.0
-5,764,914,478,178,473,000
46.455172
79
0.58102
false
2.543808
true
false
false
riccardo1991/virtual-device
app/models.py
1
4555
import numpy import scipy.stats # Sensor class represents a sensor connected to the virtual device. class Sensor: def __init__(self, sensor_id, name, sensor_type, minimum, maximum, sampling_rate, distribution): self._id = sensor_id self._name = name self._type = sensor_type self._m...
mit
-722,739,101,430,308,000
30.631944
100
0.612733
false
4.186581
false
false
false
grow/grow-ext-build-server
grow_build_server/google_sheets.py
1
5864
from google.appengine.api import memcache from google.appengine.api import urlfetch from google.appengine.ext import ndb from googleapiclient import errors from googleapiclient import discovery from oauth2client.contrib import appengine import cgi import csv import httplib2 import io import logging import time import r...
mit
-2,237,736,920,941,344,300
29.541667
90
0.601467
false
3.795469
false
false
false
gmichaeljaison/cv-utils
cv_utils/template_matching.py
1
5887
from __future__ import division import numpy as np import cv2 as cv import scipy.spatial from cv_utils import Box, img_utils, feature_extractor as fe _DEF_TM_OPT = dict(feature='rgb', distance='correlation', normalize=True, retain_size=True) def match_one(t...
gpl-3.0
6,487,248,755,391,905,000
30.821622
93
0.621199
false
3.679375
false
false
false
stefanv/scipy3
scipy/linalg/info.py
2
2837
""" Linear algebra routines ======================= Linear Algebra Basics:: inv --- Find the inverse of a square matrix solve --- Solve a linear system of equations solve_banded --- Solve a linear system of equations with a banded matrix solveh_banded --- Solve a linear system of equations wit...
bsd-3-clause
-5,861,253,898,052,439,000
41.343284
145
0.666549
false
4.31155
false
false
false
antoniodemora/git-cola
cola/widgets/submodules.py
2
3981
"""Provides widgets related to submodules""" from __future__ import absolute_import from qtpy import QtWidgets from qtpy.QtCore import Qt from qtpy.QtCore import Signal from .. import cmds from .. import core from .. import qtutils from .. import icons from ..i18n import N_ from ..widgets import defs from ..widgets i...
gpl-2.0
-887,538,373,377,109,100
31.900826
80
0.613916
false
3.953327
false
false
false
geekboxzone/lollipop_external_chromium_org
build/android/gyp/util/md5_check.py
99
2375
# Copyright 2013 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 hashlib import os def CallAndRecordIfStale( function, record_path=None, input_paths=None, input_strings=None, force=False): """Calls funct...
bsd-3-clause
3,922,210,798,291,311,600
26.616279
77
0.667368
false
3.280387
false
false
false
jakesyl/BitTornado
BitTornado/clock.py
2
1086
"""Provide a non-decreasing clock() function. In Windows, time.clock() provides number of seconds from first call, so use that. In Unix, time.clock() is CPU time, and time.time() reports system time, which may not be non-decreasing.""" import time import sys _MAXFORWARD = 100 _FUDGE = 1 class RelativeTime(object)...
mit
6,522,149,571,640,859,000
25.487805
78
0.62523
false
3.892473
false
false
false
dgarrett622/FuncComp
FuncComp/util.py
1
2464
# -*- coding: utf-8 -*- """ v1: Created on May 31, 2016 author: Daniel Garrett (dg622@cornell.edu) """ import numpy as np def maxdmag(s, ranges, x): """Calculates the maximum difference in magnitude for a given population and apparent separation value Args: s (ndarray): Apparent s...
mit
-8,903,001,090,910,545,000
34.214286
126
0.579951
false
3.008547
false
false
false
algolia/algoliasearch-client-python
algoliasearch/http/serializer.py
1
1899
import json import calendar import datetime import decimal import sys from typing import Union, Any, Dict from algoliasearch.helpers import get_items # Python 3 if sys.version_info >= (3, 0): from urllib.parse import urlencode else: from urllib import urlencode # pragma: no cover class QueryParametersSeri...
mit
-893,018,040,258,042,100
25.746479
85
0.622959
false
4.192053
false
false
false
rjw57/foldbeam
foldbeam/web/restapi/user.py
1
1057
import json from flask import url_for, make_response from .flaskapp import app, resource from .util import * @app.route('/<username>', methods=['GET', 'PUT']) def user(username): if request.method == 'GET': return get_user(username) elif request.method == 'PUT': return put_user(username) ...
apache-2.0
4,488,432,942,735,312,000
26.815789
76
0.614002
false
3.535117
false
false
false
selective-inference/selective-inference
doc/adjusted_MLE/tests/test_compare_sampler_mle.py
3
5428
import numpy as np, os, itertools import pandas as pd from .comparison_metrics import (sim_xy, selInf_R, glmnet_lasso, coverage, compare_sampler_MLE) def compare_sampler_mle(n=500, ...
bsd-3-clause
4,470,810,480,543,356,400
49.259259
93
0.336957
false
5.021277
false
false
false
ENSTA-Bretagne-Shepherd/Shepherd-Ros-Structure
src/shepherd_loc/src/sailboat_interval_estimator.py
1
2548
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Alaa El Jawad ~~~~~~~~~~~~~ This node subscribes to the mesured position of the sailboat and publishes an interval where the sailboat should be """ import rospy from shepherd_msg.msg import RosInterval, SailboatPoseInterval, SailboatPose # -----------...
mit
-131,172,703,420,569,500
35.4
82
0.501177
false
3.692754
false
false
false
codito/pomito
tests/test_pomodoro.py
1
12811
# -*- coding: utf-8 -*- """Tests for pomodoro service.""" import os import sys import time import unittest import pytest from unittest.mock import Mock from pomito import main, pomodoro, task from pomito.plugins.ui import UIPlugin from pomito.plugins.task import TaskPlugin from pomito.test import PomitoTestFactory ...
mit
-7,101,168,220,726,572,000
35.189266
111
0.615331
false
3.621996
true
false
false
zhangzewen/Network_Lib
ML/Apriori_TC.py
1
5653
#FileName:Apriori.py import sys import copy def InsertToSortedList(tlist,item): i = 0 while i < len(tlist): if item < tlist[i]: break elif item == tlist[i]: return i+=1 tlist.insert(i, item) def CompItemSet(x,y): i = 0 while i < len(x) and i < len(y): if x[i] < y[...
gpl-2.0
4,206,485,629,394,449,000
18.70696
108
0.597382
false
2.694471
false
false
false
mazaclub/hashmal
hashmal_lib/plugins/chainparams.py
1
1409
from PyQt4 import QtCore from hashmal_lib.core import chainparams from base import Plugin, BasePluginUI, Category def make_plugin(): p = Plugin(ChainParams) p.has_gui = False return p class ChainParamsObject(QtCore.QObject): """This class exists so that a signal can be emitted when chainparams prese...
gpl-3.0
6,010,033,544,786,269,000
32.547619
93
0.66785
false
4.060519
false
false
false