repo_name
stringlengths
6
61
path
stringlengths
4
230
copies
stringlengths
1
3
size
stringlengths
4
6
text
stringlengths
1.01k
850k
license
stringclasses
15 values
hash
int64
-9,220,477,234,079,998,000
9,219,060,020B
line_mean
float64
11.6
96.6
line_max
int64
32
939
alpha_frac
float64
0.26
0.9
autogenerated
bool
1 class
ratio
float64
1.62
6.1
config_test
bool
2 classes
has_no_keywords
bool
2 classes
few_assignments
bool
1 class
BasioMeusPuga/pyGames
Snake.py
1
4991
#!/usr/bin/python3 import sys import random import pygame import os.path BLACK = (0, 0, 0) WHITE = (255, 255, 255) RED = (255, 0, 0) GREEN = (0, 255, 0) FPS = 60 pygame.init() displaysurface = pygame.display.set_mode((400, 400)) displaysurface.fill(WHITE) pygame.display.set_caption('Ghatiya snake') clock = pygame....
gpl-3.0
3,223,128,494,537,172,000
24.335025
88
0.64436
false
2.680451
false
false
false
uclmr/inferbeddings
inferbeddings/nli/disan/disan.py
1
10785
# -*- coding: utf-8 -*- import tensorflow as tf from functools import reduce from operator import mul VERY_BIG_NUMBER = 1e30 VERY_SMALL_NUMBER = 1e-30 VERY_POSITIVE_NUMBER = VERY_BIG_NUMBER VERY_NEGATIVE_NUMBER = -VERY_BIG_NUMBER # --------------- DiSAN Interface ---------------- def disan(rep_tensor, rep_mask, ...
mit
6,246,170,103,102,162,000
41.972112
123
0.583496
false
3.231945
false
false
false
okuchaiev/f-lm
glstm.py
1
8571
"""Module for constructing RNN Cells.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import collections import math from tensorflow.contrib.compiler import jit from tensorflow.contrib.layers.python.layers import layers from tensorflow.contrib.rnn.python...
mit
5,373,462,395,989,063,000
41.435644
114
0.614397
false
3.757562
false
false
false
strazzere/py010parser
z.py
3
2648
import sys from pycparser.c_ast import * from pycparser.c_parser import CParser, Coord, ParseError from pycparser.c_lexer import CLexer def expand_decl(decl): """ Converts the declaration into a nested list. """ typ = type(decl) if typ == TypeDecl: return ['TypeDecl', expand_decl(decl.type)] ...
bsd-3-clause
-2,917,543,122,236,092,000
30.152941
75
0.54003
false
4.04893
false
false
false
ethereum/pydevp2p
devp2p/tests/test_peermanager.py
1
1405
from devp2p import peermanager from devp2p import crypto from devp2p.app import BaseApp from rlp.utils import encode_hex import devp2p.muxsession import rlp import devp2p.p2p_protocol import time import gevent import copy import socket def try_tcp_connect(addr): s = socket.socket() s.connect(addr) s.close...
mit
-3,365,345,710,625,542,000
26.54902
76
0.669039
false
3.252315
false
false
false
CacheBrowser/cachebrowser
cachebrowser/pipes/scrambler.py
1
19207
# cdn.jsdelivr.net import logging from time import time, sleep from threading import Thread, RLock from random import random, shuffle, choice from six.moves.urllib.parse import urlparse from mitmproxy.models import HTTPResponse from netlib.http import Headers from cachebrowser.pipes.base import FlowPipe from cachebro...
mit
-7,097,376,522,005,328,000
30.799669
151
0.552038
false
3.686564
false
false
false
pschmitt/zhue
zhue/model/config.py
1
1540
from __future__ import absolute_import from __future__ import unicode_literals from .basemodel import HueBaseObject from .user import User class BridgeConfig(HueBaseObject): def __init__(self, bridge, json): super(BridgeConfig, self).__init__(bridge, 'config', json) # Versions @property def a...
gpl-3.0
1,750,811,497,076,904,700
20.690141
71
0.593506
false
4.031414
false
false
false
dewitt/webfingerclient-dclinton
xrd.py
1
8816
#!/usr/bin/python2.5 # # Parses XRD documents. # # Copyright 2009 DeWitt Clinton # # 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 # #...
apache-2.0
-8,425,790,412,987,392,000
32.907692
77
0.645644
false
3.668747
false
false
false
okfn/jsontableschema-openrefine-py
jsontableschema/plugins/openrefine/openrefine_client.py
1
2646
import requests import six import six.moves.urllib.parse as urlparse class OpenRefineClient(object): _COMMANDS = { 'get_version': 'command/core/get-version', 'get_all_project_metadata': 'command/core/get-all-project-metadata', 'get_project_metadata': 'command/core/get-project-metadata', ...
mit
-8,839,431,766,508,617,000
35.75
80
0.589569
false
3.92
false
false
false
bjamesv/pymoldmaker
image.py
1
2378
#!/bin/python3 """ this file is a part of pymoldmaker Copyright (C) 2015 Brandon J. Van Vaerenbergh 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 optio...
gpl-3.0
-3,171,076,100,930,244,600
36.15625
79
0.650967
false
4.030508
false
false
false
alexanderfefelov/nav
python/nav/netmap/metadata.py
1
17323
# # Copyright (C) 2012 UNINETT AS # # This file is part of Network Administration Visualized (NAV). # # NAV is free software: you can redistribute it and/or modify it under # the terms of the GNU General Public License version 2 as published by # the Free Software Foundation. # # This program is distributed in the hope...
gpl-2.0
5,255,806,333,531,376,000
35.623679
80
0.592334
false
3.995157
true
false
false
xalt/xalt
old/altd/sbin/setDb.py
1
3753
#!/usr/bin/python -E import sys,os import MySQLdb import ConfigParser import base64 import time import getpass def readFromUser(): global HOST,USER,PASSWD,DB HOST=raw_input("Database host:") USER=raw_input("Database user:") PASSWD=getpass.getpass("Database pass:") DB=raw_input("Database name:") d...
lgpl-2.1
1,474,715,430,726,963,000
30.016529
110
0.612843
false
3.318302
true
false
false
andrewcurtis/SSVMetric
src/PatternEvaluator.py
1
9126
# imports import numpy as np import scipy import scipy.sparse.linalg from scipy.sparse.linalg import ArpackNoConvergence from scipy.sparse.linalg import ArpackError import time from SamplingPattern import SamplingPattern from defaults import BASE_N from utils import ft, ift, ft2, ift2, sumsq class PatternEvaluator...
mit
-3,858,472,168,336,106,000
27.698113
86
0.53364
false
3.810438
false
false
false
iyer-arvind/PyFR
pyfr/backends/openmp/generator.py
3
7202
# -*- coding: utf-8 -*- import re from pyfr.backends.base.generator import BaseKernelGenerator from pyfr.util import ndrange class OpenMPKernelGenerator(BaseKernelGenerator): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) # Specialise self._dims = ['_nx'] if self...
bsd-3-clause
6,854,901,861,240,827,000
34.653465
78
0.425993
false
3.583085
false
false
false
AerisCloud/AerisCloud
aeriscloud/log.py
1
1415
import logging import sys LOGGING_FORMAT = '%(asctime)s [%(levelname)s] %(name)s: %(message)s' FILE_LOGGING_FORMAT = '%(asctime)s,%(levelname)s,%(name)s,%(message)s' # captureWarnings exists only since 2.7 _nh = None if sys.hexversion > 0x2070000: logging.captureWarnings(True) _nh = logging.NullHandler() else...
mit
-6,147,397,567,664,631,000
26.745098
74
0.683392
false
3.618926
false
false
false
wimmuskee/ontolex-db
database/mysql.py
1
22736
# -*- coding: utf-8 -*- import pymysql.cursors import uuid from urllib.parse import urlparse """ Some explanation for this set of functions. set: put a partical subset in a class var insert: insert one row without checks and dependencies, optionally commit store: insert multiples and calling separate insert function...
mit
-5,469,644,514,981,064,000
37.083752
220
0.747229
false
3.176306
false
false
false
senser/xmppBot
ZenPacks/community/xmppBot/Jabber/plugins/graph.py
1
6750
"""Extract graphs.""" from Jabber.Plugins import Plugin from Jabber.ZenAdapter import ZenAdapter from Jabber.Options import Options from optparse import OptionError class Graph(Plugin): name = 'graph' capabilities = ['graph', 'help'] def call(self, args, log, **kw): #Dirty hack to make it work with mult...
gpl-2.0
2,868,993,540,534,500,000
47.561151
347
0.567852
false
3.982301
false
false
false
Chromium97/lnmiithackathon
website/settings.py
1
2237
""" Django settings for website project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) im...
mit
-621,911,359,711,887,500
23.855556
72
0.725078
false
3.284875
false
false
false
CornellProjects/hlthpal
web/project/main/views.py
1
28275
import os import datetime from django.utils.dateparse import parse_datetime import collections, json from django.http import HttpResponse, JsonResponse from django.http import HttpResponseForbidden from django.shortcuts import render from django.template import loader from django.contrib.auth import get_user_model from...
apache-2.0
1,060,832,617,351,029,600
36.651132
164
0.62359
false
4.369495
false
false
false
bubakazouba/Robinhood-for-Google-Finance
google_finance_export.py
1
1431
from GetRobinhoodTrades import getRobinhoodTrades import argparse import Exporter exporter = Exporter.Exporter("trades") parser = argparse.ArgumentParser(description='Export Robinhood trades to a CSV file') parser.add_argument('--debug', action='store_true', help='store raw JSON output to debug.json') parser.add_argu...
mit
-5,983,913,685,366,143,000
28.833333
95
0.725367
false
3.439904
false
false
false
lanyeit/lanye-self
pandarss/utils.py
2
2767
#!/usr/bin/env python #coding=utf-8 import decimal import time import random import datetime import calendar random_generator = random.SystemRandom() class Utils: """ 工具模块类 """ _base_id = 0 _CurrentID = random_generator.randrange(1, 1024) @staticmethod def fen2yuan(fen=0): f = decima...
bsd-3-clause
-2,332,832,476,347,254,000
26.767677
87
0.559112
false
3.47096
false
false
false
wy315700/dota2_match
dota2/Match.py
1
3864
from dota2Error import Dota2APIError import time import datetime # import dota2 from MysqlHelper import * from APIConnection import * from multiprocessing import Process, Queue, Lock, freeze_support import time import random start_seq_num = 0 api = APIConnection() process_num = 5 base_num = 1000000 base_start_num =...
gpl-2.0
-7,039,144,919,082,925,000
33.19469
126
0.524586
false
3.711816
false
false
false
michal-ruzicka/archivematica
src/MCPServer/lib/unitFile.py
1
2379
#!/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, e...
agpl-3.0
-8,173,164,090,468,189,000
33.478261
81
0.666246
false
3.843296
false
false
false
joopert/home-assistant
homeassistant/components/hlk_sw16/switch.py
12
1410
"""Support for HLK-SW16 switches.""" import logging from homeassistant.components.switch import ToggleEntity from homeassistant.const import CONF_NAME from . import DATA_DEVICE_REGISTER, SW16Device _LOGGER = logging.getLogger(__name__) def devices_from_config(hass, domain_config): """Parse configuration and ad...
apache-2.0
-2,503,243,105,140,089,300
31.045455
86
0.680851
false
3.643411
true
false
false
rogerlew/py-st-a-ggre-lite3
setup.py
2
1523
# Copyright (c) 2011, Roger Lew [see LICENSE.txt] # This software is funded in part by NIH Grant P20 RR016454. ##from distutils.core import setup from setuptools import setup setup(name='pystaggrelite3', version='0.1.3', description='Pure Python sqlite3 statistics aggregate functions', author='Ro...
bsd-3-clause
-6,954,211,580,426,667,000
44.151515
81
0.562049
false
4.389049
false
true
false
mitsei/dlkit
dlkit/primordium/mapping/spatial_units.py
1
4657
""" Implementions of osid.mapping.SpatialUnit. Can be used by implementations and consumer applications alike. """ from dlkit.abstract_osid.mapping import primitives as abc_mapping_primitives from dlkit.abstract_osid.osid.errors import NullArgument, InvalidArgument from ..osid.primitives import OsidPrimitive from .....
mit
4,065,296,784,621,175,000
39.146552
104
0.638394
false
4.308048
false
false
false
tmcrosario/odoo-tmc
tmc/models/dependence.py
1
1112
from odoo import _, api, fields, models class Dependence(models.Model): _name = 'tmc.dependence' _description = 'Dependence' name = fields.Char() abbreviation = fields.Char(size=6) document_type_ids = fields.Many2many(comodel_name='tmc.document_type') document_topic_ids = fields.Many2many...
agpl-3.0
2,107,047,882,029,457,700
32.69697
76
0.554856
false
4.058394
false
false
false
mshubian/BAK_open-hackathon
open-hackathon-adminUI/src/app/database/models.py
1
3577
import sys import email sys.path.append("..") from . import UserMixin from . import db from datetime import datetime import json def to_json(inst, cls): # add your coversions for things like datetime's # and what-not that aren't serializable. convert = dict() convert[db.DateTime] = str d = dict(...
apache-2.0
3,798,570,820,496,018,400
29.844828
93
0.612524
false
3.396961
false
false
false
waneric/PyMapLib
src/gabbs/controls/MapToolAction.py
1
6234
# -*- coding: utf-8 -*- """ MapToolAction.py - map tool for user events ====================================================================== AUTHOR: Wei Wan, Purdue University EMAIL: rcac-help@purdue.edu Copyright (c) 2016 Purdue University See the file "license.terms" for information on usage and redistr...
mit
1,932,736,580,259,168,300
36.787879
118
0.612608
false
4.338205
false
false
false
pfnet/chainer
tests/chainer_tests/links_tests/caffe_tests/test_caffe_function.py
4
35121
import os import tempfile import unittest import warnings import mock import numpy import six import chainer from chainer import links from chainer import testing # The caffe submodule relies on protobuf which under protobuf==3.7.0 and # Python 3.7 raises a DeprecationWarning from the collections module. with warni...
mit
-7,287,609,699,628,264,000
25.170641
79
0.410239
false
3.856908
true
false
false
zstackio/zstack-woodpecker
tools/trans/resource.py
1
25317
# encoding=utf-8 RUNNING = "RUNNING" STOPPED = "STOPPED" DELETED = "DELETED" EXPUNGED = "EXPUNGED" ATTACHED = "ATTACHED" DETACHED = "DETACHED" ENABLED = "ENABLED" HA = "HA" DATA = "'data'" ROOT = "'root'" VM = "'VM'" VOLUME = "'VOLUME'" QCOW2 = "'qcow2'" ISO = "'iso'" MINI = False # todo LOCAL = False class r...
apache-2.0
-8,923,569,609,837,443,000
33.444898
127
0.576846
false
3.582932
true
false
false
arielbro/HarmoniTag
data_acquisition/chords/sources/chordie.py
1
1894
from bs4 import BeautifulSoup from urllib2 import urlopen BASE_URL = "http://www.chordie.com" def make_soup(url): html = urlopen(url).read() return BeautifulSoup(html, "lxml") def get_url(option): try: line = option.findAll("tr")[1].findAll("td")[1].i.a if line.span.text=="CHORDS": ...
gpl-2.0
4,818,141,216,001,924,000
30.065574
99
0.63622
false
3.282496
false
false
false
hashware/tflearn-learn
examples/nlp/seq2seq_example.py
1
27637
''' Pedagogical example realization of seq2seq recurrent neural networks, using TensorFlow and TFLearn. More info at https://github.com/ichuang/tflearn_seq2seq ''' from __future__ import division, print_function import os import sys import tflearn import argparse import json import numpy as np import tensorflow as t...
mit
6,505,902,849,354,478,000
46.081772
168
0.595036
false
3.756558
true
false
false
ArvinPan/pyzmq
examples/security/woodhouse.py
6
2293
#!/usr/bin/env python ''' Woodhouse extends Strawhouse with a name and password check. This uses the PLAIN mechanism which does plain-text username and password authentication). It's not really secure, and anyone sniffing the network (trivial with WiFi) can capture passwords and then login. Author: Chris Laws ''' i...
bsd-3-clause
4,298,470,329,914,838,500
24.477778
125
0.648059
false
3.571651
true
false
false
erja-gp/openthread
tools/harness-automation/autothreadharness/harness_controller.py
16
5053
#!/usr/bin/env python # # Copyright (c) 2016, The OpenThread Authors. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright # notic...
bsd-3-clause
-7,499,389,205,181,361,000
36.154412
115
0.610924
false
4.356034
false
false
false
OCA/contract
agreement_legal/models/agreement.py
1
14411
# Copyright (C) 2018 - TODAY, Pavlov Media # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from odoo import _, api, fields, models class Agreement(models.Model): _inherit = "agreement" # General name = fields.Char(string="Title", required=True) version = fields.Integer( strin...
agpl-3.0
-390,334,634,178,866,200
37.429333
79
0.595448
false
4.173472
false
false
false
feikname/spades-server
pyspades/gamemodes.py
1
2853
from pyspades import contained as loaders from pyspades.collision import vector_collision, collision_3d from pyspades.constants import TC_CAPTURE_DISTANCE ctf_data = loaders.CTFState() tc_data = loaders.TCState() class IntelBasedGamemode: name = "ctf" def __init__(self, protocol): self.protocol = pr...
gpl-3.0
6,317,517,780,846,743,000
30.7
79
0.590957
false
3.951524
false
false
false
estaban/pyload
module/plugins/crypter/TnyCz.py
1
1303
# -*- coding: utf-8 -*- """ 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. This program is distributed in...
gpl-3.0
-5,228,202,936,129,360,000
32.410256
88
0.655411
false
3.512129
false
false
false
CERNatschool/particle-rate-plotter
process-frames.py
1
5413
#!/usr/bin/env python # -*- coding: utf-8 -*- """ CERN@school - Processing Frames See the README.md file for more information. """ #...for the operating stuff. import os #...for the file processing. import glob #...for parsing the arguments. import argparse #...for the logging. import logging as lg #...for f...
mit
-2,368,854,573,512,871,400
28.418478
97
0.558286
false
3.59429
false
false
false
Ledoux/ShareYourSystem
Pythonlogy/ShareYourSystem/Standards/Classors/Switcher/__init__.py
2
10216
# -*- coding: utf-8 -*- """ <DefineSource> @Date : Fri Nov 14 13:20:38 2014 \n @Author : Erwan Ledoux \n\n </DefineSource> The Switcher """ #<DefineAugmentation> import ShareYourSystem as SYS BaseModuleStr="ShareYourSystem.Standards.Classors.Watcher" DecorationModuleStr="ShareYourSystem.Standards.Classors.Tester"...
mit
-2,826,561,491,702,759,400
17.608379
94
0.649178
false
3.088271
false
false
false
citrix-openstack-build/heat
heat/openstack/common/lockutils.py
6
9338
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 OpenStack Foundation. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apac...
apache-2.0
4,315,550,123,892,458,000
32.833333
78
0.612872
false
4.301244
false
false
false
mjhea0/flask-basic-registration
project/__init__.py
1
1596
# project/__init__.py ################# #### imports #### ################# import os from flask import Flask, render_template from flask_login import LoginManager from flask_bcrypt import Bcrypt from flask_mail import Mail from flask_debugtoolbar import DebugToolbarExtension from flask_sqlalchemy import SQLAlchemy...
mit
-949,184,860,191,624,200
19.202532
61
0.620301
false
3.746479
false
false
false
ulaskan/RegEx
regex.py
1
2233
#! /usr/bin/python # Author: Ulas A. # Date: 14 Nov 2015 # Python version: 2.7 # This program takes a text file input by the user in a Linux filesystem and searches for a user input string # The search simulates Regular expressions. The program can search for text anywhere in the opened file # the beginning of each li...
gpl-2.0
409,560,282,669,412,900
34.444444
127
0.600537
false
3.72788
false
false
false
JackGavin13/octoprint-test-not-finished
src/octoprint/filemanager/util.py
9
6227
# coding=utf-8 from __future__ import absolute_import, division, print_function __author__ = "Gina Häußge <osd@foosel.net>" __license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html' __copyright__ = "Copyright (C) 2015 The OctoPrint Project - Released under terms of the AGPLv3 License" im...
agpl-3.0
-5,343,517,159,775,421,000
24.829876
114
0.68257
false
3.352181
false
false
false
cloudera/hue
desktop/core/ext-py/openpyxl-2.6.4/openpyxl/workbook/_writer.py
2
6579
from __future__ import absolute_import # Copyright (c) 2010-2019 openpyxl """Write the workbook global settings to the archive.""" from copy import copy from openpyxl.utils import absolute_coordinate, quote_sheetname from openpyxl.xml.constants import ( ARC_APP, ARC_CORE, ARC_WORKBOOK, PKG_REL_NS, ...
apache-2.0
2,303,528,685,725,274,000
33.088083
100
0.605563
false
3.833916
false
false
false
hpparvi/PyTransit
notebooks/contamination/src/plotting.py
1
5677
# PyTransit: fast and easy exoplanet transit modelling in Python. # Copyright (C) 2010-2019 Hannu Parviainen # # 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 Licen...
gpl-2.0
-746,157,780,433,276,000
45.917355
126
0.648758
false
2.503086
false
false
false
tribhuvanesh/R3PI-PO
persistent_helpers.py
1
3488
#!flask/bin/python import json import os import urllib2 import httplib2 as http import requests from creds import bigOvenAPIkey try: from urlparse import urlparse except ImportError: from urllib.parse import urlparse from flask import Flask, jsonify recipe_blob_dct = { 1 : { 'id': 1, 'ti...
apache-2.0
-4,177,722,889,112,337,000
27.357724
100
0.59547
false
3.577436
false
false
false
hrayr-artunyan/shuup
shuup/default_tax/models.py
2
4052
# This file is part of Shuup. # # Copyright (c) 2012-2016, Shoop Ltd. All rights reserved. # # This source code is licensed under the AGPLv3 license found in the # LICENSE file in the root directory of this source tree. from __future__ import unicode_literals from django.db import models from django.db.models import Q...
agpl-3.0
-5,399,539,020,065,074,000
40.773196
95
0.651037
false
3.960899
false
false
false
SalesforceEng/Providence
tests/repos/test_repotracker.py
1
2927
''' Copyright (c) 2015, Salesforce.com, Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the foll...
bsd-3-clause
-3,761,808,230,218,270,000
45.460317
755
0.767339
false
4.49616
true
false
false
buxx/intelligine
intelligine/simulation/object/molecule/MoleculeGland.py
1
1276
from intelligine.core.exceptions import BestMoleculeHere, MoleculeGlandDisabled from intelligine.simulation.molecule.DirectionMolecule import DirectionMolecule class MoleculeGland(): def __init__(self, host, context): self._molecule_type = None self._host = host self._context = context ...
apache-2.0
1,086,530,290,361,724,900
29.404762
102
0.618339
false
4.4
false
false
false
jeliasherrero/SeminarioTheano2015
logistic_reg.py
1
1781
import numpy import theano import theano.tensor as T rng = numpy.random N = 400 feats = 784 D = (rng.randn(N, feats).astype(theano.config.floatX), rng.randint(size=N,low=0, high=2).astype(theano.config.floatX)) training_steps = 10000 # Declare Theano symbolic variables x = T.matrix("x") y = T.vector("y") w = theano....
gpl-2.0
-1,169,153,566,435,132,400
29.706897
78
0.64009
false
2.800314
false
false
false
rorytrent/the-duke
duke/tile.py
1
1517
from .actions import parse_actions, parse_commands class Tile(object): def __init__(self, name, front=None, back=None, front_commands=None, back_commands=None): self.name = name self.front = parse_actions(front) self.back = parse_actions(back) self.front_commands ...
gpl-3.0
-8,379,709,236,508,500,000
30.604167
81
0.584047
false
3.764268
false
false
false
koditr/xbmc-tr-team-turkish-addons
plugin.video.temizlik.imandan.gelir/default.py
1
7503
import urllib,urllib2,re,xbmcplugin,xbmcgui #!/usr/bin/python # -*- coding: utf-8 -*- XbmcTRteam='http://XbcmTR.com' def CATEGORIES(): addDir('[COLOR red][B]>> INFOYU OKUYUNUZ <<[/B][/COLOR] ', "INFO(name)",'7','http://www.kanal23.com/dosya/unlem-1.jpg') addDir('[COLOR orange][B]>> [/B][...
gpl-2.0
-1,518,281,774,249,439,200
39
193
0.536585
false
3.391953
false
false
false
hoskerism/reefx
systemmonitor.py
1
2341
#!/user/bin/python from datetime import datetime, timedelta import os from constants import MessageCodes, Sensors, Statuses, DebugLevels import db from workerthread import WorkerThread class SystemMonitor(WorkerThread): def __init__(self, inQueue, outQueue): self.initTime = datetime.now() ...
gpl-2.0
1,238,680,166,440,448,800
35.15873
108
0.626655
false
3.818923
false
false
false
ultra-lstm/RNA-GAN
cGAN/utils.py
1
2258
""" Some codes from https://github.com/Newmu/dcgan_code """ from __future__ import division import math import json import random import scipy.misc import numpy as np from time import gmtime, strftime # ----------------------------- # new added functions for pix2pix def load_data(image_path, image_size, input_c_dim, ...
mit
4,987,736,922,287,926,000
29.931507
95
0.605846
false
3.093151
false
false
false
closeio/nylas
migrations/versions/056_message_unique_constraint.py
8
2132
""" Remove duplicated Gmail Message objects and tighten constraints for Gmail messages. Revision ID: 4b4c5579c083 Revises: 1925c535a52d Create Date: 2014-07-17 00:01:09.410292 """ # revision identifiers, used by Alembic. revision = '4b4c5579c083' down_revision = '4b4674f1a726' from alembic import op from sqlalchemy...
agpl-3.0
2,814,679,746,964,648,400
38.481481
104
0.613039
false
3.883424
false
false
false
hellodata/wubacrawler
wubacrawler2_v1.1/process/start.py
1
2178
# -*- coding:utf-8 -*- """ start.py获取详细页html源码的程序 存放在数据库code_0507里面 start2.py对详细页html源码解析 存放在数据库code_0507里面 功能:先爬取……后解析…… """ import redis import time from process.html_save import FetchDetailHtml from process.list_page import SummaryFetchParse def main(): """ 爬取详细页源码 存入code_0507数据库...
artistic-2.0
2,794,046,091,661,662,700
25.465753
111
0.495859
false
2.251748
false
false
false
Evanus/redstoner-utils
misc.py
1
9100
#pylint: disable = F0401 from helpers import * from time import time as now from time import sleep from sys import exc_info import thread import org.bukkit.inventory.ItemStack as ItemStack import org.bukkit.Bukkit as Bukkit from basecommands import simplecommand @hook.event("player.PlayerJoinEvent", "monitor") def o...
mit
-4,678,912,113,602,412,000
32.828996
150
0.621978
false
3.36414
false
false
false
tensorflow/probability
tensorflow_probability/python/internal/backend/numpy/ops.py
1
22151
# Copyright 2018 The TensorFlow Probability 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 law o...
apache-2.0
-8,286,430,538,326,064,000
29.98042
110
0.652612
false
3.669814
false
false
false
kshedstrom/pyroms
examples/cobalt-preproc/Clim_bio/make_clim_file_bio_addons.py
1
4460
import subprocess import os import sys import commands import numpy as np import pyroms import pyroms_toolbox from remap_bio_woa import remap_bio_woa from remap_bio_glodap import remap_bio_glodap data_dir_woa = '/archive/u1/uaf/kate/COBALT/' data_dir_glodap = '/archive/u1/uaf/kate/COBALT/' dst_dir='./' src_grd = py...
bsd-3-clause
6,384,273,527,730,413,000
51.470588
695
0.64148
false
2.505618
false
false
false
Seeker1911/talent
server/talent/migrations/0002_auto_20160919_1522.py
1
1432
# -*- coding: utf-8 -*- # Generated by Django 1.10 on 2016-09-19 15:22 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('talent', '0001_initial'), ] operations = [ migrations.AlterField( ...
mit
4,036,881,197,054,677,000
30.822222
88
0.569832
false
4.045198
false
false
false
CityofPittsburgh/pittsburgh-purchasing-suite
purchasing_test/integration/conductor/test_conductor.py
1
39808
# -*- coding: utf-8 -*- import json import datetime import urllib2 from mock import Mock, patch from flask import session from werkzeug.datastructures import ImmutableMultiDict from purchasing.users.models import User from purchasing.data.contracts import ContractBase from purchasing.data.contract_stages import Cont...
bsd-3-clause
-1,775,423,843,746,313,700
44.494857
121
0.626382
false
3.856243
true
false
false
jgust/SublimeCscope
sublime_cscope/event_listener.py
1
3885
import sublime import sublime_plugin from ..SublimeCscope import DEBUG from . import indexer # These commands should trigger a state change event in the indexer PROJECT_COMMANDS = ('prompt_add_folder', 'prompt_open_project_or_workspace', 'prompt_switch_project_or_workspace', ...
mit
-3,228,152,396,314,666,000
31.923729
93
0.599743
false
4.038462
false
false
false
Azure/azure-sdk-for-python
sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_cloud_service_roles_operations.py
1
8658
# 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
-5,821,989,288,854,121,000
45.8
190
0.639524
false
4.388241
true
false
false
lach76/scancode-toolkit
src/scancode/api.py
2
6971
# # Copyright (c) 2015 nexB Inc. and others. All rights reserved. # http://nexb.com and https://github.com/nexB/scancode-toolkit/ # The ScanCode software is licensed under the Apache License version 2.0. # Data generated with ScanCode require an acknowledgment. # ScanCode is a trademark of nexB Inc. # # You may not use...
apache-2.0
8,704,822,094,559,690,000
37.302198
98
0.683259
false
4.001722
false
false
false
ellezv/data_structures
src/dll.py
1
2544
"""An implementation of a doubly linked list in Python.""" class Node(): """Instantiate a node.""" def __init__(self, value=None, nxt=None, previous=None): """.""" self.value = value self.next = nxt self.previous = previous class DbLinkedList(): """Instantiate a doubly l...
mit
3,400,972,026,953,004,500
30.02439
68
0.512579
false
4.393782
false
false
false
jeske/csla
pysrc/clearsilver/odb_mysql.py
1
1981
#! /usr/bin/env python """ usage: %(progname)s [args] """ import os, sys, string, time, getopt from log import * import odb import MySQLdb class Cursor(odb.Cursor): def insert_id(self, tablename, colname): return self.cursor.insert_id() class Connection(odb.Connection): def __init__(self, host, user, pass...
bsd-2-clause
-8,139,343,470,660,586,000
22.034884
76
0.644119
false
3.5375
false
false
false
yk-tanigawa/2015gci
webdata/webdata1.py
1
1436
#!/usr/bin/env python # coding: utf-8 ################################################################### # カーリルAPIを用いて,東大図書館の蔵書の貸出可否を調べるスクリプト # 2015.05.25 yk_tani ################################################################### import urllib2, sys, json try: isbn = sys.argv[1] # specify ISBN in commandli...
mit
-1,285,989,182,587,320,000
31.102564
129
0.586262
false
2.489066
false
false
false
agravier/pycogmo
common/pynn_utils.py
1
34258
#!/usr/bin/env python2 # Copyright 2011, 2012 Alexandre Gravier (al.gravier@gmail) # This file is part of PyCogMo. # PyCogMo 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, o...
gpl-3.0
-7,213,629,115,506,757,000
40.175481
95
0.580769
false
4.113099
false
false
false
mtholder/phyloplumber
getting_started.py
1
4446
#!/usr/bin/env python import sys, os, subprocess, urllib, logging log = logging.getLogger(__name__) major, minor = [int(i) for i in sys.version_info[:2]] if major != 2 or minor < 4: sys.exit("""Please install python. Versions 2.4, 2.5, 2.6, and 2.7 should all work If you have python installed, make sure that \"pyt...
gpl-3.0
-4,168,957,450,927,577,000
35.442623
106
0.583446
false
3.623472
false
false
false
ZeusWPI/Haldis
app/views/general.py
1
6260
"Script to generate the general views of Haldis" import os from datetime import datetime, timedelta import yaml from typing import Optional from flask import Flask, render_template, make_response from flask import request, jsonify from flask import Blueprint, abort from flask import current_app as app from flask impo...
mit
2,933,671,513,590,761,000
27.715596
96
0.62476
false
3.662961
false
false
false
Havate/havate-openstack
proto-build/gui/horizon/Horizon_GUI/horizon/utils/fields.py
5
5684
# 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 t...
apache-2.0
-760,614,181,745,484,900
35.203822
79
0.622977
false
4.048433
false
false
false
bullxpfs/lustre-shine
lib/Shine/Lustre/Actions/StartTarget.py
3
3994
# StartTarget.py -- Lustre action class : start (mount) target # Copyright (C) 2009-2013 CEA # # This file is part of shine # # 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 # o...
gpl-2.0
-6,228,267,472,566,826,000
32.283333
78
0.623185
false
3.836695
false
false
false
Heathckliff/cantera
interfaces/cython/cantera/examples/thermo/rankine.py
4
1770
""" A Rankine vapor power cycle """ import cantera as ct # parameters eta_pump = 0.6 # pump isentropic efficiency eta_turbine = 0.8 # turbine isentropic efficiency p_max = 8.0e5 # maximum pressure def pump(fluid, p_final, eta): """Adiabatically pump a fluid to pressure p_final, using a pump with ...
bsd-3-clause
-2,803,135,325,289,463,300
22.6
77
0.602825
false
2.954925
false
false
false
paulmadore/Eric-IDE
6-6.0.9/eric/Plugins/VcsPlugins/vcsMercurial/HgConflictsListDialog.py
2
14728
# -*- coding: utf-8 -*- # Copyright (c) 2014 - 2015 Detlev Offenbach <detlev@die-offenbachs.de> # """ Module implementing a dialog to show a list of files which had or still have conflicts. """ from __future__ import unicode_literals import os from PyQt5.QtCore import pyqtSlot, Qt, QPoint, QProcess, QTimer from Py...
gpl-3.0
238,113,331,321,496,500
32.022422
78
0.57299
false
4.412223
false
false
false
MaxNoe/cta_event_viewer
protobuf/cta_event_pb2.py
1
2433
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: cta_event.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _ref...
mit
-9,132,853,243,116,970,000
31.013158
181
0.7127
false
3.056533
false
true
false
philiparvidsson/pymake2
src/pymake2/cli/main.py
1
2868
""" Provides the command-line interface for pymake2. """ #--------------------------------------- # IMPORTS #--------------------------------------- import os import sys from pymake2 import report from pymake2.cli import info, options from pymake2.core import makeconf from pymak...
mit
1,219,372,225,046,710,000
23.305085
76
0.541144
false
3.875676
false
false
false
IntelLabs/hpat
sdc/tests/tests_perf/generator.py
1
4291
import time import numpy as np from typing import NamedTuple from sdc.io.csv_ext import to_varname from sdc.tests.test_utils import * class CallExpression(NamedTuple): """ code: function or method call as a string type_: type of function performed (Python, Numba, SDC) jitted: option indicating whether...
bsd-2-clause
-4,105,631,501,158,639,000
29.006993
101
0.636215
false
3.389415
true
false
false
indico/indico
indico/modules/events/management/controllers/protection.py
3
7204
# This file is part of Indico. # Copyright (C) 2002 - 2021 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. from operator import attrgetter from flask import flash, jsonify, redirect, request from werkzeug.excepti...
mit
4,333,181,202,084,517,000
48.682759
115
0.686008
false
4.109527
false
false
false
jdwittenauer/ionyx
ionyx/contrib/category_to_numeric.py
1
2642
import numpy as np class CategoryToNumeric(object): """ Transform class that replaces a categorical value with a representative target value for instances that belong to that category. This technique is useful as a method to turn categorical features into numeric values for use in an estimator, and c...
apache-2.0
3,332,585,937,923,979,300
30.082353
88
0.539364
false
4.531732
false
false
false
DemocracyClub/yournextrepresentative
ynr/apps/people/migrations/0004_move_person_data.py
1
1879
# -*- coding: utf-8 -*- # Generated by Django 1.10.8 on 2018-10-23 18:45 from __future__ import unicode_literals from django.db import migrations def move_person_from_popolo(apps, schema_editor): PopoloPerson = apps.get_model("popolo", "Person") PeoplePerson = apps.get_model("people", "Person") for pper...
agpl-3.0
3,368,418,970,247,607,300
33.163636
79
0.602448
false
3.750499
false
false
false
alberthxf/custodian
setup.py
1
1560
import os from ez_setup import use_setuptools use_setuptools() from setuptools import setup, find_packages with open("README.rst") as f: long_desc = f.read() ind = long_desc.find("\n") long_desc = long_desc[ind + 1:] setup( name="custodian", packages=find_packages(), version="0.8.1", inst...
mit
3,628,376,852,117,945,000
35.27907
71
0.619231
false
3.653396
false
false
false
vascotenner/holoviews
holoviews/__init__.py
1
3414
from __future__ import print_function, absolute_import import os, sys, pydoc import numpy as np # noqa (API import) _cwd = os.path.abspath(os.path.split(__file__)[0]) sys.path.insert(0, os.path.join(_cwd, '..', 'param')) import param __version__ = param.Version(release=(1,5,0), fpath=__file__, ...
bsd-3-clause
414,004,592,514,076,860
40.634146
90
0.603984
false
4.272841
false
false
false
arne-cl/discoursegraphs
src/discoursegraphs/readwrite/rst/rstlatex.py
1
8330
#!/usr/bin/env python # -*- coding: utf-8 -*- # Author: Arne Neumann <discoursegraphs.programming@arne.cl> """ This module contains code to generate figures of RST trees in Latex (using the rst.sty package). """ # Python 2/3 compatibility from __future__ import (absolute_import, division, prin...
bsd-3-clause
-8,106,414,627,086,261,000
37.211009
119
0.646218
false
3.650307
false
false
false
getsentry/zeus
tests/zeus/utils/test_metrics.py
1
1845
from time import time from zeus.utils.metrics import Counter, HitCounter, gauge def test_hit_counter(): current_ts = int(time()) c = HitCounter(size=3) c.incr(current_ts=current_ts) c.incr(current_ts=current_ts) assert c.count(current_ts=current_ts) == 2 assert c.count(1, current_ts=current_t...
apache-2.0
-3,649,925,010,883,005,400
30.810345
74
0.63794
false
3.085284
false
false
false
PriviPK/privipk-sync-engine
inbox/util/misc.py
3
5298
import sys import pkgutil import time import re from datetime import datetime from email.utils import parsedate_tz, mktime_tz from inbox.log import get_logger from inbox.providers import providers class ProviderSpecificException(Exception): pass def or_none(value, selector): if value is None: retu...
agpl-3.0
4,643,929,602,232,661,000
25.893401
74
0.61174
false
3.927354
false
false
false
apache/incubator-superset
superset/dashboards/commands/bulk_delete.py
3
2873
# 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
3,141,048,109,437,204,500
38.902778
88
0.714236
false
4.300898
false
false
false
t1m0thyj/aiyprojects-raspbian
src/aiy/_drivers/_tts.py
1
2331
# Copyright 2017 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
apache-2.0
-8,534,463,058,438,349,000
28.884615
81
0.659374
false
3.630841
false
false
false
Pluto-tv/chromium-crosswalk
tools/telemetry/third_party/gsutilz/gslib/third_party/storage_apitools/storage_v1_client.py
12
44162
# Copyright 2014 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
bsd-3-clause
2,455,258,158,905,939,000
41.341323
367
0.621349
false
4.343661
true
false
false
biota/sourcetracker2
sourcetracker/tests/test_sourcetracker.py
1
58590
#!/usr/bin/env python # ---------------------------------------------------------------------------- # Copyright (c) 2016--, Biota Technology. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file LICENSE, distributed with this software. # -------------------------------------...
bsd-3-clause
-7,534,571,585,709,418,000
45.5
79
0.49133
false
3.320111
true
false
false
DanyC97/algorithms
algorithms/searching/depth_first_search.py
5
1076
""" Depth First Search ------------------ Recursive implementation of the depth first search algorithm used to traverse trees or graphs. Starts at a selected node (root) and explores the branch as far as possible before backtracking. Time Complexity: O(E + V) E = Number of edges ...
bsd-3-clause
6,116,533,381,887,268,000
29.742857
79
0.648699
false
4.203125
false
false
false
google/starthinker
starthinker/task/traffic/test.py
1
1495
########################################################################### # # 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 # # https://www.apache.org/l...
apache-2.0
3,856,234,003,942,590,000
37.333333
114
0.613378
false
3.986667
false
false
false
Catch-up-TV-and-More/plugin.video.catchuptvandmore
resources/lib/websites/lesargonautes.py
1
2870
# -*- coding: utf-8 -*- # Copyright: (c) 2018, SylvainCecchetto # GNU General Public License v2.0+ (see LICENSE.txt or https://www.gnu.org/licenses/gpl-2.0.txt) # This file is part of Catch-up TV & More from __future__ import unicode_literals import json import re from codequick import Listitem, Resolver, Route impo...
gpl-2.0
2,377,813,101,347,847,000
29.860215
96
0.61324
false
3.364596
false
false
false
south-coast-science/scs_core
tests/aqcsv/specification/country_test.py
1
1100
#!/usr/bin/env python3 """ Created on 4 Mar 2019 @author: Bruno Beloff (bruno.beloff@southcoastscience.com) """ from scs_core.aqcsv.specification.country_iso import CountryISO from scs_core.aqcsv.specification.country_numeric import CountryNumeric from scs_core.data.json import JSONify # -------------------------...
mit
8,914,476,633,248,161,000
22.913043
118
0.640909
false
3.548387
false
false
false
varun-suresh/Clustering
evaluation.py
1
1895
# Script to evaluate the performance of the clustering algorithm. import argparse from itertools import combinations from collections import defaultdict def count_correct_pairs(cluster, labels_lookup): """ Given a cluster, count the number of pairs belong to the same label and the total number of pairs. ...
mit
7,007,695,952,947,865,000
33.454545
80
0.641689
false
4.075269
false
false
false
CheeseLord/warts
src/shared/geometry.py
1
13529
""" Functions for doing geometry calculations in the various types of coordinates shared between client and server. """ import heapq import math from src.shared.config import CHUNK_SIZE, BUILD_SIZE from src.shared.exceptions import NoPathToTargetError from src.shared.logconfig import newLogger log = newLogger(__name...
mit
184,582,993,762,131,330
32.992462
79
0.592357
false
3.809913
false
false
false
jesseward/harmonic-shuffle
harmonic_shuffle/harmony.py
1
3320
import logging logger = logging.getLogger(__name__) class Harmony(object): # numeric representation of the Circle of 5ths. HARMONY = { 'G': 1, 'D': 2, 'A': 3, 'E': 4, 'B': 5, 'F#': 6, 'Gb': 6, 'Db': 7, 'C#': 7, 'Ab': 8, '...
mit
-5,146,620,431,627,529,000
28.642857
114
0.528614
false
3.513228
false
false
false
kaffeebrauer/Lean
Algorithm.Python/CoarseFundamentalTop3Algorithm.py
5
3479
# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals. # Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the Lice...
apache-2.0
-6,356,268,221,975,157,000
39.917647
151
0.708657
false
3.919955
false
false
false
redus/doodles
django-ex/survivalguide/survivalguide/settings.py
1
2136
""" Django settings for survivalguide project. For more information on this file, see https://docs.djangoproject.com/en/1.6/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.6/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ....
unlicense
-1,785,783,226,436,275,500
22.472527
71
0.720506
false
3.178571
false
false
false
ubuntunux/GuineaPig
PyEngine3D/Utilities/TransformObject.py
1
6511
import numpy as np from .Transform import * class TransformObject: def __init__(self, local=None): self.quat = Float4(0.0, 0.0, 0.0, 1.0) self.local = local if local is not None else Matrix4() self.updated = True self.left = WORLD_LEFT.copy() self.up = WORLD_UP.copy() ...
bsd-2-clause
-1,846,344,314,063,186,700
27.682819
104
0.530948
false
3.20897
false
false
false