repo_name
stringlengths
5
92
path
stringlengths
4
232
copies
stringclasses
19 values
size
stringlengths
4
7
content
stringlengths
721
1.04M
license
stringclasses
15 values
hash
int64
-9,223,277,421,539,062,000
9,223,102,107B
line_mean
float64
6.51
99.9
line_max
int64
15
997
alpha_frac
float64
0.25
0.97
autogenerated
bool
1 class
tpazderka/pysaml2
src/saml2/server.py
1
27849
#!/usr/bin/env python # -*- coding: utf-8 -*- # """Contains classes and functions that a SAML2.0 Identity provider (IdP) or attribute authority (AA) may use to conclude its tasks. """ import logging import os import importlib import shelve import threading from saml2.eptid import EptidShelve, Eptid from saml2.saml i...
bsd-2-clause
-1,938,614,569,276,447,000
39.774524
113
0.521132
false
zeha/multiapt
extlib/paramiko-1.7.3/paramiko/common.py
1
4059
# Copyright (C) 2003-2007 Robey Pointer <robey@lag.net> # # This file is part of paramiko. # # Paramiko 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 2.1 of the License, or (at your op...
mit
-5,328,580,210,442,775,000
31.214286
80
0.71052
false
richtermondt/inithub-web
inithub/manager/views/interest_manager.py
1
1278
''' @author: rtermondt ''' from django.shortcuts import render_to_response from django.template import RequestContext from manager.models import Interest, Interests from django.contrib.auth.decorators import login_required @login_required() def interest_manager(request): system_message = None if request.POST...
mit
-5,919,080,515,784,932,000
37.727273
69
0.623631
false
compas-dev/compas
src/compas_rhino/conduits/faces.py
1
2740
from __future__ import print_function from __future__ import absolute_import from __future__ import division try: basestring except NameError: basestring = str from System.Drawing.Color import FromArgb from Rhino.Geometry import Point3d from compas.utilities import color_to_rgb from compas_rhino.conduits.bas...
mit
8,426,798,086,672,952,000
28.782609
83
0.605839
false
cym13/anime_verif
anime_verif.py
1
4001
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2013 Cédric Picard # # LICENSE # 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) ...
gpl-3.0
253,679,824,081,122,340
28.62963
79
0.6225
false
hanlind/nova
nova/conf/service_token.py
1
2573
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # d...
apache-2.0
8,061,595,397,624,959,000
37.984848
78
0.720171
false
marrow/schema
test/transform/test_boolean.py
1
1445
from marrow.schema.testing import TransformTest from marrow.schema.transform.type import Boolean, boolean, WebBoolean, web_boolean class TestBooleanNative(TransformTest): transform = boolean.native invalid = ('x', ) @property def valid(self): yield None, None if boolean.none: yield '', None for ...
mit
-1,062,259,557,086,997,800
21.578125
82
0.667128
false
r-owen/TUI
TUI/Models/PermsModel.py
1
1598
#!/usr/bin/env python """A model of the state of the perms actor. It contains instance variables that are KeyVariables or sets of KeyVariables. All are directly associated with status keywords. History: 2003-12-10 ROwen 2003-12-17 ROwen Moved KeyVarFactory to RO.KeyVariable. 2004-05-18 ROwen Eliminated unused t...
bsd-3-clause
-8,059,034,035,777,778,000
26.551724
75
0.602003
false
viacoin/viacoin
test/functional/p2p_segwit.py
1
92836
#!/usr/bin/env python3 # Copyright (c) 2016-2017 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test segwit transactions and blocks on P2P network.""" from test_framework.mininode import * from test...
mit
-2,865,681,629,329,269,000
46.486445
220
0.635939
false
j-be/wien-geodatenviewer-exporter
convert_coordinates.py
1
1134
#!/usr/bin/python2.7 # -*- coding: utf-8 -*- from get_size import getSize import os # Fetch parameters from environment start_major = int(os.environ['__VJ_START_MAJOR__']) start_minor = int(os.environ['__VJ_START_MINOR__']) # Specific do internet data LINE_SHIFT=10 def getNext((major, minor) = (None, None), n = 0):...
mit
1,745,236,984,340,221,200
21.68
66
0.577601
false
UrLab/incubator
events/tests/test_forms.py
1
1547
from events.forms import EventForm from datetime import datetime import pytest from users.models import User @pytest.fixture(scope='function') def user(): user = User.objects.create(username="test", email="test@test.be", first_name="Test", last_name="Test") return user.id @pytest.mark.django_db def test_onl...
agpl-3.0
-8,803,743,879,468,728,000
24.262295
106
0.606749
false
Yipit/pyeqs
tests/functional/test_connection.py
1
1657
# -*- coding: utf-8 -*- from __future__ import unicode_literals from sure import scenario from pyeqs import QuerySet from tests.helpers import prepare_data, cleanup_data, add_document @scenario(prepare_data, cleanup_data) def test_simple_search_with_host_string(context): """ Connect with host string """...
mit
-8,015,881,604,622,951,000
24.106061
66
0.630054
false
projectexpert/pmis
analytic_resource_plan/wizard/resource_plan_line_make_purchase.py
1
6559
# Copyright 2019 LUXIM, Slovenia (Matjaž Mozetič) # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). from odoo import api, fields, models from odoo.tools.translate import _ from odoo.exceptions import ValidationError class ResourcePlanLineMakePurchase(models.TransientModel): _name = "res...
agpl-3.0
8,725,401,470,347,737,000
36.255682
80
0.522648
false
liberatetheweb/blockedinrussia.org
code.py
1
9146
#!/usr/bin/env python # -*- coding: UTF-8 -*- import web, bcrypt, redis, json, requests, dns.resolver, re, M2Crypto, cgi from urlparse import urlsplit from zbase62 import zbase62 web.config.debug = False r_server = redis.Redis('localhost') urls = ( '/', 'index', '/check', 'check', '/logout', 'logout', '/registe...
cc0-1.0
-4,965,741,691,448,358,000
45.746914
533
0.654034
false
tareqalayan/pytest
_pytest/monkeypatch.py
1
9043
""" monkeypatching and mocking functionality. """ from __future__ import absolute_import, division, print_function import os import sys import re import six from _pytest.fixtures import fixture RE_IMPORT_ERROR_NAME = re.compile("^No module named (.*)$") @fixture def monkeypatch(): """The returned ``monkeypatch...
mit
-8,587,276,179,298,903,000
34.050388
108
0.585204
false
mpobrien/see
see.py
1
6339
#!/usr/bin/env python """ see A human alternative to dir(). >>> from see import see >>> help(see) Copyright (c) 2009 Liam Cooke http://inky.github.com/see/ Licensed under the GNU General Public License v3. {{{ This program is free software: you can redistribute it and/or modify it under the terms of the GNU...
gpl-3.0
-980,045,166,100,666,000
25.302905
71
0.485881
false
JASchilz/RoverMUD
simple_universe/attachments/ooc_commands.py
1
1072
from basics import BaseAttachment class OOCComands(BaseAttachment): character = False def __init__(self, character): self.character = character self.action_matrix = [ ["help", self.do_help, "Open the help screen, or receive help on a specific command. \ ...
apache-2.0
-3,326,857,299,222,098,000
33.580645
108
0.583955
false
kushG/osf.io
website/addons/dataverse/views/crud.py
1
13076
# -*- coding: utf-8 -*- import os import httplib import logging import datetime import requests from bs4 import BeautifulSoup from flask import request, make_response from framework.flask import redirect from framework.exceptions import HTTPError from framework.utils import secure_filename from framework.auth.utils ...
apache-2.0
-2,003,208,364,250,141,200
29.268519
89
0.619073
false
SublimeText/PackageDev
plugins/settings/known_settings.py
1
29813
import collections import logging import os import re import textwrap import time import weakref import sublime from sublime_lib import encodings, ResourcePath from ..lib.weakmethod import WeakMethodProxy from ..lib import get_setting from .region_math import VALUE_SCOPE, get_value_region_at, get_last_key_name_from ...
mit
2,889,114,320,144,689,000
37.567917
95
0.55127
false
cbertinato/pandas
pandas/io/excel/_openpyxl.py
1
14098
from pandas.io.excel._base import ExcelWriter from pandas.io.excel._util import _validate_freeze_panes class _OpenpyxlWriter(ExcelWriter): engine = 'openpyxl' supported_extensions = ('.xlsx', '.xlsm') def __init__(self, path, engine=None, mode='w', **engine_kwargs): # Use the openpyxl module as t...
bsd-3-clause
6,980,768,126,160,941,000
30.121413
79
0.474394
false
RRZE-HPC/pycachesim
setup.py
1
4792
#!/usr/bin/env python from __future__ import absolute_import from setuptools.extension import Extension from setuptools import setup, find_packages # Always prefer setuptools over distutils from codecs import open # To use a consistent encoding import os import io import re #import numpy here = os.path.abspath(os....
agpl-3.0
-7,722,935,823,156,337,000
33.228571
91
0.643573
false
yorvic/.vim
bundle/python-mode/pylibs/pylama/checkers/pylint/logilab/common/modutils.py
1
21802
# -*- coding: utf-8 -*- # copyright 2003-2012 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of logilab-common. # # logilab-common is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser Genera...
gpl-3.0
4,864,961,915,379,925,000
32.133739
97
0.622236
false
tanglei528/glance
glance/tests/unit/common/test_property_utils.py
1
23549
# Copyright 2013 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 req...
apache-2.0
1,898,010,542,779,827,200
48.162839
78
0.618115
false
paulorauber/nn
examples/rnn.py
1
2389
import numpy as np from sklearn.utils import check_random_state from nn.model.recurrent import RecurrentNetwork random_state = check_random_state(None) def nback(n, k, length): """Random n-back targets given n, number of digits k and sequence length""" Xi = random_state.randint(k, size=length) yi = np.ze...
mit
-1,148,056,069,909,823,000
26.159091
82
0.537045
false
k4cg/Rezeptionistin
plugins/temperature.py
1
1851
# coding: utf8 import socket import urllib2 import json from plugin import Plugin class Temperature(Plugin): def __init__(self, config=None): try: self.wunderground = config.get('Temperature', 'wunderground') except (ConfigParser.NoSectionError, ConfigParser.NoOptionError): print "Temperature w...
mit
2,988,346,534,183,379,000
33.277778
155
0.666126
false
t-wissmann/qutebrowser
qutebrowser/misc/savemanager.py
1
8427
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2015-2020 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
-2,151,232,016,084,658,700
37.655963
79
0.581939
false
agopalak/football_pred
pre_proc/proc_data.py
1
4667
import sys import yaml import re import datetime as DT import logging from rainbow_logging_handler import RainbowLoggingHandler import pandas as pd import numpy as np from sklearn import preprocessing from sklearn_pandas import DataFrameMapper # Capturing current module. Needed to call getattr on this module this_m...
mit
-8,975,530,814,334,559,000
34.090226
106
0.668738
false
level12/blazeweb
tests/apps/blazewebtestapp/components/tests/views.py
2
5636
from blazeweb.globals import rg from blazeweb.content import getcontent from blazeweb.utils import redirect from blazeweb.views import View, forward, jsonify from werkzeug.exceptions import ServiceUnavailable from formencode.validators import UnicodeString, Int class Rvb(View): def default(self): # this ...
bsd-3-clause
-7,124,047,666,013,751,000
21.634538
79
0.626331
false
jtrebosc/JTutils
TSpy/zeroim3D.py
1
1091
# -*- coding: utf-8 -*- import sys import os PYTHONPATH=os.getenv("PYTHONPATH","not_defined") if "not_defined" in PYTHONPATH: MSG("cannot acces to PYTHONPATH environment. It's required for accessing to brukerPARIO lib" ) EXIT() #add the Library path for importing brukerPARIO sys.path.append(PYTHONPATH) import bruke...
bsd-3-clause
4,196,901,395,096,500,700
22.212766
95
0.692026
false
RoanokeHobby/Robots
CamJamRobot/9-avoidance.py
1
4715
# CamJam EduKit 3 - Robotics # Worksheet 9 – Obstacle Avoidance # Copyright (c) 2016 CamJam-EduKit # The MIT License (MIT) import RPi.GPIO as GPIO # Import the GPIO Library import time # Import the Time library # Set the GPIO modes GPIO.setmode(GPIO.BCM) GPIO.setwarnings(False) # Set variables for the GPIO motor pin...
gpl-3.0
-1,776,289,787,637,158,400
26.723529
68
0.719711
false
sharpbitmessage/PyBitmessage
regenerateaddresses.py
1
8348
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'regenerateaddresses.ui' # # Created: Thu Jan 24 15:52:24 2013 # by: PyQt4 UI code generator 4.9.4 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 ex...
mit
7,812,533,412,955,256,000
71.591304
372
0.750958
false
EmadMokhtar/halaqat
students/forms.py
1
6022
from crispy_forms.helper import FormHelper from crispy_forms.layout import HTML, Div, Layout from django import forms from django.utils.translation import ugettext_lazy as _ from students.models import Student class StudentForm(forms.ModelForm): dob = forms.DateField(widget=forms.DateInput( ...
mit
-5,507,447,061,664,380,000
38.359477
79
0.436898
false
popazerty/test-1
RecordTimer.py
1
39985
import os from enigma import eEPGCache, getBestPlayableServiceReference, \ eServiceReference, iRecordableService, quitMainloop, eActionMap, setPreferredTuner from Components.config import config from Components.UsageConfig import defaultMoviePath from Components.TimerSanityCheck import TimerSanityCheck from Screens....
gpl-2.0
3,353,436,738,029,087,000
34.353669
312
0.68033
false
widdowquinn/pyani
docs/conf.py
1
5946
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # This is a configuration file with no functioning code # pylint: skip-file # # pyani documentation build configuration file, created by # sphinx-quickstart on Fri Aug 11 13:27:32 2017. # # This file is execfile()d with the current directory set to its # containing dir. ...
mit
2,746,442,991,641,905,700
29.492308
84
0.662967
false
nijel/weblate
weblate/trans/validators.py
1
1538
# # Copyright © 2012 - 2021 Michal Čihař <michal@cihar.com> # # This file is part of Weblate <https://weblate.org/> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the Lice...
gpl-3.0
7,707,806,673,100,994,000
31.659574
73
0.685993
false
antonvino/inmoov-basic
hexapod_scripts_base/maestro_lib.py
1
13426
########################################################################################### # Filename: # Device.py ########################################################################################### # Project Authors: # Juhapekka Piiroinen # Brian Wu # # Changes: # June 14, 2010 by Juhapekka Pi...
mit
5,167,666,572,091,440,000
48.725926
165
0.562565
false
mimoralea/king-pong
multicnet.py
1
6980
import tensorflow as tf import cv2 import numpy as np class MultilayerConvolutionalNetwork: """ This class manages the deep neural network that will be used by the agent to learn and extrapolate the state space """ def __init__(self, input_width, input_height, nimages, nchannels): self....
mit
-3,459,783,105,853,825,500
35.544503
89
0.5851
false
wilsonkichoi/zipline
zipline/data/data_portal.py
1
64491
# # Copyright 2016 Quantopian, 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 wr...
apache-2.0
-865,142,654,808,246,400
35.830954
79
0.516025
false
trinitysoulstars/astralturf
lyriscisssor.py
1
2800
import nltk from nltk import FreqDist import json import csv print "* Loading corpus" #raw = gutenberg.raw('melville-moby_dick.txt') #raw = gutenberg.raw('bible-kjv.txt') #raw = gutenberg.raw('tss-lyrics.txt') lines = [] with open("tss-lyrics.txt", 'r') as raw: lines = raw.read() print "* Tokenizing" #tokens =...
agpl-3.0
4,980,310,506,052,259,000
19.588235
85
0.5575
false
abtink/openthread
tests/scripts/thread-cert/border_router/test_multi_thread_networks.py
1
5473
#!/usr/bin/env python3 # # Copyright (c) 2020, The OpenThread Authors. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright # ...
bsd-3-clause
-862,970,403,774,196,600
35.731544
114
0.625069
false
praekelt/django-football365
football365/migrations/0001_initial.py
1
1330
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'Call' db.create_table('football365_call', ( ('id', self.gf('django.db.models.fie...
bsd-3-clause
-9,080,950,197,422,033,000
35.972222
98
0.588722
false
albatrossandco/brubeck_cms
brubeck/articles/views.py
1
4971
# Imports from standard libraries from datetime import date, datetime, time, timedelta # Imports from Django from django.core.paginator import EmptyPage, InvalidPage, Paginator from django.contrib.sites.models import Site from django.http import Http404, HttpResponsePermanentRedirect from django.template import Reques...
bsd-3-clause
8,039,887,085,016,300,000
30.264151
179
0.62241
false
Baz2013/blog_demo
leetcode/easy/pascal_triangle.py
1
1246
# -*- coding:utf-8 -*- # 118. Pascal's Triangle QuestionEditorial Solution My Submissions # Difficulty: Easy # Contributors: Admin # Given numRows, generate the first numRows of Pascal's triangle. # # For example, given numRows = 5, # Return # # [ # [1], # [1,1], # [1,2,1], # [1,3,3,1], # [1,4,6,4,1]...
gpl-3.0
-6,662,119,099,640,546,000
21.25
69
0.460674
false
nevillegrech/stdl
src/STDL/Tests/DependsOnTest.py
1
4539
import unittest import sys sys.path=['..'] + sys.path from Parser import Parser # code from module you're testing from DependsOn import * from Exceptions import * class SimpleTests(unittest.TestCase): def setUp(self): """Call before every test case.""" self.parser = Parser() self...
epl-1.0
-1,733,438,857,289,822,200
32.664122
103
0.54924
false
SukkoPera/Arduino-Sensoria
python/server2.py
1
1152
#!/usr/bin/env python import time import server import argparse DEFAULT_NAME = "Server2" class OutdoorSensor (server.TemperatureSensor): def __init__ (self): super (OutdoorSensor, self).__init__ ("OS", "Outdoor Sensor", "20171127") class OutdoorLight (server.ControlledRelayActuator): def __init__ (self): supe...
gpl-3.0
-1,972,986,873,049,436,200
30.135135
147
0.717014
false
sitigrema/sitigrema.github.io
build.py
1
10927
#!/usr/bin/env python3 import os import shutil import json import yaml from PIL import Image from nxtools import * class GremaProduct(): def __init__(self, parent, title): self.parent = parent self.title = title self.slug = slugify(title) @property def data_dir(self): re...
mit
2,389,932,027,173,189,600
32.314024
129
0.560996
false
openhumanoids/oh-distro
ipab-distro/tests/systemtests/src/exoticaLWR/test.py
1
1072
from director import transformUtils import numpy if ikPlanner.pushToMatlab==True: print "FAILURE - pushing requests to matlab" exit() qT=numpy.array([0, 0, 0, 0, 0, 0, -6.310489698080346e-05, 0.34103086590766907, 3.8130277971504256e-05, 1.4273228645324707, 5.833456089021638e-05, -0.4845042824745178, -3.8867587136...
bsd-3-clause
-6,319,735,205,057,407,000
38.703704
192
0.724813
false
raspberrypi360/python_games
hacker_rank/join_circlesUT.py
1
1942
import unittest import join_circles class Test(unittest.TestCase): def setUp(self): pass def tearDown(self): pass def testStock(self): self.assertEqual(18, join_circles.numCombos([1,2,3,4], 3)) self.assertEqual(180, join_circles.numCombos([1,2,3,4,5], 3)) s, nu...
gpl-2.0
-571,929,680,364,812,200
41.23913
82
0.601957
false
1st1/uvloop
tests/test_base.py
1
25924
import asyncio import fcntl import logging import os import sys import threading import time import uvloop import unittest import weakref from unittest import mock from uvloop._testbase import UVTestCase, AIOTestCase class _TestBase: def test_close(self): self.assertFalse(self.loop._closed) self...
mit
-6,302,800,337,994,056,000
30.965475
78
0.56411
false
django-notifications/django-notifications
notifications/migrations/0001_initial.py
1
2201
# -*- coding: utf-8 -*- from django.db import models, migrations import django.utils.timezone from django.conf import settings import swapper class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('contenttypes', '0001_initial'), ] ...
bsd-3-clause
6,760,268,480,087,502,000
54.025
183
0.614266
false
gsalgado/pyethapp
pyethapp/accounts.py
1
20516
import json import os from random import SystemRandom import shutil from uuid import UUID from devp2p.service import BaseService from ethereum.tools import keys from ethereum.slogging import get_logger from ethereum.utils import privtopub # this is different than the one used in devp2p.crypto from ethereum.utils impo...
mit
-40,519,088,334,624,580
38.152672
99
0.604748
false
mikjo/bigitr
unit_test/daemonconfig_test.py
1
4363
# # Copyright 2012 SAS Institute # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
apache-2.0
3,015,315,161,100,464,600
37.610619
80
0.65047
false
xuru/pyvisdk
pyvisdk/do/host_network_traffic_shaping_policy.py
1
1089
import logging from pyvisdk.exceptions import InvalidArgumentError ######################################## # Automatically generated, do not edit. ######################################## log = logging.getLogger(__name__) def HostNetworkTrafficShapingPolicy(vim, *args, **kwargs): '''This data object type descr...
mit
2,717,627,943,646,971,400
31.058824
124
0.606061
false
oaubert/advene
lib/advene/plugins/tts.py
1
14814
# # Advene: Annotate Digital Videos, Exchange on the NEt # Copyright (C) 2008-2017 Olivier Aubert <contact@olivieraubert.net> # # Advene 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 ...
gpl-2.0
-6,785,914,089,887,248,000
35.220049
208
0.601256
false
d9pouces/StarterPyth
starterpyth/model.py
1
13326
# -*- coding=utf-8 -*- import datetime import os import shutil import subprocess from jinja2 import ChoiceLoader import pkg_resources from six import u from starterpyth.cliforms import BaseForm from starterpyth.utils import binary_path, walk from starterpyth.log import display, GREEN, CYAN, RED from starterpyth.trans...
gpl-2.0
-4,413,395,872,870,266,400
44.640411
120
0.55523
false
algorhythms/LeetCode
652 Find Duplicate Subtrees.py
1
2915
#!/usr/bin/python3 """ Given a binary tree, return all duplicate subtrees. For each kind of duplicate subtrees, you only need to return the root node of any one of them. Two trees are duplicate if they have the same structure with same node values. Example 1: 1 / \ 2 3 / / \ 4 2 ...
mit
6,062,483,486,887,231,000
22.134921
86
0.560549
false
civisanalytics/civis-python
civis/cli/_cli_commands.py
1
11952
#!/usr/bin/env python3 """ Additional commands to add to the CLI beyond the OpenAPI spec. """ from __future__ import print_function import functools import operator import os import sys import time import click import requests import webbrowser import civis from civis.io import file_to_civis, civis_to_file # From ...
bsd-3-clause
2,283,246,677,349,149,700
36.118012
79
0.589525
false
catapult-project/catapult
telemetry/telemetry/internal/backends/chrome/android_browser_finder.py
3
20134
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Finds android browsers that can be started and controlled by telemetry.""" from __future__ import absolute_import import contextlib import logging import...
bsd-3-clause
-6,664,016,816,628,379,000
39.348697
80
0.703387
false
vipulsabhaya/cue
cue/openstack/common/policy.py
1
28680
# Copyright (c) 2012 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
-7,924,507,737,262,820,000
30.038961
78
0.598326
false
chriscauley/django-registration
registration/admin.py
1
1630
from django.contrib import admin, messages from django.contrib.sites.requests import RequestSite from django.contrib.sites.models import Site from django.utils.translation import ugettext_lazy as _ from registration.models import RegistrationProfile class RawMixin(object): def formfield_for_dbfield(self, db_field, ...
bsd-3-clause
-7,230,500,162,756,277,000
37.809524
76
0.722086
false
Azure/azure-sdk-for-python
sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_08_01/operations/_virtual_router_peerings_operations.py
1
22472
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
mit
8,245,060,420,670,271,000
49.498876
220
0.643868
false
mynlp/ccg2lambda
scripts/run_tests.py
1
3569
#!/usr/bin/python3 # -*- coding: utf-8 -*- # # Copyright 2015 Pascual Martinez-Gomez # # 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
-3,486,462,660,503,123,000
59.491525
107
0.804147
false
apache/incubator-allura
ForgeSVN/forgesvn/tests/model/test_repository.py
1
44587
# 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 (t...
apache-2.0
8,255,370,146,006,055,000
38.24912
115
0.538722
false
unioslo/cerebrum
contrib/no/uio/user_per_sko.py
1
20843
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2004 University of Oslo, Norway # # This file is part of Cerebrum. # # Cerebrum 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 t...
gpl-2.0
-8,248,292,858,385,225,000
33.45124
80
0.58101
false
asterisk/testsuite
lib/python/asterisk/pluggable_modules.py
1
38856
"""Generic pluggable modules Copyright (C) 2012, Digium, Inc. Kinsey Moore <kmoore@digium.com> This program is free software, distributed under the terms of the GNU General Public License Version 2. """ import os import sys import logging import shutil import re sys.path.append("lib/python") from .ami import AMIEven...
gpl-2.0
3,161,859,109,901,518,000
39.016478
103
0.587528
false
darrengarvey/procfs-snapshot
parsers/smaps.py
1
3160
from model import MemoryRegion import util import re def parse_smaps_header(header): info = MemoryRegion(free=False) # Example line is: # 011e6000-01239000 rw-p 00000000 00:00 0 [heap] # 8ec00000-8ec01000 rw-s 00000000 00:14 20 /dev/shm/NS2371 (deleted) # All numbers are hex except for the ino...
apache-2.0
-3,556,137,785,705,143,000
31.244898
95
0.575633
false
raygeeknyc/ohgee
visionanalyzer.py
1
19670
#!/usr/bin/python3 import logging # Used only if this is run as main _DEBUG = logging.DEBUG SENTIMENT_CONFIDENCE_THRESHOLD = 0.25 GOOD_SENTIMENT_THRESHOLD = SENTIMENT_CONFIDENCE_THRESHOLD BAD_SENTIMENT_THRESHOLD = -1*SENTIMENT_CONFIDENCE_THRESHOLD # Import the packages we need for drawing and displaying images from ...
gpl-3.0
-6,442,731,910,641,957,000
43.401806
275
0.618607
false
sovaa/backdoorme
backdoors/shell/bash2.py
1
1323
from backdoors.backdoor import * import subprocess import threading class Bash2(Backdoor): prompt = Fore.RED + "(bash) " + Fore.BLUE + ">> " + Fore.RESET def __init__(self, core): cmd.Cmd.__init__(self) self.intro = GOOD + "Using second Bash module..." self.core = core self.opt...
mit
3,782,052,884,608,909,000
41.677419
174
0.589569
false
lem-usp/Bio507
site.py
1
3672
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import unicode_literals # unicode by default import sys import datetime from collections import OrderedDict import pandoc #import bib from flask import Flask from flask import render_template, redirect, url_for from flaskext.babel import Babel from flask...
mit
510,964,192,068,874,800
24.324138
85
0.663399
false
alexandrucoman/vbox-nova-driver
nova/compute/manager.py
1
323194
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # Copyright 2011 Justin Santa Barbara # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance wi...
apache-2.0
-8,592,144,729,025,166,000
45.071846
79
0.559565
false
cubells/l10n-spain
l10n_es_aeat_mod130/models/mod130.py
1
10541
# Copyright 2014-2019 Tecnativa - Pedro M. Baeza from odoo import _, api, fields, exceptions, models def trunc(f, n): slen = len('%.*f' % (n, f)) return float(str(f)[:slen]) class L10nEsAeatMod130Report(models.Model): _description = "AEAT 130 report" _inherit = "l10n.es.aeat.report" _name = "l1...
agpl-3.0
2,714,379,535,093,566,500
42.551867
79
0.550114
false
benvand/alexa-stackoverflow
strings.py
1
1340
"""Strings for Alexa to say""" from settings import SITE_NAME_SPEAKABLE SITE_NAME = SITE_NAME_SPEAKABLE # Breaks BREAK = '<break strength="{strength}">' XS_BREAK = BREAK.format(strength='x-strong') S_BREAK = BREAK.format(strength='strong') # Greet and dismiss WELCOME_REPROMPT = \ """ You can ask {site_name} for an...
mit
671,700,695,409,543,000
37.285714
107
0.723881
false
seewindcn/tortoisehg
src/mercurial/ui.py
1
45732
# ui.py - user interface bits for mercurial # # Copyright 2005-2007 Matt Mackall <mpm@selenic.com> # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. from __future__ import absolute_import import errno import getpass import inspect ...
gpl-2.0
-7,963,893,888,895,642,000
35.209026
80
0.551233
false
valentin-krasontovitsch/ansible
lib/ansible/modules/database/postgresql/postgresql_lang.py
1
11522
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2014, Jens Depuydt <http://www.jensd.be> # 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 ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
3,947,896,331,385,836,000
34.343558
159
0.644506
false
Azure/azure-sdk-for-python
sdk/applicationinsights/azure-applicationinsights/azure/applicationinsights/models/events_user_info_py3.py
1
1277
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
-2,469,813,432,503,886,300
34.472222
108
0.570086
false
iitjee/steppinsPython
SystemProgramming/Parallel System/00 intro.py
1
2190
Most computers spend a lot of time doing nothing. If you start a system monitor tool and watch the CPU utilization, you’ll see what I mean—it’s rare to see one hit 100 percent, even when you are running multiple programs.* There are just too many delays built into software: disk accesses, network traffic, database qu...
gpl-3.0
603,038,853,425,778,400
76.071429
127
0.796571
false
PythonScanClient/PyScanClient
Test/test_commands.py
1
14881
from __future__ import print_function import unittest import xml.etree.ElementTree as ET from scan.commands import * # These tests compare the XML as strings, even though for example # both "<comment><text>Hello</text></comment>" # and "<comment>\n <text>Hello</text>\n</comment>" # would be acceptable XML representat...
epl-1.0
-4,364,419,759,919,992,300
50.670139
346
0.608628
false
GHsimone/LCCS3basicCoder
__init__.py
1
1622
# -*- coding: utf-8 -*- """ /*************************************************************************** LCCS3_BasicCoder A QGIS plugin The plugin loads a LCCS3 legend, creates a form with all LCCS3 classes and allows the user to code selected polygons ---...
gpl-2.0
6,285,856,603,256,372,000
45.342857
117
0.422318
false
davidvon/pipa-pay-server
admin/api/cards.py
1
18567
# -*- coding: utf-8 -*- import datetime import time import traceback from flask import request from flask.ext.restful import Resource from api import API_PREFIX from api.order import create_order from app import restful_api, db, logger from cache.order import cache_qrcode_code, get_cache_order from cache.weixin impor...
apache-2.0
424,458,567,064,073,000
41.844186
119
0.558975
false
StanislavQA/python_task
timeweb2.py
1
2037
# -*- coding: utf-8 -*- from selenium.webdriver.firefox.webdriver import WebDriver import unittest def is_alert_present(wd): try: wd.switch_to_alert().text return True except: return False class timeweb2(unittest.TestCase): def setUp(self): self.wd = WebDriver() sel...
apache-2.0
2,199,998,941,769,938,200
35
104
0.599495
false
Lilykos/inspire-next
inspire/modules/workflows/views/holdingpen_edit.py
1
3372
# -*- coding: utf-8 -*- # # This file is part of INSPIRE. # Copyright (C) 2015 CERN. # # INSPIRE 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
-2,135,099,619,901,420,800
30.222222
87
0.694247
false
FedoraScientific/salome-kernel
src/KERNEL_PY/iparameters.py
1
9144
# -*- coding: iso-8859-1 -*- # Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE # # Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesse...
lgpl-2.1
-3,224,081,632,475,024,400
34.858824
107
0.610127
false
google-research/robel
robel/robot_env.py
1
21356
# Copyright 2019 The ROBEL Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wr...
apache-2.0
211,426,022,284,709,200
37.548736
80
0.594306
false
kingmotley/SickRage
sickbeard/providers/torrentproject.py
1
4736
# coding=utf-8 # Author: Gonçalo M. (aka duramato/supergonkas) <supergonkas@gmail.com> # # URL: https://sickrage.github.io # # This file is part of SickRage. # # SickRage 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 Fo...
gpl-3.0
-4,328,285,688,660,908,500
35.992188
137
0.568321
false
refstudycentre/versification
util.py
1
11774
import numpy as np import unicodecsv import codecs import goslate import sqlite3 from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.metrics.pairwise import linear_kernel def imp_load(filename): texts = [] books = [] chapters = [] verses = [] # Read in a whole bible w...
gpl-2.0
5,110,724,472,901,213,000
28.14604
125
0.590029
false
oesteban/mriqc
mriqc/qc/anatomical.py
1
21553
#!/usr/bin/env python # -*- coding: utf-8 -*- # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: # pylint: disable=no-member r""" Measures based on noise measurements ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. _iqms_cjv: - :py:func:`~mriqc.qc.anatomical.cj...
bsd-3-clause
3,528,858,505,162,906,600
32.726135
97
0.62605
false
eng-tools/sfsimodels
tests/test_interaction.py
1
2586
from sfsimodels import models import sfsimodels as sm import json import numpy as np def test_link_building_and_soil(): number_of_storeys = 6 interstorey_height = 3.4 # m n_bays = 3 fb = models.FrameBuilding(number_of_storeys, n_bays) fb.id = 1 fb.interstorey_heights = interstorey_height * n...
mit
9,039,624,404,153,438,000
27.119565
77
0.650812
false
tensorflow/agents
tf_agents/replay_buffers/replay_buffer.py
1
13019
# coding=utf-8 # Copyright 2020 The TF-Agents 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
apache-2.0
-2,854,422,179,412,945,000
41.545752
117
0.675858
false
edbrannin/Robotframework-SQLAlchemy-Library
src/SQLAlchemyLibrary/__init__.py
1
2769
# Copyright (c) 2010 Franz Allan Valencia See # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
apache-2.0
-1,904,054,005,682,905,600
39.130435
162
0.701697
false
synctree/synctree-awsebcli
ebcli/operations/deployops.py
1
1403
# Copyright 2014 Amazon.com, Inc. or its affiliates. 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. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file accompa...
apache-2.0
9,145,680,478,374,849,000
35.947368
93
0.669993
false
lorisercole/thermocepstrum
thermocepstrum/i_o/read_lammps_dump.py
1
19682
# -*- coding: utf-8 -*- ################################################################################ ### ### ReadLAMMPSDump - v0.1.8 - May 03, 2018 ### ################################################################################ ### ### a package to read LAMMPS Dump files ### (it assumes that the data colu...
gpl-3.0
-2,670,496,408,608,816,000
44.878788
160
0.511381
false
MAECProject/MAECProject.github.io
documentation/idioms/av_classification/maec_av_classification.py
1
1818
# Code for MAEC AV Classification Idiom from maec.package.package import Package from maec.package.malware_subject import MalwareSubject from maec.package.analysis import Analysis from maec.bundle.bundle import Bundle from maec.bundle.av_classification import AVClassification from cybox.core import Object from cybox.ob...
bsd-3-clause
7,595,617,559,653,435,000
32.666667
101
0.79703
false
arthurdarcet/riverrun
riverrun/http/utils.py
1
1593
import bson import cherrypy import functools import json import logging import traceback logger = logging.getLogger(__name__) def json_exposed(fn): @cherrypy.expose @functools.wraps(fn) def wrapper(*args, **kwargs): try: code = 200 value = fn(*args, **kwargs) excep...
mit
6,930,416,923,213,202,000
28.5
91
0.578154
false
khchine5/xl
lino_xl/lib/ledger/mixins.py
1
10913
# -*- coding: UTF-8 -*- # Copyright 2008-2017 Luc Saffre # License: BSD (see file COPYING for details) """Model mixins for `lino_xl.lib.ledger`. .. autosummary:: """ from __future__ import unicode_literals from builtins import str from django.db import models from lino.api import dd, rt, _ from lino.mixins impor...
bsd-2-clause
-9,218,203,295,538,878,000
28.101333
81
0.598461
false
anandpdoshi/frappe
frappe/core/page/data_import_tool/importer.py
1
8937
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe, json import frappe.permissions import frappe.async from frappe import _ from frappe.utils.csvutils import getlink from frappe.utils.dateutils import parse_date ...
mit
5,914,226,990,042,675,000
28.398026
110
0.651449
false
philetus/geosolver
workbench/tree.py
1
7545
from includes import * from parameters import Settings class Tree: def __init__(self, root): self.settings = Settings() self.orientation = self.settings.dvData.treeAlignment self.maxDepth = 100 self.siblingSeperation = 5 self.subtreeSeperation = 5 self.levelSeperation = 40 self.maxLevelHeight = [] sel...
gpl-3.0
-2,403,995,811,492,989,000
28.826087
176
0.705765
false
Belxjander/Kirito
Python-2.3.3-Amiga/Tools/pynche/ChipViewer.py
1
5028
"""Chip viewer and widget. In the lower left corner of the main Pynche window, you will see two ChipWidgets, one for the selected color and one for the nearest color. The selected color is the actual RGB value expressed as an X11 #COLOR name. The nearest color is the named color from the X11 database that is closest ...
gpl-3.0
-1,817,869,015,905,354,800
36.804511
79
0.594073
false
dropbox/dropbox-sdk-dotnet
generator/csproj.py
1
15683
from __future__ import unicode_literals from StringIO import StringIO COMPILE_INCLUDES = [ "Stone\\Decoder.cs", "Stone\\Empty.cs", "Stone\\Encoder.cs", "Stone\\IEncoder.cs", "Stone\\IDecoder.cs", "Stone\\IJsonReader.cs", "Stone\\IJsonWriter.cs", "Stone\\ITransport.cs", "Stone\\Jso...
mit
-3,488,014,230,560,297,000
43.427762
340
0.715106
false
PaulWay/insights-core
insights/parsers/tests/test_rabbitmq_log.py
1
1163
from insights.parsers.rabbitmq_log import RabbitMQStartupLog from insights.parsers.rabbitmq_log import RabbitMQStartupErrLog from insights.tests import context_wrap STARTUP_LOG = """ starting file handle cache server ...done starting worker pool ...
apache-2.0
-3,291,138,868,375,819,000
37.766667
121
0.588134
false
SCP-028/UGA
protein_pka/mcce/mcce.py
1
17127
#!python3 """ Predict protein pKa based on MCCE method. http://pka.engr.ccny.cuny.edu/ Require MCCE 3.0 to work: https://anaconda.org/SalahSalah/mcce/files """ import asyncio import glob import gzip import locale import logging import math import os import re import shutil import subprocess import sys...
apache-2.0
-3,913,487,000,637,415,000
38.11007
166
0.517896
false