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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f1387f1bb3d842436b744787a6d3dccc58edeb11 | 1,182 | py | Python | tests/test_tweet_sentiment_analysis.py | UBC-MDS/pytweet | dd97089e79ae35a773d0651cc305fc650b1cd590 | [
"MIT"
] | 2 | 2021-03-13T02:18:16.000Z | 2022-01-14T11:55:32.000Z | tests/test_tweet_sentiment_analysis.py | UBC-MDS/pytweet | dd97089e79ae35a773d0651cc305fc650b1cd590 | [
"MIT"
] | 18 | 2021-02-25T04:36:22.000Z | 2021-03-26T07:28:37.000Z | tests/test_tweet_sentiment_analysis.py | UBC-MDS/pytweet | dd97089e79ae35a773d0651cc305fc650b1cd590 | [
"MIT"
] | 8 | 2021-02-27T04:33:50.000Z | 2021-06-23T21:48:40.000Z | import pandas as pd
from pytweet.pytweet import tweet_sentiment_analysis
from pytest import raises
def test_tweet_sentiment_analysis():
"""
Test existing functionalities of tweet_sentiment_analysis(),
which supposed to be a dataframe with semetiment results
"""
# data = pd.read_csv("tests/brunomar... | 32.833333 | 80 | 0.680203 |
f13948f7e1b4f990e74904c9b786712a2c540319 | 2,436 | py | Python | server/plugins/icloud_shared_album/icloud_shared_album.py | mattlokes/eink_frame | 99b2f57c549bef1c219e12a9a8efe7473748a003 | [
"MIT"
] | null | null | null | server/plugins/icloud_shared_album/icloud_shared_album.py | mattlokes/eink_frame | 99b2f57c549bef1c219e12a9a8efe7473748a003 | [
"MIT"
] | null | null | null | server/plugins/icloud_shared_album/icloud_shared_album.py | mattlokes/eink_frame | 99b2f57c549bef1c219e12a9a8efe7473748a003 | [
"MIT"
] | null | null | null | import requests
import json
# Heavily Inspired from https://github.com/bertrandom/icloud-shared-album-to-flickr
from functools import cached_property
class IcloudSharedAlbumBaseUrl():
BASE_62_CHAR_SET = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
def __init__(self, token):
self.... | 31.230769 | 87 | 0.56445 |
77879fcef7c747998a57e2d24b86e7797b5a0e7c | 1,819 | py | Python | tests/service/ai/test_search_tree_pathfinding_ai.py | jonashellmann/informaticup21-team-chillow | f2e519af0a5d9a9368d62556703cfb1066ebb58f | [
"MIT"
] | 3 | 2021-01-17T23:32:07.000Z | 2022-01-30T14:49:16.000Z | tests/service/ai/test_search_tree_pathfinding_ai.py | jonashellmann/informaticup21-team-chillow | f2e519af0a5d9a9368d62556703cfb1066ebb58f | [
"MIT"
] | 2 | 2021-01-17T13:37:56.000Z | 2021-04-14T12:28:49.000Z | tests/service/ai/test_search_tree_pathfinding_ai.py | jonashellmann/informaticup21-team-chillow | f2e519af0a5d9a9368d62556703cfb1066ebb58f | [
"MIT"
] | 2 | 2021-04-02T14:53:38.000Z | 2021-04-20T11:10:17.000Z | import unittest
from multiprocessing import Value
import tests
from chillow.service.ai.search_tree_pathfinding_ai import SearchTreePathfindingAI
from chillow.model.action import Action
from chillow.service.data_loader import JSONDataLoader
class SearchTreePathfindingAITest(unittest.TestCase):
def setUp(self):
... | 36.38 | 103 | 0.731171 |
ae02fecafe35bcf7f8f8cc7d76dee020d6aa6e31 | 649 | py | Python | loss.py | saliAlavi/SegAN | 2b1ec5003e523a883ea9ae123765da1a529676f9 | [
"MIT"
] | 1 | 2022-01-17T18:08:01.000Z | 2022-01-17T18:08:01.000Z | loss.py | saliAlavi/SegAN | 2b1ec5003e523a883ea9ae123765da1a529676f9 | [
"MIT"
] | null | null | null | loss.py | saliAlavi/SegAN | 2b1ec5003e523a883ea9ae123765da1a529676f9 | [
"MIT"
] | 2 | 2020-07-31T07:15:40.000Z | 2022-02-27T11:09:12.000Z | import torch
def multi_scale_L1_loss(c_output, number_of_critic_scales=4):
c_output = torch.abs(c_output)
c_output = torch.sum(c_output, dim=1, keepdim=True)
c_output = (1/number_of_critic_scales) * c_output
c_output = torch.mean(c_output)
return c_output
def dice_loss(input,target):
num=input*target
... | 22.37931 | 61 | 0.701079 |
70a6398e25c639b42954b7e03940239e5cc81bb0 | 5,279 | py | Python | Packs/EmailCommunication/Scripts/DisplayEmailHtml/DisplayEmailHtml_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/EmailCommunication/Scripts/DisplayEmailHtml/DisplayEmailHtml_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/EmailCommunication/Scripts/DisplayEmailHtml/DisplayEmailHtml_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import demistomock as demisto
import pytest
EMAIL_HTML = """
<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body><div dir="ltr">image 1:
<div><div><img src="cid:ii_kgjzy6yh0" alt="image_1.png" width="275" height="184"><br></div></div><div>image 2:
</div><div><div><img src="cid:i... | 44.737288 | 118 | 0.691798 |
8dc12f606dbfaae944e13271f952db674e326ef1 | 299 | py | Python | exercises/fr/solution_02_02_02.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/fr/solution_02_02_02.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/fr/solution_02_02_02.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | import spacy
nlp = spacy.blank("fr")
doc = nlp("David Bowie a le label PER")
# Cherche le hash pour le label de chaine "PER"
person_hash = nlp.vocab.strings["PER"]
print(person_hash)
# Cherche person_hash pour obtenir la chaine
person_string = nlp.vocab.strings[person_hash]
print(person_string)
| 23 | 47 | 0.759197 |
8dd42ae4b00ca33f6cee62e43dcec97a19e2e76e | 2,282 | py | Python | analysis/scripts/ProjectFunctions.py | data301-2021-summer2/project-group39-project | ae641ec8f0384015c7c8ff41260e1e53c0fd9e51 | [
"MIT"
] | null | null | null | analysis/scripts/ProjectFunctions.py | data301-2021-summer2/project-group39-project | ae641ec8f0384015c7c8ff41260e1e53c0fd9e51 | [
"MIT"
] | 2 | 2021-08-06T12:42:54.000Z | 2021-08-16T07:32:12.000Z | analysis/scripts/ProjectFunctions.py | data301-2021-summer2/project-group39-project | ae641ec8f0384015c7c8ff41260e1e53c0fd9e51 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# In[1]:
import pandas as pd
def CoachData(n):
df = (
pd.read_csv(n)
.groupby(['head_coach','team_id'])
.sum()
.reset_index()
.drop(['game_id'], axis = 'columns')
)
return df
def TeamData(n):
# Method chaining beg... | 28.886076 | 182 | 0.588081 |
30d3ae4c70af131df7d52adb69f67024302cbdf9 | 1,379 | py | Python | python_reference/useful_scripts/univariate_poisson_pdf.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | 1 | 2019-05-10T09:16:23.000Z | 2019-05-10T09:16:23.000Z | python_reference/useful_scripts/univariate_poisson_pdf.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | null | null | null | python_reference/useful_scripts/univariate_poisson_pdf.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | 1 | 2019-10-14T07:30:18.000Z | 2019-10-14T07:30:18.000Z | import numpy as np
import math
def poisson_lambda_mle(d):
"""
Computes the Maximum Likelihood Estimate for a given 1D training
dataset from a Poisson distribution.
"""
return sum(d) / len(d)
def likelihood_poisson(x, lam):
"""
Computes the class-conditional probability for an univari... | 28.142857 | 120 | 0.640319 |
ebdcd5c38240e096fd43a02f31d14cb8ccc73eda | 6,857 | py | Python | packages/watchmen-inquiry-trino/src/watchmen_inquiry_trino/trino_storage_spi.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-inquiry-trino/src/watchmen_inquiry_trino/trino_storage_spi.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-inquiry-trino/src/watchmen_inquiry_trino/trino_storage_spi.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from abc import abstractmethod
from typing import Any, Dict, List, Optional
from watchmen_model.admin import Topic
from watchmen_model.common import DataPage
from watchmen_storage import Entity, EntityDeleter, EntityDistinctValuesFinder, EntityFinder, EntityHelper, EntityId, \
EntityIdHelper, EntityList, EntityPager,... | 31.168182 | 119 | 0.742161 |
baa70f3400a9cde38f5fb8ba7098805a4fd24029 | 95 | py | Python | basics/power.py | karinakozarova/Learning-Python | 217dfc8ca6931a238445daf0b84e188c02916c52 | [
"MIT"
] | 1 | 2019-04-07T23:14:29.000Z | 2019-04-07T23:14:29.000Z | basics/power.py | karinakozarova/Learning-Python | 217dfc8ca6931a238445daf0b84e188c02916c52 | [
"MIT"
] | null | null | null | basics/power.py | karinakozarova/Learning-Python | 217dfc8ca6931a238445daf0b84e188c02916c52 | [
"MIT"
] | null | null | null | a = int(input())
b = int(input())
c = int(input())
print(str(pow(a,b)))
print(str(pow(a,b,c))) | 15.833333 | 22 | 0.568421 |
031e1f014c9c9f3e0110d9494810700d26a43854 | 3,956 | py | Python | infrastructure/main.py | lizzyTheLizard/homeserver-azure | e79bd23ea09a1ce1a77afd73bb9acfd402dfdc57 | [
"MIT"
] | null | null | null | infrastructure/main.py | lizzyTheLizard/homeserver-azure | e79bd23ea09a1ce1a77afd73bb9acfd402dfdc57 | [
"MIT"
] | null | null | null | infrastructure/main.py | lizzyTheLizard/homeserver-azure | e79bd23ea09a1ce1a77afd73bb9acfd402dfdc57 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
import hashlib
import socket
from cdn import *
from cosmosdb import *
from function import *
from localServiceFile import *
from serviceBus import *
from storage import *
# Configuration
group = "Homeserver"
location = "switzerlandnorth"
dbName = "gutschihomeserver-db"
sbName = "gutsc... | 30.430769 | 110 | 0.586198 |
aec99a68108dec59fa8637fb2c358717b84cb4da | 1,097 | py | Python | Algorithms/Dynamic_Programming/Red_John_is_back.py | vinayvinu500/Hackerrank | e185ae9d3c7dc5cd661761142e436f5df6a3f0f1 | [
"MIT"
] | null | null | null | Algorithms/Dynamic_Programming/Red_John_is_back.py | vinayvinu500/Hackerrank | e185ae9d3c7dc5cd661761142e436f5df6a3f0f1 | [
"MIT"
] | null | null | null | Algorithms/Dynamic_Programming/Red_John_is_back.py | vinayvinu500/Hackerrank | e185ae9d3c7dc5cd661761142e436f5df6a3f0f1 | [
"MIT"
] | null | null | null | # https://www.hackerrank.com/challenges/red-john-is-back/problem?utm_campaign=challenge-recommendation&utm_medium=email&utm_source=24-hour-campaign
from math import factorial as fc
from itertools import permutations as pt
def comb(n,r):
return fc(n)/(fc(n-r)*fc(r))
def prime(n):
if n == 0 or n == 1: return F... | 18.913793 | 147 | 0.571559 |
9de5bf32883aaedb58b29e66657364001b8f6e80 | 411 | py | Python | dash/migrations/0012_auto_20210406_1617.py | bdioui/DashboardFeder | 455737c828f1c04651af495f60d6637131b911f5 | [
"MIT"
] | null | null | null | dash/migrations/0012_auto_20210406_1617.py | bdioui/DashboardFeder | 455737c828f1c04651af495f60d6637131b911f5 | [
"MIT"
] | null | null | null | dash/migrations/0012_auto_20210406_1617.py | bdioui/DashboardFeder | 455737c828f1c04651af495f60d6637131b911f5 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.7 on 2021-04-06 16:17
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('dash', '0011_auto_20210406_1506'),
]
operations = [
migrations.AlterField(
model_name='dossier',
name='date_dépôt',
... | 21.631579 | 73 | 0.608273 |
d17c88b27b77cf9c6dc5850f1394b585f8a384d1 | 669 | py | Python | BIZa/2014/Tskipu_a_k/task_6_28.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | BIZa/2014/Tskipu_a_k/task_6_28.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | BIZa/2014/Tskipu_a_k/task_6_28.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | #Задача № 6. Вариант 28
#Создайте игру, в которой компьютер загадывает название одного из шести континентов Земли, а игрок должен его угадать.
# Цкипуришвили Александр
#25.05.2016
import random
print("Компьютер загадывает название одного из шести континентов Земли, а игрок должен его угадать.")
kontinents=('Евразия'... | 33.45 | 118 | 0.741405 |
886f344c48ebc9a65308070b0b748a875df0b539 | 3,256 | py | Python | Python/Courses/LearnToCodeInPython3ProgrammingBeginnerToAdvancedYourProgress/python_course/Section4Modules/29ExerciseTimeAndMatplotlibPyplot.py | JamieBort/LearningDirectory | afca79c5f1333c079d0e96202ff44ca21b2ceb81 | [
"Info-ZIP"
] | 1 | 2022-02-02T21:56:08.000Z | 2022-02-02T21:56:08.000Z | Python/Courses/LearnToCodeInPython3ProgrammingBeginnerToAdvancedYourProgress/python_course/Section4Modules/29ExerciseTimeAndMatplotlibPyplot.py | JamieBort/LearningDirectory | afca79c5f1333c079d0e96202ff44ca21b2ceb81 | [
"Info-ZIP"
] | 27 | 2020-06-27T23:25:59.000Z | 2022-02-27T20:40:56.000Z | Python/Courses/LearnToCodeInPython3ProgrammingBeginnerToAdvancedYourProgress/python_course/Section4Modules/29ExerciseTimeAndMatplotlibPyplot.py | JamieBort/LearningDirectory | afca79c5f1333c079d0e96202ff44ca21b2ceb81 | [
"Info-ZIP"
] | null | null | null | # NOT DONE - COME BACK TO to address the following:
# Need to do the following.
# 1. see TODO comment below: consolidate all these for loops below.
# 2. graph plot code copied from ../LearningDirectory/Python/LearnToCodeInPython3ProgrammingBeginnerToAdvancedYourProgress/python_course/Section4Modules/28Matplotlib.py
# 3... | 36.177778 | 179 | 0.670147 |
ee857efcdfcf96964b0e093c9fa9329670cbb1f8 | 436 | py | Python | exercises/pt/solution_01_09.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/pt/solution_01_09.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/pt/solution_01_09.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | import spacy
nlp = spacy.load("en_core_web_sm")
text = "Upcoming iPhone X release date leaked as Apple reveals pre-orders"
# Processar o texto
doc = nlp(text)
# Iterar nas entidades previstas
for ent in doc.ents:
# Imprimir o texto e etiqueta (label) da entidade
print(ent.text, ent.label_)
# Selecionar a p... | 21.8 | 74 | 0.731651 |
4e4c606d90ebbe71da365b53f5e6a41bd9994407 | 104 | py | Python | ___Python/KarPoo/po1_kennenlernen/p01_kennenlernen/m02_excel_read.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | ___Python/KarPoo/po1_kennenlernen/p01_kennenlernen/m02_excel_read.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | ___Python/KarPoo/po1_kennenlernen/p01_kennenlernen/m02_excel_read.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | import pandas as pd
import xlrd
df = pd.read_excel("O:/___Python/personen.xlsx")
print(df.head())
| 17.333333 | 49 | 0.701923 |
e11e5994056ab3f0f3503b94905c324d16d4dc56 | 1,120 | py | Python | live-coding-sessions/6.1/zeichensuche.py | giu/appe6-uzh-hs2018 | 204dea36be1e53594124b606cdfa044368e54726 | [
"MIT"
] | null | null | null | live-coding-sessions/6.1/zeichensuche.py | giu/appe6-uzh-hs2018 | 204dea36be1e53594124b606cdfa044368e54726 | [
"MIT"
] | null | null | null | live-coding-sessions/6.1/zeichensuche.py | giu/appe6-uzh-hs2018 | 204dea36be1e53594124b606cdfa044368e54726 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Kurs: Python: Grundlagen der Programmierung für Nicht-Informatiker
# Semester: Herbstsemester 2018
# Homepage: http://accaputo.ch/kurs/python-uzh-hs-2018/
# Author: Giuseppe Accaputo
# Session: 6.1
def suche(zeichen, wort):
# Aktuelle Position im Wort
positi... | 41.481481 | 93 | 0.690179 |
09b37913f94319c80208582271bb53653c854482 | 2,347 | py | Python | app/core/views.py | dleicht/planx | 37b1fededfdd6b55f9a125a60d563679f9db97e8 | [
"BSD-2-Clause",
"MIT"
] | null | null | null | app/core/views.py | dleicht/planx | 37b1fededfdd6b55f9a125a60d563679f9db97e8 | [
"BSD-2-Clause",
"MIT"
] | null | null | null | app/core/views.py | dleicht/planx | 37b1fededfdd6b55f9a125a60d563679f9db97e8 | [
"BSD-2-Clause",
"MIT"
] | 1 | 2019-09-06T10:06:30.000Z | 2019-09-06T10:06:30.000Z | # Copyright 2014 SolidBuilds.com. All rights reserved
#
# Authors: Ling Thio <ling.thio@gmail.com>
from flask import redirect, render_template, render_template_string, Blueprint, g
from flask import request, url_for
from flask_user import current_user, login_required, roles_accepted
from flask.ext.babel import Babel
... | 29.708861 | 81 | 0.711547 |
3aa95cc25194047aa5461b89ebc64587cf4a8f45 | 6,486 | py | Python | src/onegov/activity/models/booking.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/activity/models/booking.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/activity/models/booking.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.activity.models.occasion import Occasion
from onegov.core.orm import Base
from onegov.core.orm.mixins import TimestampMixin
from onegov.core.orm.types import UUID
from sqlalchemy import Column
from sqlalchemy import Enum
from sqlalchemy import ForeignKey
from sqlalchemy import func
from sqlalchemy import In... | 29.216216 | 78 | 0.640456 |
3aadf577df0fd84edba77728defb30b1c2c990c4 | 20,043 | py | Python | verto/tests/ImageInlineTest.py | uccser/verto | d36aa88b208f1700fafc033679bd1e9775496d25 | [
"MIT"
] | 4 | 2017-04-10T06:09:54.000Z | 2019-05-04T02:07:40.000Z | verto/tests/ImageInlineTest.py | uccser/verto | d36aa88b208f1700fafc033679bd1e9775496d25 | [
"MIT"
] | 268 | 2017-04-03T20:40:46.000Z | 2022-02-04T20:10:08.000Z | verto/tests/ImageInlineTest.py | uccser/kordac | d36aa88b208f1700fafc033679bd1e9775496d25 | [
"MIT"
] | 1 | 2019-01-07T15:46:31.000Z | 2019-01-07T15:46:31.000Z | import markdown
import re
from unittest.mock import Mock
from collections import defaultdict
from verto.VertoExtension import VertoExtension
from verto.processors.ImageInlinePattern import ImageInlinePattern
from verto.errors.ArgumentMissingError import ArgumentMissingError
from verto.tests.ProcessorTest import Proces... | 46.288684 | 162 | 0.710971 |
c28d234e7d85dbe21efd9bb2e2d2bda93fe593d3 | 2,901 | py | Python | user/views.py | hhdMrLion/Product-System | e870225ab10c32688a87426d5943d922c47c4404 | [
"MIT"
] | 1 | 2021-06-18T03:03:42.000Z | 2021-06-18T03:03:42.000Z | user/views.py | hhdMrLion/Product-System | e870225ab10c32688a87426d5943d922c47c4404 | [
"MIT"
] | null | null | null | user/views.py | hhdMrLion/Product-System | e870225ab10c32688a87426d5943d922c47c4404 | [
"MIT"
] | null | null | null | from django.shortcuts import render, redirect, get_object_or_404
# Create your views here.
from django.views.generic import TemplateView, ListView
from user import models, forms
from user.models import User
def index(request):
# 首页,重定向到订单页
if not request.session.get('is_login', None):
re... | 29.01 | 99 | 0.574629 |
6c48eefc95978c28ec969b3a0ad84d1ad96b5ca5 | 3,332 | py | Python | classification/classifier/classifier.py | Ilgmi/IWIbot | c5ac71865fbb11f1676ec3239b96bab8e22257ee | [
"Apache-2.0"
] | null | null | null | classification/classifier/classifier.py | Ilgmi/IWIbot | c5ac71865fbb11f1676ec3239b96bab8e22257ee | [
"Apache-2.0"
] | null | null | null | classification/classifier/classifier.py | Ilgmi/IWIbot | c5ac71865fbb11f1676ec3239b96bab8e22257ee | [
"Apache-2.0"
] | null | null | null | import nltk
import numpy as np
from nltk.stem.lancaster import LancasterStemmer
# compute sigmoid nonlinearity
def sigmoid(x):
output = 1 / (1 + np.exp(-x))
return output
# convert output of sigmoid function to its derivative
def sigmoid_output_to_derivative(output):
return output * (1 - output)
def c... | 31.733333 | 107 | 0.631453 |
66df5543c89eb969d367a204304e597691842c40 | 985 | py | Python | src/onegov/fsi/security.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/fsi/security.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/fsi/security.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.core.security import Personal
from onegov.core.security.rules import has_permission_logged_in
from onegov.fsi import FsiApp
from onegov.fsi.models import CourseAttendee
"""
Since FSI is mainly for internal use, a user must logged in to see even
courses.
The standard has_permission_logged_in treats members ... | 32.833333 | 75 | 0.792893 |
dd79e1288300e1c60e087a545a8a86333f6c944e | 3,619 | py | Python | Packs/CommonScripts/Scripts/GetFieldsByIncidentType/GetFieldsByIncidentType_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/CommonScripts/Scripts/GetFieldsByIncidentType/GetFieldsByIncidentType_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/CommonScripts/Scripts/GetFieldsByIncidentType/GetFieldsByIncidentType_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import demistomock as demisto
import json
def executeCommand(name, args=None):
if name == 'demisto-api-get' and args and 'uri' in args and args['uri'] == "/incidentfields":
file_name = 'TestData/integration_incidentfields.json'
else:
raise ValueError('Unimplemented command called: {}'.format(n... | 32.603604 | 97 | 0.483006 |
b0e56cec7b310c88d9e8e9e3b9b17e2fe8c2d3d7 | 11,473 | py | Python | tests/test_singlefile.py | datumbox/model-index | a39af5f8aaa2a90b8fc7180744a855282360067a | [
"MIT"
] | 12 | 2021-02-26T08:19:00.000Z | 2022-01-26T14:00:16.000Z | tests/test_singlefile.py | datumbox/model-index | a39af5f8aaa2a90b8fc7180744a855282360067a | [
"MIT"
] | null | null | null | tests/test_singlefile.py | datumbox/model-index | a39af5f8aaa2a90b8fc7180744a855282360067a | [
"MIT"
] | 3 | 2021-03-19T13:51:56.000Z | 2021-08-25T05:25:52.000Z | import modelindex
from modelindex import Metadata
from modelindex.models.Collection import Collection
from modelindex.models.CollectionList import CollectionList
from modelindex.models.Model import Model
from modelindex.models.ModelList import ModelList
from modelindex.models.Result import Result
from modelindex.models... | 35.085627 | 110 | 0.49891 |
c6a26939b87bde13c255e3c54a01b340d5b667e0 | 21 | py | Python | lib/python/qmk/cli/new/__init__.py | fzf/qmk_toolbox | 10d6b425bd24b45002555022baf16fb11254118b | [
"MIT"
] | 2 | 2021-04-16T23:29:01.000Z | 2021-04-17T02:26:22.000Z | lib/python/qmk/cli/new/__init__.py | fzf/qmk_toolbox | 10d6b425bd24b45002555022baf16fb11254118b | [
"MIT"
] | null | null | null | lib/python/qmk/cli/new/__init__.py | fzf/qmk_toolbox | 10d6b425bd24b45002555022baf16fb11254118b | [
"MIT"
] | null | null | null | from . import keymap
| 10.5 | 20 | 0.761905 |
c6cb1f2b5a4cad8fe3021b6a81a6795a913154f6 | 7,661 | py | Python | src/ValidIsilTerms.py | sonar-idh/Transformer | bbfde9d19ad4a4917257483ba66eb30a8294244d | [
"MIT"
] | null | null | null | src/ValidIsilTerms.py | sonar-idh/Transformer | bbfde9d19ad4a4917257483ba66eb30a8294244d | [
"MIT"
] | null | null | null | src/ValidIsilTerms.py | sonar-idh/Transformer | bbfde9d19ad4a4917257483ba66eb30a8294244d | [
"MIT"
] | null | null | null | val_isils = {"AT_LAW", "AT_NMW_Z", "AT_OeNB", "AT_UBK", "AT_WBR", "CH_000003_X", "CH_000004_7", "CH_000006_1", "CH_000008_6", "CH_000009_3", "CH_000015_0", "CH_000027_1", "CH_000033_9", "CH_000045_X", "CH_000050_X", "CH_000086_2", "CH_000093_7", "CH_000095_1", "CH_000133_4", "CH_000653_4", "CH_000917_4", "CH_000924_9",... | 7,661 | 7,661 | 0.68059 |
a54164df720633c0eb26197325ed3da1d80e9eec | 333 | py | Python | showcase1/com/aaron/enumexample.py | qsunny/python | ace8c3178a9a9619de2b60ca242c2079dd2f825e | [
"MIT"
] | null | null | null | showcase1/com/aaron/enumexample.py | qsunny/python | ace8c3178a9a9619de2b60ca242c2079dd2f825e | [
"MIT"
] | 2 | 2021-03-25T22:00:07.000Z | 2022-01-20T15:51:48.000Z | showcase1/com/aaron/enumexample.py | qsunny/python | ace8c3178a9a9619de2b60ca242c2079dd2f825e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""枚举"""
__author__="Aaron.qiu"
from enum import Enum, unique
@unique
class Weekday(Enum):
Sun = 0 # Sun的value被设定为0
Mon = 1
Tue = 2
Wed = 3
Thu = 4
Fri = 5
Sat = 6
if __name__=="__main__":
day1 = Weekday.Mon
print(day1)
print(Weekday.Tue.value)
prin... | 15.857143 | 29 | 0.576577 |
a54f1b3f18b99ca51c8001542592b32eaf573f18 | 3,537 | py | Python | models.py | klml/kohrsupply | 89ae3ebae120398e8259dbe77c3b092485cc79f9 | [
"MIT"
] | null | null | null | models.py | klml/kohrsupply | 89ae3ebae120398e8259dbe77c3b092485cc79f9 | [
"MIT"
] | 9 | 2017-06-15T10:24:09.000Z | 2018-08-01T21:07:25.000Z | models.py | klml/kohrsupply | 89ae3ebae120398e8259dbe77c3b092485cc79f9 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
from django.conf import settings
from django.db import models
from django.contrib.auth.models import User
from django.utils import timezone
class TransportLocation(models.Model):
author = models.ForeignKey( User, related_name="authorlocation", on_delete=models.CASCADE)
... | 39.741573 | 120 | 0.720102 |
a58ca112d9034d7d616c8c841d693608ededde3f | 422 | py | Python | Tutorials/10 Days of Statistics/Day 1/quartiles.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 1/quartiles.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | null | null | null | Tutorials/10 Days of Statistics/Day 1/quartiles.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | null | null | null | #!/bin/python3
import sys
n = int(input().strip())
arr = [int(arr_i) for arr_i in input().strip().split(' ')]
def my_median(arr):
length = len(arr)
if length % 2 == 0:
median = (arr[length//2-1] + arr[length//2])/2
else:
median = arr[(length-1)//2]
return median
X = sorted(arr)
L = X... | 18.347826 | 58 | 0.57109 |
3c4d528bd3d5f40ecf5c2d5c3f9a0d4e498e574d | 1,598 | py | Python | frappe-bench/apps/erpnext/erpnext/selling/page/sales_funnel/sales_funnel.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/selling/page/sales_funnel/sales_funnel.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/selling/page/sales_funnel/sales_funnel.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
@frappe.whitelist()
def get_funnel_data(from_date, to_date):
active_leads = frappe.db.sql("""select count(*) from ... | 44.388889 | 105 | 0.675219 |
051367f3e4fb091647d0f64da301534dcc15f5cd | 1,490 | py | Python | elements/python/7/13/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | 11 | 2019-02-08T06:54:34.000Z | 2021-08-07T18:57:39.000Z | elements/python/7/13/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | 1 | 2019-05-21T08:14:10.000Z | 2019-05-21T08:14:10.000Z | elements/python/7/13/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | null | null | null | import sys
def format_line(A, L, space=' '):
if len(A) == 1:
w = A[0]
return w + space*(L - len(w))
total_space = L - sum(map(len, A))
num_spaces = len(A)-1
line = A[0]
for w in A[1:]:
n = (total_space + num_spaces - 1) // num_spaces
line += space*n + w
num_... | 23.28125 | 67 | 0.543624 |
058cd9bba1fa488923ee71eb8239956bdfde7e49 | 619 | py | Python | Codeforces_problems/Common SubsequenceA/solution.py | KAHund/CompetitiveCode | 6ed211a2f795569f5c2f18c2f660520d99d41ca0 | [
"MIT"
] | 165 | 2020-10-03T08:01:11.000Z | 2022-03-31T02:42:08.000Z | Codeforces_problems/Common SubsequenceA/solution.py | KAHund/CompetitiveCode | 6ed211a2f795569f5c2f18c2f660520d99d41ca0 | [
"MIT"
] | 383 | 2020-10-03T07:39:11.000Z | 2021-11-20T07:06:35.000Z | Codeforces_problems/Common SubsequenceA/solution.py | KAHund/CompetitiveCode | 6ed211a2f795569f5c2f18c2f660520d99d41ca0 | [
"MIT"
] | 380 | 2020-10-03T08:05:04.000Z | 2022-03-19T06:56:59.000Z | '''
If there exists a common subsequence of length k then it's garunteed the
smallest length of the subsequence that exists is 1 and that 1 length subsequence
can be any of the element of the subsequence
thus we check if there are any common elements between the 2 given arrays using a dictionary.
'''
for i in range(i... | 26.913043 | 93 | 0.668821 |
34d66a1f11f5be960c7dae0ba4614677283af67a | 1,679 | py | Python | Algorithms/Implementation/Modified_Karprekar_Numbers.py | vinayvinu500/Hackerrank | e185ae9d3c7dc5cd661761142e436f5df6a3f0f1 | [
"MIT"
] | null | null | null | Algorithms/Implementation/Modified_Karprekar_Numbers.py | vinayvinu500/Hackerrank | e185ae9d3c7dc5cd661761142e436f5df6a3f0f1 | [
"MIT"
] | null | null | null | Algorithms/Implementation/Modified_Karprekar_Numbers.py | vinayvinu500/Hackerrank | e185ae9d3c7dc5cd661761142e436f5df6a3f0f1 | [
"MIT"
] | null | null | null | l = 1
u = 1000000
# https://www.hackerrank.com/challenges/kaprekar-numbers/problem?h_r=internal-search
# https://en.wikipedia.org/wiki/Kaprekar_number
# https://betterexplained.com/articles/numbers-and-bases/
# method 1 -> square -> str -> split -> sum
def karprekar(n):
if n == 1:
return True
if n in... | 21.805195 | 115 | 0.515783 |
1fb8f1d10ab6e0250255adb59990c0b898542771 | 1,530 | py | Python | cbm/ipycbm/ipy_ext/ext_card2db.py | CsabaWirnhardt/cbm | 1822addd72881057af34ac6a7c2a1f02ea511225 | [
"BSD-3-Clause"
] | 17 | 2021-01-18T07:27:01.000Z | 2022-03-10T12:26:21.000Z | cbm/ipycbm/ipy_ext/ext_card2db.py | CsabaWirnhardt/cbm | 1822addd72881057af34ac6a7c2a1f02ea511225 | [
"BSD-3-Clause"
] | 4 | 2021-04-29T11:20:44.000Z | 2021-12-06T10:19:17.000Z | cbm/ipycbm/ipy_ext/ext_card2db.py | CsabaWirnhardt/cbm | 1822addd72881057af34ac6a7c2a1f02ea511225 | [
"BSD-3-Clause"
] | 47 | 2021-01-21T08:25:22.000Z | 2022-03-21T14:28:42.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# This file is part of CbM (https://github.com/ec-jrc/cbm).
# Author : Konstantinos Anastasakis
# Credits : GTCAP Team
# Copyright : 2021 European Commission, Joint Research Centre
# License : 3-Clause BSD
import datetime
from IPython.display import display
from ... | 30.6 | 77 | 0.620915 |
85cbb26ffb16ac9c964cf8684912d3c8b51fe0b3 | 900 | py | Python | file.py | mayur200/hacktoberfest2021 | 5f141fe6dc90916d65bef17a66f0db05649c41ef | [
"MIT"
] | null | null | null | file.py | mayur200/hacktoberfest2021 | 5f141fe6dc90916d65bef17a66f0db05649c41ef | [
"MIT"
] | null | null | null | file.py | mayur200/hacktoberfest2021 | 5f141fe6dc90916d65bef17a66f0db05649c41ef | [
"MIT"
] | null | null | null | from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler
#pip install watch for these package work
import os
import json
import time
class Myhandler(FileSystemEventHandler):
i=1
def on_modified(self, event ):
for fielname in os.listdir(folder_to_track):
... | 30 | 98 | 0.737778 |
23865eb9e3a747833782baf13c5d59f878a5195b | 3,053 | py | Python | leetcode-and-lintcode/Stack/basic_calculator_224_leetcode.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2015-12-16T04:01:03.000Z | 2015-12-16T04:01:03.000Z | leetcode-and-lintcode/Stack/basic_calculator_224_leetcode.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | leetcode-and-lintcode/Stack/basic_calculator_224_leetcode.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | '''
这是真正处理好 "48 - -48"这样的case
'''
class Solution(object):
def calculate(self, s):
"""
:type s: str
:rtype: int
"""
res = 0
sign_stack = [1]
current_sign = 1
i = 0
while i < len(s):
c = s[i]
if c.isdigit():
... | 28.009174 | 98 | 0.425156 |
f1f4f6f88810d8d3c04362a6a2778e5d19f2b0e8 | 234 | py | Python | Project Euler Qusetions 51 - 60/Project Euler Question 57.py | Clayton-Threm/Coding-Practice | 6671e8a15f9e797338caa617dae45093f4157bc1 | [
"MIT"
] | 1 | 2020-02-11T02:03:02.000Z | 2020-02-11T02:03:02.000Z | Project Euler Qusetions 51 - 60/Project Euler Question 57.py | Clayton-Threm/Coding-Practice | 6671e8a15f9e797338caa617dae45093f4157bc1 | [
"MIT"
] | null | null | null | Project Euler Qusetions 51 - 60/Project Euler Question 57.py | Clayton-Threm/Coding-Practice | 6671e8a15f9e797338caa617dae45093f4157bc1 | [
"MIT"
] | null | null | null | #Project Euler Question 57
#Square root convergents
fraction_list = 0
x = 3
y = 2
for num in range(1, 1000):
xy = x + y
x = xy + y
y = xy
if len(str(x)) > len(str(y)):
fraction_list += 1
print (fraction_list) | 16.714286 | 33 | 0.589744 |
b591d785eedd6742a95297992a63d23a00c5e59a | 5,976 | py | Python | gib_mir_die_heutige_aufgabe.py | kopp/pyventskalender | 6f6455f3c1db07f65a772b2716e4be95fbcd1804 | [
"MIT"
] | null | null | null | gib_mir_die_heutige_aufgabe.py | kopp/pyventskalender | 6f6455f3c1db07f65a772b2716e4be95fbcd1804 | [
"MIT"
] | null | null | null | gib_mir_die_heutige_aufgabe.py | kopp/pyventskalender | 6f6455f3c1db07f65a772b2716e4be95fbcd1804 | [
"MIT"
] | null | null | null | from datetime import date
from argparse import ArgumentParser
from urllib.request import urlopen
from os.path import join, abspath, dirname, exists
from os import makedirs
from typing import List
from re import compile
from json import loads
from subprocess import run
from sys import executable
from traceback import fo... | 36.218182 | 89 | 0.651439 |
a98054494ecae8c53072292c1881c822012b5795 | 6,407 | py | Python | Utils/py/lineDetection/fitEllipse.py | tarsoly/NaoTH | dcd2b67ef6bf9953c81d3e1b26e543b5922b7d52 | [
"ECL-2.0",
"Apache-2.0"
] | 15 | 2015-01-12T10:46:29.000Z | 2022-03-28T05:13:14.000Z | Utils/py/lineDetection/fitEllipse.py | tarsoly/NaoTH | dcd2b67ef6bf9953c81d3e1b26e543b5922b7d52 | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2019-01-20T21:07:50.000Z | 2020-01-22T14:00:28.000Z | Utils/py/lineDetection/fitEllipse.py | tarsoly/NaoTH | dcd2b67ef6bf9953c81d3e1b26e543b5922b7d52 | [
"ECL-2.0",
"Apache-2.0"
] | 5 | 2018-02-07T18:18:10.000Z | 2019-10-15T17:01:41.000Z |
import numpy as np
import numpy.linalg as la
import math
import random
# Ellipse: Ax^2+Bxy+Cy^2+Dx+Ey+F=0
def fitEllipse(x,y):
x = x[:,np.newaxis]
y = y[:,np.newaxis]
# design matrix
D = np.hstack((x*x, x*y, y*y, x, y, np.ones_like(x)))
print(D)
# scatter matrix
S = np.dot(D.T,D)
# ... | 24.642308 | 124 | 0.492118 |
a5f96604b482ce16caa06f3cf13227b93313df94 | 1,868 | py | Python | messagebox/messagebox.py | Hofei90/picoffee | 6b2a00f2b4631790b90495d736afeb331d759241 | [
"MIT"
] | 3 | 2019-05-04T21:34:33.000Z | 2022-01-25T10:00:25.000Z | messagebox/messagebox.py | Hofei90/picoffee | 6b2a00f2b4631790b90495d736afeb331d759241 | [
"MIT"
] | 4 | 2019-04-11T05:03:55.000Z | 2020-07-09T06:52:58.000Z | messagebox/messagebox.py | Hofei90/picoffee | 6b2a00f2b4631790b90495d736afeb331d759241 | [
"MIT"
] | 1 | 2020-02-13T19:04:31.000Z | 2020-02-13T19:04:31.000Z | import os
import peewee
SKRIPTPFAD = os.path.abspath(os.path.dirname(__file__))
DB = peewee.SqliteDatabase(os.path.join(SKRIPTPFAD, "messagebox.db3"))
class BaseModel(peewee.Model):
class Meta:
database = DB
class User(BaseModel):
uid = peewee.IntegerField(primary_key=True)
name = peewee.CharF... | 23.948718 | 82 | 0.688437 |
93bcc5acebcb3f99a4ee495b13ce2b083d683f45 | 1,084 | py | Python | polls/migrations/0001_initial.py | Murphy-KS/MyTimeMashine | a1cd5b17b239a556b1d234aace9b333f71ec2045 | [
"MIT"
] | null | null | null | polls/migrations/0001_initial.py | Murphy-KS/MyTimeMashine | a1cd5b17b239a556b1d234aace9b333f71ec2045 | [
"MIT"
] | null | null | null | polls/migrations/0001_initial.py | Murphy-KS/MyTimeMashine | a1cd5b17b239a556b1d234aace9b333f71ec2045 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.5 on 2022-03-31 15:57
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Poll',
fields=[
... | 31.882353 | 117 | 0.564576 |
19a2cd15b16e21896e6396fa33f8690b1b0a431f | 5,590 | py | Python | packages/watchmen-model/src/watchmen_model/dqc/dqc_pipelines.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-model/src/watchmen_model/dqc/dqc_pipelines.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-model/src/watchmen_model/dqc/dqc_pipelines.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from typing import List
from watchmen_model.admin import Factor, MappingFactor, Pipeline, PipelineStage, PipelineTriggerType, PipelineUnit, \
Topic, WriteTopicActionType
from watchmen_model.admin.pipeline_action_write import InsertOrMergeRowAction
from watchmen_model.common import ComputedParameter, ConstantParameter... | 36.064516 | 117 | 0.685331 |
fd8193ea87115f3385f71fb342f68c8f606746e0 | 861 | py | Python | algorithm/sorting_algorithms_in_python/sorting.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | algorithm/sorting_algorithms_in_python/sorting.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | algorithm/sorting_algorithms_in_python/sorting.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | from random import randint
from insertion_sort import insertion_sort
from merge_sort import merge_sort
from quick_sort import quicksort
from timesort import timesort
from sorting_timer import run_sorting_algorithm, ARRAY_LENGTH
if __name__ == "__main__":
# Generate an array of `ARRAY_LENGTH` items consis... | 41 | 69 | 0.765389 |
fdd214c77e21ac3bda6eab39dd2a2da8a6a42074 | 444 | py | Python | utils/cache.py | dr-bigfatnoob/quirk | f5025d7139adaf06380c429b436ccbf1e7611a16 | [
"Unlicense"
] | 1 | 2021-03-05T07:44:05.000Z | 2021-03-05T07:44:05.000Z | utils/cache.py | dr-bigfatnoob/quirk | f5025d7139adaf06380c429b436ccbf1e7611a16 | [
"Unlicense"
] | 3 | 2017-06-04T03:01:31.000Z | 2017-08-04T04:04:37.000Z | utils/cache.py | dr-bigfatnoob/quirk | f5025d7139adaf06380c429b436ccbf1e7611a16 | [
"Unlicense"
] | null | null | null | from __future__ import print_function, division
import sys
import os
sys.path.append(os.path.abspath("."))
sys.dont_write_bytecode = True
from utils.lib import mkdir
import cPickle as cPkl
def load_file(file_name):
with open(file_name) as f:
return cPkl.load(f)
def save_file(file_name, obj):
directory = fil... | 22.2 | 47 | 0.736486 |
47f58f8264613a465770a1b78bd72ee22cd90842 | 923 | py | Python | Hackerrank_problems/Sherlock_and_Permutation/solution.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 165 | 2020-10-03T08:01:11.000Z | 2022-03-31T02:42:08.000Z | Hackerrank_problems/Sherlock_and_Permutation/solution.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 383 | 2020-10-03T07:39:11.000Z | 2021-11-20T07:06:35.000Z | Hackerrank_problems/Sherlock_and_Permutation/solution.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 380 | 2020-10-03T08:05:04.000Z | 2022-03-19T06:56:59.000Z | #!/bin/python3
import os
import sys
import math
# Complete the solve function below.
def solve(n, m):
"""
this is the alghorithm to calculate the permutation
since it's said that it wants only the one starts with 1
so we just need to calculate m-1+n permutatiton
"""
mod = 10**9 + 7
m = m-1
... | 24.945946 | 78 | 0.617551 |
7bf341537172979515f7c84725ee9ca2bf681dba | 550 | py | Python | novel/crawler/rudaozhisheng/spiders/sdmoz_spider.py | East196/hello-py | a77c7a0c8e5e2b5e8cefaf0fda335ab0c3b1da21 | [
"Apache-2.0"
] | 1 | 2017-10-23T14:58:47.000Z | 2017-10-23T14:58:47.000Z | novel/crawler/rudaozhisheng/spiders/sdmoz_spider.py | East196/hello-py | a77c7a0c8e5e2b5e8cefaf0fda335ab0c3b1da21 | [
"Apache-2.0"
] | null | null | null | novel/crawler/rudaozhisheng/spiders/sdmoz_spider.py | East196/hello-py | a77c7a0c8e5e2b5e8cefaf0fda335ab0c3b1da21 | [
"Apache-2.0"
] | 1 | 2018-04-06T07:49:18.000Z | 2018-04-06T07:49:18.000Z | import scrapy
class SmallDmozSpider(scrapy.Spider):
name = "sdmoz"
allowed_domains = ["biquge.tw"]
start_urls = [
"http://www.biquge.tw/0_52/"
]
def parse(self, response):
for sel in response.xpath('//*[@id="list"]/dl/dd'):
yield {
'title': sel.xpath('a... | 28.947368 | 74 | 0.5 |
efb5dabc2dadab213b9246d224e89618c63e8de9 | 22,209 | py | Python | src/onegov/org/utils.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/org/utils.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/org/utils.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | import colorsys
import re
import sedate
from contextlib import suppress
from collections import defaultdict, Counter, OrderedDict
from datetime import datetime, time, timedelta
from isodate import parse_date, parse_datetime
from itertools import groupby
from libres.modules import errors as libres_errors
from lxml.html... | 30.633103 | 79 | 0.606871 |
08dc9d4658dfb23b054bf91beb000b4703418561 | 2,453 | py | Python | NER/run.py | moasgh/BumbleBee | 2b0aae7970ab316c7b8b12dd4032b41ee1772aad | [
"MIT"
] | 7 | 2020-03-06T05:53:43.000Z | 2022-01-30T17:31:18.000Z | NER/run.py | moasgh/BumbleBee | 2b0aae7970ab316c7b8b12dd4032b41ee1772aad | [
"MIT"
] | null | null | null | NER/run.py | moasgh/BumbleBee | 2b0aae7970ab316c7b8b12dd4032b41ee1772aad | [
"MIT"
] | null | null | null | from handlers import *
from utils import *
import re
import os
embeds = [ {"lookup": 100} ]
models = [ 'rnn_two_crf_seq' , 'rnn_two_crf_seq2' ]
for dbname in os.listdir('datasets/'):
db_name = dbname
for embed in embeds:
for model in models:
output_path = model + '_' + list(embed.keys())[0] ... | 51.104167 | 170 | 0.534855 |
de4c0404d008e54317a802bb98adc56c44fc1577 | 222 | py | Python | pacman-arch/test/pacman/tests/database001.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/database001.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/database001.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-09-26T08:44:40.000Z | 2021-09-26T08:44:40.000Z | self.description = "-D --asdeps"
lp = pmpkg("pkg")
lp.reason = 0
self.addpkg2db("local", lp)
self.args = "-D pkg --asdeps"
self.addrule("PACMAN_RETCODE=0")
self.addrule("PKG_EXIST=pkg")
self.addrule("PKG_REASON=pkg|1")
| 18.5 | 32 | 0.689189 |
c210ae937b5d385d3772f40d20283019acbc23b3 | 245 | py | Python | Licence 1/I11/TP4/ex5.3.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | 8 | 2020-11-26T20:45:12.000Z | 2021-11-29T15:46:22.000Z | Licence 1/I11/TP4/ex5.3.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | null | null | null | Licence 1/I11/TP4/ex5.3.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | 6 | 2020-10-23T15:29:24.000Z | 2021-05-05T19:10:45.000Z | semaine = [
"lundi",
"mardi",
"mercredi",
"jeudi",
"vendredi",
"samedi",
"dimanche"
]
calendNov18 = []
for i in range(1, 31):
calendNov18 += [semaine[i % 7 - 5] + " " + str(i) + " novembre"]
print(calendNov18)
| 14.411765 | 68 | 0.514286 |
a0a84fa38aa5651782e571f392ebb07160f1b1a7 | 571 | py | Python | DataStructure/U8/U8_56.py | qiaw99/Data-Structure | 3b1cdce96d4f35329ccfec29c03de57378ef0552 | [
"MIT"
] | 1 | 2019-10-29T08:21:41.000Z | 2019-10-29T08:21:41.000Z | DataStructure/U8/U8_56.py | qiaw99/Data-Structure | 3b1cdce96d4f35329ccfec29c03de57378ef0552 | [
"MIT"
] | null | null | null | DataStructure/U8/U8_56.py | qiaw99/Data-Structure | 3b1cdce96d4f35329ccfec29c03de57378ef0552 | [
"MIT"
] | null | null | null | import os
import sys
class Logger(object):
def __init__(self, filename = "daten.txt"):
self.terminal = sys.stdout
self.log = open(filename, "a")
def write(self, message):
self.terminal.write(message)
self.log.write(message)
def flush(self):
pass
path = os.path.abspath(os.path.dirname(__file__)... | 20.392857 | 49 | 0.588441 |
2663c2ec4d2fff703dfdd4b31bb164a3832fc4b4 | 1,421 | py | Python | app/app.py | student1304/co2 | dc83bb19d1f75ac7b04273e8d9c3f14a3a44153c | [
"Apache-2.0"
] | null | null | null | app/app.py | student1304/co2 | dc83bb19d1f75ac7b04273e8d9c3f14a3a44153c | [
"Apache-2.0"
] | null | null | null | app/app.py | student1304/co2 | dc83bb19d1f75ac7b04273e8d9c3f14a3a44153c | [
"Apache-2.0"
] | null | null | null | import streamlit as st
import pandas as pd
from PIL import Image
#import numpy as np
#import time
# from api_tools import get_product_info
#from eua_tools import fetch_eua_price
from calculator_tools import get_result, get_chart_data
# load md text from file and display on page
image = Image.open("./app/co2bon-logo.p... | 31.577778 | 79 | 0.688951 |
267e19ef2fc17d19c59b51d326869da0d8d4a199 | 793 | py | Python | _posts/code/rejection-sampling/circle_rejection_sampling.py | agdenadel/agdenadel.github.io | 603f042e5d66d998300c720be6f9cf1f4d87ffc9 | [
"MIT"
] | null | null | null | _posts/code/rejection-sampling/circle_rejection_sampling.py | agdenadel/agdenadel.github.io | 603f042e5d66d998300c720be6f9cf1f4d87ffc9 | [
"MIT"
] | null | null | null | _posts/code/rejection-sampling/circle_rejection_sampling.py | agdenadel/agdenadel.github.io | 603f042e5d66d998300c720be6f9cf1f4d87ffc9 | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
def square_uniform_sampling(num_samples):
return np.random.uniform(low=[-1,-1], high=[1,1], size=(num_samples,2))
def point_in_circle(point):
return point[0]**2 + point[1]**2 < 1
def get_points_in_circle(points):
return points[list(map(point_in_circle... | 22.027778 | 75 | 0.727617 |
26ddd877c2328f1a60ff877d49073ee955b628e6 | 1,524 | py | Python | rawio/raw/lut.py | hdkai/Raw-IO | f0fa928d7ef59a363c6f4c876d642af6dede6ae4 | [
"Apache-2.0"
] | null | null | null | rawio/raw/lut.py | hdkai/Raw-IO | f0fa928d7ef59a363c6f4c876d642af6dede6ae4 | [
"Apache-2.0"
] | null | null | null | rawio/raw/lut.py | hdkai/Raw-IO | f0fa928d7ef59a363c6f4c876d642af6dede6ae4 | [
"Apache-2.0"
] | null | null | null | #
# RawIO
# Copyright (c) 2021 Yusuf Olokoba.
#
from imageio import imread
from torch import stack, zeros_like, Tensor
from torch.nn.functional import grid_sample
from torchvision.transforms import ToTensor
def color_sample_1d (input: Tensor, lut: Tensor) -> Tensor:
"""
Apply a 1D look-up table to an ima... | 27.214286 | 99 | 0.605643 |
f887db6f08016daf9baf1a19df1dce2ba5bc3fd0 | 1,997 | py | Python | MyRecognitionImage.py | hakimkt/SAIVS | c310bd7c9426f0d21efeea8866cf6b881b7e8530 | [
"Apache-2.0"
] | 40 | 2018-10-29T02:29:13.000Z | 2021-11-23T13:14:50.000Z | MyRecognitionImage.py | 5l1v3r1/SAIVS | aa62451665b6398ba329d68592bf4313be60a886 | [
"Apache-2.0"
] | 1 | 2021-02-23T12:27:28.000Z | 2021-02-23T12:27:28.000Z | MyRecognitionImage.py | 5l1v3r1/SAIVS | aa62451665b6398ba329d68592bf4313be60a886 | [
"Apache-2.0"
] | 29 | 2018-10-29T02:29:17.000Z | 2022-03-17T06:31:35.000Z | #!/usr/bin/python
#coding:utf-8
import base64
import json
from requests import Request, Session
# Cloud Vision APIで画像を分析
class RecognizeImage():
def __init__(self):
return
# CAPTCHAの分析
def recognize_captcha(self, str_image_path):
# CAPTCHA画像の読み込み
bin_captcha = ope... | 29.367647 | 74 | 0.45969 |
3e5597dd413382bf0ae18bbc9e867df59ed6349b | 5,519 | py | Python | as-wechsel/neue_vau_instanz.py | bergerst/api-ePA | 9a1b239c43d752837fcdfbf08b6c3f369f3063de | [
"Apache-2.0"
] | 1 | 2021-09-09T21:34:59.000Z | 2021-09-09T21:34:59.000Z | as-wechsel/neue_vau_instanz.py | gematik/ref-ePA-HealthRecordMigration | 12fa995b4f790c1f7d7dc8ed49b9cf81713c2aaa | [
"Apache-2.0"
] | null | null | null | as-wechsel/neue_vau_instanz.py | gematik/ref-ePA-HealthRecordMigration | 12fa995b4f790c1f7d7dc8ed49b9cf81713c2aaa | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/env python3
# -*- coding: UTF-8 -*-
"""
Das ist die Referenzimplementierung für die Verschlüsselung und Signatur
beim Export der Akte für den AS-Wechsel.
Die ist der Code für die neue (i. S. v. importierende) VAU-Instanz.
Die alte VAU-Instanz stellt das Export-Paket zunächst als ZIP-File zusammen.
Und da... | 42.782946 | 87 | 0.725131 |
5f9842f992fb2f3e905a3e3d4e3904b05056fe95 | 2,382 | py | Python | MovieDetail.py | whde/Movie | 5d712642242042b0fa2e43f526605def9a6a4343 | [
"MIT"
] | 1 | 2018-12-03T06:08:46.000Z | 2018-12-03T06:08:46.000Z | MovieDetail.py | whde/Movie | 5d712642242042b0fa2e43f526605def9a6a4343 | [
"MIT"
] | null | null | null | MovieDetail.py | whde/Movie | 5d712642242042b0fa2e43f526605def9a6a4343 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: UTF-8 -*-
import ssl
import time
from bs4 import BeautifulSoup
from urllib.parse import quote
import string
import urllib3
import pymysql
import re
import hashlib
urllib3.disable_warnings()
user_agent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14) AppleWebKit\
/537.36 (KHTML,... | 31.342105 | 75 | 0.570109 |
5fd4f93c93c9f10e6c70784937c19a4acffbcad6 | 476 | py | Python | 3_zufall/2_zufallsAlter.py | Coding-for-the-Arts/drawbot-samples | e37994f3497aca252312431100b53548b4573f15 | [
"CC0-1.0"
] | null | null | null | 3_zufall/2_zufallsAlter.py | Coding-for-the-Arts/drawbot-samples | e37994f3497aca252312431100b53548b4573f15 | [
"CC0-1.0"
] | null | null | null | 3_zufall/2_zufallsAlter.py | Coding-for-the-Arts/drawbot-samples | e37994f3497aca252312431100b53548b4573f15 | [
"CC0-1.0"
] | null | null | null | """
Als ich … Jahre alt war
"""
myRandomValue = random()
# print(myRandomValue)
myAge = 43
randomPointInTime = myAge * random()
roundedResult = round(randomPointInTime)
print("Als ich", roundedResult, "Jahre alt war …")
"""
- Ersetze die Zahl 43 mit deinem Alter.
- Führe das Programm ein paar mal aus und erinnere ... | 23.8 | 77 | 0.733193 |
840687254879445457c8c4d9197dfac93984d49c | 1,243 | py | Python | 2_DeepLearning-Keras/05_Projekt_MNIST_mit_GUI/gui/preprocessing.py | felixdittrich92/DeepLearning-tensorflow-keras | 2880d8ed28ba87f28851affa92b6fa99d2e47be9 | [
"Apache-2.0"
] | null | null | null | 2_DeepLearning-Keras/05_Projekt_MNIST_mit_GUI/gui/preprocessing.py | felixdittrich92/DeepLearning-tensorflow-keras | 2880d8ed28ba87f28851affa92b6fa99d2e47be9 | [
"Apache-2.0"
] | null | null | null | 2_DeepLearning-Keras/05_Projekt_MNIST_mit_GUI/gui/preprocessing.py | felixdittrich92/DeepLearning-tensorflow-keras | 2880d8ed28ba87f28851affa92b6fa99d2e47be9 | [
"Apache-2.0"
] | null | null | null | import os
import numpy as np
import matplotlib.pyplot as plt
import cv2
from scipy.ndimage import center_of_mass
PROJECT_PATH = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
def load(image_path):
image = cv2.imread(image_path, cv2.IMREAD_GRAYSCALE)
return image
def resize(image):
image =... | 27.021739 | 75 | 0.681416 |
4b8fbeb65d674e6a15784bf7c88d4abf2986f7e4 | 2,426 | py | Python | bindings/python/ensmallen/datasets/wikidata.py | LucaCappelletti94/EnsmallenGraph | 572532b6d3f4352bf58f9ccca955376acd95fd89 | [
"MIT"
] | null | null | null | bindings/python/ensmallen/datasets/wikidata.py | LucaCappelletti94/EnsmallenGraph | 572532b6d3f4352bf58f9ccca955376acd95fd89 | [
"MIT"
] | null | null | null | bindings/python/ensmallen/datasets/wikidata.py | LucaCappelletti94/EnsmallenGraph | 572532b6d3f4352bf58f9ccca955376acd95fd89 | [
"MIT"
] | null | null | null | """Module providing graphs available from WikiData.
References
----------
Please cite:
```bib
@article{vrandevcic2014wikidata,
title={Wikidata: a free collaborative knowledgebase},
author={Vrande{\v{c}}i{\'c}, Denny and Kr{\"o}tzsch, Markus},
journal={Communications of the ACM},
volume={57},
number={10},
... | 31.506494 | 96 | 0.697444 |
8a32914d43da437dd477b41c6301b8421dbc5f45 | 141 | py | Python | my-cs/projects_util/py_vm_benchmarks/test_um_nose.py | zaqwes8811/cs-courses | aa9cf5ad109c9cfcacaadc11bf2defb2188ddce2 | [
"Apache-2.0"
] | null | null | null | my-cs/projects_util/py_vm_benchmarks/test_um_nose.py | zaqwes8811/cs-courses | aa9cf5ad109c9cfcacaadc11bf2defb2188ddce2 | [
"Apache-2.0"
] | null | null | null | my-cs/projects_util/py_vm_benchmarks/test_um_nose.py | zaqwes8811/cs-courses | aa9cf5ad109c9cfcacaadc11bf2defb2188ddce2 | [
"Apache-2.0"
] | null | null | null |
#from unnecessary_math import multiply
def test_numbers_3_4():
assert 12 == 12
def test_strings_a_3():
assert 'aaa' == 'aaa'
| 15.666667 | 38 | 0.666667 |
8a5b17a8e75951034ceadef31646d932d225ef3e | 2,704 | py | Python | src/onegov/wtfs/models/invoice.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/wtfs/models/invoice.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/wtfs/models/invoice.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from csv import writer
from datetime import datetime
from onegov.wtfs.models.municipality import Municipality
from onegov.wtfs.models.scan_job import ScanJob
class Invoice(object):
def __init__(self, session):
self.session = session
self.from_date = None
self.to_date = None
self.c... | 33.8 | 79 | 0.545118 |
8a8b7781159f5ff06c1e151420deb66062d8a7b2 | 36,946 | py | Python | eve/tests/versioning.py | RedTurtle/eve | beaf413372294d4c611f4948fbee904b8e4bc043 | [
"BSD-3-Clause"
] | 1 | 2015-02-10T17:38:18.000Z | 2015-02-10T17:38:18.000Z | pythonlib/eve/tests/versioning.py | Jumpscale/web | 8e8ec2ce01f3105c7647ee8a0c90af09311cbbeb | [
"Apache-2.0"
] | null | null | null | pythonlib/eve/tests/versioning.py | Jumpscale/web | 8e8ec2ce01f3105c7647ee8a0c90af09311cbbeb | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from bson import ObjectId
import copy
from eve.tests import TestBase
from eve import STATUS, STATUS_OK, ETAG
from eve.tests.test_settings import MONGO_DBNAME
class TestVersioningBase(TestBase):
def setUp(self):
self.versioned_field = 'ref'
self.unversioned_field = 'prog'
... | 40.689427 | 79 | 0.634304 |
6a9dadd182a1bb6dabc81fc470d880f3cc444786 | 89 | py | Python | src/labtest/apps.py | oguzhanakan0/covidlab-server | 68ea4e6cd3b1244117ae43275335896b911a9b2a | [
"MIT"
] | null | null | null | src/labtest/apps.py | oguzhanakan0/covidlab-server | 68ea4e6cd3b1244117ae43275335896b911a9b2a | [
"MIT"
] | 1 | 2022-03-25T05:33:19.000Z | 2022-03-25T05:33:19.000Z | src/labtest/apps.py | oguzhanakan0/covidlab-server | 68ea4e6cd3b1244117ae43275335896b911a9b2a | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class LabtestConfig(AppConfig):
name = 'labtest'
| 14.833333 | 33 | 0.752809 |
0af10e206f7ed85eee7120d07dcf4f7254030ac9 | 9,490 | py | Python | CharakterBeschreibung.py | klnrdknt/Sephrasto | 591224fe01825a169c21ebc6136533f282ce9a0b | [
"MIT"
] | 15 | 2017-11-09T12:49:52.000Z | 2022-03-06T12:18:48.000Z | CharakterBeschreibung.py | klnrdknt/Sephrasto | 591224fe01825a169c21ebc6136533f282ce9a0b | [
"MIT"
] | 40 | 2018-02-01T21:32:01.000Z | 2022-03-22T11:35:28.000Z | CharakterBeschreibung.py | klnrdknt/Sephrasto | 591224fe01825a169c21ebc6136533f282ce9a0b | [
"MIT"
] | 13 | 2018-03-12T17:50:42.000Z | 2022-03-06T12:21:41.000Z | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'CharakterBeschreibung.ui'
#
# Created by: PyQt5 UI code generator 5.15.4
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt5 impor... | 55.823529 | 115 | 0.713488 |
7c908d00faaf55a06a10c026db772f4f83d0a7b9 | 7,256 | py | Python | Packs/CofenseTriage/Integrations/CofenseTriagev3/test_data/input_data.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/CofenseTriage/Integrations/CofenseTriagev3/test_data/input_data.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/CofenseTriage/Integrations/CofenseTriagev3/test_data/input_data.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import time
import dateparser
MESSAGES = {
'NO_RECORDS_FOUND': "No {} were found for the given argument(s).",
"API_TOKEN": "No API token found. Please try again.",
"PAGE_SIZE": "{} is an invalid value for page size. Page size must be between 1 and 200.",
"PAGE_NUMBER": "{} is an invalid value for page ... | 51.098592 | 119 | 0.623208 |
7c9dda02c445c253a8a0457aa905f2f1e6d3de16 | 363 | py | Python | doc/examples/mixed_classic_type_hint.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 88 | 2019-01-08T16:39:08.000Z | 2022-02-06T14:19:23.000Z | doc/examples/mixed_classic_type_hint.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 13 | 2019-06-20T15:53:10.000Z | 2021-02-09T11:03:29.000Z | doc/examples/mixed_classic_type_hint.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 1 | 2019-11-05T03:03:14.000Z | 2019-11-05T03:03:14.000Z | import numpy as np
# don't import skimage in a Pythran file. Here, no problem!
from skimage.filters import sobel
from transonic import boost
# transonic def func(float[][], float[][])
# transonic def func(int[][], float[][])
@boost
def func(a: float, b: float):
return (a * np.log(b)).max()
@boost
def func1(a... | 18.15 | 59 | 0.655647 |
7c9fd9e1cbb91d8bb777871f82faf2a276852779 | 9,227 | py | Python | hihope_neptune-oh_hid/00_src/v0.1/test/developertest/src/core/build/build_testcases.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.1/test/developertest/src/core/build/build_testcases.py | dawmlight/vendor_oh_fun | bc9fb50920f06cd4c27399f60076f5793043c77d | [
"Apache-2.0"
] | null | null | null | hihope_neptune-oh_hid/00_src/v0.1/test/developertest/src/core/build/build_testcases.py | dawmlight/vendor_oh_fun | bc9fb50920f06cd4c27399f60076f5793043c77d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# 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
#
# Unle... | 36.184314 | 78 | 0.610383 |
7cfc81a46767127dc68378ea3f0042464fe2f90b | 4,021 | py | Python | skripte/python/histogramm/analyse.py | hyphenation/languages-german | 4330a0b1254e88615cb4c83e4b3dc2f0810c76d9 | [
"MIT"
] | null | null | null | skripte/python/histogramm/analyse.py | hyphenation/languages-german | 4330a0b1254e88615cb4c83e4b3dc2f0810c76d9 | [
"MIT"
] | null | null | null | skripte/python/histogramm/analyse.py | hyphenation/languages-german | 4330a0b1254e88615cb4c83e4b3dc2f0810c76d9 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# :Author: Pander <pander@users.sourceforge.net>
# :License: GNU General Public License (v. 2 or later)
# :Version: 0.1 (2013-11-05)
import codecs
import operator
import re
directory = '../../..'
#filenames = ['arzneiwirkstoffnamen', 'arzneiwirkstoffnamen-supplement', 'w... | 38.663462 | 145 | 0.5715 |
8615e2e953164b6afb543b86a9d2cf22c5092fdd | 173 | py | Python | py-basics/src/lectures/django/pip-demo.py | NadimBhatti05/s4f | 41d3525bc286ee0b6e727c601f036a96b3c2fb2c | [
"CC0-1.0"
] | null | null | null | py-basics/src/lectures/django/pip-demo.py | NadimBhatti05/s4f | 41d3525bc286ee0b6e727c601f036a96b3c2fb2c | [
"CC0-1.0"
] | null | null | null | py-basics/src/lectures/django/pip-demo.py | NadimBhatti05/s4f | 41d3525bc286ee0b6e727c601f036a96b3c2fb2c | [
"CC0-1.0"
] | 4 | 2021-12-13T15:52:00.000Z | 2022-03-28T13:54:53.000Z | # on the console:
# > pip install requests
# > pip list
import requests
response = requests.get("https://google.com/")
print(response) # should produce -> <Response [200]> | 21.625 | 52 | 0.699422 |
d4f4401e86890c8e7273d886be384409c67be97a | 8,306 | py | Python | controller/rtc.py | huberthoegl/tsgrain | 405d0ba8b98c2afa950d27294e55cd1e07506db4 | [
"Apache-2.0"
] | 1 | 2021-06-15T08:59:02.000Z | 2021-06-15T08:59:02.000Z | controller/rtc.py | huberthoegl/tsgrain | 405d0ba8b98c2afa950d27294e55cd1e07506db4 | [
"Apache-2.0"
] | null | null | null | controller/rtc.py | huberthoegl/tsgrain | 405d0ba8b98c2afa950d27294e55cd1e07506db4 | [
"Apache-2.0"
] | null | null | null | #DS 3231 RTC Real Time Clock, Registerbelegung auf Datenblatt S.15
import smbus
import time
from datetime import datetime, time, date
#I2C-Adresse
address = 0x68
#Register für Aktuelle Zeit
register = 0x00 #Hierbei wird diesmal nicht write_byte_data verwendet um 7 Byte sofort am Stück in das Register zu schreiben, d... | 33.62753 | 171 | 0.647725 |
07d3686935f7ef83644cd264abbe36aa22be1d46 | 281 | py | Python | AP_SS16/503/python/microscop.py | DimensionalScoop/kautschuk | 90403f97cd60b9716cb6a06668196891d5d96578 | [
"MIT"
] | 3 | 2016-04-27T17:07:00.000Z | 2022-02-02T15:43:15.000Z | AP_SS16/503/python/microscop.py | DimensionalScoop/kautschuk | 90403f97cd60b9716cb6a06668196891d5d96578 | [
"MIT"
] | 5 | 2016-04-27T17:10:03.000Z | 2017-06-20T14:54:20.000Z | AP_SS16/503/python/microscop.py | DimensionalScoop/kautschuk | 90403f97cd60b9716cb6a06668196891d5d96578 | [
"MIT"
] | null | null | null | print("Spaltbreiten")
print("Doppelspalt:")
zoom_units = 2e-4 * 2.4
print("Spaltabstand:", zoom_units / 1)
print("Spaltbreite:", zoom_units / 4)
print("Einzelspaltbreiten:")
print("Groß (vermutlich):", 4e-4)
print("Mittel:", zoom_units / 3)
print("Klein:", zoom_units / 4 * 2 / 3)
| 28.1 | 39 | 0.686833 |
133a292ef6ce35df577ae44e6d040455d8f4fabe | 1,082 | py | Python | python/oneflow/compatible/single_client/test/models/env_2node.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/models/env_2node.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/models/env_2node.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... | 31.823529 | 78 | 0.768946 |
6a02173d57c83c191481880b7063f7e8e10fcbb9 | 398 | py | Python | Road_safety/hackathon/migrations/0002_driver_detected.py | mukul54/xyz-bosch | 92a3f2d1e8c8308547b2e9de5d5b20ebdd6d925a | [
"Apache-2.0"
] | 3 | 2019-07-05T16:52:34.000Z | 2021-07-09T09:01:03.000Z | Road_safety/hackathon/migrations/0002_driver_detected.py | mukul54/xyz-bosch | 92a3f2d1e8c8308547b2e9de5d5b20ebdd6d925a | [
"Apache-2.0"
] | 5 | 2020-08-18T21:45:56.000Z | 2021-04-13T14:36:47.000Z | Road_safety/hackathon/migrations/0002_driver_detected.py | mukul54/xyz-bosch | 92a3f2d1e8c8308547b2e9de5d5b20ebdd6d925a | [
"Apache-2.0"
] | 2 | 2019-07-02T21:36:40.000Z | 2019-08-23T16:17:11.000Z | # Generated by Django 2.1.7 on 2019-03-30 09:37
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('hackathon', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='driver',
name='detected... | 20.947368 | 54 | 0.565327 |
168c78d10400d3bda779d8c20e807c448445363a | 3,290 | py | Python | tools/legacy/mw4-erf-converter/readErf.py | gifted-nguvu/darkstar-dts-converter | aa17a751a9f3361ca9bbb400ee4c9516908d1297 | [
"MIT"
] | 2 | 2020-03-18T18:23:27.000Z | 2020-08-02T15:59:16.000Z | tools/legacy/mw4-erf-converter/readErf.py | gifted-nguvu/darkstar-dts-converter | aa17a751a9f3361ca9bbb400ee4c9516908d1297 | [
"MIT"
] | 5 | 2019-07-07T16:47:47.000Z | 2020-08-10T16:20:00.000Z | tools/legacy/mw4-erf-converter/readErf.py | gifted-nguvu/darkstar-dts-converter | aa17a751a9f3361ca9bbb400ee4c9516908d1297 | [
"MIT"
] | 1 | 2020-03-18T18:23:30.000Z | 2020-03-18T18:23:30.000Z | import struct
def readArray(offset, rawData, fmt, numItems):
items = []
index = 0
while index < numItems:
otherData = struct.unpack_from(fmt, rawData, offset)
offset += struct.calcsize(fmt)
items.append(otherData)
index += 1
return (offset, items)
def readLod(offset, ra... | 30.747664 | 67 | 0.677508 |
9104611504562a150422dc2ddedccbe9dec8fed1 | 4,544 | py | Python | fuzzcli/engine/afl.py | ifoundthetao/FuzzFlow | 86559ac7f85fc89510c0d9647e02880edb95aa2a | [
"MIT"
] | null | null | null | fuzzcli/engine/afl.py | ifoundthetao/FuzzFlow | 86559ac7f85fc89510c0d9647e02880edb95aa2a | [
"MIT"
] | null | null | null | fuzzcli/engine/afl.py | ifoundthetao/FuzzFlow | 86559ac7f85fc89510c0d9647e02880edb95aa2a | [
"MIT"
] | null | null | null | import threading, os, subprocess, hashlib, time, shlex
from client.helper import Helper
class Fuzzer():
prev_hsh = ''
helper = None
timer = None
proc = None
out_dir = ''
def __init__(self, job, engine, target, options):
self.job = job
self.engine = engine
self.target =... | 32.457143 | 148 | 0.507923 |
9136551260e18187d9522841d0dac91118ee7773 | 526 | py | Python | pacman-termux/test/pacman/tests/symlink001.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/symlink001.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/symlink001.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-09-26T08:44:40.000Z | 2021-09-26T08:44:40.000Z | self.description = "Dir symlinks overwritten on install (the perl/git bug)"
lp = pmpkg("dummy")
lp.files = ["dir/realdir/",
"dir/symdir -> realdir"]
self.addpkg2db("local", lp)
p = pmpkg("pkg1")
p.files = ["dir/symdir/tmp"]
self.addpkg(p)
self.args = "-U %s" % p.filename()
self.addrule("PACMAN_RETCODE=1... | 26.3 | 75 | 0.693916 |
e6738e7213bd40209458756831ac7b12310208d5 | 5,461 | py | Python | zmk/utility/codeUtilityClass.py | center3d/MLW | 192cc991df61bd8991a51702a53df6a09448d4f7 | [
"Apache-2.0"
] | 2 | 2021-02-22T18:36:21.000Z | 2021-06-12T20:28:43.000Z | zmk/utility/codeUtilityClass.py | vadgama/MLW | 5ca2926aadc33d9a8a55cbf07faa472fa03e9f73 | [
"Apache-2.0"
] | 12 | 2019-12-09T13:38:30.000Z | 2022-02-10T00:31:27.000Z | zmk/utility/codeUtilityClass.py | surbhi-software/ZMOD-development | a4ff27d86f72769350d46d5c579ff92110c7273d | [
"Apache-2.0"
] | 1 | 2020-02-29T12:18:28.000Z | 2020-02-29T12:18:28.000Z | import sys,json
import subprocess
from django.http import JsonResponse
from utility.utilityClass import RUNNING_TASK_MEMORY
from random import choice
from string import ascii_uppercase
import datetime
import linecache
from trainModel import kerasUtilities
kerasUtilities = kerasUtilities.KerasUtilities()
logFolder='./lo... | 35.69281 | 114 | 0.603736 |
fc0cd33fc7130658722cf5c40601e8a17815f5ac | 7,635 | py | Python | research/cv/SiamFC/src/alexnet.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | null | null | null | research/cv/SiamFC/src/alexnet.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | null | null | null | research/cv/SiamFC/src/alexnet.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 2 | 2019-09-01T06:17:04.000Z | 2019-10-04T08:39:45.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 46.554878 | 96 | 0.538572 |
5dae014aa3b1dfe7a53ee35112b692c0cf8b17b1 | 381 | py | Python | python/gdal_cookbook/cookbook_geometry/create_geometry_collection.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/gdal_cookbook/cookbook_geometry/create_geometry_collection.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/gdal_cookbook/cookbook_geometry/create_geometry_collection.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | from osgeo import ogr
# Create a geometry collection
geomcol = ogr.Geometry(ogr.wkbGeometryCollection)
# Add a point
point = ogr.Geometry(ogr.wkbPoint)
point.AddPoint(-122,23, 47.14)
geomcol.AddGeometry(point)
# Add a line
line = ogr.Geometry(ogr.wkbLineString)
line.AddPoint(-122.60, 47.14)
line.AddPoint(-122.48, 47... | 21.166667 | 49 | 0.766404 |
5d34d97c13731c3816c205f054e8e69141074d47 | 5,604 | py | Python | python/odml/scripts/inm6_custom_validations.py | mpsonntag/snippets | fc3cc42ea49b885c1f29c0aef1379055a931a978 | [
"BSD-3-Clause"
] | null | null | null | python/odml/scripts/inm6_custom_validations.py | mpsonntag/snippets | fc3cc42ea49b885c1f29c0aef1379055a931a978 | [
"BSD-3-Clause"
] | null | null | null | python/odml/scripts/inm6_custom_validations.py | mpsonntag/snippets | fc3cc42ea49b885c1f29c0aef1379055a931a978 | [
"BSD-3-Clause"
] | null | null | null | """
Custom validations for the odML library, the validations
are specific for an INM6 use case. Check the tutorial on
python-odml.readthedocs.org for a general odml validation
introduction.
These validations require an odml library >= 1.5.0.
"""
import os
import pathlib
import odml
from odml.validation import IssueI... | 37.112583 | 96 | 0.673091 |
53d2563be0b3d5a3b3324ab265b47cb425091a0b | 8,175 | py | Python | old/baxter_utils_new.py | YoshimitsuMatsutaIe/hoge_flow_test | 22e2e2ce043a3107bd06449f6f9958641293e414 | [
"MIT"
] | null | null | null | old/baxter_utils_new.py | YoshimitsuMatsutaIe/hoge_flow_test | 22e2e2ce043a3107bd06449f6f9958641293e414 | [
"MIT"
] | null | null | null | old/baxter_utils_new.py | YoshimitsuMatsutaIe/hoge_flow_test | 22e2e2ce043a3107bd06449f6f9958641293e414 | [
"MIT"
] | null | null | null | """これが一番最新"""
import numpy as np
from math import cos, sin, tan, pi, sqrt
import baxter_utils_3
class BaxterKinematicsNew:
"""ローカル座標系の原点,ヤコビ行列等を計算
・行列べた書きを廃止
"""
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... | 26.715686 | 108 | 0.380306 |
0713cd909e3b83aabbd0c0e8162363102120c74b | 2,185 | py | Python | tools/datasets_convert/contact_coco.py | UESTC-Liuxin/SkmtSeg | 1251de57fae967aca395644d1c70a9ba0bb52271 | [
"Apache-2.0"
] | 2 | 2020-12-22T08:40:05.000Z | 2021-03-30T08:09:44.000Z | tools/datasets_convert/contact_coco.py | UESTC-Liuxin/SkmtSeg | 1251de57fae967aca395644d1c70a9ba0bb52271 | [
"Apache-2.0"
] | null | null | null | tools/datasets_convert/contact_coco.py | UESTC-Liuxin/SkmtSeg | 1251de57fae967aca395644d1c70a9ba0bb52271 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
@description:
Combine all the coco sub-data sets and follow the format of
{JointSectionNumber_date_index}(Shoulder5_200805_0001.img)
@author: LiuXin
@contact: xinliu1996@163.com
@Created on: 2020/8/6 上午9:40
"""
import os
from pycocotools.coco import COCO
from tools.datasets_convert.coco2voc... | 22.760417 | 91 | 0.648513 |
4aec652cf756d9916377aa8bc3c0ff2c58a13126 | 631 | py | Python | IVTa/2014/GOLUBEV_A_S/task_5_44.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | IVTa/2014/GOLUBEV_A_S/task_5_44.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | IVTa/2014/GOLUBEV_A_S/task_5_44.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | # Задача 5. Вариант 44.
# Напишите программу, которая бы при запуске случайным образом отображала
# название одной из семи основных физических единиц, согласно Международной системы единиц.
# Golubev A. S.
# 31.03.2016
import random
si = 'Длина, Масса, Время, Сила электрического тока, \
Температура, Колич... | 28.681818 | 92 | 0.732171 |
ab450eb80567a8a686ea028d4364793c2c2456f1 | 4,136 | py | Python | src/onegov/wtfs/forms/report.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/wtfs/forms/report.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/wtfs/forms/report.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from datetime import date
from onegov.core.orm.func import unaccent
from onegov.form import Form
from onegov.wtfs import _
from onegov.wtfs.models import Municipality
from onegov.wtfs.models import ReportBoxes
from onegov.wtfs.models import ReportBoxesAndForms
from onegov.wtfs.models import ReportBoxesAndFormsByDeliver... | 33.088 | 67 | 0.573501 |
db85866d9376def991bf2de34020892fa5525b61 | 899 | py | Python | ilswbot/config.py | Nukesor/ilswach-bot | 2e3e9dfa8f43b07caab79f2e94686557dc808731 | [
"MIT"
] | null | null | null | ilswbot/config.py | Nukesor/ilswach-bot | 2e3e9dfa8f43b07caab79f2e94686557dc808731 | [
"MIT"
] | null | null | null | ilswbot/config.py | Nukesor/ilswach-bot | 2e3e9dfa8f43b07caab79f2e94686557dc808731 | [
"MIT"
] | null | null | null | """Config values for ilswbot."""
import os
import sys
import toml
default_config = {
'telegram': {
"api_key": "your_telegram_api_key",
},
'database': {
"sql_uri": 'sqlite:///ilswbot.db',
},
'settings': {
'api_url': 'http://ilswlol.customalized.org/?raw=on',
'one_time... | 24.972222 | 77 | 0.59733 |
db8a421fdc7ccc54151ed5d19b487c35e452a870 | 811 | py | Python | test_pyToTeX.py | JonasFovea/PyDocToLaTeX | 81f90cb82f9d7b8a8bab632a845b8ced42e3e8fa | [
"MIT"
] | null | null | null | test_pyToTeX.py | JonasFovea/PyDocToLaTeX | 81f90cb82f9d7b8a8bab632a845b8ced42e3e8fa | [
"MIT"
] | 1 | 2020-09-23T21:03:00.000Z | 2020-09-23T21:03:00.000Z | test_pyToTeX.py | JonasFovea/PyDocToLaTeX | 81f90cb82f9d7b8a8bab632a845b8ced42e3e8fa | [
"MIT"
] | null | null | null | import unittest
import os.path
import os
from pyToTeX import *
class MyTestCase(unittest.TestCase):
def test_convert(self):
fn = "examplecode.py"
convert(fn, True)
self.assertTrue(os.path.isfile("examplecode.tex"))
def test_cliMissingFileName(self):
stream = os.popen("python p... | 30.037037 | 159 | 0.651048 |
91eef87f218344c367a5ae39ed4bb045a90ddb61 | 3,547 | py | Python | geol/enrichers/enrichers.py | PyGeoL/GeoL | 67a5bd2f63091e19041094c14d419055fa5ce6f0 | [
"MIT"
] | 8 | 2018-03-09T16:44:38.000Z | 2021-04-07T11:33:30.000Z | geol/enrichers/enrichers.py | PyGeoL/GeoL | 67a5bd2f63091e19041094c14d419055fa5ce6f0 | [
"MIT"
] | 4 | 2020-03-24T15:34:54.000Z | 2021-06-01T21:54:33.000Z | geol/enrichers/enrichers.py | PyGeoL/GeoL | 67a5bd2f63091e19041094c14d419055fa5ce6f0 | [
"MIT"
] | 1 | 2020-05-13T14:30:55.000Z | 2020-05-13T14:30:55.000Z | """
File description
"""
# Authors: Gianni Barlacchi <gianni.barlacchi@gmail.com>
# Michele Ferretti <mic.ferretti@gmail.com>
import geopandas as gpd
import pandas as pd
from ..utils import constants
import os
import six, abc
@six.add_metaclass(abc.ABCMeta)
class TessellationEnricher(Tessellation):
d... | 35.47 | 105 | 0.627855 |
72e592aeb32734b6c2170710f045241d18f67640 | 3,445 | py | Python | examples/language_model/t5/glue_demo.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | examples/language_model/t5/glue_demo.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | examples/language_model/t5/glue_demo.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.011905 | 121 | 0.624964 |
be3a349821d22bf5941261d46af82454e710596c | 898 | py | Python | euler-34.py | TFabijo/euler | 58dc07b9adb236890556ccd5d75ca9dbd2b50df9 | [
"MIT"
] | null | null | null | euler-34.py | TFabijo/euler | 58dc07b9adb236890556ccd5d75ca9dbd2b50df9 | [
"MIT"
] | null | null | null | euler-34.py | TFabijo/euler | 58dc07b9adb236890556ccd5d75ca9dbd2b50df9 | [
"MIT"
] | null | null | null | #naloga je podobna nalogi 29
# iscemo zgornjo mejo, do katere bomo pregledovali
# navzgor bomo ocenjevali z 9 ozirom 9! ki znaša 362880
# stevilo 9999999 je yedm mestno stevilo in je vsota fakultet stevk enaka 2540160, ki je tudi 7 mestno stevilo
# stevilo 99999999 je 8 mestno stevilo vsota fakultet pa je 2903040 ,... | 26.411765 | 111 | 0.614699 |
a3d581562b051b91fdd7ecf0c4df74d1d741a9c6 | 1,487 | py | Python | setup.py | jdmartinez36/azure-keyvault-cli-extension | 4dc674b9c30cac13e27347782c49b3ed7dca2e2f | [
"MIT"
] | 2 | 2019-06-12T13:44:34.000Z | 2020-06-01T13:24:04.000Z | setup.py | jdmartinez36/azure-keyvault-cli-extension | 4dc674b9c30cac13e27347782c49b3ed7dca2e2f | [
"MIT"
] | 5 | 2018-04-26T01:14:29.000Z | 2021-01-05T00:45:39.000Z | setup.py | jdmartinez36/azure-keyvault-cli-extension | 4dc674b9c30cac13e27347782c49b3ed7dca2e2f | [
"MIT"
] | 8 | 2018-04-24T22:52:48.000Z | 2021-11-16T06:29:28.000Z | #!/usr/bin/env python
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# ---------------------------------------------... | 38.128205 | 99 | 0.605245 |
4a2836bd49b03f05ef51e22d97996525799af632 | 325 | py | Python | day13/debug_odd_or_even.py | nurmatthias/100DaysOfCode | 22002e4b31d13e6b52e6b9222d2e91c2070c5744 | [
"Apache-2.0"
] | null | null | null | day13/debug_odd_or_even.py | nurmatthias/100DaysOfCode | 22002e4b31d13e6b52e6b9222d2e91c2070c5744 | [
"Apache-2.0"
] | null | null | null | day13/debug_odd_or_even.py | nurmatthias/100DaysOfCode | 22002e4b31d13e6b52e6b9222d2e91c2070c5744 | [
"Apache-2.0"
] | null | null | null | # number = int(input("Which number do you want to check?"))
#
# if number % 2 = 0:
# print("This is an even number.")
# else:
# print("This is an odd number.")
number = int(input("Which number do you want to check?"))
if number % 2 == 0:
print("This is an even number.")
else:
print("This is an odd number.... | 21.666667 | 59 | 0.615385 |
4aa1ac8ececd2c3da366eba143ddde43dd19fe8b | 3,771 | py | Python | hrsweb/api.py | sirboldilox/hrsweb | 7d0b9df08fde8edba9cdd4c86d9a4518aa5f9758 | [
"MIT"
] | null | null | null | hrsweb/api.py | sirboldilox/hrsweb | 7d0b9df08fde8edba9cdd4c86d9a4518aa5f9758 | [
"MIT"
] | null | null | null | hrsweb/api.py | sirboldilox/hrsweb | 7d0b9df08fde8edba9cdd4c86d9a4518aa5f9758 | [
"MIT"
] | null | null | null | """
Rest API for webrecords AJAX requests
Internal API:
/api/biometrics/<patient_id>
"""
from flask import jsonify, request, current_app
from flask_restful import Api, Resource, reqparse
from hrsweb.hrsdb import HRSDB
# Move this to the CONFIG
HRSDB_BASE_URL = 'http://localhost:8080'
base_url = HRSDB_BASE_URL
... | 24.487013 | 71 | 0.563246 |
60d2b8b5df2ed160a7b34a614c6b30648edb7187 | 31,691 | py | Python | Contrib-Microsoft/Olympus_rack_manager/python-ocs/rackmanager/redfish/enums.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 5 | 2019-11-11T07:57:26.000Z | 2022-03-28T08:26:53.000Z | Contrib-Microsoft/Olympus_rack_manager/python-ocs/rackmanager/redfish/enums.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 3 | 2019-09-05T21:47:07.000Z | 2019-09-17T18:10:45.000Z | Contrib-Microsoft/Olympus_rack_manager/python-ocs/rackmanager/redfish/enums.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 11 | 2019-07-20T00:16:32.000Z | 2022-01-11T14:17:48.000Z | # Copyright (C) Microsoft Corporation. All rights reserved.
# This program is free software; you can redistribute it
# and/or modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
from contr... | 31.100098 | 111 | 0.563662 |
1cb5507d165b0beba37a10ecb3bcfb909ea1e5e2 | 2,315 | py | Python | LINE/2021/crypto/babycrypto1/babycrypto1.py | mystickev/ctf-archives | 89e99a5cd5fb6b2923cad3fe1948d3ff78649b4e | [
"MIT"
] | 1 | 2021-11-02T20:53:58.000Z | 2021-11-02T20:53:58.000Z | LINE/2021/crypto/babycrypto1/babycrypto1.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | LINE/2021/crypto/babycrypto1/babycrypto1.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 1 | 2021-12-19T11:06:24.000Z | 2021-12-19T11:06:24.000Z | #!/usr/bin/env python
from base64 import b64decode
from base64 import b64encode
import socket
import multiprocessing
from Crypto.Cipher import AES
from Crypto.Random import get_random_bytes
from Crypto.Util.Padding import pad, unpad
import hashlib
import sys
class AESCipher:
def __init__(self, key):
self.... | 33.550725 | 91 | 0.647948 |
c70d1c4c66d7a3bddbb9301632c1aba814f322a0 | 496 | py | Python | LeetCode_problems/Majority Element/solution1.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 165 | 2020-10-03T08:01:11.000Z | 2022-03-31T02:42:08.000Z | LeetCode_problems/Majority Element/solution1.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 383 | 2020-10-03T07:39:11.000Z | 2021-11-20T07:06:35.000Z | LeetCode_problems/Majority Element/solution1.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 380 | 2020-10-03T08:05:04.000Z | 2022-03-19T06:56:59.000Z | class Solution:
def majorityElement(self, nums: List[int]) -> int:
#we make a set of the given list
s=list(set(nums))
#iterate over the set
for i in range(len(s)):
#we check if the count of the element is >n/2 by using the count function as soon as we get that required element which... | 49.6 | 209 | 0.637097 |
c7a3229a6965968021b82fc81e1dc58c85a1c5bb | 2,070 | py | Python | pymantic/util.py | dnswd/blazegraph-python | 046a6b47406b0f56d71abc6039f4d7586a1708d2 | [
"BSD-3-Clause"
] | 42 | 2016-01-15T14:31:48.000Z | 2022-03-10T14:32:25.000Z | pymantic/util.py | igor-kim/blazegraph-python | 7be8d219e00acb51d949bf49aaaed90c2c2344e5 | [
"BSD-3-Clause"
] | 3 | 2016-10-02T18:36:42.000Z | 2019-09-18T15:48:58.000Z | pymantic/util.py | igor-kim/blazegraph-python | 7be8d219e00acb51d949bf49aaaed90c2c2344e5 | [
"BSD-3-Clause"
] | 11 | 2016-08-18T09:47:52.000Z | 2021-12-26T06:22:18.000Z | """Utility functions used throughout pymantic."""
__all__ = ['en', 'de', 'one_or_none', 'normalize_iri', 'quote_normalized_iri',]
import re
from urllib import quote
def en(value):
"""Returns an RDF literal from the en language for the given value."""
from pymantic.primitives import Literal
return Literal... | 36.315789 | 83 | 0.641546 |
408259db402c94f1dc351635c80f11ab410d7f05 | 1,198 | py | Python | methods/transformers/tests/test_cli.py | INK-USC/RiddleSense | a3d57eaf084da9cf6b77692c608e2cd2870fbd97 | [
"MIT"
] | 3 | 2021-07-06T20:02:31.000Z | 2022-03-27T13:13:01.000Z | methods/transformers/tests/test_cli.py | INK-USC/RiddleSense | a3d57eaf084da9cf6b77692c608e2cd2870fbd97 | [
"MIT"
] | null | null | null | methods/transformers/tests/test_cli.py | INK-USC/RiddleSense | a3d57eaf084da9cf6b77692c608e2cd2870fbd97 | [
"MIT"
] | null | null | null | # coding=utf-8
# Copyright 2019-present, the HuggingFace Inc. team.
#
# 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 requ... | 35.235294 | 75 | 0.710351 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.