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
tomazc/orange-bio
orangecontrib/bio/kegg/tests/test_entry.py
1
1064
from six import StringIO import doctest import unittest from orangecontrib.bio.kegg.entry import parser, fields, DBEntry, entry_decorate TEST_ENTRY = """\ ENTRY test_id something else NAME test DESCRIPTION This is a test's description. it spans multiple lines SUB This...
gpl-3.0
-5,013,785,239,307,211,000
20.714286
80
0.638158
false
blackball/an-test6
net/migrations/0004_update_calibrations.py
1
22054
# encoding: utf-8 import datetime from south.db import db from south.v2 import DataMigration from django.db import models from astrometry.net.settings import * from astrometry.util.util import Tan import math import os class Migration(DataMigration): def forwards(self, orm): "Write your forwards methods ...
gpl-2.0
-8,568,439,465,542,566,000
73.255892
203
0.540446
false
MSEMJEJME/Get-Dumped
renpy/statements.py
1
3307
# Copyright 2004-2012 Tom Rothamel <pytom@bishoujo.us> # # 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, m...
gpl-2.0
-8,841,751,182,915,426,000
32.07
138
0.643786
false
Pedram26/Humans-vs-Aliens
HumansAliens.app/Contents/Resources/lib/python2.7/pygame/tests/font_test.py
1
21363
import sys import os if __name__ == '__main__': pkg_dir = os.path.split(os.path.abspath(__file__))[0] parent_dir, pkg_name = os.path.split(pkg_dir) is_pygame_pkg = (pkg_name == 'tests' and os.path.split(parent_dir)[1] == 'pygame') if not is_pygame_pkg: sys.path.insert(0, par...
apache-2.0
5,488,330,198,394,416,000
35.896373
95
0.562795
false
RayRuizhiLiao/ITK_4D
Modules/ThirdParty/pygccxml/src/pygccxml/parser/etree_scanner.py
1
2166
# Copyright 2014-2016 Insight Software Consortium. # Copyright 2004-2008 Roman Yakovenko. # Distributed under the Boost Software License, Version 1.0. # See http://www.boost.org/LICENSE_1_0.txt import warnings from . import scanner # keep py2exe happy import xml.etree.ElementTree import xml.etree.cElement...
apache-2.0
-8,333,672,104,491,799,000
28.507042
78
0.591874
false
shiningdesign/universal_tool_template.py
_ARCHIVE/universal_tool_template_1020.py
1
84756
# Univeral Tool Template v011.0 tpl_ver = 10.2 tpl_date = 180220 print("tpl_ver: {0}-{1}".format(tpl_ver, tpl_date)) # by ying - https://github.com/shiningdesign/universal_tool_template.py import importlib import sys # ---- hostMode ---- hostMode = '' hostModeList = [ ['maya', {'mui':'maya.OpenMayaUI', ...
mit
-6,143,926,066,668,047,000
47.105446
282
0.514335
false
dnlcrl/PyFunt
tools/cythonize.py
1
6618
#!/usr/bin/env python """ cythonize SOURCE: https://github.com/scipy/scipy/blob/master/setup.py Cythonize pyx files into C files as needed. Usage: cythonize [root_dir] Default [root_dir] is 'pyfunt'. Checks pyx files to see if they have been changed relative to their corresponding C files. If they have, then runs...
mit
-7,944,039,619,602,638,000
29.219178
97
0.599577
false
deepmind/interval-bound-propagation
interval_bound_propagation/src/simplex_bounds.py
1
7609
# coding=utf-8 # Copyright 2019 The Interval Bound Propagation 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 ...
apache-2.0
3,811,566,715,278,191,600
38.020513
79
0.655539
false
sigurdga/nidarholm
organization/templatetags/grouplistings.py
1
2466
from django import template from django.contrib.auth.models import Group from organization.models import GroupCategory, Role import re register = template.Library() def roles_for_user_in_group(user, group): return Role.objects.filter(membership__user=user, membership__group=group) def phone_number_format(number...
agpl-3.0
-7,402,660,224,905,612,000
41.517241
125
0.539335
false
sidnarayanan/BAdNet
train/gen/baseline/models/shallow_models/train_v3_nopt.py
1
2793
#!/usr/local/bin/python2.7 from sys import exit, stdout, argv from os import environ, system environ['KERAS_BACKEND'] = 'tensorflow' environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID" environ["CUDA_VISIBLE_DEVICES"] = "" import numpy as np import signal from keras.layers import Input, Dense, Dropout, concatenate, LSTM, Ba...
mit
6,679,780,554,708,395,000
31.103448
106
0.672037
false
lorensen/VTKExamples
src/Python/GeometricObjects/Polygon.py
1
1535
#!/usr/bin/env python import vtk def main(): colors = vtk.vtkNamedColors() # Setup four points points = vtk.vtkPoints() points.InsertNextPoint(0.0, 0.0, 0.0) points.InsertNextPoint(1.0, 0.0, 0.0) points.InsertNextPoint(1.0, 1.0, 0.0) points.InsertNextPoint(0.0, 1.0, 0.0) # Create the...
apache-2.0
-4,295,740,643,100,989,000
26.909091
61
0.695765
false
angelicadly/prog-script
tekton-master/backend/appengine/routes/rotas/rest.py
1
1044
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from gaebusiness.business import CommandExecutionException from tekton.gae.middleware.json_middleware import JsonResponse from rota_app import facade def index(): cmd = facade.list_rotas_cmd() rota_list = cmd() short_form=fac...
mit
-1,036,920,398,554,202,000
27.216216
67
0.704981
false
nedbat/django_coverage_plugin
tests/test_settings.py
1
1672
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/nedbat/django_coverage_plugin/blob/master/NOTICE.txt """Settings tests for django_coverage_plugin.""" from django.test.utils import override_settings from .plugin_test import DjangoPluginTestCase, test_s...
apache-2.0
-1,464,384,054,192,477,200
37.883721
92
0.718301
false
akshayka/edxclassify
edxclassify/classifiers/feature_generation.py
1
3989
from edxclassify.feature_spec import FEATURE_COLUMNS from edxclassify.classifiers.word_lists import * from edxclassify.data_cleaners.dc_util import compress_likert import re import nltk from nltk.tokenize import sent_tokenize, word_tokenize def to_int(value, aux=None): if value == '': return 0 return i...
gpl-2.0
2,360,410,365,754,236,000
28.992481
78
0.591376
false
srmagura/goodnight-lead
gl_site/statistics/views.py
1
6287
# View imports from django.http import JsonResponse, HttpResponse from django.shortcuts import render from gl_site.custom_auth import login_required # Forms from gl_site.statistics.statistics_form import statistics_request_form, statistics_download_form # Data from .data_generation import format_graph_data, format_f...
gpl-3.0
-8,336,534,110,600,097,000
30.435
126
0.606171
false
jhunkeler/hstcal
tests/wfc3/test_uvis_32single.py
1
1252
import subprocess import pytest from ..helpers import BaseWFC3 @pytest.mark.xfail(reason="Temporary xfail. New input/truth files on Artifactory, but branch not merged.") class TestUVIS32Single(BaseWFC3): """ Test pos UVIS2 subarray data with CTE correction """ detector = 'uvis' def _single_...
bsd-3-clause
4,627,072,372,218,348,000
31.102564
106
0.567093
false
adamfast/faadata
faadata/aircraft/parser.py
1
3304
import datetime class AircraftManufacturerCode(object): def __init__(self, record): self.code = record[:7].strip() self.manufacturer = record[8:38].strip() self.model = record[39:59].strip() self.aircraft_type = record[60].strip() self.engine_type = record[62].strip() ...
bsd-3-clause
-8,092,445,956,844,940,000
43.648649
102
0.592918
false
Aravinthu/odoo
odoo/fields.py
1
104967
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. """ High-level objects for fields. """ from collections import OrderedDict, defaultdict from datetime import date, datetime from functools import partial from operator import attrgetter import itertools import logging ...
agpl-3.0
8,913,938,050,853,976,000
41.087811
126
0.585813
false
RyadElssalihine/RyadElssalihine
user_manager/views.py
1
1508
# Create your views here. from rest_framework import status from rest_framework.decorators import api_view from rest_framework.response import Response from models import Profile,Application,Tab,Page,Footer from serializer import ProfileSerializer,TabSerializer,FooterSerializer from django.shortcuts import render from ...
gpl-2.0
-4,443,966,142,931,526,700
27.45283
71
0.772546
false
mareknetusil/twist
cbc/twist/kinematics.py
1
4324
__author__ = "Harish Narayanan" __copyright__ = "Copyright (C) 2009 Simula Research Laboratory and %s" % __author__ __license__ = "GNU GPL Version 3 or any later version" from dolfin import * #from cbc.twist.coordinate_system import CartesianSystem # Renaming grad to Grad because it looks nicer in the reference # co...
gpl-3.0
1,692,405,160,494,801,000
26.896774
83
0.639685
false
snarfed/webmention-tools
bin/demo.py
1
1241
#!/usr/bin/env python # -*- coding: utf-8 -*- from webmentiontools.urlinfo import UrlInfo from webmentiontools.webmentionio import WebmentionIO # If you have an access token from webmention.io, # set it here. Some calls require it. webmention_io_token = None wio = WebmentionIO(webmention_io_token) # Get all links...
mit
8,639,230,686,331,052,000
33.472222
72
0.617244
false
XiaochenCui/algorithm_submit
app/auth/views.py
1
5804
from flask import render_template, redirect, request, url_for, flash from flask.ext.login import login_user, logout_user, login_required, \ current_user from . import auth from .. import db from ..models import User from ..email import send_email from .forms import LoginForm, RegistrationForm, ChangePasswordForm, \...
mit
5,879,881,981,366,820,000
32.95092
78
0.630105
false
kangwonlee/ECA
lab_07_linear_algebra/gauss_jordan.py
1
1766
# -*- coding: utf8 -*- from pprint import pprint import linear_algebra as la def gauss_jordan(A): # 행렬의 크기 n_row = len(A) n_column = len(A[0]) # 단위 행렬과의 Augmented Matrix 를 만듦 AI = [] for i_row in xrange(n_row): AI_row = [0.0] * (n_column * 2) for j_column in xrange(n_column):...
apache-2.0
1,296,910,529,811,983,000
23.666667
72
0.514742
false
Chris7/django-djangui
djangui/models/mixins.py
1
1697
from __future__ import absolute_import __author__ = 'chris' from django.forms.models import model_to_dict import six class UpdateScriptsMixin(object): def save(self, **kwargs): super(UpdateScriptsMixin, self).save(**kwargs) from ..backend.utils import load_scripts load_scripts() class Dja...
gpl-3.0
4,384,404,271,976,613,400
27.3
104
0.602829
false
mosen/commandment
tests/mdm/test_checkin.py
1
1404
import pytest from flask import Response from tests.client import MDMClient class TestCheckin: def test_authenticate(self, client: MDMClient, authenticate_request: str): """Basic test: Authenticate""" response: Response = client.put('/checkin', data=authenticate_request, content_type='text/xml') ...
mit
-347,361,245,787,031,400
45.8
107
0.683761
false
manaris/jythonMusic
15. simpleCircleInstrument.py
1
2279
# simpleCircleInstrument.py # # Demonstrates how to use mouse and keyboard events to build a simple # drawing musical instrument. # from gui import * from music import * from math import sqrt ### initialize variables ###################### minPitch = C1 # instrument pitch range maxPitch = C8 # create display d ...
gpl-3.0
2,095,986,917,681,406,200
31.571429
70
0.660816
false
openstack/vitrage
doc/source/conf.py
1
2952
# 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 # distributed under the...
apache-2.0
-1,014,818,334,832,758,900
31.8
88
0.692073
false
gilles-duboscq/jvb
scripts/gen-idea-configs.py
1
3766
#!/usr/bin/env python # <configuration default="false" name="pong" type="Application" factoryName="Application"> # <option name="MAIN_CLASS_NAME" value="gd.twohundred.jvb.Main" /> # <option name="VM_PARAMETERS" value="" /> # <option name="PROGRAM_PARAMETERS" value="&quot;$PROJECT_DIR$/../vb-roms/all-roms/pong.vb...
mit
-6,872,473,540,939,162,000
43.305882
169
0.677642
false
intelligent-agent/redeem
tests/gcode/test_M83.py
1
1638
from __future__ import absolute_import from .MockPrinter import MockPrinter from redeem.Path import Path class M83_Tests(MockPrinter): def test_gcodes_M83_from_absolute(self): """ set state as it should be after a G90, all axes absolute """ self.printer.axes_absolute = ["X", "Y", "Z", "E", "H", "A", "B", "...
gpl-3.0
4,424,008,043,799,721,000
44.5
90
0.639194
false
jayvdb/travis_log_fetch
tests/test_github.py
1
1132
"""Test Github resolution.""" from __future__ import absolute_import, unicode_literals from travis_log_fetch.config import ( _get_github, get_options, ) from travis_log_fetch.get import ( get_forks, ) import pytest # Note 'foo' is a real Github user, but they do not # have repos bar or baz class TestFor...
mit
-6,854,272,443,919,678,000
27.3
68
0.621025
false
Jumpscale/jumpscale_core8
tests/tools/cuisine/TestJSCuisine.py
1
4718
""" Test JSCuisine (core) """ import unittest from unittest import mock from JumpScale import j from JumpScale.tools.cuisine.JSCuisine import JSCuisine import JumpScale from JumpScale.tools.cuisine.ProcessManagerFactory import ProcessManagerFactory class TestJSCuisine(unittest.TestCase): def setUp(self): ...
apache-2.0
-7,099,521,589,335,590,000
27.944785
86
0.643281
false
jacobajit/ion
intranet/apps/events/views.py
1
11092
# -*- coding: utf-8 -*- import datetime import logging import bleach from django import http from django.contrib import messages from django.contrib.auth.decorators import login_required from django.core import exceptions from django.shortcuts import get_object_or_404, redirect, render from .forms import AdminEvent...
gpl-2.0
-4,660,954,090,174,681,000
33.554517
152
0.627209
false
TheVirtualLtd/bda.plone.shop
src/bda/plone/shop/vocabularies.py
1
6162
# -*- coding: utf-8 -*- from bda.plone.checkout.vocabularies import country_vocabulary from bda.plone.checkout.vocabularies import gender_vocabulary from bda.plone.payment import Payments from bda.plone.shipping import Shippings from bda.plone.shop import message_factory as _ from bda.plone.shop.utils import get_shop_a...
bsd-3-clause
-2,564,873,223,783,599,600
34.011364
77
0.697339
false
elaske/mufund
tests.py
1
3839
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Author: Evan Laske # @Date: 2014-03-01 21:45:31 # @Last Modified by: Evan Laske # @Last Modified time: 2015-09-15 23:51:12 import urllib import urllib2 from bs4 import BeautifulSoup import html5lib import re from StockQuote import StockQuote from MutualFundData impo...
gpl-3.0
6,559,670,225,888,140,000
32.684211
110
0.636624
false
gooddata/openstack-nova
nova/tests/functional/regressions/test_bug_1780373.py
1
5391
# 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 # distributed under the...
apache-2.0
3,554,794,791,927,263,000
48.009091
79
0.667038
false
Foldblade/EORS
Mypackage/back_to_yesterday.py
1
3091
# encoding:utf-8 ''' ———————————————————————————————— back_to_yesterday.py 对备份文件的回档,所谓‘回到昨天’功能。 实现原理:删除源文件。解压备份的zip,自动覆盖。 ———————————————————————————————— ''' import os import zipfile import shutil import time def back_to_yesterday(): where_script = os.path.split(os.path.realpath(__file__))[0] # print(where_...
gpl-3.0
-882,281,870,340,508,500
35.5
97
0.595705
false
XiMuYouZi/PythonDemo
Crawler/Zhihu/zhihuuser/spiders/zhihu_user.py
1
4440
# -*- coding: utf-8 -*- # 爬取知乎全站的用户信息 import json from scrapy import Spider, Request from Crawler.Zhihu.zhihuuser.items import UserItem class ZhihuSpider(Spider): #忽略301,302重定向请求 # handle_httpstatus_list = [301, 302] name = "zhihu_user" allowed_domains = ["www.zhihu.com"] user_url = 'https://...
mit
4,831,802,806,455,866,000
46.88764
808
0.666823
false
thruflo/dogpile.cache
tests/cache/test_memcached_backend.py
1
6526
from ._fixtures import _GenericBackendTest, _GenericMutexTest from . import eq_, winsleep from unittest import TestCase from threading import Thread import time from nose import SkipTest from dogpile.cache import compat class _TestMemcachedConn(object): @classmethod def _check_backend_available(cls, backend):...
bsd-3-clause
7,280,850,532,205,273,000
29.783019
77
0.610175
false
sgzwiz/brython
tests/console.py
1
2190
import sys import time import random #this sucks.. cannot find dis since "root" path is blah/test #we might need to create a variable we pass via the brython function # to state what the root path is. # For now, we'll hardcode a relative path. :( sys.path.append("../Lib") import dis _rand=random.random() editor=...
bsd-3-clause
-4,744,852,278,866,266,000
19.660377
68
0.630594
false
devs1991/test_edx_docmode
venv/lib/python2.7/site-packages/ratelimitbackend/backends.py
1
2730
import logging import warnings from datetime import datetime, timedelta from django.contrib.auth.backends import ModelBackend from django.core.cache import cache from .exceptions import RateLimitException logger = logging.getLogger('ratelimitbackend') class RateLimitMixin(object): """ A mixin to enable ra...
agpl-3.0
6,461,471,023,397,237,000
29.674157
79
0.563736
false
joetsoi/moonstone
python/main.py
1
1239
from collections import namedtuple from struct import unpack, unpack_from Segment = namedtuple('Segment', 'offset length') ViewportDimension = namedtuple('ViewportDimension', 'right left') class MainExe(object): def __init__(self, file_path): data_segment = Segment(0x138a0, 0xf460) with open(fil...
agpl-3.0
326,647,625,653,657,340
27.813953
69
0.51816
false
labsquare/CuteVariant
cutevariant/gui/plugins/vql_editor/__init__.py
1
1026
from PySide2.QtWidgets import QApplication __title__ = "VQL Editor" __description__ = "A VQL editor" __long_description__ = QApplication.instance().translate( "vql_editor", """ <p>This plugin allows you to manage most of the work that can be done in a Cutevariant project by writing and executing VQL queries.<...
gpl-3.0
5,526,662,183,943,269,000
40.04
95
0.734893
false
PabloTunnon/pykka-deb
tests/logging_test.py
1
4370
import os import sys import logging import threading import unittest from pykka.actor import ThreadingActor from pykka.registry import ActorRegistry from tests import TestLogHandler class LoggingNullHandlerTest(unittest.TestCase): def test_null_handler_is_added_to_avoid_warnings(self): logger = logging....
apache-2.0
-7,781,119,297,965,645,000
35.416667
78
0.65492
false
teoliphant/scipy
scipy/ndimage/filters.py
2
40010
# Copyright (C) 2003-2005 Peter J. Verveer # # 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 # notice, this list of conditions and the following d...
bsd-3-clause
-4,108,254,230,189,439,500
34.004374
79
0.597751
false
vaniakosmos/memes-reposter
apps/imgur/migrations/0001_initial.py
1
1605
# Generated by Django 2.0.3 on 2018-06-30 17:27 import django.core.validators from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='ImgurConfig', fields=[ ...
mit
-4,660,612,646,727,245,000
38.146341
194
0.560748
false
dsweet04/rekall
rekall-core/rekall/plugins/windows/heap_analysis.py
1
16866
# Rekall Memory Forensics # Copyright 2014 Google Inc. All Rights Reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or (at # your option) any later ver...
gpl-2.0
5,344,717,608,450,970,000
37.594966
104
0.563441
false
google/makani
gs/monitor2/apps/plugins/indicators/servo.py
1
17733
# Copyright 2020 Makani Technologies 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...
apache-2.0
5,210,630,127,275,359,000
35.189796
79
0.646366
false
barak/autograd
examples/fluidsim/wing.py
1
6136
from __future__ import absolute_import from __future__ import print_function import autograd.numpy as np from autograd import value_and_grad from scipy.optimize import minimize import matplotlib.pyplot as plt import os from builtins import range rows, cols = 40, 60 # Fluid simulation code based on # "Real-Time Flui...
mit
7,440,294,014,902,484,000
36.414634
100
0.608703
false
gkc1000/pyscf
pyscf/nao/test/test_0021_nao_after_gpaw.py
1
2374
# Copyright 2014-2018 The PySCF Developers. 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 appl...
apache-2.0
8,433,557,450,837,063,000
39.237288
187
0.689553
false
MarvinTeichmann/KittiBox
tests/test_anno_load.py
1
14271
from __future__ import absolute_import from __future__ import division from __future__ import print_function import itertools import json import logging import os import sys import random from random import shuffle import numpy as np import scipy as scp import scipy.misc sys.path.insert(1, '../incl') from scipy.mis...
mit
-198,509,635,553,043,260
31.434091
78
0.529676
false
endlessm/chromium-browser
third_party/llvm/llvm/utils/lit/tests/unit/TestRunner.py
1
11413
# RUN: %{python} %s # # END. import os.path import platform import unittest import lit.discovery import lit.LitConfig import lit.Test as Test from lit.TestRunner import ParserKind, IntegratedTestKeywordParser, \ parseIntegratedTestScript class TestIntegratedTestKeywordParser(unittest.Tes...
bsd-3-clause
876,312,506,175,296,800
40.959559
100
0.557697
false
MrBloodyshadow/ShadowHunter
ini_file_validator.py
1
1651
# -*- coding: utf-8 -*- import configparser def config_file_exists(filename): config = configparser.ConfigParser() try: with open(filename) as f: config.read(f) f.close() except IOError: raise def validate_ini_file(filename, sections): try: config_fil...
mit
-8,916,940,849,141,490,000
27.964912
89
0.553604
false
baayso/learn-python3
basic/the_list.py
1
1216
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # list是一种有序的集合,可以随时添加和删除其中的元素 classmates = ['Michael', 'Bob', 'Tracy'] print(classmates) print(len(classmates)) print(classmates[0]) print(classmates[1]) print(classmates[2]) print(classmates[-1]) print(classmates[-2]) print(classmates[-3]) print() # 追加元素到末尾 classmates....
apache-2.0
-2,483,030,746,383,875,600
12.71831
48
0.676591
false
studenteternal/SoftLayer
get_list.py
1
1502
#!/usr/bin/python import yaml import SoftLayer from pprint import pprint credsFile = open("softcreds.yaml",'r') creds = yaml.load(credsFile) #print creds['username'] #print creds['api_key'] client = SoftLayer.Client(username=(creds['username']), api_key=(creds['api_key'])) n = 1 count = 1 kill_file = open("kill-...
mit
-2,538,125,823,673,107,500
28.45098
154
0.661784
false
beia/beialand
projects/CitisimWebApp/app/src/users.py
1
2358
#!flask/bin/python from flask_bcrypt import Bcrypt from flask_login import UserMixin from main import login_manager from main import mydb import MySQLdb @login_manager.user_loader def load_user(user_id): user = User() return user.getUserByID(int(user_id)) class User(UserMixin): id = None username = No...
gpl-3.0
5,566,151,524,797,660,000
29.623377
165
0.621713
false
joerocklin/gem5
src/arch/x86/isa/insts/x87/arithmetic/partial_remainder.py
1
2252
# Copyright (c) 2007 The Hewlett-Packard Development Company # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implemen...
bsd-3-clause
-8,913,529,199,190,918,000
47.956522
72
0.78286
false
openstack/manila
manila/tests/share/drivers/dummy.py
1
36007
# Copyright 2016 Mirantis 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...
apache-2.0
-266,839,410,979,436,220
39.639955
79
0.576443
false
porridge/apt-forktracer
lib/apt_forktracer/tests/test_config.py
1
1979
#!/usr/bin/python3 # apt-forktracer - a utility for managing package versions # Copyright (C) 2008,2010,2019 Marcin Owsiany <porridge@debian.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...
gpl-2.0
-973,769,816,005,193,500
37.057692
73
0.745831
false
gitterHQ/ansible
v2/ansible/playbook/attribute.py
1
1053
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible 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) an...
gpl-3.0
8,832,590,789,999,572,000
30.909091
70
0.720798
false
abusesa/idiokit
idiokit/xmpp/jid.py
1
6351
# Module for XMPP JID processing as defined in on RFC 3920 # (http://www.ietf.org/rfc/rfc3920.txt) And RFC 3454 # (http://www.ietf.org/rfc/rfc3454.txt). # # This module was originally written using both the above RFCs and the # xmppstringprep module of the pyxmpp package # (http://pyxmpp.jajcus.net/) as well as the # t...
mit
-8,818,032,369,330,515,000
27.608108
85
0.634861
false
moustakas/impy
teaching/siena_class_roster.py
1
3362
import requests #import BeautifulSoup from bs4 import BeautifulSoup import HTMLParser from HTMLParser import HTMLParser import sys import os # Open the file. r = open(sys.argv[1]) if not os.path.isdir('Detail_Class_List_files'): os.rename('Detail Class List_files', 'Detail_Class_List_files') # Try to parse the ...
gpl-2.0
-457,119,040,262,636,200
29.844037
113
0.467281
false
vitan/hue
desktop/libs/hadoop/src/hadoop/cluster.py
1
7247
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
apache-2.0
5,338,848,230,225,687,000
25.840741
132
0.673796
false
woel0007/caravel
caravel/config.py
1
5672
"""The main config file for Caravel All configuration in this file can be overridden by providing a caravel_config in your PYTHONPATH as there is a ``from caravel_config import *`` at the end of this file. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function ...
apache-2.0
6,318,949,344,365,207,000
29.494624
78
0.590973
false
facebookexperimental/eden
eden/integration/snapshot/verify.py
1
9902
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # # This software may be used and distributed according to the terms of the # GNU General Public License version 2. # pyre-strict import abc import os import stat as stat_mod import typing from pathlib import Path from typing import Dict, Itera...
gpl-2.0
-8,863,614,257,235,671,000
34.113475
86
0.608261
false
codelv/enaml-native
src/enamlnative/widgets/popup_window.py
1
4574
""" Copyright (c) 2017, Jairus Martin. Distributed under the terms of the MIT License. The full license is in the file LICENSE, distributed with this software. Created on Mar 17, 2018 @author: jrm """ from atom.api import ( Typed, ForwardTyped, Str, Float, Coerced, Bool, Enum, observe, ) from enaml.core.declar...
mit
-8,627,291,073,902,098,000
27.234568
79
0.593791
false
gst/alignak
alignak/macroresolver.py
2
23875
# -*- coding: utf-8 -*- # # Copyright (C) 2015-2015: Alignak team, see AUTHORS.txt file for contributors # # This file is part of Alignak. # # Alignak 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, eit...
agpl-3.0
-6,827,662,738,583,955,000
35.442748
100
0.556054
false
redstorm45/factory-maker
graphics/text.py
1
1178
''' Copyright 2014 Pierre Cadart This file is part of Factory Maker. Factory Maker 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) a...
gpl-3.0
-1,593,186,073,715,944,000
27.731707
80
0.696944
false
vitormazzi/django-jython
doj/backends/zxjdbc/oracle/query.py
1
6130
""" Custom Query class for Oracle. Derived from: django.db.models.sql.query.Query """ import datetime from django.db.backends import util # Cache. Maps default query class to new Oracle query class. _classes = {} def query_class(QueryClass, Database): """ Returns a custom django.db.models.sql.query.Query su...
bsd-3-clause
7,167,331,611,330,312,000
44.073529
125
0.558564
false
simplegeo/sqlalchemy
lib/sqlalchemy/dialects/mssql/base.py
1
48621
# mssql.py """Support for the Microsoft SQL Server database. Connecting ---------- See the individual driver sections below for details on connecting. Auto Increment Behavior ----------------------- ``IDENTITY`` columns are supported by using SQLAlchemy ``schema.Sequence()`` objects. In other words:: Table('t...
mit
-1,975,082,025,182,092,500
34.962278
80
0.55947
false
pmuller/ipkg
ipkg/versions.py
1
1177
import __builtin__ # because we override sorted in this module import pkg_resources def compare(a, b): if a < b: return -1 elif a == b: return 0 else: # a > b return 1 def extract(item): if isinstance(item, dict): version = item['version'] revision = item['...
mit
-3,061,816,019,314,012,000
24.042553
72
0.620221
false
thuo/bc-6-matlabette
matlabette/operators.py
1
3521
""" Operators """ from errors import InvalidArgumentsForOperator, MatlabetteRuntimeError import numpy class Operators(object): @staticmethod def add(lhs, rhs): if isinstance(lhs, float): if isinstance(rhs, float): return lhs + rhs if isinstance(rhs, list): ...
mit
374,409,545,185,218,900
33.519608
77
0.587333
false
jacquev6/LowVoltage
LowVoltage/actions/tests/integ/test_create_table.py
1
7338
# coding: utf8 # Copyright 2014-2015 Vincent Jacques <vincent@vincent-jacques.net> import datetime import LowVoltage as _lv import LowVoltage.testing as _tst class CreateTableLocalIntegTests(_tst.LocalIntegTests): def tearDown(self): self.connection(_lv.DeleteTable("Aaa")) super(CreateTableLoca...
mit
2,983,920,477,913,561,600
55.015267
137
0.67239
false
pmdp/GIW
mongodb-1/consultas.py
1
10427
# -*- coding: utf-8 -*- from bottle import run, get, request, template from pymongo import MongoClient from os import linesep mongoclient = MongoClient() db = mongoclient.giw #Columnas para las tablas de los ejercicios 2, 3, 4, 5 y 7 all_table_data = ['Nombre de usuario', 'e-mail', 'Página web', 'Tarjeta de crédito'...
gpl-3.0
4,137,989,952,177,386,000
37.779851
177
0.592322
false
kklmn/xrt
xrt/backends/raycing/physconsts.py
1
1057
# -*- coding: utf-8 -*- __author__ = "Konstantin Klementiev", "Roman Chernikov" __date__ = "07 Jan 2016" PI = 3.1415926535897932384626433832795 PI2 = 6.283185307179586476925286766559 SQRT2PI = PI2**0.5 # =2.5066282746310002 SQ3 = 1.7320508075688772935274463415059 SQ2 = 2**0.5 # =1.4142135623730951 SQPI = PI**0.5 # ...
mit
-5,220,107,738,553,659,000
34.233333
71
0.659413
false
tuxfux-hlp-notes/python-batches
archieves/Batch-63/12-Logging/seventh.py
1
2105
#!/usr/bin/python # logging.basicConfig? # logging.Formatter? # man data or time.strftime(). # https://docs.python.org/2/library/subprocess.html # cronjob or scheduler # import logging.handlers for rest all handlers. from subprocess import Popen,PIPE from logging.handlers import SysLogHandler import logging #logging....
gpl-3.0
4,377,696,708,954,028,500
32.951613
87
0.705463
false
KristianJensen/cameo
cameo/network_analysis/networkx_based.py
1
3295
# Copyright 2015 Novo Nordisk Foundation Center for Biosustainability, DTU. # # 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 requi...
apache-2.0
-9,001,907,852,848,431,000
31.303922
122
0.640061
false
chand3040/cloud_that
lms/djangoapps/shoppingcart/processors/PayPal.py
1
21754
""" Implementation the PayPal processor. To enable this implementation, add the following to lms.auth.json: CC_PROCESSOR_NAME = "PayPal" CC_PROCESSOR = { "PayPal": { "PURCHASE_ENDPOINT": "sandbox or live url of paypal", "CLIENT_ID": "<paypal client_id>", "CLIENT_SEC...
agpl-3.0
322,017,873,674,394,940
42.077228
125
0.623472
false
u7702045/sanji-cellular
tests/test_e2e/view_cellular.py
1
2045
#!/usr/bin/env python # -*- coding: UTF-8 -*- import logging from sanji.core import Sanji from sanji.connection.mqtt import Mqtt REQ_RESOURCE = "/network/cellulars" class View(Sanji): # This function will be executed after registered. def run(self): print "Go Test 1" res = self.publish.g...
gpl-2.0
3,970,784,969,812,089,300
25.558442
69
0.49291
false
gimler/techism2
techism2/ical/views.py
1
3450
#!/usr/local/bin/python # -*- coding: utf-8 -*- from django.http import HttpResponse from django.core.urlresolvers import reverse from techism2 import service from datetime import datetime, timedelta import icalendar import time def ical(request): ninety_days = datetime.utcnow() + timedelta(days=90) event_lis...
apache-2.0
7,792,382,559,504,474,000
43.217949
115
0.627428
false
infobip/infobip-api-python-client
infobip/api/model/nc/notify/NumberContextResponse.py
1
1285
# -*- coding: utf-8 -*- """This is a generated class and is not intended for modification! """ from datetime import datetime from infobip.util.models import DefaultObject, serializable from infobip.api.model.nc.notify.NumberContextResponseDetails import NumberContextResponseDetails class NumberContextResponse(Defau...
apache-2.0
2,975,082,414,965,617,700
25.791667
97
0.637354
false
glenc/sp.py
src/sp/utils.py
1
3239
# Set up References import clr clr.AddReference("System") clr.AddReference("Microsoft.SharePoint") from System import Uri from Microsoft.SharePoint import * from Microsoft.SharePoint.Administration import SPWebApplication # Enumeration # These are simple enumeration methods for walking over various SharePoint # objec...
bsd-3-clause
7,495,485,383,914,679,000
20.885135
82
0.710096
false
dukhlov/oslo.messaging
oslo_messaging/_drivers/zmq_driver/server/consumers/zmq_router_consumer.py
1
3834
# Copyright 2015 Mirantis, 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 ...
apache-2.0
3,290,392,908,728,405,500
37.727273
78
0.6265
false
stormi/tsunami
src/primaires/objet/commandes/remplir/__init__.py
1
4652
# -*-coding:Utf-8 -* # Copyright (c) 2010 LE GOFF Vincent # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # l...
bsd-3-clause
-5,609,864,221,507,276,000
41.981481
79
0.615252
false
DTOcean/dtocean-core
tests/test_data_definitions_timetable.py
1
7507
import pytest from datetime import datetime, timedelta import numpy as np import pandas as pd import matplotlib.pyplot as plt from aneris.control.factory import InterfaceFactory from dtocean_core.core import (AutoFileInput, AutoFileOutput, AutoPlot, ...
gpl-3.0
-5,739,731,147,225,360,000
25.620567
76
0.499534
false
SVilgelm/CloudFerry
cloudferry/lib/base/action/is_end_iter.py
1
1174
# Copyright (c) 2014 Mirantis 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, so...
apache-2.0
8,738,482,862,329,376,000
32.542857
70
0.682283
false
punchagan/zulip
zerver/webhooks/pagerduty/view.py
1
7008
# Webhooks for external integrations. from typing import Any, Dict, Sequence from django.http import HttpRequest, HttpResponse from zerver.decorator import webhook_view from zerver.lib.exceptions import UnsupportedWebhookEventType from zerver.lib.request import REQ, has_request_variables from zerver.lib.response impo...
apache-2.0
2,138,208,620,822,185,200
34.21608
100
0.661244
false
peterkuma/tjrapid
ob/views.py
1
1560
# -*- coding: utf-8 -*- from django.shortcuts import render from django.template import RequestContext from django.utils import translation from django.shortcuts import get_object_or_404 from django.http import Http404, HttpResponseRedirect from main.models import * from ob.models import * def events(request, categ...
mit
-8,542,457,093,815,724,000
25.896552
69
0.730128
false
sorenh/python-django-repomgmt
repomgmt/admin.py
1
1108
# # Copyright 2012 Cisco Systems, Inc. # # Author: Soren Hansen <sorhanse@cisco.com> # # 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...
apache-2.0
1,229,453,740,046,272,500
35.933333
76
0.775271
false
rlbabyuk/integration_tests
cfme/scripting/ipyshell.py
1
1483
# -*- coding: utf-8 -*- import sys from . import quickstart from IPython.terminal.interactiveshell import TerminalInteractiveShell IMPORTS = [ 'from utils import conf', 'from fixtures.pytest_store import store', 'from utils.appliance.implementations.ui import navigate_to', 'from utils import providers...
gpl-2.0
-2,106,811,254,778,584,000
37.025641
97
0.675657
false
cedias/NNPy
NNPy.py
1
14499
#-*- coding: utf-8 -*- import numpy as np # ############ # # Abstractions # # ############ # # Losses class Loss: #Calcule la valeur du loss étant données les valeurs prédites et désirées def getLossValue(self,predicted_output,desired_output): pass #Calcule le gradient (pour chaq...
mit
1,651,238,196,075,126,300
30.526201
114
0.636817
false
google-research/google-research
enas_lm/src/tpu/data_utils.py
1
3091
# coding=utf-8 # Copyright 2021 The Google Research 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 applicab...
apache-2.0
5,911,740,309,309,060,000
36.240964
79
0.664833
false
PVirie/aknowthai
src/test.py
1
1728
import gen import network as ann import numpy as np import util def eval(neural_net, data, labels): classes, alphas = neural_net.scan(data, gen.get_default_total_code()) data3ch = util.cvtColorGrey2RGB(data) red = np.array([1.0, 0.0, 0.0], dtype=np.float32) for b in xrange(alphas.shape[0]): f...
mit
-4,338,133,510,740,657,000
31.603774
96
0.601852
false
xingnix/learning
machinelearning/python/computationallearningtheory/weightedmajority.py
1
2790
import re import numpy as np input_string = """ Example Sky AirTemp Humidity Wind Water Forecast EnjoySport 1 Sunny Warm Normal Strong Warm Same Yes 2 Sunny Warm High Strong Warm Same Yes 3 Rainy Cold High Strong Warm Change No 4 Sunny Warm High Strong Cool Change...
gpl-3.0
3,463,591,842,420,936,000
29.659341
104
0.513262
false
cpbl/cpblUtilities
matplotlib_utils.py
1
7242
#!/usr/bin/python import matplotlib.pyplot as plt def prepare_figure_for_publication(ax=None, width_cm=None, width_inches=None, height_cm=None, height_inches=None, fontsize=None, fontsize_labels=None, fontsiz...
gpl-3.0
-5,737,185,367,860,241,000
43.158537
474
0.627175
false
sarrionandia/taber
data/views.py
1
4616
from django.core.exceptions import ObjectDoesNotExist from django.http import HttpResponse, Http404 from django.utils.decorators import method_decorator from django.views.generic import View from django.template import RequestContext, loader from models import Institution, Judge, Team, Venue from django.views.decorator...
gpl-2.0
3,279,643,001,639,974,000
29.569536
90
0.630416
false
efforia/django-socialize
socialize/urls.py
1
1668
#!/usr/bin/python # # This file is part of django-socialize project. # # Copyright (C) 2011-2020 William Oliveira de Lagos <william.lagos@icloud.com> # # Socialize is free software: you can redistribute it and/or modify # it under the terms of the Lesser GNU General Public License as published by # the Free Software Fo...
lgpl-3.0
-5,867,830,235,791,402,000
33.75
78
0.676259
false
googleapis/googleapis-gen
google/cloud/essentialcontacts/v1/essentialcontacts-v1-py/google/cloud/essential_contacts_v1/services/essential_contacts_service/transports/grpc_asyncio.py
1
18910
# -*- 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
-8,979,955,842,416,071,000
44.347722
94
0.615812
false
xzhang2016/tfagent
tfta/test/test2_json.py
1
40826
from kqml import KQMLList, KQMLString from tfta.tfta import TFTA from tfta.tfta_module import TFTA_Module from bioagents.tests.util import ekb_from_text, ekb_kstring_from_text, \ get_request, agent_clj_from_text from bioagents.tests.integration import _IntegrationTest, _FailureTest from...
bsd-2-clause
-776,647,102,837,806,700
38.445411
119
0.606452
false
cajone/pychess
lib/pychess/widgets/ChatWindow.py
1
3808
import re from gi.repository import Gtk from pychess.widgets.ChatView import ChatView from pychess.widgets.ViewsPanel import ViewsPanel from pychess.widgets.InfoPanel import InfoPanel from pychess.widgets.ChannelsPanel import ChannelsPanel TYPE_PERSONAL, TYPE_CHANNEL, TYPE_GUEST, \ TYPE_ADMIN, TYPE_COMP, TYPE_BL...
gpl-3.0
-2,369,495,915,848,076,000
33
77
0.608193
false
dowjones/respawn
respawn/autoscaling.py
1
15011
from cfn_pyplates import core, functions from ec2 import BlockDevice, BlockDeviceMapping from errors import RespawnResourceError class MetricsCollection(core.JSONableDict): """ Creates a Metrics Collection :param granularity: String :param kwargs: metrics - [ String, ... ] """ ...
isc
4,011,306,310,980,120,600
38.193211
120
0.500433
false