hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ad2877c3531e129bf21b558a0ab264817d4fb3aa | 3,432 | py | Python | second/pytorch/mayank_play/reading_train_info_and_ploting_multiple_sweeps_all_info.py | mayanks888/second.pytorch | 02d37885a543ee46516648dcab7db8f5d677a179 | [
"MIT"
] | null | null | null | second/pytorch/mayank_play/reading_train_info_and_ploting_multiple_sweeps_all_info.py | mayanks888/second.pytorch | 02d37885a543ee46516648dcab7db8f5d677a179 | [
"MIT"
] | null | null | null | second/pytorch/mayank_play/reading_train_info_and_ploting_multiple_sweeps_all_info.py | mayanks888/second.pytorch | 02d37885a543ee46516648dcab7db8f5d677a179 | [
"MIT"
] | null | null | null | import pickle
import numpy as np
# import mayavi.mlab as mlab
def draw_lidar_simple(pc, color=None):
''' Draw lidar points. simplest set up. '''
fig = mlab.figure(figure=None, bgcolor=(0,0,0), fgcolor=None, engine=None, size=(1600, 1000))
if color is None: color = pc[:,2]
#draw points
mlab.points3... | 50.470588 | 185 | 0.650641 |
c19b5c2b3ccb062f0b638c0e0ee563d3e90c8e0e | 2,308 | py | Python | gen.py | DotBowder/pygame-chaser | dc7469bc16fe4a91abbedd444ff61cbc3163ce45 | [
"MIT"
] | null | null | null | gen.py | DotBowder/pygame-chaser | dc7469bc16fe4a91abbedd444ff61cbc3163ce45 | [
"MIT"
] | null | null | null | gen.py | DotBowder/pygame-chaser | dc7469bc16fe4a91abbedd444ff61cbc3163ce45 | [
"MIT"
] | null | null | null | from keras.layers.core import *
from keras.layers import *
from keras.utils import *
from keras.optimizers import *
from keras.models import *
import numpy as np
import keras
import cv2
import pygame
import random
import sys
if raw_input('Are you sure you want to overwrite your existing model? (y/n)') == 'y':
pas... | 25.644444 | 149 | 0.682842 |
0789a8962457bcfe36570f212d19aa6c0e5d900a | 95 | py | Python | api/data/src/apps/infoscreen/apps.py | xeor/hohu | ab5edb47eb50fe2434432d76d5599f5a2f168f57 | [
"MIT"
] | null | null | null | api/data/src/apps/infoscreen/apps.py | xeor/hohu | ab5edb47eb50fe2434432d76d5599f5a2f168f57 | [
"MIT"
] | null | null | null | api/data/src/apps/infoscreen/apps.py | xeor/hohu | ab5edb47eb50fe2434432d76d5599f5a2f168f57 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class InfoscreenConfig(AppConfig):
name = 'infoscreen'
| 15.833333 | 34 | 0.768421 |
2c7e984dbbbfc8d083ee0e2b6871cf62939f8544 | 2,938 | py | Python | lib/source/siteinfo.py | SmartDataProjects/ddm | 911f90c88702c9f7ed7a885744028c5705543e88 | [
"MIT"
] | 1 | 2018-08-02T03:06:27.000Z | 2018-08-02T03:06:27.000Z | lib/source/siteinfo.py | SmartDataProjects/ddm | 911f90c88702c9f7ed7a885744028c5705543e88 | [
"MIT"
] | 16 | 2017-11-24T21:09:26.000Z | 2019-05-14T15:13:57.000Z | lib/source/siteinfo.py | SmartDataProjects/ddm | 911f90c88702c9f7ed7a885744028c5705543e88 | [
"MIT"
] | 11 | 2016-08-03T10:37:31.000Z | 2018-08-21T14:32:25.000Z | import fnmatch
import re
import logging
from dynamo.utils.classutil import get_instance
from dynamo.dataformat import Configuration
LOG = logging.getLogger(__name__)
class SiteInfoSource(object):
"""
Interface specs for probe to the site information source.
"""
@staticmethod
def get_instance(mod... | 31.255319 | 106 | 0.600408 |
b1bb475e972655ff870c987bf364ac2b82d09edf | 512 | py | Python | pypersonalfin/utils/amount.py | guilhermebruzzi/pypersonalfin | 180619b36ed28e90b2891a9b2b9b4708d22cbdc8 | [
"MIT"
] | 1 | 2021-12-05T17:51:00.000Z | 2021-12-05T17:51:00.000Z | pypersonalfin/utils/amount.py | guilhermebruzzi/pypersonalfin | 180619b36ed28e90b2891a9b2b9b4708d22cbdc8 | [
"MIT"
] | null | null | null | pypersonalfin/utils/amount.py | guilhermebruzzi/pypersonalfin | 180619b36ed28e90b2891a9b2b9b4708d22cbdc8 | [
"MIT"
] | 1 | 2021-02-21T20:07:18.000Z | 2021-02-21T20:07:18.000Z | from .locale import is_brazil
def amount_to_str(amount, locale=None, include_currency=True):
float_amount = amount / 100.0
# Fallback to US amount
float_amount_str = "{:.2f}".format(float_amount)
if is_brazil(locale):
float_amount_str = float_amount_str.replace('.', ',')
if include_cu... | 26.947368 | 62 | 0.675781 |
9ebd335fa1d806b7e44bec2565a44f034c191e2d | 1,301 | py | Python | 19-countingSundays.py | cmaron/Project-Euler | c4950302f71ee65d81040fae5764ec9eeef6b1f0 | [
"MIT"
] | 2 | 2015-01-20T14:00:14.000Z | 2016-01-27T16:36:53.000Z | 19-countingSundays.py | cmaron/Project-Euler | c4950302f71ee65d81040fae5764ec9eeef6b1f0 | [
"MIT"
] | null | null | null | 19-countingSundays.py | cmaron/Project-Euler | c4950302f71ee65d81040fae5764ec9eeef6b1f0 | [
"MIT"
] | null | null | null | days_in_month = {1:31,2:28,3:31,4:30,5:31,6:30,7:31,8:31,9:30,10:31,11:30,12:31}
x = 0
# M = 0, T = 1, W = 2, R = 3, F = 4, S = 5, U = 6
day_of_week = 0
month = 1
day = 1
year = 1900
d_i_m = days_in_month[month]
# This could probably be sped up by jumping a head a week/month at a time and adjusting as
# needed.
while... | 21.327869 | 97 | 0.538048 |
9459fd916901e69b6b57844f1d69447d22a421a1 | 198 | py | Python | app/models/db_session.py | atomberg/transaction-organizer | 40898300209a7fe7d4ed740a98c451060fa442f6 | [
"MIT"
] | null | null | null | app/models/db_session.py | atomberg/transaction-organizer | 40898300209a7fe7d4ed740a98c451060fa442f6 | [
"MIT"
] | null | null | null | app/models/db_session.py | atomberg/transaction-organizer | 40898300209a7fe7d4ed740a98c451060fa442f6 | [
"MIT"
] | null | null | null | from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_session, sessionmaker
engine = create_engine('sqlite:///transactions.db')
Session = scoped_session(sessionmaker(bind=engine))
| 33 | 55 | 0.828283 |
9bf5c882039bb5216945cc29b56482a7cee38a25 | 7,520 | py | Python | setup.py | jeffersonlizar/ShipIt | 501ad01eefa4a9cc2ff794dddca605e3bad92841 | [
"MIT"
] | 1 | 2019-02-19T23:25:28.000Z | 2019-02-19T23:25:28.000Z | setup.py | jeffersonlizar/ShipIt | 501ad01eefa4a9cc2ff794dddca605e3bad92841 | [
"MIT"
] | 4 | 2018-03-02T14:50:18.000Z | 2020-01-06T22:17:36.000Z | setup.py | jeffersonlizar/ShipIt | 501ad01eefa4a9cc2ff794dddca605e3bad92841 | [
"MIT"
] | 2 | 2019-02-08T23:12:24.000Z | 2020-04-27T22:18:27.000Z | """A setuptools based setup module.
See:
https://packaging.python.org/en/latest/distributing.html
https://github.com/pypa/sampleproject
"""
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
# To use a consistent encoding
from codecs import open
from os import path
here = path.absp... | 40.648649 | 101 | 0.681383 |
4a0a1a3abc058fd9e02c03c20b12a563365bdcf2 | 7,493 | py | Python | pyparsehtml/src/parse_doc_string.py | pdoms/PyParseHtml | 513ad30cdfb77eea815b66b1ad91c1c96f3dff81 | [
"MIT"
] | null | null | null | pyparsehtml/src/parse_doc_string.py | pdoms/PyParseHtml | 513ad30cdfb77eea815b66b1ad91c1c96f3dff81 | [
"MIT"
] | null | null | null | pyparsehtml/src/parse_doc_string.py | pdoms/PyParseHtml | 513ad30cdfb77eea815b66b1ad91c1c96f3dff81 | [
"MIT"
] | null | null | null | import re
import copy
from .element import Element
from .utils import isSelfCloser, mergeDict, representElementAsString, seqIdtoDict, getTagBySeqId
from .html_data import global_attributes, css_properties, html_tags_incl_attributes, html_tags_stripped
def addGlobalAttributes():
attributes = {}
for g in global_att... | 28.599237 | 120 | 0.605899 |
d17590fdc8ad7f8cef5662a782cf9a9b26912061 | 2,099 | py | Python | configs/_base_/datasets/pascal_voc12.py | LinB203/remotesense | 37ecce4b7971a1d83df0fd2c8fe033f2bee613f0 | [
"Apache-2.0"
] | null | null | null | configs/_base_/datasets/pascal_voc12.py | LinB203/remotesense | 37ecce4b7971a1d83df0fd2c8fe033f2bee613f0 | [
"Apache-2.0"
] | null | null | null | configs/_base_/datasets/pascal_voc12.py | LinB203/remotesense | 37ecce4b7971a1d83df0fd2c8fe033f2bee613f0 | [
"Apache-2.0"
] | null | null | null | # dataset settings
# dataset_type = 'PascalVOCDataset'
dataset_type = 'RometeSenseDataset'
data_root = 'data/VOCdevkit/VOC2012'
img_norm_cfg = dict(
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
# img_norm_cfg = dict(
# mean=[76.26166752, 87.26432839, 73.30952511], std=[49.25764543, ... | 34.409836 | 109 | 0.629347 |
7823aa06c2880a71ab442d554f2a131e5e3e4c49 | 11,796 | py | Python | scripts/wgan.py | manas-avi/detection-2016-nipsws | b25669dbf1c5d3d1a79638f928c989aca1c32622 | [
"MIT"
] | null | null | null | scripts/wgan.py | manas-avi/detection-2016-nipsws | b25669dbf1c5d3d1a79638f928c989aca1c32622 | [
"MIT"
] | null | null | null | scripts/wgan.py | manas-avi/detection-2016-nipsws | b25669dbf1c5d3d1a79638f928c989aca1c32622 | [
"MIT"
] | 2 | 2018-12-02T08:39:24.000Z | 2018-12-08T15:55:54.000Z | from __future__ import print_function, division
from keras.layers import Input, Dense, Reshape, Flatten, Dropout
from keras.layers import BatchNormalization, Activation, ZeroPadding2D
from keras.layers.advanced_activations import LeakyReLU
from keras.layers.merge import _Merge
from keras.layers.convolutional import Up... | 39.32 | 87 | 0.546965 |
1fc81c6ac7e9d32ebc9d118220a58c60c15a9e96 | 7,781 | py | Python | tclCommands/TclCommandAlignDrill.py | DannyPol/flatcam | 25a8634d0658e98b7fae31a095f8bef40c1b3067 | [
"MIT"
] | 1 | 2022-02-11T06:19:34.000Z | 2022-02-11T06:19:34.000Z | tclCommands/TclCommandAlignDrill.py | MRemy2/FlatCam | d4f941335ca8a8d5351aab23b396f99da06a9029 | [
"MIT"
] | null | null | null | tclCommands/TclCommandAlignDrill.py | MRemy2/FlatCam | d4f941335ca8a8d5351aab23b396f99da06a9029 | [
"MIT"
] | null | null | null | import collections
from tclCommands.TclCommand import TclCommandSignaled
from shapely.geometry import Point
import shapely.affinity as affinity
class TclCommandAlignDrill(TclCommandSignaled):
"""
Tcl shell command to create excellon with drills for aligment.
"""
# array of all command aliases, to be... | 35.208145 | 115 | 0.517928 |
19dc4c0de73f893d29d80deb7d29fa2e7be623e5 | 8,880 | py | Python | docs/conf.py | mongodb-labs/mongo-mockup-db | 317c4e049965f9d99423698a81e52d0ab37b7599 | [
"Apache-2.0"
] | 42 | 2015-09-12T18:56:51.000Z | 2021-08-16T17:57:40.000Z | docs/conf.py | mongodb-labs/mongo-mockup-db | 317c4e049965f9d99423698a81e52d0ab37b7599 | [
"Apache-2.0"
] | 31 | 2015-11-06T13:39:39.000Z | 2021-01-13T11:07:51.000Z | docs/conf.py | mongodb-labs/mongo-mockup-db | 317c4e049965f9d99423698a81e52d0ab37b7599 | [
"Apache-2.0"
] | 14 | 2015-11-22T11:24:51.000Z | 2020-09-08T05:14:11.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# mongo-mockup-db documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 9 22:26:36 2013.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in th... | 29.89899 | 82 | 0.712387 |
c229a87a87d919366746c5613025bdd29eadb26d | 2,698 | py | Python | src/models/community.py | Carbulator/carbulator-server | 7211fcb4c497e5a0bfb0be44e34f39ec94c3c56e | [
"MIT"
] | 2 | 2018-12-14T17:21:58.000Z | 2020-07-22T11:39:28.000Z | src/models/community.py | Carbulator/carbulator-server | 7211fcb4c497e5a0bfb0be44e34f39ec94c3c56e | [
"MIT"
] | 12 | 2018-09-27T07:27:55.000Z | 2018-12-03T17:02:56.000Z | src/models/community.py | Carbulator/carbulator-server | 7211fcb4c497e5a0bfb0be44e34f39ec94c3c56e | [
"MIT"
] | null | null | null | import datetime
from flask_restful import fields
from src.app import db
from src.exceptions.no_data import NoData
from src.models.car import CarModel
from src.models.user import UserModel
class CommunityModel(db.Model):
__tablename__ = 'communities'
id = db.Column(db.Integer, primary_key=True, autoincremen... | 32.506024 | 97 | 0.63195 |
4694c61e6b563e60e7304fdbe96dc311c45a0151 | 1,317 | py | Python | project/speech_recognition/speech_demo.py | shanaka-desoysa/tensorflow | 0effc668f42b64bd0712240ab2f5e8a8be42960f | [
"Apache-2.0"
] | null | null | null | project/speech_recognition/speech_demo.py | shanaka-desoysa/tensorflow | 0effc668f42b64bd0712240ab2f5e8a8be42960f | [
"Apache-2.0"
] | null | null | null | project/speech_recognition/speech_demo.py | shanaka-desoysa/tensorflow | 0effc668f42b64bd0712240ab2f5e8a8be42960f | [
"Apache-2.0"
] | null | null | null | ## https://github.com/llSourcell/tensorflow_speech_recognition_demo/blob/master/demo.py
## https://www.youtube.com/watch?v=u9FPqkuoEJ8
from __future__ import division, print_function, absolute_import
import tflearn
import speech_data
import tensorflow as tf
learning_rate = 0.0001
training_iters = 300000 # steps
batc... | 29.931818 | 109 | 0.760061 |
45daa144acaf092b610a7d7122c0f044f1986f53 | 1,309 | py | Python | examples/v2/utility/utils.py | seanli9jan/tensorflow-examples | c0921149b9d88e5836e4eaa5d3024f579ced1029 | [
"MIT"
] | null | null | null | examples/v2/utility/utils.py | seanli9jan/tensorflow-examples | c0921149b9d88e5836e4eaa5d3024f579ced1029 | [
"MIT"
] | null | null | null | examples/v2/utility/utils.py | seanli9jan/tensorflow-examples | c0921149b9d88e5836e4eaa5d3024f579ced1029 | [
"MIT"
] | null | null | null | import tensorflow as tf
import os
def tf_disable_logging(interactive="DEBUG"):
level = {"DEBUG":'0', "INFO":'1', "WARNING":'2', "ERROR":'3'}
os.environ['TF_CPP_MIN_LOG_LEVEL'] = level[interactive]
def tf_limit_gpu():
gpus = tf.config.experimental.list_physical_devices('GPU')
if gpus:
try:
... | 34.447368 | 97 | 0.685256 |
ebafe3b2b5ea712f7fe5995452bc1d07577145b5 | 2,727 | py | Python | kmmi/heuristics/utils.py | Decitizen/kMMI | 921ef6e45fbec484251444886e246741d7f0120a | [
"MIT"
] | null | null | null | kmmi/heuristics/utils.py | Decitizen/kMMI | 921ef6e45fbec484251444886e246741d7f0120a | [
"MIT"
] | null | null | null | kmmi/heuristics/utils.py | Decitizen/kMMI | 921ef6e45fbec484251444886e246741d7f0120a | [
"MIT"
] | null | null | null | from time import process_time
from datetime import timedelta as td
import numpy as np
from numba import *
from kmmi.heuristics.initialize import *
def __to_len_classes(ss):
n_ss = {}
for i,s in enumerate(ss):
n_s = len(s)
if n_s not in n_ss:
n_ss[n_s] = []
n_ss[n_s].append(i... | 28.113402 | 83 | 0.541988 |
8e53f7c1634b55e4e4c004411d0b6b8bdfd33635 | 664 | py | Python | test/tests/test_package/import_target.py | jmgc/pyston | 9f672c1bbb75710ac17dd3d9107da05c8e9e8e8f | [
"BSD-2-Clause",
"Apache-2.0"
] | null | null | null | test/tests/test_package/import_target.py | jmgc/pyston | 9f672c1bbb75710ac17dd3d9107da05c8e9e8e8f | [
"BSD-2-Clause",
"Apache-2.0"
] | null | null | null | test/tests/test_package/import_target.py | jmgc/pyston | 9f672c1bbb75710ac17dd3d9107da05c8e9e8e8f | [
"BSD-2-Clause",
"Apache-2.0"
] | null | null | null | print "running test_package.import_target"
# Since we are currently importing test_package.import_target, this
# import will succeed (return directly from sys.modules), even though
# test_package will not have the 'import_target' attribute yet
import test_package.import_target
try:
print test_package.import_targ... | 23.714286 | 95 | 0.769578 |
a9414909f5010a8992ced493af7b010f5d0816ef | 157 | py | Python | ejercicio8/pregunta2.py | mariagarciau/introduccionAlgortimica2 | 49d11ec4bed07badf751fef9d39e4337b8213a27 | [
"Apache-2.0"
] | null | null | null | ejercicio8/pregunta2.py | mariagarciau/introduccionAlgortimica2 | 49d11ec4bed07badf751fef9d39e4337b8213a27 | [
"Apache-2.0"
] | null | null | null | ejercicio8/pregunta2.py | mariagarciau/introduccionAlgortimica2 | 49d11ec4bed07badf751fef9d39e4337b8213a27 | [
"Apache-2.0"
] | null | null | null | def intereses(capital,interes,meses):
for i in range (0,meses):
capital= capital+capital*interes/100
return print(capital)
intereses(100,5,3) | 31.4 | 44 | 0.707006 |
e1bcefbaa1ce97422b7ac2e9d28403ae4b55c0b3 | 3,483 | py | Python | maskprop/MiVOS/fbrs/model/metrics.py | qinliuliuqin/iSegFormer | 67b634588cc0a1e09fb3e092966eae997eb209fa | [
"MIT"
] | 14 | 2021-12-09T08:33:23.000Z | 2022-03-26T13:11:01.000Z | maskprop/MiVOS/fbrs/model/metrics.py | qinliuliuqin/iSegFormer | 67b634588cc0a1e09fb3e092966eae997eb209fa | [
"MIT"
] | null | null | null | maskprop/MiVOS/fbrs/model/metrics.py | qinliuliuqin/iSegFormer | 67b634588cc0a1e09fb3e092966eae997eb209fa | [
"MIT"
] | null | null | null | import torch
import numpy as np
from fbrs.utils import misc
class TrainMetric(object):
def __init__(self, pred_outputs, gt_outputs):
self.pred_outputs = pred_outputs
self.gt_outputs = gt_outputs
def update(self, *args, **kwargs):
raise NotImplementedError
def get_epoch_value(sel... | 34.147059 | 103 | 0.654895 |
bc681265cce1e23e3ce4fc3adfb2725ca4c9d16c | 271 | py | Python | openbox/runner/__init__.py | shlomos/obsi | b1fccb6cef6c28f39371954f7f98fefa22b4144a | [
"Apache-2.0"
] | null | null | null | openbox/runner/__init__.py | shlomos/obsi | b1fccb6cef6c28f39371954f7f98fefa22b4144a | [
"Apache-2.0"
] | null | null | null | openbox/runner/__init__.py | shlomos/obsi | b1fccb6cef6c28f39371954f7f98fefa22b4144a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# Copyright (c) 2015 Pavel Lazar pavel.lazar (at) gmail.com
#
# The Software is provided WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED.
#####################################################################
"""
An Execution Engine Runner package
"""
| 20.846154 | 69 | 0.531365 |
f626779fc60dce20577e26dd7577f0b9088dbe30 | 508 | py | Python | build/jy901_driver/catkin_generated/pkg.installspace.context.pc.py | FProgrammerLIU/caster_man_ros | a75b503fad3a470f985072a2b3953e89074f3223 | [
"MIT"
] | null | null | null | build/jy901_driver/catkin_generated/pkg.installspace.context.pc.py | FProgrammerLIU/caster_man_ros | a75b503fad3a470f985072a2b3953e89074f3223 | [
"MIT"
] | null | null | null | build/jy901_driver/catkin_generated/pkg.installspace.context.pc.py | FProgrammerLIU/caster_man_ros | a75b503fad3a470f985072a2b3953e89074f3223 | [
"MIT"
] | null | null | null | # generated from catkin/cmake/template/pkg.context.pc.in
CATKIN_PACKAGE_PREFIX = ""
PROJECT_PKG_CONFIG_INCLUDE_DIRS = "/home/caster/ros_ws/caster/install/include".split(';') if "/home/caster/ros_ws/caster/install/include" != "" else []
PROJECT_CATKIN_DEPENDS = "serial;roscpp;sensor_msgs;tf;message_runtime".replace(';',... | 56.444444 | 151 | 0.75 |
7215e999b421702aec92ef64115f015ee50a6700 | 4,210 | py | Python | aae_architechture_3_layer.py | raktim-mondol/breast-cancer-sub-types | 98e8205c8f7edceeb1cfbe5ac4482fd8122aadd2 | [
"CC-BY-4.0"
] | 1 | 2021-08-01T11:49:05.000Z | 2021-08-01T11:49:05.000Z | aae_architechture_3_layer.py | raktim-mondol/breast-cancer-sub-types | 98e8205c8f7edceeb1cfbe5ac4482fd8122aadd2 | [
"CC-BY-4.0"
] | null | null | null | aae_architechture_3_layer.py | raktim-mondol/breast-cancer-sub-types | 98e8205c8f7edceeb1cfbe5ac4482fd8122aadd2 | [
"CC-BY-4.0"
] | null | null | null | seed=75
import os
import matplotlib as mpl
mpl.use('Agg')
import numpy as np
np.random.seed(seed)
from tensorflow import set_random_seed
set_random_seed(seed)
from keras.layers import Dense, Reshape, Flatten, Input, merge, Dropout, LeakyReLU, Activation
from keras.models import Sequential, Model, load_model
from keras.... | 40.873786 | 124 | 0.680048 |
3d3976e0ec764bb399eacee7e97a6d253d6abe8c | 3,165 | py | Python | qubell/tests/common/test_entity_list.py | storgashov/contrib-python-qubell-client | 9409c051ee4f4a7bef696dccc01edf3137affdf4 | [
"Apache-2.0"
] | null | null | null | qubell/tests/common/test_entity_list.py | storgashov/contrib-python-qubell-client | 9409c051ee4f4a7bef696dccc01edf3137affdf4 | [
"Apache-2.0"
] | null | null | null | qubell/tests/common/test_entity_list.py | storgashov/contrib-python-qubell-client | 9409c051ee4f4a7bef696dccc01edf3137affdf4 | [
"Apache-2.0"
] | null | null | null | from qubell import deprecated
import unittest
from qubell.api.private.common import EntityList, IdName
from qubell.api.private import exceptions
class EntityListTests(unittest.TestCase):
class DummyEntity:
def __init__(self, id, name):
self.id = id
self.name = name
@prope... | 34.032258 | 246 | 0.637915 |
e5561ab4bbb0066a09c843e991195e4eb26fadd7 | 4,924 | py | Python | google/appengine/tools/devappserver2/admin/admin_request_handler.py | MiCHiLU/google_appengine_sdk | 3da9f20d7e65e26c4938d2c4054bc4f39cbc5522 | [
"Apache-2.0"
] | 16 | 2016-04-23T20:16:12.000Z | 2021-10-09T16:58:25.000Z | google/appengine/tools/devappserver2/admin/admin_request_handler.py | MiCHiLU/google_appengine_sdk | 3da9f20d7e65e26c4938d2c4054bc4f39cbc5522 | [
"Apache-2.0"
] | 53 | 2016-04-06T21:10:43.000Z | 2018-03-19T23:14:33.000Z | google/appengine/tools/devappserver2/admin/admin_request_handler.py | MiCHiLU/google_appengine_sdk | 3da9f20d7e65e26c4938d2c4054bc4f39cbc5522 | [
"Apache-2.0"
] | 23 | 2016-04-19T05:45:26.000Z | 2021-12-31T23:22:36.000Z | #!/usr/bin/env python
#
# Copyright 2007 Google 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 o... | 30.395062 | 77 | 0.693136 |
089db57576c00e174cd3f9b736674724da5d5a87 | 3,280 | py | Python | TensorFlow-with-dynamic-scaling/tensorflow/python/ops/raw_ops_test.py | BingyangWu/Antman | e9323cc8ccda637d3962b0de29ce154317f17e7a | [
"MIT"
] | 388 | 2020-06-27T01:38:29.000Z | 2022-03-29T14:12:01.000Z | tensorflow/python/ops/raw_ops_test.py | yashsehgal/tensorflow | de743966b1c6da186f13a8007f68b04e52357ad1 | [
"Apache-2.0"
] | 80 | 2020-09-02T01:57:33.000Z | 2022-03-28T08:51:57.000Z | tensorflow/python/ops/raw_ops_test.py | yashsehgal/tensorflow | de743966b1c6da186f13a8007f68b04e52357ad1 | [
"Apache-2.0"
] | 75 | 2021-12-24T04:48:21.000Z | 2022-03-29T10:13:39.000Z | # Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 35.268817 | 80 | 0.689939 |
1ca86262ea33a06360d8f0e1a8086b2c8a7cc7a7 | 292 | py | Python | function1.py | priyalbhatewara123/Python-programs | 90b84310101b76c14b89f256ee9206711908a4ae | [
"bzip2-1.0.6"
] | null | null | null | function1.py | priyalbhatewara123/Python-programs | 90b84310101b76c14b89f256ee9206711908a4ae | [
"bzip2-1.0.6"
] | null | null | null | function1.py | priyalbhatewara123/Python-programs | 90b84310101b76c14b89f256ee9206711908a4ae | [
"bzip2-1.0.6"
] | null | null | null | #Function with dictionary
def build_profile(first,last,**user_info):
p = {}
p['first_name'] = first
p['last_name'] = last
for k,v in user_info.items():
p[k] = v
return p
m = build_profile('priyal','bhatewara',location = 'ratlam',field = 'IT',clg = 'MSIT')
print(m) | 29.2 | 85 | 0.619863 |
711ccab443dd5710870e298be074dadd0b8eb825 | 1,550 | py | Python | assignment3/sim/a35.py | michalmiotk/my_assingment_particle_filter | d518b427ef700cb6db9f04d31e8293d0814c1b1c | [
"MIT"
] | 6 | 2020-12-04T11:00:23.000Z | 2022-01-29T13:56:08.000Z | assignment3/sim/a35.py | michalmiotk/my_assingment_particle_filter | d518b427ef700cb6db9f04d31e8293d0814c1b1c | [
"MIT"
] | null | null | null | assignment3/sim/a35.py | michalmiotk/my_assingment_particle_filter | d518b427ef700cb6db9f04d31e8293d0814c1b1c | [
"MIT"
] | 6 | 2020-12-04T11:00:54.000Z | 2022-01-30T17:58:40.000Z | import matplotlib.pyplot as plt
import math
def plot_particles(particles, distance, show=True):
plt.xlim([-0.9, distance + 0.9])
for particle in particles:
plt.plot([particle.pos], [0.0], '*', color=particle.color)
if show:
plt.show()
def plot_resample_counts(particles, resample, i_count... | 27.192982 | 79 | 0.627097 |
6e01c198b47920e09f6d0a0faece1e8758af9f22 | 507 | py | Python | toolbox/visualization/setup.py | brennengreen/NIRFAST-Parallel | 9ee2a40d039cbfcaf03acea82e91e25d350cc0a5 | [
"BSD-3-Clause"
] | 1 | 2015-03-18T01:57:36.000Z | 2015-03-18T01:57:36.000Z | toolbox/visualization/setup.py | brennengreen/NIRFAST-Parallel | 9ee2a40d039cbfcaf03acea82e91e25d350cc0a5 | [
"BSD-3-Clause"
] | null | null | null | toolbox/visualization/setup.py | brennengreen/NIRFAST-Parallel | 9ee2a40d039cbfcaf03acea82e91e25d350cc0a5 | [
"BSD-3-Clause"
] | null | null | null | # for building the exe:
# python setup.py py2exe --includes sip
from distutils.core import setup
from py2exe.build_exe import py2exe
from glob import glob
import py2exe
import sys
sys.path.append("C:\\Program Files (x86)\\Microsoft Visual Studio 9.0\\VC\\redist\\x86\\Microsoft.VC90.CRT")
data_files = [("Mic... | 33.8 | 136 | 0.721893 |
c80d18528d72a72ccb9f58cd763e62f716b1474c | 1,098 | py | Python | maio/urls.py | jonmsawyer/maio | 468fe495189d970ccc6ec01665865bbf2c6ec578 | [
"MIT"
] | null | null | null | maio/urls.py | jonmsawyer/maio | 468fe495189d970ccc6ec01665865bbf2c6ec578 | [
"MIT"
] | 5 | 2016-09-22T23:17:40.000Z | 2018-04-05T22:36:37.000Z | maio/urls.py | jonmsawyer/maio | 468fe495189d970ccc6ec01665865bbf2c6ec578 | [
"MIT"
] | null | null | null | """
maio URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-bas... | 32.294118 | 79 | 0.6949 |
43a344148a3cbb469accf53228539aa0abeb9aff | 1,746 | py | Python | extract.py | Kyubyong/bert-token-embeddings | 73d68466be290551b4a9a31d4a02a7330cac4ce3 | [
"Apache-2.0"
] | 101 | 2019-01-22T08:36:41.000Z | 2021-11-08T10:33:56.000Z | extract.py | pengshuang/bert-token-embeddings | 73d68466be290551b4a9a31d4a02a7330cac4ce3 | [
"Apache-2.0"
] | 1 | 2019-01-28T11:32:54.000Z | 2019-02-26T02:29:39.000Z | extract.py | pengshuang/bert-token-embeddings | 73d68466be290551b4a9a31d4a02a7330cac4ce3 | [
"Apache-2.0"
] | 17 | 2019-01-22T19:24:57.000Z | 2021-09-15T02:10:50.000Z | import torch
import numpy as np
np.set_printoptions(threshold=np.nan)
from multiprocessing import Pool
import re
from tqdm import tqdm
import os
os.system("pip install pytorch_pretrained_bert")
from pytorch_pretrained_bert import BertTokenizer, BertModel
def get_embeddings(mname):
'''Gets pretrained embeddings of... | 32.333333 | 92 | 0.616838 |
ae22c4658af4d167ed1ad184faf468e89244b620 | 4,137 | py | Python | Dangerous/Golismero/tools/sqlmap/thirdparty/colorama/winterm.py | JeyZeta/Dangerous- | 824ea6b571eda98bb855f176361e9b35dfda578e | [
"MIT"
] | null | null | null | Dangerous/Golismero/tools/sqlmap/thirdparty/colorama/winterm.py | JeyZeta/Dangerous- | 824ea6b571eda98bb855f176361e9b35dfda578e | [
"MIT"
] | null | null | null | Dangerous/Golismero/tools/sqlmap/thirdparty/colorama/winterm.py | JeyZeta/Dangerous- | 824ea6b571eda98bb855f176361e9b35dfda578e | [
"MIT"
] | 1 | 2018-07-04T18:35:16.000Z | 2018-07-04T18:35:16.000Z |
from . import win32
# from wincon.h
class WinColor(object):
BLACK = 0
BLUE = 1
GREEN = 2
CYAN = 3
RED = 4
MAGENTA = 5
YELLOW = 6
GREY = 7
# from wincon.h
class WinStyle(object):
NORMAL = 0x00 # dim text, dim background
BRIGHT = 0x08 # bright text, dim backgr... | 34.190083 | 95 | 0.629683 |
9c08721e50a9252035d6ca33b282764795b45733 | 5,433 | py | Python | tests/test_adapter_fusion_loading.py | tilmanbeck/adapter-transformers | ed42ced6983891060bb160c5c4f2c5d64d2c205c | [
"Apache-2.0"
] | null | null | null | tests/test_adapter_fusion_loading.py | tilmanbeck/adapter-transformers | ed42ced6983891060bb160c5c4f2c5d64d2c205c | [
"Apache-2.0"
] | null | null | null | tests/test_adapter_fusion_loading.py | tilmanbeck/adapter-transformers | ed42ced6983891060bb160c5c4f2c5d64d2c205c | [
"Apache-2.0"
] | null | null | null | import copy
import tempfile
import unittest
import torch
from transformers import (
ADAPTER_CONFIG_MAP,
ADAPTERFUSION_CONFIG_MAP,
AdapterType,
BertModel,
RobertaModel,
XLMRobertaModel,
)
from .test_modeling_common import ids_tensor
from .utils import require_torch
def create_twin_models(mod... | 48.079646 | 115 | 0.585864 |
7e83e32b790ec316c24bd025c3c50af78279c966 | 692 | py | Python | app/main.py | pyVarad/fast-api-auth0-recepie | 453a1e05b76cb10829a4991ce60a1a0afb112803 | [
"Apache-2.0"
] | null | null | null | app/main.py | pyVarad/fast-api-auth0-recepie | 453a1e05b76cb10829a4991ce60a1a0afb112803 | [
"Apache-2.0"
] | null | null | null | app/main.py | pyVarad/fast-api-auth0-recepie | 453a1e05b76cb10829a4991ce60a1a0afb112803 | [
"Apache-2.0"
] | null | null | null | """ MAIN Application starts here.
"""
from fastapi import FastAPI
from db.database import engine
from models import dimensions, questions, answers, users
from controllers.dimension import dimension_router
from controllers.questions import questions_router
from controllers.answers import answer_router
from controllers.... | 31.454545 | 56 | 0.848266 |
e784c6a1e050bdbb2f38e6e71264e01e86f32dad | 27 | py | Python | hola.py | Esfireno/Course_Pytorch | 1c61f0ba8f8b9f144b44048981d71e345065ea57 | [
"MIT"
] | null | null | null | hola.py | Esfireno/Course_Pytorch | 1c61f0ba8f8b9f144b44048981d71e345065ea57 | [
"MIT"
] | null | null | null | hola.py | Esfireno/Course_Pytorch | 1c61f0ba8f8b9f144b44048981d71e345065ea57 | [
"MIT"
] | null | null | null | pritn("Hola pinche mundo")
| 13.5 | 26 | 0.740741 |
e5afd90af2d2d12981bf1809906017958276488c | 22,962 | py | Python | scripts/create_bokeh_dash.py | rynecarbone/fantasy_scoring | b3788e7642f7f8b0a34ed334c83ecf573c429a6e | [
"MIT"
] | null | null | null | scripts/create_bokeh_dash.py | rynecarbone/fantasy_scoring | b3788e7642f7f8b0a34ed334c83ecf573c429a6e | [
"MIT"
] | null | null | null | scripts/create_bokeh_dash.py | rynecarbone/fantasy_scoring | b3788e7642f7f8b0a34ed334c83ecf573c429a6e | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Create a bokeh dashboard with customJS callbacks for interactivity"""
import pandas as pd
from bokeh.layouts import row, column, layout, gridplot, widgetbox
from bokeh.models import (CustomJS, RangeSlider, HoverTool, Range1d,
CheckboxGroup, CheckboxButtonGroup, Sele... | 51.254464 | 168 | 0.668757 |
78dff661c93c0ab33bc26e125d6f14baa06e65d8 | 6,107 | py | Python | lib/tests/streamlit/metrics_test.py | cdeil/streamlit | 173aa1cd5835174620e8246eb5d7116be2cb6ffc | [
"Apache-2.0"
] | 1 | 2020-09-20T11:18:09.000Z | 2020-09-20T11:18:09.000Z | lib/tests/streamlit/metrics_test.py | cdeil/streamlit | 173aa1cd5835174620e8246eb5d7116be2cb6ffc | [
"Apache-2.0"
] | 108 | 2020-11-10T22:19:28.000Z | 2022-03-29T16:48:55.000Z | lib/tests/streamlit/metrics_test.py | cdeil/streamlit | 173aa1cd5835174620e8246eb5d7116be2cb6ffc | [
"Apache-2.0"
] | null | null | null | # Copyright 2018-2020 Streamlit 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 or agreed to in wr... | 37.466258 | 93 | 0.626494 |
f1066f217e54855f45c8db5ba0ac4e410e4f530d | 4,782 | py | Python | RelatedCode/FindVesselMaterialIntersection.py | Jack-XHP/LabPicV2-MaskRCNN | b0586b2827000c7b7337d5110b2b1fd6185053a8 | [
"MIT"
] | null | null | null | RelatedCode/FindVesselMaterialIntersection.py | Jack-XHP/LabPicV2-MaskRCNN | b0586b2827000c7b7337d5110b2b1fd6185053a8 | [
"MIT"
] | null | null | null | RelatedCode/FindVesselMaterialIntersection.py | Jack-XHP/LabPicV2-MaskRCNN | b0586b2827000c7b7337d5110b2b1fd6185053a8 | [
"MIT"
] | null | null | null | import numpy
import json
import cv2
import numpy as np
import os
import scipy.misc as misc
def show(Im):
cv2.imshow("show",Im.astype(np.uint8))
cv2.waitKey()
cv2.destroyAllWindows()
###############################################################################################
def FindIntersectio... | 39.85 | 133 | 0.384776 |
acd42e8f17259fe1ebf3cf14b698e7b35d810a52 | 4,630 | py | Python | prod/jobs/check_dominat_symbol.py | garywangiam02/vnpy | fbb168bf977d95ae874e92a3655c6c893db16a1f | [
"MIT"
] | null | null | null | prod/jobs/check_dominat_symbol.py | garywangiam02/vnpy | fbb168bf977d95ae874e92a3655c6c893db16a1f | [
"MIT"
] | null | null | null | prod/jobs/check_dominat_symbol.py | garywangiam02/vnpy | fbb168bf977d95ae874e92a3655c6c893db16a1f | [
"MIT"
] | null | null | null | # flake8: noqa
"""
更新主力合约
"""
from vnpy.trader.utility import load_json, save_json, append_data
from vnpy.trader.util_wechat import send_wx_msg
from vnpy.data.tdx.tdx_future_data import *
import os
import sys
import json
from collections import OrderedDict
import pandas as pd
vnpy_root = os.path.abspath(os.path.join(o... | 36.746032 | 121 | 0.590929 |
6065fdaedf80bd7a86c8877ed6ae31ca774c75c3 | 426 | py | Python | api_scrapper.py | sallagoi/python_scrapper | 47bf682e4348c2289f0991df5d40f75d6dbac091 | [
"BSD-2-Clause"
] | null | null | null | api_scrapper.py | sallagoi/python_scrapper | 47bf682e4348c2289f0991df5d40f75d6dbac091 | [
"BSD-2-Clause"
] | null | null | null | api_scrapper.py | sallagoi/python_scrapper | 47bf682e4348c2289f0991df5d40f75d6dbac091 | [
"BSD-2-Clause"
] | null | null | null | from flask import Flask, jsonify, request
from pages_jaunes_france import PJ
app = Flask(__name__)
# incomes = [
# { 'description': 'salary', 'amount': 5000 }
# ]
@app.route('/phones/')
def get_phones():
query = 'pulido'
location = 'bayonne'
proximite = 0
pj = PJ()
pj.set_query(query)
pj.s... | 19.363636 | 47 | 0.650235 |
58effa89618484e3ea4af4306b856a65528b2e7b | 352 | py | Python | hatespeech/api/__init__.py | tkhoa2711/twitter-hate-speech | 92476235bf3bf176a80b0b5879450f4acff42913 | [
"MIT"
] | null | null | null | hatespeech/api/__init__.py | tkhoa2711/twitter-hate-speech | 92476235bf3bf176a80b0b5879450f4acff42913 | [
"MIT"
] | 9 | 2018-06-12T04:52:15.000Z | 2020-04-22T02:45:43.000Z | hatespeech/api/__init__.py | tkhoa2711/twitter-hate-speech | 92476235bf3bf176a80b0b5879450f4acff42913 | [
"MIT"
] | null | null | null | from hatespeech.api.app import app
# import and register blueprints
from hatespeech.api import auth
app.register_blueprint(auth.mod)
from hatespeech.api import twitter
app.register_blueprint(twitter.mod)
from hatespeech.api import hateword
app.register_blueprint(hateword.mod)
from hatespeech.api import testing
app.... | 23.466667 | 36 | 0.840909 |
c2f2f6f92e3699c775a47ce403c56f395601b6be | 2,194 | py | Python | userbot/modules/zipfile.py | rishi432/oubx | bc960e4b4e002c1c45535e13ec24f4547aa23a56 | [
"CNRI-Python",
"Condor-1.1",
"Naumen",
"Xnet",
"FTL",
"X11",
"MS-PL"
] | null | null | null | userbot/modules/zipfile.py | rishi432/oubx | bc960e4b4e002c1c45535e13ec24f4547aa23a56 | [
"CNRI-Python",
"Condor-1.1",
"Naumen",
"Xnet",
"FTL",
"X11",
"MS-PL"
] | 1 | 2021-02-08T20:44:56.000Z | 2021-02-08T20:44:56.000Z | userbot/modules/zipfile.py | GokuMUI7/oubx | bc960e4b4e002c1c45535e13ec24f4547aa23a56 | [
"CNRI-Python",
"Condor-1.1",
"Naumen",
"Xnet",
"FTL",
"X11",
"MS-PL"
] | null | null | null | """ command: .compress """
from telethon import events
import asyncio
import zipfile
from pySmartDL import SmartDL
from userbot.events import register
import time
import os
from userbot import TEMP_DOWNLOAD_DIRECTORY ,bot
from userbot import CMD_HELP
# from uniborg.util import admin_cmd, humanbytes, progress, time_for... | 32.264706 | 93 | 0.640383 |
0eb629cdb2722cef131cea87a5b1776ac9a76edb | 1,824 | py | Python | configs/_base_/datasets/cocostuff.py | yutao1008/MSwin | acdb750e9e0a7b978b1bae0a1d571e197eeb358a | [
"MIT"
] | null | null | null | configs/_base_/datasets/cocostuff.py | yutao1008/MSwin | acdb750e9e0a7b978b1bae0a1d571e197eeb358a | [
"MIT"
] | null | null | null | configs/_base_/datasets/cocostuff.py | yutao1008/MSwin | acdb750e9e0a7b978b1bae0a1d571e197eeb358a | [
"MIT"
] | null | null | null | # dataset settings
dataset_type = 'COCOStuffDataset'
data_root = 'data/cocostuff/'
img_norm_cfg = dict(
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
img_scale = (520, 520)
crop_size = (480, 480)
train_pipeline = [
dict(type='LoadImageFromFile'),
dict(type='LoadAnnotations'),
... | 30.4 | 77 | 0.617325 |
1aba2a9f78cb0674d8b8592da03fcb1c0a58e5b7 | 1,572 | py | Python | tests/Poisson/Poisson3d/pdeapp.py | wraith1995/Exasim | ad475c7066c5bde1a7941e1703650e3a0db34fbb | [
"MIT"
] | 1 | 2022-01-09T21:26:24.000Z | 2022-01-09T21:26:24.000Z | tests/Poisson/Poisson3d/pdeapp.py | wraith1995/Exasim | ad475c7066c5bde1a7941e1703650e3a0db34fbb | [
"MIT"
] | null | null | null | tests/Poisson/Poisson3d/pdeapp.py | wraith1995/Exasim | ad475c7066c5bde1a7941e1703650e3a0db34fbb | [
"MIT"
] | null | null | null | # import external modules
import numpy, os
# Add Exasim to Python search path
cdir = os.getcwd(); ii = cdir.find("Exasim");
exec(open(cdir[0:(ii+6)] + "/Installation/setpath.py").read());
# import internal modules
import Preprocessing, Postprocessing, Gencode, Mesh
# Create pde object and mesh object
pde,mesh = Prep... | 43.666667 | 192 | 0.673664 |
4a4b0d6848a594dd5b64ea412a5149097af6ebe3 | 2,455 | py | Python | aliyun-python-sdk-hbr/aliyunsdkhbr/request/v20170908/CreateContactRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 1,001 | 2015-07-24T01:32:41.000Z | 2022-03-25T01:28:18.000Z | aliyun-python-sdk-hbr/aliyunsdkhbr/request/v20170908/CreateContactRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 363 | 2015-10-20T03:15:00.000Z | 2022-03-08T12:26:19.000Z | aliyun-python-sdk-hbr/aliyunsdkhbr/request/v20170908/CreateContactRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 682 | 2015-09-22T07:19:02.000Z | 2022-03-22T09:51:46.000Z | # 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... | 32.733333 | 74 | 0.757637 |
f45f10929a147bc2af9a27f943922859a2cfcdf2 | 4,872 | py | Python | network_model/model_for_distillation.py | yuga-n/ModelLearner | 3193efd5eb15172ba8231a34829942040fcb0fc5 | [
"MIT"
] | null | null | null | network_model/model_for_distillation.py | yuga-n/ModelLearner | 3193efd5eb15172ba8231a34829942040fcb0fc5 | [
"MIT"
] | null | null | null | network_model/model_for_distillation.py | yuga-n/ModelLearner | 3193efd5eb15172ba8231a34829942040fcb0fc5 | [
"MIT"
] | 1 | 2021-09-14T14:52:28.000Z | 2021-09-14T14:52:28.000Z | import keras.callbacks
from typing import List
from typing import Optional
import os
from datetime import datetime
from DataIO import data_loader as dl
from network_model.distillation.flow_wrapper import FlowForDistillation
from network_model.wrapper.abstract_model import AbstractModel, build_record_path
class ModelF... | 45.111111 | 98 | 0.566297 |
a52584a6b22d58aa92c65a52622b1df0bd18c71e | 26,417 | py | Python | DTLN_model.py | DgtalRock/DTLN | fec686e7a5edaf92b21aa31ff20089af50af92cf | [
"MIT"
] | 1 | 2021-09-09T08:28:08.000Z | 2021-09-09T08:28:08.000Z | DTLN_model.py | DgtalRock/DTLN | fec686e7a5edaf92b21aa31ff20089af50af92cf | [
"MIT"
] | null | null | null | DTLN_model.py | DgtalRock/DTLN | fec686e7a5edaf92b21aa31ff20089af50af92cf | [
"MIT"
] | 2 | 2020-08-11T10:50:14.000Z | 2021-07-15T17:53:49.000Z | # -*- coding: utf-8 -*-
"""
This File contains everything to train the DTLN model.
For running the training see "run_training.py".
To run evaluation with the provided pretrained model see "run_evaluation.py".
Author: Nils L. Westhausen (nils.westhausen@uol.de)
Version: 24.06.2020
This code is licensed under the term... | 41.147975 | 109 | 0.593746 |
03f473f81abfcfe1e26fe9864864f9a3b037bb4e | 1,826 | py | Python | tests/databases/value/fixtures/mongo_db.py | stevenbennett96/stk | 6e5af87625b83e0bfc7243bc42d8c7a860cbeb76 | [
"MIT"
] | null | null | null | tests/databases/value/fixtures/mongo_db.py | stevenbennett96/stk | 6e5af87625b83e0bfc7243bc42d8c7a860cbeb76 | [
"MIT"
] | null | null | null | tests/databases/value/fixtures/mongo_db.py | stevenbennett96/stk | 6e5af87625b83e0bfc7243bc42d8c7a860cbeb76 | [
"MIT"
] | null | null | null | from dataclasses import dataclass
from typing import Callable
import pymongo
import pytest
import stk
from ..case_data import CaseData
@dataclass(frozen=True)
class CaseDataData:
"""
Data used to create a :class:`.CaseData` instance.
Attributes
----------
get_database : :class:`callable`
... | 24.675676 | 67 | 0.600219 |
934ef35a6bb93cde2a0a5658cdb61cf81b4058b6 | 81 | py | Python | src/resources/__init__.py | amritha-devadiga/aaib4-inference | 963d1847b1946fed6afbccb58f3f13c8588ae447 | [
"MIT"
] | null | null | null | src/resources/__init__.py | amritha-devadiga/aaib4-inference | 963d1847b1946fed6afbccb58f3f13c8588ae447 | [
"MIT"
] | null | null | null | src/resources/__init__.py | amritha-devadiga/aaib4-inference | 963d1847b1946fed6afbccb58f3f13c8588ae447 | [
"MIT"
] | null | null | null | from .translate import InteractiveMultiTranslateResourceNew,NMTTranslateResource
| 40.5 | 80 | 0.925926 |
f7e7cb7871a7b8621bda8fd393c7e877102ee0bf | 4,155 | py | Python | FEV_KEGG/Experiments/12.py | ryhaberecht/FEV-KEGG | f55f294aae07b76954ed823f0c2e6d189fb2b1bb | [
"MIT"
] | null | null | null | FEV_KEGG/Experiments/12.py | ryhaberecht/FEV-KEGG | f55f294aae07b76954ed823f0c2e6d189fb2b1bb | [
"MIT"
] | 2 | 2019-05-30T06:42:08.000Z | 2021-05-06T10:37:40.000Z | FEV_KEGG/Experiments/12.py | ryhaberecht/FEV-KEGG | f55f294aae07b76954ed823f0c2e6d189fb2b1bb | [
"MIT"
] | null | null | null | """
Question
--------
Which EC numbers are not present in all Escherichia coli K-12 organisms?
Method
------
- Get all metabolic pathways of all E. coli K-12 organisms from KEGG.
- For each organism, combine all pathways to the metabolic network, by UNION operation.
- Convert this metabolic network into a substance-ec... | 29.678571 | 163 | 0.67485 |
0a546b4e94ef4c430e39a82fecf5e63d4561c129 | 11,263 | py | Python | src/commonwidgets.py | takumak/tuna | a50d1d34c9917d73f02257bcffcf7cc6bf582747 | [
"MIT"
] | null | null | null | src/commonwidgets.py | takumak/tuna | a50d1d34c9917d73f02257bcffcf7cc6bf582747 | [
"MIT"
] | null | null | null | src/commonwidgets.py | takumak/tuna | a50d1d34c9917d73f02257bcffcf7cc6bf582747 | [
"MIT"
] | null | null | null | import sys
import re
import logging
import html
from PyQt5.QtCore import Qt, pyqtSignal, QObject, QPoint, QRect, QSize, QEvent, QCoreApplication
from PyQt5.QtGui import QKeySequence, QValidator, QPainter, \
QPen, QBrush, QColor, QPixmap, QMouseEvent
from PyQt5.QtWidgets import QApplication, QWidget, QTableWidget, QMe... | 25.4819 | 98 | 0.643257 |
4e3939907daa9b1febbf723bfa4ce38baca20f79 | 673 | py | Python | titration/utils/devices/temperature_probe.py | kieransukachevin/AlkalinityTitrator | 09b642ee1368278b7b4fc180bed50ff538a0938a | [
"MIT"
] | null | null | null | titration/utils/devices/temperature_probe.py | kieransukachevin/AlkalinityTitrator | 09b642ee1368278b7b4fc180bed50ff538a0938a | [
"MIT"
] | 31 | 2021-06-29T17:53:56.000Z | 2021-08-19T21:59:03.000Z | titration/utils/devices/temperature_probe.py | kieransukachevin/AlkalinityTitrator | 09b642ee1368278b7b4fc180bed50ff538a0938a | [
"MIT"
] | 4 | 2021-02-12T23:21:17.000Z | 2021-11-15T16:55:38.000Z | import adafruit_max31865
import busio
import digitalio
from titration.utils import constants
class Temperature_Probe:
def __init__(self, sck, mosi, miso, cs, wires=2):
self.spi = busio.SPI(sck, MOSI=mosi, MISO=miso)
self.cs = digitalio.DigitalInOut(cs)
self.sensor = adafruit_max31865.MAX3... | 26.92 | 65 | 0.67162 |
21369cddeae1f7cdac0a1e2e4d107a5fff0b26c5 | 1,509 | py | Python | python/marvin/tests/utils/datamodel/test_query.py | margudo/marvin | 6f5a11b5b7ef80dbdb43a4538e27ccda126bab6e | [
"BSD-3-Clause"
] | null | null | null | python/marvin/tests/utils/datamodel/test_query.py | margudo/marvin | 6f5a11b5b7ef80dbdb43a4538e27ccda126bab6e | [
"BSD-3-Clause"
] | null | null | null | python/marvin/tests/utils/datamodel/test_query.py | margudo/marvin | 6f5a11b5b7ef80dbdb43a4538e27ccda126bab6e | [
"BSD-3-Clause"
] | null | null | null | # !usr/bin/env python
# -*- coding: utf-8 -*-
#
# Licensed under a 3-clause BSD license.
#
# @Author: Brian Cherinka
# @Date: 2018-11-15 10:27:30
# @Last modified by: Brian Cherinka
# @Last Modified time: 2018-11-16 10:12:52
from __future__ import print_function, division, absolute_import
import pytest
from marvi... | 27.944444 | 79 | 0.638834 |
b02f29b283d8147b85277bedffef512bbf79a389 | 351 | py | Python | example_project/misc/debug2/handlers.py | ghuntley/simpleapi | e64e05e9b2276098d3442db174a4d0204be56b39 | [
"MIT"
] | 1 | 2019-06-27T11:41:03.000Z | 2019-06-27T11:41:03.000Z | example_project/misc/debug2/handlers.py | ghuntley/simpleapi | e64e05e9b2276098d3442db174a4d0204be56b39 | [
"MIT"
] | null | null | null | example_project/misc/debug2/handlers.py | ghuntley/simpleapi | e64e05e9b2276098d3442db174a4d0204be56b39 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import urllib
from simpleapi import Namespace
class MyAPI(Namespace):
def add_one(self, a, b):
a = a + 1
return a + b
add_one.published = True
add_one.constraints = lambda ns, key, val: int(val)
def download(self, url):
return urllib.urlopen(url).read(... | 21.9375 | 55 | 0.623932 |
02956112e3985a5786862c9a38d1168dc2350f02 | 16,242 | py | Python | gui/plugins/cron_view_test.py | nahidupa/grr | 100a9d85ef2abb234e12e3ac2623caffb4116be7 | [
"Apache-2.0"
] | 1 | 2015-06-24T09:07:20.000Z | 2015-06-24T09:07:20.000Z | gui/plugins/cron_view_test.py | nahidupa/grr | 100a9d85ef2abb234e12e3ac2623caffb4116be7 | [
"Apache-2.0"
] | 3 | 2020-02-11T22:29:15.000Z | 2021-06-10T17:44:31.000Z | gui/plugins/cron_view_test.py | nahidupa/grr | 100a9d85ef2abb234e12e3ac2623caffb4116be7 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- mode: python; encoding: utf-8 -*-
"""Test the cron_view interface."""
import mock
from grr.gui import runtests_test
from grr.lib import aff4
from grr.lib import config_lib
from grr.lib import flags
from grr.lib import rdfvalue
from grr.lib import test_lib
from grr.lib.aff4_objects import... | 37.167048 | 80 | 0.685876 |
0116d23a82721e9ae1e2b28171234a3f433da950 | 242 | py | Python | run-python-script/test.py | louperelo/cwl-examples | 296587a0a4392d0a193f7d1a3684e55d0bc3bde1 | [
"MIT"
] | 3 | 2021-09-07T13:23:33.000Z | 2021-09-16T09:14:30.000Z | run-python-script/test.py | louperelo/cwl-examples | 296587a0a4392d0a193f7d1a3684e55d0bc3bde1 | [
"MIT"
] | 6 | 2021-09-07T08:07:41.000Z | 2021-09-28T12:55:58.000Z | run-python-script/test.py | louperelo/cwl-examples | 296587a0a4392d0a193f7d1a3684e55d0bc3bde1 | [
"MIT"
] | 3 | 2021-09-13T15:21:01.000Z | 2021-09-27T08:48:57.000Z | import argparse
print("I am a Python Script running in docker")
parser = argparse.ArgumentParser()
parser.add_argument('firstArg')
parser.add_argument('secondArg')
args = parser.parse_args()
print("you passed me some args:")
print(args) | 17.285714 | 47 | 0.760331 |
ac91bf07f053e468dcdfc87083655106ba07cc7d | 3,203 | py | Python | karbor-1.3.0/karbor/services/protection/flows/verify.py | scottwedge/OpenStack-Stein | 7077d1f602031dace92916f14e36b124f474de15 | [
"Apache-2.0"
] | null | null | null | karbor-1.3.0/karbor/services/protection/flows/verify.py | scottwedge/OpenStack-Stein | 7077d1f602031dace92916f14e36b124f474de15 | [
"Apache-2.0"
] | 5 | 2019-08-14T06:46:03.000Z | 2021-12-13T20:01:25.000Z | karbor-1.3.0/karbor/services/protection/flows/verify.py | scottwedge/OpenStack-Stein | 7077d1f602031dace92916f14e36b124f474de15 | [
"Apache-2.0"
] | 2 | 2020-03-15T01:24:15.000Z | 2020-07-22T20:34:26.000Z | # 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
# distributed under the Li... | 34.44086 | 75 | 0.695598 |
b903b9f9f9fb22386049aa700049192f475b90d4 | 309 | py | Python | 3. Python Advanced (September 2021)/3.1 Python Advanced (September 2021)/01. Lists as Stacks and Queues/02_matching_parentheses.py | kzborisov/SoftUni | ccb2b8850adc79bfb2652a45124c3ff11183412e | [
"MIT"
] | 1 | 2021-02-07T07:51:12.000Z | 2021-02-07T07:51:12.000Z | 3. Python Advanced (September 2021)/3.1 Python Advanced (September 2021)/01. Lists as Stacks and Queues/02_matching_parentheses.py | kzborisov/softuni | 9c5b45c74fa7d9748e9b3ea65a5ae4e15c142751 | [
"MIT"
] | null | null | null | 3. Python Advanced (September 2021)/3.1 Python Advanced (September 2021)/01. Lists as Stacks and Queues/02_matching_parentheses.py | kzborisov/softuni | 9c5b45c74fa7d9748e9b3ea65a5ae4e15c142751 | [
"MIT"
] | null | null | null | expr = input()
parenthesis_index = []
for idx, ch in enumerate(expr):
if ch not in ["(", ")"]:
continue
if ch == "(":
parenthesis_index.append(idx)
elif ch == ")":
start_index = parenthesis_index.pop()
end_index = idx
print(expr[start_index:end_index+1])
| 22.071429 | 45 | 0.566343 |
1326d6c6cf9868dc8315fe01e0e6d1ce6eb2aa1b | 6,134 | py | Python | ironstubs/process_stubs.py | YKato521/ironpython-stubs | b1f7c580de48528490b3ee5791b04898be95a9ae | [
"MIT"
] | null | null | null | ironstubs/process_stubs.py | YKato521/ironpython-stubs | b1f7c580de48528490b3ee5791b04898be95a9ae | [
"MIT"
] | null | null | null | ironstubs/process_stubs.py | YKato521/ironpython-stubs | b1f7c580de48528490b3ee5791b04898be95a9ae | [
"MIT"
] | null | null | null | """ Stub Generator for IronPython
Extended script based on script developed by Gary Edwards at:
gitlab.com/reje/revit-python-stubs
This is uses a slightly modify version of generator3,
github.com/JetBrains/intellij-community/blob/master/python/helpers/generator3.py
Iterates through a list of targeted assembl... | 34.655367 | 86 | 0.588523 |
81e604b52fe44d62364b7dc23c56b2b0dbd76f4e | 3,735 | py | Python | tests/summarizer/test_rouge.py | doruktiktiklar/sadedegel | 3362c4b6bf07c34634313b9eafe52e6817efec60 | [
"MIT"
] | null | null | null | tests/summarizer/test_rouge.py | doruktiktiklar/sadedegel | 3362c4b6bf07c34634313b9eafe52e6817efec60 | [
"MIT"
] | null | null | null | tests/summarizer/test_rouge.py | doruktiktiklar/sadedegel | 3362c4b6bf07c34634313b9eafe52e6817efec60 | [
"MIT"
] | null | null | null | from pytest import approx, raises
import numpy as np
import pytest
from .context import Rouge1Summarizer, Doc, tokenizer_context, SimpleTokenizer, BertTokenizer
@pytest.mark.parametrize("tokenizer, score_true",
[(SimpleTokenizer.__name__, np.array([2 / 4, 1 / 4, 2 / 4])),
... | 46.111111 | 101 | 0.64739 |
2a0e649d08b84aa0122a3ecff832545a7787c4de | 1,649 | py | Python | neo/Core/Header.py | neo-goo/neo-python | 82082b624a417a6631ef9effe40556e876f4ea9e | [
"MIT"
] | 12 | 2017-12-20T14:13:10.000Z | 2020-07-16T12:59:55.000Z | neo/Core/Header.py | kjhdigit/neo-project | 82082b624a417a6631ef9effe40556e876f4ea9e | [
"MIT"
] | 1 | 2022-03-17T00:01:50.000Z | 2022-03-17T00:01:50.000Z | neo/Core/Header.py | kjhdigit/neo-project | 82082b624a417a6631ef9effe40556e876f4ea9e | [
"MIT"
] | 2 | 2017-11-29T13:21:41.000Z | 2018-10-23T03:31:49.000Z | # -*- coding: UTF-8 -*-
from neo.Core.BlockBase import BlockBase
from neo.IO.MemoryStream import MemoryStream, StreamManager
from neo.IO.BinaryReader import BinaryReader
from neo.Core.Witness import Witness
class Header(BlockBase):
def __init__(self, prevhash=None, merlke_root=None, timestamp=None,
... | 24.984848 | 83 | 0.637356 |
874e2931490f15a787d6c8a0e847a80fa3206cbf | 1,389 | py | Python | coaching_sessions/sorted_matrix/search_sorted_matrix.py | Mrsteveson/Review | 0dc401e9ba45efcc4cccfddfd425f72ced96e562 | [
"MIT"
] | null | null | null | coaching_sessions/sorted_matrix/search_sorted_matrix.py | Mrsteveson/Review | 0dc401e9ba45efcc4cccfddfd425f72ced96e562 | [
"MIT"
] | null | null | null | coaching_sessions/sorted_matrix/search_sorted_matrix.py | Mrsteveson/Review | 0dc401e9ba45efcc4cccfddfd425f72ced96e562 | [
"MIT"
] | null | null | null | def search_in_sorted_matrix(matrix, target):
# O(r * c) runtime, O(1) space
# for row in matrix
# for col in row
# if matrix[row][col] == target
# return (row, col)
# return (-1, -1)
# O(r log c) ~ O(n log n) runtime, O(1) space
# binary search on all the elements in a row, starting with ... | 34.725 | 71 | 0.645068 |
e8bb0c421723c610581174322d7768fe77d615de | 2,216 | py | Python | imooc/imooc/middlewares.py | BitTigerInst/CourseWebCrawler | 1037b223ba779e81ddda2423f6082e3c67765651 | [
"MIT"
] | 6 | 2016-11-23T05:43:35.000Z | 2019-05-03T09:54:17.000Z | imooc/imooc/middlewares.py | BitTigerInst/CourseWebCrawler | 1037b223ba779e81ddda2423f6082e3c67765651 | [
"MIT"
] | null | null | null | imooc/imooc/middlewares.py | BitTigerInst/CourseWebCrawler | 1037b223ba779e81ddda2423f6082e3c67765651 | [
"MIT"
] | 7 | 2016-07-23T03:21:28.000Z | 2019-07-17T08:41:40.000Z | __author__ = 'huafei'
import random
from scrapy import log
from scrapy.downloadermiddlewares.useragent import UserAgentMiddleware
class RandomUserAgentMiddleware(UserAgentMiddleware):
def __init__(self, settings, user_agent='Scrapy'):
super(RandomUserAgentMiddleware, self).__init__()
self.user_ag... | 59.891892 | 132 | 0.680957 |
8f0d6a8873c09a7e59de790a2f937841f59ba09a | 224 | py | Python | EuclideanAlgorithm.py | Krylovsentry/Algorithms | 0cd236f04dc065d5247a6f274bb3db503db591b0 | [
"MIT"
] | 1 | 2016-08-21T13:01:42.000Z | 2016-08-21T13:01:42.000Z | EuclideanAlgorithm.py | Krylovsentry/Algorithms | 0cd236f04dc065d5247a6f274bb3db503db591b0 | [
"MIT"
] | null | null | null | EuclideanAlgorithm.py | Krylovsentry/Algorithms | 0cd236f04dc065d5247a6f274bb3db503db591b0 | [
"MIT"
] | null | null | null | # Efficient method for computing the greatest common divisor (GCD) of two numbers
def gcd(a, b):
while a % b != 0:
den = a % b
a = b
b = den
return b
print(gcd(125, 55))
print(gcd(46, 78))
| 17.230769 | 81 | 0.558036 |
f2f4bb971e82ad12a441af120cc131398d0a5521 | 2,747 | py | Python | dora/sirene/migrations/0001_initial.py | francoisromain/dora-back | 868491097d12b9a23135db3d91bc6495431e8237 | [
"MIT"
] | 1 | 2022-01-03T22:12:45.000Z | 2022-01-03T22:12:45.000Z | dora/sirene/migrations/0001_initial.py | francoisromain/dora-back | 868491097d12b9a23135db3d91bc6495431e8237 | [
"MIT"
] | 2 | 2022-03-17T18:04:11.000Z | 2022-03-18T14:55:27.000Z | dora/sirene/migrations/0001_initial.py | francoisromain/dora-back | 868491097d12b9a23135db3d91bc6495431e8237 | [
"MIT"
] | 1 | 2022-01-03T09:02:54.000Z | 2022-01-03T09:02:54.000Z | import django.contrib.postgres.indexes
from django.contrib.postgres.operations import TrigramExtension
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = []
operations = [
TrigramExtension(),
migrations.CreateModel(
... | 42.261538 | 87 | 0.531489 |
4e64f3e6f79e714fb9d7735915124b391301fe08 | 5,777 | py | Python | ehr_ml/clmbr/dataset.py | som-shahlab/ehr_ml | 4f83ac5b882916a175f0d242b38d914d00bf8a7c | [
"MIT"
] | 4 | 2021-03-12T21:41:37.000Z | 2021-06-25T16:49:52.000Z | ehr_ml/clmbr/dataset.py | som-shahlab/ehr_ml | 4f83ac5b882916a175f0d242b38d914d00bf8a7c | [
"MIT"
] | 22 | 2020-11-19T00:04:27.000Z | 2022-03-02T18:16:08.000Z | ehr_ml/clmbr/dataset.py | som-shahlab/ehr_ml | 4f83ac5b882916a175f0d242b38d914d00bf8a7c | [
"MIT"
] | 2 | 2021-05-12T13:11:46.000Z | 2021-10-15T18:30:14.000Z | from __future__ import annotations
import os
import math
import queue
import torch
import bisect
import datetime
import threading
import numpy as np
from .. import timeline
from . import PatientTimelineDataset
from .rnn_model import PatientRNN
from .sequential_task import SequentialTask
from .labeler_task import Lab... | 30.246073 | 81 | 0.645318 |
9b6ee386a94936ee7146e59671374ac4fdb1a960 | 41 | py | Python | Problems/Good names/task.py | gabrielizalo/jetbrains-academy-zookeeper | 467b43da3cb81f82987daf6b063eb2078d476d4f | [
"MIT"
] | null | null | null | Problems/Good names/task.py | gabrielizalo/jetbrains-academy-zookeeper | 467b43da3cb81f82987daf6b063eb2078d476d4f | [
"MIT"
] | null | null | null | Problems/Good names/task.py | gabrielizalo/jetbrains-academy-zookeeper | 467b43da3cb81f82987daf6b063eb2078d476d4f | [
"MIT"
] | null | null | null | model_score = 0.9875
client_name = "Bob"
| 13.666667 | 20 | 0.731707 |
94cf35ff5c2796677c4e0bab26d24a391a37a766 | 1,083 | py | Python | setup.py | taisei-project/python-zipfile-zstd | e596dd89bb35accd97727ae8bc9237aac269d8d1 | [
"MIT"
] | 1 | 2021-09-26T08:36:21.000Z | 2021-09-26T08:36:21.000Z | setup.py | taisei-project/python-zipfile-zstd | e596dd89bb35accd97727ae8bc9237aac269d8d1 | [
"MIT"
] | 3 | 2021-08-19T01:27:00.000Z | 2021-12-08T07:31:58.000Z | setup.py | taisei-project/python-zipfile-zstd | e596dd89bb35accd97727ae8bc9237aac269d8d1 | [
"MIT"
] | 1 | 2021-08-14T08:27:53.000Z | 2021-08-14T08:27:53.000Z |
import setuptools
with open('README.md', 'r', encoding='utf-8') as fh:
long_description = fh.read()
setuptools.setup(
name='zipfile-zstd',
version="0.0.3",
author='Andrei Alexeyev',
author_email='akari@taisei-project.org',
description='Monkey patch the standard zipfile module to enable Zstand... | 30.942857 | 87 | 0.650046 |
d5c2a59c3190a7551a287c94da3d043a01d4ca55 | 4,517 | py | Python | models/SelectionGAN/gaugan_pix2pixhd_guided/models/networks/normalization.py | xianjian-xie/pose-generation | ad0495e80c6fe1e7690fa8691f1eb11b4e9bca32 | [
"MIT"
] | 445 | 2019-04-14T17:48:11.000Z | 2022-03-20T11:53:30.000Z | models/SelectionGAN/gaugan_pix2pixhd_guided/models/networks/normalization.py | xianjian-xie/pose-generation | ad0495e80c6fe1e7690fa8691f1eb11b4e9bca32 | [
"MIT"
] | 17 | 2019-06-03T11:34:22.000Z | 2022-02-28T01:26:13.000Z | models/SelectionGAN/gaugan_pix2pixhd_guided/models/networks/normalization.py | xianjian-xie/pose-generation | ad0495e80c6fe1e7690fa8691f1eb11b4e9bca32 | [
"MIT"
] | 71 | 2019-04-16T01:55:39.000Z | 2022-03-22T05:09:59.000Z | """
Copyright (C) 2019 NVIDIA Corporation. All rights reserved.
Licensed under the CC BY-NC-SA 4.0 license (https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode).
"""
import re
import torch
import torch.nn as nn
import torch.nn.functional as F
from models.networks.sync_batchnorm import SynchronizedBatchNorm2d
... | 39.973451 | 105 | 0.673234 |
26374b63366148c7c1f283d9efe641ceb534d28d | 1,578 | py | Python | votesim/votemethods/tests/test_majority_judgment.py | johnh865/election_sim | b73b7e65f1bb22abb82cbe8442fcf02b0c20894e | [
"MIT"
] | 8 | 2019-10-21T23:24:51.000Z | 2021-09-14T03:04:59.000Z | votesim/votemethods/tests/test_majority_judgment.py | johnh865/election_sim | b73b7e65f1bb22abb82cbe8442fcf02b0c20894e | [
"MIT"
] | 2 | 2021-02-09T23:52:47.000Z | 2021-02-10T04:08:35.000Z | votesim/votemethods/tests/test_majority_judgment.py | johnh865/election_sim | b73b7e65f1bb22abb82cbe8442fcf02b0c20894e | [
"MIT"
] | 1 | 2019-10-21T23:32:18.000Z | 2019-10-21T23:32:18.000Z | # -*- coding: utf-8 -*-
import numpy as np
import votesim
# votesim.logSettings.start_debug()
from votesim.votemethods.score import majority_judgment
from votesim.models import spatial
def test_run():
for seed in range(50):
v = spatial.Voters(seed=seed)
v.add_random(20)
c = spatial.Candida... | 25.047619 | 61 | 0.613435 |
f36beaa02a48cb6c68edf44e27f6c48b6f313d78 | 30,459 | py | Python | ravens/agents/transporter.py | YunchuZhang/Learning-to-use-different-tools-for-objects-rearrangement | 3759664cd77b5810834937c478a9a44ad36ac90c | [
"Apache-2.0"
] | 1 | 2022-03-20T19:03:02.000Z | 2022-03-20T19:03:02.000Z | ravens/agents/transporter.py | YunchuZhang/Learning-to-use-different-tools-for-objects-rearrangement | 3759664cd77b5810834937c478a9a44ad36ac90c | [
"Apache-2.0"
] | null | null | null | ravens/agents/transporter.py | YunchuZhang/Learning-to-use-different-tools-for-objects-rearrangement | 3759664cd77b5810834937c478a9a44ad36ac90c | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2021 The Ravens Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 35.792009 | 130 | 0.690568 |
910f8c52ad25f046fbcb50a7f52b66183610a798 | 1,434 | py | Python | tests/terraform/checks/resource/gcp/test_GoogleSubnetworkPrivateGoogleEnabled.py | pmalkki/checkov | b6cdf386dd976fe27c16fed6d550756a678a5d7b | [
"Apache-2.0"
] | 1 | 2022-02-20T21:20:39.000Z | 2022-02-20T21:20:39.000Z | tests/terraform/checks/resource/gcp/test_GoogleSubnetworkPrivateGoogleEnabled.py | pmalkki/checkov | b6cdf386dd976fe27c16fed6d550756a678a5d7b | [
"Apache-2.0"
] | 3 | 2022-03-07T20:37:31.000Z | 2022-03-21T20:20:14.000Z | tests/terraform/checks/resource/gcp/test_GoogleSubnetworkPrivateGoogleEnabled.py | pmalkki/checkov | b6cdf386dd976fe27c16fed6d550756a678a5d7b | [
"Apache-2.0"
] | null | null | null | import unittest
from pathlib import Path
from checkov.runner_filter import RunnerFilter
from checkov.terraform.checks.resource.gcp.GoogleSubnetworkPrivateGoogleEnabled import check
from checkov.terraform.runner import Runner
class TestGoogleSubnetworkPrivateGoogleEnabled(unittest.TestCase):
def test(self):
... | 32.590909 | 109 | 0.702232 |
a0592ef239ba2822dfec2cfb1cd8f5bf9a6218d4 | 1,340 | py | Python | savu/plugins/ptychography/dummy_ptycho.py | nghia-vo/Savu | 1cf7343c141224643b2e1fb2f05e74448bc4fd58 | [
"Apache-2.0"
] | null | null | null | savu/plugins/ptychography/dummy_ptycho.py | nghia-vo/Savu | 1cf7343c141224643b2e1fb2f05e74448bc4fd58 | [
"Apache-2.0"
] | null | null | null | savu/plugins/ptychography/dummy_ptycho.py | nghia-vo/Savu | 1cf7343c141224643b2e1fb2f05e74448bc4fd58 | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 Diamond Light Source Ltd.
#
# 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 t... | 32.682927 | 91 | 0.730597 |
9ef78092b6aa347df80690b88a1894d400542a97 | 1,416 | py | Python | app/tests/test_pitch.py | shizukane/pitch | 0793278ef43e55a10623e006eae8b12249dd6039 | [
"MIT"
] | null | null | null | app/tests/test_pitch.py | shizukane/pitch | 0793278ef43e55a10623e006eae8b12249dd6039 | [
"MIT"
] | null | null | null | app/tests/test_pitch.py | shizukane/pitch | 0793278ef43e55a10623e006eae8b12249dd6039 | [
"MIT"
] | null | null | null | import unittest
from app.models import Pitch,User,Comment
class TestPitch(unittest.TestCase):
"""
This is the class which we will use to do tests for the Pitch
"""
def setUp(self):
"""
This will create an instance of the User and Pitch before each test case
"""
self.new... | 28.32 | 82 | 0.600989 |
0f937f017c28fb0af262468d8a22e7a20615b0d5 | 5,506 | py | Python | sysidentpy/basis_function/_basis_function.py | neylsoncrepalde/sysidentpy | 3d241ff3c460a8e01f9bd8afbaf17f27ec3937f3 | [
"BSD-3-Clause"
] | 107 | 2020-05-19T12:59:56.000Z | 2022-03-29T05:25:27.000Z | sysidentpy/basis_function/_basis_function.py | nataliakeles/sysidentpy | d1af4243e7c3d2c0b456fb9b4fe120965a7ededc | [
"BSD-3-Clause"
] | 20 | 2020-05-24T15:56:15.000Z | 2022-03-05T19:54:02.000Z | sysidentpy/basis_function/_basis_function.py | nataliakeles/sysidentpy | d1af4243e7c3d2c0b456fb9b4fe120965a7ededc | [
"BSD-3-Clause"
] | 25 | 2020-05-19T14:02:17.000Z | 2022-03-15T20:17:58.000Z | import numpy as np
from itertools import combinations_with_replacement
from sysidentpy.narmax_base import InformationMatrix
class Polynomial(InformationMatrix):
"""Build polynomial basis function.
Generate a new feature matrix consisting of all polynomial combinations
of the features with degree less than... | 34.4125 | 143 | 0.608609 |
b6cf8f7e8745be6498338524a8d6cf8fbd89d2af | 165 | py | Python | enhterm/__version__.py | pyl1b/enhterm | b4eacc25ef1bdfecab9a662b5269d016070d4e6b | [
"MIT"
] | null | null | null | enhterm/__version__.py | pyl1b/enhterm | b4eacc25ef1bdfecab9a662b5269d016070d4e6b | [
"MIT"
] | null | null | null | enhterm/__version__.py | pyl1b/enhterm | b4eacc25ef1bdfecab9a662b5269d016070d4e6b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
The version of this package. It is read by setup.py.
"""
major = 0
minor = 2
patch = 1
__version__ = '%d.%d.%d' % (major, minor, patch)
| 16.5 | 52 | 0.587879 |
450d223dd3c34d4e432e2d59bae4997d739c0eeb | 2,092 | py | Python | python_scripts/tests/cli_wallet/tests/utils/cmd_args.py | Blurt-Blockchain/steem | fbffd373cdb0f6192aa8806d07e8671e219c3767 | [
"MIT"
] | 2 | 2020-04-21T03:10:06.000Z | 2020-04-21T05:49:46.000Z | python_scripts/tests/cli_wallet/tests/utils/cmd_args.py | Blurt-Blockchain/steem | fbffd373cdb0f6192aa8806d07e8671e219c3767 | [
"MIT"
] | 4 | 2020-04-22T05:14:18.000Z | 2020-04-22T07:59:20.000Z | python_scripts/tests/cli_wallet/tests/utils/cmd_args.py | Blurt-Blockchain/steem | fbffd373cdb0f6192aa8806d07e8671e219c3767 | [
"MIT"
] | 2 | 2020-04-22T05:04:29.000Z | 2020-10-23T13:58:19.000Z | import argparse
args = None
parser = argparse.ArgumentParser(description='Blurtd cli wallet test args.')
parser.add_argument('--path-to-cli' , dest='path' , help ='Path to cli_wallet executable')
parser.add_argument('--creator' , dest='creator' , help ='Account to create pro... | 99.619048 | 240 | 0.620459 |
cdbb838ef2f6a840d5d0c40c3cb01114c1174133 | 1,214 | py | Python | Introduccion_Python/02_contenedores_datos/contenedores.py | iarielduarte/Python | 871cdaf287a583baad7c88e274e09821396d0bbb | [
"CNRI-Python"
] | null | null | null | Introduccion_Python/02_contenedores_datos/contenedores.py | iarielduarte/Python | 871cdaf287a583baad7c88e274e09821396d0bbb | [
"CNRI-Python"
] | null | null | null | Introduccion_Python/02_contenedores_datos/contenedores.py | iarielduarte/Python | 871cdaf287a583baad7c88e274e09821396d0bbb | [
"CNRI-Python"
] | null | null | null | '''
Created on 21/05/2012
@author: Willis Polanco
'''
def main():
print("Contenedores en Python.")
tupla = (1,2,3,4,5)
tupla2 = 6,
tupla3 = tuple(range(20))
print(tupla)
print(tupla3)
print(len(tupla3))
print(min(tupla))
print(max(tupla))
lista = [3,4,5,6,7,8]
listax = ... | 19.901639 | 40 | 0.547776 |
47b83edcf68a2942cd9cc1b752876bf79103b6ee | 2,924 | py | Python | src/sqlfluff/rules/L042.py | fbb-oc/sqlfluff | f50e72b748dcf700483d0e937aa2abcfb0a56e9e | [
"MIT"
] | 1 | 2022-03-03T02:29:11.000Z | 2022-03-03T02:29:11.000Z | src/sqlfluff/rules/L042.py | clairetaylor352/sqlfluff | 62900332228db323da323ce20df0c5e17ba9fcbf | [
"MIT"
] | null | null | null | src/sqlfluff/rules/L042.py | clairetaylor352/sqlfluff | 62900332228db323da323ce20df0c5e17ba9fcbf | [
"MIT"
] | null | null | null | """Implementation of Rule L042."""
from typing import Optional
from sqlfluff.core.rules.base import BaseRule, LintResult, RuleContext
from sqlfluff.core.rules.doc_decorators import document_configuration
from sqlfluff.core.rules.functional.segment_predicates import is_type
@document_configuration
class Rule_L042(Bas... | 31.782609 | 84 | 0.568057 |
9f1c8d0a324d134dca5d0716e1daa3d9f79c7927 | 4,014 | py | Python | corehq/apps/users/cases.py | johan--/commcare-hq | 86ee99c54f55ee94e4c8f2f6f30fc44e10e69ebd | [
"BSD-3-Clause"
] | null | null | null | corehq/apps/users/cases.py | johan--/commcare-hq | 86ee99c54f55ee94e4c8f2f6f30fc44e10e69ebd | [
"BSD-3-Clause"
] | 1 | 2022-03-12T01:03:25.000Z | 2022-03-12T01:03:25.000Z | corehq/apps/users/cases.py | johan--/commcare-hq | 86ee99c54f55ee94e4c8f2f6f30fc44e10e69ebd | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import
from couchdbkit import ResourceNotFound
from corehq.apps.groups.models import Group
from corehq.apps.users.models import CouchUser, CommCareUser, WebUser
from corehq.apps.hqcase.utils import assign_cases
def user_db():
return CouchUser.get_db()
def get_owner_id(case):
... | 33.45 | 90 | 0.642501 |
42b2446eb827b2a04f5eb156b1b113aac5c31e2b | 642 | py | Python | test/test_agent.py | Factern/factern-client-python | 2453dbf0d683417142fe98514ef6de2742f14f92 | [
"MIT"
] | null | null | null | test/test_agent.py | Factern/factern-client-python | 2453dbf0d683417142fe98514ef6de2742f14f92 | [
"MIT"
] | null | null | null | test/test_agent.py | Factern/factern-client-python | 2453dbf0d683417142fe98514ef6de2742f14f92 | [
"MIT"
] | 2 | 2018-07-20T15:02:06.000Z | 2018-08-01T20:38:38.000Z | # coding: utf-8
"""
Factern API
"""
from __future__ import absolute_import
import unittest
import factern_client
from factern_client.com.factern.model.agent import Agent # noqa: E501
from factern_client.rest import ApiException
class TestAgent(unittest.TestCase):
"""Agent unit test stubs"""
def set... | 18.342857 | 79 | 0.67134 |
c9adbe854094defd81b3d78f43a17ff0a178f794 | 4,083 | py | Python | nssrc/com/citrix/netscaler/nitro/resource/config/ns/nsmigration.py | guardicore/nitro-python | 5346a5086134aead80968f15a41ff527adaa0ec1 | [
"Apache-2.0"
] | null | null | null | nssrc/com/citrix/netscaler/nitro/resource/config/ns/nsmigration.py | guardicore/nitro-python | 5346a5086134aead80968f15a41ff527adaa0ec1 | [
"Apache-2.0"
] | null | null | null | nssrc/com/citrix/netscaler/nitro/resource/config/ns/nsmigration.py | guardicore/nitro-python | 5346a5086134aead80968f15a41ff527adaa0ec1 | [
"Apache-2.0"
] | null | null | null | #
# Copyright (c) 2021 Citrix Systems, 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 or... | 32.149606 | 234 | 0.739652 |
9636c6b4d28fad5ecd7cc2bbb6619ba959fd7406 | 33,072 | py | Python | Lib/asyncio/proactor_events.py | finefoot/cpython | ffcc7cd57f6a52c6074ecc9f0a9f0177fb1dbfee | [
"0BSD"
] | 2 | 2022-03-27T14:52:48.000Z | 2022-03-27T17:35:22.000Z | Lib/asyncio/proactor_events.py | finefoot/cpython | ffcc7cd57f6a52c6074ecc9f0a9f0177fb1dbfee | [
"0BSD"
] | 8 | 2022-01-07T11:31:11.000Z | 2022-03-04T00:07:16.000Z | Lib/asyncio/proactor_events.py | finefoot/cpython | ffcc7cd57f6a52c6074ecc9f0a9f0177fb1dbfee | [
"0BSD"
] | 1 | 2022-03-27T18:34:54.000Z | 2022-03-27T18:34:54.000Z | """Event loop using a proactor and related classes.
A proactor is a "notify-on-completion" multiplexer. Currently a
proactor is only implemented on Windows with IOCP.
"""
__all__ = 'BaseProactorEventLoop',
import io
import os
import socket
import warnings
import signal
import threading
import collections
from . im... | 37.117845 | 87 | 0.571239 |
0dc26147a4328d76df7205f4b52d80916c48fab5 | 514 | py | Python | backend/src/webdoctor/urls.py | CSCapstone2019/WebDoctor | cda9e4e2bd2c4e22dc4a4aa9c0758e67cdee62d5 | [
"MIT"
] | 4 | 2019-09-13T14:50:22.000Z | 2019-11-27T03:19:44.000Z | backend/src/webdoctor/urls.py | CSCapstone2019/WebDoctor | cda9e4e2bd2c4e22dc4a4aa9c0758e67cdee62d5 | [
"MIT"
] | 8 | 2019-09-15T23:02:21.000Z | 2022-02-10T09:26:10.000Z | backend/src/webdoctor/urls.py | CSCapstone2019/WebDoctor | cda9e4e2bd2c4e22dc4a4aa9c0758e67cdee62d5 | [
"MIT"
] | null | null | null | from django.contrib import admin
from django.urls import path, include
from django.conf.urls.static import static
from django.conf import settings
urlpatterns = [
path('api-auth/', include('rest_framework.urls')),
path('admin/', admin.site.urls),
path('api/', include('patients.api.urls')),
path('chat/... | 28.555556 | 80 | 0.712062 |
94d0ece7e10fcfc5cf178858e1c9faab18add179 | 7,000 | py | Python | pyprob/trace.py | SwapneelM/pyprob | 4d93441ea838c3491a49050ae05d218a34708e6d | [
"BSD-2-Clause"
] | 268 | 2017-10-16T13:09:12.000Z | 2021-12-01T19:03:12.000Z | pyprob/trace.py | SwapneelM/pyprob | 4d93441ea838c3491a49050ae05d218a34708e6d | [
"BSD-2-Clause"
] | 11 | 2017-12-05T21:50:30.000Z | 2019-02-25T19:52:39.000Z | pyprob/trace.py | SwapneelM/pyprob | 4d93441ea838c3491a49050ae05d218a34708e6d | [
"BSD-2-Clause"
] | 33 | 2017-10-21T16:32:00.000Z | 2021-11-24T13:42:53.000Z | import torch
from . import util
class Variable():
def __init__(self, distribution=None, value=None, address_base=None, address=None, instance=None, log_prob=None, log_importance_weight=None, control=False, replace=False, name=None, observed=False, reused=False, tagged=False):
self.distribution = distribu... | 47.619048 | 230 | 0.634714 |
454dbfdea10c9dd8259a91bb845438b0dad52ef4 | 744 | py | Python | cookies.py | tunir27/Attendr-Hardware-Scripts | cdc9293157d1810c2a9c8af0318b04203a8b2bf5 | [
"Apache-2.0"
] | 1 | 2018-08-15T06:27:53.000Z | 2018-08-15T06:27:53.000Z | cookies.py | tunir27/Attendr-Hardware-Scripts | cdc9293157d1810c2a9c8af0318b04203a8b2bf5 | [
"Apache-2.0"
] | null | null | null | cookies.py | tunir27/Attendr-Hardware-Scripts | cdc9293157d1810c2a9c8af0318b04203a8b2bf5 | [
"Apache-2.0"
] | null | null | null | import pickle
import requests
import os
def save_cookies(requests_cookiejar, filename):
with open(filename, 'wb') as f:
pickle.dump(requests_cookiejar, f)
def load_cookies(filename):
with open(filename, 'rb') as f:
return pickle.load(f)
#save cookies
def p():
f=os.stat("cookies.txt").st_si... | 26.571429 | 95 | 0.649194 |
7b71181ac01e1b0c8b89cbd226147310e6df9c15 | 3,432 | py | Python | kea/test_utils/base_test.py | hgomersall/Kea | bdddcfad170ae65f4ef23aea1cf495348458a738 | [
"BSD-3-Clause-Clear",
"BSD-3-Clause"
] | 1 | 2018-12-11T12:05:25.000Z | 2018-12-11T12:05:25.000Z | kea/test_utils/base_test.py | hgomersall/Kea | bdddcfad170ae65f4ef23aea1cf495348458a738 | [
"BSD-3-Clause-Clear",
"BSD-3-Clause"
] | null | null | null | kea/test_utils/base_test.py | hgomersall/Kea | bdddcfad170ae65f4ef23aea1cf495348458a738 | [
"BSD-3-Clause-Clear",
"BSD-3-Clause"
] | 1 | 2019-02-12T12:07:54.000Z | 2019-02-12T12:07:54.000Z | from veriutils.tests.base_hdl_test import HDLTestCase
from veriutils import myhdl_cosimulation
from ovenbird.cosimulation import (
vivado_vhdl_cosimulation, vivado_verilog_cosimulation)
from ovenbird import VIVADO_EXECUTABLE
import unittest
import os
VIVADO_DISABLE_REASON = ''
try:
if os.environ['USE_VIVAD... | 34.666667 | 78 | 0.664044 |
bb9b1840640aa63d8768ece6785d64989b1dbc12 | 4,902 | py | Python | neuraxle/steps/column_transformer.py | guillaume-chevalier/Neuraxle | 5645e53bbe98aac367c8fe19f41dc14b21206fbb | [
"Apache-2.0"
] | 2 | 2019-04-14T18:40:01.000Z | 2020-06-02T09:36:59.000Z | neuraxle/steps/column_transformer.py | guillaume-chevalier/Neuraxle | 5645e53bbe98aac367c8fe19f41dc14b21206fbb | [
"Apache-2.0"
] | null | null | null | neuraxle/steps/column_transformer.py | guillaume-chevalier/Neuraxle | 5645e53bbe98aac367c8fe19f41dc14b21206fbb | [
"Apache-2.0"
] | null | null | null | """
Neuraxle's Column Transformer Steps
====================================
Pipeline steps to apply N-Dimensional column transformations to different columns.
..
Copyright 2019, Neuraxio Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance w... | 36.311111 | 108 | 0.676867 |
b59108b4f3b707212130f6033c7174f5c0ebbe6d | 114 | py | Python | utils/data/__init__.py | chenwenxiao/DOI | 14bdedd0b1b886efe77737cfb62695f03ee17c58 | [
"MIT"
] | 1 | 2021-08-13T22:14:10.000Z | 2021-08-13T22:14:10.000Z | utils/data/__init__.py | chenwenxiao/DOI | 14bdedd0b1b886efe77737cfb62695f03ee17c58 | [
"MIT"
] | null | null | null | utils/data/__init__.py | chenwenxiao/DOI | 14bdedd0b1b886efe77737cfb62695f03ee17c58 | [
"MIT"
] | null | null | null | from . import mappers
from .datasets import *
from .image_utils import *
from .misc import *
from .types import *
| 19 | 26 | 0.745614 |
6f816617fdf8efdb23f75a09c6f7297e22b4e16b | 10,444 | py | Python | tensorflow_probability/python/distributions/inverse_gamma.py | cafeal/probability | f968a32d601d29ec31a10568ccfe30263cf91ef2 | [
"Apache-2.0"
] | null | null | null | tensorflow_probability/python/distributions/inverse_gamma.py | cafeal/probability | f968a32d601d29ec31a10568ccfe30263cf91ef2 | [
"Apache-2.0"
] | null | null | null | tensorflow_probability/python/distributions/inverse_gamma.py | cafeal/probability | f968a32d601d29ec31a10568ccfe30263cf91ef2 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 The TensorFlow Probability Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 34.813333 | 80 | 0.681731 |
64a5dcfe0b0dc2499c9417df271d4cfa444e9f18 | 1,558 | py | Python | setup.py | mriedem/mkdocs_macros_plugin | b8bcfafb59d23e734991ac03acd408a7d98ee272 | [
"MIT"
] | null | null | null | setup.py | mriedem/mkdocs_macros_plugin | b8bcfafb59d23e734991ac03acd408a7d98ee272 | [
"MIT"
] | null | null | null | setup.py | mriedem/mkdocs_macros_plugin | b8bcfafb59d23e734991ac03acd408a7d98ee272 | [
"MIT"
] | null | null | null | # --------------------------------------------
# Setup file for the package
#
# Laurent Franceschetti (c) 2018-2020
# --------------------------------------------
import os
from setuptools import setup, find_packages
VERSION_NUMBER = '0.4.7b'
def read_file(fname):
"Read a local file"
return open(os.path.joi... | 28.327273 | 72 | 0.598203 |
a46ead118e9ab142fd5c86ff1ee2acb1b28c8781 | 227 | py | Python | amquery/core/sample_map/__init__.py | nromashchenko/nir | 4b0c91d670462ca33a9b224740a2977e99546440 | [
"MIT"
] | 3 | 2016-09-13T16:31:05.000Z | 2016-09-14T06:36:44.000Z | amquery/core/sample_map/__init__.py | nromashchenko/nir | 4b0c91d670462ca33a9b224740a2977e99546440 | [
"MIT"
] | 36 | 2016-09-14T06:26:20.000Z | 2017-05-04T19:11:30.000Z | amquery/core/sample_map/__init__.py | nromashchenko/amquery | 4b0c91d670462ca33a9b224740a2977e99546440 | [
"MIT"
] | null | null | null | from ._sample_map import SampleMap
__license__ = "MIT"
__version__ = "0.2.1"
__author__ = "Nikolay Romashchenko"
__maintainer__ = "Nikolay Romashchenko"
__email__ = "nikolay.romashchenko@gmail.com"
__status__ = "Development"
| 22.7 | 44 | 0.779736 |
fb80aa9c1164d8028b1223941552ab9e8c23eb50 | 2,156 | py | Python | tests/ignite/contrib/metrics/regression/test_maximum_absolute_error.py | Devanshu24/ignite | 2f0ba3e65cfa36b43bc87b315733fd3f3585e430 | [
"BSD-3-Clause"
] | null | null | null | tests/ignite/contrib/metrics/regression/test_maximum_absolute_error.py | Devanshu24/ignite | 2f0ba3e65cfa36b43bc87b315733fd3f3585e430 | [
"BSD-3-Clause"
] | null | null | null | tests/ignite/contrib/metrics/regression/test_maximum_absolute_error.py | Devanshu24/ignite | 2f0ba3e65cfa36b43bc87b315733fd3f3585e430 | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
import pytest
import torch
from ignite.contrib.metrics.regression import MaximumAbsoluteError
from ignite.exceptions import NotComputableError
def test_zero_sample():
m = MaximumAbsoluteError()
with pytest.raises(
NotComputableError, match=r"MaximumAbsoluteError must have at least ... | 34.222222 | 114 | 0.68321 |
20f68ee9912c546bf47d1e98aabd4d74a5c8bbef | 2,967 | py | Python | toucan/canary_utils/lib/pptx.py | toucan-project/TOUCAN | d562e1191b5ef10480be819ba8c584034c25259b | [
"MIT"
] | 4 | 2019-08-28T14:36:23.000Z | 2019-08-30T09:49:12.000Z | toucan/canary_utils/lib/pptx.py | toucan-project/TOUCAN | d562e1191b5ef10480be819ba8c584034c25259b | [
"MIT"
] | 2 | 2021-04-20T17:09:30.000Z | 2021-09-23T23:26:22.000Z | toucan/canary_utils/lib/pptx.py | toucan-project/TOUCAN | d562e1191b5ef10480be819ba8c584034c25259b | [
"MIT"
] | 1 | 2020-01-22T20:01:58.000Z | 2020-01-22T20:01:58.000Z | #!/usr/bin/env python3
from zipfile import ZipFile
from defusedxml.minidom import parseString
from canary_api.settings import TEMPLATE_DIR
from canary_utils.lib.util import has_access
from canary_utils.lib.util import get_next_rid, find_highest_xml
from canary_utils.lib.util import open_zip, create_child, fix_metadata... | 27.220183 | 72 | 0.628918 |
d012eee3286b9188e1aea097f0452b42e81805aa | 463 | py | Python | data/scripts/templates/object/mobile/shared_dressed_raider_trandoshan_male_01.py | obi-two/GameServer | 7d37024e2291a97d49522610cd8f1dbe5666afc2 | [
"MIT"
] | 20 | 2015-02-23T15:11:56.000Z | 2022-03-18T20:56:48.000Z | data/scripts/templates/object/mobile/shared_dressed_raider_trandoshan_male_01.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | null | null | null | data/scripts/templates/object/mobile/shared_dressed_raider_trandoshan_male_01.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | 20 | 2015-04-04T16:35:59.000Z | 2022-03-24T14:54:37.000Z | #### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Creature()
result.template = "object/mobile/shared_dressed_raider_trandoshan_male_01.iff"
result.attribute_templa... | 27.235294 | 79 | 0.740821 |
a29926a57df847fd6553e0813a5e2dfeebb3885e | 78,788 | py | Python | tensorflow/python/training/saver.py | wenming2014/tensorflow | a102a6a71844e194f3946f6318768c5367f1f16b | [
"Apache-2.0"
] | 5 | 2018-07-04T22:14:02.000Z | 2018-07-04T22:21:43.000Z | tensorflow/python/training/saver.py | wenming2014/tensorflow | a102a6a71844e194f3946f6318768c5367f1f16b | [
"Apache-2.0"
] | null | null | null | tensorflow/python/training/saver.py | wenming2014/tensorflow | a102a6a71844e194f3946f6318768c5367f1f16b | [
"Apache-2.0"
] | 2 | 2019-02-26T16:21:15.000Z | 2020-12-04T17:48:17.000Z | # Copyright 2015 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... | 41.142559 | 176 | 0.68678 |
1dedc40800f0ee04f2464be09dd0c7c32f0e669f | 2,741 | py | Python | Temporal Difference/taki_v2/taxi-v2.py | tahmidbintaslim/deep-reinforcement-learning | ed817b463b9742b1d9c8d7eca5735b1f6e9b9beb | [
"MIT"
] | 7 | 2020-02-13T19:52:32.000Z | 2021-12-04T08:01:43.000Z | Temporal Difference/taki_v2/taxi-v2.py | sourcecode369/Deep-RL | ed817b463b9742b1d9c8d7eca5735b1f6e9b9beb | [
"MIT"
] | null | null | null | Temporal Difference/taki_v2/taxi-v2.py | sourcecode369/Deep-RL | ed817b463b9742b1d9c8d7eca5735b1f6e9b9beb | [
"MIT"
] | 2 | 2020-04-22T01:58:02.000Z | 2020-06-12T02:18:43.000Z | import gym
import sys
import numpy as np
import warnings
warnings.filterwarnings("ignore")
from collections import defaultdict, deque
import random
import math
env = gym.make('Taxi-v2')
def epsilon_greedy(Q,state,nA,epsilon):
if random.random()>epsilon:
return np.argmax(Q[state])
else:
return ... | 31.872093 | 115 | 0.608172 |
63f77624f8570502f2bdc62a7d639e91eb01d161 | 18,235 | py | Python | mars/worker/quota.py | sighingnow/mars | c7897fbd144d230fff5edabc1494fb3ff44aa0d2 | [
"Apache-2.0"
] | null | null | null | mars/worker/quota.py | sighingnow/mars | c7897fbd144d230fff5edabc1494fb3ff44aa0d2 | [
"Apache-2.0"
] | null | null | null | mars/worker/quota.py | sighingnow/mars | c7897fbd144d230fff5edabc1494fb3ff44aa0d2 | [
"Apache-2.0"
] | null | null | null | # Copyright 1999-2018 Alibaba Group Holding Ltd.
#
# 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 a... | 39.641304 | 110 | 0.616178 |
63479ec285324cced57d87c5b990f6739df2cc8f | 2,861 | py | Python | UKR-LP/visualizer_lp.py | tanacchi/ml_scratch | 79782ece44f8e742bbc04a83c761da0851360ee5 | [
"MIT"
] | 1 | 2020-12-02T02:31:22.000Z | 2020-12-02T02:31:22.000Z | UKR-LP/visualizer_lp.py | tanacchi/ml_scratch | 79782ece44f8e742bbc04a83c761da0851360ee5 | [
"MIT"
] | 1 | 2020-10-30T07:56:10.000Z | 2020-10-30T07:56:10.000Z | UKR-LP/visualizer_lp.py | tanacchi/ml_scratch | 79782ece44f8e742bbc04a83c761da0851360ee5 | [
"MIT"
] | null | null | null | import numpy as np
from matplotlib import pyplot as plt
from matplotlib.animation import FuncAnimation
def visualize_history(X, history, save_gif=False):
Y_history = history.Y
F_history = history.F
f_history = history.f
Zeta_history = history.Zeta
Z_history = history.Z
input_dim, latent_dim =... | 36.21519 | 91 | 0.608179 |
868dd591e47f8f66065e886dff88812afb28b04c | 1,370 | py | Python | week_1/02_find_alphabet_occurrence_array.py | swcide/algorithm | 8eb518f2ced6121f6b35a8da655bbf954d143211 | [
"Unlicense"
] | null | null | null | week_1/02_find_alphabet_occurrence_array.py | swcide/algorithm | 8eb518f2ced6121f6b35a8da655bbf954d143211 | [
"Unlicense"
] | null | null | null | week_1/02_find_alphabet_occurrence_array.py | swcide/algorithm | 8eb518f2ced6121f6b35a8da655bbf954d143211 | [
"Unlicense"
] | null | null | null | from builtins import range
input = "hello my name is sparta"
'''
str.isalpha() 함수를 이용하면 문자열이 알파벳인지 확인가능!
print("a".isalpha()) # True
print("1".isalpha()) # False
s = "abcdefg"
print(s[0].isalpha()) # True
# 내장 함수 ord() 이용해서 아스키 값 받기
print(ord('a')) # 97
print(ord('a') - ord('a')) # 97-97 ... | 25.37037 | 163 | 0.556204 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.