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
Scalr/libcloud
libcloud/test/common/test_openstack_identity.py
1
37442
# 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 use ...
apache-2.0
-8,319,677,392,506,798,000
43.310059
117
0.558464
false
4.281043
true
false
false
kietdlam/Dator
data_api/tests/test_api.py
1
7525
from django.core.urlresolvers import reverse from django.test import TestCase, Client from data_api.models import System, Program, SystemModel, Map, LocalComputer, Command, Signal, Setting, Event, Blob from django.utils.timezone import now import json class TestAPI(TestCase): def setUp(self): self.client ...
mit
-4,153,298,484,396,160,500
47.87013
122
0.626312
false
3.75499
true
false
false
tysonholub/twilio-python
twilio/rest/preview/sync/service/sync_map/sync_map_permission.py
1
16320
# coding=utf-8 r""" This code was generated by \ / _ _ _| _ _ | (_)\/(_)(_|\/| |(/_ v1.0.0 / / """ from twilio.base import values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource f...
mit
6,234,231,684,607,785,000
34.71116
109
0.622488
false
4.425163
false
false
false
arulalant/20-20-20
eye-refresher-20-20-20/setup.py
1
5914
#!/usr/bin/env python # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- ### BEGIN LICENSE # Copyright (C) 2014 <Arulalan.T> <arulalant@gmail.com> # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License version 3, as publish...
gpl-3.0
-3,586,376,260,701,555,700
38.945946
112
0.592524
false
3.635916
false
false
false
ActiveState/code
recipes/Python/577293_Maclaurinsseriesexponentialx/recipe-577293.py
1
1346
#On the name of ALLAH and may the blessing and peace of Allah #be upon the Messenger of Allah Mohamed Salla Allahu Aliahi Wassalam. #Author : Fouad Teniou #Date : 06/07/10 #version :2.6 """ maclaurin_expenantial is a function to compute e^x using maclaurin series and the interval of convergence is -inf < x < + inf e...
mit
-1,262,528,246,409,297,700
26.469388
73
0.586181
false
3.115741
false
false
false
mollie/mollie-api-python
examples/04-ideal-payment.py
1
3172
# Example: How to prepare an iDEAL payment with the Mollie API. # import os import time import flask from app import database_write from mollie.api.client import Client from mollie.api.error import Error def main(): try: # # Initialize the Mollie API library with your API key. # ...
bsd-2-clause
6,795,914,718,951,253,000
33.835165
111
0.567192
false
4.160105
false
false
false
delicb/STExtensions
repojsonconverter.py
1
2818
from collections import OrderedDict import re import json import sublime import sublime_plugin from xml.etree import ElementTree as ET NS = 'http://telventdms.com/automatedtesting/repository/' # repo = etree.parse(r'D:\sources\AutoTests\3.4.1\Repos\builder.xml') # root = repo.getroot() # print(dir(root)) # print(roo...
gpl-3.0
-6,214,032,628,975,842,000
34.670886
99
0.600071
false
3.717678
false
false
false
RedHatInsights/insights-core
insights/ocp.py
1
2492
""" Top level OpenShift 4 component =============================== The :py:func:`conf` component recognizes insights-operator and must-gather archives. """ import logging import os import yaml from fnmatch import fnmatch from insights.core.plugins import component, datasource from insights.core.context import Insight...
apache-2.0
3,250,631,066,069,565,400
27
104
0.656501
false
3.816233
false
false
false
cdepman/falcon_api
site-packages/rethinkdb/_import.py
1
43389
#!/usr/bin/env python from __future__ import print_function import signal import sys, os, datetime, time, json, traceback, csv import multiprocessing, multiprocessing.queues, subprocess, re, ctypes, codecs from optparse import OptionParser from ._backup import * import rethinkdb as r # Used because of API difference...
mit
-8,782,667,616,708,055,000
45.06051
159
0.586946
false
4.07485
false
false
false
ionelmc/borg
borg/repository.py
1
24910
from configparser import RawConfigParser from binascii import hexlify from itertools import islice import errno import os import shutil import struct import sys from zlib import crc32 from .hashindex import NSIndex from .helpers import Error, IntegrityError, read_msgpack, write_msgpack, unhexlify from .locking import ...
bsd-3-clause
-3,622,053,810,611,526,000
38.352291
128
0.56118
false
4.091656
true
false
false
zentralopensource/zentral
tests/osquery/test_setup_file_categories.py
1
7622
from functools import reduce import operator from django.contrib.auth.models import Group, Permission from django.db.models import Q from django.test import TestCase, override_settings from django.urls import reverse from django.utils.crypto import get_random_string from accounts.models import User from zentral.contrib...
apache-2.0
-5,645,174,297,442,532,000
46.049383
115
0.663343
false
4.041357
true
false
false
SnowWalkerJ/quantlib
quant/data/wind/tables/asharemargintradesum.py
1
2106
from ....common.db.sql import VARCHAR, Numeric as NUMBER, DateTime as DATETIME, Column, BaseModel, CLOB, DATE VARCHAR2 = VARCHAR class AShareMarginTradeSum(BaseModel): """ 4.32 中国A股融资融券交易汇总 Attributes ---------- object_id: VARCHAR2(100) 对象ID trade_dt: VARCHAR2(8) 日期 ...
gpl-3.0
1,095,036,121,240,428,800
33.553191
109
0.660099
false
1.804444
false
false
false
scrapinghub/dateparser
tests/test_languages.py
1
102108
from io import StringIO import logging from parameterized import parameterized, param from dateparser.languages import default_loader, Locale from dateparser.languages.validation import LanguageValidator from dateparser.conf import apply_settings from dateparser.search.detection import AutoDetectLanguage, ExactLangua...
bsd-3-clause
-638,355,453,111,467,000
43.520737
118
0.53334
false
2.604886
true
false
false
gds-attic/migratorator
tools/directgov/map_sanitiser.py
1
2488
#!/usr/bin/env python import sys import os.path import csv import json import urllib2 """ convert a DirectGov mapping GoogleDoc into Migratorator JSON """ def parse_section_name(name): # TODO: parse out section name from our file name bits = name.split('-') return urllib2.unquote(bits[1]) if len(sys.argv...
mit
1,569,544,083,688,882,700
24.131313
80
0.453778
false
3.893584
false
false
false
rob2910/dd_water_pumps
data_helper.py
1
1460
"""read_data.py: Helper script to read data from csv files.""" import config import pandas as pd import numpy as np import datetime as dt import pre_process def setCatgories(data,fields): for field in fields: data[field] = pd.Categorical.from_array(data[field]).codes return data dataConv = lambda t : (dt.dateti...
mit
-6,868,289,896,099,813,000
44.65625
414
0.730137
false
3.237251
false
false
false
tensorflow/tensor2tensor
tensor2tensor/data_generators/ops/subword_text_encoder_ops_test.py
1
1348
# coding=utf-8 # Copyright 2021 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
apache-2.0
-7,421,747,445,913,794,000
32.7
74
0.732938
false
3.510417
true
false
false
stsouko/naivemapper
NaiveMapper/ValFix.py
1
1955
import time class ValFix(object): def getMap(self, s_graph, p_graph, _map, matrix, weights): self.__time = time.perf_counter() self.__cost, self.new_map = 0, dict() twins = {x: set(m.loc[lambda m_row: abs(m_row - c) < .0000001].index.tolist()) for x, m, c in ((x, matrix[x]...
agpl-3.0
4,646,018,587,549,978,000
49.128205
112
0.479795
false
3.049922
false
false
false
sosey/ginga
examples/qt/example2_qt.py
1
8265
#! /usr/bin/env python # # example2_qt.py -- Simple, configurable FITS viewer. # # Eric Jeschke (eric@naoj.org) # # Copyright (c) Eric R. Jeschke. All rights reserved. # This is open-source software licensed under a BSD license. # Please see the file LICENSE.txt for details. # from __future__ import print_function im...
bsd-3-clause
3,359,050,266,382,949,000
30.788462
100
0.580157
false
3.689732
false
false
false
mattvonrocketstein/smash
smashlib/ipy3x/core/magic.py
1
26547
# encoding: utf-8 """Magic functions for InteractiveShell. """ from __future__ import print_function #----------------------------------------------------------------------------- # Copyright (C) 2001 Janko Hauser <jhauser@zscout.de> and # Copyright (C) 2001 Fernando Perez <fperez@colorado.edu> # Copyright (C) 2008...
mit
-5,277,935,102,509,021,000
36.128671
106
0.590688
false
4.299109
true
false
false
pedohorse/hpaste
python3.7libs/hpaste/hpastewebplugins/disabled/hastebin.py
1
2351
from urllib import request from urllib.error import URLError, HTTPError import json from ..webclipboardbase import WebClipBoardBase, WebClipBoardWidNotFound from .. import hpasteoptions as opt class HasteBin(WebClipBoardBase): def __init__(self): self.__headers = {'Accept': 'text/html,application/xhtml+xml,applic...
lgpl-3.0
2,991,879,051,627,120,600
30.346667
218
0.706933
false
3.177027
false
false
false
marcus-nystrom/share-gaze
demo_shared_gaze/iView/iview_SDK.py
1
13561
#!/usr/bin/env python # -*- coding: utf-8 -*- # Load required packages from psychopy import core, event, misc from iViewXAPI import* from iViewXAPIReturnCodes import* import threading import my_Ring_Buffer as my_rb import datetime import numpy as np epoch = datetime.datetime(2015, 9, 1, 2) ...
mit
3,918,829,064,098,951,700
38.759531
123
0.485691
false
4.355284
false
false
false
kermitfr/kermit-webui
src/webui/agent/views.py
1
9486
from django.http import HttpResponse, HttpResponseRedirect, Http404 from django.utils import simplejson as json import logging from webui.agent.models import Agent from django.template.loader import render_to_string from webui.agent.form import create_action_form from django.template.context import RequestContext from ...
gpl-3.0
357,434,654,816,494,200
50.84153
247
0.562092
false
4.575977
false
false
false
lewiskan/heron
heron/executor/src/python/heron_executor.py
1
37075
# Copyright 2016 Twitter. 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
-6,060,401,942,649,926,000
41.178612
100
0.636251
false
3.788576
true
false
false
willyg302/ok
ok/utils.py
1
2507
import os import sys import contextlib import imp from subprocess import call, STDOUT CONFIG = 'okfile' class OkException(Exception): pass ######################################## # COMPATIBILITY ######################################## PY2 = sys.version_info[0] == 2 if PY2: import urllib else: import urlli...
mit
-3,225,831,462,818,724,400
23.339806
87
0.644196
false
3.453168
false
false
false
mlensment/rebot
lib/arm.py
1
2925
import time import servo_process as sp class Arm: def __init__(self): self.spoon_status = 'empty' self.leg_status = 'retracted' def init(self): self.sp = sp.ServoProcess() self.sp.start() def is_initialized(self): return self.sp.initialized.value def update(se...
mit
3,210,064,675,348,505,600
26.857143
82
0.572308
false
3.417056
false
false
false
ZhuangER/Search-Engine
search_engine.py
1
1983
import requests from bs4 import BeautifulSoup import logging import time import re import os.path from base64 import b16encode logging.getLogger().setLevel(logging.DEBUG) _r_learnprogramming_url = re.compile(r'http://(www.)?reddit.com/r/learnprogramming') def downloadRedditUrl(url): logging.debug("Downloading url: {...
mit
-2,783,316,346,907,406,300
31.508197
86
0.70701
false
3.036753
false
false
false
william-gr/dojango
dojango/views.py
1
14285
# Create your views here. from django.apps import apps get_model = apps.get_model from django.db import models from django.shortcuts import render_to_response from django.conf import settings from dojango.util import to_dojo_data, json_encode from dojango.decorators import json_response from dojango.util import to_doj...
bsd-3-clause
-2,426,354,905,808,857,000
58.273859
162
0.567938
false
3.715215
false
false
false
MihanEntalpo/PoTrans
setup.py
1
3840
"""A setuptools based setup module. PoTrans """ # Always prefer setuptools over distutils from setuptools import setup, find_packages # To use a consistent encoding from codecs import open from os import path here = path.abspath(path.dirname(__file__)) # Get the long description from the README file with open(path....
mit
1,252,029,457,369,960,000
33.285714
94
0.663281
false
3.991684
false
false
false
Tomsod/gemrb
gemrb/GUIScripts/pst/Start.py
1
3178
# -*-python-*- # GemRB - Infinity Engine Emulator # Copyright (C) 2003 The GemRB Project # # 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) ...
gpl-2.0
-1,955,335,508,410,785,800
28.155963
109
0.759597
false
3.052834
false
false
false
lindemann09/numerosity_production_task
numprod-demo.py
1
1787
#!/usr/bin/python """ Example for the Numerosity Production Task depends on Expyriment 0.7 or larger """ from expyriment import control, misc, stimuli from numprod import NumerosityProductionTask control.defaults.auto_create_subject_id = True control.defaults.screen_open_gl = False # presentation is more fluent ...
mit
4,218,581,252,772,283,400
30.350877
83
0.634583
false
3.559761
false
false
false
community-ssu/alarmd
build_tools/cflow_filter.py
1
7277
#! /usr/bin/env python # ============================================================================ # # This file is part of Alarmd # # Copyright (C) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). # # Contact: Simo Piiroinen <simo.piiroinen@nokia.com> # # Alarmd is free software; you can redistribute i...
lgpl-2.1
1,609,586,397,937,656,600
26.254682
81
0.45527
false
3.096596
false
false
false
dataewan/frantic-accelerator
FranticAccelerator/Filters.py
1
1387
""" Define all the jinja2 filters that I need. I don't think I should need *too* many filters. """ import codecs import markdown from jinja2 import Markup from docutils.core import publish_parts def do_rst(to_convert): """ This filter converts a rst string to html. """ output = Markup(publish_parts(so...
gpl-3.0
-231,119,556,574,177,800
28.510638
82
0.643115
false
4.008671
false
false
false
arsenovic/galgebra
examples/Terminal/ConformalConsole.py
1
1978
from __future__ import print_function from sympy import Symbol, symbols, sin, cos, Rational, expand, simplify, collect from sympy import Rational as Rat from galgebra.printer import Format, Eprint, Get_Program from galgebra.ga import Ga from math import sqrt global n,nbar,I def radius(T): ''' This retrieves ...
bsd-3-clause
7,797,380,110,466,294,000
18.203883
102
0.577351
false
2.321596
false
false
false
joshfuchs/ZZCeti_pipeline
diagnostics.py
1
36843
# -*- coding: utf-8 -*- """ Diagnostic Plots for Pipeline Author: Patrick O'Brien Date last updated: February 2017 """ # Import statements from glob import glob import os import numpy as np from matplotlib.backends.backend_pdf import PdfPages import matplotlib.pyplot as plt from PyPDF2 import PdfFileMerger import panda...
mit
341,964,862,515,325,400
33.082331
317
0.538393
false
3.085162
false
false
false
printedheart/opennars
nars_gui/src/main/python/nef_theano/origin.py
1
6559
from theano import tensor as TT from theano.tensor.shared_randomstreams import RandomStreams import theano import numpy import neuron import collections import numpy as np def make_samples(num_samples, dimensions, srng): """Generate sample points uniformly distributed within the sphere Returns float array of s...
agpl-3.0
7,264,938,751,129,159,000
56.535088
189
0.668242
false
4.228885
false
false
false
cdsi/elrond
src/python/elrond/static.py
1
2380
from __future__ import division from __future__ import with_statement import math import numpy as np def is_odd(x): return bool(x & 0x01) def clamp(x, l=None, u=None): """return value limited by lower and/or upper bounds""" if u is not None: x = min(x, u) if l is not...
mit
9,149,125,898,658,527,000
22.333333
83
0.522689
false
3.173333
false
false
false
Lucterios2/contacts
lucterios/mailing/printmodel/Message_0001.py
1
2759
# -*- coding: utf-8 -*- ''' Printmodel django module for dummy @author: Laurent GAY @organization: sd-libre.fr @contact: info@sd-libre.fr @copyright: 2016 sd-libre.fr @license: This file is part of Lucterios. Lucterios is free software: you can redistribute it and/or modify it under the terms of the GNU General Publi...
gpl-3.0
6,661,851,594,123,307,000
42.109375
233
0.689743
false
2.77008
false
false
false
fernandojvdasilva/centering_py
src/corpus/Word.py
1
6325
''' Created on 03/11/2009 @author: Fernando Copyright 2009-2013 Fernando J. V. da Silva This file is part of centering_py. centering_py is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Fo...
gpl-3.0
853,951,327,328,149,500
36.345455
147
0.532016
false
4.222296
false
false
false
lucastanure/GoGo-Real-Software
core/communication/serial/tools/list_ports.py
1
2987
#!/usr/bin/env python # portable serial port access with python # this is a wrapper module for different platform implementations of the # port enumeration feature # # (C) 2011 Chris Liechti <cliechti@gmx.net> # this is distributed under a free software license, see license.txt """\ This module will provide a functio...
gpl-3.0
-1,900,352,705,985,982,500
29.171717
107
0.61299
false
3.91481
false
false
false
roman-kashitsyn/redmate
redmate/supplier.py
1
2058
"""Suppliers module. """ from . import utils from . import messaging class DbSupplier(object): def __init__(self, query, params=None): self.query = query self.params = params def __enter__(self): return self def __exit__(self, *args): self.cursor.close() def __call__...
mit
-3,062,445,914,473,326,000
22.930233
69
0.584062
false
3.825279
false
false
false
destination-hack/seatguru
FlaskApp/flightaware.py
1
1494
import json import re import random from urllib import urlretrieve from urllib2 import urlopen, URLError from pprint import pprint from bs4 import BeautifulSoup from retrying import retry # https://flightaware.com/live/flight/{flightcode} FLIGHTAWARE_URL = "https://flightaware.com/live/flight/{}" """ gets origin and ...
gpl-3.0
2,077,567,369,206,554,600
35.439024
82
0.700803
false
3.061475
false
false
false
kai06046/labeler
src/app.py
1
18360
import copy import json import logging import os import time import tkinter as tk from tkinter import ttk import cv2 import numpy as np from PIL import Image, ImageTk from src.keyhandler import KeyHandler from src.utils import Utils N = 300 LOGGER = logging.getLogger(__name__) class Labeler(tk.Frame, Utils, KeyHand...
apache-2.0
-3,332,890,392,045,789,700
40.583524
165
0.590744
false
3.132023
true
false
false
SmartElect/SmartElect
help_desk/forms.py
1
13146
from collections import namedtuple import logging from django import forms from django.contrib.auth.forms import UserCreationForm from django.contrib.auth.models import User, Group from django.core.exceptions import ValidationError from django.utils.translation import ugettext_lazy as _ from django.utils.timezone impo...
apache-2.0
3,924,021,178,113,049,600
35.115385
98
0.596836
false
3.972801
false
false
false
ncc-unesp/goo-dataproxy
core/storage/local.py
1
1688
# This file is part of goo-dataproxy. # # Copyright (c) 2103-2014 by Nucleo de Computacao Cientifica, UNESP # # Authors: # Beraldo Leal <beraldo AT ncc DOT unesp DOT br> # Gabriel von. Winckler <winckler AT ncc DOT unesp DOT br> # # goo-dataproxy is free software: you can redistribute it and/or modify # it under ...
gpl-3.0
-1,775,530,434,510,437,000
34.914894
74
0.718009
false
3.480412
false
false
false
homhei/glance
bin/glance.py
1
3416
#!/usr/bin/env python #encode=utf-8 #vim: tabstop=4 shiftwidth=4 softtabstop=4 #Created on 2013-6-7 #Copyright 2013 nuoqingyun xuqifeng import sys import time import os possible_topdir = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]), os.pardir, os.pardir)) if os.path...
apache-2.0
-254,126,492,494,727,170
28.448276
87
0.543911
false
3.873016
false
false
false
ellisonbg/altair
altair/utils/save.py
1
3830
import json import six from .core import write_file_or_filename from .mimebundle import spec_to_mimebundle def save(chart, fp, vega_version, vegaembed_version, format=None, mode=None, vegalite_version=None, embed_options=None, json_kwds=None, webdriver='chrome'): """Save a chart to file in a v...
bsd-3-clause
-7,988,532,428,946,107,000
38.895833
79
0.563185
false
4.09188
false
false
false
lfairchild/PmagPy
dialogs/demag_dialogs.py
1
74061
#!/usr/bin/env python import matplotlib import numpy as np import wx import copy import os import pmagpy.pmag as pmag import pmagpy.ipmag as ipmag import matplotlib.pyplot as plt from matplotlib.figure import Figure from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigCanvas from matplotlib.backends....
bsd-3-clause
1,370,362,597,965,084,200
42.234676
247
0.554961
false
3.430179
false
false
false
Pathoschild/stewbot
stewbot/components/Documentation.py
1
2697
# -*- coding: utf-8 -*- ####################################################### ## Documentation ## Abstracts documentation using an n-dimensioned hash. ## ## Documentation( hash ) ## Construct instance given a hash of documentation strings, with ## topic=>documentation mappings. Sub-topics can be specified as ## t...
isc
2,290,480,134,271,384,800
27.389474
110
0.539488
false
3.625
false
false
false
hackatbrown/2015.hackatbrown.org
scripts/download_resumes.py
1
1224
from csv import DictReader hackers = [h for h in DictReader(open('resumes.csv')) if h.get('resume', 'None') != 'None'] from collections import defaultdict hackers_with_names = defaultdict(int) def strip_name(name): alphabet = 'abcdefghijklmnopqrstuvwxyz ' return ''.join([c for c in name if c in alphabet + alphabet....
mit
2,671,622,698,827,433,000
25.630435
91
0.707516
false
3.022222
false
false
false
rwl/godot
godot/graph.py
1
56591
#------------------------------------------------------------------------------ # Copyright (c) 2009 Richard W. Lincoln # # 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 restricti...
mit
-3,264,219,030,547,562,000
48.510936
226
0.647046
false
3.970741
false
false
false
hugopalmer/assortment_optimization
sample/generalization.py
1
4060
############################# # FILE generalization.py # Reads a transaction dataset, a features data set and a GDT trained choice model # Returns the generalized choice model with regard to those features # # Returns a dataset choice_model_gen_####.py on all the products # print("#######################...
gpl-3.0
-3,475,359,332,503,357,400
33.946903
156
0.599507
false
3.56453
false
false
false
matthiaskramm/corepy
corepy/arch/x86/isa/x86_insts.py
1
54946
# Copyright (c) 2006-2009 The Trustees of Indiana University. # All rights reserved. # # Redistribution and use in source and binary forms, with or without ...
bsd-3-clause
-3,933,744,260,521,806,000
28.102754
118
0.634332
false
3.258376
false
false
false
wkentaro/fcn
examples/apc2016/datasets/rbo.py
1
2463
import glob import os import os.path as osp import re import chainer import numpy as np import scipy.misc from sklearn.model_selection import train_test_split from base import APC2016DatasetBase class APC2016rboDataset(APC2016DatasetBase): def __init__(self, data_type): assert data_type in ('train', 'v...
mit
6,989,087,612,546,952,000
31.84
74
0.580187
false
3.228047
false
false
false
marcosbontempo/inatelos
poky-daisy/meta/lib/oeqa/selftest/prservice.py
1
5129
import unittest import os import logging import re import shutil import datetime import oeqa.utils.ftools as ftools from oeqa.selftest.base import oeSelfTest from oeqa.utils.commands import runCmd, bitbake, get_bb_var class BitbakePrTests(oeSelfTest): def get_pr_version(self, package_name): pkgdata_dir =...
mit
-3,528,455,520,598,448,000
44.389381
169
0.652759
false
3.166049
true
false
false
Huyuwei/tvm
topi/python/topi/opengl/softmax.py
1
2054
# 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,088,279,253,726,987,000
33.233333
87
0.671373
false
3.965251
false
false
false
kirberich/qicrawler
quotes_page/core/views.py
1
6035
import random import time from django.http import HttpResponse, HttpResponseRedirect from django.shortcuts import render_to_response from django.template import RequestContext from django.core.cache import cache from django.utils import simplejson as json from django.views.decorators.http import require_POST from djan...
mit
-1,627,095,718,137,962,500
34.292398
145
0.617564
false
3.959974
false
false
false
abramhindle/UnnaturalCodeFork
python/testdata/launchpad/lib/lp/translations/scripts/tests/test_verify_pofile_stats.py
1
1073
# Copyright 2011 Canonical Ltd. This software is licensed under the # GNU Affero General Public License version 3 (see the file LICENSE). """Integration-test POFile statistics verification script.""" __metaclass__ = type from lp.testing import TestCaseWithFactory from lp.testing.dbuser import dbuser from lp.testing...
agpl-3.0
-2,822,482,089,949,901,000
36
76
0.730662
false
4.079848
true
false
false
mkieszek/odoo
addons/hr_holidays/__openerp__.py
2
2243
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. { 'name': 'Leave Management', 'version': '1.5', 'category': 'Human Resources', 'sequence': 85, 'summary': 'Holidays, Allocation and Leave Requests', 'website': 'https://www.odoo.com/page/employee...
agpl-3.0
5,130,964,635,409,238,000
40.537037
339
0.66741
false
3.948944
false
false
false
NeCTAR-RC/designate
designate/openstack/common/rpc/common.py
1
18588
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # Copyright 2011 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the ...
apache-2.0
-8,085,748,542,957,529,000
35.590551
79
0.64547
false
4.331857
false
false
false
jordanhatcher/Automation
src/package_module_loader.py
1
2820
""" Module to help load python modules from packages """ import logging import os import importlib LOGGER = logging.getLogger(__name__) MODULE_TYPES = ('conditions', 'nodes') CLASS_NAME_CONSTS = ('NODE_CLASS_NAME', 'CONDITION_CLASS_NAME') def load_package_modules(local_directory): """ Loads all modules for ...
cc0-1.0
-3,092,497,619,587,063,300
28.684211
79
0.583333
false
4.208955
false
false
false
cvxopt/chompack
src/python/pybase/llt.py
1
1847
from cvxopt import matrix, blas, lapack from chompack.symbolic import cspmatrix from chompack.misc import frontal_add_update def llt(L): """ Supernodal multifrontal Cholesky product: .. math:: X = LL^T where :math:`L` is lower-triangular. On exit, the argument `L` contains the product :m...
gpl-3.0
6,511,012,725,095,469,000
28.790323
91
0.546833
false
2.781627
false
false
false
Lancey6/redwind
redwind/plugins/wm_sender.py
1
9539
from redwind import hooks from redwind.models import Post from redwind.tasks import get_queue, async_app_context from bs4 import BeautifulSoup import re import requests import urllib from flask import current_app, request, jsonify, Blueprint from flask.ext.login import login_required wm_sender = Blueprint('wm_sender'...
bsd-2-clause
-1,642,027,157,502,162,200
33.561594
81
0.638851
false
3.791335
false
false
false
jacobbridges/pydash
tests/fixtures.py
1
1924
# -*- coding: utf-8 -*- from copy import deepcopy import pytest from pydash._compat import iteritems # pytest.mark is a generator so create alias for convenience parametrize = pytest.mark.parametrize class Object(object): def __init__(self, **attrs): for key, value in iteritems(attrs): se...
mit
-3,046,140,426,850,156,000
19.688172
70
0.598753
false
3.630189
false
false
false
rsachetto/harpia
harpia/s2iblockpropertiesgui.py
1
4675
# -*- coding: utf-8 -*- # [HARPIA PROJECT] # # # S2i - Intelligent Industrial Systems # DAS - Automation and Systems Department # UFSC - Federal University of Santa Catarina # Copyright: 2006 - 2007 Luis Carlos Dill Junges (lcdjunges@yahoo.com.br), Clovis Peruchi Scotti (scotti@ieee.org), # Guilh...
gpl-2.0
5,912,955,523,149,503,000
30.375839
139
0.554225
false
3.841413
false
false
false
furby32/pattern_recognition
testm.py
1
1285
#!/usr/bin/env python # -*- coding: utf-8 -*-import sys import sys import time import numpy as np import matplotlib.pyplot as plt from generator import ClassGenerator from generator import ClassHolder from Clasifier import EculedianDistance from Clasifier import Mahalanobis from Clasifier import MaxProbability #numCl...
gpl-2.0
2,076,360,986,759,291,600
29.595238
69
0.697276
false
2.644033
false
false
false
lielongxingkong/ics_demo
ics_demo/remote_services/proxy.py
1
2544
import logging from remoto import Connection from .registers import registered_services from ics_demo.dao import host_dao from ics_demo.helpers.exc import DuplicatedError, AlreadyExistsError, NotFoundError, InconsistentError from ics_demo.helpers.base import uuidgen, valid_ipaddr from ics_demo.helpers.remotes import ...
mit
-5,135,669,533,180,357,000
33.849315
143
0.607704
false
4.083467
false
false
false
ProfessorKaos64/openlierox
share/gamedir/scripts/dedicated_control_io.py
1
6270
#!/usr/bin/python -u # Dedicated Control handler script for OpenLieroX # (http://openlierox.sourceforge.net) # Needed for sleeping/pausing execution import time # Needed for directory access import os import sys import traceback def getRawResponse(): global EmptySignalsCount ret = sys.stdin.readline().strip() if...
lgpl-2.1
-3,921,530,379,107,408,000
23.588235
101
0.678788
false
2.790387
false
false
false
kmcginn/advent-of-code
2016/day01/taxicab2.py
1
2910
def handleTurn(heading, turn): if heading == 'N': if turn == 'L': return 'W' else: return 'E' elif heading == 'S': if turn == 'L': return 'E' else: return 'W' elif heading == 'E': if turn == 'L': return 'N' ...
mit
7,165,224,227,126,920,000
28.393939
624
0.45189
false
2.602862
false
false
false
MichaelCoughlinAN/Odds-N-Ends
Python/auto_refresh.py
1
2793
import argparse import os import time import datetime import psutil from datetime import timedelta from pywinauto import timings from pywinauto.application import Application # Default settings window_name = '- Power BI Desktop' refresh_rate = '60' def type_keys(string, element): for char in string: ele...
gpl-3.0
1,332,417,725,673,223,700
25.855769
127
0.641962
false
3.709163
false
false
false
ubalance-team/magum
setup.py
1
1350
from setuptools import setup, find_packages import os base_dir = os.path.dirname(__file__) about = {} with open(os.path.join(base_dir, "magum", "__about__.py")) as f: exec(f.read(), about) """readme = os.path.join(base_dir, 'README.rst') with open(readme) as f: long_description = f.read() """ CFFI_VERSI...
gpl-2.0
-7,041,784,796,534,272,000
31.95122
74
0.585926
false
3.668478
false
true
false
matslindh/kimochi-consumer
kimochiconsumer/views.py
1
1026
from pyramid.view import view_config from pyramid.httpexceptions import ( HTTPNotFound, ) @view_config(route_name='page', renderer='templates/page.mako') @view_config(route_name='page_view', renderer='templates/page.mako') def page_view(request): if 'page_id' in request.matchdict: data = request.kimo...
mit
-8,673,928,296,049,635,000
27.5
104
0.707602
false
3.513699
false
false
false
EdgeBotix/Samplecode
ObstTurn.py
1
2674
# This code demonstrates how the eBot can be used to detect an obstacle and turn left/right/stop. # All sonar values are reported during the exercise. # Copyright (c) 2014, Erik Wilhelm # All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided ...
gpl-2.0
4,513,647,044,807,884,000
39.515152
98
0.749439
false
3.713889
false
false
false
anubhav929/eden
modules/s3survey.py
1
143139
# -*- coding: utf-8 -*- """ Custom UI Widgets used by the survey application @copyright: 2011-2012 (c) Sahana Software Foundation @license: MIT Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to...
mit
8,890,392,464,022,313,000
37.991828
199
0.47632
false
4.87514
false
false
false
Azure/azure-sdk-for-python
sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/operations/_operations.py
1
4724
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
mit
-1,996,423,103,268,574,700
42.33945
133
0.640347
false
4.617791
false
false
false
Jaza/flask-editablesite
tests/test_sample_images.py
1
1318
# -*- coding: utf-8 -*- """Test the sample image selection.""" import os from flask_editablesite.app import create_app from flask_editablesite.settings import TestConfig from flask_editablesite.editable.sample_images import ( placeholder_or_random_sample_image,) def test_placeholder_when_no_sample_images_conf...
apache-2.0
3,499,932,829,937,683,000
29.651163
65
0.694992
false
3.477573
true
false
false
Unity-Technologies/ml-agents
ml-agents/mlagents/trainers/tests/test_torch_utils.py
1
1293
import pytest from unittest import mock import torch # noqa I201 from mlagents.torch_utils import set_torch_config, default_device from mlagents.trainers.settings import TorchSettings @pytest.mark.parametrize( "device_str, expected_type, expected_index, expected_tensor_type", [ ("cpu", "cpu", None,...
apache-2.0
1,444,733,508,747,415,600
30.536585
82
0.661253
false
3.736994
false
false
false
fabio-d/honeypot
udp_sip.py
1
4737
#!/usr/bin/env python2 # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that ...
gpl-2.0
-5,194,560,694,260,964,000
34.886364
117
0.680388
false
2.86917
false
false
false
probml/pyprobml
scripts/ae_layerwise_fashion_tf.py
1
3195
# Greedy layerwise training of a 2 layer autoencoder (MLP) on Fashion MNIST # Code is based on # https://github.com/ageron/handson-ml2/blob/master/17_autoencoders_and_gans.ipynb import numpy as np import matplotlib.pyplot as plt import os figdir = "../figures" def save_fig(fname): plt.savefig(os.path.join(figdir, fn...
mit
5,285,867,060,013,627,000
35.318182
93
0.678873
false
3.060345
false
false
false
libvirt/libvirt-test-API
libvirttestapi/repos/domain/blkstats.py
1
1816
# Copyright (C) 2010-2012 Red Hat, Inc. # This work is licensed under the GNU GPLv2 or later. # To test domain block device statistics import time import libvirt from libvirt import libvirtError from libvirttestapi.src import sharedmod from libvirttestapi.utils.utils import get_xml_value required_params = ('guestnam...
gpl-2.0
5,286,986,153,606,862,000
26.104478
67
0.620595
false
3.56778
false
false
false
thiagopa/planyourexchange-server
restserver/migrations/0010_auto_20150811_1428.py
1
2497
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import smart_selects.db_fields from decimal import Decimal import djmoney.models.fields class Migration(migrations.Migration): dependencies = [ ('restserver', '0009_auto_20150811_1400'), ] o...
agpl-3.0
4,065,526,242,503,280,600
41.322034
157
0.629555
false
3.859351
false
false
false
lukecampbell/python-gsw
gsw/gibbs/practical_salinity.py
1
27130
# -*- coding: utf-8 -*- from __future__ import division import numpy as np from library import Hill_ratio_at_SP2 from gsw.utilities import match_args_return __all__ = [ 'SP_from_C', 'C_from_SP', 'SP_from_R', 'R_from_SP', 'SP_salinometer', 'SP_from_SK...
mit
8,330,333,412,065,768,000
34.65046
79
0.57394
false
2.575959
false
false
false
ralph-group/pymeasure
pymeasure/display/browser.py
1
5317
# # This file is part of the PyMeasure package. # # Copyright (c) 2013-2021 PyMeasure Developers # # 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 limit...
mit
-7,707,478,491,721,473,000
39.587786
87
0.675193
false
4.36894
false
false
false
cpennington/edx-platform
pavelib/utils/test/suites/pytest_suite.py
1
13377
# pylint: disable=unicode-format-string """ Classes used for defining and running pytest test suites """ import os from glob import glob from pavelib.utils.envs import Env from pavelib.utils.test import utils as test_utils from pavelib.utils.test.suites.suite import TestSuite from pavelib.utils.test.utils import COV...
agpl-3.0
4,954,686,030,532,658,000
36.788136
119
0.558571
false
4.018324
true
false
false
thibault/libnexmo
tests/test_send_sms.py
1
3416
# -*- coding: utf-8 -*- from __future__ import unicode_literals from decimal import Decimal as D import responses from libnexmo import Nexmo from libnexmo.response import NexmoResponse API_KEY = 'my_api_key' API_SECRET = 'my_api_secret' nexmo = Nexmo(API_KEY, API_SECRET) FRM = '+33123456789' TO = '+33987654321' M...
mit
1,042,221,251,179,943,200
29.774775
83
0.531616
false
3.962877
false
false
false
Alberto-Beralix/Beralix
i386-squashfs-root/usr/share/hplip/ui4/faxsetupdialog.py
1
9448
# -*- coding: utf-8 -*- # # (c) Copyright 2001-2009 Hewlett-Packard Development Company, L.P. # # 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 opt...
gpl-3.0
-6,101,176,566,254,835,000
29.775244
200
0.631033
false
3.888066
false
false
false
dabura667/electrum
lib/pem.py
1
6815
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2015 Thomas Voegtlin # # 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...
mit
6,942,977,397,443,579,000
33.948718
111
0.663536
false
3.073974
false
false
false
Debian/dak
dak/dakdb/update111.py
1
1738
# coding=utf8 """ Make install_date in source consistant with binaries @contact: Debian FTP Master <ftpmaster@debian.org> @copyright: 2015, Mark Hymers <mhy@debian.org> @license: GNU General Public License version 2 or later """ # This program is free software; you can redistribute it and/or modify # it under the te...
gpl-2.0
-7,516,357,312,449,959,000
30.6
111
0.649022
false
4.312655
false
false
false
muccg/rdrf
rdrf/rdrf/migrations/0027_cdefile.py
1
1076
# -*- coding: utf-8 -*- from django.db import migrations, models import rdrf.models.definition.models class Migration(migrations.Migration): dependencies = [ ('rdrf', '0026_auto_20160314_1127'), ] operations = [ migrations.CreateModel( name='CDEFile', fields=[ ...
agpl-3.0
8,110,105,616,371,632,000
38.851852
118
0.604089
false
3.870504
false
false
false
ARLahan/authomatic
authomatic/providers/oauth2.py
1
50499
# -*- coding: utf-8 -*- """ |oauth2| Providers ------------------- Providers which implement the |oauth2|_ protocol. .. autosummary:: OAuth2 Behance Bitly Cosm DeviantART Facebook Foursquare GitHub Google LinkedIn PayPal Reddit Viadeo VK WindowsLive ...
mit
-4,201,579,905,363,650,600
30.581614
156
0.549852
false
4.245397
false
false
false
akiokio/centralfitestoque
src/.pycharm_helpers/python_stubs/-1807332816/_elementtree.py
1
3358
# encoding: utf-8 # module _elementtree # from /usr/lib/python2.7/lib-dynload/_elementtree.so # by generator 1.130 # no doc # imports import xml.etree.ElementPath as ElementPath # /usr/lib/python2.7/xml/etree/ElementPath.pyc import xml.etree.ElementTree as __xml_etree_ElementTree # Variables with simple values VERS...
bsd-2-clause
-4,699,906,557,381,204,000
22.319444
101
0.649196
false
3.807256
false
false
false
konsou/autsball
game_object.py
1
15509
# -*- coding: utf-8 -*- import pygame import vector import math import copy import types import sound import assets from colors import * # from assets import assets, assets_rot, assets_mask, assets_rot_mask class GameObject(pygame.sprite.Sprite): """ Classi joka perii pygamen Spriten ja lisää y...
mit
-3,850,579,865,449,074,000
41.630372
120
0.629868
false
3.025432
false
false
false
dknlght/dkodi
src/script.module.urlresolver/lib/urlresolver/plugins/wstream.py
1
1605
""" Plugin for UrlResolver Copyright (C) 2020 gujal This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. ...
gpl-2.0
-1,024,168,325,403,714,300
44.857143
105
0.610592
false
4.063291
false
false
false
colloquium/spacewalk
client/solaris/smartpm/smart/searcher.py
1
6117
# # Copyright (c) 2005 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
7,834,604,820,554,287,000
31.537234
75
0.600458
false
3.943907
false
false
false
wolcomm/prngmgr
tests/conftest.py
1
2365
# Copyright 2017 Workonline Communications (Pty) Ltd. All rights reserved. # # The contents of this file are 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/LIC...
apache-2.0
-7,339,718,558,451,043,000
30.533333
79
0.609725
false
4.395911
false
false
false
coldnew/zephyr-project-fork
doc/scripts/genrest/genrest.py
1
2790
# Prints a tree of all items in the configuration # vim: tabstop=4 shiftwidth=4 expandtab import kconfiglib import sys # Integers representing symbol types UNKNOWN, BOOL, TRISTATE, STRING, HEX, INT = range(6) # Strings to use for types TYPENAME = {UNKNOWN: "unknown", BOOL: "bool", TRISTATE: "tristate", S...
apache-2.0
-6,484,145,446,880,817,000
32.614458
84
0.598925
false
3.651832
true
false
false
TuxEatPi/common
tuxeatpi_common/cli.py
1
2155
"""TuxEatPi Base Main module""" import logging import os import sys import click from setproctitle import setproctitle # pylint: disable=E0611 from tuxeatpi_common.daemon import TepBaseDaemon DAEMON_CLASS = None def set_daemon_class(class_object): """Set DAEMON_CLASS global variable This variable is used...
apache-2.0
799,804,679,415,159,700
33.758065
90
0.619026
false
3.603679
false
false
false
alexbruy/QGIS
python/testing/__init__.py
1
9869
# -*- coding: utf-8 -*- """ *************************************************************************** __init__.py --------------------- Date : January 2016 Copyright : (C) 2016 by Matthias Kuhn Email : matthias@opengis.ch *********************************...
gpl-2.0
3,958,837,082,458,436,000
33.267361
125
0.510487
false
4.861576
true
false
false
StartupsPoleEmploi/labonneboite
labonneboite/alembic/versions/2e6781936bae_drop_irrelevant_etablissements_raw_.py
1
1264
""" drop irrelevant etablissements_raw columns Revision ID: 2e6781936bae Revises: d441dca1e974 Create Date: 2018-08-23 17:14:11.736661 """ from alembic import op from sqlalchemy.dialects import mysql import sqlalchemy as sa # Revision identifiers, used by Alembic. revision = '2e6781936bae' down_revision = '0da6b26c2...
agpl-3.0
8,019,603,568,447,008,000
34.111111
103
0.72943
false
3.05314
false
false
false
VirToReal/VirToCut
Python Software/CommandsStack.py
1
50840
#!/usr/bin/env python # -*- coding: utf-8 -*- #VirToCut - Controlsoftware for a dynamical Plate-Saw-Machine #Copyright (C) 2016 Benjamin Hirmer - hardy at virtoreal.net #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 Fr...
gpl-3.0
6,914,094,647,843,214,000
76.344564
275
0.639231
false
3.185293
false
false
false
blorenz/vimeo.py
vimeo/client.py
1
3051
#! /usr/bin/env python # encoding: utf-8 from __future__ import absolute_import from functools import wraps import json import requests from .auth.client_credentials import ClientCredentialsMixin from .auth.authorization_code import AuthorizationCodeMixin from .upload import UploadMixin class VimeoClient(ClientCrede...
apache-2.0
-1,121,839,580,067,840,500
34.476744
84
0.603736
false
4.185185
false
false
false