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
linzhaolover/myansible
box/Sample.py
1
3052
# Python SDK # https://github.com/box/box-python-sdk # Python scripting is usually done within a Virtual Environment # sudo pip install virtualenv # This line creates the environment, starts it, then installs the packages needed # virtualenv pythonruntime && source pythonruntime/bin/activate && pip install -U setupto...
apache-2.0
7,302,886,777,090,138,000
35.333333
153
0.753604
false
3.317391
true
false
false
loosecannon93/chittyrc
tests/chirc/tests/test_whois.py
1
4535
import pytest from chirc import replies import chirc.tests.fixtures as fixtures class TestWHOIS(object): @pytest.mark.category("WHOIS") def test_whois1(self, irc_session): client1 = irc_session.connect_user("user1", "User One") client2 = irc_session.connect_user("user2", "User Two") ...
apache-2.0
-2,772,544,942,076,431,400
46.747368
167
0.540463
false
3.675041
true
false
false
projectexpert/pmis
stock_location_analytic/tests/test_stock_location.py
1
1658
# Copyright 2017 Eficent Business and IT Consulting Services S.L. # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). from odoo.tests.common import TransactionCase from odoo.exceptions import ValidationError class TestStockLocation(TransactionCase): def setUp(self): super(TestStockLoca...
agpl-3.0
-9,127,350,128,467,652,000
36.681818
73
0.647768
false
3.785388
false
false
false
mF2C/COMPSs
compss/programming_model/bindings/python/src/pycompss/api/binary.py
1
6812
#!/usr/bin/python # # Copyright 2002-2019 Barcelona Supercomputing Center (www.bsc.es) # # 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 ...
apache-2.0
2,395,544,386,202,535,400
36.021739
94
0.503083
false
4.66256
false
false
false
AlvinCJin/RealEstateApp
app/rest/tasks.py
1
4863
from flask import Flask, jsonify, abort, make_response from flask_restful import Resource, reqparse, fields, marshal, marshal_with from flask_httpauth import HTTPBasicAuth from app import restApi from ..models import User, Post, Comment auth = HTTPBasicAuth() @auth.get_password def get_password(username): if use...
bsd-3-clause
4,405,501,381,722,816,500
27.273256
79
0.595517
false
3.599556
false
false
false
NeCTAR-RC/karaage-auth
kgauth/services/keystone/views.py
1
1579
import base64 import functools import json import logging from django.conf import settings from django.http import Http404 from django.contrib import messages from django.contrib.auth import REDIRECT_FIELD_NAME from django.shortcuts import render, redirect from django.utils.http import is_safe_url from karaage.common...
gpl-3.0
1,440,950,411,549,506,800
31.895833
73
0.70171
false
3.898765
false
false
false
sharifelguindi/qatrackplus
qatrack/data_tables/views.py
1
7529
import json import urllib from django.db.models import Q from django.http import HttpResponse from django.views.generic import ListView #============================================================================ class BaseDataTablesDataSource(ListView): """This view serves a page with a pre-rendered data tabl...
mit
-6,394,429,098,928,835,000
39.262032
104
0.516138
false
4.66192
false
false
false
MediffRobotics/DeepRobotics
rpiRobotArm/RPIControl_Version4_InverseKine/rpiDetectPushButtons/RpiButtonDetectors.py
1
2634
import RPi.GPIO as GPIO import time import serial import threading import random class RpiRobotArmButtons(threading.Thread): def __init__(self): self.FlagPress_TeachingButton=0 self.FlagPress_InsertMovementButton=0 ...
gpl-3.0
-1,573,801,194,342,410,200
31.121951
66
0.496963
false
4.637324
false
false
false
nens/python-subgrid
python_subgrid/pipeline/listener.py
1
1171
import logging import zmq import datetime import dateutil.parser import numpy as np def recv_array(socket, flags=0, copy=False, track=False): """recv a numpy array""" md = socket.recv_json(flags=flags) msg = socket.recv(flags=flags, copy=copy, track=track) buf = buffer(msg) A = np.frombuffer(buf,...
gpl-3.0
-6,849,134,146,289,940,000
25.022222
67
0.694278
false
3.355301
false
false
false
smessmer/gitversion
src/test/versioninfooutputter_test.py
1
14646
import unittest from gitversionbuilder import versioninfo, versioninfooutputter from test import test_utils class VersionInfoOutputterTest(unittest.TestCase, test_utils.CodeAsserts): def test_output_cpp(self): expected = """ // --------------------------------------------------- ...
gpl-3.0
-864,037,057,999,615,700
41.950147
111
0.4548
false
4.474794
true
false
false
Intel-Corp/CPU-Manager-for-Kubernetes
tests/e2e/driver/k8s.py
1
6738
# Copyright (c) 2017 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 law or agreed to i...
apache-2.0
-4,139,711,186,597,711,000
41.917197
149
0.619472
false
4.203369
true
false
false
kapt/django-oscar
oscar/apps/customer/views.py
1
25456
from django.shortcuts import get_object_or_404, redirect from django.views import generic from django.core.urlresolvers import reverse, reverse_lazy from django.core.exceptions import ObjectDoesNotExist from django import http from django.contrib import messages from django.utils.translation import ugettext_lazy as _ f...
bsd-3-clause
4,035,230,275,075,074,000
35.107801
79
0.617536
false
4.098535
false
false
false
pierrejean-coudert/winlibre_pm
package_manager/smart/backends/slack/slackver.py
1
3278
# # Copyright (c) 2004 Conectiva, Inc. # # Written by Gustavo Niemeyer <niemeyer@conectiva.com> # # This file is part of Smart Package Manager. # # Smart Package Manager 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 Fou...
gpl-2.0
5,257,148,869,480,719,000
27.754386
76
0.57047
false
3.191821
false
false
false
repotvsupertuga/tvsupertuga.repository
plugin.video.TVsupertuga/resources/lib/plugins/trakt.py
1
27279
""" trakt.py --- Jen Plugin for accessing trakt data Copyright (C) 2017, Jen 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 optio...
gpl-2.0
8,978,482,426,370,011,000
33.53038
98
0.50559
false
3.654743
false
false
false
oysstu/pyopencl-in-action
ch10/reduction_complete.py
1
4425
''' Combined example of the following listings Listing 10.4: Computing the final reduction (multiple passes over the data) ''' import numpy as np import pyopencl as cl import utility from string import Template ARRAY_SIZE = 2**20 # Note: The code assumes that the size of the array is divisible by the max work group ...
mit
7,613,630,887,902,118,000
34.119048
118
0.699887
false
3.136074
false
false
false
stackforge/cloudkitty
cloudkitty/storage/v2/__init__.py
1
5294
# -*- coding: utf-8 -*- # Copyright 2018 Objectif Libre # # 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 ...
apache-2.0
-579,922,156,336,436,600
32.0875
78
0.600869
false
4.419032
false
false
false
jeroanan/Aquarius
Config.py
1
1046
class Config(object): def __init__(self): self.__sqlLiteDatabasePath = "./aquarius.db" self.__webServerAddress = "192.168.0.9" self.__webServerPort = 9090 self.__harvestPaths = [] @property def harvest_paths(self): return self.__harvestPaths @ha...
gpl-3.0
-3,362,505,269,092,956,700
25.820513
52
0.606119
false
4.085938
false
false
false
sgsystem/Fire-Forest-Index
Fire-Index.py
1
12009
#!/usr/bin/env python3# import math import time #Create by Tsvetomir Gotsov #tsvetomir.gotsov@gmail.com #Ruse, Bulgaria #A Program for compute Canadian Fire Weather Index # counter = 1 while 1: #input variable temperature = float(input("Temperature at 12:00, C: ")) humidity = float(input("Relative humidi...
gpl-2.0
5,928,838,284,737,371,000
34.635015
103
0.521026
false
2.886085
false
false
false
jpcaruana/cardDav-uploader
test_vcards.py
1
1546
# -*- coding: utf-8 -*- from nose.tools import assert_equal, assert_in from vcards import VCard, VCardParser TOTO_CARD = """BEGIN:VCARD VERSION:3.0 N:Toto;Tutu;;; FN:Tutu Toto ORG:python; item1.EMAIL;type=INTERNET;type=pref:toto@tutu.com REV:2013-08-29T21:50:13Z UID:1234-5678-9000-1 END:VCARD""" APPLE_CARD = """BEGIN...
artistic-2.0
-1,027,330,064,315,539,100
22.784615
65
0.673351
false
2.4081
false
false
false
BryceLohr/authentic
authentic2/saml/common.py
1
28609
import urlparse import os.path import urllib import urllib2 import httplib import logging import re import datetime import lasso from django.template import RequestContext from django.conf import settings from django.http import HttpResponseRedirect, Http404, HttpResponse from django.shortcuts import render_to_respons...
agpl-3.0
5,954,596,151,517,733,000
37.608637
209
0.669649
false
3.778262
false
false
false
mjs/juju
releasetests/publish_streams.py
1
4037
#!/usr/bin/python from __future__ import print_function from argparse import ArgumentParser import difflib import os import sys import traceback import urllib2 __metaclass__ = type CPCS = { 'aws': "http://juju-dist.s3.amazonaws.com", 'azure': "https://jujutools.blob.core.windows.net/juju-tools", 'cano...
agpl-3.0
-1,161,595,875,358,138,000
31.296
78
0.623483
false
3.700275
false
false
false
benmoran56/esper
examples/pythonista_ios_example.py
1
2042
from scene import * import esper ################################## ## Here are a couple of Components ################################## class Renderable(SpriteNode): def __init__(self, **kwargs): SpriteNode.__init__(self, **kwargs) class Velocity: def __init__(self, x=0.0, y=0.0): ...
mit
3,362,099,836,552,510,500
28.608696
87
0.544564
false
3.746789
false
false
false
faneshion/MatchZoo
matchzoo/data_generator/callbacks/dynamic_pooling.py
1
3283
import numpy as np from matchzoo.data_generator.callbacks import Callback class DynamicPooling(Callback): """:class:`DPoolPairDataGenerator` constructor. :param fixed_length_left: max length of left text. :param fixed_length_right: max length of right text. :param compress_ratio_left: the length cha...
apache-2.0
6,737,231,352,391,612,000
34.684783
70
0.5629
false
3.844262
false
false
false
lepistone/vertical-ngo
__unported__/framework_agreement_requisition/model/purchase.py
1
4180
# -*- coding: utf-8 -*- ############################################################################## # # Author: Nicolas Bessi # Copyright 2013 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # publi...
agpl-3.0
-5,270,470,250,616,179,000
38.065421
96
0.603349
false
4.00767
false
false
false
sunjerry019/photonLauncher
0_hcphotonics/usbcounter/arthurparse.py
1
3571
import Gnuplot import time import argparse import os, sys import Gnuplot, Gnuplot.PlotItems, Gnuplot.funcutils import json import random import numpy as np def main(): parser = argparse.ArgumentParser(description = "Plots parsed json objects from usbcounter, arthur.py script. Plots a histogram of the counts by def...
apache-2.0
214,454,318,553,120,000
41.011765
159
0.562027
false
3.542659
false
false
false
dionyself/candela
converter/stl.py
1
3747
#!/usr/bin/env python """ pySTL2GC Copyright (C) 2016 Dionys Rosario This program comes with ABSOLUTELY NO WARRANTY This is free software, and you are welcome to redistribute it under certain conditions. Usage: "cat file.stl | stl.py > file.ngc" """ import ocl import logging import subproccess lo...
bsd-3-clause
6,873,691,311,930,014,000
26.962687
87
0.540966
false
2.649929
false
false
false
klahnakoski/ActiveData
vendor/jx_elasticsearch/es52/painless/integer_op.py
1
2291
# 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) # from __future__ import absolute_import, divisi...
mpl-2.0
-9,069,923,314,590,832,000
32.691176
77
0.508948
false
4.047703
false
false
false
mihneadb/suse_bug_reporter
bugreporter/gathering_modules/release.py
1
1557
''' Copyright (C) 2011 Mihnea Dobrescu-Balaur 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 distributed in ...
gpl-2.0
7,412,853,048,797,208,000
33.6
79
0.705202
false
4.054688
false
false
false
akalicki/genomics-csi
matching/dbsnp_to_ids.py
1
1714
""" Usage: (python) dbsnp_to_ids.py <dbsnp_matches.xml> Counts all matches of rsids in <dbsnp_matches.xml> where the submitter was either 1000GENOMES or HUMANGENOME_JCVI (Craig Venter). Prints a list of the most likely matches. """ from collections import defaultdict import operator import sys import xml.etree.cElemen...
gpl-2.0
4,534,242,615,387,297,000
33.28
93
0.572345
false
3.296154
false
false
false
Caesurus/CTF_Writeups
2019-PicoCTF/exploits/exploit_handyshellcode.py
1
1279
#!/usr/bin/env python2 # -*- coding: utf-8 -*- # This exploit template was generated via: # $ pwn template from pwn import * # Set up pwntools for the correct architecture context.update(arch='i386') exe = '/problems/handy-shellcode_4_b724dbfabf610aaa4841af644535be30/vuln' # Many built-in settings can be controlled o...
apache-2.0
-1,788,899,926,752,616,000
26.212766
75
0.593432
false
3.262755
false
false
false
ohnorobo/pokemon
Anh/ShapeIn.py
1
1214
import Image import colorsys import glob import os start_dir = "../images/pokemonParts/" end_dir = "../images/croppedPokeParts/" file = open("data.txt",'w') def findCrop(xdir): if not os.path.exists(xdir): xdir = start_dir+xdir filedir = os.path.split(xdir) ydir = end_dir+os.path.split(filedir[0])...
mit
-7,436,186,094,526,558,000
24.291667
62
0.51318
false
2.477551
false
false
false
polypmer/obligarcy
obligarcy/forms.py
1
6340
# -*- coding: utf-8 -*- from functools import partial from django import forms from django.forms.extras.widgets import SelectDateWidget from .models import Submission, Contract, UserProfile, Deadline from django.contrib.auth.models import User from crispy_forms.helper import FormHelper from crispy_forms.layout import S...
gpl-3.0
704,294,240,359,160,300
39.628205
109
0.590723
false
4.021574
false
false
false
dtnaylor/web-profiler
webloader/zombiejs_loader.py
1
3350
import os import logging import traceback import subprocess import httplib from collections import defaultdict from loader import Loader, LoadResult, Timeout, TimeoutError ENV = '/usr/bin/env' ZombieJS = 'node' ZombieLOADER = '/home/b.kyle/github/node-http2/example/pageloader_client.js' # TODO: when do we return FAIL...
mit
6,390,639,641,784,951,000
44.890411
129
0.662388
false
3.950472
false
false
false
ThunderGemios10/The-Super-Duper-Script-Editor
ui_eboot.py
1
6444
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'qt\ui\eboot.ui' # # Created: Mon Jun 03 01:17:17 2013 # by: PyQt4 UI code generator 4.8.5 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except Att...
gpl-3.0
5,028,844,509,646,618,000
52.7
138
0.702669
false
3.536773
false
false
false
xushiwei/nova
nova/network/manager.py
1
51086
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compli...
apache-2.0
1,390,780,870,286,262,300
44.775986
79
0.556493
false
4.541381
false
false
false
incuna/django-extra-views
extra_views/dates.py
1
2072
from django.views.generic.dates import BaseMonthArchiveView from django.views.generic.list import MultipleObjectTemplateResponseMixin from django.core.exceptions import ImproperlyConfigured from calendar import Calendar from collections import defaultdict import datetime class BaseCalendarMonthArchiveView(BaseMonthAr...
mit
8,556,893,067,625,334,000
34.724138
116
0.591699
false
4.475162
false
false
false
consciousnesss/learn_theano
learn_theano/utils/profiler_run.py
1
1095
import cProfile import pstats import inspect def profiler_run(command, how_many_lines_to_print=10, print_callers_of=None, print_callees_of=None, use_walltime=False): ''' Run a string statement under profiler with nice defaults command - s...
apache-2.0
-6,517,560,789,576,599,000
31.205882
74
0.643836
false
3.46519
false
false
false
JonathanHunz/BLL_MNIST
src/data/utils/Downloader.py
1
1417
import os import logging import urllib.request class Downloader: def __init__(self, dataset, output_dir): self.dataset = dataset self.output_dir = output_dir def download(self): # Create data directory if it doesn't already exists if not os.path.isdir(self.output_dir): ...
mit
7,118,246,504,369,650,000
32.738095
102
0.605505
false
4.498413
false
false
false
hackersql/sq1map
lib/takeover/udf.py
1
13392
#!/usr/bin/env python #coding=utf-8 """ Copyright (c) 2006-2017 sqlmap developers (http://sqlmap.org/) See the file 'doc/COPYING' for copying permission """ import os from lib.core.agent import agent from lib.core.common import checkFile from lib.core.common import dataToStdout from lib.core.common import Backend fro...
gpl-3.0
-8,349,807,804,942,385,000
32.036269
182
0.560226
false
3.561016
false
false
false
TrailingDots/async_py_messaging
async_py_messaging/Tasks/tasksink.py
1
2254
#!/bin/env python # Ref: ZeroMQ, p. 60 # Parallel task sink with kill signaling import sys import time import zmq import pdb class TaskSink(object): def __init__(self, config): self.config = config self.context = zmq.Context() # Socket to receive msgs self.receiver = self.contex...
gpl-3.0
-5,365,036,998,106,658,000
25.833333
67
0.53638
false
4.061261
false
false
false
jruizgit/rules
testpy/manners.py
1
51013
from durable.lang import * import datetime def unix_time(dt): epoch = datetime.datetime.utcfromtimestamp(0) delta = dt - epoch return delta.total_seconds() def unix_time_millis(dt): return unix_time(dt) * 1000.0 with statechart('miss_manners'): with state('ready'): @to('start') @...
mit
2,887,046,116,326,816,000
90.094643
148
0.489267
false
2.305881
false
false
false
ant30/ninja-sysop
ninjasysop/backends.py
1
3584
# -*- coding: utf-8 -*- # Copyright (c) <2012> Antonio Pérez-Aranda Alcaide (ant30) <ant30tx@gmail.com> # Antonio Pérez-Aranda Alcaide (Yaco Sistemas SL) <aperezaranda@yaco.es> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitt...
bsd-3-clause
-4,303,209,212,816,178,000
35.181818
93
0.717755
false
4.395092
false
false
false
aaltay/beam
sdks/python/apache_beam/io/aws/s3io_test.py
1
25012
# # 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 not us...
apache-2.0
5,280,664,029,086,671,000
30.86242
80
0.643331
false
3.239477
true
false
false
PhloxAR/math3
math3/tests/test_vector4.py
1
6435
try: import unittest2 as unittest except: import unittest import numpy as np from math3 import vector4 class test_vector4(unittest.TestCase): def test_import(self): import math3 math3.vector4 from math3 import vector4 def test_create(self): result = vector4.create() ...
bsd-3-clause
2,416,713,436,813,565,000
32.691099
79
0.536908
false
3.14978
true
false
false
yuhobebbho/registry
rang.py
1
5349
''' Created on Jun 3, 2014 @author: ben ''' ''' Created on Dec 31, 2013 @author: bon ''' import gtk import sqlite3,pango import datetime import Glob class New: def Ref(self): tit='Range Assignment ' self.dialog = gtk.Dialog(tit, None, 0, (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, 'Done'...
agpl-3.0
-1,183,146,429,290,282,000
33.076433
120
0.540288
false
3.216476
false
false
false
brett-rickman/probable-barnacle
proc_ms_dnssettings.py
1
4326
#!/usr/local/bin/python3 # import configparser import re import argparse import logging import os import subprocess parser = argparse.ArgumentParser() parser.add_argument( "--settings-file", help="DNS Setting file to be reviewed", default="DnsSettings.txt" ) parser.add_argument( "--prefix", help="Prefix of zon...
gpl-3.0
2,447,015,958,508,464,000
32.796875
88
0.558715
false
3.706941
false
false
false
christi3k/zulip
zerver/models.py
1
72769
from __future__ import absolute_import from typing import Any, DefaultDict, Dict, List, Set, Tuple, TypeVar, Text, \ Union, Optional, Sequence, AbstractSet, Pattern, AnyStr, Callable, Iterable from typing.re import Match from zerver.lib.str_utils import NonBinaryStr from django.db import models from django.db.mode...
apache-2.0
-2,698,740,687,606,245,000
40.275666
125
0.648174
false
3.736726
false
false
false
beebyte/irisett
irisett/webmgmt/view.py
1
9924
"""Web views.""" from typing import Any, Dict, List import time from aiohttp import web # noinspection PyPackageRequirements import aiohttp_jinja2 from irisett.sql import DBConnection from irisett import ( metadata, stats, contact, log, object_models, monitor_group, ) from irisett.monitor imp...
mit
6,827,973,100,863,876,000
36.168539
120
0.630492
false
3.761941
false
false
false
yudingding6197/fin_script
debug/api/function_name_get.py
1
1265
#!/usr/bin/env python # -*- coding:utf8 -*- ''' #两种方法获取函数名称: #1.通过系统函数 #2.通过inspect模块 获取当前文件名: ''' import os import sys import inspect from datetime import * ##############################1. def a(): print sys._getframe().f_code.co_name ################################# 2. inspect模块 def get__function_name(): ...
gpl-2.0
-4,809,166,461,827,016,000
17.557377
107
0.573828
false
2.275654
false
false
false
jcjohnson/simple-amt
delete_hits.py
1
1088
import sys import argparse import simpleamt if __name__ == '__main__': parser = argparse.ArgumentParser(parents=[simpleamt.get_parent_parser()], description="Delete HITs") parser.add_argument('--all', action='store_true', default=False) args = parser.parse_args() if (args.hit_ids_file is not No...
mit
-2,768,848,827,875,387,000
27.631579
75
0.599265
false
3.039106
false
false
false
masipcat/Visio-artifical
split.py
1
6891
#!/usr/bin/python # -*- coding: utf-8 -*- # DEV: Jordi Masip from utiles import * import tranf, imgio def mirror_effect(img): """ Retorna la imatge girada 180º sobre l'eix Y >>> mirror_effect([[255,255,255, 0],[0,255,255, 255]]) [[0, 255, 255, 255], [255, 255, 255, 0]] """ return [row[::-1] for row in img] de...
mit
-6,567,600,037,554,037,000
32.763547
124
0.656259
false
2.463695
false
false
false
Kredns/python
migrate/migrate.py
1
6917
#!/usr/bin/env python from __future__ import print_function import os import sys import shutil import argparse import logging try: sys.path.append('../color/') from color import Color except ImportError: print 'Unable to find color module. Please ensure that color.py exists.' sys.exit(2) class Window...
mit
-7,535,231,788,687,421,000
40.668675
129
0.559202
false
4.204863
false
false
false
Linux-Box/lbgui
lib/python/Components/opkg.py
1
2219
import os from boxbranding import getImageVersion def enumFeeds(): for fn in os.listdir('/etc/opkg'): if fn.endswith('-feed.conf'): file = open(os.path.join('/etc/opkg', fn)) feedfile = file.readlines() file.close() try: for feed in feedfile: yield feed.split()[1] except IndexError: pass...
gpl-2.0
-4,862,717,749,331,243,000
32.119403
212
0.562866
false
3.649671
false
false
false
reddec/pika
pika/adapters/blocking_connection.py
1
100936
"""The blocking connection adapter module implements blocking semantics on top of Pika's core AMQP driver. While most of the asynchronous expectations are removed when using the blocking connection adapter, it attempts to remain true to the asynchronous RPC nature of the AMQP protocol, supporting server sent RPC comman...
bsd-3-clause
-4,301,308,192,514,482,700
39.881328
93
0.605394
false
4.694043
false
false
false
bohdon/maya-pulse
src/pulse/scripts/pulse/views/designview.py
1
2437
""" A widget containing a collection of panels with tools for designing the rig blueprint. """ from pulse.vendor.Qt import QtWidgets from .designviews.controls import ControlsPanel from .designviews.general import GeneralPanel from .designviews.joints import JointsPanel, JointOrientsPanel from .designviews.sym import...
mit
-1,814,904,807,486,549,500
29.848101
72
0.688962
false
4.102694
false
false
false
secdev/scapy
scapy/arch/bpf/supersocket.py
1
15695
# Guillaume Valadon <guillaume@valadon.net> """ Scapy *BSD native support - BPF sockets """ from ctypes import c_long, sizeof import errno import fcntl import os import platform from select import select import struct import time from scapy.arch.bpf.core import get_dev_bpf, attach_filter from scapy.arch.bpf.consts i...
gpl-2.0
-72,780,897,247,263,180
32.898488
106
0.576298
false
3.756582
false
false
false
solidfire/solidfire-ai
sfai-openstack/verification_scripts/retype_volumes.py
1
2559
#!/usr/bin/python """ This program will retype volumes """ import os from optparse import OptionParser import random import sys import time from cinderclient import client as cinderclient from novaclient.v2 import client as novaclient USER = os.getenv('OS_USERNAME') TENANT = os.getenv('OS_TENANT_NAME') PASSWORD = ...
apache-2.0
-1,212,075,146,915,049,200
32.671053
99
0.533802
false
4.374359
false
false
false
bmstu-iu9/mill-db
pymilldb/context/__init__.py
1
1166
from .Argument import ArgumentParameter, ArgumentSequenceCurrent, ArgumentSequenceNext from .Column import Column from .Condition import Condition, ConditionWithParameter, ConditionWithOnlyColumns, logger as condition_logger from .ConditionTreeNode import ConditionTreeNodeAnd, ConditionTreeNodeOr from .DataType import ...
mit
-9,199,011,435,342,024,000
35.4375
110
0.737564
false
4.536965
false
false
false
stormi/tsunami
src/primaires/tresor/commandes/tresor/glob.py
1
3427
# -*-coding:Utf-8 -* # Copyright (c) 2012 LE GOFF Vincent # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # l...
bsd-3-clause
-1,621,422,870,923,842,000
49.044118
79
0.677931
false
3.643469
false
false
false
securesocketimproved/ssi
socksv/tcpRelay.py
1
3154
import socket import threading from pluginHelper.IPlugin import ICryptoPlugin class tcpRelay(): # This Class is used directly with no modification on both proxy side def __init__(self, pluginStack: list, uplink: socket.socket, downlink: socket.socket): self.pluginStack = pluginStack ...
gpl-3.0
7,902,421,128,341,871,000
30.183673
105
0.508878
false
4.551227
false
false
false
zurustar/ManattanFinder
img2face.py
1
1288
import cv2, glob, sys, os, imghdr, datetime, time, json def main(srcdir, destdir, cascade_path): winname = 'searching..' cv2.namedWindow(winname, cv2.WINDOW_AUTOSIZE) if not os.path.exists(destdir): os.mkdir(destdir) lastsaved = datetime.datetime.now() prefix = lastsaved.strftime('%Y%m%d-%H%M%S_') c...
gpl-3.0
-257,982,599,966,806,800
25.285714
72
0.599379
false
2.933941
false
false
false
GrognardsFromHell/TemplePlus
tpdatasrc/tpgamefiles/scr/Spell385 - Read Magic.py
1
1177
from toee import * def OnBeginSpellCast( spell ): print "Read Magic OnBeginSpellCast" print "spell.target_list=", spell.target_list print "spell.caster=", spell.caster, " caster.level= ", spell.caster_level #game.particles( "sp-divination-conjure", spell.caster ) def OnSpellEffect( spell ): print "Read Magic OnS...
mit
2,811,413,302,780,542,500
29.205128
75
0.71113
false
2.75644
false
false
false
jhseu/tensorflow
tensorflow/python/ops/control_flow_ops.py
1
138664
# Copyright 2015 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,918,525,488,657,280,500
37.146905
113
0.672871
false
3.788013
false
false
false
google-research/realworldrl_suite
realworldrl_suite/utils/loggers.py
1
2222
# coding=utf-8 # Copyright 2020 The Real-World RL Suite Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
apache-2.0
-5,429,435,280,571,818,000
27.857143
79
0.680468
false
3.778912
false
false
false
olitheolix/qtmacs
doc/source/code_snippets/tut_3_6.py
1
3060
""" Tutorial 3: Applet- and macro signatures. """ # Import the module with the global variables and the macro base class. import qtmacs.qte_global as qte_global from qtmacs.base_macro import QtmacsMacro from qtmacs.base_applet import QtmacsApplet from PyQt4 import QtGui # Get a reference to the main instance of Qtmac...
gpl-3.0
-6,201,060,233,063,597,000
29.29703
74
0.677451
false
3.493151
false
false
false
jarekswierek/g-photo
settings.py
1
3864
""" Django settings for gphoto project. Generated by 'django-admin startproject' using Django 1.11. For more information on this file, see https://docs.djangoproject.com/en/1.11/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.11/ref/settings/ """ import os im...
mit
8,127,386,446,830,089,000
23.769231
91
0.669772
false
3.345455
false
false
false
GiulianoFranchetto/zephyr
scripts/west_commands/completion.py
1
1620
# Copyright (c) 2019 Nordic Semiconductor ASA # # SPDX-License-Identifier: Apache-2.0 import argparse import os from west import log from west.commands import WestCommand # Relative to the folder where this script lives COMPLETION_REL_PATH = 'completion/west-completion' class Completion(WestCommand): def __ini...
apache-2.0
86,477,915,203,020,540
31.4
78
0.584568
false
4.378378
false
false
false
anoopcs9/samba
python/samba/join.py
1
69410
# python join code # Copyright Andrew Tridgell 2010 # Copyright Andrew Bartlett 2010 # # 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 ...
gpl-3.0
-4,350,304,505,861,588,000
43.867485
152
0.544201
false
3.780913
false
false
false
freevo/kaa-base
src/event.py
1
5809
# -*- coding: iso-8859-1 -*- # ----------------------------------------------------------------------------- # event.py - Generic event handling # # Events are similar to Signals but use a different approach. They are # global and always synchronized. An EventHandler can monitor specific # or all events; it does not ev...
lgpl-2.1
-298,180,575,882,112,600
27.615764
79
0.583922
false
4.531201
false
false
false
gemdude46/1337
htmlparse.py
1
1116
from HTMLParser import HTMLParser import DOM from html_constants import * cur = None class parser(HTMLParser): def handle_starttag(self, tag, attrs): global cur a = {} for attr in attrs: a[attr[0]] = attr[1] cur = DOM.Element(cur, tag, a) if tag in self_closing_...
gpl-3.0
-5,067,328,466,550,975,000
24.363636
63
0.542115
false
4.072993
false
false
false
trec-kba/kba-scorer
src/scripts/run-all-scorings.py
1
4139
''' run the CCR scorer on all the groups, including no restriction to a single group ''' import os import sys import json import subprocess import multiprocessing from collections import defaultdict targets = json.load(open('../../trec-kba-ccr-and-ssf-query-topics-2013-07-16.json'))['targets'] groups = set() for targ i...
mit
-2,225,209,929,018,779,600
31.590551
275
0.643151
false
2.902525
false
false
false
blueboxgroup/neutron
neutron/tests/unit/ml2/drivers/test_mech_mlnx.py
1
4429
# Copyright (c) 2014 OpenStack Foundation # 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 ...
apache-2.0
-3,087,635,536,306,254,300
38.900901
78
0.600813
false
4.067034
true
false
false
LearnEra/LearnEraPlaftform
lms/djangoapps/instructor/views/api.py
1
66169
""" Instructor Dashboard API views JSON views which the instructor dashboard requests. Many of these GETs may become PUTs in the future. """ import StringIO import json import logging import re import requests from django.conf import settings from django_future.csrf import ensure_csrf_cookie from django.views.decorat...
agpl-3.0
2,278,031,557,492,211,700
37.314418
241
0.66841
false
4.003449
false
false
false
r8b7xy/qutebrowser
qutebrowser/misc/guiprocess.py
1
5798
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2015 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 Softwa...
gpl-3.0
6,257,354,972,538,016,000
37.144737
79
0.617799
false
4.135521
false
false
false
eamonnmag/hepdata3
hepdata/modules/records/utils/submission.py
1
37311
# -*- coding: utf-8 -*- # # This file is part of HEPData. # Copyright (C) 2016 CERN. # # HEPData 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...
gpl-2.0
-5,885,377,221,371,761,000
39.555435
126
0.608721
false
4.441786
false
false
false
Nitaco/ansible
lib/ansible/plugins/connection/lxc.py
1
8254
# (c) 2015, Joerg Thalheim <joerg@higgsboson.tk> # Copyright (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = """ author: Joerg Thalheim <joe...
gpl-3.0
8,939,473,812,335,839,000
34.886957
95
0.550036
false
4.00291
false
false
false
wimac/home
Dropbox/skel/bin/sick-beard/sickbeard/providers/__init__.py
1
3704
# Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/sickbeard/ # # 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 Free Software Foundation, either version 3 of t...
gpl-2.0
8,273,234,967,528,478,000
29.65812
104
0.648758
false
3.870428
false
false
false
nextgis/nextgisweb
nextgisweb/auth/models.py
1
7198
# -*- coding: utf-8 -*- from __future__ import division, absolute_import, print_function, unicode_literals from collections import OrderedDict from passlib.hash import sha256_crypt import sqlalchemy as sa import sqlalchemy.orm as orm from ..env import env from ..models import declarative_base from ..compat import lru...
gpl-3.0
-759,827,209,894,539,800
28.743802
85
0.58419
false
4.018984
false
false
false
alphagov/digitalmarketplace-api
app/utils.py
1
10910
import datetime import random from flask import url_for as base_url_for from flask import abort, current_app, request, jsonify from werkzeug.exceptions import BadRequest from dmutils.formats import DATE_FORMAT from .validation import validate_updater_json_or_400 from . import search_api_client, dmapiclient def ran...
mit
-7,899,362,688,579,029,000
35.125828
119
0.637214
false
3.805371
true
false
false
isislovecruft/torflow
NetworkScanners/BwAuthority/extras/parsedireq.py
1
2077
#!/usr/bin/python # <armadev> mikeperry: v3 fetchers fetch about 8 times a day # <armadev> v2 fetchers fetch about 48 times a day # <armadev> except, as karsten pointed out, the v2 fetchers might fetch # more than that, since some fail and they retry # So v2 fetches are 6.0 times more frequent than v3 fetche...
bsd-3-clause
192,287,969,289,311,700
24.9625
71
0.610496
false
2.615869
false
false
false
PluginCafe/cinema4d_py_sdk
scripts/release20/fieldlist_sampling.py
1
2253
""" FieldList Sampling Example: c4d.FieldList c4d.modules.mograph.FieldLayer c4d.modules.mograph.FieldInput c4d.modules.mograph.FieldOutput Samples multiple fields with c4d.FieldList custom data and stores the result into a vertex color tag. """ import c4d from c4d.modules import mograph def main(): # Checks i...
apache-2.0
7,344,204,121,580,387,000
28.272727
102
0.723924
false
3.755
false
false
false
uruz/asylum.su
site_asylum/apps/delirium/migrations/0001_initial.py
1
1899
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='DeliriumUser', fields=[ ('id', models.AutoField...
mit
3,631,653,270,691,626,500
40.72093
118
0.550167
false
3.768908
false
false
false
abezuglov/ANN
Storm-Surge/code/feedforward_two_layers.py
1
8296
from __future__ import print_function import matplotlib.pyplot as plt import numpy as np import os import sys import time import tarfile from IPython.display import display, Image from scipy import ndimage from sklearn.linear_model import LogisticRegression from six.moves.urllib.request import urlretrieve from six.move...
gpl-3.0
-1,904,301,000,130,827,000
42.208333
148
0.634523
false
3.698618
true
false
false
spiralx/mypy
mypy/spiralx/quick2.py
1
5963
def log(f): "Logs each call to f(*a, **kw)." if hasattr(f, "func_name"): name = f.func_name elif hasattr(obj, "im_class"): name = "%s.%s" % getattrs(obj, "im_class", "__name__") else: name = str(obj) @wraps(f) def wrapper(*a, **kw): argstr = ", ".join([str(x) fo...
mit
-3,430,260,953,387,276,000
26.353211
115
0.586114
false
3.829801
false
false
false
mrava87/EAGE_Hackatoon_2017
examples/Face_Eye_HaarCreation.py
1
2879
#!/usr/bin/env python2.7 # Face recognition example from https://www.youtube.com/watch?v=88HdqNDQsEk # and https://pythonprogramming.net/haar-cascade-face-eye-detection-python-opencv-tutorial/ # # Haar cascade creation for recognition # # Authors: C. Birnie, M. Ravasi import urllib import cv2 import numpy as np impor...
mit
1,957,144,321,834,239,200
35.443038
138
0.575547
false
3.439665
false
false
false
eli261/jumpserver
apps/audits/views.py
1
10394
import csv import json import uuid import codecs from django.conf import settings from django.urls import reverse from django.utils import timezone from django.core.cache import cache from django.http import HttpResponse, JsonResponse from django.utils.decorators import method_decorator from django.views import View ...
gpl-2.0
2,714,929,687,158,336,500
35.219512
96
0.60737
false
3.900188
false
false
false
mikel-egana-aranguren/SADI-Galaxy-Docker
galaxy-dist/eggs/mercurial-2.2.3-py2.7-linux-x86_64-ucs4.egg/hgext/largefiles/reposetup.py
1
22753
# Copyright 2009-2010 Gregory P. Ward # Copyright 2009-2010 Intelerad Medical Systems Incorporated # Copyright 2010-2011 Fog Creek Software # Copyright 2010-2011 Unity Technologies # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. '...
gpl-3.0
-5,217,839,691,826,961,000
47.307856
80
0.467367
false
5.241419
false
false
false
marcharper/python-ternary
examples/ternary_contours.py
1
1845
""" Compute ternary contours using matplotlib.pyplot.contour function """ import numpy as np import matplotlib.pyplot as plt import ternary import math import itertools def shannon_entropy(p): """Computes the Shannon Entropy at a distribution in the simplex.""" s = 0. for i in range(len(p)): try: ...
mit
698,802,727,593,484,800
33.166667
120
0.681843
false
3.181034
false
false
false
yasintoda/pysolar
test_pysolar_yas/solar_diagram.py
1
2755
from pysolar.solar import * import numpy as np import matplotlib.pyplot as plt import datetime latitude_deg = 45 # month, day, shift because of DST dates_hour = [(12, 23, 1), (6, 22, 0)] dates = [(12, 23), (1, 20), (2, 18), (3, 21), (4, 17), (5, 21), (6, 22)] # dates = [] # for month in range(6): # for day in ran...
gpl-3.0
-2,649,934,976,864,009,000
33
120
0.615105
false
3.24
false
false
false
OCA/l10n-brazil
l10n_br_account_payment_brcobranca/models/account_journal.py
1
11869
# @ 2020 Akretion - www.akretion.com.br - # Magno Costa <magno.costa@akretion.com.br> # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) import os import sys import traceback from odoo import _, fields, models from odoo.exceptions import UserError, ValidationError from odoo.addons.account_move_bas...
agpl-3.0
-2,687,013,200,877,143,600
41.654676
88
0.558779
false
3.94609
false
false
false
WheatonCS/Lexos
lexos/views/k_means.py
1
1097
from flask import session, Blueprint from lexos.helpers import constants as constants from lexos.managers import session_manager as session_manager from lexos.models.k_means_model import KMeansModel from lexos.views.base import render k_means_blueprint = Blueprint("k-means", __name__) @k_means_blueprint.route("/k-me...
mit
7,266,811,166,714,852,000
28.648649
66
0.698268
false
3.706081
false
false
false
boada/planckClusters
CLUSTERpipe/plugins/_gui.py
1
14873
import pylab import time import sys import os # get the utils from the parent directory try: from utils import (PCircle, PEllipse) except ImportError: sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from utils import (PCircle, PEllipse) # fix large image error import PIL PIL.I...
mit
-461,592,300,146,957,440
26.904315
80
0.510455
false
3.352795
false
false
false
Team-Zeus/okapi
okapi/rst/directives/headers.py
1
1399
from docutils.nodes import Text from docutils.parsers.rst.directives.body import CodeBlock from okapi.core.exceptions import InvalidHeaderException from okapi.rst.nodes import headers_block from okapi.settings import settings from okapi.core.utils import parse_headers class HeadersDirective(CodeBlock): """ E...
mit
7,307,476,900,900,113,000
24.907407
73
0.631165
false
4.469649
false
false
false
ameya30/IMaX_pole_data_scripts
my_scripts/spa_res_power_ws.py
1
3471
import numpy as np from scipy.fftpack import fft2,fftshift from scipy import signal from astropy.io import fits from matplotlib import pyplot as plt import matplotlib as mpl import itertools from power import PSD2,pspec dum = fits.open("/home/prabhu/sunrise_holly/movie_data/post_demod_tr2_output_22.fits") data = dum...
mit
-4,144,245,166,558,098,000
30.563636
112
0.722558
false
2.674114
false
false
false
laputian/dml
manifold_embedding/MNIST-tsne-distances.py
1
2218
# TSNE-plotting for different distances import gzip import cPickle as pickle import seaborn as sns import numpy as np from sklearn.manifold import TSNE import matplotlib.pyplot as plt import matplotlib.patheffects as PathEffects import sys sys.path.insert(0, '../mlp_test') from data_utils import load_mnist imgp...
mit
-7,178,925,762,184,221,000
28.586667
256
0.647881
false
2.941645
false
false
false
alex3287/PyCharmProjects
project/backup.py
1
1452
#! usr/bin/python3 # программа для создания backups import os, zipfile def backupToZip(folder): """ создает резервную копию всего содержимого папки folder """ folder = os.path.abspath(folder) number = 1 while True: zipFilename = os.path.basename(folder) + '_' + str(number) + '.zip' ...
gpl-3.0
5,778,143,071,282,417,000
29.575
75
0.61897
false
2.495918
false
false
false
mattcaldwell/djangopypi
userpypi/management/commands/ppadd.py
1
4895
""" Management command for adding a package to the repository. Supposed to be the equivelant of calling easy_install, but the install target is the chishop. """ from __future__ import with_statement import os import tempfile import shutil import urllib import pkginfo from django.core.files.base import File from djan...
bsd-3-clause
-4,530,809,269,460,842,000
33.471831
96
0.631052
false
4.308979
false
false
false
itmation/django-getpaid
getpaid/backends/skrill/views.py
1
2311
import logging from django.core.urlresolvers import reverse from django.http import HttpResponse, HttpResponseRedirect from django.views.generic.base import View from django.views.generic.detail import DetailView from getpaid.backends.skrill import PaymentProcessor from getpaid.models import Payment logger = logging.g...
mit
-3,362,541,296,538,580,000
41.018182
160
0.677629
false
4.186594
false
false
false
pioniergarage/launchpad-presence-tracker
client/parser.py
1
2581
import re, datetime from lib import Activity # Pattern for MAC addresses. # Example "B6:B7:E3:AC:D8:09" MAC_PATTERN = r"(([0-9A-Fa-f]{2}[:]){5}([0-9A-Fa-f]{2}))" # Pattern for not associated string. # Example "(not associated) " NOT_ASSOCIATED_PATTERN = r"(\(not associated\) )" # Pattern for MAC addresses or not as...
mit
-7,970,433,548,878,948,000
29.011628
88
0.634638
false
3.001163
false
false
false
law12019/deep_learning
scripts/rasterize_fill_annotation.py
1
6882
# Create a mask from annotation. Uses the same ROI as download region. import sys import os import pdb import girder_client import json import urllib2 import numpy as np import scipy import cv2 import math def ensure_path(dir_path): parent, name = os.path.split(dir_path) if name == '': return e...
apache-2.0
2,603,204,754,400,817,000
27.438017
94
0.567422
false
3.289675
false
false
false