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
Jumpscale/core9
JumpScale9/clients/tarantool/templates/python/model.py
1
3184
from js9 import j import os import capnp # import msgpack import base64 ModelBaseCollection = j.data.capnp.getModelBaseClassCollection() ModelBase = j.data.capnp.getModelBaseClass() # from JumpScale9.clients.tarantool.KVSInterface import KVSTarantool class $NameModel(ModelBase): ''' ''' def __init__(sel...
apache-2.0
-5,462,478,332,331,678,000
35.181818
141
0.618719
false
t3dev/odoo
addons/purchase_requisition/tests/test_purchase_requisition.py
1
5253
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo.addons.purchase_requisition.tests.common import TestPurchaseRequisitionCommon class TestPurchaseRequisition(TestPurchaseRequisitionCommon): def test_00_purchase_requisition_users(self): self.asse...
gpl-3.0
5,065,559,259,893,772,000
44.678261
156
0.617742
false
dann/python-classpluggable
setup.py
1
1506
import os import sys from setuptools import setup, find_packages if sys.version_info[:2] < (2, 6): raise RuntimeError('Requires Python 2.6 or better') here = os.path.abspath(os.path.dirname(__file__)) try: README = open(os.path.join(here, 'README.rst')).read() CHANGES = open(os.path.join(here, 'CHANGES.r...
bsd-3-clause
6,244,364,089,358,640,000
27.980769
70
0.605578
false
timpalpant/KaggleTSTextClassification
scripts/practice/predict.6.py
1
3211
#!/usr/bin/env python ''' Make predictions for the test data 6. Use logistic regression ''' import argparse, multiprocessing from common import * from sklearn.linear_model import LogisticRegression from sklearn.preprocessing import OneHotEncoder, StandardScaler def prepare_features(data, enc=None, scaler=None): ...
gpl-3.0
6,292,408,263,200,130,000
31.765306
79
0.623482
false
Onager/l2tdevtools
l2tdevtools/dependency_writers/dpkg.py
1
4671
# -*- coding: utf-8 -*- """Writer for Debian packaging (dpkg) files.""" from __future__ import unicode_literals import io import os from l2tdevtools.dependency_writers import interface class DPKGCompatWriter(interface.DependencyFileWriter): """Dpkg compat file writer.""" PATH = os.path.join('config', 'dpkg', ...
apache-2.0
-5,977,090,796,422,307,000
30.348993
75
0.627917
false
redhat-cip/dci-control-server
tests/api/v1/test_jobs_update.py
1
1718
# -*- coding: utf-8 -*- # # Copyright (C) 2015-2016 Red Hat, 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 applicab...
apache-2.0
-6,182,659,063,903,803,000
39.904762
77
0.658324
false
pli3/enigma2-git
lib/python/Tools/Directories.py
1
8559
# -*- coding: utf-8 -*- import os from os import mkdir, rmdir, system, walk, stat as os_stat, listdir, readlink, makedirs, error as os_error, symlink, access, F_OK, R_OK, W_OK from stat import S_IMODE from re import compile from enigma import eEnv try: from os import chmod have_chmod = True except: have_chmod = Fal...
gpl-2.0
5,339,323,723,015,453,000
25.915094
141
0.667718
false
fossfreedom/alternative-toolbar
alttoolbar_sidebar.py
1
22724
# -*- Mode: python; coding: utf-8; tab-width: 4; indent-tabs-mode: nil; -*- # # Copyright (C) 2015 - 2020 David Mohammed <fossfreedom@ubuntu.com> # # 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...
gpl-3.0
-7,948,833,192,442,559,000
34.673469
97
0.573271
false
ebt-hpc/cca
cca/scripts/outlining_queries_fortran.py
1
19126
#!/usr/bin/env python3 ''' A script for outlining Fortran programs Copyright 2013-2018 RIKEN Copyright 2018-2019 Chiba Institute of Technology 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 Lice...
apache-2.0
-5,018,884,159,477,743,000
23.583548
100
0.536547
false
kpbochenek/empireofcode
non_unique.py
1
1121
# kpbochenek@gmail.com def non_unique(data): result = [] diff = 32 for d in data: if data.count(d) > 1: result.append(d) elif type(d) is str and data.count(d) + data.count(chr(ord(d) + diff)) > 1: result.append(d) elif type(d) is str and data.count(d) + data....
apache-2.0
-4,089,713,566,800,570,000
39.035714
97
0.484389
false
cloud9ers/j25framework
j25/loaders/reloader.py
1
5047
# Python Module Reloader # # Copyright (c) 2009, 2010 Jon Parise <jon@indelible.org> # # 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 ri...
lgpl-3.0
8,412,264,403,082,464,000
33.813793
99
0.607886
false
dskinner/damsel-python
dmsl/test/test_basic.py
1
2247
# -*- coding: utf-8 -*- import os.path import unittest from _parse import Template import codecs class TestBasic(unittest.TestCase): def setUp(self): self.t = { 'basic_ending_colon': None, 'basic_html': None, 'basic_indent': None, 'basic_inline': None, ...
mit
6,373,065,993,716,862,000
33.045455
58
0.58389
false
arrti/proxypooler
tests/test_pooler.py
1
7492
import asyncio import os import signal import ssl from multiprocessing import Process from random import randint from time import sleep from unittest.mock import Mock import aiohttp import pytest import requests from proxypooler import config from proxypooler.pooler import ProxyPooler from proxypooler.ext import ser...
apache-2.0
-9,551,087,619,412,100
29.958678
105
0.557528
false
sxjscience/tvm
python/tvm/topi/nn/dilate.py
1
2528
# 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
205,081,130,815,146,940
34.111111
99
0.645174
false
googleapis/python-talent
google/cloud/talent_v4beta1/services/tenant_service/transports/base.py
1
9841
# -*- 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
7,331,914,839,858,532,000
36.418251
103
0.603292
false
enrimatta/RU_Python_IV
labs/lab_objects.py
1
1675
#!/usr/bin/env python # *-* coding:utf-8 *-* """ :mod:`lab_objects` -- Objects in Python ========================================= LAB Objects Learning Objective: Explore objects in Python and how everything in Python is an object. a. Fill in the series of functions below that determ...
gpl-2.0
3,440,704,479,022,479,000
26.016129
95
0.588657
false
mwilliamson/zuice
tests/test_injector.py
1
12416
from nose.tools import assert_equal from nose.tools import assert_raises import zuice from zuice import Bindings from zuice import Injector from zuice import NoSuchBindingException from zuice import dependency from zuice import Base class Apple(object): pass default_apple = Apple() class Banana(object):...
bsd-2-clause
-4,687,835,895,482,636,000
29.808933
105
0.622181
false
nesaro/driza
pyrqt/carga/operaciones/anova.py
1
3082
#!/usr/bin/python # -*- coding: utf-8 -*- #Copyright (C) 2006-2008 Inmaculada Luengo Merino, Néstor Arocha Rodríguez #This file is part of pyrqt. # #pyrqt 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; eithe...
gpl-2.0
3,244,386,289,570,607,000
35.642857
77
0.707602
false
blockstack/blockstack-server
integration_tests/blockstack_integration_tests/scenarios/namespace_preorder_reveal_import_multi_ready.py
1
3316
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Blockstack ~~~~~ copyright: (c) 2014-2015 by Halfmoon Labs, Inc. copyright: (c) 2016 by Blockstack.org This file is part of Blockstack Blockstack is free software: you can redistribute it and/or modify it under the terms of the GNU General...
gpl-3.0
-1,843,037,481,361,064,400
33.541667
144
0.676116
false
iLoop2/ResInsight
ThirdParty/Ert/devel/python/python/ert/enkf/plot_data/pca_plot_vector.py
1
2288
from ert.cwrap import BaseCClass, CWrapper from ert.enkf import ENKF_LIB from ert.util import Matrix class PcaPlotVector(BaseCClass): def __init__(self, component, principal_component_matrix, observation_principal_component_matrix): assert isinstance(component, int) assert isinstance(principal_co...
gpl-3.0
-3,688,779,641,078,196,700
35.903226
131
0.693182
false
jeremiah-c-leary/vhdl-style-guide
vsg/tests/code_tags/test_next_line_code_tag.py
1
2440
import os import unittest from vsg.rules import process from vsg.rules import architecture from vsg import vhdlFile from vsg.tests import utils # Read in test file used for all tests lFile, eError = vhdlFile.utils.read_vhdlfile(os.path.join(os.path.dirname(__file__), 'next_line_code_tag_test_input.vhd')) oFile = v...
gpl-3.0
3,781,427,114,097,436,700
27.705882
122
0.663115
false
gauravbose/digital-menu
digimenu2/restaurant/migrations/0030_kitchen_usertable.py
1
1126
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('restaurant', '0029_cart'), ] ope...
bsd-3-clause
7,702,231,826,981,313,000
34.1875
174
0.563055
false
hammerhorn/working
cjh/letter.py
1
3270
#coding=utf8 import time from cjh.music import Pitch, Note from cjh.misc import speak """ translate the Roman alphabet into, e.g., radiophonic words, morse code, braille, etc.... """ class Letter(object): """ convert between different forms of Roman-alphabet letters """ morse_dict = { '1':'.---...
gpl-3.0
8,146,375,046,475,646,000
21.661972
75
0.306712
false
marcelocure/python-librato
tests/test_metrics.py
1
7166
import logging import unittest try: from unittest.mock import patch except ImportError: from mock import patch import librato from mock_connection import MockConnect, server #logging.basicConfig(level=logging.DEBUG) # Mock the server librato.HTTPSConnection = MockConnect class TestLibrato(unittest.TestCase): ...
bsd-3-clause
-7,349,473,628,441,905,000
37.945652
81
0.604382
false
MrJohz/snooble
tests/unit/test_ratelimit.py
1
7583
from snooble import ratelimit import time # used to monkeypatch this module from unittest import mock import pytest class TestRatelimit(object): def test_bursty(self): limiter = ratelimit.RateLimiter(5, 1, bursty=False) assert limiter.current_bucket == 1 assert limiter.refresh_period =...
mit
-3,938,698,611,375,506,000
33.468182
105
0.632072
false
syuu1228/seastar
configure.py
1
43696
#!/usr/bin/python3 # # This file is open source software, licensed to you under the terms # of the Apache License, Version 2.0 (the "License"). See the NOTICE file # distributed with this work for additional information regarding copyright # ownership. You may not use this file except in compliance with the License. ...
apache-2.0
-1,926,595,404,115,856,600
43.406504
411
0.578749
false
Royal-Society-of-New-Zealand/NZ-ORCID-Hub
orcid_api_v3/models/work_summary_v30_rc1.py
1
13920
# coding: utf-8 """ ORCID Member No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 OpenAPI spec version: Latest Generated by: https://github.com/swagger-api/swagger-codegen.git """ import pprint import re # noqa: F401 import si...
mit
3,248,907,714,498,165,000
30.422122
728
0.599282
false
catapult-project/catapult
telemetry/telemetry/internal/image_processing/_bitmap.py
3
8267
# 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. """ Bitmap is a basic wrapper for image pixels. It includes some basic processing tools: crop, find bounding box of a color and compute histogram of color va...
bsd-3-clause
5,840,911,145,013,504,000
32.605691
80
0.637958
false
mdshw5/strandex
setup.py
1
1338
from setuptools import setup install_requires = ['six'] def get_version(string): """ Parse the version number variable __version__ from a script. """ import re version_re = r"^__version__ = ['\"]([^'\"]*)['\"]" version_str = re.search(version_re, string, re.M).group(1) return version_str setup( ...
mit
6,688,157,721,223,414,000
37.228571
84
0.571749
false
project-schumann/vmf-converter
tests/vmf_converter_test.py
1
39224
import unittest import json from music21 import converter from music21 import duration from music21.chord import Chord from music21.meter import TimeSignature from music21.note import Note, Rest from music21.key import KeySignature from music21.tempo import MetronomeMark from vmf_converter.core import vmf_converter_c...
mit
8,606,255,815,061,616,000
47.605948
130
0.642158
false
cjgibson/mechkbot
bot.py
1
61053
# -*- coding: utf-8 -*- ### # AUTHORS: CHRISTIAN GIBSON, # PROJECT: /r/MechMarket Bot # UPDATED: SEPTEMBER 11, 2015 # USAGE: python bot.py [-h / --help] [-is / --interactive-shell] # EXPECTS: python 3.4.0 # beautifulsoup4 4.4.0 # praw 3.2.1 # regex 2015.06.24 ### import argparse import bs4...
gpl-2.0
7,135,524,112,241,807,000
48.879902
99
0.415147
false
quaquel/EMAworkbench
ema_workbench/examples/cart_flu_example.py
1
1172
''' Created on May 26, 2015 @author: jhkwakkel ''' import matplotlib.pyplot as plt import ema_workbench.analysis.cart as cart from ema_workbench import ema_logging, load_results ema_logging.log_to_stderr(level=ema_logging.INFO) def classify(data): # get the output for deceased population result = data['dec...
bsd-3-clause
-5,965,908,289,611,535,000
21.980392
61
0.726109
false
kdart/pycopia3
net/pycopia/http/jsonrpc1.py
1
3487
#!/usr/bin/python3.4 # vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab # # 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 r...
apache-2.0
-5,706,128,941,765,622,000
29.060345
110
0.641526
false
ty-tal/python
tools/user_audit.py
1
2470
#!/usr/bin/python2.7 -Wd ''' file:user_audit.py use: audits users table and compares current date to last password update if last update exceeds threshold send a notice to users author: ty.talmadge@gmail.com date: 20131002 connector: mysqldb because the SQL only changes per table layout ''' # define imported librar...
gpl-3.0
1,133,495,115,821,487,400
35.880597
134
0.738462
false
sargentfrancesca/coming-up-roses
client_site/models.py
1
1300
from __future__ import unicode_literals from django.db import models # Create your models here. # copy nano lib/python2.7/site-packages/pinax_theme_bootstrap folder class Category(models.Model): category_name = models.CharField(max_length=100) category_description = models.TextField() def __str__(self): return...
mit
-7,982,091,275,539,703,000
31.525
88
0.736154
false
mvcsantos/QGIS
python/plugins/processing/algs/qgis/RasterLayerHistogram.py
1
3219
# -*- coding: utf-8 -*- """ *************************************************************************** RasterLayerHistogram.py --------------------- Date : January 2013 Copyright : (C) 2013 by Victor Olaya Email : volayaf at gmail dot com *****************...
gpl-2.0
-4,066,943,660,711,654,000
34.373626
75
0.558559
false
Kelfast/mamba-framework
mamba/web/page.py
1
10483
# -*- test-case-name: mamba.test.test_web -*- # Copyright (c) 2012 - 2013 Oscar Campos <oscar.campos@member.fsf.org> # See LICENSE for more details """ .. module: page :platform: Unix, Windows :synopsis: The Page object is the main web application entry point .. moduleauthor:: Oscar Campos <oscar.campos@membe...
gpl-3.0
-775,358,922,251,888,300
32.707395
79
0.610417
false
geonition/base_page
base_page/admin.py
1
1467
""" Admin classes for base_page related models """ from django.contrib.gis import admin from django.core.urlresolvers import reverse_lazy from base_page.forms import OrganizationSettingForm from base_page.models import Feedback from base_page.models import OrganizationSetting from django.conf import settings from model...
mit
6,753,025,144,731,848,000
37.605263
93
0.632584
false
finikorg/zephyr
scripts/filter-known-issues.py
1
9183
#! /usr/bin/env python3 """ Filters a file, classifying output in errors, warnings and discarding the rest. Given a set of regular expressions read from files named *.conf in the given configuration path(s), of the format: # # Comments for multiline regex 1... # MULTILINEPYTHONREGEX MULTILINEPYTHONREGEX M...
apache-2.0
-1,054,487,401,185,095,400
35.879518
81
0.551563
false
aguijarro/DataSciencePython
DataWrangling/CaseStudy/project/audit.py
1
2399
import xml.etree.cElementTree as ET from collections import defaultdict import re street_type_re = re.compile(r'\S+\.?$', re.IGNORECASE) city_type_re = re.compile(r'\S+\.?$', re.IGNORECASE) expected = ["Street", "Avenue", "Boulevard", "Drive", "Court", "Place", "Square", "Lane", "Road", "Tra...
mit
-636,464,583,109,244,500
31
70
0.557316
false
scrapinghub/dateparser
dateparser/data/date_translation_data/ky.py
1
4964
info = { "name": "ky", "date_order": "DMY", "january": [ "янв", "январь" ], "february": [ "фев", "февраль" ], "march": [ "мар", "март" ], "april": [ "апр", "апрель" ], "may": [ "май" ], "june": [ ...
bsd-3-clause
5,801,358,384,835,052,000
16.9375
36
0.267364
false
ppppn/bib-generator
gen_bib.py
1
1967
#! /bin/sh """:" exec python3 "$0" ${1+"$@"} """ import argparse import csv import re from datetime import datetime from html_format import HTML_FORMAT def readStyles(format_csv_fname): formats = {} f = open(format_csv_fname, encoding='sjis') reader = csv.reader(f) category_header = next(reader)[0] ...
mit
-3,812,726,738,535,261,000
31.245902
73
0.613625
false
daizhengy/RDS
trove/guestagent/datastore/mysql/service.py
1
43726
# Copyright 2013 OpenStack Foundation # Copyright 2013 Rackspace Hosting # Copyright 2013 Hewlett-Packard Development Company, L.P. # 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 co...
apache-2.0
5,361,696,649,788,965,000
39.263352
79
0.55196
false
sigma-random/pwndbg
pwndbg/commands/nearpc.py
1
2744
#!/usr/bin/env python # -*- coding: utf-8 -*- from capstone import * import pwndbg.arguments import pwndbg.color import pwndbg.disasm import pwndbg.disasm.color import pwndbg.functions import pwndbg.ida import pwndbg.regs import pwndbg.strings import pwndbg.symbol import pwndbg.ui import pwndbg.vmmap @pwndbg.command...
mit
3,652,252,772,521,421,000
25.901961
92
0.603863
false
eLRuLL/scrapy
tests/mockserver.py
1
7989
import json import os import random import sys from subprocess import Popen, PIPE from urllib.parse import urlencode from OpenSSL import SSL from twisted.web.server import Site, NOT_DONE_YET from twisted.web.resource import Resource from twisted.web.static import File from twisted.web.test.test_webclient import Payloa...
bsd-3-clause
8,276,427,149,703,918,000
30.207031
105
0.619477
false
ProfessorX/Config
.PyCharm30/system/python_stubs/-1247972723/PyKDE4/kdeui/KWidgetItemDelegate.py
1
1056
# encoding: utf-8 # module PyKDE4.kdeui # from /usr/lib/python2.7/dist-packages/PyKDE4/kdeui.so # by generator 1.135 # no doc # imports import PyKDE4.kdecore as __PyKDE4_kdecore import PyQt4.QtCore as __PyQt4_QtCore import PyQt4.QtGui as __PyQt4_QtGui import PyQt4.QtSvg as __PyQt4_QtSvg class KWidgetItemDelegate(__P...
gpl-2.0
-2,606,785,844,807,714,000
25.4
77
0.676136
false
dstufft/fastly-py
tests/test_core.py
1
1153
# Copyright 2014 Donald Stufft # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
apache-2.0
-7,275,991,855,456,668,000
33.939394
74
0.740676
false
zuun77/givemegoogletshirts
codejam/2019/1B/q1.py
1
1278
import collections def solve(case, P, Q, people): ver, hor = {}, {} s, n, e, w = 0, 0, 0, 0 for p in people: x, y, d = p if d == 'S': if y in ver: ver[y] = (ver[y][0]+1, ver[y][1]) else: ver[y] = (1, 0) s += 1 elif d == 'N': if y in v...
apache-2.0
-4,067,940,558,325,939,000
25.625
58
0.400626
false
digital-anvil/djangocms-owl
runtests.py
1
1180
import sys try: from django.conf import settings settings.configure( DEBUG=True, USE_TZ=True, DATABASES={ "default": { "ENGINE": "django.db.backends.sqlite3", } }, ROOT_URLCONF="djangocms_owl.urls", INSTALLED_APPS=[ ...
bsd-3-clause
-1,932,248,877,800,464,400
20.454545
85
0.55678
false
jimbotonic/df_nlp
step1/prepare_data2.py
1
2591
# # This file is part of DF. # # DF is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public # License as published by the Free Software Foundation; # either version 3 of the License, or (at your option) any # later version. # # Latassan is distributed in the hope that it ...
gpl-2.0
8,706,524,835,819,565,000
33.092105
118
0.650714
false
renesugar/arrow
python/pyarrow/pandas_compat.py
1
37193
# 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
-6,731,303,660,057,483,000
33.247698
79
0.591912
false
nymoral/euler
p18.py
1
2156
""" By starting at the top of the triangle below and moving to adjacent numbers on the row below, the maximum total from top to bottom is 23. 3 -> 7 4 -> 2 4 6 8 5 9 3 That is, 3 + 7 + 4 + 9 = 23. Find the maximum total from top to bottom of the triangle below: 75 95 64 17 47 82 18 35 87 10 20 04 82 47 65 19 01 23 75...
mit
1,246,611,544,375,990,300
31.179104
157
0.650742
false
MikeLaptev/sandbox_python
mera/practice_with_function/sort_of_list.py
1
1144
''' Created on Aug 3, 2015 @author: Mikhail @summary: Sort list of strings by latest letter ''' def sort_by_latest_letter(list_of_strings): """ >>> sort_by_latest_letter(["abc", "cab", "bca"]) ['bca', 'cab', 'abc'] """ return [sorted_element[::-1] for sorted_element in sorted([element[::-1] for e...
apache-2.0
6,715,663,797,360,264,000
34.78125
158
0.624126
false
BV-DR/foamBazar
pythonScripts/gmshScript/geo.py
1
14381
import numpy as np import copy from .misc import * from .point import Point from .line import Line from .surface import Surface from .volume import Volume """ class to handle gmsh geo-file(s) """ class extdb(dict): ''' Extrude database, this is for conveniently accessing dict-keys by calling as attribute ...
gpl-3.0
-6,198,291,772,516,877,000
39.509859
137
0.527849
false
AutorestCI/azure-sdk-for-python
azure-cognitiveservices-vision-contentmoderator/azure/cognitiveservices/vision/contentmoderator/models/classification.py
1
1545
# 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
-4,682,587,792,800,070,000
37.625
105
0.606472
false
Asparagirl/ArchiveBot
pipeline/archivebot/seesaw/wpullargs_test.py
1
2884
from os import environ as env import unittest from .wpull import WpullArgs from seesaw.item import Item # taken form pipeline/pipeline.py if 'WARC_MAX_SIZE' in env: WARC_MAX_SIZE = env['WARC_MAX_SIZE'] else: WARC_MAX_SIZE = '5368709120' def joined(args): return str.join(' ', args) class TestWpullArgs(un...
mit
-364,133,565,755,845,800
30.692308
81
0.606449
false
pfig/CmdrKeen
setup.py
1
1221
from setuptools import setup, find_packages def long_description_from_readme(): with open('README.rst') as readme: return readme.read() setup( name="CommanderKeen", version="0.1", packages=find_packages(), scripts=['scripts/keen.py'], author="Pedro Figueiredo", author_email="pfig@...
mit
3,875,417,983,791,774,000
30.307692
70
0.610975
false
Haikson/virtenviro
virtenviro/content/templatetags/page_tags.py
1
4472
# ~*~ coding: utf-8 ~*~ __author__ = 'Kamo Petrosyan' from django import template from django.db.models import Q from virtenviro.content.models import Snippet, Page, AdditionalField, Menu from django.template import loader, Context from virtenviro.utils import * register = template.Library() @register.assignment_tag...
apache-2.0
-318,434,964,313,289,300
28.813333
87
0.632156
false
openstack/zaqar
zaqar/tests/unit/transport/wsgi/v2_0/test_claims.py
1
12577
# Copyright (c) 2013 Rackspace, 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
-5,287,691,008,987,485,000
38.800633
77
0.608333
false
MehdiSfr/tensor-flow
tensorflow/python/ops/candidate_sampling_ops.py
1
18205
# Copyright 2015 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 by applicable law or a...
apache-2.0
-4,878,222,035,196,797,000
46.408854
80
0.715737
false
xzhang2016/tfagent
setup.py
1
1318
from ez_setup import use_setuptools use_setuptools() from setuptools import setup def main(): setup(name='tfta', version='0.0.1', description='TF Agent', long_description='TF Agent', author='Xue Zhang', author_email='xue.zhang@tufts.edu', url='https://git...
bsd-2-clause
5,773,306,868,928,383,000
38.939394
78
0.525797
false
mendhak/Kindle-Time-and-Weather
server/weather-script.py
1
6448
#!/usr/bin/python # Kindle Weather Display # Matthew Petroff (http://www.mpetroff.net/) # September 2012 # # Owen Bullock - UK Weather - MetOffice - Aug 2013 # Apr 2014 - amended for Wind option # # Mendhak - redone for WeatherUnderground API import json import urllib2 from xml.dom import minidom import datetime impo...
mit
3,446,430,669,195,974,700
34.234973
93
0.596309
false
brittanystoroz/kitsune
kitsune/customercare/tests/test_templates.py
1
4222
import json from django.conf import settings from django.core.cache import cache from nose.tools import eq_ from pyquery import PyQuery as pq from kitsune.customercare.replies import REPLIES_DOCUMENT_SLUG from kitsune.sumo.tests import TestCase from kitsune.sumo.urlresolvers import reverse from kitsune.wiki.tests im...
bsd-3-clause
-8,958,314,547,248,741,000
29.157143
78
0.657035
false
xswxm/MyIoT
devices/system.py
1
1715
#!/usr/bin/python # -*- encoding: utf-8 -*- import threading, os class CPUTemp: _lock = threading.RLock() def __init__(self, id, title, feasible = True): self.id = id self.title = title self.feasible = feasible self.category = 'Value' def description(self): message ...
gpl-3.0
-1,412,676,988,932,031,500
31.339623
76
0.533839
false
bfirsh/django-mptt
setup.py
1
2361
""" Based entirely on Django's own ``setup.py``. """ import os from distutils.command.install import INSTALL_SCHEMES from distutils.core import setup def fullsplit(path, result=None): """ Split a pathname into components (the opposite of os.path.join) in a platform-neutral way. """ if result is Non...
mit
-2,161,140,952,425,725,200
35.323077
146
0.639136
false
Tanmay28/coala
bears/tests/natural_language/AlexBearTest.py
1
1313
import os import subprocess import sys from queue import Queue sys.path.insert(0, ".") import unittest from bears.tests.LocalBearTestHelper import LocalBearTestHelper from bears.natural_language.AlexBear import AlexBear from coalib.settings.Section import Section class AlexBearTest(LocalBearTestHelper): def setU...
agpl-3.0
2,532,052,658,769,836,500
29.534884
65
0.568926
false
hpcloud/CloudAgents
agents/file_exists.py
1
3605
#!/usr/bin/env python # Copyright 2013 Hewlett-Packard Development Company, L.P. # 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.or...
apache-2.0
6,946,789,395,821,561,000
30.347826
196
0.671567
false
pwittchen/learn-python-the-hard-way
exercises/exercise35.py
1
1993
# Exercise 35: Branches and Functions from sys import exit def gold_room(): print "This room is full of gold. How much do you take?" choice = raw_input("> ") if "0" in choice or "1" in choice: how_much = int(choice) else: dead("Man, learn to type a number.") if how_much < 50: ...
mit
956,250,791,782,358,400
24.551282
80
0.578525
false
willjp/pyqconcurrency
qconcurrency/models.py
1
37871
#!/usr/bin/env python """ Name : qconcurrency/models.py Created : Apr 14, 2017 Author : Will Pittman Contact : willjpittman@gmail.com ________________________________________________________________________________ Description : Generic models, and interfaces for models to be used ...
bsd-3-clause
-3,545,572,550,942,199,300
34.660075
119
0.464577
false
aerickson/jenkinsapi
jenkinsapi_tests/unittests/test_jenkins.py
1
14593
import mock # To run unittests on python 2.6 please use unittest2 library try: import unittest2 as unittest except ImportError: import unittest from jenkinsapi.plugins import Plugins from jenkinsapi.utils.requester import Requester from jenkinsapi.jenkins import Jenkins, JenkinsBase, Job from jenkinsapi.custom...
mit
1,974,490,247,969,425,200
36.805699
90
0.533681
false
wjohnston888/pynet_test-
my_devices.py
1
1517
""" pynet-rtr1 (Cisco IOS) 184.105.247.70 pynet-rtr2 (Cisco IOS) 184.105.247.71 pynet-sw1 (Arista EOS) 184.105.247.72 pynet-sw2 (Arista EOS) 184.105.247.73 pynet-sw3 (Arista EOS) 184.105.247.74 pynet-sw4 (Arista EOS) 184.105.247.75 juniper-srx 184.105.247.76 """ from getpass import getpass password = ...
apache-2.0
-8,651,061,472,039,919,000
18.960526
47
0.619644
false
nightstrike/blender_nif_plugin
testframework/integration/textures/normal/test_normal.py
1
7305
"""Export and import textured meshes.""" # ***** BEGIN LICENSE BLOCK ***** # # Copyright © 2005-2015, NIF File Format Library and Tools contributors. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # ar...
bsd-3-clause
1,311,427,785,334,063,600
42.736527
135
0.702766
false
LittleBun/Personal
ics632/tutorial_sim_grid/topic2/generate_xml_bintree_and_hostfile.py
1
5081
#!/usr/bin/env python2.7 import sys import os import math # Link parameters link_latency = "10us" link_bandwidth = 10 link_bandwidth_unit = "Gbps" # Convenient math wrappers def floor(x): return int(math.floor(x)) def ceil(x): return int(math.ceil(x)) def pow2(x): return int(math.pow(2,x)) # XML generation funct...
unlicense
-6,806,824,665,409,877,000
34.78169
156
0.604212
false
shubhamchaudhary/biggboss
biggboss-checker.py
1
6274
#!/usr/bin/env python3 # # Copyright (c) 2014 Shubham Chaudhary <me@shubhamchaudhary.in> # # 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 you...
gpl-3.0
3,544,284,820,136,747,500
35.057471
138
0.626076
false
robertnishihara/ray
python/ray/tests/test_gcs_fault_tolerance.py
1
3783
import sys import ray import pytest from ray.test_utils import ( generate_system_config_map, wait_for_condition, wait_for_pid_to_exit, ) @ray.remote class Increase: def method(self, x): return x + 2 @ray.remote def increase(x): return x + 1 @pytest.mark.parametrize( "ray_start_reg...
apache-2.0
5,112,299,766,017,386,000
27.877863
80
0.653978
false
jankim/deepnl
bin/dl-sentiwords.py
1
7318
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Learn sentiment-specific word embeddings from tweets. Author: Giuseppe Attardi """ import logging import numpy as np import argparse from ConfigParser import ConfigParser from itertools import chain # allow executing from anywhere without installing the package impo...
gpl-3.0
-4,546,892,508,208,062,000
37.114583
98
0.599344
false
cachance7/BattleQuip
battlequip/strategy.py
1
4120
from util import * import random class StrategyStateException(Exception): def __init__(self, message): super(StrategyStateException, self).__init__() self.message = message class Strategy(object): """Class to encapsulate logic of analyzing the state of a board and returning a valid coordin...
mit
-9,149,077,923,772,832,000
32.770492
95
0.563592
false
lhilt/scipy
runtests.py
1
17145
#!/usr/bin/env python """ runtests.py [OPTIONS] [-- ARGS] Run tests, building the project first. Examples:: $ python runtests.py $ python runtests.py -s {SAMPLE_SUBMODULE} $ python runtests.py -t {SAMPLE_TEST} $ python runtests.py --ipython $ python runtests.py --python somescript.py $ python...
bsd-3-clause
-2,131,450,785,985,568,300
34.205339
87
0.533508
false
mahajrod/MACE
scripts/old/test_clustering_thresholds.py
1
2709
#!/usr/bin/env python __author__ = 'Sergei F. Kliver' import os import sys import argparse from MACE.Parsers.VCF import CollectionVCF parser = argparse.ArgumentParser() parser.add_argument("-i", "--input_file", action="store", dest="input", required=True, help="Input vcf file with mutations.") pa...
apache-2.0
4,077,634,745,579,346,400
56.638298
111
0.619786
false
YourCyborg/Sun-RPI
docs/sphinx/src2rest/src2rest.py
1
2118
#! /usr/bin/python # # Auto-generate reST documentation for Sphinx from Evennia source # code. # # Uses etinenned's sphinx autopackage script. Install it to folder # "autogen" in this same directory: # # hg clone https://bitbucket.org/etienned/sphinx-autopackage-script autogen # # Create a directory tree "code/" co...
bsd-3-clause
6,890,642,337,181,281,000
32.09375
107
0.635505
false
BartGo/bottle-stack
nonpip-dl.py
1
1774
""" Download external components (non-Python) """ import requests import zipfile """ Download additional (non-Python) files needed by the project """ import os import shutil import sys sys.path.append("./lib") # http://stackoverflow.com/questions/16694907/how-to-download-large-file-in-python-with-requests-py def do...
mit
1,648,368,742,869,832,000
31.851852
109
0.669109
false
wondie/batch_gps_importer
batch_gps_importer.py
1
3604
# -*- coding: utf-8 -*- """ /*************************************************************************** Batch GPS Importer A QGIS plugin Initializer of the plugin. ------------------- begin : 2017-03-18 copyright ...
gpl-3.0
602,411,071,137,016,400
36.936842
83
0.508879
false
pyfa-org/eos
tests/integration/customization/customization/test_ancillary_armor_repairer.py
1
13565
# ============================================================================== # Copyright (C) 2011 Diego Duclos # Copyright (C) 2011-2018 Anton Vorobyov # # This file is part of Eos. # # Eos is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as publi...
lgpl-3.0
4,200,538,623,229,928,000
40.106061
80
0.6
false
ggood/adsbTheremin
aircraft_map.py
1
6296
# aircraft_map: maintains a list of aircraft "seen" by an ADSB # receiver. import math import time DEFAULT_PURGE_TIME = 120 # Forget planes not heard from in this many seconds DEFAULT_PURGE_INTERVAL = 1 # How often to purge stale aircraft EARTH_RADIUS = 6371000 # Earth's radius in meters class Aircraft(object): ...
unlicense
2,571,144,089,346,902,500
33.032432
77
0.546537
false
cmdunkers/DeeperMind
PythonEnv/lib/python2.7/site-packages/theano/sandbox/gpuarray/opt.py
1
35148
import copy import numpy import logging from six.moves import xrange import theano from theano import tensor, scalar, gof from theano.compile import optdb from theano.compile.ops import shape_i from theano.gof import (local_optimizer, EquilibriumDB, SequenceDB, Optimizer, toolbox) from theano.g...
bsd-3-clause
-188,701,961,609,684,220
34.253761
80
0.584898
false
astroswego/data-plots
src/data_plots/stats.py
1
3782
import numpy import matplotlib import matplotlib.mlab as mlab import matplotlib.pyplot as plt from matplotlib.ticker import NullFormatter from matplotlib import rcParams from scipy.optimize import curve_fit from data_plots.utils import labeler, titler rcParams['text.usetex'] = True def scatter_hist(x, y, *args, ...
mit
7,716,508,680,442,090,000
31.886957
77
0.59651
false
HLP-R/hlpr_kinesthetic_teaching
hlpr_kinesthetic_interaction/src/hlpr_kinesthetic_interaction/jaco_7dof_arm.py
1
2145
#!/usr/bin/env python import rospy from hlpr_manipulation_utils.manipulator import Gripper from kinova_msgs.srv import Start, Stop from hlpr_kinesthetic_interaction.kinesthetic_interaction import KinestheticInteraction """ jaco_7dof_arm.py Simple wrapper that abstracts out the arm class so that other arms can use ki...
bsd-3-clause
3,589,335,116,544,430,000
38.722222
96
0.682051
false
openstack/heat
heat/hacking/checks.py
1
2038
# Copyright (c) 2016 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 required by app...
apache-2.0
7,629,870,061,720,237,000
28.536232
75
0.707556
false
ggf84/tupan
tupan/particles/body.py
1
18588
# -*- coding: utf-8 -*- # """ TODO. """ from __future__ import print_function import sys import copy import numpy as np from ..lib import extensions from ..lib.utils.timing import decallmethods, timings __all__ = ["Bodies"] class NbodyMethods(object): """This class holds common methods for particles in n-bod...
mit
647,833,605,706,238,800
26.497041
79
0.528298
false
ValorNaram/isl
inputchangers/001.py
1
15830
from __future__ import print_function import os globe = {} generateIndex = False lang = "en" brackets = ["[&]", "{&}", "(&)", "<&>"] class compiler(): def __init__(self): self = self def languageSupport(self, f): if "langBuffer" in globe: langBuffer = globe["langBuffer"] else: langBuffer = {} if not f i...
mit
-5,764,654,230,822,029,000
39.480818
227
0.601655
false
graingert/maluroam
maluroam/eduroam_snort/models.py
1
3623
#!/usr/bin/env python # -*- coding: utf-8 -*- # # models.py # # Copyright 2012 Thomas Grainger <tagrain@gmail.com> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation; version 3. # ...
agpl-3.0
-4,906,065,184,165,069,000
33.504762
115
0.642009
false
Jozhogg/iris
docs/iris/example_tests/test_COP_1d_plot.py
1
1263
# (C) British Crown Copyright 2010 - 2014, Met Office # # This file is part of Iris. # # Iris is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by the # Free Software Foundation, either version 3 of the License, or # (at your option) any l...
lgpl-3.0
4,704,153,623,236,729,000
33.135135
96
0.726841
false
rail-berkeley/d4rl
d4rl/locomotion/maze_env.py
1
14289
# Copyright 2018 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 applicab...
apache-2.0
5,405,217,711,916,502,000
36.901857
132
0.492477
false
harlequin/sickbeard
sickbeard/metadata/tivo.py
1
13263
# Author: Nic Wolfe <nic@wolfeden.ca> # Author: Gordon Turner <gordonturner@gordonturner.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...
gpl-3.0
8,133,758,677,926,244,000
40.839117
176
0.562618
false
ktan2020/legacy-automation
win/Lib/site-packages/wx-3.0-msw/wx/lib/agw/toasterbox.py
1
46688
# --------------------------------------------------------------------------- # # TOASTERBOX wxPython IMPLEMENTATION # Ported And Enhanced From wxWidgets Contribution (Aj Bommarito) By: # # Andrea Gavana, @ 16 September 2005 # Latest Revision: 14 Mar 2012, 21.00 GMT # # # TODO/Caveats List # # 1. Any Idea? #...
mit
-4,192,503,519,830,455,000
33.077385
279
0.525103
false
funkyfuture/deck-chores
deck_chores/indexes.py
1
2095
from functools import lru_cache from types import MappingProxyType from typing import Dict, Tuple from deck_chores.config import cfg, CONTAINER_CACHE_SIZE from deck_chores.utils import log #### @lru_cache(maxsize=CONTAINER_CACHE_SIZE) def container_name(container_id: str) -> str: return cfg.client.containers.g...
isc
137,992,603,129,664,260
33.344262
86
0.71074
false
Tim-Erwin/sanic
sanic/router.py
1
13870
import re from collections import defaultdict, namedtuple from collections.abc import Iterable from functools import lru_cache from sanic.exceptions import NotFound, InvalidUsage from sanic.views import CompositionView Route = namedtuple( 'Route', ['handler', 'methods', 'pattern', 'parameters', 'name', 'uri']...
mit
1,279,275,129,031,850,000
35.214099
79
0.559697
false
szwieback/nlscaling
testScenarios/testEstimationSkewNormal.py
1
5774
''' Provides scenarios for testing the estimation of the parameters (error variances and mean map parameters, which correspond to generalized calibration constants) The simulated data are drawn from SkewNormal distributions, whereas normal distributions are assumed in the estimation. The results are described in testEs...
gpl-3.0
6,476,651,784,709,622,000
69.414634
160
0.733634
false
AlexandreOuellet/halite-bot
input_data.py
1
6237
#!/usr/bin/env python """Functions for downloading and reading MNIST data.""" import gzip import os from six.moves.urllib.request import urlretrieve import numpy SOURCE_URL = 'http://yann.lecun.com/exdb/mnist/' def maybe_download(filename, work_directory): """Download the data from Yann's website, unless it's al...
mit
8,355,011,669,084,884,000
37.036585
78
0.612474
false
googleapis/python-datacatalog
google/cloud/datacatalog_v1/services/policy_tag_manager/transports/base.py
1
12048
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
apache-2.0
-6,601,856,494,022,337,000
35.509091
103
0.632885
false