repo_name stringlengths 6 90 | path stringlengths 4 230 | copies stringlengths 1 4 | size stringlengths 4 7 | content stringlengths 734 985k | license stringclasses 15
values | hash int64 -9,223,303,126,770,100,000 9,223,233,360B | line_mean float64 3.79 99.6 | line_max int64 19 999 | alpha_frac float64 0.25 0.96 | autogenerated bool 1
class | ratio float64 1.5 8.06 | config_test bool 2
classes | has_no_keywords bool 2
classes | few_assignments bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
mumuwoyou/vnpy-master | sonnet/python/modules/nets/__init__.py | 3 | 1301 | # Copyright 2017 The Sonnet Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | mit | -873,895,775,926,401,500 | 45.464286 | 81 | 0.750192 | false | 4.07837 | false | false | false |
florian-wagner/gimli | doc/examples/modelling/plot_mod-dc-2d.py | 1 | 3678 | #!/usr/bin/env python
# encoding: UTF-8
"""
Geoelectric in 2.5d
-------------------
Let us start with a mathematical formulation ...
.. math::
\nabla\cdot( \sigma \nabla u ) = -I\delta(\vec{r}-\vec{r}_{\text{s}}) \in R^3
Fourier-Cosine-Transform
.. math::
\nabla\cdot( \sigma \nabla u ) & = -I\delta(\vec{r... | gpl-3.0 | 7,990,656,401,994,884,000 | 24.19863 | 88 | 0.596792 | false | 2.716396 | false | false | false |
wavesoft/LiveQ | liveq-common/liveq/reporting/lars/utilities.py | 1 | 1716 | ################################################################
# LiveQ - An interactive volunteering computing batch system
# Copyright (C) 2013 Ioannis Charalampidis
#
# 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 ... | gpl-2.0 | -2,314,549,908,923,637,000 | 26.677419 | 81 | 0.667832 | false | 3.926773 | false | false | false |
HAL90000/tirt | classifier/classifier.py | 1 | 3370 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import threading
from ComssServiceDevelopment.connectors.tcp.msg_stream_connector import InputMessageConnector, OutputMessageConnector #import modułów konektora msg_stream_connector
from ComssServiceDevelopment.connectors.tcp.object_connector import InputObjectConnector, Ou... | bsd-2-clause | 5,611,044,921,989,740,000 | 46.742857 | 207 | 0.649611 | false | 3.318769 | false | false | false |
nicholasmalaya/arcanus | disputatio/dissertation/mms/vizcoeffs.py | 2 | 5930 | #!/usr/bin/env python
"""
DESCRIPTION
This script is provides helpful definitions for interactively visualizing
manufactured quantities within a Mayavi
(http://code.enthought.com/projects/mayavi/) or IPython session. It is
/not/ a standalone program and should be %run from within an 'python
-wthre... | mit | 868,291,054,278,010,800 | 31.054054 | 81 | 0.458347 | false | 2.416463 | false | false | false |
cupy/cupy | cupyx/scipy/ndimage/interpolation.py | 1 | 29767 | import math
import warnings
import cupy
import numpy
from cupy._core import internal
from cupyx import _texture
from cupyx.scipy.ndimage import _util
from cupyx.scipy.ndimage import _interp_kernels
from cupyx.scipy.ndimage import _spline_prefilter_core
_prod = cupy._core.internal.prod
def _check_parameter(func_nam... | mit | 4,680,119,183,417,761,000 | 38.795455 | 79 | 0.585178 | false | 3.959431 | false | false | false |
usgin/modelmanager | views.py | 1 | 8560 | from django.http import HttpResponse, Http404
from django.shortcuts import render_to_response, render, get_object_or_404
from models import ContentModel, ModelVersion
from datetime import datetime, date
import json
#--------------------------------------------------------------------------------------
# Query by label... | bsd-3-clause | 6,667,174,217,160,199,000 | 46.298343 | 125 | 0.481192 | false | 4.970964 | false | false | false |
Juniper/nova | nova/db/sqlalchemy/migrate_repo/versions/332_keypair_in_extra.py | 15 | 1033 | # 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
# d... | apache-2.0 | -3,127,685,776,723,057,700 | 35.892857 | 78 | 0.704743 | false | 4.216327 | false | false | false |
aileisun/bubbleimg | bubbleimg/standards.py | 1 | 1063 | # standards.py
"""
setting standards for the pipeline
"""
def get_img_xycenter(img, center_mode='n/2'):
"""
use the convention of alignshift to define img center.
If nx, ny are even, the center is on [nx/2., ny/2.]
Otherwise if odd, the center is on [(nx-1)/2.,(ny-1)/2.]
Params
--------
i... | mit | 5,545,501,988,348,343,000 | 20.26 | 76 | 0.547507 | false | 2.961003 | false | false | false |
Jajcus/jjigw | spidentd.py | 1 | 14822 | #!/usr/bin/python
""" Simple Programmable Ident (RFC1413) Daemon """
import sys
sys.path=sys.path[1:]
import signal
import socket
import select
import threading
import os
import errno
import pwd
import grp
import getopt
import re
class Driver:
def __init__(self):
pass
def lookup(self... | gpl-2.0 | 3,370,829,443,927,899,600 | 36.055 | 134 | 0.448995 | false | 4.408685 | false | false | false |
fesh0r/xnb_parse | xnb_parse/xna_types/fez/fez_music.py | 1 | 3690 | """
FEZ music types
"""
from __future__ import print_function
from xnb_parse.file_formats.xml_utils import ET
from xnb_parse.xna_types.xna_primitive import Enum
class ShardNotes(Enum):
__slots__ = ()
enum_values = dict(enumerate(['C2', 'Csharp2', 'D2', 'Dsharp2', 'E2', 'F2', 'Fsharp2', 'G2', 'Gsharp2', 'A2'... | mit | 4,341,901,100,081,842,700 | 36.653061 | 120 | 0.578591 | false | 3.225524 | false | false | false |
syncthing/syncthing-gtk | syncthing_gtk/daemonprocess.py | 1 | 6111 | #!/usr/bin/env python2
"""
Syncthing-GTK - DaemonProcess
Runs syncthing daemon process as subprocess of application
"""
from __future__ import unicode_literals
from gi.repository import Gio, GLib, GObject
from syncthing_gtk.tools import IS_WINDOWS
from collections import deque
import os, logging
log = logging.getLogg... | gpl-2.0 | 5,564,627,412,105,889,000 | 30.994764 | 98 | 0.669449 | false | 3.03125 | false | false | false |
coopernurse/radiator | radiator/stomp.py | 1 | 10011 | import uuid
import time
from radiator import RadiatorTimeout
def dict_get(d, key, default_val):
if d.has_key(key):
return d[key]
else:
return default_val
class BaseStompConnection(object):
def drain(self, max=0, timeout=-1):
i = 0
self.f.timeout = timeout
while se... | mit | 6,172,829,512,682,010,000 | 34.126316 | 87 | 0.517431 | false | 3.949112 | false | false | false |
Aloomaio/googleads-python-lib | examples/adwords/v201806/advanced_operations/add_dynamic_search_ads_campaign.py | 1 | 7793 | #!/usr/bin/env python
#
# Copyright 2016 Google 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 requir... | apache-2.0 | 8,060,361,880,459,414,000 | 29.322957 | 80 | 0.584627 | false | 4.010808 | false | false | false |
south-coast-science/scs_core | src/scs_core/sys/eeprom_image.py | 1 | 2399 | """
Created on 25 Sep 2016
@author: Bruno Beloff (bruno.beloff@southcoastscience.com)
"""
import struct
# --------------------------------------------------------------------------------------------------------------------
class EEPROMImage(object):
"""
Load a .eep file
"""
@classmethod
def con... | mit | -1,645,307,696,609,441,800 | 23.479592 | 120 | 0.37599 | false | 5.039916 | false | false | false |
StanfordLegion/legion | bindings/python/examples/single_launch.py | 1 | 1123 | #!/usr/bin/env python3
# Copyright 2021 Stanford University
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | apache-2.0 | -4,892,271,488,950,184,000 | 27.075 | 74 | 0.682102 | false | 3.718543 | false | false | false |
mazvv/travelcrm | travelcrm/lib/qb/incomes.py | 1 | 2944 | # -*coding: utf-8-*-
from collections import Iterable
from . import ResourcesQueryBuilder
from ...models.resource import Resource
from ...models.income import Income
from ...models.invoice import Invoice
from ...models.account import Account
from ...models.currency import Currency
from ...models.order import Order
fro... | gpl-3.0 | -4,217,095,418,269,810,000 | 33.635294 | 68 | 0.58288 | false | 3.79871 | false | false | false |
jrichte43/ProjectEuler | Problem-0198/solutions.py | 1 | 1440 |
__problem_title__ = "Ambiguous Numbers"
__problem_url___ = "https://projecteuler.net/problem=198"
__problem_description__ = "A best approximation to a real number for the denominator bound is a " \
"rational number / (in reduced form) with ≤ , so that any rational " \
... | gpl-3.0 | -5,507,537,647,912,545,000 | 41.294118 | 100 | 0.566759 | false | 4.397554 | false | false | false |
mirkolai/polarization_of_emotional_engagement_in_social_media | 030 - analysis - community detection.py | 1 | 5729 | __author__ = 'nlelab'
import csv
import networkx as nx
import matplotlib.pyplot as plt
import MySQLdb
import config as cfg
import community # --> http://perso.crans.org/aynaud/communities/
db = MySQLdb.connect(host=cfg.mysql['host'], # your host, usually localhost
user=cfg.mysql['user'], # your username
... | mit | 8,555,591,874,360,377,000 | 31.925287 | 111 | 0.667307 | false | 3.260672 | false | false | false |
SolessChong/kaggle-mnist | CNN/ae.py | 1 | 1244 | import numpy
import theano.tensor as T
from pylearn2.models.model import Model
from pylearn2.space import VectorSpace
from pylearn2.utils import sharedX
from pylearn2.costs.cost import Cost, DefaultDataSpecsMixin
class AutoencoderCost(DefaultDataSpecsMixin, Cost):
supervised = False
def expr(self, model, dat... | mit | -4,952,019,030,470,552,000 | 30.125 | 75 | 0.611736 | false | 3.117794 | false | false | false |
rajeshjnu2006/Continuous-Authentication-Framework | EvaluateOneClassClassifiers.py.py | 1 | 13249 | from sklearn.preprocessing import StandardScaler
from sklearn.decomposition import PCA
from sklearn.covariance import EllipticEnvelope
from sklearn.ensemble import IsolationForest
from sklearn import svm
from sklearn.neighbors import LocalOutlierFactor
import numpy as np
import os
from sklearn.metrics import co... | mit | 24,738,294,118,647,708 | 46.354015 | 123 | 0.590158 | false | 3.421746 | false | false | false |
grammarware/slps | topics/convergence/guided/converge.py | 1 | 30275 | #!/Library/Frameworks/Python.framework/Versions/3.1/bin/python3
# -*- coding: utf-8 -*-
from functools import reduce
import os,sys
import xml.etree.ElementTree as ET
sys.path.append(os.getcwd().split('projects')[0]+'projects/slps/shared/python')
import BGF3
import XBGF3
import CBGF3
import slpsns
import metrics3
# glo... | bsd-3-clause | -8,310,017,497,979,655,000 | 32.453229 | 146 | 0.610665 | false | 2.659908 | false | false | false |
mesosphere/hackers-at-berkeley | workshop/exercise4/webservice.py | 1 | 2584 | #!/usr/bin/env python
from flask import Flask, render_template, json, url_for
import urllib2
app = Flask(__name__)
HEATMAP_WIDTH = 800
@app.route('/')
@app.route('/test')
# Here's an HTTP endpoint for testing purposes.
def test_endpoint():
return 'testing...'
@app.route('/heatmap')
def index(value=None):
# ... | apache-2.0 | 3,656,619,948,816,826,000 | 40.015873 | 78 | 0.635062 | false | 3.839525 | false | false | false |
fenixon/tiponpython | ParaQuemarDVD/source/models/observacionesensayo.py | 2 | 1525 | """
tiponpython Simulacion de ensayos de acuiferos
Copyright 2012 Andres Pias, Mathias Chubrega, Alvaro Correa, Sebastian Daloia, Jesus Guibert
This file is part of tiponpython.
tiponpython is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published ... | gpl-3.0 | -7,164,331,376,592,403,000 | 33.659091 | 93 | 0.687213 | false | 3.497706 | false | false | false |
chutchi2/cnn-crime-classification-fork | TextCNN.py | 1 | 4381 | #! /usr/bin/env python
#------------------------------------------------------------------------------
# Filename: TextCNN.py
# Description:
# Class defining text convolutional neural network using TensorFlow.
#------------------------------------------------------------------------------
import numpy as np
import ten... | apache-2.0 | -6,940,530,125,031,099,000 | 44.164948 | 103 | 0.539375 | false | 4.056481 | false | false | false |
elhuhdron/emdrp | neon3/emneon.py | 1 | 21498 | #!/usr/bin/env python
# The MIT License (MIT)
#
# Copyright (c) 2016 Paul Watkins, National Institutes of Health / NINDS
#
# 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... | mit | 5,700,079,756,353,836,000 | 53.015075 | 121 | 0.643409 | false | 3.802264 | true | false | false |
qedsoftware/commcare-hq | corehq/apps/callcenter/utils.py | 1 | 10828 | from __future__ import absolute_import
from collections import namedtuple
from datetime import datetime, timedelta
import pytz
from casexml.apps.case.mock import CaseBlock
import uuid
from xml.etree import ElementTree
from corehq.apps.app_manager.const import USERCASE_TYPE
from corehq.apps.domain.models import Domain
f... | bsd-3-clause | -5,434,732,681,437,768,000 | 35.214047 | 109 | 0.635574 | false | 3.59376 | true | false | false |
mustilica/tt-history | src/timezone_aware_date.py | 1 | 2820 | # coding=utf-8
"""
The MIT License
Copyright (c) 2013 Mustafa İlhan
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, modi... | mit | -5,999,749,024,330,028,000 | 34.683544 | 91 | 0.654487 | false | 4.151694 | false | false | false |
PaulinaLach/cmd_jsonschema_validation | doschema/validation.py | 1 | 11765 | # -*- coding: utf-8 -*-
#
# This file is part of DoSchema.
# Copyright (C) 2016 CERN.
#
# DoSchema 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 lat... | gpl-2.0 | 3,602,934,162,046,457,300 | 36.951613 | 87 | 0.530217 | false | 4.642857 | false | false | false |
abdulrehmank/music_browser | spotify/views.py | 1 | 3424 | from django.shortcuts import render
from django.views.generic import TemplateView
from django.http import HttpResponse
from urllib.parse import urlencode
import requests
import json
from django.template.loader import render_to_string
# Create your views here.
class Homepage(TemplateView):
"""
To Fetch All the... | gpl-3.0 | -5,046,806,297,499,323,000 | 42.35443 | 97 | 0.530374 | false | 4.602151 | false | false | false |
ilnatvl/python_training | test/test_modify_contact.py | 1 | 1183 | # -*- coding: utf-8 -*-
import random
from model.contact import Contact, model_to_view
from generator import random_string
def test_modify_some_contact(app, orm, check_ui):
if app.contact.count() == 0:
app.contact.create(Contact(first_name="first name"))
old_contacts = orm.get_contact_list()
conta... | apache-2.0 | -3,307,459,095,631,958,000 | 48.291667 | 110 | 0.685545 | false | 3.399425 | false | false | false |
jurcicek/extended-hidden-vector-state-parser | semantics-4/src/genSymbolGivenC1C2C3C4.py | 1 | 9119 | #!/usr/bin/env python2.4
import os.path
from glob import glob
import codecs
import sys
from svc.scripting import *
from svc.map import SymMap
from svc.utils import ADict
import toolkit
import gmtk
from observation import Observation
from hiddenObservation import HiddenObservation
from sparseProbability import Sparse... | gpl-2.0 | -7,971,464,865,404,060,000 | 31.684588 | 138 | 0.547648 | false | 3.709927 | false | false | false |
DerThorsten/opengm | src/interfaces/python/opengm/_inference.py | 14 | 5257 | class Inference:
"""
High level Inference Interface Class
"""
def __init__(self,gm,alg,impl=None,parameter=None,accumulator=None,constructSolver=True):
"""
High level Inference Interface
Keyword arguments:
gm -- the graphical model to optimize
alg -- algorithm... | mit | -4,124,947,190,303,743,000 | 38.238806 | 127 | 0.654746 | false | 4.485495 | false | false | false |
paulmueller/PyCorrFit | pycorrfit/models/model_confocal_2d_2d.py | 2 | 3205 | import numpy as np
from .control import model_setup
from .cp_confocal import twod
from .cp_mix import double_pnum
# 2D + 2D Gauß
# Model 6037
def CF_Gxyz_gauss_2D2D(parms, tau):
u""" Two-component, two-dimensional diffusion with a Gaussian laser
profile, including a triplet component.
The triplet... | gpl-2.0 | -299,360,299,632,540,300 | 26.867257 | 75 | 0.529374 | false | 3.09332 | false | false | false |
jmchilton/pulsar | pulsar/client/path_mapper.py | 2 | 4246 | import os.path
from .action_mapper import FileActionMapper
from .action_mapper import path_type
from .util import PathHelper
from galaxy.util import in_directory
class PathMapper(object):
""" Ties together a FileActionMapper and remote job configuration returned
by the Pulsar setup method to pre-determine th... | apache-2.0 | 2,588,744,433,698,858,500 | 42.326531 | 102 | 0.668158 | false | 4.036122 | true | false | false |
googleapis/googleapis-gen | google/ads/googleads/v6/googleads-py/google/ads/googleads/v6/enums/types/custom_interest_status.py | 1 | 1139 | # -*- 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 | 7,163,804,610,159,468,000 | 28.973684 | 74 | 0.691835 | false | 3.968641 | false | false | false |
miezak/madodl | madodl/curl.py | 1 | 5144 | #!/usr/bin/env python3
#
# any functions relating to pycURL
#
import os
from io import BytesIO
import re
import urllib.parse
import time
import pycurl
import unicurses
import madodl.util as _util
import madodl.gvars as _g
from madodl.exceptions import *
hdrs = {}
def curl_hdr(hdr_line):
hdr_line = hdr_line.dec... | bsd-2-clause | -3,701,387,015,565,995,000 | 22.925581 | 79 | 0.568429 | false | 3.208983 | false | false | false |
janelia-flyem/pydvid | tests/test_voxels_metainfo.py | 1 | 3849 | import nose
import numpy
import h5py
from pydvid.voxels import VoxelsMetadata
class TestVolumeInfo( object ):
metadata_json = """
{
"Axes": [
{
"Label": "X",
"Resolution": 3.1,
"Units": "nanometers",
"Size": 100,
... | bsd-3-clause | 8,643,993,435,531,782,000 | 36.368932 | 117 | 0.506625 | false | 4.009375 | true | false | false |
GutiDeng/bcpy | KvDB/ImplSQLite.py | 1 | 9116 | from Interface import Interface
import sqlite3
import time
import types
import json
import os
class Implementation(Interface):
def __init__(self, connstr, *args, **kwargs):
dbfile = connstr
# automatically create parent directory
pdir = os.path.dirname(dbfile)
if not ... | gpl-3.0 | 65,074,857,233,707,750 | 37.464135 | 124 | 0.52161 | false | 3.982525 | false | false | false |
zoulianmp/moonstone-pyqt | moonstone/gui/qt/qdicomprocess.py | 2 | 7962 | # -*- coding: utf-8 -*-
#
# Moonstone is platform for processing of medical images (DICOM).
# Copyright (C) 2009-2011 by Neppo Tecnologia da Informação LTDA
# and Aevum Softwares LTDA
#
# This file is part of Moonstone.
#
# Moonstone is free software: you can redistribute it and/or modify
# it under the terms of the GN... | lgpl-3.0 | -2,583,513,058,218,995,700 | 45.555556 | 107 | 0.528392 | false | 4.838906 | false | false | false |
pernici/sympy | sympy/assumptions/ask.py | 1 | 12110 | """Module for querying SymPy objects about assumptions."""
import inspect
from sympy.core import sympify
from sympy.utilities.source import get_class
from sympy.assumptions import global_assumptions, Assume, Predicate
from sympy.assumptions.assume import eliminate_assume
from sympy.logic.boolalg import to_cnf, And, Not... | bsd-3-clause | 2,803,486,645,710,467,000 | 39.099338 | 110 | 0.614781 | false | 3.710172 | false | false | false |
rafasis1986/EngineeringMidLevel | flaskiwsapp/workers/emails.py | 1 | 3040 | '''
Created on Oct 7, 2016
@author: rtorres
'''
from flask.globals import current_app
from sendgrid.helpers.mail import Mail, Content, Email
from sendgrid.sendgrid import SendGridAPIClient
from flaskiwsapp.extensions import celery
from flaskiwsapp.projects.controllers.ticketControllers import get_ticket_by_id
from f... | mit | 5,478,912,369,226,336,000 | 40.643836 | 117 | 0.680592 | false | 3.41573 | true | false | false |
blancltd/django-groot | groot/forms.py | 1 | 2244 | import django
from django import forms
from django.conf import settings
from django.contrib.admin.templatetags.admin_static import static
from django.contrib.admin.widgets import FilteredSelectMultiple
from django.contrib.auth.models import Group
from django.core.exceptions import ValidationError
from guardian.shortcut... | bsd-3-clause | -3,962,041,324,753,172,500 | 35.193548 | 94 | 0.676025 | false | 4.125 | false | false | false |
mandli/multilayer-examples | 1d/well_balancing_comparison.py | 1 | 2579 | #!/usr/bin/env python
r"""Script for computing the error due to a non-well-balanced method"""
import os
import numpy
import clawpack.pyclaw.solution as solution
# Parameters
sea_level = 0.0
def compute_error(q, aux, eta, rho, norm=1):
r"""Compute the steady state error where eta are the surfaces"""
num_c... | mit | -5,271,594,851,043,091,000 | 31.658228 | 105 | 0.53703 | false | 2.782093 | false | false | false |
EdwardBetts/osm-wikidata | matcher/place.py | 1 | 54037 | from flask import current_app, url_for, g, abort, redirect
from .model import (
Base,
Item,
ItemCandidate,
PlaceItem,
ItemTag,
Changeset,
IsA,
osm_type_enum,
get_bad,
)
from sqlalchemy.types import BigInteger, Float, Integer, JSON, String, DateTime, Boolean
from sqlalchemy import fun... | gpl-3.0 | -7,339,413,469,786,413,000 | 30.860849 | 112 | 0.524447 | false | 3.808839 | false | false | false |
guillaume-philippon/aquilon | lib/aquilon/worker/commands/add_address.py | 1 | 2695 | # -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2008,2009,2010,2011,2012,2013,2014,2015,2016 Contributor
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You ma... | apache-2.0 | 1,048,879,185,237,331,500 | 41.109375 | 79 | 0.646753 | false | 3.801128 | false | false | false |
opnsense/core | src/opnsense/scripts/filter/list_counters.py | 1 | 3827 | #!/usr/local/bin/python3
"""
Copyright (c) 2017-2019 Ad Schellevis <ad@opnsense.org>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain th... | bsd-2-clause | 8,417,695,913,507,780,000 | 48.064103 | 103 | 0.581134 | false | 4.146262 | false | false | false |
AlexRakita/gst_streamer | py_nodes/gst_streamer_node.py | 1 | 2746 | #!/usr/bin/env python
from __future__ import print_function
import rospy
import std_msgs.msg
import gst_engines
DEFAULT_PIPELINE_STRING = gst_engines.DEFAULT_STREAMER_PIPELINE
DEFAULT_HOST = gst_engines.DEFAULT_HOST
DEFAULT_PORT = gst_engines.DEFAULT_PORT
DEFAULT_AUTO_RESTART = True
class GstStreamerNode(object):... | bsd-2-clause | 3,660,826,551,424,301,600 | 28.847826 | 72 | 0.607065 | false | 3.803324 | false | false | false |
ares/robottelo | robottelo/config/base.py | 1 | 41315 | """Define and instantiate the configuration class for Robottelo."""
import logging
import os
import sys
from functools import partial
from logging import config
from nailgun import entities, entity_mixins
from nailgun.config import ServerConfig
from robottelo.config import casts
from six.moves.urllib.parse import url... | gpl-3.0 | -7,945,623,888,161,101,000 | 35.400881 | 79 | 0.593223 | false | 4.232661 | true | false | false |
TheCacophonyProject/Full_Noise | test/test_visits.py | 1 | 15461 | import csv
from datetime import datetime, timedelta
import dateutil.parser
from dateutil.parser import parse as parsedate
class TestVisits:
VISIT_INTERVAL_SECONDS = 600
def test_no_tag(self, helper):
admin = helper.admin_user()
cosmo = helper.given_new_user(self, "cosmo")
cosmo_group ... | agpl-3.0 | 6,691,630,689,400,789,000 | 41.709945 | 128 | 0.601902 | false | 3.640452 | true | false | false |
VirusTotal/msticpy | msticpy/sectools/sectools_magics.py | 1 | 4354 | # -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
"""msticpy... | mit | 2,229,591,653,877,642,200 | 27.090323 | 87 | 0.566376 | false | 3.972628 | false | false | false |
Wojtechnology/Muzit | modules.py | 1 | 1343 | ##########################################
#
# Author: Wojtek Swiderski
#
# File containing all modules required for the application
# Application for uploading and listening to music
#
# Last Update: February 17th, 2015
#
##########################################
# 3rd party imports
import tornado.web
import time
i... | apache-2.0 | -9,028,784,702,281,486,000 | 31.780488 | 115 | 0.641102 | false | 3.291667 | false | false | false |
moto-timo/ironpython3 | Tests/test_clrload2.py | 3 | 2340 | #####################################################################################
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# This source code is subject to terms and conditions of the Apache License, Version 2.0. A
# copy of the license can be found in the License.html file at the root of th... | apache-2.0 | 2,100,061,224,420,556,300 | 33.925373 | 101 | 0.600427 | false | 3.946037 | true | false | false |
shanot/imp | modules/rotamer/examples/rotamer_pdb.py | 1 | 3258 | ## \example rotamer/rotamer_pdb.py
# rotamer_pdb.py is a script demonstrating the usage of RotamerCalculator and RotamerLibrary.
# It reads a PDB file and a rotamer library file, and tries to rotate the atoms based on the most
# probable chi angles from the rotamer library. Then it saves the rotated atoms to a specifie... | gpl-3.0 | 1,938,431,575,901,551,000 | 31.909091 | 101 | 0.615408 | false | 3.123682 | false | false | false |
protonyx/labtronyx | labtronyx/drivers/Tektronix/Oscilloscope.py | 1 | 38926 | """
.. codeauthor:: Kevin Kennedy <protonyx@users.noreply.github.com>
Supported Interfaces
--------------------
* USB
* Ethernet (2000 Series requires the DPO2CONN Module)
Ethernet Interface
------------------
Tektronix oscilloscopes support Ethernet communication using the VXI extensions for VISA. The VISA driver ... | mit | 8,801,927,800,218,349,000 | 37.579782 | 164 | 0.537404 | false | 4.007206 | false | false | false |
Dhivyap/ansible | lib/ansible/plugins/action/raw.py | 152 | 1823 | # (c) 2012, 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) any lat... | gpl-3.0 | 6,478,108,042,393,312,000 | 35.46 | 113 | 0.676358 | false | 4.096629 | false | false | false |
chingc/DJRivals | database.py | 1 | 5153 | """Database record generator."""
from collections import OrderedDict as dict
import json
import zlib
from common import clean, ls, mkdir
from settings import game, path
import ranking
def create(mode, name):
"""Create a local record of the specified mode and name.
Arguments:
mode -- One of the four game... | bsd-2-clause | 787,782,141,174,317,300 | 43.808696 | 189 | 0.581991 | false | 3.343933 | false | false | false |
jamestunnell/auto-slideshow | slideshow_gui.py | 1 | 4180 | #!/usr/bin/python
import wx
import os
class RowPanel(wx.Panel):
def __init__(self, parent, controls):
wx.Panel.__init__( self, parent=parent, id=-1 )
sizer = wx.BoxSizer(wx.HORIZONTAL)
for control in controls:
sizer.Add(control)
self.SetSizer(sizer)
... | mit | 7,923,394,189,105,560,000 | 36 | 105 | 0.584928 | false | 3.268178 | false | false | false |
yokose-ks/edx-platform | cms/envs/aws.py | 1 | 11048 | """
This is the default template for our main set of AWS servers.
"""
# We intentionally define lots of variables that aren't used, and
# want to import all variables from base settings files
# pylint: disable=W0401, W0614
import json
from .common import *
from logsettings import get_logger_config
import os
from p... | agpl-3.0 | 7,973,736,942,085,346,000 | 37.629371 | 120 | 0.700036 | false | 3.184779 | true | false | false |
bomin2406-cmis/bomin2406-cmis-cs2 | conditionalsprac.py | 1 | 1249 | import random
def intro()
name = raw_input("So. What's your name..?:")
out = """There's someone here, at this hospital full of patients and doctors...tensed up. They are all staring at one thing, and it is, a bomb. The countdown has started: 1 minute remaining. There's no time to spare. That person in the middle is ... | cc0-1.0 | 4,125,542,617,374,954,500 | 28.738095 | 299 | 0.667734 | false | 3.038929 | false | false | false |
conan-io/conan | conans/test/unittests/util/files/strip_root_extract_test.py | 1 | 9684 | import zipfile
import os
import tarfile
import unittest
import six
from mock import Mock
from conans.client.tools import untargz, unzip
from conans.client.tools.files import chdir, save
from conans.test.utils.mocks import TestBufferConanOutput
from conans.test.utils.test_files import temp_folder
from conans.errors i... | mit | 1,948,985,854,762,916,000 | 43.219178 | 101 | 0.601817 | false | 3.552458 | true | false | false |
ritchyteam/odoo | addons/report/models/abstract_report.py | 96 | 2900 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2014-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | agpl-3.0 | 1,974,101,196,560,605,700 | 44.3125 | 96 | 0.621034 | false | 4.341317 | false | false | false |
redlink-gmbh/redlink-python-sdk | redlink/data.py | 1 | 9586 | # -*- coding: utf8 -*-
# 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, softwar... | apache-2.0 | 2,378,760,484,988,338,700 | 35.310606 | 121 | 0.593678 | false | 4.017603 | false | false | false |
khchine5/xl | lino_xl/lib/addresses/models.py | 1 | 7677 | # Copyright 2014-2017 Luc Saffre
#
# License: BSD (see file COPYING for details)
"""
Database models of `lino_xl.lib.addresses`.
"""
from __future__ import unicode_literals
from __future__ import print_function
from django.db import models
from lino.api import dd, rt, _
from lino.modlib.checkdata.choicelists import... | bsd-2-clause | -7,950,357,305,515,087,000 | 30.854772 | 79 | 0.590595 | false | 4.107544 | false | false | false |
iamprakashom/offlineimap | offlineimap/folder/GmailMaildir.py | 10 | 13398 | # Maildir folder support with labels
# Copyright (C) 2002 - 2011 John Goerzen & contributors
#
# 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
# (... | gpl-2.0 | 2,524,864,323,799,201,300 | 39.847561 | 103 | 0.615166 | false | 4.328918 | false | false | false |
google-research/ssl_detection | third_party/tensorpack/tensorpack/models/layer_norm.py | 1 | 3533 | # -*- coding: utf-8 -*-
# File: layer_norm.py
from ..compat import tfv1 as tf # this should be avoided first in model code
from ..utils.argtools import get_data_format
from .common import VariableHolder, layer_register
__all__ = ['LayerNorm', 'InstanceNorm']
@layer_register()
def LayerNorm(
x, epsilon=1e... | apache-2.0 | 2,131,740,063,647,671,300 | 31.412844 | 97 | 0.611661 | false | 3.298786 | false | false | false |
goerz/clusterjob | clusterjob/backends/lsf.py | 1 | 5933 | """
LSF backend
"""
from __future__ import absolute_import
import re
from ..status import PENDING, RUNNING, COMPLETED, CANCELLED, FAILED
from ..utils import time_to_seconds
from .. import ClusterjobBackend
def time_to_minutes(val):
return str(int(time_to_seconds(val) / 60))
class LsfBackend(ClusterjobBackend):
... | mit | -7,732,272,426,576,354,000 | 36.08125 | 79 | 0.532951 | false | 4.030571 | false | false | false |
scripteed/mtasa-blue | vendor/google-breakpad/src/tools/gyp/test/mac/gyptest-strip-default.py | 232 | 2448 | #!/usr/bin/env python
# Copyright (c) 2013 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies that the default STRIP_STYLEs match between different generators.
"""
import TestGyp
import re
import subprocess
import sys
i... | gpl-3.0 | 4,680,655,455,321,747,000 | 24.768421 | 80 | 0.684641 | false | 3.21682 | true | false | false |
nupic-community/sanity-nupic | htmsanity/nupic/journal.py | 1 | 20665 | import collections
def expandSegmentSelector(segSelector, segsByCol, defaultCells):
if isinstance(segSelector, collections.Mapping):
useSpecificCells = True
columns = segSelector.keys()
else:
useSpecificCells = False
columns = segSelector
for col in columns:
if useS... | agpl-3.0 | -3,806,226,981,404,602,400 | 40.579477 | 95 | 0.54106 | false | 4.770314 | false | false | false |
LadZone/LadZone.github.io | blog/tune_led (1).py | 3 | 2692 | #!/usr/bin/env python
import time
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
# read SPI data from MCP3008 chip, 8 possible adc's (0 thru 7)
def readadc(adcnum, clockpin, mosipin, misopin, cspin):
if ((adcnum > 7) or (adcnum < 0)):
return -1
GPIO.output(cspin, True)
GP... | agpl-3.0 | 8,647,807,790,387,738,000 | 26.469388 | 78 | 0.622957 | false | 3.130233 | false | false | false |
b-dev/django-cms-storelocator | store_locator/migrations/0006_auto__del_field_storelocator_longitude__del_field_storelocator_address.py | 2 | 4669 | # 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):
# Deleting field 'StoreLocator.longitude'
db.delete_column('cmsplugin_storelocator', 'longitude')
... | bsd-3-clause | -7,272,235,294,975,981,000 | 58.101266 | 162 | 0.59456 | false | 3.795935 | false | false | false |
south-coast-science/scs_core | src/scs_core/osio/data/topic_info.py | 1 | 2863 | """
Created on 10 Nov 2016
@author: Bruno Beloff (bruno.beloff@southcoastscience.com)
example:
{
"format": "application/json"
}
"""
from collections import OrderedDict
from scs_core.data.json import JSONable
# ----------------------------------------------------------------------------------------------------... | mit | -5,727,556,977,642,823,000 | 24.5625 | 118 | 0.394342 | false | 5.085258 | false | false | false |
acsone/alfodoo | cmis_web_alf/models/cmis_backend.py | 1 | 2408 | # Copyright 2016 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from urllib.parse import urlencode
from odoo import api, models
def to_utf8(value):
""" Safe encodng of value to utf-8 taking care of unicode values
"""
return value.encode('utf8')
def safe_urlencode(in_dict... | agpl-3.0 | -8,388,497,978,513,507,000 | 30.272727 | 75 | 0.579319 | false | 4.020033 | false | false | false |
decimalbell/tornadoscgi | tornadoscgi/server.py | 1 | 2037 | from tornado import stack_context
from tornado.tcpserver import TCPServer
class SCGIHandler(object):
def __init__(self, stream, address, server):
self.stream = stream
self.address = address
self.server = server
self.headers_callback = stack_context.wrap(self.on_headers)
sel... | mit | -6,877,761,921,288,708,000 | 32.393443 | 90 | 0.618066 | false | 4.017751 | false | false | false |
TomHeatwole/osf.io | scripts/meta/gatherer.py | 5 | 1148 | import json
import os
from website.settings import GITHUB_API_TOKEN
GIT_LOGS_FILE = os.path.join('website', 'static', 'built', 'git_logs.json')
def gather_pr_data():
import requests
pr_data = []
auth_header = {'Authorization': 'token %s' % GITHUB_API_TOKEN}
res = requests.get('https://api.github.com/... | apache-2.0 | -9,133,375,655,413,883,000 | 25.697674 | 114 | 0.517422 | false | 3.727273 | false | false | false |
hastern/jelly | view.py | 1 | 27385 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Jelly Views
Contains the View builder and a Menu for accessing all available views.
The `ViewBuilder` utilizes the *Advanced User Interface* library or more
specific, the `auiNotebook`. The term *Perspective* in the later refers to the
arrangement of views inside the... | mit | 5,727,784,544,634,008,000 | 35.175694 | 227 | 0.619755 | false | 4.033137 | false | false | false |
legumeinfo/lis_context_viewer | search/microservices/chromosome_region/request_handler.py | 1 | 1416 | # dependencies
from redisearch import Client, NumericFilter, Query
class RequestHandler:
def __init__(self, redis_connection):
self.redis_connection = redis_connection
# TODO: use aioredis and call redisearch via .execute to prevent blocking
# https://redislabs.com/blog/beyond-the-cache-with-python/
asy... | gpl-3.0 | -5,988,801,832,980,732,000 | 37.27027 | 76 | 0.621469 | false | 3.977528 | false | false | false |
oxyum/django-payment-qiwi | qiwi/models.py | 1 | 2041 | from datetime import datetime, timedelta
from time import sleep
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist
from django.db import IntegrityError, models, transaction
import signals
class Bill(models.Model):
user = models.ForeignKey(settings.AUTH_USER_MODEL)
cr... | mit | 6,070,965,901,437,878,000 | 35.446429 | 115 | 0.595786 | false | 4.389247 | false | false | false |
jswoboda/NonMaxwellianExperiments | runcode.py | 1 | 3856 | #!/usr/bin/env python
"""
Created on Wed Jun 17 16:27:13 2015
@author: John Swoboda
"""
import os, inspect, glob,pdb
import scipy as sp
import scipy.fftpack as scfft
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import rc
import seaborn as sns
from ISRSpectrum.ISRSpectrum import ISRSpectrum
#from... | mit | 6,658,385,334,094,597,000 | 33.123894 | 95 | 0.668828 | false | 2.782107 | false | false | false |
isislovecruft/leekspin | leekspin/ntor.py | 1 | 4684 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Functionality for creating and working with NTOR keys.
For a description of the NTOR handshake protocol, as well as its requisite
keys, see §5.1.4 of `tor-spec.txt`_, as well as the NTOR handshake proposal_.
.. _tor-spec.txt: https://gitweb.torproject.org/torspec.git/... | mit | -2,267,054,924,154,398,500 | 39.362069 | 93 | 0.669586 | false | 3.863036 | false | false | false |
CompPhysics/ComputationalPhysics2 | doc/src/MCsummary/src/hydrogen.py | 2 | 3577 | # Common imports
import os
# Where to save the figures and data files
PROJECT_ROOT_DIR = "Results"
FIGURE_ID = "Results/FigureFiles"
DATA_ID = "Results/VMCHydrogen"
if not os.path.exists(PROJECT_ROOT_DIR):
os.mkdir(PROJECT_ROOT_DIR)
if not os.path.exists(FIGURE_ID):
os.makedirs(FIGURE_ID)
if not os.path.exi... | cc0-1.0 | -945,375,230,380,031,000 | 28.081301 | 93 | 0.685211 | false | 3.387311 | false | false | false |
WenTr/TrendingApps | TA_GP.py | 1 | 7430 | # -*- coding: utf-8 -*-
"""
Created on Wed Apr 22 01:49:42 2015
@author: Wendy Tran
"""
'''
Sources:
https://play.google.com/store
https://docs.python.org/2/howto/urllib2.html
http://stackoverflow.com/questions/16870648/python-read-website-data-line-by-line-when-available
http://stackoverflow.com/questions/12943819/ho... | apache-2.0 | -4,483,319,537,546,698,000 | 40.055249 | 183 | 0.608075 | false | 3.452602 | false | false | false |
puhoy/sleekbasebot | sleekbasebot/sleekbasebot.py | 1 | 4397 | __author__ = 'meatpuppet'
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import sleekxmpp
import logging
from .muc_logging.muc_logging import log
if sys.version_info < (3, 0):
reload(sys)
sys.setdefaultencoding('utf8')
else:
raw_input = input
class XmppBotBase(sleekxmpp.ClientXMPP):
"""
... | mit | 2,691,930,324,471,185,000 | 33.622047 | 127 | 0.559927 | false | 4.370775 | false | false | false |
epfahl/auta | auta/auta.py | 1 | 1925 | """Main driver library, including the advance function.
"""
import cytoolz as cz
import copy
import transition
import exceptions
import configuration as cf
import utils
import validation as vl
def init(config, transitions, name=None):
"""Given a list of transitions, return a function that updates the state
... | mit | 2,626,363,130,943,984,600 | 30.048387 | 76 | 0.638961 | false | 4.249448 | false | false | false |
fluidinfo/fom | examples/tag_collections.py | 1 | 1425 | # coding: utf-8
"""Example of Many-to-many relationships in fluiddb with Fom"""
from fom.mapping import Object, tag_collection, tag_value
class Disease(Object):
symptoms = tag_collection(u'test/symptoms',
foreign_tagpath=u'test/diseases')
def __repr__(self):
return ... | mit | 5,974,852,075,430,148,000 | 27.5 | 77 | 0.687018 | false | 2.78865 | false | false | false |
foursquare/commons-old | src/python/twitter/pants/targets/java_thrift_library.py | 2 | 2814 | # ==================================================================================================
# Copyright 2011 Twitter, Inc.
# --------------------------------------------------------------------------------------------------
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use thi... | apache-2.0 | -6,318,431,192,040,684,000 | 42.96875 | 100 | 0.572139 | false | 5.211111 | false | false | false |
dwin999/Empire | lib/modules/collection/inveigh.py | 10 | 4360 | from lib.common import helpers
class Module:
def __init__(self, mainMenu, params=[]):
self.info = {
'Name': 'Invoke-Inveigh',
'Author': ['Kevin Robertson'],
'Description': ('Inveigh is a Windows PowerShell LLMNR/NBNS spoofer designed to '
... | bsd-3-clause | -1,381,794,615,220,337,200 | 34.447154 | 158 | 0.434633 | false | 4.325397 | false | false | false |
SebastienPittet/cavelink | setup.py | 1 | 1270 | # coding: utf-8
"""
A simple module to fetch Cavelink values by parsing the HTML page of sensors.
"""
from setuptools import find_packages, setup
with open('README.rst', 'r') as f:
long_description = f.read()
setup(
name='cavelink',
version='1.1.1',
author='Sébastien Pittet',
author_email='sebast... | mit | 1,971,750,617,660,919,800 | 32.394737 | 77 | 0.630418 | false | 3.940994 | false | true | false |
richard-taylor/auxo | auxo/test/test_yvonne_arnaud_agent.py | 1 | 1066 |
import logging
logging.basicConfig(filename='/tmp/unittest')
import auxo.yvonne_arnaud
import auxo.test.mocks
import unittest
class TestYvonneArnaudAgent(unittest.TestCase):
def testYvonneArnaudAgent(self):
auxo.agent.http = auxo.test.mocks.mockHttpFile('yvonne-arnaud.html')
a =... | gpl-3.0 | -7,081,827,154,439,126,000 | 27.810811 | 76 | 0.562852 | false | 3.834532 | true | false | false |
dblalock/flock | python/analyze/classify/results_utils.py | 1 | 4796 |
# reusable funcs for the problem of analyzing results of the form I have, but
# that are not totally data-agnostic
import os
import numpy as np
from pandas import DataFrame as df
from pandas.io.parsers import read_csv
# from utils import listFilesInDir
from munge import *
DATASET_COL_NAME = 'Dataset'
ERR_RATE_COL_N... | mit | 6,839,881,077,604,073,000 | 26.405714 | 77 | 0.631151 | false | 3.430615 | false | false | false |
jbresearch/cr2_scripts | cr2_replace.py | 1 | 3536 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright © 2015-2018 Johann A. Briffa
#
# This file is part of CR2_Scripts.
#
# CR2_Scripts 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 o... | gpl-3.0 | -5,990,688,172,864,524,000 | 33.320388 | 85 | 0.683451 | false | 3.67082 | false | false | false |
ric2b/Vivaldi-browser | chromium/tools/metrics/actions/extract_actions.py | 2 | 30212 | #!/usr/bin/env python
#
# Copyright (c) 2012 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.
"""Extract UserMetrics "actions" strings from the Chrome source.
This program generates the list of known actions we expect to s... | bsd-3-clause | 8,647,105,547,416,270,000 | 36.859649 | 80 | 0.676916 | false | 3.557701 | false | false | false |
thirdwing/mxnet | example/speech_recognition/log_util.py | 44 | 2467 | # 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 | 6,075,071,798,625,613,000 | 37.546875 | 103 | 0.612079 | false | 4.501825 | false | false | false |
edocappelli/oasys-crystalpy | orangecontrib/oasyscrystalpy/widgets/elements/Alignment.py | 1 | 9386 | import numpy as np
import sys
import os
import xraylib
from PyQt4.QtGui import QIntValidator, QDoubleValidator, QApplication, QSizePolicy
from orangewidget import gui
from orangewidget.settings import Setting
from oasys.widgets import widget
import orangecanvas.resources as resources
from crystalpy.util.Vector import... | mit | 6,765,638,677,186,092,000 | 35.952756 | 109 | 0.553697 | false | 3.706951 | false | false | false |
emesene/emesene | emesene/e3/cache/EmoticonCache.py | 1 | 5953 | '''a module to define a cache class for emoticons
'''
# -*- coding: utf-8 -*-
# This file is part of emesene.
#
# emesene 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 Lic... | gpl-3.0 | -8,807,912,151,527,768,000 | 33.017143 | 85 | 0.610449 | false | 4.154222 | false | false | false |
mdhaber/scipy | doc/source/tutorial/examples/plot_interp_grid.py | 13 | 1993 | import math
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import ticker
orders = [2, 3]
fig, axes = plt.subplots(1, len(orders), figsize=(11, 5))
n_cells = 7 # grid will be size (n_cells, n_cells)
# desired interpolation coordinate (xi, yi)
xi, yi = 3.3, 3.7
def get_start(cc, order):
if ... | bsd-3-clause | -4,618,133,961,995,509,000 | 30.634921 | 70 | 0.589563 | false | 2.983533 | false | false | false |
MutaharC/relython | solvers/form_slsqp.py | 1 | 1386 | # -*- coding: utf-8 -*-
from numpy import sqrt, dot, zeros
from scipy.stats import norm
from scipy.optimize import minimize
from ftrans import u_to_x
def slsqp(g, xdists, u_to_x, T, maxitr, tol, ftol, eps):
"""
Wrapper for scipy.optimize SLSQP constrained minimisation routine.
Minimizes beta subject to the... | gpl-2.0 | 2,879,232,816,228,082,000 | 34.538462 | 73 | 0.568543 | false | 3.006508 | false | false | false |
SyntaxVoid/PyFusionGUI | pyfusion/acquisition/LHD/fetch_local.py | 1 | 2695 | """LHD data fetchers.
Large chunks of code copied from Boyd, not covered by unit tests,
then copied back to this version to read .npz local data. THis is different
to reading the files obtained by retrieve
"""
def newload(filename, verbose=1):
""" Intended to replace load() in numpy
"""
from numpy import ... | gpl-3.0 | 382,721,336,004,235,260 | 35.418919 | 105 | 0.638961 | false | 3.46401 | true | false | false |
snbuback/django_services | example/myapp/api.py | 1 | 1521 | from django_services.api import DjangoServiceAPI, register
from .models import Brand, Model, Car
from .service import BrandService, CarService, ModelService
from .serializers import BrandSerializer, CarSerializer, ModelSerializer
class CarAPI(DjangoServiceAPI):
serializer_class = CarSerializer
service_class = ... | apache-2.0 | 4,814,363,861,843,140,000 | 26.672727 | 72 | 0.60092 | false | 4.056 | false | false | false |
samgoodgame/sf_crime | iterations/spark-sklearn/nn.py | 1 | 3171 | import numpy as np
from time import time
from operator import itemgetter
from sklearn import svm, grid_search
from sklearn.ensemble import RandomForestClassifier
from sknn.mlp import Classifier, Layer
from spark_sklearn import GridSearchCV
import pandas as pd
from sklearn.preprocessing import MinMaxScaler
from sklearn.... | mit | -3,632,157,795,670,813,000 | 38.6375 | 115 | 0.657521 | false | 2.914522 | false | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.