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
hakril/PythonForWindows
samples/process/thread.py
1
1631
import sys import os.path sys.path.append(os.path.abspath(__file__ + "\..\..")) import windows import windows.native_exec.simple_x86 as x86 import windows.native_exec.simple_x64 as x64 print("Creating a notepad") ## Replaced calc.exe by notepad.exe cause of windows 10. notepad = windows.utils.create_process(r"C:\wind...
bsd-3-clause
-8,247,220,387,132,427,000
28.125
84
0.667075
false
3.04291
false
false
false
start-jsk/jsk_apc
demos/grasp_data_generator/scripts/generate_evaluation_data.py
1
3866
import argparse import cv2 import datetime import json import matplotlib.pyplot as plt import numpy as np import os import os.path as osp import PIL.Image import PIL.ImageDraw import yaml from chainercv.utils.mask.mask_to_bbox import mask_to_bbox from grasp_data_generator.visualizations \ import vis_occluded_inst...
bsd-3-clause
2,756,688,793,698,856,400
34.46789
79
0.55432
false
3.406167
false
false
false
scanny/python-pptx
pptx/oxml/chart/shared.py
1
6097
# encoding: utf-8 """Shared oxml objects for charts.""" from __future__ import absolute_import, division, print_function, unicode_literals from pptx.oxml import parse_xml from pptx.oxml.ns import nsdecls from pptx.oxml.simpletypes import ( ST_LayoutMode, XsdBoolean, XsdDouble, XsdString, XsdUnsig...
mit
-5,779,250,776,741,064,000
26.21875
82
0.579957
false
3.411863
false
false
false
quantopian/zipline
zipline/data/bundles/csvdir.py
1
8039
""" Module for building a complete dataset from local directory with csv files. """ import os import sys from logbook import Logger, StreamHandler from numpy import empty from pandas import DataFrame, read_csv, Index, Timedelta, NaT from trading_calendars import register_calendar_alias from zipline.utils.cli import m...
apache-2.0
-5,625,354,991,096,741,000
34.414097
79
0.524941
false
4.264721
false
false
false
CLandauGWU/group_e
supp_funcs.py
1
9214
def zoneConcentration(shp_gdf, raw, pntLst, bufr=None): from downloading_funcs import addr_shape, down_extract_zip import pandas as pd import geopandas as gpd pnt = pntLst[0] pnt_isCalled = pntLst[1] for url in pnt: if url[-3:] == 'zip': pnt = url asser...
mit
5,698,252,796,958,923,000
28.822006
91
0.572173
false
3.211572
false
false
false
timole/sopernovus
dev/prod2csv.py
1
7254
#!/usr/bin/env python # -*- coding: utf-8 -*- import re, sys, json from pymongo import MongoClient a = None def parseColumnNames(f): line = f.readline() return line.split(',') inputFilename = sys.argv[1] inputFilenameCron = sys.argv[2] outputfilename = sys.argv[3] outputfilenameIds = sys.argv[4] outputfile...
mit
6,015,316,454,777,002,000
26.793103
288
0.514613
false
3.645226
false
false
false
brainiak/brainiak
setup.py
1
5433
from distutils import sysconfig from setuptools import setup, Extension, find_packages from setuptools.command.build_ext import build_ext import os import site import sys import setuptools from copy import deepcopy assert sys.version_info >= (3, 5), ( "Please use Python version 3.5 or higher, " "lower version...
apache-2.0
-1,000,340,240,095,070,700
30.77193
93
0.598196
false
3.516505
false
false
false
ryfeus/lambda-packs
pytorch/source/torch/cuda/nccl.py
1
1644
import warnings import torch.cuda __all__ = ['all_reduce', 'reduce', 'broadcast', 'all_gather', 'reduce_scatter'] SUM = 0 # ncclRedOp_t def is_available(tensors): devices = set() for tensor in tensors: if tensor.is_sparse: return False if not tensor.is_contiguous(): ...
mit
-5,757,900,926,952,547,000
25.095238
79
0.646594
false
3.37577
false
false
false
w0921444648/IT110_DJANGO_ATTEMPT2
mysite/mysite/settings.py
1
3236
""" Django settings for mysite project. Generated by 'django-admin startproject' using Django 1.9. For more information on this file, see https://docs.djangoproject.com/en/1.9/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.9/ref/settings/ """ import os # Bu...
gpl-2.0
2,290,409,260,022,670,000
25.52459
91
0.689431
false
3.505959
false
false
false
scienceopen/pybashutils
getIP_curl.py
1
2046
#!/usr/bin/env python """ gets interface IPv4 and IPv6 public addresses using libCURL This uses the "reflector" method, which I feel is more reliable for finding public-facing IP addresses, WITH THE CAVEAT that man-in-the-middle, etc. attacks can defeat the reflector method. PyCurl does not have a context manager. ht...
bsd-3-clause
2,727,372,804,540,858,000
26.28
120
0.646139
false
3.343137
false
false
false
github-borat/cinder
cinder/volume/drivers/vmware/error_util.py
1
2480
# Copyright (c) 2013 VMware, 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...
apache-2.0
2,716,783,250,249,688,000
30
78
0.722581
false
4.253859
false
false
false
dbreen/connectfo
game/scenes/about.py
1
1898
import pygame import random from game import constants from game.media import media from game.scene import Scene class Bouncy(object): def __init__(self, surf): self.surf = surf self.pos_x = random.randrange(0, constants.SCREEN_WIDTH - surf.get_width()) self.pos_y = random.ran...
mit
2,367,316,040,705,137,000
33.811321
97
0.570601
false
3.371226
false
false
false
shermp/KoboPatchGUI
PatchEdit.py
1
7070
import re import io, os, sys def iterDic(dic): """ Return a python 2/3 compatible iterable :param dic: :param pythonTwo: :return: """ if sys.version_info.major == 2: return dic.viewitems() else: return dic.items() class Patch: """ Create an object that contains ...
mit
-6,138,971,067,062,184,000
32.995192
115
0.563366
false
3.649974
false
false
false
edeposit/edeposit.amqp.storage
src/edeposit/amqp/storage/storage_handler.py
1
7204
#! /usr/bin/env python # -*- coding: utf-8 -*- # # Interpreter version: python 2.7 # # Imports ===================================================================== import transaction from BTrees.OOBTree import OOBTree from BTrees.OOBTree import OOTreeSet from BTrees.OOBTree import intersection from zeo_connector impo...
mit
4,649,346,435,320,711,000
28.52459
79
0.54678
false
4.519448
false
false
false
byashimov/django-controlcenter
tests/test_templatetags.py
1
11715
import collections import json from django import VERSION from django.contrib.auth.models import User from django.contrib.contenttypes.models import ContentType from controlcenter import app_settings, widgets from controlcenter.templatetags.controlcenter_tags import ( _method_prop, attrlabel, attrvalue, ...
bsd-3-clause
-5,575,421,691,948,398,000
31.541667
78
0.583696
false
4.167556
true
false
false
danceasarxx/pyfunk
pyfunk/monads/helpers.py
1
1936
from pyfunk import combinators as _, collections as __ @_.curry def fmap(fn, f): """ Generic version of fmap. @sig fmap :: Functor f => (a -> b) -> f a -> f b """ return f.fmap(fn) if hasattr(f, 'fmap') else __.fmap(fn, f) @_.curry def chain(fn, c): """ Generic version of chain @sig ...
gpl-3.0
1,954,826,466,861,489,700
22.325301
79
0.502583
false
2.942249
false
false
false
TkTech/sachi
sachi/backends/solr.py
1
6451
# -*- coding: utf-8 -*- from __future__ import unicode_literals import json import logging from sachi import six, fields from sachi.query import QAll from sachi.backends.base import SearchBackend logger = logging.getLogger(__name__) FIELD_MAPPINGS = { fields.TextField: 'text_en', fields.StringField: 'string...
mit
-4,865,335,914,014,963,000
32.42487
79
0.502868
false
4.320831
false
false
false
Ventrosky/python-scripts
network-recon/sql-scan.py
1
1585
#!/usr/bin/env python import sys, os, subprocess def nmapScriptsScan(ip, port): print "[-] Starting nmap ms-sql script scan for " + ip + ":" + port nmapCmd = "nmap -sV -Pn -v -p "+port+" --script=ms-sql* -oN reports/sql/"+ip+"_"+port+"_nmap "+ip+ " >> reports/sql/"+ip+"_"+port+"_nmapOutput.txt" subprocess...
gpl-3.0
442,974,220,446,875,260
37.658537
152
0.543849
false
3.394004
false
false
false
alexhayes/django-toolkit
django_toolkit/font_awesome.py
1
5598
from django.core.urlresolvers import reverse from copy import copy class Icon(): """ Represents a Bootstrap icon (<i>) tag. """ def __init__(self, icon, *css): self.icon = icon self.css = css def render(self, extra_css=[]): html = '<i class="%s' % self.icon if ...
mit
-2,145,452,662,055,833,300
30.8125
122
0.486781
false
3.914685
false
false
false
sergiohr/NeoDB
core/blockdb.py
1
3923
''' Created on Apr 20, 2014 @author: sergio ''' import psycopg2 import neo.core from .. import dbutils class BlockDB(neo.core.Block): ''' classdocs ''' def __init__(self, id_project = None, id_individual = None, name = None, description = None, file_origin = None, ...
gpl-3.0
8,031,664,291,213,629,000
32.538462
105
0.53454
false
4.103556
false
false
false
lavanoid/pi-rc
control_dune_warrior.py
1
8703
#!/usr/bin/env python """Manually send commands to the RC car.""" import argparse import json import pygame import pygame.font import socket import sys from common import server_up UP = LEFT = DOWN = RIGHT = False QUIT = False # pylint: disable=superfluous-parens def dead_frequency(frequency): """Returns an app...
gpl-2.0
9,042,649,700,021,385,000
25.372727
87
0.568884
false
3.803759
false
false
false
damaggu/SAMRI
samri/pipelines/utils.py
1
6258
# -*- coding: utf-8 -*- from __future__ import print_function, division, unicode_literals, absolute_import def parse_paravision_date(pv_date): """Convert ParaVision-style datetime string to Python datetime object. Parameters ---------- pv_date : str ParaVision datetime string. Returns ------- `datetime.d...
gpl-3.0
-7,383,947,743,070,093,000
28.380282
167
0.693193
false
3.250909
false
false
false
andresailer/DIRAC
tests/Integration/Resources/Catalog/FIXME_Test_CatalogPlugin.py
1
18130
#! /usr/bin/env python # FIXME: it has to be seen if this is any useful # FIXME: to bring back to life from DIRAC.Core.Base.Script import parseCommandLine parseCommandLine() from DIRAC.Resources.Catalog.FileCatalog import FileCatalog from DIRAC.Core.Utilities.File ...
gpl-3.0
3,103,157,516,962,040,000
44.325
170
0.703475
false
3.558391
true
false
false
nmalaguti/mini-halite
tournament/migrations/0001_initial.py
1
2061
# -*- coding: utf-8 -*- # Generated by Django 1.10.5 on 2017-01-09 05:56 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.Crea...
mit
5,398,077,657,251,073,000
37.886792
137
0.540029
false
4.5
false
false
false
rleigh-dundee/openmicroscopy
components/tools/OmeroWeb/omeroweb/webgateway/views.py
1
64885
# # webgateway/views.py - django application view handling functions # # Copyright (c) 2007, 2008, 2009 Glencoe Software, Inc. All rights reserved. # # This software is distributed under the terms described by the LICENCE file # you can find at the root of the distribution bundle, which states you are # free to use i...
gpl-2.0
-5,932,802,012,153,358,000
36.636311
184
0.587316
false
3.653023
false
false
false
Parallel-in-Time/pySDC
pySDC/playgrounds/mpifft/grayscott.py
1
7994
import numpy as np from mpi4py import MPI import matplotlib.pyplot as plt from pySDC.helpers.stats_helper import filter_stats, sort_stats from pySDC.implementations.collocation_classes.gauss_radau_right import CollGaussRadau_Right from pySDC.implementations.collocation_classes.gauss_lobatto import CollGaussLobatto fro...
bsd-2-clause
632,620,661,393,249,800
38.97
120
0.643858
false
3.265523
false
false
false
sbates130272/libdonard
scripts/imgrep.py
1
6622
#!/usr/bin/env python ######################################################################## ## ## Copyright 2014 PMC-Sierra, 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 ## htt...
apache-2.0
2,855,813,345,342,170,000
32.958974
99
0.517064
false
3.596958
false
false
false
edy89/Compugrafica
level2.py
1
14250
import pygame import sys import random import level1_main import menu from pygame.locals import * pygame.init() reloj = pygame.time.Clock() opciones = [ ("Jugar", level1_main.Nivel_1), ("Creditos", menu.creditos), ("Salir", menu.salir_del_programa) ...
gpl-3.0
-8,573,626,075,694,006,000
40.537313
122
0.479368
false
3.348214
false
false
false
GoodCloud/johnny-cache
johnny/transaction.py
1
10890
#!/usr/bin/env python # -*- coding: utf-8 -*- from django.db import transaction as django_transaction from django.db import connection try: from django.db import DEFAULT_DB_ALIAS except: DEFUALT_DB_ALIAS = None try: from functools import wraps except ImportError: from django.utils.functional import wr...
mit
-1,120,410,348,727,484,800
33.245283
115
0.551974
false
3.975904
false
false
false
the-fascinator/fascinator-portal
src/main/config/portal/default/default/scripts/download.py
1
7607
import os from com.googlecode.fascinator.api.indexer import SearchRequest from com.googlecode.fascinator.api.storage import StorageException from com.googlecode.fascinator.common.solr import SolrDoc, SolrResult from java.io import ByteArrayInputStream, ByteArrayOutputStream from java.lang import Boolean from java.net...
gpl-2.0
963,536,829,417,706,400
35.927184
100
0.567767
false
4.386967
false
false
false
digiholic/universalSmashSystem
engine/abstractFighter.py
1
75599
import settingsManager import pygame import xml.etree.ElementTree as ElementTree import xml.dom.minidom import os import engine.baseActions as baseActions import engine.collisionBox as collisionBox import weakref import engine.hurtbox as hurtbox import math import numpy import spriteManager import engine.ar...
gpl-3.0
-4,722,417,059,480,184,000
40.139911
237
0.555986
false
4.229788
false
false
false
rockneurotiko/madness-things
Python/Pygame/2-sprites/platfom_simple.py
1
4157
import pygame BLACK = ( 0, 0, 0) WHITE = ( 255, 255, 255) BLUE = ( 0, 0, 255) RED = ( 255, 0, 0) GREEN = ( 0, 255, 0) size = (800, 600) class Player(pygame.sprite.Sprite): change_x = 0 change_y = 0 level = None def __init__(self): pygame.sprite.Sprite.__init__(self) #The player. take an image, but now a...
mpl-2.0
384,585,491,287,128,450
21.117021
70
0.65071
false
2.702861
false
false
false
vileopratama/vitech
docs/tutorials/ebook/Odoo Development Cookbook/OdooDevelopmentCookbook_Code/Chapter13_code/ch13_r02_restrict_access_to_web_accessible_paths/controllers/main.py
1
2112
# -*- coding: utf-8 -*- # © 2015 Therp BV <http://therp.nl> # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from openerp import http from openerp.http import request class Main(http.Controller): @http.route('/my_module/all-books', type='http', auth='none') def all_books(self): rec...
mit
2,850,783,390,967,410,000
37.381818
77
0.547134
false
3.620926
false
false
false
ahnolds/rpglib
rpglib/window.py
1
10818
""" The module for drawing the game world """ # Standard Library packages import sys # External dependenices import pygame # Internal dependencies import world # Rendering settings SCREEN_X = 450 SCREEN_Y = 450 HALF_SCREEN_X = SCREEN_X // 2 HALF_SCREEN_Y = SCREEN_Y // 2 SQUARE_SIZE = 18 SCREEN_BG = ...
gpl-2.0
3,770,847,533,449,233,000
34.585526
84
0.495563
false
4.068447
false
false
false
GluonsAndProtons/gluon
gluon/backends/backends/proton_client.py
1
2296
from oslo_log import log as logging from gluon.common import exception as exc from requests import get, put, post, delete import json LOG = logging.getLogger(__name__) logger = LOG class Client(object): def __init__(self, backend): self._backend = backend def json_get(self, url): resp = get...
apache-2.0
-5,607,964,346,719,619,000
37.915254
79
0.490854
false
4.610442
false
false
false
digitalocean/netbox
netbox/tenancy/filters.py
1
2787
import django_filters from django.db.models import Q from extras.filters import CustomFieldModelFilterSet, CreatedUpdatedFilterSet from utilities.filters import BaseFilterSet, NameSlugSearchFilterSet, TagFilter, TreeNodeMultipleChoiceFilter from .models import Tenant, TenantGroup __all__ = ( 'TenancyFilterSet', ...
apache-2.0
1,279,330,868,893,995,500
28.648936
109
0.634733
false
4.050872
false
false
false
NetApp/manila
manila/tests/api/fakes.py
1
9038
# Copyright 2010 OpenStack 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 b...
apache-2.0
-2,230,026,258,513,124,000
27.511041
79
0.609648
false
3.583664
false
false
false
Tjorriemorrie/twurl
gae/src/views.py
1
16080
from src import app from flask import request, render_template, json, Response, abort, redirect from models import User, Tweet, Link, UserLink import urllib import base64 from google.appengine.api import urlfetch, taskqueue, mail import datetime import math from flask.ext.jsontools import jsonapi import urlparse import...
apache-2.0
-4,003,832,567,429,699,600
32.569937
133
0.600684
false
3.689766
false
false
false
joelagnel/ns-3
src/visualizer/visualizer/plugins/mesh.py
1
6674
import gtk import ns3 from visualizer.base import InformationWindow NODE_STATISTICS_MEMORY = 10 class StatisticsCollector(object): """ Collects interface statistics for all nodes. """ class NetDevStats(object): __slots__ = ['rxPackets', 'rxBytes', 'txPackets', 'txBytes', ...
gpl-2.0
-4,180,465,858,970,958,000
38.02924
94
0.596644
false
3.864505
false
false
false
rmmariano/testejenkins
tests/global_imports.py
1
2622
#!/usr/bin/env python # -*- coding: utf-8 -*- from common import * from os import path from os import remove from glob import glob # Imports automáticos from gluon.cache import Cache from gluon.globals import Request, Response, Session from gluon.http import HTTP, redirect from gluon.sql import DAL, Field, SQLDB fr...
mit
7,813,400,860,123,454,000
23.439252
83
0.695103
false
3.191697
false
false
false
syntheticpp/lyx
lib/lyx2lyx/lyx2lyx_tools.py
1
19009
# This file is part of lyx2lyx # -*- coding: utf-8 -*- # Copyright (C) 2011 The LyX team # # 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
-5,966,020,858,891,533,000
35.001894
110
0.559209
false
3.468163
false
false
false
yoseforb/lollypop
src/define.py
1
2679
#!/usr/bin/python # Copyright (c) 2014-2015 Cedric Bellegarde <cedric.bellegarde@adishatz.org> # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your opti...
gpl-3.0
-5,321,358,665,882,580,000
24.759615
76
0.651362
false
3.529644
false
false
false
openqt/algorithms
projecteuler/ac/old/pe051_prime_digit_replacements.py
1
3267
#!/usr/bin/env python # coding=utf-8 """ Prime digit replacements Problem 51 By replacing the 1st digit of the 2-digit number *3, it turns out that six of the nine possible values: 13, 23, 43, 53, 73, and 83, are all prime. By replacing the 3rd and 4th digits of 56**3 with the same digit, this 5-digit number is the f...
gpl-3.0
-7,675,758,474,691,941,000
28.972477
102
0.566269
false
3.159574
false
false
false
byt3smith/CIRTKit
modules/reversing/viper/strings.py
1
8205
# This file is part of Viper - https://github.com/viper-framework/viper # See the file 'LICENSE' for copying permission. import os import re from socket import inet_pton, AF_INET6, error as socket_error from lib.common.abstracts import Module from lib.core.session import __sessions__ DOMAIN_REGEX = re.compile('([a-z...
mit
1,134,222,950,011,861,100
64.64
124
0.467642
false
2.187417
false
false
false
ekansa/open-context-py
opencontext_py/apps/imports/fieldannotations/complexdescriptions.py
1
11675
import uuid as GenUUID from django.conf import settings from django.db import models from opencontext_py.libs.general import LastUpdatedOrderedDict from opencontext_py.apps.ocitems.manifest.models import Manifest from opencontext_py.apps.ocitems.documents.models import OCdocument from opencontext_py.apps.imports.fields...
gpl-3.0
-8,557,080,162,303,926,000
59.807292
142
0.484968
false
5.179681
false
false
false
gabelula/b-counted
.google_appengine/tools/bulkload_client.py
1
1747
#!/usr/bin/env python # # Copyright 2007 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 o...
apache-2.0
3,248,498,652,674,230,300
33.254902
76
0.680595
false
3.346743
false
false
false
haanme/FinnBrain
pipeline_DTI_step1_DTIprep.py
1
4312
#!/usr/bin/env python #################################################################### # Python 2.7 script for executing FA, MD calculations for one case # #################################################################### # Directory where result data are located experiment_dir = '/Users/eija/Documents/FinnBra...
mit
-2,800,876,285,888,440,000
33.222222
200
0.618506
false
3.384615
false
false
false
ionitadaniel19/testframeworksevolution
src/hybridframework/hybridtests.py
1
2051
''' Created on 01.06.2014 @author: ionitadaniel19 ''' def show_answer_hybrid_simple(driver,scenario): from modularframework.login import LoginPage from modularframework.testframeworks import TestFrameworksPage from config.utilities import get_simple_hybrid_driven_scenario_values from config.co...
mit
-3,050,877,202,472,316,400
48.073171
177
0.643588
false
4.202869
true
false
false
Azure/azure-sdk-for-python
sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_default_security_rules_operations.py
1
8972
# 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
4,355,501,811,463,052,300
47.76087
236
0.650022
false
4.452605
true
false
false
cmateu/gaiaerror_py
gaiaerr.py
1
5490
#!/usr/bin/env python import numpy as np import scipy import sys import os import os.path import argparse import myutils #--------Version History---------------------------------------------------------------------------- # 16/nov/2017: parallax mission time scaling factor fixed (goes as (5./tm)**0...
bsd-3-clause
1,554,841,752,632,622,300
37.661972
326
0.701093
false
2.610556
false
false
false
WilJoey/tn_ckan
ckan/lib/email_notifications.py
1
7858
''' Code for generating email notifications for users (e.g. email notifications for new activities in your dashboard activity stream) and emailing them to the users. ''' import datetime import re import pylons import ckan.model as model import ckan.logic as logic import ckan.lib.base as base from ckan.common import...
mit
3,647,540,538,416,515,000
33.61674
79
0.670781
false
3.917248
false
false
false
vnsofthe/odoo-dev
addons/rhwl_gene/rhwl_gene.py
1
55239
# -*- coding: utf-8 -*- from openerp import SUPERUSER_ID, api from openerp.osv import fields, osv from openerp.tools.translate import _ import openerp.addons.decimal_precision as dp import datetime,time import logging import os import shutil import re import urllib2 from openerp import tools from lxml import etree _lo...
agpl-3.0
-2,561,111,213,991,747,000
48.208411
304
0.545021
false
2.91949
false
false
false
pazagra/catkin_ws
src/Multimodal_Interaction/Offline_Learning/SVM.py
1
3693
from scipy.cluster.vq import * from sklearn.preprocessing import Normalizer from sklearn.svm import LinearSVC from sklearn.externals import joblib from sklearn.svm import * from sklearn.metrics import * from sklearn import linear_model import matplotlib.pyplot as plt import cv2 import os import numpy as np from sklearn...
gpl-3.0
-1,168,504,347,862,580,700
34.519231
86
0.580558
false
3.826943
false
false
false
jscottcronin/PinkSlipper
Featurize_Data/prnewswire_featurize.py
1
5306
from collections import defaultdict import pymongo import requests from bs4 import BeautifulSoup import numpy as np import newspaper def in_clean_db(title, database): ''' PURPOSE: check if article is in given database INPUT: title (str) - article headline database (pymongo obj) - c...
gpl-2.0
3,361,504,421,104,785,000
28.977401
76
0.525066
false
4.097297
false
false
false
marcardioid/DailyProgrammer
solutions/237_Intermediate/solution.py
1
1128
def fill(grid): legend = {0: '#', 1: '=', 2: '-', 3: '.'} grid = {(x, y): grid[y][x] for y in range(h) for x in range(w)} def flood(root=(1, 1), depth=0): visited = set() queue = {root} while queue: node = queue.pop() ...
mit
7,404,926,787,901,546,000
36.633333
109
0.428191
false
3.27907
false
false
false
AstroTech/workshop-python
django/solution/untitled/iris/migrations/0001_initial.py
1
1172
# Generated by Django 2.1.4 on 2018-12-05 10:46 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Iris', fields=[ ('id', models.AutoField(aut...
mit
4,240,290,656,096,076,300
42.407407
115
0.610922
false
3.919732
false
false
false
endlessm/chromium-browser
third_party/chromite/lib/unittest_lib.py
1
2714
# -*- coding: utf-8 -*- # Copyright 2014 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Unittest-only utility functions library.""" from __future__ import print_function import os from chromite.lib import cros_bu...
bsd-3-clause
6,010,867,396,611,084,000
31.309524
80
0.670597
false
3.652759
false
false
false
recrm/Zanar2
udebs/interpret.py
1
11842
#!/usr/bin/env python3 import sys import re import copy import json import itertools class standard: """ Basic functionality built into the Udebs scripting language. None of the functions here can depend on any other Udebs module. """ def _print(*args): print(*args) return True ...
mit
6,787,578,980,685,789,000
25.374165
104
0.492653
false
4.015599
false
false
false
prheenan/prhUtil
igor/scripts/SurfaceDetection/SurfaceUtil.py
1
4678
# force floating point division. Can still use integer with // from __future__ import division # This file is used for importing the common utilities classes. import numpy as np import matplotlib.pyplot as plt # need to add the utilities class. Want 'home' to be platform independent from os.path import expanduser home ...
gpl-2.0
-2,648,850,792,978,439,000
42.314815
77
0.680847
false
3.951014
false
false
false
caiogit/bird-a
backend/birda/storage/__init__.py
1
8395
#!/usr/bin/env python # -*- coding: utf-8 -*- # References: # - Static and abstract methods: https://julien.danjou.info/blog/2013/guide-python-static-class-abstract-methods # - Singletons in Python: http://stackoverflow.com/questions/6760685/creating-a-singleton-in-python?rq=1 # - Lock acquisition with a decorator: ht...
gpl-3.0
6,128,479,153,392,613,000
26.709571
158
0.537344
false
3.849152
false
false
false
onelab-eu/sfa
sfa/client/sfaadmin.py
1
22773
#!/usr/bin/python import os import sys import copy from pprint import pformat, PrettyPrinter from optparse import OptionParser from sfa.generic import Generic from sfa.util.xrn import Xrn from sfa.storage.record import Record from sfa.trust.hierarchy import Hierarchy from sfa.trust.gid import GID from sfa.trust.cert...
mit
-1,940,394,473,199,436,800
42.543021
151
0.575243
false
3.84744
false
false
false
gnocchixyz/python-gnocchiclient
gnocchiclient/v1/resource_cli.py
1
10591
# # 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 # ...
apache-2.0
-1,724,077,443,211,696,600
38.966038
78
0.572656
false
4.365622
false
false
false
cualbondi/cualbondi.com.ar
apps/widget/views.py
1
3631
from apps.catastro.models import Ciudad from apps.core.models import Recorrido from django.contrib.gis.geos import Point from django.http import HttpResponse from django.shortcuts import render_to_response from django.template import RequestContext from django.conf import settings from django.contrib.sites.models impo...
agpl-3.0
6,066,271,413,888,378,000
40.261364
153
0.552189
false
4.003308
false
false
false
alexharmenta/Inventationery
Inventationery/apps/Inventory/migrations/0015_orderhistorymodel.py
1
1364
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('Inventory', '0014_auto_20151227_1250'), ] operations = [ migrations.CreateModel( name='OrderHistoryModel', ...
bsd-3-clause
8,270,451,206,548,817,000
40.333333
136
0.574047
false
4.302839
false
false
false
cdiener/micom
micom/solution.py
1
3836
"""A community solution object.""" import numpy as np import pandas as pd from optlang.interface import OPTIMAL from cobra.core import Solution, get_solution def _group_species(values, ids, species, what="reaction"): """Format a list of values by id and species.""" df = pd.DataFrame({values.name: values, wha...
apache-2.0
2,541,745,594,639,425,500
42.590909
79
0.612617
false
4.156013
false
false
false
pitpig/rozowoo
app/trackback.py
1
3315
"""tblib.py: A Trackback (client) implementation in Python """ __author__ = "Matt Croydon <matt@ooiio.com>" __copyright__ = "Copyright 2003, Matt Croydon" __license__ = "GPL" __version__ = "0.1.0" __history__ = """ 0.1.0: 1/29/03 - Code cleanup, release. It can send pings, and autodiscover a URL to ping. 0.0.9: 1/29/0...
mit
-4,092,896,514,661,918,700
43.213333
131
0.625943
false
3.607182
false
false
false
MaxVanDeursen/tribler
Tribler/Core/statistics.py
1
5656
import os from Tribler.Core.CacheDB.sqlitecachedb import DB_FILE_RELATIVE_PATH from Tribler.Core.simpledefs import NTFY_TORRENTS, NTFY_CHANNELCAST DATA_NONE = u"None" class TriblerStatistics(object): def __init__(self, session): """ Constructor. :param session: The Tribler session. ...
lgpl-3.0
5,846,355,451,444,601,000
47.34188
118
0.62111
false
4.031361
false
false
false
osaddon/cdmi
test/functional/cdmi/test_utils.py
1
3630
# Copyright (c) 2010-2011 IBM. # # 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
5,300,052,521,575,340,000
33.571429
79
0.585675
false
4.148571
true
false
false
amyxchen/openhtf
openhtf/util/functions.py
1
1523
# Copyright 2016 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 agre...
apache-2.0
8,318,662,720,419,666,000
32.844444
79
0.732108
false
4.029101
false
false
false
penguinscontrol/Spinal-Cord-Modeling
Python/morphology_parser.py
1
7351
# -*- coding: utf-8 -*- """ Created on Thu Feb 25 19:14:49 2016 @author: Radu """ from pyparsing import Word, nums, OneOrMore, Keyword, Literal, ZeroOrMore, Optional, Group from string import lowercase def print_for_loop(target_file): def for_parseaction(origString, loc, tokens): put_string = 'for ' + t...
gpl-2.0
7,230,308,802,427,356,000
36.697436
161
0.629846
false
3.425443
false
false
false
XandyWang/PythonDemo
baseTest/GuiDemo.py
1
2027
#!/usr/bin/python # -*- coding: utf-8 -*- from Tkinter import * import tkMessageBox import tkFileDialog import xlrd import os class MainPanel(Frame): def __init__(self,master=None): Frame.__init__(self,master) self.pack(expand = 1, fill='both',padx = 5, pady = 5) self.createWidgets() ...
mit
-5,904,888,387,031,046,000
32.830508
94
0.592982
false
3.156646
false
false
false
tktrungna/leetcode
Python/verify-preorder-serialization-binary-tree.py
1
2175
""" QUESTION: One way to serialize a binary tree is to use pre-oder traversal. When we encounter a non-null node, we record the node's value. If it is a null node, we record using a sentinel value such as #. _9_ / \ 3 2 / \ / \ 4 1 # 6 / \ / \ / \ # # # # # # For example, the above binar...
mit
3,118,352,650,100,566,000
28.405405
119
0.569655
false
3.530844
false
false
false
AechPro/Machine-Learning
Partners Healthcare/2016 Breast Cancer/dev/ReconNet/util/Intensity_Converter.py
1
3553
import numpy as np from openpyxl import load_workbook from scipy.optimize import fsolve workingDirectory = "C:/Users/Matt/Desktop/abs to conc/1. Abs to Conc (for Matt)" def padConcatenate(matrices,shapes): largestAxis = np.max(shapes) for matrix in matrices: if len(matrix) != largestAxis: ...
apache-2.0
6,532,349,445,452,838,000
35.03125
120
0.532789
false
2.50741
false
false
false
JamesLinEngineer/RKMC
addons/plugin.audio.jambmc/addon.py
1
44439
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2013 Tristan Fischer (sphere@dersphere.de) # # 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 ...
gpl-2.0
24,996,541,849,658,104
30.764832
79
0.560769
false
3.543497
false
false
false
jbalogh/airflow
airflow/models.py
1
73231
import copy from datetime import datetime, timedelta import getpass import imp import jinja2 import json import logging import os import dill import re import signal import socket import sys from sqlalchemy import ( Column, Integer, String, DateTime, Text, Boolean, ForeignKey, PickleType, Index,) from sqlalche...
apache-2.0
-7,476,350,181,389,807,000
34.757324
86
0.572422
false
4.168669
false
false
false
simone/django-gb
django/utils/deprecation.py
1
2585
import inspect import warnings class RemovedInDjango20Warning(DeprecationWarning): pass class RemovedInDjango19Warning(PendingDeprecationWarning): pass RemovedInNextVersionWarning = RemovedInDjango19Warning class warn_about_renamed_method(object): def __init__(self, class_name, old_method_name, new_...
bsd-3-clause
-6,056,115,480,740,207,000
34.410959
90
0.592263
false
4.279801
false
false
false
lixun910/pysal
pysal/explore/giddy/mobility.py
1
4182
""" Income mobility measures. """ __author__ = "Wei Kang <weikang9009@gmail.com>, Sergio J. Rey <sjsrey@gmail.com>" __all__ = ["markov_mobility"] import numpy as np import numpy.linalg as la def markov_mobility(p, measure="P",ini=None): """ Markov-based mobility index. Parameters ---------- p ...
bsd-3-clause
3,632,192,855,585,092,600
31.169231
81
0.504304
false
2.920391
false
false
false
evilkost/cdic
src/cdic_project/cdic/logic/copr_logic.py
1
1290
# coding: utf-8 from flask import abort from sqlalchemy.orm.exc import NoResultFound from sqlalchemy.orm.query import Query from .. import db from ..logic.event_logic import create_project_event from ..logic.project_logic import ProjectLogic from ..models import Project, User, LinkedCopr def check_link_exists(proj...
gpl-3.0
4,390,492,934,067,052,000
25.326531
79
0.66124
false
3.333333
false
false
false
MilchReis/PicSort
src/gui/components.py
1
4356
# -*- coding: utf-8 -*- ''' @author: nick ''' import pygame def isIn(objPos, objBounds, point): if (point[0] > objPos[0] and point[0] < objPos[0] + objBounds[0]) and (point[1] > objPos[1] and point[1] < objPos[1] + objBounds[1]): return True else: return False class Component(): ...
gpl-2.0
8,014,038,098,838,877,000
28.632653
137
0.541093
false
3.67285
false
false
false
csangani/ReproducingSprout
create_trace.py
1
1774
## Create a network trace using specified distribution for packet intervals import numpy import os import random import sys UPLINK_TRACE_SIZE = 30000 DOWNLINK_TRACE_SIZE = 350000 TRACES_PATH = 'cleaned_traces' def create_trace(d_name, d_function, mode): intervals = [int(round(abs(d_function()))) for _ in range(...
mit
-5,686,957,577,726,436,000
30.678571
126
0.603157
false
3.353497
false
false
false
fle-internal/content-pack-maker
minimize-content-pack.py
1
1088
""" minimize-content-pack Remove assessment items, subtitles and po files from a content pack. Usage: minimize-content-pack.py <old-content-pack-path> <out-path> """ import zipfile from pathlib import Path from docopt import docopt ITEMS_TO_TRANSFER = [ "metadata.json", "content.db", "backend.mo", ...
bsd-2-clause
1,715,905,646,846,452,200
22.652174
68
0.620404
false
3.443038
false
false
false
mouton5000/DiscreteEventApplicationEditor
test/testsArithmeticExpressions/MathFunctions/testAbs.py
1
2775
__author__ = 'mouton' from triggerExpressions import Evaluation from unittest import TestCase from math import pi, sqrt from arithmeticExpressions import ALitteral, Func, UndefinedLitteral, SelfLitteral from database import Variable class TestAbs(TestCase): @classmethod def setUpClass(cls): import g...
mit
7,408,478,610,740,688,000
30.908046
82
0.625586
false
3.234266
true
false
false
emptyewer/DEEPN
functions/stat_graph.py
1
3795
import math import re import matplotlib as mpl from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas import matplotlib.colors as colors import matplotlib.cm as cm import numpy as np from matplotlib.figure import Figure from PyQt4 import QtGui class GraphFrame(QtGui.QFrame): def __init__(...
mit
-6,688,862,044,473,764,000
37.72449
103
0.594466
false
3.42509
false
false
false
rookies/dmx2serial
DMX.py
1
4980
#!/usr/bin/python3 from enum import IntEnum import struct class Flag(IntEnum): Payload = 0b10000000 Success = 0b01000000 Resend = 0b00100000 Configurate = 0b00000100 Hello = 0b00000010 Parity = 0b00000001 class FlagSet(object): def __init__(self, flags=0x00): flags = int(flags) if ...
mit
-8,310,246,874,338,883,000
25.349206
197
0.675301
false
3
false
false
false
philipn/i-am-cc
cc/cc/settings.py
1
5647
# Django settings for cc project. import os DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@example.com'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': '', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. 'NAME': '', # O...
mit
999,494,496,442,481,700
31.085227
100
0.680538
false
3.695681
false
false
false
equella/Equella
Source/Tools/ImportLibraries/Python/odbclient.py
1
1697
# Copyright Dytech Solutions, 2005. # This module is provided 'commercial-in-confidence' and may not be reproduced nor redistributed without # express written permission from the copyright holder. # Author: Adam Eijdenberg, Dytech Solutions <adam.eijdenberg@dytech.com.au> # Note: This is a very basic ODBC database a...
apache-2.0
-7,283,380,422,882,922,000
29.854545
149
0.582793
false
3.057658
false
false
false
erigones/esdc-ce
bin/eslib/filelock.py
1
2314
import os import time from functools import wraps class FileLockTimeout(Exception): pass class FileLockError(Exception): pass class FileLock(object): """ Simple file lock. """ def __init__(self, lockfile): self._lockfile = lockfile self._lockfile_fd = None def __repr__...
apache-2.0
-2,884,021,981,432,574,500
25.295455
109
0.537165
false
4.26151
false
false
false
Berserker66/FactorioManager
tests.py
1
2223
__author__ = 'Fabian' import unittest broken_mods = {"5dim mod", "Air Filtering", "canInsert"} class TestRemoteAPI(unittest.TestCase): indextestfields = ["title", "contact", "name", "homepage", "author"] def test_index(self): from FactorioManager import remoteapi index = remoteapi.ModIndex ...
mit
-479,495,605,471,145,800
42.588235
105
0.547458
false
4.490909
true
false
false
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/stages.py
1
3495
# Copyright 2016 PerfKitBenchmarker Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
apache-2.0
4,238,887,930,728,280,600
32.932039
80
0.660658
false
3.803047
false
false
false
googledatalab/pydatalab
solutionbox/ml_workbench/tensorflow/transform.py
1
18304
# Copyright 2017 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 ...
apache-2.0
2,258,065,721,742,861,000
32.340619
127
0.661385
false
3.88455
false
false
false
weblyzard/inscriptis
tests/test_block.py
1
1720
""" Test cases for the Block class. """ from inscriptis.model.canvas.block import Block from inscriptis.model.canvas.prefix import Prefix def test_merge_normal_text_collapsable_whitespaces(): """ test cases where the block has collapsable whitespaces """ b = Block(0, Prefix()) b.merge_normal_text(...
gpl-2.0
-7,282,760,581,919,414,000
25.461538
58
0.64593
false
3.392505
false
false
false
maschwanden/boxsimu
boxsimu/solver.py
1
31181
# -*- coding: utf-8 -*- """ Created on Thu Jun 23 2016 at 10:37UTC @author: Mathias Aschwanden (mathias.aschwanden@gmail.com) """ import os import pdb import copy import time as time_module import datetime import numpy as np import dill as pickle import matplotlib.pyplot as plt from attrdict import AttrDict import m...
mit
-289,562,725,548,882,940
37.305897
98
0.57612
false
3.693994
false
false
false
Delosari/dazer
bin/lib/Math_Libraries/linfit_script.py
1
13123
from numpy import asarray, array, sqrt from uncertainties import unumpy, ufloat def linfit(x_true, y, sigmay=None, relsigma=True, cov=False, chisq=False, residuals=False): """ Least squares linear fit. Fit a straight line `f(x_true) = a + bx` to points `(x_true, y)`. Returns coefficients `a` an...
mit
-1,549,250,426,603,208,400
42.456954
119
0.590338
false
3.492946
false
false
false
hirunatan/estelcon_web
activities/services.py
1
11340
from django.core.mail import send_mail, mail_managers from django.conf import settings from django.contrib.auth import authenticate from django.contrib.auth.models import User from django.db.models import Count from datetime import datetime, timedelta from collections import namedtuple import locale import math from ...
agpl-3.0
-6,948,931,239,060,189,000
29.928767
113
0.647002
false
3.371864
false
false
false
ruohoruotsi/Wavelet-Tree-Synth
nnet/VAE-RyotaKatoh-chainer/VAE_YZ_X.py
1
5152
import os import time import numpy as np from chainer import cuda, Variable, function, FunctionSet, optimizers from chainer import functions as F class VAE_YZ_X(FunctionSet): def __init__(self, **layers): super(VAE_YZ_X, self).__init__(**layers) def softplus(self, x): return F.log(F.exp(x) ...
gpl-2.0
-8,410,004,486,679,140,000
36.064748
195
0.572011
false
2.927273
false
false
false
wangshunzi/Python_code
02-Python面向对象代码/面向对象-三大特性/封装.py
1
1583
# _*_ encoding:utf-8 _*_ # import win32com.client # # class Caculator(object): def __check_num_zsq(func): def inner(self, n): if not isinstance(n, int): raise TypeError("当前这个数据的类型有问题, 应该是一个整型数据") return func(self, n) return inner def __say(self, word): ...
mit
-5,992,346,275,371,996,000
22.459016
58
0.512229
false
2.773256
false
false
false
flegoff/hcrendu
settings.py
1
5119
# Django settings for hcrendu project. DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@example.com'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. '...
mit
7,010,484,665,604,025,000
32.457516
122
0.683727
false
3.643416
false
false
false
maxive/erp
addons/point_of_sale/tests/test_frontend.py
1
12623
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo.api import Environment from odoo.tools import DEFAULT_SERVER_DATE_FORMAT from datetime import date, timedelta import odoo.tests class TestUi(odoo.tests.HttpCase): def test_01_pos_basic_order(self): ...
agpl-3.0
-4,505,519,686,318,333,000
41.076667
154
0.465816
false
4.025191
true
false
false
wwgong/CVoltDB
tools/vis.py
1
6217
#!/usr/bin/env python # This is a visualizer which pulls TPC-C benchmark results from the MySQL # databases and visualizes them. Four graphs will be generated, latency graph on # sinigle node and multiple nodes, and throughput graph on single node and # multiple nodes. # # Run it without any arguments to see what argu...
gpl-3.0
-5,714,690,900,903,100,000
29.326829
80
0.5493
false
3.358725
false
false
false
g0v/sunshine.cy
website/cy/api/views.py
1
4839
#from django.contrib.auth.models import User, Group from rest_framework import viewsets from .serializers import * from journals.models import Journals from reports.models import Reports from property.models import Stock, Land, Building, Car, Cash, Deposit, Aircraft, Boat, Bonds, Fund, OtherBonds, Antique, Insurance, ...
cc0-1.0
-828,647,415,842,423,900
48.377551
267
0.713784
false
3.547654
false
false
false