repo_name stringlengths 6 61 | path stringlengths 4 230 | copies stringlengths 1 3 | size stringlengths 4 6 | text stringlengths 1.01k 850k | license stringclasses 15
values | hash int64 -9,220,477,234,079,998,000 9,219,060,020B | line_mean float64 11.6 96.6 | line_max int64 32 939 | alpha_frac float64 0.26 0.9 | autogenerated bool 1
class | ratio float64 1.62 6.1 | config_test bool 2
classes | has_no_keywords bool 2
classes | few_assignments bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Pandaaaa906/ChemErpSystem | Inquiry_manage/migrations/0002_auto_20170102_0936.py | 1 | 2813 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2017-01-02 01:36
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('Produc... | apache-2.0 | 3,179,247,869,178,049,000 | 45.114754 | 235 | 0.644863 | false | 3.639069 | false | false | false |
rwl/PyCIM | CIM14/ENTSOE/Dynamics/IEC61970/Dynamics/ExcitationSystems/ExcitationSystemsExcST4B.py | 1 | 3178 | # Copyright (C) 2010-2011 Richard Lincoln
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish... | mit | 4,906,574,204,467,682,000 | 28.155963 | 276 | 0.596287 | false | 3.018044 | false | false | false |
akrherz/iem | htdocs/geojson/network.py | 1 | 3007 | """GeoJSON of a given IEM network code"""
import json
import datetime
import psycopg2.extras
import memcache
from paste.request import parse_formvars
from pyiem.util import get_dbconn, html_escape
def run(network, only_online):
"""Generate a GeoJSON dump of the provided network"""
pgconn = get_dbconn("mesosi... | mit | 5,936,087,925,441,181,000 | 30.322917 | 71 | 0.513136 | false | 3.754057 | false | false | false |
rdmnk/Orgnode | Orgnode/myorgnode.py | 1 | 17535 | # MIT License
# 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, copycopy,
# modify, merge, publish, distribute... | mit | 7,033,371,234,430,106,000 | 31.210227 | 86 | 0.509552 | false | 3.951995 | false | false | false |
fusic-com/flask-todo | config/cdn.py | 2 | 1143 | import json
from urlobject import URLObject
from boto import connect_cloudfront
from . import settings
from . import paths
CACHE_FILE=paths.CACHE/'cdn.json'
def get_cache(force_rebuild=False):
if not settings.AWS_ACCESS_KEY_ID:
return {}
if force_rebuild or not hasattr(get_cache, 'cache'):
if... | mit | 3,600,982,094,379,134,000 | 33.636364 | 110 | 0.655293 | false | 3.901024 | false | false | false |
AMOboxTV/AMOBox.LegoBuild | script.skinshortcuts/resources/lib/xmlfunctions.py | 1 | 51495 | # coding=utf-8
import os, sys, datetime, unicodedata, re
import xbmc, xbmcgui, xbmcvfs, xbmcaddon
import xml.etree.ElementTree as xmltree
from xml.sax.saxutils import escape as escapeXML
import ast
from traceback import print_exc
from unicodeutils import try_decode
if sys.version_info < (2, 7):
import simplejson
e... | gpl-2.0 | -6,610,807,520,888,053,000 | 50.962664 | 267 | 0.53011 | false | 4.710483 | false | false | false |
wukong-m2m/NanoKong | tools/inteldemo201202/reprogram.py | 1 | 3181 | #!/usr/bin/python
import sys
import pynvc
def reprogramNvmdefault(destination, filename):
MESSAGESIZE = 16
reply = pynvc.sendWithRetryAndCheckedReceive(destination=destination,
command=pynvc.REPRG_OPEN,
allowedReplies=... | gpl-2.0 | -2,236,280,340,222,188,800 | 41.986486 | 127 | 0.552028 | false | 3.716121 | false | false | false |
lillisgary/mezzanine-newsue | build/lib.linux-x86_64-2.7/sue/admin.py | 2 | 1414 | from django.contrib import admin
from mezzanine.pages.admin import PageAdmin
from .models import HomePage, Slide, Portfolio, PortfolioItem, PortfolioItemImage, PortfolioItemCategory, Porter, TempPortfolio, ItemPorter, Portfolios, DocumentListItem, DocumentList, DocumentListItemCategory
from mezzanine.core.admin import... | bsd-2-clause | -4,301,660,201,645,536,000 | 33.487805 | 209 | 0.834512 | false | 3.740741 | false | false | false |
Peddle/hue | desktop/core/ext-py/python-daemon/daemon/pidlockfile.py | 42 | 5946 | # -*- coding: utf-8 -*-
# daemon/pidlockfile.py
# Part of python-daemon, an implementation of PEP 3143.
#
# Copyright © 2008–2009 Ben Finney <ben+python@benfinney.id.au>
#
# This is free software: you may copy, modify, and/or distribute this work
# under the terms of the Python Software Foundation License, version 2 o... | apache-2.0 | 2,624,831,999,551,938,600 | 28.944444 | 75 | 0.609884 | false | 4.080523 | false | false | false |
tapatron/pert-calc | pert.py | 1 | 3254 | #!/usr/bin/env python
# copyright (c) 2014 Stein Fletcher <steinfletcher@gmail.com>
#
# Purpose: A simple utility to estimate tasks using PERT
# Usage:
# pert --tasks="1,2,4 5,7,11 7,11,22"
#
# which calculates the total duration (including risk) of 3 tasks
# task1: optimistic: 1, nominal: 2, pessimistic: 4
# ... | mit | 4,799,152,905,269,200,000 | 27.79646 | 112 | 0.594653 | false | 3.672686 | false | false | false |
hrkfdn/cherry | modules.py | 1 | 1938 | import inspect
import imp
from irc import IRCConn
from console import Console
MODULES = ["mod_tv", "mod_imdb", "mod_yt", "mod_weather", "mod_8ball", "mod_hlquery", "mod_kiez", "mod_wc", "mod_wa"]
class Modules():
# dictionary with modname mapped to (module, obj)
modules = {}
def instantiate(self, m):
... | bsd-3-clause | -8,024,597,456,429,800,000 | 31.3 | 117 | 0.534572 | false | 3.852883 | false | false | false |
brente/djangocms-youtube-slider | djangocms_youtube_slider/south_migrations/0001_initial.py | 2 | 4426 | # -*- coding: utf-8 -*-
from south.db import db
from south.v2 import SchemaMigration
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'YoutubeVideoContainer'
db.create_table(u'cmsplugin_youtubevideocontainer', (
(u'cmsplugin_ptr', self.gf('django.db.models.fie... | mit | 8,185,830,980,724,661,000 | 65.074627 | 167 | 0.607094 | false | 3.642798 | false | false | false |
sfu-fas/coursys | grad/views/manage_supervisors.py | 1 | 1865 | from courselib.auth import requires_role
from django.shortcuts import get_object_or_404, render
from grad.models import GradStudent, Supervisor, GradRequirement
from grad.forms import SupervisorForm, possible_supervisors
from django.contrib import messages
from log.models import LogEntry
from django.http import HttpRes... | gpl-3.0 | -9,047,068,081,236,019,000 | 44.487805 | 115 | 0.654155 | false | 4.045553 | false | false | false |
langcog/wordbank | instruments/schemas/Swedish_WG.py | 1 | 63685 | from django.db import models
from instruments.base import BaseTable
class Swedish_WG(BaseTable):
item_1_choices = [('understands', 'understands'), ('produces', 'produces')]
item_1 = models.CharField(max_length=11, choices=item_1_choices, null=True)
item_2_choices = [('understands', 'understands'), ('produ... | gpl-2.0 | 4,529,313,738,187,687,000 | 81.174194 | 83 | 0.685358 | false | 3.440759 | false | false | false |
bcarroll/authmgr | authmgr/authmgr/lib/Flask_SQLAlchemySession/__init__.py | 1 | 3240 | """
https://github.com/MSA-Argentina/FlaskSQLAlchemySession/edit/master/FlaskSQLAlchemySession/__init__.py
[description]
Variables:
db {[type]} -- [description]
_table_name {str} -- [description]
_data_serializer {[type]} -- [description]
"""
from __future__ import absolute_import
import pickle
from dat... | bsd-3-clause | 2,075,606,725,752,848,000 | 28.724771 | 102 | 0.614198 | false | 4.0399 | false | false | false |
Ironpulse/CRC2017 | Cam/imagewriter.py | 1 | 4698 |
import os.path
import time
import threading
import cv2
import numpy as np
import logging
logger = logging.getLogger('cscore.storage')
class ImageWriter:
'''
Creates a thread that periodically writes images to a specified
directory. Useful for looking at images after a match has
complete... | agpl-3.0 | -402,439,446,709,973,600 | 33.807407 | 100 | 0.508514 | false | 4.619469 | false | false | false |
zhaopu7/models | nce_cost/infer.py | 1 | 1992 | # -*- encoding:utf-8 -*-
import numpy as np
import glob
import gzip
import paddle.v2 as paddle
from nce_conf import network_conf
def main():
paddle.init(use_gpu=False, trainer_count=1)
word_dict = paddle.dataset.imikolov.build_dict()
dict_size = len(word_dict)
prediction_layer = network_conf(
... | apache-2.0 | -6,765,368,289,635,308,000 | 27.457143 | 80 | 0.549197 | false | 3.387755 | false | false | false |
PedalPi/PluginsManager | pluginsmanager/model/pedalboard.py | 1 | 8060 | # Copyright 2017 SrMouraSilva
#
# 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,... | apache-2.0 | -5,304,959,297,585,082,000 | 33.435897 | 266 | 0.632043 | false | 4.092433 | false | false | false |
RubnC/modified-spectral | spectral/tests/envi.py | 1 | 11101 | #########################################################################
#
# envi.py - This file is part of the Spectral Python (SPy) package.
#
# Copyright (C) 2013 Thomas Boggs
#
# Spectral Python is free software; you can redistribute it and/
# or modify it under the terms of the GNU General Public License
... | gpl-2.0 | -3,295,892,582,417,661,400 | 36.12709 | 82 | 0.58265 | false | 3.656456 | true | false | false |
yufengg/tensorflow | tensorflow/contrib/bayesflow/python/ops/csiszar_divergence.py | 12 | 1562 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 | 7,561,534,556,336,436,000 | 30.877551 | 80 | 0.689501 | false | 3.666667 | false | false | false |
mgadi/naemonbox | sources/psdash/gevent-1.0.1/greentest/test__queue.py | 3 | 10905 | from __future__ import with_statement
from greentest import TestCase, main, GenericGetTestCase
import gevent
from gevent.hub import get_hub
from gevent import util
from gevent import queue
from gevent.queue import Empty, Full
from gevent.event import AsyncResult
class TestQueue(TestCase):
def test_send_first(sel... | gpl-2.0 | 488,388,398,618,766,660 | 27.033419 | 113 | 0.546905 | false | 3.757753 | true | false | false |
lig/i18n-string | i18n_string.py | 1 | 1420 | from collections import Mapping
from locale import getdefaultlocale, normalize
def normalize_lang(lang):
return normalize(lang).split('.')[0]
def get_default_lang():
return getdefaultlocale()[0]
class LocaleDict(dict):
def __new__(cls, data=None):
self = dict.__new__(cls)
if data:
... | bsd-2-clause | -1,428,376,439,097,220,900 | 25.792453 | 76 | 0.607042 | false | 4.396285 | false | false | false |
rishig/zulip | zerver/views/pointer.py | 1 | 1173 |
from django.http import HttpRequest, HttpResponse
from django.utils.translation import ugettext as _
from zerver.decorator import to_non_negative_int
from zerver.lib.actions import do_update_pointer
from zerver.lib.request import has_request_variables, JsonableError, REQ
from zerver.lib.response import json_success
f... | apache-2.0 | 5,036,255,552,979,921,000 | 42.444444 | 92 | 0.737425 | false | 3.949495 | false | false | false |
kirienko/gourmet | src/gourmet/plugin_loader.py | 1 | 16825 | import glob
import logging
import os.path
import sys
import traceback
from typing import Dict, List
import pkg_resources
from gourmet import gglobals
from gourmet.prefs import Prefs
from .defaults.defaults import loc
from .gdebug import debug
PRE = 0
POST = 1
try:
current_path = os.path.split(os.path.join(os.g... | gpl-2.0 | -8,503,242,675,846,742,000 | 36.979684 | 119 | 0.571352 | false | 4.193669 | false | false | false |
seejay/feedIO | feedio/purify.py | 1 | 2483 | #!/usr/bin/python
"""
A piece of code to do the required manipulation tasks for feedIO.
currently provides,
cleanText() function to clear any tags and make a text readable.
shorten() function to short a long text into a predefined size.
To be used with the feedIO tts feature and for classification of the art... | gpl-3.0 | -7,916,118,449,881,894,000 | 26.285714 | 82 | 0.664116 | false | 3.879688 | false | false | false |
fw1121/CheckM | scripts/createTaxonomicSpecificMarkerSets.py | 3 | 10651 | #!/usr/bin/env python
###############################################################################
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License... | gpl-3.0 | 5,907,076,798,651,764,000 | 47.413636 | 280 | 0.527181 | false | 4.219889 | false | false | false |
ScoffM/ITESO-Word2Vec | Salaries_Woeization.py | 1 | 3115 | import pandas as pd
import numpy as np
import math
import time
#Replace the nan values with the string True_nan in a dataframe's column
def eliminate_nan(col):
trueNan = pd.isnull(col)
indexs = trueNan[ trueNan == True].index.tolist()
col[indexs] = 'True_nan'
return col
#colnames is a lis... | gpl-3.0 | 3,483,683,236,759,404,000 | 39.533333 | 98 | 0.609952 | false | 3.721625 | false | false | false |
rec/BiblioPixelAnimations | BiblioPixelAnimations/matrix/pinwheel.py | 2 | 1351 | from bibliopixel.animation.matrix import Matrix
class Pinwheel(Matrix):
def __init__(self, layout, dir=True, **kwds):
super().__init__(layout, **kwds)
self._center = (self.width // 2, self.height // 2)
self._dir = dir
self._len = (self.width * 2) + (self.height * 2) - 2
def p... | mit | 3,571,952,326,134,889,000 | 29.022222 | 67 | 0.487047 | false | 3.385965 | false | false | false |
adamdoupe/enemy-of-the-state | jcc/jcc/python.py | 2 | 57348 | #
# 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
# distri... | gpl-2.0 | 2,680,661,775,088,932,400 | 38.441541 | 196 | 0.528841 | false | 3.7268 | false | false | false |
scwuaptx/CTF | 2018-writeup/hitcon/children_tcache.py | 1 | 1235 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from pwn import *
host = "10.211.55.19"
#host = "52.68.236.186"
#port = 56746
host = "54.178.132.125"
port = 8763
r = remote(host,port)
def allocate(size,data):
r.recvuntil(":")
r.sendline("1")
r.recvuntil("e:")
r.sendline(str(size))
r.recvuntil("a:... | gpl-2.0 | -9,162,183,849,842,138,000 | 15.689189 | 61 | 0.614575 | false | 2.213262 | false | false | false |
markdrago/flypaper | src/mercurial_repo.py | 1 | 2562 | import os
import subprocess
from datetime import datetime
from changeset_list import ChangesetList
from changeset import Changeset
class MercurialRepo(object):
def __init__(self, repodir):
self._repodir = repodir
#NOTE: Since a commit may have 0 files changed (merge), we add a preceding
# '#' to... | mit | -5,807,498,315,869,296,000 | 37.238806 | 79 | 0.639344 | false | 4.041009 | false | false | false |
cogumbreiro/relay | ui/relay/warnings/models.py | 1 | 11533 | from django.db import models
from django.db.models import permalink
import re
import sys
def warn(msg):
sys.stderr.write(msg)
class Code_base(models.Model):
program_name = models.CharField(max_length=50, core=True)
version = models.CharField(max_length=40, core=True)
compile_options = models.CharField... | bsd-3-clause | -4,808,662,429,024,099,000 | 32.623907 | 98 | 0.613197 | false | 3.433462 | false | false | false |
DataReply/google-maps-services-python | googlemaps/directions.py | 12 | 5126 | #
# Copyright 2014 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 required by applicable law ... | apache-2.0 | 4,944,768,763,200,504,000 | 33.870748 | 79 | 0.677917 | false | 4.150607 | false | false | false |
shiminasai/ciat_plataforma | guias_cacao/models.py | 2 | 153154 | # -*- coding: utf-8 -*-
from django.db import models
from django.contrib.auth.models import User
from mapeo.models import Persona
from sorl.thumbnail import ImageField
from multiselectfield import MultiSelectField
# Create your models here.
class FichaSombra(models.Model):
productor = models.ForeignKey(
Pe... | mit | 5,736,390,111,348,182,000 | 37.740102 | 166 | 0.538431 | false | 3.342004 | false | false | false |
lstorchi/pca_fit | utilities/estimate_phi_and_charge.py | 1 | 2929 | import numpy
import math
import sys
import re
from scipy import stats
####################################################################
def file_len(fname):
with open(fname) as f:
for i, l in enumerate(f):
pass
return i + 1
####################################################################
f... | apache-2.0 | 1,603,819,680,319,063,300 | 20.536765 | 90 | 0.576989 | false | 3.019588 | false | false | false |
molobrakos/home-assistant | homeassistant/components/scsgate/cover.py | 7 | 2704 | """Support for SCSGate covers."""
import logging
import voluptuous as vol
from homeassistant.components import scsgate
from homeassistant.components.cover import (CoverDevice, PLATFORM_SCHEMA)
from homeassistant.const import (CONF_DEVICES, CONF_NAME)
import homeassistant.helpers.config_validation as cv
_LOGGER = log... | apache-2.0 | 3,655,453,133,303,029,000 | 27.765957 | 79 | 0.628328 | false | 3.719395 | false | false | false |
florianfesti/boxes | boxes/generators/agricolainsert.py | 1 | 30390 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (C) 2020 Guillaume Collic
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your opti... | gpl-3.0 | 6,987,736,483,937,999,000 | 31.537473 | 158 | 0.551366 | false | 3.83809 | false | false | false |
aranzgeo/properties | properties/base/union.py | 2 | 9323 | """union.py: Union property"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from warnings import warn
from six import PY2
from .base import GENERIC_ERRORS, HasProperties
from .instance import Instance
from .. impo... | mit | -3,137,872,113,707,390,500 | 34.048872 | 113 | 0.576424 | false | 4.645242 | false | false | false |
weissercn/MLTools | Dalitz_simplified/evaluation_of_optimised_classifiers/gaussian_same_projection_on_each_axis_analysis/plot_gauss_dimenionality_analysis.py | 1 | 21737 | import sys
import numpy as np
import matplotlib.pyplot as plt
import os
# Options for mode 'single_p_values','ensemble', 'ensemble_redefined', 'ensemble_redefined_noCPV', 'ensemble_redefined_optimised', 'ensemble_redefined_noCPV_optimised'
MODE= 'ensemble_redefined_noCPV_optimised'
if MODE == 'single_p_values':
dime... | mit | 7,951,414,230,523,062,000 | 46.66886 | 213 | 0.643097 | false | 2.567868 | false | false | false |
jaytlennon/Image-Analysis | python/using_scikit_learn_clustering.py | 4 | 1566 | from itertools import cycle
from time import time
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.colors as colors
from sklearn.preprocessing import StandardScaler
from sklearn.cluster import Birch
from PIL import Image
import sys
import os
mydir = os.path.expanduser("~/GitHub/Image-Analysis")
... | mit | -2,141,438,698,161,400,000 | 26.473684 | 78 | 0.697318 | false | 2.847273 | false | false | false |
hazelcast/hazelcast-python-client | hazelcast/protocol/codec/transactional_set_remove_codec.py | 1 | 1225 | from hazelcast.serialization.bits import *
from hazelcast.protocol.builtin import FixSizedTypesCodec
from hazelcast.protocol.client_message import OutboundMessage, REQUEST_HEADER_SIZE, create_initial_buffer, RESPONSE_HEADER_SIZE
from hazelcast.protocol.builtin import StringCodec
from hazelcast.protocol.builtin import D... | apache-2.0 | -3,358,503,309,228,034,600 | 41.241379 | 127 | 0.781224 | false | 3.165375 | false | false | false |
googleapis/googleapis-gen | google/cloud/automl/v1/automl-v1-py/google/cloud/automl_v1/services/auto_ml/pagers.py | 1 | 15766 | # -*- 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 | -2,445,530,751,282,038,300 | 39.739018 | 95 | 0.64544 | false | 4.45745 | false | false | false |
feigaochn/leetcode | p263_ugly_number.py | 2 | 1435 | # coding: utf-8
# author: Fei Gao <leetcode.com@feigao.xyz>
# Problem: ugly number
#
# Write a program to check whether a given number is an ugly number.
#
# Ugly numbers are positive numbers whose prime factors only include 2, 3, 5.
# For example, 6, 8 are ugly while 14 is not ugly since it includes another
# prime... | mit | -5,159,015,496,010,155,000 | 20.41791 | 77 | 0.549129 | false | 3.337209 | false | false | false |
magicsky/nodechalk | chalk/Chalk.py | 1 | 2205 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 fileencoding=utf-8 ff=unix ft=python
"""
@author: Wu Liang
@contact: garcia.relax@gmail.com
@date: 2015/05/09
"""
from __future__ import absolute_import
from types import ModuleType
import sys
from chalk.SupportedColo... | mit | 8,145,812,429,696,313,000 | 28.797297 | 107 | 0.423583 | false | 3.834783 | false | false | false |
Net-ng/kansha | kansha/card_addons/label/models.py | 2 | 1149 | # -*- coding:utf-8 -*-
#--
# Copyright (c) 2012-2014 Net-ng.
# All rights reserved.
#
# This software is licensed under the BSD License, as described in
# the file LICENSE.txt, which you should have received as part of
# this distribution.
#--
from elixir import using_options
from elixir import ManyToOne, ManyToMany
f... | bsd-3-clause | 4,538,223,466,102,745,000 | 24.533333 | 72 | 0.630983 | false | 3.706452 | false | false | false |
sciunto/scifig | libscifig/database.py | 1 | 2161 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
import os.path
import hashlib
try:
import cPickle as pickle
except:
import pickle
def _calculate_checksum(filepath):
hasher = hashlib.md5()
with open(filepath, 'rb') as afile:
buf = afile.read()
hasher.update(buf)
return ... | gpl-3.0 | 4,511,459,496,460,730,000 | 25.353659 | 90 | 0.600648 | false | 3.764808 | false | false | false |
hemio-ev/hamsql | test/utils.py | 2 | 3772 | import psycopg2
import subprocess
import time
import os.path
dburl = "postgres://postgres@/hamsql-test"
dburl_invalid = "postgres://postgresX@/hamsql-test"
def run(cmd, setup, delete_db=False, capture=False, invalid_connection=False, args=[]):
global dburl
settings = {}
path = 'hamsql'
params = [path... | gpl-3.0 | 4,227,699,176,388,237,300 | 27.575758 | 109 | 0.599682 | false | 4.082251 | false | false | false |
moodpulse/l2 | api/parse_file/views.py | 1 | 1663 | import tempfile
from django.http import HttpRequest, JsonResponse
from api.parse_file.pdf import extract_text_from_pdf
import simplejson as json
from api.views import endpoint
from appconf.manager import SettingManager
def dnk_covid(request):
prefixes = []
key_dnk = SettingManager.get("dnk_kovid", default='fa... | mit | 6,391,463,727,328,777,000 | 35.790698 | 141 | 0.596713 | false | 3.077821 | false | false | false |
ska-sa/katdal | katdal/flags.py | 1 | 1652 | ################################################################################
# Copyright (c) 2019, National Research Foundation (Square Kilometre Array)
#
# Licensed under the BSD 3-Clause License (the "License"); you may not use
# this file except in compliance with the License. You may obtain a copy
# of the Lice... | bsd-3-clause | 3,509,311,591,821,161,000 | 36.545455 | 80 | 0.6023 | false | 3.84186 | false | false | false |
rakvat/direktkreditverwaltung | dkapp/migrations/0003_auto_20200728_1929.py | 1 | 2115 | # Generated by Django 3.0.8 on 2020-07-28 17:29
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('dkapp', '0002_auto_20200726_1744'),
]
operations = [
migrations.AlterField(
model_name='accountingentry',
name='crea... | gpl-3.0 | -7,953,272,076,920,990,000 | 27.972603 | 61 | 0.526714 | false | 5 | false | false | false |
riolet/SAM | sam/local/rv.py | 2 | 2842 | map_title = "Pam"
meta_title = "Tsoh Sliated"
stats_title = "Stats"
table_title = "Elbat Weiv"
login_title = "Nigol"
settings_title = "Sngittes"
dashboard_title = "Draobhsad"
units_role_cc = "tneilc"
units_role_c = "yltsom tneilc"
units_role_cs = "dexim tneilc/revres"
units_role_s = "yltsom revres"
units_role_ss = "rev... | gpl-3.0 | 1,502,175,834,318,290,400 | 31.295455 | 82 | 0.701619 | false | 2.196291 | false | true | false |
glottobank/pycldf | tests/test_paralleltext.py | 1 | 1119 | from pathlib import Path
import pytest
from pycldf.dataset import ParallelText
@pytest.fixture
def ds(tmpdir):
ds = ParallelText.in_dir(str(tmpdir))
ds.add_component('FunctionalEquivalentTable')
ds.add_component('FunctionalEquivalentsetTable')
for fname in [
'forms.csv',
'functionalE... | apache-2.0 | -6,987,609,921,863,617,000 | 27.692308 | 83 | 0.636282 | false | 3.380665 | false | false | false |
gengwg/leetcode | 112_path_sum.py | 1 | 1183 | # 112. Path Sum
# Given a binary tree and a sum,
# determine if the tree has a root-to-leaf path
# such that adding up all the values along the path equals the given sum.
#
# For example:
# Given the below binary tree and sum = 22,
# 5
# / \
# 4 8
# / / \
# ... | apache-2.0 | -5,073,569,330,014,601,000 | 25.288889 | 104 | 0.556213 | false | 3.399425 | false | false | false |
RokKos/FRI_Programiranje | TTK/DN01/Vigenere.py | 1 | 3509 | from string import ascii_lowercase
from math import gcd
# Constants
kN = len(ascii_lowercase)
kStartAscii = ord(ascii_lowercase[0])
kFILE_NAME = "TheHitchhikersGuidetotheGalaxy.txt"
# Helpers
def AsciiValue(char):
return ord(char) - kStartAscii
def CharValue(num):
return chr(num + kStartAscii)
def Transform... | mit | -6,810,865,207,348,621,000 | 26.629921 | 81 | 0.591052 | false | 3.204566 | false | false | false |
gusmaogabriels/mkin4py | mkin4py/solver/linsolver.py | 1 | 2121 | # -*- coding: utf-8 -*-
from __future__ import division, absolute_import, print_function
from . import np as __np, linalg as __linalg, derivatives as __derivatives
from .params import convergence_params
from ..bases import mkmodel as __mk
def newton_type(param):
""" lin_solver
params(1) : param as int
... | mit | -4,942,007,584,744,219,000 | 42.285714 | 96 | 0.584158 | false | 3.460033 | false | false | false |
KatsuomiK/HTML5Shooter | build/build.py | 1 | 2556 | #! /usr/bin/python
import os
import base64
def list_files(dir):
list = []
for root, dirs, files in os.walk(dir):
for file in files:
fullpath = os.path.join(root, file).replace("\\", "/")
list.append(fullpath)
return list
def remove_... | mit | -1,062,201,311,078,490,500 | 23.306931 | 220 | 0.552817 | false | 3.235443 | false | false | false |
allmightyspiff/softlayer-python | SoftLayer/shell/cmd_help.py | 3 | 1103 | """Print help text."""
# :license: MIT, see LICENSE for more details.
import click
from click import formatting
from SoftLayer.CLI import core as cli_core
from SoftLayer.CLI import environment
from SoftLayer.shell import routes
@click.command()
@environment.pass_env
@click.pass_context
def cli(ctx, env):
"""Pri... | mit | -4,125,463,605,830,137,300 | 26.575 | 53 | 0.663645 | false | 3.925267 | false | false | false |
imron/scalyr-agent-2 | benchmarks/scripts/print_compression_algorithm_results.py | 2 | 3953 | #!/usr/bin/env python
# Copyright 2014-2020 Scalyr Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | apache-2.0 | 6,730,945,357,748,172,000 | 25.006579 | 83 | 0.571718 | false | 4.100622 | false | false | false |
alien3211/lom | Library_of_mind/WindowGTK.py | 1 | 30677 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import log
from MySQL import ConMySQL
from AddRowWindowGTK import AddRowWindowGTK
import csv
import os
from collections import deque, defaultdict
import gi
from gi.repository import Gtk as gtk
from gi.repository import Gdk
gi.require_version('Gtk', '3.0')
def css():
... | gpl-3.0 | -2,701,084,870,422,299,600 | 29.986869 | 148 | 0.561496 | false | 3.706742 | true | false | false |
jeffery-do/Vizdoombot | doom/lib/python3.5/site-packages/theano/sandbox/gpuarray/elemwise.py | 4 | 118800 | from __future__ import print_function
import copy
from theano.compat import izip
import numpy
import theano
from theano import Apply, scalar, config
from theano import scalar as scal
from six.moves import StringIO, xrange
from theano.gof.utils import MethodNotDefined
from theano.scalar import Scalar
from theano.tensor... | mit | -9,199,357,860,788,290,000 | 39.339559 | 156 | 0.449773 | false | 3.62162 | false | false | false |
mclaughlin6464/pearce | pearce/mocks/tpcfSubregions.py | 1 | 21979 | """
I'm modifying the halotools tpcf code to add a few more efficincies.
One directly returns the correlation functions from subregions, so I can compute arbitary jackknifes more efficiently
Another is to add a flag for do_auto1 and do_auto2. Sometimes, you wanna compute xi_gg and xi_gm but not xi_mm!
"""
from __fut... | mit | 554,307,896,365,136,200 | 40.785171 | 117 | 0.629282 | false | 3.350968 | false | false | false |
device42/OpenDCIM-to-Device42-Migration | opendcim2d42.py | 1 | 19438 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR AN... | bsd-2-clause | 3,975,270,395,107,543,600 | 32.001698 | 146 | 0.485441 | false | 3.758314 | false | false | false |
dhardtke/pyEncode | app/modules/mod_process/process_repository.py | 1 | 7493 | import os
import re
from app import db, config, socketio, app
from app.library.formatters import formatted_file_data
from app.models.file import File
from app.models.package import Package
from app.modules.mod_process.file_repository import FileRepository
from app.modules.mod_process.status_map import StatusMap
clas... | mit | 5,981,169,389,569,720,000 | 32.302222 | 114 | 0.609369 | false | 4.5193 | true | false | false |
sansbacon/nba | bbref.py | 1 | 15408 | # bbref.py
import datetime
import logging
import re
from string import ascii_lowercase
from bs4 import BeautifulSoup
from dateutil.parser import *
from nba.scraper import BasketballScraper
from nba.dates import datetostr
from nba.names import fuzzy_match
from nba.pipelines.bbref import *
from nba.player.nbacom impor... | mit | -6,796,014,073,940,704,000 | 38.917098 | 117 | 0.524208 | false | 4.002078 | false | false | false |
moijes12/oh-mainline | vendor/packages/scrapy/scrapy/contrib/downloadermiddleware/stats.py | 19 | 1370 | from scrapy.exceptions import NotConfigured
from scrapy.utils.request import request_httprepr
from scrapy.utils.response import response_httprepr
from scrapy.stats import stats
from scrapy.conf import settings
class DownloaderStats(object):
def __init__(self):
if not settings.getbool('DOWNLOADER_STATS'):
... | agpl-3.0 | 1,570,326,803,235,319,800 | 46.241379 | 95 | 0.705109 | false | 3.971014 | false | false | false |
codex-bot/github | github/events/repository.py | 1 | 1573 | from data_types.organization import Organization
from data_types.repository import Repository
from data_types.user import User
from .base import EventBase
class EventRepository(EventBase):
def __init__(self, sdk):
super(EventRepository, self).__init__(sdk)
self.hook = None
self.repository... | mit | 820,249,232,561,150,100 | 29.784314 | 111 | 0.601911 | false | 4.563953 | false | false | false |
ivanvza/api-wow-python | wow_api.py | 1 | 17489 | #!/usr/bin/python
# -*- coding: UTF-8 -*-
import requests
import sys
import datetime
import optparse
import urllib2
from BeautifulSoup import BeautifulSoup
import textwrap
options = optparse.OptionParser(usage='%prog -r <Realm> -c <Character Name> --cs <options>', description='WoW API functions (https://github.com/bli... | mit | 4,502,594,035,306,280,400 | 42.827068 | 183 | 0.583919 | false | 3.216296 | false | false | false |
cristianmiranda/plex-trakt-scrobbler | src/helper/trakt.py | 1 | 6672 | import json
import logging
import os
import socket
import urllib
import urllib2
import urlparse
class Trakt(object):
CLIENT_ID = 'aa9cd9a641758c5c20f2076e657a199925a6d2409dcddd0c8737b0dc1e90b6b0'
CLIENT_SECRET = 'c6a1b1d563a521b4b126efd8847cd18d2a5533a702997f6401dd6e8f48c83faa'
USER_AGENT = 'plex-trakt-sc... | mit | 7,181,757,827,706,876,000 | 32.19403 | 132 | 0.552158 | false | 3.633987 | false | false | false |
packetsled/bro_intel_linter | intel_linter.py | 1 | 26250 | #!/usr/bin/python
#
# MixMode.ai - Bro Intel Linter
#
# WHEN WHAT WHO
# 03-04-2015 Initial development Aaron Eppert
# 08-24-2015 Explicitly verify single character fields Aaron Eppert
# 08-24-2015 GPL and pushed to G... | gpl-3.0 | 3,333,144,674,259,233,000 | 40.403785 | 194 | 0.523048 | false | 3.75 | false | false | false |
Pymatteo/QtNMR | build/exe.win32-3.4/scipy/__config__.py | 1 | 1547 | # This file is generated by C:\Users\asd\src\34\scipy-0.15.1\setup.py
# It contains system_info results at the time of building this package.
__all__ = ["get_info","show"]
atlas_threads_info={}
openblas_info={}
lapack_mkl_info={}
blas_mkl_info={}
lapack_opt_info={'library_dirs': ['C:\\local\\vendor\\binaries\\... | gpl-3.0 | 3,856,228,979,932,694,000 | 47.967742 | 186 | 0.557207 | false | 2.941065 | false | false | false |
Kromey/roglick | roglick/systems/input.py | 1 | 3339 | import time
from roglick.lib import libtcod
from roglick.engine.ecs import SystemBase
from roglick.components import FatigueComponent,PositionComponent
from roglick.events import ClimbDownEvent,ClimbUpEvent,MoveEvent,QuitEvent,PreInputEvent
from roglick.engine import event
class InputSystem(SystemBase):
# Defin... | mit | 4,605,689,450,673,225,000 | 35.293478 | 88 | 0.556155 | false | 3.777149 | false | false | false |
fansubgroup/Kerrigan1.x-server | ServerClone.py | 1 | 2507 | #!/usr/bin/env python
from multiprocessing import Process, Queue
from multiprocessing.reduction import reduce_handle, rebuild_handle
import os
import socket
import time
import threading
import json
import Skateboard
def server(s_to_client, PASSWD, addrnew, process_id, client_pipe):
print('ServerClone is ok.')
... | gpl-3.0 | -3,393,982,700,760,976,000 | 28.845238 | 122 | 0.583167 | false | 3.477115 | false | false | false |
basnijholt/holoviews | doc/conf.py | 1 | 2564 | # -*- coding: utf-8 -*-
from nbsite.shared_conf import *
# Declare information specific to this project.
project = u'HoloViews'
authors = u'PyViz developers'
copyright = u'2019 ' + authors
description = 'Stop plotting your data - annotate your data and let it visualize itself.'
import holoviews
version = release = h... | bsd-3-clause | 7,038,576,219,516,057,000 | 26.276596 | 89 | 0.555772 | false | 3.418667 | false | false | false |
marxsk/nimmt6 | runner.py | 1 | 1381 | #!/usr/bin/python
""" Single-player game - Nimmt6 with two players and open cards """
import game, player, card
# 10.000 round / 5 seconds with Firstplayer
ROUNDS = 10000
def play():
""" Main function which defines set of games for comuter bots or single game vs human"""
bots = [ player.Firstplayer(), player.Rando... | apache-2.0 | -1,805,987,851,468,064,500 | 29.043478 | 105 | 0.673425 | false | 3.015284 | false | false | false |
Legilibre/SedLex | sedlex/CreateGitBookVisitor.py | 1 | 16946 | # -*- coding: utf-8 -*-
from duralex.AbstractVisitor import AbstractVisitor
from .AddCommitMessageVisitor import int_to_roman
from . import template
from . import diff
from duralex.alinea_parser import *
import duralex.tree as tree
from bs4 import BeautifulSoup
import jinja2
import os
import subprocess
import tempf... | agpl-3.0 | -7,017,960,253,196,176,000 | 38.856471 | 147 | 0.512368 | false | 3.950326 | false | false | false |
chipx86/reviewboard | reviewboard/features/checkers.py | 2 | 4416 | """Review Board feature checkers."""
from __future__ import unicode_literals
from django.conf import settings
from djblets.features.checkers import SiteConfigFeatureChecker
class RBFeatureChecker(SiteConfigFeatureChecker):
"""Feature checker that checks against a LocalSite's configuration.
Features can be... | mit | -9,158,350,635,790,341,000 | 40.660377 | 79 | 0.603261 | false | 4.768898 | true | false | false |
lemming52/white_pawn | hackerrank/snakesladders/solution.py | 1 | 3998 | """
Markov takes out his Snakes and Ladders game, stares at the board and wonders: "If I can always roll the die to whatever number I want, what would be the least number of rolls to reach the destination?"
Rules The game is played with a cubic die of faces numbered to .
Starting from square , land on square ... | mit | 7,320,411,094,006,963,000 | 22.230303 | 202 | 0.615808 | false | 3.485615 | false | false | false |
SilverBlogTeam/SilverBlog | upgrade/upgrade_from_1.py | 1 | 1367 | if __name__ == '__main__':
print("The upgrade script has changed. You need to execute the upgrade command again to update the data structure.")
exit(0)
import json
import os
import shutil
from common import file
def change_time_fomart(list_item):
import time
system_info = json.loads(file.read_file(".... | bsd-3-clause | 6,423,764,364,611,883,000 | 39.235294 | 120 | 0.653987 | false | 3.645333 | false | false | false |
EthanAdner/Picture | picture.py | 1 | 1865 | """
picture.py
Author: Ethan Adner
Credit: Hex color codes
Assignment:
Use the ggame library to "paint" a graphical picture of something (e.g. a house, a face or landscape).
Use at least:
1. Three different Color objects.
2. Ten different Sprite objects.
3. One (or more) RectangleAsset objects.
4. One (or more) Circ... | mit | 2,853,899,190,494,927,000 | 23.866667 | 104 | 0.710456 | false | 2.590278 | false | false | false |
fre-sch/collector-drone | collectordrone/errors.py | 1 | 1289 | # Unofficial companion web-app for Elite: Dangerous (property of Frontier
# Developments). Collector-Drone lets you manage blueprints and material
# inventory for crafting engineer upgrades.
# Copyright (C) 2016 Frederik Schumacher
#
# This program is free software: you can redistribute it and/or modify
# it under the... | gpl-3.0 | -6,516,625,199,229,902,000 | 39.28125 | 73 | 0.71218 | false | 3.990712 | false | false | false |
liorvh/infernal-twin | wp2_crack.py | 9 | 5176 | import wx
import os, sys
class MyFrame(wx.Frame):
def __init__(self, parent, id, title):
wx.Frame.__init__(self, parent, id, title)
panel = wx.Panel(self,-1)
wx.StaticText(panel, -1, 'See Logs for results\ncaptures/key_found.txt', (45, 25), style=wx.ALIGN_CENTRE)
self.CreateS... | gpl-3.0 | 3,435,153,990,718,865,400 | 38.212121 | 131 | 0.553323 | false | 3.210918 | false | false | false |
hzdg/django-ecstatic | setup.py | 1 | 1619 | #/usr/bin/env python
import codecs
import os
from setuptools import setup, find_packages
read = lambda filepath: codecs.open(filepath, 'r', 'utf-8').read()
def exec_file(filepath, globalz=None, localz=None):
exec(read(filepath), globalz, localz)
# Load package meta from the pkgmeta module without loading the pa... | mit | 959,482,487,382,134,500 | 31.38 | 81 | 0.627548 | false | 3.730415 | false | false | false |
dbrattli/RxPY | rx/linq/observable/selectmany.py | 1 | 2647 | from rx import Observable
from rx.internal.utils import adapt_call
from rx.internal import extensionmethod
import collections
def _flat_map(source, selector):
def projection(x, i):
selector_result = selector(x, i)
if isinstance(selector_result, collections.Iterable):
result = Observable... | apache-2.0 | -875,346,721,671,318,700 | 35.763889 | 80 | 0.69286 | false | 4.471284 | false | false | false |
divir94/News-Analytics | Divir/Scraping/scrape_articles.py | 1 | 10543 | # -*- coding: utf8 -*-
# scraping
import urllib2
from goose import Goose
from bs4 import BeautifulSoup
# db
import shelve
# time/timeout
import signal
from datetime import *
from contextlib import contextmanager
from time import time
# others
import itertools
import sys
from pprint import pprint
from collections imp... | apache-2.0 | 1,659,297,324,422,557,700 | 31.244648 | 119 | 0.572987 | false | 3.656955 | false | false | false |
lifei96/Medium_Crawler | User_Crawler/util_parser.py | 2 | 2683 | # -*- coding: utf-8 -*-
import json
def user_parser(file_path):
with open(file_path, 'r') as f:
raw_data = json.load(f)
data = dict()
data['username'] = raw_data['profile']['user']['username']
if 'socialStats' in raw_data['profile']['user']:
data['followers'] = raw_data['profile']['us... | mit | -755,214,441,095,604,200 | 38.455882 | 120 | 0.600447 | false | 3.601342 | false | false | false |
openstack/nova | nova/virt/hyperv/vmops.py | 2 | 50873 | # Copyright (c) 2010 Cloud.com, Inc
# 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.apache.org/... | apache-2.0 | 2,815,185,111,773,525,000 | 44.140195 | 79 | 0.573919 | false | 4.314562 | true | false | false |
andychase/eventizer | parse/keywords.py | 1 | 1350 | def merge_words(words, desc):
"""
>>> list(merge_words(["Wow", "Yo", "Yo"], "Wow and Yo Yo"))
['Wow', 'Yo Yo']
"""
size = len(words)
skipNext = False
for i, word in enumerate(words):
if skipNext:
skipNext = False
continue
if i + 1 < size:
... | mit | 6,268,337,354,913,017,000 | 27.391304 | 64 | 0.528889 | false | 3.947368 | false | false | false |
iovation/launchkey-python | launchkey/entities/validation.py | 2 | 10429 | """Validators"""
# pylint: disable=too-few-public-methods
from formencode import Schema, validators, ForEach
from ..utils.validation import ValidateISODate
class PublicKeyValidator(Schema):
"""Public Key entity Validator"""
id = validators.String()
active = validators.Bool()
date_created = ValidateI... | mit | 8,261,304,007,005,720,000 | 32.86039 | 79 | 0.678205 | false | 4.040682 | false | false | false |
SkillSmart/ConferenceManagementSystem | Portal/urls.py | 1 | 1214 | from django.conf.urls import url, include
from . import views
app_name = 'portal'
urlpatterns = [
url(r'^$', views.IndexView.as_view(), name='index'),
url(r'^competition/$', views.CompetitionIndex.as_view(), name='competition'),
url(r'^venue/$', views.VenueIndex.as_view(), name="venues"),
url(r'^venue... | mit | 1,118,255,267,880,372,000 | 56.857143 | 99 | 0.64168 | false | 3.145078 | false | true | false |
rubydhash/webradius | config_server/freeradius/raddb/python/txthash.py | 1 | 2346 | # -*- coding: utf-8 -*-
import re
import md5
import string
from exceptions import Exception
class TxtHash:
__id = None
__hw_type = None
__regex = None
__is_id = None
__digs = None
__regex_str = "([0-9a-f]{2})[^0-9a-f]?([0-9a-f]{2})[^0-9a-f]?([0-9a-f]{2})[^0-9a-f]?([0-9a-f]{2})[^0-9a-f]?([0-9a-... | lgpl-2.1 | -4,038,245,052,719,588,000 | 28.3125 | 148 | 0.469083 | false | 3.547655 | false | false | false |
rochacbruno/dynaconf | example/multiple_sources/app.py | 1 | 1469 | from dynaconf import settings
print("Read from settings.py:", settings.PYTHON_VAR) # noqa
# BY DEFAULT 'development' is the current env
print("Read from development_settings.py:", settings.PYTHON_DEV_VAR) # noqa
# If ENV_FOR_DYNACONF=production is in envvars so
# print("Read from production_settings.py:", settings... | mit | 6,942,934,247,941,992,000 | 33.97619 | 78 | 0.682097 | false | 3.193478 | false | false | false |
spectralDNS/shenfun | demo/Stokes2NP.py | 1 | 4031 | r"""Solve Stokes equations using a coupled formulation
The Stokes equations are in strong form
.. math::
-\nabla^2 u - \nabla p &= f \\
\nabla \cdot u &= h \\
u(x, y=\pm 1) &= 0 \\
u(x=\pm 1, y) &= 0
where :math:`f` and :math:`h` are given functions of space.
In addition we require :math:`\int p d\ ... | bsd-2-clause | -389,010,432,669,954,800 | 29.308271 | 117 | 0.592905 | false | 2.486737 | false | false | false |
spacy-io/spaCy | spacy/ml/tb_framework.py | 1 | 1420 | from thinc.api import Model, noop
from .parser_model import ParserStepModel
def TransitionModel(
tok2vec, lower, upper, resize_output, dropout=0.2, unseen_classes=set()
):
"""Set up a stepwise transition-based model"""
if upper is None:
has_upper = False
upper = noop()
else:
ha... | mit | 8,833,489,119,848,649,000 | 28.583333 | 78 | 0.602817 | false | 3.454988 | false | false | false |
wakamori/GoForIt | 1/1-1.py | 1 | 1788 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
1-1.py
license BSD
author chen_ji <wakamori111 at gmail.com>
"""
import datetime
import random
import sys
class DayLife:
"""Life in a day."""
def __init__(self, date, life):
"""Set birth datetime and life."""
self.birthdate = date
sel... | bsd-2-clause | -1,893,952,449,638,936,800 | 29.827586 | 72 | 0.571588 | false | 3.64898 | false | false | false |
adambreznicky/javascript | Guardrail/Snake/downloadGET_v1.py | 1 | 3746 | __file__ = 'downloadGET_v1'
__date__ = '11/12/2015'
__author__ = 'ABREZNIC'
import arcpy, zipfile, os, shutil, urllib, urllib2, json, glob
# http://blogs.esri.com/esri/arcgis/2013/10/10/quick-tips-consuming-feature-services-with-geoprocessing/
district = arcpy.GetParameterAsText(0)
username = arcpy.GetParameterAsText(... | mit | -4,923,730,972,539,032,000 | 30.754237 | 148 | 0.64976 | false | 3.201709 | false | false | false |
pculture/mirocommunity | localtv/admin/flatpages_views.py | 1 | 2483 | from django.contrib.flatpages.models import FlatPage
from django.http import HttpResponseRedirect
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.views.decorators.csrf import csrf_protect
from localtv.admin import forms
from localtv.decorators import require_site_... | agpl-3.0 | 6,873,660,476,525,704,000 | 40.383333 | 79 | 0.530407 | false | 5.162162 | false | false | false |
mpihlak/pg_logforward | testing/test_logserver.py | 1 | 1769 | #!/usr/bin/env python
import sys, SocketServer
class JSONLogServer(SocketServer.BaseRequestHandler):
"""
Sample UDP server for receiving JSON messages.
"""
def handle_json(self, data):
try:
import json
msg = json.loads(data)
print("parsed json message:")
... | bsd-2-clause | 1,712,845,533,709,028,900 | 26.640625 | 90 | 0.504805 | false | 3.887912 | false | false | false |
AlmostBetterNetwork/pinecast | podcasts/views.py | 1 | 18321 | import datetime
import time
from email.utils import formatdate, parsedate
from xml.sax.saxutils import escape, quoteattr
from django.conf import settings
from django.http import Http404, HttpResponse, HttpResponseNotAllowed, HttpResponseNotModified, StreamingHttpResponse
from django.shortcuts import redirect
from djan... | apache-2.0 | -478,698,706,499,665,860 | 37.562105 | 117 | 0.595349 | false | 3.669271 | false | false | false |
xujun10110/golismero | tools/xsser/XSSer/dork.py | 7 | 13363 | #!/usr/bin/python
# -*- coding: iso-8859-15 -*-
"""
$Id$
This file is part of the xsser project, http://xsser.sourceforge.net.
Copyright (c) 2011/2012 psy <root@lordepsylon.net> - <epsylon@riseup.net>
xsser is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License a... | gpl-2.0 | 8,629,160,586,795,557,000 | 47.948718 | 190 | 0.517099 | false | 3.764225 | false | false | false |
ooovector/qtlab_replacement | tomography.py | 1 | 2105 | from . import data_reduce
import numpy as np
from . import readout_classifier
#import cvxopt
#import cvxpy
class tomography:
def __init__(self, sz_measurer, pulse_generator, proj_seq, reconstruction_basis={}):
self.sz_measurer = sz_measurer
#self.adc = adc
self.pulse_generator = pulse_generator
self.proj_seq ... | gpl-3.0 | 7,328,445,836,942,787,000 | 36.607143 | 136 | 0.690261 | false | 2.891484 | false | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.