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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
mozman/ezdxf | tests/test_01_dxf_entities/test_131_field_list.py | 1 | 2369 | # Copyright (c) 2019 Manfred Moitzi
# License: MIT License
from typing import cast
import pytest
import ezdxf
from ezdxf.entities.idbuffer import FieldList
from ezdxf.lldxf.tagwriter import TagCollector, basic_tags_from_text
FIELDLIST = """0
FIELDLIST
5
0
102
{ACAD_REACTORS
330
0
102
}
330
0
100
AcDbIdSet
90
12
100
Ac... | mit | -7,176,212,482,512,180,000 | 21.561905 | 69 | 0.662727 | false | 3.133598 | true | false | false |
krautradio/PyRfK | lib/rfk/database/base.py | 1 | 14479 | import time
import hashlib
from datetime import timedelta
from passlib.hash import bcrypt
from sqlalchemy import *
from sqlalchemy.orm import relationship, backref, exc
from sqlalchemy.dialects.mysql import INTEGER as Integer
from sqlalchemy.ext.hybrid import hybrid_property, hybrid_method
from sqlalchemy.sql.express... | bsd-3-clause | 1,369,849,253,642,008,600 | 34.662562 | 113 | 0.58243 | false | 4.344134 | false | false | false |
albertoferna/compmech | setup.py | 1 | 1198 | from glob import glob
import sys
import os
from subprocess import Popen
import numpy
#params = 'build_ext -inplace -IC:\clones\cubature\cubature ' + ' '.join(sys.argv[1:])
params = 'build_ext --inplace -I%s' % numpy.get_include() + ' '.join(sys.argv[1:]) + ' clean'
cwd = os.getcwd()
if os.name == 'nt':
use_sdk =... | bsd-3-clause | 8,871,118,216,028,705,000 | 29.717949 | 93 | 0.569282 | false | 3.040609 | false | false | false |
MicBrain/Scheme-Interpreter | scheme.py | 1 | 21214 | """This module implements the core Scheme interpreter functions, including the
eval/apply mutual recurrence, environment model, and read-eval-print loop.
"""
from scheme_primitives import *
from scheme_reader import *
from ucb import main, trace
##############
# Eval/Apply #
##############
def scheme_eval(expr, env)... | apache-2.0 | 1,368,474,208,198,917,400 | 35.139693 | 93 | 0.593335 | false | 3.926337 | false | false | false |
beefoo/still-i-rise | collect_sound_data.py | 1 | 2076 | # -*- coding: utf-8 -*-
# Description: generate audio clips for lines, words, and syllables
import argparse
import json
import os
from pprint import pprint
import re
import subprocess
import sys
# input
parser = argparse.ArgumentParser()
parser.add_argument('-in', dest="INPUT_FILE", default="still_i_rise.wav", help=... | mit | 2,398,684,887,728,343,000 | 55.108108 | 323 | 0.725915 | false | 2.969957 | false | false | false |
googleapis/googleapis-gen | google/cloud/talent/v4beta1/talent-v4beta1-py/google/cloud/talent_v4beta1/services/job_service/transports/grpc.py | 1 | 23359 | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# 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... | apache-2.0 | 5,724,087,368,380,103,000 | 42.580224 | 87 | 0.609615 | false | 4.638403 | false | false | false |
chungjjang80/FRETBursts | fretbursts/burstlib.py | 1 | 133746 | #
# FRETBursts - A single-molecule FRET burst analysis toolkit.
#
# Copyright (C) 2013-2016 The Regents of the University of California,
# Antonino Ingargiola <tritemio@gmail.com>
#
"""
This module contains all the main FRETBursts analysis functions.
`burstslib.py` defines the fundamental object `Data()`... | gpl-2.0 | -7,185,521,470,680,014,000 | 41.513032 | 82 | 0.562813 | false | 3.492336 | false | false | false |
sl2017/campos | campos_jobber_final/models/campos_jobber_accom_group.py | 1 | 1182 | # -*- coding: utf-8 -*-
# Copyright 2017 Stein & Gabelgaard ApS
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from openerp import api, fields, models, _
class CamposJobberAccomGroup(models.Model):
_name = 'campos.jobber.accom.group'
_description = 'Campos Jobber Accom Group' # TODO
n... | agpl-3.0 | 1,359,394,841,940,174,300 | 38.433333 | 114 | 0.64467 | false | 3.507418 | false | false | false |
OpenTouch/python-facette | src/facette/v1/groupentry.py | 1 | 1278 | # Copyright (c) 2014 Alcatel-Lucent Enterprise
# 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
#
# Un... | apache-2.0 | -6,053,528,661,753,423,000 | 34.5 | 78 | 0.682316 | false | 3.6 | false | false | false |
macarthur-lab/xbrowse | xbrowse_server/api/views.py | 1 | 67273 | import datetime
import csv
import json
import logging
import sys
import traceback
from collections import defaultdict
from django.views.decorators.csrf import csrf_exempt
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.shortcuts import get_object_or_404
from django... | agpl-3.0 | -8,759,921,877,234,000,000 | 36.645775 | 170 | 0.615225 | false | 3.801808 | false | false | false |
dvklopfenstein/PrincetonAlgorithms | py/AlgsSedgewickWayne/Topological.py | 1 | 2002 | """Compute topological ordering(w DFS) of a DAG or edge-weighted DAG. Runs in O(E + V) time."""
# TBD Finish Python port
from AlgsSedgewickWayne.DirectedCycle import DirectedCycle
from AlgsSedgewickWayne.DepthFirstOrder import DepthFirstOrder
from AlgsSedgewickWayne.EdgeWeightedDigraph import EdgeWeightedDigraph
from... | gpl-2.0 | -1,320,169,917,173,574,100 | 39.04 | 95 | 0.695305 | false | 3.398981 | false | false | false |
WizeCommerce/medusa | setup.py | 1 | 1292 | #!/usr/bin/env python
import os
from setuptools import setup, find_packages
# Utility function to read the README file.
# Used for the long_description. It's nice, because now 1) we have a top level
# README file and 2) it's easier to type in the README file than to put a raw
# string in below ...
def read(fname):
... | apache-2.0 | -8,982,372,392,790,578,000 | 37 | 119 | 0.647059 | false | 3.578947 | false | false | false |
open-austin/influence-texas | src/influencetx/legislators/migrations/0001_initial.py | 1 | 1680 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2019-01-17 17:38
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Legis... | gpl-2.0 | -3,630,584,201,326,298,000 | 41 | 150 | 0.554167 | false | 4.009547 | false | false | false |
raphaelrpl/portal | backend/appengine/routes/questions/rest.py | 1 | 4013 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from time import sleep
from gaebusiness.business import CommandExecutionException
from permission_app.permission_facade import main_user_form
from tekton.gae.middleware.json_middleware import JsonResponse
from question_app import question_... | mit | -3,836,463,681,952,738,300 | 33.299145 | 115 | 0.673561 | false | 3.821905 | false | false | false |
mozillazg/bustard | tests/httpbin/core.py | 1 | 21325 | # -*- coding: utf-8 -*-
"""
httpbin.core
~~~~~~~~~~~~
This module provides the core HttpBin experience.
"""
import base64
import json
import os
import random
import time
import uuid
from bustard.app import Bustard
from bustard.http import (
Response, Headers, jsonify as bustard_jsonify, redirect
)
from bustard.... | mit | 1,247,459,229,769,562,400 | 27.245033 | 81 | 0.608488 | false | 3.708696 | false | false | false |
SurfasJones/icecream-info | icecream/lib/python2.7/site-packages/sphinx/search/__init__.py | 1 | 11415 | # -*- coding: utf-8 -*-
"""
sphinx.search
~~~~~~~~~~~~~
Create a full-text search index for offline search.
:copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from __future__ import with_statement
import re
import cPickle as pickle
from do... | mit | -8,059,802,016,210,315,000 | 33.279279 | 80 | 0.565484 | false | 4.215288 | false | false | false |
ilya-epifanov/ansible | lib/ansible/plugins/strategies/linear.py | 1 | 14293 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible 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) an... | gpl-3.0 | -5,798,462,310,246,295,000 | 45.405844 | 179 | 0.547331 | false | 4.777072 | false | false | false |
Huyuwei/tvm | topi/python/topi/image/resize.py | 1 | 7184 | # 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,464,358,940,680,116,000 | 32.886792 | 96 | 0.549415 | false | 2.980913 | false | false | false |
ictofnwi/coach | dashboard/views.py | 1 | 19639 | import random
import re
import json
import pytz
import dateutil.parser
from datetime import datetime, timedelta
from pprint import pformat
from hashlib import md5
from django.http import HttpResponse
from django.core.exceptions import ObjectDoesNotExist
from django.shortcuts import render, redirect
from django.conf im... | agpl-3.0 | -7,548,557,729,014,595,000 | 38.594758 | 82 | 0.585671 | false | 4.473576 | false | false | false |
mikacousin/olc | src/ascii_load.py | 1 | 25915 | """ASCII file: Load functions"""
import array
from olc.channel_time import ChannelTime
from olc.cue import Cue
from olc.define import MAX_CHANNELS, NB_UNIVERSES, App
from olc.device import Device, Parameter, Template
from olc.group import Group
from olc.independent import Independent
from olc.master import Master
fro... | gpl-3.0 | -7,586,853,367,817,942,000 | 41.001621 | 88 | 0.353849 | false | 4.790203 | false | false | false |
mementum/backtrader | samples/vctest/vctest.py | 1 | 15011 | #!/usr/bin/env python
# -*- coding: utf-8; py-indent-offset:4 -*-
###############################################################################
#
# Copyright (C) 2015-2020 Daniel Rodriguez
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License a... | gpl-3.0 | 3,710,281,282,891,024,000 | 35.612195 | 79 | 0.541136 | false | 4.155869 | false | false | false |
vivisect/synapse | synapse/lib/trigger.py | 1 | 1918 | import logging
import synapse.lib.cache as s_cache
logger = logging.getLogger(__name__)
class Triggers:
def __init__(self):
self._trig_list = []
self._trig_match = s_cache.MatchCache()
self._trig_byname = s_cache.Cache(onmiss=self._onTrigNameMiss)
def clear(self):
'''
... | apache-2.0 | -5,746,460,234,072,582,000 | 25.638889 | 79 | 0.519291 | false | 4.063559 | false | false | false |
orionzhou/robin | utils/counter.py | 1 | 6732 | """
Counter class for py2.6 back compat.
<http://code.activestate.com/recipes/576611/>
"""
from operator import itemgetter
from heapq import nlargest
from itertools import repeat, ifilter
class Counter(dict):
'''Dict subclass for counting hashable objects. Sometimes called a bag
or multiset. Elements are st... | gpl-2.0 | -6,222,579,013,777,309,000 | 32 | 85 | 0.531491 | false | 4.210131 | false | false | false |
wjakob/layerlab | recipes/utils/materials.py | 1 | 6279 | # Complex-valued IOR curves for a few metals
from scipy import interpolate
lambda_gold = [298.75705, 302.400421, 306.133759, 309.960449, 313.884003, 317.908142,
322.036835, 326.274139, 330.624481, 335.092377, 339.682678, 344.400482,
349.251221, 354.240509, 359.37442, 364.659332, 370.10202, 375.709625,
381... | bsd-2-clause | 1,225,152,362,439,384,800 | 60.558824 | 85 | 0.637363 | false | 1.763764 | false | false | false |
angus-ai/angus-jumpingsumo | wrapper.py | 1 | 3347 | # -*- coding: utf-8 -*-
#!/usr/bin/env python
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache Licens... | apache-2.0 | -9,205,598,472,601,172,000 | 24.356061 | 74 | 0.58052 | false | 3.649945 | false | false | false |
nhatbui/pysuite | pookeeper/pookeeper/pookeeper.py | 1 | 7385 | import os
from collections import defaultdict, OrderedDict
from twisted.internet.protocol import Factory
from twisted.protocols.basic import LineReceiver
from twisted.internet import reactor
class ZooKeeper(LineReceiver):
def __init__(self, connection_addr, znodes, ephem_nodes):
self.address = connection... | mit | -7,960,860,430,897,966,000 | 29.899582 | 91 | 0.55545 | false | 3.870545 | false | false | false |
FluidityStokes/fluidity | tests/mms_tracer_P1dg_cdg_diff_steady_3d_cjc_inhNmnnbc/cdg3d.py | 1 | 1504 | import os
from fluidity_tools import stat_parser
from sympy import *
from numpy import array,max,abs
meshtemplate='''
Point(1) = {0.0,0.0,0,0.1};
Extrude {1,0,0} {
Point{1}; Layers{<layers>};
}
Extrude {0,1,0} {
Line{1}; Layers{<layers>};
}
Extrude {0,0,1} {
Surface{5}; Layers{<layers>};
}
//Z-normal surface, z=... | lgpl-2.1 | -6,174,876,977,776,289,000 | 25.857143 | 77 | 0.664229 | false | 2.94902 | false | false | false |
hzlf/openbroadcast | website/apps/__rework_in_progress/importer/api.py | 1 | 7486 | from django.conf import settings
from django.conf.urls.defaults import *
from django.contrib.auth.models import User
from django.db.models import Count
import json
from tastypie import fields
from tastypie.authentication import *
from tastypie.authorization import *
from tastypie.resources import ModelResource, Resourc... | gpl-3.0 | 2,424,500,771,755,327,000 | 31.837719 | 190 | 0.56786 | false | 4.050866 | false | false | false |
crempp/mdweb | mdweb/SiteMapView.py | 1 | 2696 | """MDWeb SiteMap View Object."""
import datetime
import logging
import numbers
import os
import pytz
import time
from flask import (
current_app as app,
make_response,
render_template_string,
url_for,
)
from flask.views import View
#: Template string to use for the sitemap generation
# (is there a bet... | mit | -4,282,121,319,264,830,000 | 30.717647 | 124 | 0.585682 | false | 3.845934 | false | false | false |
armyofevilrobots/reticulatus | reticulatus/gui/reticulate_main.py | 1 | 13375 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'reticulate_main.ui'
#
# Created: Thu Oct 25 21:48:45 2012
# by: pyside-uic 0.2.13 running on PySide 1.1.0
#
# WARNING! All changes made in this file will be lost!
from PySide import QtCore, QtGui
class Ui_main_window(object):
def ... | gpl-3.0 | -5,630,036,228,393,934,000 | 61.209302 | 173 | 0.717458 | false | 3.835675 | false | false | false |
mitodl/micromasters | cms/migrations/0025_infolinks.py | 1 | 1226 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2016-12-05 22:18
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import modelcluster.fields
class Migration(migrations.Migration):
dependencies = [
('cms', '0024_programtabpage'),
... | bsd-3-clause | -5,478,774,938,762,284,000 | 38.548387 | 161 | 0.604405 | false | 4.127946 | false | false | false |
vpelletier/neoppod | neo/master/backup_app.py | 1 | 16200 | #
# Copyright (C) 2012-2016 Nexedi SA
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed... | gpl-2.0 | -8,403,937,226,814,069,000 | 45.685879 | 80 | 0.555 | false | 4.473902 | false | false | false |
redhat-openstack/glance | glance/cmd/registry.py | 1 | 2664 | #!/usr/bin/env python
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2011 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file ... | apache-2.0 | -6,918,632,415,636,315,000 | 32.3 | 78 | 0.626502 | false | 4.188679 | false | false | false |
adusca/treeherder | treeherder/perf/models.py | 1 | 2417 | from django.core.validators import MinLengthValidator
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from jsonfield import JSONField
from treeherder.model.models import (MachinePlatform,
OptionCollection,
... | mpl-2.0 | -5,983,352,198,108,781,000 | 33.042254 | 83 | 0.620604 | false | 4.621415 | false | false | false |
lovetox/gajim | src/common/crypto.py | 1 | 4823 | # common crypto functions (mostly specific to XEP-0116, but useful elsewhere)
# -*- coding:utf-8 -*-
## src/common/crypto.py
##
## Copyright (C) 2007 Brendan Taylor <whateley AT gmail.com>
##
## This file is part of Gajim.
##
## Gajim is free software; you can redistribute it and/or modify
## it under the terms of the ... | gpl-3.0 | 1,936,273,987,310,581,000 | 30.940397 | 94 | 0.6243 | false | 3.601942 | false | false | false |
python-dirbtuves/it-brandos-egzaminai | exams/E2018/pagrindinis/u2/u2.py | 1 | 1377 | from itertools import islice
from pathlib import Path
from typing import Dict
def seconds(v: int, m: int, s: int) -> int:
# Ši funkcija verčia valandas, minutes ir sekundes į sekundes.
return v * 3600 + m * 60 + s
def save_results(path: Path, pabaiga: Dict[str, int]) -> None:
with path.open('w') as f:
... | agpl-3.0 | -4,870,201,727,215,256,000 | 33.075 | 78 | 0.590609 | false | 2.720559 | false | false | false |
Woraufhin/logic | formula.py | 1 | 1112 | import itertools
import string
from abc import ABCMeta, abstractproperty
import attr
def is_valid_formula(inst, attr, value):
if not isinstance(value, (Formula, str)):
raise ValueError('{} is not a valid formula type.'.format(value))
class Formula(object):
__metaclass__ = ABCMeta
group = {'ope... | mit | 1,520,875,086,732,139,300 | 19.592593 | 73 | 0.642986 | false | 3.379939 | false | false | false |
googleapis/python-dataflow-client | google/cloud/dataflow_v1beta3/types/snapshots.py | 1 | 5677 | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# 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... | apache-2.0 | 4,473,963,810,072,339,500 | 31.815029 | 95 | 0.648758 | false | 4.084173 | false | false | false |
invariantor/ImageSplit-Classification | image split and classification/image_split.py | 1 | 6276 | import numpy as np
import pylab
import mahotas as mh
import types
# constants
upper_distance = 100 #the start searching
approxWidth = 40
threshold = 300
border = 1
def pre_process(image):
"""
pre_process will return black_white image, given a colorful image as input.
"""
T = mh.threshol... | mit | -6,850,167,160,207,502,000 | 28.608491 | 149 | 0.53362 | false | 3.273865 | false | false | false |
Maselkov/GW2Bot | guildwars2/evtc.py | 1 | 12990 | import datetime
import aiohttp
import discord
from discord.ext import commands
from discord.ext.commands.cooldowns import BucketType
from .exceptions import APIError
from .utils.chat import (embed_list_lines, en_space, magic_space,
zero_width_space)
UTC_TZ = datetime.timezone.utc
BASE_URL =... | mit | -8,968,317,482,185,168,000 | 39.702194 | 79 | 0.522027 | false | 4.15488 | false | false | false |
mit-ll/LO-PHI | lophi-automation/lophi_automation/dataconsumers/logudp.py | 1 | 1294 | """
Class to handle logging over UDP
(c) 2015 Massachusetts Institute of Technology
"""
# Native
import socket
import logging
logger = logging.getLogger(__name__)
class LogUDP:
def __init__(self,address,port):
"""
Intialize our UDP logger
@param addre... | bsd-3-clause | -5,603,330,343,461,050,000 | 22.125 | 72 | 0.506955 | false | 4.957854 | false | false | false |
jprawiharjo/Nerddit | Storm/Streaming/Push_to_Cassandra_Bolt.py | 1 | 3976 | # -*- coding: utf-8 -*-
"""
Created on Sat Jan 23 13:37:20 2016
@author: jprawiharjo
"""
from cassandra.cluster import Cluster
import cassandra
from collections import namedtuple
from pyleus.storm import SimpleBolt
from Streaming.Doc_Processor import DataFrame
import logging
log = logging.getLogger('cassandra_bolt')
... | gpl-3.0 | 9,044,771,838,797,030,000 | 37.240385 | 124 | 0.608903 | false | 3.740357 | false | false | false |
googleapis/googleapis-gen | google/ads/googleads/v7/googleads-py/google/ads/googleads/v7/enums/types/placeholder_type.py | 1 | 1630 | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# 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... | apache-2.0 | -9,196,301,452,706,389,000 | 27.103448 | 74 | 0.634969 | false | 3.773148 | false | false | false |
julierthanjulie/PedestrianTracking | generate_frames.py | 1 | 3979 |
"""
This code generates frames from CSV values that can be stiched together using FFMPEG
to animate pedestrian data. This version produces an animation at 4x speed.
"""
print "Importing..."
# Please ensure the following dependencies are installed before use:
import pylab
import numpy as np
import itertools
impo... | mit | -6,176,049,097,840,916,000 | 22.96988 | 149 | 0.643629 | false | 2.821986 | false | false | false |
by46/simplekit | simplekit/email/__init__.py | 1 | 4151 | import httplib
import os.path
import requests
import six
from simplekit import settings
from simplekit.exceptions import MailException
PRIORITY_NORMAL = 0
PRIORITY_LOW = 1
PRIORITY_HIGH = 2
CONTENT_TYPE_HTML = 0
CONTENT_TYPE_TEXT = 1
ENCODING_UTF8 = 0
ENCODING_ASCII = 1
ENCODING_UTF32 = 2
ENCODI... | mit | -3,068,504,204,268,324,000 | 33.177966 | 115 | 0.582751 | false | 3.847081 | false | false | false |
pentestfail/TA-FireEye_TAP | bin/input_module_fireeye_tap_incidents.py | 1 | 4568 |
# encoding = utf-8
import os
import sys
import time
import datetime
import json
def validate_input(helper, definition):
api_env = definition.parameters.get('api_env', None)
instanceid = definition.parameters.get('instance_id', None)
apikey = definition.parameters.get('apikey', None)
api_limit = defin... | mit | -2,108,804,593,542,460,400 | 43.794118 | 183 | 0.632443 | false | 3.910959 | false | false | false |
turtlewit/GSHS_RPG | AdventureEngine/CoreEngine/input.py | 2 | 3088 | #------------------------------------------------------------------------------#
# Copyright 2016-2017 Golden Sierra Game Development Class #
# This file is part of Verloren (GSHS_RPG). #
# ... | gpl-3.0 | 1,061,857,247,540,585,600 | 35.204819 | 80 | 0.510687 | false | 3.979381 | false | false | false |
TheOriginalBDM/Lazy-Cleaner-9000 | code/clean_sweep_vision.py | 1 | 6258 | #!/usr/bin/env python
from picamera.array import PiRGBArray
from picamera import PiCamera
import cv2
import time
from colormath.color_diff import delta_e_cie2000
from colormath.color_objects import LabColor, sRGBColor
from colormath.color_conversions import convert_color
def nothing(*arg):
pass
def is_allowed_co... | gpl-3.0 | 5,175,269,980,451,224,000 | 30.606061 | 135 | 0.563279 | false | 2.843253 | false | false | false |
raiden-network/raiden | raiden/utils/upgrades.py | 1 | 8374 | import os
import sqlite3
import sys
from contextlib import closing
from glob import escape, glob
from pathlib import Path
import filelock
import structlog
from raiden.constants import RAIDEN_DB_VERSION
from raiden.storage.sqlite import SQLiteStorage
from raiden.storage.versions import VERSION_RE, filter_db_names, lat... | mit | -4,492,969,264,185,019,000 | 36.891403 | 98 | 0.614999 | false | 4.143493 | true | false | false |
tymmothy/dds3x25 | dds3x25/dds.py | 1 | 12274 | #!/usr/bin/env python
"""
This is an interface library for Hantek DDS-3X25 arbitrary waveform generator.
Licenced LGPL2+
Copyright (C) 2013 Domas Jokubauskis (domas@jokubauskis.lt)
Copyright (C) 2014 Tymm Twillman (tymmothy@gmail.com)
"""
import struct
import math
import collections
# dds3x25 imports...
from usb_int... | lgpl-2.1 | 106,578,187,649,829,000 | 32.535519 | 130 | 0.607952 | false | 3.744356 | true | false | false |
atzengin/OCC | oc-utils/python/modtool/code_generator.py | 1 | 2298 | #
# Copyright 2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your option)
# any later version.
#
#... | gpl-3.0 | -1,651,171,289,484,127,200 | 41.555556 | 76 | 0.681027 | false | 3.836394 | false | false | false |
mostaphaRoudsari/Honeybee | src/Honeybee_AskMe.py | 1 | 1992 | #
# Honeybee: A Plugin for Environmental Analysis (GPL) started by Mostapha Sadeghipour Roudsari
#
# This file is part of Honeybee.
#
# Copyright (c) 2013-2020, Mostapha Sadeghipour Roudsari <mostapha@ladybug.tools>
# Honeybee is free software; you can redistribute it and/or modify
# it under the terms of the GNU G... | gpl-3.0 | -3,768,216,618,678,705,700 | 35.218182 | 100 | 0.744478 | false | 3.207729 | false | false | false |
wdv4758h/ZipPy | edu.uci.python.benchmark/src/benchmarks/euler31-timed.py | 1 | 1614 | #runas solve()
#unittest.skip recursive generator
#pythran export solve()
# 01/08/14 modified for benchmarking by Wei Zhang
import sys, time
COINS = [1, 2, 5, 10, 20, 50, 100, 200]
# test
def _sum(iterable):
sum = None
for i in iterable:
if sum is None:
sum = i
else:
su... | bsd-3-clause | 7,452,297,059,408,330,000 | 23.830769 | 115 | 0.576208 | false | 3.189723 | false | false | false |
longde123/MultiversePlatform | lib/IPCE/Lib/ctypes.py | 1 | 5974 | # Copyright (c) 2006 Seo Sanghyeon
# 2006-06-08 sanxiyn Created
# 2006-06-11 sanxiyn Implemented .value on primitive types
# 2006-11-02 sanxiyn Support for multiple signatures
__all__ = [
'c_int', 'c_float', 'c_double', 'c_char_p', 'c_void_p',
'LibraryLoader', 'CDLL', 'cdll',
'byref', 'sizeof'
]
# --... | mit | -2,151,948,963,422,639,000 | 25.789238 | 70 | 0.571142 | false | 4.105842 | false | false | false |
bergolho1337/URI-Online-Judge | Basicos/Python/1061/main.py | 1 | 1292 | # -*- coding: utf-8 -*-
def converteString (dia, hora):
evento = []
# Parse do dia
num = dia[4:6]
evento.append(int(num))
# Parse da hora
num = hora[0:2]
evento.append(int(num))
# Parse dos minutos
num = hora[5:7]
evento.append(int(num))
# Parse dos segundos
num = hora[1... | gpl-2.0 | -1,258,978,114,268,866,600 | 25.387755 | 78 | 0.629257 | false | 2.327928 | false | false | false |
google/material-design-icons | update/venv/lib/python3.9/site-packages/fontTools/varLib/plot.py | 5 | 4153 | """Visualize DesignSpaceDocument and resulting VariationModel."""
from fontTools.varLib.models import VariationModel, supportScalar
from fontTools.designspaceLib import DesignSpaceDocument
from matplotlib import pyplot
from mpl_toolkits.mplot3d import axes3d
from itertools import cycle
import math
import logging
impor... | apache-2.0 | -5,397,906,847,771,724,000 | 23.868263 | 80 | 0.642427 | false | 2.69151 | false | false | false |
inonit/django-chemtrails | tests/testapp/migrations/0005_guild.py | 1 | 1061 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-05-10 13:14
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('testapp', '0004_book_view_book_permission'),
]
ope... | mit | 6,104,085,431,111,180,000 | 34.366667 | 144 | 0.600377 | false | 4.144531 | false | false | false |
alfred82santa/tarrabme2 | src/orgs/models.py | 1 | 1856 | from django.db import models
from common.models import CommonModel, AbstractContact, AbstractAddress
from django.contrib.auth.models import Group
from imagekit.models import ProcessedImageField, ImageSpecField
from imagekit.processors import ResizeToFill
class Organization(CommonModel):
name = models.CharField(max... | gpl-3.0 | -9,086,944,784,570,360,000 | 34.692308 | 77 | 0.634698 | false | 4.450839 | false | false | false |
anneline/Bika-LIMS | bika/lims/utils/__init__.py | 1 | 13899 | from time import time
from AccessControl import ModuleSecurityInfo, allow_module
from bika.lims import logger
from bika.lims.browser import BrowserView
from DateTime import DateTime
from email import Encoders
from email.MIMEBase import MIMEBase
from plone.memoize import ram
from plone.registry.interfaces import IRegist... | agpl-3.0 | -5,184,133,056,224,156,000 | 29.818182 | 86 | 0.630189 | false | 3.817358 | false | false | false |
zmarvel/slowboy | slowboy/util.py | 1 | 1753 |
import abc
from collections import namedtuple
Op = namedtuple('Op', ['function', 'cycles', 'description'])
class ClockListener(metaclass=abc.ABCMeta):
@abc.abstractmethod
def notify(self, clock: int, cycles: int):
"""Notify the listener that the clock has advanced.
:param clock: The new valu... | mit | 8,089,310,398,789,706,000 | 24.405797 | 75 | 0.590416 | false | 3.240296 | false | false | false |
koreiklein/fantasia | ui/render/gl/distances.py | 1 | 1104 | # Copyright (C) 2013 Korei Klein <korei.klein1@gmail.com>
# Constants for gl rendering of basic are collected here.
from ui.render.gl import colors
epsilon = 0.0001
divider_spacing = 15.0
notThickness = 22.0
notShiftThickness = notThickness + 21.0
# Amount by which to shift the value contained inside a Not.
notShi... | gpl-2.0 | -6,752,107,023,383,802,000 | 19.444444 | 64 | 0.764493 | false | 2.860104 | false | false | false |
shakfu/start-vm | default/bin/normalize.py | 1 | 1259 | #!/usr/bin/env python
import hashlib
import os
import sys
from datetime import datetime
HASH = hashlib.md5(str(datetime.now())).hexdigest()
def normalize(path, file_func=None, dir_func=None):
''' recursive normalization of directory and file names
applies the following changes to directory and filenames... | mit | -1,232,118,386,050,333,700 | 23.211538 | 65 | 0.597299 | false | 3.449315 | false | false | false |
luci/luci-py | appengine/components/components/auth/change_log_test.py | 2 | 45674 | #!/usr/bin/env vpython
# Copyright 2014 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
import datetime
import sys
import unittest
from test_support import test_env
test_env.setup_test_env()
from google.appeng... | apache-2.0 | -6,992,933,365,418,927,000 | 38.238832 | 80 | 0.593073 | false | 3.291108 | true | false | false |
HydrelioxGitHub/PiDDL | ZTPAGE.py | 1 | 2847 | # coding: utf-8
from urllib2 import urlopen
import urllib2
import bs4 as BeautifulSoup
class ZTPage:
def __init__(self, url):
self.url = url
self.update()
def update(self):
self.update_content()
self.parse_type()
self.parse_infos()
self.parse_links()
def ... | gpl-2.0 | 8,344,752,789,403,362,000 | 32.892857 | 95 | 0.556024 | false | 3.842105 | false | false | false |
darknao/piOClock | ssd1351.py | 1 | 13500 | #!/bin/env python
# -*- coding: UTF-8 -*-
# ----------------------------------------------------------------------
# ssd1351.py from https://github.com/guyc/py-gaugette
# ported by Jason Porritt,
# and reworked by darknao,
# based on original work by Guy Carpenter for display.py
#
# This library works with
# Adafruit... | gpl-3.0 | 4,144,339,368,829,440,500 | 32.039216 | 96 | 0.548368 | false | 3.222568 | false | false | false |
bnx05/pytest-selenium | test_parameters.py | 1 | 2603 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import pytest
import time
from selenium import webdriver
sample_email_address = "demo@engagespark.com"
sample_password = "Password123"
email_addresses = ["invalid_email", "another_invalid_email@", "not_another_invalid_email@blah"]
passwords = ["weak_password", "generic_p... | mit | -6,535,209,611,040,000,000 | 36.724638 | 96 | 0.717633 | false | 3.443122 | true | false | false |
DonaldTrumpHasTinyHands/tiny_hands_pac | documents_gallery/models.py | 1 | 4091 | from django.db import models
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from wagtail.wagtailcore.fields import RichTextField
from wagtail.wagtailcore.models import Page
from wagtail.wagtailadmin.edit_handlers import FieldPanel, MultiFieldPanel
from wagtail.wagtaildocs.models import Docume... | mit | 3,715,756,117,222,630,000 | 29.088235 | 104 | 0.676363 | false | 4.279289 | false | false | false |
mrocklin/into | into/backends/sql_csv.py | 1 | 2811 |
from ..regex import RegexDispatcher
from ..append import append
from .csv import CSV
import os
import datashape
import sqlalchemy
import subprocess
copy_command = RegexDispatcher('copy_command')
execute_copy = RegexDispatcher('execute_copy')
@copy_command.register('.*sqlite')
def copy_sqlite(dialect, tbl, csv):
... | bsd-3-clause | -432,463,007,566,880,260 | 27.683673 | 82 | 0.630736 | false | 3.655397 | false | false | false |
blenderben/lolstatbot | lolstatbot.py | 1 | 22559 | # Leauge of Legends Statistics Chat Bot
# A chat bot written in Python that provides match statistics right to your Twitch chat.
# 2015 Benjamin Chu - https://github.com/blenderben
import socket # imports module allowing connection to IRC
import threading # imports module allowing timing functions
import requests # im... | mit | 362,198,703,597,034,500 | 37.894828 | 164 | 0.675074 | false | 2.769335 | true | false | false |
pacpac1992/mymockup | src/widgets/tab.py | 1 | 3754 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import wx
import wx.lib.ogl as ogl
class Tab_dialog(wx.Dialog):
def __init__(self, parent, title):
super(Tab_dialog, self).__init__(parent, title=title,size=(410,220))
self.parent = parent
self.nombre = wx.TextCtrl(self,-1, pos=(10,10), size=(200,30),style=wx.TE_P... | mit | 5,063,618,514,684,932,000 | 23.86755 | 98 | 0.633724 | false | 2.453595 | false | false | false |
vegeclic/django-regularcom | blog/migrations/0001_initial.py | 1 | 14127 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'TaggedItem'
db.create_table('blog_taggeditem', (
('id', self.gf('django.db.model... | agpl-3.0 | -4,488,898,404,940,486,700 | 65.328638 | 216 | 0.590784 | false | 3.72253 | false | false | false |
Ultimaker/Cura | cura/XRayPass.py | 1 | 1577 | # Copyright (c) 2018 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
import os.path
from UM.Resources import Resources
from UM.Application import Application
from UM.PluginRegistry import PluginRegistry
from UM.View.RenderPass import RenderPass
from UM.View.RenderBatch import RenderBatch
f... | lgpl-3.0 | -1,777,091,487,277,248,500 | 38.425 | 147 | 0.715916 | false | 3.754762 | false | false | false |
the-nick-of-time/DnD | DnD/modules/resourceModule.py | 1 | 2471 | import tkinter as tk
from typing import Union
import lib.components as gui
import lib.resourceLib as res
import lib.settingsLib as settings
class ResourceDisplay(gui.Section):
"""Displays a resource like sorcery points or Hit Dice."""
def __init__(self, container: Union[tk.BaseWidget, tk.Tk], resource: res.... | gpl-2.0 | 771,843,469,293,149,600 | 34.811594 | 93 | 0.613112 | false | 3.490113 | false | false | false |
lptorres/noah-inasafe | web_api/third_party/simplejson/decoder.py | 1 | 14670 | """Implementation of JSONDecoder
"""
from __future__ import absolute_import
import re
import sys
import struct
from .compat import fromhex, b, u, text_type, binary_type, PY3, unichr
from .scanner import make_scanner, JSONDecodeError
def _import_c_scanstring():
try:
from ._speedups import scanstr... | gpl-3.0 | 8,479,624,750,722,993,000 | 35.712082 | 79 | 0.519632 | false | 4.300792 | false | false | false |
miaoski/bsideslv-plc-home | hmi.py | 1 | 1699 | # -*- coding: utf8 -*-
# This trivial HMI is decoupled from ModBus server
import gevent
from flask import Flask, render_template
from flask_sockets import Sockets
from pymodbus.client.sync import ModbusTcpClient
from time import sleep
import sys
app = Flask(__name__)
sockets = Sockets(app)
try:
myip = sys.argv[1... | gpl-2.0 | 4,138,471,727,828,687,000 | 23.623188 | 84 | 0.608005 | false | 3.248566 | false | false | false |
houshengbo/nova_vmware_compute_driver | nova/virt/hyperv/vmops.py | 1 | 25971 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Cloudbase Solutions Srl
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.ap... | apache-2.0 | -4,034,157,555,488,214,000 | 42.141196 | 79 | 0.576643 | false | 4.102844 | true | false | false |
mganeva/mantid | qt/applications/workbench/workbench/widgets/plotselector/presenter.py | 1 | 15293 | # Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source
# & Institut Laue - Langevin
# SPDX - License - Identifier: GPL - 3.0 +
# This file is part of the mantid workbench.... | gpl-3.0 | 4,486,501,413,745,917,000 | 36.760494 | 86 | 0.589028 | false | 4.316399 | false | false | false |
DailyActie/Surrogate-Model | surrogate/sampling/samLatinHypercube.py | 1 | 8477 | # MIT License
#
# Copyright (c) 2016 Daily Actie
#
# 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, ... | mit | 210,019,104,960,525,800 | 33.044177 | 99 | 0.572018 | false | 3.502893 | false | false | false |
pyannote/pyannote-parser | tests/test_repere.py | 1 | 2075 | #!/usr/bin/env python
# encoding: utf-8
# The MIT License (MIT)
# Copyright (c) 2014-2015 CNRS
# 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 limita... | mit | 1,854,699,619,890,575,400 | 31.920635 | 79 | 0.729508 | false | 3.764065 | false | false | false |
Rdbaker/Mealbound | tests/models/test_transactions.py | 1 | 4543 | """Test the Transaction models."""
from unittest.mock import patch
import pytest
from ceraon.models.transactions import Transaction
@pytest.mark.usefixtures('db')
class TestTransaction:
"""Transaction tests."""
def test_get_by_id(self, meal, host, guest):
"""Get Transaction by id."""
transa... | bsd-3-clause | 5,709,859,063,645,114,000 | 41.064815 | 80 | 0.657495 | false | 3.866383 | true | false | false |
ptisserand/ansible | lib/ansible/modules/cloud/amazon/cloudfront_distribution.py | 1 | 85955 | #!/usr/bin/python
# Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = '''
---
module... | gpl-3.0 | 7,483,290,099,521,737,000 | 42.302267 | 159 | 0.610645 | false | 4.467051 | true | false | false |
40223232/w16b_test | wsgi.py | 1 | 27797 | #@+leo-ver=5-thin
#@+node:2014fall.20141212095015.1775: * @file wsgi.py
# coding=utf-8
# 上面的程式內容編碼必須在程式的第一或者第二行才會有作用
################# (1) 模組導入區
# 導入 cherrypy 模組, 為了在 OpenShift 平台上使用 cherrypy 模組, 必須透過 setup.py 安裝
#@@language python
#@@tabwidth -4
#@+<<declarations>>
#@+node:2014fall.20141212095015.1776: ** <<declar... | gpl-3.0 | 421,274,124,816,849,400 | 29.535904 | 137 | 0.554152 | false | 2.049902 | false | false | false |
NeerajM999/recap-python | LearnPython/data_structures/binary_tree.py | 1 | 1761 | class Node:
def __init__(self, value):
self.value = value
self.left = None
self.right = None
class BinaryTree(object):
def __init__(self, root_val):
self.root = Node(root_val)
def preorder_traversal(self, start, traversal):
""" Root -> left -> right """
if... | gpl-3.0 | 1,749,836,215,305,637,600 | 27.885246 | 75 | 0.571266 | false | 3.6841 | false | false | false |
kret0s/gnuhealth-live | tryton/server/trytond-3.8.3/trytond/model/fields/one2one.py | 1 | 2080 | # This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
from types import NoneType
from trytond.model.fields.field import Field
from trytond.model.fields.many2many import Many2Many
from trytond.pool import Pool
class One2One(Many... | gpl-3.0 | 4,749,240,343,853,297,000 | 32.015873 | 72 | 0.546635 | false | 4.16 | false | false | false |
Metonimie/Beaglebone | programs/server.py | 1 | 3147 | #!/usr/bin/env python
"""
A very simple server in python
used to control gpio pins on the beaglebone black.
The server listens for POST requests on port
6410. It has no security at all, which means
that it accepts post-data from everyone.
Send a GET request::
curl http://localhost
Send a POST request::
curl -... | gpl-3.0 | 3,281,151,376,845,631,500 | 28.688679 | 77 | 0.571973 | false | 4.157199 | false | false | false |
arbrandes/edx-configuration | playbooks/roles/supervisor/files/pre_supervisor_checks.py | 1 | 12593 | import argparse
import boto.ec2
from boto.utils import get_instance_metadata, get_instance_identity
from boto.exception import AWSConnectionError
import hipchat
import os
import subprocess
import traceback
import socket
import time
# Services that should be checked for migrations.
MIGRATION_COMMANDS = {
'lms':... | agpl-3.0 | -2,843,304,026,179,480,000 | 45.640741 | 152 | 0.615262 | false | 4.182331 | false | false | false |
cyanogen/uchroma | uchroma/traits.py | 1 | 11759 | #
# uchroma - Copyright (C) 2021 Stefanie Kondik
#
# 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, version 3.
#
# This program is distributed in the hope that it will be useful, but
# WIT... | lgpl-3.0 | 468,926,082,809,482,900 | 28.619647 | 97 | 0.615188 | false | 3.944649 | false | false | false |
cardmagic/PyAMF | pyamf/adapters/_django_db_models_base.py | 1 | 8476 | # Copyright (c) 2007-2009 The PyAMF Project.
# See LICENSE.txt for details.
"""
`django.db.models` adapter module.
:see: `Django Project <http://www.djangoproject.com>`_
:since: 0.4.1
"""
from django.db.models.base import Model
from django.db.models import fields
from django.db.models.fields import related, files
... | mit | -6,217,738,496,913,844,000 | 28.430556 | 91 | 0.61975 | false | 4.080886 | false | false | false |
ICOS-Carbon-Portal/data | src/main/python/update-restheart/Restheart.py | 1 | 2242 | import requests
class Restheart(object):
def __init__(self):
# self._baseUrl = 'http://127.0.0.1:8088/db/' # localhost
self._baseUrl = 'https://restheart.icos-cp.eu/db/' # production
self._verfify = True if self._baseUrl.__contains__('restheart') else False
def get_records_to_update(self, op, pagesize, coll... | gpl-3.0 | 5,153,336,162,370,622,000 | 37.655172 | 189 | 0.650758 | false | 3.058663 | false | false | false |
domecraft/Games | RPG/classes.py | 1 | 3530 | class character:
def __init__(self, name, gender ,health, race, role, status, strength, defense, magic, bounty, income, reputation):
self.name = name
self.health = health
self.status = status
self.strength = strength
self.defense = defense
self.race = race
sel... | gpl-2.0 | 3,359,393,522,367,290,000 | 29.964912 | 119 | 0.545326 | false | 3.904867 | false | false | false |
fbergmann/libSEDML | examples/python/create_sedml.py | 1 | 5521 | #!/usr/bin/env python
##
## @file create_sedml.py
## @brief cerates a SED-ML document.
## @author Frank T. Bergmann
##
## <!--------------------------------------------------------------------------
## This file is part of libSEDML. Please visit http://sed-ml.org for more
## information about SEDML, and the la... | bsd-2-clause | 3,096,274,935,878,346,000 | 32.05988 | 119 | 0.685926 | false | 3.393362 | false | false | false |
molmod/yaff | yaff/pes/colvar.py | 1 | 13249 | # -*- coding: utf-8 -*-
# YAFF is yet another force-field code.
# Copyright (C) 2011 Toon Verstraelen <Toon.Verstraelen@UGent.be>,
# Louis Vanduyfhuys <Louis.Vanduyfhuys@UGent.be>, Center for Molecular Modeling
# (CMM), Ghent University, Ghent, Belgium; all rights reserved unless otherwise
# stated.
#
# This file is pa... | gpl-3.0 | -3,113,228,627,627,625,000 | 37.853372 | 102 | 0.611669 | false | 4.174228 | false | false | false |
russorat/savage-leads | api/models/lead.py | 1 | 2649 | from elasticsearch import Elasticsearch,RequestsHttpConnection,NotFoundError
from flask import url_for
import config
import json
class Lead(object):
es = Elasticsearch(config.ES_HOSTS,connection_class=RequestsHttpConnection)
@staticmethod
def create_lead(lead_data):
try:
results = Lead.es.create(index... | apache-2.0 | -1,660,902,958,443,782,400 | 29.102273 | 86 | 0.559079 | false | 3.800574 | false | false | false |
jaantollander/CrowdDynamics | crowddynamics/core/tests/test_interactions_benchmark.py | 1 | 1239 | import numpy as np
import pytest
from crowddynamics.core.interactions import agent_agent_block_list
from crowddynamics.core.vector2D import unit_vector
from crowddynamics.simulation.agents import Agents, Circular, ThreeCircle, \
AgentGroup
def attributes():
orientation = np.random.uniform(-np.pi, np.pi)
... | gpl-3.0 | 4,276,068,190,012,276,700 | 36.545455 | 80 | 0.684423 | false | 3.580925 | false | false | false |
myshkov/bnn-analysis | models/bbb_sampler.py | 1 | 4851 | """
This module implements Bayes By Backprop -based sampler for NNs.
http://jmlr.org/proceedings/papers/v37/blundell15.pdf
"""
import numpy as np
from keras.models import Sequential
from keras.layers.core import Activation
from keras import backend as K
from keras.engine.topology import Layer
from sampler import Samp... | mit | -8,254,993,371,662,850,000 | 35.201493 | 111 | 0.556999 | false | 3.433121 | false | false | false |
felixbr/nosql-rest-preprocessor | nosql_rest_preprocessor/models.py | 1 | 5131 | from __future__ import absolute_import, unicode_literals, print_function, division
from nosql_rest_preprocessor import exceptions
from nosql_rest_preprocessor.utils import non_mutating
class BaseModel(object):
required_attributes = set()
optional_attributes = None
immutable_attributes = set()
priv... | mit | 7,771,158,724,342,860,000 | 33.213333 | 161 | 0.524069 | false | 4.80881 | false | false | false |
math-a3k/django-ai | tests/test_models/migrations/0011_add_is_inferred_and_minor_tweaks.py | 1 | 2196 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-12-20 15:34
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('test_models', '0010_myunsupervisedlearningtechnique'),
]
operations = [
mig... | lgpl-3.0 | -7,274,611,177,119,370 | 33.857143 | 64 | 0.536885 | false | 4.565489 | false | false | false |
Makeystreet/makeystreet | woot/apps/catalog/views/review.py | 1 | 5983 | from django.conf import settings
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect, Http404
from django.shortcuts import render
from django.utils import timezone
from woot.apps.catalog.forms import CreateProductReviewForm,\
CreateShopReviewForm, CreateSpaceReviewForm
from wo... | apache-2.0 | 661,690,713,215,756,200 | 33.188571 | 77 | 0.563095 | false | 4.131906 | false | false | false |
semplea/characters-meta | python/alchemy/examples/alchemy_vision_v1.py | 1 | 1466 | import json
from os.path import join, dirname
from watson_developer_cloud import AlchemyVisionV1
alchemy_vision = AlchemyVisionV1(api_key='c851400276c1acbd020210847f8677e6d1577c26')
# Face recognition
with open(join(dirname(__file__), '../resources/face.jpg'), 'rb') as image_file:
print(json.dumps(alchemy_vision... | mit | 1,583,828,267,179,628,300 | 47.866667 | 106 | 0.71487 | false | 3.073375 | false | true | false |
mmclenna/engine | sky/tools/create_ios_sdk.py | 1 | 1820 | #!/usr/bin/env python
# Copyright 2016 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 argparse
import subprocess
import shutil
import sys
import os
def main():
parser = argparse.ArgumentParser(description='Crea... | bsd-3-clause | 4,522,966,620,628,158,000 | 26.575758 | 77 | 0.697802 | false | 3.427495 | false | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.