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
anomaly/prestans
prestans/rest/response.py
1
13386
import webob from prestans import exception from prestans.http import STATUS from prestans.parser import AttributeFilter from prestans import serializer from prestans.types import Array from prestans.types import BinaryResponse from prestans.types import DataCollection from prestans.types import Model class Response...
bsd-3-clause
-3,160,285,723,558,265,000
35.377717
113
0.590318
false
4.57016
false
false
false
DataViva/dataviva-scripts
scripts/comtrade/helpers/calc_rca.py
1
1782
import sys, os import pandas as pd import numpy as np file_path = os.path.dirname(os.path.realpath(__file__)) ps_calcs_lib_path = os.path.abspath(os.path.join(file_path, "../../../lib/ps_calcs")) sys.path.insert(0, ps_calcs_lib_path) import ps_calcs def calc_rca(ypw): ubiquity_required = 20 diversity_require...
mit
7,757,585,191,492,210,000
36.914894
93
0.69248
false
2.874194
false
false
false
copyninja/apt-offline
apt_offline_core/AptOfflineDebianBtsLib.py
1
10168
#!/usr/bin/env python # debianbts.py - Methods to query Debian's BTS. # Copyright (C) 2007-2010 Bastian Venthur <venthur@debian.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 ve...
gpl-3.0
842,525,302,459,896,700
33.006689
91
0.624803
false
3.747881
false
false
false
almorel/lab
python/pycuda/main.py
1
7262
#!/usr/bin/env python # Mandelbrot calculate using GPU, Serial numpy and faster numpy # Use to show the speed difference between CPU and GPU calculations # ian@ianozsvald.com July 2010 # Based on vegaseat's TKinter/numpy example code from 2006 # http://www.daniweb.com/code/snippet216851.html# # with minor changes to ...
gpl-3.0
-6,831,566,313,177,774,000
34.42439
180
0.631644
false
3.171179
false
false
false
pbanaszkiewicz/amy
amy/workshops/management/commands/instructors_activity.py
1
5300
import logging import os from django.core.mail import send_mail from django.core.management.base import BaseCommand from django.template.loader import get_template from workshops.models import Badge, Person, Role logger = logging.getLogger() class Command(BaseCommand): help = "Report instructors activity." ...
mit
-337,196,337,048,741,500
32.757962
87
0.561698
false
4.380165
false
false
false
gdetor/SI-RF-Structure
Statistics/bivariate.py
1
5235
# Copyright (c) 2014, Georgios Is. Detorakis (gdetor@gmail.com) and # Nicolas P. Rougier (nicolas.rougier@inria.fr) # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redis...
gpl-3.0
5,246,652,282,058,843,000
42.625
177
0.634193
false
3.029514
false
false
false
asmaps/nsupdate.info
nsupdate/main/models.py
1
4197
from django.db import models from django.contrib.auth.models import User from django.core.exceptions import ValidationError from django.core.validators import RegexValidator from django.conf import settings from django.db.models.signals import post_delete from django.contrib.auth.hashers import make_password from main ...
bsd-3-clause
9,057,991,372,963,181,000
33.68595
90
0.653562
false
3.774281
false
false
false
efornal/pulmo
app/migrations/0004_objectives_and_targets_connection.py
1
2224
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('app', '0003_create_model_productionform'), ] operations = [ migrations.CreateModel( name='ConnectionSource', ...
gpl-3.0
-2,067,851,419,938,858,500
35.459016
80
0.547212
false
4.742004
false
false
false
FluidityProject/fluidity
tools/optimality.py
2
32601
#!/usr/bin/python3 # Copyright (C) 2006 Imperial College London and others. # # Please see the AUTHORS file in the main source directory for a full list # of copyright holders. # # Prof. C Pain # Applied Modelling and Computation Group # Department of Earth Science and Engineering # Imperial Colleg...
lgpl-2.1
-6,594,667,205,454,949,000
44.279167
158
0.648968
false
3.478182
false
false
false
rcatwood/Savu
savu/plugins/filters/component_analysis/ica.py
1
2407
# 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,032,943,843,606,573,000
37.206349
98
0.666805
false
3.826709
false
false
false
thethythy/Mnemopwd
mnemopwd/client/uilayer/uicomponents/TitledBorderWindow.py
1
2935
# -*- coding: utf-8 -*- # Copyright (c) 2016-2017, Thierry Lemeunier <thierry at lemeunier dot net> # All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: # # 1. Redistributions of source code must reta...
bsd-2-clause
-3,652,827,740,056,266,000
39.205479
93
0.667121
false
3.887417
false
false
false
no-net/gr-winelo
python/client/sim_source_c.py
1
12656
import numpy #from grc_gnuradio import blks2 as grc_blks2 from gnuradio import gr, uhd, blocks # , analog from gruel import pmt # import grextras for python blocks import gnuradio.extras from twisted.internet import reactor #import thread from threading import Thread import time import random from winelo.client impo...
gpl-3.0
-4,139,212,272,071,479,300
43.720848
84
0.514855
false
3.997473
false
false
false
stettberger/metagit
gmp/tools.py
1
1689
from gmp.options import * import subprocess import tempfile import os class ScreenExecutor: instance = None def __init__(self): self.screen_fd, self.screen_path = tempfile.mkstemp() self.counter = 0 self.screen_fd = os.fdopen(self.screen_fd, "w") def get(): if not ScreenExe...
gpl-3.0
-679,937,508,764,406,700
26.688525
104
0.541149
false
3.563291
false
false
false
Wizmann/DjangoSimditor
bootstrap3/renderers.py
1
12414
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.forms import (TextInput, DateInput, FileInput, CheckboxInput, ClearableFileInput, Select, RadioSelect, CheckboxSelectMultiple) from django.forms.extras import SelectDateWidget from django.forms.forms import BaseForm, ...
mit
-1,456,957,295,543,779,600
38.788462
257
0.599807
false
3.902546
false
false
false
dimatura/opendr
slider_demo.py
1
3446
from cvwrap import cv2 import numpy as np import chumpy as ch from copy import deepcopy def nothing(x): pass def get_renderer(): import chumpy as ch from opendr.everything import * # Load mesh m = load_mesh('/Users/matt/geist/OpenDR/test_dr/nasa_earth.obj') m.v += ch.array([0,0,3.]) ...
mit
3,740,670,982,097,944,000
31.509434
126
0.482008
false
2.973253
false
false
false
ceteri/pytextrank
setup.py
1
1642
import setuptools with open("README.md", "r") as fh: long_description = fh.read() setuptools.setup( name="pytextrank", version="2.0.3", author="Paco Xander Nathan", author_email="paco@derwen.ai", description="Python implementation of TextRank for phrase extraction and lightweight summarization...
apache-2.0
-4,886,367,476,329,915,000
38.095238
170
0.64799
false
4.287206
false
false
false
bjornedstrom/python-aesgcm
test/test.py
1
2446
from binascii import hexlify, unhexlify import unittest import aesgcm class TestVectors(unittest.TestCase): VECTORS = [ { 'key': unhexlify(b'0000000000000000000000000000000000000000000000000000000000000000'), 'iv': unhexlify(b'000000000000000000000000'), 'aad': None, ...
bsd-2-clause
-3,236,481,412,823,010,000
33.942857
98
0.60834
false
3.694864
true
false
false
Shiruyaka/MeowMeow
Keyring.py
1
2692
# -*- coding: utf-8 -*- from collections import namedtuple import time import random from Crypto.PublicKey import RSA PrivateRing = namedtuple('PrivateRing', 'timestamp key_id pub_key priv_key') PublicRing = namedtuple('PublicRing', 'timestamp key_id pub_key owner_trust user_name key_legit') def import_keyring(type...
mit
4,771,661,473,854,343,000
25.92
98
0.554978
false
3.628032
false
false
false
htcondor/job_hooks
hooks/hook_reply_fetch.py
1
3170
#!/usr/bin/python # Copyright 2008 Red Hat, 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 applicab...
apache-2.0
-4,077,373,557,673,507,000
31.680412
98
0.662145
false
3.47207
true
false
false
pombredanne/discern
examples/problem_grader/grader/migrations/0001_initial.py
1
7167
# -*- coding: 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 model 'Rubric' db.create_table(u'grader_rubric', ( (u'id', self.gf('django.db.models.fi...
agpl-3.0
4,707,439,369,962,626,000
60.793103
187
0.566206
false
3.681048
false
false
false
deepgraphs/dgraphdb
restDgraphDb/dgraphdb/dgraphdbstore.py
1
1380
__author__ = 'mpetyx' from rdflib import Graph # import rdflib.plugin from django.conf import settings import datetime import os # register('SQLite', Store, 'rdflib.store.SQLite', 'SQLite') def random_file_generating(): basename = "deepGraphFile" suffix = datetime.datetime.now().strftime("%y%m%d_%H%M%S") ...
mit
5,964,938,748,346,534,000
25.037736
68
0.624638
false
3.458647
false
false
false
aysteph3/MiniMIPS_Testing
src/algorithm_opt_greedy_ver2.py
1
9513
# Copyright (C) 2017 Siavoosh Payandeh Azad, Stephen Oyeniran # for each new function we start from empty set! import Logger import sys import copy import itertools import time import package package.generate_folders(package.generated_files_folder) sys.stdout = Logger.Logger(package.generated_files_folder) if "-sp" i...
gpl-3.0
-8,961,026,154,048,714,000
41.09292
230
0.644276
false
2.910064
true
false
false
jreback/pandas
pandas/core/indexes/datetimelike.py
1
28697
""" Base and utility classes for tseries type pandas objects. """ from datetime import datetime from typing import TYPE_CHECKING, Any, List, Optional, Tuple, Type, TypeVar, Union, cast import numpy as np from pandas._libs import NaT, Timedelta, iNaT, join as libjoin, lib from pandas._libs.tslibs import BaseOffset, Re...
bsd-3-clause
-3,249,803,881,970,340,400
32.023015
88
0.552671
false
4.106611
false
false
false
ironfroggy/django-mailer
mailer/__init__.py
1
4161
VERSION = (0, 2, 0, "dev", 1) def get_version(): if VERSION[3] == "final": return "%s.%s.%s" % (VERSION[0], VERSION[1], VERSION[2]) elif VERSION[3] == "dev": return "%s.%s.%s%s%s" % (VERSION[0], VERSION[1], VERSION[2], VERSION[3], VERSION[4]) else: return "%s.%s.%s%s" % (VERSION[0],...
mit
-1,367,007,737,760,832,500
32.02381
92
0.604903
false
4.051607
false
false
false
neilLasrado/erpnext
erpnext/controllers/queries.py
1
19700
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe import erpnext from frappe.desk.reportview import get_match_cond, get_filters_cond from frappe.utils import nowdate, getdate from collecti...
gpl-3.0
-5,845,624,524,436,555,000
30.980519
143
0.651421
false
2.983041
false
false
false
OctavianLee/Pywechat
pywechat/services/wechat_shake.py
1
20297
# -*- coding: utf-8 -*- from pywechat.services.basic import Basic class ShakeService(Basic): """This class is an implement of the Wechat service of shaking. All request's urls come from the official documents. Link: https://mp.weixin.qq.com/wiki/home/index.html """ def bind_page( s...
mit
5,705,444,596,172,750,000
28.836765
80
0.452708
false
4.232165
false
false
false
iwalz/zendserverapi
docs/conf.py
1
7828
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Zend Server API documentation build configuration file, created by # sphinx-quickstart on Mon Dec 24 01:33:37 2012. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in thi...
bsd-3-clause
-1,641,784,278,740,480,300
31.213992
80
0.70465
false
3.761653
true
false
false
rcanepa/cs-fundamentals
python/interview_questions/longest_repeated_substring.py
1
2128
"""Longest repeated substring (or LCP = longest common prefix in a suffix array). Problem: find the longest repeated substring inside a string. Steps: 1. Create suffixes. This should be linear in time and space, but it isn't. Slicing strings in Python (with slice or [a:b]) is a linear operation wit...
mit
4,694,552,034,413,392,000
30.761194
103
0.569549
false
3.848101
false
false
false
marckn/dimerizer
dimerizer/forcefield/collect/collectfromtopology.py
1
2636
import dimerizer.forcefield.basic_parsing_tools as parser import basic_func as basic def collect_tags(fname, atomlist): """ Collect the dimerized atomtypes. fname is a topology filename, atomlist is the list of atom INDICES (0 to N-1) Returns: tuple with two elements: 1) a list of tags w...
gpl-3.0
-1,301,878,778,461,048,800
22.963636
74
0.638088
false
3.222494
false
false
false
masschallenge/django-accelerator
accelerator_abstract/models/base_startup_mentor_relationship.py
1
1538
# MIT License # Copyright (c) 2017 MassChallenge, Inc. from __future__ import unicode_literals import swapper from django.conf import settings from django.db import models from accelerator_abstract.models.accelerator_model import AcceleratorModel CONFIRMED_RELATIONSHIP = "Confirmed" DESIRED_RELATIONSHIP = "Desired"...
mit
2,679,707,739,714,140,000
34.767442
75
0.676853
false
3.73301
false
false
false
cogu/py-apx
util/apx_split.py
1
3475
#!/usr/bin/env python3 import os, sys import apx import argparse def parse_lines_in_file(path): """ Parses text file path line by line and returns a list of names found in it. The special character '#' can be used as a comment character and allows users to write line comments. Comments does not affect ...
mit
-8,647,016,750,354,452,000
38.044944
129
0.641151
false
3.564103
false
false
false
energicryptocurrency/energi
qa/rpc-tests/rest.py
1
15355
#!/usr/bin/env python3 # Copyright (c) 2014-2018 The Energi Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # Copyright (c) 2014-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the...
mit
-6,753,828,709,250,829,000
44.428994
132
0.616346
false
3.619755
true
false
false
baykovr/rukovod
rukovod.py
1
6576
#!/usr/bin/env python # Texas A&M University # Department of Computer Science and Engineering # Robert A. Baykov import sys,datetime,time,csv,os,argparse,smtplib from email.MIMEMultipart import MIMEMultipart from email.MIMEText import MIMEText from rukovod_datatypes import Course,Section,Student #...
gpl-3.0
2,644,757,180,881,620,500
24.417671
99
0.621502
false
2.994536
false
false
false
bigswitch/nova
nova/tests/unit/api/openstack/compute/test_flavors.py
1
24823
# Copyright 2012 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
apache-2.0
774,215,699,162,965,000
35.666174
79
0.457237
false
4.444584
true
false
false
flux3dp/fluxghost
fluxghost/api/discover.py
1
4822
from time import time import logging import json from fluxghost import g logger = logging.getLogger("API.DISCOVER") def get_online_message(source, device): st = None doc = { "uuid": device.uuid.hex, "alive": True, "source": source, "serial": device.serial, "version":...
agpl-3.0
3,847,416,626,889,435,600
31.362416
79
0.48652
false
4.20401
false
false
false
rocky/python3-trepan
trepan/lib/printing.py
1
4182
# -*- coding: utf-8 -*- # Copyright (C) 2007-2010, 2015, 2020 Rocky Bernstein # 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 lat...
gpl-3.0
5,689,020,719,061,596,000
25.980645
73
0.518173
false
3.658793
false
false
false
chennan47/OSF-Offline
start.py
1
1174
import sys from PyQt5.QtWidgets import QApplication, QMessageBox, QSystemTrayIcon from osfoffline import utils from osfoffline.application.main import OSFApp from osfoffline.database_manager.db import drop_db def running_warning(): warn_app = QApplication(sys.argv) QMessageBox.information( None, ...
apache-2.0
8,891,531,229,938,620,000
20.345455
70
0.626065
false
3.738854
false
false
false
onedata/cluster-example
bamboos/docker/package.py
1
3382
#!/usr/bin/env python # coding=utf-8 """Author: Tomasz Lichon Copyright (C) 2015 ACK CYFRONET AGH This software is released under the MIT license cited in 'LICENSE.txt' Build packages in dockerized environment, as user 'package' Run the script with -h flag to learn about script's running options. """ from os.path i...
mit
-2,463,403,816,468,090,400
25.015385
79
0.617978
false
3.617112
false
false
false
pandich/pymetrics
pymetrics/histogram.py
1
1143
import numpy as np from metric import metric_decorated from statistical_metric import StatisticalMetric from pymetrics.unit.timeunit import now time_key = 'time' value_key = 'value' class Histogram(StatisticalMetric): time_series_dtype = np.dtype([ (time_key, float), (value_key, float), ]) ...
apache-2.0
4,475,350,069,275,106,300
22.326531
64
0.627297
false
3.848485
false
false
false
crazyyoung01/vv
vn.trader/ctaAlgo/multiCtaTemplate.py
1
7374
# encoding: UTF-8 ''' 本文件包含了CTA引擎中的策略开发用模板,开发策略时需要继承CtaTemplate类。 ''' from ctaBase import * from vtConstant import * ######################################################################## class MultiCtaTemplate(object): """MultiCTA策略模板""" # 策略类的名称和作者 className = 'MultiCtaTemplate' author = EM...
mit
1,487,841,099,240,909,300
33.378947
96
0.402174
false
3.743266
false
false
false
TylerTemp/wordz
wordz/single_select.py
1
3137
import textwrap import curses import logging from wordz import keys logger = logging.getLogger('single_select') class SingleSelect(object): check = '\u2713' def __init__(self, content, current=0, default=0, padding=0, lineno=False): self.content = content self.current = current self....
gpl-3.0
-9,084,918,205,113,767,000
27.225225
94
0.514204
false
4.074122
false
false
false
jerryryle/python-lz4ex
tests/lz4hc_test.py
1
1734
from lz4ex import lz4, lz4hc import unittest class TestLZ4(unittest.TestCase): def test_compress_default(self): input_data = b"2099023098234882923049823094823094898239230982349081231290381209380981203981209381238901283098908123109238098123" input_data_size = len(input_data) compressed = lz...
bsd-3-clause
8,206,075,741,504,018,000
39.325581
136
0.72203
false
3.135624
true
false
false
EICT/C-BAS
src/vendor/geni_trust/gen-certs.py
1
10956
#!/usr/bin/env python import sys import os.path import optparse import geniutil import datetime import subprocess import uuid CA_CERT_FILE = 'ca-cert.pem' CA_KEY_FILE = 'ca-key.pem' SA_CERT_FILE = 'sa-cert.pem' SA_KEY_FILE = 'sa-key.pem' MA_CERT_FILE = 'ma-cert.pem' MA_KEY_FILE = 'ma-key.pem' AM_CERT_FILE = 'am-cert....
bsd-3-clause
7,574,652,154,376,849,000
45.621277
136
0.629518
false
3.057773
false
false
false
1032231418/python
lesson10/apps/books/publish/__init__.py
1
3345
# coding=utf8 from django.views.generic import ListView, DetailView, CreateView from django.db.models import Q from django.http import JsonResponse, HttpResponseRedirect from django.core.urlresolvers import reverse from django.shortcuts import render from pure_pagination.mixins import PaginationMixin from django.contri...
apache-2.0
-5,549,527,290,084,019,000
32.706522
80
0.613028
false
3.284958
false
false
false
mattilyra/gensim
gensim/corpora/svmlightcorpus.py
1
5903
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2010 Radim Rehurek <radimrehurek@seznam.cz> # Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html """Corpus in SVMlight format.""" from __future__ import with_statement import logging from gensim import utils from gensim.corpora ...
lgpl-2.1
1,579,964,182,420,635,000
30.736559
118
0.569372
false
4.09362
false
false
false
annoviko/pyclustering
pyclustering/utils/metric.py
1
20881
"""! @brief Module provides various distance metrics - abstraction of the notion of distance in a metric space. @authors Andrei Novikov (pyclustering@yandex.ru) @date 2014-2020 @copyright BSD-3-Clause """ import numpy from enum import IntEnum class type_metric(IntEnum): """! @brief Enu...
gpl-3.0
-7,497,159,329,073,956,000
30.883465
142
0.614338
false
3.813185
false
false
false
madhusudancs/pytask
scripts/generate_tasks_from_csv.py
1
2862
#!/usr/bin/env python # # Copyright 2011 Authors of PyTask. # # This file is part of PyTask. # # PyTask is free software: you can redistribute it and/or modify it # under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either version 3 of the License, or # (at your opt...
agpl-3.0
2,580,936,690,223,775,000
25.747664
71
0.643256
false
3.683398
false
false
false
UKPLab/sentence-transformers
sentence_transformers/losses/CosineSimilarityLoss.py
1
2213
import torch from torch import nn, Tensor from typing import Iterable, Dict from ..SentenceTransformer import SentenceTransformer class CosineSimilarityLoss(nn.Module): """ CosineSimilarityLoss expects, that the InputExamples consists of two texts and a float label. It computes the vectors u = model(inpu...
apache-2.0
990,618,158,397,479,200
51.690476
177
0.712155
false
3.875657
false
false
false
damiendart/nfsnapi-python
nfsnapi.py
1
5512
"""Stuff to make working with the NearlyFreeSpeech.NET API easier. >>> import nfsnapi >>> # Replace USERNAME, API_KEY, and so on with actual values. >>> nfsnapi.run_request("USERNAME", "API_KEY", ... "/account/ACCOUNT_NUMBER/balance") '10.56' >>> nfsnapi.run_request("USERNAME", "API_KEY", ... "/dns/DOMAI...
unlicense
-8,174,024,267,578,874,000
40.134328
88
0.717888
false
3.742023
false
false
false
jima80525/KidTasks
tasks/models.py
1
3216
""" Define the data models for the KidsTasks app """ import datetime from django.db import models class Kid(models.Model): """ Defines the kids which have to do the tasks. """ name = models.CharField(max_length=256) last_update_date = models.DateField(default=datetime.datetime.today) days = [ ...
mit
8,298,939,762,771,274,000
33.956522
79
0.610386
false
3.783529
false
false
false
listyque/TACTIC-Handler
thlib/side/python_minifier/rename/mapper.py
1
5193
""" For each node in an AST set the namespace to use for name binding and resolution """ import ast from python_minifier.rename.util import is_namespace def add_parent_to_arguments(arguments, func): arguments.parent = func arguments.namespace = func for arg in arguments.args: add_parent(arg, ar...
epl-1.0
-7,521,664,311,103,650,000
34.568493
168
0.677258
false
4.028704
false
false
false
rjschwei/azure-sdk-for-python
azure-mgmt-sql/azure/mgmt/sql/models/server_metric.py
1
2274
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
8,039,844,268,228,363,000
33.984615
76
0.5708
false
4.119565
false
false
false
elopio/snapcraft
tests/integration/general/test_clean_prime_step.py
1
3431
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright (C) 2016-2018 Canonical Ltd # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 as # published by the Free Software Foundation. # # This program is distributed in ...
gpl-3.0
-3,465,672,595,023,628,300
37.988636
77
0.660449
false
3.611579
true
false
false
fbcotter/dataset_loading
dataset_loading/pascal.py
1
1677
from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import pandas as pd from dataset_loading import core def img_sets(): """ List all the image sets from Pascal VOC. Don't bother computing this on the fly, just remember it. It's faster. ...
mit
-7,223,453,819,954,609,000
28.946429
75
0.543828
false
3.568085
false
false
false
DarkPhoenix6/My_Libraries
Python/Utils/mars.py
1
12802
from __future__ import division import sys import math class Point2D(object): def __init__(self, x, y): self.x = x self.y = y def square_distance(self, other_point): """ Calculates the square distance between this Point2D and another Point2D :param other_point: The other Poin...
gpl-3.0
4,510,197,727,863,930,400
36.542522
136
0.529605
false
3.518966
false
false
false
josanvel/BazarPapeleriaLulita
CodigoBazarLulita/pyBotonesReportes.py
1
1813
''' Created on 15/03/2015 @author: josanvel ''' from PyQt4 import QtCore, QtGui from BotonesReportes import Ui_BotonesReportes from pyReporteGanancia import MyformReporteGanancias from pyReporteProducto import MyformReporteProductos class MyformBotonesReportes(QtGui.QMainWindow): def __init__(self, parent=N...
gpl-2.0
846,794,267,647,496,200
35.28
129
0.63155
false
3.5
false
false
false
jpacg/su-binary
jni/selinux/python/sepolicy/sepolicy/manpage.py
1
41002
#! /usr/bin/python -Es # Copyright (C) 2012-2013 Red Hat # AUTHOR: Dan Walsh <dwalsh@redhat.com> # AUTHOR: Miroslav Grepl <mgrepl@redhat.com> # see file 'COPYING' for use and warranty information # # semanage is a tool for managing SELinux configuration files # # This program is free software; you can redistribute i...
gpl-2.0
-2,246,087,477,278,939,100
30.686244
361
0.598971
false
3.405199
false
false
false
gonicus/gosa
backend/src/gosa/backend/objects/index.py
1
70746
# This file is part of the GOsa framework. # # http://gosa-project.org # # Copyright: # (C) 2016 GONICUS GmbH, Germany, http://www.gonicus.de # # See the LICENSE file in the project's top-level directory for details. """ Object Index ============ The Object Index is the search engine in GOsa. It keeps track about a...
lgpl-2.1
-7,332,828,401,185,501,000
39.265225
240
0.534066
false
4.380829
false
false
false
amwelch/ifpy
ifpy/parse.py
1
2325
import dpkt import humanfriendly import nids import sys import pandas as pd import socket ips = {} ip_to_domain = {} def handle_tcp_stream(tcp): end_states = (nids.NIDS_CLOSE, nids.NIDS_TIMEOUT, nids.NIDS_RESET) ports = [80, 443] if tcp.addr[1][1] not in ports: return global ips if tcp.nid...
mit
-3,545,299,151,492,854,000
26.352941
100
0.564301
false
3.274648
false
false
false
yahoo/bossmashup
templates/publisher.py
1
3761
#Copyright (c) 2011 Yahoo! Inc. All rights reserved. Licensed under the BSD License. # See accompanying LICENSE file or http://www.opensource.org/licenses/BSD-3-Clause for the specific language governing permissions and limitations under the License. """ Main class here is Serp (Search Engine Results Page) This is a...
bsd-3-clause
4,224,145,653,442,078,700
41.258427
165
0.683595
false
3.568311
false
false
false
ainur-fa/python_training_1
test/test_del_contact_in_group.py
1
1061
# -*- coding: utf-8 -*- from model.contact import Contact from model.group import Group import random def test_del_contact_in_group(app, db, orm): list =[] app.contact.check_available_min_requirement(app, db) group_list = db.get_group_list() for this_group in group_list: contacts_in_group = orm...
apache-2.0
7,627,593,699,910,538,000
41.44
101
0.681433
false
3.167164
false
false
false
francisbrochu/microbiome-summer-school-2017_mass-spec
example/tutorial_code/alignment.py
1
3212
# -*- coding: utf-8 -*- from __future__ import print_function, division, absolute_import, unicode_literals import numpy as np from .spectrum import Spectrum from .spectrum_utils import take_closest, binary_search_mz_values from subprocess import call from os.path import join from os import remove class Mass_Spectra...
mit
-4,486,410,587,900,100,000
30.194175
83
0.540473
false
3.902795
false
false
false
google-research/rigl
rigl/experimental/jax/pruning/init_test.py
1
8125
# coding=utf-8 # Copyright 2021 RigL Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
apache-2.0
-4,098,234,479,641,906,000
34.021552
80
0.617231
false
3.609507
true
false
false
ayosec/pyslide
Pyslide/Presentation/Pages.py
1
9277
# -*- coding: latin1 -*- # # Copyright (C) 2003, 2004 Ayose Cazorla León # # Authors # Ayose Cazorla <ayose.cazorla@hispalinux.es> # # This file is part of Pyslide. # # Pyslide 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...
gpl-2.0
-1,627,606,097,163,363,300
27.283537
85
0.556214
false
3.990108
false
false
false
FrankNagel/qlc
src/webapp/quanthistling/scripts/annotations/annotations_for_jakway2008.py
1
8208
# -*- coding: utf8 -*- import sys, os sys.path.append(os.path.abspath('.')) import re from operator import attrgetter import difflib # Pylons model init sequence import pylons.test import logging from quanthistling.config.environment import load_environment from quanthistling.model.meta import Sessi...
gpl-3.0
-4,918,240,981,853,853,000
35.488584
202
0.577851
false
3.670841
false
false
false
heejongahn/hjlog
hjlog/models/post.py
1
1123
from datetime import datetime from hjlog import db # Tag helper table tags = db.Table( 'tags', db.Column('tag_id', db.Integer, db.ForeignKey('tag.id')), db.Column('post_id', db.Integer, db.ForeignKey('post.id'))) class Post(db.Model): id = db.Column(db.Integer, primary_key=True) title = db.Colum...
mit
-7,618,970,135,233,268,000
30.194444
69
0.631345
false
3.509375
false
false
false
kirillmorozov/youbot_control
scripts/client_gui.py
1
32532
#!/usr/bin/python2 # -*- coding: utf-8 -*- """Client GUI to control youBot robot.""" import Tkinter as tk import ttk import tkMessageBox import rospyoubot from math import radians, degrees class MainApplication(ttk.Frame): u"""Основное окно приложения.""" def __init__(self, parent, *args, **kwargs): ...
bsd-2-clause
1,213,052,310,638,447,400
38.376276
84
0.535551
false
3.097632
true
false
false
adrienpacifico/openfisca-france
openfisca_france/model/prelevements_obligatoires/prelevements_sociaux/cotisations_sociales/exonerations.py
1
24644
# -*- coding: utf-8 -*- from __future__ import division from numpy import datetime64, maximum as max_, minimum as min_, round as round_, timedelta64 from ....base import * # noqa analysis:ignore from .base import apply_bareme_for_relevant_type_sal class jei_date_demande(Variable): column = DateCol(default = ...
agpl-3.0
2,386,070,103,312,394,000
47.772
120
0.672517
false
2.926437
false
false
false
Niddel/magnet-api2-sdk-python
magnetsdk2/cef.py
1
4911
# -*- coding: utf-8 -*- """ This module implements writing CEF format events. """ from math import ceil, trunc import six from magnetsdk2.time import seconds_from_UTC_epoch def escape_header_entry(x): """ Escapes backslashes and pipes from a header entry. :param x: the string value to escape :retur...
apache-2.0
-9,034,116,061,246,250,000
35.377778
100
0.589086
false
3.789352
false
false
false
pombredanne/metamorphosys-desktop
metamorphosys/META/3rdParty/ctemplate-1.0/src/htmlparser/generate_fsm.py
1
10998
#!/usr/bin/env python # # Copyright (c) 2008, 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 # not...
mit
-816,260,982,260,084,900
31.327273
80
0.600382
false
4.301134
true
false
false
cameronbwhite/PyOLP
PyOLP/paginated.py
1
3928
#!/usr/bin/env python2 # -*- coding: utf-8 -*- # Copyright (C) 2013, Cameron White # # PyGithub 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 # S...
gpl-3.0
1,788,661,924,577,692,200
33.156522
79
0.532332
false
4.743961
false
false
false
sea-kg/inventory-files
contrib/ppa/build_source_pkg_for_ppa.py
1
6043
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import fileinput import re import subprocess import os import sys import shutil from pprint import pprint import datetime print ("Welcome to preapre ppa package...") dists = [] # https://wiki.ubuntu.com/Releases dists.append({ "name": "Ubuntu 16.04.7 LTS (xenial)"...
mit
3,938,819,940,711,231,500
28.478049
171
0.557836
false
2.965162
false
false
false
Kaushikpatnaik/LSTM-Encoder-for-Driver-Telematics
dataProcess.py
1
7823
import numpy as np import os import random from collections import defaultdict, Counter from sklearn.utils import resample, shuffle import math def createFeatures(dataWin1, dataWin2, dataWin3): # given three raw data windows compute velocity accelaration # and change in direction vecData = np.array(np...
mit
-992,711,337,174,148,200
34.721461
149
0.51208
false
3.793889
false
false
false
zorna/zorna
zorna/site/templatetags/site_tags.py
1
1112
from django.template import TemplateSyntaxError from django import template register = template.Library() from zorna.site.models import SiteOptions class check_if_has_access_to_option_node(template.Node): def __init__(self, key, var_name): self.var_name = var_name if not (key[0] == key[-1] and k...
bsd-3-clause
-8,295,376,805,729,403,000
29.054054
73
0.598921
false
3.61039
false
false
false
EricssonResearch/calvin-base
calvin/runtime/south/transports/lib/twisted/base_transport.py
1
4660
# -*- coding: utf-8 -*- # Copyright (c) 2015 Ericsson AB # # 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 ...
apache-2.0
6,143,106,125,151,566,000
35.692913
141
0.600858
false
5.04329
false
false
false
ToonTownInfiniteRepo/ToontownInfinite
toontown/building/DistributedBuildingMgrAI.py
1
9120
from direct.directnotify.DirectNotifyGlobal import * from otp.ai.AIBaseGlobal import * from toontown.building import DistributedBuildingAI from toontown.building import GagshopBuildingAI from toontown.building import HQBuildingAI from toontown.building import KartShopBuildingAI from toontown.building import PetshopBuil...
mit
4,311,047,661,063,541,000
42.428571
101
0.651645
false
4.075067
false
false
false
fernandolobato/balarco
works/serializers.py
1
4427
from rest_framework import serializers from . import models from clients import serializers as client_serializers from users import serializers as user_serializers class WorkTypeSerializer(serializers.ModelSerializer): name = serializers.CharField(read_only=True) class Meta: model = models.WorkType...
mit
-4,358,667,984,826,051,600
31.313869
93
0.635871
false
4.006335
false
false
false
MarsZone/DreamLand
muddery/utils/readers.py
1
3270
""" This module parse data files to lines. """ from __future__ import print_function import csv import codecs try: import xlrd except ImportError: xlrd = None class DataReader(object): """ Game data file reader. """ types = None def __init__(self, filename = None): """ ...
bsd-3-clause
2,917,408,387,520,421,400
19.31677
79
0.486544
false
4.313984
false
false
false
jerkern/nxt_slam
python/sonar.py
1
4434
import numpy as np import math class FOVCone(object): """ Represent a FOV measurment """ def __init__(self, pos, theta, prec, dist): self.xpos = pos[0] self.ypos = pos[1] self.theta = theta self.prec = prec self.dist = dist def __call__(self, y, x, optdata = None):...
gpl-3.0
7,736,525,555,743,298,000
33.107692
95
0.489851
false
3.519048
false
false
false
momijiame/diagram-autobuild
diagram_autobuild/tool.py
1
2493
#!/usr/bin/env python # -*- coding: utf-8 -*- import abc import os from future.utils import with_metaclass class BuildCommand(with_metaclass(abc.ABCMeta)): def __init__(self, src_file, dst_dir, opts=None): self.src_file = src_file self.dst_dir = dst_dir self.opts = opts or '' @abc....
apache-2.0
-557,459,658,530,651,140
19.603306
75
0.610911
false
3.671576
false
false
false
kg-bot/SupyBot
plugins/Izmeri/plugin.py
1
2100
### # Copyright (c) 2013, KG-Bot # All rights reserved. # # ### import supybot.utils as utils from supybot.commands import * import supybot.plugins as plugins import supybot.ircutils as ircutils import supybot.callbacks as callbacks import random import time import re try: from supybot.i18n import PluginInternatio...
gpl-3.0
-2,426,150,339,966,610,000
37.888889
272
0.670952
false
2.830189
false
false
false
tensorflow/models
official/vision/beta/data/process_coco_few_shot_json_files.py
1
6042
# Copyright 2021 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
2,241,717,489,347,854,600
40.958333
111
0.602781
false
3.354803
false
false
false
frePPLe/frePPLe
freppledb/input/admin.py
1
29772
# # Copyright (C) 2007-2020 by frePPLe bv # # This library is free software; you can redistribute it and/or modify it # under the terms of the GNU Affero General Public License as published # by the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This library is d...
agpl-3.0
1,851,207,254,629,476,900
25.300353
102
0.465505
false
4.366036
false
false
false
mabuchilab/Instrumental
instrumental/drivers/util.py
1
14998
# -*- coding: utf-8 -*- # Copyright 2015-2019 Nate Bogdanowicz """ Helpful utilities for writing drivers. """ import copy import contextlib from inspect import getargspec import pint from past.builtins import basestring from . import decorator from .. import Q_, u from ..log import get_logger log = g...
gpl-3.0
-6,475,790,318,701,356,000
34.940887
100
0.55274
false
4.27903
false
false
false
ingadhoc/odoo-infrastructure
infrastructure/wizard/rename_db_wizard.py
1
1333
# -*- coding: utf-8 -*- ############################################################################## # For copyright and license notices, see __openerp__.py file in module root # directory ############################################################################## from openerp import fields, api, models class in...
agpl-3.0
8,406,193,038,402,414,000
34.078947
78
0.562641
false
4.114198
false
false
false
halftk/OpenShareNow
OpenShareNow/OpenShareNow/settings.py
1
2380
""" Django settings for OpenShareNow project. For more information on this file, see https://docs.djangoproject.com/en/1.6/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.6/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, .....
gpl-2.0
-430,860,475,850,630,200
24.319149
85
0.714286
false
3.207547
false
false
false
hgijeon/the_PLAY
Structure/View/SelectScreenView.py
1
5849
from .View import * import os from ..Scene.GameScene import GameScene from tkinter.filedialog import askopenfilename class SelectScreenView(View): def onInit(self): self.red = gameapi.Color(255,0,0) self.fileSelected = False self.background = self.resizeImage(gameapi.image.load(os.path.joi...
mit
6,012,414,013,244,064,000
42.007353
121
0.570525
false
3.392691
false
false
false
chaudum/crate-top
cstat/widgets.py
1
8226
# vi: set encoding=utf-8 # Licensed to CRATE Technology GmbH ("Crate") under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. Crate licenses # this file to you under the Apache License, Version 2.0 (the "License");...
apache-2.0
-6,437,177,651,761,129,000
33.275
86
0.532093
false
3.894886
false
false
false
gennaios/alfred-gnosis
src/playhouse/sqlite_ext.py
1
43137
import json import math import re import struct import sys from peewee import * from peewee import ColumnBase from peewee import EnclosedNodeList from peewee import Entity from peewee import Expression from peewee import Node from peewee import NodeList from peewee import OP from peewee import VirtualField from peewee...
mit
-35,110,409,590,999,170
33.208565
79
0.568236
false
3.958976
false
false
false
arunkgupta/gramps
gramps/gen/utils/file.py
1
9733
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2000-2007 Donald N. Allingham # Copyright (C) 2009 Gary Burton # Copyright (C) 2011 Tim G L Lyons # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published ...
gpl-2.0
5,058,031,207,568,249,000
31.228477
96
0.577109
false
4.152304
false
false
false
e-koch/clean_masks
clean_mask_construct.py
1
13421
import numpy as np import scipy.ndimage as nd from signal_id import RadioMask, Noise from radio_beam import Beam import astropy.units as u from astropy.io import fits from astropy.extern import six import astropy from skimage.morphology import reconstruction ''' Routines for constructing a robust clean mask. 1) Pick...
mit
-5,155,616,146,169,940,000
29.502273
81
0.543402
false
4.08554
false
false
false
filannim/Temporal-Footprint
temporal_footprint/predict.py
1
9133
# -*- coding: utf-8 -*- #!/usr/bin/env python # # Copyright 2014 Michele Filannino # # gnTEAM, School of Computer Science, University of Manchester. # All rights reserved. This program and the accompanying materials # are made available under the terms of the GNU General Public License. # # author: Michele Filannino #...
apache-2.0
-1,198,312,042,371,473,000
41.483721
353
0.688711
false
2.952797
false
false
false
ibelikov/jimmy
jimmy/modules/throttle/tests/test_throttle.py
1
15691
# -*- coding: utf-8 -*- # Copyright 2016 Mirantis, Inc. # # 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) any later version...
apache-2.0
8,527,842,525,457,008,000
43.450425
103
0.548467
false
4.003828
true
false
false
ipittau/ldutil
ldutil.py
1
13182
#!/usr/bin/python # # ldutil helps you to manage library dependencies on a filesystem # # Copyright (C) 2014 Ilario Pittau (ilariopittau[at]gmail[dot]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 Softwa...
gpl-2.0
2,598,428,152,028,018,000
34.723577
144
0.616826
false
3.666759
false
false
false
nlehuby/OSM_snippets
navitia-to-OSM (bus routes)/route_to_html.py
1
6357
#------------------------------------------------------------------------------- # Author: nlehuby # # Created: 28/01/2015 # Copyright: (c) nlehuby 2015 # Licence: MIT #------------------------------------------------------------------------------- #!/usr/bin/env python # -*- coding: utf-8 -*- ...
mit
-1,326,381,942,221,232,000
34.436782
125
0.504732
false
3.379531
false
false
false
spacy-io/spaCy
spacy/tests/test_misc.py
1
11269
import pytest import os import ctypes from pathlib import Path from spacy.about import __version__ as spacy_version from spacy import util from spacy import prefer_gpu, require_gpu, require_cpu from spacy.ml._precomputable_affine import PrecomputableAffine from spacy.ml._precomputable_affine import _backprop_precomputa...
mit
5,117,938,492,506,105,000
31.289398
88
0.59961
false
3.07644
true
false
false
NicoVarg99/daf-recipes
ckan/ckan/ckan/ckan/logic/validators.py
1
27447
# encoding: utf-8 import collections import datetime from itertools import count import re import mimetypes import ckan.lib.navl.dictization_functions as df import ckan.logic as logic import ckan.lib.helpers as h from ckan.model import (MAX_TAG_LENGTH, MIN_TAG_LENGTH, PACKAGE_NAME_MIN_LENGTH, ...
gpl-3.0
4,499,609,140,008,467,000
31.989183
107
0.626407
false
3.886576
false
false
false
narunask/silly_chatbot
rtmbot/app/plugins/chatbot.py
1
1552
#!/usr/bin/env python3 # coding: utf-8 from rtmbot.core import Plugin from chatterbot import ChatBot from plugins.console import Command # Sessions SESS = {} # Init ChatBots BOTS = ['HAL 9000', 'Wall-E', 'Agent Smith'] TRAINER='chatterbot.trainers.ChatterBotCorpusTrainer' BOT_DICT = {B: ChatBot(B, trainer=TRAINER...
mit
2,409,432,908,618,128,000
27.740741
88
0.586985
false
3.448889
false
false
false
jds2001/ocp-checkbox
plugins/jobs_info.py
1
13008
# # This file is part of Checkbox. # # Copyright 2010 Canonical Ltd. # # Checkbox 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. # # C...
gpl-3.0
8,009,267,436,187,903,000
38.180723
79
0.555889
false
4.777084
true
false
false
oniwan/GCI
sele.py
1
1328
from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as ec import time driver = webdriver.PhantomJS() url = "https://lzone.daiwa.co.jp/lzone/common/authorize" username='shinichi...
mit
2,879,929,457,836,766,700
29.883721
81
0.779367
false
3.081206
false
true
false