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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
pedrombmachado/summitxl | simple_follower/scripts/laserTracker.py | 1 | 3097 | #!/usr/bin/env python
# test mail: chutter@uos.de
import rospy
import thread, threading
import time
import numpy as np
from sensor_msgs.msg import Joy, LaserScan
from geometry_msgs.msg import Twist, Vector3
from std_msgs.msg import String as StringMsg
from simple_follower.msg import position as PositionMsg
class la... | gpl-3.0 | 31,351,464,826,698,900 | 35.435294 | 112 | 0.723926 | false | 3.47587 | false | false | false |
jmanday/Informatica | DAI/Practicas/resolucionPracticas_1_2/sesion02/ej_04.py | 1 | 1510 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Practicas de Desarrollo de Aplicaciones para Internet (DAI)
# Copyright (C) 2013 - Zerjillo (zerjioi@ugr.es)
#
# 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 Softwar... | gpl-3.0 | -1,203,772,582,571,132,200 | 32.466667 | 116 | 0.689701 | false | 3.329646 | false | false | false |
andrellsantos/agentspeak-py | agentspeak-py/agent.py | 1 | 13361 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import random
import copy
from agentspeak import *
class Agent:
def __init__(self, name, belief_base, initial_goals, plan_library):
self.name = name
self.__belief_base = belief_base
# Conjunto de planos P
self.__plan_library = plan_li... | gpl-3.0 | 7,225,907,124,630,131,000 | 43.016722 | 112 | 0.573708 | false | 3.852459 | false | false | false |
openhealthcare/randomise.me | rm/trials/migrations/0020_auto__add_field_report_variable__chg_field_report_score.py | 1 | 7439 | # -*- 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 field 'Report.variable'
db.add_column(u'trials_report', 'variable',
self.gf('... | agpl-3.0 | -7,017,855,676,726,162,000 | 61.521008 | 137 | 0.54752 | false | 3.7195 | false | false | false |
agconti/Ember-Demo | ember_demo/users/migrations/0002_set_site_domain_and_name.py | 1 | 4352 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import DataMigration
from django.conf import settings
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
"""Set site domain and name."""
Site = orm['sites.Site']
site = Site.ob... | mit | 6,375,379,218,639,753,000 | 58.630137 | 195 | 0.554917 | false | 3.644891 | false | false | false |
kg-bot/SupyBot | plugins/MilleBornes/config.py | 1 | 2718 | ###
# Copyright (c) 2010, Valentin Lorentz
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditi... | gpl-3.0 | 5,178,330,492,657,698,000 | 45.067797 | 79 | 0.765636 | false | 4.266876 | true | false | false |
tombstone/models | official/vision/detection/dataloader/factory.py | 1 | 4932 | # Copyright 2019 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,585,703,879,675,773,000 | 46.883495 | 80 | 0.70884 | false | 3.6 | false | false | false |
CivicKnowledge/metaeditor | compat/tests/helpers.py | 1 | 1050 | # -*- coding: utf-8 -*-
import fudge
local_cache = {}
def patch_identifier_index(result):
""" Patches ambry search identifier to return given result. """
from ambry.library.search import Search
# convert each dict in the result to the hit expected by searcher.
class MyDict(dict):
pass
... | mit | -950,198,280,900,492,700 | 22.333333 | 70 | 0.598095 | false | 4.038462 | false | false | false |
rastrexando-eu/rastrexando-eu | core/migrations/0060_auto_20180128_1205.py | 1 | 1505 | # Generated by Django 2.0.1 on 2018-01-28 11:05
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0059_config'),
]
operations = [
migrations.AlterField(
model_name='config',
... | gpl-3.0 | -6,761,579,042,721,352,000 | 37.564103 | 183 | 0.621011 | false | 3.886305 | false | false | false |
FedoraScientific/salome-hexablock | doc/test_doc/make_transformation/make_scale.py | 1 | 1308 | # -*- coding: latin-1 -*-
# Copyright (C) 2009-2014 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later ... | lgpl-2.1 | -8,208,037,687,077,105,000 | 28.727273 | 81 | 0.692661 | false | 3.198044 | false | false | false |
openstack/designate | designate/objects/zone_import.py | 1 | 1570 | # Copyright 2015 Rackspace Inc.
#
# Author: Tim Simmons <tim.simmons@rackspace.com>
#
# 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
#
# Unl... | apache-2.0 | -6,399,281,235,386,972,000 | 34.681818 | 75 | 0.689809 | false | 4.056848 | false | false | false |
anish/buildbot | master/buildbot/status/buildrequest.py | 1 | 4850 | # This file is part of Buildbot. Buildbot 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.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | gpl-2.0 | -6,598,749,122,687,935,000 | 30.699346 | 80 | 0.632165 | false | 4.46593 | false | false | false |
rbmj/pyflightcontrol | pyflightcontrol/aircraft/mpl3115a2.py | 1 | 3189 | from smbus import SMBus
from sys import exit
import os
import time
class MPL3115A2(object):
#I2C ADDRESS/BITS
ADDRESS = (0x60)
#REGISTERS
REGISTER_STATUS = (0x00)
REGISTER_STATUS_TDR = 0x02
REGISTER_STATUS_PDR = 0x04
REGISTER_STATUS_PTDR = 0x08
REGISTER_PRESSURE_MSB = (0x01)
... | apache-2.0 | -4,089,819,986,893,017,600 | 26.973684 | 72 | 0.570398 | false | 2.633361 | false | false | false |
ray-project/ray | rllib/examples/env/mbmpo_env.py | 1 | 3338 | from gym.envs.classic_control import PendulumEnv, CartPoleEnv
import numpy as np
# MuJoCo may not be installed.
HalfCheetahEnv = HopperEnv = None
try:
from gym.envs.mujoco import HalfCheetahEnv, HopperEnv
except Exception:
pass
class CartPoleWrapper(CartPoleEnv):
"""Wrapper for the Cartpole-v0 environme... | apache-2.0 | 4,605,161,927,756,585,500 | 31.72549 | 79 | 0.584182 | false | 3.218901 | false | false | false |
EliAndrewC/ensconce | tests/unit/crypto/test_ephemeral.py | 1 | 3398 | import os
import hashlib
from ensconce.crypto import MasterKey, state, util as crypto_util
from ensconce import exc
from tests import BaseModelTest
class EphemeralStateTest(BaseModelTest):
def setUp(self):
super(EphemeralStateTest, self).setUp()
# We need to reset the state
state.se... | bsd-3-clause | 6,698,764,096,634,126,000 | 39.464286 | 106 | 0.628605 | false | 4.195062 | true | false | false |
jkominek/scicasting | hurricanes/firststorm.py | 1 | 2737 | #!/usr/bin/python
from datetime import datetime, date, timedelta
from pymc import *
import numpy as np
dates = [ date(1992, 4, 21),
date(1993, 5, 31),
date(1994, 6, 30),
date(1995, 6, 2),
date(1996, 6, 17),
date(1997, 6, 1),
date(1998, 7, 27),
date... | isc | 4,998,649,028,677,647,000 | 28.117021 | 77 | 0.583851 | false | 2.896296 | false | false | false |
jacobian-archive/python-hdcloud | hdcloud/client.py | 1 | 1893 | import httplib2
import urlparse
import urllib
import hdcloud
from . import exceptions
try:
import json
except ImportError:
import simplejson as json
class HDCloudClient(httplib2.Http):
USER_AGENT = 'python-hdcloud/%s' % hdcloud.__version__
BASE_URL = 'http://hdcloud.com/api/v1/'
def _... | bsd-3-clause | -7,586,979,735,969,499,000 | 32.210526 | 85 | 0.595351 | false | 3.903093 | false | false | false |
licko/vpp-1701-licko | test/test_gre.py | 1 | 23296 | #!/usr/bin/env python
import unittest
from logging import *
from framework import VppTestCase, VppTestRunner
from vpp_sub_interface import VppDot1QSubint
from vpp_gre_interface import VppGreInterface
from vpp_ip_route import IpRoute, RoutePath
from vpp_papi_provider import L2_VTR_OP
from scapy.packet import Raw
from... | apache-2.0 | 656,361,454,378,659,000 | 33.666667 | 78 | 0.455915 | false | 3.634321 | true | false | false |
dessn/sn-bhm | dessn/planck/planck.py | 1 | 1173 | import numpy as np
import inspect
import os
def get_planck(restricted=True):
""" Priors from COM_CosmoParams_fullGrid_R2.00\base_w\plikHM_TT_lowTEB\base_w_plikHM_TT_lowTEB"""
file = os.path.abspath(inspect.stack()[0][1])
dir_name = os.path.dirname(file)
results = np.load(dir_name + "/planck.npy")
... | mit | -8,789,032,739,981,367,000 | 32.514286 | 101 | 0.618926 | false | 3.119681 | false | false | false |
houghb/ligpy | ligpy/ligpy_utils.py | 1 | 18322 | """
Misc utility functions required by several modules in the ligpy program.
"""
import os
import numpy as np
from constants import GAS_CONST, MW
def set_paths():
"""
Set the absolute path to required files on the current machine.
Returns
-------
reactionlist_path : str
... | bsd-2-clause | -1,464,800,841,360,162,300 | 34.439072 | 79 | 0.569643 | false | 4.337595 | false | false | false |
simphony/simphony-mayavi | simphony_mayavi/cuds/tests/test_vtk_lattice.py | 1 | 9617 | import unittest
from functools import partial
from numpy.testing import assert_array_equal
from hypothesis import given
from hypothesis.strategies import sampled_from
from tvtk.api import tvtk
from simphony.core.cuba import CUBA
from simphony.testing.abc_check_lattice import (
CheckLatticeNodeOperations, CheckLat... | bsd-2-clause | -8,452,465,650,325,802,000 | 37.468 | 76 | 0.580638 | false | 3.464337 | true | false | false |
whiskeylover/idreamoftoast | toast/app.py | 1 | 6684 | import datetime
import json
from urllib.parse import unquote
from urllib.request import urlopen
from flask import jsonify, Response
from peewee import CharField, DateTimeField, IntegerField, Model
import config
#-------------------------------------------------------------------------------
# Constants
#------------... | apache-2.0 | 3,691,948,276,489,078,300 | 33.8125 | 159 | 0.529473 | false | 3.597417 | false | false | false |
gonicus/gosa | common/src/gosa/common/network.py | 1 | 3494 | # 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.
import dbus
from gosa.common.components.dbus_runner import DBusRunner
from logging import getLogger
... | lgpl-2.1 | -8,663,401,339,332,908,000 | 31.962264 | 139 | 0.603892 | false | 3.997712 | false | false | false |
yephper/django | django/contrib/gis/geos/prototypes/predicates.py | 1 | 1630 | """
This module houses the GEOS ctypes prototype functions for the
unary and binary predicate operations on geometries.
"""
from ctypes import c_char, c_char_p, c_double
from django.contrib.gis.geos.libgeos import GEOM_PTR, GEOSFuncFactory
from django.contrib.gis.geos.prototypes.errcheck import check_predicat... | bsd-3-clause | -4,548,278,871,508,046,000 | 35.906977 | 98 | 0.752761 | false | 3.551198 | false | false | false |
DavidWhittingham/agsadmin | agsadmin/sharing_admin/community/groups/Group.py | 1 | 1457 | from __future__ import (absolute_import, division, print_function, unicode_literals)
from builtins import (ascii, bytes, chr, dict, filter, hex, input, int, map, next, oct, open, pow, range, round, str,
super, zip)
from ...._utils import send_session_request
from ..._PortalEndpointBase import Por... | bsd-3-clause | 7,639,082,891,741,181,000 | 32.906977 | 117 | 0.643102 | false | 3.937838 | false | false | false |
segfaulthunter/asynchia | benchmark/ee_parse.py | 1 | 2223 | # -*- coding: us-ascii -*-
# asynchia - asynchronous networking library
# Copyright (C) 2009 Florian Mayer <florian.mayer@bitsrc.org>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, eit... | gpl-3.0 | -3,150,133,316,793,390,600 | 26.7875 | 77 | 0.662618 | false | 3.5625 | false | false | false |
mrosenstihl/PulsePrograms | autoPFGStimulatedEcho_const_T1/analyse.py | 1 | 2319 | import re, os,sys
import numpy as N
from tables import *
import scipy.odr
import pylab as P
conv = 6.36e-5
gamma = 2.67522e8
start = 50
stop = 250
def diffusion(p,x):
sig = N.exp(-p[0]*x)+p[1]
return sig
hdf = openFile(sys.argv[1])
temperature_runs = [run for run in hdf.root.data_pool if run._v_name.startswith(... | bsd-2-clause | -8,492,228,953,505,733,000 | 24.483516 | 88 | 0.626994 | false | 2.373593 | false | false | false |
emrecimen/CIOL-ICF | ICF_Training_Test.py | 1 | 8182 |
# This file is the implementation of the algorithm 1 and includes the main function
# One can use this file if the training and test files are separated.
# Inputs can be tuned in the corresponding area
# The accuracy rates and all function parameters are printed to the console as output
# Dataset can be in csv or arff... | mit | -6,865,739,474,599,376,000 | 26.641892 | 185 | 0.558788 | false | 2.923187 | true | false | false |
jesseklein406/django-imager | imagersite/imager_images/migrations/0004_auto_20150728_1555.py | 1 | 1063 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('imager_images', '0003_auto_20150726_1224'),
]
operations = [
migrations.AlterField(
model_name='album',
... | mit | -1,288,981,641,645,240,300 | 26.25641 | 63 | 0.543744 | false | 4.504237 | false | false | false |
dchirikov/luna | contrib/ansible/modules/clustering/luna_bmcsetup.py | 1 | 2793 | #!/usr/bin/python
from ansible.module_utils.basic import AnsibleModule
from ansible.errors import AnsibleError
try:
import luna
except ImportError:
raise AnsibleError("luna is not installed")
from luna_ansible.helpers import StreamStringLogger
import logging
if luna.__version__ != '1.2':
raise AnsibleEr... | gpl-3.0 | -39,312,346,139,698,100 | 26.653465 | 79 | 0.557465 | false | 3.784553 | false | false | false |
95subodh/Leetcode | 376. Wiggle Subsequence.py | 1 | 1580 | #A sequence of numbers is called a wiggle sequence if the differences between successive numbers strictly alternate between positive and negative. The first difference (if one exists) may be either positive or negative. A sequence with fewer than two elements is trivially a wiggle sequence.
#
#For example, [1,7,4,9,2,5... | mit | 877,606,916,788,035,800 | 46.909091 | 301 | 0.724684 | false | 3.204868 | false | false | false |
a4a881d4/fs45g | fs45g/fs45gstat.py | 1 | 1031 | import fuse
class fs45gStat(fuse.Stat):
def __init__(self):
self.st_mode = 0
self.st_ino = 0
self.st_dev = 0
self.st_nlink = 0
self.st_uid = 0
self.st_gid = 0
self.st_size = 0
self.st_atime = 0
self.st_mtime = 0
self.st_ctime = 0
class fs45gROStat(fs45gStat):
def __init__(self, clone, uid, gid):... | apache-2.0 | -6,573,624,865,860,555,000 | 31.21875 | 63 | 0.659554 | false | 2.58396 | false | false | false |
dAck2cC2/m3e | build_legacy/tools/findleaves.py | 1 | 3628 | #!/usr/bin/env python
#
# Copyright (C) 2009 The Android Open Source Project
#
# 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 req... | apache-2.0 | 5,406,521,903,935,846,000 | 27.566929 | 82 | 0.595645 | false | 3.617149 | false | false | false |
NicovincX2/Python-3.5 | Statistiques/Estimation (statistique)/Régression/bay_ridge_OLS.py | 1 | 2049 | # -*- coding: utf-8 -*-
import os
import numpy as np
import matplotlib.pyplot as plt
from scipy import stats
from sklearn.linear_model import BayesianRidge, LinearRegression
###############################################################################
# Generating simulated data with Gaussian weigthts
np.random.se... | gpl-3.0 | 3,795,073,158,633,134,000 | 31.52381 | 79 | 0.63348 | false | 3.359016 | false | false | false |
variablehair/Eggplantato | discord/ext/commands/bot.py | 1 | 26536 | # -*- coding: utf-8 -*-
"""
The MIT License (MIT)
Copyright (c) 2015-2017 Rapptz
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to u... | mit | -222,379,513,342,976,670 | 32.17 | 123 | 0.599525 | false | 4.544614 | false | false | false |
DOAJ/doaj | doajtest/unit/test_upgrade.py | 1 | 2252 | import json
import time
import re
from collections import OrderedDict
from doajtest.helpers import DoajTestCase
from portality import models
from portality.upgrade import do_upgrade
from portality.lib.paths import rel2abs
def operation(journal):
j = models.Journal.pull(journal.id)
bj = j.bibjson()
bj.titl... | apache-2.0 | 5,705,412,087,984,378,000 | 27.506329 | 85 | 0.567496 | false | 3.48068 | true | false | false |
ESOedX/edx-platform | openedx/core/djangoapps/schedules/management/commands/tests/test_send_course_update.py | 1 | 4396 | """
Tests for send_course_update management command.
"""
from __future__ import absolute_import
from unittest import skipUnless
import ddt
from django.conf import settings
from edx_ace.utils.date import serialize
from mock import patch
from six.moves import range
from openedx.core.djangoapps.schedules import resolve... | agpl-3.0 | -5,302,609,191,891,175,000 | 42.96 | 126 | 0.734531 | false | 3.835951 | true | false | false |
PetroWu/AutoPortraitMatting | portrait.py | 1 | 8570 | import numpy as np
import scipy.io as sio
import os
from PIL import Image
class BatchDatset:
imgs = []
max_batch = 0
batch_size = 0
cur_imgs = []
cur_labels = []
cur_batch = 0 # index of batch generated
cur_ind = 0 # index of current image in imgs
img_width = 600
img_height = 800
... | apache-2.0 | 5,070,734,809,259,799,000 | 42.72449 | 149 | 0.502684 | false | 3.046569 | false | false | false |
query/mt-submissions | hw2-decoding/decode.py | 1 | 7691 | #!/usr/bin/env python
"""A translation decoder."""
from collections import defaultdict, namedtuple
import models
Hypothesis = namedtuple('Hypothesis',
['logprob', 'future_cost', 'coverage',
'lm_state', 'predecessor', 'candidate'])
def decode(tm, lm, source_sentence... | mit | -7,950,587,443,624,482,000 | 45.896341 | 76 | 0.52854 | false | 4.718405 | false | false | false |
paolodoz/timesheet | embedded/modwsgi.py | 1 | 1518 | #!/usr/bin/env python
import cherrypy, logging
import sys, os
# Suppose this file in
installation_path = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir))
sys.path.insert(0, installation_path)
from core.routes.routes import Routes
from core.config import conf_server, conf_static, conf_logging
def... | gpl-2.0 | -6,801,214,810,711,781,000 | 35.142857 | 100 | 0.732543 | false | 3.411236 | false | false | false |
dwaiter/django-filebrowser-old | filebrowser/views.py | 1 | 19478 | # coding: utf-8
# general imports
import itertools, os, re
from time import gmtime, strftime
# django imports
from django.shortcuts import render_to_response, HttpResponse
from django.template import RequestContext as Context
from django.http import HttpResponseRedirect
from django.contrib.admin.views.decorators impo... | bsd-3-clause | -3,435,572,908,903,204,000 | 38.509128 | 186 | 0.599446 | false | 3.960553 | false | false | false |
KSchopmeyer/smipyping | tests/test_logging.py | 1 | 3914 | #!/usr/bin/env python
# (C) Copyright 2017 Inova Development Inc.
# All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# ... | mit | 7,747,978,183,615,586,000 | 31.616667 | 77 | 0.619315 | false | 4.077083 | true | false | false |
onepercentclub/onepercentclub-site | apps/vouchers/models.py | 1 | 4574 | import random
from django.conf import settings
from django.db import models
from django.utils.translation import ugettext as _
from django_extensions.db.fields import ModificationDateTimeField, CreationDateTimeField
from djchoices import DjangoChoices, ChoiceItem
from .mails import mail_new_voucher
class VoucherStatu... | bsd-3-clause | 1,365,753,965,112,462,600 | 46.645833 | 146 | 0.691517 | false | 4.005254 | false | false | false |
ushatil/wellness-tracker | ws/wellspring/services/vest_service.py | 1 | 1420 | import logging
from wellspring.models import VestSection, VestSubSection
LOGGER = logging.getLogger(__name__)
VEST_SECTIONS = {
"EQUILIBRIUM" : ["SCHOOL", "SELF", "HOME", "WORK"],
"SUPPORT" : ["PROFESSIONALS", "FAMILY", "FRIENDS", "COLLEAGUES"],
"LIFESTYLE" ... | mit | 4,386,219,538,674,025,000 | 35.435897 | 87 | 0.671831 | false | 3.356974 | false | false | false |
frdwrd/bifocal | bifocal/models/transaction.py | 1 | 3366 | # Copyright (c) 2013-2015, Vehbi Sinan Tunalioglu <vst@vsthost.com>
#
# 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 retain the above copyright
# noti... | agpl-3.0 | 6,468,546,355,782,887,000 | 32.326733 | 77 | 0.645276 | false | 4.354463 | false | false | false |
ntim/g4sipm | sample/run/luigi/contrib/afterpulse.py | 1 | 3367 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
from ROOT import TH1, Double, ROOT, TF1
def prob_dist_1comp(x, par):
dt = x[0]
amp = par[0]
pL = par[1]
tauL = par[2]
tauTh = par[3]
T = np.exp(-dt / tauTh)
L = np.exp(-dt / tauL)
pTot = 0
pTot += T * (1. - pL) / tauTh... | gpl-3.0 | -5,261,657,332,472,781,000 | 40.567901 | 153 | 0.610039 | false | 2.457664 | false | false | false |
cedadev/cloudhands-burst | cloudhands/burst/agent.py | 1 | 2328 | #!/usr/bin/env python
# encoding: UTF-8
import asyncio
from collections import namedtuple
try:
from functools import singledispatch
except ImportError:
from singledispatch import singledispatch
import logging
import sqlite3
import warnings
from cloudhands.common.connectors import initialise
from cloudhands.c... | bsd-3-clause | -3,134,247,760,245,154,000 | 27.048193 | 75 | 0.60567 | false | 4.36773 | false | false | false |
orlenko/bccf | src/django_cron/timezone.py | 1 | 8256 | """Timezone helper functions.
This module uses pytz when it's available and fallbacks when it isn't.
"""
from datetime import datetime, timedelta, tzinfo
from threading import local
import time as _time
try:
import pytz
except ImportError:
pytz = None
from django.conf import settings
__all__ = [
'utc',... | unlicense | 6,542,756,796,065,424,000 | 27.277397 | 81 | 0.645833 | false | 4.057002 | false | false | false |
asphalt-framework/asphalt-web | asphalt/web/rpc/xmlrpc/serialization.py | 1 | 4239 | import math
from base64 import b64encode, b64decode
from collections import OrderedDict
from collections.abc import Sequence, Mapping
from datetime import date, datetime
from typing import List, Dict, Any
from xml.sax.saxutils import escape
from asphalt.core.utils import qualified_name
from lxml.etree import Element
... | apache-2.0 | 5,541,318,617,819,902,000 | 25.166667 | 94 | 0.671621 | false | 3.635506 | false | false | false |
packagecontrol/st_package_reviewer | st_package_reviewer/check/file/check_redundant_files.py | 2 | 1795 | import logging
from . import FileChecker
l = logging.getLogger(__name__)
class CheckPackageMetadata(FileChecker):
def check(self):
if self.sub_path("package-metadata.json").is_file():
self.fail("'package-metadata.json' is supposed to be automatically generated "
"by Pa... | mit | 7,026,769,167,104,673,000 | 27.492063 | 99 | 0.597214 | false | 4.356796 | false | false | false |
HazyResearch/dd-genomics | archived/v1/code/gene_pheno_pairs.py | 1 | 2378 | import ddext
from ddext import SD
def init():
ddext.input('doc_id', 'text')
ddext.input('sent_id_1', 'int')
ddext.input('mention_id_1', 'text')
ddext.input('wordidxs_1', 'int[]')
ddext.input('words_1', 'text[]')
ddext.input('entity_1', 'text')
ddext.input('type_1', 'text')
ddext.input('correct_1', 'bo... | apache-2.0 | -2,130,952,374,785,913,000 | 29.101266 | 168 | 0.584945 | false | 2.535181 | false | false | false |
dgouldin/djangocon-eu-2015 | djapi/api/url_registry.py | 2 | 2925 | import types
from collections import defaultdict
from functools import wraps
from urlparse import urljoin
from django.contrib.contenttypes.models import ContentType
from django.core.urlresolvers import reverse, NoReverseMatch
LIST_METHODS = ('POST',)
DETAIL_METHODS = ('PUT', 'PATCH', 'DELETE',)
ALL_METHODS = LIST_ME... | mit | -4,767,235,335,549,177,000 | 30.451613 | 88 | 0.681709 | false | 3.889628 | false | false | false |
jarod-w/ocsetup | ocsetup/sshcmd.py | 1 | 1977 | #!/usr/bin/env python
import pexpect
import sys
import gtk
from ovirtnode.ovirtfunctions import log
class PopupEntry(gtk.Dialog):
def __init__(self, label="", title="", parent=None, flags=0, buttons=None):
super(PopupEntry, self).__init__(title, parent, flags, buttons)
self.hbox = gtk.HBox()
... | gpl-2.0 | -8,240,140,385,106,602,000 | 28.954545 | 79 | 0.528073 | false | 3.96988 | false | false | false |
PyBossa/pybossa | test/test_s3_client.py | 1 | 5554 | # -*- coding: utf8 -*-
# This file is part of PYBOSSA.
#
# Copyright (C) 2015 Scifabric LTD.
#
# PYBOSSA 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 op... | agpl-3.0 | -8,953,775,506,088,436,000 | 37.041096 | 105 | 0.620274 | false | 3.413645 | true | false | false |
LastAvenger/labots | labots/config/config.py | 1 | 3322 | import logging
import yaml
from typing import Dict
from labots.config import checker
from labots.common import meta
# Initialize logging
logger = logging.getLogger(__name__)
class AttrDict(dict):
def __init__(self, *args, **kwargs):
super(AttrDict, self).__init__(*args, **kwargs)
self.__dict__ = ... | gpl-3.0 | 1,553,425,372,541,772,800 | 34.340426 | 70 | 0.491872 | false | 3.968937 | true | false | false |
gemrb/iesh | infinity/formats/gam_v22.py | 1 | 31222 | # -*-python-*-
# ie_shell.py - Simple shell for Infinity Engine-based game files
# Copyright (C) 2004-2009 by Jaroslav Benkovsky, <edheldil@users.sf.net>
#
# 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 Fo... | gpl-2.0 | 2,371,619,244,215,804,400 | 28.877512 | 123 | 0.394818 | false | 3.612403 | false | false | false |
jmcallister47/trailcam | night/motion-camera.py | 1 | 1673 | #!/usr/bin/env python
'''Script that manages motion sensor, camera module and light
When motion is detected, turn on infrared light, take and save picture, turn off light
Maximum of one picture every 4 seconds'''
from gpiozero import MotionSensor
import subprocess
from datetime import datetime
from time import sl... | gpl-3.0 | -4,917,927,044,453,764,000 | 31.803922 | 104 | 0.608488 | false | 3.492693 | false | false | false |
kaochiuan/HsinchuCityWebsite | HsinchuCityWebsite/HsinchuCityWebsite/app/views.py | 1 | 19767 | """
Definition of views.
"""
from django.shortcuts import render
from django.http import HttpResponse
from django.http import HttpRequest
from django.template import RequestContext
from datetime import datetime
from datetime import date
from django.http.response import HttpResponse
import urllib.request
import json
i... | mit | 9,109,989,609,018,349,000 | 41.778022 | 173 | 0.602631 | false | 3.752989 | false | false | false |
Azure/azure-sdk-for-python | sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/entity_record.py | 1 | 2689 | # 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 | 6,033,418,252,891,552,000 | 39.134328 | 78 | 0.612495 | false | 4.043609 | false | false | false |
poondog/kangaroo-m7-mkv | scripts/gcc-wrapper.py | 1 | 3884 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2011-2012, Code Aurora Forum. 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 a... | gpl-2.0 | 3,073,904,154,896,566,300 | 32.482759 | 97 | 0.664779 | false | 3.770874 | false | false | false |
cemagg/sucem-fem | sandbox/flux_calc/plotty.py | 1 | 1219 | from __future__ import division
import pylab
import numpy as np
import run_data
reload(run_data)
def get_unit_gradients(resdict, ind=0, op=lambda x: x):
return dict((k, np.gradient(op(v[ind])))
for k,v in resdict.iteritems())
def get_gradients(resdict, op1=lambda x: x, op2=lambda x: x):
retur... | gpl-3.0 | 247,746,161,481,558,900 | 32.861111 | 68 | 0.647252 | false | 2.661572 | false | false | false |
astrilchuk/sd2xmltv | libschedulesdirect/common/servicecountry.py | 1 | 1174 | import logging
class ServiceCountry(object):
def __init__(self):
self.full_name = None # type: unicode
self.short_name = None # type: unicode
self.postal_code_example = None # type: unicode
self.postal_code_regex = None # type: unicode
self.one_postal_code = False ... | mit | 825,535,162,735,604,700 | 26.302326 | 94 | 0.580068 | false | 3.811688 | false | false | false |
glomex/gcdt-lookups | setup.py | 1 | 1606 | from setuptools import setup, find_packages
from codecs import open
import os
here = os.path.abspath(os.path.dirname(__file__))
# Get the long description from the README file
try:
import pypandoc
long_description = pypandoc.convert('README.md', format='md', to='rst')
except(IOError, ImportError):
with op... | mit | -4,124,764,179,536,673,000 | 31.12 | 87 | 0.627024 | false | 3.600897 | false | false | false |
bdzimmer/handwriting | handwriting/verify.py | 1 | 13242 | # -*- coding: utf-8 -*-
"""
Interactively verify predictions from algorithms so they can be used as ground
truth for evaluation or training.
"""
# Copyright (c) 2017 Ben Zimmer. All rights reserved.
# New process that uses mutable tree of Samples.
import os
import sys
import cv2
import numpy as np
from handwrit... | bsd-3-clause | 6,504,261,244,183,423,000 | 37.606414 | 100 | 0.576801 | false | 4.040891 | true | false | false |
heckj/redisco | redisco/models/attributes.py | 1 | 15052 | # -*- coding: utf-8 -*-
"""
Defines the fields that can be added to redisco models.
"""
import sys
from datetime import datetime, date
from dateutil.tz import tzutc, tzlocal
from calendar import timegm
from redisco.containers import List
from exceptions import FieldValidationError, MissingID
__all__ = ['Attribute', 'C... | mit | -8,004,247,094,733,032,000 | 30.48954 | 76 | 0.554411 | false | 4.450621 | false | false | false |
kayhayen/Nuitka | nuitka/nodes/NodeBases.py | 1 | 35111 | # Copyright 2021, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on its own.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in complianc... | apache-2.0 | 8,789,145,488,713,669,000 | 28.308013 | 88 | 0.594856 | false | 4.418701 | false | false | false |
ThomasBollmeier/GObjectCreator3 | src/gobjcreator3/codegen/c_code_generator.py | 1 | 29821 | from gobjcreator3.codegen.code_generator import CodeGenerator
from gobjcreator3.codegen.output import StdOut
from gobjcreator3.codegen.name_creator import NameCreator
from gobjcreator3.codegen.c_marshaller_generator import CMarshallerGenerator, CMarshallerNameCreator
from gobjcreator3.model.type import Type
from gobjcr... | apache-2.0 | 763,292,699,945,116,500 | 36.464824 | 127 | 0.539653 | false | 4.250428 | true | false | false |
klahnakoski/MySQL-to-S3 | mysql_to_s3/__init__.py | 1 | 1965 | # encoding: utf-8
#
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Author: Kyle Lahnakoski (kyle@lahnakoski.com)
#
from __future__ import absolute_import
from __... | mpl-2.0 | 562,157,114,475,749,760 | 21.586207 | 75 | 0.553181 | false | 3.094488 | false | false | false |
gamnor/olhoneles | montanha/migrations/0007_auto__add_pernaturebyyear__add_pernature.py | 1 | 10393 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as 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 'PerNatureByYear'
db.create_table(u'montanha_pernaturebyye... | agpl-3.0 | -336,951,130,467,373,200 | 68.293333 | 151 | 0.560185 | false | 3.423254 | false | false | false |
roccoma504/reddit_wallpaper | reddit_mac_wallpaper.py | 1 | 1030 | #!/usr/bin/python
# This script changes the wallpaper of the current OSX desktop. It will change the wallpaper of the desktop on each screen but not each desktop.
from AppKit import NSWorkspace, NSScreen
from Foundation import NSURL
import os
import praw
import urllib
# Define the reddit object.
r = praw.Reddit(user... | mit | 7,633,890,986,158,433,000 | 33.366667 | 144 | 0.74466 | false | 3.322581 | false | false | false |
mulkieran/pyblk | tests/test_utils.py | 1 | 1744 | # -*- coding: utf-8 -*-
# Copyright (C) 2015 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is distributed in th... | gpl-2.0 | -5,400,782,520,455,736,000 | 32.538462 | 77 | 0.706995 | false | 3.945701 | true | false | false |
eljost/pysisyphus | deprecated/optimizers/BFGS.py | 1 | 4901 | #!/usr/bin/env python3
import matplotlib.pyplot as plt
import numpy as np
from pysisyphus.helpers import fit_rigid, procrustes
from pysisyphus.optimizers.BacktrackingOptimizer import BacktrackingOptimizer
# [1] Nocedal, Wright - Numerical Optimization, 2006
class BFGS(BacktrackingOptimizer):
def __init__(self,... | gpl-3.0 | -1,036,933,543,861,177,100 | 39.504132 | 86 | 0.550296 | false | 3.758436 | false | false | false |
ArcherSys/ArcherSys | Lib/genericpath.py | 1 | 3883 |
"""
Path operations common to more than one OS
Do not use directly. The OS specific modules import the appropriate
functions from this module themselves.
"""
import os
import stat
__all__ = ['commonprefix', 'exists', 'getatime', 'getctime', 'getmtime',
'getsize', 'isdir', 'isfile', 'samefile', 'sameopenfi... | mit | -4,081,050,003,796,660,000 | 28.195489 | 78 | 0.661087 | false | 3.698095 | false | false | false |
chill17/pycounter | pycounter/constants.py | 1 | 6177 | """Constants used by pycounter."""
NS = {
'SOAP-ENV': "http://schemas.xmlsoap.org/soap/envelope/",
'sushi': "http://www.niso.org/schemas/sushi",
'sushicounter': "http://www.niso.org/schemas/sushi/counter",
'counter': "http://www.niso.org/schemas/counter",
}
METRICS = {
u"JR1": u"FT Article Req... | mit | -3,423,670,937,387,437,600 | 32.754098 | 79 | 0.583293 | false | 3.531732 | false | false | false |
smwahl/PlLayer | outline.py | 1 | 8657 | import numpy as np
import scipy as sp
import matplotlib.pyplot as plt
import matplotlib
from copy import deepcopy
class planet
''' Represents a snapshot of an evoloving planet, with methods
for comparing different snapshots and relating thermal evolution to
time.'''
def __init__(self, params=None, ... | mit | -6,883,647,413,842,892,000 | 32.296154 | 104 | 0.621116 | false | 4.178089 | false | false | false |
slush0/epycyzm | morpavsolver/__init__.py | 1 | 3468 | # https://github.com/morpav/zceq_solver--bin
from cffi import FFI
import os.path
import inspect
ffi = None
library = None
library_header = """
typedef struct {
char data[1344];
} Solution;
typedef struct {
unsigned int data[512];
} ExpandedSolution;
typedef struct HeaderAndNonce {
char data[140];
} HeaderAnd... | mit | 957,639,449,207,624,700 | 28.896552 | 93 | 0.654268 | false | 3.729032 | false | false | false |
adobe-type-tools/fontlab-scripts | TrueType/convertToTTF.py | 1 | 28980 | #FLM: Convert PFA/UFO/TXT to TTF/VFB
# coding: utf-8
__copyright__ = __license__ = """
Copyright (c) 2015-2016 Adobe Systems Incorporated. All rights reserved.
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 ... | mit | -4,984,340,435,244,985,000 | 34.212637 | 131 | 0.621636 | false | 3.592859 | false | false | false |
RetroView/hecl | blender/hecl/frme.py | 3 | 21197 | import bpy, struct, math
from mathutils import Quaternion
def draw(layout, context):
if bpy.context.active_object:
obj = bpy.context.active_object
layout.label(text="Widget Settings:", icon='OBJECT_DATA')
layout.prop_menu_enum(obj, 'retro_widget_type', text='Widget Type')
#layout.pr... | mit | -7,502,796,951,139,289,000 | 53.212276 | 169 | 0.586168 | false | 3.407878 | false | false | false |
lanacioncom/elecciones_2015_caba | backend/scripts/apitransforms.py | 1 | 8671 | # coding: utf-8
import logging
# TODO Remove only for testing
import json
import io
from utils import get_percentage, format_percentage, sort_results_by_percentage
from config import JSON_EXAMPLE_PATH, SPECIAL_PARTIES, PASS_THRESHOLD
from config import Paso2015
log = logging.getLogger('paso.%s' % (__name__))
PERC_KEYS... | mit | 3,808,144,704,324,429,300 | 34.235772 | 79 | 0.524919 | false | 3.675997 | false | false | false |
eaudeweb/lcc-toolkit | lcc/tests/answer.py | 1 | 6176 | import json
from django.contrib.auth.models import User
from django.urls import reverse
from rest_framework import status
from rest_framework.test import APITestCase
from lcc.models import (
Answer, Assessment, Country, Question
)
from lcc.serializers import AnswerSerializer
from lcc.tests.taxonomy import create_... | gpl-3.0 | 359,729,923,295,122,600 | 37.842767 | 78 | 0.628886 | false | 3.981947 | true | false | false |
rwl/PyCIM | CIM14/IEC61970/Dynamics/PowerSystemStabilizers/PssIEEE2B.py | 1 | 7134 | # Copyright (C) 2010-2011 Richard Lincoln
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish... | mit | -6,638,819,848,225,770,000 | 42.766871 | 448 | 0.614943 | false | 3.162234 | false | false | false |
nathanielksmith/done | done/Tasks.py | 1 | 2607 | # who nate smith
# when march 2010
# why the done tool
# where midwest usa
import sys
from time import mktime, time
from datetime import datetime
import sqlite3
from termcolor import colored
import sql_interp.sql_interp as si
from Config import db_path
class Task:
def __init__(self, desc, due):
self.... | gpl-3.0 | -1,143,508,511,663,373,800 | 23.59434 | 73 | 0.519371 | false | 3.666667 | false | false | false |
neil92/MiscScripts2 | replace_every_xth_line.py | 1 | 1281 | #!/usr/local/miniconda3/bin/python
def setupArguments():
"""
This is the function that sets up the flags and the arguements you can pass to the script.
:author: Neil A. Patel
"""
aParser = argparse.ArgumentParser("Setup the arguments.")
aparser.add_argument('-f', '--file', action='store', dest='file_targe... | mit | -5,675,658,794,333,368,000 | 39.03125 | 105 | 0.674473 | false | 3.713043 | false | false | false |
bertnotbob/django-property | config/settings/base.py | 1 | 4530 | import dj_database_url, os
from django.core.exceptions import ImproperlyConfigured
def get_env_variable(var_name):
try:
return os.environ[var_name]
except:
error_msg = 'Set the {} environment variable'.format(var_name)
raise ImproperlyConfigured(error_msg)
# Paths
BASE_DIR = os.path... | mit | 5,718,639,544,731,947,000 | 25.343023 | 99 | 0.641501 | false | 3.498069 | true | false | false |
pydata/xarray | xarray/tests/test_utils.py | 1 | 10440 | from datetime import datetime
from typing import Hashable
import numpy as np
import pandas as pd
import pytest
from xarray.coding.cftimeindex import CFTimeIndex
from xarray.core import duck_array_ops, utils
from xarray.core.indexes import PandasIndex
from xarray.core.utils import either_dict_or_kwargs, iterate_nested... | apache-2.0 | 7,916,387,651,723,424,000 | 30.164179 | 88 | 0.582759 | false | 3.128559 | true | false | false |
tingcar/PSEP | src/PSEP/settings.py | 1 | 3680 | """
Django settings for PSEP 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, ...)
impor... | apache-2.0 | -5,925,759,729,754,591,000 | 22.144654 | 110 | 0.701087 | false | 3.279857 | false | false | false |
TakLee96/discriminant | train.py | 1 | 2430 | import numpy as np
from os import path
from scipy.io import loadmat
from timer import timer
from classifier import LDAClassifier, QDAClassifier
""" TODO: choose either mnist or spam >>HERE<< """
which = "spam.mat"
which = "mnist.mat"
""" TODO: choose either mnist or spam >>HERE<< """
timer.start("reading", which, "... | mit | -644,527,991,301,725,700 | 33.714286 | 103 | 0.634979 | false | 3.164063 | false | false | false |
marcoscrcamargo/ic | results.py | 1 | 2191 | import csv
import time
fieldnames = ['class', 'knn_hst', 'hst_pxl', 'mlp_hst', 'mlp_pxl', 'svm_hst', 'svm_pxl', 'ensemble_hst', 'ensemble_pxl', 'ensemble_all']
writer = None
file = 'results_' + str(time.ctime()) +'.csv'
def initializate(fname=file):
global writer
global file
file = fname
with open(fname, 'w') as... | gpl-3.0 | 6,560,752,996,770,302,000 | 41.980392 | 136 | 0.524418 | false | 2.633413 | false | false | false |
lisogallo/odoo-it-infra | it_infrastructure/server_repository.py | 1 | 2915 | # -*- coding: utf-8 -*-
from openerp import models, fields, api, _
from openerp.exceptions import except_orm
from fabric.api import cd, sudo, settings
from fabric.contrib.files import exists
import os
class server_repository(models.Model):
""""""
_name = 'it_infrastructure.server_repository'
_descriptio... | agpl-3.0 | -4,230,107,899,597,576,000 | 31.032967 | 74 | 0.50223 | false | 4.31213 | false | false | false |
FabianWe/csd-freiburg-forms | csd_freiburg_forms/donate_o_meter/donate_o_meter.py | 1 | 2011 | # Copyright (C) 2016 Fabian Wenzelmann
#
# This file is part of csd-freiburg-forms.
#
# csd-freiburg-forms 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)... | gpl-3.0 | -3,033,785,776,946,643,500 | 33.672414 | 79 | 0.632521 | false | 3.744879 | false | false | false |
maximilianofaccone/puppy-siberian | usr/share/bleachbit/Common.py | 1 | 7633 | # vim: ts=4:sw=4:expandtab
# -*- coding: UTF-8 -*-
# BleachBit
# Copyright (C) 2014 Andrew Ziem
# http://bleachbit.sourceforge.net
#
# 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 versi... | gpl-3.0 | 3,201,493,757,747,861,000 | 29.898785 | 91 | 0.666798 | false | 3.414765 | false | false | false |
lucabaldini/rating02 | dump_rating.py | 1 | 7983 | #!/usr/bin/env python
#
# Copyright (C) 2019, Luca Baldini.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This p... | gpl-3.0 | 4,332,046,184,173,600,300 | 41.68984 | 80 | 0.591131 | false | 3.555902 | false | false | false |
ademariag/kapitan | kapitan/refs/secrets/vaultkv.py | 2 | 9041 | # Copyright 2019 The Kapitan Authors
# SPDX-FileCopyrightText: 2020 The Kapitan Authors <kapitan-admins@googlegroups.com>
#
# SPDX-License-Identifier: Apache-2.0
"hashicorp vault kv secrets module"
import base64
import logging
import os
from binascii import Error as b_error
from sys import exit
from kapitan import c... | apache-2.0 | 3,772,391,026,941,438,000 | 38.480349 | 128 | 0.619843 | false | 3.937718 | false | false | false |
zenieldanaku/pygpj | func/core/viz.py | 1 | 6108 | # coding=UTF-8
# Viz.py
import os
from math import ceil
from func.core.lang import t, probar_input
def PrepPrint(lista):
imp = ''
lineas = []
for elemento in lista:
imp += str(elemento)+', '
if len(imp) > 75:
lineas.append(imp)
imp = ''
... | mit | 1,342,281,639,521,813,200 | 32.659091 | 103 | 0.430984 | false | 3.290183 | false | false | false |
vivaxy/algorithms | python/problems/most_common_word.py | 1 | 1131 | """
https://leetcode.com/problems/most-common-word/
https://leetcode.com/submissions/detail/150204402/
"""
class Solution:
def mostCommonWord(self, paragraph, banned):
"""
:type paragraph: str
:type banned: List[str]
:rtype: str
"""
wordAcc = dict()
for wor... | mit | -3,210,401,791,503,412,000 | 24.704545 | 152 | 0.505747 | false | 4.097826 | true | false | false |
hanxi/pyfm | pyfm.py | 1 | 2766 | #!/usr/bin/python
# coding: utf-8
import sys
import os
import threading
import time
import random
import json
import signal
import gst
# 基础类
class MusicBase:
def __init__(self):
self.app_name = 'console_fm'
self.appPath = os.path.realpath(sys.path[0])
jsonStr = open(self.appPath+'/music2ty... | mit | 7,971,246,647,054,509,000 | 25.02 | 67 | 0.577633 | false | 3.008092 | false | false | false |
wittrup/crap | python/encoding.py | 1 | 1363 |
N = 0 # character never appears in text
A = 1 # character appears in plain ASCII text
I = 2 # character appears in ISO-8859 text
X = 3 # character appears in non-ISO extended ASCII (Mac, IBM PC)
text_chars = [
# BEL BS HT LF VT FF CR
N, N, N, N, N, N, N, A, A, A, A, A, A, A, N, N, # ... | mit | -1,026,429,806,372,490,800 | 44.466667 | 81 | 0.405723 | false | 1.72096 | false | false | false |
elationfoundation/git_hooks | pre-commit/python/timestamp.py | 1 | 1631 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import re
import subprocess
from datetime import datetime
class TestSuite():
def __init__(self):
self.stdout = 0
def run(self, files):
for file_name in files:
try:
self.set_changed(file_name)
except Excepti... | gpl-2.0 | 188,132,529,603,103,600 | 30.365385 | 118 | 0.505825 | false | 3.949153 | false | false | false |
Weihonghao/ECM | find_emotion_word.py | 1 | 1493 | from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer
from tqdm import tqdm
import mmap
def whetherEmotion(word, threshold):
analyzer = SentimentIntensityAnalyzer()
sentiment_result = analyzer.polarity_scores(word)
if abs(sentiment_result['compound']) > threshold:
return True
ret... | agpl-3.0 | 8,073,913,267,619,536,000 | 30.104167 | 73 | 0.653048 | false | 3.05317 | false | false | false |
Kkevsterrr/backdoorme | backdoors/shell/netcat.py | 1 | 1739 | from backdoors.backdoor import *
import time
class Netcat(Backdoor):
prompt = Fore.RED + "(nc) " + Fore.BLUE + ">> " + Fore.RESET
def __init__(self, core):
cmd.Cmd.__init__(self)
self.intro = GOOD + "Using netcat backdoor..."
self.core = core
self.options = {
... | mit | 8,729,828,714,688,870,000 | 44.763158 | 180 | 0.564117 | false | 3.331418 | false | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.