hexsha stringlengths 40 40 | size int64 5 2.06M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 248 | max_stars_repo_name stringlengths 5 125 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 248 | max_issues_repo_name stringlengths 5 125 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 248 | max_forks_repo_name stringlengths 5 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 5 2.06M | avg_line_length float64 1 1.02M | max_line_length int64 3 1.03M | alphanum_fraction float64 0 1 | count_classes int64 0 1.6M | score_classes float64 0 1 | count_generators int64 0 651k | score_generators float64 0 1 | count_decorators int64 0 990k | score_decorators float64 0 1 | count_async_functions int64 0 235k | score_async_functions float64 0 1 | count_documentation int64 0 1.04M | score_documentation float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
282ccb40eb876af8551ca4938f1b672da9c20208 | 1,189 | py | Python | helpers.py | AHS-Open-Sorcery/HTNE-Project | c6caf57f1e89302c06ef0a84ddb83c645274d183 | [
"MIT"
] | null | null | null | helpers.py | AHS-Open-Sorcery/HTNE-Project | c6caf57f1e89302c06ef0a84ddb83c645274d183 | [
"MIT"
] | null | null | null | helpers.py | AHS-Open-Sorcery/HTNE-Project | c6caf57f1e89302c06ef0a84ddb83c645274d183 | [
"MIT"
] | null | null | null | from data_retrieval import *
import emailer
from login.config import Config
from sentiment_analysis import *
import tweepy
import json
def send_email(user_id, post_id): # Note: can determine user_id from post_id
try:
emailer.send_email(Config.EMAIL_SENDER, get_email(user_id), get_post_content(post_id), Co... | 27.022727 | 117 | 0.710681 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 157 | 0.132044 |
282cfc4e7936eaf93017c54214756f8505acd57a | 3,291 | py | Python | attack_metrics/mr.py | asplos2020/DRTest | c3de497142d9b226e518a1a0f95f7350d2f7acd6 | [
"MIT"
] | 1 | 2021-04-01T07:31:17.000Z | 2021-04-01T07:31:17.000Z | attack_metrics/mr.py | Justobe/DRTest | 85c3c9b2a46cafa7184130f2596c5f9eb3b20bff | [
"MIT"
] | null | null | null | attack_metrics/mr.py | Justobe/DRTest | 85c3c9b2a46cafa7184130f2596c5f9eb3b20bff | [
"MIT"
] | 1 | 2020-12-24T12:12:54.000Z | 2020-12-24T12:12:54.000Z | """
This tutorial shows how to generate adversarial examples using FGSM
and train a model using adversarial training with TensorFlow.
It is very similar to mnist_tutorial_keras_tf.py, which does the same
thing but with a dependence on keras.
The original paper can be found at:
https://arxiv.org/abs/1412.6572
"""
from _... | 33.242424 | 101 | 0.717107 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 804 | 0.244303 |
282d70a51f36fc140a29300e30c60da47fb2411b | 7,434 | py | Python | detect_deeplabv3plus_ascend.py | jackhanyuan/deeplabv3plus-ascend | 817006a4514257aa8cd07d752b70bbff9709ba9f | [
"Apache-2.0"
] | null | null | null | detect_deeplabv3plus_ascend.py | jackhanyuan/deeplabv3plus-ascend | 817006a4514257aa8cd07d752b70bbff9709ba9f | [
"Apache-2.0"
] | null | null | null | detect_deeplabv3plus_ascend.py | jackhanyuan/deeplabv3plus-ascend | 817006a4514257aa8cd07d752b70bbff9709ba9f | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# by [jackhanyuan](https://github.com/jackhanyuan) 07/03/2022
import argparse
import copy
import glob
import os
import re
import sys
import time
from pathlib import Path
import cv2
import acl
import torch
import numpy as np
from PIL import Image
import torch.nn.functiona... | 34.738318 | 114 | 0.595776 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,270 | 0.170837 |
282db7a977d5ee21b51eae4baa89a5c662e12b73 | 1,044 | py | Python | trim2.py | AmadeusChan/GeminiGraph | 893b05ee5c560ec51d41ab6a58a300baade8a9f5 | [
"Apache-2.0"
] | null | null | null | trim2.py | AmadeusChan/GeminiGraph | 893b05ee5c560ec51d41ab6a58a300baade8a9f5 | [
"Apache-2.0"
] | null | null | null | trim2.py | AmadeusChan/GeminiGraph | 893b05ee5c560ec51d41ab6a58a300baade8a9f5 | [
"Apache-2.0"
] | null | null | null | import os
with open("./simple_graph.txt", "r") as f:
N = int(f.readline())
edges = []
while True:
line = f.readline().strip()
if line == None or len(line) == 0:
break
line = line.split(" ")
edges.append([int(line[0]), int(line[1])])
con = []
for i in range(N):
... | 18.642857 | 50 | 0.51341 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 94 | 0.090038 |
282de6dc694665ce1234b3c8d5c5765ed89dc979 | 3,516 | py | Python | Classes/Data.py | zerowsir/stock_study | ae2f3fab2b0cb3f4c980f0b229547867902415c4 | [
"MIT"
] | 5 | 2020-04-27T08:07:06.000Z | 2022-01-02T14:47:21.000Z | Classes/Data.py | zerowsir/stock_study | ae2f3fab2b0cb3f4c980f0b229547867902415c4 | [
"MIT"
] | null | null | null | Classes/Data.py | zerowsir/stock_study | ae2f3fab2b0cb3f4c980f0b229547867902415c4 | [
"MIT"
] | 3 | 2020-04-25T12:29:09.000Z | 2021-07-09T05:47:01.000Z | # coding=utf-8
"""
__title__ = ''
__file__ = ''
__author__ = 'tianmuchunxiao'
__mtime__ = '2019/7/4'
"""
import requests
import datetime
import pandas as pd
from io import StringIO
TODAY = datetime.date.strftime(datetime.date.today(), '%Y%m%d')
class Data(object):
URL = ''
PARAMS = {}
HEADERS = {}
file_pa... | 42.878049 | 834 | 0.700512 | 3,306 | 0.921919 | 0 | 0 | 0 | 0 | 0 | 0 | 2,475 | 0.690184 |
28306d7ad64f3293bff710f9c34f8a63246637c0 | 4,151 | py | Python | tledb/common/misc.py | rtubio/tledb | 2bfb13497d4ba7c155505fa7396abd7bf837b3a5 | [
"Apache-2.0"
] | null | null | null | tledb/common/misc.py | rtubio/tledb | 2bfb13497d4ba7c155505fa7396abd7bf837b3a5 | [
"Apache-2.0"
] | 5 | 2020-11-09T00:24:16.000Z | 2022-02-10T15:10:19.000Z | tledb/common/misc.py | rtubio/tledb | 2bfb13497d4ba7c155505fa7396abd7bf837b3a5 | [
"Apache-2.0"
] | 1 | 2020-11-08T10:35:23.000Z | 2020-11-08T10:35:23.000Z |
import datetime
import logging
import pytz
import socket
logger = logging.getLogger('common')
def get_fqdn(ip_address):
"""
Function that transforms a given IP address into the associated FQDN name
for that host.
:param ip_address: IP address of the remote host.
:return: FQDN name for that host... | 30.748148 | 78 | 0.688991 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2,316 | 0.557938 |
2832742f4b503c46d1f0a267a28c5b2b06f21e83 | 2,455 | py | Python | CoC/CoC_Default_CmdSets.py | macorvalan/MyGame | 29a14bcb1ffb11b158d325112d5698107d8f1188 | [
"Unlicense"
] | null | null | null | CoC/CoC_Default_CmdSets.py | macorvalan/MyGame | 29a14bcb1ffb11b158d325112d5698107d8f1188 | [
"Unlicense"
] | null | null | null | CoC/CoC_Default_CmdSets.py | macorvalan/MyGame | 29a14bcb1ffb11b158d325112d5698107d8f1188 | [
"Unlicense"
] | null | null | null | """
"""
from evennia import default_cmds
from evennia import CmdSet
class CoCCharacterCmdSet(default_cmds.CharacterCmdSet):
"""
The `CharacterCmdSet` contains general in-game commands like `look`,
`get`, etc available on in-game Character objects. It is merged with
the `AccountCmdSet` when an Accoun... | 24.068627 | 72 | 0.627291 | 2,371 | 0.965784 | 0 | 0 | 0 | 0 | 0 | 0 | 1,509 | 0.614664 |
2832f2cc2b9e737de1d148d89d82f9fe93379119 | 6,300 | py | Python | dit/inference/counts.py | leoalfonso/dit | e7d5f680b3f170091bb1e488303f4255eeb11ef4 | [
"BSD-3-Clause"
] | 1 | 2021-03-15T08:51:42.000Z | 2021-03-15T08:51:42.000Z | dit/inference/counts.py | leoalfonso/dit | e7d5f680b3f170091bb1e488303f4255eeb11ef4 | [
"BSD-3-Clause"
] | null | null | null | dit/inference/counts.py | leoalfonso/dit | e7d5f680b3f170091bb1e488303f4255eeb11ef4 | [
"BSD-3-Clause"
] | null | null | null | """
Non-cython methods for getting counts and distributions from data.
"""
import numpy as np
try: # cython
from .pycounts import counts_from_data, distribution_from_data
except ImportError: # no cython
from boltons.iterutils import windowed_iter
from collections import Counter, defaultdict
from it... | 35 | 98 | 0.619524 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4,176 | 0.662857 |
28336284c8b0c58eec05e4f7f5c39c75af17be88 | 1,845 | py | Python | tests/test_get_meetings.py | GeorgianBadita/Dronem-gym-envirnoment | f3b488f6a4b55722c4b129051555a68d7775278c | [
"MIT"
] | 5 | 2020-06-13T10:43:42.000Z | 2022-01-25T10:37:32.000Z | tests/test_get_meetings.py | GeorgianBadita/Dronem-gym-envirnoment | f3b488f6a4b55722c4b129051555a68d7775278c | [
"MIT"
] | null | null | null | tests/test_get_meetings.py | GeorgianBadita/Dronem-gym-envirnoment | f3b488f6a4b55722c4b129051555a68d7775278c | [
"MIT"
] | null | null | null | """
@author: Badita Marin-Georgian
@email: geo.badita@gmail.com
@date: 21.03.2020 00:58
"""
from env_interpretation import Meeting
from env_interpretation.meeting import get_valid_meetings
def test_get_meetings_4_robots(env4_robots):
env_data = env4_robots.get_env_metadata()
cycles_length = [l... | 38.4375 | 104 | 0.656369 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 222 | 0.120325 |
2834130633642f13cf991cd575cca24813206c77 | 1,670 | py | Python | python/test/environment/test_reset.py | stacyvjong/PandemicSimulator | eca906f5dc8135d7c90a1582b96621235f745c17 | [
"Apache-2.0"
] | null | null | null | python/test/environment/test_reset.py | stacyvjong/PandemicSimulator | eca906f5dc8135d7c90a1582b96621235f745c17 | [
"Apache-2.0"
] | null | null | null | python/test/environment/test_reset.py | stacyvjong/PandemicSimulator | eca906f5dc8135d7c90a1582b96621235f745c17 | [
"Apache-2.0"
] | null | null | null | # Confidential, Copyright 2020, Sony Corporation of America, All rights reserved.
import copy
import numpy as np
from pandemic_simulator.environment import CityRegistry, Home, GroceryStore, Office, School, Hospital, PopulationParams, \
LocationParams
from pandemic_simulator.script_helpers import make_standard_loc... | 36.304348 | 122 | 0.742515 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 81 | 0.048503 |
28343120a82f0ad353610fd53956f8cb3bf271dc | 1,008 | py | Python | Groups/Group_ID_6/SIFT_and_RESIFT/Code_files/sift.py | sonaldangi12/DataScience | 3d7cd529a96f37c2ef179ee408e2c6d8744d746a | [
"MIT"
] | 5 | 2020-12-13T07:53:22.000Z | 2020-12-20T18:49:27.000Z | Groups/Group_ID_6/SIFT_and_RESIFT/Code_files/sift.py | Gulnaz-Tabassum/DataScience | 1fd771f873a9bc0800458fd7c05e228bb6c4e8a0 | [
"MIT"
] | null | null | null | Groups/Group_ID_6/SIFT_and_RESIFT/Code_files/sift.py | Gulnaz-Tabassum/DataScience | 1fd771f873a9bc0800458fd7c05e228bb6c4e8a0 | [
"MIT"
] | 24 | 2020-12-12T11:23:28.000Z | 2021-10-04T13:09:38.000Z | from libs import *
def SIFT_algo(training_image,training_gray,test_image,test_gray):
#test_gray = cv2.cvtColor(test_image, cv2.COLOR_RGB2GRAY)
#training_gray = cv2.cvtColor(training_image, cv2.COLOR_RGB2GRAY)
# Creating SIFT Object
sift = cv2.SIFT_create()
# Detecting features
... | 56 | 128 | 0.779762 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 234 | 0.232143 |
283446254a407be87bc62c4c4206eacf19fcc853 | 651 | py | Python | Q14__/23_Maximum_Points_You_Can_Obtain_from_Cards/Solution.py | hsclinical/leetcode | 48a57f6a5d5745199c5685cd2c8f5c4fa293e54a | [
"Apache-2.0"
] | null | null | null | Q14__/23_Maximum_Points_You_Can_Obtain_from_Cards/Solution.py | hsclinical/leetcode | 48a57f6a5d5745199c5685cd2c8f5c4fa293e54a | [
"Apache-2.0"
] | null | null | null | Q14__/23_Maximum_Points_You_Can_Obtain_from_Cards/Solution.py | hsclinical/leetcode | 48a57f6a5d5745199c5685cd2c8f5c4fa293e54a | [
"Apache-2.0"
] | null | null | null | from typing import List
class Solution:
def maxScore(self, cardPoints: List[int], k: int) -> int:
if k <= 0:
return 0
else:
numOfCards = len(cardPoints)
totalPart1 = sum(cardPoints) * (k//numOfCards)
k = k%numOfCards
totalPart2... | 32.55 | 79 | 0.506912 | 624 | 0.958525 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
28349545dacdb38c6ebe53a67d01ff333f29fa0c | 1,192 | py | Python | utils/editResult.py | JasonHippo/Scene_text_detection_and_recognition | c0da141d71b7b888d560296b201aecbbd735b565 | [
"MIT"
] | 4 | 2021-12-27T14:37:33.000Z | 2022-03-30T10:56:57.000Z | utils/editResult.py | JasonHippo/Scene_text_detection_and_recognition | c0da141d71b7b888d560296b201aecbbd735b565 | [
"MIT"
] | null | null | null | utils/editResult.py | JasonHippo/Scene_text_detection_and_recognition | c0da141d71b7b888d560296b201aecbbd735b565 | [
"MIT"
] | null | null | null | import pandas as pd
import argparse
badword = ["!", "$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","@","[","/","]","^","_","`","{","|","}","~","の","®"]
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument('--path', help='the path of file')
... | 32.216216 | 141 | 0.428691 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 205 | 0.170976 |
28360d264e9f210900fd3d3f89893b647f81343f | 133 | py | Python | Service/Ipv4_stun/startup.py | zlf7735268/Tenet | 54005ad5d17b5d1f5ef4cc04aa6eb7939e58c2c5 | [
"Apache-2.0"
] | 2 | 2021-12-17T01:21:19.000Z | 2021-12-17T14:49:42.000Z | Service/Ipv4_stun/startup.py | zlf7735268/Tenet | 54005ad5d17b5d1f5ef4cc04aa6eb7939e58c2c5 | [
"Apache-2.0"
] | null | null | null | Service/Ipv4_stun/startup.py | zlf7735268/Tenet | 54005ad5d17b5d1f5ef4cc04aa6eb7939e58c2c5 | [
"Apache-2.0"
] | null | null | null | from Ipv4_stun.transfer import Transfer
#m=Transfer(address=('172.16.0.156',9080))
m=Transfer(address=('127.0.0.1', 82))
m.run() | 26.6 | 43 | 0.691729 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 54 | 0.406015 |
2837b7ad00fad751653116c498c45a40929e5a19 | 4,030 | py | Python | generator/season.py | fraziermatthew/njba | acedec351543b8ecf339beb2d27c635f3377e929 | [
"MIT"
] | null | null | null | generator/season.py | fraziermatthew/njba | acedec351543b8ecf339beb2d27c635f3377e929 | [
"MIT"
] | null | null | null | generator/season.py | fraziermatthew/njba | acedec351543b8ecf339beb2d27c635f3377e929 | [
"MIT"
] | null | null | null | """season.py: Generates random NJBA season data."""
__author__ = "Matthew Frazier"
__copyright__ = "Copyright 2019, University of Delaware, CISC 637 Database Systems"
__email__ = "matthew@udel.edu"
from datetime import timedelta
import calendar
import csv
'''
Steps to run this project:
1. Create a virtual env a... | 33.032787 | 106 | 0.536476 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,202 | 0.298263 |
2837e96df35c3511f85fcf1e1d1d5915d5541eac | 2,746 | py | Python | src/pace/allele_similarity.py | tmadden/pace | 0be5d92579efc4e6219f5c58bb4e4ac6754e865e | [
"MIT"
] | null | null | null | src/pace/allele_similarity.py | tmadden/pace | 0be5d92579efc4e6219f5c58bb4e4ac6754e865e | [
"MIT"
] | 9 | 2019-01-16T15:13:37.000Z | 2019-07-29T18:31:58.000Z | src/pace/allele_similarity.py | tmadden/pace | 0be5d92579efc4e6219f5c58bb4e4ac6754e865e | [
"MIT"
] | null | null | null | import numpy as np
import pandas as pd
import pace
from pace.definitions import amino_acids, builtin_aa_encodings, builtin_allele_similarities
from pace.sklearn import create_one_hot_encoder
from pkg_resources import resource_stream
def load_allele_similarity(allele_similarity_name):
allele_similarity = ... | 36.131579 | 101 | 0.717407 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,419 | 0.516752 |
2838bf018ab619624c31ab34ebae1fd0c469063d | 13,884 | py | Python | client/forms/reader_form.py | zhmzlzn/Network-Pj-BookReader | 891d395f2db464f4d4e7b84dd03c3cddebbafd30 | [
"MIT"
] | 6 | 2019-11-28T10:47:46.000Z | 2021-11-04T08:22:56.000Z | client/forms/reader_form.py | zhmzlzn/python-BookReader | 891d395f2db464f4d4e7b84dd03c3cddebbafd30 | [
"MIT"
] | null | null | null | client/forms/reader_form.py | zhmzlzn/python-BookReader | 891d395f2db464f4d4e7b84dd03c3cddebbafd30 | [
"MIT"
] | 4 | 2019-12-17T15:29:22.000Z | 2021-05-28T16:39:51.000Z | import tkinter as tk
from tkinter import *
from tkinter import messagebox
from tkinter.simpledialog import askinteger
from protocol.secure_transmission.secure_channel import establish_secure_channel_to_server
from protocol.message_type import MessageType
from protocol.data_conversion.from_byte import deserialize_messag... | 43.118012 | 129 | 0.584054 | 15,581 | 0.975886 | 0 | 0 | 0 | 0 | 0 | 0 | 4,348 | 0.272329 |
2838cb9fb3068b931f43ec405489f94b2abb45c7 | 3,285 | py | Python | akispy/__init__.py | ryanleland/Akispy | dbbb85a1d1b027051e11179289cc9067cb90baf6 | [
"MIT"
] | null | null | null | akispy/__init__.py | ryanleland/Akispy | dbbb85a1d1b027051e11179289cc9067cb90baf6 | [
"MIT"
] | 2 | 2017-05-19T21:59:04.000Z | 2021-06-25T15:28:07.000Z | akispy/__init__.py | ryanleland/Akispy | dbbb85a1d1b027051e11179289cc9067cb90baf6 | [
"MIT"
] | 1 | 2017-05-18T05:23:47.000Z | 2017-05-18T05:23:47.000Z | #!/usr/bin/env python
"""Light weight python client for Akismet API."""
__title__ = 'akispy'
__version__ = '0.2'
__author__ = 'Ryan Leland'
__copyright__ = 'Copyright 2012 Ryan Leland'
import http.client, urllib.request, urllib.parse, urllib.error
class Connection(object):
_key = None
_version = None
... | 30.990566 | 101 | 0.557991 | 3,022 | 0.919939 | 0 | 0 | 0 | 0 | 0 | 0 | 1,073 | 0.326636 |
283a11f41a96444be50edc2390d31671ac936bd1 | 1,599 | py | Python | scripts/extract_mfcc.py | xavierfav/coala | b791ad6bb5c4f7b8f8f8fa8e0c5bd5b89b0ecbc3 | [
"MIT"
] | 34 | 2020-06-12T15:54:22.000Z | 2021-12-16T08:16:45.000Z | scripts/extract_mfcc.py | xavierfav/ae-w2v-attention | 8039c056ad365769bdf8d77d6292d4f3cfb957a4 | [
"MIT"
] | 3 | 2020-06-22T09:06:27.000Z | 2021-07-10T09:58:30.000Z | scripts/extract_mfcc.py | xavierfav/coala | b791ad6bb5c4f7b8f8f8fa8e0c5bd5b89b0ecbc3 | [
"MIT"
] | 4 | 2020-10-23T03:29:35.000Z | 2021-08-19T09:31:57.000Z | """
This script is used to compute mffc features for target task datasets.
Warning: Need manual editing for switching datasets
"""
import os
import librosa
import soundfile as sf
import numpy as np
from tqdm import tqdm
from pathlib import Path
FILES_LOCATION = '../data/UrbanSound8K/audio'
FILES_LOCATION = '../data/G... | 30.75 | 89 | 0.632896 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 456 | 0.285178 |
283a66142e84ec8f0ef344d826e481e7692288fc | 391 | py | Python | sqli/__main__.py | everilae/sqli | 8a63076dc8316b38ce521b63e67bea8d2ccf2a80 | [
"MIT"
] | null | null | null | sqli/__main__.py | everilae/sqli | 8a63076dc8316b38ce521b63e67bea8d2ccf2a80 | [
"MIT"
] | 1 | 2017-10-22T11:13:58.000Z | 2020-06-01T09:20:20.000Z | sqli/__main__.py | everilae/sqli | 8a63076dc8316b38ce521b63e67bea8d2ccf2a80 | [
"MIT"
] | null | null | null | import argparse
import astunparse
import sys
from . import check
parser = argparse.ArgumentParser()
parser.add_argument("file", nargs="?", type=argparse.FileType("r"),
default=sys.stdin)
args = parser.parse_args()
poisoned = check(args.file.read())
print("Possible SQL injections:")
for p in poi... | 23 | 67 | 0.682864 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 51 | 0.130435 |
283aae358baff3c73b726efc887ef653ab678494 | 318 | py | Python | rammstein.py | wildekek/rammstein-generator | fc7ef34260c4dddaba01ff4c964349e13bd4bf1a | [
"MIT"
] | 3 | 2015-10-11T15:39:30.000Z | 2019-06-18T19:20:00.000Z | rammstein.py | wildekek/rammstein-generator | fc7ef34260c4dddaba01ff4c964349e13bd4bf1a | [
"MIT"
] | null | null | null | rammstein.py | wildekek/rammstein-generator | fc7ef34260c4dddaba01ff4c964349e13bd4bf1a | [
"MIT"
] | 1 | 2019-06-16T21:49:16.000Z | 2019-06-16T21:49:16.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
a='Du hast mich'
b='Du, du hast'+'\n'+a
c=a+' gefragt'
def j(i):
return '\n'.join(i)
d=j([b,b,''])
e=j(['Willst du bis der Tod euch scheidet','Treurig sein für alle Tage?','Nein, nein!',''])
f=j([d,b,a,'',j([c,c,c,'Und ich hab nichts gesagt','']),e,e])
print j([d,f,f,e]) | 28.909091 | 91 | 0.566038 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 204 | 0.639498 |
283bc06264c86314c6694bec3801d78f4ce49fef | 799 | py | Python | tests/test_06_reporting_classes.py | themperek/pyuvm | 12abf6b0a631321c0fcce6ebbc04b8cc9900c6a8 | [
"Apache-2.0"
] | null | null | null | tests/test_06_reporting_classes.py | themperek/pyuvm | 12abf6b0a631321c0fcce6ebbc04b8cc9900c6a8 | [
"Apache-2.0"
] | null | null | null | tests/test_06_reporting_classes.py | themperek/pyuvm | 12abf6b0a631321c0fcce6ebbc04b8cc9900c6a8 | [
"Apache-2.0"
] | null | null | null | import pyuvm_unittest
from pyuvm import *
class s06_reporting_classes_TestCase(pyuvm_unittest.pyuvm_TestCase):
"""Basic test cases."""
def test_object_creation(self):
"""
Test that we actually get a logger in our object.
"""
ro = uvm_report_object('ro')
self.assertTrue... | 34.73913 | 68 | 0.524406 | 754 | 0.94368 | 0 | 0 | 0 | 0 | 0 | 0 | 213 | 0.266583 |
283c7a1056bf5070026e3e0618dc2649d53dd2ec | 203 | py | Python | sucursal_crud/sucursal_crud_api/models/puntoDeRetiro.py | cassa10/challenge-api | 0bcc4f38b049f930faca45b80d869835650e2a23 | [
"MIT"
] | null | null | null | sucursal_crud/sucursal_crud_api/models/puntoDeRetiro.py | cassa10/challenge-api | 0bcc4f38b049f930faca45b80d869835650e2a23 | [
"MIT"
] | null | null | null | sucursal_crud/sucursal_crud_api/models/puntoDeRetiro.py | cassa10/challenge-api | 0bcc4f38b049f930faca45b80d869835650e2a23 | [
"MIT"
] | null | null | null | from django.db import models
from django.core.validators import MinValueValidator
from .nodo import Nodo
class PuntoDeRetiro(Nodo):
capacidad = models.IntegerField(validators=[MinValueValidator(1)]) | 33.833333 | 70 | 0.817734 | 97 | 0.477833 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
283cfb68139e552afe4cbfabaafdcde926934b65 | 8,429 | py | Python | trinity/sync/header/chain.py | g-r-a-n-t/trinity | f108b6cd34ed9aabfcf9e235badd91597650ecd5 | [
"MIT"
] | 1 | 2021-04-07T07:33:28.000Z | 2021-04-07T07:33:28.000Z | trinity/sync/header/chain.py | g-r-a-n-t/trinity | f108b6cd34ed9aabfcf9e235badd91597650ecd5 | [
"MIT"
] | null | null | null | trinity/sync/header/chain.py | g-r-a-n-t/trinity | f108b6cd34ed9aabfcf9e235badd91597650ecd5 | [
"MIT"
] | null | null | null | import asyncio
from typing import Sequence
from async_service import Service, background_asyncio_service
from eth.abc import BlockHeaderAPI
from eth.exceptions import CheckpointsMustBeCanonical
from eth_typing import BlockNumber
from trinity._utils.pauser import Pauser
from trinity.chains.base import AsyncChainAPI
fr... | 37.629464 | 97 | 0.626409 | 7,502 | 0.890023 | 0 | 0 | 0 | 0 | 5,004 | 0.593665 | 1,291 | 0.153162 |
283d50169f9d4063fc968899a7356c0ef91c4024 | 2,436 | py | Python | plato/clients/scaffold.py | iQua/plato | 76fdac06af8b4d85922cd12749b4a687e3161745 | [
"Apache-2.0"
] | null | null | null | plato/clients/scaffold.py | iQua/plato | 76fdac06af8b4d85922cd12749b4a687e3161745 | [
"Apache-2.0"
] | null | null | null | plato/clients/scaffold.py | iQua/plato | 76fdac06af8b4d85922cd12749b4a687e3161745 | [
"Apache-2.0"
] | 1 | 2021-05-18T15:03:32.000Z | 2021-05-18T15:03:32.000Z | """
A federated learning client using SCAFFOLD.
Reference:
Karimireddy et al., "SCAFFOLD: Stochastic Controlled Averaging for Federated Learning"
(https://arxiv.org/pdf/1910.06378.pdf)
"""
import os
from dataclasses import dataclass
import torch
from plato.clients import simple
@dataclass
class Report(simple.Re... | 35.304348 | 93 | 0.694992 | 2,134 | 0.876026 | 0 | 0 | 135 | 0.055419 | 1,434 | 0.58867 | 693 | 0.284483 |
283e3728c74f274d987dc75b56ca98081fe4485b | 2,307 | py | Python | test/test.py | SK-415/bilireq | ce4dfa2ae05a88291162907b86caf29ab868bedc | [
"MIT"
] | 2 | 2021-10-20T06:32:35.000Z | 2022-03-26T11:40:07.000Z | test/test.py | SK-415/bilireq | ce4dfa2ae05a88291162907b86caf29ab868bedc | [
"MIT"
] | 1 | 2021-12-06T01:37:08.000Z | 2021-12-06T01:37:08.000Z | test/test.py | SK-415/bilireq | ce4dfa2ae05a88291162907b86caf29ab868bedc | [
"MIT"
] | null | null | null | import asyncio
import sys
from pathlib import Path
sys.path.append(str(Path(__file__).parent.parent))
from bilireq.auth import Auth
from bilireq.dynamic import get_user_dynamics, get_followed_dynamics_update_info, get_followed_new_dynamics, get_followed_history_dynamics
from bilireq.live import get_rooms_info_by_ids
... | 30.355263 | 138 | 0.704378 | 0 | 0 | 0 | 0 | 0 | 0 | 1,792 | 0.772747 | 880 | 0.379474 |
283f0444ed2c9cb2e8181317df155e9ffdbf38c6 | 1,105 | py | Python | scripts/pgmviz.py | anindex/auto_localization | e8acc6fb4a4221115e2d4f9ba87fd077ad741b70 | [
"MIT"
] | 1 | 2020-09-03T14:29:27.000Z | 2020-09-03T14:29:27.000Z | scripts/pgmviz.py | anindex/auto_localization | e8acc6fb4a4221115e2d4f9ba87fd077ad741b70 | [
"MIT"
] | null | null | null | scripts/pgmviz.py | anindex/auto_localization | e8acc6fb4a4221115e2d4f9ba87fd077ad741b70 | [
"MIT"
] | 2 | 2019-09-26T15:20:37.000Z | 2021-07-14T11:00:49.000Z | import re
import numpy
def read_pgm(filename, byteorder='>'):
"""Return image data from a raw PGM file as numpy array.
Format specification: http://netpbm.sourceforge.net/doc/pgm.html
"""
with open(filename, 'rb') as f:
buffer = f.read()
try:
header, width, height, maxval = re.sea... | 34.53125 | 99 | 0.529412 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 361 | 0.326697 |
283fe692e8590b67f92e91991108dc8259bb2861 | 406 | py | Python | sgnlp/models/span_extraction/__init__.py | vincenttzc/sgnlp | 44ae12a5ae98c9a1945d346e9373854c7d472a4b | [
"MIT"
] | null | null | null | sgnlp/models/span_extraction/__init__.py | vincenttzc/sgnlp | 44ae12a5ae98c9a1945d346e9373854c7d472a4b | [
"MIT"
] | null | null | null | sgnlp/models/span_extraction/__init__.py | vincenttzc/sgnlp | 44ae12a5ae98c9a1945d346e9373854c7d472a4b | [
"MIT"
] | null | null | null | from .config import RecconSpanExtractionConfig
from .tokenization import RecconSpanExtractionTokenizer
from .modeling import RecconSpanExtractionModel
from .preprocess import RecconSpanExtractionPreprocessor
from .postprocess import RecconSpanExtractionPostprocessor
from .train import train
from .eval import evaluate
f... | 40.6 | 58 | 0.889163 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2841fd174e918cba71310ebfefa31472caa5fe2f | 331 | py | Python | pandoc-starter/MarkTex/marktex/config.py | riciche/SimpleCVReproduction | 4075de39f9c61f1359668a413f6a5d98903fcf97 | [
"Apache-2.0"
] | 923 | 2020-01-11T06:36:53.000Z | 2022-03-31T00:26:57.000Z | pandoc-starter/MarkTex/marktex/config.py | riciche/SimpleCVReproduction | 4075de39f9c61f1359668a413f6a5d98903fcf97 | [
"Apache-2.0"
] | 25 | 2020-02-27T08:35:46.000Z | 2022-01-25T08:54:19.000Z | pandoc-starter/MarkTex/marktex/config.py | riciche/SimpleCVReproduction | 4075de39f9c61f1359668a413f6a5d98903fcf97 | [
"Apache-2.0"
] | 262 | 2020-01-02T02:19:40.000Z | 2022-03-23T04:56:16.000Z | '''Don't change the basic param'''
import os
'''prog path'''
config_path = os.path.split(__file__)[0]
marktemp_path = os.path.join(config_path,"markenv.tex")
'''tools setting'''
image_download_retry_time = 10
# 在尝试重试次数达到上限后,是否等待手动下载该文件放到目录
# wait_manully_if_all_failed = False
# 在tex文件里添加图片的时候,使用相对路径还是绝对路径
give_rele_pa... | 23.642857 | 55 | 0.770393 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 280 | 0.643678 |
28420d9ddb5dd0a224753623044f62aac5eba76f | 669 | py | Python | ProgramsToRead/ExercisesLists/Lista05/Exer12Lista05.py | ItanuRomero/PythonStudyPrograms | 2b784b2af068b34e65ddf817ca8d99c1ca3a710e | [
"MIT"
] | null | null | null | ProgramsToRead/ExercisesLists/Lista05/Exer12Lista05.py | ItanuRomero/PythonStudyPrograms | 2b784b2af068b34e65ddf817ca8d99c1ca3a710e | [
"MIT"
] | null | null | null | ProgramsToRead/ExercisesLists/Lista05/Exer12Lista05.py | ItanuRomero/PythonStudyPrograms | 2b784b2af068b34e65ddf817ca8d99c1ca3a710e | [
"MIT"
] | null | null | null | # Questão 12. Construa uma função que receba uma string como parâmetro
# e devolva outra string com os carateres emba- ralhados. Por exemplo:
# se função receber a palavra python, pode retornar npthyo, ophtyn ou
# qualquer outra combinação possível, de forma aleatória. Padronize em
# sua função que todos os caracte... | 37.166667 | 71 | 0.751868 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 486 | 0.711567 |
28426aef923f9eca775a9b7c35cef0f1597b7c28 | 54,872 | py | Python | DataScience/Numpy.py | AlPus108/Python_lessons | 0e96117d9a8b76fd651e137fc126ddedaa6accd9 | [
"MIT"
] | null | null | null | DataScience/Numpy.py | AlPus108/Python_lessons | 0e96117d9a8b76fd651e137fc126ddedaa6accd9 | [
"MIT"
] | null | null | null | DataScience/Numpy.py | AlPus108/Python_lessons | 0e96117d9a8b76fd651e137fc126ddedaa6accd9 | [
"MIT"
] | null | null | null | # Numpy массивы
# Документация по NumPy: https://numpy.org/doc/stable/
# Список универсальных функций NumPy https://numpy.org/devdocs/reference/ufuncs.html
# NumPy - векторные/научные вычисления. Пакет содержит функциональные средства для работы с многомерными массивами
# и высокоуровневыми математическими функциями
... | 37.842759 | 129 | 0.64563 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 67,870 | 0.886216 |
2842d30820f635256f73ae79bc6c16f824dc89f6 | 704 | py | Python | setup.py | jlevy44/Submit-HPC | 83dfd60587fab2c75e02f1c14b688b4bc51aff8c | [
"MIT"
] | 1 | 2020-06-11T00:51:24.000Z | 2020-06-11T00:51:24.000Z | setup.py | jlevy44/Submit-HPC | 83dfd60587fab2c75e02f1c14b688b4bc51aff8c | [
"MIT"
] | null | null | null | setup.py | jlevy44/Submit-HPC | 83dfd60587fab2c75e02f1c14b688b4bc51aff8c | [
"MIT"
] | 1 | 2020-06-19T01:05:07.000Z | 2020-06-19T01:05:07.000Z | from setuptools import setup
with open('README.md','r', encoding='utf-8') as f:
long_description = f.read()
setup(name='submit_hpc',
version='0.1.2',
description='Collection of growing job submission scripts, not to replace workflow specifications.',
url='https://github.com/jlevy44/Submit-HPC',
... | 37.052632 | 106 | 0.666193 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 308 | 0.4375 |
28461474953cc9c257de317f17581d4ef1a01795 | 18,209 | py | Python | DQN/network.py | Xin-Ye-1/HIEM | 6764f579eef6ec92dd85a005af27419f630df7da | [
"Apache-2.0"
] | 2 | 2021-04-12T02:41:00.000Z | 2021-05-15T02:18:15.000Z | DQN/network.py | Xin-Ye-1/HIEM | 6764f579eef6ec92dd85a005af27419f630df7da | [
"Apache-2.0"
] | null | null | null | DQN/network.py | Xin-Ye-1/HIEM | 6764f579eef6ec92dd85a005af27419f630df7da | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/env python
import tensorflow as tf
import tensorflow.contrib.slim as slim
seed = 0
def fc2d(inputs,
num_outputs,
activation_fn,
scope):
with tf.variable_scope(scope, reuse=tf.AUTO_REUSE) as s:
n0, n1, n2 = inputs.get_shape().as_list()
weights = tf.get_varia... | 55.012085 | 123 | 0.473228 | 16,292 | 0.894722 | 0 | 0 | 0 | 0 | 0 | 0 | 577 | 0.031688 |
2847498b54c2f788df1761ffd02163a689964021 | 5,924 | py | Python | 128/utility.py | Jeffrey-Ede/Adaptive-Partial-STEM | dc13e64ba3fb8266d39a260780af615b170a3c88 | [
"MIT"
] | 3 | 2020-04-29T21:45:21.000Z | 2021-08-13T16:01:14.000Z | 128/utility.py | Jeffrey-Ede/intelligent-partial-STEM | dc13e64ba3fb8266d39a260780af615b170a3c88 | [
"MIT"
] | null | null | null | 128/utility.py | Jeffrey-Ede/intelligent-partial-STEM | dc13e64ba3fb8266d39a260780af615b170a3c88 | [
"MIT"
] | null | null | null | import tensorflow as tf
import itertools
import numpy as np
FLAGS = tf.flags.FLAGS
def stepped_spiral_actions(theta_incr=np.pi/180):
coverage = FLAGS.num_steps*FLAGS.step_size/FLAGS.img_side**2
start_theta = np.pi/4
start_r = np.sqrt(2)*FLAGS.step_size
start_position = np.ones(... | 33.280899 | 116 | 0.613774 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,454 | 0.245442 |
2847f21bc2086528a4db0c276260fe7ae1c988d5 | 1,336 | py | Python | tests/test_lexer.py | codyd51/camelback | 2dd1269bcbc7ce35fcab1df7dfddce229c51e610 | [
"MIT"
] | 2 | 2018-11-22T16:45:24.000Z | 2018-11-26T16:13:31.000Z | tests/test_lexer.py | codyd51/camelback | 2dd1269bcbc7ce35fcab1df7dfddce229c51e610 | [
"MIT"
] | null | null | null | tests/test_lexer.py | codyd51/camelback | 2dd1269bcbc7ce35fcab1df7dfddce229c51e610 | [
"MIT"
] | null | null | null | import os
import unittest
from camelback.lexer import Lexer
class TestLexer(unittest.TestCase):
SOURCE_CODE_FILE = os.path.join(os.path.dirname(__file__), 'bin', 'snakecase.c')
def test_tokenize_source_code(self):
with open(TestLexer.SOURCE_CODE_FILE) as f:
stream = f.read()
lexe... | 37.111111 | 113 | 0.355539 | 1,272 | 0.952096 | 0 | 0 | 0 | 0 | 0 | 0 | 401 | 0.30015 |
28484e4880b21cb0cfb818580cf5e99d4d59fc00 | 568 | py | Python | tests/conftest.py | ljnsn/pycwatch | 9fb8910b010e7e89357a9c6b99197697ee5a8cf6 | [
"MIT"
] | 1 | 2022-02-25T17:23:17.000Z | 2022-02-25T17:23:17.000Z | tests/conftest.py | ljnsn/pycwatch | 9fb8910b010e7e89357a9c6b99197697ee5a8cf6 | [
"MIT"
] | 1 | 2022-02-28T18:37:08.000Z | 2022-02-28T18:37:08.000Z | tests/conftest.py | ljnsn/pycwatch | 9fb8910b010e7e89357a9c6b99197697ee5a8cf6 | [
"MIT"
] | null | null | null | """Fixtures and configuration for the test suite."""
from pathlib import Path
import pytest
import vcr
from pycwatch import CryptoWatchClient
BASE_DIR = Path(__file__).parent.absolute()
api_vcr = my_vcr = vcr.VCR(
serializer="yaml",
cassette_library_dir=BASE_DIR.joinpath("vcr_cassettes").as_posix(),
rec... | 20.285714 | 71 | 0.739437 | 0 | 0 | 0 | 0 | 137 | 0.241197 | 0 | 0 | 135 | 0.237676 |
2848866b78d851fe0130aa00ed413f094e4d8df4 | 6,861 | py | Python | cxphasing/CXResolutionEstimate.py | jbgastineau/cxphasing | a9847a0afb9a981d81f027e75c06c9bb2b531d33 | [
"MIT"
] | 3 | 2018-05-11T16:05:55.000Z | 2021-12-20T08:52:02.000Z | cxphasing/CXResolutionEstimate.py | jbgastineau/cxphasing | a9847a0afb9a981d81f027e75c06c9bb2b531d33 | [
"MIT"
] | null | null | null | cxphasing/CXResolutionEstimate.py | jbgastineau/cxphasing | a9847a0afb9a981d81f027e75c06c9bb2b531d33 | [
"MIT"
] | 2 | 2018-11-14T08:57:10.000Z | 2021-12-20T08:52:06.000Z | """
.. module:: CXResolutionEstimate.py
:platform: Unix
:synopsis: A class for predicting the resolution of a ptychography measurement.
.. moduleauthor:: David Vine <djvine@gmail.com>
"""
import requests
import pdb
import scipy as sp
import numpy as np
import scipy.fftpack as spf
from pylab import *
class Hen... | 27.011811 | 126 | 0.69538 | 4,992 | 0.727591 | 0 | 0 | 87 | 0.01268 | 0 | 0 | 3,390 | 0.494097 |
284932efb61177d76bc830e6f9381821ff06ec7e | 997 | py | Python | classes/migrations/0007_auto_20201206_1223.py | henrylameck/school_management_system | 38c270977d001d28f2338eb90fffc3e8c2598d06 | [
"MIT"
] | null | null | null | classes/migrations/0007_auto_20201206_1223.py | henrylameck/school_management_system | 38c270977d001d28f2338eb90fffc3e8c2598d06 | [
"MIT"
] | 3 | 2021-06-05T00:01:48.000Z | 2021-09-22T19:39:12.000Z | classes/migrations/0007_auto_20201206_1223.py | henrylameck/school_management_system | 38c270977d001d28f2338eb90fffc3e8c2598d06 | [
"MIT"
] | null | null | null | # Generated by Django 3.1 on 2020-12-06 09:23
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('classes', '0006_auto_20201205_2224'),
]
operations = [
migrations.RemoveField(
model_name='classsyllabus',
name='compo... | 26.236842 | 53 | 0.563691 | 906 | 0.908726 | 0 | 0 | 0 | 0 | 0 | 0 | 206 | 0.20662 |
2849b9c3dc25b3aa339fd03d7bee0279359be673 | 1,129 | py | Python | Analysis/views_in_dow.py | harrisonxia/Lil-Data | 204467aa740bef10d865925508d7cf007cac19b3 | [
"MIT"
] | 5 | 2018-11-14T03:31:13.000Z | 2022-01-12T04:20:16.000Z | Analysis/views_in_dow.py | harrisonxia/Lil-Data | 204467aa740bef10d865925508d7cf007cac19b3 | [
"MIT"
] | null | null | null | Analysis/views_in_dow.py | harrisonxia/Lil-Data | 204467aa740bef10d865925508d7cf007cac19b3 | [
"MIT"
] | null | null | null | import sys
from pyspark.sql import SparkSession, functions, types
from pyspark.sql.functions import date_format
import json
def views_in_dow():
data_stream = spark.read.json('stream_cleanned')
data_channel = spark.read.json('channel_cleanned')
data_stream.createOrReplaceTempView('data_s')
data_c... | 35.28125 | 154 | 0.723649 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 409 | 0.362267 |
284d7bf5c6289c980a9a21998f63efdfc660f3b8 | 570 | py | Python | videoprocessor/app.py | ashish1595/uPresent | 663acc6ad7c958c8d45699918c60e48535aff3b3 | [
"MIT"
] | 1 | 2020-09-02T23:51:15.000Z | 2020-09-02T23:51:15.000Z | videoprocessor/app.py | ashish1595/uPresent | 663acc6ad7c958c8d45699918c60e48535aff3b3 | [
"MIT"
] | 1,143 | 2020-01-26T07:18:37.000Z | 2022-03-31T21:02:44.000Z | videoprocessor/app.py | ashish1595/uPresent | 663acc6ad7c958c8d45699918c60e48535aff3b3 | [
"MIT"
] | 4 | 2020-01-27T07:47:29.000Z | 2020-07-22T10:54:15.000Z | from flask import Flask
from flask_restful import Api
from elasticapm.contrib.flask import ElasticAPM
from flask_restful_swagger import swagger
from resources import custom_logger
from resources.routes import initialize_routes
import logging
app = Flask(__name__)
app.config.from_object("config.Config")
# Initializing... | 24.782609 | 47 | 0.801754 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 63 | 0.110526 |
284e0e3fc7904eb4e425103fc8997d9f8ee44f17 | 1,593 | py | Python | cogs/rng.py | Ana-gram/Amanager | 5ceef312125b1c73dea59d37f8f06e22293c8960 | [
"Apache-2.0"
] | 12 | 2021-04-23T18:10:24.000Z | 2021-05-03T13:08:54.000Z | cogs/rng.py | Ana-gram/Amanager | 5ceef312125b1c73dea59d37f8f06e22293c8960 | [
"Apache-2.0"
] | 3 | 2021-04-04T17:47:02.000Z | 2021-11-20T10:59:46.000Z | cogs/rng.py | Margana314/Amanager | 87e241d942ca07f3ed8dfc5e1aebfde6f58bbdac | [
"Apache-2.0"
] | 3 | 2021-04-30T11:07:28.000Z | 2021-05-01T11:35:27.000Z | import discord, random
from discord.ext import commands
from discord_slash import cog_ext
from discord_slash.utils.manage_commands import create_option
class Slash(commands.Cog):
def __init__(self, bot):
self.bot = bot
@cog_ext.cog_slash(name="rng", description="Générer un nombre aléatoire !", options... | 40.846154 | 190 | 0.603264 | 1,359 | 0.847785 | 0 | 0 | 1,275 | 0.795384 | 815 | 0.508422 | 463 | 0.288833 |
284ed97a6e7a6cca5b8e4fac818f272a6b8ee59d | 1,538 | py | Python | app.py | dodoche/essaie | 53d22cfec969a8f992f4b5cb473bb41a215975b6 | [
"Apache-2.0"
] | null | null | null | app.py | dodoche/essaie | 53d22cfec969a8f992f4b5cb473bb41a215975b6 | [
"Apache-2.0"
] | null | null | null | app.py | dodoche/essaie | 53d22cfec969a8f992f4b5cb473bb41a215975b6 | [
"Apache-2.0"
] | null | null | null | from flask import Flask
from kubernetes.client.rest import ApiException
from pprint import pprint
from kubernetes import client, config
app = Flask(__name__)
@app.route("/ing")
def ing():
# Configure API key authorization: BearerToken
configuration = kubernetes.client.Configuration()
configuration.api_key... | 48.0625 | 171 | 0.727568 | 0 | 0 | 0 | 0 | 1,311 | 0.852406 | 0 | 0 | 818 | 0.53186 |
284f1b158ca4db2c6a71a6bb4e065847635e83d7 | 447 | py | Python | Chapter2_Python/Logic.py | LKilian1/UdemyML_Template | 4d9cd40c35ff29d796e2b7d327e0032ee7dc2f5a | [
"MIT"
] | null | null | null | Chapter2_Python/Logic.py | LKilian1/UdemyML_Template | 4d9cd40c35ff29d796e2b7d327e0032ee7dc2f5a | [
"MIT"
] | null | null | null | Chapter2_Python/Logic.py | LKilian1/UdemyML_Template | 4d9cd40c35ff29d796e2b7d327e0032ee7dc2f5a | [
"MIT"
] | null | null | null | i_am_broke = False
if i_am_broke:
print("I am broke.")
else:
print("I am not broke.")
my_bank_account = 1000
if my_bank_account <= 0:
print("I am broke.")
else:
print("I am not broke.")
# equal ==
# less <
# greater >
# not equal !=
# less or equal <=
# greater or equal >=
my_age = 21
if my_age ... | 13.96875 | 33 | 0.604027 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 203 | 0.454139 |
284f52f9892227b12c3c28dae697a2873a90c1e7 | 34 | py | Python | my_script.py | jeroenpijpker/easy_CD_tutorial | 2827508a7060c74ff937d7820c5b0f5cdfa4d6a4 | [
"MIT"
] | null | null | null | my_script.py | jeroenpijpker/easy_CD_tutorial | 2827508a7060c74ff937d7820c5b0f5cdfa4d6a4 | [
"MIT"
] | null | null | null | my_script.py | jeroenpijpker/easy_CD_tutorial | 2827508a7060c74ff937d7820c5b0f5cdfa4d6a4 | [
"MIT"
] | null | null | null | print("x")
print("x")
print("x")
| 6.8 | 10 | 0.529412 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 9 | 0.264706 |
2851770a789aa6df103f42e0f34d59c8093d59ff | 498 | py | Python | neighbour/migrations/0014_auto_20211228_2342.py | mary-wan/Neighbourhood | 4150ea60d8ab471fce7173c50c040f36320f3f40 | [
"Unlicense"
] | 2 | 2022-01-17T03:52:59.000Z | 2022-02-18T15:09:34.000Z | neighbour/migrations/0014_auto_20211228_2342.py | mary-wan/Neighbourhood | 4150ea60d8ab471fce7173c50c040f36320f3f40 | [
"Unlicense"
] | null | null | null | neighbour/migrations/0014_auto_20211228_2342.py | mary-wan/Neighbourhood | 4150ea60d8ab471fce7173c50c040f36320f3f40 | [
"Unlicense"
] | null | null | null | # Generated by Django 2.2.24 on 2021-12-28 20:42
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('neighbour', '0013_profile_neighbourhood'),
]
operations = [
migrations.AlterModelOptions(
name='neighbourhood',
options={'o... | 21.652174 | 52 | 0.566265 | 412 | 0.827309 | 0 | 0 | 0 | 0 | 0 | 0 | 144 | 0.289157 |
2853e0d7d747d6c3288b88732191d861e6eecd97 | 427 | py | Python | scipy/ndimage/tests/__init__.py | Ennosigaeon/scipy | 2d872f7cf2098031b9be863ec25e366a550b229c | [
"BSD-3-Clause"
] | 9,095 | 2015-01-02T18:24:23.000Z | 2022-03-31T20:35:31.000Z | scipy/ndimage/tests/__init__.py | Ennosigaeon/scipy | 2d872f7cf2098031b9be863ec25e366a550b229c | [
"BSD-3-Clause"
] | 11,500 | 2015-01-01T01:15:30.000Z | 2022-03-31T23:07:35.000Z | scipy/ndimage/tests/__init__.py | Ennosigaeon/scipy | 2d872f7cf2098031b9be863ec25e366a550b229c | [
"BSD-3-Clause"
] | 5,838 | 2015-01-05T11:56:42.000Z | 2022-03-31T23:21:19.000Z |
from __future__ import annotations
from typing import List, Type
import numpy
# list of numarray data types
integer_types: List[Type] = [
numpy.int8, numpy.uint8, numpy.int16, numpy.uint16,
numpy.int32, numpy.uint32, numpy.int64, numpy.uint64]
float_types: List[Type] = [numpy.float32, numpy.float64]
comple... | 26.6875 | 63 | 0.754098 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 29 | 0.067916 |
285632d72a4a6ee14ee3a1b9a5965b712d109e62 | 10,286 | py | Python | experiments/utils.py | linshaoxin-maker/taas | 34e11fab167a7beb78fbe6991ff8721dc9208793 | [
"MIT"
] | 4 | 2021-02-28T11:58:18.000Z | 2022-02-03T03:26:45.000Z | experiments/utils.py | linshaoxin-maker/taas | 34e11fab167a7beb78fbe6991ff8721dc9208793 | [
"MIT"
] | null | null | null | experiments/utils.py | linshaoxin-maker/taas | 34e11fab167a7beb78fbe6991ff8721dc9208793 | [
"MIT"
] | null | null | null | import torch
import os
import subprocess as sp
from mlutils.pt.training import TrainerBatch
from mlutils.callbacks import Callback
from os import path
import numpy as np
import json
class WeightedSum:
def __init__(self, name, init, postprocessing=None):
self.name = name
self.v = init
self.... | 33.504886 | 119 | 0.586914 | 6,341 | 0.616469 | 0 | 0 | 0 | 0 | 0 | 0 | 2,032 | 0.19755 |
28567dfbf8e22fcad08ad19553a2399e95399e25 | 6,612 | py | Python | noise/perlin.py | AnthonyBriggs/Python-101 | e6c7584fd6791bb5d7d05fd419faa46dc7148f61 | [
"MIT"
] | 3 | 2017-08-02T23:40:55.000Z | 2018-07-02T14:59:07.000Z | noise/perlin.py | AnthonyBriggs/Python-101 | e6c7584fd6791bb5d7d05fd419faa46dc7148f61 | [
"MIT"
] | null | null | null | noise/perlin.py | AnthonyBriggs/Python-101 | e6c7584fd6791bb5d7d05fd419faa46dc7148f61 | [
"MIT"
] | null | null | null | #!/usr/bin/python
"""
TODO: where'd I get this from?
"""
import math
import random
p = (
151,160,137,91,90,15,131,13,201,95,96,53,194,233,7,225,140,36,103,
30,69,142,8,99,37,240,21,10,23,190,6,148,247,120,234,75,0,26,197,
62,94,252,219,203,117,35,11,32,57,177,33,88,237,149,56,87,174,20,
125,136,171,168,68,175,74,165... | 31.942029 | 92 | 0.58908 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 807 | 0.122051 |
2856b66bfd0e689f82a8cb47b06e0b491d804f30 | 3,555 | py | Python | tests/test_random.py | xadrnd/display_sdk_ios | f8a140d1cf3d1e8f63b915caf8c723d771dac13f | [
"BSD-3-Clause"
] | null | null | null | tests/test_random.py | xadrnd/display_sdk_ios | f8a140d1cf3d1e8f63b915caf8c723d771dac13f | [
"BSD-3-Clause"
] | null | null | null | tests/test_random.py | xadrnd/display_sdk_ios | f8a140d1cf3d1e8f63b915caf8c723d771dac13f | [
"BSD-3-Clause"
] | null | null | null | from test_base import DisplaySDKTest
from utils import *
class RandomTest(DisplaySDKTest):
def test_banner_random(self):
click_btn(self, "All Errors")
for i in range(10):
click_load_ad_btn(self, "Banner")
accept_location(self)
webview = block_until_webvie... | 25.76087 | 106 | 0.501547 | 3,496 | 0.983404 | 0 | 0 | 0 | 0 | 0 | 0 | 972 | 0.273418 |
28573be47f861d148cdbe92b563ea159f2c46f16 | 1,964 | py | Python | libretto/plugin/__init__.py | johnwcchau/libretto | 8b8cde81a978536f1c797e070818188bd2c006e5 | [
"MIT"
] | null | null | null | libretto/plugin/__init__.py | johnwcchau/libretto | 8b8cde81a978536f1c797e070818188bd2c006e5 | [
"MIT"
] | null | null | null | libretto/plugin/__init__.py | johnwcchau/libretto | 8b8cde81a978536f1c797e070818188bd2c006e5 | [
"MIT"
] | null | null | null | import logging
from configparser import ConfigParser
from typing import Callable
__plugins = {}
def plugin_disabled(config, path):
name = '.'.join(path.replace('/', '.').replace('\\', '.').split('.')[:-2])
return config.getboolean(name, "disabled", fallback=False)
def plugin_mjs(config):
from glob impor... | 32.733333 | 82 | 0.588595 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 489 | 0.248982 |
2858823061844e57eb3d0e1bf225fe8863fd7485 | 30,325 | py | Python | cax/tasks/tsm_mover.py | XENON1T/cax | 06de9290851904695275fd34d7c74e2c9eb7fe59 | [
"0BSD"
] | 2 | 2016-05-19T05:51:15.000Z | 2017-10-13T13:43:00.000Z | cax/tasks/tsm_mover.py | XENON1T/cax | 06de9290851904695275fd34d7c74e2c9eb7fe59 | [
"0BSD"
] | 93 | 2016-03-26T20:34:01.000Z | 2021-03-25T21:41:57.000Z | cax/tasks/tsm_mover.py | XENON1T/cax | 06de9290851904695275fd34d7c74e2c9eb7fe59 | [
"0BSD"
] | 2 | 2017-05-19T03:47:09.000Z | 2018-12-19T18:10:45.000Z | """Handle copying data between sites.
tsm_mover.py contains the necessary classes
to upload and download from tape backup and
syncronize it with the runDB.
Author: Boris Bauermeister
Email: Boris.Bauermeister@fysik.su.se
"""
import datetime
import logging
import os
import time
import hashlib
import ... | 38.679847 | 142 | 0.54526 | 29,569 | 0.97507 | 0 | 0 | 0 | 0 | 0 | 0 | 8,633 | 0.284683 |
285a8bab289bfb8c666439b93d30129bb0e1ff4e | 2,076 | py | Python | src/network/topology.py | joelwanner/smtax | 7d46f02cb3f15f2057022c574e0f3a8e5236d647 | [
"MIT"
] | null | null | null | src/network/topology.py | joelwanner/smtax | 7d46f02cb3f15f2057022c574e0f3a8e5236d647 | [
"MIT"
] | null | null | null | src/network/topology.py | joelwanner/smtax | 7d46f02cb3f15f2057022c574e0f3a8e5236d647 | [
"MIT"
] | null | null | null | from network.route import *
class Host(object):
def __init__(self, name, r, s, a=1):
self.name = name
self.receiving_cap = r
self.sending_cap = s
self.amp_factor = a
self.links = []
def add_link(self, l):
self.links.append(l)
def __str__(self):
if... | 23.590909 | 102 | 0.560694 | 1,946 | 0.93738 | 0 | 0 | 80 | 0.038536 | 0 | 0 | 144 | 0.069364 |
285ae74b0cd6ba7b852c770105e6b5d4523be1ae | 5,310 | py | Python | leetcode_python/Sort/wiggle-sort-ii.py | yennanliu/Python_basics | 6a597442d39468295946cefbfb11d08f61424dc3 | [
"Unlicense"
] | 18 | 2019-08-01T07:45:02.000Z | 2022-03-31T18:05:44.000Z | leetcode_python/Sort/wiggle-sort-ii.py | yennanliu/Python_basics | 6a597442d39468295946cefbfb11d08f61424dc3 | [
"Unlicense"
] | null | null | null | leetcode_python/Sort/wiggle-sort-ii.py | yennanliu/Python_basics | 6a597442d39468295946cefbfb11d08f61424dc3 | [
"Unlicense"
] | 15 | 2019-12-29T08:46:20.000Z | 2022-03-08T14:14:05.000Z | # V0
# V1
# https://www.hrwhisper.me/leetcode-wiggle-sort-ii/
class Solution(object):
def wiggleSort(self, nums):
"""
:type nums: List[int]
:rtype: void Do not return anything, modify nums in-place instead.
"""
temp = sorted(nums)
s, t = (len(nums) + 1) >> 1, len(n... | 34.038462 | 103 | 0.468927 | 4,926 | 0.927684 | 0 | 0 | 0 | 0 | 0 | 0 | 1,116 | 0.210169 |
285af3b4261da560e2b691c6b8e6dc0c7a368402 | 517 | py | Python | model/Rules/ZigZag.py | GigliOneiric/ElliotWave | 5d0fc166530a57132dce4e4c00ecb33cb8101aaa | [
"Apache-2.0"
] | null | null | null | model/Rules/ZigZag.py | GigliOneiric/ElliotWave | 5d0fc166530a57132dce4e4c00ecb33cb8101aaa | [
"Apache-2.0"
] | null | null | null | model/Rules/ZigZag.py | GigliOneiric/ElliotWave | 5d0fc166530a57132dce4e4c00ecb33cb8101aaa | [
"Apache-2.0"
] | null | null | null | import config.Text
class ZigZag:
def __init__(self, name: str):
self._name = name
@property
def name(self):
return self._name
@property
def conditions(self):
conditions = {
'wa_b': {
config.Text.waves: ['waveA', 'waveB'],
config... | 21.541667 | 97 | 0.54352 | 495 | 0.957447 | 0 | 0 | 409 | 0.791103 | 0 | 0 | 50 | 0.096712 |
285ef9691cdce93a606e382f9fdd9a1cebb1c5b6 | 232 | py | Python | views.py | Rexypoo/shortnsweet | e773f01f2fdd6630b8d649232b48a753aa387c4f | [
"Apache-2.0"
] | null | null | null | views.py | Rexypoo/shortnsweet | e773f01f2fdd6630b8d649232b48a753aa387c4f | [
"Apache-2.0"
] | null | null | null | views.py | Rexypoo/shortnsweet | e773f01f2fdd6630b8d649232b48a753aa387c4f | [
"Apache-2.0"
] | null | null | null | from django.shortcuts import get_object_or_404, redirect, render
from .models import ShortURL
def redirect_alias(request, short_name):
shorturl = get_object_or_404(ShortURL, alias=short_name)
return redirect(shorturl.url)
| 29 | 64 | 0.806034 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
285f254edbac663963266cf598f4a69429de61bf | 4,153 | py | Python | pyautomailer/command_line.py | matteocappello94/pyautomailer | 933c23426d00d32543da3af03fe67a7e8fa38247 | [
"MIT"
] | null | null | null | pyautomailer/command_line.py | matteocappello94/pyautomailer | 933c23426d00d32543da3af03fe67a7e8fa38247 | [
"MIT"
] | 2 | 2018-08-08T07:51:14.000Z | 2018-08-10T14:35:32.000Z | pyautomailer/command_line.py | matteocappello94/pyautomailer | 933c23426d00d32543da3af03fe67a7e8fa38247 | [
"MIT"
] | null | null | null | import argparse
import sys
import logging as log
from pyautomailer import PyAutoMailer, PyAutoMailerMode
def main():
parser = parse_args(sys.argv[1:])
# Auto mailer init.
am = PyAutoMailer(parser.sender,
parser.host,
parser.port,
parser.use... | 36.752212 | 79 | 0.575969 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,227 | 0.295449 |
285fac9d4a82de6931604146cf170d6983d5310f | 4,225 | py | Python | test-suite/handwritten-src/python/test_foo_interface.py | trafi/trafi-djinni | 47cd2c849782e2ab4b38e5dc6a5a3104cc87f673 | [
"Apache-2.0"
] | 16 | 2020-10-18T20:09:29.000Z | 2022-02-21T07:11:13.000Z | test-suite/handwritten-src/python/test_foo_interface.py | trafi/trafi-djinni | 47cd2c849782e2ab4b38e5dc6a5a3104cc87f673 | [
"Apache-2.0"
] | 53 | 2020-10-13T20:08:29.000Z | 2022-03-10T14:59:50.000Z | test-suite/handwritten-src/python/test_foo_interface.py | trafi/trafi-djinni | 47cd2c849782e2ab4b38e5dc6a5a3104cc87f673 | [
"Apache-2.0"
] | 13 | 2020-10-16T20:31:36.000Z | 2022-01-28T15:37:05.000Z | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
# Example code written by a python developer to access cpp implementation of Foo
# This file should be hand-written by a python developer
from foo_interface import FooInterface
from djinni.support import decode... | 31.296296 | 108 | 0.626509 | 957 | 0.226188 | 0 | 0 | 0 | 0 | 0 | 0 | 1,137 | 0.268731 |
286006999e3a7c33bbad8b78611b5c41448309f0 | 4,324 | py | Python | examples/dvrl_asr/dvrl_asr_finetuning.py | SeunghyunSEO/seosh_fairseq | 443b2a8effb6b8fba5758989076cf992470ccb62 | [
"MIT"
] | null | null | null | examples/dvrl_asr/dvrl_asr_finetuning.py | SeunghyunSEO/seosh_fairseq | 443b2a8effb6b8fba5758989076cf992470ccb62 | [
"MIT"
] | 2 | 2022-02-22T08:28:06.000Z | 2022-02-22T09:26:26.000Z | examples/dvrl_asr/dvrl_asr_finetuning.py | SeunghyunSEO/seosh_fairseq | 443b2a8effb6b8fba5758989076cf992470ccb62 | [
"MIT"
] | null | null | null | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
import logging
import os
import to... | 36.336134 | 132 | 0.698196 | 3,115 | 0.720398 | 0 | 0 | 3,203 | 0.740749 | 0 | 0 | 758 | 0.175301 |
286032d47c652ffe5a80685b84caa53cf8ed1a03 | 2,727 | py | Python | opensource/opencv/write_to_video.py | marciojv/hacks-cognitives-plataforms | 5b43f52d6afde4ad2768ad5b85e376578e2c9b2f | [
"Apache-2.0"
] | 1 | 2021-05-14T18:43:51.000Z | 2021-05-14T18:43:51.000Z | opensource/opencv/write_to_video.py | marciojv/hacks-cognitives-plataforms | 5b43f52d6afde4ad2768ad5b85e376578e2c9b2f | [
"Apache-2.0"
] | null | null | null | opensource/opencv/write_to_video.py | marciojv/hacks-cognitives-plataforms | 5b43f52d6afde4ad2768ad5b85e376578e2c9b2f | [
"Apache-2.0"
] | 9 | 2019-02-04T22:08:08.000Z | 2021-07-17T12:12:12.000Z | # para executar
# python write_to_video.py --output example.avi
# ou
# python write_to_video.py --output example.avi --picamera 1
# python -m pip install imutils
from __future__ import print_function
from imutils.video import VideoStream
import numpy as np
import argparse
import imutils
import time
import cv2
#https:... | 27.826531 | 71 | 0.69527 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,401 | 0.513751 |
2860ad63802d9b4247cfc5b4ea2a3cd53137c044 | 3,973 | py | Python | src/anaplan_api/Upload.py | pieter-pot/anaplan-api | 1b099cb102f98b114afa0794a40aaf0de19956c1 | [
"BSD-2-Clause"
] | null | null | null | src/anaplan_api/Upload.py | pieter-pot/anaplan-api | 1b099cb102f98b114afa0794a40aaf0de19956c1 | [
"BSD-2-Clause"
] | null | null | null | src/anaplan_api/Upload.py | pieter-pot/anaplan-api | 1b099cb102f98b114afa0794a40aaf0de19956c1 | [
"BSD-2-Clause"
] | null | null | null | # ===============================================================================
# Created: 1 Nov 2021
# @author: Jesse Wilson (Anaplan Asia Pte Ltd)
# Description: Abstract Anaplan Authentication Class
# Input: Username & Password, or SHA keypair
# Output: Anaplan JWT and token expiry time
# ================... | 29.87218 | 106 | 0.686383 | 3,387 | 0.852504 | 0 | 0 | 0 | 0 | 0 | 0 | 2,235 | 0.562547 |
286195dbc7f21dde0f07a4dbc6375c32996ea510 | 561 | py | Python | oppadc/osutimingpoint.py | jamuwu/oppadc.py | 3faca744143575f0a4f12f213745b0f311973526 | [
"MIT"
] | 8 | 2019-11-01T00:03:52.000Z | 2021-01-02T18:33:31.000Z | oppadc/osutimingpoint.py | jamuwu/oppadc.py | 3faca744143575f0a4f12f213745b0f311973526 | [
"MIT"
] | 7 | 2019-12-16T16:29:07.000Z | 2021-02-22T01:01:22.000Z | oppadc/osutimingpoint.py | jamuwu/oppadc.py | 3faca744143575f0a4f12f213745b0f311973526 | [
"MIT"
] | 9 | 2019-12-16T21:58:21.000Z | 2022-02-02T12:18:45.000Z | class OsuTimingPoint(object):
"""
representats a timingpoint in osu
if change is False:
ms_per_beat = -100.0 * bpm_multiplier
"""
def __init__(self, starttime:float or str=0.0, ms_per_beat:float or str=-100.0, change:bool=False):
self.starttime:float = float(starttime)
self.ms_per_beat:float = float(ms_... | 29.526316 | 128 | 0.71836 | 560 | 0.998217 | 0 | 0 | 0 | 0 | 0 | 0 | 228 | 0.406417 |
28631cb627e7dcbf9512e0e9d35ed83e8378693a | 427 | py | Python | startPWM.py | adeept/adeept_alter | 6adf00eb141405fc3abad44965f81ba7797dd962 | [
"MIT"
] | 1 | 2021-12-21T15:50:57.000Z | 2021-12-21T15:50:57.000Z | startPWM.py | adeept/adeept_alter | 6adf00eb141405fc3abad44965f81ba7797dd962 | [
"MIT"
] | 2 | 2021-03-14T22:05:42.000Z | 2021-07-19T22:13:37.000Z | startPWM.py | adeept/adeept_alter | 6adf00eb141405fc3abad44965f81ba7797dd962 | [
"MIT"
] | null | null | null | import Adafruit_PCA9685
pwm = Adafruit_PCA9685.PCA9685()
pwm.set_pwm_freq(50)
initPWM = 320
setPWM = initPWM
ctrlPort = 11
def main():
global setPWM
while 1:
commandInput = input()
if commandInput == 'w':
setPWM += 1
elif commandInput == 's':
setPWM -= 1
pwm.set_pwm(ctrlPort, 0,... | 16.423077 | 35 | 0.651054 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 | 0.014052 |
28658c7c561044400a64c09359dccf6abba3fb8e | 2,042 | py | Python | get_tracks.py | RamonPuon/Spotipy-Valence-Analysis | 05f48e068097839d3dbd47d06f69608e48d1ac16 | [
"MIT"
] | null | null | null | get_tracks.py | RamonPuon/Spotipy-Valence-Analysis | 05f48e068097839d3dbd47d06f69608e48d1ac16 | [
"MIT"
] | null | null | null | get_tracks.py | RamonPuon/Spotipy-Valence-Analysis | 05f48e068097839d3dbd47d06f69608e48d1ac16 | [
"MIT"
] | null | null | null | #cred.py, python script with my client ID and my client secret
import cred
import spotipy
from spotipy.oauth2 import SpotifyClientCredentials
import pandas as pd
client_credential_manager = SpotifyClientCredentials(client_id= cred.client_ID, client_secret= cred.client_SECRET)
sp = spotipy.Spotify(client_credentials_ma... | 39.269231 | 114 | 0.644466 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 518 | 0.253673 |
28673f63b24f6a069e726650a9df5d529a4e2b9c | 3,053 | py | Python | Uzura/data/subsystem/stream.py | jskny/Uzura | 356f8c25ceef5bd098b8e338e4acabb3f8653dca | [
"MIT"
] | null | null | null | Uzura/data/subsystem/stream.py | jskny/Uzura | 356f8c25ceef5bd098b8e338e4acabb3f8653dca | [
"MIT"
] | null | null | null | Uzura/data/subsystem/stream.py | jskny/Uzura | 356f8c25ceef5bd098b8e338e4acabb3f8653dca | [
"MIT"
] | null | null | null | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# ユーザーストリームで流れているアカウントの画像を片っ端から取得、保存。
# Perl の名刺化スクリプトと連携せよ。
# 2012 / 11 / 14
# jskny
# http://d.hatena.ne.jp/iacctech/20110429/1304090609
import sys, tweepy, urllib, urllib2
import os, time, subprocess, socket
import re
from tweepy.streaming import StreamListener, ... | 24.821138 | 263 | 0.717327 | 1,419 | 0.407876 | 0 | 0 | 0 | 0 | 0 | 0 | 1,418 | 0.407588 |
286a9f1d8d066c57291a41e5d9d48a731a2d4a0c | 541 | py | Python | templates/django/djangoRest/app_dir/user/test/test_user_views.py | david-osas/create-basic-app | 860fc579672855093ad8426fb01d010de4c7cff8 | [
"MIT"
] | 2 | 2020-12-01T11:33:36.000Z | 2020-12-01T12:25:49.000Z | django-rest-framework-boilerplate/app_dir/user/test/test_user_views.py | PiotrZak/lem-golem | 78f91f21b19725fca99c05d8c536330ef2785064 | [
"MIT"
] | 2 | 2020-11-25T14:38:57.000Z | 2020-11-25T22:55:25.000Z | templates/django/djangoRest/app_dir/user/test/test_user_views.py | david-osas/create-basic-app | 860fc579672855093ad8426fb01d010de4c7cff8 | [
"MIT"
] | 2 | 2020-11-26T08:59:50.000Z | 2021-03-30T20:01:06.000Z | from django.test import TestCase
from django.urls import reverse
from rest_framework.test import APIClient
from ...factories import UserFactory
class UserViewTest(TestCase):
def setUp(self):
self.client = APIClient()
self.user = UserFactory()
self.client.force_authenticate(user=self.user)
... | 28.473684 | 54 | 0.698706 | 394 | 0.728281 | 0 | 0 | 0 | 0 | 0 | 0 | 14 | 0.025878 |
286ba9afaaf93ad96524d8cf507a1bf2ad30a104 | 2,862 | py | Python | port_mapping.py | sbalasa/CiscoFMC | 024c9b6df3513e1e4a8e3e3f976a0c67b58c1909 | [
"MIT"
] | 1 | 2021-11-09T03:56:29.000Z | 2021-11-09T03:56:29.000Z | port_mapping.py | sbalasa/CiscoFMC | 024c9b6df3513e1e4a8e3e3f976a0c67b58c1909 | [
"MIT"
] | null | null | null | port_mapping.py | sbalasa/CiscoFMC | 024c9b6df3513e1e4a8e3e3f976a0c67b58c1909 | [
"MIT"
] | 1 | 2021-11-09T03:56:06.000Z | 2021-11-09T03:56:06.000Z | ports = {
"ssh": {"type": "PortLiteral", "port": "22", "protocol": "6",},
"udp/netbios-dgm": {"type": "PortLiteral", "port": "138", "protocol": "17",},
"udp/netbios-ns": {"type": "PortLiteral", "port": "137", "protocol": "17",},
"tcp/ssh": {"type": "PortLiteral", "port": "22", "protocol": "6",},
... | 57.24 | 82 | 0.490217 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,930 | 0.674354 |
286dae799942d25528e620a011ce5d17032d1ce7 | 2,336 | py | Python | deep-learning-lab-00/binlogreg.py | BalderOdinson/Deep-Learning-Lab | 70786ff1be40fc829d64a644585c1d5683c76538 | [
"MIT"
] | null | null | null | deep-learning-lab-00/binlogreg.py | BalderOdinson/Deep-Learning-Lab | 70786ff1be40fc829d64a644585c1d5683c76538 | [
"MIT"
] | null | null | null | deep-learning-lab-00/binlogreg.py | BalderOdinson/Deep-Learning-Lab | 70786ff1be40fc829d64a644585c1d5683c76538 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Mon Mar 18 18:38:38 2019
@author: Oshikuru
"""
import numpy as np
import matplotlib.pyplot as plt
import random
import data
import pdb
import IPython
param_delta = 0.5
param_niter = 100
param_lambda = 0.01
def binlogreg_classify(X, w, b):
scores = np.dot(X, w) + b
ret... | 24.851064 | 141 | 0.610445 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 703 | 0.300556 |
286e9cde8312920eabbf75c1a2872023f23ceb28 | 778 | py | Python | LintCode/1103.py | RENHANFEI/LintCode | d572dee248ba4c2a95b52cd737d76c7297f4e7b4 | [
"CNRI-Python"
] | null | null | null | LintCode/1103.py | RENHANFEI/LintCode | d572dee248ba4c2a95b52cd737d76c7297f4e7b4 | [
"CNRI-Python"
] | null | null | null | LintCode/1103.py | RENHANFEI/LintCode | d572dee248ba4c2a95b52cd737d76c7297f4e7b4 | [
"CNRI-Python"
] | null | null | null | from collections import Counter
class Solution:
"""
@param nums: a list of integers
@return: return a boolean
"""
def isPossible(self, nums):
left = Counter(nums) # record nums not placed
end = Counter() # record subsequences ended with certain num
for num in ... | 25.933333 | 71 | 0.417738 | 731 | 0.939589 | 0 | 0 | 0 | 0 | 0 | 0 | 145 | 0.186375 |
286fb0783887ca84bf84591d7e276b7bf74e2f66 | 2,867 | py | Python | safe_eval/default_rules.py | bentheiii/safe_eval | caf9e7a6df3d6029e4bdac2abe11326d55c09ed2 | [
"MIT"
] | 1 | 2021-05-16T17:24:05.000Z | 2021-05-16T17:24:05.000Z | safe_eval/default_rules.py | bentheiii/safe_eval | caf9e7a6df3d6029e4bdac2abe11326d55c09ed2 | [
"MIT"
] | null | null | null | safe_eval/default_rules.py | bentheiii/safe_eval | caf9e7a6df3d6029e4bdac2abe11326d55c09ed2 | [
"MIT"
] | null | null | null | from _ast import In, NotIn, Is, IsNot
from collections import deque, Counter
from decimal import Decimal
from fractions import Fraction
from safe_eval.rules import BinOpRule, CallableTypeRule, CallableRule, GetattrTypeRule, CallableMethodRule
k_view_type = type({}.keys())
v_view_type = type({}.values())
it_view_type ... | 31.505495 | 118 | 0.702825 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 69 | 0.024067 |
2870b3250a7dca1e04fe54265450ad0c248653be | 6,745 | py | Python | test/lib/mayaUsd/render/vp2RenderDelegate/testVP2RenderDelegatePointInstanceSelection.py | ika-rporter/maya-usd | 8f216a4fb955fc44c0abda55caa53ed295aaa625 | [
"Apache-2.0"
] | 507 | 2019-07-30T20:05:10.000Z | 2022-03-30T07:38:43.000Z | test/lib/mayaUsd/render/vp2RenderDelegate/testVP2RenderDelegatePointInstanceSelection.py | ika-rporter/maya-usd | 8f216a4fb955fc44c0abda55caa53ed295aaa625 | [
"Apache-2.0"
] | 1,188 | 2019-07-31T11:27:27.000Z | 2022-03-31T21:06:06.000Z | test/lib/mayaUsd/render/vp2RenderDelegate/testVP2RenderDelegatePointInstanceSelection.py | ika-rporter/maya-usd | 8f216a4fb955fc44c0abda55caa53ed295aaa625 | [
"Apache-2.0"
] | 165 | 2019-07-30T22:27:57.000Z | 2022-03-25T07:20:23.000Z | #!/usr/bin/env mayapy
#
# Copyright 2021 Autodesk
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 37.265193 | 100 | 0.697999 | 5,881 | 0.871905 | 0 | 0 | 2,697 | 0.399852 | 0 | 0 | 1,835 | 0.272053 |
2871778d5e8e5178dee6f9e80da7e8ac737d84a0 | 5,443 | py | Python | cy_widgets/strategy/exchange/base.py | cragod/CYWidgets | b1df1e32c363ed9252737d3041a7557b1dc604fe | [
"MIT"
] | 1 | 2021-06-17T02:25:25.000Z | 2021-06-17T02:25:25.000Z | cy_widgets/strategy/exchange/base.py | cragod/CYWidgets | b1df1e32c363ed9252737d3041a7557b1dc604fe | [
"MIT"
] | null | null | null | cy_widgets/strategy/exchange/base.py | cragod/CYWidgets | b1df1e32c363ed9252737d3041a7557b1dc604fe | [
"MIT"
] | 1 | 2021-12-08T06:50:33.000Z | 2021-12-08T06:50:33.000Z | # -*- coding: utf-8 -*-
import numpy as np
import talib as ta
from abc import ABC, abstractproperty, abstractclassmethod, abstractmethod
class BaseExchangeStrategy(ABC):
"""交易策略基类"""
shortable = True # 能否做空
leverage = 1 # 策略杠杆
def __init__(self, *initial_data, **kwargs):
"""支持按字典方式传入参数信息"""... | 35.344156 | 165 | 0.533346 | 6,299 | 0.978257 | 0 | 0 | 1,210 | 0.187917 | 0 | 0 | 2,241 | 0.348035 |
287237c213c17fd114b9833d581d53122d6ad18d | 492 | py | Python | app/core/admin/__init__.py | 3darkman/faction-builder-api | 9dda323ef44a1ca0976306a4f20f9cc3e13704ec | [
"MIT"
] | null | null | null | app/core/admin/__init__.py | 3darkman/faction-builder-api | 9dda323ef44a1ca0976306a4f20f9cc3e13704ec | [
"MIT"
] | null | null | null | app/core/admin/__init__.py | 3darkman/faction-builder-api | 9dda323ef44a1ca0976306a4f20f9cc3e13704ec | [
"MIT"
] | null | null | null | from django.contrib import admin
from core import models
from .category import CategoryAdmin
from .trait import TraitAdmin
from .user import UserAdmin
admin.site.register(models.User, UserAdmin)
admin.site.register(models.Ability)
admin.site.register(models.Category, CategoryAdmin)
admin.site.register(models.Trait, ... | 28.941176 | 51 | 0.835366 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
287358c4458cfef128d6223f0355c87f498e047c | 2,196 | py | Python | src/predict_video_file.py | irfanmustafas/TeethClassifierCNN | 8c58b50162b3f9eb7f12251cbca9fcbd4d6c43b7 | [
"MIT"
] | 1 | 2018-12-05T01:49:54.000Z | 2018-12-05T01:49:54.000Z | src/predict_video_file.py | irfanmustafas/TeethClassifierCNN | 8c58b50162b3f9eb7f12251cbca9fcbd4d6c43b7 | [
"MIT"
] | null | null | null | src/predict_video_file.py | irfanmustafas/TeethClassifierCNN | 8c58b50162b3f9eb7f12251cbca9fcbd4d6c43b7 | [
"MIT"
] | null | null | null | import numpy as np
import sys
import caffe
import glob
import uuid
import cv2
from util import transform_img
from mouth_detector_dlib import mouth_detector
from caffe.proto import caffe_pb2
import os
import shutil
from util import histogram_equalization
from teeth_cnn import teeth_cnn
mouth_detector_instance = mouth_d... | 31.371429 | 89 | 0.679417 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 268 | 0.12204 |
28738d283bf4868349454e25d748bec7dc9a9c6f | 33,650 | py | Python | sdk/python/pulumi_gcp/dataloss/prevention_deidentify_template.py | sisisin/pulumi-gcp | af6681d70ea457843409110c1324817fe55f68ad | [
"ECL-2.0",
"Apache-2.0"
] | 121 | 2018-06-18T19:16:42.000Z | 2022-03-31T06:06:48.000Z | sdk/python/pulumi_gcp/dataloss/prevention_deidentify_template.py | sisisin/pulumi-gcp | af6681d70ea457843409110c1324817fe55f68ad | [
"ECL-2.0",
"Apache-2.0"
] | 492 | 2018-06-22T19:41:03.000Z | 2022-03-31T15:33:53.000Z | sdk/python/pulumi_gcp/dataloss/prevention_deidentify_template.py | sisisin/pulumi-gcp | af6681d70ea457843409110c1324817fe55f68ad | [
"ECL-2.0",
"Apache-2.0"
] | 43 | 2018-06-19T01:43:13.000Z | 2022-03-23T22:43:37.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... | 56.841216 | 422 | 0.624101 | 33,146 | 0.985022 | 0 | 0 | 30,805 | 0.915453 | 0 | 0 | 25,512 | 0.758158 |
2874251d928931a6c2a13448e5d757c4351cb292 | 2,163 | py | Python | examples/quickstart.py | miketlk/omfgp | 6e5a0f52f2688d81bde3e5169a37311c9517fe1d | [
"MIT"
] | null | null | null | examples/quickstart.py | miketlk/omfgp | 6e5a0f52f2688d81bde3e5169a37311c9517fe1d | [
"MIT"
] | null | null | null | examples/quickstart.py | miketlk/omfgp | 6e5a0f52f2688d81bde3e5169a37311c9517fe1d | [
"MIT"
] | 1 | 2021-08-16T10:19:52.000Z | 2021-08-16T10:19:52.000Z | import sys
import omfgp as gp
import time
if gp.USES_USCARD:
import uscard
from machine import Pin
def get_default_reader():
"""Return default smart card reader."""
if gp.USES_USCARD:
return uscard.Reader(name="Smart card reader",
ifaceId=2,
... | 32.283582 | 77 | 0.631993 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 589 | 0.272307 |
28742e12e6739c290a95e278f025627ff9c82803 | 685 | py | Python | basic/myunittest/test_timeit.py | fplust/python3-cookbook | 0eaca2e3631bb69deaf466c32023bbb2093513da | [
"Apache-2.0"
] | 1 | 2019-07-25T09:09:54.000Z | 2019-07-25T09:09:54.000Z | basic/myunittest/test_timeit.py | fplust/python3-cookbook | 0eaca2e3631bb69deaf466c32023bbb2093513da | [
"Apache-2.0"
] | null | null | null | basic/myunittest/test_timeit.py | fplust/python3-cookbook | 0eaca2e3631bb69deaf466c32023bbb2093513da | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
Topic: 基准测试
Desc :
"""
from timeit import timeit
__author__ = 'Xiong Neng'
class Stock():
# 鼓励使用__slots__提升性能
__slots__ = ["name", "shares", "price"]
def __init__(self, name, shares, price):
self.name = name
self.shares = shares... | 17.125 | 58 | 0.563504 | 224 | 0.315938 | 0 | 0 | 0 | 0 | 0 | 0 | 268 | 0.377997 |
28753e72046917448d518c1d4a909cdfe502ee60 | 7,276 | py | Python | tectosaur2/hmatrix/tree.py | tbenthompson/BIE_tutorials | 02cd56ab7e63e36afc4a10db17072076541aab77 | [
"MIT"
] | 15 | 2021-08-31T15:02:45.000Z | 2022-02-11T21:10:01.000Z | tectosaur2/hmatrix/tree.py | tbenthompson/BIE_tutorials | 02cd56ab7e63e36afc4a10db17072076541aab77 | [
"MIT"
] | 79 | 2021-08-29T15:35:39.000Z | 2022-03-25T14:56:42.000Z | tectosaur2/hmatrix/tree.py | tbenthompson/BIE_tutorials | 02cd56ab7e63e36afc4a10db17072076541aab77 | [
"MIT"
] | 3 | 2022-03-12T14:44:41.000Z | 2022-03-21T20:43:20.000Z | from dataclasses import dataclass
from typing import Optional
import matplotlib.pyplot as plt
import numpy as np
@dataclass()
class TreeNode:
idx_start: int
idx_end: int
center: np.ndarray
radius: float
is_leaf: bool
left: Optional["TreeNode"]
right: Optional["TreeNode"]
@dataclass()
cl... | 35.149758 | 94 | 0.665063 | 464 | 0.063771 | 0 | 0 | 503 | 0.069131 | 0 | 0 | 2,450 | 0.336723 |
2875e4f861693b2c0256a550012c98712e49a11c | 644 | py | Python | 2017/day2/corruptionChecksum.py | madeleine-adams/advent_of_code_2020 | 8f142a91d1a40390aad274c5e0513f50b168d029 | [
"MIT"
] | null | null | null | 2017/day2/corruptionChecksum.py | madeleine-adams/advent_of_code_2020 | 8f142a91d1a40390aad274c5e0513f50b168d029 | [
"MIT"
] | null | null | null | 2017/day2/corruptionChecksum.py | madeleine-adams/advent_of_code_2020 | 8f142a91d1a40390aad274c5e0513f50b168d029 | [
"MIT"
] | null | null | null | file = open('corruptionChecksum_input.txt', 'r')
spreadsheet = file.readlines()
def find_smallest(inputs):
smallest = int(inputs[0])
for value in inputs:
number = int(value)
if number < smallest:
smallest = number
return smallest
def find_largest(inputs):
largest = int(in... | 20.774194 | 48 | 0.636646 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 33 | 0.051242 |
287609c52314ac1d737c0937fa4d8b3058a4d68f | 3,579 | py | Python | neurst/cli/inspect_checkpoint.py | ishine/neurst | 2ba322393fcfed4261b33f4a657e12bbe321baaa | [
"Apache-2.0"
] | 208 | 2020-11-12T03:56:41.000Z | 2022-03-27T07:01:27.000Z | neurst/cli/inspect_checkpoint.py | ishine/neurst | 2ba322393fcfed4261b33f4a657e12bbe321baaa | [
"Apache-2.0"
] | 16 | 2021-02-20T07:57:03.000Z | 2022-01-27T07:36:31.000Z | neurst/cli/inspect_checkpoint.py | ishine/neurst | 2ba322393fcfed4261b33f4a657e12bbe321baaa | [
"Apache-2.0"
] | 33 | 2020-11-12T04:44:50.000Z | 2022-03-23T09:22:29.000Z | # Copyright 2020 ByteDance Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | 41.137931 | 103 | 0.658843 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,312 | 0.366583 |
28762253888319609860c7b7288acdb032a74ac2 | 1,621 | py | Python | homepage/migrations/0005_professor_test_data.py | oriAdler/ClassRater | a68492ea8eab1475ab604da9d6efc99c73954d4b | [
"MIT"
] | 1 | 2021-04-12T18:05:12.000Z | 2021-04-12T18:05:12.000Z | homepage/migrations/0005_professor_test_data.py | ellaml/ClassRater | d786f9fb4bb51041590e46165badf12a7beef67e | [
"MIT"
] | 103 | 2021-03-09T07:12:20.000Z | 2021-05-23T06:13:21.000Z | homepage/migrations/0005_professor_test_data.py | ellaml/ClassRater | d786f9fb4bb51041590e46165badf12a7beef67e | [
"MIT"
] | 17 | 2021-03-09T07:07:44.000Z | 2021-05-02T16:31:45.000Z | from django.db import migrations, transaction
class Migration(migrations.Migration):
dependencies = [
('homepage', '0001_initial'),
('homepage', '0003_course_test_data'),
('homepage', '0004_followed_courses_test_data'),
]
def generate_data(apps, schema_editor):
... | 33.770833 | 76 | 0.595312 | 1,568 | 0.967304 | 0 | 0 | 0 | 0 | 0 | 0 | 368 | 0.22702 |
2876482aeef7877b4183338fac2e85b74a0eaedf | 1,220 | py | Python | scripts/hsvanalyzer.py | acmerobotics/relic-recovery | 4ff05bbf906829aef0a98bc32691e5d0eadc1d8f | [
"MIT"
] | 32 | 2018-01-17T03:00:02.000Z | 2022-01-15T18:30:48.000Z | scripts/hsvanalyzer.py | acmerobotics/relic-recovery | 4ff05bbf906829aef0a98bc32691e5d0eadc1d8f | [
"MIT"
] | 4 | 2017-10-21T20:28:27.000Z | 2018-04-02T05:27:00.000Z | scripts/hsvanalyzer.py | acmerobotics/relic-recovery | 4ff05bbf906829aef0a98bc32691e5d0eadc1d8f | [
"MIT"
] | 7 | 2018-02-21T00:59:20.000Z | 2021-01-21T21:52:17.000Z | import cv2
import numpy as np
from matplotlib import pyplot as plt
from util import resize_min_dim, smart_hsv_range
IMAGE_FILENAME = '/Users/ryanbrott/Desktop/36.jpg'
MIN_DIMENSION = 480
# LOWER_HSV, UPPER_HSV = (170, 80, 0), (7, 255, 255)
LOWER_HSV, UPPER_HSV = (175, 80, 80), (22, 255, 255)
image = cv2.imread(IMAGE_... | 23.461538 | 76 | 0.705738 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 137 | 0.112295 |
2876ee5a4ee75e47b6a9d9c1abc057001acf18bc | 1,114 | py | Python | FEniCSUI/AnalysesHub/models.py | nasserarbabi/FEniCSUI-dev | f8f161e1b49932843e01301212e7d031fff4f6c8 | [
"MIT"
] | null | null | null | FEniCSUI/AnalysesHub/models.py | nasserarbabi/FEniCSUI-dev | f8f161e1b49932843e01301212e7d031fff4f6c8 | [
"MIT"
] | 8 | 2021-03-10T21:59:52.000Z | 2021-09-22T19:12:57.000Z | FEniCSUI/AnalysesHub/models.py | nasserarbabi/FEniCSUI | f8f161e1b49932843e01301212e7d031fff4f6c8 | [
"MIT"
] | null | null | null | from django.db import models
from dashboard.models import projects
class AnalysisConfig(models.Model):
project = models.OneToOneField(
projects,
on_delete=models.CASCADE,
primary_key=True)
mesh = models.TextField()
visualizationMesh = models.TextField()
config = models.TextFiel... | 23.208333 | 42 | 0.672352 | 1,037 | 0.93088 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2877efb3076b7e16a9739c3098ef12ad38d235d3 | 1,924 | py | Python | code/pyto/util/test/_test_numpy_plus.py | anmartinezs/pyseg_system | 5bb07c7901062452a34b73f376057cabc15a13c3 | [
"Apache-2.0"
] | 12 | 2020-01-08T01:33:02.000Z | 2022-03-16T00:25:34.000Z | code/pyto/util/test/_test_numpy_plus.py | anmartinezs/pyseg_system | 5bb07c7901062452a34b73f376057cabc15a13c3 | [
"Apache-2.0"
] | 8 | 2019-12-19T19:34:56.000Z | 2022-03-10T10:11:28.000Z | code/pyto/util/test/_test_numpy_plus.py | anmartinezs/pyseg_system | 5bb07c7901062452a34b73f376057cabc15a13c3 | [
"Apache-2.0"
] | 2 | 2022-03-30T13:12:22.000Z | 2022-03-30T18:12:10.000Z | """
ToDo: convert to proper format
Tests for modules in this directory
"""
from __future__ import print_function
# Author: Vladan Lucic, last modified 05.04.07
import scipy
import scipy.ndimage
import numpy
import pyto.util.numpy_plus as np_plus
# define test arrays
aa = numpy.arange(12, dtype='int32')
aa = aa.resh... | 26.722222 | 73 | 0.572245 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 397 | 0.206341 |
2878821e6aef46d6ef7a165e5a576c9bd3a04754 | 922 | py | Python | GithubRepositoryStatistics-Python3/Repository.py | SmileZXLee/GithubRepositoryStatistics | 62eeddd715aecf268c48b39aa596f1168a3c2661 | [
"MIT"
] | 1 | 2020-07-15T14:12:53.000Z | 2020-07-15T14:12:53.000Z | GithubRepositoryStatistics-Python3/Repository.py | SmileZXLee/GithubRepositoryStatistics | 62eeddd715aecf268c48b39aa596f1168a3c2661 | [
"MIT"
] | null | null | null | GithubRepositoryStatistics-Python3/Repository.py | SmileZXLee/GithubRepositoryStatistics | 62eeddd715aecf268c48b39aa596f1168a3c2661 | [
"MIT"
] | null | null | null | #coding=utf-8
__author__ = 'zxlee'
__github__ = 'https://github.com/SmileZXLee/GithubRepositoryStatistics'
class Repository :
def __init__(self,brief,url,language,star_count,fork_count,star_url,fork_url,is_fork):
#仓库介绍
self.brief = brief.replace('\r','').replace('\n','').replace('\t','').strip()
#仓库url
... | 26.342857 | 87 | 0.627983 | 893 | 0.889442 | 0 | 0 | 0 | 0 | 0 | 0 | 282 | 0.280876 |
287c433b713a1b08f3c14e17afb0adcebbc1cab6 | 3,242 | py | Python | src/www/__init__.py | jbrezmorf/codecritic | 190df65f2f12667469b55abed48a45de5dc18965 | [
"MIT"
] | null | null | null | src/www/__init__.py | jbrezmorf/codecritic | 190df65f2f12667469b55abed48a45de5dc18965 | [
"MIT"
] | 20 | 2019-05-26T12:13:19.000Z | 2020-09-09T16:37:09.000Z | src/www/__init__.py | jbrezmorf/codecritic | 190df65f2f12667469b55abed48a45de5dc18965 | [
"MIT"
] | 1 | 2020-04-13T09:02:48.000Z | 2020-04-13T09:02:48.000Z | #!/bin/python3
# author: Jan Hybs
import enum
import pathlib
from bson import objectid
from flask import Flask, redirect, session, render_template, url_for
import flask.json
from flask_cors import CORS
from loguru import logger
from entities.crates import ICrate
from env import Env
from functools import wraps
def ... | 25.936 | 82 | 0.612585 | 773 | 0.238433 | 0 | 0 | 972 | 0.299815 | 0 | 0 | 704 | 0.21715 |
287d78c0342acb7571ce49d00f17612456b0c4a2 | 18,740 | py | Python | pages/getAltData.py | ngocuong0105/ts_webapp | 4399862ead6eb2d0c993d36fffe14967984ad4b2 | [
"MIT"
] | null | null | null | pages/getAltData.py | ngocuong0105/ts_webapp | 4399862ead6eb2d0c993d36fffe14967984ad4b2 | [
"MIT"
] | null | null | null | pages/getAltData.py | ngocuong0105/ts_webapp | 4399862ead6eb2d0c993d36fffe14967984ad4b2 | [
"MIT"
] | null | null | null | import base64
from collections import deque
from io import BytesIO
import os
import time
from PIL import Image
import pandas as pd
from pandas.core.arrays import boolean
import praw
import requests
import streamlit as st
import datetime
import pytesseract
pytesseract.pytesseract.tesseract_cmd ='context/tesseract'
impo... | 44.513064 | 143 | 0.596265 | 18,333 | 0.977656 | 0 | 0 | 0 | 0 | 0 | 0 | 5,443 | 0.290262 |
287d866f9124af9905e3876a7fc982e255ffcb59 | 157 | py | Python | npt/pipelines/__init__.py | chbrandt/npt | 7d58db9987c8f4d93c4e61e1fc98cce38733d06e | [
"MIT"
] | null | null | null | npt/pipelines/__init__.py | chbrandt/npt | 7d58db9987c8f4d93c4e61e1fc98cce38733d06e | [
"MIT"
] | 2 | 2022-02-18T16:38:13.000Z | 2022-02-18T16:56:33.000Z | npt/pipelines/__init__.py | chbrandt/npt | 7d58db9987c8f4d93c4e61e1fc98cce38733d06e | [
"MIT"
] | 1 | 2022-03-15T09:03:51.000Z | 2022-03-15T09:03:51.000Z | from npt import log
from . import search as Search
from . import download as Download
from . import processing as Processing
from . import mosaic as Mosaic
| 22.428571 | 38 | 0.789809 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
287e24f0cb26f8666ac36c1761cfbf6bd7afe7ac | 252 | py | Python | PythonFiles/classes2.py | IamVaibhavsar/Python_Files | 283d73929a3e11955c71499407c4f8bff56e4273 | [
"MIT"
] | null | null | null | PythonFiles/classes2.py | IamVaibhavsar/Python_Files | 283d73929a3e11955c71499407c4f8bff56e4273 | [
"MIT"
] | null | null | null | PythonFiles/classes2.py | IamVaibhavsar/Python_Files | 283d73929a3e11955c71499407c4f8bff56e4273 | [
"MIT"
] | 1 | 2019-07-26T15:25:21.000Z | 2019-07-26T15:25:21.000Z | class Student:
def __init__(self,name,major,gpa):
self.name=name
self.major=major
self.gpa=gpa
def on_honor_roll (self):
if self.gpa>=8.5:
return True
else:
return False | 22.909091 | 39 | 0.519841 | 252 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
287f3fa6bbdc5def4722251d903f7d2865df6fbb | 324 | py | Python | config.py | Shutey/ShuteyBot2.0 | 16f0baf6e8725bb452cac06fa60d6db023212f6c | [
"MIT"
] | 2 | 2020-04-23T00:52:06.000Z | 2020-04-23T00:56:24.000Z | config.py | Shutey/ShuteyBot2.0 | 16f0baf6e8725bb452cac06fa60d6db023212f6c | [
"MIT"
] | null | null | null | config.py | Shutey/ShuteyBot2.0 | 16f0baf6e8725bb452cac06fa60d6db023212f6c | [
"MIT"
] | null | null | null | token = 'Mzc5NTc3MDc1NTU3NzI4MjU2.DXixQA.DLLB8b81nSyB1IGNJ6WeEeukAQU' #Put Your bots token here
prefix = '^^' #put prefix here
link = 'https://discordapp.com/oauth2/authorize?client_id=379577075557728256&scope=bot&permissions=134659080' #put bot invite link here
ownerid = '227860415709708288' #put your id here... | 36 | 136 | 0.774691 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 274 | 0.845679 |
28815fa52327ea951a0284d87cd467c55924b39e | 761 | py | Python | 540. Single Element in a Sorted Array.py | Into-Y0u/Github-Baby | 5e4e6b02f49c2c99533289be9d49911006cad919 | [
"MIT"
] | 2 | 2022-01-25T04:30:26.000Z | 2022-01-25T10:36:15.000Z | 540. Single Element in a Sorted Array.py | Into-Y0u/Leetcode-Baby | 681ad4df01ee908f76d888aa4ccc10f04c03c56f | [
"MIT"
] | null | null | null | 540. Single Element in a Sorted Array.py | Into-Y0u/Leetcode-Baby | 681ad4df01ee908f76d888aa4ccc10f04c03c56f | [
"MIT"
] | null | null | null | class Solution:
def singleNonDuplicate(self, nums: List[int]) -> int:
if len(nums) == 1:
return nums[0]
start = 0
end = len(nums) - 1
while start <= end:
mid = start + ((end - start) // 2)
# Check if mid is the single number
if start < ... | 34.590909 | 90 | 0.442838 | 760 | 0.998686 | 0 | 0 | 0 | 0 | 0 | 0 | 109 | 0.143233 |
2881d51b1365029af80a4c7b248cb3bb598a7958 | 3,466 | py | Python | frispy/throw_data.py | carrino/FrisPy | db9e59f465ee25d1c037d580c37da8f35b930b50 | [
"MIT"
] | null | null | null | frispy/throw_data.py | carrino/FrisPy | db9e59f465ee25d1c037d580c37da8f35b930b50 | [
"MIT"
] | null | null | null | frispy/throw_data.py | carrino/FrisPy | db9e59f465ee25d1c037d580c37da8f35b930b50 | [
"MIT"
] | null | null | null | # Copyright (c) 2021 John Carrino
import struct
from dataclasses import dataclass
import numpy as np
from scipy.spatial.transform import Rotation
@dataclass
class ThrowData:
NUM_POINTS = 2000
SENSORS_GRAVITY_STANDARD = 9.80665
SENSORS_DPS_TO_RADS = 0.017453293
OUTPUT_SCALE_FACTOR_400G = (SENSORS_GRAVI... | 35.731959 | 124 | 0.638777 | 3,306 | 0.953837 | 0 | 0 | 3,317 | 0.957011 | 0 | 0 | 55 | 0.015868 |
288275f551eb96263ac0a6a9893bc8305effff9d | 7,754 | py | Python | test/test_hankelutils.py | hlatkydavid/vnmrjpy | 48707a1000dc87e646e37c8bd686e695bd31a61e | [
"MIT"
] | null | null | null | test/test_hankelutils.py | hlatkydavid/vnmrjpy | 48707a1000dc87e646e37c8bd686e695bd31a61e | [
"MIT"
] | null | null | null | test/test_hankelutils.py | hlatkydavid/vnmrjpy | 48707a1000dc87e646e37c8bd686e695bd31a61e | [
"MIT"
] | null | null | null | import unittest
import vnmrjpy as vj
import numpy as np
import matplotlib.pyplot as plt
import time
#import cupy as cp
RP={'rcvrs':4,'filter_size':(11,7),'virtualcoilboost':False}
PLOTTING = False
class Test_hankelutils(unittest.TestCase):
def test_lvl2_hankel_average(self):
#rp={'rcvrs':4,'filter_s... | 39.969072 | 79 | 0.596595 | 7,553 | 0.974078 | 0 | 0 | 0 | 0 | 0 | 0 | 2,690 | 0.346918 |
2883fadc5c01ff1f187f68ba84f5e3ae0a52978b | 1,057 | py | Python | src/archive/test3.py | felipearcaro/indexing-repository-python | 4fa504d3535495b30db443cc753ebc56e7e329c2 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | src/archive/test3.py | felipearcaro/indexing-repository-python | 4fa504d3535495b30db443cc753ebc56e7e329c2 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | src/archive/test3.py | felipearcaro/indexing-repository-python | 4fa504d3535495b30db443cc753ebc56e7e329c2 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | #setup
import docx2txt
# extract text
text = docx2txt.process("../documents/ambev.docx")
text2 = docx2txt.process("../documents/ambev2.docx")
text3 = docx2txt.process("../documents/ambev3.docx")
from whoosh.fields import Schema, TEXT
schema = Schema(title=TEXT, content=TEXT)
import os, os.path
from whoosh import i... | 24.581395 | 53 | 0.746452 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 240 | 0.227058 |
28846fa1c1e9c7ab3ae95eddc73455be7f366a02 | 196 | py | Python | Source Code/web/backend/files_app/fileapi/urls.py | creosB/Virtual-pdf-library | edb334b16dfd0d3c616683f6fbb370e54f489560 | [
"CC0-1.0"
] | 11 | 2021-12-20T01:51:56.000Z | 2022-01-01T10:17:47.000Z | Source Code/web/backend/files_app/fileapi/urls.py | creosB/Virtual-pdf-library | edb334b16dfd0d3c616683f6fbb370e54f489560 | [
"CC0-1.0"
] | null | null | null | Source Code/web/backend/files_app/fileapi/urls.py | creosB/Virtual-pdf-library | edb334b16dfd0d3c616683f6fbb370e54f489560 | [
"CC0-1.0"
] | 1 | 2021-12-21T08:47:56.000Z | 2021-12-21T08:47:56.000Z | from django.urls import path
from .views import FileList, FileDetail
urlpatterns = [
path('',FileList.as_view()),
path('<int:pk>/',FileDetail.as_view()), # individual items from django
] | 24.5 | 74 | 0.704082 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 43 | 0.219388 |
288538cbd5c881814ddd71394b3b7fcabde021bf | 4,427 | py | Python | barcodes/generateBarcodes.py | sbarton272/AcousticBarcodes-Explorations | 73f019228988727575af7d67d1b7c7119f6c49a6 | [
"MIT"
] | null | null | null | barcodes/generateBarcodes.py | sbarton272/AcousticBarcodes-Explorations | 73f019228988727575af7d67d1b7c7119f6c49a6 | [
"MIT"
] | null | null | null | barcodes/generateBarcodes.py | sbarton272/AcousticBarcodes-Explorations | 73f019228988727575af7d67d1b7c7119f6c49a6 | [
"MIT"
] | null | null | null | """
Generate barcode images with various encodings
TODO
- Include text at bottom
- DXF instead
"""
#========================================================
# Imports
#========================================================
from dxfwrite import DXFEngine as dxf
#=====================================================... | 29.125 | 98 | 0.483171 | 3,089 | 0.697764 | 0 | 0 | 0 | 0 | 0 | 0 | 1,232 | 0.278292 |
2887834c88b90ae4d29891c6021442f87fb025c0 | 110 | py | Python | example/cheeseshop/apps/catalog/admin.py | sflems/django-constance | e177292c74cbf158c7218d8818d5d6c34b17eee1 | [
"BSD-3-Clause"
] | 899 | 2015-12-17T09:24:11.000Z | 2022-03-31T15:57:53.000Z | example/cheeseshop/apps/catalog/admin.py | sflems/django-constance | e177292c74cbf158c7218d8818d5d6c34b17eee1 | [
"BSD-3-Clause"
] | 342 | 2015-12-27T11:07:44.000Z | 2022-03-24T13:34:46.000Z | example/cheeseshop/apps/catalog/admin.py | sflems/django-constance | e177292c74cbf158c7218d8818d5d6c34b17eee1 | [
"BSD-3-Clause"
] | 213 | 2015-12-23T00:32:34.000Z | 2022-03-17T17:04:57.000Z | from django.contrib import admin
from cheeseshop.apps.catalog.models import Brand
admin.site.register(Brand)
| 22 | 48 | 0.836364 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
28878c846aed485a7bc9a73365300409e1defb8b | 672 | py | Python | leetcode/editor/cn/FindKPairsWithSmallestSums.py | huangge1199/leet-code-python | 5d01bbb6f12a495ea7ea0a90b5b3b4aa92bcc2f7 | [
"Apache-2.0"
] | 1 | 2022-02-12T13:55:41.000Z | 2022-02-12T13:55:41.000Z | leetcode/editor/cn/FindKPairsWithSmallestSums.py | huangge1199/leet-code-python | 5d01bbb6f12a495ea7ea0a90b5b3b4aa92bcc2f7 | [
"Apache-2.0"
] | null | null | null | leetcode/editor/cn/FindKPairsWithSmallestSums.py | huangge1199/leet-code-python | 5d01bbb6f12a495ea7ea0a90b5b3b4aa92bcc2f7 | [
"Apache-2.0"
] | null | null | null | # 373:查找和最小的 K 对数字
# leetcode submit region begin(Prohibit modification and deletion)
from heapq import heappop, heappush
from typing import List
class Solution:
def kSmallestPairs(self, nums1: List[int], nums2: List[int], k: int) -> List[List[int]]:
m, n = len(nums1), len(nums2)
ans = []
... | 33.6 | 92 | 0.578869 | 457 | 0.662319 | 0 | 0 | 0 | 0 | 0 | 0 | 166 | 0.24058 |
288bed12c190fb35b526a110b53eefe990c1f7a5 | 2,505 | py | Python | urls.py | Shakil-1501/Quizdjango | 5e201d0f05ce2a49d36484009ff6032821365bc6 | [
"MIT"
] | null | null | null | urls.py | Shakil-1501/Quizdjango | 5e201d0f05ce2a49d36484009ff6032821365bc6 | [
"MIT"
] | null | null | null | urls.py | Shakil-1501/Quizdjango | 5e201d0f05ce2a49d36484009ff6032821365bc6 | [
"MIT"
] | null | null | null | # Core Django imports.
from django.urls import path
from django.shortcuts import redirect, render
# LMS app imports
from lms.views.course.course_views import (
CourseListView,fetch_questions,compute_stats,display_lp,Edit_quiz,preview_quiz,fetch_questions_oneatatime,compute_html,enter_comment,quiz_lp
)
... | 22.567568 | 145 | 0.621956 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 773 | 0.308583 |
288fb0e62147ed4c6a19e3faeb3476a5404525aa | 270 | py | Python | rasterio/errors.py | clembou/rasterio | 57169c31dae04e1319b4c4b607345475a7122910 | [
"BSD-3-Clause"
] | null | null | null | rasterio/errors.py | clembou/rasterio | 57169c31dae04e1319b4c4b607345475a7122910 | [
"BSD-3-Clause"
] | null | null | null | rasterio/errors.py | clembou/rasterio | 57169c31dae04e1319b4c4b607345475a7122910 | [
"BSD-3-Clause"
] | null | null | null | """A module of errors."""
class RasterioIOError(IOError):
"""A failure to open a dataset using the presently registered drivers."""
class RasterioDriverRegistrationError(ValueError):
"""To be raised when, eg, _gdal.GDALGetDriverByName("MEM") returns NULL"""
| 27 | 78 | 0.733333 | 238 | 0.881481 | 0 | 0 | 0 | 0 | 0 | 0 | 172 | 0.637037 |
28935cc03b2db600110d382016ba629d850712b4 | 236 | py | Python | cloud_test_app/cloud_test/utils.py | gabrielamelian/django-docker-code-test | 0500980c519140460f66d3812da29e651a0d0ac6 | [
"Apache-2.0"
] | null | null | null | cloud_test_app/cloud_test/utils.py | gabrielamelian/django-docker-code-test | 0500980c519140460f66d3812da29e651a0d0ac6 | [
"Apache-2.0"
] | null | null | null | cloud_test_app/cloud_test/utils.py | gabrielamelian/django-docker-code-test | 0500980c519140460f66d3812da29e651a0d0ac6 | [
"Apache-2.0"
] | null | null | null |
def parse_boolean(value):
if type(value) == bool:
return value
if value in ['True', 'true', 'T', 't', '1']:
return True
if value in ['False', 'false', 'F', 'f', '0']:
return False
return False
| 19.666667 | 50 | 0.512712 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 44 | 0.186441 |