hexsha stringlengths 40 40 | size int64 7 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 125 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | 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 4 247 | max_issues_repo_name stringlengths 4 125 | 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 4 247 | max_forks_repo_name stringlengths 4 125 | 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 1 1.04M | avg_line_length float64 1.77 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 7 1.04M | filtered:remove_function_no_docstring int64 -102 942k | filtered:remove_class_no_docstring int64 -354 977k | filtered:remove_delete_markers int64 0 60.1k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
30737425867bb55a2af14436ac1b6d6839ca34e3 | 16,368 | py | Python | modules/exploit/use/petitpotam.py | astar-security/MaeGeri | b28b37fe1cb8c4f650b8a4c9019636c540262fda | [
"Apache-2.0"
] | null | null | null | modules/exploit/use/petitpotam.py | astar-security/MaeGeri | b28b37fe1cb8c4f650b8a4c9019636c540262fda | [
"Apache-2.0"
] | null | null | null | modules/exploit/use/petitpotam.py | astar-security/MaeGeri | b28b37fe1cb8c4f650b8a4c9019636c540262fda | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# Author: GILLES Lionel aka topotam (@topotam77)
#
# Greetz : grenadine(@Greynardine), skar(@__skar), didakt(@inf0sec1), plissken, pixis(@HackAndDo), shutd0wn(@ _nwodtuhs)
# "Most of" the code stolen from dementor.py from @3xocyte ;)
import sys
import argparse
from impacket import system_er... | 36.454343 | 243 | 0.574047 | #!/usr/bin/env python
#
# Author: GILLES Lionel aka topotam (@topotam77)
#
# Greetz : grenadine(@Greynardine), skar(@__skar), didakt(@inf0sec1), plissken, pixis(@HackAndDo), shutd0wn(@ _nwodtuhs)
# "Most of" the code stolen from dementor.py from @3xocyte ;)
import sys
import argparse
from impacket import system_er... | 7,103 | 4,628 | 1,111 |
2d3ca8371c21a92681fe90abff723c44bebc3c0d | 3,045 | py | Python | game2048/RNN_training.py | fuuuyuuu/2048-api | d96aa0bc7099e8ce7b792ec2b1051a44b4325eec | [
"Apache-2.0"
] | null | null | null | game2048/RNN_training.py | fuuuyuuu/2048-api | d96aa0bc7099e8ce7b792ec2b1051a44b4325eec | [
"Apache-2.0"
] | null | null | null | game2048/RNN_training.py | fuuuyuuu/2048-api | d96aa0bc7099e8ce7b792ec2b1051a44b4325eec | [
"Apache-2.0"
] | null | null | null | import torch
from torch import nn
import torchvision.transforms as transforms
import matplotlib.pyplot as plt
from data_loader import data_load
from torch.autograd import Variable
import numpy as np
# torch.manual_seed(1) # reproducible
# Hyper Parameters
EPOCH = 20 # train the training data n times... | 31.71875 | 110 | 0.587521 | import torch
from torch import nn
import torchvision.transforms as transforms
import matplotlib.pyplot as plt
from data_loader import data_load
from torch.autograd import Variable
import numpy as np
# torch.manual_seed(1) # reproducible
# Hyper Parameters
EPOCH = 20 # train the training data n times... | 2,344 | 0 | 122 |
ce512afce118edf2c22282a539009707e00c705b | 1,877 | py | Python | apps/iiif/serializers/annotation_list.py | ecds/readux | 4eac8b48efef8126f4f2be28b5eb943c85a89c2e | [
"Apache-2.0"
] | 18 | 2017-06-12T09:58:02.000Z | 2021-10-01T11:14:34.000Z | apps/iiif/serializers/annotation_list.py | ecds/readux | 4eac8b48efef8126f4f2be28b5eb943c85a89c2e | [
"Apache-2.0"
] | 276 | 2019-04-26T20:13:01.000Z | 2022-03-31T10:26:28.000Z | apps/iiif/serializers/annotation_list.py | ecds/readux | 4eac8b48efef8126f4f2be28b5eb943c85a89c2e | [
"Apache-2.0"
] | 7 | 2018-03-13T23:44:26.000Z | 2021-09-15T17:54:55.000Z | # pylint: disable = attribute-defined-outside-init, too-few-public-methods
"""Module for serializing IIIF Annotation Lists"""
import json
from django.core.serializers import serialize
from django.core.serializers.base import SerializerDoesNotExist
from .base import Serializer as JSONSerializer
from django.contrib.auth ... | 36.096154 | 90 | 0.583378 | # pylint: disable = attribute-defined-outside-init, too-few-public-methods
"""Module for serializing IIIF Annotation Lists"""
import json
from django.core.serializers import serialize
from django.core.serializers.base import SerializerDoesNotExist
from .base import Serializer as JSONSerializer
from django.contrib.auth ... | 1,099 | 0 | 79 |
ec30a32c1bd8adc81def1f3444251698d0bc0811 | 26 | py | Python | tranco/__init__.py | ZeroSum24/tranco-python-package | f9aeebaa0d25946323646886f1110cec197e0f54 | [
"MIT"
] | 12 | 2019-05-24T17:17:07.000Z | 2021-05-11T11:25:04.000Z | tranco/__init__.py | ZeroSum24/tranco-python-package | f9aeebaa0d25946323646886f1110cec197e0f54 | [
"MIT"
] | 6 | 2019-06-11T21:10:42.000Z | 2021-01-25T08:05:09.000Z | tranco/__init__.py | ZeroSum24/tranco-python-package | f9aeebaa0d25946323646886f1110cec197e0f54 | [
"MIT"
] | 3 | 2019-02-26T15:17:54.000Z | 2021-08-21T16:53:34.000Z | from .tranco import Tranco | 26 | 26 | 0.846154 | from .tranco import Tranco | 0 | 0 | 0 |
6ace6f1e7b2b5d4ff7aa95d88b4bbe251e459eca | 575 | py | Python | FOMMS_integrate/stochastic.py | nschieber/FOMMS_integrate | 87456d476ecee45b8a06782da12baa1ce4c08e88 | [
"BSD-3-Clause"
] | null | null | null | FOMMS_integrate/stochastic.py | nschieber/FOMMS_integrate | 87456d476ecee45b8a06782da12baa1ce4c08e88 | [
"BSD-3-Clause"
] | null | null | null | FOMMS_integrate/stochastic.py | nschieber/FOMMS_integrate | 87456d476ecee45b8a06782da12baa1ce4c08e88 | [
"BSD-3-Clause"
] | null | null | null | """
This function implements 1d Monte Carlo integration
"""
import numpy as np
def monte_1d(x, f, trials):
"""
Compute a 1D definite integral
Parameters
----------
f : function
User defined function.
x : numpy array
Integration domain.
trials : integer
Total numb... | 19.166667 | 52 | 0.553043 | """
This function implements 1d Monte Carlo integration
"""
import numpy as np
def monte_1d(x, f, trials):
"""
Compute a 1D definite integral
Parameters
----------
f : function
User defined function.
x : numpy array
Integration domain.
trials : integer
Total numb... | 0 | 0 | 0 |
138fa2e645bcd4f89b72e76fa68172d58825add1 | 3,047 | py | Python | snip/train.py | 3846chs/SNIP | de1771cf4c90edeaa9924ed406293b48ceece7a2 | [
"MIT"
] | null | null | null | snip/train.py | 3846chs/SNIP | de1771cf4c90edeaa9924ed406293b48ceece7a2 | [
"MIT"
] | null | null | null | snip/train.py | 3846chs/SNIP | de1771cf4c90edeaa9924ed406293b48ceece7a2 | [
"MIT"
] | null | null | null | import os
import tensorflow.compat.v1 as tf
import time
import numpy as np
# np.random._bit_generator = np.random.bit_generator
from augment import augment
| 45.477612 | 99 | 0.596652 | import os
import tensorflow.compat.v1 as tf
import time
import numpy as np
# np.random._bit_generator = np.random.bit_generator
from augment import augment
def train(args, model, sess, dataset):
print('|========= START TRAINING =========|')
if not os.path.isdir(args.path_summary): os.makedirs(args.path_summa... | 2,866 | 0 | 23 |
0e58e67d4649d5ef878008d9074dacf7645f53e2 | 4,768 | py | Python | m1_resnet.py | VinGPan/Kaggle-HumanProtein | 4d1abcc7f46774355644d30428ed6c73b28fd782 | [
"Apache-2.0"
] | null | null | null | m1_resnet.py | VinGPan/Kaggle-HumanProtein | 4d1abcc7f46774355644d30428ed6c73b28fd782 | [
"Apache-2.0"
] | null | null | null | m1_resnet.py | VinGPan/Kaggle-HumanProtein | 4d1abcc7f46774355644d30428ed6c73b28fd782 | [
"Apache-2.0"
] | null | null | null | from keras_retinanet.bin.train import train_main
from keras_retinanet import models
import glob
import numpy as np
from sklearn.metrics import f1_score
import os
if __name__ == '__main__':
os.chdir("../")
model_name = 'resnet101'
train_main(0, None, ["csv", "data/trn1.csv", "data/classes.csv",
... | 103.652174 | 3,138 | 0.676594 | from keras_retinanet.bin.train import train_main
from keras_retinanet import models
import glob
import numpy as np
from sklearn.metrics import f1_score
import os
if __name__ == '__main__':
os.chdir("../")
model_name = 'resnet101'
train_main(0, None, ["csv", "data/trn1.csv", "data/classes.csv",
... | 0 | 0 | 0 |
27d6a355d2304d3fc689d470c15bce5dbf127caf | 5,795 | py | Python | sdk/python/pulumi_aws_native/customerprofiles/_enums.py | AaronFriel/pulumi-aws-native | 5621690373ac44accdbd20b11bae3be1baf022d1 | [
"Apache-2.0"
] | 29 | 2021-09-30T19:32:07.000Z | 2022-03-22T21:06:08.000Z | sdk/python/pulumi_aws_native/customerprofiles/_enums.py | AaronFriel/pulumi-aws-native | 5621690373ac44accdbd20b11bae3be1baf022d1 | [
"Apache-2.0"
] | 232 | 2021-09-30T19:26:26.000Z | 2022-03-31T23:22:06.000Z | sdk/python/pulumi_aws_native/customerprofiles/_enums.py | AaronFriel/pulumi-aws-native | 5621690373ac44accdbd20b11bae3be1baf022d1 | [
"Apache-2.0"
] | 4 | 2021-11-10T19:42:01.000Z | 2022-02-05T10:15:49.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
from enum import Enum
__all__ = [
'IntegrationConnectorType',
'IntegrationMarketoConnectorOperator',
'IntegrationOperatorPropertiesKeys',
... | 30.025907 | 80 | 0.718033 | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
from enum import Enum
__all__ = [
'IntegrationConnectorType',
'IntegrationMarketoConnectorOperator',
'IntegrationOperatorPropertiesKeys',
... | 0 | 4,568 | 253 |
2d12ec7f50c3d061e4b79a9ffffcc034bd787b1d | 2,104 | py | Python | Dataset/split_data.py | atmacvit/meronymnet | 47e1a7caadc0f770439bb26a93b885f790f62804 | [
"MIT"
] | 1 | 2021-11-02T05:13:12.000Z | 2021-11-02T05:13:12.000Z | Dataset/split_data.py | atmacvit/meronymnet | 47e1a7caadc0f770439bb26a93b885f790f62804 | [
"MIT"
] | 1 | 2021-12-17T14:29:18.000Z | 2021-12-17T14:29:18.000Z | Dataset/split_data.py | atmacvit/meronymnet | 47e1a7caadc0f770439bb26a93b885f790f62804 | [
"MIT"
] | null | null | null | import numpy as np
import pickle
objects = ['cow', 'dog', 'person', 'horse', 'sheep', 'aeroplane', 'bird', 'bicycle', 'cat', 'motorbike', 'car']
for object_name in objects:
with open(object_name + '_part_separated_labels', 'rb') as f:
label = pickle.load(f)
with open(object_name + '_part_separated_... | 41.254902 | 112 | 0.661122 | import numpy as np
import pickle
objects = ['cow', 'dog', 'person', 'horse', 'sheep', 'aeroplane', 'bird', 'bicycle', 'cat', 'motorbike', 'car']
for object_name in objects:
with open(object_name + '_part_separated_labels', 'rb') as f:
label = pickle.load(f)
with open(object_name + '_part_separated_... | 0 | 0 | 0 |
ae765890a283e1cafc55cfc222fa3eddff1f2a46 | 2,302 | py | Python | neutron/extensions/providernet.py | MultipleCrashes/neutron | fb268d7e91b22192a6e42f78b0057b4ebd3033ef | [
"Apache-2.0"
] | 1 | 2019-06-02T06:15:39.000Z | 2019-06-02T06:15:39.000Z | neutron/extensions/providernet.py | MultipleCrashes/neutron | fb268d7e91b22192a6e42f78b0057b4ebd3033ef | [
"Apache-2.0"
] | null | null | null | neutron/extensions/providernet.py | MultipleCrashes/neutron | fb268d7e91b22192a6e42f78b0057b4ebd3033ef | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2012 OpenStack Foundation.
# 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... | 32.885714 | 78 | 0.728931 | # Copyright (c) 2012 OpenStack Foundation.
# 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... | 293 | 0 | 131 |
8d7f3685a45adea2ebce073ffebe24607e61fa6d | 3,181 | py | Python | tests/test_consumer_api.py | tysongg/essential-cosmic | 1bd21b4ed246dfda983c6e49b0967a4a1a289d63 | [
"MIT"
] | null | null | null | tests/test_consumer_api.py | tysongg/essential-cosmic | 1bd21b4ed246dfda983c6e49b0967a4a1a289d63 | [
"MIT"
] | 9 | 2020-01-27T02:08:04.000Z | 2020-01-27T02:46:53.000Z | tests/test_consumer_api.py | tysongg/essential-cosmic | 1bd21b4ed246dfda983c6e49b0967a4a1a289d63 | [
"MIT"
] | null | null | null | import pytest
import asyncio
import os
import sys
# Workaround so we don't have to create a setup.py file for the project and
# install an editable version
sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir))
from essential_cosmic.app import make_app
| 31.186275 | 85 | 0.607042 | import pytest
import asyncio
import os
import sys
# Workaround so we don't have to create a setup.py file for the project and
# install an editable version
sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir))
from essential_cosmic.app import make_app
class TestConsumer:
@pytest.fixture(scope="fun... | 2,481 | 408 | 23 |
d04c8eff07c31a44f0aef8503a211c69268b39fd | 8,889 | py | Python | nuke_stubs/nukescripts/precomp.py | sisoe24/Nuke-Python-Stubs | 79c53cf5cb7b38e15a34fd04f672b143d9d7dc85 | [
"MIT"
] | 1 | 2022-01-12T01:29:16.000Z | 2022-01-12T01:29:16.000Z | nuke_stubs/nukescripts/precomp.py | sisoe24/Nuke-Python-Stubs | 79c53cf5cb7b38e15a34fd04f672b143d9d7dc85 | [
"MIT"
] | null | null | null | nuke_stubs/nukescripts/precomp.py | sisoe24/Nuke-Python-Stubs | 79c53cf5cb7b38e15a34fd04f672b143d9d7dc85 | [
"MIT"
] | null | null | null | # Copyright (c) 2009 The Foundry Visionmongers Ltd. All Rights Reserved.
import nuke
import os, re, sys, math, time
from nukescripts import execute_panel
from nukescripts import panels
| 28.399361 | 167 | 0.623242 | # Copyright (c) 2009 The Foundry Visionmongers Ltd. All Rights Reserved.
import nuke
import os, re, sys, math, time
from nukescripts import execute_panel
from nukescripts import panels
class PrecompOptionsDialog( panels.PythonPanel ):
def __init__( self ):
panels.PythonPanel.__init__( self, "Precomp Nodes", "uk... | 8,441 | 28 | 234 |
71db7646b48f42a2dbbfeaf06ad12d63c39123bf | 72,149 | py | Python | MonteCarloMarginalizeCode/Code/RIFT/misc/dag_utils.py | spfanning/research-projects-RIT | 34afc69ccb502825c81285733dac8ff993f79503 | [
"MIT"
] | 8 | 2019-10-23T01:18:44.000Z | 2021-07-09T18:24:36.000Z | MonteCarloMarginalizeCode/Code/RIFT/misc/dag_utils.py | spfanning/research-projects-RIT | 34afc69ccb502825c81285733dac8ff993f79503 | [
"MIT"
] | 7 | 2020-01-03T14:38:26.000Z | 2022-01-17T16:57:02.000Z | MonteCarloMarginalizeCode/Code/RIFT/misc/dag_utils.py | spfanning/research-projects-RIT | 34afc69ccb502825c81285733dac8ff993f79503 | [
"MIT"
] | 11 | 2019-10-23T01:19:50.000Z | 2021-11-20T23:35:39.000Z | # Copyright (C) 2013 Evan Ochsner
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.
#
# This program is distributed in ... | 40.149694 | 465 | 0.665526 | # Copyright (C) 2013 Evan Ochsner
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.
#
# This program is distributed in ... | 423 | 0 | 68 |
175a3b4d2739554618c982905727d9731a509a3f | 934 | py | Python | boot.py | Ca11MeE/easy_frame | c3ec3069e3f61d1c01e5bd7ebbdf28e953a8ffa8 | [
"Apache-2.0"
] | null | null | null | boot.py | Ca11MeE/easy_frame | c3ec3069e3f61d1c01e5bd7ebbdf28e953a8ffa8 | [
"Apache-2.0"
] | null | null | null | boot.py | Ca11MeE/easy_frame | c3ec3069e3f61d1c01e5bd7ebbdf28e953a8ffa8 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
from flask import Flask
import mysql,os,re
from mysql import Pool
import properties
# 定义WEB容器(同时防止json以ascii解码返回)
app=Flask(__name__)
app.config['JSON_AS_ASCII'] = False
# 处理各模块中的自动注入以及组装各蓝图
# dir_path中为蓝图模块路径,例如需要引入的蓝图都在routes文件夹中,则传入参数'/routes'
print('加载数据库模块')
mysql.pool = Pool.Pool()
# print('加载... | 22.780488 | 96 | 0.639186 | # coding: utf-8
from flask import Flask
import mysql,os,re
from mysql import Pool
import properties
# 定义WEB容器(同时防止json以ascii解码返回)
app=Flask(__name__)
app.config['JSON_AS_ASCII'] = False
# 处理各模块中的自动注入以及组装各蓝图
# dir_path中为蓝图模块路径,例如需要引入的蓝图都在routes文件夹中,则传入参数'/routes'
def map_apps(dir_path):
path=os.getcwd()+dir_path
... | 512 | 0 | 45 |
84eea4a37f53204b935d3f1eece7e1963b816b5c | 1,893 | py | Python | setup.py | bastian-src/SysMonTask | 95868e230efa130e820f91893a3c8d5664632ac4 | [
"BSD-3-Clause"
] | 1 | 2021-05-20T09:31:26.000Z | 2021-05-20T09:31:26.000Z | setup.py | bastian-src/SysMonTask | 95868e230efa130e820f91893a3c8d5664632ac4 | [
"BSD-3-Clause"
] | null | null | null | setup.py | bastian-src/SysMonTask | 95868e230efa130e820f91893a3c8d5664632ac4 | [
"BSD-3-Clause"
] | null | null | null | from setuptools import setup, find_packages
import os
with open("README.md", "r") as fh:
long_description = fh.read()
setup(
name='sysmontask',
version='1.3.9',
description='System Monitor With UI Like Windows',
url='https://github.com/KrispyCamel4u/SysMonTask',
author='Neeraj Kumar',
auth... | 39.4375 | 159 | 0.692552 | from setuptools import setup, find_packages
import os
with open("README.md", "r") as fh:
long_description = fh.read()
def get_data_files():
data_files = [('/usr/share/sysmontask/glade_files', ['glade_files/disk.glade','glade_files/diskSidepane.glade','glade_files/gpu.glade',
'glade_files/gpuSidepane.glade... | 603 | 0 | 23 |
34090bb1e8c0e500ca86d957c3a062355daf3cc0 | 8,337 | py | Python | zelus/src/services/Twitter/twitter.py | Jacquesjh/Zelus | 6beac45a7ab5e4acce76175ad78eb3287bd7e398 | [
"MIT"
] | 1 | 2022-01-12T01:14:12.000Z | 2022-01-12T01:14:12.000Z | zelus/src/services/Twitter/twitter.py | Jacquesjh/Zelus | 6beac45a7ab5e4acce76175ad78eb3287bd7e398 | [
"MIT"
] | null | null | null | zelus/src/services/Twitter/twitter.py | Jacquesjh/Zelus | 6beac45a7ab5e4acce76175ad78eb3287bd7e398 | [
"MIT"
] | null | null | null |
from typing import List
import random
from time import sleep
from tweepy import Client
from TwitterAPI import TwitterAPI
| 33.083333 | 168 | 0.576946 |
from typing import List
import random
from time import sleep
from tweepy import Client
from TwitterAPI import TwitterAPI
class Twitter:
creds : dict
hash_tags: list
nfts_to_tweet: dict
nfts_to_reply: dict
def __init__(self, creds: dict, nfts_to_tweet: dict, nfts_to_reply: dict) -> None:
... | 7,600 | 591 | 23 |
210a678a3c714cdead1544323597dcdb1cff8f70 | 323 | py | Python | day8/d8p2.py | Akankshasharmaa/100DaysOfCode | 395bd8bd063495af7d04ec7b2f819923f502059f | [
"MIT"
] | 2 | 2021-12-22T07:43:14.000Z | 2021-12-24T12:07:33.000Z | day8/d8p2.py | Akankshasharmaa/100DaysOfCode | 395bd8bd063495af7d04ec7b2f819923f502059f | [
"MIT"
] | null | null | null | day8/d8p2.py | Akankshasharmaa/100DaysOfCode | 395bd8bd063495af7d04ec7b2f819923f502059f | [
"MIT"
] | 1 | 2021-12-22T07:43:26.000Z | 2021-12-22T07:43:26.000Z |
result = non_start('Hello', 'There')
print(result)
result = non_start('java', 'code')
print(result)
result = non_start('shotl', '')
print(result) | 24.846154 | 54 | 0.616099 | def non_start(str1, str2):
if len(str1) >= 1 and len(str2) >= 1:
newstr = str1[1:len(str1)] + str2[1:len(str2)]
return newstr
else:
return False
result = non_start('Hello', 'There')
print(result)
result = non_start('java', 'code')
print(result)
result = non_start('shotl', '')
print(resu... | 155 | 0 | 22 |
a1b5ff50c9c782fea188c9b6fb9e25d0a0c8232c | 705 | py | Python | port.py | hawk-0fcx/port | 223024c4ca7b95c34182b74d8116280f9371fc53 | [
"Apache-2.0"
] | 1 | 2022-03-12T11:33:16.000Z | 2022-03-12T11:33:16.000Z | port.py | hawk-unity/port | 223024c4ca7b95c34182b74d8116280f9371fc53 | [
"Apache-2.0"
] | null | null | null | port.py | hawk-unity/port | 223024c4ca7b95c34182b74d8116280f9371fc53 | [
"Apache-2.0"
] | null | null | null | import socket
import os
os.system("clear")
import colorama
from colorama import Fore, Back, Style, init
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.settimeout(5)
print("""
_ _
| |__ __ ___ _| | __ _
| '_ \ / _` \ \ /\ / / |/ /| |_
| | | | (_| |\ V V /| ... | 26.111111 | 68 | 0.537589 | import socket
import os
os.system("clear")
import colorama
from colorama import Fore, Back, Style, init
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.settimeout(5)
print("""
_ _
| |__ __ ___ _| | __ _
| '_ \ / _` \ \ /\ / / |/ /| |_
| | | | (_| |\ V V /| ... | 135 | 0 | 23 |
09bff90f642cffe4743a7a3613eb947ba5cade52 | 156 | py | Python | _solved/solutions/01-introduction-geospatial-data19.py | lleondia/geopandas-tutorial | 5128fd6865bbd979a7b4e5b8cb4d0de51bead029 | [
"BSD-3-Clause"
] | 341 | 2018-04-26T08:46:05.000Z | 2022-03-01T08:13:39.000Z | _solved/solutions/01-introduction-geospatial-data19.py | lleondia/geopandas-tutorial | 5128fd6865bbd979a7b4e5b8cb4d0de51bead029 | [
"BSD-3-Clause"
] | 24 | 2020-09-30T19:57:14.000Z | 2021-10-05T07:21:09.000Z | _solved/solutions/01-introduction-geospatial-data19.py | lleondia/geopandas-tutorial | 5128fd6865bbd979a7b4e5b8cb4d0de51bead029 | [
"BSD-3-Clause"
] | 128 | 2018-05-07T07:30:29.000Z | 2022-02-19T17:53:39.000Z | # As comparison, the misleading plot when not turning the population number into a density
districts.plot(column='population', figsize=(12, 6), legend=True) | 78 | 90 | 0.788462 | # As comparison, the misleading plot when not turning the population number into a density
districts.plot(column='population', figsize=(12, 6), legend=True) | 0 | 0 | 0 |
15c549b448318131afb3c0205f8085e21f227080 | 9,494 | py | Python | update_headers.py | simoncozens/pysilfont | bb8a9fc58a83e074bbcc466ba058841845b9107e | [
"MIT"
] | 41 | 2015-05-21T21:12:26.000Z | 2022-02-17T17:23:14.000Z | update_headers.py | simoncozens/pysilfont | bb8a9fc58a83e074bbcc466ba058841845b9107e | [
"MIT"
] | 63 | 2015-05-15T10:25:55.000Z | 2021-02-23T04:51:17.000Z | update_headers.py | simoncozens/pysilfont | bb8a9fc58a83e074bbcc466ba058841845b9107e | [
"MIT"
] | 12 | 2015-06-12T11:52:08.000Z | 2020-09-23T10:40:59.000Z | #!/usr/bin/env python
'Checks for standard headers and update version and copyright info in python files'
__url__ = 'http://github.com/silnrsi/pysilfont'
__copyright__ = 'Copyright (c) 2016 SIL International (http://www.sil.org)'
__license__ = 'Released under the MIT License (http://opensource.org/licenses/MIT)'
__auth... | 48.192893 | 123 | 0.425637 | #!/usr/bin/env python
'Checks for standard headers and update version and copyright info in python files'
__url__ = 'http://github.com/silnrsi/pysilfont'
__copyright__ = 'Copyright (c) 2016 SIL International (http://www.sil.org)'
__license__ = 'Released under the MIT License (http://opensource.org/licenses/MIT)'
__auth... | 8,728 | 0 | 46 |
83d2715a3c28310e7a615f390760361ca9c50fc6 | 1,976 | py | Python | rapidtest/executors/__init__.py | yehzhang/RapidTest | 2302fc10ddafba1d16ef1d7448d46c66f5a05da2 | [
"MIT"
] | null | null | null | rapidtest/executors/__init__.py | yehzhang/RapidTest | 2302fc10ddafba1d16ef1d7448d46c66f5a05da2 | [
"MIT"
] | null | null | null | rapidtest/executors/__init__.py | yehzhang/RapidTest | 2302fc10ddafba1d16ef1d7448d46c66f5a05da2 | [
"MIT"
] | null | null | null | import atexit
import logging
from inspect import isclass
from .common_executors import BaseExecutor
from .externel_executors import ExternalExecutorFabric
from .java import *
from .operations import Operation, Operations
from .python import *
from ..utils import isstring
logger = logging.getLogger(__name__)
atex... | 30.875 | 97 | 0.674089 | import atexit
import logging
from inspect import isclass
from .common_executors import BaseExecutor
from .externel_executors import ExternalExecutorFabric
from .java import *
from .operations import Operation, Operations
from .python import *
from ..utils import isstring
logger = logging.getLogger(__name__)
class B... | 304 | 1,206 | 95 |
5855a718f19fd271a7d90653c654f8cb39f399af | 83 | py | Python | src/polls/forLoop5.py | Prince-linux/python-learning | 75335ed497081b557400a05320b52b8889c3e1f4 | [
"MIT"
] | 1 | 2015-08-27T13:03:27.000Z | 2015-08-27T13:03:27.000Z | src/polls/forLoop5.py | Prince-linux/python-learning | 75335ed497081b557400a05320b52b8889c3e1f4 | [
"MIT"
] | 22 | 2015-08-23T18:17:30.000Z | 2015-09-16T13:38:36.000Z | src/polls/forLoop5.py | Prince-linux/python-learning | 75335ed497081b557400a05320b52b8889c3e1f4 | [
"MIT"
] | null | null | null | for i in range(201, 0, -2):
print(i)
for i in range(100, 0, -1):
print(i)
| 13.833333 | 27 | 0.53012 | for i in range(201, 0, -2):
print(i)
for i in range(100, 0, -1):
print(i)
| 0 | 0 | 0 |
ca4f6f3248cffb86968c72e3aaf6cc6ec45f47c6 | 430 | py | Python | Vars & Data Entry/exercicio 3.py | SkaarlK/Learning-Python | bbf011182fb5bf876aa9a274400c41a266a0e8c7 | [
"MIT"
] | 2 | 2022-01-01T19:31:56.000Z | 2022-01-01T19:32:54.000Z | Vars & Data Entry/exercicio 3.py | SkaarlK/Learning-Python | bbf011182fb5bf876aa9a274400c41a266a0e8c7 | [
"MIT"
] | null | null | null | Vars & Data Entry/exercicio 3.py | SkaarlK/Learning-Python | bbf011182fb5bf876aa9a274400c41a266a0e8c7 | [
"MIT"
] | null | null | null | dias = int(input("Insira os dias para virarem segundos: "))
horas = int(input("Insira as horas para virarem segundos: "))
minutos = int(input("Insira os minutos para virarem segundos: "))
segundos = int(input("Insira os segundos para serem somados aos anteriores: "))
segundos += (dias * 86400) + (horas * 3600) + (minut... | 71.666667 | 101 | 0.711628 | dias = int(input("Insira os dias para virarem segundos: "))
horas = int(input("Insira as horas para virarem segundos: "))
minutos = int(input("Insira os minutos para virarem segundos: "))
segundos = int(input("Insira os segundos para serem somados aos anteriores: "))
segundos += (dias * 86400) + (horas * 3600) + (minut... | 0 | 0 | 0 |
c06c9c6d5402fedf403bcb579088899fc6cd9baf | 748 | py | Python | motivate_gui.py | neesara/motivate | 36cfb2a3502d48b99189841f35b9693e40dd8532 | [
"MIT"
] | null | null | null | motivate_gui.py | neesara/motivate | 36cfb2a3502d48b99189841f35b9693e40dd8532 | [
"MIT"
] | null | null | null | motivate_gui.py | neesara/motivate | 36cfb2a3502d48b99189841f35b9693e40dd8532 | [
"MIT"
] | null | null | null | import tkinter as tk
import os
import random
import datetime
root = tk.Tk()
root.title("Motivation")
root.configure(background='white')
command=os.getcwd()+'/motivate/motivate.py'
quote=os.popen(command).read()
color=random.choice(['green','blue','purple','red','orange','brown','magenta','violet','maroon','olive','lim... | 39.368421 | 165 | 0.71123 | import tkinter as tk
import os
import random
import datetime
root = tk.Tk()
root.title("Motivation")
root.configure(background='white')
command=os.getcwd()+'/motivate/motivate.py'
quote=os.popen(command).read()
color=random.choice(['green','blue','purple','red','orange','brown','magenta','violet','maroon','olive','lim... | 0 | 0 | 0 |
fc06bae0a0175ddaa81e9b5257fbdf007c920b1c | 100 | py | Python | Code/bin_manager/mgr_Analytics/apps.py | kailashmuralidharan/smartbin | 87f762f7d15e0da6645ce62c49f6a8b4ccfe785d | [
"MIT"
] | null | null | null | Code/bin_manager/mgr_Analytics/apps.py | kailashmuralidharan/smartbin | 87f762f7d15e0da6645ce62c49f6a8b4ccfe785d | [
"MIT"
] | null | null | null | Code/bin_manager/mgr_Analytics/apps.py | kailashmuralidharan/smartbin | 87f762f7d15e0da6645ce62c49f6a8b4ccfe785d | [
"MIT"
] | 1 | 2020-01-22T10:35:38.000Z | 2020-01-22T10:35:38.000Z | from django.apps import AppConfig
| 16.666667 | 36 | 0.78 | from django.apps import AppConfig
class MgrAnalyticsConfig(AppConfig):
name = 'mgr_Analytics'
| 0 | 42 | 23 |
57bdb73e1704842d0766817fd5391f99486fe936 | 2,062 | py | Python | tests/test_normalization.py | learniotai/iotai-sensor-classifications | ba2527cb317afa30a5c495d1cddc16f7dc2936ed | [
"Apache-2.0"
] | null | null | null | tests/test_normalization.py | learniotai/iotai-sensor-classifications | ba2527cb317afa30a5c495d1cddc16f7dc2936ed | [
"Apache-2.0"
] | null | null | null | tests/test_normalization.py | learniotai/iotai-sensor-classifications | ba2527cb317afa30a5c495d1cddc16f7dc2936ed | [
"Apache-2.0"
] | null | null | null | """Test normalizing gesture recording data."""
import os
import numpy as np
from iotai_sensor_classification.recording import read_recordings
from iotai_sensor_classification.normalization import normalize_mean_std_dict
from data.gestures import linear_accelerometer
from iotai_sensor_classification.plot_util import co... | 54.263158 | 113 | 0.727934 | """Test normalizing gesture recording data."""
import os
import numpy as np
from iotai_sensor_classification.recording import read_recordings
from iotai_sensor_classification.normalization import normalize_mean_std_dict
from data.gestures import linear_accelerometer
from iotai_sensor_classification.plot_util import co... | 1,621 | 0 | 23 |
fb9c84f69582b895624fd919a820ac62d428a59c | 4,791 | py | Python | examples/book_view/benchmark.py | toluaina/essync | 4a0119d99760eaa193f4ae60abd2b5f38482b280 | [
"BSD-3-Clause"
] | 1 | 2019-09-26T21:05:37.000Z | 2019-09-26T21:05:37.000Z | examples/book_view/benchmark.py | toluaina/essync | 4a0119d99760eaa193f4ae60abd2b5f38482b280 | [
"BSD-3-Clause"
] | null | null | null | examples/book_view/benchmark.py | toluaina/essync | 4a0119d99760eaa193f4ae60abd2b5f38482b280 | [
"BSD-3-Clause"
] | 1 | 2019-08-27T16:19:09.000Z | 2019-08-27T16:19:09.000Z | import json
from random import choice
from typing import Set
import click
import sqlalchemy as sa
from faker import Faker
from schema import Book
from sqlalchemy.orm import sessionmaker
from pgsync.base import pg_engine
from pgsync.constants import DELETE, INSERT, TG_OP, TRUNCATE, UPDATE
from pgsync.utils import get_... | 29.757764 | 77 | 0.529743 | import json
from random import choice
from typing import Set
import click
import sqlalchemy as sa
from faker import Faker
from schema import Book
from sqlalchemy.orm import sessionmaker
from pgsync.base import pg_engine
from pgsync.constants import DELETE, INSERT, TG_OP, TRUNCATE, UPDATE
from pgsync.utils import get_... | 3,797 | 0 | 91 |
b388ad646acdaff30e3ae11dca9c423ac5dc3c80 | 794 | py | Python | resources/ArchivesSpace post-migration scripts/TitleCapitalization.py | smith-special-collections/aspace-migration | 0ad6f1346df52e12739f27b54570586af4362559 | [
"MIT"
] | 2 | 2016-09-14T12:31:40.000Z | 2018-05-25T02:45:37.000Z | resources/ArchivesSpace post-migration scripts/TitleCapitalization.py | smith-special-collections/aspace-migration | 0ad6f1346df52e12739f27b54570586af4362559 | [
"MIT"
] | 1 | 2017-04-13T16:24:59.000Z | 2017-04-18T19:30:08.000Z | resources/ArchivesSpace post-migration scripts/TitleCapitalization.py | smith-special-collections/aspace-migration | 0ad6f1346df52e12739f27b54570586af4362559 | [
"MIT"
] | null | null | null | import requests
import json
aspace_url = 'http://localhost:8089'
username = 'admin'
password = 'admin'
repo_num = '2'
auth = requests.post(aspace_url+'/users/'+username+'/login?password='+password).json()
session = auth["session"]
headers = {'X-ArchivesSpace-Session':session}
for d in range(1,6):
resource_json = re... | 37.809524 | 133 | 0.730479 | import requests
import json
aspace_url = 'http://localhost:8089'
username = 'admin'
password = 'admin'
repo_num = '2'
auth = requests.post(aspace_url+'/users/'+username+'/login?password='+password).json()
session = auth["session"]
headers = {'X-ArchivesSpace-Session':session}
for d in range(1,6):
resource_json = re... | 0 | 0 | 0 |
2abcfcc2281955e4ae7cbe49ec5370d4ae3c495c | 540 | py | Python | Node.py | akshaykamath/Bayes-Network-Inference-Algorithms | 3a0867130dd74bf2444a7ce4f972fff6b1a989dc | [
"MIT"
] | null | null | null | Node.py | akshaykamath/Bayes-Network-Inference-Algorithms | 3a0867130dd74bf2444a7ce4f972fff6b1a989dc | [
"MIT"
] | null | null | null | Node.py | akshaykamath/Bayes-Network-Inference-Algorithms | 3a0867130dd74bf2444a7ce4f972fff6b1a989dc | [
"MIT"
] | null | null | null | __author__ = 'Akshay'
| 21.6 | 48 | 0.625926 | __author__ = 'Akshay'
class Node:
initial_time = 0
finish_time = 0
name = None
child_nodes = None
parent_nodes = None
conditional_probability_table = {}
def __init__(self, nm):
self.name = nm
self.parent_distance = 0
self.child_nodes = []
self.parent_nodes ... | 279 | 214 | 23 |
90d1a8e84d85bc7f4e6d8664cd0c5d4332376007 | 38,126 | py | Python | conpaas-services/src/conpaas/services/xtreemfs/manager/manager.py | bopopescu/conpaas | e0a2955ae3e7da7525d799bed411e9f76ecf0919 | [
"BSD-3-Clause"
] | 1 | 2015-09-20T18:20:01.000Z | 2015-09-20T18:20:01.000Z | conpaas-services/src/conpaas/services/xtreemfs/manager/manager.py | bopopescu/conpaas | e0a2955ae3e7da7525d799bed411e9f76ecf0919 | [
"BSD-3-Clause"
] | 1 | 2020-07-27T11:56:18.000Z | 2020-07-27T11:56:18.000Z | conpaas-services/src/conpaas/services/xtreemfs/manager/manager.py | bopopescu/conpaas | e0a2955ae3e7da7525d799bed411e9f76ecf0919 | [
"BSD-3-Clause"
] | 3 | 2018-09-14T16:54:14.000Z | 2020-07-26T03:14:56.000Z | # -*- coding: utf-8 -*-
"""
:copyright: (C) 2010-2013 by Contrail Consortium.
"""
from threading import Thread
from conpaas.core.expose import expose
from conpaas.core.manager import BaseManager
from conpaas.core.manager import ManagerException
from conpaas.core.https.server import HttpJsonResponse, HttpErrorR... | 38.864424 | 138 | 0.577087 | # -*- coding: utf-8 -*-
"""
:copyright: (C) 2010-2013 by Contrail Consortium.
"""
from threading import Thread
from conpaas.core.expose import expose
from conpaas.core.manager import BaseManager
from conpaas.core.manager import ManagerException
from conpaas.core.https.server import HttpJsonResponse, HttpErrorR... | 32,779 | 4,876 | 46 |
a3c424cf728d4c2ef3a50ff9cfcd26a82c1360fa | 505 | py | Python | Python/delete_empty_folders/script.py | Ian-Yy/code-n-stitch | 20fc8784bf51bd3e36329d1ca44b0be6dc66fae6 | [
"MIT"
] | 50 | 2020-09-19T16:40:21.000Z | 2022-02-05T05:48:42.000Z | Python/delete_empty_folders/script.py | Ian-Yy/code-n-stitch | 20fc8784bf51bd3e36329d1ca44b0be6dc66fae6 | [
"MIT"
] | 266 | 2020-09-25T17:24:04.000Z | 2021-11-29T07:17:57.000Z | Python/delete_empty_folders/script.py | Ian-Yy/code-n-stitch | 20fc8784bf51bd3e36329d1ca44b0be6dc66fae6 | [
"MIT"
] | 113 | 2020-09-26T10:28:11.000Z | 2021-10-15T06:58:53.000Z | import os
import sys
# enter path to the directory with the files
x = input('Absolute path of folder, from which empty subfolders are to be removed: ')
# check if path is valid
if not os.path.exists(x):
print('Invalid path\nTerminating program')
sys.exit()
# cleanup of empty subfolders
walk = list(os.walk('/home/n... | 26.578947 | 85 | 0.720792 | import os
import sys
# enter path to the directory with the files
x = input('Absolute path of folder, from which empty subfolders are to be removed: ')
# check if path is valid
if not os.path.exists(x):
print('Invalid path\nTerminating program')
sys.exit()
# cleanup of empty subfolders
walk = list(os.walk('/home/n... | 0 | 0 | 0 |
0a5858e6445232a1bc20db7f822c0cac94845b29 | 21,764 | py | Python | test/unit/test_file_copy.py | networktocode/pynxos | 6ee22d52e5a0f0ae2e6b96b0c1ce158c30eb75e9 | [
"Apache-2.0"
] | 14 | 2016-04-17T19:03:15.000Z | 2021-04-06T13:04:23.000Z | test/unit/test_file_copy.py | networktocode/pynxos | 6ee22d52e5a0f0ae2e6b96b0c1ce158c30eb75e9 | [
"Apache-2.0"
] | 8 | 2016-02-02T23:44:12.000Z | 2019-02-15T20:20:20.000Z | test/unit/test_file_copy.py | networktocode/pynxos | 6ee22d52e5a0f0ae2e6b96b0c1ce158c30eb75e9 | [
"Apache-2.0"
] | 17 | 2016-04-17T19:03:17.000Z | 2021-04-05T09:55:43.000Z | import unittest
import mock
from tempfile import NamedTemporaryFile
from pynxos.features.file_copy import FileCopy, FileTransferError
if __name__ == "__main__":
unittest.main() | 91.445378 | 3,856 | 0.66826 | import unittest
import mock
from tempfile import NamedTemporaryFile
from pynxos.features.file_copy import FileCopy, FileTransferError
class FileCopyTestCase(unittest.TestCase):
@mock.patch('pynxos.device.Device', autospec=True)
def setUp(self, mock_device):
self.device = mock_device
self.devi... | 19,245 | 2,313 | 23 |
1ba7e9d00ac9ddde32d332f71e982fac582852a8 | 1,154 | py | Python | lcd-numbers/pylint/checkers/__init__.py | kelesi/coedcop | 2bdbac207cf6f81de70b92c644c40663bbea8c8a | [
"MIT"
] | 1 | 2017-12-08T15:55:17.000Z | 2017-12-08T15:55:17.000Z | lcd-numbers/pylint/checkers/__init__.py | kelesi/coedcop | 2bdbac207cf6f81de70b92c644c40663bbea8c8a | [
"MIT"
] | null | null | null | lcd-numbers/pylint/checkers/__init__.py | kelesi/coedcop | 2bdbac207cf6f81de70b92c644c40663bbea8c8a | [
"MIT"
] | null | null | null | """Jeff Bay's Object Calisthenics Rules."""
# 1. One level of indentation per method
# * Pylint's "checkers.refactoring", max-nested-blocks=1
# * Pylint's "checkers.design_analysis", max-branches=1
# * DONE
# 2. Don't use the ELSE keyword
import checkers.no_else
# * also Pylint's "checkers.refactoring", max-nested-bl... | 26.837209 | 89 | 0.738302 | """Jeff Bay's Object Calisthenics Rules."""
# 1. One level of indentation per method
# * Pylint's "checkers.refactoring", max-nested-blocks=1
# * Pylint's "checkers.design_analysis", max-branches=1
# * DONE
# 2. Don't use the ELSE keyword
import checkers.no_else
# * also Pylint's "checkers.refactoring", max-nested-bl... | 0 | 0 | 0 |
0892a02aefb143a24befa8f3ebf7c11b8155f8f2 | 1,794 | py | Python | args.py | stevievb/sagemaker-labeljob-scoreboard | 038456cd2d83ba4bf365ecb305bf443cdc1aa404 | [
"Apache-2.0"
] | null | null | null | args.py | stevievb/sagemaker-labeljob-scoreboard | 038456cd2d83ba4bf365ecb305bf443cdc1aa404 | [
"Apache-2.0"
] | null | null | null | args.py | stevievb/sagemaker-labeljob-scoreboard | 038456cd2d83ba4bf365ecb305bf443cdc1aa404 | [
"Apache-2.0"
] | null | null | null | # © 2020 Amgen 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 or agre... | 32.618182 | 105 | 0.672241 | # © 2020 Amgen 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 or agre... | 1,062 | 0 | 23 |
f7e47ef168d23cb2dc99e0ac2263c621df593dbd | 132 | py | Python | server/src/resources/__init__.py | AlexandreBattut/centrale | 28d1aa53abb88e7ffb87ee1d64cb698a2c76402a | [
"MIT"
] | null | null | null | server/src/resources/__init__.py | AlexandreBattut/centrale | 28d1aa53abb88e7ffb87ee1d64cb698a2c76402a | [
"MIT"
] | null | null | null | server/src/resources/__init__.py | AlexandreBattut/centrale | 28d1aa53abb88e7ffb87ee1d64cb698a2c76402a | [
"MIT"
] | null | null | null | from .user import UserResource
from .movie import MovieResource,MovieAuthorResource
from .note import NoteResource, NoteAllResource
| 33 | 52 | 0.863636 | from .user import UserResource
from .movie import MovieResource,MovieAuthorResource
from .note import NoteResource, NoteAllResource
| 0 | 0 | 0 |
ae7b9a5ad2f42b1085d8218767395ee08e327173 | 5,994 | py | Python | gui.py | kratantjain/SQLiVS | 6b91cc454742c753ef002ac52c01ddf09bdcf8ed | [
"MIT"
] | null | null | null | gui.py | kratantjain/SQLiVS | 6b91cc454742c753ef002ac52c01ddf09bdcf8ed | [
"MIT"
] | null | null | null | gui.py | kratantjain/SQLiVS | 6b91cc454742c753ef002ac52c01ddf09bdcf8ed | [
"MIT"
] | 1 | 2018-10-28T17:47:24.000Z | 2018-10-28T17:47:24.000Z | from Tkinter import *
from tkMessageBox import *
from tkFileDialog import *
from SQLinjector import *
import time
import websitedata
Home()
| 41.625 | 127 | 0.656823 | from Tkinter import *
from tkMessageBox import *
from tkFileDialog import *
from SQLinjector import *
import time
import websitedata
def checkvuln(wsite,name):
inject=[]
global result
for x in name:
sqlinject=x
inject.append(wsite.replace("FUZZ",sqlinject))
showinfo('Wait'," Checking we... | 5,646 | 0 | 199 |
1f013a9bb78006e16890563e1f2078779f4852ab | 3,131 | py | Python | src/pybind/matrix/kaldi_matrix_pybind_test.py | aadps/kaldi | cd351bb31c98f9d540c409478cbf2c5fef1853ca | [
"Apache-2.0"
] | null | null | null | src/pybind/matrix/kaldi_matrix_pybind_test.py | aadps/kaldi | cd351bb31c98f9d540c409478cbf2c5fef1853ca | [
"Apache-2.0"
] | null | null | null | src/pybind/matrix/kaldi_matrix_pybind_test.py | aadps/kaldi | cd351bb31c98f9d540c409478cbf2c5fef1853ca | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# Copyright 2019 Mobvoi AI Lab, Beijing, China (author: Fangjun Kuang)
# Apache 2.0
import os
import sys
sys.path.insert(0, os.path.join(os.path.dirname(__file__), os.pardir))
import unittest
import numpy as np
import kaldi
if __name__ == '__main__':
unittest.main()
| 29.537736 | 71 | 0.545513 | #!/usr/bin/env python3
# Copyright 2019 Mobvoi AI Lab, Beijing, China (author: Fangjun Kuang)
# Apache 2.0
import os
import sys
sys.path.insert(0, os.path.join(os.path.dirname(__file__), os.pardir))
import unittest
import numpy as np
import kaldi
class TestFloatSubMatrix(unittest.TestCase):
def test_from_nu... | 2,612 | 65 | 150 |
17e2ec4a244bb94a85b8daab658bef83ab4ca1af | 1,982 | py | Python | src/controllers/supporting_lists/controller.py | MaxVanHoucke/esp-uantwerp | 6f2129d60954b198f233e75956a4f5c675a03cbc | [
"MIT"
] | null | null | null | src/controllers/supporting_lists/controller.py | MaxVanHoucke/esp-uantwerp | 6f2129d60954b198f233e75956a4f5c675a03cbc | [
"MIT"
] | null | null | null | src/controllers/supporting_lists/controller.py | MaxVanHoucke/esp-uantwerp | 6f2129d60954b198f233e75956a4f5c675a03cbc | [
"MIT"
] | null | null | null | from flask import Blueprint, request, render_template, jsonify
from flask_login import current_user
from src.controllers.supporting_lists.manage_lists import manage, update_item
from src.models.type import TypeDataAccess
from src.models.tag import TagDataAccess
from src.models.research_group import *
from src.models.st... | 33.033333 | 89 | 0.701816 | from flask import Blueprint, request, render_template, jsonify
from flask_login import current_user
from src.controllers.supporting_lists.manage_lists import manage, update_item
from src.models.type import TypeDataAccess
from src.models.tag import TagDataAccess
from src.models.research_group import *
from src.models.st... | 0 | 0 | 0 |
5e309a053528b67904d5d5112db0bd96f00b89b5 | 1,204 | py | Python | makerbean/PDFBot.py | AndersonBY/python-makerbean | c7713a019217e7f2eb42010af8f4f6c8a15fa910 | [
"MIT"
] | 8 | 2020-12-28T12:49:50.000Z | 2021-04-12T13:49:19.000Z | makerbean/PDFBot.py | AndersonBY/python-makerbean | c7713a019217e7f2eb42010af8f4f6c8a15fa910 | [
"MIT"
] | null | null | null | makerbean/PDFBot.py | AndersonBY/python-makerbean | c7713a019217e7f2eb42010af8f4f6c8a15fa910 | [
"MIT"
] | 4 | 2021-01-12T07:48:11.000Z | 2021-04-12T13:49:21.000Z | # -*- coding: utf-8 -*-
# @Author: ander
# @Date: 2020-12-22 16:19:51
# @Last Modified by: ander
# @Last Modified time: 2020-12-22 16:25:49
import pdfplumber
from PyPDF2 import PdfFileReader, PdfFileWriter, PdfFileMerger
import os.path
from .utilities import mkdir
class PDFBot(object):
"""docstring for ExcelB... | 30.1 | 85 | 0.649502 | # -*- coding: utf-8 -*-
# @Author: ander
# @Date: 2020-12-22 16:19:51
# @Last Modified by: ander
# @Last Modified time: 2020-12-22 16:25:49
import pdfplumber
from PyPDF2 import PdfFileReader, PdfFileWriter, PdfFileMerger
import os.path
from .utilities import mkdir
class PDFBot(object):
"""docstring for ExcelB... | 743 | 0 | 135 |
7d8042e0a0e082248ae3fb8d16b1773619abf452 | 3,510 | py | Python | tests/unit/resources/settings/test_backups.py | PragadeeswaranS/oneview-python | 3acc113b8dd30029beb7c228c3bc2bbe67d3485b | [
"Apache-2.0"
] | null | null | null | tests/unit/resources/settings/test_backups.py | PragadeeswaranS/oneview-python | 3acc113b8dd30029beb7c228c3bc2bbe67d3485b | [
"Apache-2.0"
] | null | null | null | tests/unit/resources/settings/test_backups.py | PragadeeswaranS/oneview-python | 3acc113b8dd30029beb7c228c3bc2bbe67d3485b | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
###
# (C) Copyright [2019] Hewlett Packard Enterprise Development LP
#
# 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
#... | 35.454545 | 118 | 0.74188 | # -*- coding: utf-8 -*-
###
# (C) Copyright [2019] Hewlett Packard Enterprise Development LP
#
# 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
#... | 1,895 | 748 | 23 |
4bc85f8092188613ab654a4c3765404fe3fb867c | 672 | py | Python | airbnb/system/region_revenue.py | mpresh/airbnb-tools | 6f1884082e91ec810ea5667a1b2041ad246ebf7b | [
"MIT"
] | 1 | 2017-07-12T16:44:02.000Z | 2017-07-12T16:44:02.000Z | airbnb/system/region_revenue.py | mpresh/airbnb-tools | 6f1884082e91ec810ea5667a1b2041ad246ebf7b | [
"MIT"
] | null | null | null | airbnb/system/region_revenue.py | mpresh/airbnb-tools | 6f1884082e91ec810ea5667a1b2041ad246ebf7b | [
"MIT"
] | null | null | null | import zipcodes
import listings
import bnbcalendar
import finance
from pprint import pprint
if __name__ == "__main__":
region_average_revenue(zipcodes.get_all_cape_cod_zip_codes)
| 33.6 | 80 | 0.733631 | import zipcodes
import listings
import bnbcalendar
import finance
from pprint import pprint
def region_average_revenue(zipcodes_func, adults=16, state="MA"):
rooms = listings.get_all_listings(zipcodes_func, adults=adults, state=state)
#rooms = ["4914702", "16042826"]
for room in rooms:
print("Getti... | 455 | 0 | 23 |
2b4944225389f356c9da74143b2cea6864e7e5f4 | 2,458 | py | Python | conveniences/demo_mnbc.py | mateusnbm/ai-conveniences | 4a0cd0d761f1d534149f9f0ab03f5f94e4290580 | [
"MIT"
] | null | null | null | conveniences/demo_mnbc.py | mateusnbm/ai-conveniences | 4a0cd0d761f1d534149f9f0ab03f5f94e4290580 | [
"MIT"
] | null | null | null | conveniences/demo_mnbc.py | mateusnbm/ai-conveniences | 4a0cd0d761f1d534149f9f0ab03f5f94e4290580 | [
"MIT"
] | null | null | null | #
# demo_spam_classifier.py
#
# Multinomial Naive Bays Classifier.
#
# Based-on:
#
# https://www.udemy.com/data-science-and-machine-learning-with-python-hands-on/
# http://blog.datumbox.com/machine-learning-tutorial-the-naive-bayes-text-classifier/
#
import os
import io
import numpy
from pandas import DataFrame
from s... | 27.931818 | 107 | 0.684703 | #
# demo_spam_classifier.py
#
# Multinomial Naive Bays Classifier.
#
# Based-on:
#
# https://www.udemy.com/data-science-and-machine-learning-with-python-hands-on/
# http://blog.datumbox.com/machine-learning-tutorial-the-naive-bayes-text-classifier/
#
import os
import io
import numpy
from pandas import DataFrame
from s... | 735 | 0 | 46 |
e5ab48881e462aa904536ebf91d486c500e7719a | 115 | py | Python | testing_focus_session/01_unit_tests/03_pytest/02_fixtures/05_request_fixture/test_module.py | netanelrevah/testing-focus-session | ce1ef76afa444ee50a1d20f0855ae5073ee2c2d9 | [
"MIT"
] | 1 | 2020-06-26T12:40:38.000Z | 2020-06-26T12:40:38.000Z | testing_focus_session/01_unit_tests/03_pytest/02_fixtures/05_request_fixture/test_module.py | netanelrevah/testing-focus-session | ce1ef76afa444ee50a1d20f0855ae5073ee2c2d9 | [
"MIT"
] | null | null | null | testing_focus_session/01_unit_tests/03_pytest/02_fixtures/05_request_fixture/test_module.py | netanelrevah/testing-focus-session | ce1ef76afa444ee50a1d20f0855ae5073ee2c2d9 | [
"MIT"
] | 1 | 2021-10-05T10:29:19.000Z | 2021-10-05T10:29:19.000Z | ports = [80, 433, 8080, 8000]
| 16.428571 | 34 | 0.652174 | ports = [80, 433, 8080, 8000]
def test_connections(connections):
for c in connections:
print(c.port)
| 61 | 0 | 23 |
3f2201b86a9fcb9ecd7c3f12b0c04d9a9eeca535 | 6,660 | py | Python | src/commoncode/filetype.py | Pratikrocks/commoncode | 02fb544869708607997bbf3440e1b402c68a3164 | [
"Apache-2.0"
] | 2 | 2020-09-28T10:12:28.000Z | 2021-01-15T11:16:44.000Z | src/commoncode/filetype.py | Pratikrocks/commoncode | 02fb544869708607997bbf3440e1b402c68a3164 | [
"Apache-2.0"
] | 28 | 2020-11-13T01:39:37.000Z | 2022-03-28T20:14:50.000Z | src/commoncode/filetype.py | Pratikrocks/commoncode | 02fb544869708607997bbf3440e1b402c68a3164 | [
"Apache-2.0"
] | 6 | 2020-11-18T00:16:18.000Z | 2021-09-01T09:01:11.000Z | #
# Copyright (c) nexB Inc. and others. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
# See http://www.apache.org/licenses/LICENSE-2.0 for the license text.
# See https://github.com/nexB/commoncode for support or download.
# See https://aboutcode.org for more information about nexB OSS projects.
#
import ... | 29.469027 | 86 | 0.666066 | #
# Copyright (c) nexB Inc. and others. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
# See http://www.apache.org/licenses/LICENSE-2.0 for the license text.
# See https://github.com/nexB/commoncode for support or download.
# See https://aboutcode.org for more information about nexB OSS projects.
#
import ... | 0 | 0 | 0 |
05aeadad29492f4792dc64b4e5f1e4699b3a1866 | 1,522 | py | Python | object_detection/serving_script/predict.py | qq2016/kubeflow_learning | 930706686108f997aab42ccf2fe455dcf09a4afc | [
"Apache-2.0"
] | 1,165 | 2018-03-01T01:47:14.000Z | 2022-03-31T08:35:00.000Z | object_detection/serving_script/predict.py | arki1/examples | c93b792d67c8c52bc91d4ccf5fbaead4e2324331 | [
"Apache-2.0"
] | 929 | 2018-02-04T18:20:16.000Z | 2022-03-31T18:20:43.000Z | object_detection/serving_script/predict.py | arki1/examples | c93b792d67c8c52bc91d4ccf5fbaead4e2324331 | [
"Apache-2.0"
] | 687 | 2018-02-01T21:35:30.000Z | 2022-03-29T07:47:47.000Z | """ Script to send prediction request.
Usage:
python predict.py --url=YOUR_KF_HOST/models/coco --input_image=YOUR_LOCAL_IMAGE
--output_image=OUTPUT_IMAGE_NAME.
This will save the prediction result as OUTPUT_IMAGE_NAME.
The output image is the input image with the detected bounding boxes.
"""
import argparse
imp... | 27.178571 | 81 | 0.729304 | """ Script to send prediction request.
Usage:
python predict.py --url=YOUR_KF_HOST/models/coco --input_image=YOUR_LOCAL_IMAGE
--output_image=OUTPUT_IMAGE_NAME.
This will save the prediction result as OUTPUT_IMAGE_NAME.
The output image is the input image with the detected bounding boxes.
"""
import argparse
imp... | 1,009 | 0 | 23 |
835a69e7ee6ae96c62b6be6b24e176d61f9beb24 | 151 | py | Python | src/polls/tests/functional_tests.py | ikos289/docker-django | 6fa50df751e357b82b686d15b16891210e506430 | [
"MIT"
] | null | null | null | src/polls/tests/functional_tests.py | ikos289/docker-django | 6fa50df751e357b82b686d15b16891210e506430 | [
"MIT"
] | null | null | null | src/polls/tests/functional_tests.py | ikos289/docker-django | 6fa50df751e357b82b686d15b16891210e506430 | [
"MIT"
] | null | null | null | from selenium import webdriver
browser = webdriver.Firefox()
browser.get('http://0.0.0.0:8000')
print(browser.title)
assert 'Django' in browser.title
| 21.571429 | 34 | 0.761589 | from selenium import webdriver
browser = webdriver.Firefox()
browser.get('http://0.0.0.0:8000')
print(browser.title)
assert 'Django' in browser.title
| 0 | 0 | 0 |
a72428b374da27389d79bf99ef277a86b1fa5dd6 | 509 | py | Python | src/olympia/stats/migrations/0005_create_switch_bigquery_download_stats_cron_tasks.py | shashwatsingh/addons-server | 8fce98901104349055a828b5a47865f5e8f4120b | [
"BSD-3-Clause"
] | 843 | 2016-02-09T13:00:37.000Z | 2022-03-20T19:17:06.000Z | src/olympia/stats/migrations/0005_create_switch_bigquery_download_stats_cron_tasks.py | shashwatsingh/addons-server | 8fce98901104349055a828b5a47865f5e8f4120b | [
"BSD-3-Clause"
] | 10,187 | 2016-02-05T23:51:05.000Z | 2022-03-31T15:24:44.000Z | src/olympia/stats/migrations/0005_create_switch_bigquery_download_stats_cron_tasks.py | shashwatsingh/addons-server | 8fce98901104349055a828b5a47865f5e8f4120b | [
"BSD-3-Clause"
] | 551 | 2016-02-08T20:32:16.000Z | 2022-03-15T16:49:24.000Z | # Generated by Django 2.2.13 on 2020-07-23 16:13
from django.db import migrations
| 25.45 | 61 | 0.707269 | # Generated by Django 2.2.13 on 2020-07-23 16:13
from django.db import migrations
def create_waffle_switch(apps, schema_editor):
Switch = apps.get_model('waffle', 'Switch')
Switch.objects.create(
name='use-bigquery-for-download-stats-cron',
active=False,
note='Use BigQuery in download... | 239 | 139 | 46 |
800e3537aea3f08140b4b85867fd724bf0b52669 | 1,055 | py | Python | mmaction/models/losses/__init__.py | ovshake/mmaction2 | 71e92e9d4c28190d485ba153aae5200bf71f70b1 | [
"Apache-2.0"
] | null | null | null | mmaction/models/losses/__init__.py | ovshake/mmaction2 | 71e92e9d4c28190d485ba153aae5200bf71f70b1 | [
"Apache-2.0"
] | null | null | null | mmaction/models/losses/__init__.py | ovshake/mmaction2 | 71e92e9d4c28190d485ba153aae5200bf71f70b1 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) OpenMMLab. All rights reserved.
from .base import BaseWeightedLoss
from .binary_logistic_regression_loss import BinaryLogisticRegressionLoss
from .bmn_loss import BMNLoss
from .cross_entropy_loss import BCELossWithLogits, CrossEntropyLoss
from .hvu_loss import HVULoss
from .nll_loss import NLLLoss
from ... | 50.238095 | 149 | 0.842654 | # Copyright (c) OpenMMLab. All rights reserved.
from .base import BaseWeightedLoss
from .binary_logistic_regression_loss import BinaryLogisticRegressionLoss
from .bmn_loss import BMNLoss
from .cross_entropy_loss import BCELossWithLogits, CrossEntropyLoss
from .hvu_loss import HVULoss
from .nll_loss import NLLLoss
from ... | 0 | 0 | 0 |
77675869986e0085d26d2e304c0a479a6582a179 | 4,449 | py | Python | app/__init__.py | IEEEComputerSocietyUNB/app-perdidos | 92497b876b5eef874b390ace926c222155e9ceec | [
"MIT"
] | null | null | null | app/__init__.py | IEEEComputerSocietyUNB/app-perdidos | 92497b876b5eef874b390ace926c222155e9ceec | [
"MIT"
] | 13 | 2021-03-14T17:21:09.000Z | 2021-03-14T17:56:03.000Z | app/__init__.py | IEEEComputerSocietyUNB/app-perdidos | 92497b876b5eef874b390ace926c222155e9ceec | [
"MIT"
] | null | null | null | from flask import Flask, render_template, url_for, request, redirect, send_from_directory, session, flash
from functools import wraps
from .db import init_db
from .models.object import Object
from .controllers.object import ObjectController
from .controllers.user import UserController
from flask import jsonify
| 26.963636 | 105 | 0.612272 | from flask import Flask, render_template, url_for, request, redirect, send_from_directory, session, flash
from functools import wraps
from .db import init_db
from .models.object import Object
from .controllers.object import ObjectController
from .controllers.user import UserController
from flask import jsonify
def cr... | 4,115 | 0 | 23 |
77e0586d04fc6b5bd498ff7eda396fdc0f889dc1 | 96 | py | Python | venv/lib/python3.8/site-packages/poetry/utils/password_manager.py | Retraces/UkraineBot | 3d5d7f8aaa58fa0cb8b98733b8808e5dfbdb8b71 | [
"MIT"
] | 2 | 2022-03-13T01:58:52.000Z | 2022-03-31T06:07:54.000Z | venv/lib/python3.8/site-packages/poetry/utils/password_manager.py | DesmoSearch/Desmobot | b70b45df3485351f471080deb5c785c4bc5c4beb | [
"MIT"
] | 19 | 2021-11-20T04:09:18.000Z | 2022-03-23T15:05:55.000Z | venv/lib/python3.8/site-packages/poetry/utils/password_manager.py | DesmoSearch/Desmobot | b70b45df3485351f471080deb5c785c4bc5c4beb | [
"MIT"
] | null | null | null | /home/runner/.cache/pip/pool/3a/e8/d9/6b866f26f3d0047a518cb59b619be509f29a97d30cbaa9657343abd771 | 96 | 96 | 0.895833 | /home/runner/.cache/pip/pool/3a/e8/d9/6b866f26f3d0047a518cb59b619be509f29a97d30cbaa9657343abd771 | 0 | 0 | 0 |
b7060bcb1857418d2ea9deaaa1621e5bdb64a900 | 25,094 | py | Python | Part-03-Understanding-Software-Crafting-Your-Own-Tools/models/edx-platform/openedx/core/djangoapps/user_api/accounts/serializers.py | osoco/better-ways-of-thinking-about-software | 83e70d23c873509e22362a09a10d3510e10f6992 | [
"MIT"
] | 3 | 2021-12-15T04:58:18.000Z | 2022-02-06T12:15:37.000Z | Part-03-Understanding-Software-Crafting-Your-Own-Tools/models/edx-platform/openedx/core/djangoapps/user_api/accounts/serializers.py | osoco/better-ways-of-thinking-about-software | 83e70d23c873509e22362a09a10d3510e10f6992 | [
"MIT"
] | null | null | null | Part-03-Understanding-Software-Crafting-Your-Own-Tools/models/edx-platform/openedx/core/djangoapps/user_api/accounts/serializers.py | osoco/better-ways-of-thinking-about-software | 83e70d23c873509e22362a09a10d3510e10f6992 | [
"MIT"
] | 1 | 2019-01-02T14:38:50.000Z | 2019-01-02T14:38:50.000Z | """
Django REST Framework serializers for the User API Accounts sub-application
"""
import json
import logging
import re
from django.conf import settings
from django.contrib.auth.models import User # lint-amnesty, pylint: disable=imported-auth-user
from django.core.exceptions import ObjectDoesNotExist
from django.u... | 39.64297 | 124 | 0.676895 | """
Django REST Framework serializers for the User API Accounts sub-application
"""
import json
import logging
import re
from django.conf import settings
from django.contrib.auth.models import User # lint-amnesty, pylint: disable=imported-auth-user
from django.core.exceptions import ObjectDoesNotExist
from django.u... | 845 | 1,265 | 426 |
c05dfe4ef31302a3269efbac97cf25db20c3b395 | 2,399 | py | Python | tests/test_utils.py | noelhx/organize | d3eb2fe9d67e79f2b16b795aa923efcbfb3d9fb3 | [
"MIT"
] | null | null | null | tests/test_utils.py | noelhx/organize | d3eb2fe9d67e79f2b16b795aa923efcbfb3d9fb3 | [
"MIT"
] | null | null | null | tests/test_utils.py | noelhx/organize | d3eb2fe9d67e79f2b16b795aa923efcbfb3d9fb3 | [
"MIT"
] | null | null | null | from organize.utils import Path, find_unused_filename, splitglob, increment_filename_version
| 34.768116 | 92 | 0.654856 | from organize.utils import Path, find_unused_filename, splitglob, increment_filename_version
def test_splitglob():
assert splitglob('~/Downloads') == (Path.home() / 'Downloads', '')
assert (
splitglob('/Test/\* tmp\*/*[!H]/**/*.*') ==
(Path('/Test/\* tmp\*'), '*[!H]/**/*.*'))
assert (
... | 2,090 | 0 | 207 |
f8fca3440139ea2fefeb145c13dad62f93de1cce | 4,767 | py | Python | calibration_tool/correspondence/correspondence.py | liwen-deepmotion/map_based_lidar_camera_calibration_tool | d260380729b05b153c2efd1e76d4ae077c48c4b1 | [
"MIT"
] | 26 | 2021-04-24T08:07:20.000Z | 2022-03-13T15:21:02.000Z | calibration_tool/correspondence/correspondence.py | Grandzxw/map_based_lidar_camera_calibration_tool | d260380729b05b153c2efd1e76d4ae077c48c4b1 | [
"MIT"
] | null | null | null | calibration_tool/correspondence/correspondence.py | Grandzxw/map_based_lidar_camera_calibration_tool | d260380729b05b153c2efd1e76d4ae077c48c4b1 | [
"MIT"
] | 9 | 2021-04-19T23:32:21.000Z | 2022-03-03T06:31:19.000Z | from typing import Dict
import numpy as np
from actor.correspondence_actor import CorrespondenceActor
from shape.point_2d import Point2D
from shape.polyline_2d import Polyline2D
from shape.shape import Shape
| 34.294964 | 128 | 0.623872 | from typing import Dict
import numpy as np
from actor.correspondence_actor import CorrespondenceActor
from shape.point_2d import Point2D
from shape.polyline_2d import Polyline2D
from shape.shape import Shape
class Correspondence(object):
def __init__(self, shape: Shape = None,
reprojected_shap... | 4,040 | 8 | 509 |
c14b091cf5862855f63fbbe263409ba8262d2632 | 12,598 | py | Python | cclp/neuralnet/trainers/trainers.py | Kamnitsask/ssl_compact_clustering | 19938d295493f6c9f2c19a60ccb1bb9a3596906c | [
"Apache-2.0"
] | 61 | 2019-06-06T19:22:14.000Z | 2022-03-24T01:38:59.000Z | cclp/neuralnet/trainers/trainers.py | Kamnitsask/ssl_compact_clustering | 19938d295493f6c9f2c19a60ccb1bb9a3596906c | [
"Apache-2.0"
] | 3 | 2019-07-22T14:24:55.000Z | 2020-09-30T09:15:34.000Z | cclp/neuralnet/trainers/trainers.py | Kamnitsask/ssl_compact_clustering | 19938d295493f6c9f2c19a60ccb1bb9a3596906c | [
"Apache-2.0"
] | 10 | 2019-06-06T18:41:27.000Z | 2022-03-24T01:39:13.000Z | #!/usr/bin/env python
# Copyright (c) 2018, Konstantinos Kamnitsas
#
# This program is free software; you can redistribute and/or modify
# it under the terms of the Apache License, Version 2.0. See the
# accompanying LICENSE file or read the terms at:
# http://www.apache.org/licenses/LICENSE-2.0
from __future__ impo... | 54.301724 | 230 | 0.656057 | #!/usr/bin/env python
# Copyright (c) 2018, Konstantinos Kamnitsas
#
# This program is free software; you can redistribute and/or modify
# it under the terms of the Apache License, Version 2.0. See the
# accompanying LICENSE file or read the terms at:
# http://www.apache.org/licenses/LICENSE-2.0
from __future__ impo... | 11,708 | 1 | 235 |
2a69b09f93d4e645ddd5130d2759a0551e9cb112 | 9,363 | py | Python | PyEvolv/grid_creator/grid_creator.py | peerlator/PyEvolv | 7f5644e2ea22257f34547c9b050bc4cdd4f3bdec | [
"MIT"
] | 1 | 2018-08-02T19:42:35.000Z | 2018-08-02T19:42:35.000Z | PyEvolv/grid_creator/grid_creator.py | peerlator/PyEvolv | 7f5644e2ea22257f34547c9b050bc4cdd4f3bdec | [
"MIT"
] | 1 | 2018-08-02T19:41:58.000Z | 2018-08-05T17:53:17.000Z | PyEvolv/grid_creator/grid_creator.py | peerlator/PyEvolv | 7f5644e2ea22257f34547c9b050bc4cdd4f3bdec | [
"MIT"
] | null | null | null | import pygame
import numpy as np
import colorsys
from typing import List, Union, Tuple
import os
from PyEvolv.grid_creator.Sidebar import Sidebar
from PyEvolv.assets.font import FONT | 47.770408 | 281 | 0.610061 | import pygame
import numpy as np
import colorsys
from typing import List, Union, Tuple
import os
from PyEvolv.grid_creator.Sidebar import Sidebar
from PyEvolv.assets.font import FONT
class GridCreator:
def __init__(self,display_width:int, display_height:int, grid:np.ndarray, grids_path:str, relatives_on_screen:int... | 142 | 9,016 | 23 |
69e1c7f030fdae6cc022477307bb6b668d3bc021 | 2,726 | py | Python | api/Random_positions.py | TeaBreak-Tech/funtube_be | c244739fb4b9cced244cea4717bde3f09f8d86cf | [
"MIT"
] | null | null | null | api/Random_positions.py | TeaBreak-Tech/funtube_be | c244739fb4b9cced244cea4717bde3f09f8d86cf | [
"MIT"
] | null | null | null | api/Random_positions.py | TeaBreak-Tech/funtube_be | c244739fb4b9cced244cea4717bde3f09f8d86cf | [
"MIT"
] | null | null | null | #import util_preparation as up
import pandas as pd
import random
import os
import csv
from .models import *
PREVENT_DURATION = 60
START_PREVENT_DURATION = 120
END_PREVENT_DURATION = 120
| 29.956044 | 100 | 0.573001 | #import util_preparation as up
import pandas as pd
import random
import os
import csv
from .models import *
PREVENT_DURATION = 60
START_PREVENT_DURATION = 120
END_PREVENT_DURATION = 120
def generagte_random_ads(video_id,N_ADS=3):
# 确定插入的广告
# 可用广告在 ad_urls.csv 里查询
ads = []
ads = [[ad.ad_id, ad.href,... | 2,662 | 0 | 23 |
5f7d6c5925fe4e52b86831fe3e20e0cbb51570a3 | 4,646 | py | Python | temboo/core/Library/Box/Files/ZipFile.py | jordanemedlock/psychtruths | 52e09033ade9608bd5143129f8a1bfac22d634dd | [
"Apache-2.0"
] | 7 | 2016-03-07T02:07:21.000Z | 2022-01-21T02:22:41.000Z | temboo/core/Library/Box/Files/ZipFile.py | jordanemedlock/psychtruths | 52e09033ade9608bd5143129f8a1bfac22d634dd | [
"Apache-2.0"
] | null | null | null | temboo/core/Library/Box/Files/ZipFile.py | jordanemedlock/psychtruths | 52e09033ade9608bd5143129f8a1bfac22d634dd | [
"Apache-2.0"
] | 8 | 2016-06-14T06:01:11.000Z | 2020-04-22T09:21:44.000Z | # -*- coding: utf-8 -*-
###############################################################################
#
# ZipFile
# Creates a zipped version of the specified Box file and returns a link to the new compressed file.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License... | 40.754386 | 206 | 0.674774 | # -*- coding: utf-8 -*-
###############################################################################
#
# ZipFile
# Creates a zipped version of the specified Box file and returns a link to the new compressed file.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License... | 312 | 424 | 100 |
2374e49774cc023c7ed6620b6560ab93b1236fd8 | 1,009 | py | Python | telegram_addons/conversationhandlerext.py | LaFa777/python-telegram-bot-addons | 55c48ada4c83df2b2ec75f00e819f8928149f8cd | [
"Apache-2.0"
] | null | null | null | telegram_addons/conversationhandlerext.py | LaFa777/python-telegram-bot-addons | 55c48ada4c83df2b2ec75f00e819f8928149f8cd | [
"Apache-2.0"
] | null | null | null | telegram_addons/conversationhandlerext.py | LaFa777/python-telegram-bot-addons | 55c48ada4c83df2b2ec75f00e819f8928149f8cd | [
"Apache-2.0"
] | null | null | null | from telegram.ext import ConversationHandler
class ConversationHandlerExt(ConversationHandler):
"""Расширяет оригинальный :class:`telegram.ext.ConversationHandler` возможностью вручную
установить `state`. Переопределяет конструктор, теперь обязателен только 1 параметр (states).
"""
def set_state(self... | 32.548387 | 97 | 0.622398 | from telegram.ext import ConversationHandler
class ConversationHandlerExt(ConversationHandler):
"""Расширяет оригинальный :class:`telegram.ext.ConversationHandler` возможностью вручную
установить `state`. Переопределяет конструктор, теперь обязателен только 1 параметр (states).
"""
def __init__(self,... | 277 | 0 | 27 |
68408fe7a5c1690df451641f4565f48305c8e19c | 830 | py | Python | src/compas_ghpython/artists/pointartist.py | GeneKao/compas | eb6b5dc928236477d5d0fa1561e26dda6296f019 | [
"MIT"
] | null | null | null | src/compas_ghpython/artists/pointartist.py | GeneKao/compas | eb6b5dc928236477d5d0fa1561e26dda6296f019 | [
"MIT"
] | null | null | null | src/compas_ghpython/artists/pointartist.py | GeneKao/compas | eb6b5dc928236477d5d0fa1561e26dda6296f019 | [
"MIT"
] | null | null | null | from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
import compas_ghpython
from compas.artists import PrimitiveArtist
from .artist import GHArtist
class PointArtist(GHArtist, PrimitiveArtist):
"""Artist for drawing points.
Parameters
----------
... | 23.714286 | 68 | 0.659036 | from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
import compas_ghpython
from compas.artists import PrimitiveArtist
from .artist import GHArtist
class PointArtist(GHArtist, PrimitiveArtist):
"""Artist for drawing points.
Parameters
----------
... | 128 | 0 | 53 |
9ec102cb665e7539c5fa44c0ec648ab7542b5df8 | 167 | py | Python | imagetext.py | downthecrop/python-text-from-image | d4c79e38ad7a938c17ad94554a5d5dad59991930 | [
"BSD-2-Clause"
] | null | null | null | imagetext.py | downthecrop/python-text-from-image | d4c79e38ad7a938c17ad94554a5d5dad59991930 | [
"BSD-2-Clause"
] | null | null | null | imagetext.py | downthecrop/python-text-from-image | d4c79e38ad7a938c17ad94554a5d5dad59991930 | [
"BSD-2-Clause"
] | null | null | null | ##Requires PIL (Pillow), and pytesseract
from PIL import Image
from pytesseract import image_to_string
img=Image.open('test.png')
print(image_to_string(img)) | 20.875 | 41 | 0.760479 | ##Requires PIL (Pillow), and pytesseract
from PIL import Image
from pytesseract import image_to_string
img=Image.open('test.png')
print(image_to_string(img)) | 0 | 0 | 0 |
ba109537d1c09b462c5c8821fa653a5b7cfb8c0a | 2,744 | py | Python | covid19-etl/etl/bayes_model_workflow.py | West-Loop-Strategy/covid19-tools | a8f30c97fbc5d4e775003fea95cb57f5df88332a | [
"Apache-2.0"
] | null | null | null | covid19-etl/etl/bayes_model_workflow.py | West-Loop-Strategy/covid19-tools | a8f30c97fbc5d4e775003fea95cb57f5df88332a | [
"Apache-2.0"
] | null | null | null | covid19-etl/etl/bayes_model_workflow.py | West-Loop-Strategy/covid19-tools | a8f30c97fbc5d4e775003fea95cb57f5df88332a | [
"Apache-2.0"
] | null | null | null | from datetime import datetime
import requests
import time
from etl import base
from utils.fence_helper import get_api_key, get_access_token
| 39.768116 | 114 | 0.622449 | from datetime import datetime
import requests
import time
from etl import base
from utils.fence_helper import get_api_key, get_access_token
class BAYES_MODEL_WORKFLOW(base.BaseETL):
def __init__(self, base_url, access_token, s3_bucket):
super().__init__(base_url, access_token, s3_bucket)
self.hea... | 2,479 | 20 | 103 |
5e646af002eec7affa6c340d69f3649382ec6a9a | 17,625 | py | Python | shape_recognition/libraries/UR10/UR10.py | ys1998/tactile-shape-recognition | b5ab6f1cdf04ff23e14b467a590533e7ee740b52 | [
"MIT"
] | null | null | null | shape_recognition/libraries/UR10/UR10.py | ys1998/tactile-shape-recognition | b5ab6f1cdf04ff23e14b467a590533e7ee740b52 | [
"MIT"
] | null | null | null | shape_recognition/libraries/UR10/UR10.py | ys1998/tactile-shape-recognition | b5ab6f1cdf04ff23e14b467a590533e7ee740b52 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
'''
#-------------------------------------------------------------------------------
# NATIONAL UNIVERSITY OF SINGAPORE - NUS
# SINGAPORE INSTITUTE FOR NEUROTECHNOLOGY - SINAPSE
# Singapore
# URL: http://www.sinapseinstitute.org
#-----------------------------------------------------------... | 31.756757 | 198 | 0.549787 | # -*- coding: utf-8 -*-
'''
#-------------------------------------------------------------------------------
# NATIONAL UNIVERSITY OF SINGAPORE - NUS
# SINGAPORE INSTITUTE FOR NEUROTECHNOLOGY - SINAPSE
# Singapore
# URL: http://www.sinapseinstitute.org
#-----------------------------------------------------------... | 11,431 | 1 | 776 |
072d2914c7508a4a27885c88e7923aafdfe723a6 | 4,133 | py | Python | src/rlmamr/my_env/capture_target_MA_core.py | yuchen-x/CoRL2019 | d482a90441bc8eb0461f1f22fbd65d96584f6914 | [
"MIT"
] | 2 | 2020-02-05T04:17:03.000Z | 2021-05-24T04:07:36.000Z | src/rlmamr/my_env/capture_target_MA_core.py | yuchen-x/CoRL2019 | d482a90441bc8eb0461f1f22fbd65d96584f6914 | [
"MIT"
] | null | null | null | src/rlmamr/my_env/capture_target_MA_core.py | yuchen-x/CoRL2019 | d482a90441bc8eb0461f1f22fbd65d96584f6914 | [
"MIT"
] | null | null | null | #!/usr/bin/python
import numpy as np
import IPython
from IPython.core.debugger import set_trace
NORTH = np.array([0, 1])
SOUTH = np.array([0, -1])
WEST = np.array([-1, 0])
EAST = np.array([1, 0])
STAY = np.array([0, 0])
TRANSLATION_TABLE = [
# [left, intended_direction, right]
[WEST, NORTH, EAST],
[EAS... | 33.064 | 140 | 0.581176 | #!/usr/bin/python
import numpy as np
import IPython
from IPython.core.debugger import set_trace
NORTH = np.array([0, 1])
SOUTH = np.array([0, -1])
WEST = np.array([-1, 0])
EAST = np.array([1, 0])
STAY = np.array([0, 0])
TRANSLATION_TABLE = [
# [left, intended_direction, right]
[WEST, NORTH, EAST],
[EAS... | 1,637 | 0 | 223 |
87af048da678fa17419acdfe0ee36bfcb3064335 | 4,026 | py | Python | src/python/packages/study/__main__.py | djrlj694/nyc-taxi-analysis | 0d62cc56594ef9260580c9e6c203e9fbde6fee24 | [
"MIT"
] | null | null | null | src/python/packages/study/__main__.py | djrlj694/nyc-taxi-analysis | 0d62cc56594ef9260580c9e6c203e9fbde6fee24 | [
"MIT"
] | null | null | null | src/python/packages/study/__main__.py | djrlj694/nyc-taxi-analysis | 0d62cc56594ef9260580c9e6c203e9fbde6fee24 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""
__main__.py - The main module for processing data and creating visual summaries
for this study.
"""
import os
import sys
from pathlib import Path
import etl
import pandas as pd
import ui.cli as cli
from file import YAMLFile
# ================================================================... | 22.617978 | 79 | 0.513164 | #!/usr/bin/env python3
"""
__main__.py - The main module for processing data and creating visual summaries
for this study.
"""
import os
import sys
from pathlib import Path
import etl
import pandas as pd
import ui.cli as cli
from file import YAMLFile
# ================================================================... | 871 | 0 | 115 |
dcfb93be50b868f85e2e53dee2d5dd941c95ec50 | 4,100 | py | Python | ssa_sim_v2/simulator/modules/auction_attributes/auction_attributes_base_module.py | donghun2018/adclick-simulator-v2 | ade886e9dcbde9fcea218a19f0130cc09f81e55e | [
"MIT"
] | null | null | null | ssa_sim_v2/simulator/modules/auction_attributes/auction_attributes_base_module.py | donghun2018/adclick-simulator-v2 | ade886e9dcbde9fcea218a19f0130cc09f81e55e | [
"MIT"
] | null | null | null | ssa_sim_v2/simulator/modules/auction_attributes/auction_attributes_base_module.py | donghun2018/adclick-simulator-v2 | ade886e9dcbde9fcea218a19f0130cc09f81e55e | [
"MIT"
] | null | null | null | # Fix paths for imports to work in unit tests ----------------
if __name__ == "__main__":
from _fix_paths import fix_paths
fix_paths()
# ------------------------------------------------------------
# Load libraries ---------------------------------------------
from typing import Dict
import numpy as np
f... | 33.606557 | 152 | 0.596098 | # Fix paths for imports to work in unit tests ----------------
if __name__ == "__main__":
from _fix_paths import fix_paths
fix_paths()
# ------------------------------------------------------------
# Load libraries ---------------------------------------------
from typing import Dict
import numpy as np
f... | 912 | 27 | 57 |
348061fbd3722432b2a2937544c82aef93786355 | 232 | py | Python | src/cloudio/exception/invalid_cloudio_attribute_type_exception.py | michaelFavre/cloudio-endpoint-python | c00f7cc0578d1974d47fbab5a97a3239fcb99084 | [
"MIT"
] | null | null | null | src/cloudio/exception/invalid_cloudio_attribute_type_exception.py | michaelFavre/cloudio-endpoint-python | c00f7cc0578d1974d47fbab5a97a3239fcb99084 | [
"MIT"
] | null | null | null | src/cloudio/exception/invalid_cloudio_attribute_type_exception.py | michaelFavre/cloudio-endpoint-python | c00f7cc0578d1974d47fbab5a97a3239fcb99084 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*- | 46.4 | 122 | 0.732759 | # -*- coding: utf-8 -*-
class InvalidCloudioAttributeTypeException(Exception):
def __init__(self, type):
super(InvalidCloudioAttributeTypeException, self).__init__(str(type) + ' is not a valid cloud.io attribute type!') | 127 | 33 | 49 |
603e4e67758efe34205d8f7d4feea0a544dec0f7 | 3,871 | py | Python | openchat/agents/unlikelihood.py | mgorkove/openchat | 6dbf289e510e5adc10d98d30fcbf2338b8290eef | [
"Apache-2.0"
] | 8 | 2021-03-12T05:30:22.000Z | 2022-01-26T09:36:40.000Z | openchat/agents/unlikelihood.py | mgorkove/openchat | 6dbf289e510e5adc10d98d30fcbf2338b8290eef | [
"Apache-2.0"
] | null | null | null | openchat/agents/unlikelihood.py | mgorkove/openchat | 6dbf289e510e5adc10d98d30fcbf2338b8290eef | [
"Apache-2.0"
] | 3 | 2021-09-23T02:33:11.000Z | 2022-01-18T18:59:18.000Z | import importlib
from parlai.core.agents import add_datapath_and_model_args
from parlai.core.build_data import modelzoo_path
from openchat.utils import (
inherit,
create_agent_from_opt_file_and_model_class,
)
from openchat.base import (
ParlaiGenerationAgent,
Seq2SeqLM,
ConvAI2Agent,
WizardOf... | 33.66087 | 65 | 0.61302 | import importlib
from parlai.core.agents import add_datapath_and_model_args
from parlai.core.build_data import modelzoo_path
from openchat.utils import (
inherit,
create_agent_from_opt_file_and_model_class,
)
from openchat.base import (
ParlaiGenerationAgent,
Seq2SeqLM,
ConvAI2Agent,
WizardOf... | 3,328 | 181 | 23 |
b11059298c8234b3e10476c7c2a4e80a7072ec74 | 1,085 | py | Python | src/account/migrations/0002_auto_20200412_1356.py | kravchenko89/test | 9eb43e6e96ec198fa433c775f1ffa0f02022e6e4 | [
"MIT"
] | null | null | null | src/account/migrations/0002_auto_20200412_1356.py | kravchenko89/test | 9eb43e6e96ec198fa433c775f1ffa0f02022e6e4 | [
"MIT"
] | 6 | 2021-03-19T10:08:06.000Z | 2022-02-10T14:03:57.000Z | src/account/migrations/0002_auto_20200412_1356.py | kravchenko89/test | 9eb43e6e96ec198fa433c775f1ffa0f02022e6e4 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.10 on 2020-04-12 13:56
import django.core.validators
from django.db import migrations, models
import django_countries.fields
| 30.138889 | 191 | 0.582488 | # Generated by Django 2.2.10 on 2020-04-12 13:56
import django.core.validators
from django.db import migrations, models
import django_countries.fields
class Migration(migrations.Migration):
dependencies = [
('account', '0001_initial'),
]
operations = [
migrations.AddField(
m... | 0 | 909 | 23 |
d34c7fe1bde2e41f49f5f3ca9ebb728a7f0a3605 | 1,570 | py | Python | model_lstm/setup.py | ofbennett/sentiment-analysis-app | 94362ae3e638daeec29e09065549fd4078af8a1a | [
"MIT"
] | 2 | 2020-10-04T16:58:54.000Z | 2021-10-04T13:51:10.000Z | model_lstm/setup.py | ofbennett/sentiment-analysis-app | 94362ae3e638daeec29e09065549fd4078af8a1a | [
"MIT"
] | null | null | null | model_lstm/setup.py | ofbennett/sentiment-analysis-app | 94362ae3e638daeec29e09065549fd4078af8a1a | [
"MIT"
] | null | null | null | from setuptools import find_packages, setup
from pathlib import Path
NAME = 'model_lstm'
DESCRIPTION = 'LSTM model which classifies the sentiment of English sentences.'
URL = 'https://github.com/ofbennett/sentiment-analysis-app'
EMAIL = 'contact.me.ob@gmail.com'
AUTHOR = 'Oscar Bennett'
REQUIRES_PYTHON = '>=3.7.0'
ROO... | 34.130435 | 82 | 0.652229 | from setuptools import find_packages, setup
from pathlib import Path
NAME = 'model_lstm'
DESCRIPTION = 'LSTM model which classifies the sentiment of English sentences.'
URL = 'https://github.com/ofbennett/sentiment-analysis-app'
EMAIL = 'contact.me.ob@gmail.com'
AUTHOR = 'Oscar Bennett'
REQUIRES_PYTHON = '>=3.7.0'
ROO... | 85 | 0 | 23 |
70753e98dbe35bdd622af25516015fa34134b692 | 4,757 | py | Python | domains/domains/ple/ple_env.py | ramya-ram/discovering-blind-spots | 091de837663ff3b0208ea90df9ce7a9eeb6343fe | [
"MIT"
] | null | null | null | domains/domains/ple/ple_env.py | ramya-ram/discovering-blind-spots | 091de837663ff3b0208ea90df9ce7a9eeb6343fe | [
"MIT"
] | null | null | null | domains/domains/ple/ple_env.py | ramya-ram/discovering-blind-spots | 091de837663ff3b0208ea90df9ce7a9eeb6343fe | [
"MIT"
] | 3 | 2020-03-13T18:35:31.000Z | 2020-07-20T03:24:37.000Z | import gym
from gym import spaces
from ple import PLE
import numpy as np | 38.056 | 134 | 0.64074 | import gym
from gym import spaces
from ple import PLE
import numpy as np
def process_state_prespecified(state):
return np.array([ state.values() ])
def process_state(state):
return np.array(state)
class PLEEnv(gym.Env):
metadata = {'render.modes': ['human', 'rgb_array']}
def __init__(self, prespecif... | 4,167 | 449 | 69 |
d720558039425b7b46dedfcf73d7c8783c9496cd | 579 | py | Python | Python/Fundamentals/io_switch.py | Gjacquenot/training-material | 16b29962bf5683f97a1072d961dd9f31e7468b8d | [
"CC-BY-4.0"
] | 115 | 2015-03-23T13:34:42.000Z | 2022-03-21T00:27:21.000Z | Python/Fundamentals/io_switch.py | Gjacquenot/training-material | 16b29962bf5683f97a1072d961dd9f31e7468b8d | [
"CC-BY-4.0"
] | 56 | 2015-02-25T15:04:26.000Z | 2022-01-03T07:42:48.000Z | Python/Fundamentals/io_switch.py | Gjacquenot/training-material | 16b29962bf5683f97a1072d961dd9f31e7468b8d | [
"CC-BY-4.0"
] | 59 | 2015-11-26T11:44:51.000Z | 2022-03-21T00:27:22.000Z | #!/usr/bin/env python
if __name__ == '__main__':
from argparse import ArgumentParser
from io import StringIO
import sys
arg_parser = ArgumentParser(description='I/O test')
arg_parser.add_argument('-o', dest='output', help='output file')
options = arg_parser.parse_args()
str_io = StringIO()
... | 28.95 | 68 | 0.632124 | #!/usr/bin/env python
if __name__ == '__main__':
from argparse import ArgumentParser
from io import StringIO
import sys
arg_parser = ArgumentParser(description='I/O test')
arg_parser.add_argument('-o', dest='output', help='output file')
options = arg_parser.parse_args()
str_io = StringIO()
... | 0 | 0 | 0 |
9df7df112f519136b1e342846112fa1c98437980 | 4,102 | py | Python | app.py | banana-breads/SmartOven | d5a79a77ceca6269252d27b350d6d6ccd76f3000 | [
"MIT"
] | 3 | 2022-01-30T18:00:26.000Z | 2022-01-30T18:03:34.000Z | app.py | banana-breads/SmartOven | d5a79a77ceca6269252d27b350d6d6ccd76f3000 | [
"MIT"
] | 10 | 2022-01-30T21:06:40.000Z | 2022-02-03T09:42:36.000Z | app.py | banana-breads/SmartOven | d5a79a77ceca6269252d27b350d6d6ccd76f3000 | [
"MIT"
] | 1 | 2022-02-01T12:48:05.000Z | 2022-02-01T12:48:05.000Z | import json
from flask import Flask
from flasgger import Swagger
from globals import connected_devices, Oven
import os
import recipes
import ovens
import recipe_search_online
import db
from mqtt_shared import mqtt_manager, mqtt_topics
from constants import MONGO_URI, MONGO_URI_TEST
import argparse
fro... | 29.941606 | 75 | 0.627986 | import json
from flask import Flask
from flasgger import Swagger
from globals import connected_devices, Oven
import os
import recipes
import ovens
import recipe_search_online
import db
from mqtt_shared import mqtt_manager, mqtt_topics
from constants import MONGO_URI, MONGO_URI_TEST
import argparse
fro... | 3,227 | 0 | 75 |
cfebce4ce5effba03e6fe213972dd94622cfecd1 | 511 | py | Python | msg_90s_celular_20_02_2019/converte_num_letra.py | python-joinville/dojo-puzzles | 412d8d3443b2cdb492fa9a77c08a876a182994ee | [
"MIT"
] | 3 | 2018-07-31T19:49:43.000Z | 2019-06-28T20:52:58.000Z | msg_90s_celular_20_02_2019/converte_num_letra.py | python-joinville/dojo-puzzles | 412d8d3443b2cdb492fa9a77c08a876a182994ee | [
"MIT"
] | null | null | null | msg_90s_celular_20_02_2019/converte_num_letra.py | python-joinville/dojo-puzzles | 412d8d3443b2cdb492fa9a77c08a876a182994ee | [
"MIT"
] | 1 | 2018-07-28T19:36:48.000Z | 2018-07-28T19:36:48.000Z | tabela = {'2': 'a',
'3':'d',
'5':'j',
'4':'g',
'6':'m',
'7':'p',
'8':'t',
'9': 'w',
'0': ' ',
}
| 22.217391 | 47 | 0.403131 | tabela = {'2': 'a',
'3':'d',
'5':'j',
'4':'g',
'6':'m',
'7':'p',
'8':'t',
'9': 'w',
'0': ' ',
}
def converte_num_letra(digitos):
palavra = ''
letra = ''
sequencia = ''
for digito in digitos:
if letra != '' and digi... | 311 | 0 | 23 |
494aaca2f4ace6c6bc7d69520a23e5deddd3db65 | 720 | py | Python | src/Chapter 3/Exercise 7.py | group9BSE1/BSE-2021 | bea904fce079b856c26f8c06bd734176bdc4d70d | [
"MIT"
] | 1 | 2021-03-27T19:01:49.000Z | 2021-03-27T19:01:49.000Z | src/Chapter 3/Exercise 7.py | group9BSE1/BSE-2021 | bea904fce079b856c26f8c06bd734176bdc4d70d | [
"MIT"
] | null | null | null | src/Chapter 3/Exercise 7.py | group9BSE1/BSE-2021 | bea904fce079b856c26f8c06bd734176bdc4d70d | [
"MIT"
] | null | null | null | # location
location = input("Job Location:\n")
pay = input("Payment:\n")
# Prints For decisions
no = "No thanks,I can find something Better"
doubt = "Without a doubt I'll take it"
sure = "Sure, I can work with that"
no_way = "No way!"
# Try and Except
try:
location = str(location)
pay = float(pay)
except:
... | 21.176471 | 44 | 0.594444 | # location
location = input("Job Location:\n")
pay = input("Payment:\n")
# Prints For decisions
no = "No thanks,I can find something Better"
doubt = "Without a doubt I'll take it"
sure = "Sure, I can work with that"
no_way = "No way!"
# Try and Except
try:
location = str(location)
pay = float(pay)
except:
... | 0 | 0 | 0 |
ac9894d149ca837137178fd7b2aa80f309e87fd9 | 1,985 | py | Python | simple_rest_client/api.py | allisson/python-simple-rest-client | c5b9a4848adac78212b86ebb736e51e8b50e64d8 | [
"MIT"
] | 163 | 2017-04-13T21:24:12.000Z | 2022-02-21T04:55:47.000Z | simple_rest_client/api.py | allisson/python-simple-rest-client | c5b9a4848adac78212b86ebb736e51e8b50e64d8 | [
"MIT"
] | 39 | 2017-08-02T14:46:12.000Z | 2021-12-10T12:57:29.000Z | simple_rest_client/api.py | allisson/python-simple-rest-client | c5b9a4848adac78212b86ebb736e51e8b50e64d8 | [
"MIT"
] | 50 | 2017-06-05T22:39:52.000Z | 2021-12-26T21:09:52.000Z | from slugify import slugify
from .resource import Resource
| 33.644068 | 105 | 0.652393 | from slugify import slugify
from .resource import Resource
class API:
def __init__(
self,
api_root_url=None,
params=None,
headers=None,
timeout=None,
append_slash=False,
json_encode_body=False,
ssl_verify=None,
):
self.api_root_url = api... | 1,805 | -11 | 130 |
c64480096569db772606bfc626022fbec11fab93 | 1,753 | py | Python | broker-manager/SearchDate.py | victor-prado/broker-manager | b056cf59247e41e890b1443c0c9e44832b79c51a | [
"MIT"
] | null | null | null | broker-manager/SearchDate.py | victor-prado/broker-manager | b056cf59247e41e890b1443c0c9e44832b79c51a | [
"MIT"
] | null | null | null | broker-manager/SearchDate.py | victor-prado/broker-manager | b056cf59247e41e890b1443c0c9e44832b79c51a | [
"MIT"
] | null | null | null | import tkinter as tk
from Data import Data
from EditClient import EditClient
#Arrumar!
#root = tk.Tk()
#app = SearchDate(master=root)
#app.mainloop()
#data = Data()
#data.db.close()
| 28.274194 | 77 | 0.541928 | import tkinter as tk
from Data import Data
from EditClient import EditClient
class SearchDate(tk.Frame, Data):
def __init__(self, master=None):
super().__init__(master)
self.frame = tk.Frame(self.master)
self.frame.grid()
self.create_table()
def create_entry(self, row_value, m... | 1,399 | 12 | 158 |
2d82e8a5afd34b19a82dd079954acdf19ab0b1a0 | 467 | py | Python | lego-catalog/backend/resources/scripts/populate_dynamodb.py | neovasili/101_serverless_workshop | a005ab4af620c3c1a522aab8d201378ea7840ab5 | [
"MIT"
] | 4 | 2019-11-13T17:58:15.000Z | 2020-03-12T12:24:10.000Z | lego-catalog/backend/resources/scripts/populate_dynamodb.py | neovasili/101_serverless_workshop | a005ab4af620c3c1a522aab8d201378ea7840ab5 | [
"MIT"
] | null | null | null | lego-catalog/backend/resources/scripts/populate_dynamodb.py | neovasili/101_serverless_workshop | a005ab4af620c3c1a522aab8d201378ea7840ab5 | [
"MIT"
] | null | null | null | import boto3
import json
session = boto3.session.Session( profile_name= 'jmcore' )
dynamodb = session.resource( 'dynamodb', region_name= 'eu-west-1' )
table = dynamodb.Table( 'serverless_workshop' )
with open( "user-sets-data.json" ) as json_file:
users = json.load( json_file )
for user in users:
userID = use... | 24.578947 | 67 | 0.631692 | import boto3
import json
session = boto3.session.Session( profile_name= 'jmcore' )
dynamodb = session.resource( 'dynamodb', region_name= 'eu-west-1' )
table = dynamodb.Table( 'serverless_workshop' )
with open( "user-sets-data.json" ) as json_file:
users = json.load( json_file )
for user in users:
userID = use... | 0 | 0 | 0 |
d9beda75cf8f601813cb1e0106a06881bcd28dbb | 4,306 | py | Python | ml/sarsa/gym-minigrid/tests.py | AlinMH/C-Projects | 1e11b4fd1b96045b4b810d5892b2be73c1d5d886 | [
"MIT"
] | null | null | null | ml/sarsa/gym-minigrid/tests.py | AlinMH/C-Projects | 1e11b4fd1b96045b4b810d5892b2be73c1d5d886 | [
"MIT"
] | null | null | null | ml/sarsa/gym-minigrid/tests.py | AlinMH/C-Projects | 1e11b4fd1b96045b4b810d5892b2be73c1d5d886 | [
"MIT"
] | null | null | null | from sarsa_skel import *
if __name__ == '__main__':
plot_softmax("MiniGrid-Empty-6x6-v0")
| 46.804348 | 105 | 0.51974 | from sarsa_skel import *
def plot_egreedy(map):
c1 = 0.5
lr1 = 0.1
d1 = 0.99
q01 = 0
steps1, avg_lengths1, avg_returns1 = sarsa_egreedy(map_file=map, learning_rate=lr1,
discount=d1, const=c1, train_episodes=500, q0=q01,
... | 4,162 | 0 | 46 |
47b9a30e8798f592988d1d728ccd51bd10f6cb58 | 958 | py | Python | Python3/146.lru-cache.py | 610yilingliu/leetcode | 30d071b3685c2131bd3462ba77c6c05114f3f227 | [
"MIT"
] | null | null | null | Python3/146.lru-cache.py | 610yilingliu/leetcode | 30d071b3685c2131bd3462ba77c6c05114f3f227 | [
"MIT"
] | null | null | null | Python3/146.lru-cache.py | 610yilingliu/leetcode | 30d071b3685c2131bd3462ba77c6c05114f3f227 | [
"MIT"
] | null | null | null | #
# @lc app=leetcode id=146 lang=python3
#
# [146] LRU Cache
#
# @lc code=start
# Your LRUCache object will be instantiated and called as such:
# obj = LRUCache(capacity)
# param_1 = obj.get(key)
# obj.put(key,value)
# @lc code=end
| 22.809524 | 63 | 0.538622 | #
# @lc app=leetcode id=146 lang=python3
#
# [146] LRU Cache
#
# @lc code=start
class LRUCache:
def __init__(self, capacity: int):
self.cap = capacity
self.d = dict()
self.stack = []
def get(self, key: int):
if key not in self.d:
return -1
self.stack.remove(... | 625 | -6 | 103 |
019902fd823def4e117ea65ffc273ad7678112be | 7,817 | py | Python | mergejs.py | tmcw/OpenLayerer | 44212b0f9a8aae71f6f96f6357671e89f6ea6cc5 | [
"Apache-2.0",
"BSD-2-Clause"
] | 1 | 2015-07-17T19:01:07.000Z | 2015-07-17T19:01:07.000Z | mergejs.py | tmcw/OpenLayerer | 44212b0f9a8aae71f6f96f6357671e89f6ea6cc5 | [
"Apache-2.0",
"BSD-2-Clause"
] | null | null | null | mergejs.py | tmcw/OpenLayerer | 44212b0f9a8aae71f6f96f6357671e89f6ea6cc5 | [
"Apache-2.0",
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
#
# Merge multiple JavaScript source code files into one.
#
# Usage:
# This script requires source files to have dependencies specified in them.
#
# Dependencies are specified with a comment of the form:
#
# // @requires <file path>
#
# e.g.
#
# // @requires Geo/DataSource.js
#
# This scri... | 32.707113 | 102 | 0.612639 | #!/usr/bin/env python
#
# Merge multiple JavaScript source code files into one.
#
# Usage:
# This script requires source files to have dependencies specified in them.
#
# Dependencies are specified with a comment of the form:
#
# // @requires <file path>
#
# e.g.
#
# // @requires Geo/DataSource.js
#
# This scri... | 214 | 0 | 31 |
37506a8286c5b05402cb22c60eb6b8354ead4f28 | 5,955 | py | Python | test/core/dnn/transformer_test.py | ClaudioBorges/ehrudite | 8633995d3bf795fffeccabd7d20be522241f3bb5 | [
"Apache-2.0"
] | null | null | null | test/core/dnn/transformer_test.py | ClaudioBorges/ehrudite | 8633995d3bf795fffeccabd7d20be522241f3bb5 | [
"Apache-2.0"
] | null | null | null | test/core/dnn/transformer_test.py | ClaudioBorges/ehrudite | 8633995d3bf795fffeccabd7d20be522241f3bb5 | [
"Apache-2.0"
] | 1 | 2022-03-18T09:26:05.000Z | 2022-03-18T09:26:05.000Z | """The test file for transformer DNN"""
import ehrudite.core.dnn.transformer as transformer
import random
import tensorflow as tf
| 34.224138 | 87 | 0.674559 | """The test file for transformer DNN"""
import ehrudite.core.dnn.transformer as transformer
import random
import tensorflow as tf
def test_transformer_encoder_decoder_layer():
batch_size = random.randint(8, 64)
d_model = 2 ** random.randint(7, 9)
dff = random.randint(512, 2048)
input_seq_len = random... | 5,656 | 0 | 161 |
e2ec933ae2e853f380dc429a8199678745d149a0 | 454 | py | Python | tests/core/test_asset.py | BlockGeeks0x01/py-asimov | 5490b90bd5f47d48a69aa4de3b13c60039b2603f | [
"MIT"
] | null | null | null | tests/core/test_asset.py | BlockGeeks0x01/py-asimov | 5490b90bd5f47d48a69aa4de3b13c60039b2603f | [
"MIT"
] | null | null | null | tests/core/test_asset.py | BlockGeeks0x01/py-asimov | 5490b90bd5f47d48a69aa4de3b13c60039b2603f | [
"MIT"
] | null | null | null | from unittest.mock import Mock
from asimov import Asset, constant
| 28.375 | 68 | 0.742291 | from unittest.mock import Mock
from asimov import Asset, constant
def test_asset():
assert Asset.asset_wrapper(0, 1, 1) == 4294967297
assert Asset.asset2str(4294967297) == '000000000000000100000001'
mock_contract = Mock()
mock_contract.read.return_value = 1
new_asset = Asset(mock_contract, 0, 1)... | 363 | 0 | 23 |
6052fd4f4ec0f135719d466deae94ed26256b6cc | 2,471 | py | Python | datamatch/test_similarities.py | pckhoi/datamatch | 3d279293ff9bec84f383133090863db1307a3a68 | [
"MIT"
] | 2 | 2021-05-22T01:53:20.000Z | 2021-05-25T01:15:35.000Z | datamatch/test_similarities.py | pckhoi/datamatch | 3d279293ff9bec84f383133090863db1307a3a68 | [
"MIT"
] | 3 | 2021-05-10T03:27:51.000Z | 2021-06-10T09:50:07.000Z | datamatch/test_similarities.py | pckhoi/datamatch | 3d279293ff9bec84f383133090863db1307a3a68 | [
"MIT"
] | null | null | null | import unittest
from datetime import date
from datamatch.similarities import (
StringSimilarity, DateSimilarity, JaroWinklerSimilarity, AbsoluteNumericalSimilarity, RelativeNumericalSimilarity
)
| 39.222222 | 117 | 0.645488 | import unittest
from datetime import date
from datamatch.similarities import (
StringSimilarity, DateSimilarity, JaroWinklerSimilarity, AbsoluteNumericalSimilarity, RelativeNumericalSimilarity
)
class TestStringSimilarity(unittest.TestCase):
def test_sim(self):
obj = StringSimilarity()
self.a... | 1,872 | 150 | 245 |
4942b83f028a5746713b6d146dd0b18ef104db83 | 575 | py | Python | pyeccodes/defs/grib1/localConcepts/ekmi/units_def.py | ecmwf/pyeccodes | dce2c72d3adcc0cb801731366be53327ce13a00b | [
"Apache-2.0"
] | 7 | 2020-04-14T09:41:17.000Z | 2021-08-06T09:38:19.000Z | pyeccodes/defs/grib1/localConcepts/ekmi/units_def.py | ecmwf/pyeccodes | dce2c72d3adcc0cb801731366be53327ce13a00b | [
"Apache-2.0"
] | null | null | null | pyeccodes/defs/grib1/localConcepts/ekmi/units_def.py | ecmwf/pyeccodes | dce2c72d3adcc0cb801731366be53327ce13a00b | [
"Apache-2.0"
] | 3 | 2020-04-30T12:44:48.000Z | 2020-12-15T08:40:26.000Z | import pyeccodes.accessors as _
| 23.958333 | 62 | 0.596522 | import pyeccodes.accessors as _
def load(h):
def wrapped(h):
table2Version = h.get_l('table2Version')
indicatorOfParameter = h.get_l('indicatorOfParameter')
if table2Version == 1 and indicatorOfParameter == 224:
return 'J kg**-1'
if table2Version == 1 and indicatorO... | 519 | 0 | 23 |
8e54067c74c3efbad693b3983718ac2e603e8a34 | 9,858 | py | Python | pymdwizard/core/fgdc_utils.py | mmfink/fort-pymdwizard | 96f46e8cc2594b82b475b4f3fcae96a05ebc03e4 | [
"CC-BY-4.0"
] | 53 | 2017-05-01T05:03:33.000Z | 2022-03-13T04:49:15.000Z | pymdwizard/core/fgdc_utils.py | mmfink/fort-pymdwizard | 96f46e8cc2594b82b475b4f3fcae96a05ebc03e4 | [
"CC-BY-4.0"
] | 109 | 2017-05-17T15:15:40.000Z | 2022-03-24T21:12:45.000Z | pymdwizard/core/fgdc_utils.py | mmfink/fort-pymdwizard | 96f46e8cc2594b82b475b4f3fcae96a05ebc03e4 | [
"CC-BY-4.0"
] | 17 | 2017-02-08T16:18:18.000Z | 2021-01-28T19:38:09.000Z | #!/usr/bin/env python
# -*- coding: utf8 -*-
"""
The MetadataWizard(pymdwizard) software was developed by the
U.S. Geological Survey Fort Collins Science Center.
See: https://github.com/usgs/fort-pymdwizard for current project source code
See: https://usgs.github.io/fort-pymdwizard/ for current user documentation
See: ... | 33.993103 | 79 | 0.582674 | #!/usr/bin/env python
# -*- coding: utf8 -*-
"""
The MetadataWizard(pymdwizard) software was developed by the
U.S. Geological Survey Fort Collins Science Center.
See: https://github.com/usgs/fort-pymdwizard for current project source code
See: https://usgs.github.io/fort-pymdwizard/ for current user documentation
See: ... | 0 | 0 | 0 |
8f8f0545a32a374fa4e403b6c4173448c8aebaaf | 2,113 | py | Python | lib/python/treadmill/infra/setup/node.py | bretttegart/treadmill | 812109e31c503a6eddaee2d3f2e1faf2833b6aaf | [
"Apache-2.0"
] | 2 | 2017-10-31T18:48:20.000Z | 2018-03-04T20:35:20.000Z | lib/python/treadmill/infra/setup/node.py | bretttegart/treadmill | 812109e31c503a6eddaee2d3f2e1faf2833b6aaf | [
"Apache-2.0"
] | null | null | null | lib/python/treadmill/infra/setup/node.py | bretttegart/treadmill | 812109e31c503a6eddaee2d3f2e1faf2833b6aaf | [
"Apache-2.0"
] | null | null | null | from treadmill.infra.setup import base_provision
from treadmill.infra import configuration, constants, instances
from treadmill.api import ipa
| 29.347222 | 67 | 0.482726 | from treadmill.infra.setup import base_provision
from treadmill.infra import configuration, constants, instances
from treadmill.api import ipa
class Node(base_provision.BaseProvision):
def setup(
self,
image,
key,
tm_release,
instance_type,
a... | 1,873 | 20 | 76 |
fa35d2742f0af2fece6c31ef5a0689b9bda6cc31 | 898 | py | Python | localflavor/dk/forms.py | int2k/django-localflavor | fcda7f3aa3685f15f031b7d9b78f02e19ac5fb0b | [
"BSD-3-Clause"
] | 1 | 2020-07-12T23:24:38.000Z | 2020-07-12T23:24:38.000Z | localflavor/dk/forms.py | KonstantinKlepikov/django-localflavor | 87133f6cea1799e0b5e073dbc727dc88746f8fa8 | [
"BSD-3-Clause"
] | null | null | null | localflavor/dk/forms.py | KonstantinKlepikov/django-localflavor | 87133f6cea1799e0b5e073dbc727dc88746f8fa8 | [
"BSD-3-Clause"
] | 1 | 2020-01-17T16:26:54.000Z | 2020-01-17T16:26:54.000Z | """Denmark specific Form helpers."""
from django.core.exceptions import ValidationError
from django.forms import fields, widgets
from django.utils.translation import gettext_lazy as _
from .dk_municipalities import DK_MUNICIPALITIES
from .dk_postalcodes import DK_POSTALCODES
class DKPostalCodeField(fields.CharFiel... | 33.259259 | 94 | 0.759465 | """Denmark specific Form helpers."""
from django.core.exceptions import ValidationError
from django.forms import fields, widgets
from django.utils.translation import gettext_lazy as _
from .dk_municipalities import DK_MUNICIPALITIES
from .dk_postalcodes import DK_POSTALCODES
def postal_code_validator(value):
if... | 251 | 0 | 50 |
b8de9676b1c3db948ce6ca35eb77076d04fa3617 | 3,445 | py | Python | test/unit/test_browser.py | sanAkdam/chime | 1adbddbdddcdc2669086dee60d1bfb2f97535cff | [
"BSD-3-Clause"
] | 8 | 2015-02-05T22:12:41.000Z | 2015-05-15T16:15:14.000Z | test/unit/test_browser.py | sanAkdam/chime | 1adbddbdddcdc2669086dee60d1bfb2f97535cff | [
"BSD-3-Clause"
] | 168 | 2015-02-02T23:02:52.000Z | 2015-05-15T21:54:07.000Z | test/unit/test_browser.py | codeforamerica/bizarro-cms | 1adbddbdddcdc2669086dee60d1bfb2f97535cff | [
"BSD-3-Clause"
] | 5 | 2016-11-20T15:51:32.000Z | 2021-04-16T09:44:08.000Z | import unittest
from unittest import TestCase
from acceptance.browser import Browser
if __name__ == '__main__':
unittest.main()
| 37.043011 | 116 | 0.613933 | import unittest
from unittest import TestCase
from acceptance.browser import Browser
class TestBrowser(TestCase):
def test_creation(self):
browser = Browser('Windows', '7', "IE", '8.0')
self.assertEqual('Windows', browser.os)
self.assertEqual('7', browser.os_version)
self.assertEq... | 2,929 | 7 | 373 |
23198638402b93bfa4324851435640a23d8cb61f | 4,889 | py | Python | logplayer/r2files.py | rug/robosoc2d | 7a018f8ef6974f96a44df018b8adb185e2c07c63 | [
"MIT"
] | null | null | null | logplayer/r2files.py | rug/robosoc2d | 7a018f8ef6974f96a44df018b8adb185e2c07c63 | [
"MIT"
] | null | null | null | logplayer/r2files.py | rug/robosoc2d | 7a018f8ef6974f96a44df018b8adb185e2c07c63 | [
"MIT"
] | null | null | null | # (c) 2021 Ruggero Rossi
# Load a Robosoc2d game state log
# supported version: 1.0.0 | 36.214815 | 77 | 0.55676 | # (c) 2021 Ruggero Rossi
# Load a Robosoc2d game state log
# supported version: 1.0.0
def load_state_log(file_name):
history = None
with open(file_name, 'r') as f:
game={}
version=f.readline()
if len(version)==0 :
return None
game['ver']=version
game['team1... | 4,781 | 0 | 23 |
6d78cbb20f53042b0737e27a57734137bf0a0e4c | 8,198 | py | Python | theano/sandbox/mkl/tests/test_conv.py | intel/Theano-dev | 6ca6fd4646f9e958058c7bce52cd51923c05c2f4 | [
"BSD-3-Clause"
] | 64 | 2016-10-02T20:41:56.000Z | 2020-03-11T14:59:40.000Z | theano/sandbox/mkl/tests/test_conv.py | intel/Theano-dev | 6ca6fd4646f9e958058c7bce52cd51923c05c2f4 | [
"BSD-3-Clause"
] | 4 | 2017-06-12T05:12:38.000Z | 2018-03-15T03:16:30.000Z | theano/sandbox/mkl/tests/test_conv.py | intel/Theano-dev | 6ca6fd4646f9e958058c7bce52cd51923c05c2f4 | [
"BSD-3-Clause"
] | 30 | 2016-10-27T21:59:00.000Z | 2021-02-20T09:55:14.000Z | import theano
import unittest
import numpy
from nose.plugins.skip import SkipTest
from theano import tensor as T
from theano.tensor.nnet import conv2d
from theano.sandbox import mkl
from theano.sandbox.mkl.basic_ops import U2IConv, I2U
from theano.sandbox.mkl.mkl_conv import Conv2D
numpy.random.seed(123)
if not mkl.m... | 44.797814 | 123 | 0.639302 | import theano
import unittest
import numpy
from nose.plugins.skip import SkipTest
from theano import tensor as T
from theano.tensor.nnet import conv2d
from theano.sandbox import mkl
from theano.sandbox.mkl.basic_ops import U2IConv, I2U
from theano.sandbox.mkl.mkl_conv import Conv2D
numpy.random.seed(123)
if not mkl.m... | 7,140 | 53 | 206 |
0a99668876349e7b2f9a56a2f17351b4ba01af2a | 3,837 | py | Python | tests/python_tests.py | reasoned-ai/norm | 5e45d5917ce8745c9a757a0c6b5e689ea0cac19f | [
"Apache-2.0"
] | 8 | 2019-07-22T08:57:20.000Z | 2021-03-26T13:51:02.000Z | tests/python_tests.py | xumiao/norm | 5e45d5917ce8745c9a757a0c6b5e689ea0cac19f | [
"Apache-2.0"
] | null | null | null | tests/python_tests.py | xumiao/norm | 5e45d5917ce8745c9a757a0c6b5e689ea0cac19f | [
"Apache-2.0"
] | 1 | 2019-11-16T13:37:35.000Z | 2019-11-16T13:37:35.000Z | """Unit tests for embedding Python code"""
import datetime
from pandas import DataFrame
from tests.utils import NormTestCase
| 30.696 | 70 | 0.484754 | """Unit tests for embedding Python code"""
import datetime
from pandas import DataFrame
from tests.utils import NormTestCase
class PythonTestCase(NormTestCase):
def test_python_declaration(self):
script = """
test := {{
from datetime import datetime
test = datetime.utcno... | 3,483 | 14 | 212 |
0a67f4076fdfe5bc717c7292a9258ff71ce35595 | 10,696 | py | Python | src/hobbits-plugins/analyzers/KaitaiStruct/ksy_py/network/bitcoin_transaction.py | SabheeR/hobbits | 8bfb997940c73467af2ceb0275c470b763d2c1bf | [
"MIT"
] | 304 | 2020-02-07T21:05:22.000Z | 2022-03-24T05:30:37.000Z | src/hobbits-plugins/analyzers/KaitaiStruct/ksy_py/network/bitcoin_transaction.py | SabheeR/hobbits | 8bfb997940c73467af2ceb0275c470b763d2c1bf | [
"MIT"
] | 2,107 | 2019-11-05T09:26:16.000Z | 2022-02-14T13:35:36.000Z | src/hobbits-plugins/analyzers/KaitaiStruct/ksy_py/network/bitcoin_transaction.py | SabheeR/hobbits | 8bfb997940c73467af2ceb0275c470b763d2c1bf | [
"MIT"
] | 30 | 2020-03-11T14:36:43.000Z | 2022-03-07T04:45:17.000Z | # This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild
from pkg_resources import parse_version
import kaitaistruct
from kaitaistruct import KaitaiStruct, KaitaiStream, BytesIO
import collections
from enum import Enum
if parse_version(kaitaistruct.__version__) < parse_versi... | 50.691943 | 164 | 0.553291 | # This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild
from pkg_resources import parse_version
import kaitaistruct
from kaitaistruct import KaitaiStruct, KaitaiStream, BytesIO
import collections
from enum import Enum
if parse_version(kaitaistruct.__version__) < parse_versi... | 8,770 | 1,078 | 107 |
10c64417440fb35fb29c424a295af5fb46bac46b | 5,951 | py | Python | modules/widgets.py | ldvlpr-dev/AudioVisualizer-Release | 23e18b9b96a7bb54a134603b0e41f70b5d8569ad | [
"MIT"
] | 2 | 2021-04-01T16:22:52.000Z | 2021-05-21T18:01:12.000Z | modules/widgets.py | ldvlpr-dev/AudioVisualizer-Release | 23e18b9b96a7bb54a134603b0e41f70b5d8569ad | [
"MIT"
] | null | null | null | modules/widgets.py | ldvlpr-dev/AudioVisualizer-Release | 23e18b9b96a7bb54a134603b0e41f70b5d8569ad | [
"MIT"
] | 2 | 2021-03-31T09:00:58.000Z | 2021-04-28T18:36:31.000Z | import cv2
import numpy as np
| 40.209459 | 214 | 0.59469 | import cv2
import numpy as np
def hex_to_bgr(hx):
hx = hx.lstrip('#')
return tuple(int(hx[i:i + 2], 16) for i in (0, 2, 4))[::-1]
class Rectangle:
def __init__(self, x, y, width, height, max_height, min_db, max_db, color, thickness, reverse):
self.rev = -1 if reverse else 1
self.x = x
... | 5,523 | -11 | 403 |
0b5bf0d5fdf0bab0a0494fecb3c1227a2fd961bb | 21,768 | py | Python | polygon/rest/reference.py | Polygon-io/client-python | beddb8cbf9e77effa52c40878ab5aefa5f8bef85 | [
"MIT"
] | 1 | 2019-11-19T20:56:27.000Z | 2019-11-19T20:56:27.000Z | polygon/rest/reference.py | Polygon-io/client-python | beddb8cbf9e77effa52c40878ab5aefa5f8bef85 | [
"MIT"
] | null | null | null | polygon/rest/reference.py | Polygon-io/client-python | beddb8cbf9e77effa52c40878ab5aefa5f8bef85 | [
"MIT"
] | null | null | null | from .base import BaseClient
from typing import Optional, Any, Dict, List, Union, Iterator
from .models import (
MarketHoliday,
MarketStatus,
Ticker,
TickerDetails,
TickerNews,
TickerTypes,
Sort,
Order,
AssetClass,
Locale,
Split,
Dividend,
DividendType,
Frequency,... | 44.064777 | 308 | 0.642181 | from .base import BaseClient
from typing import Optional, Any, Dict, List, Union, Iterator
from .models import (
MarketHoliday,
MarketStatus,
Ticker,
TickerDetails,
TickerNews,
TickerTypes,
Sort,
Order,
AssetClass,
Locale,
Split,
Dividend,
DividendType,
Frequency,... | 0 | 21,145 | 161 |
3a917aec646616b14d05103f2a853a51a6359d7f | 459 | py | Python | gitup/test/test_bookmarks.py | hr157/git-repo-updater | 4ad20a6979226bf066740287accc8239d82a89ec | [
"MIT"
] | 772 | 2015-01-17T09:11:07.000Z | 2022-03-23T08:50:31.000Z | gitup/test/test_bookmarks.py | hr157/git-repo-updater | 4ad20a6979226bf066740287accc8239d82a89ec | [
"MIT"
] | 50 | 2015-03-12T14:33:51.000Z | 2022-03-10T07:58:54.000Z | gitup/test/test_bookmarks.py | hr157/git-repo-updater | 4ad20a6979226bf066740287accc8239d82a89ec | [
"MIT"
] | 110 | 2015-01-30T07:27:23.000Z | 2021-12-15T07:22:20.000Z | # -*- coding: utf-8 -*-
#
# Copyright (C) 2011-2018 Ben Kurtovic <ben.kurtovic@gmail.com>
# Released under the terms of the MIT License. See LICENSE for details.
from __future__ import print_function, unicode_literals
from gitup import config
| 30.6 | 71 | 0.736383 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2011-2018 Ben Kurtovic <ben.kurtovic@gmail.com>
# Released under the terms of the MIT License. See LICENSE for details.
from __future__ import print_function, unicode_literals
from gitup import config
def test_empty_list(tmpdir, capsys):
config_path = tmpdir / "config"
... | 190 | 0 | 23 |
8d619e7f57b45654b3e4b1e082e471adaafd8081 | 596 | py | Python | benchmark/matrix_product.py | xu3kev/bril | 7d21628621b584e1ec09b3960bf9909276ba7f25 | [
"MIT"
] | null | null | null | benchmark/matrix_product.py | xu3kev/bril | 7d21628621b584e1ec09b3960bf9909276ba7f25 | [
"MIT"
] | null | null | null | benchmark/matrix_product.py | xu3kev/bril | 7d21628621b584e1ec09b3960bf9909276ba7f25 | [
"MIT"
] | null | null | null | from cg import *
from random import randint
cg = CG()
n=20
c = [[Var("int") for i in range(n)] for i in range(n)]
a = [[Var("int") for i in range(n)] for i in range(n)]
b = [[Var("int") for i in range(n)] for i in range(n)]
m=100
for vs in a:
for v in vs:
cg.init(v, randint(0,m))
for vs in b:
for v... | 19.225806 | 54 | 0.510067 | from cg import *
from random import randint
cg = CG()
n=20
c = [[Var("int") for i in range(n)] for i in range(n)]
a = [[Var("int") for i in range(n)] for i in range(n)]
b = [[Var("int") for i in range(n)] for i in range(n)]
m=100
for vs in a:
for v in vs:
cg.init(v, randint(0,m))
for vs in b:
for v... | 0 | 0 | 0 |
d00adb83565673cb264520ebee0b3eda48e2f0c5 | 2,523 | py | Python | weighted_mean_prediction/random_forest/tuned_rf_model.py | fegb-dataset22/dataset22 | 6642a01ca7ab9948c9b5ffc3aae1201cd8c72f0b | [
"MIT"
] | null | null | null | weighted_mean_prediction/random_forest/tuned_rf_model.py | fegb-dataset22/dataset22 | 6642a01ca7ab9948c9b5ffc3aae1201cd8c72f0b | [
"MIT"
] | null | null | null | weighted_mean_prediction/random_forest/tuned_rf_model.py | fegb-dataset22/dataset22 | 6642a01ca7ab9948c9b5ffc3aae1201cd8c72f0b | [
"MIT"
] | null | null | null | import os.path
from typing import Dict
import matplotlib.pyplot as plt
import pandas as pd
from sklearn import metrics
from sklearn.ensemble import RandomForestRegressor
from hyperparameter_tuning.study_functions import load_study
from root import ROOT_DIR
from weighted_mean_prediction.data_setup import get_encoded_s... | 37.656716 | 100 | 0.738407 | import os.path
from typing import Dict
import matplotlib.pyplot as plt
import pandas as pd
from sklearn import metrics
from sklearn.ensemble import RandomForestRegressor
from hyperparameter_tuning.study_functions import load_study
from root import ROOT_DIR
from weighted_mean_prediction.data_setup import get_encoded_s... | 464 | 0 | 46 |
0278f07d5c4fcf43dea6388a703c9cfa378a80f3 | 4,464 | py | Python | Evaluation_Protocol/Task2_VideoTextSpotting/utils/Annotation_Deal/vis.py | weijiawu/BOVText-Benchmark | 375cc1c72e20fb751e17a33c74fc4ca5c1557389 | [
"CC-BY-4.0"
] | 24 | 2021-10-12T04:02:31.000Z | 2022-03-31T07:19:17.000Z | Evaluation_Protocol/Task2_VideoTextSpotting/utils/Annotation_Deal/vis.py | maoxiaofei99/BOVText-Benchmark | 880342867704f8be78fb8f8e1615a234a287a574 | [
"CC-BY-4.0"
] | 1 | 2021-10-12T04:06:14.000Z | 2021-10-12T04:06:14.000Z | Evaluation_Protocol/Task2_VideoTextSpotting/utils/Annotation_Deal/vis.py | maoxiaofei99/BOVText-Benchmark | 880342867704f8be78fb8f8e1615a234a287a574 | [
"CC-BY-4.0"
] | 5 | 2021-11-29T05:18:36.000Z | 2022-02-27T02:22:47.000Z | # -*- coding: utf-8 -*-
import cv2
import os
import copy
import numpy as np
import math
# import Levenshtein
from cv2 import VideoWriter, VideoWriter_fourcc
import json
from tqdm import tqdm
from PIL import Image, ImageDraw, ImageFont
import shutil
def Frames2Video(frames_dir=""):
''' 将frames_dir下面的所有视频帧合成一个视频 '... | 35.428571 | 144 | 0.600582 | # -*- coding: utf-8 -*-
import cv2
import os
import copy
import numpy as np
import math
# import Levenshtein
from cv2 import VideoWriter, VideoWriter_fourcc
import json
from tqdm import tqdm
from PIL import Image, ImageDraw, ImageFont
import shutil
def Frames2Video(frames_dir=""):
''' 将frames_dir下面的所有视频帧合成一个视频 '... | 803 | 0 | 50 |
132e0421e9b24a450962f82bb4efb1ae59d84d80 | 5,814 | py | Python | vnpy_tinysoft/tinysoft_datafeed.py | noranhe/vnpy_tinysoft | aaa00679adf93b40710e03113411adc24a98a038 | [
"MIT"
] | null | null | null | vnpy_tinysoft/tinysoft_datafeed.py | noranhe/vnpy_tinysoft | aaa00679adf93b40710e03113411adc24a98a038 | [
"MIT"
] | 1 | 2021-10-30T05:32:06.000Z | 2021-11-01T11:36:15.000Z | vnpy_tinysoft/tinysoft_datafeed.py | vnpy/vnpy_tinysoft | 0d97a91251c02f1b2a7e4afd707a2157056605c6 | [
"MIT"
] | null | null | null | from datetime import datetime, timedelta
from typing import Dict, List, Optional
from pytz import timezone
from vnpy.trader.setting import SETTINGS
from vnpy.trader.constant import Exchange, Interval
from vnpy.trader.object import BarData, TickData, HistoryRequest
from vnpy.trader.utility import extract_vt_symbol
from... | 31.945055 | 133 | 0.491916 | from datetime import datetime, timedelta
from typing import Dict, List, Optional
from pytz import timezone
from vnpy.trader.setting import SETTINGS
from vnpy.trader.constant import Exchange, Interval
from vnpy.trader.object import BarData, TickData, HistoryRequest
from vnpy.trader.utility import extract_vt_symbol
from... | 0 | 0 | 0 |
e2d1dcb2354936fd158943bcf5fefb6597f1fd28 | 1,203 | py | Python | d8.py | sdamashek/adventofcode | 68b50d16246657313ce491b1b1b047e743f687fa | [
"Unlicense"
] | null | null | null | d8.py | sdamashek/adventofcode | 68b50d16246657313ce491b1b1b047e743f687fa | [
"Unlicense"
] | null | null | null | d8.py | sdamashek/adventofcode | 68b50d16246657313ce491b1b1b047e743f687fa | [
"Unlicense"
] | null | null | null | inp = open('input_d8.txt').read()
arr = [[0 for i in range(50)] for j in range(6)]
for i in inp.split('\n')[:-1]:
if i.startswith('rotate row'):
rotaterow(int(i.split('y=')[1].split(' ')[0]), int(i.split('by ')[1]))
elif i.startswith('rotate column'):
print(i)
rotatecol(int(i.split('x... | 23.134615 | 78 | 0.47714 | inp = open('input_d8.txt').read()
arr = [[0 for i in range(50)] for j in range(6)]
def rect(x,y):
global arr
for i in range(x):
for j in range(y):
print(i,j)
arr[j][i] = 1
def rotatecol(x,n):
global arr
for _ in range(n):
first = arr[5][x]
for i in rang... | 584 | 0 | 92 |