hexsha stringlengths 40 40 | size int64 6 782k | ext stringclasses 7
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 237 | max_stars_repo_name stringlengths 6 72 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses list | max_stars_count int64 1 53k ⌀ | 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 184 | max_issues_repo_name stringlengths 6 72 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses list | max_issues_count int64 1 27.1k ⌀ | 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 184 | max_forks_repo_name stringlengths 6 72 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses list | max_forks_count int64 1 12.2k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 6 782k | avg_line_length float64 2.75 664k | max_line_length int64 5 782k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
c0a79ab959d5dca8d2473f6c707220cf00356549 | 2,585 | py | Python | cloudmesh_apachestorm/cloudmesh_apachestorm/command_apachestorm.py | futuresystems/465-oliverlewis | c1a093e9de012e752a2277c4fb533cbd974a5a8d | [
"Apache-2.0"
] | null | null | null | cloudmesh_apachestorm/cloudmesh_apachestorm/command_apachestorm.py | futuresystems/465-oliverlewis | c1a093e9de012e752a2277c4fb533cbd974a5a8d | [
"Apache-2.0"
] | null | null | null | cloudmesh_apachestorm/cloudmesh_apachestorm/command_apachestorm.py | futuresystems/465-oliverlewis | c1a093e9de012e752a2277c4fb533cbd974a5a8d | [
"Apache-2.0"
] | null | null | null | from cloudmesh_base.Shell import Shell
import subprocess
import yaml
class command_apachestorm(object):
@classmethod
def status(cls, host):
msg = "Unknown host"
try:
msg = Shell.ping("-c", "1", host)
except:
pass
if "1 packets transmitted, 1 packets rec... | 31.91358 | 115 | 0.632108 |
c0b133b29d5dd93fbc26ec1b39a9a997fe1f862b | 1,724 | py | Python | infrastructure/localServiceFile.py | lizzyTheLizard/homeserver-azure | e79bd23ea09a1ce1a77afd73bb9acfd402dfdc57 | [
"MIT"
] | null | null | null | infrastructure/localServiceFile.py | lizzyTheLizard/homeserver-azure | e79bd23ea09a1ce1a77afd73bb9acfd402dfdc57 | [
"MIT"
] | null | null | null | infrastructure/localServiceFile.py | lizzyTheLizard/homeserver-azure | e79bd23ea09a1ce1a77afd73bb9acfd402dfdc57 | [
"MIT"
] | null | null | null | from azwrapper import *
import os
import json
def createLocalServiceFile(group, appName, sbName, dbName, storageName):
filename = appName + "/local.settings.json"
print('Recreate local service file ' + filename)
# Create a management rule for sb and get it
createRule = "servicebus namespace authorizat... | 42.04878 | 109 | 0.653712 |
a917e5acd7bb391a624ff0486a04335da8c89327 | 1,880 | py | Python | p01/cifastapi/apiClasses.py | JoseIbanez/fastapi | ac4b74f23315021042efd88e192aa39d8481de53 | [
"MIT"
] | null | null | null | p01/cifastapi/apiClasses.py | JoseIbanez/fastapi | ac4b74f23315021042efd88e192aa39d8481de53 | [
"MIT"
] | null | null | null | p01/cifastapi/apiClasses.py | JoseIbanez/fastapi | ac4b74f23315021042efd88e192aa39d8481de53 | [
"MIT"
] | null | null | null | from typing import Optional
from enum import Enum
from fastapi import FastAPI, Body, HTTPException, status
from pydantic import BaseModel, Field
import time
import producer
import json
class AZ(str, Enum):
"""
Availability Zone Id
"""
az1 = 'AZ1'
az2 = 'AZ2'
az3 = 'AZ3'
az4 = 'AZ4'
class... | 24.102564 | 82 | 0.62766 |
8d770cddf153f54f4635f380d3a165da33476aeb | 3,454 | py | Python | src/server/app/repository/PresentationRepositoryNew.py | MatthiasRiener/DigiPen | 9b4aff4a1c431e06d73733dc3dd3f3f3d4631704 | [
"MIT"
] | null | null | null | src/server/app/repository/PresentationRepositoryNew.py | MatthiasRiener/DigiPen | 9b4aff4a1c431e06d73733dc3dd3f3f3d4631704 | [
"MIT"
] | null | null | null | src/server/app/repository/PresentationRepositoryNew.py | MatthiasRiener/DigiPen | 9b4aff4a1c431e06d73733dc3dd3f3f3d4631704 | [
"MIT"
] | null | null | null | from ..helper.helpers import getUUID, parse_multi_form
from ..db.settings import mongoclient
from .CanvasRepositoryNew import createSlide, getSlidesInOrder
from .AuthenticationRepository import AuthenticationRepository
import time, json
from bson import json_util
authRepo = AuthenticationRepository(testing=False)
... | 28.311475 | 118 | 0.669369 |
8da219bbe5cc09a983f04a694862aedfc58ea14c | 1,525 | py | Python | API_examples/openWeatherMap.py | nilsfed/SmarterWecker | 82a64172206fb1065bb0aaac0a769952af136c1a | [
"MIT"
] | null | null | null | API_examples/openWeatherMap.py | nilsfed/SmarterWecker | 82a64172206fb1065bb0aaac0a769952af136c1a | [
"MIT"
] | null | null | null | API_examples/openWeatherMap.py | nilsfed/SmarterWecker | 82a64172206fb1065bb0aaac0a769952af136c1a | [
"MIT"
] | null | null | null | import requests
import api_keys
from tkinter import *
import os
import io
# allows for image formats other than gif
from PIL import Image, ImageTk
import tkinter as tk
from urllib.request import urlopen
#cities = ["London,uk", "Porto,pt", "Paris,fr"]
#weather_dict = {}
def city_forecast(city):
respons... | 26.754386 | 120 | 0.699016 |
5734d11219528ff4af22f99023c0956bb6b9ceee | 3,081 | py | Python | scripts/qt2/Qtimer.py | ProfJust/Ruhr-TurtleBot-Competition-RTC- | 5c2425bee331b4d5033757a9425676932d111775 | [
"Unlicense",
"MIT"
] | null | null | null | scripts/qt2/Qtimer.py | ProfJust/Ruhr-TurtleBot-Competition-RTC- | 5c2425bee331b4d5033757a9425676932d111775 | [
"Unlicense",
"MIT"
] | null | null | null | scripts/qt2/Qtimer.py | ProfJust/Ruhr-TurtleBot-Competition-RTC- | 5c2425bee331b4d5033757a9425676932d111775 | [
"Unlicense",
"MIT"
] | null | null | null | #!/usr/bin/python3
# -*- coding: utf-8 -*-
##Qtimer.py
import sys
from PyQt5.QtCore import (Qt, QTimer)
from PyQt5.QtWidgets import (QWidget, QPushButton, QApplication, QLabel)
import random
global S
S = 2 #Spalten
global R
R = 2 #Reihen
global SIZE
SIZE = 150
class Ui(QWidget):
def __init__(self): #Konstrukor
... | 40.539474 | 78 | 0.557287 |
93ba3cef9c44baaed75c649f5340b9a640c95e50 | 229 | py | Python | fastapi/tutorial-1-3-router/routers/items.py | pisitj/practice-python-web-framework | 5f7f60737b1cf9618e73ad8047b6c4f556d1feb0 | [
"MIT"
] | null | null | null | fastapi/tutorial-1-3-router/routers/items.py | pisitj/practice-python-web-framework | 5f7f60737b1cf9618e73ad8047b6c4f556d1feb0 | [
"MIT"
] | null | null | null | fastapi/tutorial-1-3-router/routers/items.py | pisitj/practice-python-web-framework | 5f7f60737b1cf9618e73ad8047b6c4f556d1feb0 | [
"MIT"
] | null | null | null | from fastapi import APIRouter
router = APIRouter(prefix="/items")
@router.get("/")
def get_item_list():
return {"message": "Get List of Items."}
@router.post("/")
def create_item():
return {"message": "Create a Item."} | 20.818182 | 44 | 0.663755 |
93f6d4f0b10a7bb5c6a12d9a39073a6b31ec1fc7 | 845 | py | Python | code/tests/test_cliserver.py | simonmulser/master-thesis | 5ca2ddda377a0eede5a3c50866e0f90292c5448f | [
"CC-BY-4.0"
] | null | null | null | code/tests/test_cliserver.py | simonmulser/master-thesis | 5ca2ddda377a0eede5a3c50866e0f90292c5448f | [
"CC-BY-4.0"
] | null | null | null | code/tests/test_cliserver.py | simonmulser/master-thesis | 5ca2ddda377a0eede5a3c50866e0f90292c5448f | [
"CC-BY-4.0"
] | 1 | 2019-06-05T09:10:30.000Z | 2019-06-05T09:10:30.000Z | import unittest
from mock import MagicMock
from mock import patch
from cliserver import Functions
from bitcoin import core
from chain import Block
from chain import BlockOrigin
class CliServerTest(unittest.TestCase):
def __init__(self, *args, **kwargs):
super(CliServerTest, self).__init__(*args, **kwargs... | 28.166667 | 91 | 0.711243 |
47ba1003ae56dae52a5768a4492f787f6634ab50 | 1,594 | py | Python | restapi/main.py | xiang2002/Web | f12393c38ea3e88ceb67d270d707f3df0cf5e05a | [
"MIT"
] | 1 | 2020-10-21T07:18:00.000Z | 2020-10-21T07:18:00.000Z | restapi/main.py | xiang2002/Web | f12393c38ea3e88ceb67d270d707f3df0cf5e05a | [
"MIT"
] | null | null | null | restapi/main.py | xiang2002/Web | f12393c38ea3e88ceb67d270d707f3df0cf5e05a | [
"MIT"
] | null | null | null | from flask import Flask,request
from flask.views import MethodView
from google.cloud import ndb
import json
class Boat(ndb.Model):
id = ndb.StringProperty()
name = ndb.StringProperty(required=True)
type = ndb.StringProperty()
length = ndb.IntegerProperty()
app = Flask(__name__)
class BoatA... | 33.208333 | 68 | 0.604768 |
eff6822c6e1c2bb6c1566d930831392602100ef2 | 240 | py | Python | python/coursera_python/MICHIGAN/WEB/test/Greedy.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/coursera_python/MICHIGAN/WEB/test/Greedy.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/coursera_python/MICHIGAN/WEB/test/Greedy.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | # Some examples of using Regular expression and making it greedy and non-greedy
import re
#Greedy
#Longest
x = 'From : Using the : character'
y = re.findall('^F.+:',x)
print(y)
#Non-Greedy
#Shortest
y = re.findall('^F.+?:',x)
print(y)
| 14.117647 | 79 | 0.670833 |
324f5941410f3bd254fb51a6e9601276677e4bb6 | 843 | py | Python | robolib/networks/common.py | Obyoxar/RobolabStatistics | 08343ca3ac49df7efdac33692d7cc4b783e851f5 | [
"MIT"
] | 2 | 2017-11-30T21:12:11.000Z | 2017-12-01T07:52:43.000Z | robolib/networks/common.py | Obyoxar/RobolabStatistics | 08343ca3ac49df7efdac33692d7cc4b783e851f5 | [
"MIT"
] | 14 | 2017-11-14T18:12:53.000Z | 2018-06-03T16:07:57.000Z | robolib/networks/common.py | Obyoxar/RobolabStatistics | 08343ca3ac49df7efdac33692d7cc4b783e851f5 | [
"MIT"
] | 3 | 2018-02-05T10:40:03.000Z | 2018-02-09T09:29:19.000Z | from keras import backend
import numpy as np
def contrastive_loss(y_true, y_pred):
margin = 5
return backend.mean(y_true * backend.square(y_pred) + \
(1 - y_true) * backend.square(backend.maximum(margin - y_pred, (y_pred - margin) / 10)))
def contrastive_loss_manual(correct, predictio... | 27.193548 | 112 | 0.666667 |
085e4b12ebaf8df0162ba5003aa9ff9ae1f53d97 | 500 | py | Python | Contests/Binary.py | MastaCoder/Projects | ebb0a3134522b12f052fec8d753005f384adf1b1 | [
"MIT"
] | 5 | 2018-10-11T01:55:40.000Z | 2021-12-25T23:38:22.000Z | Contests/Binary.py | MastaCoder/mini_projects | ebb0a3134522b12f052fec8d753005f384adf1b1 | [
"MIT"
] | null | null | null | Contests/Binary.py | MastaCoder/mini_projects | ebb0a3134522b12f052fec8d753005f384adf1b1 | [
"MIT"
] | 1 | 2019-02-22T14:42:50.000Z | 2019-02-22T14:42:50.000Z | amount = int(input())
for i in range(amount):
binary = "{0:b}".format(int(input()))
length = len(binary)
count = 0
mod = (length % 4)
if mod != 0:
for a in range(4 - (length % 4)):
print("0", end = "")
count += 1
for a in range(length):
coun... | 23.809524 | 44 | 0.422 |
3ee2af5c666786be5a102710d627a0e29448768d | 630 | py | Python | Python/zzz_training_challenge/Python_Challenge/solutions/tests/ch04_strings/ex03_reverse_string_test.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/tests/ch04_strings/ex03_reverse_string_test.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/tests/ch04_strings/ex03_reverse_string_test.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | # Beispielprogramm für das Buch "Python Challenge"
#
# Copyright 2020 by Michael Inden
import pytest
from ch04_strings.solutions.ex03_reverse_string import reverse_inplace, reverse
def input_and_expected():
return [("ABCD", "DCBA"), ("OTTO", "OTTO"), ("PETER", "RETEP")]
@pytest.mark.parametrize("input, expecte... | 23.333333 | 79 | 0.687302 |
412d0495bdaef03296ae1b221e12c5c7831120f0 | 282 | py | Python | tensorflow/basic-rl/tutorial11/code/random_pendulum.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | 1 | 2019-05-10T09:16:23.000Z | 2019-05-10T09:16:23.000Z | tensorflow/basic-rl/tutorial11/code/random_pendulum.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | null | null | null | tensorflow/basic-rl/tutorial11/code/random_pendulum.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | 1 | 2019-10-14T07:30:18.000Z | 2019-10-14T07:30:18.000Z | import gym
env = gym.make("Pendulum-v0")
while True:
obs, done = env.reset(), False
episode_rew = 0
while not done:
env.render()
obs, rew, done, _ = env.step(env.action_space.sample())
episode_rew += rew
print("Episode reward", episode_rew)
| 23.5 | 63 | 0.613475 |
c23f8cbe3724b84ed8ef63909136a282193a1391 | 4,544 | py | Python | Data-Structures/Trees/AVL_Trees/AVLTree.py | hussamEL-Hwary/DS-Algo-Handbook | 86a97d586a4ca8b17168c0a9f5a9f43f856eba58 | [
"MIT"
] | 18 | 2016-11-01T04:00:36.000Z | 2021-09-13T14:26:35.000Z | Data-Structures/Trees/AVL_Trees/AVLTree.py | JEERU/DS-Algo-Handbook | 86a97d586a4ca8b17168c0a9f5a9f43f856eba58 | [
"MIT"
] | 60 | 2016-10-11T14:50:47.000Z | 2016-10-31T11:05:01.000Z | Data-Structures/Trees/AVL_Trees/AVLTree.py | JEERU/DS-Algo-Handbook | 86a97d586a4ca8b17168c0a9f5a9f43f856eba58 | [
"MIT"
] | 87 | 2016-09-08T05:04:50.000Z | 2016-10-30T19:19:53.000Z | class Node:
# Node class. Each node can hold data, left and right children and keeps
# track of its height
def __init__(self, value):
self.data = value
self.left = None
self.right = None
self.height = 1
class Tree:
# Node class. A tree is composed of nodes and has a ro... | 33.910448 | 109 | 0.613776 |
cd69623e6ba78b2979688ae5fcce0f9685504eb5 | 789 | py | Python | meteohautnah/helpers.py | MeteorologieHautnah/MeteorologieHautnah | 1607c25b85753f31faccfd279abd503b83c1f4ea | [
"MIT"
] | 1 | 2022-02-17T08:24:13.000Z | 2022-02-17T08:24:13.000Z | meteohautnah/helpers.py | MeteorologieHautnah/MeteorologieHautnah | 1607c25b85753f31faccfd279abd503b83c1f4ea | [
"MIT"
] | null | null | null | meteohautnah/helpers.py | MeteorologieHautnah/MeteorologieHautnah | 1607c25b85753f31faccfd279abd503b83c1f4ea | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Helper functions
*author*: Johannes Röttenbacher
"""
import sys
import os
def read_command_line_args():
"""
Read out command line arguments and save them to a dictionary. Expects arguments in the form key=value.
Returns: dictionary with command line arguments as dict[key] = valu... | 19.725 | 107 | 0.617237 |
903da184259db6aa79eecbbc96e072fb931cbf29 | 2,003 | py | Python | Packs/ZeroTrustAnalyticsPlatform/Scripts/ZTAPParseLinks/ZTAPParseLinks.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/ZeroTrustAnalyticsPlatform/Scripts/ZTAPParseLinks/ZTAPParseLinks.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/ZeroTrustAnalyticsPlatform/Scripts/ZTAPParseLinks/ZTAPParseLinks.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | from CommonServerPython import *
from typing import Dict, Any
import traceback
from collections import defaultdict
""" STANDALONE FUNCTION """
def parse_links(events) -> str:
"""Parses external links the raw trigger events field
and returns a section containing those links.
"""
if not events:
... | 24.426829 | 71 | 0.599601 |
5f4e616b6b97161afb918af398e5417571c337be | 1,017 | py | Python | 04.DFS_BFS/HG/B1260.py | SP2021-2/Algorithm | 2e629eb5234212fad8bbc11491aad068e5783780 | [
"MIT"
] | 1 | 2021-11-21T06:03:06.000Z | 2021-11-21T06:03:06.000Z | 04.DFS_BFS/HG/B1260.py | SP2021-2/Algorithm | 2e629eb5234212fad8bbc11491aad068e5783780 | [
"MIT"
] | 2 | 2021-10-13T07:21:09.000Z | 2021-11-14T13:53:08.000Z | 04.DFS_BFS/HG/B1260.py | SP2021-2/Algorithm | 2e629eb5234212fad8bbc11491aad068e5783780 | [
"MIT"
] | null | null | null | import sys
from collections import deque
N, M, V = map(int, input().split())
G = [[] for _ in range(N+1)]
for _ in range(M):
i, j = map(int, sys.stdin.readline().split())
G[i].append(j)
G[j].append(i)
G = list(map(sorted, G))
def dfs(s):
if s in visited:
return
print(s, end=" ")
visi... | 19.557692 | 49 | 0.46411 |
39680c26d19fef63244a6396f66e44f1b7a05c23 | 3,774 | py | Python | worker/sharebrowser.py | greenorca/ECMan | 744cb2ec97d52a68d45cf40a967ac60b92dafbb4 | [
"MIT"
] | null | null | null | worker/sharebrowser.py | greenorca/ECMan | 744cb2ec97d52a68d45cf40a967ac60b92dafbb4 | [
"MIT"
] | 9 | 2019-05-11T19:53:01.000Z | 2020-11-10T07:24:14.000Z | worker/sharebrowser.py | greenorca/ECMan | 744cb2ec97d52a68d45cf40a967ac60b92dafbb4 | [
"MIT"
] | null | null | null | import os
import socket
from configparser import ConfigParser
from pathlib import Path
from smb.SMBConnection import SMBConnection
'''
Created on Feb 19, 2019
@author: sven
'''
class ShareBrowser(object):
'''
simple class to connect with given credentials to given serverName name and retrieve the servers s... | 31.45 | 109 | 0.593005 |
ffd2e3a85ee77d688476e4d8cb04b9834dec0d6c | 308 | py | Python | Matrizen und Vektoren/Matrizen und Vektoren/diabetes.py | severinhaller/einf-machinelearning | 4dfc8f1da0d81c5aa800d1459f81b72d1bf6dd9b | [
"MIT"
] | null | null | null | Matrizen und Vektoren/Matrizen und Vektoren/diabetes.py | severinhaller/einf-machinelearning | 4dfc8f1da0d81c5aa800d1459f81b72d1bf6dd9b | [
"MIT"
] | null | null | null | Matrizen und Vektoren/Matrizen und Vektoren/diabetes.py | severinhaller/einf-machinelearning | 4dfc8f1da0d81c5aa800d1459f81b72d1bf6dd9b | [
"MIT"
] | null | null | null | import numpy as np
diabetes_data_set = np.genfromtxt('diabetes_daten.csv', delimiter=',', encoding="utf_8_sig")
matrix_A = diabetes_data_set[:, :10]
y = diabetes_data_set[:, np.newaxis, 10]
print(matrix_A, y)
w = np.matmul(np.matmul(np.linalg.inv(np.matmul(matrix_A.T, matrix_A)),matrix_A.T),y)
print(w) | 25.666667 | 92 | 0.733766 |
ffe86366e19e59517ec771f9bbf771bd9d3556e9 | 1,745 | py | Python | Statistics.py | danielvh8/RP-granzyme-B | fcb29321f8ad55bfaa56e31f45eeab907e1ed1af | [
"MIT"
] | null | null | null | Statistics.py | danielvh8/RP-granzyme-B | fcb29321f8ad55bfaa56e31f45eeab907e1ed1af | [
"MIT"
] | null | null | null | Statistics.py | danielvh8/RP-granzyme-B | fcb29321f8ad55bfaa56e31f45eeab907e1ed1af | [
"MIT"
] | null | null | null | from pathlib import Path
from collections import Counter
from tqdm import tqdm
import math
from scipy.stats import norm
import re
import gzip
from configparser import ConfigParser
parser = ConfigParser()
parser.read(Path('In/parameters.ini'))
def GetAcidFrequency():
"""
Read the file with proteins and... | 32.924528 | 104 | 0.569054 |
4b348987f9c67ce3fc5130bb9153b69fe0a878fb | 157 | py | Python | Python/Buch_ATBS/Teil_1/Kapitel_01_bis_04/14_insert_string_in_string.py | Apop85/Scripts | e71e1c18539e67543e3509c424c7f2d6528da654 | [
"MIT"
] | null | null | null | Python/Buch_ATBS/Teil_1/Kapitel_01_bis_04/14_insert_string_in_string.py | Apop85/Scripts | e71e1c18539e67543e3509c424c7f2d6528da654 | [
"MIT"
] | 6 | 2020-12-24T15:15:09.000Z | 2022-01-13T01:58:35.000Z | Python/Buch_ATBS/Teil_1/Kapitel_01_bis_04/14_insert_string_in_string.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | null | null | null | # Strings slicen und Strings in Strings einfügen
string='Das ist schön.'
inp=' nicht '
print(string)
string=string[0:7] + inp + string[8:13]
print(string)
| 17.444444 | 48 | 0.719745 |
4b9209444940bfa4587025286361130bde2dfba3 | 974 | py | Python | tikz/center/tikz.py | RalfGuder/LaTeX-examples | a1bf9fe422969be1ca4674394ebd2170c07f7693 | [
"MIT"
] | 1,231 | 2015-01-07T04:04:25.000Z | 2022-03-31T17:43:29.000Z | tikz/center/tikz.py | DoubleL61/LaTeX-examples | cd0d97f85fadb59b7c6e9062b37a8bf7d725ba0c | [
"MIT"
] | 5 | 2015-05-10T13:10:47.000Z | 2021-05-02T21:28:49.000Z | tikz/center/tikz.py | DoubleL61/LaTeX-examples | cd0d97f85fadb59b7c6e9062b37a8bf7d725ba0c | [
"MIT"
] | 400 | 2015-01-05T06:22:18.000Z | 2022-03-19T04:07:59.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from random import uniform
import random
n = 5
x_min, y_min = 0, 0
x_max, y_max = 5, 5
x_sum = 0
y_sum = 0
coordinates = []
random.seed(42)
for i in range(n):
x = uniform(x_min, x_max)
y = uniform(y_min, y_max)
x_sum += x
y_sum += y
coordinates.appen... | 22.136364 | 75 | 0.574949 |
29be2e5804f80fd6a49a279aaf6076481f99f7b5 | 4,116 | py | Python | tests/components/test_regressors.py | Matheus158257/projects | 26a6148046533476e625a872a2950c383aa975a8 | [
"Apache-2.0"
] | null | null | null | tests/components/test_regressors.py | Matheus158257/projects | 26a6148046533476e625a872a2950c383aa975a8 | [
"Apache-2.0"
] | null | null | null | tests/components/test_regressors.py | Matheus158257/projects | 26a6148046533476e625a872a2950c383aa975a8 | [
"Apache-2.0"
] | null | null | null | from os import environ, path, remove
from requests import get
from pytest import fixture
from papermill import execute_notebook
from .utils import creates_boston_metadata, creates_titanic_metadata, \
creates_mock_dataset, delete_mock_dataset
from projects.controllers.utils import uuid_alpha
EXPERIMENT_ID = str(u... | 35.791304 | 107 | 0.763605 |
d9e4a371f4412abae380c582413249949f44660e | 985 | py | Python | exercises/pt/exc_01_12_02.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/pt/exc_01_12_02.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/pt/exc_01_12_02.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | import spacy
from spacy.matcher import Matcher
nlp = spacy.load("pt_core_news_sm")
matcher = Matcher(nlp.vocab)
doc = nlp(
"Eu baixei o Fortnite em meu computador e não consigo abrir o jogo de jeito algum. Me ajudem? "
"Mas quando eu estava baixando o Minecraft, eu tinha a versão do Windows que é "
"uma p... | 37.884615 | 99 | 0.743147 |
d9f7fcf0ba06e702feaebd3528d8d2abf4e8496e | 2,370 | py | Python | applications/question_answering/faq_finance/export_model.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | applications/question_answering/faq_finance/export_model.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | applications/question_answering/faq_finance/export_model.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 37.619048 | 124 | 0.699578 |
8a47153a263300b49318b014b45a7e409981feba | 5,082 | py | Python | research/cv/AVA_hpa/src/network_define_eval.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/AVA_hpa/src/network_define_eval.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/AVA_hpa/src/network_define_eval.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 36.826087 | 117 | 0.603109 |
0a44dcb75c231884a522c24a991f36928bc20ed7 | 5,047 | py | Python | bigbench/bbseqio/tools/seqio_task_catalog_generator_main.py | dimmollo/BIG-bench | f0dffeb4f16ef5489686a81e2d63362d251cda3e | [
"Apache-2.0"
] | null | null | null | bigbench/bbseqio/tools/seqio_task_catalog_generator_main.py | dimmollo/BIG-bench | f0dffeb4f16ef5489686a81e2d63362d251cda3e | [
"Apache-2.0"
] | null | null | null | bigbench/bbseqio/tools/seqio_task_catalog_generator_main.py | dimmollo/BIG-bench | f0dffeb4f16ef5489686a81e2d63362d251cda3e | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, so... | 37.664179 | 81 | 0.717456 |
6adfd194847e5aade71f2624527e665b1b2316f2 | 313 | py | Python | 2-resources/Lambda-weeks/m7/71e1/cs-sprint-challenge-hash-tables-master/hashtables/ex2/ex2.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 2-resources/Lambda-weeks/m7/71e1/cs-sprint-challenge-hash-tables-master/hashtables/ex2/ex2.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 2-resources/Lambda-weeks/m7/71e1/cs-sprint-challenge-hash-tables-master/hashtables/ex2/ex2.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | # Hint: You may not need all of these. Remove the unused functions.
class Ticket:
def __init__(self, source, destination):
self.source = source
self.destination = destination
def reconstruct_trip(tickets, length):
"""
YOUR CODE HERE
"""
# Your code here
return route
| 20.866667 | 70 | 0.648562 |
7ced8fd872397bc2732728aab0e74f0d1acae388 | 5,076 | py | Python | test/test_npu/test_network_ops/test_convolution_backward_input.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-12-02T03:07:35.000Z | 2021-12-02T03:07:35.000Z | test/test_npu/test_network_ops/test_convolution_backward_input.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-11-12T07:23:03.000Z | 2021-11-12T08:28:13.000Z | test/test_npu/test_network_ops/test_convolution_backward_input.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2020, Huawei Technologies.All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
#
# Unless required by applicable law... | 48.342857 | 77 | 0.502364 |
6b0d2540ae00c01623cd0e023bc8253759918fda | 3,012 | py | Python | app/services/file_services/file_services.py | zhiyong-lv/flask-login | d8bf0719bae19ba8f7f44ea6d6a8ca65ba22aa63 | [
"MIT"
] | null | null | null | app/services/file_services/file_services.py | zhiyong-lv/flask-login | d8bf0719bae19ba8f7f44ea6d6a8ca65ba22aa63 | [
"MIT"
] | null | null | null | app/services/file_services/file_services.py | zhiyong-lv/flask-login | d8bf0719bae19ba8f7f44ea6d6a8ca65ba22aa63 | [
"MIT"
] | null | null | null | from sqlalchemy.exc import IntegrityError
from app import db
from app.models.files import File
from app.schema import file_schema
from .exceptions import FileNotFound, FileDuplicated, FileBaseError
from .file_status import CREATE_STATUS
from ..base_service import BaseService
VALID = True
INVALID = False
class FileS... | 37.65 | 118 | 0.625166 |
13f5d5f9d981fbe66f2af915740f73578158f806 | 2,895 | py | Python | repo/script.module.urlresolver/lib/urlresolver/plugins/cda.py | dbiesecke/dbiesecke.github.io | 5894473591f078fd22d1cb33794c5e656ae9b8dd | [
"MIT"
] | 1 | 2017-11-26T18:18:46.000Z | 2017-11-26T18:18:46.000Z | repo/script.module.urlresolver/lib/urlresolver/plugins/cda.py | dbiesecke/dbiesecke.github.io | 5894473591f078fd22d1cb33794c5e656ae9b8dd | [
"MIT"
] | null | null | null | repo/script.module.urlresolver/lib/urlresolver/plugins/cda.py | dbiesecke/dbiesecke.github.io | 5894473591f078fd22d1cb33794c5e656ae9b8dd | [
"MIT"
] | 3 | 2019-09-30T19:52:05.000Z | 2020-04-12T21:20:56.000Z | """
urlresolver XBMC Addon
Copyright (C) 2015 tknorris
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
... | 39.657534 | 110 | 0.648705 |
6a44f9824e22559262135aa548d5e0cffc1b26ff | 16,952 | py | Python | ingress/ambassador/ambassador/kubewatch.py | smthkissinger/docker-images | 35e868295d04fa780325ada4168381f1e80e8fe4 | [
"BSD-3-Clause"
] | 63 | 2018-02-04T03:31:22.000Z | 2022-03-07T08:27:39.000Z | ingress/ambassador/ambassador/kubewatch.py | smthkissinger/docker-images | 35e868295d04fa780325ada4168381f1e80e8fe4 | [
"BSD-3-Clause"
] | 3 | 2020-06-15T03:41:03.000Z | 2020-06-15T03:41:04.000Z | ingress/ambassador/ambassador/kubewatch.py | smthkissinger/docker-images | 35e868295d04fa780325ada4168381f1e80e8fe4 | [
"BSD-3-Clause"
] | 40 | 2018-01-22T16:31:16.000Z | 2022-03-08T04:40:42.000Z | # Copyright 2018 Datawire. 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 agr... | 36.932462 | 113 | 0.595505 |
e06cbf96c9fa4f5183e43a58f89564976dc02453 | 3,477 | py | Python | tests/test_connectors/test_rsmq.py | shipt/py-volley | 0114651478c8df7304d3fe3cb9f72998901bb3fe | [
"MIT"
] | 8 | 2022-02-24T14:59:24.000Z | 2022-03-31T04:37:55.000Z | tests/test_connectors/test_rsmq.py | shipt/py-volley | 0114651478c8df7304d3fe3cb9f72998901bb3fe | [
"MIT"
] | 3 | 2022-02-27T17:08:52.000Z | 2022-03-18T13:11:01.000Z | tests/test_connectors/test_rsmq.py | shipt/py-volley | 0114651478c8df7304d3fe3cb9f72998901bb3fe | [
"MIT"
] | 2 | 2022-02-24T15:03:07.000Z | 2022-03-15T03:12:00.000Z | from unittest.mock import MagicMock, patch
from pytest import MonkeyPatch, raises
from tenacity import stop_after_attempt
from volley.connectors.rsmq import RSMQConfigError, RSMQConsumer, RSMQProducer
from volley.data_models import QueueMessage
def test_rsmq_producer(mock_rsmq_producer: RSMQProducer, queue_message:... | 36.6 | 115 | 0.719298 |
bcd84ae1f30abcb49ce5526f3b4f0ba495106a12 | 915 | py | Python | Textadventure/items/consumables/potions/mana_potion.py | clemens2107/textadventure | 870f3ff98accdadad386a2cae4bd4328341f7eb9 | [
"CC0-1.0"
] | null | null | null | Textadventure/items/consumables/potions/mana_potion.py | clemens2107/textadventure | 870f3ff98accdadad386a2cae4bd4328341f7eb9 | [
"CC0-1.0"
] | null | null | null | Textadventure/items/consumables/potions/mana_potion.py | clemens2107/textadventure | 870f3ff98accdadad386a2cae4bd4328341f7eb9 | [
"CC0-1.0"
] | null | null | null | # -*- coding: utf-8 -*-
from items.items import basic_item
class ManaPotion(basic_item):
def __init__(self, level, drop_chanc_category, equipment_category, number, name, weight, worth, regenerated_mana):
basic_item.__init__(self, level, drop_chanc_category, equipment_category, number, name, weight, ... | 36.6 | 119 | 0.672131 |
f8fef7b295d087554ceed9257cf6b1d86b4a743f | 5,359 | py | Python | lbry/lbry/schema/result.py | mittalkartik2000/lbry-sdk | a07b17ec0c9c5d0a88bc730caf6ab955e0971b38 | [
"MIT"
] | null | null | null | lbry/lbry/schema/result.py | mittalkartik2000/lbry-sdk | a07b17ec0c9c5d0a88bc730caf6ab955e0971b38 | [
"MIT"
] | 4 | 2020-10-27T21:53:05.000Z | 2022-02-11T03:10:54.000Z | lbry/lbry/schema/result.py | braveheart12/lbry-sdk | dc709b468f9dce60d206161785def5c7ace2b763 | [
"MIT"
] | null | null | null | import base64
import struct
from typing import List
from binascii import hexlify
from itertools import chain
from lbry.schema.types.v2.result_pb2 import Outputs as OutputsMessage
class Outputs:
__slots__ = 'txos', 'extra_txos', 'txs', 'offset', 'total'
def __init__(self, txos: List, extra_txos: List, txs: ... | 43.92623 | 95 | 0.63482 |
db6affd782e032865acb4ef14e0d0c88b838f26e | 1,877 | py | Python | exercises/es/test_general.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/es/test_general.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/es/test_general.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | # This test file only runs internally when you test the course with pytest.
# It can be used to ensure that results the course depend on are accurate, e.g.
# when updating to a new version of spaCy. This especially includes predictions
# that some examples assume or depend on.
import spacy
import pytest
import spacy
f... | 34.127273 | 112 | 0.676612 |
91efb96313e37d8fbfdb02994591304f9b87c99a | 1,497 | py | Python | oneflow/python/test/models/1node_test.py | wanghongsheng01/framework_enflame | debf613e05e3f5ea8084c3e79b60d0dd9e349526 | [
"Apache-2.0"
] | 2 | 2021-09-10T00:19:49.000Z | 2021-11-16T11:27:20.000Z | oneflow/python/test/models/1node_test.py | duijiudanggecl/oneflow | d2096ae14cf847509394a3b717021e2bd1d72f62 | [
"Apache-2.0"
] | 1 | 2021-06-16T08:37:50.000Z | 2021-06-16T08:37:50.000Z | oneflow/python/test/models/1node_test.py | duijiudanggecl/oneflow | d2096ae14cf847509394a3b717021e2bd1d72f62 | [
"Apache-2.0"
] | 1 | 2021-11-10T07:57:01.000Z | 2021-11-10T07:57:01.000Z | """
Copyright 2020 The OneFlow Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agr... | 24.145161 | 79 | 0.770207 |
72e3846612d7ed923cea9d701661680d15e1f573 | 768 | py | Python | task_manager/task_manager/tasks/migrations/0001_initial.py | trenev/softuni-python-web-basics | 0fcf6b7f3389d06685d40615c376dc4027e772f2 | [
"MIT"
] | 1 | 2022-03-03T10:16:14.000Z | 2022-03-03T10:16:14.000Z | task_manager/task_manager/tasks/migrations/0001_initial.py | trenev/softuni-python-web-basics | 0fcf6b7f3389d06685d40615c376dc4027e772f2 | [
"MIT"
] | null | null | null | task_manager/task_manager/tasks/migrations/0001_initial.py | trenev/softuni-python-web-basics | 0fcf6b7f3389d06685d40615c376dc4027e772f2 | [
"MIT"
] | null | null | null | # Generated by Django 4.0.1 on 2022-02-23 16:25
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Task',
fields=[
('id', models.BigAutoField(... | 30.72 | 162 | 0.570313 |
72ed2f7d248610c3e0875f453cdf9ab75832a46e | 1,568 | py | Python | test/test_npu/test_network_ops/test_stride.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-12-02T03:07:35.000Z | 2021-12-02T03:07:35.000Z | test/test_npu/test_network_ops/test_stride.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-11-12T07:23:03.000Z | 2021-11-12T08:28:13.000Z | test/test_npu/test_network_ops/test_stride.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2020, Huawei Technologies.All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
#
# Unless required by applicable law... | 37.333333 | 76 | 0.68176 |
f408c2d3925dba35c4e57c4a2c8c7f3719c804fa | 745 | py | Python | 0-notes/job-search/Cracking the Coding Interview/C09SystemDesignScalability/questions/9.1-question.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 0-notes/job-search/Cracking the Coding Interview/C09SystemDesignScalability/questions/9.1-question.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 0-notes/job-search/Cracking the Coding Interview/C09SystemDesignScalability/questions/9.1-question.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | # Stock Data
# Imagine you are building some sort of service that will be called by up to 1k client
# apps to get simple end-of-day stock price info (open, close, high, low).
# You may assume you already have the data.
# You can store it in any format you wish.
# How would you design the client-facing service t... | 39.210526 | 97 | 0.743624 |
be2f7bf2fe817b655d2d712464373a2e84aadf83 | 1,183 | py | Python | 023-C141-FlaskMockup/main.py | somePythonProgrammer/PythonCode | fb2b2245db631cefd916a960768f411969b0e78f | [
"MIT"
] | 2 | 2021-09-28T13:55:20.000Z | 2021-11-15T10:08:49.000Z | 023-C141-FlaskMockup/main.py | somePythonProgrammer/PythonCode | fb2b2245db631cefd916a960768f411969b0e78f | [
"MIT"
] | null | null | null | 023-C141-FlaskMockup/main.py | somePythonProgrammer/PythonCode | fb2b2245db631cefd916a960768f411969b0e78f | [
"MIT"
] | 1 | 2022-01-20T03:02:20.000Z | 2022-01-20T03:02:20.000Z | import pandas as pd
from flask import Flask, jsonify, request
app = Flask(__name__)
df = pd.read_csv("articles.csv")
user_data = {
"Liked": [],
"Disliked": [],
"NotRead": [],
}
@app.route("/")
def index():
return jsonify({
"msg": "success"
})
@app.route("/like")
def like():
index = r... | 21.907407 | 43 | 0.599324 |
22a1c240ad9189c140be3ae5bb5b9fe5e535add7 | 6,641 | py | Python | src/onegov/agency/forms/agency.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/agency/forms/agency.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/agency/forms/agency.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from cgi import FieldStorage
from io import BytesIO
from onegov.agency import _
from onegov.agency.collections import ExtendedAgencyCollection
from onegov.agency.models import ExtendedAgency
from onegov.agency.utils import handle_empty_p_tags
from onegov.core.security import Private
from onegov.core.utils import linkif... | 35.897297 | 77 | 0.619334 |
4a5174087b4e77b57a514ea658ca18879da00083 | 385 | py | Python | Selectsort.py | dapan2017/Sort-Algorithm | c99235b51383fbedf14cc4ae14be3058defb2c64 | [
"Apache-2.0"
] | null | null | null | Selectsort.py | dapan2017/Sort-Algorithm | c99235b51383fbedf14cc4ae14be3058defb2c64 | [
"Apache-2.0"
] | null | null | null | Selectsort.py | dapan2017/Sort-Algorithm | c99235b51383fbedf14cc4ae14be3058defb2c64 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Fri Aug 31 16:02:08 2018
@author: fengxue
"""
def Selectsort(s):
for i in range(0, len(s) - 1):
index = i
for j in range(i + 1, len(s)):
if s[index] > s[j]:
index = j
s[i], s[index] = s[index], s[i]
return ... | 24.0625 | 49 | 0.457143 |
43b01a0021be5068351fae2449e6f2304333ad2e | 8,220 | py | Python | packages/watchmen-storage-mysql/src/watchmen_storage_mysql/table_creator.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-storage-mysql/src/watchmen_storage_mysql/table_creator.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-storage-mysql/src/watchmen_storage_mysql/table_creator.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from typing import Callable, Dict, List, Optional, Tuple, Union
from watchmen_model.admin import Factor, FactorType, is_aggregation_topic, is_raw_topic, Topic
from watchmen_storage import as_table_name
from watchmen_utilities import ArrayHelper, is_blank, is_not_blank
# noinspection DuplicatedCode
def ask_column_nam... | 33.145161 | 110 | 0.741119 |
78edffdecdadff264bb8eca53cb9ff7a26ee5b77 | 3,157 | py | Python | research/cv/StackedHourglass/src/utils/img.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/StackedHourglass/src/utils/img.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/StackedHourglass/src/utils/img.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 28.963303 | 93 | 0.559075 |
600c36641dbb8cf08dba191cc434973b45b53eb0 | 1,219 | py | Python | packages/OpenCV/nodes/OpenCV___WebcamFeed0/OpenCV___WebcamFeed0___METACODE.py | Shirazbello/Pyscriptining | 0f2c80a9bb10477d65966faeccc7783f20385c1b | [
"MIT"
] | null | null | null | packages/OpenCV/nodes/OpenCV___WebcamFeed0/OpenCV___WebcamFeed0___METACODE.py | Shirazbello/Pyscriptining | 0f2c80a9bb10477d65966faeccc7783f20385c1b | [
"MIT"
] | null | null | null | packages/OpenCV/nodes/OpenCV___WebcamFeed0/OpenCV___WebcamFeed0___METACODE.py | Shirazbello/Pyscriptining | 0f2c80a9bb10477d65966faeccc7783f20385c1b | [
"MIT"
] | null | null | null | from custom_src.NodeInstance import NodeInstance
from custom_src.Node import Node
# USEFUL
# self.input(index) <- access to input data
# self.outputs[index].set_val(val) <- set output data port value
# self.main_widget <- access to main widget
class %NODE_TITLE%_NodeInstance... | 28.348837 | 109 | 0.64233 |
60a0fcf6907168dde989861177c5fea7e324ebf3 | 6,440 | py | Python | abfahrt/unittest/unittest_stationlist.py | Team-Zugig-zum-Erfolg/InformatiCup | 788076ac38bf6d8f462465b7fb96db14d13bed30 | [
"MIT"
] | 1 | 2022-01-30T14:30:02.000Z | 2022-01-30T14:30:02.000Z | abfahrt/unittest/unittest_stationlist.py | Team-Zugig-zum-Erfolg/InformatiCup | 788076ac38bf6d8f462465b7fb96db14d13bed30 | [
"MIT"
] | null | null | null | abfahrt/unittest/unittest_stationlist.py | Team-Zugig-zum-Erfolg/InformatiCup | 788076ac38bf6d8f462465b7fb96db14d13bed30 | [
"MIT"
] | null | null | null | import unittest
# The unittest unit testing framework was originally inspired by JUnit and has a similar flavor as major unit testing frameworks in other languages.
# It supports test automation, sharing of setup and shutdown code for tests, aggregation of tests into collections, and independence of the tests from the ... | 56 | 224 | 0.649689 |
60c62f7954bd9e29dd2be743e56853a145503775 | 2,397 | py | Python | cgi-bin/scheduleManager.py | joecrop/SDMO | c9b5a2bcdd861f87e1470e012e9e882b51587dc6 | [
"MIT"
] | 1 | 2018-12-19T18:10:11.000Z | 2018-12-19T18:10:11.000Z | cgi-bin/scheduleManager.py | joecrop/SDMO | c9b5a2bcdd861f87e1470e012e9e882b51587dc6 | [
"MIT"
] | 1 | 2021-09-21T05:22:24.000Z | 2021-09-21T05:22:24.000Z | cgi-bin/scheduleManager.py | joecrop/SDMO | c9b5a2bcdd861f87e1470e012e9e882b51587dc6 | [
"MIT"
] | null | null | null | import sqlite3 as lite
import sys
import datetime
db = 'data/meds.db'
def addSchedule(name, datetime, repeat, repeat_base, med, user, as_needed):
con = None
try:
con = lite.connect(db)
con.execute("INSERT INTO schedules(name, datetime, repeat, repeat_base, med, user, as_needed) values (?, ?, ?, ?, ?, ?, ?)", (... | 21.401786 | 220 | 0.651648 |
60f2beec7444a6272b4531353e9f2dc338ca3888 | 3,052 | py | Python | quant/api/gate.py | doubleDragon/QuantBot | 53a1d6c62ecece47bf777da0c0754430b706b7fd | [
"MIT"
] | 7 | 2017-10-22T15:00:09.000Z | 2019-09-19T11:45:43.000Z | quant/api/gate.py | doubleDragon/QuantBot | 53a1d6c62ecece47bf777da0c0754430b706b7fd | [
"MIT"
] | 1 | 2018-01-19T16:19:40.000Z | 2018-01-19T16:19:40.000Z | quant/api/gate.py | doubleDragon/QuantBot | 53a1d6c62ecece47bf777da0c0754430b706b7fd | [
"MIT"
] | 5 | 2017-12-11T15:10:29.000Z | 2018-12-21T17:40:58.000Z | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
import hashlib
import hmac
import urllib
import requests
import time
BASE_URL = "http://data.gate.io/api2/1"
def url_for(path, path_arg=None, parameters=None):
url = "%s/%s" % (BASE_URL, path)
return url
class PublicClient(object):
@classmethod
def _ge... | 29.346154 | 105 | 0.572412 |
e0cb4d0bb80387d1c9a9a875a8dfccd0b281df01 | 377 | py | Python | books/PythonCleanCode/ch3_good_code/exceptions_3.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | books/PythonCleanCode/ch3_good_code/exceptions_3.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | books/PythonCleanCode/ch3_good_code/exceptions_3.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | """Clean Code in Python - Chapter 3: General Traits of Good Code
> Exceptions
"""
class InternalDataError(Exception):
"""An exception with the data of our domain problem."""
def process(data_dictionary, record_id):
try:
return data_dictionary[record_id]
except KeyError as e:
... | 23.5625 | 65 | 0.679045 |
90ccc038f0f29df02207696c45fb5628926d91c3 | 618 | py | Python | config/decorators.py | zhouhongf/bank_hr | a42e5e18f3ec36b1ec65931415fe476c9690e0a0 | [
"MIT"
] | 2 | 2021-11-27T06:40:47.000Z | 2022-01-06T03:12:46.000Z | config/decorators.py | zhouhongf/bank_hr | a42e5e18f3ec36b1ec65931415fe476c9690e0a0 | [
"MIT"
] | null | null | null | config/decorators.py | zhouhongf/bank_hr | a42e5e18f3ec36b1ec65931415fe476c9690e0a0 | [
"MIT"
] | null | null | null | import asyncio
try:
import uvloop
asyncio.set_event_loop_policy(uvloop.EventLoopPolicy())
except ImportError:
pass
from functools import wraps
# 使用函数装饰器singleton实现单列
def singleton(cls):
"""
A singleton created by using decorator
:param cls: cls
:return: instance
"""
_instances = ... | 17.657143 | 59 | 0.647249 |
d3ca33df5fae6f66239e21907eed0581ca31476e | 144 | py | Python | leetcode/344-Reverse-String/ReverseString.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2015-12-16T04:01:03.000Z | 2015-12-16T04:01:03.000Z | leetcode/344-Reverse-String/ReverseString.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | leetcode/344-Reverse-String/ReverseString.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | class Solution(object):
def reverseString(self, s):
"""
:type s: str
:rtype: str
"""
return s[::-1]
| 18 | 31 | 0.444444 |
31b32a1b695fb3504ef85ed8694df4a993518783 | 928 | py | Python | Packs/CommonScripts/Scripts/CIDRBiggerThanPrefix/CIDRBiggerThanPrefix_test.py | jrauen/content | 81a92be1cbb053a5f26a6f325eff3afc0ca840e0 | [
"MIT"
] | 2 | 2021-12-06T21:38:24.000Z | 2022-01-13T08:23:36.000Z | Packs/CommonScripts/Scripts/CIDRBiggerThanPrefix/CIDRBiggerThanPrefix_test.py | jrauen/content | 81a92be1cbb053a5f26a6f325eff3afc0ca840e0 | [
"MIT"
] | 61 | 2021-10-07T08:54:38.000Z | 2022-03-31T10:25:35.000Z | Packs/CommonScripts/Scripts/CIDRBiggerThanPrefix/CIDRBiggerThanPrefix_test.py | henry-sue-pa/content | 043c6badfb4f9c80673cad9242fdea72efe301f7 | [
"MIT"
] | 2 | 2022-01-05T15:27:01.000Z | 2022-02-01T19:27:43.000Z | import pytest
import demistomock as demisto
CIDR_RANGES = [
('192.168.0.0/24', '18', 1, [False]),
('192.168.0.0/24', '32', 1, [True]),
('2002::1234:abcd:ffff:c0a8:101/127', '64', 1, [False]),
('2002::1234:abcd:ffff:c0a8:101/127', '168', 1, [True]),
('192.168.0.0/24,2002::1234:abcd:ffff:c0a8:101/12... | 32 | 81 | 0.623922 |
9ed35e940846503083fd528ee747c22dcbf43b9c | 9,603 | py | Python | Tests/Marketplace/Tests/zip_packs_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Tests/Marketplace/Tests/zip_packs_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Tests/Marketplace/Tests/zip_packs_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | # type: ignore[attr-defined]
# pylint: disable=no-member
import pytest
from Tests.Marketplace.zip_packs import get_latest_pack_zip_from_pack_files, zip_packs,\
remove_test_playbooks_if_exist, remove_test_playbooks_from_signatures, get_zipped_packs_names,\
copy_zipped_packs_to_artifacts
class TestZipPacks:
... | 36.934615 | 118 | 0.630324 |
6f1dd2a2cffd9ceee7447969d06f1820da91e43c | 618 | py | Python | rpc-test-client.py | lihuiba/SoftSAN | 1b8ab2cae92b7aac34211909b27d4ebe595275d7 | [
"Apache-2.0"
] | 1 | 2015-08-02T09:53:18.000Z | 2015-08-02T09:53:18.000Z | rpc-test-client.py | lihuiba/SoftSAN | 1b8ab2cae92b7aac34211909b27d4ebe595275d7 | [
"Apache-2.0"
] | null | null | null | rpc-test-client.py | lihuiba/SoftSAN | 1b8ab2cae92b7aac34211909b27d4ebe595275d7 | [
"Apache-2.0"
] | 2 | 2018-03-21T04:59:50.000Z | 2019-12-03T15:54:17.000Z | import rpc, logging
import messages_pb2 as msg
import mds_mock
import gevent.socket
MDS_IP = '192.168.0.149'
MDS_PORT = 6789
logging.basicConfig(level=logging.DEBUG)
socket=gevent.socket.socket()
socket.connect((MDS_IP, MDS_PORT))
# guid=msg.Guid()
# guid.a=10
# guid.b=22
# guid.c=30
# guid.d=40
# stub=rpc.RpcStu... | 15.846154 | 46 | 0.705502 |
6f6c4b191a49297b74d9c9b58be8d516423c2879 | 1,002 | py | Python | Visual Studio Product Team/Visual Studio 2010 SDK Samples/[C++]-Visual Studio 2010 SDK Samples/IronPython Studio VS Shell Isolated/C#,C++/studioisolated/IronPython/src/IronPython.Project/Templates/Items/Form/Form.py | zzgchina888/msdn-code-gallery-microsoft | 21cb9b6bc0da3b234c5854ecac449cb3bd261f29 | [
"MIT"
] | 2 | 2022-01-21T01:40:58.000Z | 2022-01-21T01:41:10.000Z | Common7/IDE/src/IronPython.Project/Templates/Items/Form/Form.py | jdm7dv/visual-studio | 16cff89cee98f3c5e1c3e6134d1658c271a5902f | [
"Apache-2.0"
] | 1 | 2022-03-15T04:21:41.000Z | 2022-03-15T04:21:41.000Z | Common7/IDE/src/IronPython.Project/Templates/Items/Form/Form.py | jdm7dv/visual-studio | 16cff89cee98f3c5e1c3e6134d1658c271a5902f | [
"Apache-2.0"
] | null | null | null | import System
from System.Windows.Forms import *
from System.ComponentModel import *
from System.Drawing import *
from clr import *
class $rootnamespace$: # namespace
class $safeitemname$(System.Windows.Forms.Form):
""""""
__slots__ = []
def __init__(self):
self.Initial... | 27.081081 | 54 | 0.51497 |
489cb63d0955c24f2e63110700868c938451aabf | 1,225 | py | Python | src/onegov/user/forms/login.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/user/forms/login.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/user/forms/login.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.form import Form
from onegov.user import _
from wtforms import StringField, PasswordField, validators
class LoginForm(Form):
""" A generic login form for onegov.user """
username = StringField(
label=_("E-Mail Address"),
validators=[validators.InputRequired()],
render_kw={... | 29.166667 | 77 | 0.613878 |
fb941595075118b8d817a9e2cf90df4ac7d8090c | 5,053 | py | Python | Utils/github_workflow_scripts/delete_stale_non_contrib_branches.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Utils/github_workflow_scripts/delete_stale_non_contrib_branches.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Utils/github_workflow_scripts/delete_stale_non_contrib_branches.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | #!/usr/bin/env python3
import os
import sys
import urllib3
from blessings import Terminal
from github import Github, enable_console_debug_logging
from github.Repository import Repository
from typing import List
from dateparser import parse
from datetime import datetime, timezone
from utils import timestamped_print
ur... | 42.822034 | 118 | 0.651296 |
f72d376d64716f4e1292cdae5c874f29c229dbed | 1,022 | py | Python | GeeksForGeeks/SumOfPairs/solution2.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 165 | 2020-10-03T08:01:11.000Z | 2022-03-31T02:42:08.000Z | GeeksForGeeks/SumOfPairs/solution2.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 383 | 2020-10-03T07:39:11.000Z | 2021-11-20T07:06:35.000Z | GeeksForGeeks/SumOfPairs/solution2.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 380 | 2020-10-03T08:05:04.000Z | 2022-03-19T06:56:59.000Z | # Map Approach [O(n)] :
# Idea is to create a hashmap to store freq of the elements, and lookup those elements while traversing the array to check if their sum is equal to the given sum or not
# GeeksforGeeks Explanation: https://youtu.be/bvKMZXc0jQU
def getPairsCount(arr, n, sum):
m = [0] * 1000
# Store count... | 31.9375 | 168 | 0.671233 |
f78ca0c3a1438fdea904c50ea5eb3ddf2ca2d077 | 3,100 | py | Python | code/selfish_proxy/strategy/code.py | simonmulser/master-thesis | 5ca2ddda377a0eede5a3c50866e0f90292c5448f | [
"CC-BY-4.0"
] | null | null | null | code/selfish_proxy/strategy/code.py | simonmulser/master-thesis | 5ca2ddda377a0eede5a3c50866e0f90292c5448f | [
"CC-BY-4.0"
] | null | null | null | code/selfish_proxy/strategy/code.py | simonmulser/master-thesis | 5ca2ddda377a0eede5a3c50866e0f90292c5448f | [
"CC-BY-4.0"
] | 1 | 2019-06-05T09:10:30.000Z | 2019-06-05T09:10:30.000Z | import logging
from strategy import Action
from strategy import ActionException
from strategy import BlockOrigin
class Strategy:
def __init__(self, lead_stubborn=False, equal_fork_stubborn=False, trail_stubborn=0):
self.lead_stubborn = lead_stubborn
self.equal_fork_stubborn = equal_fork_stubborn
... | 38.271605 | 111 | 0.54129 |
4d0180ec68b29b9295731cce057d7d2b8fd66401 | 5,261 | py | Python | test/test_npu/test_network_ops/test_mse_loss_backward.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-12-02T03:07:35.000Z | 2021-12-02T03:07:35.000Z | test/test_npu/test_network_ops/test_mse_loss_backward.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-11-12T07:23:03.000Z | 2021-11-12T08:28:13.000Z | test/test_npu/test_network_ops/test_mse_loss_backward.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 35.547297 | 82 | 0.65919 |
4d27ca52bd770caa1003a4534ba5829aaf88f977 | 612 | py | Python | scriptsForPreprocessing/rename_file_in_folder.py | fishial/Object-Detection-Model | 4792f65ea785156a8e240d9cdbbc0c9d013ea0bb | [
"CC0-1.0"
] | 1 | 2022-01-03T14:00:17.000Z | 2022-01-03T14:00:17.000Z | scriptsForPreprocessing/rename_file_in_folder.py | fishial/Object-Detection-Model | 4792f65ea785156a8e240d9cdbbc0c9d013ea0bb | [
"CC0-1.0"
] | null | null | null | scriptsForPreprocessing/rename_file_in_folder.py | fishial/Object-Detection-Model | 4792f65ea785156a8e240d9cdbbc0c9d013ea0bb | [
"CC0-1.0"
] | 1 | 2021-12-21T09:50:53.000Z | 2021-12-21T09:50:53.000Z | import glob, os
import uuid
import shutil
def rename(dir, pattern):
folders = [x[0] for x in os.walk(dir)]
for folder in folders:
for x, pathAndFilename in enumerate(glob.iglob(os.path.join(folder, pattern))):
title, ext = os.path.splitext(os.path.basename(pathAndFilename))
file... | 36 | 87 | 0.606209 |
4299a3e444bcc9b95957fd42401e3d4246180557 | 318 | py | Python | src/visuanalytics/util/dict_utils.py | mxsph/Data-Analytics | c82ff54b78f50b6660d7640bfee96ea68bef598f | [
"MIT"
] | 3 | 2020-08-24T19:02:09.000Z | 2021-05-27T20:22:41.000Z | src/visuanalytics/util/dict_utils.py | mxsph/Data-Analytics | c82ff54b78f50b6660d7640bfee96ea68bef598f | [
"MIT"
] | 342 | 2020-08-13T10:24:23.000Z | 2021-08-12T14:01:52.000Z | src/visuanalytics/util/dict_utils.py | visuanalytics/visuanalytics | f9cce7bc9e3227568939648ddd1dd6df02eac752 | [
"MIT"
] | 8 | 2020-09-01T07:11:18.000Z | 2021-04-09T09:02:11.000Z | def merge_dict(dict1, dict2):
# TODO (max) may merge sub lists
for k in set(dict1).union(set(dict2)):
if k in dict2:
if isinstance(dict1.get(k, None), dict) and isinstance(dict2[k], dict):
merge_dict(dict1[k], dict2[k])
else:
dict1[k] = dict2[k]
| 35.333333 | 83 | 0.544025 |
c427432275f2e4a83a41182e11f1d14d52ab306a | 668 | py | Python | schloesser/ex06_07/misc.py | appfs/appfs | 8cbbfa0e40e4d4a75a498ce8dd894bb2fbc3a9e3 | [
"MIT"
] | 11 | 2017-04-21T11:39:55.000Z | 2022-02-11T20:25:18.000Z | schloesser/ex06_07/misc.py | appfs/appfs | 8cbbfa0e40e4d4a75a498ce8dd894bb2fbc3a9e3 | [
"MIT"
] | 69 | 2017-04-26T09:30:38.000Z | 2017-08-01T11:31:21.000Z | schloesser/ex06_07/misc.py | appfs/appfs | 8cbbfa0e40e4d4a75a498ce8dd894bb2fbc3a9e3 | [
"MIT"
] | 53 | 2017-04-20T16:16:11.000Z | 2017-07-19T12:53:01.000Z | #!/usr/bin/env python3
'''
helper functions
'''
def pop_next_destination(to_visit, distance):
'''
Return a vertex that still has to be visited and has currently smallest distance to startvertex.
Args:
to_visit (array): an array of bools indicating whether or not a vertex has to be visited.
... | 27.833333 | 107 | 0.643713 |
e1e06398895993fed82d5a2d6c50aada73005024 | 1,273 | py | Python | solutions/item_based_recommend/service/load.py | naetimus/bootcamp | 0182992df7c54012944b51fe9b70532ab6a0059b | [
"Apache-2.0"
] | 1 | 2021-01-11T18:40:22.000Z | 2021-01-11T18:40:22.000Z | solutions/item_based_recommend/service/load.py | naetimus/bootcamp | 0182992df7c54012944b51fe9b70532ab6a0059b | [
"Apache-2.0"
] | null | null | null | solutions/item_based_recommend/service/load.py | naetimus/bootcamp | 0182992df7c54012944b51fe9b70532ab6a0059b | [
"Apache-2.0"
] | null | null | null | import logging
from bert_serving.client import BertClient
from src.milvus import milvus_client
from src.search import do_search, do_show_categories, do_show_category_texts
from src.insert import do_insert
from src.mysql_toolkits import connect_mysql
from src.config import BERT_HOST, BERT_PORT, TABLE_NAME
import sys, ... | 24.480769 | 76 | 0.630008 |
97f6d7f9abcc0f00edfc1c061099806af3c9b6e1 | 2,494 | py | Python | main.py | PeppaPizza/Blob-s-Advanture | bade5c10ef44c6bf9ea18f6f41607dd2923366a0 | [
"Unlicense"
] | null | null | null | main.py | PeppaPizza/Blob-s-Advanture | bade5c10ef44c6bf9ea18f6f41607dd2923366a0 | [
"Unlicense"
] | null | null | null | main.py | PeppaPizza/Blob-s-Advanture | bade5c10ef44c6bf9ea18f6f41607dd2923366a0 | [
"Unlicense"
] | null | null | null | # ______ _ _ ___ _ _
# | ___ \ | | | / _ \ | | | |
# | |_/ / | ___ | |__ ___ / /_\ \ __| |_ ____ _ _ __ | |_ _ _ _ __ ___
# | ___ \ |/ _ \| '_ \/ __| | _ |/ _` \ \ / / _` | '_ \| __| | | | '__/ _ \
# | ... | 30.790123 | 131 | 0.52927 |
18e8d90b1a5a7e3d927a6b7e30abdfd52427232a | 1,045 | pyde | Python | sketches/ghost/ghost.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 4 | 2018-06-03T02:11:46.000Z | 2021-08-18T19:55:15.000Z | sketches/ghost/ghost.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | null | null | null | sketches/ghost/ghost.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 3 | 2019-12-23T19:12:51.000Z | 2021-04-30T14:00:31.000Z | easing1 = 0.01
easing2 = 0.05
ghostX = 240
ghostY = 200
engelX = 200
engelY = 240
def setup():
global bg, ghost, engel
bg = loadImage("koken.jpg")
ghost = loadImage("ghost.png")
engel = loadImage("engel.png")
frameRate(30)
size(560, 320)
def draw():
global ghostX, ghostY, engelX, engelY
... | 22.234043 | 42 | 0.552153 |
e16addc018fec8464a382177dabeacb33eba191e | 811 | py | Python | pyScript_NodeManager/Node_ListWidget.py | Shirazbello/Pyscriptining | 0f2c80a9bb10477d65966faeccc7783f20385c1b | [
"MIT"
] | null | null | null | pyScript_NodeManager/Node_ListWidget.py | Shirazbello/Pyscriptining | 0f2c80a9bb10477d65966faeccc7783f20385c1b | [
"MIT"
] | null | null | null | pyScript_NodeManager/Node_ListWidget.py | Shirazbello/Pyscriptining | 0f2c80a9bb10477d65966faeccc7783f20385c1b | [
"MIT"
] | null | null | null | from PySide2.QtWidgets import QWidget, QHBoxLayout, QLabel
from PySide2.QtCore import Signal
from Node import Node
class Node_ListWidget(QWidget):
double_clicked = Signal(Node)
def __init__(self, node):
super(Node_ListWidget, self).__init__()
self.setLayout(QHBoxLayout(self))
self.l... | 23.171429 | 58 | 0.662145 |
e1b21523d1109585b328d1f572ca5bf50aaba26c | 7,318 | py | Python | PlaidCTF/2021/crypto/Fake_Medallion/bank.py | mystickev/ctf-archives | 89e99a5cd5fb6b2923cad3fe1948d3ff78649b4e | [
"MIT"
] | 1 | 2021-11-02T20:53:58.000Z | 2021-11-02T20:53:58.000Z | PlaidCTF/2021/crypto/Fake_Medallion/bank.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | PlaidCTF/2021/crypto/Fake_Medallion/bank.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 1 | 2021-12-19T11:06:24.000Z | 2021-12-19T11:06:24.000Z | import numpy as np
import random
from os import urandom
from Crypto.Util.number import long_to_bytes, bytes_to_long
from Crypto.Cipher import AES
from qiskit import (
QuantumCircuit,
QuantumRegister,
ClassicalRegister,
Aer,
assemble
)
from qiskit.quantum_info.operators import Operator
class Ban... | 36.049261 | 79 | 0.498634 |
36c167b7801402f9baa7db6ee590d8046b6e47b5 | 3,938 | py | Python | src/onegov/org/views/message.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/org/views/message.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/org/views/message.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from collections import namedtuple
from onegov.chat import Message
from onegov.chat import MessageCollection
from onegov.core.custom import json
from onegov.core.security import Private
from onegov.core.templates import render_template
from onegov.file import File
from onegov.file.models.file_message import FileMessage... | 30.292308 | 78 | 0.627222 |
7ff46f9d11285740d3cd318551477cc0dbe9e0ab | 8,038 | py | Python | research/cv/relationnet/src/relationnet.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 1 | 2021-11-18T08:17:44.000Z | 2021-11-18T08:17:44.000Z | research/cv/relationnet/src/relationnet.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | null | null | null | research/cv/relationnet/src/relationnet.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 2 | 2019-09-01T06:17:04.000Z | 2019-10-04T08:39:45.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 42.983957 | 108 | 0.626524 |
180dd92f6714de7b04ce1538431300f787bc1b48 | 7,906 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/onyx_igmp.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/onyx_igmp.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/onyx_igmp.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | #!/usr/bin/python
#
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | 35.137778 | 103 | 0.642676 |
18618d5258f1ab5c31fb97456248b89aace7202c | 3,708 | py | Python | official/nlp/fasttext/export.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | official/nlp/fasttext/export.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | official/nlp/fasttext/export.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 37.836735 | 104 | 0.707389 |
18784340fd321a5e21abb49f4a1f043b833f6a5f | 769 | py | Python | Hackerrank_problems/Is This a Binary Search Tree/solution.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 165 | 2020-10-03T08:01:11.000Z | 2022-03-31T02:42:08.000Z | Hackerrank_problems/Is This a Binary Search Tree/solution.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 383 | 2020-10-03T07:39:11.000Z | 2021-11-20T07:06:35.000Z | Hackerrank_problems/Is This a Binary Search Tree/solution.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 380 | 2020-10-03T08:05:04.000Z | 2022-03-19T06:56:59.000Z | """ Node is defined as
class node:
def __init__(self, data):
self.data = data
self.left = None
self.right = None
"""
def build_list(root, nodes):
"""
Put the tree elements in a list with the
inorder traversal approach.
"""
if root:
build_list(root.left, nodes)
nod... | 24.806452 | 53 | 0.608583 |
a1dfecff52abbfa7a373a3429d60348487cb60a4 | 2,305 | py | Python | weibo/test/testUserMore.py | haiboz/weiboSpider | 517cae2ef3e7bccd9e1d328a40965406707f5362 | [
"Apache-2.0"
] | null | null | null | weibo/test/testUserMore.py | haiboz/weiboSpider | 517cae2ef3e7bccd9e1d328a40965406707f5362 | [
"Apache-2.0"
] | null | null | null | weibo/test/testUserMore.py | haiboz/weiboSpider | 517cae2ef3e7bccd9e1d328a40965406707f5362 | [
"Apache-2.0"
] | null | null | null | #encoding:utf8
'''
Created on 2016年4月12日
@author: wb-zhaohaibo
'''
import re
from bs4 import BeautifulSoup
html_cont = open("user.html","r").read().decode("utf8")
# soup = BeautifulSoup(html_cont,"html.parser",from_encoding="utf-8")
# <a class="WB_cardmore S_txt1 S_line1 clearfix" href="/p/10050538428590... | 48.020833 | 660 | 0.662907 |
62aa7c9204067adb7afc5f2f0e007f5b9f6a8143 | 36 | py | Python | lib/python3.5/operator.py | hwroitzsch/BikersLifeSaver | 469c738fdd6352c44a3f20689b17fa8ac04ad8a2 | [
"MIT"
] | 1 | 2020-08-16T04:04:23.000Z | 2020-08-16T04:04:23.000Z | lib/python3.5/operator.py | hwroitzsch/BikersLifeSaver | 469c738fdd6352c44a3f20689b17fa8ac04ad8a2 | [
"MIT"
] | 5 | 2020-06-05T18:53:24.000Z | 2021-12-13T19:49:15.000Z | lib/python3.5/operator.py | hwroitzsch/BikersLifeSaver | 469c738fdd6352c44a3f20689b17fa8ac04ad8a2 | [
"MIT"
] | null | null | null | /usr/local/lib/python3.5/operator.py | 36 | 36 | 0.805556 |
62afd92d6ef50f7a09e31f5a4ac2bbc19174d0b9 | 2,889 | py | Python | Packs/PassiveTotal/Scripts/RiskIQPassiveTotalComponentsWidgetScript/RiskIQPassiveTotalComponentsWidgetScript_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/PassiveTotal/Scripts/RiskIQPassiveTotalComponentsWidgetScript/RiskIQPassiveTotalComponentsWidgetScript_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/PassiveTotal/Scripts/RiskIQPassiveTotalComponentsWidgetScript/RiskIQPassiveTotalComponentsWidgetScript_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | from RiskIQPassiveTotalComponentsWidgetScript import set_arguments_for_widget_view
def test_for_components_widget_set_arguments_for_widget_view_when_indicator_type_riskiqasset_and_riskiqassettype_is_empty():
# Configure
# set argument for command
indicator_data = {
'indicator_type': 'RiskIQAsset'... | 28.89 | 124 | 0.688474 |
62f2eb9d40dd462961c5e19897b4bea5e14a7b8f | 3,464 | py | Python | pupil_invisible_monitor/deployment/_packaging/linux.py | JuBepy/Gaze_Mouse | 4ddea30b4f53deb744dac3f370e7f48baa3b99c2 | [
"MIT"
] | null | null | null | pupil_invisible_monitor/deployment/_packaging/linux.py | JuBepy/Gaze_Mouse | 4ddea30b4f53deb744dac3f370e7f48baa3b99c2 | [
"MIT"
] | null | null | null | pupil_invisible_monitor/deployment/_packaging/linux.py | JuBepy/Gaze_Mouse | 4ddea30b4f53deb744dac3f370e7f48baa3b99c2 | [
"MIT"
] | null | null | null | import shutil
from pathlib import Path
from subprocess import call
from .utils import pupil_version, get_tag_commit, app_name, package_name, dist_dir
def deb_package(deployment_root: Path) -> Path:
app_version = pupil_version()
git_version = get_tag_commit()
# lets build the structure for our d... | 33.307692 | 113 | 0.659065 |
a7fd2f9a8a311c7ad14b34b8fb4e8da6533cb593 | 1,123 | py | Python | helper/segmentation/downloader_coco_imgs.py | fishial/Object-Detection-Model | 4792f65ea785156a8e240d9cdbbc0c9d013ea0bb | [
"CC0-1.0"
] | 1 | 2022-01-03T14:00:17.000Z | 2022-01-03T14:00:17.000Z | helper/segmentation/downloader_coco_imgs.py | fishial/Object-Detection-Model | 4792f65ea785156a8e240d9cdbbc0c9d013ea0bb | [
"CC0-1.0"
] | null | null | null | helper/segmentation/downloader_coco_imgs.py | fishial/Object-Detection-Model | 4792f65ea785156a8e240d9cdbbc0c9d013ea0bb | [
"CC0-1.0"
] | 1 | 2021-12-21T09:50:53.000Z | 2021-12-21T09:50:53.000Z | import os
import json
import requests
from tqdm import tqdm
from concurrent.futures import ThreadPoolExecutor
def find_image_by_id(id: int):
for i in data['images']:
if i['id'] == id:
return i
f = open('data/export.json',)
data = json.load(f)
f.close()
def download(url):
r = requests.g... | 27.390244 | 95 | 0.657168 |
3dca61406bf7a4c2f47f50e04f49dc1a3c83664e | 582 | py | Python | py-basics/src/lectures/dictionaries/roman-numbers.py | AndrasTarlos/s4f | bfe2d631a9a2715953d8ac5ddc8ef97d3cefb426 | [
"CC0-1.0"
] | null | null | null | py-basics/src/lectures/dictionaries/roman-numbers.py | AndrasTarlos/s4f | bfe2d631a9a2715953d8ac5ddc8ef97d3cefb426 | [
"CC0-1.0"
] | null | null | null | py-basics/src/lectures/dictionaries/roman-numbers.py | AndrasTarlos/s4f | bfe2d631a9a2715953d8ac5ddc8ef97d3cefb426 | [
"CC0-1.0"
] | 4 | 2021-12-13T15:52:00.000Z | 2022-03-28T13:54:53.000Z | # 5kyu | Roman Numerals Decoder
# https://www.codewars.com/kata/51b6249c4612257ac0000005/python
def solution(roman):
lookup = {"I": 1, "V": 5, "X": 10, "L": 50, "C": 100, "D": 500, "M": 1000}
number = 0
lastVal = 0
for ch in roman[::-1]:
val = lookup[ch]
if lastVal > val:
n... | 23.28 | 78 | 0.537801 |
3dd7d1ba2ec2b0dd5acf938a2aaae9dca33ec7dc | 1,045 | py | Python | HW2/compute_proj_xform.py | kvswim/kv_jhu_cv | 2ddf7a9d497aef116a7c043157b8631cea45000d | [
"MIT"
] | null | null | null | HW2/compute_proj_xform.py | kvswim/kv_jhu_cv | 2ddf7a9d497aef116a7c043157b8631cea45000d | [
"MIT"
] | null | null | null | HW2/compute_proj_xform.py | kvswim/kv_jhu_cv | 2ddf7a9d497aef116a7c043157b8631cea45000d | [
"MIT"
] | null | null | null | # Author: TK
import cv2
import numpy
import matplotlib.pyplot as plt
def compute_proj_xform(matches,features1,features2,image1,image2):
"""
DO NOT DO - NOT REQ for 461
Computer Vision 600.461/661 Assignment 2
Args:
matches (list of tuples): list of index pairs of possible matches. For example, ... | 43.541667 | 147 | 0.707177 |
b15fb458bd4aa3c11e38608b002baad8e18ad4b7 | 860 | py | Python | demos/Multiscale/ThreeSided/model/parts/providers.py | w-ghub/demos | 6382676fae89bd5a190626612712fcedf17bca6d | [
"MIT"
] | 56 | 2020-07-08T23:23:15.000Z | 2022-03-11T20:43:09.000Z | demos/Multiscale/ThreeSided/model/parts/providers.py | w-ghub/demos | 6382676fae89bd5a190626612712fcedf17bca6d | [
"MIT"
] | 41 | 2020-07-11T23:24:06.000Z | 2022-01-28T13:28:07.000Z | demos/Multiscale/ThreeSided/model/parts/providers.py | w-ghub/demos | 6382676fae89bd5a190626612712fcedf17bca6d | [
"MIT"
] | 39 | 2020-07-15T11:35:04.000Z | 2022-02-01T16:02:51.000Z |
# Behaviors
def provider_choice(params, step, history, current_state):
#fiat claimed by providers
#note: balance of provided vol covered in tokens (computed later)
txo_fiat = params['theta']*current_state['tx_volume']+ (1-params['theta'])*params['gamma']*current_state['volume_of_production']*current_state[... | 37.391304 | 168 | 0.701163 |
49194082bd80057a3697018db842320d6b034da4 | 1,469 | py | Python | research/cv/tgcn/src/config.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 1 | 2021-11-18T08:17:44.000Z | 2021-11-18T08:17:44.000Z | research/cv/tgcn/src/config.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | null | null | null | research/cv/tgcn/src/config.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 2 | 2019-09-01T06:17:04.000Z | 2019-10-04T08:39:45.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 29.38 | 93 | 0.643975 |
7703080b0fb27902316a042f0a45739d4fb697e9 | 8,863 | py | Python | Termux-Mpv-master/termuxmpv/__main__.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | Termux-Mpv-master/termuxmpv/__main__.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | Termux-Mpv-master/termuxmpv/__main__.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-05T18:07:48.000Z | 2022-02-24T21:25:07.000Z | #!/usr/bin/env python
import sys
import signal
import subprocess
import socket
import os
import time
import tempfile
import json
import select
class Termuxmpv:
def signal_handler(self, signal, frame):
pass
def __init__(self, args):
signal.signal(signal.SIGINT, self.signal_handler)
sel... | 30.98951 | 119 | 0.483132 |
772aca7600d70802042d07553663b4527ce2f962 | 1,644 | py | Python | src/visuanalytics/tests/analytics/transform/types/test_transform_loop.py | mxsph/Data-Analytics | c82ff54b78f50b6660d7640bfee96ea68bef598f | [
"MIT"
] | 3 | 2020-08-24T19:02:09.000Z | 2021-05-27T20:22:41.000Z | src/visuanalytics/tests/analytics/transform/types/test_transform_loop.py | mxsph/Data-Analytics | c82ff54b78f50b6660d7640bfee96ea68bef598f | [
"MIT"
] | 342 | 2020-08-13T10:24:23.000Z | 2021-08-12T14:01:52.000Z | src/visuanalytics/tests/analytics/transform/types/test_transform_loop.py | visuanalytics/visuanalytics | f9cce7bc9e3227568939648ddd1dd6df02eac752 | [
"MIT"
] | 8 | 2020-09-01T07:11:18.000Z | 2021-04-09T09:02:11.000Z | import unittest
from visuanalytics.tests.analytics.transform.transform_test_helper import prepare_test
class TestTransformLoop(unittest.TestCase):
# TODO
def setUp(self):
self.data = {
"value": 0,
"values": []
}
def test_range(self):
values = [
... | 25.292308 | 86 | 0.364355 |
91f75e34be5fdc09741729569bcb90d3936c6316 | 616 | py | Python | RDS/circle2_use_cases/metadata/src/api/Jsonschema.py | Sciebo-RDS/Sciebo-RDS | d71cf449ed045a2a7a049e2cb77c99fd5a9195bd | [
"MIT"
] | 10 | 2020-06-24T08:22:24.000Z | 2022-01-13T16:17:36.000Z | RDS/circle2_use_cases/metadata/src/api/Jsonschema.py | Sciebo-RDS/Sciebo-RDS | d71cf449ed045a2a7a049e2cb77c99fd5a9195bd | [
"MIT"
] | 78 | 2020-01-23T14:32:06.000Z | 2022-03-07T14:11:16.000Z | RDS/circle2_use_cases/metadata/src/api/Jsonschema.py | Sciebo-RDS/Sciebo-RDS | d71cf449ed045a2a7a049e2cb77c99fd5a9195bd | [
"MIT"
] | 1 | 2020-06-24T08:33:48.000Z | 2020-06-24T08:33:48.000Z | from lib.Metadata import Metadata
from flask import jsonify
import json
def index():
# taken from https://raw.githubusercontent.com/datacite/schema/master/source/json/kernel-4.3/datacite_4.3_schema.json
# https://sandbox.zenodo.org//schemas/deposits/records/legacyrecord.json
# example can be found here: h... | 41.066667 | 157 | 0.711039 |
62366de4f890a7d34b1eddc66476dd0c81cab820 | 243 | py | Python | exercises/zh/test_02_05_01.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/zh/test_02_05_01.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/zh/test_02_05_01.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | def test():
assert (
"from spacy.tokens import Doc" in __solution__
), "你有正确导入Doc类吗?"
assert doc.text == "spaCy is cool!", "你有正确创建Doc吗?"
assert "print(doc.text)" in __solution__, "你有打印Doc的文字吗?"
__msg__.good("好极了!")
| 30.375 | 60 | 0.62963 |
b86e3ea082ab7c27f86ba45352f5d23a11c5641b | 433 | py | Python | 1_basics/6_stroke.py | Coding-for-the-Arts/drawbot-samples | e37994f3497aca252312431100b53548b4573f15 | [
"CC0-1.0"
] | null | null | null | 1_basics/6_stroke.py | Coding-for-the-Arts/drawbot-samples | e37994f3497aca252312431100b53548b4573f15 | [
"CC0-1.0"
] | null | null | null | 1_basics/6_stroke.py | Coding-for-the-Arts/drawbot-samples | e37994f3497aca252312431100b53548b4573f15 | [
"CC0-1.0"
] | null | null | null | """
Linienfarbe
"""
newPage(1000, 1000)
fill(None)
stroke(0, 0, 1)
strokeWidth(2)
line((0, 0), (width(), height()))
oval(100, 100, 800, 800)
"""
- Mit der Funktion stroke() kannst du die Linienfarbe einstellen.
- Mit dem Wert "None" als Argument von fill() oder stroke()
kannst du eine Farbe «abschalten».
- Probi... | 20.619048 | 71 | 0.69515 |
a2941daaec811da6fe2d6346446d26822afe7ee1 | 636 | py | Python | AFluentPython/pyDesignPatterns/factory_patterns/factory_func.py | RoboCuper-hujinlei/AI-Job | cf7a081d59700d75f0f2dc73b6d5130863796f01 | [
"Apache-2.0"
] | null | null | null | AFluentPython/pyDesignPatterns/factory_patterns/factory_func.py | RoboCuper-hujinlei/AI-Job | cf7a081d59700d75f0f2dc73b6d5130863796f01 | [
"Apache-2.0"
] | null | null | null | AFluentPython/pyDesignPatterns/factory_patterns/factory_func.py | RoboCuper-hujinlei/AI-Job | cf7a081d59700d75f0f2dc73b6d5130863796f01 | [
"Apache-2.0"
] | null | null | null | '''
factory 工厂模式
'''
import sys
import os
import json
class A:
pass
def main():
a = A()
b = A()
print(id(a) == id(b))
print(a, b)
class JSONParser:
def parse(self, raw_data):
return json.loads(raw_data) # str 2 dict
class XMLParser:
def parse(self, raw_data):
return... | 14.454545 | 49 | 0.570755 |
a2b48fbf2f8359880a2f950704a00b2936d0bfb0 | 429 | py | Python | py-td1/ex1.py | HuguesGuilleus/istyPOO | f460665799be2b2f34a1ebaa9878e06bb028a410 | [
"BSD-3-Clause"
] | null | null | null | py-td1/ex1.py | HuguesGuilleus/istyPOO | f460665799be2b2f34a1ebaa9878e06bb028a410 | [
"BSD-3-Clause"
] | null | null | null | py-td1/ex1.py | HuguesGuilleus/istyPOO | f460665799be2b2f34a1ebaa9878e06bb028a410 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
# GUILLEUS Hugues IATIC3 <hugues.guilleus@ens.uvsq.fr>
print("=== Première partie")
temps = 6.892
dist = 19.7
vit = dist / temps
print(f"vitesse: {vit}")
print("vitesse {0:.1f}".format(vit))
print("\n=== Deuxième partie")
nom = input("nom? ")
age = int(input("âge? "))
pr... | 23.833333 | 58 | 0.652681 |
0c00d572c2a13e64142d360414031f7dfa78f091 | 1,776 | py | Python | main.py | Strange-Penguins/Stython | f4f96383681f311dd0ecceddf15417c78c974830 | [
"MIT"
] | 1 | 2021-03-13T21:50:12.000Z | 2021-03-13T21:50:12.000Z | main.py | Strange-Penguins/Stython | f4f96383681f311dd0ecceddf15417c78c974830 | [
"MIT"
] | 4 | 2021-03-13T22:22:11.000Z | 2021-03-14T22:17:49.000Z | main.py | Strange-Penguins/Stython | f4f96383681f311dd0ecceddf15417c78c974830 | [
"MIT"
] | null | null | null | import os
import customclient
from discord.ext import commands
from discord import Intents
import discord
prefix = os.environ.get("DISCORD_PREFIX")
# Returns a prefix. Warning: Two Arguments required
def get_prefix(client, message):
return commands.when_mentioned_or(prefix)(client, message)
# A Function to loa... | 24.666667 | 107 | 0.686374 |
0c36081283dbbc7939fdb41d31e3f1a417f1aa48 | 556 | py | Python | test.py | AnonymFx/trainingswissenschafften-zusammenfassung | 741a183b26af4744b656c7607855d15bf707b358 | [
"MIT"
] | null | null | null | test.py | AnonymFx/trainingswissenschafften-zusammenfassung | 741a183b26af4744b656c7607855d15bf707b358 | [
"MIT"
] | null | null | null | test.py | AnonymFx/trainingswissenschafften-zusammenfassung | 741a183b26af4744b656c7607855d15bf707b358 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
from re import sub
inp = """
•
Kulturell-erzieherische Funktion
– Fair-Play, Aneignung von
Charaktereigenschaften
•
Soziale Funktion
– Ausbildung von Zusammengehörigkeitsgefühl
•
Kommerzielle Funktion
– Profisport, materieller Gewinn
•
Unterhaltungsfunktion
– Medienunternehmen
•
Politische Funktion... | 15.885714 | 48 | 0.703237 |
ce461a6aa7d4fc467dcee11fdf983694e04da6b2 | 488 | py | Python | exercises/pt/test_01_02_03.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/pt/test_01_02_03.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/pt/test_01_02_03.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | def test():
import spacy.tokens
import spacy.lang.es
assert isinstance(
nlp, spacy.lang.es.Spanish
), "O objeto nlp deve ser uma instância da classe Spanish."
assert isinstance(
doc, spacy.tokens.Doc
), "Você processou o texto com o objeto nlp para criar o documento Doc?"
as... | 34.857143 | 86 | 0.690574 |
0cae158a413d5357f22a529cb9a7373f86f7bd29 | 267 | py | Python | frappe-bench/apps/erpnext/erpnext/support/doctype/issue/test_issue.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 4 | 2017-09-25T23:34:08.000Z | 2020-07-17T23:52:26.000Z | frappe-bench/apps/erpnext/erpnext/support/doctype/issue/test_issue.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/support/doctype/issue/test_issue.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 5 | 2017-06-02T01:58:32.000Z | 2022-02-22T16:59:01.000Z | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
test_records = frappe.get_test_records('Issue')
class TestIssue(unittest.TestCase):
pass
| 22.25 | 85 | 0.808989 |
0cbfe6e3f956b6edf5c47f924daec121ad0f70d7 | 2,286 | py | Python | src/d2py/tools/write/_docs.py | xinetzone/d2py | 657362a0451921ef5a7b05b4a8378f7379063cdf | [
"Apache-2.0"
] | 3 | 2022-03-09T14:08:42.000Z | 2022-03-10T04:17:17.000Z | src/d2py/tools/write/_docs.py | xinetzone/d2py | 657362a0451921ef5a7b05b4a8378f7379063cdf | [
"Apache-2.0"
] | 3 | 2021-11-07T13:11:26.000Z | 2022-03-19T03:28:48.000Z | src/d2py/tools/write/_docs.py | xinetzone/d2py | 657362a0451921ef5a7b05b4a8378f7379063cdf | [
"Apache-2.0"
] | 1 | 2022-03-15T14:18:32.000Z | 2022-03-15T14:18:32.000Z | '''临时代码'''
import sys
from pathlib import Path
from shutil import rmtree
from invoke import Collection, task
@task(name='clean')
def _clean(c):
output = Path(c.sphinx.target)
if output.exists():
print(f'delete {output}')
rmtree(output)
@task(
default=True,
help={
"opts": "Ext... | 24.847826 | 72 | 0.569554 |
b2f0eeacab66ecf971f2fa73186c3712ff100ee0 | 666 | py | Python | src/test/tests/unit/utility.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 226 | 2018-12-29T01:13:49.000Z | 2022-03-30T19:16:31.000Z | src/test/tests/unit/utility.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 5,100 | 2019-01-14T18:19:25.000Z | 2022-03-31T23:08:36.000Z | src/test/tests/unit/utility.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 84 | 2019-01-24T17:41:50.000Z | 2022-03-10T10:01:46.000Z | # ----------------------------------------------------------------------------
# CLASSES: nightly
#
# Test Case: utility.py
#
# Tests: Utility_test unit test
#
# Mark C. Miller, Mon Dec 1 23:55:05 PST 2014
#
# Modifications:
# Kathleen Biagas, Mon Oct 26, 2020
# Retrieve correct path on Windows.
#
# -... | 24.666667 | 78 | 0.503003 |
6549fb9bc237438bb8fdd076a19cf7746b637993 | 162 | py | Python | Contests/DMOPC '14 Exam Time P1 - French Homework.py | MastaCoder/Projects | ebb0a3134522b12f052fec8d753005f384adf1b1 | [
"MIT"
] | 5 | 2018-10-11T01:55:40.000Z | 2021-12-25T23:38:22.000Z | Contests/DMOPC '14 Exam Time P1 - French Homework.py | MastaCoder/mini_projects | ebb0a3134522b12f052fec8d753005f384adf1b1 | [
"MIT"
] | null | null | null | Contests/DMOPC '14 Exam Time P1 - French Homework.py | MastaCoder/mini_projects | ebb0a3134522b12f052fec8d753005f384adf1b1 | [
"MIT"
] | 1 | 2019-02-22T14:42:50.000Z | 2019-02-22T14:42:50.000Z | a = input()
b = input()
if b[-1] == "s":
print(a + "-tu les", b, "?")
elif b[-1] == "e":
print(a + "-tu la", b, "?")
else:
print(a + "-tu le", b, "?") | 20.25 | 32 | 0.382716 |
3332a3fc803047795d8f7b735825a66cd9ef2646 | 1,842 | py | Python | chillow/service/ai/artificial_intelligence.py | jonashellmann/informaticup21-team-chillow | f2e519af0a5d9a9368d62556703cfb1066ebb58f | [
"MIT"
] | 3 | 2021-01-17T23:32:07.000Z | 2022-01-30T14:49:16.000Z | chillow/service/ai/artificial_intelligence.py | jonashellmann/informaticup21-team-chillow | f2e519af0a5d9a9368d62556703cfb1066ebb58f | [
"MIT"
] | 2 | 2021-01-17T13:37:56.000Z | 2021-04-14T12:28:49.000Z | chillow/service/ai/artificial_intelligence.py | jonashellmann/informaticup21-team-chillow | f2e519af0a5d9a9368d62556703cfb1066ebb58f | [
"MIT"
] | 2 | 2021-04-02T14:53:38.000Z | 2021-04-20T11:10:17.000Z | from abc import ABCMeta, abstractmethod
from multiprocessing import Value
from chillow.model.game import Game
from chillow.model.player import Player
class ArtificialIntelligence(metaclass=ABCMeta):
"""Abstract base-class for AI implementations.
Attributes:
player: The player associated with this AI... | 36.117647 | 104 | 0.67101 |
cc1a7116372c7715b03953fddd43dee12131c66c | 1,512 | py | Python | aMLpy/plot_crossmatch.py | dirac-institute/SPSAS2019 | 34781162bb088b17c1b9afb69eee2284dce6bdec | [
"MIT"
] | 15 | 2019-07-31T07:18:49.000Z | 2021-06-03T23:41:59.000Z | aMLpy/plot_crossmatch.py | dirac-institute/SPSAS2019 | 34781162bb088b17c1b9afb69eee2284dce6bdec | [
"MIT"
] | null | null | null | aMLpy/plot_crossmatch.py | dirac-institute/SPSAS2019 | 34781162bb088b17c1b9afb69eee2284dce6bdec | [
"MIT"
] | 6 | 2019-08-01T19:33:16.000Z | 2020-08-27T13:01:15.000Z | """
Catalog cross-matching
----------------------
This plots the cross-matched samples between the SDSS imaging data and
the SDSS Stripe 82 standard stars.
"""
# Author: Jake VanderPlas <vanderplas@astro.washington.edu>
# License: BSD
# The figure is an example from astroML: see http://astroML.github.com
import os
im... | 28.528302 | 74 | 0.683201 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.