repo_name stringlengths 6 61 | path stringlengths 4 230 | copies stringlengths 1 3 | size stringlengths 4 6 | text stringlengths 1.01k 850k | license stringclasses 15
values | hash int64 -9,220,477,234,079,998,000 9,219,060,020B | line_mean float64 11.6 96.6 | line_max int64 32 939 | alpha_frac float64 0.26 0.9 | autogenerated bool 1
class | ratio float64 1.62 6.1 | config_test bool 2
classes | has_no_keywords bool 2
classes | few_assignments bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
acbilson/forbidden-island | tests/integrationtests.py | 1 | 1368 | import unittest
import sys
sys.path.append('../src')
from islandgame import *
from service_console import *
from service_player import *
from service_log import *
from service_screen import *
from iofactory import FakeIO
from tiles import *
class TestGame(unittest.TestCase):
def test_golden_initialization(self):
... | gpl-3.0 | -7,989,361,619,788,491,000 | 30.090909 | 112 | 0.655702 | false | 3.590551 | false | false | false |
rupenp/lin-train | solvers/logisticregression.py | 2 | 1722 | from solver import Solver
import numpy as np
class LogisticRegression(Solver):
"""
This uses the generalized linear model with gradient descent to calculate linear coefficients (parameters). This
class is abstract and must be extended by the underlying distribution to determine the exact gradient and meth... | mit | -4,388,168,504,590,578,700 | 30.309091 | 116 | 0.552846 | false | 3.656051 | false | false | false |
vegarwe/sqrl | pysqrl/pysqrl/sqrl_client.py | 1 | 2411 | from .sqrl_conv import sqrl_base64_encode, sqrl_base64_decode
from .sqrl_url import SqrlUrl
from .sqrl_crypto import *
def sqrl_query(imk, sks, server):
# Get site specific keys
idk, ssk = sqrl_get_idk_for_site(imk, sks)
client = b'ver=1\r\n'
client += b'cmd=query\r\n'
client += b'idk=%s\r\n' ... | mit | -1,717,149,960,949,419,500 | 32.027397 | 61 | 0.571132 | false | 2.614967 | false | false | false |
spacelis/crawler.kka | examples/utils/tweepy_patch.py | 1 | 2726 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
""" A patch to tweepy for storing original json in Status.
File: tweepy_patch.py
Author: SpaceLis
Email: Wen.Li@tudelft.nl
GitHub: http://github.com/spacelis
Description:
"""
import types
import sys
from json import dumps
def stack(cls, method, mock):
""" Patching ... | mit | 7,350,485,128,015,927,000 | 22.912281 | 76 | 0.567131 | false | 3.734247 | false | false | false |
FAForever/client | src/api/ApiBase.py | 1 | 3965 | from PyQt5 import QtCore, QtNetwork
import logging
import json
from config import Settings
logger = logging.getLogger(__name__)
class ApiBase(QtCore.QObject):
def __init__(self, route):
QtCore.QObject.__init__(self)
self.url = QtCore.QUrl(Settings.get('api') + route)
self.manager = QtNet... | gpl-3.0 | -783,237,696,539,453,700 | 37.495146 | 92 | 0.560151 | false | 4.300434 | false | false | false |
paulmadore/Eric-IDE | 6-6.0.9/eric/Preferences/ConfigurationPages/IrcPage.py | 2 | 7648 | # -*- coding: utf-8 -*-
# Copyright (c) 2012 - 2015 Detlev Offenbach <detlev@die-offenbachs.de>
#
"""
Module implementing the IRC configuration page.
"""
from __future__ import unicode_literals
from .ConfigurationPageBase import ConfigurationPageBase
from .Ui_IrcPage import Ui_IrcPage
import Preferences
class Ir... | gpl-3.0 | 7,421,247,464,999,810,000 | 41.966292 | 79 | 0.625785 | false | 4.165577 | true | false | false |
mghweb/sublime-miva-ide | miva-pos-calculator.py | 1 | 1617 | import sublime, sublime_plugin, re, threading
miva_error_status_key = 'miva_pos_calculator_error'
class MvtPosCalculatorCommand( sublime_plugin.TextCommand ):
def run( self, edit ):
selections = self.view.sel()
for selection in selections:
# get region from start of file to first point in selection
se... | mit | 624,135,251,984,196,700 | 32.6875 | 89 | 0.664193 | false | 3.068311 | false | false | false |
nirvaris/nirvaris-profile | setup.py | 1 | 1256 | import os
from setuptools import setup
with open(os.path.join(os.path.dirname(__file__), 'README.md')) as readme:
README = readme.read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='nirvaris-profile',
version='3.0',
... | mit | -3,625,902,828,120,398,300 | 33.888889 | 78 | 0.636146 | false | 3.912773 | false | true | false |
dwoods/gn-maps | geonode/documents/migrations/0002_auto__add_field_document_popular_count__add_field_document_share_count.py | 4 | 16466 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Document.popular_count'
db.add_column(u'documents_document', 'popular_count', self.gf('dja... | gpl-3.0 | 2,982,839,074,268,630,000 | 84.760417 | 205 | 0.55648 | false | 3.547178 | false | false | false |
hsab/UMOG | umog_addon/nodes/geometry/dissolve_limited.py | 1 | 2551 | from ...base_types import UMOGOutputNode
import bpy
import numpy as np
import math
from mathutils import Vector
class DissolveLimitedNode(bpy.types.Node, UMOGOutputNode):
bl_idname = "umog_DissolveLimitedNode"
bl_label = "Dissolve Limited"
assignedType = "Object"
delimitOptions = bpy.props.EnumPrope... | gpl-3.0 | -6,074,537,798,682,257,000 | 32.12987 | 125 | 0.614661 | false | 3.762537 | false | false | false |
7Robot/cerveau | ia/missions/petit/positioning.py | 1 | 3131 | # -*-coding:UTF-8 -*
from events.event import Event
from missions.mission import Mission
class PositioningMission(Mission):
def __init__(self, robot, can, ui):
super(self.__class__,self).__init__(robot, can, ui)
self.state = -1
def start(self):
if self.state == -1:
self.cr... | gpl-3.0 | 2,794,002,897,405,929,000 | 35.835294 | 78 | 0.464388 | false | 4.024422 | false | false | false |
google/google-ctf | third_party/edk2/BaseTools/Source/Python/Eot/EotMain.py | 1 | 69215 | ## @file
# This file is used to be the main entrance of EOT tool
#
# Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The ... | apache-2.0 | -5,141,420,957,244,299,000 | 38.264689 | 199 | 0.541761 | false | 3.868489 | false | false | false |
openhumanoids/pronto | motion_estimate/scripts/send_a_robot_state.py | 2 | 2079 | #!/usr/bin/python
# A very simple process to combine the floating base estimate
# with the kinematics and output the combined message
# input: POSE_BODY and ATLAS_STATE, output: EST_ROBOT_STATE
#
# currently this only works/used for Thor Mang
import os,sys
import lcm
import time
from lcm import LCM
from math import *
... | lgpl-2.1 | -3,301,472,500,719,083,500 | 32.532258 | 233 | 0.645984 | false | 2.658568 | false | false | false |
mgp25/LocalBitcoins-API | src/LocalBitcoin.py | 1 | 12088 | import hmac
import json
import urllib
import hashlib
import requests
from urllib import parse
from datetime import datetime
class LocalBitcoin:
baseurl = 'https://localbitcoins.com'
def __init__(self, hmac_auth_key, hmac_auth_secret, debug = False):
self.hmac_auth_key = hmac_auth_key
self.hm... | mit | -391,811,989,045,716,030 | 39.837838 | 301 | 0.649073 | false | 4.076897 | false | false | false |
zozo123/buildbot | master/buildbot/test/unit/test_steps_source_svn.py | 3 | 87137 | # 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-3.0 | -5,627,715,937,354,881,000 | 42.897733 | 164 | 0.435234 | false | 4.564536 | true | false | false |
Debith/py2traits | src/pytraits/core/singleton.py | 1 | 2028 | #!/usr/bin/python -tt
# -*- coding: utf-8 -*-
'''
Copyright 2014-2015 Teppo Perä
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
Un... | apache-2.0 | 270,962,698,969,717,020 | 29.727273 | 78 | 0.613222 | false | 4.179381 | false | false | false |
Polytechnique-org/xorgauth | scripts/alumnforce/convert_json_to_csv.py | 1 | 3347 | #!/usr/bin/env python3
# -*- coding:UTF-8 -*-
"""Convert a JSON file to a CSV file to be imported on AlumnForce website
This is the reciprocal of convert_csv_to_json.py.
"""
import argparse
import csv
import json
import sys
from csv_format import ALUMNFORCE_FIELDS
JSON_TO_CSV_FIELDS = dict((x[1], (x[0], x[2], i)) f... | agpl-3.0 | -6,566,489,218,920,297,000 | 34.989247 | 111 | 0.599641 | false | 3.739665 | false | false | false |
vitorio/ocropodium | ocradmin/presets/models.py | 1 | 4715 | """
Model to store script data.
"""
import json
import datetime
from django.db import models
from django.contrib.auth.models import User
from tagging.fields import TagField
import tagging
import autoslug
from nodetree import script
class JsonTextField(models.TextField):
def to_python(self, value):
retur... | apache-2.0 | -4,253,747,964,622,213,000 | 27.75 | 88 | 0.584093 | false | 4.005947 | false | false | false |
Erotemic/local | init/_freshstart-win/install_scripts.py | 1 | 2047 |
"""
cd %HOME%
mkdir tmp
cd tmp
wget http://www.woogerworks.com/files/cockatrice.weeklybuilds/Cockatrice-WindowsClient.exe
Cockatrice-WindowsClient.exe
"""
def install_ansicon():
""" lets windows console display ansii
References:
http://www.liferay.com/web/igor.spasic/blog/-/blogs/enable-ansi-colors... | gpl-3.0 | 4,970,867,670,716,593,000 | 27.830986 | 108 | 0.657548 | false | 2.883099 | false | false | false |
JmPotato/Pomash | Pomash/libs/models.py | 1 | 3675 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from .tools import *
from .utils import *
class DatabaseError(Exception):
def __init__(self, content):
Exception.__init__(self)
if os.path.exists("blog.db"):
db = Connection("blog.db")
else:
raise DatabaseError("Database file not found !")
... | mit | 368,509,658,430,314,900 | 31.530973 | 122 | 0.633741 | false | 3.61002 | false | false | false |
CrashenX/python-rabbitmq | src/receive.py | 1 | 2219 | #!/usr/bin/env python
# Hello queue example using Python and RabbitMQ
# Copyright (c) 2014, Jesse J. Cook
# 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 ... | bsd-3-clause | 8,839,191,121,534,269,000 | 41.673077 | 80 | 0.764308 | false | 4.101664 | false | false | false |
RasaHQ/rasa_nlu | rasa/core/policies/tf_utils.py | 1 | 36915 | from collections import namedtuple
import tensorflow as tf
class TimedNTM(object):
"""Timed Neural Turing Machine
Inspired by paper:
https://arxiv.org/pdf/1410.5401.pdf
Implementation inspired by:
https://github.com/carpedm20/NTM-tensorflow/blob/master/ntm_cell.py
See our paper for d... | apache-2.0 | 4,987,237,206,709,575,000 | 37.65445 | 88 | 0.579033 | false | 4.057039 | false | false | false |
schleichdi2/OpenNfr_E2_Gui-6.0 | lib/python/Plugins/Extensions/MediaPortal/additions/porn/naughtyamerica.py | 1 | 7967 | # -*- coding: utf-8 -*-
###############################################################################################
#
# MediaPortal for Dreambox OS
#
# Coded by MediaPortal Team (c) 2013-2017
#
# This plugin is open source but it is NOT free software.
#
# This plugin may only be distributed to and executed... | gpl-2.0 | 8,299,333,533,479,308,000 | 36.933333 | 163 | 0.663779 | false | 3.06582 | false | false | false |
snood1205/Computational-Science | eq-solve.py | 1 | 1492 | import numpy as np
import numpy.linalg as la
import scipy.linalg as sla
import timeit
# This file provides many different methods for solving Ax=b
# Economy QR Decomposition
def qrsolve(a,b):
q, r = la.qr(a,mode='reduced')
return np.dot(np.dot(la.inv(r),la.inv(q)),b)
# LU (non-pivot) Decomposition
def lusolve(a,b... | mit | -8,539,782,576,811,710,000 | 25.642857 | 87 | 0.664879 | false | 2.353312 | false | false | false |
elastic/elasticsearch-dsl-py | tests/test_integration/test_examples/test_completion.py | 1 | 1307 | # -*- coding: utf-8 -*-
# Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (the "Licens... | apache-2.0 | 6,124,546,491,409,554,000 | 35.25 | 76 | 0.722605 | false | 3.655462 | false | false | false |
thagomizer/examples | Collision15/scripts/rails_log_to_csv.py | 1 | 1983 | # Copyright 2015 Google
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software... | apache-2.0 | -4,016,073,517,099,934,700 | 32.05 | 74 | 0.602622 | false | 3.553763 | false | false | false |
dirkjankrijnders/aubio | interfaces/python/test_fft.py | 4 | 3442 | from numpy.testing import TestCase, run_module_suite
from numpy.testing import assert_equal, assert_almost_equal
# WARNING: numpy also has an fft object
from aubio import fvec, fft, cvec
from numpy import array, shape
from math import pi
class aubio_fft_test_case(TestCase):
def test_members(self):
f = fft()
... | gpl-3.0 | 2,928,332,273,026,703,400 | 30.290909 | 72 | 0.623475 | false | 2.982669 | true | false | false |
tsuberi/kid-watch-app | Server/twilio/rest/resources/messages.py | 3 | 5123 | from . import InstanceResource, ListResource
from .media import MediaList
from .util import normalize_dates, parse_date
class Message(InstanceResource):
""" A Message instance.
.. attribute:: sid
A 34 character string that uniquely identifies this resource.
.. attribute:: account_sid
T... | mit | -2,986,672,169,921,871,000 | 31.630573 | 79 | 0.64552 | false | 4.525618 | false | false | false |
dmlc/mxnet | benchmark/python/sparse/util.py | 19 | 1451 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | apache-2.0 | -8,475,303,383,507,789,000 | 38.216216 | 92 | 0.67264 | false | 4.008287 | false | false | false |
fkie-cad/FACT_core | src/plugins/analysis/cwe_checker/code/cwe_checker.py | 1 | 5402 | '''
This plugin implements a wrapper around the BAP plugin cwe_checker, which checks ELF executables for
several CWEs (Common Weakness Enumeration). Please refer to cwe_checkers implementation for further information.
Please note that these checks are heuristics and the checks are static.
This means that there are defi... | gpl-3.0 | -5,476,560,485,305,494,000 | 42.564516 | 121 | 0.637727 | false | 4.098634 | false | false | false |
un33k/problems | paths/iterative_max_product.py | 1 | 1549 |
import sys
import cProfile
def maxProductPaths(nXm_matrix):
"""
Returns the `maximum` path `product` from the top left to the bottom
right by moving right and down in a 2D array of size n x m.
"""
hight = len(nXm_matrix)
width = len(nXm_matrix[0])
noop = 1
grid = {}
# create a gr... | bsd-2-clause | -7,724,922,176,417,361,000 | 24.393443 | 72 | 0.537766 | false | 3.338362 | false | false | false |
Hybrid-Cloud/cinder | cinder/volume/drivers/nexenta/jsonrpc.py | 9 | 2851 | # Copyright 2016 Nexenta Systems, 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
#
# Unless req... | apache-2.0 | 6,879,426,092,511,571,000 | 32.151163 | 78 | 0.600842 | false | 4.015493 | false | false | false |
pfont/www.pfont.ir | app/utilis/sms.py | 1 | 1807 | from suds.client import Client as SoapClient
from lxml import objectify
#import logging
#logging.basicConfig(level=logging.INFO)
#logging.getLogger('suds.client').setLevel(logging.DEBUG)
#print(client)
class SMS(object):
def __init__(self, app=None):
self.sender = None
self.soapservice = None
... | gpl-2.0 | -3,489,350,214,241,698,300 | 33.75 | 80 | 0.515219 | false | 4.428922 | false | false | false |
AntoineLee/spider163 | spider163/spider/music.py | 1 | 3493 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import requests
import json
from bs4 import BeautifulSoup
import settings as uapi
from spider163 import settings
from spider163.utils import pysql
from spider163.utils import pylog
from terminaltables import AsciiTable
class Music:
def __init__(self):
s... | mit | -6,229,999,756,993,117,000 | 38.211765 | 114 | 0.553255 | false | 3.296736 | false | false | false |
aplicatii-romanesti/allinclusive-kodi-pi | .kodi/addons/plugin.video.1channel/waldo/indexes/1Channel_index.py | 3 | 8581 | import os
import re
import sys
import urllib2
import HTMLParser
import xbmcgui
import xbmcplugin
from t0mm0.common.addon import Addon
from t0mm0.common.addon import Addon as Addon2
addon = Addon('plugin.video.waldo', sys.argv)
_1CH = Addon2('plugin.video.1channel', sys.argv)
#BASE_Address = 'www.primewire.ag'
BASE_A... | apache-2.0 | -3,277,716,678,351,474,000 | 39.866667 | 132 | 0.623121 | false | 3.668662 | false | false | false |
0x0mar/phpsploit | plugins/file_system/ls/plugin.py | 1 | 3708 | """List directory contents
SYNOPSIS:
ls [<REMOTE PATH>] ...
DESCRIPTION:
List the files in given remote directory path
- If the given element is not an accessible directory, the
payload automatically considers the path's basename as a
regex pattern, it allows to list files which match a
specif... | gpl-3.0 | 4,447,813,382,959,210,000 | 33.654206 | 79 | 0.617044 | false | 3.667656 | false | false | false |
tjcsl/director | web3/apps/docs/urls.py | 1 | 1025 | from django.conf.urls import url
from . import views
urlpatterns = [
url(r"^$", views.index_view, name="docs_home"),
url(r"new/$", views.new_article_view, name="new_article"),
url(r"^list/$", views.list_articles_view, name="list_articles"),
url(r"(?P<article_slug>[\w-]+)/$", views.read_article_view, n... | mit | 1,922,998,732,607,338,200 | 59.294118 | 115 | 0.64 | false | 3.059701 | false | true | false |
NiJeLorg/paratransit_api | paratransit/api/migrations/0011_dropoff_locations_pickup_locations.py | 1 | 1759 | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-05-11 19:49
from __future__ import unicode_literals
import django.contrib.gis.db.models.fields
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('api', '0010_auto_2... | mit | -2,889,880,485,835,931,000 | 44.102564 | 114 | 0.599204 | false | 3.865934 | false | false | false |
aricaldeira/PySPED | pysped/cte/leiaute/modais_300.py | 1 | 26661 | # -*- coding: utf-8 -*-
#
# PySPED - Python libraries to deal with Brazil's SPED Project
#
# Copyright (C) 2010-2012
# Copyright (C) Aristides Caldeira <aristides.caldeira at tauga.com.br>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public Lice... | lgpl-2.1 | -6,469,052,802,770,192,000 | 36.894737 | 188 | 0.597147 | false | 2.894079 | false | false | false |
seanxwzhang/LeetCode | 031 Next permutation/solution.py | 1 | 1427 | #!/usr/bin/env python
# Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.
# If such arrangement is not possible, it must rearrange it as the lowest possible order (ie, sorted in ascending order).
# The replacement must be in-place, do not allocate ext... | mit | 7,357,985,183,012,399,000 | 48 | 121 | 0.680507 | false | 3.543641 | false | false | false |
TheTimmy/spack | var/spack/repos/builtin/packages/nalu/package.py | 1 | 2287 | ##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 | -967,329,023,991,329,200 | 40.581818 | 138 | 0.659816 | false | 3.780165 | false | false | false |
gngrwzrd/gity | python/getremotebranches.py | 2 | 1653 | # Copyright Aaron Smith 2009
#
# This file is part of Gity.
#
# Gity 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.
#
# Gity is dis... | gpl-3.0 | 7,285,313,256,843,885,000 | 32.755102 | 96 | 0.723533 | false | 2.983755 | false | false | false |
HaroldMills/Vesper | vesper/util/tests/test_time_frequency_analysis_utils.py | 1 | 11794 | import numpy as np
from vesper.tests.test_case import TestCase
import vesper.util.time_frequency_analysis_utils as tfa_utils
'''
TODO: Add test cases for which window size differs from DFT size,
and for which window is not rectangular.
'''
'''
TODO: Given that we need to test FFTs and spectrograms implemented
in va... | mit | 602,153,895,218,348,300 | 28.858228 | 77 | 0.483805 | false | 3.364907 | true | false | false |
drewswinney/myo | Lumyo Desktop/Lumyo Python/lumyo/MyoREST.py | 1 | 10667 | # Coded by Walker Argendeli, Lumyo Capstone Group
from urlparse import urlparse, urljoin
from datetime import datetime, timedelta
import requests, json
from getpass import getpass
from enum import Enum, IntEnum
from collections import namedtuple
# class API:
#
# def __init__(self, low_myo, timestamp, firmware... | mit | -1,072,669,365,186,132,100 | 39.256604 | 180 | 0.664104 | false | 4.136099 | false | false | false |
krak3n/Facio | tests/test_config.py | 1 | 9744 | # -*- coding: utf-8 -*-
"""
.. module:: tests.test_config
:synopsis: Tests for the Facio config module.
"""
import os
import six
from mock import MagicMock, patch, PropertyMock
from facio.config import ConfigurationFile, CommandLineInterface, Settings
from facio.exceptions import FacioException
from six import St... | bsd-3-clause | -4,704,710,260,870,213,000 | 30.230769 | 79 | 0.603448 | false | 3.965812 | true | false | false |
xuet0ng/github-enterprise-wechat | rest/endpoint.py | 1 | 1834 | # -*- coding:utf-8 -*-
import json
import os
from flask import Flask, request
from message import pr_msg, ci_failed_msg
from wechat_sdk import WeChat
app = Flask(__name__)
@app.route('/')
def hello_world():
return 'Hello World!'
if 'GITHUB_WECHAT_CORP_SECRET' in os.environ.keys():
we_github = WeChat(
... | apache-2.0 | 9,202,398,030,092,775,000 | 23.783784 | 73 | 0.556707 | false | 3.383764 | false | false | false |
j91321/rext | modules/misc/cobham/admin_reset_code.py | 1 | 1835 | # Name:Cobham Aviator/Explorer/Sailor admin reset code generator
# File:admin_reset_code.py
# Author:Ján Trenčanský
# License: GNU GPL v3
# Created: 4.12.2015
# Last modified: 4.12.2015
# Shodan Dork:
# Description: generates predictable admin reset code for Cobham Aviator/Explorer/Sailor - CVE-2014-2943
# Based on wor... | gpl-3.0 | -2,954,850,911,019,823,000 | 28.031746 | 115 | 0.680153 | false | 3.033167 | false | false | false |
kmuthupa/dash-listener | dash-listener-alt.py | 1 | 1226 | import socket
import struct
import binascii
import time
import json
import urllib2
import requests
macs = {
'74c246c3e349' : 'dash_tide'
}
def post_data():
data = {
"date": time.strftime("%Y-%m-%d"),
"tally": '1'
}
requests.post("https://sheetsu.com/apis/390c6259", data)
def record_tal... | mit | 4,926,280,512,311,301,000 | 26.863636 | 82 | 0.6354 | false | 3.004902 | false | false | false |
sellberg/SACLA2016B8055 | scripts/02_process_batch_runs.py | 2 | 2603 | #!/home/software/SACLA_tool/bin/python2.7
import os
import sys
from argparse import ArgumentParser
parser = ArgumentParser()
parser = ArgumentParser(description="Wrapper to run 01_process_runs.py that can be run as batch job")
parser.add_argument("-start", "--start-run", type=int, dest="start", required=True,
... | bsd-2-clause | 514,893,911,962,557,500 | 40.31746 | 125 | 0.64272 | false | 3.307497 | false | false | false |
IZSVenezie/VetEpiGIS-Stat | plugin/globalt_dialog.py | 1 | 5863 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'globalt_dialog_base.ui'
#
# Created: Sat Jan 7 15:11:01 2017
# by: PyQt4 UI code generator 4.10.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
e... | gpl-3.0 | 6,605,957,696,505,159,000 | 51.348214 | 104 | 0.681051 | false | 3.527677 | false | false | false |
lampjian/effectivelang | Python/lug/67.209.186.120:8888.py | 1 | 2648 | #!/usr/bin/python3
import base64
import pickle
from flask import Flask, request
from handies import file_contents, safe_unpickle
import flag
app = Flask(__name__)
class Credential:
"If the user wants the flag, he or she must have a credential."
def __init__(self, username: str, password: str):
self.... | gpl-3.0 | -8,001,954,234,055,832,000 | 28.617978 | 72 | 0.404021 | false | 3.59618 | false | false | false |
maveron58/indiana | positioning/strategy/nn_with_linreg.py | 1 | 1610 | from positioning.chains import LocalLinRegDataChain
from positioning.computations.rssi_linear_regression import RssiLinearRegression
from positioning.computations.trilateration import Trilateration
from positioning.strategy import NearestNeighbourStrategy
from positioning.strategy.abstract_location_strategy import Abst... | mit | 4,677,599,620,941,124,000 | 50.967742 | 104 | 0.710559 | false | 3.659091 | false | false | false |
waynegm/OpendTect-Plugins | bin/python/wmpy/Filtering/ex_spatial_filter_circular.py | 2 | 4264 | # Spatial Filter
#
# Applies a Lowpass, Highpass, Band Reject or Bandpass circular symmetric filter
# by convolution
#
import sys,os
import numpy as np
import scipy.special as ss
#
# Import the module with the I/O scaffolding of the External Attribute
#
sys.path.insert(0, os.path.join(sys.path[0], '..'))
import extatt... | gpl-3.0 | 6,843,834,675,507,858,000 | 25.81761 | 206 | 0.583021 | false | 2.920548 | false | false | false |
sanguinariojoe/FreeCAD | src/Mod/Arch/ArchEquipment.py | 11 | 14419 | # -*- coding: utf8 -*-
#***************************************************************************
#* Copyright (c) 2014 Yorik van Havre <yorik@uncreated.net> *
#* *
#* This program is free software; you can redistribute it and/or... | lgpl-2.1 | -4,741,429,345,536,449,000 | 37.553476 | 168 | 0.578126 | false | 4.065125 | false | false | false |
google-research/google-research | ravens/ravens/tasks/task.py | 1 | 13097 | # coding=utf-8
# Copyright 2021 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | apache-2.0 | 3,601,930,096,458,876,400 | 36.31339 | 108 | 0.588913 | false | 3.43033 | false | false | false |
TheAlgorithms/Python | maths/euclidean_gcd.py | 1 | 1272 | """ https://en.wikipedia.org/wiki/Euclidean_algorithm """
def euclidean_gcd(a: int, b: int) -> int:
"""
Examples:
>>> euclidean_gcd(3, 5)
1
>>> euclidean_gcd(6, 3)
3
"""
while b:
a, b = b, a % b
return a
def euclidean_gcd_recursive(a: int, b: int) -> int:
"""
Rec... | mit | -7,999,576,104,044,941,000 | 26.06383 | 77 | 0.584906 | false | 2.795604 | false | false | false |
XefPatterson/INF8225_Project | Model/model_flex.py | 1 | 12332 | import numpy as np
import tensorflow as tf
from queues import create_queues_for_bucket
from termcolor import cprint
FLAGS = None
class Seq2Seq(object):
def __init__(self,
buckets,
forward_only=False):
"""
Seq2Seq model
:param buckets: List of pairs
... | mit | -1,201,654,647,298,813,000 | 45.014925 | 121 | 0.577522 | false | 4.0078 | false | false | false |
osmanbaskaya/mapping-impact | run/dataset-stats.py | 1 | 1312 | # -*- coding: utf-8 -*-
__author__ = "Osman Baskaya"
import sys
from collections import Counter, defaultdict as dd
import os
from nlp_utils import calc_perp
key_file = sys.argv[1]
d = dd(list)
all_senses = []
total_num_instance = 0
for line in open(key_file):
total_num_instance += 1
word, instance_id, sense =... | mit | 1,706,787,379,362,280,400 | 33.526316 | 97 | 0.608232 | false | 2.981818 | false | false | false |
Arkapravo/morse-0.6 | src/morse/actuators/kuka_lwr.py | 1 | 3893 | import logging; logger = logging.getLogger("morse." + __name__)
import math
import morse.actuators.armature_actuator
from morse.helpers.morse_math import normalise_angle
from morse.core.services import service
from morse.core.exceptions import MorseRPCInvokationError
class KukaActuatorClass(morse.actuators.armature_ac... | bsd-3-clause | -9,090,081,137,052,656,000 | 38.323232 | 129 | 0.610326 | false | 4.042575 | false | false | false |
Nate-Devv/Tuxemon | tuxemon/core/components/controller.py | 3 | 6080 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Tuxemon
# Copyright (C) 2014, William Edwards <shadowapex@gmail.com>,
# Benjamin Bean <superman2k5@gmail.com>
#
# This file is part of Tuxemon.
#
# Tuxemon is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Pu... | gpl-3.0 | 3,111,139,258,999,061,000 | 44.684211 | 127 | 0.60237 | false | 3.603796 | false | false | false |
bureaucratic-labs/natasha-factRuEval-2016 | main.py | 1 | 2053 |
import os
import re
from collections import namedtuple
from random import seed, sample
from tqdm import tqdm as log_progress
from natasha import NamesExtractor
from natasha.markup import show_markup
from natasha.grammars.name import Name
FACTRU_DIR = 'factRuEval-2016'
DEVSET_DIR = os.path.join(FACTRU_DIR, 'devset'... | mit | -2,350,521,041,399,897,600 | 20.385417 | 65 | 0.617633 | false | 3.163328 | false | false | false |
magfest/panels | panels/models/__init__.py | 1 | 7130 | from panels import *
from panels.config import panels_config as config
def url_domain(url):
url = url.strip().replace('//', '/')
url = re.sub(r'^https?:/', '', url)
url = re.sub(r'^www\.', '', url)
return url.split('/', 1)[0].strip('@#?=. ')
@Session.model_mixin
class SessionMixin:
def panel_app... | agpl-3.0 | 8,330,503,066,072,709,000 | 34.472637 | 125 | 0.651192 | false | 3.82716 | false | false | false |
samba-team/samba | python/samba/tests/dns_aging.py | 1 | 111372 | # Unix SMB/CIFS implementation.
# Copyright (C) Kai Blin <kai@samba.org> 2011
# Copyright (C) Catalyst.NET 2021
#
# 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... | gpl-3.0 | 5,310,065,596,641,548,000 | 38.975592 | 84 | 0.60095 | false | 3.524765 | true | false | false |
jnishi/chainer | tests/chainer_tests/test_variable.py | 1 | 97383 | import copy
import inspect
import platform
import re
import sys
import unittest
import warnings
import mock
import numpy as np
import pytest
import six
import chainer
from chainer import backend
from chainer.backends import cuda
from chainer.backends import intel64
import chainer.functions as F
from chainer import in... | mit | -47,175,618,758,789,790 | 32.270584 | 79 | 0.586776 | false | 3.345001 | true | false | false |
barbagroup/pygbe | pygbe/tree/cuda_kernels.py | 1 | 83039 | try:
from pycuda.compiler import SourceModule
except ImportError:
pass
def kernels(BSZ, Nm, K_fine, P, REAL):
mod = SourceModule( """
#define REAL %(precision)s
#define BSZ %(blocksize)d
#define Nm %(Nmult)d
#define K_fine %(K_near)d
#define P %(Ptree)d
/*
__device__ i... | bsd-3-clause | -102,341,381,851,496,640 | 35.088223 | 180 | 0.345645 | false | 2.685521 | false | false | false |
fajran/kasuari | utils/merge.py | 1 | 2326 | from PIL import Image
import sys
import os
class ImageMerger:
format = "%(z)d.%(x)d.%(y)d.jpg"
def __init__(self, target):
self.target = target
self.size = 256
def start(self):
level = 0
while True:
total = self._merge(level)
if total == 1:
... | mit | -4,343,508,817,439,789,600 | 25.735632 | 73 | 0.316423 | false | 4.69899 | false | false | false |
TrainingB/Clembot | clembot/exts/autorespond/autoresponder.py | 1 | 4240 | import json
import os
import discord
from discord.ext import commands
from clembot.exts.utils.utilities import Utilities
class AutoResponder(commands.Cog):
def __init__(self, bot):
self.bot = bot
self.guild_dict = bot.guild_dict
self.utilities = Utilities()
self.pokemon_forms = ... | gpl-3.0 | -8,263,116,281,136,314,000 | 42.265306 | 195 | 0.652594 | false | 3.530391 | false | false | false |
mgraffg/simplegp | SimpleGP/tests/test_eval.py | 1 | 1811 | # Copyright 2013 Mario Graff Guerrero
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in wri... | apache-2.0 | 7,823,612,286,752,798,000 | 36.729167 | 77 | 0.59746 | false | 3.090444 | false | false | false |
HBPNeurorobotics/BlenderRobotDesigner | robot_designer_plugin/export/collada15/file.py | 1 | 8958 | # #####
# This file is part of the RobotDesigner of the Neurorobotics subproject (SP10)
# in the Human Brain Project (HBP).
# It has been forked from the RobotEditor (https://gitlab.com/h2t/roboteditor)
# developed at the Karlsruhe Institute of Technology in the
# High Performance Humanoid Technologies Laboratory (H2T)... | gpl-2.0 | 702,177,518,763,781,600 | 35.713115 | 114 | 0.635298 | false | 3.687937 | false | false | false |
rrpg/engine | core/commands/look.py | 1 | 4279 | # -*- coding: utf-8 -*-
from models import area, character, place, item, item_container
import core.command
from core.localisation import _
class look(core.command.command):
"""
Look command
"""
def run(self):
"""
c.run()
Display some informations about the player's current position
(characters arround,... | mit | 7,157,176,980,451,430,000 | 25.91195 | 71 | 0.64057 | false | 3.021893 | false | false | false |
alirizakeles/zato | code/zato-server/src/zato/server/service/internal/server.py | 1 | 3943 | # -*- coding: utf-8 -*-
"""
Copyright (C) 2012 Dariusz Suchojad <dsuch at zato.io>
Licensed under LGPLv3, see LICENSE.txt for terms and conditions.
"""
from __future__ import absolute_import, division, print_function, unicode_literals
# stdlib
from contextlib import closing
from traceback import format_exc
# Zato
... | gpl-3.0 | 9,005,205,076,764,030,000 | 34.205357 | 125 | 0.568603 | false | 3.939061 | false | false | false |
tapilab/theissier | scriptPredict.py | 1 | 2153 | #!/bin/python
import pymongo
from pymongo import MongoClient
client = MongoClient('localhost', 27017)
from sklearn.feature_extraction.text import CountVectorizer
vec = CountVectorizer()
from sklearn.linear_model import LogisticRegression
from elasticsearch import Elasticsearch
es = Elasticsearch()
import zerorpc
import... | apache-2.0 | 6,065,205,377,650,612,000 | 40.403846 | 131 | 0.673014 | false | 3.661565 | false | false | false |
arvinddoraiswamy/blahblah | cryptopals/Set4/c32_client.py | 1 | 1265 | import requests
import datetime
import operator
import sys
url= 'http://localhost:9000/test?'
file_qs='file=fddoo&'
sig_qs ='signature='
siglen= 40
byte_count= 0
guessed_bytes= ''
req_url= ''
''' http://localhost:9000/test?file=foo&signature=24b2d4322e50bf57c88697644e2fd1450794ab5c '''
''' http://localhost:9000/test... | mit | 8,099,344,932,862,683,000 | 28.418605 | 96 | 0.667194 | false | 2.829978 | false | false | false |
optimamodel/Optima | optima/calibration.py | 1 | 13511 | """
CALIBRATION
Function(s) to perform calibration.
"""
from optima import OptimaException, Link, Par, dcp, asd, printv, findinds, isnumber, odict
from numpy import zeros, array, mean
import six
if six.PY3:
unicode = str
def autofit(project=None, name=None, fitwhat=None, fitto=None, method='wape', maxtime=None... | lgpl-3.0 | 3,351,361,125,149,846,000 | 49.044444 | 170 | 0.6041 | false | 3.767708 | false | false | false |
waxa/GCM-Push-Class-for-python | GCMPush.py | 2 | 1398 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @author waxa <waxaman@gmail.com>
import json
import requests
class GCMPush :
# @param servKey : A serer key from google console
# @param verbose : optional param to print info from push request
def __init__(self, servKey, verbose = False) :
self.servKey = servKe... | gpl-2.0 | 1,831,681,067,588,702,500 | 30.772727 | 132 | 0.642346 | false | 3.320665 | false | false | false |
chromium/chromium | third_party/blink/renderer/bindings/scripts/bind_gen/interface.py | 1 | 299474 | # Copyright 2019 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import itertools
import web_idl
from . import name_style
from .blink_v8_bridge import blink_class_name
from .blink_v8_bridge import blink_type_info
from .b... | bsd-3-clause | -3,042,133,025,695,879,000 | 37.178735 | 105 | 0.618404 | false | 3.894837 | false | false | false |
brian-cleary/LatentStrainAnalysis | LSA/create_hash.py | 3 | 1150 | #!/usr/bin/env python
import sys,getopt,os
from fastq_reader import Fastq_Reader
help_message = "usage example: python create_hash.py -i /project/home/original_reads/ -o /project/home/hashed_reads/ -k kmer_size -s hash_size"
if __name__ == "__main__":
try:
opts, args = getopt.getopt(sys.argv[1:],'hi:o:k:s:',["inpu... | mit | -3,431,116,481,094,081,500 | 30.972222 | 143 | 0.626957 | false | 2.595937 | false | false | false |
jbalogh/zamboni | apps/compat/views.py | 1 | 5983 | import json
import re
from django import http
from django.conf import settings
from django.db.models import Count
from django.shortcuts import redirect
from django.views.decorators.csrf import csrf_exempt
import jingo
import redisutils
from tower import ugettext as _
import amo.utils
from amo.decorators import post_... | bsd-3-clause | -8,089,806,695,348,152,000 | 35.705521 | 77 | 0.598362 | false | 3.615106 | false | false | false |
KixPanganiban/shisetsu | shisetsu/middlewares.py | 1 | 2794 | """
shisetsu.middlewares
<github.com/kixpanganiban>
Contains `Middlewares`.
"""
from .contract import Contract
from .exceptions import MiddlewareError
class Middlewares(object):
"""Middlewares facilitate registering and executing middlwares wherever
they are defined. To add a middleware handler, a function ca... | mit | 7,818,230,602,946,721,000 | 32.261905 | 78 | 0.646385 | false | 4.484751 | false | false | false |
SageBerg/St.GeorgeGame | Python_version/actions.py | 1 | 211741 | from __future__ import print_function # for printing to stderr
# for exmaple: print(state.character.get_attack(), file=sys.stderr)
import sys
import random
import abc
import places
from raffle import Raffle
import money
import items
import persons
from outcome import Outcome
class Action(object):
"""
abst... | apache-2.0 | -5,675,993,034,953,079,000 | 32.135994 | 105 | 0.531437 | false | 3.815392 | false | false | false |
MustafaMustafa/dcgan-tf-benchmark | run_dcgan.py | 1 | 1596 | import os
import subprocess
datafile = 'data/benchmark_GAN_generated_cosmo_maps_128.npy'
output_size = 128
epoch = 1
flip_labels = 0.01
batch_size = 128
z_dim = 64
nd_layers = 4
ng_layers = 4
gf_dim = 64
df_dim = 64
save_every_step = 'False'
data_format = 'NHWC'
transpose_matmul_b = False
verbose = 'False'
arch = 'KNL... | mit | -5,536,285,681,664,096,000 | 37.926829 | 125 | 0.543233 | false | 3.297521 | false | true | false |
Klafyvel/Sivigik | gallery/migrations/0001_initial.py | 1 | 1051 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-07-25 14:02
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import gallery.models
class Migration(migrations.Migration):
initial = True
dependencies = [
('article', '0001_i... | agpl-3.0 | -7,081,145,542,296,569,000 | 35.241379 | 134 | 0.616556 | false | 4.01145 | false | false | false |
thaumos/ansible | lib/ansible/modules/remote_management/redfish/redfish_facts.py | 1 | 12031 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2017-2018 Dell EMC Inc.
# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'status': ['preview'],
... | gpl-3.0 | 3,895,431,353,467,819,500 | 33.771676 | 118 | 0.591721 | false | 4.384475 | false | false | false |
ricardogsilva/PyWPS | pywps/inout/formats/lists.py | 1 | 1471 | """List of supported formats
"""
from collections import namedtuple
_FORMAT = namedtuple('FormatDefinition', 'mime_type,'
'extension, schema')
_FORMATS = namedtuple('FORMATS', 'GEOJSON, JSON, SHP, GML, GEOTIFF, WCS,'
'WCS100, WCS110, WCS20, WFS, WFS100,'
... | mit | 7,804,016,274,088,547,000 | 48.033333 | 73 | 0.583956 | false | 3.136461 | false | true | false |
mark-me/Pi-Jukebox | venv/Lib/site-packages/pygame/freetype.py | 1 | 1814 | """Enhanced Pygame module for loading and rendering computer fonts"""
import sys
from pygame._freetype import (
Font,
STYLE_NORMAL, STYLE_OBLIQUE, STYLE_STRONG, STYLE_UNDERLINE, STYLE_WIDE,
STYLE_DEFAULT,
init, quit, get_init,
was_init, get_cache_size, get_default_font, get_default_resolution,
get_er... | agpl-3.0 | -821,348,237,561,825,800 | 39.311111 | 92 | 0.690187 | false | 3.909483 | false | false | false |
dnussbaum/classy-python-client-library | classyclient/ClassyClientResponse.py | 1 | 2895 | import json
from Exceptions import *
class ClassyClientResponse:
"""Returned after an API request by ClassyClient. Allows for paging of results."""
def __init__(self, response, session):
self.total = None
self.per_page = None
self.last_page = None
self.current_page = None
... | mit | 911,507,018,896,841,900 | 29.797872 | 86 | 0.561313 | false | 4.346847 | false | false | false |
tu-darmstadt-ros-pkg/hector_flexbe_behavior | hector_flexbe_states/src/hector_flexbe_states/set_mapping_state.py | 1 | 1316 | #!/usr/bin/env python
import rospy
from flexbe_core import EventState, Logger
from flexbe_core.proxy import ProxyPublisher
from flexbe_core.proxy import ProxyServiceCaller
from ethzasl_icp_mapper.srv import SetMode, GetMode, SetModeRequest
from smach import CBState
class SetMappingState(EventState):
'''
Activat... | bsd-3-clause | 3,987,962,716,252,878,300 | 20.225806 | 116 | 0.712766 | false | 3.281796 | false | false | false |
dlukes/pyvert | pyvert/_pyvert.py | 1 | 12731 | from itertools import chain
from lazy import lazy
from tempfile import NamedTemporaryFile as NamedTempFile
import regex as re
import random
from lxml import etree
from html import unescape
__all__ = ["Structure", "iterstruct", "config"]
__version__ = "0.0.0"
# disable security preventing DoS attacks with huge files
... | gpl-3.0 | -5,762,219,757,734,732,000 | 38.660436 | 85 | 0.578352 | false | 4.109425 | false | false | false |
ttm/music | sandbox/thirdchant.py | 1 | 1450 | import sys
keys=tuple(sys.modules.keys())
for key in keys:
if "music" in key:
del sys.modules[key]
import music as M
from percolation.rdf import c
H = M.utils.H
durs = 1, 1, 1, 1 ,1,1, 1, 1
notes = 0, 2, 4, 5, 7,9, 11, 12
text = 'sin-ging my ass out for you yes'
sonic_vector=M.singing.sing(te... | gpl-3.0 | -7,002,696,181,112,037,000 | 38.189189 | 73 | 0.644828 | false | 2.420701 | false | false | false |
sbc/django-uploadify-s3-example | src/apps/examples/urls.py | 1 | 3353 | # Copyright (c) 2010, Sam Charrington (@samcharrington), http://geekfactor.charrington.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:
# * Redistributions of source code must retain the a... | bsd-3-clause | -9,205,390,484,445,760,000 | 43.131579 | 90 | 0.682374 | false | 4.124231 | false | false | false |
bcharlas/mytrunk | py/timing.py | 3 | 6985 | # encoding: utf-8
# 2008 © Václav Šmilauer <eudoxos@arcig.cz>
"""Functions for accessing timing information stored in engines and functors.
See :ref:`timing` section of the programmer's manual, `wiki page <http://yade-dem.org/index.php/Speed_profiling_using_TimingInfo_and_TimingDeltas_classes>`_ for some examples.
""... | gpl-2.0 | -721,391,456,232,729,100 | 55.764228 | 175 | 0.456603 | false | 3.759828 | false | false | false |
razzius/PyClassLessons | instructors/course-2015/functions_gens_and_ducks/examples/in_class/color_choice_refactor.py | 3 | 1418 | """Choose 3 colors at random from the six color options -
"red","blue","green","purple","yellow","orange"
"""
import random
myColors=(["red","blue","green","purple","yellow","orange"])
a=random.choice(myColors)
b=random.choice(myColors)
c=random.choice(myColors)
d=random.choice(myColors)
line=[a,b,c,d]
D=dict()
for c... | mit | 1,235,833,155,699,136,000 | 18.985915 | 60 | 0.51622 | false | 3.179372 | false | false | false |
rilutham/HAC-DM | src/MainWindow.py | 1 | 26850 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""MainWindow.py
@author: rilutham
"""
from PyQt4 import QtGui
from RawData import RawData
from Preprocessing import Bining, DeriveAttribute
from Segmentation import Segmentation
from About import About
import matplotlib.pyplot as plt
from matplotlib.backends.backend_qt4agg i... | mit | 8,529,156,216,676,085,000 | 44.508475 | 174 | 0.6127 | false | 3.474379 | false | false | false |
levilucio/SyVOLT | ExFamToPerson/transformation/HCityCompany2Association.py | 1 | 3243 | from core.himesis import Himesis
import uuid
class HCityCompany2Association(Himesis):
def __init__(self):
"""
Creates the himesis graph representing the DSLTrans rule CityCompany2Association.
"""
# Flag this instance as compiled now
self.is_compiled = True
... | mit | -7,335,360,096,594,106,000 | 31.43 | 110 | 0.488437 | false | 3.998767 | false | false | false |
emacsmirror/stgit | stgit/commands/common.py | 1 | 16342 | """Function/variables common to all the commands"""
import email.utils
import os
import re
import sys
from stgit import templates
from stgit.compat import decode_utf8_with_latin1
from stgit.config import config
from stgit.exception import StgException
from stgit.lib.git import CommitData, MergeException, RepositoryEx... | gpl-2.0 | 6,991,844,058,826,038,000 | 27.821869 | 88 | 0.594052 | false | 3.814659 | true | false | false |
bhavin04890/finaldashboard | modules/eden/vulnerability.py | 3 | 17256 | # -*- coding: utf-8 -*-
""" Sahana Eden Vulnerability Model
@copyright: 2012 (c) Sahana Software Foundation
@license: MIT
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 with... | mit | 6,863,977,461,972,140,000 | 41.294118 | 93 | 0.480934 | false | 5.192898 | false | false | false |
Knio/osxactivity | window.py | 1 | 3156 | import os
import time
import subprocess
import logging
import json
import sys
import structpack
from collections import defaultdict
IDLE_TIME = 15
APP_TIME = 1
log = logging.getLogger()
logging.basicConfig(
level=logging.DEBUG,
# format='%(message)s',
datefmt='%Y-%m-%d %H:%M:%s',
filename='logs/windo... | mit | -6,299,528,443,896,209,000 | 19.36129 | 105 | 0.553549 | false | 3.510567 | false | false | false |
mosbasik/rvagaming-flask | app/views.py | 1 | 2055 | from flask import render_template, flash, redirect, session, url_for, request, g
from flask.ext.login import login_user, logout_user, current_user, login_required
from app import app, db, lm, oid
from forms import LoginForm
from models import Site_User
@lm.user_loader
def load_user(id):
return User.query.get(int(... | mit | 5,976,283,463,642,106,000 | 33.25 | 90 | 0.516788 | false | 3.819703 | false | false | false |
salabim/salabim | sample models/Demo animate 2.py | 1 | 1276 | # Demo animate 2.py
import salabim as sim
class AnimateWaitSquare(sim.Animate):
def __init__(self, i):
self.i = i
sim.Animate.__init__(
self, rectangle0=(-10, -10, 10, 10), x0=300 - 30 * i, y0=100, fillcolor0="red", linewidth0=0
)
def visible(self, t):
... | mit | -374,682,658,797,282,800 | 21.62963 | 104 | 0.547806 | false | 3.182045 | false | false | false |
rdmorganiser/rdmo | rdmo/questions/migrations/0007_refactoring.py | 2 | 11515 | # -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2017-01-26 16:01
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('questions', '0006_auto_20160803_1619'),
]
operations ... | apache-2.0 | -6,882,792,998,716,746,000 | 49.951327 | 340 | 0.608597 | false | 4.405126 | false | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.