repo_name
stringlengths
5
92
path
stringlengths
4
232
copies
stringclasses
19 values
size
stringlengths
4
7
content
stringlengths
721
1.04M
license
stringclasses
15 values
hash
int64
-9,223,277,421,539,062,000
9,223,102,107B
line_mean
float64
6.51
99.9
line_max
int64
15
997
alpha_frac
float64
0.25
0.97
autogenerated
bool
1 class
Einsteinish/PyTune3
utils/bootstrap_story_hash.py
1
1046
import time import pymongo from django.conf import settings from apps.rss_feeds.models import MStory, Feed db = settings.MONGODB batch = 0 start = 0 for f in xrange(start, Feed.objects.latest('pk').pk): if f < batch*100000: continue start = time.time() try: cp1 = time.time() - start # if fe...
mit
-1,049,889,034,965,736,000
35.068966
100
0.547801
false
pvizeli/hassio
hassio/core.py
1
5205
"""Main file for HassIO.""" import asyncio import logging import aiohttp import docker from .addons import AddonManager from .api import RestAPI from .host_control import HostControl from .const import ( SOCKET_DOCKER, RUN_UPDATE_INFO_TASKS, RUN_RELOAD_ADDONS_TASKS, RUN_UPDATE_SUPERVISOR_TASKS, RUN_WATCHDOG_H...
bsd-3-clause
-6,239,368,141,571,753,000
32.152866
78
0.634006
false
xerxes2/gpodder
src/gpodder/sync.py
1
41915
# -*- coding: utf-8 -*- # # gPodder - A media aggregator and podcast client # Copyright (c) 2005-2011 Thomas Perl and the gPodder Team # # gPodder 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...
gpl-3.0
4,256,110,186,213,595,000
38.805318
197
0.578122
false
pusnik/pyexchange
pyexchange/connection.py
1
4274
""" (c) 2013 LinkedIn Corp. 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 agreed to in writing...
apache-2.0
4,606,826,240,127,029,000
32.390625
212
0.726954
false
jyundt/oval
app/main/views.py
1
16557
from collections import OrderedDict from itertools import groupby from operator import itemgetter, and_ import datetime from flask import render_template, redirect, request, url_for, current_app, flash from slackclient import SlackClient from sqlalchemy import extract, or_ from sqlalchemy import func from app import...
gpl-2.0
5,109,266,585,834,278,000
38.705036
115
0.59872
false
UTDS16/collab-texter
ctxt/client/resources_rc.py
1
19028
# -*- coding: utf-8 -*- # Resource object code # # Created by: The Resource Compiler for PyQt5 (Qt v5.7.0) # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore qt_resource_data = b"\ \x00\x00\x05\x88\ \x89\ \x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\ \x00\x00\x10\x0...
mit
-1,276,647,372,063,725,300
57.910217
96
0.725773
false
google/grr
grr/server/grr_response_server/bin/config_updater_util.py
1
44739
#!/usr/bin/env python """Utilities for modifying the GRR server configuration.""" import argparse import getpass import os import re import shutil import socket import subprocess import sys import time from typing import Optional, Text, Generator from urllib import parse as urlparse import MySQLdb from MySQLdb.consta...
apache-2.0
-8,097,962,447,948,236,000
38.803381
90
0.663359
false
CanalTP/navitia
source/jormungandr/tests/kirin_realtime_tests.py
1
155835
# Copyright (c) 2001-2015, Canal TP and/or its affiliates. All rights reserved. # # This file is part of Navitia, # the software to build cool stuff with public transport. # # Hope you'll enjoy and contribute to this project, # powered by Canal TP (www.canaltp.fr). # Help us simplify mobility and open public tr...
agpl-3.0
6,100,804,965,290,161,000
47.759387
127
0.599788
false
Shadow6363/Competitions
2015/Advent of Code/Day23.py
1
1537
# -*- coding: utf-8 -*- import sys class ChristmasComputer(object): def __init__(self, a=0, b=0): self.registers = { 'a': a, 'b': b, 'pc': 0 } def hlf(self, r): self.registers[r] /= 2 self.registers['pc'] += 1 def tpl(self, r): ...
unlicense
1,569,794,654,536,664,000
22.287879
83
0.510085
false
endlessm/chromium-browser
third_party/chromite/cli/cros/cros_deploy_unittest.py
1
3712
# -*- coding: utf-8 -*- # Copyright 2015 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. """This module tests the cros deploy command.""" from __future__ import print_function import sys from chromite.cli import comm...
bsd-3-clause
-1,279,988,953,280,330,200
32.142857
72
0.688039
false
msteinhoff/foption-bot
src/python/interaction/irc/commands.py
1
42748
# -*- coding: UTF-8 -*- """ $Id$ $URL$ Copyright (c) 2010 foption Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modif...
mit
-386,239,166,133,980,860
32.686367
112
0.544447
false
adsorensen/girder
girder/api/v1/resource.py
1
18333
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### # Copyright 2013 Kitware 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 cop...
apache-2.0
-4,673,234,978,141,301,000
46.618182
100
0.590193
false
johndamen/pyeasyplot
easyplot/gui/plotsettings.py
1
4044
from PyQt4 import QtGui, QtCore from .settings import PlotSettings from . import basewidgets as bw from .. import datasets def _marker_field(**kwargs): return bw.Dropdown( ['.', ',', 'o', '*', '+', 'x', 'd', 'D', 'v', '^', '<', '>', 's', 'p', '|', '_'], **kwargs) def _label_f...
gpl-3.0
-7,314,996,505,525,338,000
24.601266
57
0.599159
false
iut-ibk/P8-WSC-GUI
3dparty/Editra/src/extern/dexml/_util.py
1
4954
import copy class Error(Exception): """Base exception class for the dexml module.""" pass class ParseError(Error): """Exception raised when XML could not be parsed into objects.""" pass class RenderError(Error): """Exception raised when object could not be rendered into XML.""" pass class Xm...
gpl-2.0
4,871,161,818,355,427,000
36.530303
80
0.636455
false
jameslovejoy/apportionment
scripts/apportion.py
1
1096
import math class Apportion: populations = {} seats = {} def __init__(self): f = open('../data/2010.csv', 'r') for line in f: state, pop = [s.strip() for s in line.split(',')] self.seats[state] = 1 self.populations[state] = int(pop.strip()) @classmethod def find_highest_priority(cls): highest = ...
mit
-1,152,712,967,480,970,600
22.340426
74
0.64781
false
pasmod/simurg
simurg/scrapper/template.py
1
4965
from selector_finder import find_selector from dragnet import content_extractor from collections import OrderedDict from unidecode import unidecode from bs4 import BeautifulSoup from simurg.clients.fetcher import fetch from simurg.util import is_valid import logging import os.path import time import re def clean_soup...
mit
-8,685,732,525,461,948,000
30.424051
78
0.611682
false
misterdanb/midi.py
midi.py
1
21677
import sys import os import struct import array from enum import Enum def bytes_to_uint16(byte_list): return struct.unpack('>H', byte_list[:4])[0] def uint16_to_bytes(value): return struct.pack('>H', value) def bytes_to_uint24(byte_list): return struct.unpack('>I', b'\x00' + byte_list[:3])[0] def uint2...
gpl-3.0
-7,045,622,822,486,815,000
39.068392
95
0.565069
false
braams/shtoom
shtoom/ui/qtui/shtoommainwindow.py
1
7392
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'shtoommainwindow.ui' # # Created: Wed Jan 19 15:16:20 2005 # by: The PyQt User Interface Compiler (pyuic) 3.13 # # WARNING! All changes made in this file will be lost! from qt import * class ShtoomMainWindow(QMainWindow): def __i...
lgpl-2.1
666,659,779,956,600,600
43.263473
156
0.700352
false
grzes/djangae
djangae/fields/charfields.py
2
1862
from django.core.exceptions import ImproperlyConfigured from django.db import models from djangae.core import validators from google.appengine.api.datastore_types import _MAX_STRING_LENGTH class CharOrNoneField(models.CharField): """ A field that stores only non-empty strings or None (it won't store empty strin...
bsd-3-clause
-2,620,553,355,130,936,300
41.318182
110
0.670784
false
PfarrCh/openrsa
test/solovaystrassen_testcase.py
1
1957
# -*- coding: utf-8 -*- """ MIT License Copyright (c) 2017 Christian Pfarr Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, cop...
mit
-1,429,215,743,879,170,800
38.14
87
0.722024
false
azlanismail/prismgames
examples/games/car/networkx/algorithms/isomorphism/vf2userfunc.py
1
7715
""" Module to simplify the specification of user-defined equality functions for node and edge attributes during isomorphism checks. During the construction of an isomorphism, the algorithm considers two candidate nodes n1 in G1 and n2 in G2. The graphs G1 and G2 are then compared with respec...
gpl-2.0
4,223,319,619,097,362,400
36.964646
82
0.625275
false
Donnerbart/hazelcast-simulator
dist/src/main/dist/bin/benchmark-report.py
1
32024
#!/usr/bin/env python # -*- coding: utf-8 -*- # todo: # - writing html # - pruning of dstats to match running time # - when comparing benchmarks; use 1 color for all plots from 1 benchmark # - if no latency info is found; print warning # - when not a lot of data points, them time issues in gnuplot (use WORKER_PERFORMA...
apache-2.0
4,435,826,421,564,153,300
39.0125
131
0.531147
false
smsolivier/VEF
code/hlimit.py
1
2247
#!/usr/bin/env python3 import numpy as np import matplotlib.pyplot as plt import ld as LD import dd as DD from hidespines import * import sys ''' compares difference between Sn and moment equations as cell width --> 0 ''' if (len(sys.argv) > 1): outfile = sys.argv[1] else: outfile = None def getDiff(sol...
mit
-3,564,279,865,597,912,600
24.827586
85
0.653316
false
instana/python-sensor
instana/instrumentation/urllib3.py
1
3690
# (c) Copyright IBM Corp. 2021 # (c) Copyright Instana Inc. 2017 from __future__ import absolute_import import opentracing import opentracing.ext.tags as ext import wrapt from ..log import logger from ..singletons import agent from ..util.traceutils import get_active_tracer from ..util.secrets import strip_secrets_f...
mit
-8,290,494,705,377,039,000
37.041237
128
0.557995
false
pulsar-chem/Pulsar-Core
test/system/TestBasisSet.py
1
2740
import pulsar as psr def run_test(): tester = psr.PyTester("Testing the BasisSet and BasisSetShell") cGTO = psr.ShellType.CartesianGaussian sGTO = psr.ShellType.SphericalGaussian alpha=[3.42525091, 0.62391373, 0.16885540] c=[0.15432897, 0.53532814, 0.44463454] FakeD=psr.BasisShellInfo(cGTO,2,3...
bsd-3-clause
-7,388,309,216,171,697,000
43.193548
81
0.69854
false
thorwhalen/ut
pdict/special.py
1
5569
"""Special dicts""" __author__ = 'thor' from collections import defaultdict, UserDict from ut.pdict.get import set_value_in_nested_key_path val_unlikely_to_be_value_of_dict = (1987654321, 8239080923) class keydefaultdict(defaultdict): def __missing__(self, key): ret = self[key] = self.default_factory(ke...
mit
-1,439,519,557,595,874,300
34.929032
135
0.514455
false
Yelp/elastalert
tests/loaders_test.py
1
18593
# -*- coding: utf-8 -*- import copy import datetime import os import mock import pytest import elastalert.alerts import elastalert.ruletypes from elastalert.config import load_conf from elastalert.loaders import FileRulesLoader from elastalert.util import EAException test_config = {'rules_folder': 'test_folder', ...
apache-2.0
3,519,834,831,022,614,500
41.256818
133
0.60313
false
radicalbit/ambari
ambari-server/src/main/resources/common-services/STORM/1.0.1.3.0/package/scripts/nimbus.py
1
3638
#!/usr/bin/env python """ 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");...
apache-2.0
8,656,776,630,715,992,000
32.072727
106
0.765531
false
z-plot/z-plot
examples/basics-svg/verticalbars.py
1
2343
#! /usr/bin/env python from zplot import * # populate zplot table from data file t = table('verticalbars.data') # create the postscript file we'll use as our canvas canvas = svg('verticalbars.svg') # on the x-axis, we want categories, not numbers. Thus, we # determine the number of categories by checking the max #...
bsd-3-clause
2,614,298,282,952,092,700
35.046154
76
0.703799
false
cs-au-dk/Artemis
WebKit/Tools/Scripts/webkitpy/common/net/layouttestresults_unittest.py
1
7183
# Copyright (c) 2010, Google 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...
gpl-3.0
-7,733,571,483,401,349,000
48.19863
219
0.747459
false
Chitrank-Dixit/django-fcm
setup.py
1
1550
import os from setuptools import find_packages, setup with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme: README = readme.read() # allow setup.py to be run from any path os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) setup( name='django-fcm', versio...
mit
-703,198,790,023,050,000
34.227273
103
0.61871
false
BradAJ/zipflights
web_app/app/models.py
1
5577
from app import * def ita_search(faa_orig, faa_dest, start_date, end_date, duration = None, out_constraints = None, return_constraints = None, month_search = True): """ faa_orig, faa_dest: FAA airport code strs e.g. 'SFO' start_date, end_date: datetime objs e.g. datetime.date.today(), datetime.date(2015, 2...
mit
-2,482,724,947,257,887,000
43.261905
146
0.607674
false
Jailander/COSMOS
kriging_exploration/scripts/explorator.py
1
34183
#!/usr/bin/env python import cv2 import sys import yaml import signal import numpy as np #import utm import matplotlib as mpl import matplotlib.cm as cm import rospy import argparse import actionlib from cosmos_msgs.msg import KrigInfo from cosmos_msgs.srv import CompareModels import kriging_exploration.map_c...
mit
-8,971,978,584,816,281,000
39.694048
455
0.537519
false
jkonecny12/anaconda
pyanaconda/modules/network/nm_client.py
1
63957
# # utility functions using libnm # # Copyright (C) 2018 Red Hat, Inc. # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions of # the GNU General Public License v.2, or (at your option) any later version. # This program is distri...
gpl-2.0
5,622,254,389,794,948,000
37.551537
100
0.647388
false
williamFalcon/pytorch-lightning
tests/trainer/test_dataloaders.py
1
9641
import pytest import tests.models.utils as tutils from pytorch_lightning import Trainer from tests.models import ( TestModelBase, LightningTestModel, LightEmptyTestStep, LightValidationMultipleDataloadersMixin, LightTestMultipleDataloadersMixin, LightTestFitSingleTestDataloadersMixin, Light...
apache-2.0
6,846,499,677,689,317,000
28.756173
93
0.637382
false
rcatwood/Savu
savu/plugins/loaders/image_loader.py
1
3329
# Copyright 2014 Diamond Light Source Ltd. # # 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 t...
gpl-3.0
-5,461,242,725,985,273,000
33.319588
79
0.606789
false
suyashphadtare/test
erpnext/hr/doctype/appraisal/appraisal.py
1
2344
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe.utils import flt, getdate from frappe import _ from frappe.model.mapper import get_mapped_doc from frappe.model.document ...
agpl-3.0
-7,190,961,120,013,383,000
30.253333
122
0.697099
false
kryptxy/torrench
torrench/utilities/Config.py
1
4151
""" Config module.""" import logging import os from configparser import SafeConfigParser from torrench.utilities.Common import Common class Config(Common): r""" Config class. This class checks for config file's presence. Also, this class manages TPB/KAT proxies; That is, obtains TPB/KAT URL and ...
gpl-3.0
-2,175,531,742,058,077,200
38.160377
104
0.58781
false
Tehsmash/ironic
ironic/tests/test_images.py
1
20411
# Vim: tabstop=4 shiftwidth=4 softtabstop=4 # coding=utf-8 # Copyright 2013 Hewlett-Packard Development Company, L.P. # 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 Lic...
apache-2.0
1,871,641,000,553,366,800
42.335456
79
0.589535
false
mgpyh/django-fluent-comments
setup.py
1
2800
#!/usr/bin/env python from __future__ import print_function from setuptools import setup, find_packages from os import path import codecs import os import re import sys # When creating the sdist, make sure the django.mo file also exists: if 'sdist' in sys.argv or 'develop' in sys.argv: try: os.chdir('flue...
apache-2.0
-491,437,323,616,683,260
30.818182
102
0.633929
false
peterbarkley/SurfGeckos
djangosite/snippets/migrations/0012_auto_20170917_2131.py
1
2390
# -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2017-09-18 07:31 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('snippets', '0011_auto_20170917_2103'), ] operations = [ migrations.AlterFie...
mit
5,916,513,155,612,824,000
33.142857
107
0.575732
false
venicegeo/eventkit-cloud
eventkit_cloud/utils/tests/test_coordinate_converter.py
1
2036
import json import logging import requests_mock from django.conf import settings from django.test import TestCase, override_settings from eventkit_cloud.utils.geocoding.coordinate_converter import CoordinateConverter logger = logging.getLogger(__name__) mockURL = "http://test.test" @override_settings(GEOCODING_AUTH...
bsd-3-clause
-3,576,577,693,981,335,000
31.31746
100
0.583497
false
rsharris/jun2015lgl
create_script_insert_length_sparse.py
1
17318
#!/usr/bin/env python """ Create a cluster job file to create an average insert length sparsity discriminator track. """ from sys import argv,stdin,stdout,stderr,exit def usage(s=None): message = """ usage: create_script_insert_length_sparse [options] > insert_length_sparse.sh <sub>_<samp>_<type> (require...
gpl-3.0
-284,336,170,452,609,440
33.090551
101
0.636332
false
vivisect/synapse
synapse/tools/pushfile.py
1
1334
import os import sys import argparse import synapse.telepath as s_telepath import synapse.lib.output as s_output def getArgParser(): p = argparse.ArgumentParser() p.add_argument('cortex', help='telepath URL for a target cortex') p.add_argument('filenames', nargs='+', help='files to upload') p.add_arg...
apache-2.0
1,528,828,532,409,268,200
24.653846
85
0.587706
false
FedoraScientific/salome-paravis
src/PV_SWIG/paravis.py
1
3020
# Copyright (C) 2010-2014 CEA/DEN, EDF R&D # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library ...
lgpl-2.1
6,292,424,748,321,725,000
30.134021
98
0.765232
false
viktorradnai/screenwarp
utils/create_chessboard.py
1
2170
#!/usr/bin/python import cv2 import wand.image import wand.color import wand.drawing import sys import logging import argparse logger = logging.getLogger(__name__) def parse_cmdline(): parser = argparse.ArgumentParser(description=''' TODO: insert description.''' ) parser.add_argument('-v', '--ver...
gpl-3.0
882,043,655,816,583,800
32.90625
140
0.632258
false
Symphonia/Searcher
ImageView.py
1
4861
from PySide import QtGui, QtCore import sys, os class ImageView(QtGui.QWidget): def __init__(self,imagelist,parent = None): super(ImageView,self).__init__(parent) self.imagesize = None self.mode = '' self.imageList = imagelist[0] self.index = imagelist[1] self.title_label = QtGui.QLabel(self) self.image...
mit
5,924,794,669,647,383,000
32.763889
104
0.687513
false
L3nzian/AutoPermit
ap_connections.py
1
7082
#import pyodbc import odbc import _winreg import ConfigParser config_file = 'AutoPermit.ini' def get_config_dict(config_file, section): """ Reads a config file :param config_file: a config file usable by ConfigParser :param section: a section in the config file :return: a dictionary section's en...
gpl-2.0
664,343,986,325,360,600
30.336283
89
0.572296
false
icgc-dcc/dcc-storage
docs/conf.py
1
5104
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # score documentation build configuration file, created by # sphinx-quickstart on Thu Sep 27 15:44:32 2018. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # auto...
gpl-3.0
6,997,627,080,463,810,000
29.023529
79
0.672218
false
bwall/BAMF
IntegrationQueue/static/cifstrap.py
1
6896
import socket import time import struct import sys import threading import datetime def PrintLog(message): message = "[" + str(datetime.datetime.now()) + "] " + message print message f = open("hashlog.txt", "a") f.write(message + "\n") f.close() class Handler(threading.Thread): def __init__(...
mit
1,397,065,986,422,724,000
37.311111
127
0.518997
false
heistermann/wradvis
wradvis/gui.py
1
3615
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) 2016, wradlib Development Team. All Rights Reserved. # Distributed under the MIT License. See LICENSE.txt for more info. # -----------------------------------------------------------------------------...
mit
-3,702,765,137,946,317,000
31.567568
98
0.604149
false
rabernat/xrft
setup.py
1
1391
import os import versioneer from setuptools import setup, find_packages PACKAGES = find_packages() DISTNAME = 'xrft' LICENSE = 'MIT' AUTHOR = 'xrft Developers' AUTHOR_EMAIL = 'takaya@ldeo.columbia.edu' URL = 'https://github.com/xgcm/xrft' CLASSIFIERS = [ 'Development Status :: 4 - Beta', 'License :: OSI Approv...
mit
5,605,376,177,296,393,000
29.23913
65
0.670022
false
klyone/PacketTesterXML
PTXML_server.py
1
1324
#! /usr/bin/python # ****************************************************************************** # @file PTXML_client.py # @brief Example using PTXMLServer # # Copyright (C) 2014 # # @author Miguel Jimenez Lopez <klyone@ugr.es> # # ****************************************************************************** ...
lgpl-3.0
-7,830,697,422,475,709,000
32.948718
81
0.592145
false
shikhar394/uptane
tests/test_der_encoder.py
1
21951
""" <Program Name> test_der_encoder.py <Purpose> Unit testing for DER Encoding, uptane/encoding/asn1_codec.py """ from __future__ import print_function from __future__ import unicode_literals import uptane # Import before TUF modules; may change tuf.conf values. import tuf.formats import tuf.keys import tuf.repo...
mit
-9,105,546,731,241,856,000
35.342715
163
0.70589
false
kiddinn/plaso
tests/test_lib.py
1
6573
# -*- coding: utf-8 -*- """Shared functions and classes for testing.""" import io import os import shutil import re import tempfile import unittest from dfdatetime import time_elements from dfvfs.lib import definitions as dfvfs_definitions from dfvfs.path import factory as path_spec_factory from dfvfs.resolver import...
apache-2.0
-5,972,444,404,994,941,000
32.365482
78
0.685836
false
fclesio/learning-space
Python/ims24/ims24/contrators/requester.py
1
3740
#!/usr/bin/env python3.6 # -*- coding: utf-8 -*- # # requester.py # @Author : Gustavo F (gustavo@gmf-tech.com) # @Link : https://github.com/sharkguto # @Date : 17/02/2019 11:06:12 import typing import requests from requests_futures.sessions import FuturesSession from ims24 import logger from ims24.configuration....
gpl-2.0
-6,365,144,988,948,067,000
33.62963
105
0.55
false
iddqd1/django-cms
cms/tests/test_check.py
1
7102
# -*- coding: utf-8 -*- from copy import deepcopy import os from django.apps import apps from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.template import base from django.test import SimpleTestCase, TestCase from cms.api import add_plugin from cms.models.pluginmodel...
bsd-3-clause
-8,568,157,656,037,007,000
37.808743
120
0.661222
false
enigmampc/catalyst
catalyst/data/continuous_future_reader.py
1
12198
import numpy as np import pandas as pd from catalyst.data.session_bars import SessionBarReader class ContinuousFutureSessionBarReader(SessionBarReader): def __init__(self, bar_reader, roll_finders): self._bar_reader = bar_reader self._roll_finders = roll_finders def load_raw_arrays(self, col...
apache-2.0
-5,301,456,748,954,233,000
32.977716
79
0.523856
false
home-assistant/home-assistant
homeassistant/components/yeelight/config_flow.py
1
9179
"""Config flow for Yeelight integration.""" import logging import voluptuous as vol import yeelight from homeassistant import config_entries, exceptions from homeassistant.components.dhcp import IP_ADDRESS from homeassistant.const import CONF_DEVICE, CONF_HOST, CONF_ID, CONF_NAME from homeassistant.core import callba...
apache-2.0
-138,866,631,066,562,610
36.313008
88
0.577514
false
Awingu/open-ovf
py/ovf/env/PlatformSection.py
1
2180
# vi: ts=4 expandtab syntax=python ############################################################################## # Copyright (c) 2008 IBM Corporation # All rights reserved. This program and the accompanying materials # are made available under the terms of the Eclipse Public License v1.0 # which accompanies this distr...
epl-1.0
-395,953,434,265,755,460
30.142857
78
0.563303
false
jeandet/meson
mesonbuild/mlog.py
1
5948
# Copyright 2013-2014 The Meson development team # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agree...
apache-2.0
-5,709,928,738,078,606,000
28.59204
90
0.632313
false
mariusor/tlcal
plusfw/scraper/html.py
1
5805
import plusfw from datetime import datetime from requests import get, post, codes, exceptions import json class Html: """ """ base_uris = { plusfw.LABEL_PFW: "https://www.plusforward.net", plusfw.LABEL_QLIVE: "https://www.plusforward.net", plusfw.LABEL_QIV: "https://www.plusforwa...
mit
-3,542,870,659,403,007,000
32.554913
113
0.566925
false
paulhtremblay/boto_emr
boto_emr/get_s3_common_crawl_paths.py
1
1380
import boto3 import os def list_objects(bucket_name, prefix): final = [] session = boto3.Session() client = session.client('s3') next_token = 'init' kwargs = {} while next_token: if next_token != 'init': kwargs.update({'ContinuationToken': next_token}) response = cl...
mit
3,909,192,302,405,928,400
29.666667
83
0.604348
false
semplice/alan2
alan-config.py
1
5617
#!/usr/bin/env python # -*- coding: utf-8 -*- # # alan2 - An openbox menu builder # Copyright (C) 2013 Semplice Project # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the...
gpl-3.0
-4,496,736,953,788,623,000
30.205556
158
0.718177
false
DrKylstein/tiled-vorticons
keenlib/ted15.py
1
3290
''' Commander Keen 1-3 level loader/saver 2014 <dr.kylstein@gmail.com> ''' from __future__ import print_function import math import rlew import file_gen_util as util RLEW_FLAG = 0xFEFE HEADER_FIELDS = ('width', 'height', 'plane_count', 'unk1', 'unk2', 'unk3', 'unk4', 'plane_size', 'unk5', 'unk6', 'u...
mit
-5,003,504,926,450,260,000
25.111111
80
0.547416
false
gabriel-samfira/jrunner
jrunner/jobqueue/workers/simple.py
1
1445
# Copyright 2013 Cloudbase Solutions Srl # 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 applicabl...
apache-2.0
-6,615,291,938,239,006,000
26.264151
75
0.70519
false
poppogbr/genropy
legacy_packages/dev/main.py
1
1554
#!/usr/bin/env python # encoding: utf-8 import sys import os class Package(object): def config_attributes(self): return dict(comment='dev package', name_short='dev', name_long='dev', name_full='dev') def config_db(self, pkg): #developer table t = pkg.table('de...
lgpl-2.1
-7,410,479,213,271,342,000
30.714286
72
0.530245
false
DirkWilhelmi/mikro_tms
rpi_functions.py
1
1501
import ConfigParser from r515.basic_functions import BasicFunctions from r515.basic_settings import BasicSettings from r515.connection import Connection config = ConfigParser.ConfigParser() config.read(['r515.cfg']) conn = Connection(config.get('Connection', 'IP'), config.get('Connection', 'USR'), config.get('Connect...
gpl-2.0
8,981,977,570,421,429,000
14.02
115
0.67022
false
cz-maria/Pawel_the_Mage
wrogowie.py
1
3434
import pygame import stale class Enemy(pygame.sprite.Sprite): walking_frames_l = [] walking_frames_r = [] def __init__(self): super().__init__() image = pygame.image.load("knight.png").convert() image.set_colorkey(stale.WHITE) self.walking_frames_l.append(image) ...
mit
7,943,579,829,183,453,000
32.666667
91
0.547175
false
I-prefer-the-front-end/I-prefer-the-front-end
iptfe/blog/views.py
1
1283
from django.shortcuts import render from django.http import HttpResponse from blog.models import Post, Comment from django.http import HttpResponseRedirect, HttpResponse from django.core.urlresolvers import reverse def archive(request): all_posts = Post.objects.all(); context = {} context['posts'] = all_p...
mit
-7,611,802,143,038,839,000
28.837209
82
0.670304
false
l0b0/tilde
.config/calibre/global.py
1
3641
# calibre wide preferences ### Begin group: DEFAULT # database path # Path to the database in which books are stored database_path = '/home/username/library1.db' # filename pattern # Pattern to guess metadata from filenames filename_pattern = u'(?P<title>.+) - (?P<author>[^_]+)' # isbndb com key # Access key for...
gpl-3.0
1,650,783,839,469,190,100
34.686275
411
0.765659
false
rouge8/pip
tests/functional/test_download.py
1
21568
import os.path import shutil import textwrap import pytest from pip._internal.cli.status_codes import ERROR from tests.lib.path import Path def fake_wheel(data, wheel_path): shutil.copy( data.packages.joinpath('simple.dist-0.1-py2.py3-none-any.whl'), data.packages.joinpath(wheel_path), ) @...
mit
-2,968,084,934,226,915,000
28.464481
79
0.562175
false
TensorVision/MediSeg
eval.py
1
3028
"""Evaluation of the Model. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from datetime import datetime import math import time import tensorflow.python.platform from tensorflow.python.platform import gfile import numpy as np import tensorflow as tf...
mit
-7,461,508,753,181,198,000
25.561404
89
0.652906
false
d2emon/generator-pack
src/genesys/generator/generator/name.py
1
2378
import random from fixtures import generator_data GENDER_NEUTRAL = 0 GENDER_MALE = 1 GENDER_FEMALE = 2 def random_generator(selector, generator_id=None, max_value=10): if generator_id is None: generator_id = random.randrange(max_value) return selector(generator_id) class Name: glue = "" d...
gpl-3.0
-4,013,448,233,439,665,000
22.78
89
0.619849
false
umlaeute/tto-oracle
OracleClient.py
1
1756
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright © 2015, IOhannes m zmölnig, forum::für::umläute # 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 #...
gpl-2.0
-5,601,967,010,997,971,000
37.086957
126
0.648402
false
erinspace/osf.io
api/wb/serializers.py
1
2711
from django.db import IntegrityError from rest_framework import serializers as ser from rest_framework import exceptions from website.files import exceptions as file_exceptions from api.base.serializers import IDField, ShowIfVersion class DestinationSerializer(ser.Serializer): parent = ser.CharField(write_only=...
apache-2.0
3,177,119,665,188,211,000
37.183099
112
0.695315
false
JohnOmernik/pimeup
throne/throne.py
1
11168
#!/usr/bin/python #Gateway import time import random import sys import cwiid import json import gevent from collections import OrderedDict import cStringIO import alsaaudio import wave import requests import os import struct import math from dotstar import Adafruit_DotStar import socket WHATAMI = os.path.basename(__fi...
apache-2.0
-4,747,397,339,700,146,000
27.56266
182
0.588378
false
andresriancho/w3af-webui
src/w3af_webui/migrations/0006_auto__add_field_scan_show_report_time.py
1
10565
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Scan.show_report_time' db.add_column(u'scans', 'show_report_time', self.gf('django.db.mod...
gpl-2.0
-7,063,761,660,673,439,000
75.007194
182
0.547468
false
KenkoGeek/2book
tobook/tobook/settings.py
1
3747
""" Django settings for tobook project. Generated by 'django-admin startproject' using Django 1.11.3. For more information on this file, see https://docs.djangoproject.com/en/1.11/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.11/ref/settings/ """ import os ...
mit
3,251,829,976,081,123,000
25.202797
91
0.681879
false
ekasitk/sahara
sahara/conductor/api.py
1
17877
# Copyright (c) 2013 Mirantis 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 writ...
apache-2.0
-5,505,272,707,848,714,000
36.399582
79
0.618001
false
marcosfede/algorithms
adventofcode/2018/21/d21.py
1
2031
def addr(r, a, b): return r[a]+r[b] def addi(r, a, b): return r[a]+b def mulr(r, a, b): return r[a]*r[b] def muli(r, a, b): return r[a] * b def banr(r, a, b): return r[a] & r[b] def bani(r, a, b): return r[a] & b def borr(r, a, b): return r[a] | r[b] def bori(r, a, b): ret...
gpl-3.0
-1,701,008,128,301,558,000
17.981308
148
0.573117
false
Phoenix1369/site
judge/models/interface.py
1
3940
import re from django.core.exceptions import ValidationError from django.core.urlresolvers import reverse from django.db import models from django.utils.translation import ugettext_lazy as _ from mptt.fields import TreeForeignKey from mptt.models import MPTTModel from judge.models.problem import Problem from judge.mo...
agpl-3.0
-7,833,119,848,122,889,000
34.818182
114
0.661421
false
google/carfac
python/tf/car_saveload_test.py
1
1728
# Lint as: python3 #!/usr/bin/env python # Copyright 2021 The CARFAC Authors. All Rights Reserved. # # This file is part of an implementation of Lyon's cochlear model: # "Cascade of Asymmetric Resonators with Fast-Acting Compression" # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use...
apache-2.0
2,798,924,330,977,943,000
30.418182
74
0.699653
false
secynic/ipwhois
ipwhois/tests/online/test_rdap.py
1
1923
import json import io from os import path import logging from ipwhois.tests import TestCommon from ipwhois.exceptions import (HTTPLookupError, HTTPRateLimitError) from ipwhois.rdap import (RDAP, Net) LOG_FORMAT = ('[%(asctime)s] [%(levelname)s] [%(filename)s:%(lineno)s] ' '[%(funcName)s()] %(message)s') ...
bsd-2-clause
8,589,798,249,177,699,000
26.471429
74
0.512741
false
akretion/odoo
odoo/addons/base/models/ir_module.py
4
42225
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import base64 from collections import defaultdict from decorator import decorator from operator import attrgetter import importlib import io import logging import os import shutil import tempfile import zipfile import re...
agpl-3.0
-8,592,800,491,846,170,000
42.441358
184
0.58958
false
sergg75/dataModels
Environment/AirQualityObserved/harvest/madrid_air_quality_harvest.py
1
10084
#!../bin/python # -*- coding: utf-8 -*- from __future__ import with_statement import csv import datetime import json import urllib2 import StringIO import logging import logging.handlers import re from pytz import timezone import contextlib import copy # Entity type AMBIENT_TYPE_NAME = 'AirQualityObserved' # List o...
mit
-1,189,698,492,716,572,200
26.327913
121
0.597679
false
MichaelHills/seizure-detection
common/data.py
1
1254
import io import os import os.path def makedirs(dir): try: os.makedirs(dir) except: pass class jsdict(dict): def __init__(self, data): self.__dict__ = data class CachedDataLoader: def __init__(self, dir): self.dir = dir makedirs(dir) # try to load data ...
mit
8,616,434,518,350,097,000
24.08
77
0.541467
false
Bauble/bauble.api
bauble/routes/auth.py
1
4072
""" All routes in Bauble use HTTP basic auth. """ from datetime import datetime, timedelta import os import smtplib import bottle from bottle import request import sqlalchemy as sa import bauble import bauble.config as config import bauble.db as db import bauble.email as email from bauble import app, API_ROOT from b...
bsd-3-clause
2,067,726,693,262,682,400
29.38806
122
0.631139
false
lepture/terminal
setup.py
1
1369
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys kwargs = {} if sys.platform == 'win32': kwargs['install_requires'] = ['colorama'] try: from setuptools import setup except ImportError: from distutils.core import setup import terminal from email.utils import parseaddr author, author_email = parsea...
bsd-3-clause
6,709,991,807,795,420,000
28.76087
70
0.615778
false
magfest/mivs
mivs/models.py
1
16621
from mivs import * def href(url): return ('http://' + url) if url and not url.startswith('http') else url class ReviewMixin: @property def video_reviews(self): return [r for r in self.reviews if r.video_status != c.PENDING] @property def game_reviews(self): return [r for r in se...
agpl-3.0
-4,106,034,085,182,044,700
35.610132
190
0.64232
false
capone212/crashtec
src/crashtec/symbolsmngr/bindownloader.py
1
6478
''' Created on 27.03.2013 HB! :) @author: capone ''' # TODO: Style!!! rewrite it all import urllib import os import socket import urlparse import logging from crashtec.db.provider import routines as dbroutines from crashtec.db.provider import filter from crashtec.config import symbolsmngrconfig from crashtec.utils...
gpl-3.0
-6,197,031,200,596,405,000
36.662791
80
0.619636
false
theo-l/django
django/views/static.py
6
4553
""" Views and functions for serving static files. These are only to be used during development, and SHOULD NOT be used in a production setting. """ import mimetypes import posixpath import re from pathlib import Path from django.http import ( FileResponse, Http404, HttpResponse, HttpResponseNotModified, ) from dja...
bsd-3-clause
607,832,988,565,243,500
32.696296
112
0.626291
false
xlqian/navitia
release/script_release.py
1
16196
# -*- coding: utf-8 -*- # Copyright (c) 2001-2018, Canal TP and/or its affiliates. All rights reserved. # # This file is part of Navitia, # the software to build cool stuff with public transport. # # Hope you'll enjoy and contribute to this project, # powered by Canal TP (www.canaltp.fr). # Help us simplify mobilit...
agpl-3.0
3,002,856,353,887,246,300
35.151786
113
0.566066
false
pycrystem/pycrystem
pyxem/signals/tensor_field.py
1
3246
# -*- coding: utf-8 -*- # Copyright 2016-2020 The pyXem developers # # This file is part of pyXem. # # pyXem 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
-612,649,568,791,090,200
27.725664
77
0.637708
false
rpm-software-management/librepo
examples/python/download_packages_with_fastestmirror.py
1
1645
#!/usr/bin/env python3 """ librepo - download packages """ import os import os.path import time import librepo CACHE = "fastestmirror.cache" LIBREPOPKG = "librepo-1.2.1-2.fc20.x86_64.rpm" LAMEPKG = "lame-3.99.5-2.fc19.x86_64.rpm" if __name__ == "__main__": # Setup logging def debug_function(msg, _): ...
lgpl-2.1
-5,597,930,237,731,403,000
26.416667
96
0.649848
false
mizuy/mizwiki
mizwiki/utils/conv_pukiwiki.py
1
4421
# -*- coding: utf-8 -*- import codecs, os, cStringIO as StringIO, re, sys class IStreamBuffer: @staticmethod def _conv(v): return v.rstrip(u'\n\r') def __init__(self,inputfile): self.input = codecs.getreader('utf-8')(inputfile) self.stack = [] def __iter__(self): r...
mit
-3,868,430,965,057,557,000
25.793939
75
0.434291
false
fabian4/trove
trove/guestagent/strategies/backup/experimental/mongo_impl.py
1
4132
# Copyright (c) 2014 eBay Software Foundation # Copyright 2015 Hewlett-Packard Development Company, L.P. and Tesora, 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 L...
apache-2.0
-8,938,092,058,526,218,000
37.259259
78
0.623427
false
eciis/web
backend/handlers/resend_invite_handler.py
1
1157
# -*- coding: utf-8 -*- """Resend Invite Handler.""" import json from util import login_required from utils import json_response from utils import Utils from custom_exceptions import NotAuthorizedException from . import BaseHandler from google.appengine.ext import ndb __all__ = ['ResendInviteHandler'] class ResendIn...
gpl-3.0
8,617,821,435,491,337,000
31.138889
81
0.65255
false
runefriborg/pycsp
test/unix/multiprocesstest.py
1
7496
""" Copyright (c) 2009 John Markus Bjoerndalen <jmb@cs.uit.no>, Brian Vinter <vinter@diku.dk>, Rune M. Friborg <runef@diku.dk> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restrict...
mit
-4,761,640,826,768,007,000
33.703704
176
0.636873
false
cossacklabs/acra
wrappers/python/acrawriter/django/__init__.py
1
3334
# Copyright 2016, Cossack Labs Limited # # 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 wri...
apache-2.0
-2,575,220,979,208,501,000
36.044444
95
0.658668
false