repo_name
stringlengths
6
90
path
stringlengths
4
230
copies
stringlengths
1
4
size
stringlengths
4
7
content
stringlengths
734
985k
license
stringclasses
15 values
hash
int64
-9,223,303,126,770,100,000
9,223,233,360B
line_mean
float64
3.79
99.6
line_max
int64
19
999
alpha_frac
float64
0.25
0.96
autogenerated
bool
1 class
ratio
float64
1.5
8.06
config_test
bool
2 classes
has_no_keywords
bool
2 classes
few_assignments
bool
1 class
cloudbase/neutron
neutron/worker.py
1
4115
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # d...
apache-2.0
8,622,565,312,202,018,000
31.92
79
0.648846
false
4.546961
false
false
false
abantos/bolt
test/test_btconfig.py
1
1539
import unittest import bolt._btconfig as config class TestConfigurationManager(unittest.TestCase): def setUp(self): self.configuration = { 'task': { 'option': 1, 'overridable': 'initial', 'child': { 'overridable': 'inchild',...
mit
3,300,309,358,068,737,500
24.229508
80
0.581546
false
4.028796
true
false
false
labordoc/labordoc-next
modules/webjournal/lib/webjournal_washer.py
35
4809
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2007, 2008, 2009, 2010, 2011 CERN. ## ## Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## Licens...
gpl-2.0
-5,421,269,967,822,107,000
34.622222
81
0.634643
false
4.138554
false
false
false
chromium/chromium
tools/perf/page_sets/rendering/tough_filters_cases.py
10
2247
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from telemetry.page import shared_page_state from page_sets.rendering import rendering_story from page_sets.rendering import story_tags class ToughFiltersC...
bsd-3-clause
-2,418,649,279,470,470,700
34.666667
77
0.692924
false
3.521944
false
false
false
devilry/devilry-django
devilry/devilry_superadmin/management/commands/devilry_periodsetrelatedstudents.py
1
3454
from django.contrib.contenttypes.models import ContentType from django.db import transaction from django.utils import timezone from devilry.apps.core.models import Assignment from devilry.devilry_compressionutil.models import CompressedArchiveMeta from devilry.devilry_group.models import FeedbackSet from devilry.devil...
bsd-3-clause
-7,170,047,507,918,122,000
45.053333
133
0.662131
false
4.339196
false
false
false
arcyfelix/Machine-Learning-For-Trading
39_fit_polynomial.py
2
2029
import matplotlib.pyplot as plt import numpy as np import scipy.optimize as spo def error_poly(C,data): ''' Compute error between given polynomial and observd data. Parameters ---------- C: numpy.poly1d object or equivalent array of polynomial coefficients data: 2D array as (x,y) ...
apache-2.0
-7,462,274,108,503,265,000
30.71875
88
0.580582
false
3.331691
false
false
false
bigzz/autotest
client/setup.py
4
2529
# pylint: disable=E0611 from distutils.core import setup import os try: import autotest.common as common except ImportError: import common from autotest.client.shared import version # Mostly needed when called one level up if os.path.isdir('client'): client_dir = 'client' else: client_dir = '.' auto...
gpl-2.0
1,325,349,126,028,541,700
27.1
83
0.61289
false
3.546985
true
false
false
twitter/pants
src/python/pants/util/eval.py
2
2923
# coding=utf-8 # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import absolute_import, division, print_function, unicode_literals from builtins import range, str from textwrap import dedent from future.utils import str...
apache-2.0
8,935,440,141,416,554,000
37.460526
98
0.639412
false
4.105337
false
false
false
open2c/cooltools
cooltools/cli/util.py
1
2285
import os.path as op import csv import io import click class TabularFilePath(click.Path): def __init__( self, default_column_index, exists=False, resolve_path=False, allow_dash=False ): """ Parameters ---------- default_column : str or int Name of desired co...
mit
2,344,887,592,803,087,000
26.53012
88
0.564114
false
3.926117
false
false
false
tkoziara/parmec
python/keyfileparse.py
1
19272
""" Parser for LS-DYNA GCORE keyfiles. NB: This only supports fixed-format keyfiles. Free- or long-format keyfiles cannot be read. To use from the command line run: python keyfileparse.py [-p] path_to_keyfile where: - if the optional "-p" switch is present then timing ...
mit
-3,207,781,611,496,945,700
41.210762
152
0.49808
false
4.247741
false
false
false
DaemonDevelopers/CBSE-Toolchain
CBSE.py
1
23220
#!/usr/bin/python # Daemon CBSE Source Code # Copyright (c) 2014-2015, Daemon Developers # 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...
bsd-3-clause
-6,408,541,875,985,511,000
35.915739
147
0.61727
false
4.367946
false
false
false
afonari/q-e_schrodinger
bin/qexsd/qespresso/xsdtypes/exceptions.py
1
1753
# -*- coding: utf-8 -*- # # Copyright (c), 2015-2016, Quantum Espresso Foundation and SISSA (Scuola # Internazionale Superiore di Studi Avanzati). All rights reserved. # This file is distributed under the terms of the MIT License. See the # file 'LICENSE' in the root directory of the present distribution, or # http://o...
gpl-2.0
4,204,162,988,114,377,000
30.303571
91
0.668568
false
3.9217
false
false
false
dlakata/habits
app/emailer.py
1
1200
from app import User, app import requests import jwt from flask import render_template def send_email(from_email, user, habit, action, start, end, token): email = jwt.decode(token, 'dankmemes', algorithms=['HS256'])['email'] u = User.query.filter_by(email=email, id=user.id).first() if u == user: ...
gpl-3.0
-876,628,581,727,911,400
40.413793
103
0.513333
false
3.658537
false
false
false
zhenzhai/edx-platform
common/lib/sandbox-packages/hint/hint_class/Week5/Prob7_Part1.py
1
1395
from hint_class_helpers.find_matches import find_matches class Prob7_Part1: """ Author: Jigar Patel Date: 10/24/2016 """ def check_attempt(self, params): #unpack params self.attempt = params['attempt'] #student's attempt self.answer = params['answer'] #solution self.att_tree = params['att_tree'...
agpl-3.0
-7,578,393,658,636,235,000
30.704545
179
0.589247
false
3.461538
false
false
false
peterkmurphy/isityaml
setup.py
1
1363
#!/usr/bin/env python from setuptools import setup setup(name='isityaml', version='0.7', description='A Django app for checking the correctness of YAML', author='Peter Murphy', author_email='peterkmurphy@gmail.com', url='http://pypi.python.org/pypi/isityaml/', packages=['isityaml'], packag...
bsd-3-clause
8,430,596,024,089,816,000
33.075
68
0.586941
false
4.259375
false
false
false
spacy-io/spaCy
spacy/tokens/_dict_proxies.py
1
1989
from typing import Iterable, Tuple, Union, TYPE_CHECKING import weakref from collections import UserDict import srsly from .span_group import SpanGroup if TYPE_CHECKING: # This lets us add type hints for mypy etc. without causing circular imports from .doc import Doc # noqa: F401 from .span import Span ...
mit
2,554,618,661,561,387,000
37.25
94
0.652589
false
3.622951
false
false
false
DOAJ/doaj
portality/scripts/anon_import.py
1
3837
""" Clear out the index and retrieve new anonymised data, according to a configuration file Configure the target index in your *.cfg override file For now, this import script requires the same index pattern (prefix, 'types', index-per-type setting) as the exporter. """ import esprit, json, gzip, shutil from portality...
apache-2.0
3,937,069,494,999,615,000
36.990099
128
0.611676
false
3.833167
true
false
false
SafirSDK/safir-sdk-core
src/lluf/lluf_utils.ss/tests/DynamicLibraryLoader_test/run_test.py
1
1958
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### # # Copyright Saab AB, 2011-2013 (http://safirsdkcore.com) # # Created by: Lars Hagstrom (lars@foldspace.nu) # ############################################################################### # #...
gpl-3.0
-7,268,855,526,295,845,000
29.123077
79
0.625638
false
3.71537
true
false
false
Event38/MissionPlanner
Lib/site-packages/numpy/doc/broadcasting.py
95
5511
""" ======================== Broadcasting over arrays ======================== The term broadcasting describes how numpy treats arrays with different shapes during arithmetic operations. Subject to certain constraints, the smaller array is "broadcast" across the larger array so that they have compatible shapes. Broadc...
gpl-3.0
-4,201,041,957,692,141,000
30.135593
94
0.641263
false
3.422981
false
false
false
letuananh/yawlib
yawlib/glosswordnet/gwnmodels.py
1
13574
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Gloss WordNet Data Transfer Object """ # This code is a part of yawlib library: https://github.com/letuananh/yawlib # :copyright: (c) 2014 Le Tuan Anh <tuananh.ke@gmail.com> # :license: MIT, see LICENSE for more details. import logging import re from collections imp...
mit
-3,062,335,322,400,625,000
33.277778
132
0.518933
false
3.570226
false
false
false
Abdoctor/behave
tests/issues/test_issue0336.py
1
2612
# -*- coding: UTF-8 """ Test issue #336: Unicode problem w/ exception traceback on Windows (python2.7) Default encoding (unicode-escape) of text() causes problems w/ exception tracebacks. STATUS: BASICS SOLVED (default encoding changed) ALTERNATIVE SOLUTIONS: * Use traceback2: Returns unicode-string when calling trac...
bsd-2-clause
7,535,412,090,488,110,000
38.575758
85
0.687213
false
3.597796
true
false
false
ccxt/ccxt
examples/py/bypass-cloudflare-with-cookies.py
1
1676
# -*- coding: utf-8 -*- import cfscrape import os import sys from pprint import pprint root = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) sys.path.append(root + '/python') import ccxt # noqa: E402 def print_supported_exchanges(): print('Supported exchanges:') print(', '.jo...
mit
-7,602,595,116,496,153,000
23.647059
105
0.569212
false
3.724444
false
false
false
odoousers2014/odoo-development
tools/python/OCA_Downloader.py
2
6431
from pygit2 import clone_repository from urllib2 import urlopen, Request import json from sys import argv, maxint from os import path from getopt import getopt, GetoptError class EventHook(object): # http://www.voidspace.org.uk/python/weblog/arch_d7_2007_02_03.shtml#e616 def __init__(self): self.__h...
agpl-3.0
959,230,622,267,139,600
26.365957
77
0.562432
false
3.945399
false
false
false
bicard/raspberrypi
quad-store-sensors/37in1/ds18b20-sensor-NOTWORKING.py
1
1205
import os import time #---------------------------------------------------------------- # Note: # ds18b20's data pin must be connected to pin7. #---------------------------------------------------------------- # Reads temperature from sensor and prints to stdout # id is the id of the sensor def readSensor(id): tfil...
gpl-3.0
-299,600,591,051,923,600
22.627451
74
0.604149
false
3.403955
false
false
false
google/deluca
deluca/utils/experiment.py
1
6636
# Copyright 2021 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/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
apache-2.0
-6,756,392,191,647,047,000
35.662983
94
0.621157
false
4.397614
false
false
false
TiddlySpace/tiddlyspace
tiddlywebplugins/tiddlyspace/controlview.py
1
11112
""" ControlView is for protecting the pope (PTP). Jermoelen says: The PTP issue boiled down to a desire that it should not be possible to reach tiddler content via a space URI unless that content has been explicitly stored or included into the space. The goal was to avoid mischievous people being able to construct U...
bsd-3-clause
-9,135,363,344,837,645,000
35.916944
79
0.604932
false
4.130855
false
false
false
missionpinball/mpf
mpf/tests/test_Snux.py
1
4755
"""Test snux platform.""" from mpf.tests.MpfFakeGameTestCase import MpfFakeGameTestCase, MagicMock from mpf.platforms.interfaces.driver_platform_interface import PulseSettings, HoldSettings class TestSnux(MpfFakeGameTestCase): def get_config_file(self): return 'config.yaml' def get_machine_path(self)...
mit
-7,255,871,927,699,974,000
37.04
108
0.64143
false
3.488628
true
false
false
jgao54/airflow
tests/operators/test_bash_operator.py
1
3560
# -*- coding: utf-8 -*- # # 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
-6,838,112,184,806,307,000
36.083333
88
0.58736
false
3.995511
true
false
false
easyw/kicad-3d-models-in-freecad
cadquery/FCAD_script_generator/Connector_Wago_734/cq_connect_wago_734.py
1
19515
#!/usr/bin/python # -*- coding: utf8 -*- # ## Dimensions are from data sheets given in the settings of the corresponding KiCad footprint: ## http://www.farnell.com/datasheets/2157639.pdf ## Dimensions not given in the data sheet were estimeted from the drawings. # # ## requirements ## cadquery FreeCAD plugin ## htt...
gpl-2.0
-7,257,211,072,133,612,000
40.967742
196
0.583807
false
3.589956
false
false
false
Hearen/OnceServer
pool_management/bn-xend-core/xend/DelPerformanceFile.py
1
1804
''' Created on 2013-10-17 @author: root ''' import xml.dom.minidom as Dom import time import os import signal import os.path from xen.xend import XendDomain, XendNode, XendAPIStore, XendPIFMetrics import logging log = logging.getLogger("performancedel") log.setLevel(logging.DEBUG) file_handle = l...
mit
-2,811,478,027,107,792,000
23.8
71
0.538803
false
3.938865
false
false
false
mvendra/mvtools
fsquery_adv_filter.py
1
5221
#!/usr/bin/env python3 import sys import os import path_utils import detect_repo_type def filter_extension_is(path, params): filename_ext = path_utils.getextension(path) return filename_ext in params def filter_extension_is_not(path, params): return not filter_extension_is(path, params) def filter_has_...
mit
6,315,224,946,368,423,000
26.919786
160
0.582647
false
3.810949
false
false
false
saraivaufc/jornalEletronico
newspaper/models/classifield.py
1
1128
from django.db import models from django.utils.translation import ugettext as _ from datetime import datetime from .offer import Offer class Classifield(models.Model): title = models.CharField(max_length=100, verbose_name=_("Title"), ) description = models.TextField(verbose_name=_("Description"), ) price = models.F...
mit
-6,090,304,118,076,404,000
40.777778
149
0.723404
false
3.377246
false
false
false
valeth/apex-sigma
sigma/plugins/utility/other/poll.py
3
1736
import discord import random async def poll(cmd, message, args): if not args: out_content = discord.Embed(type='rich', color=0xDB0000, title='❗ Missing Arguments.') await message.channel.send(None, embed=out_content) return all_qry = ' '.join(args) ...
gpl-3.0
7,885,312,924,697,585,000
38.488372
78
0.555948
false
3.087273
false
false
false
d1hotpep/openai_gym
gym/envs/doom/doom_basic.py
2
1718
import logging from gym.envs.doom import doom_env logger = logging.getLogger(__name__) class DoomBasicEnv(doom_env.DoomEnv): """ ------------ Training Mission 1 - Basic ------------ This map is rectangular with gray walls, ceiling and floor. You are spawned in the center of the longer wall, and a red...
mit
-6,087,351,235,600,706,000
34.791667
91
0.538999
false
3.775824
false
false
false
elkoutwest/Pound-Cake
blog/management/commands/blog_create_fixtures.py
1
1124
from copy import copy from django.contrib.auth import get_user_model from django.core.exceptions import ObjectDoesNotExist from django.core.management.base import BaseCommand from blog.models import Category, Post from blog.fixtures import CATEGORIES, POSTS class Command(BaseCommand): def handle(self, *args, **op...
mit
6,675,059,684,734,501,000
30.222222
53
0.564947
false
4.625514
false
false
false
thomaslaurenson/Vestigium
src/CellPathNormalizer.py
1
4941
# !/usr/bin/python """ Author: Thomas Laurenson Email: thomas@thomaslaurenson.com Website: thomaslaurenson.com Date: 2015/12/28 Description: CellPathNormalizer.py is a Vestigium module to normalize the full path of a Windows Registry artifact. Copyright (c) 2015, Thomas Laurenson ###############...
gpl-2.0
8,545,258,897,497,014,000
34.330882
87
0.573973
false
4.447345
false
false
false
viswimmer1/PythonGenerator
data/python_files/30159381/views.py
1
5075
import stripe from django.shortcuts import render_to_response from django.template import RequestContext from django.conf import settings from django.db.models import Q from django.contrib.contenttypes.models import ContentType from django.http import parse_cookie from account.views import lazy_create_user from accou...
gpl-2.0
-2,107,887,739,368,087,600
44.72973
285
0.654778
false
3.955573
false
false
false
embirico/basketball-object-tracker
src/image_object.py
1
5133
# Library imports import cv2 import numpy as np import pickle import itertools # Local imports import colors import top_line_detection as tld import hough from geometry import get_intersection class ImageObject(): # Variables verbose = False save_name = None # Images _bgr_img = None _gray_mask = None _dominant...
mit
4,104,857,198,918,027,000
30.490798
89
0.705435
false
2.765625
false
false
false
cpennington/edx-platform
common/djangoapps/edxmako/tests.py
1
8559
import unittest import ddt from django.conf import settings from django.http import HttpResponse from django.test import TestCase from django.test.client import RequestFactory from django.test.utils import override_settings from django.urls import reverse from edx_django_utils.cache import RequestCache from mock imp...
agpl-3.0
8,430,600,590,585,939,000
44.526596
120
0.644468
false
3.940608
true
false
false
Jumpscale/jumpscale6_core
lib/JumpScale/core/base/idgenerator/IDGenerator.py
1
1653
from JumpScale import j import random class IDGenerator: """ generic provider of id's lives at j.idgenerator """ def generateRandomInt(self,fromInt,toInt): """ how to use: j.base.idgenerator.generateRandomInt(0,10) """ return random.randint(fromInt,toInt) ...
bsd-2-clause
3,410,341,831,585,511,400
29.62963
80
0.581367
false
3.964029
false
false
false
602p/starfighter_revival
ai.py
1
2816
import pygame, math ais={} def register_ai(name): def _internal(cls): ais[name]=cls cls.name=name return cls return _internal @register_ai("empty") class AI(object): def update(self, dt): pass def get_angle(x1, x2, y1, y2): delta_angle=math.degrees(math.atan2(y2-y1, -(x2-x1)))+90 return delta_angle de...
mit
-4,185,463,535,847,463,000
30.651685
105
0.696733
false
2.6541
false
false
false
ztp-at/RKSV
receipt.py
1
2218
#!/usr/bin/env python2.7 ########################################################################### # Copyright 2017 ZT Prentner IT GmbH (www.ztp.at) # # This program 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 Softw...
agpl-3.0
-6,861,065,024,592,584,000
33.65625
76
0.601443
false
3.526232
false
false
false
ross128/stg
map/util.py
1
1756
from map.models import * from django.utils.datastructures import OrderedDict import hashlib import numpy as np def generate_map_slice(indices, map_seed=0, slice_size=10): """generates a map slice of given size randomly""" this_seed = int(hashlib.sha256(str(tuple([map_seed, indices])).encode('utf-8')).hexdigest(), ba...
gpl-3.0
-6,539,317,443,393,522,000
32.769231
120
0.686219
false
2.74375
false
false
false
pochoi/SHTOOLS
examples/python/TimingAccuracy/TimingAccuracyGLQC.py
2
2760
#!/usr/bin/env python """ This script is a python version of TimingAccuracyGLQC. We use numpy functions to simplify the creation of random coefficients. """ import os import sys import time import numpy as np sys.path.append(os.path.join(os.path.dirname(__file__), "../../..")) import pyshtools as shtools #==== MAIN ...
bsd-3-clause
3,199,417,494,652,420,600
30.724138
102
0.569565
false
3.016393
false
false
false
AlexWixom/CompSkillsF16
Materials/summarize_nonPandas_headers.py
2
2507
#!/usr/bin/env python # demonstration of data exploration code for Comp Bio course, Fall 2016 # James A. Foster # WARNING: not completely error checked ''' Usage: summarize_nonPandasHeaders.py inputFile where inputfile is a tab delimited summary of a Hiseq dataset, as in Homework 5 but WITH HEADERS **Main point**...
gpl-3.0
2,551,186,849,332,099,600
35.333333
106
0.659753
false
3.486787
false
false
false
BastiTee/lazyscan
scan_pages_and_create_pdf.py
1
6305
#!/usr/bin/env python3 """ Script to invoke scanning on a twain-compatible printer and to convert scanned pages to a PDF. Also includes a routine to easily scan multiple pages at once. """ def get_python_major_version(): """Returns the integer value of the major version of Python that runs this script.""" ...
gpl-3.0
-4,643,650,662,475,727,000
31.668394
79
0.617446
false
3.674242
false
false
false
xander-blr/kicker-scorer
app/service.py
2
2511
"""Set of services to do not trivial db operations.""" from app.models import Team, Player, Match from app import db from app.util import generate_team_name class TeamService(object): """docstring for TeamService.""" def find_or_create(community, teamJSON): """Find team using provided team json: by ...
mit
8,949,089,934,086,902,000
29.621951
103
0.628037
false
3.77027
false
false
false
ckuethe/gr-chancoding
python/qa_bsc.py
2
2853
#!/usr/bin/env python # # Copyright 2011 Communications Engineering Lab, KIT # # GNU Radio 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, or (at your option) # any later version. # # GNU R...
gpl-3.0
6,723,901,463,337,191,000
34.6625
119
0.638977
false
3.376331
true
false
false
hkhpub/show_and_tell_korean
webdemo/webdemo/im2txt_analyzer.py
1
1622
import requests import run_inference from googletrans import Translator translator = Translator() def analyze_image(filename): # change the locations if this program is running on the other computer or server. FLAGS = { "checkpoint_path": "/home/hkh/sources/im2txt/im2txt/model/train", "vocab_file": "/hdd/...
mit
8,811,587,460,141,908,000
27.473684
84
0.680641
false
3.290061
false
false
false
wavefront-mike/python-client
wavefront_client/models/dashboard_history.py
1
5607
# coding: utf-8 """ Copyright 2016 SmartBear Software 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 applica...
apache-2.0
-5,672,787,096,987,943,000
27.753846
83
0.569645
false
4.554833
false
false
false
aaivazis/nautilus
nautilus/services/apiGateway.py
2
16634
# external imports import aiohttp_cors from collections.abc import Callable from collections import defaultdict import json import functools # local imports from nautilus.auth.models import UserPassword import nautilus.database import nautilus.api.endpoints.requestHandlers.apiQuery as api_query import nautilus.network....
mit
-1,468,133,359,049,919,700
34.542735
104
0.592521
false
4.684314
false
false
false
ajjackson/mctools
mctools/ase_convert.py
1
1470
#! /usr/bin/env python from __future__ import absolute_import import argparse import ase.io def convert(input_filename, output_filename, from_format=None, to_format=None): """Wrap ASE functions to read structure from file and write new format""" try: structure = ase.io.read(input_filename, format=from...
gpl-3.0
5,845,848,145,353,227,000
37.684211
79
0.614966
false
4.152542
false
false
false
NickPresta/sentry
src/sentry/templatetags/sentry_helpers.py
1
12626
""" sentry.templatetags.sentry_helpers ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2013 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ # XXX: Import django-paging's template tags so we don't have to worry about # INSTALLED_APPS import datetime from...
bsd-3-clause
8,703,652,980,897,816,000
26.688596
99
0.624822
false
3.773461
false
false
false
uber/vertica-python
vertica_python/vertica/messages/backend_messages/load_balance_response.py
1
2410
# Copyright (c) 2018-2019 Micro Focus or one of its affiliates. # Copyright (c) 2018 Uber Technologies, 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/licen...
apache-2.0
-3,931,684,985,322,441,700
39.847458
83
0.739419
false
4.162349
false
false
false
rudkx/swift
utils/gyb_syntax_support/kinds.py
41
1152
""" All the known base syntax kinds. These will all be considered non-final classes and other types will be allowed to inherit from them. """ SYNTAX_BASE_KINDS = ['Decl', 'Expr', 'Pattern', 'Stmt', 'Syntax', 'SyntaxCollection', 'Type'] def kind_to_type(kind): """ Converts a SyntaxKind to ...
apache-2.0
-4,347,283,128,454,688,000
27.8
79
0.609375
false
4
false
false
false
hjbrock/AI-trials
cleaning-bot/simulator.py
1
4107
#!/usr/bin/python # # Author: Hannah Brock # Class: CS 5300, Fall 2014 # # For usage information, run: python simulator.py --help from cleaning_bot import * import argparse import numpy from scipy import stats def confidence_interval(array, confidence=0.95): double_array = numpy.array(array) * 1.0 mean = nump...
gpl-2.0
7,879,215,496,216,660,000
37.745283
115
0.638179
false
3.296148
false
false
false
geekwolf/fms
content/views.py
1
8289
#-*- coding: utf-8 -*- ''' Author: Geekwolf Blog: http://www.simlinux.com ''' from django.contrib.auth.decorators import login_required from content.models import Content, Type, User, Images, ZbxContent from django.core.urlresolvers import reverse from django.shortcuts import render_to_response, HttpResponseRed...
gpl-2.0
-8,984,259,166,506,728,000
30.01145
130
0.634585
false
3.442797
false
false
false
ouiliame/ps.py
xlwt/Row.py
30
11779
# -*- coding: windows-1252 -*- import BIFFRecords import Style from Cell import StrCell, BlankCell, NumberCell, FormulaCell, MulBlankCell, BooleanCell, ErrorCell, \ _get_cells_biff_data_mul import ExcelFormula import datetime as dt from Formatting import Font try: from decimal import Decimal except ImportErro...
mit
7,098,422,304,819,662,000
38.526846
110
0.564989
false
3.554315
false
false
false
HEGOArgentina/Linux-IPLE-3
usr/lib/ubiquity/ubiquity/misc.py
1
27099
# -*- coding: utf-8; Mode: Python; indent-tabs-mode: nil; tab-width: 4 -*- from collections import namedtuple import contextlib import grp import os import pwd import re import shutil import subprocess import syslog from ubiquity import osextras def utf8(s, errors="strict"): """Decode a string as UTF-8 if it is...
gpl-2.0
-1,626,807,909,430,020,600
30.364583
79
0.553821
false
3.86411
false
false
false
mrquim/repository.mrquim
repo/script.module.covenant/lib/resources/lib/sources/en/watchseries.py
7
5345
# -*- coding: utf-8 -*- ''' Covenant Add-on 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 prog...
gpl-2.0
-2,634,810,157,647,473,000
46.723214
190
0.53377
false
4.046177
false
false
false
rwesterlund/pysteam
pysteam/game.py
1
1546
#!/usr/bin/env python # encoding: utf-8 """ game.py Created by Scott on 2013-12-28. Copyright (c) 2013 Scott Rice. All rights reserved. """ import sys import os import shutil class Game(object): @staticmethod def valid_custom_image_extensions(): return ['.png', '.jpg', '.jpeg', '.tga'] def __in...
mit
8,583,306,663,270,633,000
27.109091
77
0.584735
false
3.672209
false
false
false
olegpshenichniy/truechat
server/api/registration/serializers.py
1
2392
import numpy from io import BytesIO from PIL import Image from rest_framework import serializers from django.core import exceptions from django.core.files.uploadedfile import InMemoryUploadedFile from django.contrib.auth import password_validation, get_user_model from user.models import Profile User = get_user_mode...
mit
-7,109,653,731,601,167,000
30.064935
103
0.624582
false
4.538899
false
false
false
goodwillcoding/RIDE
utest/controller/test_arguments.py
1
2375
import unittest from robotide.controller.arguments import parse_argument,\ parse_arguments_to_var_dict from robot.utils.asserts import assert_equals, assert_none class TestParseArguments(unittest.TestCase): def test_parse(self): args = ['${my arg}', '${default}=huhuu', '@{list}', 'invalid${}{}{{'] ...
apache-2.0
1,368,873,448,470,821,600
35
96
0.601263
false
3.427128
true
false
false
cdrttn/fragmon
gamequery/irc.py
1
5237
import fragmon.irc as fi import types import fnmatch #CTCP utils CTM = '\x01' def is_ctcp_req(text): """ is this a CTCP request? """ return text[0] == CTM and text[-1] == CTM def mk_ctcp_req(cmd, *args): """ same as above, but tuple args """ return mk_ctcp_req2(cmd, args) def mk_ctcp_req2(cmd, args)...
mit
477,245,054,040,884,700
24.546341
105
0.568264
false
3.376531
false
false
false
seme0021/python-zillow
setup.py
1
1536
""" The setup and build script for the python-zillow library. """ import os from setuptools import setup, find_packages def read(*paths): """Build a file path from *paths* and return the contents.""" with open(os.path.join(*paths), 'r') as f: return f.read() setup( name='python-zillow', ve...
apache-2.0
8,869,008,532,485,018,000
31.680851
76
0.616536
false
3.98961
false
false
false
fuomag9/ChaturbateBot
modules/Preferences.py
1
3357
import logging from modules import Utils from modules.alchemy import PreferenceUser def user_has_preferences(chatid: str) -> bool: """ Checks if user exists in the preferences table :param chatid: The chatid of the user who will be tested :return: True if it exists, False if it doesn't exist ...
gpl-3.0
-5,212,498,744,724,096,000
33.255102
122
0.711647
false
3.664847
true
false
false
davelab6/telaro
markov.py
1
5272
""" Telaro A test text generator for font development, using Markov chains. Copyright (C) 2010 Luke Kenneth Casson Leighton <luke.leighton@googlemail.com> 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 ...
gpl-3.0
-8,047,253,565,539,047,000
33.233766
125
0.580615
false
3.526421
false
false
false
PowerShellEmpire/Empire
lib/modules/powershell/collection/get_sql_query.py
10
3534
from lib.common import helpers class Module: def __init__(self, mainMenu, params=[]): self.info = { 'Name': 'Get-SQLQuery', 'Author': ['@_nullbind', '@0xbadjuju'], 'Description': ('Executes a query on target SQL servers.'), 'Background' : True, ...
bsd-3-clause
5,940,974,954,040,610,000
36.595745
127
0.494341
false
4.501911
false
false
false
laslabs/vertical-medical
sale_medical_prescription/wizards/medical_sale_wizard.py
1
7112
# -*- coding: utf-8 -*- # Copyright 2016 LasLabs Inc. # License GPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). from odoo import api, fields, models from collections import defaultdict import logging _logger = logging.getLogger(__name__) class MedicalSaleWizard(models.TransientModel): _name = 'medica...
agpl-3.0
-8,011,212,586,520,054,000
31.623853
74
0.531777
false
3.821601
false
false
false
ivh/VAMDC-VALD
nodes/jpl/node/queryfunc.py
3
37362
# -*- coding: utf-8 -*- from django.db.models import Q from django.db import connection from django.conf import settings import sys import datetime def LOG(s): if settings.DEBUG: print >> sys.stderr, s from dictionaries import * from itertools import chain from copy import deepcopy from models import * from vam...
gpl-3.0
-4,957,743,217,971,903,000
35.992079
162
0.5887
false
3.650059
false
false
false
Boquete/activity-scribble
miscwidgets.py
1
3365
# Originally part of Write Activity # Modified by Sayamindu Dasgupta <sayamindu@laptop.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 2 of the License, or # (at your option...
gpl-2.0
-3,186,178,088,414,170,600
34.797872
76
0.624368
false
4.005952
false
false
false
RedhawkSDR/throughput
streams/corba/__init__.py
1
2738
# # This file is protected by Copyright. Please refer to the COPYRIGHT file # distributed with this source distribution. # # This file is part of REDHAWK throughput. # # REDHAWK throughput is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published ...
lgpl-3.0
-3,613,529,215,171,284,500
31.987952
85
0.67458
false
3.62649
false
false
false
cfournie/segmentation.evaluation
segeval/util/__init__.py
2
3260
''' Utility functions and classes for the package. .. moduleauthor:: Chris Fournier <chris.m.fournier@gmail.com> ''' from __future__ import absolute_import from segeval.compute import compute_pairwise_values class SegmentationMetricError(Exception): ''' Indicates that a runtime check has failed, and the alg...
bsd-3-clause
-9,055,274,149,065,622,000
38.277108
145
0.652147
false
4.411367
false
false
false
Karpova-Lab/syringe-pump
doc_src/source/BOMs/tableGenerator.py
1
2123
import pandas as pd from sys import argv import pyperclip script,xlsFile = argv def getColWidths(table): colMax = [] for cols in table: lengths = [] for entry in table[cols]: lengths.append(len(entry)) colMax.append(max(lengths) if max(lengths)>len(cols) else len(cols) ) ...
mit
-756,138,708,435,380,200
29.768116
90
0.638719
false
3.635274
false
false
false
deepakrana47/DT-RAE
Global.py
1
1746
import pickle def init(): global rejected, accepted, wfname, v_size, fstopwds, fabbwds, r, c fstopwds = "./stopwords2.txt" fabbwds = "./abbrev1.txt" rejected = 0 accepted = 0 wfname = None import numpy as np def init_wv_self(stopword=None, vsize=200): global word_vec, word_vec2, word_vec1...
apache-2.0
-2,582,983,701,240,838,000
27.177419
117
0.584192
false
3.041812
false
false
false
dallascard/guac
core/lda/lda_postprocessing.py
1
2175
import os from optparse import OptionParser import pandas as pd from sklearn.preprocessing import normalize from ..util import file_handling as fh from ..util import dirs def main(): usage = "%prog project lda_output_dir" parser = OptionParser(usage=usage) #parser.add_option('--keyword', dest='key', de...
apache-2.0
-6,956,092,703,987,019,000
26.531646
87
0.64
false
3.246269
false
false
false
erh3cq/hyperspy
hyperspy/io_plugins/bruker.py
4
59035
# -*- coding: utf-8 -*- # # Copyright 2016 Petras Jokubauskas # Copyright 2016 The HyperSpy developers # # This library 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...
gpl-3.0
4,150,832,247,988,630,500
40.138676
105
0.548752
false
4.064583
false
false
false
WmHHooper/aima-python
submissions/Brock/mySearches.py
1
4204
import search from math import(cos, pi) # # A sample map problem # sumner_map = search.UndirectedGraph(dict( # Portland=dict(Mitchellville=7, Fairfield=17, Cottontown=18), # Cottontown=dict(Portland=18), # Fairfield=dict(Mitchellville=21, Portland=17), # Mitchellville=dict(Portland=7, Fairfield=21), # )) #...
mit
-1,938,797,795,464,989,200
26.657895
80
0.593958
false
2.691421
false
false
false
Slober3/PotHead
modules/PotHeadMain.py
1
5802
''' PotHead main module Contains the main modules ''' import os import socket import _thread import select import urllib.parse,urllib.request from datetime import datetime #Check if log directory exists def ChcklogDir(logDirName): if not os.path.isdir(logDirName): return 0 else: return 1 #Crea...
mit
-7,051,427,666,402,076,000
40.748201
157
0.520165
false
4.445977
false
false
false
shengqiu/renthop
processImage.py
1
2120
# -*- coding: UTF-8 -*- from PIL import Image from os import listdir, chdir from os.path import isdir, join, isfile, getsize from dbFunctions import insertOne def getNumberOfPics(postingId): fileList = [f for f in listdir(postingId) if isfile(join(postingId,f))] numOfPics = len(fileList) return numOfPics def ...
gpl-2.0
-6,074,039,028,583,994,000
28.859155
99
0.673585
false
3.322884
false
false
false
ITOO-UrFU/open-programs
open_programs/apps/api_v11/views.py
1
44019
from datetime import date import jwt from cms.api_views import * from competences.models import Competence from competences.serializers import CompetenceSerializer from courses.models import Course from courses.serializers import CourseSerializer from disciplines.models import Discipline, Semester, TrainingTerms, Diag...
unlicense
7,767,795,497,660,778,000
38.097583
120
0.607964
false
4.094506
false
false
false
SwimByteRun/IronScrape
IronScrape.py
1
9885
#! bin/python import csv, json, requests, sys, time from bs4 import BeautifulSoup filepath = "IRONMAN_Results" raceURLS = [("im_arizona_2014","http://www.ironman.com/triathlon/events/americas/ironman/arizona/results.aspx"), ("im_austrailia_2015","http://www.ironman.com/triathlon/events/asiapac/ironman/au...
mit
7,616,510,947,165,475,000
53.318681
132
0.651492
false
3.214634
false
false
false
dzil123/minesweeper
minesweeper.py
1
12140
#!/usr/bin/python3 import random import numpy as np from enum import Enum class Visibility(Enum): hidden = 0 flag = 1 visible = 2 open = visible flagged = flag unopened = hidden class Cell(object): MINE_STR = 'X' ZERO_STR = '_' def __init__(self, is_mine, neighbors=None, visible=None): self.is_mine ...
agpl-3.0
-4,216,966,254,846,519,000
22.164122
112
0.589883
false
2.705751
false
false
false
kevinschoonover/cs2001-cpl
homework/2017-fs-1b-hw03-ksyh3/main.py
1
3801
"""Unswaps minion name tags. This module can be used as a library or as a program. For program usage, please run the program as shown:: python3.5 main.py --help """ import argparse import copy from functools import reduce import json import sys from swapevent import to_swapevent def swap_nametags(acc, sw): ...
gpl-3.0
5,867,451,724,836,056,000
31.487179
79
0.669561
false
3.752221
false
false
false
bjodah/chempy
examples/bokeh_interactive_robertson.py
1
1366
""" Interactive kinetics app with sliders. Start by runing: $ bokeh serve interactive.py Add --show argument or navigate to: http://localhost:5006/interactive """ from collections import defaultdict import sys from chempy import Reaction, ReactionSystem from chempy.kinetics.rates import MassAction from chempy....
bsd-2-clause
7,371,462,007,067,813,000
25.784314
87
0.562225
false
3.184149
false
false
false
jyundt/oval
migrations/versions/c52b17f09a01_re_readding_the_delete_constraint_in_.py
1
1209
"""Re-readding the delete constraint in Admin Role. Revision ID: c52b17f09a01 Revises: f2fdab5c2ad0 Create Date: 2016-04-19 14:11:15.009793 """ # revision identifiers, used by Alembic. revision = 'c52b17f09a01' down_revision = 'f2fdab5c2ad0' from alembic import op import sqlalchemy as sa def upgrade(): ### co...
gpl-2.0
7,738,360,092,310,290,000
36.78125
99
0.671629
false
3.068528
false
false
false
GNOME/gnome-music
gnomemusic/windowplacement.py
1
3611
# Copyright 2018 The GNOME Music developers # # GNOME Music is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # GNOME Music is distribu...
gpl-2.0
3,039,140,619,863,189,500
38.681319
78
0.67239
false
4.003326
false
false
false
ECastleton/Popstop
popsicle/orders/migrations/0001_initial.py
1
1839
# -*- coding: utf-8 -*- # Generated by Django 1.10.6 on 2017-04-11 03:39 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...
gpl-3.0
-150,232,274,446,685,060
33.698113
114
0.549755
false
4.463592
false
false
false
inwotep/lava-android-test
lava_android_test/test_definitions/android-0xbenchmark/android_0xbenchmark_wait.py
2
1690
#!/usr/bin/python # Copyright (c) 2011 Linaro # Author: Linaro Validation Team <linaro-dev@lists.linaro.org> # # This file is part of LAVA Android Test. # # # 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...
gpl-3.0
6,199,444,763,677,148,000
30.296296
77
0.685799
false
3.427992
false
false
false
lbel/Maastricht-Masterclass-2015
scripts/Selection.py
1
4911
from array import array from sys import stdout def Selection(Bs_Mass = (5330,5400), Ds_Mass = (1955, 1985), Bs_Lifetime = (0, 0.01) ) : if raw_input("Execute selection? [y/N] ") not in ["y", "Y"]: return nbins = "200" wp = WorkspacePreparer(Bs_Mass, Ds_Mass, Bs_Lifetime) ...
mit
3,083,911,904,489,748,000
33.584507
123
0.596823
false
3.020295
false
false
false
hbhdytf/mac2
test/auto.py
1
1235
#!/usr/bin/env python # -*- coding:utf-8 -*- import os import time if raw_input("restart swift or not (y/n):")=='y': for k in os.popen('sudo python setup.py install').readlines(): pass for j in os.popen('sudo swift-init main restart').readlines(): pass # print j, # time.sleep(0.02) name ...
apache-2.0
-4,564,152,045,241,425,000
34.114286
149
0.611066
false
2.587368
false
false
false
rgayon/plaso
plaso/parsers/sqlite_plugins/firefox_downloads.py
1
4659
# -*- coding: utf-8 -*- """SQLite parser plugin for Mozilla Firefox downloads database files.""" from __future__ import unicode_literals from dfdatetime import posix_time as dfdatetime_posix_time from plaso.containers import events from plaso.containers import time_events from plaso.lib import definitions from plaso...
apache-2.0
-2,106,924,126,236,262,400
37.504132
79
0.696931
false
3.784728
false
false
false
gangadharkadam/office_frappe
frappe/utils/file_manager.py
1
7127
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe import os, base64, re import hashlib import mimetypes from frappe.utils import get_site_path, get_hook_method, get_files_path from frappe import _ from frappe imp...
mit
-6,969,453,172,069,038,000
29.852814
112
0.703101
false
2.924497
false
false
false
lsaffre/lino
lino/management/commands/resetsequences.py
1
1923
# -*- coding: UTF-8 -*- # Copyright 2017 by Rumma & Ko Ltd. # License: BSD, see LICENSE for more details. """.. management_command:: resetsequences Reset the database sequences for all plugins. This is required (and automatically called) on a postgres after restoring from a snapshot (:xfile:`restore.py`) because thi...
bsd-2-clause
4,394,245,622,574,943,000
35.283019
77
0.705668
false
4.108974
false
false
false
mescobal/geined
cli_ver.py
1
2350
#!/usr/bin/env python # -*- coding: utf-8 -*- import cgi import cgitb; cgitb.enable() import datos import htm import pagina def listado(frm): """Listado de detalles del cliente""" # Recuperar variables cliente_id = frm.getvalue("id") # Bases de datos clientes = datos.Tabla("clientes") cat_clien...
gpl-3.0
756,743,917,661,954,400
39.465517
98
0.608269
false
2.705882
false
false
false
tylert/yak-keyboards
mx_switch_mods.py
1
3102
#!/usr/bin/env python # This script tries to suggest a minimal number of modified switches that uses # mostly easy-to-get switches (Blue, Clear, Black, Grey linear) and offer some # options for making sure not to waste any of the switch parts. # This covers only the Cherry MX family of switches. import itertools sp...
gpl-3.0
-4,804,948,017,884,326,000
37.296296
78
0.64539
false
2.809783
false
false
false
ortoloco/jordbruksmark
jordbruksmark/views.py
1
3184
# -*- coding: utf-8 -*- from django.http import HttpResponse from django.shortcuts import render, redirect from django.contrib.auth.decorators import login_required, permission_required from jordbruksmark.models import * @permission_required('jordbruksmark.is_gardener') def week_plan_cultivation_list(request, week)...
gpl-3.0
4,980,082,037,618,233,000
30.215686
112
0.65201
false
3.190381
false
false
false
worldcompany/djangoembed
oembed/tests/tests/views.py
2
3164
from django.conf import settings from django.core.urlresolvers import reverse from django.utils import simplejson import oembed from oembed.models import StoredOEmbed, StoredProvider from oembed.tests.tests.base import BaseOEmbedTestCase class OEmbedViewTestCase(BaseOEmbedTestCase): def test_missing_endpoint(self...
mit
-7,478,395,662,736,213,000
37.585366
85
0.596397
false
4.125163
true
false
false
Tony-Wang/YaYaNLP
yaya/dictionary/chinese_traditional_dict.py
1
1854
from yaya.collection.dict import DoubleArrayTrie from yaya import config from yaya.utility.singleton import singleton __author__ = 'tony' class ChinseTraditionalBaseDict: def convert_key_to_value(self, text): search = self.trie.search(text) wordnet = [None] * search.array_length lennet = ...
apache-2.0
1,134,801,089,675,945,900
35.352941
82
0.553398
false
3.685885
false
false
false
CINPLA/expipe-dev
phy/phy/stats/clusters.py
2
2482
# -*- coding: utf-8 -*- """Cluster statistics.""" #------------------------------------------------------------------------------ # Imports #------------------------------------------------------------------------------ import numpy as np #---------------------------------------------------------------------------...
gpl-3.0
2,127,363,039,178,456,600
30.025
79
0.478243
false
4.136667
false
false
false