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
linrio/WhetherOrNotMe
testme.py
1
2028
# -*- coding utf-8 -*- import cv2 import os import numpy as np from sklearn.model_selection import train_test_split import random import tensorflow as tf def read_data(img_path, image_h = 64, image_w = 64): image_data = [] label_data = [] image = cv2.imread(img_path) #cv2.namedWindow("Image...
apache-2.0
568,228,649,818,764,700
33
105
0.594675
false
2.909613
false
false
false
hylandnp/CS7012_DISTRIBUTED_PROJECT
reducer.py
1
7038
#Listen and respond to SNMP GET/GETNEXT queries from pysnmp.carrier.asyncore.dispatch import AsyncoreDispatcher from pysnmp.carrier.asyncore.dgram import udp, udp6, unix from pyasn1.codec.ber import encoder, decoder from pysnmp.proto import api import time, bisect from src.map_reduce import Mapper, Reducer, Shuffler fr...
mit
280,178,073,929,246,180
31.583333
82
0.583262
false
3.680962
false
false
false
okanokumus/Programming
Python/IntroductionPython/variable_types.py
1
1599
# https://www.tutorialspoint.com/python/python_variable_types.htm # Python variables do not need explicit declaration to reserve memory space. # The declaration happens automatically when you assign a value to a variable. # The equal sign (=) is used to assign values to variables. number = 5 weight = 58.9 name = 'pyth...
gpl-3.0
-2,425,228,713,200,995,300
33.782609
95
0.699812
false
3.423983
false
false
false
cthoyt/onto2nx
src/onto2nx/ontospy/core/entities.py
1
12106
# !/usr/bin/env python # -*- coding: UTF-8 -*- from __future__ import print_function from itertools import count from .utils import * class RDF_Entity(object): """ Pythonic representation of an RDF resource - normally not instantiated but used for inheritance purposes <triples> : a structure like...
gpl-3.0
-5,157,829,616,975,822,000
32.076503
120
0.566331
false
3.878885
true
false
false
UASLab/ImageAnalysis
scripts/archive/5b-solver5.py
1
23350
#!/usr/bin/python # 1. Iterate through all the image pairs and triangulate the match points. # 2. Set the 3d location of features to triangulated position (possibly # averaged if the feature is included in multiple matches # 3. Compute new camera poses with solvePnP() using triangulated point locations # 4. Repeat ...
mit
-8,557,831,333,197,678,000
36.479936
97
0.592248
false
3.378672
false
false
false
asherkhb/coge
web/gobe/gobe.py
1
7785
#!/usr/bin/python import web import os try: import sqlite3 except ImportError: from pysqlite2 import dbapi2 as sqlite3 import simplejson import urllib TMPDIR = "../tmp/GEvo/" if not os.path.exists(TMPDIR): TMPDIR = os.path.join(os.path.dirname(__file__), TMPDIR) DBTMPL = os.path.join(TMPDIR, "%s.sqlite") ...
bsd-2-clause
5,173,759,947,039,488,000
37.925
145
0.479897
false
3.705378
false
false
false
mjasher/gac
GAC/flopy/modpath/mpbas.py
1
6164
""" mpbas module. Contains the ModpathBas class. Note that the user can access the ModpathBas class as `flopy.modflow.ModpathBas`. Additional information for this MODFLOW/MODPATH package can be found at the `Online MODFLOW Guide <http://water.usgs.gov/ogw/modflow/MODFLOW-2005-Guide/index.html?bas6.htm>`_. ""...
gpl-2.0
3,510,775,014,214,753,300
34.922156
91
0.540234
false
3.496313
false
false
false
dattalab/d_code
events/eventRoutines.py
1
23750
"""Event arrays are 2D label arrays (time x ROI) that are generated from an array of fluorescent traces of the same size. Uses the following inequality to determine if an event occured at a specific time in a cell: dF/F of cell > (baseline of cell + std_threshold * std of cell * alpha) See the findEve...
mit
7,388,882,840,149,779,000
49.211416
179
0.666695
false
3.80792
false
false
false
romses/FitView
fitparse/records.py
1
11248
import math import struct try: from itertools import izip_longest except: from itertools import zip_longest as izip_longest from numbers import Number class RecordBase(object): # namedtuple-like base class. Subclasses should must __slots__ __slots__ = () # TODO: switch back to namedtuple, and do...
bsd-3-clause
-8,365,860,220,540,263,000
28.291667
89
0.55192
false
3.534884
false
false
false
crossgovernmentservices/csd-notes
app/blueprints/sso/views.py
1
1740
# -*- coding: utf-8 -*- """ Single Sign-On views """ from urllib.parse import unquote, urlparse, urlunparse from flask import ( Blueprint, redirect, request, session, url_for ) from flask_security.utils import login_user, logout_user from app.extensions import ( user_datastore, oidc ) s...
mit
8,933,051,197,988,040,000
17.913043
66
0.616667
false
3.359073
false
false
false
CFIS-Octarine/octarine
planning/ObsStatus.py
1
9227
from __future__ import absolute_import import argparse import logging import math import sys import tempfile import time import ephem import matplotlib import requests from astropy.io.votable import parse matplotlib.use('Agg') from matplotlib.pyplot import figure, close from matplotlib.patches import Rectangle from ...
gpl-3.0
-8,040,165,882,080,599,000
34.08365
115
0.563672
false
3.491109
false
false
false
enthought/uchicago-pyanno
pyanno/ui/annotations_view.py
1
9266
# Copyright (c) 2011, Enthought, Ltd. # Author: Pietro Berkes <pberkes@enthought.com> # License: Modified BSD license (2-clause) from traits.has_traits import HasTraits, on_trait_change from traits.trait_numeric import Array from traits.trait_types import (Instance, Int, ListFloat, Button, Event, File, ...
bsd-2-clause
-7,870,631,480,164,798,000
29.281046
79
0.54878
false
4.548846
false
false
false
try-dash-now/idash
lib/winTelnet.py
1
17448
__author__ = 'Sean Yu' '''created @2015/9/14''' '''a windows telnet session''' from telnetlib import Telnet as spawn import socket import select # Tunable parameters DEBUGLEVEL = 0 # Telnet protocol defaults TELNET_PORT = 23 # Telnet protocol characters (don't change) IAC = chr(255) # "Interpret As Command" DONT = c...
mit
7,032,868,279,089,488,000
33.414201
256
0.504814
false
3.746618
false
false
false
ValvePython/steam
steam/core/crypto.py
1
3356
""" All function in this module take and return :class:`bytes` """ import sys from os import urandom as random_bytes from struct import pack from base64 import b64decode from Cryptodome.Hash import MD5, SHA1, HMAC from Cryptodome.PublicKey.RSA import import_key as rsa_import_key, construct as rsa_construct from Crypto...
mit
-1,118,242,270,544,146,800
30.660377
93
0.703516
false
2.851317
false
false
false
ddu7/PyLC
063Unique Paths II.py
1
1314
# -*- coding: utf-8 -*- # Follow up for "Unique Paths": # # Now consider if some obstacles are added to the grids. How many unique paths would there be? # # An obstacle and empty space is marked as 1 and 0 respectively in the grid. # # For example, # There is one obstacle in the middle of a 3x3 grid as illustrated belo...
mit
-4,832,800,005,191,433,000
26.711111
94
0.463082
false
2.645435
false
false
false
mbourqui/django-echoices
echoices/enums/enums.py
1
9631
import warnings from enum import Enum, EnumMeta from types import DynamicClassAttribute class EChoiceMeta(EnumMeta): """ Used to override some methods. See Also -------- https://blog.ionelmc.ro/2015/02/09/understanding-python-metaclasses/#restrictions-with-multiple-metaclasses """ ...
gpl-3.0
-4,122,943,399,944,168,000
29.003115
119
0.554979
false
4.545068
false
false
false
lagopus/lagopus
test/integration_test/tools/lib/ofp/ofp_group_mod.py
1
1137
import os import sys import copy import logging from checker import * from .ofp import register_ofp_creators from .ofp import OfpBase from .ofp_bucket import SCE_BUCKETS from .ofp_bucket import OfpBucketCreator # YAML: # group_mod: # command: 0 # type: 0 # group_id: 0 # buckets: # - bucket: # weig...
apache-2.0
6,999,811,155,225,049,000
22.204082
68
0.5365
false
3.679612
false
false
false
MatrixGamesHub/mtxPython
src/mtxNet/RendererClient.py
1
4645
""" mtxPython - A framework to create matrix games. Copyright (C) 2016 Tobias Stampfl <info@matrixgames.rocks> 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 in version 3 of the ...
gpl-3.0
-2,398,894,517,825,313,300
38.033613
147
0.575027
false
4.345182
false
false
false
WatanukiRasadar/kylin
kylin/_injector.py
1
1117
from functools import wraps from typing import Callable from ._scope import Scope class Injector(Callable): """ class decorator to inject dependencies into a callable decorated function """ def __init__(self, dependencies: dict, fun: Callable): self.dependencies = dependencies se...
mit
-8,151,589,430,398,917,000
26.925
97
0.622202
false
4.296154
false
false
false
tymofij/adofex
transifex/projects/templatetags/project_tags.py
1
1755
from django import template from django.db.models import Sum from transifex.languages.models import Language from transifex.resources.models import RLStats, Resource from transifex.txcommon.utils import StatBarsPositions register = template.Library() @register.inclusion_tag('resources/stats_bar_simple.html') def prog...
gpl-3.0
2,672,739,128,950,525,400
27.306452
65
0.611966
false
4.016018
false
false
false
google/google-ctf
third_party/edk2/BaseTools/Source/Python/GenFds/FdfParser.py
1
193525
## @file # parse FDF file # # Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR> # Copyright (c) 2015, Hewlett Packard Enterprise Development, L.P.<BR> # # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License # w...
apache-2.0
-8,537,984,819,681,910,000
40.938762
223
0.573885
false
4.237279
false
false
false
folti/subuser
logic/subuserlib/commands.py
1
2023
# -*- coding: utf-8 -*- """ This module helps us figure out which subuser subcommands can be called. """ #external imports import os #internal imports import subuserlib.executablePath import subuserlib.paths def getBuiltIn(): """ Get a list of the names of the built in subuser commands. """ try: commands ...
lgpl-3.0
4,134,394,350,383,250,000
35.781818
196
0.739001
false
3.890385
false
false
false
abranches/backmonitor
backmonitor/protocol.py
1
1832
import logging from twisted.internet.protocol import Factory, Protocol from frame import decode_frame from message import decode_message log = logging.getLogger(__name__) class ConnectionManager(object): def __init__(self, backmonitor, addr): self.backmonitor = backmonitor self.addr = addr ...
apache-2.0
6,756,100,460,570,981,000
26.757576
90
0.637555
false
4.173121
false
false
false
vntarasov/openpilot
selfdrive/registration.py
1
2605
import os import json from datetime import datetime, timedelta from selfdrive.swaglog import cloudlog from selfdrive.version import version, terms_version, training_version, get_git_commit, get_git_branch, get_git_remote from common.hardware import HARDWARE from common.api import api_get from common.params import Para...
mit
2,335,180,383,859,445,000
37.308824
157
0.70595
false
3.280856
false
false
false
s1na/darkoob
darkoob/book/views.py
1
2366
from django.http import HttpResponse, HttpResponseRedirect from django.shortcuts import render, render_to_response from django.core.urlresolvers import reverse from django.http import Http404 from django.utils.translation import ugettext as _ from django.contrib.auth.decorators import login_required from django.contrib...
mit
4,478,514,506,639,604,000
30.546667
145
0.677515
false
3.834684
false
false
false
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/providers/openstack/swift.py
1
4141
# Copyright 2016 PerfKitBenchmarker 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
5,507,729,754,466,135,000
34.09322
75
0.683651
false
3.921402
false
false
false
cpennington/edx-platform
lms/djangoapps/courseware/module_render.py
1
55817
""" Module rendering """ import hashlib import json import logging import textwrap from collections import OrderedDict from functools import partial import six from completion import waffle as completion_waffle from completion.models import BlockCompletion from django.conf import settings from django.contrib.auth.mo...
agpl-3.0
-4,936,744,408,799,270,000
41.608397
119
0.650572
false
4.181049
false
false
false
kieranjol/IFIscripts
seq.py
1
1751
#!/usr/bin/env python import subprocess import sys import os import argparse from glob import glob parser = argparse.ArgumentParser(description='Generate v210/mov file from image sequence.' 'Written by Kieran O\'Leary.') parser.add_argument('input', help='file path of parent director...
mit
9,195,344,782,524,252,000
34.02
103
0.667047
false
3.367308
false
false
false
apophys/freeipa
pylint_plugins.py
1
10988
# # Copyright (C) 2015 FreeIPA Contributors see COPYING for license # from __future__ import print_function import copy import os.path import sys import textwrap from astroid import MANAGER, register_module_extender from astroid import scoped_nodes from pylint.checkers import BaseChecker from pylint.checkers.utils ...
gpl-3.0
3,321,435,523,477,805,600
27.246787
77
0.545777
false
3.915895
true
false
false
solvo/organilab
src/authentication/migrations/0001_initial.py
1
1044
# -*- coding: utf-8 -*- # Generated by Django 1.11.13 on 2018-06-21 07:16 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Feedb...
gpl-3.0
7,104,996,995,801,698,000
33.8
129
0.577586
false
4.423729
false
false
false
tensorflow/model-optimization
tensorflow_model_optimization/python/core/sparsity/keras/test_utils.py
1
5637
# Copyright 2019 The TensorFlow 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 applica...
apache-2.0
1,986,405,175,058,615,300
29.972527
94
0.664006
false
3.449816
false
false
false
finger563/editor
tests/flatProxyModel.py
1
3113
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys from PyQt4 import QtCore, QtGui class FlatProxyModel(QtGui.QAbstractProxyModel): def sourceDataChanged(self, topLeft, bottomRight): self.dataChanged.emit(self.mapFromSource(topLeft), self.mapFromSource(bottomRight)) ...
mit
131,644,875,371,513,710
30.765306
78
0.610022
false
3.737095
false
false
false
Jumpscale/play8
sockettest.py
1
1790
# import nnpy # import time # s=nnpy.Socket(nnpy.AF_SP,nnpy.REP) # # # s.bind('tcp://127.0.0.1:5555') # # # s.setsockopt(option=nnpy.RCVBUF,level=nnpy.SOL_SOCKET,value=1024*1024) # # s.getsockopt(option=nnpy.RCVBUF,level=nnpy.SOL_SOCKET) # # counter=0 # while True: # try: # res=s.recv(flags=nnpy.DONTWAIT) ...
apache-2.0
-7,030,116,780,493,325,000
22.246753
111
0.60838
false
3.162544
false
false
false
NazarioJL/google-foobar
level_3/the_grandest_staircase_of_them_all/solution.py
1
1603
def answer(n): # there will be only *one* sequence with count 1 result = make_stairs_count(n) - 1 return result def make_stairs(total_remaining): """Returns a list of all sequences of increasing values that add up to total_remaining""" all_lists = [] def make_stairs_rec(prev_step_size, left, ...
unlicense
3,313,028,360,251,223,000
25.716667
93
0.59451
false
3.807601
false
false
false
DarkFenX/Pyfa
eos/saveddata/module.py
1
46249
# =============================================================================== # Copyright (C) 2010 Diego Duclos # # This file is part of eos. # # eos 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, ...
gpl-3.0
1,596,012,414,091,344,100
41.159526
155
0.613894
false
4.268876
false
false
false
ezarowny/url-condenser
url_condenser/url_condenser/settings.py
1
3209
""" Django settings for url_condenser project. Generated by 'django-admin startproject' using Django 1.9.1. For more information on this file, see https://docs.djangoproject.com/en/1.9/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.9/ref/settings/ """ import...
mit
-3,015,443,904,954,819,600
25.303279
91
0.689
false
3.495643
false
false
false
vsego/PyteArt
patgen.py
1
2830
#!/usr/bin/env python3 """ Patterns generator for img2dat.py """ from itertools import combinations from PIL import Image, ImageDraw, ImageFont, ImageFilter from string import printable, ascii_letters, punctuation from sys import argv, stderr class GenPatts: allowedHoles = 0 # how many colors are permitted to re...
gpl-2.0
-1,986,131,092,147,713,800
39.428571
106
0.576325
false
3.958042
false
false
false
theindependentwolf/liverpool-discord-bot
result_details.py
1
4915
import discord from random import randint import random import random from random import randint import urllib.request from html.parser import HTMLParser from bs4 import BeautifulSoup import nocontext import requests import datetime import config import asyncio import csv import time import dateutil.relativedelta as re...
mit
744,983,116,459,146,000
29.71875
165
0.580671
false
3.564177
false
false
false
richardcornish/smsweather
fabfile.py
1
2185
from fabric import task from django.utils.termcolors import colorize # 1. Local: ssh-add ~/.ssh/aws.pem # 2. Local: Edit hosts, repo_name, pythonpath (if necessary) # 3. Remote: Copy .env to to {code_dir}/.env: hosts = [{ 'host': 'ec2-3-89-247-193.compute-1.amazonaws.com', 'user': 'ubuntu', }] repo_name = ...
bsd-3-clause
7,770,267,891,711,363,000
26.910256
199
0.637115
false
3.159652
false
false
false
espenhgn/hybridLFPy
examples/example_microcircuit_params_lognormalweights.py
1
38825
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Modified parameters file for the Hybrid LFP scheme, applying the methodology with the model of: Potjans, T. and Diesmann, M. "The Cell-Type Specific Cortical Microcircuit: Relating Structure and Activity in a Full-Scale Spiking Network Model". Cereb. Cortex (2014) 24 (...
gpl-3.0
-5,546,768,391,567,412,000
35.082714
111
0.457051
false
3.895355
false
false
false
MichSchli/QuestionAnsweringGCN
example_reader/graph_reader/graph_converter.py
1
2831
from example_reader.graph_reader.edge_type_utils import EdgeTypeUtils from example_reader.graph_reader.graph import Graph import numpy as np class GraphConverter: hypergraph_interface = None edge_type_utils = None def __init__(self, hypergraph_interface): self.hypergraph_interface = hypergraph_in...
mit
1,603,126,252,323,630,600
48.684211
125
0.671494
false
3.427361
false
false
false
the-virtual-brain/tvb-hpc
tvb_hpc/rng.py
1
3024
# Copyright 2018 TVB-HPC contributors # # 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 applicab...
apache-2.0
-6,177,618,747,205,311,000
30.5
78
0.581019
false
3.401575
false
false
false
asoc/snakewatch
snakewatch/action/Write.py
1
2980
""" This file is part of snakewatch. snakewatch 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) any later version. snakewatch is distributed in the hop...
bsd-3-clause
2,404,914,814,539,267,600
29.721649
98
0.614094
false
4.28777
false
false
false
eddieantonio/statically-typed-python
my_hip_site/my_hip_site.py
1
1932
#!/usr/bin/env python3 # -*- coding: UTF-8 -*- # This is free and unencumbered software released into the public domain. # # Anyone is free to copy, modify, publish, use, compile, sell, or # distribute this software, either in source code form or as a compiled # binary, for any purpose, commercial or non-commercial, a...
unlicense
-7,519,536,901,940,282,000
31.711864
73
0.67513
false
3.67619
false
false
false
makefu/bepasty-server
bepasty/views/display.py
1
6026
import errno import time from flask import current_app, render_template, Markup, url_for from flask.views import MethodView from werkzeug.exceptions import NotFound, Forbidden from pygments import highlight from pygments.lexers import get_lexer_for_mimetype from pygments.util import ClassNotFound as NoPygmentsLexer f...
bsd-2-clause
-7,702,975,127,156,539,000
44.651515
109
0.554597
false
4.5548
false
false
false
dimtion/jml
inputFiles/opponents/team-roquette/greedy.py
1
3203
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import lib.PyratApi as api import lib.travelHeuristics as th import lib.utils as ut import time import operator BOT_NAME = "greedy" PATH = [] METAGRAPH = {} BESTPATH = {} MOVING = False EATENCOINS = [] NB_COINS_TO_COMPUTE = 5 CURRENTCOIN = [] # This function should no...
mit
1,538,619,702,752,280,000
26.358974
141
0.702281
false
3.430868
false
false
false
vialectrum/vialectrum
electrum_ltc/gui/qt/util.py
1
34021
import asyncio import os.path import time import sys import platform import queue import traceback import os import webbrowser from functools import partial, lru_cache from typing import NamedTuple, Callable, Optional, TYPE_CHECKING, Union, List, Dict, Any from PyQt5.QtGui import (QFont, QColor, QCursor, QPixmap, QSt...
mit
-5,169,814,777,630,352,000
34.364865
124
0.608271
false
3.912708
false
false
false
GearsAD/semisorted_arnerve
arnerve/core/LCMManager.py
1
3344
''' Created on Sep 7, 2014 @author: gearsad ''' import lcm #Import the user types from user_update_t import user_update_t #Import the bot types from bot_update_t import bot_update_t from bot_control_command_t import bot_control_command_t #Import the role types from role_response_t import role_response_t class LCMM...
mit
-770,272,538,006,643,300
32.787879
119
0.609151
false
3.690949
false
false
false
1upon0/rfid-auth-system
GUI/printer/Pillow-2.7.0/Tests/test_format_hsv.py
1
5636
from helper import unittest, PillowTestCase, hopper from PIL import Image import colorsys import itertools class TestFormatHSV(PillowTestCase): def int_to_float(self, i): return float(i)/255.0 def str_to_float(self, i): return float(ord(i))/255.0 def to_int(self, f): return i...
apache-2.0
8,927,930,943,546,535,000
32.349112
78
0.503549
false
3.424058
true
false
false
mollyproject/mollyproject
molly/apps/places/providers/tfl.py
1
3958
from urllib2 import urlopen from xml.dom import minidom from collections import defaultdict import threading import logging from django.utils.translation import ugettext_lazy as _ from molly.apps.places.providers import BaseMapsProvider logger = logging.getLogger(__name__) class TubeRealtimeProvider(BaseMapsProvide...
apache-2.0
-4,033,144,124,539,551,000
42.977778
107
0.55331
false
4.768675
false
false
false
skosukhin/spack
var/spack/repos/builtin/packages/r-affycompatible/package.py
1
2149
############################################################################## # 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
8,644,395,620,993,898,000
47.840909
128
0.689158
false
3.91439
false
false
false
ryankanno/py-utilities
tests/time/test_date_utilities.py
1
1831
#!/usr/bin/env python # -*- coding: utf-8 -*- import calendar from datetime import timedelta from nose.tools import ok_ from py_utilities.time.date_utilities import EPOCH_AS_STRUCT_TIME from py_utilities.time.date_utilities import EPOCH_AS_DATETIME from py_utilities.time.date_utilities import next_day from py_utilitie...
mit
-4,479,779,889,592,963,000
34.901961
76
0.631349
false
3.480989
true
false
false
endlessm/chromium-browser
third_party/llvm/lldb/test/API/functionalities/avoids-fd-leak/TestFdLeak.py
1
4011
""" Test whether a process started by lldb has no extra file descriptors open. """ import lldb from lldbsuite.test import lldbutil from lldbsuite.test.lldbtest import * from lldbsuite.test.decorators import * def python_leaky_fd_version(test): import sys # Python random module leaks file descriptors on som...
bsd-3-clause
-3,330,200,459,424,116,000
36.839623
106
0.667913
false
3.920821
true
false
false
jwlin/web-crawler-tutorial
ch4/google_finance_api.py
1
2251
import requests import json from datetime import datetime, timedelta def get_stock(query): # query 可以是多支股票, 如 TPE:2330,TPE:2498, 不同股票以 , 分開 resp = requests.get('http://finance.google.com/finance/info?client=ig&q=' + query) if resp.status_code == 200: # 移除回傳資料開頭的 // # 剩下的資料是一個 list of dict,...
mit
-177,420,440,146,556,900
28.097222
118
0.556086
false
2.615481
false
false
false
devilry/devilry-django
devilry/devilry_group/feedbackfeed_builder/feedbackfeed_sidebarbuilder.py
1
1342
# -*- coding: utf-8 -*- # Devilry imports from devilry.devilry_comment.models import CommentFile from devilry.devilry_group.feedbackfeed_builder import builder_base from devilry.devilry_group import models as group_models class FeedbackFeedSidebarBuilder(builder_base.FeedbackFeedBuilderBase): def __init__(self,...
bsd-3-clause
-1,378,049,649,158,134,000
34.315789
71
0.651267
false
4.03003
false
false
false
bbengfort/cloudscope
cloudscope/console/commands/modify.py
1
12414
# cloudscope.console.commands.modify # Modifies topologies in place for deploying to alternative sites. # # Author: Benjamin Bengfort <bengfort@cs.umd.edu> # Created: Fri Aug 12 11:36:41 2016 -0400 # # Copyright (C) 2016 University of Maryland # For license information, see LICENSE.txt # # ID: modify.py [] benjamin@...
mit
4,806,752,857,086,505,000
33.010959
83
0.550991
false
4.406816
false
false
false
keturn/txOpenBCI
txopenbci/control.py
1
6185
# -*- coding: utf-8 -*- """ Players: * one who makes sure a connection to the device is open - a stable presence in the community; everyone knows where to find them * one who holds the connection to the device - may come and go with the connection * one who knows how to command the device * one who hears what the ...
apache-2.0
-3,535,835,345,981,307,000
25.545064
78
0.638157
false
4.128838
false
false
false
mdworks2016/work_development
Python/20_Third_Certification/venv/lib/python3.7/site-packages/celery/backends/s3.py
1
2745
# -*- coding: utf-8 -*- """s3 result store backend.""" from __future__ import absolute_import, unicode_literals from kombu.utils.encoding import bytes_to_str from celery.exceptions import ImproperlyConfigured from .base import KeyValueStoreBackend try: import boto3 import botocore except ImportError: bo...
apache-2.0
759,880,483,341,247,200
30.551724
75
0.601821
false
3.630952
false
false
false
jhartford/pybo
pybo/demos/intermediate.py
1
1969
""" Demo performing Bayesian optimization on an objective function sampled from a Gaussian process. This script also demonstrates user-defined visualization via a callback function that is imported from the advanced demo. Note that in this demo we are sampling an objective function from a Gaussian process. We are not,...
bsd-2-clause
-4,735,991,816,232,202,000
37.607843
80
0.6516
false
4.207265
false
true
false
adongy/adminradius
admin_radius/models.py
1
4418
from django.db import models from .raw_models import * from django.core.urlresolvers import reverse import datetime from django.core.exceptions import ValidationError class RadPassManager(models.Manager): def get_queryset(self): return super(RadPassManager, self).get_queryset().filter(attribute='NT-Pas...
mit
73,345,521,450,151,820
36.449153
144
0.611815
false
4.083179
false
false
false
YuxuanLing/trunk
trunk/code/study/python/Fluent-Python-example-code/21-class-metaprog/bulkfood/model_v8.py
1
2193
import abc import collections class AutoStorage: __counter = 0 def __init__(self): cls = self.__class__ prefix = cls.__name__ index = cls.__counter self.storage_name = '_{}#{}'.format(prefix, index) cls.__counter += 1 def __get__(self, instance, owne...
gpl-3.0
8,952,538,520,680,736,000
25.4125
67
0.559052
false
4.185115
false
false
false
diogo149/dooML
loss.py
1
2707
"""Table of Contents -modified_huber -hinge -squared_hinge -log -squared -huber -epsilon_insensitive -squared_epislon_insensitive -alpha_huber -absolute """ import numpy as np def modified_huber(p, y): """Modified Huber loss for binary classification with y in {-1, 1}; equ...
gpl-3.0
2,330,747,692,834,036,700
22.53913
127
0.586997
false
3.162383
false
false
false
DiamondLightSource/diffcalc
diffcalc/hkl/vlieg/calc.py
1
32658
### # Copyright 2008-2011 Diamond Light Source Ltd. # This file is part of Diffcalc. # # Diffcalc 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 late...
gpl-3.0
-7,248,182,833,805,356,000
37.557261
79
0.552208
false
3.42327
false
false
false
vollov/py-parser
src/xmlp/coverage.py
1
2568
#!/usr/bin/python from xml.dom.minidom import parse import xml.dom.minidom, os current_directory = os.path.dirname(os.path.abspath(__file__)) data_directory = os.path.join(current_directory, '../data') file_path = os.path.join(data_directory, 'coverages.xml') # Open XML document using minidom parser D...
mit
2,440,359,789,388,073,000
30.716049
151
0.666667
false
3.053508
false
false
false
endrjuskr/studies
MRJP/LatteCompilerPython/src/lattepar.py
1
10557
__author__ = 'Andrzej Skrodzki - as292510' from .LatteParsers.LatteTypes import * from .LatteParsers.LatteExpressions import * from .LatteParsers.LatteParameters import * from .LatteParsers.LatteStatements import * from .LatteParsers.LatteTopDefinitions import * from .LatteExceptions import * import ply.yacc as yacc ...
apache-2.0
-9,036,227,321,942,147,000
19.906931
110
0.531401
false
2.497516
false
false
false
ninjawil/weather-station
scripts/setup.py
1
4064
#------------------------------------------------------------------------------- # # The MIT License (MIT) # # Copyright (c) 2015 William De Freitas # # 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 ...
mit
-6,399,027,101,030,141,000
36.62963
80
0.450295
false
5.271077
false
false
false
ameya30/IMaX_pole_data_scripts
imax_lp_max_/imax_rotate_Q_U.py
1
3065
import glob import numpy as np import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec from scipy.optimize import minimize_scalar from astropy.io import fits def Q_eq(phi): # Set inputs for fnction sumU = 0 for wv in range(0, 5): uSing = uMes[wv] qSing ...
mit
-1,030,299,242,345,325,800
29.346535
114
0.501142
false
2.896975
false
false
false
aiorchestra/aiorchestra-openstack-plugin
openstack_plugin/tasks/compute.py
1
6731
# Author: Denys Makogon # # 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 t...
apache-2.0
5,980,241,100,788,522,000
36.814607
78
0.626504
false
3.924781
false
false
false
kancom/cca
grabber/views.py
1
1536
from django.shortcuts import render from django.http import HttpResponse, HttpResponseRedirect from crispy_forms.helper import FormHelper from crispy_forms.layout import Layout, ButtonHolder, Submit from crispy_forms.bootstrap import Field, InlineRadios, TabHolder, Tab from django import forms from . import models from...
apache-2.0
-3,808,581,804,322,514,000
32.391304
76
0.617839
false
4.254848
false
false
false
ldionne/nstl-lang
nstl/sema/scope.py
1
2717
"""Interface to store lexical scope related information used during semantic analysis.""" import sys from itertools import chain from ..helpers import orderedset class Scope(object): """Parent class for all scopes. Implements generic lexical scoping operations. _parent The parent scope o...
bsd-3-clause
-5,247,343,988,452,406,000
31.73494
80
0.577475
false
4.800353
false
false
false
DOTOCA/plugin.video.netflixbmc
default.py
1
62469
#!/usr/bin/python # -*- coding: utf-8 -*- import os import sys import re import json import time import shutil import threading import subprocess import xbmc import xbmcplugin import xbmcgui import xbmcaddon import xbmcvfs from resources.lib import chrome_cookies trace_on = False addon = xbmcaddon.Ad...
gpl-2.0
8,642,612,235,448,023,000
44.307635
530
0.60971
false
3.75347
false
false
false
jhseu/tensorflow
tensorflow/python/ops/summary_ops_v2.py
1
46626
# Copyright 2017 The TensorFlow 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 applica...
apache-2.0
2,818,230,846,669,279,700
35.626866
104
0.690816
false
3.996743
false
false
false
forkbong/qutebrowser
qutebrowser/config/websettings.py
1
9471
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2014-2021 Florian Bruhin (The Compiler) <mail@qutebrowser.org> # # This file is part of qutebrowser. # # qutebrowser 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 S...
gpl-3.0
3,179,883,137,833,848,300
34.339552
78
0.652201
false
4.068299
true
false
false
TimBizeps/BachelorAP
V103_Biegung elastischer Stäbe/Auswertung.py
1
7054
import matplotlib as mpl import matplotlib.pyplot as plt import numpy as np import scipy.constants as const from scipy.optimize import curve_fit def auswertung(material, querschnitt, einspannung, x, D, d, L, M): if einspannung == "einseitig": u = L*x**2 - x**3/3 g = const.g F = M*g # ...
gpl-3.0
-5,941,356,961,601,821,000
31.635514
171
0.463918
false
2.404959
false
false
false
shacknetisp/fourthevaz
modules/default/chatbot/wordai.py
1
4216
# -*- coding: utf-8 -*- from random import choice import copy import random import string import pprint import pickle class wordai: """Word AI""" def load(self): """Load the file.""" try: self.dict_file = open(self.dbfile, 'rb') self.data_dict = pickle.load(self.dict_f...
mit
5,600,262,000,338,761,000
31.183206
73
0.46371
false
3.988647
false
false
false
lukecampbell/compliance-checker
compliance_checker/cf/appendix_d.py
1
4004
#!/usr/bin/env python ''' Appendix D compliance support for CF 1.6 and CF 1.7 The definitions given here allow an application to compute dimensional coordinate values from the dimensionless ones and associated variables. The formulas are expressed for a gridpoint (n,k,j,i) where i and j are the horizontal indices, k i...
apache-2.0
2,743,449,355,784,953,000
59.666667
148
0.692807
false
3.64
false
false
false
DemianWright/io_scene_blb
const.py
1
6023
# ##### BEGIN GPL LICENSE BLOCK ##### # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is ...
gpl-2.0
3,007,720,878,029,224,000
27.965174
113
0.619957
false
3.338692
false
false
false
twhiteaker/pynwm
src/pynwm/hydroshare/hs_latest.py
1
2315
#!/usr/bin/python2 """Identifies the latest National Water Model files in HydroShare.""" from hs_list import list_sims, list_dates def _find_complete_sim(sims): for key in reversed(sims): sim = sims[key] if sim['is_complete']: return (key, sim) return (None, None) def find_lates...
mit
5,805,429,525,390,713,000
34.075758
81
0.580562
false
3.977663
false
false
false
z01nl1o02/tests
mxnet/cn/utils.py
1
15685
from math import exp from mxnet import gluon from mxnet import autograd from mxnet import nd from mxnet import image from mxnet.gluon import nn import mxnet as mx import numpy as np from time import time import matplotlib.pyplot as plt import matplotlib as mpl import random import pdb class DataLoader(object): """...
gpl-2.0
8,030,618,133,173,451,000
37.070388
99
0.562576
false
3.492541
true
false
false
DeveloperJose/Vision-Rat-Brain
feature_matching_v3/exp_dynamic_programming.py
1
11157
# Author: Jose G Perez # Version 1.0 # Last Modified: January 31, 2018 import numpy as np import pylab as plt from skimage import color from util_im import imshow_matches from util_sm import load_sm, norm_sm, norm_prob_sm from util_sift import precompute_sift, load_sift precompute_sift('S_BB_V4', 'PW_BB_V4') s_im, s_l...
mit
-8,387,339,234,302,177,000
34.531847
104
0.553554
false
2.709983
false
false
false
facebook/chisel
commands/FBXCTestCommands.py
1
48565
#!/usr/bin/python # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import re import fbchisellldbbase as fb import lldb NOT_FOUND = 0xFFFFFFFF # UINT32_MAX def lldbc...
mit
-1,635,572,801,278,517,000
28.776211
99
0.564789
false
4.377197
false
false
false
fossfreedom/indicator-sysmonitor
sensors.py
1
22495
#!/usr/bin/python3 # coding: utf-8 # # A simple indicator applet displaying cpu and memory information # # Author: Alex Eftimie <alex@eftimie.ro> # Fork Author: fossfreedom <foss.freedom@gmail.com> # Original Homepage: http://launchpad.net/indicator-sysmonitor # Fork Homepage: https://github.com/fossfreedom/indicator-s...
gpl-3.0
-5,165,070,681,103,870,000
30.178918
120
0.532117
false
4.065099
false
false
false
skirpichev/omg
diofant/combinatorics/polyhedron.py
1
27227
from ..core import Basic, Tuple from ..core.compatibility import as_int from ..sets import FiniteSet from ..utilities import flatten, unflatten from ..utilities.iterables import minlex from .perm_groups import PermutationGroup from .permutations import Permutation rmul = Permutation.rmul class Polyhedron(Basic): ...
bsd-3-clause
3,605,767,470,753,817,000
32.738538
80
0.530356
false
3.578733
false
false
false
strands-project/robomongo
src/third-party/qscintilla/Python/configure.py
1
29817
# This script configures QScintilla for PyQt v4.10 and later. It will fall # back to the old script if an earlier version of PyQt is found. # # Copyright (c) 2012 Riverbank Computing Limited <info@riverbankcomputing.com> # # This file is part of QScintilla. # # This file may be used under the terms of the GNU Genera...
gpl-3.0
5,562,037,454,009,413,000
32.691525
202
0.583325
false
3.79496
true
false
false
sassoftware/mint
mint/django_rest/rbuilder/platforms/models.py
1
5423
# # Copyright (c) SAS Institute 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 w...
apache-2.0
-8,816,140,235,265,148,000
40.083333
121
0.702379
false
3.873571
false
false
false
pbs/django-cms
cms/utils/page.py
1
3242
# -*- coding: utf-8 -*- from django.conf import settings from django.db.models import Q from django.core.exceptions import ValidationError import re APPEND_TO_SLUG = "-copy" COPY_SLUG_REGEX = re.compile(r'^.*-copy(?:-(\d+)*)?$') def is_valid_page_slug(page, parent, lang, slug, site, path=None): """Validates given...
bsd-3-clause
-1,183,574,578,454,097,700
34.23913
134
0.607958
false
3.747977
false
false
false
yothenberg/mcxapi
mcxapi/api.py
1
20155
import logging import requests import re from requests.adapters import HTTPAdapter from requests.packages.urllib3.util.retry import Retry from datetime import datetime, timezone, timedelta from collections import namedtuple from anytree import RenderTree, NodeMixin from .exceptions import McxNetworkError, McxParsingE...
mit
4,570,036,573,036,988,400
39.149402
143
0.541851
false
3.972211
false
false
false
clebersfonseca/google-python-exercises
basic/list1.py
1
3265
#!/usr/bin/python -tt # Copyright 2010 Google Inc. # Licensed under the Apache License, Version 2.0 # http://www.apache.org/licenses/LICENSE-2.0 # Google's Python Class # http://code.google.com/edu/languages/google-python-class/ # Basic list exercises # Fill in the code for the functions below. main() is already set ...
apache-2.0
1,280,166,186,578,082,600
29.514019
79
0.580398
false
3.037209
true
false
false
NicovincX2/Python-3.5
Physique/Mouvement/Dynamique/Systèmes oscillants/Oscillateur harmonique/oscillateur_harmonique_periode_animation.py
1
2155
# -*- coding: utf-8 -*- import os ''' Simple résolution numérique de l'équation d'un oscillateur harmonique pour illustrer l'isochronisme des oscillations quelle que soit l'amplitude de départ avec animation au cours du temps. ''' import numpy as np # Pour np.linspace import scipy as sp ...
gpl-3.0
-7,314,351,340,730,637,000
29.169014
79
0.634921
false
2.86747
false
false
false
dufferzafar/critiquebrainz
critiquebrainz/frontend/apis/relationships/artist.py
1
3750
""" Relationship processor for artist entity. """ from urlparse import urlparse from flask_babel import gettext import urllib def process(artist): """Handles processing supported relation lists.""" if 'artist-relation-list' in artist and artist['artist-relation-list']: artist['band-members'] = _artist...
gpl-2.0
5,770,933,709,101,641,000
42.103448
121
0.476
false
4.62963
false
false
false
electrumalt/electrum-ixc
gui/qt/transaction_dialog.py
1
7687
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2012 thomasv@gitorious # # 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...
gpl-3.0
436,080,397,216,934,200
32.714912
136
0.589046
false
3.731553
false
false
false
fungos/gemuo
src/gemuo/engine/relpor.py
1
1926
# # GemUO # # (c) 2005-2012 Max Kellermann <max@duempel.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; version 2 of the License. # # This program is distributed in the hope tha...
gpl-2.0
277,350,442,926,236,400
32.789474
80
0.590343
false
3.739806
false
false
false
nlsynth/iroha
examples/config-examples.py
1
1102
#! /usr/bin/python # Run this to generate Makefile, then run 'make' EXAMPLES = { 'minimum' : {'minimum'}, 'copy' : {'copy'}, 'loop' : {'loop', 'example_common'}, 'xorshift' : {'xorshift', 'example_common'}, } EXAMPLE_OBJS = ['example_common', 'copy', 'loop', 'minimum', 'xorshift'] OUTPU...
bsd-3-clause
-4,760,997,667,858,220,000
29.611111
133
0.554446
false
2.568765
false
false
false
jbaayen/sympy
sympy/thirdparty/pyglet/pyglet/font/__init__.py
1
21133
# ---------------------------------------------------------------------------- # pyglet # Copyright (c) 2006-2007 Alex Holkner # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistributi...
bsd-3-clause
-2,993,675,939,295,804,400
34.221667
79
0.58288
false
4.111479
false
false
false
JackDanger/sentry
tests/acceptance/test_project_keys.py
1
2933
from __future__ import absolute_import from datetime import datetime from django.utils import timezone from sentry.models import ProjectKey from sentry.testutils import AcceptanceTestCase class ProjectKeysTest(AcceptanceTestCase): def setUp(self): super(ProjectKeysTest, self).setUp() self.user =...
bsd-3-clause
2,673,051,990,279,457,300
30.537634
85
0.582339
false
3.81901
true
false
false
sgibbes/zonal_stats_app
utilities/zstats_subprocess.py
1
2378
import sys import os import sqlite3 import prep_shapefile import arcpy from arcpy.sa import * import datetime import simpledbf arcpy.CheckOutExtension("Spatial") value = sys.argv[1] zone = sys.argv[2] final_aoi = sys.argv[3] cellsize = sys.argv[4] analysis = sys.argv[5] start = int(sys.argv[6]) stop = int(sys.argv[7]...
apache-2.0
-2,103,962,230,845,745,000
28.358025
108
0.687132
false
3.321229
false
false
false
JordanP/openstack-snippets
ospurge/ospurge/main.py
1
8851
#!/usr/bin/env python3 # 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, so...
apache-2.0
-7,863,330,502,847,431,000
35.726141
79
0.632471
false
4.1691
true
false
false
ideascube/ideascube
ideascube/blog/migrations/0001_initial.py
1
1992
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models from django.conf import settings import taggit.managers class Migration(migrations.Migration): dependencies = [ ('taggit', '0002_auto_20150616_2121'), migrations.swappable_dependency(settings...
agpl-3.0
-7,513,129,243,814,382,000
51.421053
208
0.601908
false
3.898239
false
false
false
chenzilin/git-repo
git_refs.py
1
3980
# # Copyright (C) 2009 The Android Open Source Project # # 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 la...
apache-2.0
-7,995,023,122,377,508,000
22.690476
74
0.585427
false
3.528369
false
false
false
remibergsma/cosmic
cosmic-core/systemvm/patches/debian/config/opt/cloud/bin/cs/CsConfig.py
1
2202
# -- coding: utf-8 -- from CsAddress import CsAddress from CsDatabag import CsCmdLine class CsConfig(object): """ A class to cache all the stuff that the other classes need """ __LOG_FILE = "/var/log/cloud.log" __LOG_LEVEL = "DEBUG" __LOG_FORMAT = "%(asctime)s %(levelname)-8s %(message)s" ...
apache-2.0
761,955,633,890,424,600
24.022727
87
0.563124
false
3.517572
false
false
false