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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
df4c3dbef470a60384fd7c1257c2abe4fa2b767e | 581 | py | Python | Packs/ServerLogs/Scripts/ServerLogs/ServerLogs.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/ServerLogs/Scripts/ServerLogs/ServerLogs.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/ServerLogs/Scripts/ServerLogs/ServerLogs.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import re
import demistomock as demisto
from CommonServerPython import *
file = '/var/log/demisto/server.log'
try:
res = demisto.executeCommand('ssh', {'cmd': f'tail {file}', 'using': 'localhost'})
except ValueError as e:
demisto.error(str(e))
return_error('The script could not execute the `ssh` command.... | 30.578947 | 99 | 0.67642 |
982b65b6c8205498376cdb0a0a16cb37393c2234 | 4,003 | py | Python | app/spotifyAPI.py | ItZzMJ/SliderDownloader | 9c5b5aee096e7a56d5d42e1cb8dbd1a104e2b5a9 | [
"MIT"
] | null | null | null | app/spotifyAPI.py | ItZzMJ/SliderDownloader | 9c5b5aee096e7a56d5d42e1cb8dbd1a104e2b5a9 | [
"MIT"
] | null | null | null | app/spotifyAPI.py | ItZzMJ/SliderDownloader | 9c5b5aee096e7a56d5d42e1cb8dbd1a104e2b5a9 | [
"MIT"
] | null | null | null | import json
from track import Track
import spotipy
from spotipy.oauth2 import SpotifyClientCredentials
import logging
class SpotifyAPI:
def __init__(self):
logging.info("[SPOTIFYAPI] SpotifyAPI init")
self.credentials = self.get_credentials()
auth_manager = SpotifyClientCredentials(client... | 34.213675 | 137 | 0.558331 |
1422460605ce1581c3be9e2046691060b73b8bab | 1,895 | py | Python | benwaonline/schemas/user_schema.py | goosechooser/benwaonline | e2879412aa6c3c230d25cd60072445165517b6b6 | [
"MIT"
] | null | null | null | benwaonline/schemas/user_schema.py | goosechooser/benwaonline | e2879412aa6c3c230d25cd60072445165517b6b6 | [
"MIT"
] | 16 | 2017-09-13T10:21:40.000Z | 2020-06-01T04:32:22.000Z | benwaonline/schemas/user_schema.py | goosechooser/benwaonline | e2879412aa6c3c230d25cd60072445165517b6b6 | [
"MIT"
] | null | null | null | from marshmallow_jsonapi import fields
from benwaonline.schemas import BaseSchema
class UserSchema(BaseSchema):
id = fields.String()
username = fields.String()
created_on = fields.DateTime()
user_id = fields.String()
active = fields.Boolean(load_from='is_active', dump_to='is_active')
class Met... | 30.564516 | 71 | 0.585224 |
147e4adf3128c36f7a20b708030b2c47444026e5 | 1,246 | py | Python | 7_DeepLearning-GANs/02_DCGAN/Generator.py | felixdittrich92/DeepLearning-tensorflow-keras | 2880d8ed28ba87f28851affa92b6fa99d2e47be9 | [
"Apache-2.0"
] | null | null | null | 7_DeepLearning-GANs/02_DCGAN/Generator.py | felixdittrich92/DeepLearning-tensorflow-keras | 2880d8ed28ba87f28851affa92b6fa99d2e47be9 | [
"Apache-2.0"
] | null | null | null | 7_DeepLearning-GANs/02_DCGAN/Generator.py | felixdittrich92/DeepLearning-tensorflow-keras | 2880d8ed28ba87f28851affa92b6fa99d2e47be9 | [
"Apache-2.0"
] | null | null | null | '''
Generator - generiert die Daten bzw. das Bild
'''
from tensorflow.keras.models import Sequential, Model
from tensorflow.keras.layers import *
from tensorflow.keras.optimizers import *
def build_generator(z_dimension, channels):
model = Sequential()
model.add(Dense(128 * 7 * 7, input_dim=z_dimension))... | 38.9375 | 130 | 0.70947 |
258ea6f1ad3a1f4f7e91c885a81415aacbe706a3 | 1,330 | py | Python | nettests/server/handler.py | Laighno/evt | 90b94e831aebb62c6ad19ce59c9089e9f51cfd77 | [
"MIT"
] | 1,411 | 2018-04-23T03:57:30.000Z | 2022-02-13T10:34:22.000Z | nettests/server/handler.py | Zhang-Zexi/evt | e90fe4dbab4b9512d120c79f33ecc62791e088bd | [
"Apache-2.0"
] | 27 | 2018-06-11T10:34:42.000Z | 2019-07-27T08:50:02.000Z | nettests/server/handler.py | Zhang-Zexi/evt | e90fe4dbab4b9512d120c79f33ecc62791e088bd | [
"Apache-2.0"
] | 364 | 2018-06-09T12:11:53.000Z | 2020-12-15T03:26:48.000Z | import json
from twisted.internet import reactor
from payengine import PayEngine, prepare_for_debug
from watchpool import WatchPool
context = {}
class Handler:
def __call__(self, socket):
data = socket.recv_string()
cmd = json.loads(data)
func = cmd['func']
if func == 'stop':
... | 29.555556 | 100 | 0.504511 |
6cde4c52f9619e5f200ec226313357f6219c25f7 | 740 | py | Python | books/PythonAutomate/scheduling/naver_webtoon_down.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | books/PythonAutomate/scheduling/naver_webtoon_down.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | books/PythonAutomate/scheduling/naver_webtoon_down.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | import os
import requests
import bs4
url = "https://comic.naver.com/webtoon/detail.nhn?titleId=733766&no=37&weekday=mon"
resp = requests.get(url)
resp.raise_for_status()
soup = bs4.BeautifulSoup(resp.text, "html.parser")
img_list = soup.select("div.wt_viewer > img")
src_url = img_list[0].get("src")
print(src_url)
r... | 24.666667 | 83 | 0.693243 |
2c881e3d5a23dea480ff54d57e2259f86b24539b | 149 | py | Python | filters/urlencode.py | adblockplus/web.adblockplus.org | c2c570ce4f4296afc3577afe233c6b23b128f206 | [
"MIT"
] | 9 | 2016-01-29T18:05:29.000Z | 2021-10-06T04:21:55.000Z | filters/urlencode.py | adblockplus/web.adblockplus.org | c2c570ce4f4296afc3577afe233c6b23b128f206 | [
"MIT"
] | 9 | 2015-04-06T19:03:32.000Z | 2019-05-28T13:34:55.000Z | filters/urlencode.py | adblockplus/web.adblockplus.org | c2c570ce4f4296afc3577afe233c6b23b128f206 | [
"MIT"
] | 18 | 2015-04-06T17:42:31.000Z | 2021-10-06T04:26:29.000Z |
import urllib
# This can be removed once we can rely on having at least Jinja2 2.7.
def urlencode(value):
return urllib.quote(value)
| 16.555556 | 70 | 0.691275 |
2cc3a5ed5c1f54ea323571266056e9d4dbf01c95 | 2,768 | pyde | Python | site/public/courses/CS-1.1/Projects/CatchTheFruit/CatchTheFruit.pyde | KitsuneNoctus/makeschool | 5eec1a18146abf70bb78b4ee3d301f6a43c9ede4 | [
"MIT"
] | 1 | 2021-08-24T20:22:19.000Z | 2021-08-24T20:22:19.000Z | site/public/courses/CS-1.1/Projects/CatchTheFruit/CatchTheFruit.pyde | KitsuneNoctus/makeschool | 5eec1a18146abf70bb78b4ee3d301f6a43c9ede4 | [
"MIT"
] | null | null | null | site/public/courses/CS-1.1/Projects/CatchTheFruit/CatchTheFruit.pyde | KitsuneNoctus/makeschool | 5eec1a18146abf70bb78b4ee3d301f6a43c9ede4 | [
"MIT"
] | null | null | null | add_library('sound')
#You will need to install the sound library go to sketch->import library -> Add library -> search for "sound" and install
'''The setup() function is run once, when the program starts.
It's used to define initial enviroment properties such as screen size and to load media such as images and ... | 43.936508 | 137 | 0.716763 |
391041d8e4dd988e081b1b2b27513ae70f1027aa | 9,156 | py | Python | Tests/test_userinterface.py | dereklm12880/rssticker | d90e8c00811d67bd9fb8104bbb6ec98aae5221f4 | [
"MIT"
] | 2 | 2020-02-26T01:54:26.000Z | 2020-04-27T20:09:14.000Z | Tests/test_userinterface.py | dereklm12880/rssticker | d90e8c00811d67bd9fb8104bbb6ec98aae5221f4 | [
"MIT"
] | 17 | 2020-02-29T02:43:44.000Z | 2020-04-27T20:38:44.000Z | Tests/test_userinterface.py | dereklm12880/rssticker | d90e8c00811d67bd9fb8104bbb6ec98aae5221f4 | [
"MIT"
] | 8 | 2020-02-26T21:37:36.000Z | 2020-06-23T00:01:27.000Z | import tkinter
import unittest
from unittest.mock import call, patch, PropertyMock
import webbrowser
import tkinter as tk
from tkinter import ttk
import os, sys
from tkinter import font
import queue
sys.path.append("../")
from RSS.view.userinterface import RSSticker as ui
from RSS.controller.rssfeed import RssControlle... | 41.058296 | 109 | 0.616099 |
46c03ee097a5e02804838ba4278f862ef8b5c279 | 13,452 | py | Python | examples/text_to_sql/RAT-SQL/text2sql/dataproc/ernie_input_encoder_v2.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | examples/text_to_sql/RAT-SQL/text2sql/dataproc/ernie_input_encoder_v2.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | examples/text_to_sql/RAT-SQL/text2sql/dataproc/ernie_input_encoder_v2.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 app... | 41.137615 | 124 | 0.56185 |
37a165e3d846d5aead18f24fee423dc48a460a6f | 2,342 | py | Python | src/onegov/agency/models/person.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/agency/models/person.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/agency/models/person.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.org.models import Organisation
from onegov.org.models.extensions import AccessExtension
from onegov.org.models.extensions import PublicationExtension
from onegov.people import Person
from sqlalchemy.orm import object_session
class ExtendedPerson(Person, AccessExtension, PublicationExtension):
""" An e... | 31.648649 | 79 | 0.595218 |
80ddd15307d36a46c5063352979845f234f40570 | 2,045 | py | Python | larq_compute_engine/tflite/benchmark/benchmarknet.py | timdebruin/compute-engine | bdd3c080ea330ad911cfb6b02dd41b6c574a7cf4 | [
"Apache-2.0"
] | null | null | null | larq_compute_engine/tflite/benchmark/benchmarknet.py | timdebruin/compute-engine | bdd3c080ea330ad911cfb6b02dd41b6c574a7cf4 | [
"Apache-2.0"
] | null | null | null | larq_compute_engine/tflite/benchmark/benchmarknet.py | timdebruin/compute-engine | bdd3c080ea330ad911cfb6b02dd41b6c574a7cf4 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import tensorflow as tf
import larq_compute_engine as lqce
import itertools
import os
# The HWIO support in TF lite will be dropped at some point.
# But for now it remains usefull for comparison
# Returns OHWI binary convolution and a float convolution using the same weights
def AllConv(features, k... | 31.953125 | 143 | 0.628362 |
afe19b5bb58e07b835d8806961f63b5cd3e2e5d6 | 6,913 | py | Python | Packs/Zimperium/Integrations/Zimperium/Zimperium_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/Zimperium/Integrations/Zimperium/Zimperium_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/Zimperium/Integrations/Zimperium/Zimperium_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import pytest
from Zimperium import Client, events_search, users_search, user_get_by_id, devices_search, device_get_by_id, \
devices_get_last_updated, app_classification_get, file_reputation, fetch_incidents, report_get
from test_data.response_constants import RESPONSE_SEARCH_EVENTS, RESPONSE_SEARCH_USERS, RESPONSE... | 46.086667 | 120 | 0.714162 |
b34689936d3878c93d2c6d6b19a2b139482f17fd | 2,488 | py | Python | script/extract/extract.py | stefanhetzenauer/fh-masterarbeit | a20ff446f4f89c7a4a457c983be5a5dcea4973ac | [
"MIT"
] | null | null | null | script/extract/extract.py | stefanhetzenauer/fh-masterarbeit | a20ff446f4f89c7a4a457c983be5a5dcea4973ac | [
"MIT"
] | null | null | null | script/extract/extract.py | stefanhetzenauer/fh-masterarbeit | a20ff446f4f89c7a4a457c983be5a5dcea4973ac | [
"MIT"
] | null | null | null | from jpeg2dct.numpy import load, loads
import json
import os
from tqdm import tqdm
import numpy as np
import pandas as pd
from datetime import datetime
COMPRESSED_DIR = r''
COMPRESSED_DIFFERENT_DIR = r''
DCT_DIR = r''
DCT_DIFFERENT_DIR = r''
def extract(amount=5000):
# make sure that directory exists
if not o... | 31.897436 | 149 | 0.64791 |
ff96e5c5fa1e1d66839f0983e7a0938437c489eb | 9,158 | py | Python | raw_code/common/helper_functions.py | stevenruidigao/bwsiuassar2019 | 25e267d2c9d96c767f7f9ea168a27bcad56690b7 | [
"MIT"
] | null | null | null | raw_code/common/helper_functions.py | stevenruidigao/bwsiuassar2019 | 25e267d2c9d96c767f7f9ea168a27bcad56690b7 | [
"MIT"
] | null | null | null | raw_code/common/helper_functions.py | stevenruidigao/bwsiuassar2019 | 25e267d2c9d96c767f7f9ea168a27bcad56690b7 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Helper functions for UAS-SAR."""
__author__ = "Ramamurthy Bhagavatula"
__version__ = "1.0"
__maintainer__ = "Ramamurthy Bhagavatula"
__email__ = "ramamurthy.bhagavatula@ll.mit.edu"
# Import required modules and methods
import logging
import logging.config
i... | 33.918519 | 112 | 0.573924 |
ffa287392a46fccfbd14e348c8ba101aa07eef91 | 267 | py | Python | exercises/ja/test_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/test_01_03_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/ja/test_01_03_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | def test():
assert doc.text == "私はツリーカンガルーとイルカが好きです。", "テキストをちゃんと処理しましたか?"
assert tree_kangaroos == doc[2:4], "ツリーカンガルーのスパンを選択しましたか?"
assert (
tree_kangaroos_and_dolphins == doc[2:6]
), "ツリーカンガルーとイルカのスパンを選択しましたか?"
__msg__.good("よくできました!")
| 33.375 | 66 | 0.674157 |
44552ccc38a33abee6711272bd05da3049915ab1 | 1,031 | py | Python | brick/db.py | xsank/bottle | 4c228043ea31811fffd8eb30914d025c1fd43dc0 | [
"MIT"
] | 9 | 2015-01-06T01:32:43.000Z | 2017-03-01T18:34:54.000Z | brick/db.py | jude90/bottle | 4c228043ea31811fffd8eb30914d025c1fd43dc0 | [
"MIT"
] | null | null | null | brick/db.py | jude90/bottle | 4c228043ea31811fffd8eb30914d025c1fd43dc0 | [
"MIT"
] | 4 | 2015-02-05T09:48:43.000Z | 2016-02-22T15:04:35.000Z | '''
Created on 2013-4-22
@author: Xsank
'''
import sqlite3
from exception import DatabaseOperationError
class SQLite(object):
def __init__(self,database):
self.database=database
def __str__(self):
return self.database
def __del__(self):
self.close()
... | 21.040816 | 48 | 0.585839 |
92b7127612d480453d1c95eaa31e657805a8dad9 | 2,479 | py | Python | plugins/tff_backend/bizz/todo/hoster.py | threefoldfoundation/app_backend | b3cea2a3ff9e10efcc90d3d6e5e8e46b9e84312a | [
"Apache-2.0"
] | null | null | null | plugins/tff_backend/bizz/todo/hoster.py | threefoldfoundation/app_backend | b3cea2a3ff9e10efcc90d3d6e5e8e46b9e84312a | [
"Apache-2.0"
] | 178 | 2017-08-02T12:58:06.000Z | 2017-12-20T15:01:12.000Z | plugins/tff_backend/bizz/todo/hoster.py | threefoldfoundation/app_backend | b3cea2a3ff9e10efcc90d3d6e5e8e46b9e84312a | [
"Apache-2.0"
] | 2 | 2018-01-10T10:43:12.000Z | 2018-03-18T10:42:23.000Z | # -*- coding: utf-8 -*-
# Copyright 2017 GIG Technology NV
#
# 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... | 30.9875 | 93 | 0.614764 |
5b9c684cde38df17b6420e7d8674a93a7be74be3 | 1,141 | py | Python | src/server/bo/Account.py | ralfstefanbender/Studifix2 | 281c0a89ce56796437fe054068058c0f01a7df02 | [
"RSA-MD"
] | null | null | null | src/server/bo/Account.py | ralfstefanbender/Studifix2 | 281c0a89ce56796437fe054068058c0f01a7df02 | [
"RSA-MD"
] | null | null | null | src/server/bo/Account.py | ralfstefanbender/Studifix2 | 281c0a89ce56796437fe054068058c0f01a7df02 | [
"RSA-MD"
] | null | null | null | from server.bo import BusinessObject as bo
class Account (bo.BusinessObject):
"""Realisierung eines exemplarischen Bankkontos.
Ein Konto besitzt einen Inhaber sowie eine Reihe von Buchungen (vgl. Klasse Transaction),
mit deren Hilfe auch der Kontostand berechnet werden kann.
"""
def __init__(self... | 34.575758 | 93 | 0.669588 |
f3b3d8d03a64c0ba99862e53d3d020da19d5124c | 970 | py | Python | tests/test_post.py | Lanseuo/lucas-blog | fd6932952aac3a3055026551700bc86adef279f4 | [
"MIT"
] | 1 | 2019-01-29T15:57:20.000Z | 2019-01-29T15:57:20.000Z | tests/test_post.py | Lanseuo/lucas-blog | fd6932952aac3a3055026551700bc86adef279f4 | [
"MIT"
] | 1 | 2018-05-05T19:43:28.000Z | 2018-05-05T19:43:28.000Z | tests/test_post.py | Lanseuo/lucas-blog | fd6932952aac3a3055026551700bc86adef279f4 | [
"MIT"
] | 1 | 2018-04-24T09:36:57.000Z | 2018-04-24T09:36:57.000Z | import pytest
from datetime import datetime, timedelta
from pathlib import Path
from blog.post import Post
from blog.errors import PostNotFound
@pytest.fixture
def post():
return Post("hallo-welt")
def test_nonexistent_permalink():
try:
Post("i-do-not-exist")
assert False
except PostNot... | 21.555556 | 55 | 0.694845 |
1b2e1afad679359d02e8b80519af6622cb4ac6ea | 678 | py | Python | .venv/Lib/site-packages/dexpy/eval.py | AI-Assistant/FEMAG-Python | ff86e8f41485ae9df6034e6b8e810b59f8094c70 | [
"MIT"
] | 21 | 2016-10-19T18:13:03.000Z | 2021-11-02T13:58:31.000Z | .venv/Lib/site-packages/dexpy/eval.py | AI-Assistant/FEMAG-Python | ff86e8f41485ae9df6034e6b8e810b59f8094c70 | [
"MIT"
] | 43 | 2016-10-11T20:56:28.000Z | 2020-08-20T16:39:38.000Z | .venv/Lib/site-packages/dexpy/eval.py | AI-Assistant/FEMAG-Python | ff86e8f41485ae9df6034e6b8e810b59f8094c70 | [
"MIT"
] | 6 | 2017-12-22T03:47:37.000Z | 2021-03-13T03:45:26.000Z | """Functions to evaluate a design matrix."""
import numpy as np
import math
def det_xtxi(x_matrix, use_log = True):
"""Calculates the determinant of the inverse of the information matrix.
Also known as the D-optimal criterion.
"""
xtxi = np.linalg.inv(np.dot(x_matrix.T, x_matrix))
if use_log:
... | 28.25 | 75 | 0.659292 |
59fae1e4757b47994759d6f967c4fe50813cf364 | 262 | py | Python | Cornelia Ekpenyong Tasks/project9 python/index.py | cornelia247/cil-internship-cohort-01 | b8184337056d378eab16d26b40b26ed58cd177bb | [
"MIT"
] | null | null | null | Cornelia Ekpenyong Tasks/project9 python/index.py | cornelia247/cil-internship-cohort-01 | b8184337056d378eab16d26b40b26ed58cd177bb | [
"MIT"
] | null | null | null | Cornelia Ekpenyong Tasks/project9 python/index.py | cornelia247/cil-internship-cohort-01 | b8184337056d378eab16d26b40b26ed58cd177bb | [
"MIT"
] | null | null | null | from PIL import Image
basewidth = 300
img = Image.open('life-python.jpg')
wpercent = (basewidth / float(img.size[0]))
hsize = int((float(img.size[1]) * float(wpercent)))
img = img.resize((basewidth, hsize), Image.ANTIALIAS)
img.save('resized_python.jpg') | 32.75 | 54 | 0.698473 |
8496c657a48e1a52cc3adbefa2b7520edf974f56 | 374 | py | Python | webapp/flask_middleware/server.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | webapp/flask_middleware/server.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | webapp/flask_middleware/server.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | from flask import Flask, request
from middleware import middleware
app = Flask("DemoApp")
# calling our middleware
app.wsgi_app = middleware(app.wsgi_app)
@app.route("/", methods=["GET", "POST"])
def hello():
user = request.environ["user"]
return f"Hi {user['name']} user"
if __name__ == "__ma... | 22 | 45 | 0.641711 |
6d2e86456c09d15d2faeb4a16c8aa2c47af282ed | 1,424 | py | Python | Python/zzz_training_challenge/Python_Challenge/solutions/tests/ch04_strings/ex07_capitalize_test.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/tests/ch04_strings/ex07_capitalize_test.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/tests/ch04_strings/ex07_capitalize_test.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | # Beispielprogramm für das Buch "Python Challenge"
#
# Copyright 2020 by Michael Inden
import pytest
from ch04_strings.solutions.ex07_capitalize import capitalize, capitalize_words, capitalize_special_2
@pytest.mark.parametrize("input, expected",
[("this is a very special title",
... | 40.685714 | 101 | 0.524579 |
ed994872fc8ddf379b17e8ce41a7339afcb8f44e | 2,837 | py | Python | Tennis/pinball.py | helkyar/Simple-Games | bd495d43596e8f965249b04efc6c8b644385def7 | [
"MIT"
] | null | null | null | Tennis/pinball.py | helkyar/Simple-Games | bd495d43596e8f965249b04efc6c8b644385def7 | [
"MIT"
] | null | null | null | Tennis/pinball.py | helkyar/Simple-Games | bd495d43596e8f965249b04efc6c8b644385def7 | [
"MIT"
] | null | null | null | # Author
# https://www.youtube.com/redirect?event=video_description&redir_token=QUFFLUhqbWRNUnozUWk0b2pIVWFSN0cxMjlVSDRBSkUxUXxBQ3Jtc0tuSXRNZ045NHE5X29oM0s3WDZQY3ZvcnZ5UFFTUWRhTlYwR2VDMXpvTGdtTlFDcFZnam8zeHc0SmpfNkxMbWE3bS1yRVV3Z0c2bzB5bzVad3RmcmFsSzI3bkwzcEI1ZmM5YVVHaHQ4SlR5QXd1MnllYw&q=http%3A%2F%2Fchristianthompson.... | 24.042373 | 360 | 0.65809 |
eddd3744129f6b5a44a702d5604624cec2c89c5d | 176 | py | Python | source/blog/forms.py | JakubGutowski/PersonalBlog | 96122b36486f7e874c013e50d939732a43db309f | [
"BSD-3-Clause"
] | null | null | null | source/blog/forms.py | JakubGutowski/PersonalBlog | 96122b36486f7e874c013e50d939732a43db309f | [
"BSD-3-Clause"
] | null | null | null | source/blog/forms.py | JakubGutowski/PersonalBlog | 96122b36486f7e874c013e50d939732a43db309f | [
"BSD-3-Clause"
] | null | null | null | from django import forms
class PostComent(forms.Form):
nick = forms.CharField(label="nick", max_length=20)
comment = forms.CharField(label="comment", max_length=140)
| 25.142857 | 62 | 0.738636 |
fcb827ff34620ed1bb90add31dd09a4b329fc775 | 1,486 | py | Python | middleware/utils/simple_async.py | fsr/infoscreen | 60930853934b6e278eeca70202f24ea8c41cb356 | [
"MIT"
] | 6 | 2016-05-03T12:14:00.000Z | 2021-07-06T16:34:21.000Z | middleware/utils/simple_async.py | fsr/infoscreen | 60930853934b6e278eeca70202f24ea8c41cb356 | [
"MIT"
] | 23 | 2015-01-09T15:50:51.000Z | 2019-02-01T10:00:49.000Z | middleware/utils/simple_async.py | fsr/infoscreen | 60930853934b6e278eeca70202f24ea8c41cb356 | [
"MIT"
] | 5 | 2015-06-08T17:27:37.000Z | 2017-06-09T15:07:33.000Z | import threading
import time
EMIT_NOTIFICATIONS = False
def ct():
return time.strftime('%H:%M:%S')
class AsyncExec:
def __init__(self, f, args=(), kwargs={}, name='unnamed'):
assert callable(f)
self._name = name
self._function = f
self._args = args
self._kwargs = kw... | 24.766667 | 66 | 0.583445 |
fcbbdf8a90ef685387c4eede15712a6fa5d68d97 | 1,832 | py | Python | par2fun.py | nvoss12838/gpsFIT | 5f06274e57f7c2f4101775eadf7142e5f492b177 | [
"MIT"
] | 1 | 2019-10-01T04:13:08.000Z | 2019-10-01T04:13:08.000Z | par2fun.py | nvoss12838/gpsFIT | 5f06274e57f7c2f4101775eadf7142e5f492b177 | [
"MIT"
] | null | null | null | par2fun.py | nvoss12838/gpsFIT | 5f06274e57f7c2f4101775eadf7142e5f492b177 | [
"MIT"
] | null | null | null | import numpy as np
def par2fun(parFile,funFile):
data = np.genfromtxt(parFile,skiprows = 1, dtype = None)
f = open(funFile,'w')
f.write('trend %s %s \n' % ((data[0][1]*data[0][2]),(data[1][1]*data[1][2])))
f.write('periodAnn %s %s \n' % (data[2][1],data[3][1]))
f.write('periodSemiAnn %s %s \n'% (data[4][1],data[... | 73.28 | 115 | 0.520197 |
fccfbc364d052376edb30556552ed874a3746972 | 1,705 | py | Python | src/unittest/python/grundlegend/test_allgemein.py | dlangheiter-tgm/test-mirror | 9878da44953c40abc1df0311f275c3eebc2e876b | [
"MIT"
] | null | null | null | src/unittest/python/grundlegend/test_allgemein.py | dlangheiter-tgm/test-mirror | 9878da44953c40abc1df0311f275c3eebc2e876b | [
"MIT"
] | null | null | null | src/unittest/python/grundlegend/test_allgemein.py | dlangheiter-tgm/test-mirror | 9878da44953c40abc1df0311f275c3eebc2e876b | [
"MIT"
] | null | null | null | """
Created on 27.12.2013
@author: Walter Rafeiner-Magor <wrafeiner-magor@tgm.ac.at>
"""
import unittest
from bruch.Bruch import *
class TestAllgemein(unittest.TestCase):
def setUp(self):
self.b = Bruch(3, 2)
self.b2 = Bruch(self.b)
self.b3 = Bruch(4, 2)
pass
def tearDown(se... | 22.434211 | 80 | 0.573607 |
1e0746422459c5c43f61807e94f12e804d75a6a3 | 225 | py | Python | PYTHON/Sets/check_strict_superset.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | PYTHON/Sets/check_strict_superset.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | PYTHON/Sets/check_strict_superset.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
A = set(map(int, input().split()))
for _ in range(int(input())):
N = set(map(int, input().split()))
if not A.issuperset(N):
print('False')
sys.exit(1)
print('True')
| 18.75 | 38 | 0.568889 |
44ad9f5e4866d95df5c154fd08d1808dab9a9d19 | 522 | py | Python | zhi/test_functionality.py | Rustem/ZLU | 9e050bdbc317f6fbddb4eed64d9ebdec995a9add | [
"MIT"
] | 1 | 2017-08-26T14:47:48.000Z | 2017-08-26T14:47:48.000Z | zhi/test_functionality.py | Rustem/ZLU | 9e050bdbc317f6fbddb4eed64d9ebdec995a9add | [
"MIT"
] | null | null | null | zhi/test_functionality.py | Rustem/ZLU | 9e050bdbc317f6fbddb4eed64d9ebdec995a9add | [
"MIT"
] | null | null | null | from kazoo.client import KazooClient
exit = False
def on_zconn(state):
print state, state.__class__
def on_node_presence(evt):
print evt
global exit
exit = True
if __name__ == "__main__":
zk = KazooClient(hosts='znode1.zcluster.com:2181,znode2.zcluster.com:2181,znode3.zcluster.com:2181')
... | 18.642857 | 104 | 0.636015 |
e54eb15f5348619b64cf5c991aea1ac45a165fe4 | 14,592 | py | Python | experiments/sumo_rl/environment/env_NonRL.py | june6723/sumo-rl-offset | 775cddc8d168fb7c4959610a96a791d746fa0afd | [
"MIT"
] | 4 | 2020-10-11T01:30:13.000Z | 2021-04-27T16:03:41.000Z | experiments/sumo_rl/environment/env_NonRL.py | june6723/sumo-rl-offset | 775cddc8d168fb7c4959610a96a791d746fa0afd | [
"MIT"
] | null | null | null | experiments/sumo_rl/environment/env_NonRL.py | june6723/sumo-rl-offset | 775cddc8d168fb7c4959610a96a791d746fa0afd | [
"MIT"
] | null | null | null | import os
import sys
if 'SUMO_HOME' in os.environ:
tools = os.path.join(os.environ['SUMO_HOME'], 'tools')
sys.path.append(tools)
else:
sys.exit("Please declare the environment variable 'SUMO_HOME'")
import traci
import sumolib
from gym import Env
import traci.constants as tc
from gym import spaces
from ray.... | 43.171598 | 196 | 0.612253 |
e5f5d38178103a62fb2aa977834fdcaf21b274af | 221 | py | Python | Contests/Ship.py | MastaCoder/Projects | ebb0a3134522b12f052fec8d753005f384adf1b1 | [
"MIT"
] | 5 | 2018-10-11T01:55:40.000Z | 2021-12-25T23:38:22.000Z | Contests/Ship.py | MastaCoder/mini_projects | ebb0a3134522b12f052fec8d753005f384adf1b1 | [
"MIT"
] | null | null | null | Contests/Ship.py | MastaCoder/mini_projects | ebb0a3134522b12f052fec8d753005f384adf1b1 | [
"MIT"
] | 1 | 2019-02-22T14:42:50.000Z | 2019-02-22T14:42:50.000Z | p = list(input())
c = {"B": 0, "F": 0, "T": 0, "L": 0, "C": 0}
for a in range(len(p)):
c[p[a]] = 1
m = False
for b in c:
if c[b] == 0:
print(b)
m = True
if m == False:
print("NO MISSING PARTS") | 20.090909 | 44 | 0.434389 |
00d0b6023ca2ff3a34046e55432c00875864b458 | 95 | py | Python | backend/apps/iamstudent/apps.py | n-hackert/match4healthcare | 761248c27b49e568c545c643a72eac9a040649d7 | [
"MIT"
] | 3 | 2020-03-27T20:39:31.000Z | 2020-03-31T20:24:55.000Z | backend/apps/iamstudent/apps.py | n-hackert/match4healthcare | 761248c27b49e568c545c643a72eac9a040649d7 | [
"MIT"
] | 21 | 2020-03-28T09:57:15.000Z | 2020-03-31T11:38:00.000Z | backend/apps/iamstudent/apps.py | n-hackert/match4healthcare | 761248c27b49e568c545c643a72eac9a040649d7 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class IamstudentConfig(AppConfig):
name = 'iamstudent'
| 15.833333 | 34 | 0.768421 |
9721954a9a005bad2a0ec25430e4f2ff1a32948f | 1,279 | py | Python | Backend/migrations/alembic/versions/50cd32ec9ca7_create_email_subs_table.py | dbvis-ukon/coronavis | f00374ac655c9d68541183d28ede6fe5536581dc | [
"Apache-2.0"
] | 15 | 2020-04-24T20:18:11.000Z | 2022-01-31T21:05:05.000Z | Backend/migrations/alembic/versions/50cd32ec9ca7_create_email_subs_table.py | dbvis-ukon/coronavis | f00374ac655c9d68541183d28ede6fe5536581dc | [
"Apache-2.0"
] | 2 | 2021-05-19T07:15:09.000Z | 2022-03-07T08:29:34.000Z | Backend/migrations/alembic/versions/50cd32ec9ca7_create_email_subs_table.py | dbvis-ukon/coronavis | f00374ac655c9d68541183d28ede6fe5536581dc | [
"Apache-2.0"
] | 4 | 2020-04-27T16:20:13.000Z | 2021-02-23T10:39:42.000Z | """create email_subs table
Revision ID: 50cd32ec9ca7
Revises: 5cf8d4366856
Create Date: 2020-11-25 21:23:23.674423
"""
from alembic import op
# revision identifiers, used by Alembic.
revision = '50cd32ec9ca7'
down_revision = '5cf8d4366856'
branch_labels = None
depends_on = None
def upgrade():
op.get_bind().exe... | 27.212766 | 68 | 0.593432 |
9750fb72222d8b8a9d9d45d2e75bafa0dd38bfbb | 389 | py | Python | frappe-bench/apps/erpnext/erpnext/patches/v8_0/make_payments_table_blank_for_non_pos_invoice.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:55:29.000Z | 2021-04-29T14:55:29.000Z | frappe-bench/apps/erpnext/erpnext/patches/v8_0/make_payments_table_blank_for_non_pos_invoice.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v8_0/make_payments_table_blank_for_non_pos_invoice.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:39:01.000Z | 2021-04-29T14:39:01.000Z | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
frappe.reload_doctype('Sales Invoice')
frappe.db.sql("""
delete from
`tabSales Invoice Payment`
where
p... | 25.933333 | 71 | 0.737789 |
c15825dc0703aedc4d3df17723c740efe2fd9759 | 503 | py | Python | 01.DataStructure/Stack&Queue/NY/B9012_NY.py | SP2021-2/Algorithm | 2e629eb5234212fad8bbc11491aad068e5783780 | [
"MIT"
] | 1 | 2021-11-21T06:03:06.000Z | 2021-11-21T06:03:06.000Z | 01.DataStructure/Stack&Queue/NY/B9012_NY.py | SP2021-2/Algorithm | 2e629eb5234212fad8bbc11491aad068e5783780 | [
"MIT"
] | 2 | 2021-10-13T07:21:09.000Z | 2021-11-14T13:53:08.000Z | 01.DataStructure/Stack&Queue/NY/B9012_NY.py | SP2021-2/Algorithm | 2e629eb5234212fad8bbc11491aad068e5783780 | [
"MIT"
] | null | null | null | #백준 - 9012 ok
#2. 9. 00. 프로그래머스
t = int(input())
for i in range(t) :
str = input()
q = []
score = 0
for s in range(0, len(str)) :
if str[s] == "(" :
q.append(str[s])
elif str[s] == ")" :
try :
q.pop()
except IndexError :
... | 17.344828 | 33 | 0.349901 |
a9f662f4ae6b9ec713f57862dbc0590aa317308d | 1,014 | py | Python | Problem Solving/Data Structures/Disjoint Set/Merging Communities/merging_communities2.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | 1 | 2021-02-22T17:37:45.000Z | 2021-02-22T17:37:45.000Z | Problem Solving/Data Structures/Disjoint Set/Merging Communities/merging_communities2.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | null | null | null | Problem Solving/Data Structures/Disjoint Set/Merging Communities/merging_communities2.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | null | null | null | # Union-Find with union by size and find by path compression
#!/bin/python3
class Node:
def __init__(self, data):
self.data = data
self.parent = self
self.size = 1
def make_set(data):
return Node(data)
def find(node):
if node != node.parent:
node.parent = find(node... | 24.142857 | 60 | 0.546351 |
99c8f45110ab507bd5f0d97bfc8ce2907aed9b84 | 805 | py | Python | SoSe-21/Uebung-9/A1-Alphabet.py | jonasrdt/Wirtschaftsinformatik2 | 30d5d896808b98664c55cb6fbb3b30a7f1904d9f | [
"MIT"
] | 1 | 2022-03-23T09:40:39.000Z | 2022-03-23T09:40:39.000Z | SoSe-21/Uebung-9/A1-Alphabet.py | jonasrdt/Wirtschaftsinformatik2 | 30d5d896808b98664c55cb6fbb3b30a7f1904d9f | [
"MIT"
] | null | null | null | SoSe-21/Uebung-9/A1-Alphabet.py | jonasrdt/Wirtschaftsinformatik2 | 30d5d896808b98664c55cb6fbb3b30a7f1904d9f | [
"MIT"
] | null | null | null | din_alphabet = {
"A": "Anton",
"Ä": "Ärger",
"B": "Berta",
"C": "Cäsar",
"D": "Dora",
"E": "Emil",
"F": "Friedrich",
"G": "Gustav",
"H": "Heinrich",
"I": "Ida",
"J": "Julius",
"K": "Kaufmann",
"L": "Ludwig",
"M": "Martha",
"N": "Nordpol",
"O": "Otto",
... | 19.634146 | 46 | 0.431056 |
82203785b8a2d42fd33b61773abda563a14faf1f | 255 | py | Python | server/test_basic.py | cutec-chris/sce | da1f906ff4a049722b8968eeab8a07b411c92a8c | [
"MIT"
] | null | null | null | server/test_basic.py | cutec-chris/sce | da1f906ff4a049722b8968eeab8a07b411c92a8c | [
"MIT"
] | null | null | null | server/test_basic.py | cutec-chris/sce | da1f906ff4a049722b8968eeab8a07b411c92a8c | [
"MIT"
] | null | null | null | from server.scebase import Vector3
import sce,tempfile,pathlib
world = sce.World(pathlib.Path(tempfile.gettempdir()) / 'sce-test', pathlib.Path(__file__).parent.parent / 'contents' / 'trappist-1f')
world.Spawn('Megalosaurus_Character_BP',Vector3(10,10,0)) | 63.75 | 134 | 0.780392 |
413dfe7e1f202e7a186b66240aa7150a2ab65ad3 | 51 | py | Python | tools/exceptions.py | pancakeDevelopment/vaccipy | e908b2b24954d7ea6bf76ef9df1fd048cdc6455c | [
"MIT"
] | 2 | 2021-05-04T16:48:25.000Z | 2021-05-18T10:03:46.000Z | tools/exceptions.py | pancakeDevelopment/vaccipy | e908b2b24954d7ea6bf76ef9df1fd048cdc6455c | [
"MIT"
] | null | null | null | tools/exceptions.py | pancakeDevelopment/vaccipy | e908b2b24954d7ea6bf76ef9df1fd048cdc6455c | [
"MIT"
] | null | null | null | class DesktopNotificationError(Exception):
pass | 25.5 | 42 | 0.823529 |
cf75a0193abbec611955a616b98b8b4ff1d21f01 | 2,028 | py | Python | python/oneflow/nn/modules/narrow.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | null | null | null | python/oneflow/nn/modules/narrow.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | null | null | null | python/oneflow/nn/modules/narrow.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | null | null | null | """
Copyright 2020 The OneFlow Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agr... | 30.268657 | 78 | 0.643491 |
d8aa2ec03ac42da67f187bfaed7e3be8339c834c | 727 | py | Python | Python/Exercícios_Python/063_progressão_aritmética_v3.py | vdonoladev/aprendendo-programacao | 83abbcd6701b2105903b28fd549738863418cfb8 | [
"MIT"
] | null | null | null | Python/Exercícios_Python/063_progressão_aritmética_v3.py | vdonoladev/aprendendo-programacao | 83abbcd6701b2105903b28fd549738863418cfb8 | [
"MIT"
] | null | null | null | Python/Exercícios_Python/063_progressão_aritmética_v3.py | vdonoladev/aprendendo-programacao | 83abbcd6701b2105903b28fd549738863418cfb8 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""063 - Progressão Aritmética v3
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1rNN-4Lh2GNuKrrh1ipOpBL9MkyCwoh2B
"""
print("-=" * 10)
print("{:^20}".format("Gerador de PA V3.0"))
print("-=" * 10)
primeiro = int(input("Primeir... | 25.964286 | 77 | 0.602476 |
513ed1944dae77c7f93ed0ac901249111a928fd2 | 1,318 | py | Python | challenges/dfsComponentSize/python3/dfsComponentSize.py | jimmynguyen/codefights | f4924fcffdb4ff14930618bb1a781e4e02e9aa09 | [
"MIT"
] | 5 | 2020-05-21T03:02:34.000Z | 2021-09-06T04:24:26.000Z | challenges/dfsComponentSize/python3/dfsComponentSize.py | jimmynguyen/codefights | f4924fcffdb4ff14930618bb1a781e4e02e9aa09 | [
"MIT"
] | 6 | 2019-04-24T03:39:26.000Z | 2019-05-03T02:10:59.000Z | challenges/dfsComponentSize/python3/dfsComponentSize.py | jimmynguyen/codefights | f4924fcffdb4ff14930618bb1a781e4e02e9aa09 | [
"MIT"
] | 1 | 2021-09-06T04:24:27.000Z | 2021-09-06T04:24:27.000Z | def dfsComponentSize(matrix, vertex):
stack = [vertex]
component = []
while stack:
v = stack.pop()
if v not in component:
component.append(v)
for w, connected in enumerate(matrix[v]):
if connected:
stack.append(w)
return len(component)
if __name__ == '__main__':
input0 = [[[False,True,False], [... | 59.909091 | 409 | 0.682094 |
853b3161040e119d834860b125870c938b99a30f | 266 | py | Python | ProjectEuler_plus/euler_076.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | ProjectEuler_plus/euler_076.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | ProjectEuler_plus/euler_076.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
max_n = 1000 + 1
ways = [1] + [0] * max_n
for i in range(1, max_n):
for j in range(i, max_n + 1):
ways[j] += ways[j - i]
for _ in range(int(input().strip())):
n = int(input().strip())
print((ways[n] - 1) % (10 ** 9 + 7))
| 22.166667 | 40 | 0.511278 |
743ece11a8556f0b33288eeba5415ac45349e1d8 | 4,059 | py | Python | src/data_filter.py | Times125/Emotion-Analyse | b5d9f23fdf6c75f57f5cf20d58834a095b0c7e1e | [
"Apache-2.0"
] | 11 | 2018-01-16T06:39:00.000Z | 2021-11-28T11:46:41.000Z | src/data_filter.py | Times125/Emotion-Analyse | b5d9f23fdf6c75f57f5cf20d58834a095b0c7e1e | [
"Apache-2.0"
] | null | null | null | src/data_filter.py | Times125/Emotion-Analyse | b5d9f23fdf6c75f57f5cf20d58834a095b0c7e1e | [
"Apache-2.0"
] | 2 | 2019-08-16T14:53:37.000Z | 2019-08-17T02:01:22.000Z | #! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
@Author:lch02
@Time: 2018/1/3 13:08
@Description: 利用训练好的分类器重新筛选原始语料,然后利用原始语料重新训练
"""
import os
import config
import pickle
from multiprocessing import Pool
from openpyxl import load_workbook
from deal_files import text_parse
from deal_features import best_bigram_wor... | 35.295652 | 85 | 0.59596 |
77cfa1d3dcc61759400237e3fa24d2f8304573e5 | 693 | py | Python | ransom_note.py | kautuk-desai/HackerRank | 6c0b22800ea2e40d118d6a0a5c0ece067a0a69bf | [
"MIT"
] | null | null | null | ransom_note.py | kautuk-desai/HackerRank | 6c0b22800ea2e40d118d6a0a5c0ece067a0a69bf | [
"MIT"
] | null | null | null | ransom_note.py | kautuk-desai/HackerRank | 6c0b22800ea2e40d118d6a0a5c0ece067a0a69bf | [
"MIT"
] | null | null | null | from collections import Counter as counter
def main():
m, n = map(int, input().strip().split(' '))
magazine = input().strip().split(' ')
ransom = input().strip().split(' ')
answer = ransom_note(magazine, ransom)
if answer:
print("Yes")
else:
print("No")
def ransom_note(magazi... | 21 | 47 | 0.59596 |
24decd1faadb3b502349246309edfd8c93794618 | 5,163 | py | Python | Paddle_Industry_Practice_Sample_Library/nlp_projects/relation_extraction/ernie/evaluate.py | linuxonly801/awesome-DeepLearning | b063757fa130c4d56aea5cce2e592610f1e169f9 | [
"Apache-2.0"
] | 1 | 2022-03-19T09:58:37.000Z | 2022-03-19T09:58:37.000Z | Paddle_Industry_Practice_Sample_Library/nlp_projects/relation_extraction/ernie/evaluate.py | linuxonly801/awesome-DeepLearning | b063757fa130c4d56aea5cce2e592610f1e169f9 | [
"Apache-2.0"
] | null | null | null | Paddle_Industry_Practice_Sample_Library/nlp_projects/relation_extraction/ernie/evaluate.py | linuxonly801/awesome-DeepLearning | b063757fa130c4d56aea5cce2e592610f1e169f9 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020 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... | 44.895652 | 184 | 0.741817 |
7051b79ac6e3dbe8a135eb6d46b60fc4a8c50082 | 2,401 | py | Python | shinrl/solvers/discrete_vi/_build_calc_params_mixin.py | omron-sinicx/ShinRL | 09f4ae274a33d1fc1d9d542f816aef40014af6b5 | [
"MIT"
] | 34 | 2021-12-09T07:12:57.000Z | 2022-03-11T08:17:20.000Z | shinrl/solvers/discrete_vi/_build_calc_params_mixin.py | omron-sinicx/ShinRL | 09f4ae274a33d1fc1d9d542f816aef40014af6b5 | [
"MIT"
] | null | null | null | shinrl/solvers/discrete_vi/_build_calc_params_mixin.py | omron-sinicx/ShinRL | 09f4ae274a33d1fc1d9d542f816aef40014af6b5 | [
"MIT"
] | 4 | 2021-12-11T07:48:01.000Z | 2022-03-01T23:50:33.000Z | """MixIns to compute new params for nn-based algorithms.
Author: Toshinori Kitamura
Affiliation: NAIST & OSX
"""
from typing import Optional
import chex
import gym
import haiku as hk
import jax
import jax.numpy as jnp
import optax
from chex import Array
import shinrl as srl
from .config import ViConfig
class Build... | 35.308824 | 87 | 0.654311 |
3b16b4ed6d0a56327c5c51889369b0d1232f7a1e | 608 | py | Python | tarefas-poo/lista-01/calculos/view/paineis/painel_bissexto.py | victoriaduarte/POO_UFSC | 0c65b4f26383d1e3038d8469bd91fd2c0cb98c1a | [
"MIT"
] | null | null | null | tarefas-poo/lista-01/calculos/view/paineis/painel_bissexto.py | victoriaduarte/POO_UFSC | 0c65b4f26383d1e3038d8469bd91fd2c0cb98c1a | [
"MIT"
] | null | null | null | tarefas-poo/lista-01/calculos/view/paineis/painel_bissexto.py | victoriaduarte/POO_UFSC | 0c65b4f26383d1e3038d8469bd91fd2c0cb98c1a | [
"MIT"
] | null | null | null | # --------------------------
# UFSC - CTC - INE - INE5603
# Exercício calculos
# --------------------------
# Classe responsável por verificar se um ano é bissexto.
from view.paineis.painel_abstrato import PainelAbstrato
from model.calculos import bissexto
class PainelBissexto(PainelAbstrato):
def __init__(self):... | 28.952381 | 56 | 0.578947 |
8dff6fe337d4967691725c483344cace934feb53 | 171 | py | Python | django/ToDoApp/manageToDo/forms.py | pisitj/practice-python-web-framework | 5f7f60737b1cf9618e73ad8047b6c4f556d1feb0 | [
"MIT"
] | null | null | null | django/ToDoApp/manageToDo/forms.py | pisitj/practice-python-web-framework | 5f7f60737b1cf9618e73ad8047b6c4f556d1feb0 | [
"MIT"
] | null | null | null | django/ToDoApp/manageToDo/forms.py | pisitj/practice-python-web-framework | 5f7f60737b1cf9618e73ad8047b6c4f556d1feb0 | [
"MIT"
] | null | null | null | from django import forms
from .models import ToDoList
class ToDoListForm(forms.ModelForm):
class Meta:
model = ToDoList
fields = ['item', 'completed'] | 24.428571 | 38 | 0.684211 |
309a5c31438157b494aa53efdb1ecc5f557e4a3e | 470 | py | Python | code/Classes.py | ju1-eu/pyAnfaenger | 59440e99d69582ee2c7a022c8b819e7c78f41ac0 | [
"MIT"
] | null | null | null | code/Classes.py | ju1-eu/pyAnfaenger | 59440e99d69582ee2c7a022c8b819e7c78f41ac0 | [
"MIT"
] | null | null | null | code/Classes.py | ju1-eu/pyAnfaenger | 59440e99d69582ee2c7a022c8b819e7c78f41ac0 | [
"MIT"
] | null | null | null | class Car:
def __init__(self, name, year, ps): # self (this in C++/Java)
self.name = name
self.year = year
self.ps = ps
def print_car(self):
print("Car: ", self.name)
def print_ps(self):
print("Leistung: ", self.ps, " PS")
my_car = Car("Audi A1 Sportback 40 TFSI",... | 20.434783 | 65 | 0.593617 |
c62eafccdf8e0fce0309a75bfc48209c24758bbf | 2,146 | py | Python | Packs/ExpanseV2/Scripts/ExpanseAggregateAttributionDevice/ExpanseAggregateAttributionDevice_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/ExpanseV2/Scripts/ExpanseAggregateAttributionDevice/ExpanseAggregateAttributionDevice_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/ExpanseV2/Scripts/ExpanseAggregateAttributionDevice/ExpanseAggregateAttributionDevice_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import demistomock as demisto # noqa
import ExpanseAggregateAttributionDevice
INPUT = [
{"serial_number": "serialA", "count": 2, "src": "1.1.1.1"},
{"serial": "serialB", "src": "8.8.8.8", "vsys": "vsys1"},
{"log_source_id": "serialB", "src_ip": "10.0.0.1", "vsys": "vsys1", "count": 5},
{"serial_numb... | 25.855422 | 84 | 0.540075 |
79fff1b27053269602f5bafd3136d5889a08ce6b | 1,218 | py | Python | phish/main.py | wectf/2021 | 333086b618aae8f95449265b6ec94eb6db4e57a9 | [
"MIT"
] | 26 | 2021-06-20T17:01:16.000Z | 2022-02-22T03:13:18.000Z | WeCTF/2021/Phish/main.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | WeCTF/2021/Phish/main.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 4 | 2021-06-20T17:08:19.000Z | 2021-07-04T08:36:56.000Z | import os
from flask import Flask, render_template, request
from peewee import *
app = Flask(__name__)
db = SqliteDatabase("core.db")
class User(Model):
id = AutoField()
password = CharField()
username = CharField(unique=True)
class Meta:
database = db
@db.connection_context()
def initia... | 22.145455 | 117 | 0.62069 |
0020e69c718d3fc148212df3db2e63f0cd86a47f | 425 | py | Python | bolt/data/config_defaults.py | ph7vc/CL4M-B0T | e992cf63b1215ea7c241cab94edc251653dbaed7 | [
"MIT"
] | 9 | 2019-02-17T06:33:14.000Z | 2021-10-05T02:19:00.000Z | bolt/data/config_defaults.py | ns-phennessy/Bolt | e992cf63b1215ea7c241cab94edc251653dbaed7 | [
"MIT"
] | 28 | 2019-02-10T07:48:05.000Z | 2021-12-20T00:15:37.000Z | bolt/data/config_defaults.py | ph7vc/CL4M-B0T | e992cf63b1215ea7c241cab94edc251653dbaed7 | [
"MIT"
] | 4 | 2015-03-13T03:58:55.000Z | 2015-05-27T08:29:46.000Z | config_defaults = {
"name": "Bolt",
"trigger": ".",
"worker_threads": 1,
"shard_total": 1,
"shard_id": 0,
"mongo_database_uri": "mongodb://localhost:27017",
"mongo_database_username": "",
"mongo_database_password": "",
"mongo_database_use_tls": False,
"webhook_enable": False,
... | 25 | 54 | 0.597647 |
cc9c73c6bd9c02777bae8de789347874f006a6a8 | 14,127 | py | Python | python/oneflow/test/modules/test_consistent_cast.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | null | null | null | python/oneflow/test/modules/test_consistent_cast.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | null | null | null | python/oneflow/test/modules/test_consistent_cast.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | null | null | null | """
Copyright 2020 The OneFlow Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agr... | 43.201835 | 84 | 0.631415 |
ccb41845ea38c1cd9e3ba36eda3f0d5c42243a42 | 375 | py | Python | Programming Languages/Python/Theory/100_Python_Challenges/Section _1_Basic_Coding_Exercises/12. return the next number greater than the two numbers a and b and divisible by b.py | jaswinder9051998/Resources | fd468af37bf24ca57555d153ee64693c018e822e | [
"MIT"
] | 101 | 2021-12-20T11:57:11.000Z | 2022-03-23T09:49:13.000Z | Programming Languages/Python/Theory/100_Python_Challenges/Section _1_Basic_Coding_Exercises/12. return the next number greater than the two numbers a and b and divisible by b.py | Sid-1164/Resources | 3987dcaeddc8825f9bc79609ff26094282b8ece1 | [
"MIT"
] | 4 | 2022-01-12T11:55:56.000Z | 2022-02-12T04:53:33.000Z | Programming Languages/Python/Theory/100_Python_Challenges/Section _1_Basic_Coding_Exercises/12. return the next number greater than the two numbers a and b and divisible by b.py | Sid-1164/Resources | 3987dcaeddc8825f9bc79609ff26094282b8ece1 | [
"MIT"
] | 38 | 2022-01-12T11:56:16.000Z | 2022-03-23T10:07:52.000Z | """
Given two numbers a and b.
Create a function that returns the next number greater than a and b and divisible by b. (a>b)
Example:
a = 25, b = 5
Expected output = 30
"""
def check_division(a,b):
if a > b:
for num in range(1, a+b+1):
if num % b == 0 and num > a and num > b:
... | 20.833333 | 93 | 0.538667 |
aebadfa042326390263c18928221aefd895b5eae | 636 | py | Python | code/project/test/user/views.py | redxyb/Flask | 4ee226501f16eb0fa5cb585dc6bf780005fa8a28 | [
"MIT"
] | null | null | null | code/project/test/user/views.py | redxyb/Flask | 4ee226501f16eb0fa5cb585dc6bf780005fa8a28 | [
"MIT"
] | null | null | null | code/project/test/user/views.py | redxyb/Flask | 4ee226501f16eb0fa5cb585dc6bf780005fa8a28 | [
"MIT"
] | null | null | null | '''
Author: xyb
Date: 2020-08-10 10:17:07
LastEditTime: 2020-08-10 12:18:19
'''
'''注册user的路由'''
from . import user_bp
from flask import Flask, url_for, redirect
@user_bp.route('/index', methods=['GET', 'POST'])
def user_profile():
return 'user_profile'
#动态路由:<>即是一个转换器,默认为字符串类型,
#即将该位置的数据以字符串格式进行匹配、并以字符串为数据类型类型、... | 21.931034 | 75 | 0.715409 |
ee28dc0af266a1c10a1f3514ddb20f9888dbb55c | 16,963 | py | Python | src/onegov/gazette/utils/sogc_converter.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/gazette/utils/sogc_converter.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/gazette/utils/sogc_converter.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from dateutil.parser import parse
from onegov.gazette.models import Issue
from textwrap import dedent
def html_converter(text):
return '<br>'.join((line.strip() for line in text.split('\n')))
class SogcConverter(object):
""" The base class for all converters. """
def __init__(self, root):
self... | 27.945634 | 79 | 0.521488 |
c9fdd0c5ad673eaec091773d6b06c11a12b64a55 | 2,903 | py | Python | research/cv/centernet_resnet50_v1/postprocess.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/centernet_resnet50_v1/postprocess.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/centernet_resnet50_v1/postprocess.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... | 44.661538 | 106 | 0.699621 |
eea95f207c62139a17597a9ce3060f7e2ea84f37 | 2,604 | py | Python | Python/Buch_ATBS/Teil_2/Kapitel_13_Arbeiten_mit_Word_und_PDF_Dokumenten/01_pdf_einleitung_mit_pypdf2/01_pdf_einleitung_mit_pypdf2.py | Apop85/Scripts | e71e1c18539e67543e3509c424c7f2d6528da654 | [
"MIT"
] | null | null | null | Python/Buch_ATBS/Teil_2/Kapitel_13_Arbeiten_mit_Word_und_PDF_Dokumenten/01_pdf_einleitung_mit_pypdf2/01_pdf_einleitung_mit_pypdf2.py | Apop85/Scripts | e71e1c18539e67543e3509c424c7f2d6528da654 | [
"MIT"
] | 6 | 2020-12-24T15:15:09.000Z | 2022-01-13T01:58:35.000Z | Python/Buch_ATBS/Teil_2/Kapitel_13_Arbeiten_mit_Word_und_PDF_Dokumenten/01_pdf_einleitung_mit_pypdf2/01_pdf_einleitung_mit_pypdf2.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | null | null | null | # 01_einleitung_pypdf2.pypdf2.py
# Um PDF's zu lesen benötigt man das Modul PyPDF2 welches man mit pip gegebenenfalls nachinstallieren muss.
import PyPDF2, os, re
os.chdir(os.path.dirname(__file__))
max_text_length=70
max_text_delta=20
def output(title, string):
print('╔'+''.center(max_text_length+8, '═')+'╗')
... | 60.55814 | 329 | 0.74616 |
0177b0054ee889a3111da7c5e2de64c9305f6659 | 1,071 | py | Python | src/bo4e/enum/kundentyp.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 1 | 2022-03-02T12:49:44.000Z | 2022-03-02T12:49:44.000Z | src/bo4e/enum/kundentyp.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 21 | 2022-02-04T07:38:46.000Z | 2022-03-28T14:01:53.000Z | src/bo4e/enum/kundentyp.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | null | null | null | # pylint: disable=missing-module-docstring
from bo4e.enum.strenum import StrEnum
class Kundentyp(StrEnum):
"""
Auflistung der Typen von Endkunden. Daraus kann das Verbrauchsprofil abgeleitet werden.
"""
GEWERBE = "GEWERBE" #: Gewerbekunden
PRIVAT = "PRIVAT" #: Privatkunden
LANDWIRT = "LANDW... | 42.84 | 91 | 0.730159 |
019380f6bd455c7bd4774660d695153598ded6cc | 2,954 | py | Python | src/onegov/reservation/collection.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/reservation/collection.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/reservation/collection.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.core.utils import normalize_for_url
from onegov.reservation.models import Resource
from uuid import uuid4
any_type = object()
class ResourceCollection(object):
""" Manages a list of resources.
"""
def __init__(self, libres_context):
assert hasattr(libres_context, 'get_service'), """... | 32.108696 | 79 | 0.649628 |
09bc79ad0bdb49e021fb1422849a7546e1db8d07 | 4,758 | py | Python | brick/router.py | xsank/bottle | 4c228043ea31811fffd8eb30914d025c1fd43dc0 | [
"MIT"
] | 9 | 2015-01-06T01:32:43.000Z | 2017-03-01T18:34:54.000Z | brick/router.py | jude90/bottle | 4c228043ea31811fffd8eb30914d025c1fd43dc0 | [
"MIT"
] | null | null | null | brick/router.py | jude90/bottle | 4c228043ea31811fffd8eb30914d025c1fd43dc0 | [
"MIT"
] | 4 | 2015-02-05T09:48:43.000Z | 2016-02-22T15:04:35.000Z | '''
Created on 2013-4-21
@author: Xsank
'''
import re
from exception import RouteError,RouteBuildError,RouteSyntaxError
class Route(object):
syntax = re.compile(r'(.*?)(?<!\\):([a-zA-Z_]+)?(?:#(.*?)#)?')
default = '[^/]+'
def __init__(self, route, target=None, name=None, static=False):
self.ro... | 32.589041 | 91 | 0.515553 |
3a22815e67033b36d093112e7c4eec60be473332 | 782 | py | Python | django_project/wordcount_project/wordcount/views.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | django_project/wordcount_project/wordcount/views.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | django_project/wordcount_project/wordcount/views.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | from django.http import HttpResponse
from django.shortcuts import render
def homepage(request):
return render(request, 'home.html')
def about(request):
name = 'jone'
age = 29
return render(request, 'about.html', {'name': name, 'age': age})
def count(request):
fulltext = request.GET['fulltext']
... | 26.066667 | 89 | 0.613811 |
3a842f1b596e6eda6763c0876ce36ea0cd4fb089 | 3,007 | py | Python | tests/onegov/page/test_collection.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/page/test_collection.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/page/test_collection.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | import pytest
from onegov.page import PageCollection
def test_add_page(session):
pages = PageCollection(session)
root = pages.add_root(title='Test')
assert root.name == 'test'
assert root.title == 'Test'
assert root.root is root
assert list(root.ancestors) == []
assert root.path == 'test... | 26.848214 | 75 | 0.656801 |
aaec1448ede367a6d7bf97a885062ea0cdc5626b | 10,591 | py | Python | tests/onegov/gazette/test_views_notice_states.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/gazette/test_views_notice_states.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/gazette/test_views_notice_states.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from freezegun import freeze_time
from tests.onegov.gazette.common import accept_notice
from tests.onegov.gazette.common import change_category
from tests.onegov.gazette.common import change_organization
from tests.onegov.gazette.common import edit_notice
from tests.onegov.gazette.common import login_users
from tests.o... | 45.454936 | 79 | 0.629402 |
c958135a0d38185376eebc352195da14d81fab6f | 756 | py | Python | RedBook/ch8/books/urls.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | RedBook/ch8/books/urls.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | RedBook/ch8/books/urls.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | from django.urls import path
from . import views
app_name = 'books'
urlpatterns = [
# /books/
path('', views.BooksModelView.as_view(), name='index'),
# /books/book/
path('book/', views.BookList.as_view(), name='book_list'),
# /books/author/
path('author/', views.AuthorList.as_view(), name='auth... | 37.8 | 90 | 0.656085 |
a375f645a53e7601770ea477ab05e9921e8fa231 | 24,762 | py | Python | CheatsheetGenerator.py | klnrdknt/Sephrasto | 591224fe01825a169c21ebc6136533f282ce9a0b | [
"MIT"
] | 15 | 2017-11-09T12:49:52.000Z | 2022-03-06T12:18:48.000Z | CheatsheetGenerator.py | klnrdknt/Sephrasto | 591224fe01825a169c21ebc6136533f282ce9a0b | [
"MIT"
] | 40 | 2018-02-01T21:32:01.000Z | 2022-03-22T11:35:28.000Z | CheatsheetGenerator.py | klnrdknt/Sephrasto | 591224fe01825a169c21ebc6136533f282ce9a0b | [
"MIT"
] | 13 | 2018-03-12T17:50:42.000Z | 2022-03-06T12:21:41.000Z | from Wolke import Wolke
import re
import math
from difflib import SequenceMatcher
from fractions import Fraction
from Hilfsmethoden import Hilfsmethoden, WaffeneigenschaftException
import Objekte
class CheatsheetGenerator(object):
def __init__(self):
self.RuleCategories = []
self.RuleCategories.ap... | 42.915078 | 132 | 0.582384 |
42d0145205a77bebf15f9acbe39f37c28fd89304 | 1,137 | py | Python | chapter_five/comparison_script.py | PacktPublishing/Speed-up-your-Python-with-Rust | 1fce5fb59ea966015768e7eca51c0e31d69531ec | [
"MIT"
] | 21 | 2021-09-10T12:46:26.000Z | 2022-03-23T02:50:39.000Z | chapter_five/comparison_script.py | PacktPublishing/Speed-up-your-Python-with-Rust | 1fce5fb59ea966015768e7eca51c0e31d69531ec | [
"MIT"
] | null | null | null | chapter_five/comparison_script.py | PacktPublishing/Speed-up-your-Python-with-Rust | 1fce5fb59ea966015768e7eca51c0e31d69531ec | [
"MIT"
] | 6 | 2021-09-02T08:32:37.000Z | 2022-03-17T21:15:25.000Z | from time import time
from flitton_fib_rs.flitton_fib_rs import fibonacci_number
from numba import jit
def python_fib_number(number: int) -> int:
if number < 0:
raise ValueError("Fibonacci has to be equal or above zero")
elif number in [1, 2]:
return 1
else:
return python_fib_numb... | 22.294118 | 76 | 0.651715 |
42df01ebeff44c43a715a21f8fcd2395872ab9d8 | 851 | py | Python | python/logging/lowermodule_traceback.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/logging/lowermodule_traceback.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/logging/lowermodule_traceback.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | # lowermodule.py
import logging
import logging.config
import traceback
logging.config.fileConfig(fname='logging.conf', disable_existing_loggers=False)
logger = logging.getLogger(__name__)
def word_count(myfile):
try:
# count the number of words in a file, myfile, and log the result
with open(myfi... | 29.344828 | 79 | 0.647474 |
95744fa5795e424cc9d3356072ce89a9964bf890 | 1,249 | py | Python | service/wkb/question_answer.py | wangkaibiao/SettlersFinancialData3 | 498249e14f24bfa3186f07e8f66ee624d08c6ff1 | [
"MIT"
] | null | null | null | service/wkb/question_answer.py | wangkaibiao/SettlersFinancialData3 | 498249e14f24bfa3186f07e8f66ee624d08c6ff1 | [
"MIT"
] | null | null | null | service/wkb/question_answer.py | wangkaibiao/SettlersFinancialData3 | 498249e14f24bfa3186f07e8f66ee624d08c6ff1 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Thu Jun 28 14:12:48 2018
@author: 18253
"""
import pandas as pd#pandas不用考虑字符编码问题
content=open(
"/media/bdai/LENOVO/Databases/文字数据/2018年度济南分行零售业务风险政策指引v4.txt")
content_str=content.read()
"新增信用类小贷业务客户评分原则上不低于8档,新增保证类小贷业务客户评分原则上不低于7档" in content_str#True
... | 24.98 | 66 | 0.545236 |
6c11fb296c52918a6597c2f55fd2a6a6675fded3 | 1,866 | py | Python | Subbler.py | NickForero11/Subbler | ed528514e96ddc30d58230ff98ff0fd5216ea5de | [
"MIT"
] | null | null | null | Subbler.py | NickForero11/Subbler | ed528514e96ddc30d58230ff98ff0fd5216ea5de | [
"MIT"
] | null | null | null | Subbler.py | NickForero11/Subbler | ed528514e96ddc30d58230ff98ff0fd5216ea5de | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""Driver module to use Subbler as an executable script.
"""
from extract_data import extract_audio
from get_upload_link import get_upload_link
from upload_audiofile import upload_audiofile
from init_transcription import init_transcription
from check_job import check_job
from get_transcription_da... | 29.15625 | 75 | 0.722937 |
66609750dea1d07a1acaec7b3ab37b0fc0a3f012 | 6,161 | py | Python | assets/tools/scm_migration/options.py | brnnnfx/openoffice-org | 8b1023c59fd9c7a58d108bb0b01dd1f8884c9163 | [
"Apache-2.0"
] | 5 | 2019-10-14T23:00:48.000Z | 2021-11-06T22:21:06.000Z | assets/tools/scm_migration/options.py | brnnnfx/openoffice-org | 8b1023c59fd9c7a58d108bb0b01dd1f8884c9163 | [
"Apache-2.0"
] | 31 | 2020-11-14T09:27:16.000Z | 2022-03-08T17:09:15.000Z | assets/tools/scm_migration/options.py | brnnnfx/openoffice-org | 8b1023c59fd9c7a58d108bb0b01dd1f8884c9163 | [
"Apache-2.0"
] | 15 | 2020-11-10T17:04:25.000Z | 2022-01-31T12:12:48.000Z | #!/usr/bin/python
# Simple minded script for generating exclude rules for the cvs2svn options file
# Broken tags/branches, force them to branch
print 'ctx.symbol_strategy.add_rule(ForceBranchRegexpStrategyRule(\'OO614B\'))'
print 'ctx.symbol_strategy.add_rule(ForceBranchRegexpStrategyRule(\'OO619B\'))'
print 'ctx.sym... | 70.011364 | 130 | 0.774387 |
666d6625990c7fdd81e480feadad6b3afb98f71e | 2,721 | py | Python | loesungsvorschlaege/python_wiederholung/praxis/wdh_3.py | severinhaller/einf-machinelearning | 4dfc8f1da0d81c5aa800d1459f81b72d1bf6dd9b | [
"MIT"
] | null | null | null | loesungsvorschlaege/python_wiederholung/praxis/wdh_3.py | severinhaller/einf-machinelearning | 4dfc8f1da0d81c5aa800d1459f81b72d1bf6dd9b | [
"MIT"
] | null | null | null | loesungsvorschlaege/python_wiederholung/praxis/wdh_3.py | severinhaller/einf-machinelearning | 4dfc8f1da0d81c5aa800d1459f81b72d1bf6dd9b | [
"MIT"
] | null | null | null | # Lösungen zu den Aufgaben aus Unterabschnitt 1.3
import random
def quadratzahl():
zufallszahl = random.randint(1, 100)
potenz = pow(zufallszahl, 2)
print(f"Die Quadratzahl von {zufallszahl} lautet {potenz}.")
# Aufagbe 1
quadratzahl()
quadratzahl()
quadratzahl()
print()
# Aufagbe 2
import turtle as t... | 16.591463 | 105 | 0.633591 |
66d7140b33636079ab829b6aec21024fc1f84802 | 215 | py | Python | login/urls.py | rocky-roll-call/rrc-backend | 02e8e11c3dab7661e48650e2e861a4a97788a4ce | [
"MIT"
] | null | null | null | login/urls.py | rocky-roll-call/rrc-backend | 02e8e11c3dab7661e48650e2e861a4a97788a4ce | [
"MIT"
] | null | null | null | login/urls.py | rocky-roll-call/rrc-backend | 02e8e11c3dab7661e48650e2e861a4a97788a4ce | [
"MIT"
] | null | null | null | from django.urls import path
from .views import FacebookLogin
urlpatterns = [
# path("login/facebook", facebook_login, name="facebook-login")
# path("facebook/", FacebookLogin.as_view(), name="fb_login")
]
| 26.875 | 67 | 0.72093 |
dd01484e956a6edd57da829d63e0f66b02b569e4 | 886 | py | Python | Python-BlueEdTech-main/projeto-poo/relogio.py | Gitdu-edu/TrabalhoFinalBlue | 9152264b79b3dfdf01253706e437ee7713f6c3e7 | [
"MIT"
] | 3 | 2021-05-30T20:01:06.000Z | 2021-07-07T00:46:37.000Z | Python-BlueEdTech-main/projeto-poo/relogio.py | Gitdu-edu/TrabalhoFinalBlue | 9152264b79b3dfdf01253706e437ee7713f6c3e7 | [
"MIT"
] | null | null | null | Python-BlueEdTech-main/projeto-poo/relogio.py | Gitdu-edu/TrabalhoFinalBlue | 9152264b79b3dfdf01253706e437ee7713f6c3e7 | [
"MIT"
] | null | null | null | class Relogio:
def __init__(self):
self.horas = 7
self.minutos = 0
self.dia = 1
def avancaTempo(self, minutos):
self.minutos += minutos
while(self.minutos >= 60):
self.minutos -= 60
self.horas += 1
if(self.horas >= 24):
self.ho... | 30.551724 | 79 | 0.520316 |
b08f990b08893d093cdb1552a368ded58d886422 | 684 | py | Python | files/exercises/helpers/test_helper_functions.py | erikschmitt/DataScienceW20 | 599eea52a166d7f180a499f98a7bcca143657e68 | [
"Apache-2.0"
] | null | null | null | files/exercises/helpers/test_helper_functions.py | erikschmitt/DataScienceW20 | 599eea52a166d7f180a499f98a7bcca143657e68 | [
"Apache-2.0"
] | null | null | null | files/exercises/helpers/test_helper_functions.py | erikschmitt/DataScienceW20 | 599eea52a166d7f180a499f98a7bcca143657e68 | [
"Apache-2.0"
] | null | null | null | import unittest
from os import getcwd
from os.path import split
from helper_functions import translate_to_local_file_path
class HelperFunctionsTestCase(unittest.TestCase):
"""Test for HelperFunction.py"""
def test_translate_to_local_file_path(self):
pwd=getcwd()
head, tail = split(pwd)
... | 32.571429 | 75 | 0.701754 |
b0053bd57f9e6ad9eddb4f95a8454a04c3c316b6 | 1,822 | py | Python | IVTp/2014/Shcherbakov_R_A/task_13_22.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | IVTp/2014/Shcherbakov_R_A/task_13_22.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | IVTp/2014/Shcherbakov_R_A/task_13_22.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | # Задача 13. Вариант 22.
# Разработайте собственную стратегию ходов компьютера для игры "Крестики-
# нолики" (Задача 12). Перепишите функцию computer_move() в соответствии с этой
# стратегией.
# Щербаков Р.А.
# 22.05.2016
import random
print("""
Добро пожаловать на игру крестики нолики
чтобы сделать ход введите чис... | 24.958904 | 79 | 0.475302 |
c65eaf48464f6b4bd4284e486e3c9658d96737d1 | 2,450 | py | Python | meerkat_consul/__init__.py | meerkat-code/meerkat_consul | 983851b360f330ad258e15d45d98251e0fe21100 | [
"MIT"
] | null | null | null | meerkat_consul/__init__.py | meerkat-code/meerkat_consul | 983851b360f330ad258e15d45d98251e0fe21100 | [
"MIT"
] | 1 | 2018-07-18T16:36:12.000Z | 2018-07-18T16:36:12.000Z | meerkat_consul/__init__.py | fjelltopp/meerkat_consul | 983851b360f330ad258e15d45d98251e0fe21100 | [
"MIT"
] | null | null | null | import logging
import os
from json.decoder import JSONDecodeError
import backoff as backoff
import requests
from flask import Flask
app = Flask(__name__)
app.config.from_object(os.getenv('CONFIG_OBJECT', 'config.Development'))
app.config.from_pyfile(os.getenv('MEERKAT_CONSUL_SETTINGS'), silent=True)
logger = logging... | 31.410256 | 101 | 0.752245 |
c6b6351453fee463b73de1db5551cd535c235d6c | 5,366 | py | Python | Website/admin.py | NeonCrafter13/easyvoc | 605f3394565df8192615bc9ced27c0fa8d1ee51a | [
"MIT"
] | null | null | null | Website/admin.py | NeonCrafter13/easyvoc | 605f3394565df8192615bc9ced27c0fa8d1ee51a | [
"MIT"
] | null | null | null | Website/admin.py | NeonCrafter13/easyvoc | 605f3394565df8192615bc9ced27c0fa8d1ee51a | [
"MIT"
] | null | null | null | from flask import Blueprint, templating, session, escape, request
from db import userdb, requestdb, taskdb
admin = Blueprint("admin", __name__, static_folder="static", template_folder="templates")
@admin.route("/")
def overview():
user = None
if "name" in session:
user = session["name"]
if no... | 32.131737 | 105 | 0.63921 |
af03c844212ecfae7ddff3619f1a8ce9e8db2438 | 4,834 | py | Python | monsoon-web-master/monsoon.py | jaakaappi/archived-projects | be1f754eca7c1434f3a363b0ea8ebcd190a42436 | [
"MIT"
] | null | null | null | monsoon-web-master/monsoon.py | jaakaappi/archived-projects | be1f754eca7c1434f3a363b0ea8ebcd190a42436 | [
"MIT"
] | 3 | 2021-03-10T13:18:31.000Z | 2021-05-11T09:20:11.000Z | monsoon-web-master/monsoon.py | jaakaappi/archived-projects | be1f754eca7c1434f3a363b0ea8ebcd190a42436 | [
"MIT"
] | null | null | null | import aiohttp
import aiohttp_jinja2
import argparse
import jinja2
import os
from aiohttp import web
from datetime import datetime, timedelta
from models import Base, Data
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
parser = argparse.ArgumentParser()
parser.add_argument('--mock', help=... | 33.337931 | 113 | 0.674803 |
a53787c806526c0d894a485e4d6dffddc3916bb6 | 463 | py | Python | Audio_Extract_Test/clip.py | g-ghosh/Final-Thesis | 3f49bbb43bb1f67f927ba4d9c8887f4e3ada8ff0 | [
"MIT"
] | 1 | 2021-08-21T06:19:44.000Z | 2021-08-21T06:19:44.000Z | Audio_Extract_Test/clip.py | Swastik1993/Final-Thesis | 86b809c7ffea5b6d456a57f38ff278e45ea82d9a | [
"MIT"
] | null | null | null | Audio_Extract_Test/clip.py | Swastik1993/Final-Thesis | 86b809c7ffea5b6d456a57f38ff278e45ea82d9a | [
"MIT"
] | 1 | 2019-03-13T15:12:50.000Z | 2019-03-13T15:12:50.000Z | from pydub import AudioSegment
files_path = '/home/gaurab/Audio_Extract_Test/'
file_name = 'small_audio'
startMin = 0
startSec = 2.33
endMin = 0
endSec = 2.8
# Time to miliseconds
startTime = startMin*60*1000+startSec*1000
endTime = endMin*60*1000+endSec*1000
# Opening file and extracting segment
song = AudioSegme... | 21.045455 | 59 | 0.760259 |
a59867b3c27be3fc587f1150b338749722ab89ea | 1,971 | py | Python | surface/Game.py | StefanSchmelz/whoGetsTheMillion | 99a42b6a2e99def4faa05787b4869387d7827f86 | [
"MIT"
] | null | null | null | surface/Game.py | StefanSchmelz/whoGetsTheMillion | 99a42b6a2e99def4faa05787b4869387d7827f86 | [
"MIT"
] | null | null | null | surface/Game.py | StefanSchmelz/whoGetsTheMillion | 99a42b6a2e99def4faa05787b4869387d7827f86 | [
"MIT"
] | null | null | null | import tkinter as tk
from engine.Player import Player
from surface.qPanel import QuestionDisplayPanel
class GameUi:
def __init__(self):
self.player = Player()
self.gameWindow = tk.Tk()
self.jokerFrame = tk.Frame(self.gameWindow)
self.halfJoker = tk.Button(self.jokerFrame, text="50... | 38.647059 | 95 | 0.608828 |
a722c27b63f2c4154fd899993c434a16925a0a88 | 2,935 | py | Python | indl/old_reference/test_trainable_prior.py | SachsLab/indl | 531d2e0c2ee765004aedc553af40e258262f86cb | [
"Apache-2.0"
] | 1 | 2021-02-22T01:39:50.000Z | 2021-02-22T01:39:50.000Z | indl/old_reference/test_trainable_prior.py | SachsLab/indl | 531d2e0c2ee765004aedc553af40e258262f86cb | [
"Apache-2.0"
] | null | null | null | indl/old_reference/test_trainable_prior.py | SachsLab/indl | 531d2e0c2ee765004aedc553af40e258262f86cb | [
"Apache-2.0"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
import tensorflow.keras.layers as tfkl
from tensorflow.keras import backend as K
import tensorflow_probability as tfp
tfd = tfp.distributions
tfpl = tfp.layers
tfb = tfp.bijectors
# Constants #
#############
BATCH_SIZE = 8
N_EPOCHS = 5
PRIOR_T... | 31.223404 | 95 | 0.656899 |
f9f2aae84e710e52e9645ccb403881782ba2f7cf | 1,134 | py | Python | Contrib-Microsoft/Olympus_rack_manager/python-ocs/commonapi/models/fwversion.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/commonapi/models/fwversion.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/commonapi/models/fwversion.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.
# -*- codi... | 23.142857 | 68 | 0.537919 |
f97c763216fb0ee80e1cc597b62ec455a9d49583 | 531 | py | Python | nz_django/day3/db_relation_demo/cms/migrations/0008_auto_20200220_1621.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | null | null | null | nz_django/day3/db_relation_demo/cms/migrations/0008_auto_20200220_1621.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 27 | 2020-02-12T07:55:58.000Z | 2022-03-12T00:19:09.000Z | nz_django/day3/db_relation_demo/cms/migrations/0008_auto_20200220_1621.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 2 | 2020-02-18T01:54:55.000Z | 2020-02-21T11:36:28.000Z | # Generated by Django 2.0 on 2020-02-20 08:21
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('cms', '0007_auto_20200220_1618'),
]
operations = [
migrations.AlterField(
model_name='article',
... | 26.55 | 167 | 0.65725 |
f9929f5ebe4f8942a5b3691c2909e38fd7c8c0c6 | 2,036 | py | Python | src/data/cluster_colors.py | klawr/deepmech | 61de238f1d4b1b867ec1d5f4e4af2a3b25a5abff | [
"MIT"
] | 1 | 2020-04-17T12:27:06.000Z | 2020-04-17T12:27:06.000Z | src/data/cluster_colors.py | klawr/deepmech | 61de238f1d4b1b867ec1d5f4e4af2a3b25a5abff | [
"MIT"
] | 1 | 2022-02-27T13:13:17.000Z | 2022-02-27T13:13:17.000Z | src/data/cluster_colors.py | klawr/deepmech | 61de238f1d4b1b867ec1d5f4e4af2a3b25a5abff | [
"MIT"
] | null | null | null |
import cv2
import numpy as np
from sklearn.cluster import KMeans
from os import listdir, path, mkdir
from tqdm import tqdm
# insert directory 'n', 'o' or 'x' here:
target = 'x'
# Don't review process on the go:
auto = True
dir_path = path.join('raw', target)
processed = path.join('processed', target)
# This is not r... | 30.38806 | 83 | 0.659627 |
ddb3466943e1db3ddfe521f2a33dea26bdc235b7 | 147 | py | Python | 3.Python/strangestroad.py | AyushSarode/Hacktoberfest2020-Newbie | f7194dabcefb7e808eaedc852c630cbd65367517 | [
"MIT"
] | 11 | 2020-10-02T06:37:32.000Z | 2020-10-28T09:09:33.000Z | 3.Python/strangestroad.py | AyushSarode/Hacktoberfest2020-Newbie | f7194dabcefb7e808eaedc852c630cbd65367517 | [
"MIT"
] | 7 | 2020-10-08T09:03:22.000Z | 2020-11-03T23:58:13.000Z | 3.Python/strangestroad.py | AyushSarode/Hacktoberfest2020-Newbie | f7194dabcefb7e808eaedc852c630cbd65367517 | [
"MIT"
] | 58 | 2020-09-29T15:35:39.000Z | 2021-10-05T17:35:15.000Z | name, age = "Ashwini Patel", *20*
username = "strangestroad"
print ('Hello!')
print("Name: {}\nAge: {}\nUsername: {}".format(name, age, username))
| 29.4 | 68 | 0.646259 |
b5baaf98fef8d56f75fefb8b7c3167e738eda2e2 | 5,400 | py | Python | x2paddle/project_convertor/pytorch/dependency_analyzer.py | usertianqin/X2Paddle | b554a8094ca3e255ef4bd2e80337222a35625133 | [
"Apache-2.0"
] | 559 | 2019-01-14T06:01:55.000Z | 2022-03-31T02:52:43.000Z | x2paddle/project_convertor/pytorch/dependency_analyzer.py | usertianqin/X2Paddle | b554a8094ca3e255ef4bd2e80337222a35625133 | [
"Apache-2.0"
] | 353 | 2019-05-07T13:20:03.000Z | 2022-03-31T05:30:12.000Z | x2paddle/project_convertor/pytorch/dependency_analyzer.py | usertianqin/X2Paddle | b554a8094ca3e255ef4bd2e80337222a35625133 | [
"Apache-2.0"
] | 241 | 2018-12-25T02:13:51.000Z | 2022-03-27T23:21:43.000Z | # 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 appl... | 36.986301 | 80 | 0.640741 |
1f4ddc061ac4ba0c2bc32f5713d51bf42dbf5a1e | 104 | py | Python | packages/watchmen-inquiry-kernel/src/watchmen_inquiry_kernel/storage/__init__.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-inquiry-kernel/src/watchmen_inquiry_kernel/storage/__init__.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-inquiry-kernel/src/watchmen_inquiry_kernel/storage/__init__.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from .report_data_service import ReportDataService
from .subject_data_service import SubjectDataService
| 34.666667 | 52 | 0.903846 |
2f1357106159e7e522ab9311b48483e560f59d62 | 2,237 | py | Python | models/hr_documents.py | DevCriUd/hr_cgt | 5db7c173b937fd156b365d17ddf9bd6d86638315 | [
"Apache-2.0"
] | null | null | null | models/hr_documents.py | DevCriUd/hr_cgt | 5db7c173b937fd156b365d17ddf9bd6d86638315 | [
"Apache-2.0"
] | null | null | null | models/hr_documents.py | DevCriUd/hr_cgt | 5db7c173b937fd156b365d17ddf9bd6d86638315 | [
"Apache-2.0"
] | 2 | 2019-08-07T18:25:43.000Z | 2019-08-19T16:19:57.000Z | # -*- coding: utf-8 -*-
from odoo import api, fields, models
from odoo import tools, _
from odoo.exceptions import ValidationError
from odoo.modules.module import get_module_resource
import logging
_logger = logging.getLogger(__name__)
class FullHrDocuments(models.Model):
_name = 'hr.documents'
# Compute
... | 26.630952 | 74 | 0.618686 |
2f853df7c18d172258e589bc46283c7b4e25be55 | 4,889 | py | Python | marsyas-vamp/marsyas/src/apps/openmir/omSpectrogram.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | marsyas-vamp/marsyas/src/apps/openmir/omSpectrogram.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | marsyas-vamp/marsyas/src/apps/openmir/omSpectrogram.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
#
#
#
import sys
import os
import datetime
import commands
import re
import time
import simplejson as json
import marsyas
import numpy as np
import scipy.misc.pilutil as smp
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from optparse import OptionParser
def run(audioFile,... | 36.485075 | 112 | 0.638167 |
9eb4035d4dfc6864c661d50d27462cc8f5df4e9b | 2,638 | py | Python | task_1/data_investigation/top_words.py | strumswell/sentiment-apple-events | b6f4f7799374aba757874f5426b3a2c1bf7d29b5 | [
"MIT"
] | 1 | 2022-02-28T22:02:50.000Z | 2022-02-28T22:02:50.000Z | task_1/data_investigation/top_words.py | strumswell/sentiment-apple-events | b6f4f7799374aba757874f5426b3a2c1bf7d29b5 | [
"MIT"
] | null | null | null | task_1/data_investigation/top_words.py | strumswell/sentiment-apple-events | b6f4f7799374aba757874f5426b3a2c1bf7d29b5 | [
"MIT"
] | null | null | null | # Sources
# - https://towardsdatascience.com/end-to-end-topic-modeling-in-python-latent-dirichlet-allocation-lda-35ce4ed6b3e0
# Not so happy with found topics -> but we have to look deeper into the topics and if we can label them
#
# %% Importing modules
import pandas as pd
from wordcloud import WordCloud
from sklea... | 45.482759 | 463 | 0.731615 |
a81cec331b4d1f8709869120bee101d023910a44 | 2,149 | py | Python | Algorithms/Bit_Manipulation/and_product.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | Algorithms/Bit_Manipulation/and_product.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | Algorithms/Bit_Manipulation/and_product.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
MAX_E = 32
def next_power_of_2(n):
for i in range(MAX_E):
if e_2[i] > n:
return e_2[i]
e_2 = [2 ** i for i in range(1, MAX_E + 1)]
for _ in range(int(input())):
a, b = list(map(int, input().strip().split()))
np = next_power_of_2(a ^ b)
np = np - 1
print... | 30.267606 | 287 | 0.658911 |
b5afd71f10632930c492c039b852433ae7fee609 | 1,521 | py | Python | Calibrate.py | manpreet-singh/DataCollectionPackage | 996546b9062c969c2af3a60b35445077f70641c2 | [
"MIT"
] | null | null | null | Calibrate.py | manpreet-singh/DataCollectionPackage | 996546b9062c969c2af3a60b35445077f70641c2 | [
"MIT"
] | null | null | null | Calibrate.py | manpreet-singh/DataCollectionPackage | 996546b9062c969c2af3a60b35445077f70641c2 | [
"MIT"
] | null | null | null | import time
import logging
import sys
import os
from Adafruit_BNO055 import BNO055
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
GPIO.setup(17, GPIO.OUT)
bno = BNO055.BNO055(serial_port='/dev/serial0', rst=18)
# Enable verbose debug logging if -v is passed as a parameter.
if len(sys.argv) =... | 28.698113 | 81 | 0.690335 |
f555e417e1b1ba7e4095dd7ac01a8b102b1e0b0d | 1,987 | py | Python | 33. Search in Rotated Sorted array.py | chenenfeng/lt | be71a83ff485d2fa8850df324e5661767be3dc00 | [
"MIT"
] | 1 | 2018-09-03T23:53:43.000Z | 2018-09-03T23:53:43.000Z | 33. Search in Rotated Sorted array.py | chenenfeng/lt | be71a83ff485d2fa8850df324e5661767be3dc00 | [
"MIT"
] | null | null | null | 33. Search in Rotated Sorted array.py | chenenfeng/lt | be71a83ff485d2fa8850df324e5661767be3dc00 | [
"MIT"
] | null | null | null | #ascending array with some pivots, like[4,5,6,7,1,2,3], 1 is just the pivot, no duplicate exists
# time complexity should be O(logn)
# give a target number, then find the number in the array and return in its index, if not found, return -1
"""
I need to find the pivot, because no duplicate, if I use for-looper to comp... | 41.395833 | 143 | 0.661298 |
5fd8ad32d406eeb1a17795f30bd0ca0c0d125bfd | 79 | pyde | Python | sketches/Legend_Of_Zelda/Legend_Of_Zelda.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 4 | 2018-06-03T02:11:46.000Z | 2021-08-18T19:55:15.000Z | sketches/Legend_Of_Zelda/Legend_Of_Zelda.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | null | null | null | sketches/Legend_Of_Zelda/Legend_Of_Zelda.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 3 | 2019-12-23T19:12:51.000Z | 2021-04-30T14:00:31.000Z | def setup():
# w/o HUD
size(512, 352)
# w HUD
# size(512, 480)
| 13.166667 | 20 | 0.468354 |
27424bc2a8ca8f1eaf75518e1609ceffded9828c | 80 | py | Python | examples/miniportal/portal/macros/add.py | Jumpscale/web | 8e8ec2ce01f3105c7647ee8a0c90af09311cbbeb | [
"Apache-2.0"
] | 1 | 2015-10-26T10:38:32.000Z | 2015-10-26T10:38:32.000Z | examples/miniportal/portal/macros/add.py | Jumpscale/web | 8e8ec2ce01f3105c7647ee8a0c90af09311cbbeb | [
"Apache-2.0"
] | null | null | null | examples/miniportal/portal/macros/add.py | Jumpscale/web | 8e8ec2ce01f3105c7647ee8a0c90af09311cbbeb | [
"Apache-2.0"
] | null | null | null |
def add(actors, a, b):
return actors.system.usermanager.editUser(actors)
| 13.333333 | 53 | 0.7125 |
27c1e08ec56e6f70f50ab40912db0a42dddc4240 | 692 | py | Python | home/views.py | joaogabriel15/spfc | 74e0fb79cfe64001fe55fea07aa80d61fa76b2e4 | [
"MIT"
] | null | null | null | home/views.py | joaogabriel15/spfc | 74e0fb79cfe64001fe55fea07aa80d61fa76b2e4 | [
"MIT"
] | null | null | null | home/views.py | joaogabriel15/spfc | 74e0fb79cfe64001fe55fea07aa80d61fa76b2e4 | [
"MIT"
] | null | null | null | from django.contrib.auth.decorators import login_required
from django.shortcuts import render, redirect
from .models import Civil, Documento, TipoDocumento
# Create your views here.
@login_required()
def home(request):
return render(request, 'home/index.html')
def pesquisa_id(request, civil_id):
civil_dados ... | 28.833333 | 69 | 0.745665 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.