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
DedMemez/ODS-August-2017
suit/SuitDNA.py
1
7589
# Fuck you Disyer. Stealing my fucking paypal. GET FUCKED: toontown.suit.SuitDNA from panda3d.core import Datagram, DatagramIterator, VBase4 import random from direct.directnotify.DirectNotifyGlobal import * from toontown.toonbase import TTLocalizer, ToontownGlobals import random from direct.distributed.PyDatagra...
apache-2.0
5,145,229,808,531,475,000
21.501548
90
0.548557
false
2.940333
false
false
false
tswast/google-cloud-python
videointelligence/google/cloud/videointelligence_v1/gapic/video_intelligence_service_client.py
1
14088
# -*- coding: utf-8 -*- # # Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
apache-2.0
-8,513,084,120,351,419,000
45.039216
156
0.626704
false
4.681954
true
false
false
BeeeOn/server
t/restui/t1007-types-list-detail.py
1
10281
#! /usr/bin/env python3 import config config.import_libs() import unittest import socket import json from rest import GET, POST, PUT, DELETE class TestTypesListDetail(unittest.TestCase): """ Create a session for testing. """ def setUp(self): req = POST(config.ui_host, config.ui_port, "/auth") req.body(confi...
bsd-3-clause
227,601,853,684,804,400
32.271845
94
0.654897
false
3.010542
true
false
false
fusionbox/django-darkknight
darkknight/forms.py
1
4549
import re import os from django import forms from django.db import transaction from django.utils.translation import ugettext as _ from django.forms.formsets import BaseFormSet from localflavor.us.us_states import US_STATES from django_countries import countries from OpenSSL import crypto from darkknight.models import...
bsd-2-clause
-862,029,955,554,943,000
31.963768
111
0.591778
false
4.043556
false
false
false
debian789/suescunet
apps/codigos/admin.py
1
1478
from django.contrib import admin from models import mdl_codigos from apps.elementos_comunes.models import mdl_lenguaje,mdl_sistema_operativo from actions import export_as_csv ## crea el listado de opciones en el administrado !!! class codigosAdmin(admin.ModelAdmin): list_display = ('titulo','lenguaje','archivo','i...
gpl-2.0
5,772,595,188,927,756,000
31.152174
85
0.747632
false
2.672694
false
false
false
jeremiah-c-leary/vhdl-style-guide
vsg/tests/sequential/test_rule_006.py
1
1193
import os import unittest from vsg.rules import sequential from vsg import vhdlFile from vsg.tests import utils sTestDir = os.path.dirname(__file__) lFile, eError =vhdlFile.utils.read_vhdlfile(os.path.join(sTestDir,'rule_006_test_input.vhd')) lExpected = [] lExpected.append('') utils.read_file(os.path.join(sTestDi...
gpl-3.0
3,324,378,810,418,496,500
24.934783
106
0.678122
false
3.304709
true
false
false
acjones617/k-means
lib/exec.py
1
1524
import normalize as n import cluster as c import jsonpickle as j import argparse import ast parser = argparse.ArgumentParser() parser.add_argument('matrix') parser.add_argument('options') args = parser.parse_args() matrix = ast.literal_eval(args.matrix) options = ast.literal_eval(args.options) # steps: # 1. norma...
mit
4,464,520,530,550,727,700
24.4
78
0.727034
false
3.544186
false
false
false
mlperf/training_results_v0.7
Google/benchmarks/ssd/implementations/ssd-research-TF-tpu-v4-512/ssd_main.py
1
11062
# Copyright 2018 Google. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
apache-2.0
66,469,063,065,002,300
35.388158
90
0.653679
false
3.437539
false
false
false
openwebcc/ba
maintenance/rawdata/als/hef/071011_hef14_fix_ala.py
1
2755
#!/usr/bin/python # # fix incorrect syntax for echoes in .ala files of 071011_hef14 # import re import os import sys sys.path.append('/home/institut/rawdata/www/lib') from Laser.Util import las if __name__ == '__main__': """ fix incorrect return number and number of returns for given pulse syntax """ import ...
gpl-3.0
-4,989,434,933,116,422,000
33.873418
120
0.536116
false
3.969741
false
false
false
google/retiming
models/networks.py
1
16657
# Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
apache-2.0
2,665,017,518,263,958,500
44.386921
117
0.576514
false
3.506737
false
false
false
samirelanduk/pygtop
pygtop/targets.py
1
14667
"""Contains target-specific objects and functions.""" from . import gtop from . import pdb from .interactions import Interaction, get_interaction_by_id from .exceptions import NoSuchTargetError, NoSuchTargetFamilyError from .shared import DatabaseLink, Gene, strip_html def get_target_by_id(target_id): """Returns ...
mit
6,307,949,579,907,811,000
30.678186
115
0.628281
false
3.83752
false
false
false
easyw/kicad-3d-models-in-freecad
cadquery/FCAD_script_generator/Fuse/main_generator_SMD.py
1
13644
# -*- coding: utf8 -*- #!/usr/bin/python # # This is derived from a cadquery script for generating PDIP models in X3D format # # from https://bitbucket.org/hyOzd/freecad-macros # author hyOzd # This is a # Dimensions are from Microchips Packaging Specification document: # DS00000049BY. Body drawing is the same as QFP g...
gpl-2.0
-5,632,057,004,259,708,000
38.547826
141
0.591469
false
3.632588
false
false
false
kalyptorisk/daversy
src/daversy/db/oracle/index.py
1
3580
from daversy.utils import * from daversy.db.object import Index, IndexColumn class IndexColumnBuilder(object): """ Represents a builder for a column in an index. """ DbClass = IndexColumn XmlTag = 'index-column' Query = """ SELECT c.column_name, lower(c.descend) AS sort, i.index_name, ...
gpl-2.0
1,298,916,235,426,265,300
35.907216
95
0.569832
false
3.824786
false
false
false
patrick91/pycon
backend/notifications/aws.py
1
2184
import typing from urllib.parse import urljoin import boto3 from django.conf import settings from newsletters.exporter import Endpoint from users.models import User def _get_client(): return boto3.client("pinpoint", region_name="eu-central-1") def chunks(l, n): for i in range(0, len(l), n): yield l...
mit
7,613,541,312,755,594,000
27.736842
87
0.642399
false
4.044444
false
false
false
jcushman/pywb
pywb/rewrite/cookie_rewriter.py
1
4929
from Cookie import SimpleCookie, CookieError #================================================================= class WbUrlBaseCookieRewriter(object): """ Base Cookie rewriter for wburl-based requests. """ def __init__(self, url_rewriter): self.url_rewriter = url_rewriter def rewrite(self, co...
gpl-3.0
-1,616,446,436,483,166,000
31.006494
75
0.564212
false
4.526171
false
false
false
colloquium/spacewalk
client/solaris/smartpm/smart/interfaces/gtk/interactive.py
1
31919
# # 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,670,332,782,027,367,000
37.135006
88
0.556534
false
4.217627
false
false
false
qbuat/tauperf
old/eff_tools/DecisionTool.py
1
2103
from ROOT import TMVA from array import array from rootpy.extern import ordereddict import logging log = logging.getLogger('DecisionTool') class DecisionTool: def __init__(self,tree,name,weight_file,var_file,cutval): """ A class to handle the decision of the BDT""" TMVA.Tools.Instance() s...
gpl-3.0
-3,456,458,913,760,876,500
30.863636
67
0.514503
false
4.021033
false
false
false
bioconda/bioconda-utils
bioconda_utils/bot/chat.py
1
5842
""" Chat with the bot via Gitter """ import asyncio import logging from typing import Any, Dict, List import aiohttp from .. import gitter from ..gitter import AioGitterAPI from .commands import command_routes logger = logging.getLogger(__name__) # pylint: disable=invalid-name """ https://webhooks.gitter.im/e/b9e...
mit
7,395,101,836,971,723,000
40.432624
96
0.566587
false
4.181818
false
false
false
reshanie/roblox.py
roblox/asset.py
1
12222
""" Copyright (c) 2017 James Patrick Dill, reshanie Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, ...
mit
-1,756,698,657,007,532,500
28.708543
115
0.58722
false
4.090361
false
false
false
jcsp/manila
manila/tests/scheduler/fakes.py
1
12546
# Copyright 2011 OpenStack LLC. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
apache-2.0
4,470,534,704,318,130,700
48.588933
78
0.492428
false
4.650111
false
false
false
corredD/upy
transformation.py
1
68489
# -*- coding: utf-8 -*- # transformations.py # Copyright (c) 2006-2013, Christoph Gohlke # Copyright (c) 2006-2013, The Regents of the University of California # Produced at the Laboratory for Fluorescence Dynamics # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modifica...
gpl-3.0
-2,078,898,188,954,768,100
33.503778
83
0.578706
false
2.98935
false
false
false
bepress/xavier
xavier/taskqueue.py
1
2517
""" Offline Manager for Xavier """ import logging import jsonpickle logger = logging.getLogger(__name__) class Task(object): def __init__(self, func): self.func = func self.path = '%s.%s' % (func.__name__, func.__module__) self.publish_event = None def __call__(self, *args, **kwargs...
mit
-8,391,339,796,450,315,000
26.064516
98
0.594358
false
4.237374
false
false
false
zestrada/nova-cs498cc
nova/cells/manager.py
1
15722
# Copyright (c) 2012 Rackspace Hosting # 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
-814,845,744,529,827,200
42.551247
78
0.596871
false
4.357539
false
false
false
ShaguptaS/moviepy
moviepy/video/fx/resize.py
1
3276
resize_possible = True try: import cv2 resizer = lambda pic, newsize : cv2.resize(pic.astype('uint8'), tuple(map(int, newsize)), interpolation=cv2.INTER_AREA) except ImportError: try: import Image import numpy as np ...
mit
-3,920,737,535,064,460,300
31.117647
76
0.53083
false
3.995122
false
false
false
BrendanLeber/adventofcode
2016/20-firewall_rules/firewall_rules.py
1
1586
# -*- coding: utf-8 -*- import argparse import pdb import traceback from typing import List, Tuple def test_ip(ip: int, rules: List[Tuple[int, int]], max_addr: int) -> bool: for (start, end) in rules: if start <= ip <= end: break else: if ip < max_addr: return True ...
mit
2,803,982,701,570,625,000
24.580645
100
0.552333
false
3.580135
false
false
false
uwosh/UWOshOIE
tests/testTransitionApproveForFA.py
1
4225
import os, sys if __name__ == '__main__': execfile(os.path.join(sys.path[0], 'framework.py')) from Products.UWOshOIE.tests.uwoshoietestcase import UWOshOIETestCase from Products.CMFCore.WorkflowCore import WorkflowException class TestTransitionApproveForFA(UWOshOIETestCase): """Ensure product is properly inst...
gpl-2.0
7,559,430,899,610,069,000
41.676768
304
0.68213
false
3.648532
true
false
false
dpshelio/sunpy
sunpy/util/net.py
2
6983
""" This module provides general net utility functions. """ import os import re import sys import shutil from unicodedata import normalize from email.parser import FeedParser from urllib.parse import urljoin, urlparse from urllib.request import urlopen from sunpy.util import replacement_filename __all__ = ['slugify',...
bsd-2-clause
134,006,119,759,047,330
28.340336
98
0.622798
false
4.117335
false
false
false
msherry/PyXB-1.1.4
tests/bugs/test-200908271556.py
1
1990
import pyxb_114.binding.generate import pyxb_114.binding.datatypes as xs import pyxb_114.binding.basis import pyxb_114.utils.domutils import gc import os.path xsd='''<?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="instance"> <xs:complexType> ...
apache-2.0
223,691,252,362,142,340
27.028169
89
0.554271
false
3.390119
true
false
false
deuscoin-org/deuscoin-core
qa/rpc-tests/test_framework/authproxy.py
1
6097
""" Copyright 2011 Jeff Garzik AuthServiceProxy has the following improvements over python-jsonrpc's ServiceProxy class: - HTTP connections persist for the life of the AuthServiceProxy object (if server supports HTTP/1.1) - sends protocol 'version', per JSON-RPC 1.1 - sends proper, incrementing 'id' ...
mit
-2,653,445,764,162,595,300
36.176829
105
0.599803
false
4.345688
false
false
false
JasonLai256/plumbca
plumbca/cache.py
1
2429
# -*- coding:utf-8 -*- """ plumbca.cache ~~~~~~~~~~~~~ CacheHandler for the collections control. :copyright: (c) 2015 by Jason Lai. :license: BSD, see LICENSE for more details. """ import asyncio import logging import re import os from .config import DefaultConf from .collection import IncreaseC...
bsd-3-clause
-7,146,317,080,230,869,000
31.386667
80
0.599012
false
3.968954
false
false
false
sdrogers/lda
code/lda_utilities.py
1
14058
import numpy as np import pickle import jsonpickle def match_topics_across_dictionaries(lda1 = None,lda2 = None,file1 = None,file2 = None, same_corpus = True,copy_annotations = False,copy_threshold = 0.5,summary_file = None, new_file2 = None,mass_tol = 5.0): # finds the closest topic matches from lda2 to lda1 if l...
gpl-3.0
7,522,224,093,427,851,000
33.374083
132
0.636862
false
2.75431
false
false
false
our-city-app/oca-backend
src/rogerthat/models/auth/acm.py
1
2211
# -*- coding: utf-8 -*- # Copyright 2020 Green Valley Belgium NV # # 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
6,988,458,327,065,646,000
28.891892
101
0.703754
false
3.438569
false
false
false
cartertech/odoo-hr-ng
hr_report_payroll_attendance_summary/report/attendance_summary.py
1
14914
#-*- coding:utf-8 -*- ############################################################################## # # Copyright (C) 2015 One Click Software (http://oneclick.solutions) # and Copyright (C) 2013 Michael Telahun Makonnen <mmakonnen@gmail.com>. # # This program is free software: you can redistribute it and/or m...
agpl-3.0
-5,935,333,586,226,009,000
42.48105
148
0.495575
false
3.907257
false
false
false
adlius/osf.io
api/providers/urls.py
1
5275
from django.conf.urls import include, url from api.providers import views app_name = 'osf' urlpatterns = [ url( r'^preprints/', include( ( [ url(r'^$', views.PreprintProviderList.as_view(), name=views.PreprintProviderList.view_name), url...
apache-2.0
7,185,396,797,768,840,000
80.153846
202
0.653649
false
4.03596
false
true
false
akraft196/pyASC
examples/mplot1.py
1
7267
#! /usr/bin/env python # # quick and dirty processing of the MD All Sky images from astropy.io import fits import matplotlib.pyplot as plt import matplotlib.image as mpimg from scipy.misc import imsave import numpy as np import aplpy import argparse as ap import os.path import logging import time def d(ff,box=[]):...
mit
8,728,276,588,416,666,000
31.734234
236
0.551534
false
3.260206
false
false
false
wooga/airflow
airflow/providers/google/cloud/operators/natural_language.py
1
10959
# # 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...
apache-2.0
3,930,899,505,662,823,400
40.044944
102
0.686559
false
4.140159
false
false
false
goinnn/django-multiselectfield
example/app/urls.py
1
1723
# -*- coding: utf-8 -*- # Copyright (c) 2013 by Pablo Martín <goinnn@gmail.com> # # This software 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) a...
lgpl-3.0
1,116,952,307,818,030,800
34.875
79
0.639373
false
4.109785
false
false
false
bunnylin/supersakura
translate.py
1
4235
#!/usr/bin/python # CC0, 2017 :: Kirinn Bunnylin / Mooncore # https://creativecommons.org/publicdomain/zero/1.0/ import sys, re, time, subprocess #from subprocess import check_output if len(sys.argv) < 2: print("Usage: python translate.py inputfile.tsv >outputfile.tsv") print("The input file should be a tsv. The ...
gpl-3.0
9,078,087,450,414,523,000
35.508621
79
0.654782
false
3.576858
false
false
false
marcusmchale/breedcafs
app/cypher.py
1
76573
class Cypher: def __init__(self): pass # user procedures allowed_emails = ( ' MATCH ' ' (e: Emails) ' ' RETURN ' ' e.allowed ' ) user_allowed_emails = ( ' MATCH ' ' (u:User) ' ' WITH ' ' COLLECT (DISTINCT u.email) as registered_emails ' ' MATCH ' ' (user:User {' ' username_lower : toLower(...
gpl-3.0
6,791,217,323,624,032,000
29.951091
110
0.525838
false
2.351317
false
false
false
acgtun/acgtun.com
acgtun/leetcode/views.py
1
1338
# -*- coding: utf-8 -*- from __future__ import unicode_literals from __future__ import absolute_import import os import sys from collections import OrderedDict from django.template.loader import render_to_string from django.http import HttpResponse from django.conf import settings from . import db_table from databas...
gpl-2.0
-7,404,087,127,536,536,000
28.733333
116
0.683857
false
3.558511
false
false
false
jdilallo/jdilallo-test
examples/dfp/v201311/label_service/create_labels.py
1
1668
#!/usr/bin/python # # Copyright 2014 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
apache-2.0
-6,635,565,559,352,071,000
28.785714
77
0.681655
false
3.723214
false
false
false
cshinaver/cctools
umbrella/src/umbrella.py
1
188703
#!/usr/bin/env cctools_python # CCTOOLS_PYTHON_VERSION 2.7 2.6 # All the vanilla python package dependencies of Umbrella can be satisfied by Python 2.6. """ Umbrella is a tool for specifying and materializing comprehensive execution environments, from the hardware all the way up to software and data. A user simply in...
gpl-2.0
-3,054,751,530,107,959,000
42.014133
648
0.702808
false
3.167061
false
false
false
leshchevds/ganeti
lib/jqueue/__init__.py
1
52112
# # # Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2014 Google Inc. # 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 copyri...
bsd-2-clause
-2,647,619,656,363,776,500
29.403734
80
0.644055
false
3.897098
false
false
false
tmoer/multimodal_varinf
networks/network_rl.py
1
7832
# -*- coding: utf-8 -*- """ Created on Thu Mar 2 14:48:24 2017 @author: thomas """ #from layers import Latent_Layer import sys import os.path sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))) sys.path.append(os.path.abspath(os.path.dirname(__file__))) import tensorflow as tf import tens...
mit
8,419,598,953,240,772,000
47.652174
154
0.588994
false
3.125299
false
false
false
KaiserAndres/kaiserBot
bot_executables.py
1
4751
import roller import random DEFAULT_CARD_AMOUNT = 1 MAX_CARDS = 15 CARD_SEPARATOR = "||" def ping_exec(irc, message): pong = 'PONG ' + message.text.split(" ")[1] + '\r\n' irc.send(pong.encode("utf-8")) def roll_exec(irc, message): ''' A !roll comand has the following structure: !rol...
mit
-1,279,902,818,268,667,600
29.455128
80
0.53273
false
3.708821
false
false
false
thermokarst/advent-of-code-2015
day20.py
1
2724
# Matthew Ryan Dillon # github.com/thermokarst # # --- Day 20: Infinite Elves and Infinite Houses --- # # To keep the Elves busy, Santa has them deliver some presents by hand, # door-to-door. He sends them down a street with infinite houses numbered # sequentially: 1, 2, 3, 4, 5, and so on. # # Each Elf is assigned a n...
mit
-2,547,104,543,869,876,000
34.842105
82
0.656021
false
3.182243
false
false
false
emmettk/pvrsex
tiff_file_folder_divider.py
1
5268
# -*- coding: utf-8 -*- """ Created on Thu Sep 28 16:14:22 2017 @author: ekrupczak on LaVision Divide tiffs up into subfolders with maximum number of files per folder This allows them to be imported into DaVis which seems unwilling to import more than about 10000 files at a time. Or pull all tiffs from specified fol...
mit
-5,883,737,634,653,318,000
33.664474
113
0.610478
false
2.679552
false
false
false
czcorpus/kontext
lib/bgcalc/csv_cache.py
1
1387
# Copyright (c) 2021 Charles University, Faculty of Arts, # Institute of the Czech National Corpus # Copyright (c) 2021 Tomas Machalek <tomas.machalek@gmail.com> # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as publis...
gpl-2.0
5,040,845,778,632,978,000
32.829268
67
0.618601
false
3.583979
false
false
false
arnavd96/Cinemiezer
myvenv/lib/python3.4/site-packages/music21/demos/smt2011.py
1
5140
# -*- coding: utf-8 -*- #------------------------------------------------------------------------------- # Name: smt2011.py # Purpose: Demonstrations for the SMT 2011 demo # # Authors: Christopher Ariza # Michael Scott Cuthbert # # Copyright: Copyright © 2011 Michael Scott Cuthbert an...
mit
-2,055,209,700,920,989,400
30.527607
87
0.590971
false
3.616467
false
false
false
jaeddy/bripipetools
bripipetools/dbification/flowcellrun.py
1
8314
""" Class for importing data from a sequencing run into GenLIMS and the Research DB as new objects. """ import logging import os import re from .. import parsing from .. import database from .. import annotation logger = logging.getLogger(__name__) class FlowcellRunImporter(object): """ Collects FlowcellRu...
mit
3,064,618,017,734,528,000
39.955665
82
0.595141
false
4.294421
false
false
false
hidashun/django-typed-models
typedmodels/tests.py
1
8182
from django.utils import unittest try: import yaml # NOQA PYYAML_AVAILABLE = True except ImportError: PYYAML_AVAILABLE = False from django.core import serializers from django.test import TestCase from django.db.models.query_utils import DeferredAttribute from .test_models import AngryBigCat, Animal, BigC...
bsd-3-clause
-235,403,817,046,583,680
43.467391
189
0.666585
false
3.466949
true
false
false
Zogg/Tiltai
tiltai/sdn/docker.py
1
1700
from tiltai.utils import tiltai_logs_format import socket from logbook import Logger, StderrHandler err = StderrHandler(format_string=tiltai_logs_format) log = Logger("sdn[docker]") def dockersdn(queue_name, resolver, storage): """ Get addresses and type of the socket from within docker container. A hostnam...
gpl-3.0
-5,203,554,288,579,424,000
29.357143
94
0.63
false
4.228856
false
false
false
AdamsLee/mongo-connector
mongo_connector/connector.py
1
31437
# Copyright 2013-2014 MongoDB, 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 writing...
apache-2.0
-3,153,926,013,907,341,300
42.967832
85
0.533193
false
4.748074
true
false
false
v4hn/ecto
test/scripts/test_tendrils.py
1
2868
#!/usr/bin/env python # # Copyright (c) 2011, Willow Garage, Inc. # 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 # n...
bsd-3-clause
3,189,837,938,713,107,000
31.590909
77
0.656206
false
3.681643
false
false
false
lazuxd/teste-admitere-snpap
slidingpanel.py
1
3425
# -*- coding: utf-8 -*- from kivy.animation import Animation from kivy.clock import Clock from kivy.core.window import Window from kivy.lang import Builder from kivy.metrics import dp from kivy.properties import OptionProperty, NumericProperty, StringProperty, \ BooleanProperty, ListProperty from kivy.uix.boxlayout...
mit
-6,720,822,278,794,531,000
35.827957
90
0.574015
false
3.767877
false
false
false
sophilabs/py101
py101/lists/__init__.py
1
1763
"""" Introduction Adventure Author: Ignacio Avas (iavas@sophilabs.com) """ import codecs import io import sys import unittest from story.adventures import AdventureVerificationError, BaseAdventure from story.translation import gettext as _ class TestOutput(unittest.TestCase): """Variables Adventure test""" d...
mit
1,598,433,818,799,941,000
29.396552
79
0.601815
false
4.177725
true
false
false
ZeitOnline/zeit.push
src/zeit/push/browser/mobile.py
1
1348
from zope.cachedescriptors.property import Lazy as cachedproperty import logging import sys import zeit.push.interfaces import zope.security.proxy log = logging.getLogger(__name__) class FindTitle(object): def __call__(self): name = self.request.form.get('q') if not name: return '' ...
bsd-3-clause
2,564,557,959,152,968,000
27.083333
71
0.626855
false
4.084848
false
false
false
grafgustav/accessmail
src/Service/ImapReceiver.py
1
1024
__author__ = 'phillip' from .MailReceiver import MailReceiver import poplib class IMAPReceiver(MailReceiver): def __init__(self, config): self._conn = None def connect(self, config): self._server = poplib.POP3_SSL() self._server.apop() def delete_mail(self, n): self._se...
mit
-1,807,214,119,877,362,200
18.711538
41
0.584961
false
3.605634
false
false
false
kurennon/misc-tools
find_validator/find_validator.py
1
1259
#!/usr/bin/env python3 DIG_CHARS = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ" def find_validator(dig_string, old_base): dig_sum = sum_digits(dig_string, old_base) return dig_sum[-1:].upper() def sum_digits(dig_string, old_base): int_sum = 0 while dig_string: int_sum += int(dig_string[:1], base=...
gpl-3.0
3,645,768,671,179,305,500
36.029412
96
0.590151
false
3.375335
false
false
false
yggi49/wtforms-polyglot
wtf_polyglot/meta.py
1
2876
from __future__ import unicode_literals try: from html import escape from html.parser import HTMLParser except ImportError: from cgi import escape from HTMLParser import HTMLParser from wtforms.meta import DefaultMeta from wtforms.widgets.core import HTMLString class PolyglotHTMLParser(HTMLParser): ...
bsd-3-clause
-4,385,307,373,991,363,000
31.681818
78
0.631085
false
4.050704
false
false
false
torchingloom/edx-platform
common/lib/xmodule/xmodule/master_class_module.py
1
15766
# -*- coding: utf-8 -*- """Word cloud is ungraded xblock used by students to generate and view word cloud. On the client side we show: If student does not yet answered - `num_inputs` numbers of text inputs. If student have answered - words he entered and cloud. """ import json import logging import datetime import cs...
agpl-3.0
-7,321,570,871,203,777,000
39.703125
195
0.540179
false
4.418999
false
false
false
googleapis/googleapis-gen
google/cloud/aiplatform/v1/aiplatform-v1-py/google/cloud/aiplatform_v1/services/pipeline_service/transports/grpc_asyncio.py
1
18872
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
apache-2.0
227,159,472,070,711,040
46.417085
109
0.632524
false
4.751259
false
false
false
puttarajubr/commcare-hq
custom/ilsgateway/tests/test_locations_sync.py
1
4004
from datetime import datetime import json import os from django.test import TestCase from corehq.apps.commtrack.models import CommtrackConfig from corehq.apps.commtrack.tests.util import bootstrap_domain as initial_bootstrap from corehq.apps.locations.models import Location, SQLLocation from custom.ilsgateway.api impor...
bsd-3-clause
6,287,786,364,255,786,000
47.829268
102
0.709041
false
3.894942
true
false
false
davidvg/google_api
google_api/gmail_api.py
1
13120
''' Basic Python3 implementation of some functionality of the Gmail API. Based on the code from the Gmail API documentation. Requires a 'secret file' to allow authentication (see [1]) Installation ----------- In Python3, install the API using pip3: pip3 install --upgrade google-api-python-client Install packages...
mit
-5,331,380,682,368,593,000
32.384224
88
0.509604
false
4.462585
false
false
false
Lax/Packages
ganglia-gmond-modules-python-plugins/usr/lib64/ganglia/python_modules/sockstat.py
1
2803
# sockstat module for ganglia 3.1.x and above # Copyright (C) Wang Jian <lark@linux.net.cn>, 2009 import os, sys import time last_poll_time = 0 sockstats = { 'tcp_total': 0, 'tcp_established': 0, 'tcp_orphan': 0, 'tcp_timewait': 0, 'udp_total': 0 } def metric_update(): global sockstats f...
gpl-3.0
-1,002,256,754,032,724,500
23.163793
79
0.49447
false
3.393462
false
false
false
paolomonella/ursus
xmlToolBox/minidomToolBox.py
1
7687
#! /usr/bin/env python # This is a toolbox I'm using to look for specific things in the XML DOM ################## # Import modules # ################## from __future__ import print_function from xml.dom.minidom import parse, parseString #import xml.dom.minidom ################# # Parse the XML # ################# ...
gpl-2.0
6,549,222,712,097,434,000
38.420513
120
0.552751
false
3.894124
false
false
false
niallrmurphy/pyvern
test_tree.py
1
20890
#!/usr/bin/env python # encoding: utf-8 # Niall Richard Murphy <niallm@gmail.com> """Test the tree (gap-production) object.""" import sys import constants import random import tree # Perhaps unittest2 is available. Try to import it, for # those cases where we are running python 2.7. try: import unittest2 as unitt...
apache-2.0
-4,469,209,220,088,208,400
34.709402
94
0.613787
false
2.750132
true
false
false
kmahyyg/learn_py3
antiscanhttp.py
1
2192
#!/usr/bin/env python3 # -*- coding : utf-8 -*- # http://speedtest.tele2.net/10GB.zip # https://docs.python.org/3/library/http.server.html # http://blog.csdn.net/cteng/article/details/51584766 """ Anti-HTTP-Scanner : Redirect all requests to 10GB speedtest file Patrick Young 2017/10/8 usage: "antiscanhttp.py" [-h] [-...
agpl-3.0
8,516,625,122,009,231,000
31.235294
113
0.649635
false
3.564228
false
false
false
brendanlong/dash-ts-tools
dash_initialization_segmenter.py
1
4159
#!/usr/bin/env python3 import argparse import os from ts import * def write_ts(file_name, packets, force): logging.info("Writing %s", file_name) if not force and os.path.exists(file_name): choice = input( "Output file {} already exists. Overwrite it? " "[y/N] ".format(file_na...
bsd-2-clause
-5,032,914,013,594,060,000
40.178218
80
0.5434
false
4.19254
false
false
false
MarcoVogt/basil
tests/test_RegisterHardwareLayer.py
1
9389
# # ------------------------------------------------------------ # Copyright (c) All rights reserved # SiLab, Institute of Physics, University of Bonn # ------------------------------------------------------------ # import unittest from basil.dut import Dut from basil.HL.RegisterHardwareLayer import Registe...
bsd-3-clause
-6,639,450,954,130,615,000
45.180905
163
0.575248
false
3.235355
true
false
false
mistercrunch/panoramix
superset/reports/api.py
2
14710
# 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 u...
apache-2.0
-7,320,515,751,932,594,000
32.205418
85
0.560639
false
4.497096
false
false
false
adieu/django-invitation
invitation/models.py
1
6880
import os import random import datetime from django.db import models from django.conf import settings from django.utils.http import int_to_base36 from django.utils.hashcompat import sha_constructor from django.utils.translation import ugettext_lazy as _ from django.contrib.auth.models import User from django.core.mail ...
bsd-3-clause
-6,604,925,912,574,837,000
37.435754
100
0.636628
false
4.075829
false
false
false
drssoccer55/RLBot
src/main/python/rlbot/utils/structures/rigid_body_struct.py
1
1072
import ctypes from rlbot.utils.structures.bot_input_struct import PlayerInput from rlbot.utils.structures.game_data_struct import Vector3 from rlbot.utils.structures.start_match_structures import MAX_PLAYERS class Quaternion(ctypes.Structure): _fields_ = [("x", ctypes.c_float), ("y", ctypes.c_flo...
mit
-2,333,322,161,590,240,000
29.628571
69
0.609142
false
3.658703
false
false
false
jepler/linuxcnc-mirror
src/emc/usr_intf/pncconf/pncconf.py
1
292409
#!/usr/bin/env python # -*- encoding: utf-8 -*- # This is pncconf, a graphical configuration editor for LinuxCNC # Chris Morley copyright 2009 # This is based from stepconf, a graphical configuration editor for linuxcnc # Copyright 2007 Jeff Epler <jepler@unpythonic.net> # # This program is free software...
lgpl-2.1
-1,847,330,764,788,389,000
54.005267
192
0.527267
false
3.77671
false
false
false
HaebinShin/tensorflow
tensorflow/python/ops/nn_ops.py
1
56530
# 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
5,910,611,416,458,937,000
41.535741
92
0.660375
false
3.586929
false
false
false
joseguerrero/sembrando
src/presentacion/paginas/pantalla9.py
1
30062
#!/usr/bin/env python # -*- coding: utf-8 -*- import pygame from librerias import pantalla from librerias.boton import boton from librerias.texto import texto from librerias.popups import PopUp from librerias.imagen import imagen from librerias.contenido import cont from librerias.imgfondo import fondo from librerias.p...
gpl-3.0
7,081,254,828,094,702,000
58.114173
189
0.497036
false
3.289877
true
false
false
barct/odoo-coop
infocoop_epec_consumos/tab_fact.py
1
5194
# -*- coding: utf-8 -*- ############################################################################## # For copyright and license notices, see __openerp__.py file in module root # directory ############################################################################## from openerp import models, fields, api from opene...
gpl-3.0
-7,498,251,093,839,075,000
33.85906
78
0.426646
false
3.799561
false
false
false
ufal/ker
server.py
1
9594
#!/usr/bin/env python import flask from flask import Flask from flask import request from werkzeug import secure_filename import os, random, datetime, codecs import sys, json, magic import cPickle as pickle import regex as re import keywords import argparse import xml.etree.ElementTree import zipfile app = Flask(__na...
lgpl-3.0
3,862,969,899,623,233,500
34.142857
126
0.603294
false
3.533702
false
false
false
Juanlu001/CBC.Solve
cbc/swing/fsinewton/solver/boundary_conditions.py
1
4016
"""Module containing implementation of monolithic FSI boundary conditions""" __author__ = "Gabriel Balaban" __copyright__ = "Copyright (C) 2010 Simula Research Laboratory and %s" % __author__ __license__ = "GNU GPL Version 3 or any later version" from dolfin import * class FSIBC(object): """ Boundary Conditi...
gpl-3.0
-6,300,717,971,602,277,000
43.131868
101
0.608317
false
3.960552
false
false
false
timopulkkinen/BubbleFish
tools/telemetry/telemetry/core/chrome/win_platform_backend.py
1
3723
# Copyright (c) 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import ctypes import subprocess try: import win32api # pylint: disable=F0401 import win32con # pylint: disable=F0401 import win32process # pylin...
bsd-3-clause
2,244,057,969,717,524,000
36.606061
77
0.640612
false
3.964856
false
false
false
Jajcus/pyxmpp2
pyxmpp2/mainloop/wait.py
1
2125
# # (C) Copyright 2011 Jacek Konieczny <jajcus@jajcus.net> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License Version # 2.1 as published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful...
lgpl-2.1
-7,421,785,645,248,673,000
35.637931
77
0.660235
false
3.994361
false
false
false
kamitchell/py2app
py2app/filters.py
1
1048
from pkg_resources import require require("macholib") import os import sys from macholib.util import has_filename_filter, in_system_path def not_stdlib_filter(module, prefix=None): """ Return False if the module is located in the standard library """ if prefix is None: prefix = sys.prefix ...
mit
183,278,461,600,789,730
27.324324
67
0.645992
false
3.969697
false
false
false
tuukka/sonata-svn-test
sonata/plugins/test.py
1
2113
# this is the magic interpreted by Sonata, referring to on_enable etc. below: ### BEGIN PLUGIN INFO # [plugin] # plugin_format: 0, 0 # name: Test plugin # version: 0, 0, 1 # description: A simple test plugin. # author: Tuukka Hastrup # author_email: Tuukka.Hastrup@iki.fi # url: http://sonata.berlios.de # license: GPL...
gpl-3.0
4,461,166,768,552,095,000
27.554054
77
0.705632
false
2.984463
false
false
false
datacommonsorg/data
scripts/us_bjs/nps/preprocess_data.py
1
19122
import pandas as pd from absl import flags from absl import app FLAGS = flags.FLAGS flags.DEFINE_string('preprocess_file', 'NPS_1978-2018_Data.tsv', 'file path to tsv file with data to proess', short_name='p') def convert_nan_for_calculation(value): if ...
apache-2.0
8,942,910,421,515,007,000
45.867647
174
0.653488
false
2.993425
false
false
false
scotwk/cloud-custodian
tools/zerodark/zerodark/ipdb.py
1
24394
# Copyright 2017-2018 Capital One Services, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed ...
apache-2.0
-6,660,086,870,212,036,000
33.309423
100
0.540051
false
4.058902
true
false
false
jjdmol/LOFAR
LTA/LTAIngest/dav/webdav/acp/Acl.py
1
10978
# pylint: disable-msg=W0622 # # Copyright 2008 German Aerospace Center (DLR) # # 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 requ...
gpl-3.0
5,891,104,285,362,545,000
34.299035
118
0.55092
false
4.081041
false
false
false
thundernet8/WRGameVideos-API
venv/lib/python2.7/site-packages/flask_jsonpify.py
1
2543
from flask import current_app, json, request def __pad(strdata): """ Pads `strdata` with a Request's callback argument, if specified, or does nothing. """ if request.args.get('callback'): return "%s(%s);" % (request.args.get('callback'), strdata) else: return strdata ...
gpl-2.0
-717,886,847,209,968,100
29.395062
80
0.583956
false
4.231281
false
false
false
taoliu/taolib
Scripts/ce_histone_matrix.py
1
17749
#!/usr/bin/env python # Time-stamp: <2010-09-08 02:38:38 Tao Liu> """Module Description Copyright (c) 2008 Tao Liu <taoliu@jimmy.harvard.edu> This code is free software; you can redistribute it and/or modify it under the terms of the BSD License (see the file COPYING included with the distribution). @status: exper...
bsd-3-clause
-3,209,012,394,225,596,000
38.267699
610
0.57423
false
3.391745
false
false
false
antechrestos/cf-python-client
main/cloudfoundry_client/v2/service_brokers.py
1
1120
from cloudfoundry_client.v2.entities import EntityManager class ServiceBrokerManager(EntityManager): def __init__(self, target_endpoint, client): super(ServiceBrokerManager, self).__init__(target_endpoint, client, '/v2/service_brokers') def create(self, broker_url, broker_name, auth_username, auth_pa...
apache-2.0
-4,444,524,997,635,367,400
47.695652
109
0.68125
false
3.971631
false
false
false
Comunitea/CMNT_004_15
project-addons/custom_account/models/payment.py
1
3019
# Copyright 2019 Omar Castiñeira, Comunitea Servicios Tecnológicos S.L. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from odoo import models, fields, api class PaymentOrderLine(models.Model): _inherit = 'account.payment.line' _order = 'partner_name' partner_name = fields.Char(relate...
agpl-3.0
-3,272,857,600,221,413,000
44.712121
79
0.46006
false
4.196106
false
false
false
project-owner/Peppy
ui/container.py
1
6297
# Copyright 2016-2021 Peppy Player peppy.player@gmail.com # # This file is part of Peppy Player. # # Peppy Player 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 you...
gpl-3.0
-7,975,863,792,035,716,000
31.626943
114
0.570907
false
4.623348
false
false
false
ooici/marine-integrations
mi/dataset/driver/hypm/ctd/driver.py
1
1597
""" @package mi.dataset.driver.hypm.ctd.driver @file marine-integrations/mi/dataset/driver/hypm/ctd/driver.py @author Bill French @brief Driver for the hypm/ctd Release notes: initial release """ __author__ = 'Bill French' __license__ = 'Apache 2.0' from mi.core.log import get_logger ; log = get_logger() from mi.da...
bsd-2-clause
1,017,401,072,070,529,700
27.017544
62
0.639324
false
3.802381
true
false
false
cmunk/protwis
api/views.py
1
32974
from django.shortcuts import render from rest_framework import views, generics, viewsets from rest_framework.response import Response from rest_framework.parsers import MultiPartParser, FormParser, FileUploadParser from rest_framework.renderers import JSONRenderer from django.template.loader import render_to_string fro...
apache-2.0
-7,819,170,572,501,628,000
38.48982
175
0.611724
false
4.041922
false
false
false
Djabx/mgd
mgdpck/writters/cbz.py
1
1116
#! /usr/bin/python # -*- coding: utf-8 -*- ''' A cbz writter ''' from mgdpck import actions import os import mimetypes import zipfile class CbzWritter(actions.AbsWritter): @classmethod def get_name(cls): return 'cbz' def __init__(self, outdir): self.outdir = outdir self.out = None def done(se...
apache-2.0
603,414,583,288,958,700
21.32
134
0.654122
false
2.883721
false
false
false
RicardoJohann/frappe
frappe/utils/goal.py
1
4641
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe import _ from six.moves import xrange def get_monthly_results(goal_doctype, goal_field, date_col, filter_str, aggregation = '...
mit
6,556,498,908,767,743,000
29.333333
112
0.676578
false
3.023453
false
false
false
nmarincic/numbasom
numbasom/numbasom.py
1
8667
from numba import jit import numpy as np import math import collections from timeit import default_timer as timer @jit(nopython=True) def normalize(data, min_val=0, max_val=1): no_vectors, dim = data.shape D = np.empty((no_vectors,dim), dtype=np.float64) inf = 1.7976931348623157e+308 min_arr = np.empty(dim, dtype...
mit
1,146,145,510,830,641,200
22.81044
88
0.621207
false
2.410178
false
false
false
Buchhold/QLever
misc/move_language_into_relation.py
1
1046
import argparse import sys __author__ = 'buchholb' parser = argparse.ArgumentParser() parser.add_argument('--nt', type=str, help='n-triple file.', required=True) def writeNtFileToStdout(nt): for line in open(nt): cols = line.strip('\n').split(...
apache-2.0
8,025,750,356,437,480,000
26.526316
75
0.448375
false
3.521886
false
false
false
google-research/language
language/xsp/model/constants.py
1
1574
# coding=utf-8 # Copyright 2018 The Google AI Language Team 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 ...
apache-2.0
-5,873,433,957,893,586,000
30.48
74
0.747776
false
3.238683
false
false
false
cangermueller/deepcpg
deepcpg/data/dna.py
1
2502
"""Functions for representing DNA sequences.""" from __future__ import division from __future__ import print_function from collections import OrderedDict import numpy as np from six.moves import range # Mapping of nucleotides to integers CHAR_TO_INT = OrderedDict([('A', 0), ('T', 1), ('G', 2), ('C', 3), ('N', 4)]) ...
mit
-3,484,228,904,838,836,700
22.383178
79
0.583933
false
3.460581
false
false
false
pynamodb/PynamoDB
tests/test_discriminator.py
1
6828
import pytest from pynamodb.attributes import DiscriminatorAttribute from pynamodb.attributes import DynamicMapAttribute from pynamodb.attributes import ListAttribute from pynamodb.attributes import MapAttribute from pynamodb.attributes import NumberAttribute from pynamodb.attributes import UnicodeAttribute from pynam...
mit
-3,047,368,666,517,998,000
33.836735
105
0.57645
false
3.776549
true
false
false