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
rep/hpfeeds
tests/test_client_integration_py2.py
1
1398
import logging import threading import unittest from hpfeeds import client from hpfeeds.protocol import readpublish from .fakebroker import FakeBroker, setup_default_reactor class TestClientIntegration(unittest.TestCase): log = logging.getLogger('hpfeeds.testserver') def _server_thread(self): self...
gpl-3.0
5,969,301,653,231,483,000
25.377358
76
0.633763
false
geosim/QAD
qad_joindisjoin_cmd.py
1
25015
# -*- coding: utf-8 -*- """ /*************************************************************************** QAD Quantum Aided Design plugin comando JOIN e DISJOIN per aggregare e disgregare le geometrie (multipoint, multilinestring, poligon e multipoligon) ------------------- be...
gpl-3.0
-2,137,112,879,578,955,000
39.693811
139
0.577587
false
pointhi/kicad-footprint-generator
scripts/Packages/Package_Gullwing__QFP_SOIC_SO/ipc_gullwing_generator.py
1
30745
#!/usr/bin/env python3 import sys import os import argparse import yaml import math sys.path.append(os.path.join(sys.path[0], "..", "..", "..")) # load parent path of KicadModTree from KicadModTree import * # NOQA from KicadModTree.nodes.base.Pad import Pad # NOQA sys.path.append(os.path.join(sys.path[0], "..", "...
gpl-3.0
-423,376,989,085,531,260
46.574303
199
0.557056
false
drwahl/pimometer
bin/mongo_config.py
1
5605
#!/usr/bin/env python # vim: set expandtab: """ ********************************************************************** GPL License *********************************************************************** This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public Lic...
gpl-2.0
-256,066,831,566,277,950
29.966851
90
0.603211
false
SUSE/kiwi
kiwi/utils/sysconfig.py
1
2856
# Copyright (c) 2015 SUSE Linux GmbH. All rights reserved. # # This file is part of kiwi. # # kiwi 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 la...
gpl-3.0
-2,067,535,882,005,381,400
33
70
0.572129
false
lucadealfaro/crowdranker
controllers/feedback.py
1
10966
# -*- coding: utf-8 -*- import access import util @auth.requires_login() def index(): """Produces a list of the feedback obtained for a given venue, or for all venues.""" venue_id = request.args(0) if venue_id == 'all': q = (db.submission.user == get_user_email()) else: q = ((db.su...
bsd-3-clause
-9,091,172,184,251,331,000
45.66383
138
0.621922
false
gabrielmagno/nano-dlna
nanodlna/dlna.py
1
1582
#!/usr/bin/env python3 # encoding: UTF-8 import os import pkgutil import sys from xml.sax.saxutils import escape as xmlescape if sys.version_info.major == 3: import urllib.request as urllibreq else: import urllib2 as urllibreq def send_dlna_action(device, data, action): action_data = pkgutil.get_data( ...
mit
4,625,877,574,989,528,000
27.763636
78
0.616941
false
morevnaproject/RenderChan
renderchan/contrib/pencil2d.py
1
5111
__author__ = 'Konstantin Dmitriev' from renderchan.module import RenderChanModule from renderchan.utils import is_true_string from distutils.version import StrictVersion import subprocess import tempfile import os from xml.etree import ElementTree class RenderChanPencil2dModule(RenderChanModule): def __init__(s...
bsd-3-clause
-8,211,885,996,274,041,000
43.443478
285
0.576208
false
eggplantbren/NSwMCMC
python/straightline2.py
1
2303
import copy import numpy as np import numpy.random as rng import scipy.special from utils import randh from numba import jit # How many parameters are there? num_params = 4 # Some data data = np.loadtxt("road.txt") N = data.shape[0] # Number of data points # Plot the data import matplotlib.pyplot as plt plt.plot(dat...
gpl-2.0
5,760,810,357,822,276,000
22.989583
87
0.6231
false
kennedyshead/home-assistant
tests/helpers/test_entity_registry.py
1
32162
"""Tests for the Entity Registry.""" from unittest.mock import patch import pytest from homeassistant import config_entries from homeassistant.const import EVENT_HOMEASSISTANT_START, STATE_UNAVAILABLE from homeassistant.core import CoreState, callback, valid_entity_id from homeassistant.exceptions import MaxLengthExc...
apache-2.0
2,473,947,555,476,688,400
32.819138
88
0.631864
false
ActiveState/code
recipes/Python/286240_Python_portscanners/recipe-286240.py
1
3523
# a simple portscanner with multithreading import socket as sk import sys import threading MAX_THREADS = 50 def usage(): print "\npyScan 0.1" print "usage: pyScan <host> [start port] [end port]" class Scanner(threading.Thread): def __init__(self, host, port): threading.Thread.__init__(self) ...
mit
749,350,839,647,121,400
26.523438
74
0.518024
false
bacaldwell/ironic
ironic/tests/unit/common/test_image_service.py
1
16700
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # d...
apache-2.0
4,742,086,651,356,532,000
47.688047
78
0.627365
false
CommonsCloud/Core-API
CommonsCloudAPI/models/user.py
1
8946
""" For CommonsCloud copyright information please see the LICENSE document (the "License") included with this software package. This file may not be used in any manner except in compliance with the License Unless required by applicable law or agreed to in writing, software distributed under the License is distributed ...
agpl-3.0
2,422,971,609,378,438,700
28.331148
145
0.705455
false
mjschultz/redlock
tests/test_lock.py
1
1801
from redlock import RedLock import time def test_default_connection_details_value(): """ Test that RedLock instance could be created with default value of `connection_details` argument. """ lock = RedLock("test_simple_lock") def test_simple_lock(): """ Test a RedLock can be acquired. ...
mit
3,412,506,755,901,172,000
26.707692
84
0.62965
false
chme/plugin.audio.mpdclient2
mpdclient/Navigation.py
1
19566
# # Copyright (c) chme # # This file is part of the mpdclient kodi plugin # # This plugin 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 ...
gpl-3.0
-9,181,020,625,052,426,000
39.342268
163
0.525759
false
Psycojoker/hackeragenda
hackeragenda/settings.py
1
5897
# Django settings for hackeragenda project. import os from collections import OrderedDict PROJECT_PATH = os.path.abspath(os.path.split(__file__)[0]) SUBPROJECT_PATH = os.path.split(PROJECT_PATH)[0] BASE_DIR = PROJECT_PATH # to avoid stupid warning from django 1.6 DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( ...
gpl-3.0
-9,104,221,644,388,092,000
21.76834
72
0.575886
false
mbr/flatland0
tests/schema/test_dicts.py
1
17601
from flatland import ( Dict, Integer, String, SparseDict, Unset, ) from flatland.util import Unspecified, keyslice_pairs from tests._util import ( asciistr, udict, unicode_coercion_available, ) import six import pytest def test_dict(): with pytest.raises(TypeError): Dict()...
mit
-5,521,041,941,222,855,000
25.075556
77
0.546276
false
wooga/airflow
tests/providers/microsoft/azure/operators/test_file_to_wasb.py
1
2779
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
apache-2.0
-3,118,337,514,945,456,000
33.308642
87
0.635121
false
lizardsystem/lizard-map
lizard_map/daterange.py
1
2259
"""Handle the date range setting and remembering """ import datetime import logging from django.conf import settings import pytz # NOTE: this module is obsolete as date ranges are entirely handled in # javascript and should be passed as request parameter logger = logging.getLogger(__name__) # Session data postfix...
lgpl-3.0
-1,085,294,113,683,170,700
29.527027
78
0.698539
false
mlperf/training_results_v0.5
v0.5.0/nvidia/submission/code/object_detection/pytorch/maskrcnn_benchmark/config/defaults.py
1
11814
# # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. # # Copyright (c) 2017-2018, NVIDIA CORPORATION. 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 a...
apache-2.0
-2,606,254,840,766,577,000
38.777778
83
0.604706
false
ajaygarg84/sugar
src/jarabe/frame/activitiestray.py
1
30803
# Copyright (C) 2006-2007 Red Hat, Inc. # Copyright (C) 2008 One Laptop Per Child # Copyright (C) 2010 Collabora Ltd. <http://www.collabora.co.uk/> # # 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 Foundati...
gpl-2.0
-8,059,462,500,647,446,000
36.610501
79
0.610103
false
explora26/zephyr
doc/conf.py
1
14566
# -*- coding: utf-8 -*- # # Zephyr documentation build configuration file, created by # sphinx-quickstart on Fri May 8 11:43:01 2015. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # Al...
apache-2.0
-3,894,528,861,728,211,000
32.405963
84
0.682595
false
0xbc/pyvex
setup.py
1
5029
# pylint: disable=no-name-in-module,import-error import os import urllib2 import subprocess import sys import shutil import glob import tarfile import multiprocessing import platform try: from setuptools import setup from setuptools import find_packages packages = find_packages() except ImportError: fr...
bsd-2-clause
5,826,168,124,604,355,000
32.751678
140
0.616624
false
eonpatapon/contrail-controller
src/config/fabric-ansible/job_manager/job_messages.py
1
9479
class MsgBundle(object): JOB_TEMPLATE_MISSING = 1, JOB_EXECUTION_ID_MISSING = 2, JOB_SUMMARY_MESSAGE_HDR = 3, JOB_RESULT_STATUS_NONE = 4, JOB_MULTI_DEVICE_FAILED_MESSAGE_HDR = 5, JOB_SINGLE_DEVICE_FAILED_MESSAGE_HDR = 6, PLAYBOOK_RESULTS_MESSAGE = 7, PLAYBOOK_EXIT_WITH_ERROR = 8, PL...
apache-2.0
-8,469,327,516,854,512,000
51.661111
78
0.450364
false
vitchyr/rlkit
rlkit/torch/sac/sac.py
1
8191
from collections import OrderedDict, namedtuple from typing import Tuple import numpy as np import torch import torch.optim as optim from rlkit.core.loss import LossFunction, LossStatistics from torch import nn as nn import rlkit.torch.pytorch_util as ptu from rlkit.core.eval_util import create_stats_ordered_dict fro...
mit
-7,586,187,944,391,447,000
30.026515
99
0.553534
false
pythondude325/flaskr
flaskr.py
1
3871
from postmarkup import render_bbcode from sqlite3 import connect from contextlib import closing from flask import Flask, request, session, g, redirect, url_for, abort, render_template, flash # config DATABASE = 'flaskr.db' DEBUG = True SECRET_KEY = 'devkey' USERNAME = 'admin' PASSWORD = 'default' # create app app = F...
mit
-5,481,024,899,938,952,000
29.007752
113
0.612245
false
medularis/py-star
py_star/astemu.py
1
4712
from __future__ import absolute_import, print_function, unicode_literals from os import fork, kill, waitpid from signal import SIGTERM import socket from time import sleep from . import compat_six as six class Event(dict): """ Events are encoded as dicts with a header fieldname to content-list map. Norm...
bsd-3-clause
8,920,116,669,416,906,000
32.41844
73
0.493633
false
cherokee/pyscgi
CTK/ProgressBar.py
1
1975
# CTK: Cherokee Toolkit # # Authors: # Alvaro Lopez Ortega <alvaro@alobbs.com> # # Copyright (C) 2010-2011 Alvaro Lopez Ortega # # This program is free software; you can redistribute it and/or # modify it under the terms of version 2 of the GNU General Public # License as published by the Free Software Foundation....
bsd-3-clause
-5,721,624,957,532,368,000
28.924242
90
0.620759
false
jabaier/iic1103.20152.s5
strings_listas_ej0.py
1
1320
# defina una función que dado una lista de numeros # retorne la suma de ellos def sumalista(l): # calcula l[0] + l[1] + l[2] + ... + l[??] # el largo de la lista l se obtiene con len(l) suma = 0 i = 0 while i < len(l): suma = suma + l[i] i = i + 1 return suma def sumalista_cool(l): ...
unlicense
-7,947,223,740,876,585,000
19.292308
62
0.541319
false
jalavik/plotextractor
plotextractor/converter.py
1
7853
# -*- coding: utf-8 -*- # # This file is part of plotextractor. # Copyright (C) 2010, 2011, 2015 CERN. # # plotextractor 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 (a...
gpl-2.0
7,425,665,071,529,268,000
36.754808
84
0.605246
false
jminuscula/dixit-online
server/src/dixit/api/game/views/player.py
1
2333
from django.db import IntegrityError from django.shortcuts import get_object_or_404 from rest_framework.permissions import IsAuthenticated from rest_framework.exceptions import NotFound from rest_framework.response import Response from rest_framework import generics, status from dixit.game.models import Player from ...
mit
-6,770,100,734,929,883,000
32.811594
100
0.675954
false
kasra-hosseini/obspyDMT
obspyDMT/tests/test_input_handler.py
1
6739
#!/usr/bin/env python # -*- coding: utf-8 -*- # ------------------------------------------------------------------- # Filename: test_input_handler.py # Purpose: testing input_handler # Author: Kasra Hosseini # Email: kasra.hosseinizad@earth.ox.ac.uk # License: GPLv3 # ----------------------------...
gpl-3.0
-1,119,200,854,747,404,200
39.113095
79
0.599644
false
ixaxaar/sdcc
support/regression/compact-results.py
1
1999
import sys, re import string """Simple script that scans all of the test suite results text fed in through stdin and summarises the total number of failures, test points, and test cases.""" # Read in everything lines = sys.stdin.readlines() # Init the running totals failures = 0 cases = 0 tests = 0 bytes = 0 ticks =...
gpl-2.0
9,146,120,504,725,573,000
29.287879
99
0.568284
false
mdworks2016/work_development
Python/20_Third_Certification/venv/lib/python3.7/site-packages/celery/backends/database/session.py
1
1896
# -*- coding: utf-8 -*- """SQLAlchemy session.""" from __future__ import absolute_import, unicode_literals from kombu.utils.compat import register_after_fork from sqlalchemy import create_engine from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import sessionmaker from sqlalchemy.pool import ...
apache-2.0
277,522,112,381,838,560
30.6
78
0.634494
false
tensorflow/compression
tensorflow_compression/python/util/packed_tensors.py
1
3070
# Copyright 2019 Google LLC. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
apache-2.0
-766,657,654,993,320,700
30.979167
80
0.657003
false
wzin/interactivespaces-python-api
tests/test_master.py
1
13234
#!/usr/bin/env python # -*- coding: utf-8 -*- import unittest from mock import MagicMock import json import urllib import urllib2 import sys import os sys.path.append(os.getcwd()) import interactivespaces TEST_ACTIVITY_DATA = { "id":"53", "bundleContentHash":"hjkl", ...
apache-2.0
-5,224,145,098,743,237,000
36.174157
102
0.504458
false
yollamttam/WordPrediction
EntropyBenchmarkUnigram.py
1
1302
import nltk import glob import pickle import numpy as np from fann2 import libfann ### Unigram perplexity # obvious alpha = 0.5 nExamples = 0 fileToEntropy = {} # load pickle wordsInOrder = pickle.load( open( "wordsInOrder.p", "rb" ) ) wordProb = pickle.load( open( "wordProbability.p", "rb" ) ) # load neural netwo...
apache-2.0
2,327,401,023,340,730,000
21.448276
62
0.659754
false
luiscape/hdxscraper-violation-documentation-center-syria
app/__main__.py
1
1039
#!/usr/bin/python # -*- coding: utf-8 -*- import os import sys dir = os.path.split(os.path.split(os.path.realpath(__file__))[0])[0] dir = os.path.join(dir, 'scripts') sys.path.append(dir) from setup.load import LoadConfig from utilities.prompt_format import item from utilities.database import CleanTable, StoreRecord...
mit
3,159,288,300,322,429,400
21.106383
68
0.668912
false
sfjuocekr/PokeIV
setup.py
1
1764
#!/usr/bin/env python #-- Setup file for py2exe from distutils.core import setup import py2exe import sys, os import Cryptodome import requests #find POGOProtos sys.path.append("pgoapi\protos") mydata = list() path = Cryptodome.__path__[0] root_end = path.find('Cryptodome') for folder,folder_name,files in os.walk(p...
mit
1,747,010,191,501,326,800
29.413793
78
0.560091
false
Matla/Python_Logging
logging/logging.py
1
6683
__author__ = "Mats Larsen" __copyright__ = "Mats Larsen2014" __credits__ = ["Morten Lind"] __license__ = "GPL" __maintainer__ = "Mats Larsen" __email__ = "matsla@{ntnu.no}" __status__ = "Development" #-------------------------------------------------------------------- #File: logging.py #Module Description """ This mod...
gpl-3.0
-5,752,381,826,589,844,000
38.081871
102
0.540326
false
emedvedev/st2
st2actions/st2actions/runners/windows_command_runner.py
1
4081
# Licensed to the StackStorm, Inc ('StackStorm') 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 th...
apache-2.0
-9,076,009,354,234,646,000
38.621359
92
0.627542
false
psathyrella/partis
bin/add-seqs-to-outputs.py
1
5004
#!/usr/bin/env python import csv import os import sys csv.field_size_limit(sys.maxsize) # make sure we can write very large csv fields import argparse import operator import colored_traceback.always import collections # if you move this script, you'll need to change this method of getting the imports partis_dir = os....
gpl-3.0
3,960,263,518,355,998,000
63.153846
391
0.733613
false
adityahase/frappe
frappe/core/doctype/navbar_settings/navbar_settings.py
1
1160
# -*- coding: utf-8 -*- # Copyright (c) 2020, Frappe Technologies and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe.model.document import Document from frappe import _ class NavbarSettings(Document): def validate(self): self.validat...
mit
5,117,916,987,784,409,000
28
89
0.735345
false
Julian/home-assistant
homeassistant/components/notify/pushbullet.py
1
4409
""" PushBullet platform for notify component. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/notify.pushbullet/ """ import logging from homeassistant.components.notify import ( ATTR_TARGET, ATTR_TITLE, BaseNotificationService) from homeassistant.con...
mit
-4,096,327,190,134,021,000
33.992063
78
0.604445
false
mdworks2016/work_development
Python/20_Third_Certification/venv/lib/python3.7/site-packages/django/contrib/gis/db/models/functions.py
1
16962
from decimal import Decimal from django.contrib.gis.db.models.fields import BaseSpatialField, GeometryField from django.contrib.gis.db.models.sql import AreaField, DistanceField from django.contrib.gis.geos import GEOSGeometry from django.core.exceptions import FieldError from django.db.models import ( BooleanFiel...
apache-2.0
7,931,150,428,917,694,000
35.24359
117
0.635538
false
himaaaatti/qtile
libqtile/widget/backlight.py
1
3044
# Copyright (c) 2012 Tim Neumann # Copyright (c) 2012, 2014 Tycho Andersen # Copyright (c) 2013 Tao Sauvage # Copyright (c) 2014 Sean Vig # # 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 wit...
mit
7,803,237,369,298,870,000
32.822222
79
0.638962
false
raphaelrubino/nid
nn/mono/run.py
1
1143
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from __future__ import absolute_import import numpy as np np.random.seed( 1337 ) import data_utils from nid import Neural_information_density import sys if __name__ == '__main__': if len( sys.argv ) != 9: print( "\nUsage: ", sys.argv[ 0 ], "<context> <target> <voc...
mit
8,807,348,404,547,177,000
26.878049
138
0.677165
false
komuW/sewer
sewer/catalog.py
1
2472
import codecs, importlib, json, os from typing import Dict, List, Sequence from .auth import ProviderBase class ProviderDescriptor: def __init__( self, *, name: str, desc: str, chals: Sequence[str], args: Sequence[Dict[str, str]], deps: Sequence[str], ...
mit
-5,405,137,072,739,433,000
30.692308
91
0.59021
false
wienerschnitzel/schnitzelserver
schnitzelserver/session/session.py
1
4940
import logging import enum from sqlalchemy import or_ from sqlalchemy import inspect from schnitzelserver.moduleindex import ModuleIndex from schnitzelserver.session.grant_access import SessionGrant from schnitzelserver.pool import ModelPool, ViewPool logger = logging.getLogger(__name__) class AccessTypes(enum.Enum...
lgpl-3.0
7,753,447,680,131,350,000
38.846774
114
0.591498
false
cprakashagr/PythonClass
src/maths/Haversine.py
1
1450
from math import radians, cos, sin, asin, sqrt import time current_milli_time = lambda: int(round(time.time() * 1000)) def haversine(point1, point2, miles = False): AVG_EARTH_RADIUS = 6371 lat1, lng1 = point1 lat2, lng2 = point2 # convert all latitudes/longitudes from decimal degrees to radians ...
mit
-8,202,962,493,890,972,000
22.015873
73
0.570345
false
dedupeio/dedupe-examples
pgsql_big_dedupe_example/pgsql_big_dedupe_example_init_db.py
1
10090
#!/usr/bin/env python # -*- coding: utf-8 -*- """ This is a setup script for mysql_example. It downloads a zip file of Illinois campaign contributions and loads them in t aMySQL database named 'contributions'. __Note:__ You will need to run this script first before execuing [mysql_example.py](http://datamade.github.c...
mit
-596,923,599,316,805,100
39.522088
87
0.615461
false
yunli2004/OpenClos
jnpr/openclos/util.py
2
8115
''' Created on Aug 21, 2014 @author: moloyc ''' import re import os import yaml import platform import datetime import shutil from netaddr import IPNetwork import netifaces from propLoader import propertyFileLocation TWO_STAGE_CONFIGURATOR_DEFAULT_ATTEMPT=5 TWO_STAGE_CONFIGURATOR_DEFAULT_INTERVAL=30 # in seconds TWO...
apache-2.0
3,603,975,910,876,883,000
29.855513
107
0.616266
false
xncbf/authome
log/views.py
1
3426
from django.contrib.auth.mixins import LoginRequiredMixin from django.contrib.auth.models import User from django.contrib.staticfiles.templatetags.staticfiles import static from django.urls import reverse from django.db import connection from django.shortcuts import render, HttpResponse from django.utils import timezon...
mit
8,670,323,591,795,827,000
43.763158
118
0.496179
false
LabD/wagtail-personalisation
tests/factories/rule.py
1
1032
from __future__ import absolute_import, unicode_literals import datetime import factory from wagtail_personalisation import rules class DayRuleFactory(factory.DjangoModelFactory): class Meta: model = rules.DayRule class DeviceRuleFactory(factory.DjangoModelFactory): class Meta: model = ...
mit
6,287,791,869,828,322,000
18.471698
59
0.719961
false
jfrfonseca/IndexadorDidaticoPython
fileIO.py
1
11925
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' José F. R. Fonseca See Attached License file Controls the access to the disk. Defines the class DIskAccessControl, an object to control the disk files. Multithread-writes the files ''' import ast import os import time from linecache import getline from threading impor...
gpl-2.0
-3,419,447,673,354,494,500
49.312236
126
0.617243
false
uberVU/elasticboard
data_processor/api.py
1
7727
from functools import partial, wraps import datetime import queries from utils import crossdomain from flask import Flask, jsonify, request from werkzeug.contrib.cache import MemcachedCache cache = MemcachedCache(['127.0.0.1:11211']) CACHE_TIMEOUT = 5 * 60 app = Flask(__name__) # app.debug = True CHART_INTERVALS = 6...
mit
-6,479,771,487,385,263,000
31.330544
116
0.671541
false
elhe/bread_diary_web
application/views.py
1
1189
from application import application, utils from application.urls import DIARY_ADD_URL, DIARY_ALL_URL from dateutil.parser import parser from flask import render_template, request, url_for from werkzeug.utils import redirect __author__ = 'elhe' @application.route('/', methods=['GET', ]) def index(): response = ...
gpl-2.0
5,933,237,861,314,215,000
35.030303
71
0.637511
false
jaseg/python-mpv
setup.py
1
1155
#!/usr/bin/env python3 from setuptools import setup setup( name = 'python-mpv', version = '0.5.1', py_modules = ['mpv'], description = 'A python interface to the mpv media player', url = 'https://github.com/jaseg/python-mpv', author = 'jaseg', author_email = 'github@jaseg.net', license ...
agpl-3.0
5,502,061,537,492,389,000
34
93
0.575758
false
cstrong/ProjectCost
app/__init__.py
1
1110
######################################### # # Project Cost project # # pyapp/__init__.py # ######################################### from flask import Flask from flask.ext.bootstrap import Bootstrap # Monkey patch to make flask-triangle work, since it is not yet compatible with python3 import builtins builtins.unicod...
mit
2,145,066,538,203,652,400
23.130435
87
0.672973
false
mahabuber/erpnext
erpnext/accounts/doctype/sales_invoice/sales_invoice.py
2
26538
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe import frappe.defaults from frappe.utils import cint, flt from frappe import _, msgprint, throw from erpnext.accounts.party import get_par...
agpl-3.0
6,422,347,278,987,420,000
35.204638
153
0.685771
false
ahwillia/PyNeuron-Toolbox
PyNeuronToolbox/neuromorpho.py
1
5790
""" Scraper for querying NeuroMorpho.Org from Python. For more on NeuroMorpho.Org, see: Ascoli GA, Donohue DE, Halavi M. (2007) NeuroMorpho.Org: a central resource for neuronal morphologies.J Neurosci., 27(35):9247-51 Run this file as a stand-alone script for a demo. The demo queries NeuroMorpho.Org in gener...
mit
-963,203,165,447,386,800
35.19375
137
0.647323
false
cloudify-cosmo/cloudify-cli
cloudify_cli/tests/commands/test_deployments.py
1
48285
######## # Copyright (c) 2018 Cloudify Platform Ltd. 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 requi...
apache-2.0
-2,392,071,210,047,672,000
40.339897
79
0.589334
false
Scille/parsec-cloud
parsec/backend/vlob.py
1
13190
# Parsec Cloud (https://parsec.cloud) Copyright (c) AGPLv3 2016-2021 Scille SAS from typing import List, Tuple, Dict, Optional from uuid import UUID import pendulum from parsec.utils import timestamps_in_the_ballpark from parsec.api.protocol import ( DeviceID, OrganizationID, vlob_create_serializer, v...
agpl-3.0
-1,780,366,703,321,259,500
31.407862
100
0.605762
false
nakagami/reportlab
src/reportlab/pdfbase/ttfonts.py
1
45587
#Copyright ReportLab Europe Ltd. 2000-2012 #see license.txt for license details __version__ = '$Id: ttfonts.py 3959 2012-09-27 14:39:39Z robin $' __doc__="""TrueType font support This defines classes to represent TrueType fonts. They know how to calculate their own width and how to write themselves into PDF files. T...
bsd-3-clause
468,004,839,853,736,800
38.67537
179
0.566653
false
lightalchemist/ML-algorithms
dim_reduction/spectral_embedding.py
1
1410
# -*- coding: utf-8 -*- import numpy as np def compute_pairwise_distance_matrix(X, k): """Compute pairwise distances between each point in X and its k-nearest neighbors.""" from scipy.spatial import KDTree kdtree = KDTree(X) A = np.zeros((X.shape[0], X.shape[0]), dtype=np.float) for i, x in...
mit
6,210,406,793,321,975,000
33.390244
82
0.614184
false
mick-d/nipype
nipype/interfaces/nipy/model.py
7
13161
# -*- coding: utf-8 -*- from __future__ import print_function, division, unicode_literals, absolute_import from builtins import range, str, bytes import os import nibabel as nb import numpy as np from ...utils.misc import package_check from ...utils import NUMPY_MMAP from ..base import (BaseInterface, TraitedSpec, ...
bsd-3-clause
6,562,482,735,676,853,000
39.74613
112
0.52458
false
X-dark/Flexget
flexget/__init__.py
1
1135
#!/usr/bin/python from __future__ import unicode_literals, division, absolute_import import os import logging from flexget import logger from flexget.options import get_parser from flexget import plugin from flexget.manager import Manager __version__ = '{git}' log = logging.getLogger('main') def main(args=None): ...
mit
-4,021,792,851,769,180,700
26.682927
74
0.672247
false
spcui/virt-test
virttest/libvirt_xml/vol_xml.py
1
3408
""" Module simplifying manipulation of XML described at http://libvirt.org/ """ from virttest.libvirt_xml import base, accessors class VolXMLBase(base.LibvirtXMLBase): """ Accessor methods for VolXML class. Properties: name: string, operates on XML name tag uuid: string, operates on uui...
gpl-2.0
-8,600,053,957,075,828,000
35.645161
80
0.569542
false
switowski/invenio
invenio/modules/submit/models.py
1
19892
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2011, 2012, 2015 CERN. # # Invenio 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 optio...
gpl-2.0
2,390,014,930,960,900,600
36.674242
78
0.61477
false
rhiever/sklearn-benchmarks
model_code/grid_search/SGDClassifier.py
1
1597
import sys import pandas as pd import numpy as np import itertools from sklearn.preprocessing import RobustScaler from sklearn.linear_model import SGDClassifier from evaluate_model import evaluate_model dataset = sys.argv[1] pipeline_components = [RobustScaler, SGDClassifier] pipeline_parameters = {} loss_values = [...
mit
2,270,912,534,851,505,000
52.233333
204
0.705698
false
sitexa/foobnix
foobnix/gui/top.py
1
2239
#-*- coding: utf-8 -*- ''' Created on 22 сент. 2010 @author: ivan ''' from gi.repository import Gtk from foobnix.gui.model.signal import FControl from foobnix.gui.state import LoadSave from foobnix.gui.menu import MenuBarWidget from foobnix.helpers.my_widgets import ImageButton from foobnix.helpers.menu import Popup...
gpl-3.0
2,132,427,195,450,941,200
30.928571
94
0.640268
false
inkhey/Transvoyage.py
transvoyage.py
1
13138
#!/usr/bin/python # -*- coding: utf-8 -*- # transvoyage.py # Version 0.3 # # Copyright 2014 Guénaël Muller <contact@inkey-art.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 Free Software Foundation; eit...
gpl-3.0
-8,850,327,259,524,849,000
35.261838
229
0.639038
false
MultiNet-80211/Hostapd
wpa_supplicant/examples/wpas-dbus-new-signals.py
1
6275
#!/usr/bin/python import dbus import sys, os import time import gobject from dbus.mainloop.glib import DBusGMainLoop WPAS_DBUS_SERVICE = "fi.w1.wpa_supplicant1" WPAS_DBUS_INTERFACE = "fi.w1.wpa_supplicant1" WPAS_DBUS_OPATH = "/fi/w1/wpa_supplicant1" WPAS_DBUS_INTERFACES_INTERFACE = "fi.w1.wpa_supplicant1...
gpl-2.0
1,071,992,416,003,939,100
28.91133
124
0.69259
false
itsCoder/itscoder.github.io
generate_post.py
1
1594
# coding=utf-8 import os import re FUCK_STR = ' ' PATTERN_PHASE_FILE = re.compile('\S+-weeklyblog-phase-(\d+)\.md') PATTERN_POST = re.compile('-\s*\[(.+)\]\((https?://\S+)\)\s*\(\[@(.+)\]\((.+)\)\)') PATTERN_CATEGORY = re.compile('#{5}\s*(.*?)\n') BLOG_DIR = '_posts/' def get_post(f, phase): phase_summary = '...
mit
-2,145,483,734,492,894,700
32.869565
83
0.466924
false
sdrogers/ms2ldaviz
ms2ldaviz/setup_feat_col.py
1
2204
import os import sys os.environ.setdefault("DJANGO_SETTINGS_MODULE", "ms2ldaviz.settings_simon") import django django.setup() from basicviz.models import * if __name__ == '__main__': other_experiment_name = sys.argv[1] fs,status = BVFeatureSet.objects.get_or_create(name = 'binned_005') if status: print("Crea...
mit
8,517,246,142,656,428,000
25.890244
125
0.685118
false
blue-yonder/pyscaffold
tests/test_update.py
1
7140
# -*- coding: utf-8 -*- import logging import os import re from os.path import join as path_join from pathlib import Path from pkg_resources import parse_version, working_set import pytest from pyscaffold import __version__, structure, update from pyscaffold.utils import chdir from .helpers import uniqstr EDITABLE...
mit
422,592,667,080,846,660
36.578947
84
0.621429
false
uni-peter-zheng/tp-qemu
openvswitch/tests/ovs_basic.py
4
10440
import logging import time import os from virttest import utils_misc, aexpect, utils_net, openvswitch, ovs_utils from virttest import versionable_class, data_dir from autotest.client.shared import error def allow_iperf_firewall(machine): machine.cmd("iptables -I INPUT -p tcp --dport 5001 --j ACCEPT") machine....
gpl-2.0
-4,935,766,518,107,801,000
39.153846
79
0.484962
false
beyoungwoo/C_glibc_Sample
_Algorithm/ProjectEuler_python/euler_4.py
1
1587
#!/usr/bin/python -Wall # -*- coding: utf-8 -*- """ <div id="content"> <div style="text-align:center;" class="print"><img src="images/print_page_logo.png" alt="projecteuler.net" style="border:none;" /></div> <h2>Largest palindrome product</h2><div id="problem_info" class="info"><h3>Problem 4</h3><span>Published on Frid...
gpl-3.0
-6,911,959,164,782,817,000
28.388889
198
0.555766
false
michal-ruzicka/archivematica
src/MCPClient/lib/clientScripts/restructureForComplianceMaildir.py
1
1919
#!/usr/bin/python -OO # This file is part of Archivematica. # # Copyright 2010-2013 Artefactual Systems Inc. <http://artefactual.com> # # Archivematica 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, ei...
agpl-3.0
8,630,748,113,008,248,000
36.627451
125
0.705576
false
gopaycommunity/gopay-python-api
tests/unit/utils.py
1
1531
from gopay.enums import PaymentInstrument, BankSwiftCode, Currency, Language class Utils: GO_ID = '8712700986' CLIENT_ID = '1689337452' CLIENT_SECRET = 'CKr7FyEE' CLIENT_ID_EET = "1365575992" CLIENT_SECRET_EET = "NUVsrv4W" GO_ID_EET = '8289213768' @staticmethod def create_base_payme...
mit
-2,250,619,758,455,118,600
35.452381
112
0.536251
false
ludwiktrammer/odoo
addons/sale/sale.py
1
42630
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from datetime import datetime, timedelta from openerp import SUPERUSER_ID from openerp import api, fields, models, _ import openerp.addons.decimal_precision as dp from openerp.exceptions import UserError from openerp.too...
agpl-3.0
-3,618,811,220,402,187,000
46.314095
276
0.607718
false
sk413025/tilitools
ocsvm.py
1
3767
from cvxopt import matrix,spmatrix,sparse from cvxopt.blas import dot,dotu from cvxopt.solvers import qp import numpy as np from kernel import Kernel class OCSVM: """One-class support vector machine 'Estimating the support of a high-dimensional distribution.', Sch\"{o}lkopf, B and Platt, J C and Shawe-Taylor, ...
mit
-5,839,695,781,475,350,000
24.452703
89
0.663127
false
jianrongdeng/LAMOST
ana/scripts/filesIO.py
1
9324
""" ============================ script: filesIO.py ============================ date: 20170615 by Jianrong Deng purpose: handle input / output files various data I/O functions Input: input dir, date, time """ import const import pickle import os #========================== def getDir (path=const.test_path_ou...
gpl-3.0
-551,796,630,725,550,400
28.506329
191
0.525097
false
fbzhong/sublime-closure-linter
gjslint.py
1
4010
import os import re import shutil import sublime import sublime_plugin from const import * from listener import * from statusprocess import * from asyncprocess import * class ShowClosureLinterResultCommand(sublime_plugin.WindowCommand): """show closure linter result""" def run(self): self.window.run_command("s...
bsd-3-clause
6,959,701,586,400,418,000
31.33871
134
0.625436
false
qedsoftware/commcare-hq
corehq/apps/userreports/sql/data_source.py
1
5578
import numbers from django.utils.decorators import method_decorator from django.utils.translation import ugettext from dimagi.utils.decorators.memoized import memoized from sqlagg.columns import SimpleColumn from sqlagg.sorting import OrderBy from corehq.apps.reports.sqlreport import SqlData, DatabaseColumn from co...
bsd-3-clause
1,145,583,826,430,436,100
37.736111
114
0.6436
false
andrejbauer/jurij
jurij/graph.py
1
4649
# -*- encoding: utf-8 -*- # A very simple implementation of graphs in python, including graphs # embedded in the plane. class Graph(): """A graph stored as an adjacency dictionary.""" def __init__(self, data=None, vertices=None, edges=None, vertex_labels=None, edge_labels=None): """C...
bsd-2-clause
-6,448,450,689,787,050,000
35.03876
88
0.52678
false
twitterdev/twitter-python-ads-sdk
examples/audience_summary.py
1
1125
from twitter_ads.client import Client from twitter_ads.targeting import AudienceSummary CONSUMER_KEY = 'your consumer key' CONSUMER_SECRET = 'your consumer secret' ACCESS_TOKEN = 'access token' ACCESS_TOKEN_SECRET = 'access token secret' ACCOUNT_ID = 'account id' # initialize the client client = Client(CONSUMER_KEY, ...
mit
1,429,144,818,825,178,400
27.125
81
0.625778
false
pxzhang94/GAN
GAN/wasserstein_gan/wgan_tensorflow.py
1
3148
import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data import numpy as np import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec import os mb_size = 32 X_dim = 784 z_dim = 10 h_dim = 128 mnist = input_data.read_data_sets('../../MNIST_data', one_hot=True) def plot(samples...
apache-2.0
-6,329,197,380,667,734,000
24.184
76
0.589263
false
retorquere/zotero-better-bibtex
setup/item.py
1
24607
#!/usr/bin/env python3 from networkx.readwrite import json_graph from collections import OrderedDict import hashlib import operator import shlex from functools import reduce from http.client import RemoteDisconnected from lxml import etree from mako import exceptions from mako.template import Template from munch impo...
mit
-3,831,744,764,635,071,500
40.011667
161
0.61897
false
hasadna/OpenTrain
webserver/opentrain/timetable/utils.py
1
3883
from models import TtStop,TtStopTime,TtTrip import gtfs.models from timetable.models import TtShape import json from common import ot_utils import datetime def build_from_gtfs(start_date,days=30): build_stops() end_date = start_date + datetime.timedelta(days=days-1) print '=' * 50 print 'Start day = %s...
bsd-3-clause
-7,730,519,627,983,113,000
40.308511
99
0.60443
false
aaronj1335/cs388-final-project
bin/plot.py
1
6512
#!/usr/bin/env python import os from os.path import join from itertools import chain from math import log from pylab import plot, show, legend, close, figure, title, xlabel, ylabel, barh, savefig import matplotlib as mpl import matplotlib.pyplot as plt from matplotlib.ticker import FuncFormatter N = 0 ...
bsd-2-clause
-7,641,680,713,887,290,000
27.814159
94
0.578163
false
CommunityHoneyNetwork/CHN-Server
mhn/auth/views.py
2
5341
import hashlib import random from flask import Blueprint, request, jsonify from flask_mail import Message from sqlalchemy.exc import IntegrityError from flask_security.utils import ( login_user as login, verify_and_update_password, encrypt_password, logout_user as logout) from mhn import db, mail from...
lgpl-2.1
2,775,682,520,948,707,000
33.458065
88
0.644823
false
tlksio/tlksio
env/lib/python3.4/site-packages/pylint/checkers/base.py
1
37578
# Copyright (c) 2003-2013 LOGILAB S.A. (Paris, FRANCE). # Copyright (c) 2009-2010 Arista Networks, Inc. # http://www.logilab.fr/ -- mailto:contact@logilab.fr # 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 # ...
mit
1,372,308,262,561,143,800
41.033557
94
0.551599
false
ideamonk/apt-offline
apt_offline_gui/Ui_AptOfflineQtAbout.py
1
8800
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'AptOfflineQtAbout.ui' # # Created: Sun Nov 7 20:54:52 2010 # by: PyQt4 UI code generator 4.7.3 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui class Ui_AboutAptOffline(object): def setupUi...
gpl-3.0
6,399,191,816,789,832,000
65.165414
201
0.716364
false
zhoulan/google-python-exercises
basic/string1.py
1
4177
#!/usr/bin/python -tt # Copyright 2010 Google Inc. # Licensed under the Apache License, Version 2.0 # http://www.apache.org/licenses/LICENSE-2.0 # Google's Python Class # http://code.google.com/edu/languages/google-python-class/ # Basic string exercises # Fill in the code for the functions below. main() is already se...
apache-2.0
343,722,256,654,909,760
29.268116
78
0.651903
false
gangadharkadam/tailorerp
erpnext/support/doctype/support_ticket/support_ticket.py
1
8287
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from erpnext.utilities.transaction_base import TransactionBase from frappe.utils import now, extract_email_id import json import reque...
agpl-3.0
-8,289,523,798,107,514,000
34.26383
237
0.68879
false
afriestad/WikiLinks
kokekunster/settings_dev.py
1
1482
import os from kokekunster.settings import BASE_DIR # Settings for development environment DEBUG = True ALLOWED_HOSTS = ['*'] # "Secret" cryptographic key, only used during local development SECRET_KEY = 'fc4_hb-wi32l^c&qpx6!m)o*xd(4ga$13(ese#pfj#pjxnmt0p' # Database # https://docs.djangoproject.com/en/1.8/ref...
mit
8,427,073,580,051,762,000
22.15625
78
0.687584
false
pFernbach/hpp-rbprm-corba
script/tools/parse_bench_contactGen.py
1
1861
import sys totalSuccess = 0. totalTime = 0. totalMuscodConverg = 0. totalMuscodWarmStartConverg = 0. totalCrocConverg = 0. totalConf = 0. totalIt = 0. f = open("/local/fernbac/bench_iros18/bench_contactGeneration/walk_noCroc.log","r") line = f.readline() while line.startswith("new"): totalIt += 1. line = f.r...
lgpl-3.0
5,070,445,143,479,115,000
32.232143
97
0.602902
false
LordDarkula/chess_py
chess_py/core/board.py
1
13656
# -*- coding: utf-8 -*- """ Constructs board object which stores the get_location of all the pieces. Default Array | [[0th row 0th item, 0th row 1st item, 0th row 2nd item], | [1st row 0th item, 1st row 1st item, 1st row 2nd item], | [2nd row 0th item, 2nd row 1st item, 2nd row 2nd item]] | Default board | 8...
mit
-1,198,334,598,218,724,400
30.571429
106
0.550108
false
nke001/attention-lvcsr
lvsr/extensions.py
1
3223
"""Nice small extensions that maybe will it make to Blocks at some point.""" from __future__ import print_function import subprocess import pkgutil import math from theano.scan_module.scan_op import Scan from blocks.extensions import TrainingExtension, SimpleExtension class CGStatistics(SimpleExtension): def __...
mit
-8,607,135,214,068,613,000
39.2875
88
0.603785
false