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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
fd11d7e54da74a36276aabc4ab8b3b45f82e0cb3 | 292 | py | Python | Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-008/pg-8.3-found-each-text.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-008/pg-8.3-found-each-text.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-008/pg-8.3-found-each-text.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | country = "Bangladesh"
print("country =", country)
print("country[1] =", country[0])
print("country[1] =", country[1])
print("country[2] =", country[2])
print("country[6] =", country[6])
print("country[8] =", country[8])
print("country[9] =", country[9])
print("country[1o] =", country[10])
| 26.545455 | 35 | 0.633562 |
1fc1178148fd57948205d6894364f8998511df53 | 72 | py | Python | python/pd_read_csv.py | YA-androidapp/Python-cheatsheet-ML | eafa57d933a2bafd1e169c234acf987670ba790d | [
"Apache-2.0"
] | null | null | null | python/pd_read_csv.py | YA-androidapp/Python-cheatsheet-ML | eafa57d933a2bafd1e169c234acf987670ba790d | [
"Apache-2.0"
] | null | null | null | python/pd_read_csv.py | YA-androidapp/Python-cheatsheet-ML | eafa57d933a2bafd1e169c234acf987670ba790d | [
"Apache-2.0"
] | null | null | null | import pandas as pd
import sys
df1 = pd.read_csv(sys.stdin)
print(df1)
| 12 | 28 | 0.75 |
23bf83af7bc38a723f0aa9370aabbb782d957369 | 746 | py | Python | test/py/benchmark_grpc.py | wybosys/nnt.logic.jvm | 249aedd7f8dd03d94dcb0780b91dadacd4b25270 | [
"BSD-3-Clause"
] | 2 | 2020-09-22T11:01:31.000Z | 2020-09-22T11:12:29.000Z | test/py/benchmark_grpc.py | wybosys/nnt.logic.jvm | 249aedd7f8dd03d94dcb0780b91dadacd4b25270 | [
"BSD-3-Clause"
] | null | null | null | test/py/benchmark_grpc.py | wybosys/nnt.logic.jvm | 249aedd7f8dd03d94dcb0780b91dadacd4b25270 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
import time
import threading
from dubbo.test_pb2_grpc import TestStub
from google.protobuf.empty_pb2 import Empty
from google.protobuf.wrappers_pb2 import StringValue
import grpc
# 当前启动的测试服务
host = "localhost:8093"
def test():
# 链接服务器
channel = grpc.insecure_channel(host)
stub = ... | 20.162162 | 52 | 0.623324 |
7b2ed76b21e3025612213a7d7bb88cec31e0d6ef | 824 | py | Python | python_gui_tkinter/Tkinter/TkinterCourse/33_sliders.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python_gui_tkinter/Tkinter/TkinterCourse/33_sliders.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python_gui_tkinter/Tkinter/TkinterCourse/33_sliders.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | '''
A slider is a Tkinter object with which a user can set a value by moving an indicator. Sliders can be vertically or horizontally arranged. A slider is created with the Scale method().
Using the Scale widget creates a graphical object, which allows the user to select a numerical value by moving a knob along a scale... | 48.470588 | 473 | 0.760922 |
7bbe385893227a2e83ce3bb4503a6be9b5a8d5eb | 722 | py | Python | elements/python/6/18/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | 11 | 2019-02-08T06:54:34.000Z | 2021-08-07T18:57:39.000Z | elements/python/6/18/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | 1 | 2019-05-21T08:14:10.000Z | 2019-05-21T08:14:10.000Z | elements/python/6/18/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | null | null | null | import random
import collections
def sample(n, k):
"""
Compute a sample from {0, 1, ..., n-1} of size k.
"""
a = dict()
for i in xrange(k):
j = random.randrange(i, n)
a[i], a[j] = a.get(j, j), a.get(i, i)
return [a[i] for i in xrange(k)]
def count_samples(n, k, trials=1000):
... | 21.235294 | 54 | 0.574792 |
a816b1af71d1da423fbdc3a5141121f5513070f8 | 333 | py | Python | exercises/pt/exc_02_05_01.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/pt/exc_02_05_01.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/pt/exc_02_05_01.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | from spacy.lang.en import English
nlp = English()
# Importe a classe Doc
from ____ import ____
# Texto desejado: "spaCy is cool!"
words = ["spaCy", "is", "cool", "!"]
spaces = [True, True, False, False]
# Crie um Doc a partir das palavras words e o espaçamento spaces
doc = ____(____, words=words, spaces=spaces)
pri... | 22.2 | 64 | 0.6997 |
a5c049a77cf00f3c53e0e224f98009f02e2ee583 | 12,379 | py | Python | src/main/python/ble_temperature_sensor/bluetoothtemperaturesensor.py | BikeAtor/WoMoAtor | 700cc8b970dcfdd5af2f471df1a223d2a38cb1bf | [
"Apache-2.0"
] | null | null | null | src/main/python/ble_temperature_sensor/bluetoothtemperaturesensor.py | BikeAtor/WoMoAtor | 700cc8b970dcfdd5af2f471df1a223d2a38cb1bf | [
"Apache-2.0"
] | null | null | null | src/main/python/ble_temperature_sensor/bluetoothtemperaturesensor.py | BikeAtor/WoMoAtor | 700cc8b970dcfdd5af2f471df1a223d2a38cb1bf | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
####################
# # DEPRECATED
####################
import sys
from time import sleep
sys.path.append('.')
sys.path.append('..')
sys.path.append('ble_temperature_sensor')
sys.path.append('lib')
import logging
import threading
import time
# bluetooth
from bleson import get_provider, Observ... | 43.283217 | 158 | 0.480976 |
f518513ac0d6bf084fc23fb2bd2242cbd858cd3f | 3,961 | py | Python | yolov5-coreml-tflite-converter/inference-python/python_utils/plots.py | SchweizerischeBundesbahnen/sbb-ml-models | 485356aeb0a277907c160d435f7f654154046a70 | [
"MIT"
] | null | null | null | yolov5-coreml-tflite-converter/inference-python/python_utils/plots.py | SchweizerischeBundesbahnen/sbb-ml-models | 485356aeb0a277907c160d435f7f654154046a70 | [
"MIT"
] | null | null | null | yolov5-coreml-tflite-converter/inference-python/python_utils/plots.py | SchweizerischeBundesbahnen/sbb-ml-models | 485356aeb0a277907c160d435f7f654154046a70 | [
"MIT"
] | null | null | null | import cv2
from coordinates import scale_coords_yolo
WHITE_COLOR = (225, 255, 255)
class Colors:
# Ultralytics color palette https://ultralytics.com/
def __init__(self):
# hex = matplotlib.colors.TABLEAU_COLORS.values()
hex = ('FF3838', 'FF9D97', 'FF701F', 'FFB21D', 'CFD231', '48F90A', '92CC... | 40.418367 | 114 | 0.599849 |
f557eb7843808fa3f755612fa5ac390e27891904 | 4,411 | py | Python | cross_entropy/main.py | laituan245/Reinforcement-Learning-Dojo | 3187621c9188d72fe593ef69ecad6d1288889a51 | [
"MIT"
] | null | null | null | cross_entropy/main.py | laituan245/Reinforcement-Learning-Dojo | 3187621c9188d72fe593ef69ecad6d1288889a51 | [
"MIT"
] | null | null | null | cross_entropy/main.py | laituan245/Reinforcement-Learning-Dojo | 3187621c9188d72fe593ef69ecad6d1288889a51 | [
"MIT"
] | null | null | null | import gym
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import numpy as np
from torch import LongTensor, FloatTensor
from gym.wrappers import Monitor
# Main Classes and Helper Functions
class PolicyNetwork(nn.Module):
def __init__(self, input_size, hidden_size, nb_... | 34.193798 | 80 | 0.663568 |
27eda7bd1857376b04eb740d15493f84894fe84c | 132 | py | Python | deep-learning-from-scratch/ch01/imshow.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | deep-learning-from-scratch/ch01/imshow.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | deep-learning-from-scratch/ch01/imshow.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
from matplotlib.image import imread
img = imread('../dataset/lena.jpg')
plt.imshow(img)
plt.show() | 18.857143 | 35 | 0.757576 |
fdc0ae86b9f9565cc9e0a9f5cd485e40f542ce9b | 1,372 | py | Python | Python/Buch_ATBS/Teil_2/Kapitel_11_Webscraping/03_download_mittels_request/03_download_mittels_request.py | Apop85/Scripts | e71e1c18539e67543e3509c424c7f2d6528da654 | [
"MIT"
] | null | null | null | Python/Buch_ATBS/Teil_2/Kapitel_11_Webscraping/03_download_mittels_request/03_download_mittels_request.py | Apop85/Scripts | e71e1c18539e67543e3509c424c7f2d6528da654 | [
"MIT"
] | 6 | 2020-12-24T15:15:09.000Z | 2022-01-13T01:58:35.000Z | Python/Buch_ATBS/Teil_2/Kapitel_11_Webscraping/03_download_mittels_request/03_download_mittels_request.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | null | null | null | # 03_download_mittels_request.py
# Da request nicht standardmässig installiert ist muss es mit pip install request nachinstalliert werden.
import requests, os, logging
os.chdir(os.path.dirname(__file__))
fake_url='http://inventwithpython.com/nicht_existierende_seite'
real_url='https://raw.githubusercontent.com/Apop85... | 33.463415 | 175 | 0.761662 |
a904626a19aab8a3b80eebd99db7eb4b687809e1 | 467 | py | Python | Python/Buch_ATBS/Teil_1/Kapitel_01_bis_04/05_random_counter.py | Apop85/Scripts | e71e1c18539e67543e3509c424c7f2d6528da654 | [
"MIT"
] | null | null | null | Python/Buch_ATBS/Teil_1/Kapitel_01_bis_04/05_random_counter.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/05_random_counter.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | null | null | null | # Würfle x mal eine Zahl zwischen 0 und 9 und werte aus wie oft die einzelnen Zahlen gewürfelt wurden.
import random
rngvar=[0]*10
while True:
print('Wie oft soll gewürfelt werden?')
try:
total=int(input())
break
except ValueError:
print('Das ist keine Zahl!')
faktor=100/total
fo... | 22.238095 | 103 | 0.635974 |
8bc1ac9084d7e8acede72619112d40a90021dd91 | 2,185 | py | Python | backend/app/utils/utils.py | jinnn-dev/patholearn | b4e6a18cfbf963e71640ed6cac3fc3a618a7ae15 | [
"MIT"
] | 1 | 2022-02-20T12:45:04.000Z | 2022-02-20T12:45:04.000Z | backend/app/utils/utils.py | JamesNeumann/learning-by-annotations | c2b5e4b653eeb1c973aa5a7dad35ac8be18cb1ad | [
"MIT"
] | 21 | 2021-11-01T10:13:56.000Z | 2021-12-02T10:02:13.000Z | backend/app/utils/utils.py | jinnn-dev/patholearn | b4e6a18cfbf963e71640ed6cac3fc3a618a7ae15 | [
"MIT"
] | 1 | 2021-12-16T18:20:55.000Z | 2021-12-16T18:20:55.000Z | import csv
import json
from io import StringIO
from math import hypot
from typing import Any, Dict, Iterator, List, Union
from app.schemas.polygon_data import Point
from app.schemas.solver_result import LineResult, PointResult, PolygonResult
from fastapi import File, UploadFile
def point_diff(p1, p2):
... | 28.376623 | 81 | 0.652632 |
d028bb4ee417a35ad86788f0fbf001d1a811a3b7 | 96 | py | Python | backend/hunters_log/apps.py | Liannaccone/hunters-log | d8dc4656ad9231a346601c876dfb281a00261867 | [
"MIT"
] | null | null | null | backend/hunters_log/apps.py | Liannaccone/hunters-log | d8dc4656ad9231a346601c876dfb281a00261867 | [
"MIT"
] | null | null | null | backend/hunters_log/apps.py | Liannaccone/hunters-log | d8dc4656ad9231a346601c876dfb281a00261867 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class HuntersLogConfig(AppConfig):
name = 'hunters_log'
| 16 | 34 | 0.770833 |
3eebac3724e7b18946dc8187981a89682d7f004b | 2,339 | py | Python | 3kCTF/2021/web/online_compiler/app.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 1 | 2021-11-02T20:53:58.000Z | 2021-11-02T20:53:58.000Z | 3kCTF/2021/web/online_compiler/app.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | 3kCTF/2021/web/online_compiler/app.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | from flask import Flask, redirect, url_for, request
from flask_cors import CORS, cross_origin
from pathlib import Path
from subprocess import PIPE, Popen
import string
import random
def get_random_string(length):
letters = string.ascii_lowercase
result_str = ''.join(random.choice(letters) for i in range(length... | 29.2375 | 71 | 0.538264 |
410e3471dea93d2e1dd1f33ccce2c2ad9246e4f3 | 229 | py | Python | backend/response_builder.py | whatwouldmarvindo/sweetgeeks | 9d7d1103b7aa08aaeecfe32745016b789d922076 | [
"MIT"
] | null | null | null | backend/response_builder.py | whatwouldmarvindo/sweetgeeks | 9d7d1103b7aa08aaeecfe32745016b789d922076 | [
"MIT"
] | 2 | 2021-09-29T08:15:26.000Z | 2021-11-03T09:37:37.000Z | backend/response_builder.py | whatwouldmarvindo/sweetgeeks | 9d7d1103b7aa08aaeecfe32745016b789d922076 | [
"MIT"
] | null | null | null | import json
def build_statistic(cityName):
filename = "response_" + cityName + ".json"
with open(filename, 'r') as myfile:
data=myfile.read()
# parse file
response = json.loads(data)
return response | 20.818182 | 47 | 0.646288 |
dfe09a8560fea6cbee56a048d67392a48ea69a0f | 2,529 | py | Python | source/blog/views.py | JakubGutowski/PersonalBlog | 96122b36486f7e874c013e50d939732a43db309f | [
"BSD-3-Clause"
] | null | null | null | source/blog/views.py | JakubGutowski/PersonalBlog | 96122b36486f7e874c013e50d939732a43db309f | [
"BSD-3-Clause"
] | null | null | null | source/blog/views.py | JakubGutowski/PersonalBlog | 96122b36486f7e874c013e50d939732a43db309f | [
"BSD-3-Clause"
] | null | null | null | from django.shortcuts import render
from django.http import HttpResponseRedirect
from django.views import View
from .forms import PostComent as PostComentForm
from django.http import HttpResponse
from datetime import datetime
from calendar import month_name
from .models import BlogPost, PostComments, VisitorIp... | 32.844156 | 82 | 0.61724 |
f835aa8952f899fb7713e27bd5e05ea46ab51a78 | 749 | py | Python | admin-tutorial/AdminFilter/ordering_/admin.py | zhengtong0898/django-decode | 69680853a4a5b07f6a9c4b65c7d86b2d401a92b1 | [
"MIT"
] | 5 | 2020-07-14T07:48:10.000Z | 2021-12-20T21:20:10.000Z | admin-tutorial/AdminFilter/ordering_/admin.py | zhengtong0898/django-decode | 69680853a4a5b07f6a9c4b65c7d86b2d401a92b1 | [
"MIT"
] | 7 | 2021-03-26T03:13:38.000Z | 2022-03-12T00:42:03.000Z | admin-tutorial/AdminFilter/ordering_/admin.py | zhengtong0898/django-decode | 69680853a4a5b07f6a9c4b65c7d86b2d401a92b1 | [
"MIT"
] | 1 | 2021-02-16T07:04:25.000Z | 2021-02-16T07:04:25.000Z | from django.contrib import admin
from .models import ArticleModel
from django.urls import reverse
# Register your models here.
class ArticleModelAdmin(admin.ModelAdmin):
list_display = ('title', 'tags', 'author', 'date_joined', 'view_on_site')
ordering = ('title', 'date_joined') #... | 25.827586 | 95 | 0.648865 |
f8801a0a1593ce71dea7f22f64c8d8c67fd07e49 | 768 | py | Python | imgFilter/filter/migrations/0001_initial.py | xiang2002/Web | f12393c38ea3e88ceb67d270d707f3df0cf5e05a | [
"MIT"
] | 1 | 2020-10-21T07:18:00.000Z | 2020-10-21T07:18:00.000Z | imgFilter/filter/migrations/0001_initial.py | xiang2002/Web | f12393c38ea3e88ceb67d270d707f3df0cf5e05a | [
"MIT"
] | null | null | null | imgFilter/filter/migrations/0001_initial.py | xiang2002/Web | f12393c38ea3e88ceb67d270d707f3df0cf5e05a | [
"MIT"
] | null | null | null | # Generated by Django 3.0.4 on 2020-09-15 01:38
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Queue',
fields=[
('id', mod... | 27.428571 | 115 | 0.511719 |
3e724329618b66b629256604ca6ece1986cbbcfe | 1,896 | py | Python | src/main.py | jschito/project_structure_template | e8834129cca72988e08bea78a8a16f4fe071b2ef | [
"BSD-3-Clause"
] | null | null | null | src/main.py | jschito/project_structure_template | e8834129cca72988e08bea78a8a16f4fe071b2ef | [
"BSD-3-Clause"
] | null | null | null | src/main.py | jschito/project_structure_template | e8834129cca72988e08bea78a8a16f4fe071b2ef | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Main function of your project. Describe it here."""
__author__ = 'XYZ'
__copyright__ = "Copyright 2021, YOUR_COMPANY"
__license__ = "BSD-3-Clause License"
__version__ = "0.0.1"
__status__ = "Development"
import os
import sys
import time
import pandas as pd
import cons... | 30.580645 | 132 | 0.700949 |
e49682217a08fa945b528b985de0f8a9c059c1cd | 1,701 | py | Python | vorl6-ueb1.py | haenno/FOM-BSc-WI-Semster3-Skriptsprachen-Python | bb34b6b1ba7e8fe7b22ce598a80d5011122c2d4a | [
"MIT"
] | null | null | null | vorl6-ueb1.py | haenno/FOM-BSc-WI-Semster3-Skriptsprachen-Python | bb34b6b1ba7e8fe7b22ce598a80d5011122c2d4a | [
"MIT"
] | null | null | null | vorl6-ueb1.py | haenno/FOM-BSc-WI-Semster3-Skriptsprachen-Python | bb34b6b1ba7e8fe7b22ce598a80d5011122c2d4a | [
"MIT"
] | null | null | null | # 6. Vorlesung 30.10.2020, Skript Python 4 (07_Python_04.pdf)
# Übung 1: GUI, Skala mit Benzinverbräuchen
from tkinter import *
def calc_result():
km = float(entry_km.get())
l = float(entry_l.get())
result = (l / km) * 100
label_result.configure(text="Der Druchschnittliche Verbrauch beträgt %.2f Lite... | 27.885246 | 106 | 0.697825 |
e4ba26c9d1e6c3e719e6d4b79ac910605e9c4eb9 | 1,590 | py | Python | kNN/src/wdbc.py | quqixun/MLAlgorithms | 1ad46a899a6280a08c196fb4eb0931408c8636c7 | [
"MIT"
] | 2 | 2018-04-25T18:00:28.000Z | 2018-08-08T09:39:18.000Z | kNN/src/wdbc.py | quqixun/MLAlgorithms | 1ad46a899a6280a08c196fb4eb0931408c8636c7 | [
"MIT"
] | null | null | null | kNN/src/wdbc.py | quqixun/MLAlgorithms | 1ad46a899a6280a08c196fb4eb0931408c8636c7 | [
"MIT"
] | 2 | 2019-03-03T02:55:48.000Z | 2021-01-21T04:50:46.000Z | # Conventional Machine Learning Algorithms
# Test script for Class of "kNN" on WDBC.
# Author: Qixun Qu
# Create on: 2018/05/04
# Modify on: 2018/05/04
# ,,, ,,,
# ;" '; ;' ",
# ; @.ss$$$$$$s.@ ;
# `s$$$$$$$$$$$$$$$'
# $$$$$$$$$$$$$$$$$$
# $$$$P""Y$$$Y""W$$$$$
# $$$$ p"$$$"q $$$$$
# ... | 22.394366 | 65 | 0.583648 |
39d02cafe9516143160173caaedf238074599688 | 68 | py | Python | src/templates/template.py | cbarnson/UVa | 0dd73fae656613e28b5aaf5880c5dad529316270 | [
"Unlicense",
"MIT"
] | 2 | 2019-09-07T17:00:26.000Z | 2020-08-05T02:08:35.000Z | src/templates/template.py | cbarnson/UVa | 0dd73fae656613e28b5aaf5880c5dad529316270 | [
"Unlicense",
"MIT"
] | null | null | null | src/templates/template.py | cbarnson/UVa | 0dd73fae656613e28b5aaf5880c5dad529316270 | [
"Unlicense",
"MIT"
] | null | null | null |
def Main():
x = input()
if __name__ == '__main__':
Main() | 11.333333 | 27 | 0.514706 |
39ee878cd77f69b10b2c882544839ecc3a4ef533 | 2,025 | py | Python | test/test_npu/test_network_ops/test_nms_with_mask.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_nms_with_mask.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_nms_with_mask.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... | 38.942308 | 95 | 0.713086 |
f24059b8c7897f13452df233a8415284eb8411aa | 1,601 | py | Python | posts/admin.py | alien3211/lom-web | c7971238b0dd043854c911a0b9126b84d7deed4a | [
"MIT"
] | null | null | null | posts/admin.py | alien3211/lom-web | c7971238b0dd043854c911a0b9126b84d7deed4a | [
"MIT"
] | null | null | null | posts/admin.py | alien3211/lom-web | c7971238b0dd043854c911a0b9126b84d7deed4a | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Post, Category
from categories.admin import CategoryBaseAdmin, CategoryBaseAdminForm
from django.utils.translation import ugettext_lazy as _
# Register your models here.
class PostAdmin(admin.ModelAdmin):
list_display = ('title', 'slug', 'author', 'publish', 's... | 32.673469 | 79 | 0.618988 |
d9a6093e3cd1f9b199df0737a081134828e194a2 | 16,485 | py | Python | huTools/structured.py | gadventures/huTools | 8bc58d63491bcd3cfc3e78d219be703d943ffeb5 | [
"BSD-3-Clause"
] | null | null | null | huTools/structured.py | gadventures/huTools | 8bc58d63491bcd3cfc3e78d219be703d943ffeb5 | [
"BSD-3-Clause"
] | null | null | null | huTools/structured.py | gadventures/huTools | 8bc58d63491bcd3cfc3e78d219be703d943ffeb5 | [
"BSD-3-Clause"
] | null | null | null | # encoding: utf-8
"""
structured.py - handle structured data/dicts/objects
Created by Maximillian Dornseif on 2009-12-27.
Copyright (c) 2009-2011, 2015 HUDORA. All rights reserved.
"""
from __future__ import print_function
from __future__ import absolute_import
from __future__ import unicode_literals
from future impor... | 32.643564 | 108 | 0.596906 |
8a11c92ec66e930c0597171f36f6cf5fa7e8a56a | 248 | py | Python | src/server/app/models/Subtask.py | MatthiasRiener/DigiPen | 9b4aff4a1c431e06d73733dc3dd3f3f3d4631704 | [
"MIT"
] | 6 | 2020-12-15T18:57:53.000Z | 2022-02-06T18:54:35.000Z | src/server/app/models/Subtask.py | MatthiasRiener/DigiPen | 9b4aff4a1c431e06d73733dc3dd3f3f3d4631704 | [
"MIT"
] | 186 | 2020-11-17T10:18:17.000Z | 2022-03-02T07:19:22.000Z | src/server/app/models/Subtask.py | MatthiasRiener/DigiPen | 9b4aff4a1c431e06d73733dc3dd3f3f3d4631704 | [
"MIT"
] | 1 | 2020-12-14T19:37:30.000Z | 2020-12-14T19:37:30.000Z | from ..db.settings import db
class SubTask(db.Document):
sub_id = db.StringField(primary_key=True, required=True)
parent_id = db.StringField(required=True)
name= db.StringField(required=True)
status = db.BooleanField(default=False) | 35.428571 | 60 | 0.745968 |
76d2b32ae8918d389e10f8d79bde5a3bb5a0f8a8 | 810 | py | Python | Sorting/algos/radix.py | CandleStein/VAlg | 43aecdd351954d316f132793cf069b70bf2e5cc2 | [
"MIT"
] | null | null | null | Sorting/algos/radix.py | CandleStein/VAlg | 43aecdd351954d316f132793cf069b70bf2e5cc2 | [
"MIT"
] | null | null | null | Sorting/algos/radix.py | CandleStein/VAlg | 43aecdd351954d316f132793cf069b70bf2e5cc2 | [
"MIT"
] | 1 | 2020-09-25T18:31:34.000Z | 2020-09-25T18:31:34.000Z | import numpy as np
import matplotlib.pyplot as plt
def countingsort(arr, exp):
n = len(arr)
output = [0] * len(arr)
count = [0] * 10
for i in range(0, n):
idx = int(arr[i] / exp) % 10
count[idx] += 1
for i in range(1, 10):
count[i] += count[i - 1]
i = n - 1
whil... | 20.25 | 42 | 0.497531 |
6a8c45087c58287887bc86816056ce5c7052ac73 | 366 | py | Python | ___Python/Marco/PythonProj/p03_lambda/m02_filtern.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | ___Python/Marco/PythonProj/p03_lambda/m02_filtern.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | ___Python/Marco/PythonProj/p03_lambda/m02_filtern.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | celsius_temperaturen = (0.7 , 2.1, 4.2, 8.2, 12.5, 15.6, 16.9, 16.3, 13.6, 9.5, 4.6, 2.3)#Durchschnittstemeraturen Bielefeld nach Jahren
def filtern(liste, grenze):
gefiltert = []
for element in liste:
if element >= grenze:
gefiltert.append(element)
return gefiltert
print(fi... | 20.333333 | 137 | 0.614754 |
0ad2270432254f00ee9759dbe06c5a315be0f38d | 222 | py | Python | conftest.py | DangerOnTheRanger/project-panzee | 9392a3d8c4a0acbac80905e164dca91b691022ab | [
"BSD-2-Clause"
] | 5 | 2015-07-16T20:44:58.000Z | 2016-04-19T03:47:46.000Z | conftest.py | DangerOnTheRanger/project-panzee | 9392a3d8c4a0acbac80905e164dca91b691022ab | [
"BSD-2-Clause"
] | 6 | 2015-12-23T07:05:06.000Z | 2016-07-03T22:29:03.000Z | conftest.py | DangerOnTheRanger/project-panzee | 9392a3d8c4a0acbac80905e164dca91b691022ab | [
"BSD-2-Clause"
] | null | null | null | # Shim to allow py.test to run without panzee being installed inside
# the Python package directory; i.e, in-place
# This doesn't seem to work for Windows 10
import sys
import os
sys.path.append(os.path.abspath(os.pardir)) | 37 | 68 | 0.774775 |
7c1a7cc139c645355092f042237058364d07e921 | 2,059 | py | Python | Veranstaltungen/migrations/0006_auto_20170510_0046.py | wmles/scholarium.at | d2356b3e475df772382e035ddcb839fc7dae4305 | [
"MIT"
] | 1 | 2017-07-24T10:19:36.000Z | 2017-07-24T10:19:36.000Z | Veranstaltungen/migrations/0006_auto_20170510_0046.py | wmles/scholarium.at | d2356b3e475df772382e035ddcb839fc7dae4305 | [
"MIT"
] | 9 | 2017-07-26T14:16:08.000Z | 2022-03-11T23:14:40.000Z | Veranstaltungen/migrations/0006_auto_20170510_0046.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-09 22:46
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('Veranstaltungen', '0005_auto_20170509_1521'),
]
operations = [
migrations.R... | 30.279412 | 66 | 0.57018 |
7c7be76f69b39d7b9803638e59bb7c7036303f2c | 782 | py | Python | code/XJV-Viewer.py | digidigital/XJustiz2HTMLviewer | 1c3735abd531f90e3c0d7a221acb1ca5a4a79cd3 | [
"MIT"
] | 2 | 2021-04-13T06:53:24.000Z | 2021-09-27T20:45:24.000Z | code/XJV-Viewer.py | digidigital/XJustiz2HTMLviewer | 1c3735abd531f90e3c0d7a221acb1ca5a4a79cd3 | [
"MIT"
] | null | null | null | code/XJV-Viewer.py | digidigital/XJustiz2HTMLviewer | 1c3735abd531f90e3c0d7a221acb1ca5a4a79cd3 | [
"MIT"
] | 1 | 2021-04-13T20:28:12.000Z | 2021-04-13T20:28:12.000Z | #!/usr/bin/python3
# coding: utf-8
import webbrowser
import lxml.etree as ET
inputfile = "./XJustiz-Testdaten/Beispiel_synthetisch2.xml"
#inputfile = "./XJustiz-Testdaten/Beispiel_synthetisch1.xml"
#inputfile = "./XJustiz-Testdaten/xjustiz_nachricht_aaz_v3_2.xml"
#inputfile = "./XJustiz-Testdaten/xjustiz_nachricht_v... | 27.928571 | 65 | 0.754476 |
863b60d370b8d7d16875031b685c772b97286f43 | 1,416 | py | Python | exam_recipes/exam_recipes/web/views.py | trenev/softuni-python-web-basics | 0fcf6b7f3389d06685d40615c376dc4027e772f2 | [
"MIT"
] | 1 | 2022-03-03T10:16:14.000Z | 2022-03-03T10:16:14.000Z | exam_recipes/exam_recipes/web/views.py | trenev/softuni-python-web-basics | 0fcf6b7f3389d06685d40615c376dc4027e772f2 | [
"MIT"
] | null | null | null | exam_recipes/exam_recipes/web/views.py | trenev/softuni-python-web-basics | 0fcf6b7f3389d06685d40615c376dc4027e772f2 | [
"MIT"
] | null | null | null | from django.shortcuts import render, redirect
from exam_recipes.web.forms import RecipeForm, DeleteForm
from exam_recipes.web.models import Recipe
def get_all_recipes():
return Recipe.objects.all()
def get_recipe(pk):
return Recipe.objects.get(pk=pk)
def show_home(request):
context = {
'recip... | 23.213115 | 85 | 0.673729 |
86466641d5000cc8cf908bf1217f5603c7621da7 | 6,417 | py | Python | 20-hs-redez-sem/groups/04-secureTeams/feed.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 8 | 2020-03-17T21:12:18.000Z | 2021-12-12T15:55:54.000Z | 20-hs-redez-sem/groups/04-secureTeams/feed.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 2 | 2021-07-19T06:18:43.000Z | 2022-02-10T12:17:58.000Z | 20-hs-redez-sem/groups/04-secureTeams/feed.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 25 | 2020-03-20T09:32:45.000Z | 2021-07-18T18:12:59.000Z | #!/usr/bin/env python3
# lib/feed.py
# Jan-Mar 2020 <christian.tschudin@unibas.ch>
import cbor2
import os
import crypto
import event
import pcap
class FEED:
def __init__(self, fname, fid=None, signer=None,
create_if_notexisting=False,
digestmod = 'sha256'):
self.fname... | 31.610837 | 92 | 0.525168 |
866a91e388bc727f6f1aae53bb6afb6004684ea9 | 2,735 | py | Python | python/oneflow/compatible/single_client/test/ops/test_cpu_only_user_op.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/test/ops/test_cpu_only_user_op.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/test/ops/test_cpu_only_user_op.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... | 32.951807 | 88 | 0.731261 |
d4a72eac7a6b6de21ebb26d1e968cd78b9060d22 | 2,019 | py | Python | pkg/build/builder/ansible/sitecustomize.py | kayanme/werf | 655dbdc5f5ddba6e604274d29ee3d885ed79559e | [
"Apache-2.0"
] | 1,426 | 2020-06-05T13:43:08.000Z | 2022-03-31T19:58:57.000Z | pkg/build/builder/ansible/sitecustomize.py | kayanme/werf | 655dbdc5f5ddba6e604274d29ee3d885ed79559e | [
"Apache-2.0"
] | 1,053 | 2020-06-17T14:58:08.000Z | 2022-03-31T15:44:52.000Z | pkg/build/builder/ansible/sitecustomize.py | kayanme/werf | 655dbdc5f5ddba6e604274d29ee3d885ed79559e | [
"Apache-2.0"
] | 84 | 2020-06-05T14:28:46.000Z | 2022-03-29T22:42:05.000Z | from werf.tee_popen import TeePopen
import sys, re
import os
# __del__ is called when python assigns real arguments into sys.argv
class IsAnsiballZ(object):
ansiballz_re = re.compile(r'/AnsiballZ.*\.py$')
def __del__(self):
if len(sys.argv) > 0:
if self.ansiballz_re.search(sys.argv[0]):
... | 33.098361 | 83 | 0.685488 |
9c7d567f901c37f4b4c10bcf521b6983fd06dbc4 | 23,173 | py | Python | src/main/python/tpms/tpms.py | BikeAtor/WoMoAtor | 700cc8b970dcfdd5af2f471df1a223d2a38cb1bf | [
"Apache-2.0"
] | null | null | null | src/main/python/tpms/tpms.py | BikeAtor/WoMoAtor | 700cc8b970dcfdd5af2f471df1a223d2a38cb1bf | [
"Apache-2.0"
] | null | null | null | src/main/python/tpms/tpms.py | BikeAtor/WoMoAtor | 700cc8b970dcfdd5af2f471df1a223d2a38cb1bf | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
import sys
sys.path.append('lib')
import os
import logging
import threading
import subprocess
import time
import json
import traceback
# GUI
import tkinter as tk
import tkinter.font as tkFont
import cairosvg
import io
from PIL import Image, ImageTk
class TPMSData:
id = None
pressure =... | 44.908915 | 189 | 0.488068 |
138f6c109187613ff10a4728b41dee8b21443c12 | 10,833 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/storage/hpe3par/test_ss_3par_cpg.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/storage/hpe3par/test_ss_3par_cpg.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/storage/hpe3par/test_ss_3par_cpg.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | # Copyright: (c) 2018, Hewlett Packard Enterprise Development LP
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
import mock
import sys
sys.modules['hpe3par_sdk'] = mock.Mock()
sys.modules['hpe3par_sdk.client'] = mock.Mock()
sys.modules['hpe3parclient'] = mock.Mock()
sys... | 43.8583 | 116 | 0.606203 |
b99abf2ad2761b1b22c1553f9c3edd01139360b7 | 2,288 | py | Python | Library/Logger.py | rccannizzaro/QC-StrategyBacktest | 847dbd61680466bc60ce7893eced8a8f70d16b2e | [
"Apache-2.0"
] | 11 | 2021-12-02T15:41:47.000Z | 2022-03-14T03:49:22.000Z | Library/Logger.py | ikamanu/QC-StrategyBacktest | 847dbd61680466bc60ce7893eced8a8f70d16b2e | [
"Apache-2.0"
] | null | null | null | Library/Logger.py | ikamanu/QC-StrategyBacktest | 847dbd61680466bc60ce7893eced8a8f70d16b2e | [
"Apache-2.0"
] | 5 | 2022-02-02T12:07:51.000Z | 2022-02-13T02:24:19.000Z | ########################################################################################
# #
# Licensed under the Apache License, Version 2.0 (the "License"); #
# you may not use this file except in compliance with... | 38.779661 | 94 | 0.435752 |
e0193dc1ee3a9f5681fdf7a0ff01ec3757aeba23 | 128 | py | Python | 20-fs-ias-lec/groups/05-loraLink/src/old/V12/main.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 8 | 2020-03-17T21:12:18.000Z | 2021-12-12T15:55:54.000Z | 20-fs-ias-lec/groups/05-loraLink/src/old/V12/main.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 2 | 2021-07-19T06:18:43.000Z | 2022-02-10T12:17:58.000Z | 20-fs-ias-lec/groups/05-loraLink/src/old/V12/main.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 25 | 2020-03-20T09:32:45.000Z | 2021-07-18T18:12:59.000Z | from lora_app_layer import Lora_App
lora_App = Lora_App()
#from lora_network_layer import Gossip
#gossip = Gossip()
| 14.222222 | 39 | 0.734375 |
0eb35976cbb6fd9a5b565017c6f829cd219e0a4d | 618 | py | Python | lang-python/basics/04-conditions/conditions.py | xd23fe39/technical-notes | bb6348705a95db24d07b1081b1aa0265dda131ce | [
"MIT"
] | null | null | null | lang-python/basics/04-conditions/conditions.py | xd23fe39/technical-notes | bb6348705a95db24d07b1081b1aa0265dda131ce | [
"MIT"
] | null | null | null | lang-python/basics/04-conditions/conditions.py | xd23fe39/technical-notes | bb6348705a95db24d07b1081b1aa0265dda131ce | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
# Einfache Kontrollstrukturen
# for ... range() und if ... else Kontrollstrukturen
# Variable für Summenbildung
sum = 0
# Wiederholung/Loop: hier wird mittels range() eine Zählerschleife implementiert
for i in range(0,5):
print("for i in range(start, end): %i " %... | 24.72 | 80 | 0.558252 |
16bec0b1231d9d046f1af7f514986640c0d27ec2 | 4,607 | py | Python | python_experiments/data_analysis/vldbj_data_parsing/varying_delta_statistics.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | 8 | 2020-04-14T23:17:00.000Z | 2021-06-21T12:34:04.000Z | python_experiments/data_analysis/vldbj_data_parsing/varying_delta_statistics.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | null | null | null | python_experiments/data_analysis/vldbj_data_parsing/varying_delta_statistics.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | 1 | 2021-01-17T16:26:50.000Z | 2021-01-17T16:26:50.000Z | import os, json
from data_analysis.vldbj_data_parsing.probesim_querying_time_statistics import probesim_tag
bprw_tag = 'bprw'
flpmc_tag = 'flpmc'
bflpmc_tag = 'bflpmc'
sling_tag = 'sling'
tsf_tag = 'tsf'
flp_tag = "full local push"
delta_lst = list(reversed([10 ** (-(i + 1)) for i in range(9)]))
def get_file_path(... | 38.714286 | 119 | 0.659431 |
d5ee966ca7fdacb64697ef8e310307dad2c133ce | 681 | py | Python | weibo/login/testMain.py | haiboz/weiboSpider | 517cae2ef3e7bccd9e1d328a40965406707f5362 | [
"Apache-2.0"
] | null | null | null | weibo/login/testMain.py | haiboz/weiboSpider | 517cae2ef3e7bccd9e1d328a40965406707f5362 | [
"Apache-2.0"
] | null | null | null | weibo/login/testMain.py | haiboz/weiboSpider | 517cae2ef3e7bccd9e1d328a40965406707f5362 | [
"Apache-2.0"
] | null | null | null | #encoding:utf8
'''
Created on 2016年4月11日
@author: wb-zhaohaibo
'''
import spynner
if __name__ == '__main__':
browser = spynner.Browser()
#创建一个浏览器对象
browser.hide()
#打开浏览器,并隐藏。
browser.load("http://www.weather.com.cn/weather/101070105.shtml")
#brow... | 21.967742 | 81 | 0.591777 |
e6e0d5338b77bd2297127b1a92b478cf2f075109 | 12,868 | py | Python | modules/random_search_v2.py | J0nasW/Bachelorarbeit | 37052be075713f2016d42782397ff875e3e982f8 | [
"MIT"
] | null | null | null | modules/random_search_v2.py | J0nasW/Bachelorarbeit | 37052be075713f2016d42782397ff875e3e982f8 | [
"MIT"
] | null | null | null | modules/random_search_v2.py | J0nasW/Bachelorarbeit | 37052be075713f2016d42782397ff875e3e982f8 | [
"MIT"
] | null | null | null | """
RL MODULE WITH RANDOM SEARCH
CALL BY: <random_search_v2.py>
RETURN: Parameter Matrices for the inverted Pendulum Problem
Stores Data of best Parameters in '<date>_rs2_v2_<reward>.hkl'
INFO: V2 with improved loading times and better simulation performance
"""
# Some dependencies
import o... | 43.918089 | 165 | 0.563879 |
e6fadbdd5c8fbcd04782d054fbf1dcd27f2c3160 | 528 | py | Python | exercises/es/exc_03_09_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/es/exc_03_09_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/es/exc_03_09_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | from spacy.lang.es import Spanish
from spacy.tokens import Token
nlp = Spanish()
# Define la función getter que toma un token y devuelve su texto al revés
def get_reversed(token):
return token.text[::-1]
# Registra la extensión de propiedad del Token, "reversed", con
# el getter get_reversed
____.____(____, ___... | 26.4 | 73 | 0.746212 |
fc3ebe0d57850d3a13f5e5d838afa5610ff1e442 | 3,156 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/onyx_lldp.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/onyx_lldp.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/onyx_lldp.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'],
... | 26.974359 | 103 | 0.647972 |
5d175c5c66a970c61e9f7ee8449edc6f1c20edf2 | 1,543 | py | Python | conf.py | Salomens/salomens.github.io | 69b89d2f4781971d898b1ff79019763f98286709 | [
"MIT"
] | 1 | 2022-01-17T02:19:14.000Z | 2022-01-17T02:19:14.000Z | conf.py | Salomens/salomens.github.io | 69b89d2f4781971d898b1ff79019763f98286709 | [
"MIT"
] | 4 | 2022-01-14T08:43:09.000Z | 2022-03-16T07:38:19.000Z | conf.py | Salomens/blog | 69b89d2f4781971d898b1ff79019763f98286709 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""博客构建配置文件
"""
# For Maverick
site_prefix = "/"
source_dir = "../src/"
build_dir = "../dist/"
index_page_size = 10
archives_page_size = 20
template = {
"name": "Galileo",
"type": "local",
"path": "../Galileo"
}
enable_jsdelivr = {
"enabled": False,
"repo": ... | 20.038961 | 57 | 0.49838 |
5395f0ee8b33ff40f6eff3fa9968251106c9dac4 | 43,175 | py | Python | hihope_neptune-oh_hid/00_src/v0.1/test/xdevice/src/xdevice/_core/driver/drivers_lite.py | dawmlight/vendor_oh_fun | bc9fb50920f06cd4c27399f60076f5793043c77d | [
"Apache-2.0"
] | 1 | 2022-02-15T08:51:55.000Z | 2022-02-15T08:51:55.000Z | hihope_neptune-oh_hid/00_src/v0.3/test/xdevice/src/xdevice/_core/driver/drivers_lite.py | dawmlight/vendor_oh_fun | bc9fb50920f06cd4c27399f60076f5793043c77d | [
"Apache-2.0"
] | null | null | null | hihope_neptune-oh_hid/00_src/v0.3/test/xdevice/src/xdevice/_core/driver/drivers_lite.py | dawmlight/vendor_oh_fun | bc9fb50920f06cd4c27399f60076f5793043c77d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# coding=utf-8
#
# Copyright (c) 2020-2021 Huawei Device 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
#
#... | 42.286974 | 79 | 0.577186 |
ab05b5e3143b865678816238d1901367e52e6fbf | 1,809 | py | Python | build.py | xusiwei/bearpi-hm_nano | 3ee5b0f9097b19dae89713908500b8dd855c4238 | [
"Apache-2.0"
] | 1 | 2022-02-15T08:51:55.000Z | 2022-02-15T08:51:55.000Z | hihope_neptune-oh_hid/00_src/v0.3/build.py | dawmlight/vendor_oh_fun | bc9fb50920f06cd4c27399f60076f5793043c77d | [
"Apache-2.0"
] | null | null | null | hihope_neptune-oh_hid/00_src/v0.3/build.py | dawmlight/vendor_oh_fun | bc9fb50920f06cd4c27399f60076f5793043c77d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2020 Huawei Device 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
... | 26.217391 | 74 | 0.636816 |
dba1831b6d4339b67001b85f2045942379a6ae8f | 2,503 | py | Python | kollektiv5gui/util/config.py | MateRyze/InformatiCup-2019 | eeca3ff7f8a102f4093697c6badee21ce25e2e87 | [
"MIT"
] | 3 | 2019-03-21T17:02:55.000Z | 2019-04-04T18:16:10.000Z | kollektiv5gui/util/config.py | MateRyze/InformatiCup-2019 | eeca3ff7f8a102f4093697c6badee21ce25e2e87 | [
"MIT"
] | 11 | 2019-10-30T12:05:39.000Z | 2022-03-11T23:43:54.000Z | kollektiv5gui/util/config.py | MateRyze/InformatiCup-2019 | eeca3ff7f8a102f4093697c6badee21ce25e2e87 | [
"MIT"
] | 1 | 2019-10-30T12:04:00.000Z | 2019-10-30T12:04:00.000Z | import os
import shutil
import configparser
from kollektiv5gui.util.paths import getResourcePath
__DEFAULT_CONFIG_FILENAME = os.path.join(getResourcePath(), 'default.ini')
__USER_CONFIG_FILENAME = os.path.expanduser('~/.kollektiv5.ini')
__DEFAULT_CONFIG = None
__CONFIG = None
def __loadConfig():
"""
Load an ... | 30.52439 | 74 | 0.693568 |
5304515bfe95f847b361f608c0201c2345ec1eef | 9,372 | py | Python | deprecated/benchmark/ps/distribute_word2vec/tensorflow/word2vec_distribute.py | hutuxian/FleetX | 843c7aa33f5a14680becf058a3aaf0327eefafd4 | [
"Apache-2.0"
] | 170 | 2020-08-12T12:07:01.000Z | 2022-03-07T02:38:26.000Z | deprecated/benchmark/ps/distribute_word2vec/tensorflow/word2vec_distribute.py | hutuxian/FleetX | 843c7aa33f5a14680becf058a3aaf0327eefafd4 | [
"Apache-2.0"
] | 195 | 2020-08-13T03:22:15.000Z | 2022-03-30T07:40:25.000Z | deprecated/benchmark/ps/distribute_word2vec/tensorflow/word2vec_distribute.py | hutuxian/FleetX | 843c7aa33f5a14680becf058a3aaf0327eefafd4 | [
"Apache-2.0"
] | 67 | 2020-08-14T02:07:46.000Z | 2022-03-28T10:05:33.000Z | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 46.167488 | 186 | 0.625267 |
725fb0c9664d06418f4da9767d1cbe5ce2aaefa8 | 240 | py | Python | Language Proficiency/Python/Itertools/itertools.combinations()/combinations.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | 1 | 2021-02-22T17:37:45.000Z | 2021-02-22T17:37:45.000Z | Language Proficiency/Python/Itertools/itertools.combinations()/combinations.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | null | null | null | Language Proficiency/Python/Itertools/itertools.combinations()/combinations.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from itertools import combinations
if __name__ == "__main__":
string, n = input().split()
n = int(n)
for i in range(n):
print("\n".join(map("".join, list(combinations(sorted(string), i+1)))))
| 18.461538 | 79 | 0.608333 |
72d66009db9e0eedaa26f3834c0d3e3607efa49a | 229 | py | Python | src/python/py-accepted/4A.py | cbarnson/UVa | 0dd73fae656613e28b5aaf5880c5dad529316270 | [
"Unlicense",
"MIT"
] | 2 | 2019-09-07T17:00:26.000Z | 2020-08-05T02:08:35.000Z | src/python/py-accepted/4A.py | cbarnson/UVa | 0dd73fae656613e28b5aaf5880c5dad529316270 | [
"Unlicense",
"MIT"
] | null | null | null | src/python/py-accepted/4A.py | cbarnson/UVa | 0dd73fae656613e28b5aaf5880c5dad529316270 | [
"Unlicense",
"MIT"
] | null | null | null | # Problem # : 4A
# Created on : 2019-01-11 22:42:54
def Main():
x = int(input())
if x > 2:
x -= 2
print('NO' if x & 1 else 'YES')
else:
print('NO')
if __name__ == '__main__':
Main()
| 16.357143 | 39 | 0.458515 |
f456087e130e34b1fd53e544f484fd920c8a0720 | 4,705 | py | Python | src/visitpy/visit_flow/flow/src/filters/npy_ops.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 226 | 2018-12-29T01:13:49.000Z | 2022-03-30T19:16:31.000Z | src/visitpy/visit_flow/flow/src/filters/npy_ops.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 5,100 | 2019-01-14T18:19:25.000Z | 2022-03-31T23:08:36.000Z | src/visitpy/visit_flow/flow/src/filters/npy_ops.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 84 | 2019-01-24T17:41:50.000Z | 2022-03-10T10:01:46.000Z | # Copyright (c) Lawrence Livermore National Security, LLC and other VisIt
# Project developers. See the top-level LICENSE file for dates and other
# details. No copyright assignment is required to contribute to VisIt.
"""
file: npy_ops.py
author: Cyrus Harrison <cyrush@llnl.gov>
created: 12/09/2011
description:
... | 27.840237 | 73 | 0.519447 |
bec2c8b521e3dacd53a39cd55f2e147ef876cc72 | 3,615 | py | Python | src/onegov/org/models/search.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/org/models/search.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/org/models/search.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from cached_property import cached_property
from elasticsearch_dsl.function import SF
from elasticsearch_dsl.query import FunctionScore
from elasticsearch_dsl.query import Match
from elasticsearch_dsl.query import MatchPhrase
from elasticsearch_dsl.query import MultiMatch
from onegov.core.collection import Pagination
... | 31.434783 | 78 | 0.643707 |
fe3e78a3e39283c4706723c82a43c58bd9f32d30 | 2,307 | py | Python | simple-sklearn-demo/test7/irisTest3.py | crackedcd/Intern.MT | 36398837af377a7e1c4edd7cbb15eabecd2c3103 | [
"MIT"
] | 1 | 2019-07-05T03:42:17.000Z | 2019-07-05T03:42:17.000Z | simple-sklearn-demo/test7/irisTest3.py | crackedcd/Intern.MT | 36398837af377a7e1c4edd7cbb15eabecd2c3103 | [
"MIT"
] | null | null | null | simple-sklearn-demo/test7/irisTest3.py | crackedcd/Intern.MT | 36398837af377a7e1c4edd7cbb15eabecd2c3103 | [
"MIT"
] | 1 | 2019-06-24T05:56:55.000Z | 2019-06-24T05:56:55.000Z | """
信息的定义: 消除随机不确定性
信息熵: 消除不确定性的程度的大小, 单位bit, 当测量的是抛硬币形式的两种等概率事件时, 测量的信息量是1bit.
类似于质量, 当我们知道质量的标准单位是1g时, 想知道某个物体A的质量m, 是看它相当于多少(n)个1g的物体,
也就是m = 1 * n, 要计算n, 则使用乘法的反函数, 得到m / 1.
同理可以简单得出结论, 因为相互独立的事件的概率是用指数方法来计算的, 例如3次抛硬币的某种结果概率应该是(1/2)^3,
所以要计算信息的"数量", 应该用指数的反函数, 也就是对数来计算.
例如4个不确定情况是几个硬币抛出的结果? 是log以2为底, 4的对数, 答案是2.
再... | 36.046875 | 117 | 0.738188 |
fe799cb8ff52be680586deadf6bdfdce422e3376 | 97 | py | Python | Python/Courses/Python-Tutorials.Zulkarnine-Mahmud/01.Object-oriented-programming/16-PlainClass.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Courses/Python-Tutorials.Zulkarnine-Mahmud/01.Object-oriented-programming/16-PlainClass.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Courses/Python-Tutorials.Zulkarnine-Mahmud/01.Object-oriented-programming/16-PlainClass.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | class PlainClass:
pass
abc = PlainClass()
abc.age = 18
abc.name = "shihab"
print(abc.age)
| 9.7 | 19 | 0.659794 |
a3c02ce83ff87e28066797d657936bb7a9da715c | 1,166 | py | Python | wz/local/attendance_config.py | gradgrind/WZ | 672d93a3c9d7806194d16d6d5b9175e4046bd068 | [
"Apache-2.0"
] | null | null | null | wz/local/attendance_config.py | gradgrind/WZ | 672d93a3c9d7806194d16d6d5b9175e4046bd068 | [
"Apache-2.0"
] | null | null | null | wz/local/attendance_config.py | gradgrind/WZ | 672d93a3c9d7806194d16d6d5b9175e4046bd068 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
local/attendance_config.py
Last updated: 2021-03-19
Configuration items for attendance tables.
===========================================
"""
# In RESOURCES/templates:
TEMPLATE = 'Vorlage_Klassenbuch' # .xlsx
# Tabellentitle der Seite für Notizen (Klassenfahrten, Auslandsaufenthalt... | 26.5 | 81 | 0.749571 |
4a96fa66325f63f73289fe5a1ccbdd551c24cc65 | 6,303 | py | Python | files/meas/Experiment_03/diff/gain.py | mimeiners/ans | 382e000e687d5ec0c80a84223087e60ed656a1dd | [
"MIT"
] | null | null | null | files/meas/Experiment_03/diff/gain.py | mimeiners/ans | 382e000e687d5ec0c80a84223087e60ed656a1dd | [
"MIT"
] | null | null | null | files/meas/Experiment_03/diff/gain.py | mimeiners/ans | 382e000e687d5ec0c80a84223087e60ed656a1dd | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Fri May 21 10:10:10 2021
@author: © Vadim Grebnev, Tim Hilker, Delphino Klinker
"""
import ltspice
import matplotlib.pyplot as plt
import matplotlib.ticker as mplt
from scipy.optimize import leastsq
import numpy as np
import redpitaya_scpi as scpi
from time import sleep as dela... | 36.433526 | 77 | 0.625416 |
434daf47bd910b92b3c06710a68761e952c9fbf7 | 441 | py | Python | src/util/constants.py | blitzher/Starbot | 90da81f3beac74cd4394c2d8e18d9c67d6819b16 | [
"MIT"
] | null | null | null | src/util/constants.py | blitzher/Starbot | 90da81f3beac74cd4394c2d8e18d9c67d6819b16 | [
"MIT"
] | null | null | null | src/util/constants.py | blitzher/Starbot | 90da81f3beac74cd4394c2d8e18d9c67d6819b16 | [
"MIT"
] | null | null | null | import numpy as np
class Const:
def __init__(self):
self.car_height = 50
self.ball_radius = 92.75
self.side_wall = 4096
self.back_wall = 5120
self.ceiling = 2044
self.map = np.array((self.side_wall, self.back_wall, self.ceiling))
self.goal_height = 642
... | 22.05 | 75 | 0.605442 |
60ce829ce1f8936d443931dbb14c68f987b617ce | 1,132 | py | Python | hello/hello_ml/tool.py | East196/hello-py | a77c7a0c8e5e2b5e8cefaf0fda335ab0c3b1da21 | [
"Apache-2.0"
] | 1 | 2017-10-23T14:58:47.000Z | 2017-10-23T14:58:47.000Z | hello/hello_ml/tool.py | East196/hello-py | a77c7a0c8e5e2b5e8cefaf0fda335ab0c3b1da21 | [
"Apache-2.0"
] | null | null | null | hello/hello_ml/tool.py | East196/hello-py | a77c7a0c8e5e2b5e8cefaf0fda335ab0c3b1da21 | [
"Apache-2.0"
] | 1 | 2018-04-06T07:49:18.000Z | 2018-04-06T07:49:18.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import codecs
import matplotlib.pyplot as plt
from scipy.misc import imread
from wordcloud import WordCloud
back_coloring = imread("nlp/mask.jpg")
wordcloud = WordCloud(font_path='nlp/文泉驿微米黑.ttf', background_color="white", mask=back_coloring)
def show_wordcloud(data):
... | 21.358491 | 95 | 0.606007 |
714a48a786de065ff1da761634dcfcc63e6dfa7b | 205 | py | Python | Online-Judges/DimikOJ/Python/23-number-from-alphabet.py | shihab4t/Competitive-Programming | e8eec7d4f7d86bfa1c00b7fbbedfd6a1518f19be | [
"Unlicense"
] | 3 | 2021-06-15T01:19:23.000Z | 2022-03-16T18:23:53.000Z | Online-Judges/DimikOJ/Python/23-number-from-alphabet.py | shihab4t/Competitive-Programming | e8eec7d4f7d86bfa1c00b7fbbedfd6a1518f19be | [
"Unlicense"
] | null | null | null | Online-Judges/DimikOJ/Python/23-number-from-alphabet.py | shihab4t/Competitive-Programming | e8eec7d4f7d86bfa1c00b7fbbedfd6a1518f19be | [
"Unlicense"
] | null | null | null | for _ in range(int(input())):
alphaber_str = input()
#print(ord("A"), ord("Z"))
number = ""
for i in alphaber_str:
temp = ord(i) - 64
number += str(temp)
print(number)
| 20.5 | 30 | 0.521951 |
71ca1c48561de617fa7a17b66c37e23d8c38dac4 | 1,645 | py | Python | src/util/genpriority.py | CorvusPrudens/Corisc | e30abde099dc3c1979c2f7d7ff6d37f7d990f852 | [
"MIT"
] | null | null | null | src/util/genpriority.py | CorvusPrudens/Corisc | e30abde099dc3c1979c2f7d7ff6d37f7d990f852 | [
"MIT"
] | null | null | null | src/util/genpriority.py | CorvusPrudens/Corisc | e30abde099dc3c1979c2f7d7ff6d37f7d990f852 | [
"MIT"
] | null | null | null | import os
template = " wire [{size}:0] {vector};"
bit_template = " assign {vector}[{index}] = {src}[{index}] & ~({sources_less});"
def genpriority(vector, size, src, target, line):
out =[template.format_map({'vector': vector, 'size': size-1})]
out.append(f' assign {vector}[0] = {src}[0];')
for i in range(1... | 33.571429 | 121 | 0.618237 |
e07e28f59fe71bdca94942e2b5c3699b5583c73d | 1,921 | py | Python | leetcode/051-N-Queens/NQueens_002.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2015-12-16T04:01:03.000Z | 2015-12-16T04:01:03.000Z | leetcode/051-N-Queens/NQueens_002.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | leetcode/051-N-Queens/NQueens_002.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | # I just use a tricky technique here
# Improved from 3.10% to 14.34 %
# Far from perfect, however, better
# {Leetcode : AC, Lintcode : AC}
# Based on the 001 version, and make use of the SYMMETRY of this problem
class Solution(object):
def solveNQueens(self, n):
"""
:type n: int
:rtype: Lis... | 28.671642 | 78 | 0.414368 |
e0aa39c50e78f348b65e2b908e7c1e7bd8f07134 | 2,311 | py | Python | solutions/Textsys/Milvus-bert-server/src/pg_operating.py | naetimus/bootcamp | 0182992df7c54012944b51fe9b70532ab6a0059b | [
"Apache-2.0"
] | 1 | 2021-01-11T18:40:22.000Z | 2021-01-11T18:40:22.000Z | solutions/Textsys/Milvus-bert-server/src/pg_operating.py | naetimus/bootcamp | 0182992df7c54012944b51fe9b70532ab6a0059b | [
"Apache-2.0"
] | null | null | null | solutions/Textsys/Milvus-bert-server/src/pg_operating.py | naetimus/bootcamp | 0182992df7c54012944b51fe9b70532ab6a0059b | [
"Apache-2.0"
] | 2 | 2021-06-14T23:50:25.000Z | 2021-06-21T10:30:34.000Z | import os
import time
import psycopg2
import numpy as np
import sys
def connect_postgres_server(PG_HOST, PG_PORT, PG_USER, PG_PASSWORD, PG_DATABASE):
try:
conn = psycopg2.connect(host=PG_HOST, port=PG_PORT, user=PG_USER, password=PG_PASSWORD, database=PG_DATABASE)
return conn
except:
... | 29.253165 | 117 | 0.58849 |
1c2e2463dffc444c3ccdc2e39b33c19f6d840870 | 1,604 | py | Python | official/nlp/mass/mindspore_hub_conf.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | official/nlp/mass/mindspore_hub_conf.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | official/nlp/mass/mindspore_hub_conf.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2020-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 agre... | 41.128205 | 88 | 0.698254 |
1c41ec8e80bab40b9157f039fb6c7beb59ca8cd6 | 468 | py | Python | frappe-bench/apps/erpnext/erpnext/patches/v7_0/update_prevdoc_values_for_supplier_quotation_item.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v7_0/update_prevdoc_values_for_supplier_quotation_item.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v7_0/update_prevdoc_values_for_supplier_quotation_item.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | import frappe
def execute():
frappe.reload_doctype('Supplier Quotation Item')
for data in frappe.db.sql(""" select prevdoc_docname, prevdoc_detail_docname, name
from `tabSupplier Quotation Item` where prevdoc_docname is not null""", as_dict=True):
frappe.db.set_value("Supplier Quotation Item", data.name, "materi... | 58.5 | 113 | 0.794872 |
1c480d61ea3390831e6d2b87dc17df6cf61992b3 | 3,911 | py | Python | tapia/exercise5/ex5.py | appfs/appfs | 8cbbfa0e40e4d4a75a498ce8dd894bb2fbc3a9e3 | [
"MIT"
] | 11 | 2017-04-21T11:39:55.000Z | 2022-02-11T20:25:18.000Z | tapia/exercise5/ex5.py | appfs/appfs | 8cbbfa0e40e4d4a75a498ce8dd894bb2fbc3a9e3 | [
"MIT"
] | 69 | 2017-04-26T09:30:38.000Z | 2017-08-01T11:31:21.000Z | tapia/exercise5/ex5.py | appfs/appfs | 8cbbfa0e40e4d4a75a498ce8dd894bb2fbc3a9e3 | [
"MIT"
] | 53 | 2017-04-20T16:16:11.000Z | 2017-07-19T12:53:01.000Z | import sys
import networkx as nx
def is_valid(line):
"""
Checks if the content of an edge has a valid format.
<vertex vertex weight>
:param line: A line of the input text.
:type: String
:return: A list if edge is valid, None otherwise.
"""
edge = line.rsplit()
wrong_args_number =... | 26.605442 | 106 | 0.639223 |
1c6f99a73ab0b4f1341f4aa93255ee0b8c37e81f | 317 | py | Python | src/onegov/swissvotes/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/swissvotes/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/swissvotes/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | import logging
from translationstring import TranslationStringFactory
log = logging.getLogger('onegov.swissvotes')
log.addHandler(logging.NullHandler())
_ = TranslationStringFactory('onegov.swissvotes')
from onegov.swissvotes.app import SwissvotesApp # noqa
__all__ = (
'_',
'log',
'SwissvotesApp'
)
| 19.8125 | 55 | 0.760252 |
c7a5a8c50e8bc8b69019a21858905eaa2ba9637f | 1,599 | py | Python | autorequester.py | Lyceoth/DataEngineeringProject | bc3c230a23eb5f3e8d7dd5322e3b22995801dc29 | [
"Apache-2.0"
] | null | null | null | autorequester.py | Lyceoth/DataEngineeringProject | bc3c230a23eb5f3e8d7dd5322e3b22995801dc29 | [
"Apache-2.0"
] | null | null | null | autorequester.py | Lyceoth/DataEngineeringProject | bc3c230a23eb5f3e8d7dd5322e3b22995801dc29 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python3
from argparse import ArgumentParser
import requests
import time
import random
import sys
player_dist = {
10243: {"chance": 4, "count": 0}, # Thomas Mueller
6556: {"chance": 3, "count": 0}, # Manuel Neuer
9039: {"chance": 2, "count": 0}, # Robert Lewandowski
5145: {"chance": 1, "co... | 33.3125 | 112 | 0.641651 |
c7abe9ba4c980d079cd63df1c199bacae6bc441e | 1,252 | py | Python | Co-Simulation/Sumo/sumo-1.7.0/tools/sumolib/color.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | 4 | 2020-11-13T02:35:56.000Z | 2021-03-29T20:15:54.000Z | sumolib/color.py | KhalidHALBA-GR-NIST/UCEFSUMOV2V | 4eb7ac761303a171718a10e4131184746bded9fd | [
"MIT"
] | 9 | 2020-12-09T02:12:39.000Z | 2021-02-18T00:15:28.000Z | sumolib/color.py | KhalidHALBA-GR-NIST/UCEFSUMOV2V | 4eb7ac761303a171718a10e4131184746bded9fd | [
"MIT"
] | 1 | 2020-11-20T19:31:26.000Z | 2020-11-20T19:31:26.000Z | # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
# Copyright (C) 2012-2020 German Aerospace Center (DLR) and others.
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is available at
# https://www.eclipse.org/legal/epl-2.... | 32.947368 | 77 | 0.674121 |
1be8ccc497fb8719ff985a7c399e0e58a6518653 | 2,669 | py | Python | test/test_npu/test_network_ops/test___and__.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___and__.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___and__.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2020 Huawei Technologies Co., Ltd
# 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 appl... | 41.703125 | 78 | 0.624204 |
408dd6a24b836c2565d96d3313323ed62d8bb650 | 2,518 | py | Python | src/onegov/user/auth/second_factor.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/user/auth/second_factor.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/user/auth/second_factor.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from abc import ABCMeta, abstractmethod
from onegov.core.utils import is_valid_yubikey
SECOND_FACTORS = {}
class SecondFactor(metaclass=ABCMeta):
""" Base class and registry for secondary auth factors. """
def __init_subclass__(cls, type, **kwargs):
global SECOND_FACTORS
assert type not in ... | 31.475 | 76 | 0.675139 |
40cb0fd76c62b9e5bf0a4bc84790824de5e8364f | 189 | py | Python | Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-004/pg-4.9-leap-year-another-way.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-004/pg-4.9-leap-year-another-way.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-004/pg-4.9-leap-year-another-way.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | year = input("plase enter a Year: ")
year = int(year)
if year % 400 == 0:
print("yes")
elif year % 100 == 0:
print("no")
elif year % 4 == 0:
print("yes")
else:
print("no")
| 15.75 | 36 | 0.534392 |
90f89ec0432fe525d5b338a4d0cbeb996ccb5a1f | 1,789 | py | Python | research/cv/3dcnn/src/initializer.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/3dcnn/src/initializer.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/3dcnn/src/initializer.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... | 32.527273 | 108 | 0.66853 |
46ab89d57c98f1c03a6715349913ecfa20d908da | 498 | py | Python | src/utils/io/config.py | dreaming-coder/RadarSet | c912298d0d6058c6647986524e5d95a205b51c1d | [
"MIT"
] | null | null | null | src/utils/io/config.py | dreaming-coder/RadarSet | c912298d0d6058c6647986524e5d95a205b51c1d | [
"MIT"
] | null | null | null | src/utils/io/config.py | dreaming-coder/RadarSet | c912298d0d6058c6647986524e5d95a205b51c1d | [
"MIT"
] | null | null | null | from configparser import ConfigParser
__all__ = ["ini_parse"]
from settings import rain
def ini_parse(file: str, encoding: str = "UTF-8"):
"""
:param file: ini 文件路径
:param encoding: 文件编码格式,默认UTF-8
:return: ini 的解析对象
"""
ini_reader = ConfigParser()
ini_reader.re... | 20.75 | 50 | 0.630522 |
315e4db687fa53415634c8dea22d5dc4ae3caaa9 | 441 | py | Python | leetcode/134-Gas-Station/GasStation_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2017-05-18T06:11:02.000Z | 2017-05-18T06:11:02.000Z | leetcode/134-Gas-Station/GasStation_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | leetcode/134-Gas-Station/GasStation_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | class Solution(object):
def canCompleteCircuit(self, gas, cost):
"""
:type gas: List[int]
:type cost: List[int]
:rtype: int
"""
tot, sum, start = 0, 0, 0
for i in range(len(gas)):
tot += gas[i] - cost[i]
sum += gas[i] - cost[i]
... | 25.941176 | 44 | 0.417234 |
7323f1022831fc15b73226930c8fc27d70e280e1 | 1,130 | bzl | Python | build/linter/rules.bzl | 78182648/blibli-go | 7c717cc07073ff3397397fd3c01aa93234b142e3 | [
"MIT"
] | 22 | 2019-04-27T06:44:41.000Z | 2022-02-04T16:54:14.000Z | build/linter/rules.bzl | YouthAge/blibli-go | 7c717cc07073ff3397397fd3c01aa93234b142e3 | [
"MIT"
] | null | null | null | build/linter/rules.bzl | YouthAge/blibli-go | 7c717cc07073ff3397397fd3c01aa93234b142e3 | [
"MIT"
] | 34 | 2019-05-07T08:22:27.000Z | 2022-03-25T08:14:56.000Z | load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_repository")
load("//build/linter:deps.bzl", "DEPS")
load("//build/linter:internal/linter_repositories.bzl", "linter_repositories")
def go_lint_repositories(
lang_deps = DEPS,
lang_requires = [
"com_github_alecthomas_gometalinter",
"com_g... | 34.242424 | 78 | 0.648673 |
732d28805900916bb059ba61539a56cf3293b5f8 | 1,331 | py | Python | src/visitpy/pyavt/examples/py_query.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 226 | 2018-12-29T01:13:49.000Z | 2022-03-30T19:16:31.000Z | src/visitpy/pyavt/examples/py_query.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 5,100 | 2019-01-14T18:19:25.000Z | 2022-03-31T23:08:36.000Z | src/visitpy/pyavt/examples/py_query.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 84 | 2019-01-24T17:41:50.000Z | 2022-03-10T10:01:46.000Z | # Example VisIt Python Expression
#
# Example embedded python query that calcultes the average cell value.
# (currently serial only)
#
#
# Usage:
# Load in the Query window or run with provided driver:
# visit -o path/to/rect2d.silo -nowin -cli -s visit_py_query_test.py
#
# simple cell average query
class CellAvgQue... | 35.026316 | 76 | 0.680691 |
732e4971bfcfaed691fe4e9398a1a9a7b3850628 | 7,768 | py | Python | Python/calendar-push.py | Tamwyn/Turniermanagment | 489b3169f4d73ebe3fe68158befff82bf20fa80b | [
"MIT"
] | null | null | null | Python/calendar-push.py | Tamwyn/Turniermanagment | 489b3169f4d73ebe3fe68158befff82bf20fa80b | [
"MIT"
] | null | null | null | Python/calendar-push.py | Tamwyn/Turniermanagment | 489b3169f4d73ebe3fe68158befff82bf20fa80b | [
"MIT"
] | null | null | null | #!/usr/bin/python
#coding=utf-8
#
# Copyright 2012 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unles... | 42.448087 | 166 | 0.662976 |
7dfd321e68b0926cf2b70d77ab5ef8c785679ec5 | 1,845 | py | Python | Python/zzz_training_challenge/Python_Challenge/solutions/ch05_datastructures/solutions/ex03_list_reverse.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/ch05_datastructures/solutions/ex03_list_reverse.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/ch05_datastructures/solutions/ex03_list_reverse.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | # Beispielprogramm für das Buch "Python Challenge"
#
# Copyright 2020 by Michael Inden
from ch05_datastructures.solutions.ex02_stack import Stack
def reverse(values):
result = []
for i in range(len(values) - 1, -1, -1):
result.append(values[i])
return result
def reverse_with_comprehension(va... | 23.35443 | 98 | 0.644986 |
b42898f7fa313cef6c93a2402b4456e6002b6d11 | 27,259 | py | Python | official/nlp/ernie/src/pretrain_reader.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | official/nlp/ernie/src/pretrain_reader.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | official/nlp/ernie/src/pretrain_reader.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.544728 | 115 | 0.547672 |
c304c39b9067f65206311c801c333c0bfee5d47d | 348 | py | Python | python/generator_tricks_for_systemprogrammer/recvcount.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/generator_tricks_for_systemprogrammer/recvcount.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/generator_tricks_for_systemprogrammer/recvcount.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | # recvcount.py
#
# Example of a co-routine
def recv_count():
try:
while True:
n = yield
print("T-minus", n)
except GeneratorExit:
print("Kaboom!")
if __name__ == "__main__":
r = recv_count()
r.send(None)
for i in range(5, 0, -1):
... | 15.818182 | 32 | 0.479885 |
6f11ad3488e4050ed19dd51695226111fdac2896 | 496 | py | Python | ___Python/Angela/PyKurs/p02_datenstrukturen/m03_anwendung_woerterbuecher.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | ___Python/Angela/PyKurs/p02_datenstrukturen/m03_anwendung_woerterbuecher.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | ___Python/Angela/PyKurs/p02_datenstrukturen/m03_anwendung_woerterbuecher.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | satz = "Fischers Fritze fischt frische Fische"
# 1) Haeufigkeit des Buchstaben e
# for-Schleife und Zaehler anzahl
zaehler = 0
for zeichen in satz:
if zeichen == "e":
zaehler += 1
print(zaehler)
# 2) Haeufigkeitsverteilung der Buchstaben im satz
d = {}
for zeichen in satz:
if zeichen in d... | 22.545455 | 66 | 0.637097 |
4891d73e1031b3d1ba2d885e5f13b6e8ea4702cd | 1,461 | py | Python | marsyas-vamp/marsyas/scripts/generate-unit-test-cpp-files.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | marsyas-vamp/marsyas/scripts/generate-unit-test-cpp-files.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | marsyas-vamp/marsyas/scripts/generate-unit-test-cpp-files.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
'''
Helper script to generate CxxTest runner files (xxx_runner.cpp)
from test suite header files (Testxxx.h)
in the unit test folder (src/tests/unit_tests)
using the CxxTest python script cxxtestgen.py.
Copyright 2010 Stefaan Lippens.
'''
import os
import sys
import glob
import re
import subpr... | 27.566038 | 90 | 0.685832 |
8256f3dd7b236a862f9c823f399a1f943c2fa8c2 | 20,182 | py | Python | skripte/python/lang_s/s2long-s.py | hyphenation/languages-german | 4330a0b1254e88615cb4c83e4b3dc2f0810c76d9 | [
"MIT"
] | null | null | null | skripte/python/lang_s/s2long-s.py | hyphenation/languages-german | 4330a0b1254e88615cb4c83e4b3dc2f0810c76d9 | [
"MIT"
] | null | null | null | skripte/python/lang_s/s2long-s.py | hyphenation/languages-german | 4330a0b1254e88615cb4c83e4b3dc2f0810c76d9 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf8 -*-
# :Copyright: © 2012, 2014 Günter Milde.
# :Licence: This work may be distributed and/or modified under
# the conditions of the `LaTeX Project Public License`,
# either version 1.3 of this license or (at your option)
# any later version... | 31.485179 | 108 | 0.618967 |
7d732e6e2906614080dcce030c40878a39b3359a | 811 | py | Python | dailyprogrammer/314e/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | 11 | 2019-02-08T06:54:34.000Z | 2021-08-07T18:57:39.000Z | dailyprogrammer/314e/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | 1 | 2019-05-21T08:14:10.000Z | 2019-05-21T08:14:10.000Z | dailyprogrammer/314e/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | null | null | null | import sys
def cat_cmp(x, y):
return int(x + y) - int(y + x)
def cat_range(numbers):
sorted_numbers = sorted(numbers, cmp=cat_cmp)
mn = ''.join(sorted_numbers)
mx = ''.join(reversed(sorted_numbers))
return mn, mx
def test():
cases = [
('5 56 50', '50556 56550'),
('7... | 21.918919 | 62 | 0.563502 |
c4b6b1af4b6b43acd0ad09abc61ee0ee2fd6ddaf | 5,798 | py | Python | examples/text_classification/multi_label/deploy/python/predict.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | examples/text_classification/multi_label/deploy/python/predict.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | examples/text_classification/multi_label/deploy/python/predict.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... | 41.414286 | 152 | 0.652466 |
c4d47dee5e337115b3bd4d07982078643a18b1c0 | 11,049 | py | Python | tests/onegov/org/test_cli.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/org/test_cli.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/org/test_cli.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | import os
import yaml
from click.testing import CliRunner
from datetime import datetime
from onegov.chat import MessageCollection
from onegov.core.cli.commands import cli as core_cli
from onegov.event import Event, EventCollection
from onegov.org.cli import cli
from onegov.ticket import TicketCollection
from onegov.us... | 31.659026 | 77 | 0.585483 |
4819e19ce0655469f7f8584c6f58d24762756a23 | 1,333 | py | Python | source/pkgsrc/lang/python37/patches/patch-Lib_distutils_sysconfig.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-11-20T22:46:39.000Z | 2021-11-20T22:46:39.000Z | source/pkgsrc/lang/python37/patches/patch-Lib_distutils_sysconfig.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | source/pkgsrc/lang/python37/patches/patch-Lib_distutils_sysconfig.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | $NetBSD: patch-Lib_distutils_sysconfig.py,v 1.1 2018/07/03 03:55:40 adam Exp $
Remove _multiarch from config path (differs across platforms).
Simplify _sysconfigdata to include only platform name.
--- Lib/distutils/sysconfig.py.orig 2016-12-23 02:21:19.000000000 +0000
+++ Lib/distutils/sysconfig.py
@@ -242,8 +242,6 @... | 45.965517 | 78 | 0.699175 |
485be1aca8742c6783a1b7a1e45eac9bc4f91e01 | 307 | py | Python | exercises/ja/solution_01_03_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/ja/solution_01_03_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/ja/solution_01_03_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | # 日本語クラスをインポートし、nlpオブジェクトを作成
from spacy.lang.ja import Japanese
nlp = Japanese()
# テキストを処理
doc = nlp("私はツリーカンガルーとイルカが好きです。")
# 「ツリーカンガルー」のスライスを選択
tree_kangaroos = doc[2:4]
print(tree_kangaroos.text)
# 「ツリーカンガルーとイルカ」のスライスを選択
tree_kangaroos_and_dolphins = doc[2:6]
print(tree_kangaroos_and_dolphins.text)
| 19.1875 | 39 | 0.791531 |
d208b244f20dbbe663f0873b2468cf6946365cd8 | 245 | py | Python | KnowledgeQuizTool/MillionHeroes/baiduSearch/get.py | JianmingXia/StudyTest | 66d688ad41bbce619f44359ea126ff07a923f97b | [
"MIT"
] | 26 | 2018-01-11T03:57:40.000Z | 2021-12-22T07:12:59.000Z | baiduSearch/get.py | wenxuefeng3930/MillionHeroesAssistant | c382e2685275d6b5d92d5b68fa9c515360e61f9e | [
"MIT"
] | 68 | 2020-09-05T04:22:49.000Z | 2022-03-25T18:47:08.000Z | baiduSearch/get.py | wenxuefeng3930/MillionHeroesAssistant | c382e2685275d6b5d92d5b68fa9c515360e61f9e | [
"MIT"
] | 10 | 2018-01-11T03:59:05.000Z | 2021-12-22T07:13:00.000Z | import requests
__url = 'http://www.baidu.com/s?wd=' # 搜索请求网址
def page(word):
r = requests.get(__url + word)
if r.status_code == 200: # 请求错误(不是200)处理
return r.text
else:
print(r.status_code)
return False
| 18.846154 | 46 | 0.595918 |
962fda205ed043a701da4911522aa3e02bc2f2e3 | 603 | py | Python | Tutorials/10 Days of Statistics/Day 9/multiple_linear_regression.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | 1 | 2021-02-22T17:37:45.000Z | 2021-02-22T17:37:45.000Z | Tutorials/10 Days of Statistics/Day 9/multiple_linear_regression.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | null | null | null | Tutorials/10 Days of Statistics/Day 9/multiple_linear_regression.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | null | null | null | #!/bin/python3
import numpy as np
m, n = [int(arr_i) for arr_i in input().strip().split(' ')]
X = np.ones((n, m+1))
y = np.zeros(n)
for i in range(n):
arr = [float(arr_i) for arr_i in input().strip().split(' ')]
for j in range(m):
X[i][j+1] = arr[j]
y[i] = arr[m]
print(X)
S = np.dot(X.T, X)
S_inv ... | 22.333333 | 64 | 0.537313 |
968fb33a50f3a189a70f68d75e43cdb109cc258f | 440 | py | Python | tests/onegov/swissvotes/test_views_exceptions.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/swissvotes/test_views_exceptions.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/swissvotes/test_views_exceptions.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from webtest import TestApp as Client
def test_view_exceptions(swissvotes_app):
client = Client(swissvotes_app)
client.get('/locale/de_CH').follow()
assert (
"Sie versuchen eine Seite zu öffnen, für die Sie nicht autorisiert "
"sind"
) in client.get('/votes/update', status=403)
a... | 27.5 | 76 | 0.679545 |
96c04922057130527a1d880e98fb5acf8dc6a539 | 3,568 | py | Python | pyntcloud/io/open3d.py | bernssolg/pyntcloud-master | 84cf000b7a7f69a2c1b36f9624f05f65160bf992 | [
"MIT"
] | 1,142 | 2016-10-10T08:55:30.000Z | 2022-03-30T04:46:16.000Z | pyntcloud/io/open3d.py | bernssolg/pyntcloud-master | 84cf000b7a7f69a2c1b36f9624f05f65160bf992 | [
"MIT"
] | 195 | 2016-10-10T08:30:37.000Z | 2022-02-17T12:51:17.000Z | pyntcloud/io/open3d.py | bernssolg/pyntcloud-master | 84cf000b7a7f69a2c1b36f9624f05f65160bf992 | [
"MIT"
] | 215 | 2017-02-28T00:50:29.000Z | 2022-03-22T17:01:31.000Z | import numpy as np
import pandas as pd
def from_open3d(o3d_data, **kwargs):
"""Create a PyntCloud instance from Open3D's PointCloud/TriangleMesh instance"""
try:
import open3d as o3d
except ImportError:
raise ImportError("Open3D must be installed. Try `pip install open3d`")
if not isi... | 41.488372 | 115 | 0.59389 |
f7631173b912f47f3f617ab589a7e2343fe9b4e2 | 564 | py | Python | spider/master_neg.py | iecasszyjy/tweet_search-master | e4978521a39964c22ae46bf35d6ff17710e8e6c6 | [
"MIT"
] | null | null | null | spider/master_neg.py | iecasszyjy/tweet_search-master | e4978521a39964c22ae46bf35d6ff17710e8e6c6 | [
"MIT"
] | 2 | 2021-03-31T18:54:16.000Z | 2021-12-13T19:49:08.000Z | spider/master_neg.py | iecasszyjy/tweet_search-master | e4978521a39964c22ae46bf35d6ff17710e8e6c6 | [
"MIT"
] | null | null | null | import re
import json
import random
random.seed(1)
from Config import get_config
_,db,r = get_config()
stopwords_en = db.event_metadata.find_one({'name':'stopwords_en'})['data']
def get_stopwords():
return stopwords_en[random.randint(0,len(stopwords_en)-1)]
def get_task():
for item in db.dataset.find({},{'_id':1... | 22.56 | 74 | 0.689716 |
e3c34df44709c6707d2a2dc7fba8345ca43ab9f5 | 433 | py | Python | PMIa/2014/danilov_d_a/task_5_6.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | PMIa/2014/danilov_d_a/task_5_6.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | PMIa/2014/danilov_d_a/task_5_6.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | #Задача 5. Вариант 6.
#Напишите программу, которая бы при запуске случайным образом отображала название одного из двух спутников Марса.
#Данилов Д.А.
#21.05.2016
import random
first="Фобос"
second="Дэймос"
print("Программа случайным образом отображала название одного из двух спутников Марса")
a=random.rand... | 24.055556 | 114 | 0.729792 |
e3e7f226e706e91b4f158678a650191e0547b559 | 236 | py | Python | python/coursera_python/FUND_OF_COMP_RICE/FUND_OF_COMPUTING_RICE/WK2/10.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/coursera_python/FUND_OF_COMP_RICE/FUND_OF_COMPUTING_RICE/WK2/10.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/coursera_python/FUND_OF_COMP_RICE/FUND_OF_COMPUTING_RICE/WK2/10.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | import math
def project_to_distance(point_x, point_y, distance):
dist_to_origin = math.sqrt(point_x ** 2 + point_y ** 2)
scale = distance / dist_to_origin
print(point_x * scale, point_y * scale)
project_to_distance(2, 7, 4)
| 33.714286 | 59 | 0.720339 |
58922f9eedd9439c635600f11327b3c334723a89 | 6,969 | py | Python | samples/feature-tools/ftools.py | Matheus158257/projects | 26a6148046533476e625a872a2950c383aa975a8 | [
"Apache-2.0"
] | null | null | null | samples/feature-tools/ftools.py | Matheus158257/projects | 26a6148046533476e625a872a2950c383aa975a8 | [
"Apache-2.0"
] | null | null | null | samples/feature-tools/ftools.py | Matheus158257/projects | 26a6148046533476e625a872a2950c383aa975a8 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Wed Oct 11 08:05:00 2019
@author: ascalet / lladeira
Feature Tools implementation utilizing feature tools Data Science Machine
"""
import io
import os
import numpy as np
import pandas as pd
import warnings
import featuretools as ft
import featuretools.variable_types as vtypes... | 31.96789 | 142 | 0.52834 |
543a7e0584a5f1a25cc00007ee7ef756176b7c32 | 438 | py | Python | Sensore1/Sensore1/gps-module.py | lorenaleon/GitHubEx | a237244645556936f5c7184fdb60e77da44146b9 | [
"MIT"
] | null | null | null | Sensore1/Sensore1/gps-module.py | lorenaleon/GitHubEx | a237244645556936f5c7184fdb60e77da44146b9 | [
"MIT"
] | null | null | null | Sensore1/Sensore1/gps-module.py | lorenaleon/GitHubEx | a237244645556936f5c7184fdb60e77da44146b9 | [
"MIT"
] | null | null | null | import os
import time
import serial
import pynmea2
import string
#loop for the gps
while True:
port = "/dev/ttyAMA0"
ser = serial.Serial(port, baudrate=9600, timeout=0.5)
dataout = pynmea2.NMEAStreanReader()
newdata = ser.readline()
print ("Obtendo latitude e longetude")
if newdata[0:6] == '$GPGGA':
newmsg =... | 19.043478 | 54 | 0.712329 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.