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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
a92577bbe3e2b81f09a14408eaded58f7fc9c3c1 | 2,186 | py | Python | src/lecture4/ROC_plot/roc_plot.py | Fassial/zju-intern | f421f9c97d3c567e9b97121c5bf5c675c9e2c721 | [
"MIT"
] | 1 | 2020-08-17T07:09:09.000Z | 2020-08-17T07:09:09.000Z | src/lecture4/ROC_plot/roc_plot.py | Fassial/zju-intern | f421f9c97d3c567e9b97121c5bf5c675c9e2c721 | [
"MIT"
] | null | null | null | src/lecture4/ROC_plot/roc_plot.py | Fassial/zju-intern | f421f9c97d3c567e9b97121c5bf5c675c9e2c721 | [
"MIT"
] | 2 | 2020-07-26T07:27:57.000Z | 2020-08-17T07:09:15.000Z | import matplotlib.pyplot as plt
import os
import pandas as pd
import numpy as np
from sklearn.metrics import roc_curve
color_list = ['red','blue','black','chocolate','yellow','green','pink','violet']
font = {'family': 'Times New Roman', 'weight': 'normal', 'size': 9, }
def draw_roc_plot(save_fig_path,fig_name):
... | 48.577778 | 147 | 0.684355 |
a99008c7a639ab6327aaf63bebdfc8eb2d376e11 | 663 | py | Python | RDS/circle3_central_services/research_manager/src/api/User/Research/Status.py | Sciebo-RDS/Sciebo-RDS | d71cf449ed045a2a7a049e2cb77c99fd5a9195bd | [
"MIT"
] | 10 | 2020-06-24T08:22:24.000Z | 2022-01-13T16:17:36.000Z | RDS/circle3_central_services/research_manager/src/api/User/Research/Status.py | Sciebo-RDS/Sciebo-RDS | d71cf449ed045a2a7a049e2cb77c99fd5a9195bd | [
"MIT"
] | 78 | 2020-01-23T14:32:06.000Z | 2022-03-07T14:11:16.000Z | RDS/circle3_central_services/research_manager/src/api/User/Research/Status.py | Sciebo-RDS/Sciebo-RDS | d71cf449ed045a2a7a049e2cb77c99fd5a9195bd | [
"MIT"
] | 1 | 2020-06-24T08:33:48.000Z | 2020-06-24T08:33:48.000Z | import Singleton
from flask import jsonify, request
def index(user_id, research_id):
result = Singleton.ProjectService.getProject(
user_id, int(research_id)).status
return jsonify({"status": result})
def patch(user_id, research_id):
try:
req = request.json
except:
req = None
... | 26.52 | 73 | 0.689291 |
8d2c0c0faf89569556f38428c774dc8a963d75d4 | 1,427 | py | Python | src/ztc/java/jmap.py | magistersart/ZTC_fork | ce72734ea575d9846b5b81f3efbfd14fa1f7e532 | [
"PostgreSQL"
] | null | null | null | src/ztc/java/jmap.py | magistersart/ZTC_fork | ce72734ea575d9846b5b81f3efbfd14fa1f7e532 | [
"PostgreSQL"
] | null | null | null | src/ztc/java/jmap.py | magistersart/ZTC_fork | ce72734ea575d9846b5b81f3efbfd14fa1f7e532 | [
"PostgreSQL"
] | null | null | null | #!/usr/bin/env python
#pylint: disable=W0232
'''
ZTC JMap class: runs jmap ... <pid>, caches results and parses output
Created on 17.12.2009
@author: vrusinov
'''
import os
from ztc.check import ZTCCheck
from ztc.store import ZTCStore
class Jmap(ZTCCheck):
"""
Monitoring using jmap
"""
pid = 0... | 23.393443 | 69 | 0.544499 |
93f8d7d4e6c85af06feb27685103562b29070175 | 380 | py | Python | train_model/util.py | liwde/ArtOrTrash | 75d6aa0da53b7dd2ef328150afa4b0cb7d8c458a | [
"Apache-2.0"
] | 4 | 2019-06-03T19:31:47.000Z | 2019-06-13T13:38:58.000Z | train_model/util.py | liwde/ArtOrTrash | 75d6aa0da53b7dd2ef328150afa4b0cb7d8c458a | [
"Apache-2.0"
] | null | null | null | train_model/util.py | liwde/ArtOrTrash | 75d6aa0da53b7dd2ef328150afa4b0cb7d8c458a | [
"Apache-2.0"
] | null | null | null | import tensorflow as tf
from constants import *
def load_image(filename, label=None):
img_raw = tf.io.read_file(filename)
img_tensor = tf.image.decode_jpeg(img_raw, channels=3)
img_final = tf.image.resize(img_tensor, (IMAGE_SIZE, IMAGE_SIZE))
img_final = (img_final-IMAGE_MEAN)/IMAGE_STD
if label is... | 31.666667 | 69 | 0.731579 |
9e064175fef8ac344eba249ba3259221f8238e9f | 3,437 | py | Python | HW2/match_features.py | kvswim/kv_jhu_cv | 2ddf7a9d497aef116a7c043157b8631cea45000d | [
"MIT"
] | null | null | null | HW2/match_features.py | kvswim/kv_jhu_cv | 2ddf7a9d497aef116a7c043157b8631cea45000d | [
"MIT"
] | null | null | null | HW2/match_features.py | kvswim/kv_jhu_cv | 2ddf7a9d497aef116a7c043157b8631cea45000d | [
"MIT"
] | null | null | null | import cv2
import numpy as np
import matplotlib.pyplot as plt
def match_features(feature_coords1,feature_coords2,image1,image2):
"""
Computer Vision 600.461/661 Assignment 2
Args:
feature_coords1 (list of tuples): list of (row,col) tuple feature coordinates from image1
feature_coords2 (list... | 40.916667 | 147 | 0.637475 |
199cafd3baaef22c150b42aee7184ad32a6eabad | 987 | pyde | Python | sketches/mandelbrot5/mandelbrot5.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 4 | 2018-06-03T02:11:46.000Z | 2021-08-18T19:55:15.000Z | sketches/mandelbrot5/mandelbrot5.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | null | null | null | sketches/mandelbrot5/mandelbrot5.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 3 | 2019-12-23T19:12:51.000Z | 2021-04-30T14:00:31.000Z | import math
left = -2.25 # -2.25 -0.25
right = 0.75 # 0.75 0.25
bottom = -1.5 # -1.5 -1.0
top = 1.5 # 1.5 -0.5
maxlimit = 4.0
maxiter = 100
def setup():
size(600, 600)
noLoop()
def draw():
for x in range(width):
cr = left + x*(right - left)/width
for y in range(height):
... | 27.416667 | 65 | 0.411348 |
27d1294be9314e30f2d855d6f967a54b32e026d2 | 868 | py | Python | Codeforces/643-2/C.py | dipta007/Competitive-Programming | 998d47f08984703c5b415b98365ddbc84ad289c4 | [
"MIT"
] | 6 | 2018-10-15T18:45:05.000Z | 2022-03-29T04:30:10.000Z | Codeforces/643-2/C.py | dipta007/Competitive-Programming | 998d47f08984703c5b415b98365ddbc84ad289c4 | [
"MIT"
] | null | null | null | Codeforces/643-2/C.py | dipta007/Competitive-Programming | 998d47f08984703c5b415b98365ddbc84ad289c4 | [
"MIT"
] | 4 | 2018-01-07T06:20:07.000Z | 2019-08-21T15:45:59.000Z | """ Python 3 compatibility tools. """
from __future__ import division, print_function
import itertools
import sys
if sys.version_info[0] < 3:
input = raw_input
range = xrange
filter = itertools.ifilter
map = itertools.imap
zip = itertools.izip
def input1(type=int):
return type(input())
def input2(type... | 15.5 | 47 | 0.58871 |
08bfec6edd3efa80d9a3d4419886649baca9d39c | 484 | py | Python | 002-C98-Functions/__main__.py | somePythonProgrammer/PythonCode | fb2b2245db631cefd916a960768f411969b0e78f | [
"MIT"
] | 2 | 2021-09-28T13:55:20.000Z | 2021-11-15T10:08:49.000Z | 002-C98-Functions/__main__.py | somePythonProgrammer/PythonCode | fb2b2245db631cefd916a960768f411969b0e78f | [
"MIT"
] | null | null | null | 002-C98-Functions/__main__.py | somePythonProgrammer/PythonCode | fb2b2245db631cefd916a960768f411969b0e78f | [
"MIT"
] | 1 | 2022-01-20T03:02:20.000Z | 2022-01-20T03:02:20.000Z | # File swpper
# Made by somePythonProgrammer as a WhiteHat project.
# read the files
global file1_contents,file2_contents
with open('file_1.txt') as f1, open('file_2.txt') as f2:
file1_contents = f1.read()
file2_contents = f2.read()
# write the files, swapping them.
open('file_1.txt','w').write(file2_contents... | 30.25 | 70 | 0.729339 |
08c8ea2bb74e4d849566188dd93a17d19d462ca8 | 3,814 | py | Python | train_scripts/classification/auto_train_cross.py | fishial/Object-Detection-Model | 4792f65ea785156a8e240d9cdbbc0c9d013ea0bb | [
"CC0-1.0"
] | 1 | 2022-01-03T14:00:17.000Z | 2022-01-03T14:00:17.000Z | train_scripts/classification/auto_train_cross.py | fishial/Object-Detection-Model | 4792f65ea785156a8e240d9cdbbc0c9d013ea0bb | [
"CC0-1.0"
] | null | null | null | train_scripts/classification/auto_train_cross.py | fishial/Object-Detection-Model | 4792f65ea785156a8e240d9cdbbc0c9d013ea0bb | [
"CC0-1.0"
] | 1 | 2021-12-21T09:50:53.000Z | 2021-12-21T09:50:53.000Z | # coding=utf-8
from __future__ import absolute_import, division, print_function
import sys
# Change path specificly to your directories
sys.path.insert(1, '/home/codahead/Fishial/FishialReaserch')
from module.classification_package.src.model import FcNet
from module.classification_package.src.model import Backbone
f... | 37.762376 | 135 | 0.677766 |
3eaa33f008fff4d82957e9bd13085d0ffc7de01e | 339 | py | Python | initdb.py | Nukesor/ilswach-bot | 2e3e9dfa8f43b07caab79f2e94686557dc808731 | [
"MIT"
] | null | null | null | initdb.py | Nukesor/ilswach-bot | 2e3e9dfa8f43b07caab79f2e94686557dc808731 | [
"MIT"
] | null | null | null | initdb.py | Nukesor/ilswach-bot | 2e3e9dfa8f43b07caab79f2e94686557dc808731 | [
"MIT"
] | null | null | null | #!/bin/env python
"""Drop and create a new database with schema."""
from sqlalchemy_utils.functions import database_exists, create_database
from ilswbot.db import engine, base
from ilswbot.subscriber import Subscriber # noqa
db_url = engine.url
if not database_exists(db_url):
create_database(db_url)
base.met... | 26.076923 | 71 | 0.784661 |
eb067a43f46a029b5e9cdb43560f2bcbc0e11261 | 171 | py | Python | Python/Sets/no_idea.py | rho2/HackerRank | 4d9cdfcabeb20212db308d8e4f2ac1b8ebf7d266 | [
"MIT"
] | null | null | null | Python/Sets/no_idea.py | rho2/HackerRank | 4d9cdfcabeb20212db308d8e4f2ac1b8ebf7d266 | [
"MIT"
] | null | null | null | Python/Sets/no_idea.py | rho2/HackerRank | 4d9cdfcabeb20212db308d8e4f2ac1b8ebf7d266 | [
"MIT"
] | null | null | null | n, m = input().split()
i = input().split()
a = set(input().strip().split())
b = set(input().strip().split())
print(sum([1 if x in a else -1 if x in b else 0 for x in i])) | 28.5 | 61 | 0.578947 |
deef2d7af38cd9e884627c124442fa736766c4ad | 115 | py | Python | Python/Courses/Python-Tutorials.Telusko/02.Miscellaneous/20.01-File-handling-Writing.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Courses/Python-Tutorials.Telusko/02.Miscellaneous/20.01-File-handling-Writing.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Courses/Python-Tutorials.Telusko/02.Miscellaneous/20.01-File-handling-Writing.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | file = open("text.txt", "r")
file2 = open("text2.txt", "w")
file2.write("Hello file")
file.close()
file2.close()
| 14.375 | 30 | 0.626087 |
9d158d7bd6a672e720e9c119d9631a887c224f21 | 855 | py | Python | data/airlinesdb.py | Janrupf/airport-db-seeding | 768a9373f02ede5bf613d09270d2fbe84de37a97 | [
"MIT"
] | null | null | null | data/airlinesdb.py | Janrupf/airport-db-seeding | 768a9373f02ede5bf613d09270d2fbe84de37a97 | [
"MIT"
] | null | null | null | data/airlinesdb.py | Janrupf/airport-db-seeding | 768a9373f02ede5bf613d09270d2fbe84de37a97 | [
"MIT"
] | null | null | null | import csv
from types import SimpleNamespace
class AirlinesDB:
def __init__(self, cache):
airlines_csv = cache.resolve_entry("airlines.csv", AirlinesDB.download_airlines)
with open(airlines_csv) as f:
reader = csv.reader(f, quotechar='"')
self.airlines = [SimpleNamespace(n... | 32.884615 | 125 | 0.660819 |
9d53b1ff579c4a05efb026d11534b63dc66387aa | 203 | py | Python | main.py | SLAPaper/hihoCoder | 3f64d678c5dd46db36345736eb56880fb2d2c5fe | [
"MIT"
] | null | null | null | main.py | SLAPaper/hihoCoder | 3f64d678c5dd46db36345736eb56880fb2d2c5fe | [
"MIT"
] | null | null | null | main.py | SLAPaper/hihoCoder | 3f64d678c5dd46db36345736eb56880fb2d2c5fe | [
"MIT"
] | null | null | null | from __future__ import print_function, division, absolute_import, unicode_literals
while True:
try:
# get raw_input and do all the calculation
pass
except EOFError:
break | 25.375 | 82 | 0.699507 |
c2451e9702384350473bf0caba571f4af2b11892 | 592 | py | Python | Problems/SlidingWindow/MaxSumTwoNonOverlappingSubarrays/max_sum_two_non_overlapping_subarrays.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | Problems/SlidingWindow/MaxSumTwoNonOverlappingSubarrays/max_sum_two_non_overlapping_subarrays.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | Problems/SlidingWindow/MaxSumTwoNonOverlappingSubarrays/max_sum_two_non_overlapping_subarrays.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | from typing import List
def maxSumTwoNoOverlap(self, nums: List[int], firstLen: int, secondLen: int) -> int:
for i in range(1, len(nums)):
nums[i] += nums[i - 1]
res, fmax, smax = nums[firstLen + secondLen - 1], nums[firstLen - 1], nums[secondLen - 1]
for i in range(firstLen + secondLen, len(nums)... | 49.333333 | 97 | 0.613176 |
5f03da35b36fd7728f91991bd64290e13ceecfc1 | 18,666 | py | Python | code/tests/test_networking.py | simonmulser/master-thesis | 5ca2ddda377a0eede5a3c50866e0f90292c5448f | [
"CC-BY-4.0"
] | null | null | null | code/tests/test_networking.py | simonmulser/master-thesis | 5ca2ddda377a0eede5a3c50866e0f90292c5448f | [
"CC-BY-4.0"
] | null | null | null | code/tests/test_networking.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 networking import Networking
import networking
from bitcoin import net
from bitcoin import messages
from bitcoin.core import CBlockHeader
from bitcoin.core import CBlock
from bitcoin.net import CInv
from chain import Block
from chain import BlockOri... | 38.968685 | 115 | 0.688471 |
a06067e8483a27953c2823b30e158f48ade89349 | 2,089 | py | Python | packages/watchmen-rest/src/watchmen_rest/auth_helper.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-rest/src/watchmen_rest/auth_helper.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-rest/src/watchmen_rest/auth_helper.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from typing import List, Optional
from starlette.requests import Request
from watchmen_auth import AuthenticationManager, AuthFailOn401, AuthFailOn403, PrincipalService
from watchmen_model.admin import UserRole
from .authentication import get_admin_principal_by, get_any_admin_principal_by, get_any_principal_by, \
ge... | 32.138462 | 103 | 0.8382 |
26a45aa2a62f42248727ef8a913017d53af4b073 | 2,124 | py | Python | opencv_tutorial/opencv_python_tutorials/Image_Processing/image_pyramids.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | opencv_tutorial/opencv_python_tutorials/Image_Processing/image_pyramids.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | opencv_tutorial/opencv_python_tutorials/Image_Processing/image_pyramids.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Mon Apr 1 14:39:33 2019
@author: jone
"""
#%% Gaussian Pyramids
import cv2
img = cv2.imread('img/monkey.tiff')
lower_reso = cv2.pyrDown(img) # 원본 이미지의 1/4 사이즈
higher_reso = cv2.pyrUp(img) # 원본 이미지의 4배 사이즈
cv2.imshow('img', img)
cv2.imshow('lower', lower_reso)
cv2.imshow... | 19.135135 | 69 | 0.620527 |
f82597a798062ed58ecf3fd9a0ebfe1c3dc78a36 | 218 | py | Python | snake/object.py | dotKuro/vorsemesterWISE19-20 | 436c6d1846b6c1bfb087652e8ca179bd1b12c28e | [
"CC0-1.0"
] | 1 | 2019-09-27T13:47:20.000Z | 2019-09-27T13:47:20.000Z | snake/object.py | dotKuro/vorsemesterWISE19-20 | 436c6d1846b6c1bfb087652e8ca179bd1b12c28e | [
"CC0-1.0"
] | null | null | null | snake/object.py | dotKuro/vorsemesterWISE19-20 | 436c6d1846b6c1bfb087652e8ca179bd1b12c28e | [
"CC0-1.0"
] | null | null | null | from collections import namedtuple
from enum import Enum, auto
Object = namedtuple('Object', 'x y')
class ObjectName(Enum):
HEAD = auto()
TAIL = auto()
APPLE = auto()
WALL = auto()
FREE = auto()
| 16.769231 | 36 | 0.62844 |
3e00cfe7797adc3a1ce4485a18656e31de4f3988 | 2,032 | py | Python | research/cv/vnet/src/split.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/vnet/src/split.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/vnet/src/split.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... | 40.64 | 117 | 0.6875 |
5fbdb8b45f3c20930e64ce687ac65926f9b2ebf8 | 541,759 | py | Python | rnpflow_test/baxter_oldold.py | YoshimitsuMatsutaIe/hoge_flow_test | 22e2e2ce043a3107bd06449f6f9958641293e414 | [
"MIT"
] | null | null | null | rnpflow_test/baxter_oldold.py | YoshimitsuMatsutaIe/hoge_flow_test | 22e2e2ce043a3107bd06449f6f9958641293e414 | [
"MIT"
] | null | null | null | rnpflow_test/baxter_oldold.py | YoshimitsuMatsutaIe/hoge_flow_test | 22e2e2ce043a3107bd06449f6f9958641293e414 | [
"MIT"
] | null | null | null | """力技"""
import numpy as np
from math import pi, sqrt
from math import cos as c
from math import sin as s
class BaxterFuncs:
"""すごく遅い"""
L = 278e-3
h = 64e-3
H = 1104e-3
L0 = 270.35e-3
L1 = 69e-3
L2 = 364.35e-3
L3 = 69e-3
L4 = 374.29e-3
L5 = 10e-3
L6 = 368.3e-3
... | 1,543.472934 | 54,241 | 0.378111 |
f253ca6c2260b0069ee21eb9dc9c2b72aac771a1 | 4,388 | py | Python | python/python_backup/PRAC_PYTHON/21_chatbox.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/python_backup/PRAC_PYTHON/21_chatbox.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/python_backup/PRAC_PYTHON/21_chatbox.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | """Creating an AI named Chatbox """
"""The list of functions or operations it can perform ..."""
import os
def clear():
os.system('cls') # on windows
def print1():
for i1 in range(60):
print("--",end ='')
i1=i1+1
def range1(s1): #for making a range of numbers as per... | 27.425 | 118 | 0.545579 |
29e4c67cd7be21311a4c00f61eb0d079112fa735 | 252 | py | Python | Programming Languages/Python/Theory/100_Python_Exercises/Exercises/Exercise 14/14.py | jaswinder9051998/Resources | fd468af37bf24ca57555d153ee64693c018e822e | [
"MIT"
] | 101 | 2021-12-20T11:57:11.000Z | 2022-03-23T09:49:13.000Z | 50-Python-Exercises/Exercises/Exercise 14/14.py | kuwarkapur/Hacktoberfest-2022 | efaafeba5ce51d8d2e2d94c6326cc20bff946f17 | [
"MIT"
] | 4 | 2022-01-12T11:55:56.000Z | 2022-02-12T04:53:33.000Z | 50-Python-Exercises/Exercises/Exercise 14/14.py | kuwarkapur/Hacktoberfest-2022 | efaafeba5ce51d8d2e2d94c6326cc20bff946f17 | [
"MIT"
] | 38 | 2022-01-12T11:56:16.000Z | 2022-03-23T10:07:52.000Z | #Write a script that remove duplicates from a list
a = ["1", 1, "1", 2]
a = list(set(a))
print(a)
#If you want to keep the order, you need OrderedDict
from collections import OrderedDict
a = ["1", 1, "1", 2]
a = list(OrderedDict.fromkeys(a))
print(a)
| 22.909091 | 52 | 0.674603 |
d9be87183e329cd14214d30e40f21f5136356327 | 657 | py | Python | python/data_sci/1.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/data_sci/1.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/data_sci/1.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | import asyncio
import aiohttp
def fetch_page(url, idx):
url = 'https://yahoo.com'
response = yield from aiohttp.request('GET', url)
if response.status == 200:
print("data fetched successfully for: %d" % idx)
else:
print("data fetch failed for: %d" % idx)
print(response.cont... | 24.333333 | 56 | 0.628615 |
d9c0bb7b9b7eb35625ded2d28253289f877923e3 | 880 | py | Python | Veranstaltungen/migrations/0009_auto_20170531_1640.py | wmles/scholarium.at | d2356b3e475df772382e035ddcb839fc7dae4305 | [
"MIT"
] | 1 | 2017-07-24T10:19:36.000Z | 2017-07-24T10:19:36.000Z | Veranstaltungen/migrations/0009_auto_20170531_1640.py | wmles/scholarium.at | d2356b3e475df772382e035ddcb839fc7dae4305 | [
"MIT"
] | 9 | 2017-07-26T14:16:08.000Z | 2022-03-11T23:14:40.000Z | Veranstaltungen/migrations/0009_auto_20170531_1640.py | wmles/scholarium.at | d2356b3e475df772382e035ddcb839fc7dae4305 | [
"MIT"
] | 1 | 2017-03-07T12:38:23.000Z | 2017-03-07T12:38:23.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.9.11 on 2017-05-31 14:40
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('Veranstaltungen', '0008_auto_20170511_1352'),
]
operations = [
migrations.R... | 25.882353 | 55 | 0.590909 |
8a7ca566b63ecd6d45cf94d2d2a058997d60d628 | 992 | py | Python | Course_1/Week_04/2_minimum_cut.py | KnightZhang625/Stanford_Algorithm | 7dacbbfa50e7b0e8380cf500df24af60cb9f42df | [
"Apache-2.0"
] | null | null | null | Course_1/Week_04/2_minimum_cut.py | KnightZhang625/Stanford_Algorithm | 7dacbbfa50e7b0e8380cf500df24af60cb9f42df | [
"Apache-2.0"
] | 1 | 2020-07-16T08:03:22.000Z | 2020-07-16T08:09:34.000Z | Course_1/Week_04/2_minimum_cut.py | KnightZhang625/Stanford_Algorithm | 7dacbbfa50e7b0e8380cf500df24af60cb9f42df | [
"Apache-2.0"
] | null | null | null | # coding:utf-8
import copy
import codecs
import random
def buildGraph(path):
vertics = []
edges = []
with codecs.open(path, 'r', 'utf-8') as file:
for line in file:
line = line.strip().split('\t')
node = int(line[0])
others = line[1: ]
vertics.append(node)
for o in others:
o = int(o)
if (... | 19.84 | 48 | 0.621976 |
6a9419c82a7686c4ad51b9d9124ffcc28e2fc794 | 4,930 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/memset_memstore_info.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/memset_memstore_info.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/memset_memstore_info.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2018, Simon Weald <ansible@simonweald.com>
# 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... | 28.011364 | 121 | 0.641176 |
0a83207cb5bbf465c0613e65ff722aed733e8367 | 422 | py | Python | tests/conftest.py | dmlap/transformers | 79588e6fdb5af8add092fc27dd695ea1ebc68b18 | [
"Apache-2.0"
] | 47 | 2021-04-16T22:29:25.000Z | 2022-02-11T08:19:13.000Z | tests/conftest.py | dmlap/transformers | 79588e6fdb5af8add092fc27dd695ea1ebc68b18 | [
"Apache-2.0"
] | 12 | 2021-04-28T19:45:02.000Z | 2021-08-31T13:56:02.000Z | tests/conftest.py | dmlap/transformers | 79588e6fdb5af8add092fc27dd695ea1ebc68b18 | [
"Apache-2.0"
] | 5 | 2021-04-28T21:54:15.000Z | 2022-02-11T07:48:17.000Z | # tests directory-specific settings - this file is run automatically
# by pytest before any tests are run
import sys
from os.path import abspath, dirname, join
# allow having multiple repository checkouts and not needing to remember to rerun
# 'pip install -e .[dev]' when switching between checkouts and running test... | 35.166667 | 81 | 0.779621 |
0ac6b3fcaccdf7e7a378eaad915cc34e4d70a9f7 | 2,989 | py | Python | backend/api/views.py | giacomooo/CASFEE_Project2 | 420ff488d6b9deefe6623a45ecfed299f97a4639 | [
"MIT"
] | null | null | null | backend/api/views.py | giacomooo/CASFEE_Project2 | 420ff488d6b9deefe6623a45ecfed299f97a4639 | [
"MIT"
] | null | null | null | backend/api/views.py | giacomooo/CASFEE_Project2 | 420ff488d6b9deefe6623a45ecfed299f97a4639 | [
"MIT"
] | null | null | null | from datetime import datetime
from django_filters import rest_framework
from rest_framework import permissions, viewsets, filters, status
from rest_framework import decorators
from rest_framework.decorators import action
from rest_framework.response import Response
from api.permissions import KeycloakRolePermissions
... | 40.945205 | 104 | 0.726999 |
862a7b48d70dd706b4f165a7a6d3d95b1e0a0102 | 9,144 | py | Python | src/pss_receive/pss-send/send.py | ska-telescope/sdp-prototype | 8c6cbda04a83b0e16987019406ed6ec7e1058a31 | [
"BSD-3-Clause"
] | 2 | 2019-07-15T09:49:34.000Z | 2019-10-14T16:04:17.000Z | src/pss_receive/pss-send/send.py | ska-telescope/sdp-prototype | 8c6cbda04a83b0e16987019406ed6ec7e1058a31 | [
"BSD-3-Clause"
] | 17 | 2019-07-15T14:51:50.000Z | 2021-06-02T00:29:43.000Z | src/pss_receive/pss-send/send.py | ska-telescope/sdp-configuration-prototype | 8c6cbda04a83b0e16987019406ed6ec7e1058a31 | [
"BSD-3-Clause"
] | 1 | 2019-10-10T08:16:48.000Z | 2019-10-10T08:16:48.000Z | #!/usr/bin/env python3
import logging
import argparse
import random
import string
import os
import numpy as np
import spead2
import spead2.send
# pylint: disable=C0116,W1202
# A module to send a file over UDP using the spead2 data exchange protocol
#
# Author: Benjamin Shaw
# Email : benjamin.shaw@manchester.ac.uk
... | 35.169231 | 100 | 0.564523 |
86de424ab70278b73df2f4e2e52c805a9b3a34dd | 982 | py | Python | files/migrations/0001_initial.py | m-atisa/Standard-Answer-App | 28ad940925f794b1ca0cfd66f850f780aa43b4f8 | [
"Apache-2.0"
] | null | null | null | files/migrations/0001_initial.py | m-atisa/Standard-Answer-App | 28ad940925f794b1ca0cfd66f850f780aa43b4f8 | [
"Apache-2.0"
] | null | null | null | files/migrations/0001_initial.py | m-atisa/Standard-Answer-App | 28ad940925f794b1ca0cfd66f850f780aa43b4f8 | [
"Apache-2.0"
] | null | null | null | # Generated by Django 3.1.2 on 2020-11-02 03:09
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import files.models
import files.validators
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependen... | 33.862069 | 157 | 0.675153 |
813e151c7698d34120d68e6fdf39979264e13f97 | 94 | py | Python | python/python_backup/PRAC_PYTHON/rrt.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/python_backup/PRAC_PYTHON/rrt.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/python_backup/PRAC_PYTHON/rrt.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | n=input ("term")
j=5;
for i in range(1,n,1):
j=(j*10)+5
print j
| 13.428571 | 23 | 0.393617 |
be249c1d9950643a35063f024a63d70bd019c4af | 12,491 | py | Python | bets/views.py | Thames1990/BadBatBets | 8dffb69561668b8991bf4103919e4b254d4ca56a | [
"MIT"
] | null | null | null | bets/views.py | Thames1990/BadBatBets | 8dffb69561668b8991bf4103919e4b254d4ca56a | [
"MIT"
] | null | null | null | bets/views.py | Thames1990/BadBatBets | 8dffb69561668b8991bf4103919e4b254d4ca56a | [
"MIT"
] | null | null | null | import logging
from datetime import datetime
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.core.exceptions import PermissionDenied, ValidationError
from django.urls import reverse, reverse_lazy
from django.forms import SelectDateWidget
from django.forms.model... | 44.294326 | 116 | 0.604115 |
07f1f61e6817d0ce484063e4ca79bb8b53b2761b | 949 | py | Python | python/p007.py | tlming16/Projec_Euler | 797824c5159fae67493de9eba24c22cc7512d95d | [
"MIT"
] | 4 | 2018-11-14T12:03:05.000Z | 2019-09-03T14:33:28.000Z | python/p007.py | tlming16/Projec_Euler | 797824c5159fae67493de9eba24c22cc7512d95d | [
"MIT"
] | null | null | null | python/p007.py | tlming16/Projec_Euler | 797824c5159fae67493de9eba24c22cc7512d95d | [
"MIT"
] | 1 | 2018-11-17T14:39:22.000Z | 2018-11-17T14:39:22.000Z | #!/usr/bin/python3
# -*- coding:utf-8 -*-
# author :mathm
# emali :tlming16@fudan.edu.cn
class solution:
__slots__=('num')
def __init__(self,n:int):
self.num=n
def is_prime(self,n):
if n==2 or n==3 or n==5:
return True
if n<0 or n%2==0 or n%3==0 or n%5==0:
... | 18.98 | 45 | 0.437302 |
92c18d1654ad7d0174ffb0529a31daed459ee8ba | 2,412 | py | Python | task/common.py | CcTtry/PipeSwitch | c6d632ee20b6dbbaea9a6fb95b9ea0ed4bbbf67e | [
"Apache-2.0"
] | null | null | null | task/common.py | CcTtry/PipeSwitch | c6d632ee20b6dbbaea9a6fb95b9ea0ed4bbbf67e | [
"Apache-2.0"
] | null | null | null | task/common.py | CcTtry/PipeSwitch | c6d632ee20b6dbbaea9a6fb95b9ea0ed4bbbf67e | [
"Apache-2.0"
] | null | null | null | import torch
kMinBlockSize = 512
def set_fullname(mod, fullname):
mod.fullname = fullname
if len(list(mod.children())) == 0:
for index, p in enumerate(mod.parameters()):
p.reserved_name = '%s->p%d' % (fullname, index)
for child_name, child in mod.named_children():
chi... | 31.736842 | 72 | 0.573383 |
1303305da786e6e090e147c4b4b889feddeaac6d | 3,313 | py | Python | oneflow/python/eager/symbol.py | ncnnnnn/oneflow | f6e81f65eed1d87c3125e7a78247cfaa72220020 | [
"Apache-2.0"
] | 1 | 2020-12-24T09:26:36.000Z | 2020-12-24T09:26:36.000Z | oneflow/python/eager/symbol.py | duijiudanggecl/oneflow | d2096ae14cf847509394a3b717021e2bd1d72f62 | [
"Apache-2.0"
] | null | null | null | oneflow/python/eager/symbol.py | duijiudanggecl/oneflow | d2096ae14cf847509394a3b717021e2bd1d72f62 | [
"Apache-2.0"
] | null | null | null | """
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... | 30.962617 | 88 | 0.709931 |
130f60ab4e080c29001e1a124fcc0bafef01f3b7 | 210 | py | Python | Curso-Em-Video-Python/2Exercicios/048_soma_impares_multiplos_de_3.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso-Em-Video-Python/2Exercicios/048_soma_impares_multiplos_de_3.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso-Em-Video-Python/2Exercicios/048_soma_impares_multiplos_de_3.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | cont = 0
soma = 0
for c in range(1, 501, 2):
verificar = c % 3
if verificar == 0:
cont += 1
soma += c
print('O total de numeros impares é {} e a soma entre eles é {}'.format(cont, soma)) | 26.25 | 84 | 0.557143 |
139aa04221c87d69d2ed9b94f4c87041afd96d5b | 1,601 | py | Python | test/test_npu/test_network_ops/test_scatterv1.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_scatterv1.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_scatterv1.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... | 40.025 | 75 | 0.707683 |
1689065aaef575f6b62b19a774e263d5caedc1d6 | 4,664 | py | Python | python_experiments/run_vldbj_experiments/run_varying_eps_for_gt_exp.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | 8 | 2020-04-14T23:17:00.000Z | 2021-06-21T12:34:04.000Z | python_experiments/run_vldbj_experiments/run_varying_eps_for_gt_exp.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | null | null | null | python_experiments/run_vldbj_experiments/run_varying_eps_for_gt_exp.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | 1 | 2021-01-17T16:26:50.000Z | 2021-01-17T16:26:50.000Z | from exec_utilities import time_out_util
from exec_utilities.exec_utils import *
def run_varying_eps_exp():
exec_path_lst = [
# '/homes/ywangby/workspace/yche/git-repos/SimRank/LPMC-Profile/build/bprw-rand-varying-gt',
# '/homes/ywangby/workspace/yche/git-repos/SimRank/LPMC-Profile/build/flpmc-ran... | 49.094737 | 120 | 0.582333 |
16c7804ccb1fd0895dad9ebca91f15a099d72852 | 2,552 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/network/check_point/test_checkpoint_session.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/network/check_point/test_checkpoint_session.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/network/check_point/test_checkpoint_session.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | # Copyright (c) 2018 Red Hat
#
# This file is part of Ansible
#
# Ansible 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.
#
# Ansible i... | 37.529412 | 151 | 0.748433 |
16d4e5904bbf94eff0a18dd3792e7278c21998cb | 154 | py | Python | language/python/bokeh/pickle.py | mkmayank/quest | dbdde9e62c0b2c2b0cd5d16304793291d8400248 | [
"Apache-2.0"
] | null | null | null | language/python/bokeh/pickle.py | mkmayank/quest | dbdde9e62c0b2c2b0cd5d16304793291d8400248 | [
"Apache-2.0"
] | null | null | null | language/python/bokeh/pickle.py | mkmayank/quest | dbdde9e62c0b2c2b0cd5d16304793291d8400248 | [
"Apache-2.0"
] | null | null | null | import pickle
f = open(filename, 'w')
pickle.dump(object, f)
f = open(filename, 'r')
object = pickle.load(f)
b._base_px_column
Out[51]: u'base_px'
| 10.266667 | 23 | 0.668831 |
bc65a75fb666a9ae48944aba80b2efc744c10461 | 405 | py | Python | INBa/2015/Serdechnaya_A_M/task_1_25.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | INBa/2015/Serdechnaya_A_M/task_1_25.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | INBa/2015/Serdechnaya_A_M/task_1_25.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | # Задача 1. Вариант 25.
# Напишите программу, которая будет сообщать род деятельности и псевдоним под которым скрывается София Шиколоне.
# После вывода информации программа должна дожидаться пока пользователь нажмет Enter для выхода.
print("Софи Лорен - итальянская певица и актриса. Полное имя - София Виллани Шиколоне... | 57.857143 | 113 | 0.797531 |
912d7e82c26fbbab1cfddba627de2f0a570a112d | 3,828 | py | Python | site/public/courses/DS-1.1/CA_lessons/OITA-structures.py | KitsuneNoctus/makeschool | 5eec1a18146abf70bb78b4ee3d301f6a43c9ede4 | [
"MIT"
] | 1 | 2021-08-24T20:22:19.000Z | 2021-08-24T20:22:19.000Z | site/public/courses/DS-1.1/CA_lessons/OITA-structures.py | KitsuneNoctus/makeschool | 5eec1a18146abf70bb78b4ee3d301f6a43c9ede4 | [
"MIT"
] | null | null | null | site/public/courses/DS-1.1/CA_lessons/OITA-structures.py | KitsuneNoctus/makeschool | 5eec1a18146abf70bb78b4ee3d301f6a43c9ede4 | [
"MIT"
] | null | null | null | # !python3
################################################################################
####################### IMPORTATIONS AND INITIALIZATIONS #######################
################################################################################
# Data Analysis/Visualization Toolkit.
import numpy as ... | 45.035294 | 117 | 0.564786 |
e66ce461a0ade43fde198f9c6905d5b94e7c3828 | 30,836 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/network/netscaler/test_netscaler_cs_vserver.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/network/netscaler/test_netscaler_cs_vserver.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/network/netscaler/test_netscaler_cs_vserver.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null |
# Copyright (c) 2017 Citrix Systems
#
# This file is part of Ansible
#
# Ansible 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.
#
# ... | 40.255875 | 150 | 0.650344 |
fc0f2eab3621de948d0dc83d066e9d479961e3b5 | 191 | py | Python | 1688-count-of-matches-in-tournament/1688-count-of-matches-in-tournament.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | 2 | 2021-12-05T14:29:06.000Z | 2022-01-01T05:46:13.000Z | 1688-count-of-matches-in-tournament/1688-count-of-matches-in-tournament.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | 1688-count-of-matches-in-tournament/1688-count-of-matches-in-tournament.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | class Solution:
def numberOfMatches(self, n: int) -> int:
result=0
while(n>1):
k=int(n/2)
result+=k
n-=k
return result
| 21.222222 | 45 | 0.434555 |
5defd877a8325a79564bd22fe611dda83ce45f6d | 916 | py | Python | pacman-termux/test/pacman/tests/query006.py | Maxython/pacman-for-termux | 3b208eb9274cbfc7a27fca673ea8a58f09ebad47 | [
"MIT"
] | 23 | 2021-05-21T19:11:06.000Z | 2022-03-31T18:14:20.000Z | source/pacman-6.0.1/test/pacman/tests/query006.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 11 | 2021-05-21T12:08:44.000Z | 2021-12-21T08:30:08.000Z | source/pacman-6.0.1/test/pacman/tests/query006.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-09-26T08:44:40.000Z | 2021-09-26T08:44:40.000Z | self.description = "Query info on a package (overflow long values)"
p = pmpkg("overflow")
p.desc = "Overflow size and date values if possible"
p.url = "http://www.archlinux.org"
p.license = "GPL2"
p.arch = "i686"
p.packager = "Arch Linux"
# size is greater than 4294967295, aka UINT_MAX
p.size = "10000000000"
# build d... | 29.548387 | 67 | 0.727074 |
5d0f9d7bfeec277b1a8d73e7b936be5a9a272591 | 2,434 | py | Python | Packs/Xsoar_Utils/Integrations/XsoarUtils/XsoarUtils.py | PAM360/content | 928aac9c586c6e593b2a452c402a37cb5df28dac | [
"MIT"
] | 2 | 2021-12-06T21:38:24.000Z | 2022-01-13T08:23:36.000Z | Packs/Xsoar_Utils/Integrations/XsoarUtils/XsoarUtils.py | PAM360/content | 928aac9c586c6e593b2a452c402a37cb5df28dac | [
"MIT"
] | 87 | 2022-02-23T12:10:53.000Z | 2022-03-31T11:29:05.000Z | Packs/Xsoar_Utils/Integrations/XsoarUtils/XsoarUtils.py | PAM360/content | 928aac9c586c6e593b2a452c402a37cb5df28dac | [
"MIT"
] | 2 | 2022-01-05T15:27:01.000Z | 2022-02-01T19:27:43.000Z | import json
import demistomock as demisto # noqa: F401
import requests
from CommonServerPython import * # noqa: F401
from typing import Callable
# change the below to your default playground id while testing from your local machine
default_playground_id = "122c7bff-feae-4177-867e-37e2096cd7d9"
class Main_Object()... | 33.342466 | 88 | 0.663106 |
54e53ae66aff5064fc373d321f0a7fb46e4260ea | 798 | py | Python | test/test_indexer.py | krveronika/job-finder | fcb9f5124d809145c0e6749b077abf0c69128c63 | [
"MIT"
] | 2 | 2021-01-31T11:31:27.000Z | 2021-02-02T06:18:48.000Z | test/test_indexer.py | krveronika/job-finder | fcb9f5124d809145c0e6749b077abf0c69128c63 | [
"MIT"
] | 2 | 2021-02-01T17:32:26.000Z | 2021-02-02T07:23:39.000Z | test/test_indexer.py | krveronika/job-finder | fcb9f5124d809145c0e6749b077abf0c69128c63 | [
"MIT"
] | 4 | 2021-01-30T10:52:23.000Z | 2021-02-05T20:00:17.000Z | from models.Indexer import BaselineIndexer, FaissIndexer
from models.Embedder import RandomEmbedder
import numpy as np
import unittest
class testIndexer(unittest.TestCase):
def setUp(self):
self.embedder = RandomEmbedder()
def test_indexer(self):
for metric in ['cosine', 'l2']:
sel... | 42 | 81 | 0.649123 |
db61784a103eae1d447c5b341277f5d6fcb59c64 | 6,357 | py | Python | solutions/recommender_system/infer_milvus.py | naetimus/bootcamp | 0182992df7c54012944b51fe9b70532ab6a0059b | [
"Apache-2.0"
] | 1 | 2021-01-11T18:40:22.000Z | 2021-01-11T18:40:22.000Z | solutions/recommender_system/infer_milvus.py | naetimus/bootcamp | 0182992df7c54012944b51fe9b70532ab6a0059b | [
"Apache-2.0"
] | null | null | null | solutions/recommender_system/infer_milvus.py | naetimus/bootcamp | 0182992df7c54012944b51fe9b70532ab6a0059b | [
"Apache-2.0"
] | null | null | null | from __future__ import print_function
import math
import sys
import argparse
import numpy as np
import paddle
import paddle.fluid as fluid
import paddle.fluid.layers as layers
import paddle.fluid.nets as nets
from milvus import Milvus, IndexType, MetricType
from functools import reduce
import time
import getopt
PASS_N... | 32.6 | 119 | 0.616328 |
5306854f067de1908216115ad795b9e6ed66d5a9 | 2,639 | py | Python | django-rest-framework/tutorial_3/snippets/migrations/0001_initial.py | pisitj/practice-python-web-framework | 5f7f60737b1cf9618e73ad8047b6c4f556d1feb0 | [
"MIT"
] | null | null | null | django-rest-framework/tutorial_3/snippets/migrations/0001_initial.py | pisitj/practice-python-web-framework | 5f7f60737b1cf9618e73ad8047b6c4f556d1feb0 | [
"MIT"
] | null | null | null | django-rest-framework/tutorial_3/snippets/migrations/0001_initial.py | pisitj/practice-python-web-framework | 5f7f60737b1cf9618e73ad8047b6c4f556d1feb0 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.7 on 2021-03-31 17:23
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
ope... | 75.4 | 990 | 0.511178 |
534166b92b555e96b543d762bd71c042f54ecc8d | 238 | py | Python | demos/System_Dynamics/Compartment_Models/sir/model/sys_params.py | w-ghub/demos | 6382676fae89bd5a190626612712fcedf17bca6d | [
"MIT"
] | 56 | 2020-07-08T23:23:15.000Z | 2022-03-11T20:43:09.000Z | demos/System_Dynamics/Compartment_Models/sir/model/sys_params.py | w-ghub/demos | 6382676fae89bd5a190626612712fcedf17bca6d | [
"MIT"
] | 41 | 2020-07-11T23:24:06.000Z | 2022-01-28T13:28:07.000Z | demos/System_Dynamics/Compartment_Models/sir/model/sys_params.py | w-ghub/demos | 6382676fae89bd5a190626612712fcedf17bca6d | [
"MIT"
] | 39 | 2020-07-15T11:35:04.000Z | 2022-02-01T16:02:51.000Z | sys_params = {
# 𝛽: expected amount of people an infected person infects per day
'infection_rate': [0.4],
# 𝛾: the proportion of infected recovering per day ( 𝛾 = 1/D)
'recovering_rate': [1/14]
}
| 34 | 74 | 0.584034 |
72b8474dd4f503ae2f381eaa3e89953ddc59139d | 4,716 | py | Python | src/gvz/models.py | Integreat/gemeindeverzeichnis-django | 0089b97ea02b4741263c37357260c497b66a306d | [
"Apache-2.0"
] | 7 | 2021-04-24T19:11:15.000Z | 2021-10-30T12:59:16.000Z | src/gvz/models.py | Integreat/gemeindeverzeichnis-django | 0089b97ea02b4741263c37357260c497b66a306d | [
"Apache-2.0"
] | 10 | 2021-04-25T10:25:12.000Z | 2021-04-26T17:55:20.000Z | src/gvz/models.py | Integreat/gemeindeverzeichnis-django | 0089b97ea02b4741263c37357260c497b66a306d | [
"Apache-2.0"
] | null | null | null | """
Model for municipalities and zip codes
"""
# pylint: disable=R0903
from django.db import models
from .constants import DIVISION_CATEGORIES, ADMINISTRATIVE_TYPES
class AdministrativeDivision(models.Model):
"""
GVZ line (administrative division)
"""
ags = models.CharField(unique=True, max_length=9... | 35.19403 | 84 | 0.618533 |
72e06a62afdbec0c0c0a4242b6e04ca6a04e066e | 981 | py | Python | v301/python/c.py | chrbeckm/anfaenger-praktikum | 51764ff23901de1bc3d16dc935acfdc66bb2b2b7 | [
"MIT"
] | 2 | 2019-12-10T10:25:11.000Z | 2021-01-26T13:59:40.000Z | v301/python/c.py | chrbeckm/anfaenger-praktikum | 51764ff23901de1bc3d16dc935acfdc66bb2b2b7 | [
"MIT"
] | null | null | null | v301/python/c.py | chrbeckm/anfaenger-praktikum | 51764ff23901de1bc3d16dc935acfdc66bb2b2b7 | [
"MIT"
] | 1 | 2020-12-06T21:24:58.000Z | 2020-12-06T21:24:58.000Z | import numpy as np
import matplotlib.pyplot as plt
print('Leistung ANFANG')
n, U, sU, I, sI = np.genfromtxt('python/daten/werte_c.txt', unpack=True)
i = I / 1000 # Skalierungsfaktor betrachten
u = U * 0.1
r = u / i
p = u * i
u0 = 1.4608
u01 = 1.5
ri = 5.64
ri1 = 6.2
def uk(i, u, r):
return(u + i * r)
m = np.... | 26.513514 | 91 | 0.61366 |
be898a77317988389de41edfeae159070688a93b | 4,428 | py | Python | shinrl/_calc/backup_rl.py | omron-sinicx/ShinRL | 09f4ae274a33d1fc1d9d542f816aef40014af6b5 | [
"MIT"
] | 34 | 2021-12-09T07:12:57.000Z | 2022-03-11T08:17:20.000Z | shinrl/_calc/backup_rl.py | omron-sinicx/ShinRL | 09f4ae274a33d1fc1d9d542f816aef40014af6b5 | [
"MIT"
] | null | null | null | shinrl/_calc/backup_rl.py | omron-sinicx/ShinRL | 09f4ae274a33d1fc1d9d542f816aef40014af6b5 | [
"MIT"
] | 4 | 2021-12-11T07:48:01.000Z | 2022-03-01T23:50:33.000Z | """
Bellman-backup functions for reinforcement learning.
Use collected samples to approximate the expectation.
Author: Toshinori Kitamura
Affiliation: NAIST & OSX
"""
from typing import Optional
import chex
import jax
import jax.numpy as jnp
from chex import Array
@jax.jit
def optimal_backup_rl(next_q: Array, rew: ... | 29.131579 | 101 | 0.604336 |
fe76af9d2f8253b6b21fe0f5b69ecb7e58de54ca | 159 | py | Python | pandemie/tester/__init__.py | marvinsxtr/informaticup-2020-pandemie | 0d37d5236eadfe7bb3cbd7cbfd0e1b7afca74c89 | [
"MIT"
] | null | null | null | pandemie/tester/__init__.py | marvinsxtr/informaticup-2020-pandemie | 0d37d5236eadfe7bb3cbd7cbfd0e1b7afca74c89 | [
"MIT"
] | null | null | null | pandemie/tester/__init__.py | marvinsxtr/informaticup-2020-pandemie | 0d37d5236eadfe7bb3cbd7cbfd0e1b7afca74c89 | [
"MIT"
] | 1 | 2020-03-28T00:02:41.000Z | 2020-03-28T00:02:41.000Z | from pandemie.tester.strategy import AbstractStrategy
from pandemie.tester.tester import Tester
from pandemie.tester.optimization import bayesian_optimization
| 39.75 | 62 | 0.886792 |
fe9befe26519673133840bfe6688fd9976537ab3 | 1,736 | py | Python | frappe-bench/apps/erpnext/erpnext/patches/v8_5/fix_tax_breakup_for_non_invoice_docs.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v8_5/fix_tax_breakup_for_non_invoice_docs.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v8_5/fix_tax_breakup_for_non_invoice_docs.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | import frappe
from erpnext.regional.india.setup import make_custom_fields
from erpnext.controllers.taxes_and_totals import get_itemised_tax_breakup_html
def execute():
companies = [d.name for d in frappe.get_all('Company', filters = {'country': 'India'})]
if not companies:
return
make_custom_fields()
# update ... | 36.93617 | 94 | 0.706797 |
22c48fc9aeeff4e7eb0d342304278811335d5022 | 441 | py | Python | tests/cli/test_dump.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | 1 | 2021-06-01T14:49:18.000Z | 2021-06-01T14:49:18.000Z | tests/cli/test_dump.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | 286 | 2020-12-04T14:13:00.000Z | 2022-03-09T19:05:16.000Z | tests/cli/test_dump.py | DanielGrams/gsevpt | a92f71694388e227e65ed1b24446246ee688d00e | [
"MIT"
] | null | null | null | def test_all(client, seeder, app, utils):
user_id, admin_unit_id = seeder.setup_base()
seeder.create_event(admin_unit_id, "RRULE:FREQ=DAILY;COUNT=7")
seeder.create_event_with_co_organizers(admin_unit_id)
runner = app.test_cli_runner()
result = runner.invoke(args=["dump", "all"])
assert "Zipped ... | 36.75 | 66 | 0.727891 |
4abd435ebce253c8eb53178f069851096fa39dec | 743 | py | Python | deutschland/smard/__init__.py | kiranmusze/deutschland | 86d8ead3f38ad88ad66bb338b9f5a8db06992344 | [
"Apache-2.0"
] | null | null | null | deutschland/smard/__init__.py | kiranmusze/deutschland | 86d8ead3f38ad88ad66bb338b9f5a8db06992344 | [
"Apache-2.0"
] | null | null | null | deutschland/smard/__init__.py | kiranmusze/deutschland | 86d8ead3f38ad88ad66bb338b9f5a8db06992344 | [
"Apache-2.0"
] | null | null | null | # flake8: noqa
"""
Bundesnetzagentur Strommarktdaten
Bundesnetzagentur Strommarktdaten # noqa: E501
The version of the OpenAPI document: 0.0.1
Generated by: https://openapi-generator.tech
"""
__version__ = "1.0.0"
# import ApiClient
from deutschland.smard.api_client import ApiClient
# import Con... | 26.535714 | 58 | 0.81965 |
4374664ffdb33cd15c37bc432c35e6ea7ff1a9af | 1,370 | py | Python | misc/notebooks/db.py | dbvis-ukon/coronavis | f00374ac655c9d68541183d28ede6fe5536581dc | [
"Apache-2.0"
] | 15 | 2020-04-24T20:18:11.000Z | 2022-01-31T21:05:05.000Z | misc/notebooks/db.py | dbvis-ukon/coronavis | f00374ac655c9d68541183d28ede6fe5536581dc | [
"Apache-2.0"
] | 2 | 2021-05-19T07:15:09.000Z | 2022-03-07T08:29:34.000Z | misc/notebooks/db.py | dbvis-ukon/coronavis | f00374ac655c9d68541183d28ede6fe5536581dc | [
"Apache-2.0"
] | 4 | 2020-04-27T16:20:13.000Z | 2021-02-23T10:39:42.000Z | import psycopg2 as pg
import psycopg2.extensions
import psycopg2.extras
import logging
import os
from urllib.parse import quote
logger = logging.getLogger(__name__)
logging.basicConfig(level=logging.DEBUG)
DATABASE_FILE = 'corona_app'
SQLALCHEMY_DATABASE_URI = 'postgresql://' # Fallback to Zero
# create postgresql... | 33.414634 | 179 | 0.69562 |
43a8f20220d2dbe6a1e37a082b29bb372daa7237 | 1,400 | py | Python | PYTHON/Built_Ins/input.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | PYTHON/Built_Ins/input.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | PYTHON/Built_Ins/input.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
if __name__ == '__main__':
val = list(map(int, input().split()))
x, k = val[0], val[1]
P = input().split()
res = 0
flag = '+'
for i, p in enumerate(P):
if i % 2 == 1:
flag = p
else:
if p.find('**') != -1:
e = p.split... | 28.571429 | 41 | 0.270714 |
78dc631a0c8e2d4be6a0fcc2c1b6c90da4966ea4 | 5,376 | py | Python | app/datasources/stac/item.py | geospatial-jeff/cognition-datasources-api | 9c2f0332f231638e5fb615d2293c32a3ad96654d | [
"Apache-2.0"
] | 18 | 2019-03-27T20:09:37.000Z | 2022-02-04T17:38:07.000Z | app/datasources/stac/item.py | geospatial-jeff/cognition-datasources-api | 9c2f0332f231638e5fb615d2293c32a3ad96654d | [
"Apache-2.0"
] | 3 | 2019-06-05T15:12:17.000Z | 2020-04-30T17:54:37.000Z | app/datasources/stac/item.py | geospatial-jeff/cognition-datasources-api | 9c2f0332f231638e5fb615d2293c32a3ad96654d | [
"Apache-2.0"
] | 3 | 2019-06-29T01:16:37.000Z | 2020-04-30T17:25:26.000Z | from schema import Schema, And
import re
import json
eo_extension = {
'gsd': {'type': float},
'platform': {'type': str},
'constellation': {'type': str},
'instrument': {'type': str},
'bands': {'type': list},
'epsg': {'type': int},
'cloud_cover': {'type': float},
'off_nadir': {'type': flo... | 32 | 162 | 0.486235 |
60a45a4da8adf455fd36feaa22400e212dc6c61e | 6,087 | py | Python | src/lcdoc/mkdocs/stats/__init__.py | axiros/docutools | f99874a64afba8f5bc740049d843151ccd9ceaf7 | [
"BSD-2-Clause"
] | 24 | 2021-10-04T22:11:59.000Z | 2022-02-02T21:51:43.000Z | src/lcdoc/mkdocs/stats/__init__.py | axiros/docutools | f99874a64afba8f5bc740049d843151ccd9ceaf7 | [
"BSD-2-Clause"
] | 2 | 2021-10-04T21:51:30.000Z | 2021-10-05T14:15:31.000Z | src/lcdoc/mkdocs/stats/__init__.py | axiros/docutools | f99874a64afba8f5bc740049d843151ccd9ceaf7 | [
"BSD-2-Clause"
] | null | null | null | """
## Stats
Prints collected stats on stdout after build.
Intended for piping into / consolidation with [jq](https://stedolan.github.io/jq/download/).
### Config
config_scheme = (('round_digits', config_options.Type(int, default=4)),)
"""
from lcdoc import log
import json
import os
import sys
from mkdocs.con... | 33.081522 | 95 | 0.56941 |
7187d08b632a37c931f5062a2e0ae06cf6d1d9a0 | 1,912 | py | Python | main.py | jonashellmann/informaticup21-team-chillow | f2e519af0a5d9a9368d62556703cfb1066ebb58f | [
"MIT"
] | 3 | 2021-01-17T23:32:07.000Z | 2022-01-30T14:49:16.000Z | main.py | jonashellmann/informaticup21-team-chillow | f2e519af0a5d9a9368d62556703cfb1066ebb58f | [
"MIT"
] | 2 | 2021-01-17T13:37:56.000Z | 2021-04-14T12:28:49.000Z | main.py | jonashellmann/informaticup21-team-chillow | f2e519af0a5d9a9368d62556703cfb1066ebb58f | [
"MIT"
] | 2 | 2021-04-02T14:53:38.000Z | 2021-04-20T11:10:17.000Z | import os
import logging
import argparse
from chillow.service import ai
from chillow.controller import OnlineController, OfflineController, AIEvaluationController
from chillow.service.data_loader import JSONDataLoader
from chillow.service.data_writer import JSONDataWriter
if __name__ == "__main__":
logging.basicC... | 39.020408 | 116 | 0.691946 |
e0a273c7a971e07e605ee77f5c866812356ed008 | 10,161 | py | Python | python/oneflow/compatible/single_client/summary/summary_hparams.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 3,285 | 2020-07-31T05:51:22.000Z | 2022-03-31T15:20:16.000Z | python/oneflow/compatible/single_client/summary/summary_hparams.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 2,417 | 2020-07-31T06:28:58.000Z | 2022-03-31T23:04:14.000Z | python/oneflow/compatible/single_client/summary/summary_hparams.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 520 | 2020-07-31T05:52:42.000Z | 2022-03-29T02:38:11.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... | 29.885294 | 88 | 0.617853 |
e0e6989603558f563786fb01cf3386ad1576a719 | 4,717 | py | Python | transonic/backends/base_jit.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 88 | 2019-01-08T16:39:08.000Z | 2022-02-06T14:19:23.000Z | transonic/backends/base_jit.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 13 | 2019-06-20T15:53:10.000Z | 2021-02-09T11:03:29.000Z | transonic/backends/base_jit.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 1 | 2019-11-05T03:03:14.000Z | 2019-11-05T03:03:14.000Z | """SubBackend class for Transonic JIT compilation
=================================================
Internal API
------------
.. autoclass:: SubBackendJIT
:members:
:private-members:
"""
import re
from pathlib import Path
try:
import numpy as np
except ImportError:
np = None
from transonic.analyses ... | 34.940741 | 82 | 0.630909 |
460220023d22860d67ce9a55f6e25bea62988f4a | 1,546 | py | Python | LeetCode_problems/Wildcard_Matching/solution.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 165 | 2020-10-03T08:01:11.000Z | 2022-03-31T02:42:08.000Z | LeetCode_problems/Wildcard_Matching/solution.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 383 | 2020-10-03T07:39:11.000Z | 2021-11-20T07:06:35.000Z | LeetCode_problems/Wildcard_Matching/solution.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 380 | 2020-10-03T08:05:04.000Z | 2022-03-19T06:56:59.000Z | # Made use of dynamic programming to solve this problem.
# Defined a 2D matrix variable "matrix" where matrix[i][j] implies that the first i characters in string s match with the first j characters of string p.
# Init: matrix[0][0] = True if both s and p are null
# matrix[i][0] = False if pattern is null
# matrix[0][j... | 48.3125 | 154 | 0.562096 |
c77c032875610d77037d7f5e9f78910ba00e544e | 1,111 | py | Python | Data-Structures/Stacks/tests/test_stack.py | hussamEL-Hwary/DS-Algo-Handbook | 86a97d586a4ca8b17168c0a9f5a9f43f856eba58 | [
"MIT"
] | 18 | 2016-11-01T04:00:36.000Z | 2021-09-13T14:26:35.000Z | Data-Structures/Stacks/tests/test_stack.py | JEERU/DS-Algo-Handbook | 86a97d586a4ca8b17168c0a9f5a9f43f856eba58 | [
"MIT"
] | 60 | 2016-10-11T14:50:47.000Z | 2016-10-31T11:05:01.000Z | Data-Structures/Stacks/tests/test_stack.py | JEERU/DS-Algo-Handbook | 86a97d586a4ca8b17168c0a9f5a9f43f856eba58 | [
"MIT"
] | 87 | 2016-09-08T05:04:50.000Z | 2016-10-30T19:19:53.000Z | import unittest
from stack import Stack
class StackTest(unittest.TestCase):
def setUp(self):
self.simple_stack = Stack()
def test_stack_push(self):
self.assertEqual(self.simple_stack.isEmpty(), True)
self.simple_stack.push(20)
self.assertEqual(self.simple_stack.isEmpty(), False... | 33.666667 | 66 | 0.687669 |
c7b8b89f62d51d54b8ee3b99c43090f27c5af150 | 509 | py | Python | Chapter2_Python/07-Dictionaries.py | olebause/TensorFlow2 | 70fcb7c85c7ead0dc4f88ffa35be5f2eb93e618e | [
"MIT"
] | 2 | 2021-02-10T19:50:27.000Z | 2021-12-30T06:15:55.000Z | Chapter2_Basics/Dictionaries.py | franneck94/UdemyPythonIntro | 4895a91a04eedce7d59b61bf12e5aa209fe60f85 | [
"MIT"
] | 1 | 2020-12-21T15:29:20.000Z | 2022-01-15T12:06:09.000Z | Chapter2_Basics/Dictionaries.py | franneck94/UdemyPythonIntro | 4895a91a04eedce7d59b61bf12e5aa209fe60f85 | [
"MIT"
] | 4 | 2020-11-08T17:07:53.000Z | 2022-02-07T06:40:55.000Z | students = {"Ben": 1, "Jan": 2, "Peter": 1, "Melissa": 4}
print(students)
# Read element
student1 = students["Ben"]
print(student1)
# Write element
students["Ben"] = 6
print(students)
# Add element
students["Julia"] = 1
print(students)
# Remove element
students.pop("Julia")
print(students)
# Keys
for student_name ... | 16.419355 | 57 | 0.699411 |
4040b15dd0b865bbb8b03a129c14f19267301ce7 | 1,115 | py | Python | Fastir_Collector/registry/windows8Users.py | Unam3dd/Train-2018-2020 | afb6ae70fe338cbe55a21b74648d91996b818fa2 | [
"MIT"
] | 4 | 2021-04-23T15:39:17.000Z | 2021-12-27T22:53:24.000Z | Fastir_Collector/registry/windows8Users.py | Unam3dd/Train-2018-2020 | afb6ae70fe338cbe55a21b74648d91996b818fa2 | [
"MIT"
] | null | null | null | Fastir_Collector/registry/windows8Users.py | Unam3dd/Train-2018-2020 | afb6ae70fe338cbe55a21b74648d91996b818fa2 | [
"MIT"
] | 2 | 2021-04-19T08:28:54.000Z | 2022-01-19T13:23:29.000Z | from __future__ import unicode_literals
from registry.reg import _Reg
class Windows8UserReg(_Reg):
def __init__(self, params):
_Reg.__init__(self, params)
_Reg.init_win_vista_and_above(self)
def csv_open_save_mru(self):
super(Windows8UserReg, self)._csv_open_save_mru(
r"So... | 35.967742 | 91 | 0.73722 |
90df000fece2b0c475e4f861198ce96a2940cace | 876 | py | Python | Utils/py/RL_ActionSelection/env_0/reward.py | tarsoly/NaoTH | dcd2b67ef6bf9953c81d3e1b26e543b5922b7d52 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | Utils/py/RL_ActionSelection/env_0/reward.py | tarsoly/NaoTH | dcd2b67ef6bf9953c81d3e1b26e543b5922b7d52 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | Utils/py/RL_ActionSelection/env_0/reward.py | tarsoly/NaoTH | dcd2b67ef6bf9953c81d3e1b26e543b5922b7d52 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # script for reward functions
def simple_reward_and_termination(world, state):
"""
simple reward function which checks whether the ball is in one of the goal
- this returns a final reward and sets the termination state to True
- else the reward is -1 and termination state is False
:param s... | 27.375 | 78 | 0.544521 |
462ee80e2b055a001bf50b80896588c203518813 | 386 | py | Python | Source/06_UDP/client.py | rbiotblbk/WBS_T9_2022 | 533156db88ff2fe676564b0e5d6e84e888ab0916 | [
"MIT"
] | 1 | 2022-02-28T09:49:35.000Z | 2022-02-28T09:49:35.000Z | Source/06_UDP/client.py | rbiotblbk/WBS_T9_2022 | 533156db88ff2fe676564b0e5d6e84e888ab0916 | [
"MIT"
] | null | null | null | Source/06_UDP/client.py | rbiotblbk/WBS_T9_2022 | 533156db88ff2fe676564b0e5d6e84e888ab0916 | [
"MIT"
] | null | null | null | import socket
print("Client Side UDP")
print("~" * 30)
# Create Socket
# AF_INET: IPV4
# SOCK_DGRAM : UDP
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
ip = "localhost" # IP of the server Localhost IP 127.0.0.1
port = 10000
# Create the message
message = input("Enter your message: ")
# Send the message
s... | 16.083333 | 58 | 0.696891 |
9ee015b943531e03515eb61bdebe600d56faf92e | 1,025 | py | Python | erntehelfer/urls.py | abernten/website | 89167c5b1914953ac67def01b9ec0c169c50658f | [
"MIT"
] | 3 | 2020-03-21T22:32:56.000Z | 2020-03-28T23:06:38.000Z | erntehelfer/urls.py | abernten/website | 89167c5b1914953ac67def01b9ec0c169c50658f | [
"MIT"
] | null | null | null | erntehelfer/urls.py | abernten/website | 89167c5b1914953ac67def01b9ec0c169c50658f | [
"MIT"
] | null | null | null | from django.urls import path, re_path, include
from django.views.generic import TemplateView
from django.contrib.auth import views as auth_views
from .views import *
urlpatterns = [
# Static pages
path('', TemplateView.as_view(template_name='index.html')),
path('imprint', TemplateView.as_view(template_na... | 32.03125 | 72 | 0.698537 |
81f05d594d70359a557c4c7fe8d5f8b9e6b459ee | 3,188 | py | Python | fuzzsvc/controller/Script.py | ifoundthetao/FuzzFlow | 86559ac7f85fc89510c0d9647e02880edb95aa2a | [
"MIT"
] | 53 | 2016-08-26T02:51:45.000Z | 2021-05-24T21:05:44.000Z | controller/Script.py | FingerLeakers/FuzzFlow | 3f2de617c3658904f9640f53a05d5e4e90634e32 | [
"MIT"
] | null | null | null | controller/Script.py | FingerLeakers/FuzzFlow | 3f2de617c3658904f9640f53a05d5e4e90634e32 | [
"MIT"
] | 31 | 2016-08-26T04:08:31.000Z | 2021-05-24T21:05:54.000Z | from flask_restful import Resource, reqparse
from model.FuzzingScript import FuzzingScript
from app import app
db = app.config['db']
class ScriptCtrl(Resource):
def create(self, data):
try:
if data['visible'] is not None:
script = FuzzingScript(data['name'], data['script'], dat... | 34.27957 | 85 | 0.564617 |
5ed97ee3a083b64a645fdd385bfe5d080bce7c24 | 88 | py | Python | src/austria/apps.py | frocentus/offenewahlen_api | 71860583890f8a4c23df67f271e8f13558fa9582 | [
"MIT"
] | 14 | 2017-07-12T14:42:57.000Z | 2017-09-08T20:32:53.000Z | src/austria/apps.py | frocentus/offenewahlen_api | 71860583890f8a4c23df67f271e8f13558fa9582 | [
"MIT"
] | 209 | 2017-07-11T21:36:01.000Z | 2017-11-05T01:10:50.000Z | src/austria/apps.py | OKFNat/offenewahlen-api | 71860583890f8a4c23df67f271e8f13558fa9582 | [
"MIT"
] | 8 | 2017-07-15T09:40:42.000Z | 2018-01-12T03:02:06.000Z | from django.apps import AppConfig
class AustriaConfig(AppConfig):
name = 'austria'
| 17.6 | 33 | 0.761364 |
48cd1bb077b74cc13d0c7c5ed6a457bac9050432 | 844 | py | Python | banner-generator-main/custombanner.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | banner-generator-main/custombanner.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | banner-generator-main/custombanner.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-05T18:07:48.000Z | 2022-02-24T21:25:07.000Z | import time, os, sys
os.system("clear")
print("If you have generated a banner file using generator.py or your banner is between 30th 35th line of file, you can use this.")
time.sleep(2)
path= input("\nEnter file name or path > ")
try:
with open(path, 'r') as f3:
lines = f3.readlines()
with open(path... | 42.2 | 131 | 0.496445 |
1ef6fab3a172e59649cc209a3e23d2397a25e880 | 152 | py | Python | Python/ifelse.py | aja512/HackerRank | 5ddf3c03447732922f2075bca2690a1591163f7b | [
"MIT"
] | null | null | null | Python/ifelse.py | aja512/HackerRank | 5ddf3c03447732922f2075bca2690a1591163f7b | [
"MIT"
] | null | null | null | Python/ifelse.py | aja512/HackerRank | 5ddf3c03447732922f2075bca2690a1591163f7b | [
"MIT"
] | null | null | null | import sys
N = int(input().strip())
if N % 2 == 1 or N >= 6 and N <= 20:
print("Weird")
elif N >= 2 and N <= 5 or N >= 20:
print("Not Weird")
| 16.888889 | 36 | 0.506579 |
d23b3592eea28f5775ea93e791ead35a341c72ef | 19,980 | py | Python | qmk_firmware/lib/python/qmk/info.py | DanTupi/personal_setup | 911b4951e4d8b78d6ea8ca335229e2e970fda871 | [
"MIT"
] | null | null | null | qmk_firmware/lib/python/qmk/info.py | DanTupi/personal_setup | 911b4951e4d8b78d6ea8ca335229e2e970fda871 | [
"MIT"
] | null | null | null | qmk_firmware/lib/python/qmk/info.py | DanTupi/personal_setup | 911b4951e4d8b78d6ea8ca335229e2e970fda871 | [
"MIT"
] | null | null | null | """Functions that help us generate and use info.json files.
"""
from glob import glob
from pathlib import Path
import jsonschema
from dotty_dict import dotty
from milc import cli
from qmk.constants import CHIBIOS_PROCESSORS, LUFA_PROCESSORS, VUSB_PROCESSORS
from qmk.c_parse import find_layouts
from qmk.json_schema im... | 36.195652 | 179 | 0.61967 |
836d851fd1e1d7bd2b3d7594adcac6a2ff579118 | 3,169 | py | Python | skills/volume/action-volume.py | gidocarper/rhasspy-skills-test | eaf57287a67a0e43a299053cf0b107d61afd9b13 | [
"Unlicense"
] | 4 | 2021-01-08T21:08:50.000Z | 2021-12-08T15:30:50.000Z | skills/volume/action-volume.py | gidocarper/rhasspy-skills-test | eaf57287a67a0e43a299053cf0b107d61afd9b13 | [
"Unlicense"
] | null | null | null | skills/volume/action-volume.py | gidocarper/rhasspy-skills-test | eaf57287a67a0e43a299053cf0b107d61afd9b13 | [
"Unlicense"
] | null | null | null | """Example app using topic for receiving raw MQTT messages."""
import logging
import json, os
import io, configparser
from rhasspyhermes.nlu import NluIntent
from rhasspyhermes_app import EndSession, HermesApp
from rhasspyhermes_app import HermesApp, TopicData
from volume import Volume
_LOGGER = logging.getLogger("R... | 33.357895 | 110 | 0.692016 |
f79c83a8c877164b64b5a8ad1ad7dac1279545aa | 1,604 | py | Python | Python/zzz_training_challenge/Python_Challenge/solutions/ch07_recursion_advanced/solutions/ex06_math_operations.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/ch07_recursion_advanced/solutions/ex06_math_operations.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/ch07_recursion_advanced/solutions/ex06_math_operations.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | # Beispielprogramm für das Buch "Python Challenge"
#
# Copyright 2020 by Michael Inden
def all_combinations_with_value(base_values, desired_value):
all_combinations = find_all_combinations(base_values)
return find_by_value(all_combinations, desired_value)
def find_by_value(all_combinations, desired_value):... | 27.186441 | 72 | 0.665835 |
12773951d57b0920a3a0967ca99efe7b18ab2233 | 2,638 | py | Python | frappe-bench/env/lib/python2.7/site-packages/gocardless_pro/resources/creditor.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/env/lib/python2.7/site-packages/gocardless_pro/resources/creditor.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/env/lib/python2.7/site-packages/gocardless_pro/resources/creditor.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | # WARNING: Do not edit by hand, this file was generated by Crank:
#
# https://github.com/gocardless/crank
#
class Creditor(object):
"""A thin wrapper around a creditor, providing easy access to its
attributes.
Example:
creditor = client.creditors.get()
creditor.id
"""
def __init__(s... | 17.824324 | 69 | 0.622441 |
12cacdb95281dc9b58430f615125f5c8c74249b4 | 378 | py | Python | frappe-bench/apps/erpnext/erpnext/patches/v8_0/delete_bin_indexes.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:55:29.000Z | 2021-04-29T14:55:29.000Z | frappe-bench/apps/erpnext/erpnext/patches/v8_0/delete_bin_indexes.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v8_0/delete_bin_indexes.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:39:01.000Z | 2021-04-29T14:39:01.000Z | # Copyright (c) 2017, Frappe and Contributors
# License: GNU General Public License v3. See license.txt
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import frappe
def execute():
# delete bin indexes
unwanted_indexes = ["item_code", "warehouse"]
for k in unwanted_indexes:
try:
frappe.db.sql... | 23.625 | 57 | 0.71164 |
4280b7016259f2b0622aba03f9c69f10fa0ce1bf | 1,022 | py | Python | DnD/field.py | austinmh12/DiscordBots | 55550b68a7ad6423de55e62dbbff93fd88f08ff2 | [
"MIT"
] | null | null | null | DnD/field.py | austinmh12/DiscordBots | 55550b68a7ad6423de55e62dbbff93fd88f08ff2 | [
"MIT"
] | null | null | null | DnD/field.py | austinmh12/DiscordBots | 55550b68a7ad6423de55e62dbbff93fd88f08ff2 | [
"MIT"
] | null | null | null | from PIL import Image as Img, ImageDraw as IDraw
from discord.ext import commands
import discord
import logging
import typing
log = logging.getLogger(__name__)
log.setLevel(logging.DEBUG)
stream_handler = logging.StreamHandler()
stream_handler.setFormatter(logging.Formatter('[%(asctime)s - %(name)s - %(levelname)s] %(... | 32.967742 | 102 | 0.688845 |
c44522416d1adf85366b8681f9b1a157021b6b5e | 6,885 | py | Python | src/aijack/defense/dp/manager/accountant.py | luoshenseeker/AIJack | 4e871a5b3beb4b7c976d38060d6956efcebf880d | [
"MIT"
] | 24 | 2021-11-17T02:16:47.000Z | 2022-03-27T01:04:08.000Z | src/aijack/defense/dp/manager/accountant.py | luoshenseeker/AIJack | 4e871a5b3beb4b7c976d38060d6956efcebf880d | [
"MIT"
] | 9 | 2021-12-03T06:09:27.000Z | 2022-03-29T06:33:53.000Z | src/aijack/defense/dp/manager/accountant.py | luoshenseeker/AIJack | 4e871a5b3beb4b7c976d38060d6956efcebf880d | [
"MIT"
] | 5 | 2022-01-12T09:58:04.000Z | 2022-03-17T09:29:04.000Z | import numpy as np
from aijack_dp_core import (
_greedy_search,
_greedy_search_frac,
_ternary_search,
_ternary_search_int,
culc_tightupperbound_lowerbound_of_rdp_with_theorem6and8_of_zhu_2019,
culc_upperbound_of_rdp_with_Sampled_Gaussian_Mechanism,
eps_gaussian,
eps_laplace,
)
from .rd... | 31.013514 | 120 | 0.584023 |
67161317c7d682efdbc14144bc31c6fed31f4d87 | 1,082 | py | Python | doc/precursers/2019_09-Sneakernet/Sneakernet/dump-log.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 8 | 2020-03-17T21:12:18.000Z | 2021-12-12T15:55:54.000Z | doc/precursers/2019_09-Sneakernet/Sneakernet/dump-log.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 2 | 2021-07-19T06:18:43.000Z | 2022-02-10T12:17:58.000Z | doc/precursers/2019_09-Sneakernet/Sneakernet/dump-log.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 25 | 2020-03-20T09:32:45.000Z | 2021-07-18T18:12:59.000Z | #!/usr/bin/env python3
# Sneakernet/read-log.py
import base64
import json
import os
import pprint
import sys
import lib.gg as gg
import lib.pcap as log
import lib.crypto as crypto
LOG_FILE_NAME = 'log.pcap'
# ----------------------------------------------------------------------
if __name__ == '__main__':
... | 20.807692 | 86 | 0.511091 |
e1d66504ed6e3cf6f58939c3bb4e5af129e6eafc | 5,561 | py | Python | technix/de.py | dr-bigfatnoob/quirk | f5025d7139adaf06380c429b436ccbf1e7611a16 | [
"Unlicense"
] | 1 | 2021-03-05T07:44:05.000Z | 2021-03-05T07:44:05.000Z | technix/de.py | dr-bigfatnoob/quirk | f5025d7139adaf06380c429b436ccbf1e7611a16 | [
"Unlicense"
] | 3 | 2017-06-04T03:01:31.000Z | 2017-08-04T04:04:37.000Z | technix/de.py | dr-bigfatnoob/quirk | f5025d7139adaf06380c429b436ccbf1e7611a16 | [
"Unlicense"
] | null | null | null | from __future__ import print_function, division
import os
import sys
sys.path.append(os.path.abspath("."))
sys.dont_write_bytecode = True
__author__ = "bigfatnoob"
from utils.lib import O
from utils.stats import Statistics
import time
from technix.tech_utils import Point, seed
from utils import plotter
from technix... | 30.723757 | 119 | 0.655458 |
c0613bcb1d8796d6b0bfc6535b345661a65f0e51 | 1,624 | py | Python | mobile/tools/python/misc/restore-git.py | jameswu2014/Paddle-Lite | 827e349ac8eb769a873fe9b3aa961af8b8b20a96 | [
"Apache-2.0"
] | 3 | 2018-08-01T09:45:48.000Z | 2021-01-06T14:55:10.000Z | mobile/tools/python/misc/restore-git.py | tao8687/Paddle-Lite | ebc0e39c7e8c09ad2d1b6a2923a420b2c1727635 | [
"Apache-2.0"
] | null | null | null | mobile/tools/python/misc/restore-git.py | tao8687/Paddle-Lite | ebc0e39c7e8c09ad2d1b6a2923a420b2c1727635 | [
"Apache-2.0"
] | 5 | 2020-10-13T09:30:16.000Z | 2021-06-08T02:46:17.000Z | import os
import sys
import subprocess
username = ""
email = ""
home = ""
desktop = "{}/Desktop".format(home)
dir_1 = "{}/1".format(desktop)
dir_2 = "{}/2".format(desktop)
src_dir = dir_1
dest_dir = dir_2
src_mobile_dir = "{}/paddle-mobile".format(src_dir)
dest_mobile_dir = "{}/paddle-mobile".format(dest_dir)
def clo... | 29.527273 | 96 | 0.623153 |
a1ebdd027fd4a3fb77f0b51b14b2620ccaa6718b | 285 | py | Python | Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-004/pg-4.5-grade-calculator-ep.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-004/pg-4.5-grade-calculator-ep.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-004/pg-4.5-grade-calculator-ep.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | marks = input("Plase Enter your Marks: ")
marks = int(marks)
if marks >= 80:
print("Your Grade is A+")
elif marks >= 70:
print("Your Grade is A")
elif marks >= 60:
print("Your Grade is A-")
elif marks >= 50:
print("Your Grade is B")
else:
print("Your Grade is F")
| 20.357143 | 41 | 0.607018 |
773fdf6f57126d1c2660161f30ca07b110580205 | 1,269 | py | Python | keras_fcn/backend/common.py | li657835991/FCN | 26bafeaf631a095d9d2befcc3b798a87c8d0fa7c | [
"MIT"
] | 235 | 2017-03-01T14:34:29.000Z | 2021-06-03T16:16:16.000Z | keras_fcn/backend/common.py | li657835991/FCN | 26bafeaf631a095d9d2befcc3b798a87c8d0fa7c | [
"MIT"
] | 39 | 2017-03-25T01:20:25.000Z | 2020-10-30T11:51:47.000Z | keras_fcn/backend/common.py | li657835991/FCN | 26bafeaf631a095d9d2befcc3b798a87c8d0fa7c | [
"MIT"
] | 105 | 2017-04-13T21:31:46.000Z | 2021-11-01T17:25:48.000Z | import h5py
import keras.backend as K
def load_weights(model, weights_path):
"""Load weights from Caffe models."""
print("Loading weights...")
if h5py is None:
raise ImportError('`load_weights` requires h5py.')
f = h5py.File(weights_path, mode='r')
# New file format.
layer_names = [n.... | 33.394737 | 74 | 0.624113 |
7749a42fa1df4819dc7f170b34211bd1563f40f3 | 4,206 | py | Python | year_2/prog_base_sem1_cw/app/administer/views.py | honchardev/KPI | f8425681857c02a67127ffb05c0af0563a8473e1 | [
"MIT"
] | null | null | null | year_2/prog_base_sem1_cw/app/administer/views.py | honchardev/KPI | f8425681857c02a67127ffb05c0af0563a8473e1 | [
"MIT"
] | 21 | 2020-03-24T16:26:04.000Z | 2022-02-18T15:56:16.000Z | year_2/prog_base_sem1_cw/app/administer/views.py | honchardev/KPI | f8425681857c02a67127ffb05c0af0563a8473e1 | [
"MIT"
] | null | null | null | from flask import render_template, current_app, request, redirect, url_for, flash
from flask_login import login_required
from ..main.forms import EditCommentForm, PostForm
from ..models import User, Permission, Comment, Role, Post
from ..decorators import permission_required, admin_required
from .. import db
from .form... | 30.042857 | 81 | 0.695197 |
623fa518450c4476ed1fe05e2fcdb87c8ebb6955 | 1,547 | py | Python | Sketche/nature_of_code/chapter_1/mover_4.py | kantel/p5 | 2ef14191c35fdb056b44624c6ff0ff764c88cc30 | [
"MIT"
] | null | null | null | Sketche/nature_of_code/chapter_1/mover_4.py | kantel/p5 | 2ef14191c35fdb056b44624c6ff0ff764c88cc30 | [
"MIT"
] | null | null | null | Sketche/nature_of_code/chapter_1/mover_4.py | kantel/p5 | 2ef14191c35fdb056b44624c6ff0ff764c88cc30 | [
"MIT"
] | null | null | null | import p5
import os
from pvector import PVector
# Hier wird der Pfad zum Verzeichnis des ».py«-Files gesetzt
# Erspart einem das Herumgehample in TextMate mit dem os.getcwd()
# und os.path.join()
file_path = os.path.dirname(os.path.abspath(__file__))
os.chdir(file_path)
class Mover(object):
def __init__(self... | 26.220339 | 65 | 0.594053 |
626ec3936666d7474ceb2ea986cc601e96f5ad56 | 87 | py | Python | python/python_backup/PRAC_PYTHON/10_append1.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/python_backup/PRAC_PYTHON/10_append1.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/python_backup/PRAC_PYTHON/10_append1.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | def f(a, L=[]):
L.append(a)
return L
print(f(1))
print(f(2))
print(f(3)) | 12.428571 | 16 | 0.482759 |
b2a3ae32e8035dc78bb5f0d6029cf75e6d5ff3b3 | 3,811 | py | Python | forge/models/tables.py | Pandinosaurus/3d-forge | d631e14a9351911c3e5612c73c1608d97ed547d2 | [
"BSD-3-Clause"
] | 31 | 2015-07-13T15:36:50.000Z | 2022-02-07T21:37:51.000Z | forge/models/tables.py | Pandinosaurus/3d-forge | d631e14a9351911c3e5612c73c1608d97ed547d2 | [
"BSD-3-Clause"
] | 109 | 2015-04-24T10:03:24.000Z | 2019-04-12T13:34:01.000Z | forge/models/tables.py | Pandinosaurus/3d-forge | d631e14a9351911c3e5612c73c1608d97ed547d2 | [
"BSD-3-Clause"
] | 16 | 2015-10-03T06:03:22.000Z | 2022-03-31T08:24:37.000Z | # -*- coding: utf-8 -*-
import os
import ConfigParser
from sqlalchemy import Column, Sequence, BigInteger, Text
from sqlalchemy.ext.declarative import declarative_base
from geoalchemy2.types import Geometry
from forge.models import Vector
from forge.lib.helpers import isShapefile
Base = declarative_base()
table_ar... | 33.725664 | 77 | 0.636841 |
a27d540e46da037ff0d5ad0cd6a86139c57680c7 | 1,156 | py | Python | solutions/mols_search/mols-search-webserver/src/service/search.py | naetimus/bootcamp | 0182992df7c54012944b51fe9b70532ab6a0059b | [
"Apache-2.0"
] | 1 | 2021-01-11T18:40:22.000Z | 2021-01-11T18:40:22.000Z | solutions/mols_search/mols-search-webserver/src/service/search.py | naetimus/bootcamp | 0182992df7c54012944b51fe9b70532ab6a0059b | [
"Apache-2.0"
] | null | null | null | solutions/mols_search/mols-search-webserver/src/service/search.py | naetimus/bootcamp | 0182992df7c54012944b51fe9b70532ab6a0059b | [
"Apache-2.0"
] | 1 | 2020-04-03T05:24:47.000Z | 2020-04-03T05:24:47.000Z | import logging
from common.const import default_cache_dir
from indexer.index import milvus_client, create_table, insert_vectors, delete_table, search_vectors, create_index
from diskcache import Cache
from encoder.encode import smiles_to_vec
def query_smi_from_ids(vids):
res = []
cache = Cache(default_cache_di... | 30.421053 | 113 | 0.656574 |
a2a54c2d8cf466b898734ea0c75960964eb6c3e7 | 9,568 | py | Python | src/onegov/election_day/models/principal.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/election_day/models/principal.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/election_day/models/principal.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | import onegov.election_day
from cached_property import cached_property
from collections import OrderedDict
from datetime import date
from onegov.core import utils
from onegov.core.custom import json
from onegov.election_day import _
from pathlib import Path
from urllib.parse import urlsplit
from yaml import safe_load
... | 31.893333 | 79 | 0.571384 |
ac516160826d75dbf322f247e1cb02985cfb5b09 | 2,377 | py | Python | MT-LSTM/config.py | baowj-678/TC | 4c9bf6bf2202c9930616259d3f3e1a2b0529a6e6 | [
"MIT"
] | null | null | null | MT-LSTM/config.py | baowj-678/TC | 4c9bf6bf2202c9930616259d3f3e1a2b0529a6e6 | [
"MIT"
] | null | null | null | MT-LSTM/config.py | baowj-678/TC | 4c9bf6bf2202c9930616259d3f3e1a2b0529a6e6 | [
"MIT"
] | null | null | null | """ MT-LSTM 的配置文件
@Author: Bao Wenjie
@Email: bwj_678@qq.com
@Date: 2020/10/31
"""
class Config(object):
def __init__(self):
self.ENV = 'default' #当前的环境参数
self.Introduce = 'Not at the moment' #对此次实验的描述
self.VERSION = 1 #当前版本
############... | 36.015152 | 105 | 0.431216 |
5a08b59948a7e071556a2e27f555220c92b5856e | 1,844 | py | Python | 03 Python/Entwicklung eines IoT-Devices/loesung/src/my_iot_device/database.py | DennisSchulmeister/dhbwka-wwi-iottech-quellcodes | 58f86907af31187f267a9ea476f061cc59098ebd | [
"CC-BY-4.0"
] | null | null | null | 03 Python/Entwicklung eines IoT-Devices/loesung/src/my_iot_device/database.py | DennisSchulmeister/dhbwka-wwi-iottech-quellcodes | 58f86907af31187f267a9ea476f061cc59098ebd | [
"CC-BY-4.0"
] | null | null | null | 03 Python/Entwicklung eines IoT-Devices/loesung/src/my_iot_device/database.py | DennisSchulmeister/dhbwka-wwi-iottech-quellcodes | 58f86907af31187f267a9ea476f061cc59098ebd | [
"CC-BY-4.0"
] | 1 | 2020-10-10T20:24:05.000Z | 2020-10-10T20:24:05.000Z | import apsw, os
DBFILE = os.path.join(os.path.expanduser("~"), "my_iot_device.sqlite")
class DatabaseHandler:
"""
Einfacher Datenbank-Handler, der die gemessenen Sensorwerte in einer
lokelen SQLite-Datenbank ablegt. Auf diese Weise ist schon einmal
sichergestellt, dass die Werte nicht verloren gehen. ... | 34.792453 | 93 | 0.649675 |
ce77219392780b4ad4b8609424ec256635c400a1 | 1,412 | py | Python | code/worker.py | hawkeye116477/appimage.github.io | 89ea5ee6e08ed7b30cee3499cb88f8c886c2ae0e | [
"MIT"
] | 228 | 2017-08-23T13:35:04.000Z | 2022-03-30T20:57:21.000Z | code/worker.py | hawkeye116477/appimage.github.io | 89ea5ee6e08ed7b30cee3499cb88f8c886c2ae0e | [
"MIT"
] | 1,504 | 2017-08-21T15:06:59.000Z | 2022-03-31T20:22:42.000Z | code/worker.py | hawkeye116477/appimage.github.io | 89ea5ee6e08ed7b30cee3499cb88f8c886c2ae0e | [
"MIT"
] | 530 | 2017-08-23T13:28:42.000Z | 2022-03-31T20:03:25.000Z | #!/usr/bin/env python3
import os, sys
import requests # It is an extra dependency but it allows us to download only the portion of the file that is needed to check the magic
def main() -> None:
# Get the URL to the AppImage
f = open(sys.argv[1], "r")
url = f.readline()
f.close()
print(url)
... | 28.24 | 135 | 0.611898 |
f05e4ba52353998873741e2d69b9609819dcea11 | 1,922 | py | Python | research/cv/Pix2Pix/src/models/init_w.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/Pix2Pix/src/models/init_w.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/Pix2Pix/src/models/init_w.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... | 43.681818 | 104 | 0.659209 |
f078bf32d9f6370c8ebf21dcb9ca71546d107231 | 3,596 | py | Python | pythonProj/FZPython/pyquant/libs/mysqllib.py | iHamburg/FZQuant | 86b750ec33d01badfd3f324d6f1599118b9bf8ff | [
"MIT"
] | null | null | null | pythonProj/FZPython/pyquant/libs/mysqllib.py | iHamburg/FZQuant | 86b750ec33d01badfd3f324d6f1599118b9bf8ff | [
"MIT"
] | null | null | null | pythonProj/FZPython/pyquant/libs/mysqllib.py | iHamburg/FZQuant | 86b750ec33d01badfd3f324d6f1599118b9bf8ff | [
"MIT"
] | 2 | 2019-04-10T10:05:00.000Z | 2021-11-24T17:17:23.000Z | #!/usr/bin/env python
# coding: utf8
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.sql import func
from pyquant.config import mysql as config
# import pymysql
# pymysql.threadsafety = 3
__all__ = [
'session',
... | 26.637037 | 90 | 0.573971 |
331cdcef9028318617e9e716c91c58396abc3f7c | 12,695 | py | Python | src/onegov/feriennet/forms/attendee.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/feriennet/forms/attendee.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/feriennet/forms/attendee.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from cached_property import cached_property
from chameleon.utils import Markup
from sedate import utcnow
from onegov.activity import Attendee, AttendeeCollection
from onegov.activity import Booking, BookingCollection, Occasion
from onegov.core.templates import render_macro
from onegov.feriennet import _
from onegov.f... | 31.03912 | 79 | 0.600709 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.