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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
e06ed7ae8f8ae203e701a28e181f3d6eee04ad29 | 341 | py | Python | custom_user/config.py | EE/flexdb | 08a80b9e56201e678ef055af27bdefa6d52bcbf5 | [
"MIT"
] | null | null | null | custom_user/config.py | EE/flexdb | 08a80b9e56201e678ef055af27bdefa6d52bcbf5 | [
"MIT"
] | null | null | null | custom_user/config.py | EE/flexdb | 08a80b9e56201e678ef055af27bdefa6d52bcbf5 | [
"MIT"
] | null | null | null | app_name = "custom_user"
prefix_url = "custom_user"
static_files = {
'js': {
'custom_user/js/': ['main.js', ]
},
'css': {
'custom_user/css/': ['main.css', ]
},
'html': {
'': []
}
}
permissions = {
"edit": "Editing other users data.",
"permissions": "Changing permi... | 18.944444 | 52 | 0.510264 |
16e1433d7ae33f402d9dff80d2095f73e2f2631e | 8,092 | py | Python | crypto/mini-A3S/src/mini.py | NoXLaw/RaRCTF2021-Challenges-Public | 1a1b094359b88f8ebbc83a6b26d27ffb2602458f | [
"MIT"
] | null | null | null | crypto/mini-A3S/src/mini.py | NoXLaw/RaRCTF2021-Challenges-Public | 1a1b094359b88f8ebbc83a6b26d27ffb2602458f | [
"MIT"
] | null | null | null | crypto/mini-A3S/src/mini.py | NoXLaw/RaRCTF2021-Challenges-Public | 1a1b094359b88f8ebbc83a6b26d27ffb2602458f | [
"MIT"
] | null | null | null | '''
Base-3 AES
Just use SAGE lmao
'''
T_SIZE = 3 # Fixed trits in a tryte
W_SIZE = 3 # Fixed trytes in a word (determines size of matrix)
POLY = (2, 0, 1, 1) # Len = T_SIZE + 1
POLY2 = ((2, 0, 1), (1, 2, 0), (0, 2, 1), (2, 0, 1)) # Len = W_SIZE + 1
CONS = ((1, 2, 0), (2, 0, 1), (1... | 28.195122 | 108 | 0.514088 |
bcd2d8d9e532eac60c876ee80ba4d00b985823e8 | 5,192 | py | Python | scripts/matching_illustration.py | tliu68/maggot_connectome | ef4bbd2011fa9e03da187fcca8c8c1ca79209a36 | [
"MIT"
] | null | null | null | scripts/matching_illustration.py | tliu68/maggot_connectome | ef4bbd2011fa9e03da187fcca8c8c1ca79209a36 | [
"MIT"
] | null | null | null | scripts/matching_illustration.py | tliu68/maggot_connectome | ef4bbd2011fa9e03da187fcca8c8c1ca79209a36 | [
"MIT"
] | null | null | null | #%% [markdown]
# # Matching the two sides of the brain
# Using techniques for graph matching, we can try to uncover a one-to-one correspondence
# between the nodes of the left side of the brain and the nodes of the right side.
#%% [markdown]
# ## Preliminaries
#%%
from pkg.utils import set_warnings
import datetime
imp... | 27.617021 | 88 | 0.678929 |
4c32ef5ec425a8be229f70b56517501239337626 | 2,436 | py | Python | source/api/api_oauth.py | weberval/SocialBot | f45e16c28fe2a1283b09b1f5c7b6334ef03f9a7b | [
"MIT"
] | 2 | 2018-04-07T14:56:12.000Z | 2020-03-26T12:06:51.000Z | source/api/api_oauth.py | weberval/SocialBot | f45e16c28fe2a1283b09b1f5c7b6334ef03f9a7b | [
"MIT"
] | 2 | 2018-04-07T14:55:31.000Z | 2018-04-25T07:43:29.000Z | source/api/api_oauth.py | weberval/SocialBot | f45e16c28fe2a1283b09b1f5c7b6334ef03f9a7b | [
"MIT"
] | 2 | 2019-09-06T22:31:43.000Z | 2020-03-26T12:06:51.000Z | from requests_oauthlib import OAuth1Session
from api.json_connector import JSONConnector
from api.api_config import APIConfig
import webbrowser
import time
class OAuthProcess:
REQUEST_TOKEN_URL = 'https://api.twitter.com/oauth/request_token'
ACCESS_TOKEN_URL = 'https://api.twitter.com/oauth/access_token'
... | 34.309859 | 105 | 0.637931 |
4c5e7bd962db16755804757217b3b749b713ff02 | 2,451 | py | Python | bin/lovelace-gen.py | Adamvg/SmartHouse | 740b010260f6f6b38a19e2a75d431446abd54253 | [
"MIT"
] | 136 | 2019-06-27T08:11:47.000Z | 2022-03-11T12:26:53.000Z | bin/lovelace-gen.py | Venkysgithu/SmartHouse | d4e42dbbbb1f535f1684d507de411a4421b92e4d | [
"MIT"
] | 5 | 2020-05-30T00:19:22.000Z | 2022-03-25T18:49:47.000Z | bin/lovelace-gen.py | Venkysgithu/SmartHouse | d4e42dbbbb1f535f1684d507de411a4421b92e4d | [
"MIT"
] | 63 | 2019-07-15T21:11:58.000Z | 2022-03-13T09:43:24.000Z | import argparse
import os
import sys
import codecs
import time
from ruamel.yaml import YAML
from ruamel.yaml.constructor import RoundTripConstructor
import jinja2
MAIN_FILE = 'main.yaml'
GENERATOR_MESSAGE = """
# This file is automatically generated by lovelace-gen.py
# https://github.com/thomasloven/homeassistant-lo... | 28.172414 | 77 | 0.667891 |
538cd9ff065270192f4bd10a04f599f993e583ec | 7,817 | py | Python | Packs/Phishing/Scripts/CheckEmailAuthenticity/CheckEmailAuthenticity.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/Phishing/Scripts/CheckEmailAuthenticity/CheckEmailAuthenticity.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/Phishing/Scripts/CheckEmailAuthenticity/CheckEmailAuthenticity.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
import re
import traceback
'''HELPER FUNCTIONS'''
def get_spf(auth, spf):
"""
Get SPF validation information
:param auth: authentication header value (if exist), contains the validation result and sender i... | 37.581731 | 119 | 0.579634 |
54d001ec81dbd91b98a24d130213e6144e95f7c6 | 6,766 | py | Python | Contrib-Inspur/openbmc/poky/bitbake/lib/bb/fetch2/perforce.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 5 | 2019-11-11T07:57:26.000Z | 2022-03-28T08:26:53.000Z | Contrib-Inspur/openbmc/poky/bitbake/lib/bb/fetch2/perforce.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 3 | 2019-09-05T21:47:07.000Z | 2019-09-17T18:10:45.000Z | Contrib-Inspur/openbmc/poky/bitbake/lib/bb/fetch2/perforce.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 11 | 2019-07-20T00:16:32.000Z | 2022-01-11T14:17:48.000Z | """
BitBake 'Fetch' implementation for perforce
"""
# Copyright (C) 2003, 2004 Chris Larson
# Copyright (C) 2016 Kodak Alaris, Inc.
#
# SPDX-License-Identifier: GPL-2.0-only
#
# Based on functions from the base bb module, Copyright 2003 Holger Schurig
import os
import logging
import bb
from bb.fetch2 import Fetch... | 35.056995 | 100 | 0.57183 |
54f70c16e4fa8abebe2028e0531c90f83ebe9a10 | 131 | py | Python | addition_module/DSDG/data/__init__.py | weihaoxie/FaceX-Zoo | db0b087e4f4d28152e172d6c8d3767a8870733b4 | [
"Apache-2.0"
] | 1 | 2022-02-07T02:03:37.000Z | 2022-02-07T02:03:37.000Z | addition_module/DSDG/data/__init__.py | weihaoxie/FaceX-Zoo | db0b087e4f4d28152e172d6c8d3767a8870733b4 | [
"Apache-2.0"
] | null | null | null | addition_module/DSDG/data/__init__.py | weihaoxie/FaceX-Zoo | db0b087e4f4d28152e172d6c8d3767a8870733b4 | [
"Apache-2.0"
] | null | null | null | from .generation_dataset import GenDataset_s
from .recognition_dataset import ImageList, SeparateBatchSampler, SeparateImageList
| 43.666667 | 84 | 0.877863 |
db6c8b0e7a6b5f2d98182ab0cff103dc4ee03d18 | 3,345 | py | Python | Python/plotCpXc.py | guillaumetousignant/euler3D | 7bdfaae7f6b774232b6fc9f83d40a67ccee9a8ae | [
"MIT"
] | 1 | 2019-02-11T00:45:37.000Z | 2019-02-11T00:45:37.000Z | Python/plotCpXc.py | guillaumetousignant/euler3D | 7bdfaae7f6b774232b6fc9f83d40a67ccee9a8ae | [
"MIT"
] | null | null | null | Python/plotCpXc.py | guillaumetousignant/euler3D | 7bdfaae7f6b774232b6fc9f83d40a67ccee9a8ae | [
"MIT"
] | null | null | null | import tecplot
import os
import numpy as np
import math
import string
from tecplot.exception import *
from tecplot.constant import *
class plotCpXc(object):
def __init__(self, mySurfaceFlowFile, Type, Axis, XCoordinate, YCoordinate, ZCoordinate):
print("plotCpXc...................................... | 35.967742 | 105 | 0.550374 |
db984fd977db219727a7a2f296e6066cf480e148 | 3,406 | py | Python | SleekSecurity/layers/plugins/brute/commondir.py | GitInitDev/ZohoUniv | 966704837e65f58b52492b56d08e7958df3d220a | [
"Unlicense"
] | null | null | null | SleekSecurity/layers/plugins/brute/commondir.py | GitInitDev/ZohoUniv | 966704837e65f58b52492b56d08e7958df3d220a | [
"Unlicense"
] | null | null | null | SleekSecurity/layers/plugins/brute/commondir.py | GitInitDev/ZohoUniv | 966704837e65f58b52492b56d08e7958df3d220a | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python
# -*- coding:utf-8 -*-
#
# @name: Wascan - Web Application Scanner
# @repo: https://github.com/m4ll0k/Wascan
# @author: Momo Outaadi (M4ll0k)
# @license: See the file 'LICENSE.txt'
from os import path
from re import search, I
from Queue import Queue
from threading import Thread
from lib.ut... | 32.438095 | 85 | 0.520258 |
91bddd22f65c56a0ef1b6c5a80d32303b706996e | 374 | py | Python | nz_crawl_demo/day11/first_celery/task.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | null | null | null | nz_crawl_demo/day11/first_celery/task.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 27 | 2020-02-12T07:55:58.000Z | 2022-03-12T00:19:09.000Z | nz_crawl_demo/day11/first_celery/django_celery/first_celery/task.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 2 | 2020-02-18T01:54:55.000Z | 2020-02-21T11:36:28.000Z | from celery import Celery
#broker任务队列 生产者生产任务 放到这里边 消费者从这里边拿
#backend 存储 消费者处理好以后 将结果存放到这里边
app = Celery('celery_1904',broker='redis://127.0.0.1:6379/1',backend='redis://127.0.0.1:6379/2')
# celery.Task
@app.task
def hello(name):
print("hello world:{}".format(name))
return "hello world:{}".format(name)
@... | 22 | 96 | 0.679144 |
53073302199c4913b28ae257104b654c1aa164b6 | 4,009 | py | Python | Backdoor-ReverseShellPack/listener.py | Unam3dd/Train-2018-2020 | afb6ae70fe338cbe55a21b74648d91996b818fa2 | [
"MIT"
] | 4 | 2021-04-23T15:39:17.000Z | 2021-12-27T22:53:24.000Z | Backdoor-ReverseShellPack/listener.py | Unam3dd/Train-2018-2020 | afb6ae70fe338cbe55a21b74648d91996b818fa2 | [
"MIT"
] | null | null | null | Backdoor-ReverseShellPack/listener.py | Unam3dd/Train-2018-2020 | afb6ae70fe338cbe55a21b74648d91996b818fa2 | [
"MIT"
] | 2 | 2021-04-19T08:28:54.000Z | 2022-01-19T13:23:29.000Z | #!/usr/bin/python2
#-*- coding:utf-8 -*-
import socket
import colorama
import nclib
from datetime import datetime
import time
import random
import sys
import argparse
import os
import platform
from ftplib import FTP
import readline
import thread
banner1 = '''
██▀███ ▓█████ ██▒ █▓ ▒█████ ██▓ █ ██ ▄▄▄█████... | 43.576087 | 129 | 0.444749 |
535567c7daee523fdbdaf46b86b8f8c00f455570 | 1,012 | py | Python | files/math/Experiment_05/Messung 09062020/CSV Dateien/Auswertung.py | mimeiners/ans | 382e000e687d5ec0c80a84223087e60ed656a1dd | [
"MIT"
] | null | null | null | files/math/Experiment_05/Messung 09062020/CSV Dateien/Auswertung.py | mimeiners/ans | 382e000e687d5ec0c80a84223087e60ed656a1dd | [
"MIT"
] | null | null | null | files/math/Experiment_05/Messung 09062020/CSV Dateien/Auswertung.py | mimeiners/ans | 382e000e687d5ec0c80a84223087e60ed656a1dd | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Sun Jun 7 22:56:38 2020
@author: Julian
"""
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import matplotlib as mpl
plt.close('all')
mpl.rc('xtick', labelsize=20)
mpl.rc('ytick', labelsize=20)
plt.rcParams.update({'font.size': 22})
#%%
a = np.array(pd... | 32.645161 | 101 | 0.647233 |
f44af1ae25d632346c1bd7aa9f47593dcc00aa3f | 10,581 | py | Python | finbyz_dashboard/finbyz_dashboard/report/item_wise_purchase_register.py | finbyz/finbyz_dashboard | 9c58ab7bccf589bc010d0e5bf95b20cadd4d71f0 | [
"MIT"
] | 1 | 2021-11-19T05:27:11.000Z | 2021-11-19T05:27:11.000Z | finbyz_dashboard/finbyz_dashboard/report/item_wise_purchase_register.py | finbyz/finbyz_dashboard | 9c58ab7bccf589bc010d0e5bf95b20cadd4d71f0 | [
"MIT"
] | null | null | null | finbyz_dashboard/finbyz_dashboard/report/item_wise_purchase_register.py | finbyz/finbyz_dashboard | 9c58ab7bccf589bc010d0e5bf95b20cadd4d71f0 | [
"MIT"
] | 2 | 2021-08-21T10:41:38.000Z | 2021-11-19T05:27:13.000Z | # 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, erpnext
from frappe import _
from frappe.utils import flt
from erpnext.accounts.report.item_wise_sales_register.item_wise_sales_register ... | 27.200514 | 143 | 0.671392 |
be642bef41fb688333b8ee5c45c923a3e6f3d667 | 717 | py | Python | Python/Courses/LearnToCodeInPython3ProgrammingBeginnerToAdvancedYourProgress/python_course/Section4Modules/28Matplotlib.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/28Matplotlib.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/28Matplotlib.py | JamieBort/LearningDirectory | afca79c5f1333c079d0e96202ff44ca21b2ceb81 | [
"Info-ZIP"
] | null | null | null | # Matplotlib is an external module.
# External modules need to be installed.
# to install this matplotlib library type 'pip install matplotlib' in the commnand line.
# it was already installed. I didn't update it.
# we'll be using these libraries in later lessons:
# https://matplotlib.org/
# https://scikit-learn.org/s... | 29.875 | 88 | 0.716876 |
22ee0e83fd44b17fb0b4c1fe1f2ba28b1282cea5 | 899 | py | Python | TestCodeArchive/PythonCode/ColorDetection/test.py | tobiasdossinger/percy | c2ca6f21fcd6830ffd6d3879f7bcaaa5b87335e5 | [
"MIT"
] | null | null | null | TestCodeArchive/PythonCode/ColorDetection/test.py | tobiasdossinger/percy | c2ca6f21fcd6830ffd6d3879f7bcaaa5b87335e5 | [
"MIT"
] | null | null | null | TestCodeArchive/PythonCode/ColorDetection/test.py | tobiasdossinger/percy | c2ca6f21fcd6830ffd6d3879f7bcaaa5b87335e5 | [
"MIT"
] | null | null | null | import cv2
import numpy as np
# rgb(113, 145, 109)
# define the list of boundaries
boundaries = [
([73, 105, 69], [153, 185, 149]),
([86, 31, 4], [220, 88, 50]),
([25, 146, 190], [62, 174, 250]),
([103, 86, 65], [145, 133, 128])
]
cap = cv2.VideoCapture(0)
while(True):
# Capture frame-by-frame
ret, image... | 24.297297 | 63 | 0.627364 |
434e271a0b27b63ac369d85f5c23cce2ba5cef1c | 1,228 | py | Python | vormittags/blatt2_2.py | dotKuro/vorsemesterWISE19-20 | 436c6d1846b6c1bfb087652e8ca179bd1b12c28e | [
"CC0-1.0"
] | 1 | 2019-09-27T13:47:20.000Z | 2019-09-27T13:47:20.000Z | vormittags/blatt2_2.py | dotKuro/vorsemesterWISE19-20 | 436c6d1846b6c1bfb087652e8ca179bd1b12c28e | [
"CC0-1.0"
] | null | null | null | vormittags/blatt2_2.py | dotKuro/vorsemesterWISE19-20 | 436c6d1846b6c1bfb087652e8ca179bd1b12c28e | [
"CC0-1.0"
] | null | null | null | from math import inf
def square_number(number):
"""f(x) = x^2"""
return number*number
def get_smallest_number(numbers):
smallest_number = inf
for number in numbers:
if number < smallest_number:
smallest_number = number
return smallest_number
def get_largest_number(numbers... | 18.058824 | 52 | 0.650651 |
602a48b04e8467d67395819cb5192a9c780472e1 | 5,032 | py | Python | src/lecture1/new_classifier/binary_classification/binary_classification.py | Fassial/zju-intern | f421f9c97d3c567e9b97121c5bf5c675c9e2c721 | [
"MIT"
] | 1 | 2020-08-17T07:09:09.000Z | 2020-08-17T07:09:09.000Z | src/lecture1/new_classifier/binary_classification/binary_classification.py | Fassial/zju-intern | f421f9c97d3c567e9b97121c5bf5c675c9e2c721 | [
"MIT"
] | null | null | null | src/lecture1/new_classifier/binary_classification/binary_classification.py | Fassial/zju-intern | f421f9c97d3c567e9b97121c5bf5c675c9e2c721 | [
"MIT"
] | 2 | 2020-07-26T07:27:57.000Z | 2020-08-17T07:09:15.000Z | import sys
sys.path.append('..')
from hog.hog import hog
import numpy as np
import matplotlib.pyplot as plt
"""
get_hog:
@params:
image_list(list) : the list of image to compute hog
@rets:
feature_list(list) : the list of hog of pictures
"""
def get_hog(image_list):
feature_l... | 27.347826 | 129 | 0.62182 |
e0be668c4967be418bee984ecd5c34ab5b342842 | 1,548 | py | Python | pacman-arch/test/pacman/tests/sync600.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/sync600.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/sync600.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-09-26T08:44:40.000Z | 2021-09-26T08:44:40.000Z | # coding=utf8
self.description = "Sync packages with evil filenames"
self.filesystem = ["usr/bin/endwithspace",
"usr/bin/newendwithspace",
"usr/bin/disappear",
"spaces/name",
"spaces/name2"]
p1 = pmpkg("spaces")
p1.files = ["usr/bin/endwithsp... | 29.769231 | 59 | 0.608527 |
1c4f37aff89600bd99aff7bb0f929755302b2530 | 19,576 | py | Python | matbench/tests/test_task.py | sparks-baird/matbench | 4424609454286e32fff2bcc724379b2a316c5a76 | [
"MIT"
] | 15 | 2021-11-01T09:02:19.000Z | 2022-03-19T10:59:41.000Z | matbench/tests/test_task.py | sparks-baird/matbench | 4424609454286e32fff2bcc724379b2a316c5a76 | [
"MIT"
] | 62 | 2021-09-20T14:09:59.000Z | 2022-03-30T19:03:22.000Z | matbench/tests/test_task.py | ardunn/matbench | 7d11a2d63766339ec00e610e2255be29b81544d3 | [
"MIT"
] | 4 | 2021-03-22T10:37:42.000Z | 2021-07-20T14:11:28.000Z | import copy
import glob
import json
import os
import unittest
import numpy as np
import pandas as pd
from pymatgen.core import Structure
from matbench.constants import (
CLF_METRICS,
COMPOSITION_KEY,
FOLD_DIST_METRICS,
MBV01_KEY,
REG_KEY,
REG_METRICS,
STRUCTURE_KEY,
TEST_KEY,
)
from ma... | 40.698545 | 85 | 0.547558 |
1c9c6067bec90385ac8f64ba102f07afd3f71c60 | 14,370 | py | Python | methods/transformers/src/transformers/tokenization_phobert.py | INK-USC/RiddleSense | a3d57eaf084da9cf6b77692c608e2cd2870fbd97 | [
"MIT"
] | 3 | 2021-07-06T20:02:31.000Z | 2022-03-27T13:13:01.000Z | methods/transformers/src/transformers/tokenization_phobert.py | INK-USC/RiddleSense | a3d57eaf084da9cf6b77692c608e2cd2870fbd97 | [
"MIT"
] | null | null | null | methods/transformers/src/transformers/tokenization_phobert.py | INK-USC/RiddleSense | a3d57eaf084da9cf6b77692c608e2cd2870fbd97 | [
"MIT"
] | null | null | null | # coding=utf-8
# Copyright (c) 2020, VinAI Research and the HuggingFace Inc. team.
# Copyright 2018 The Open AI Team Authors and 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... | 39.916667 | 120 | 0.589422 |
c769a2913c2c110262a25aed80373fc3278ea2d3 | 321 | py | Python | tests/onegov/wtfs/test_views_exceptions.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/wtfs/test_views_exceptions.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/wtfs/test_views_exceptions.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null |
def test_view_exceptions(client):
assert (
"Sie versuchen eine Seite zu öffnen, für die Sie nicht autorisiert "
"sind"
) in client.get('/municipalities/add', status=403)
assert (
"Die angeforderte Seite konnte nicht gefunden werden."
) in client.get('/abstimmungen', status=404)... | 29.181818 | 76 | 0.663551 |
90c8619d3f9a203f67fc414487571061d2a3c8b7 | 34 | py | Python | lib/python3.5/bisect.py | hwroitzsch/BikersLifeSaver | 469c738fdd6352c44a3f20689b17fa8ac04ad8a2 | [
"MIT"
] | 1 | 2020-08-16T04:04:23.000Z | 2020-08-16T04:04:23.000Z | lib/python3.5/bisect.py | hwroitzsch/BikersLifeSaver | 469c738fdd6352c44a3f20689b17fa8ac04ad8a2 | [
"MIT"
] | 5 | 2020-06-05T18:53:24.000Z | 2021-12-13T19:49:15.000Z | lib/python3.5/bisect.py | hwroitzsch/BikersLifeSaver | 469c738fdd6352c44a3f20689b17fa8ac04ad8a2 | [
"MIT"
] | null | null | null | /usr/local/lib/python3.5/bisect.py | 34 | 34 | 0.794118 |
90e70d391c9cddc020c33afdf7938b77ddbf91ae | 15,197 | py | Python | tests/test_app.py | MePyDo/pygqa | 61cde42ee815968fdd029cc5056ede3badea3d91 | [
"MIT"
] | null | null | null | tests/test_app.py | MePyDo/pygqa | 61cde42ee815968fdd029cc5056ede3badea3d91 | [
"MIT"
] | null | null | null | tests/test_app.py | MePyDo/pygqa | 61cde42ee815968fdd029cc5056ede3badea3d91 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
"""
# append project baspath to site
import os, site
ABSPATH = os.path.dirname( os.path.abspath( __file__) )
base_path = os.path.join( ABSPATH , ".." )
site.addsitedir(base_path)
from os import path as osp
import shutil
from urllib.parse import urlencode
# Coverage am Anfang initialis... | 32.68172 | 152 | 0.500757 |
2943bd44a3f156d35232e17afcc816ac83ba7fea | 495 | py | Python | demos/System_Dynamics/prey_predator_sd/model/partial_state_update_block.py | w-ghub/demos | 6382676fae89bd5a190626612712fcedf17bca6d | [
"MIT"
] | 56 | 2020-07-08T23:23:15.000Z | 2022-03-11T20:43:09.000Z | demos/System_Dynamics/prey_predator_sd/model/partial_state_update_block.py | w-ghub/demos | 6382676fae89bd5a190626612712fcedf17bca6d | [
"MIT"
] | 41 | 2020-07-11T23:24:06.000Z | 2022-01-28T13:28:07.000Z | demos/System_Dynamics/prey_predator_sd/model/partial_state_update_block.py | w-ghub/demos | 6382676fae89bd5a190626612712fcedf17bca6d | [
"MIT"
] | 39 | 2020-07-15T11:35:04.000Z | 2022-02-01T16:02:51.000Z | from .parts.lotka_volterra import *
partial_state_update_block = [
{
# lotka_volterra.py
'policies': {
'reproduce_prey': reproduce_prey,
'reproduce_predators': reproduce_predators,
'eliminate_prey': eliminate_prey,
'eliminate_predators': eliminate_pr... | 26.052632 | 66 | 0.581818 |
29513d49ed15820c34dacd765efb5a2d8fb49f55 | 6,396 | py | Python | 7-assets/past-student-repos/LambdaSchool-master/m6/62b1/names/doubly_linked_list.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/past-student-repos/LambdaSchool-master/m6/62b1/names/doubly_linked_list.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/past-student-repos/LambdaSchool-master/m6/62b1/names/doubly_linked_list.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | """Each ListNode holds a reference to its previous node
as well as its next node in the List."""
class ListNode:
def __init__(self, value, prev=None, next=None):
self.value = value
self.prev = prev
self.next = next
"""Wrap the given value in a ListNode and insert it
after this node.... | 31.820896 | 112 | 0.586304 |
9ec491d69833370e084875fb8dbce3377c2f3543 | 117 | py | Python | Fitting/model2pest.py | nvoss12838/gpsFIT | 5f06274e57f7c2f4101775eadf7142e5f492b177 | [
"MIT"
] | 1 | 2019-10-01T04:13:08.000Z | 2019-10-01T04:13:08.000Z | Fitting/model2pest.py | nvoss12838/gpsFIT | 5f06274e57f7c2f4101775eadf7142e5f492b177 | [
"MIT"
] | null | null | null | Fitting/model2pest.py | nvoss12838/gpsFIT | 5f06274e57f7c2f4101775eadf7142e5f492b177 | [
"MIT"
] | null | null | null | import equation_builder
t,l,u = readData()
functions = parseFunFile(funFile)
model = model_tseries(t,functions)
| 11.7 | 34 | 0.760684 |
829c2b54f8eca5847221eb555f23a11395d53673 | 1,409 | py | Python | app.py | fablab-ka/labstatus | 1b93232fecb95ea3ba8fc950575a74cba8bed2df | [
"MIT"
] | null | null | null | app.py | fablab-ka/labstatus | 1b93232fecb95ea3ba8fc950575a74cba8bed2df | [
"MIT"
] | null | null | null | app.py | fablab-ka/labstatus | 1b93232fecb95ea3ba8fc950575a74cba8bed2df | [
"MIT"
] | null | null | null | from bottle import Bottle, route, run, template, static_file, request, error, hook, get, post, server_names
import os.path
import uuid
import bottle
import datetime
import logging
logging.basicConfig(level=logging.INFO, filename="log/log.txt", filemode="a+",
format='%(asctime)s - %(message)s')
@rou... | 24.719298 | 107 | 0.621008 |
c4d33c45a99459e69d57349b19416c82c5aa407e | 2,295 | py | Python | web-brutator-master/lib/core/Utils.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | web-brutator-master/lib/core/Utils.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | web-brutator-master/lib/core/Utils.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-05T18:07:48.000Z | 2022-02-24T21:25:07.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import argparse
import glob
from os.path import basename
class Utils:
@staticmethod
def list_modules():
modules = list(map(lambda x: basename(x)[:-3].lower(),
glob.glob('./lib/modules/*.py')))
if '__init__' in modules:
mod... | 31.438356 | 90 | 0.606972 |
c4e9b5701c9edc42d9cf5f89b02cf0bb95034a21 | 967 | py | Python | packages/std/nodes/std___Button0/widgets/std___Button0___main_widget___METACODE.py | Shirazbello/Pyscriptining | 0f2c80a9bb10477d65966faeccc7783f20385c1b | [
"MIT"
] | null | null | null | packages/std/nodes/std___Button0/widgets/std___Button0___main_widget___METACODE.py | Shirazbello/Pyscriptining | 0f2c80a9bb10477d65966faeccc7783f20385c1b | [
"MIT"
] | null | null | null | packages/std/nodes/std___Button0/widgets/std___Button0___main_widget___METACODE.py | Shirazbello/Pyscriptining | 0f2c80a9bb10477d65966faeccc7783f20385c1b | [
"MIT"
] | null | null | null | # from PySide2.QtWidgets import ...
# from PySide2.QtCore import ...
# from PySide2.QtGui import ...
from PySide2.QtWidgets import QPushButton
class %NODE_TITLE%_NodeInstance_MainWidget(QPushButton):
def __init__(self, parent_node_instance):
super(%NODE_TITLE%_NodeInstance_MainWidget, self).__init__()
... | 26.861111 | 68 | 0.564633 |
4826a723e78b5430a258cb34b35b5c606cfcd663 | 618 | py | Python | format_json.py | LikeToAccess/RCB | 37510facf935a9a8559bdd85ac86b292b5764639 | [
"MIT"
] | 1 | 2022-02-02T18:08:10.000Z | 2022-02-02T18:08:10.000Z | format_json.py | LikeToAccess/RCB | 37510facf935a9a8559bdd85ac86b292b5764639 | [
"MIT"
] | null | null | null | format_json.py | LikeToAccess/RCB | 37510facf935a9a8559bdd85ac86b292b5764639 | [
"MIT"
] | null | null | null | import os
from settings import data_drive_letter
def run():
os.chdir(f"{data_drive_letter}:/REDDIT_DATA")
files_read = []
files_changed = []
for filename in os.listdir():
if "RC_" in filename:
if filename.endswith(".json"):
files_read.append(filename)
else:
try:
os.rename(filename, f"{filena... | 21.310345 | 72 | 0.697411 |
82f39730f4e2c778a531e089e3b168391da9fb85 | 1,168 | py | Python | packages/Perceptron/nodes/Perceptron___Perceptron0/widgets/Perceptron___Perceptron0___main_widget___METACODE.py | Shirazbello/Pyscriptining | 0f2c80a9bb10477d65966faeccc7783f20385c1b | [
"MIT"
] | null | null | null | packages/Perceptron/nodes/Perceptron___Perceptron0/widgets/Perceptron___Perceptron0___main_widget___METACODE.py | Shirazbello/Pyscriptining | 0f2c80a9bb10477d65966faeccc7783f20385c1b | [
"MIT"
] | null | null | null | packages/Perceptron/nodes/Perceptron___Perceptron0/widgets/Perceptron___Perceptron0___main_widget___METACODE.py | Shirazbello/Pyscriptining | 0f2c80a9bb10477d65966faeccc7783f20385c1b | [
"MIT"
] | null | null | null | from PySide2.QtWidgets import QLabel, QVBoxLayout, QPushButton
from PySide2.QtCore import Qt
from PySide2.QtGui import QPixmap
from PySide2.QtWidgets import QWidget
import os
class %NODE_TITLE%_NodeInstance_MainWidget(QWidget):
def __init__(self, parent_node_instance):
super(%NODE_TITLE%_NodeInstance_Mai... | 29.948718 | 97 | 0.628425 |
73e2c09c3bfa03b827704fe98cda5c911154b9c9 | 4,888 | py | Python | python/oneflow/utils/data/decorator.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 3,285 | 2020-07-31T05:51:22.000Z | 2022-03-31T15:20:16.000Z | python/oneflow/utils/data/decorator.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 2,417 | 2020-07-31T06:28:58.000Z | 2022-03-31T23:04:14.000Z | python/oneflow/utils/data/decorator.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... | 38.1875 | 95 | 0.617635 |
86077796856e104399a309b22724b2d18989f1ac | 568 | py | Python | packages/watchmen-storage-oracle/src/watchmen_storage_oracle/__init__.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-storage-oracle/src/watchmen_storage_oracle/__init__.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-storage-oracle/src/watchmen_storage_oracle/__init__.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from .data_source_oracle import OracleDataSourceHelper, OracleDataSourceParams
from .storage_oracle import StorageOracle, TopicDataStorageOracle
from .storage_oracle_configuration import StorageOracleConfiguration
from .table_defs_oracle import register_meta_table
from .table_defs_helper import ask_meta_data, create_bo... | 71 | 109 | 0.889085 |
e3902cb98d3b9b64988f3a70b3cfbe8889a484d1 | 334 | py | Python | website/apps/blog/managers.py | stahlnow/stahlnow | 265dd46c54f68173071d1c86218201d6e618ceeb | [
"MIT"
] | 1 | 2017-03-14T08:08:31.000Z | 2017-03-14T08:08:31.000Z | website/apps/blog/managers.py | stahlnow/stahlnow | 265dd46c54f68173071d1c86218201d6e618ceeb | [
"MIT"
] | null | null | null | website/apps/blog/managers.py | stahlnow/stahlnow | 265dd46c54f68173071d1c86218201d6e618ceeb | [
"MIT"
] | null | null | null | from django.db.models import Manager
from django.utils import timezone
class PublicManager(Manager):
"""Returns published posts that are not in the future."""
def published(self):
#return self.get_queryset().filter(status__gte=2, publish__lte=timezone.now())
return self.get_queryset().filter(... | 33.4 | 86 | 0.736527 |
e3de500da50258f52d4463a873db3955c6249b64 | 231 | py | Python | Linkedin Learning/Learning Python/Excercise Files/Exercise Files/Ch2/conditionals_start.py | rishav3101/Online-Courses-Learning | 1e9356af331b27b6ee33d376d8d7104edaeac2fa | [
"MIT"
] | 331 | 2019-10-22T09:06:28.000Z | 2022-03-27T13:36:03.000Z | Linkedin Learning/Learning Python/Excercise Files/Exercise Files/Ch2/conditionals_start.py | rishav3101/Online-Courses-Learning | 1e9356af331b27b6ee33d376d8d7104edaeac2fa | [
"MIT"
] | 8 | 2020-04-10T07:59:06.000Z | 2022-02-06T11:36:47.000Z | Linkedin Learning/Learning Python/Excercise Files/Exercise Files/Ch2/conditionals_start.py | rishav3101/Online-Courses-Learning | 1e9356af331b27b6ee33d376d8d7104edaeac2fa | [
"MIT"
] | 572 | 2019-07-28T23:43:35.000Z | 2022-03-27T22:40:08.000Z | #
# Example file for working with conditional statements
#
def main():
x, y = 10, 100
# conditional flow uses if, elif, else
# conditional statements let you use "a if C else b"
if __name__ == "__main__":
main()
| 15.4 | 54 | 0.649351 |
49c5b1fb79436059918888a84576101f7f34a81a | 77 | py | Python | 0-notes/job-search/Cracking the Coding Interview/C07ObjectOrientedDesign/questions/7.3-question.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 0-notes/job-search/Cracking the Coding Interview/C07ObjectOrientedDesign/questions/7.3-question.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 0-notes/job-search/Cracking the Coding Interview/C07ObjectOrientedDesign/questions/7.3-question.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | # 7.3 Jukebox
# Design a musical jukebox using object-oriented principles.
| 15.4 | 60 | 0.766234 |
b7c8b29f6f3d72ff327e3e27b533f357e489be11 | 3,069 | py | Python | src/test/tests/operators/operators.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 226 | 2018-12-29T01:13:49.000Z | 2022-03-30T19:16:31.000Z | src/test/tests/operators/operators.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 5,100 | 2019-01-14T18:19:25.000Z | 2022-03-31T23:08:36.000Z | src/test/tests/operators/operators.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 84 | 2019-01-24T17:41:50.000Z | 2022-03-10T10:01:46.000Z | # ----------------------------------------------------------------------------
# CLASSES: nightly
#
# Test Case: operators.py
#
# Tests: mesh - 3D unstructured, single domain
# plots - pc
# operators - slice, clip, onionpeel
# selection - none
#
# Defect ID: no... | 21.765957 | 78 | 0.685239 |
8339723cee8b68fc655b092a12ada55a2409a471 | 134,500 | py | Python | Funktionen.py | hanslhansl/TUW-statistics-calculator1 | 1dfa449212531e61cbaf1c425d75d759061c9159 | [
"MIT"
] | null | null | null | Funktionen.py | hanslhansl/TUW-statistics-calculator1 | 1dfa449212531e61cbaf1c425d75d759061c9159 | [
"MIT"
] | null | null | null | Funktionen.py | hanslhansl/TUW-statistics-calculator1 | 1dfa449212531e61cbaf1c425d75d759061c9159 | [
"MIT"
] | null | null | null | from scipy.stats import norm, t, chi2, binom, f
import math
import numpy as np
import tkintertable as tkt
import pandas as pd
from statsmodels.sandbox.stats.multicomp import MultiComparison, get_tukeyQcrit2
#Base class
class function:
name = "Default name"
description = "Default description"
def... | 54.586039 | 248 | 0.548387 |
b10b3855e7bd31fffb1ba1e628adf1e8d1195ce1 | 385 | py | Python | HackerP/Basic Data Types/Find the Runner-Up Score!.py | JKChang2015/hackerrank | 5e5bd6892d2e4754e73f73eecfa8f4b9f266c3bd | [
"MIT"
] | null | null | null | HackerP/Basic Data Types/Find the Runner-Up Score!.py | JKChang2015/hackerrank | 5e5bd6892d2e4754e73f73eecfa8f4b9f266c3bd | [
"MIT"
] | null | null | null | HackerP/Basic Data Types/Find the Runner-Up Score!.py | JKChang2015/hackerrank | 5e5bd6892d2e4754e73f73eecfa8f4b9f266c3bd | [
"MIT"
] | null | null | null | # Find the Runner-Up Score!
# Created by JKChang
# 14/08/2018, 11:22
# Tag:
# Description: https://www.hackerrank.com/challenges/find-second-maximum-number-in-a-list/problem?h_r=next-challenge&h_v=zen
if __name__ == '__main__':
n = int(input())
arr = list(map(int, input().split()))
z = max(arr)
while ... | 24.0625 | 124 | 0.641558 |
491ce311c10d22af8f03213133a8caf4c4bfd8d5 | 1,911 | py | Python | rating/no_third_party_cookies.py | thegreenwebfoundation/green-spider | 68f22886178bbe5b476a4591a6812ee25cb5651b | [
"Apache-2.0"
] | 19 | 2018-04-20T11:03:41.000Z | 2022-01-12T20:58:56.000Z | rating/no_third_party_cookies.py | thegreenwebfoundation/green-spider | 68f22886178bbe5b476a4591a6812ee25cb5651b | [
"Apache-2.0"
] | 160 | 2018-04-05T16:12:59.000Z | 2022-03-01T13:01:27.000Z | rating/no_third_party_cookies.py | thegreenwebfoundation/green-spider | 68f22886178bbe5b476a4591a6812ee25cb5651b | [
"Apache-2.0"
] | 8 | 2018-11-05T13:07:57.000Z | 2021-06-11T11:46:43.000Z | """
Adds a point if the site sets no third party cookies.
"""
import logging
from urllib.parse import urlparse
from rating.abstract_rater import AbstractRater
class Rater(AbstractRater):
rating_type = 'boolean'
default_value = False
depends_on_checks = ['load_in_browser']
max_score = 1
def __in... | 31.85 | 122 | 0.566196 |
775232056d6b9f32bcf4ab23b6576788e6d54090 | 285 | py | Python | 30 Days of Code/30DoC-day-10/30DoC_day_10.py | nirobio/puzzles | fda8c84d8eefd93b40594636fb9b7f0fde02b014 | [
"MIT"
] | null | null | null | 30 Days of Code/30DoC-day-10/30DoC_day_10.py | nirobio/puzzles | fda8c84d8eefd93b40594636fb9b7f0fde02b014 | [
"MIT"
] | null | null | null | 30 Days of Code/30DoC-day-10/30DoC_day_10.py | nirobio/puzzles | fda8c84d8eefd93b40594636fb9b7f0fde02b014 | [
"MIT"
] | null | null | null | #!/bin/python3
import math
import os
import random
import re
import sys
n = int(input())
result = 0
maximum = 0
while n > 0:
if n % 2 == 1:
result += 1
if result > maximum:
maximum = result
else:
result = 0
n //= 2
print(maximum)
| 10.961538 | 28 | 0.536842 |
62245e4e66cc936197bf24a3d4ca83caf4120b1f | 75,560 | py | Python | research/cvtmodel/resnet_ipl/src/resnest101e.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cvtmodel/resnet_ipl/src/resnest101e.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cvtmodel/resnet_ipl/src/resnest101e.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | import mindspore.ops as P
from mindspore import nn
class Module0(nn.Cell):
def __init__(self, conv2d_0_in_channels, conv2d_0_out_channels, conv2d_2_in_channels, conv2d_2_out_channels,
reshape_4_shape, conv2d_7_in_channels, conv2d_7_out_channels, conv2d_9_in_channels,
conv2d_9_out_... | 64.08821 | 120 | 0.511342 |
029a964c3751edb2d79603212f9d277eee752977 | 1,062 | py | Python | Mostafa's_workflow/ReadImage.py | FrieAT/MD_CompressedWavelet | 82bd10edd611485cd5f0b81da744e07a3b7c98eb | [
"MIT"
] | 2 | 2020-03-28T11:50:45.000Z | 2020-12-08T13:36:26.000Z | Mostafa's_workflow/ReadImage.py | FrieAT/MD_CompressedWavelet | 82bd10edd611485cd5f0b81da744e07a3b7c98eb | [
"MIT"
] | 2 | 2020-04-20T11:12:59.000Z | 2020-05-11T05:37:36.000Z | Mostafa's_workflow/ReadImage.py | FrieAT/MD_CompressedWavelet | 82bd10edd611485cd5f0b81da744e07a3b7c98eb | [
"MIT"
] | null | null | null |
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
from PIL import Image, ImageFilter, ImageDraw
import pywt
import pywt.data
class ReadImage:
def do(image):
#plt.ylabel('Quadratzahlen')
#plt.plot([1,2,3,4], [1,4,9,16], 'bo')
#plt.axis([0,5,0,20])
#... | 31.235294 | 94 | 0.577213 |
02a3a89aeeefd1ebb6f5d914e8e441d76acd3617 | 6,039 | py | Python | Saving.py | Turidus/Minecraft-MapMaker | 16e4015d03d67f04cfd247c11c9e3e2a5429b79f | [
"MIT"
] | 1 | 2018-10-24T16:02:08.000Z | 2018-10-24T16:02:08.000Z | Saving.py | Turidus/Minecraft-MapMaker | 16e4015d03d67f04cfd247c11c9e3e2a5429b79f | [
"MIT"
] | 2 | 2018-07-16T19:04:00.000Z | 2018-07-29T11:43:53.000Z | Saving.py | Turidus/Minecraft-MapMaker | 16e4015d03d67f04cfd247c11c9e3e2a5429b79f | [
"MIT"
] | null | null | null | """
Provides functions that save the different data representations to disc
Made by Turidus https://github.com/Turidus/Minecraft-MapMaker
Copyright (c) 2018 Turidus
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to dea... | 37.04908 | 131 | 0.612684 |
f30dc3340f00137dafaf9ba0ec53599c26985219 | 1,940 | py | Python | Python/zzz_training_challenge/Python_Challenge/solutions/ch07_recursion_advanced/intro/fib_with_memo.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/ch07_recursion_advanced/intro/fib_with_memo.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/ch07_recursion_advanced/intro/fib_with_memo.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | # Beispielprogramm für das Buch "Python Challenge"
#
# Copyright 2020 by Michael Inden
import time
def fib_rec(n):
if n <= 0:
raise ValueError("n must be >= 1")
if n == 1 or n == 2:
return 1
# rekursiver Abstieg
return fib_rec(n - 1) + fib_rec(n - 2)
def fibonacci_optimized(n):
... | 24.25 | 86 | 0.62732 |
a2b844862d230d53c295264c476f61302eb6a150 | 3,488 | py | Python | LedgerDonjon/2020/ghostbuster/ghostbuster/network/ssh-isolation.py | mystickev/ctf-archives | 89e99a5cd5fb6b2923cad3fe1948d3ff78649b4e | [
"MIT"
] | 1 | 2021-11-02T20:53:58.000Z | 2021-11-02T20:53:58.000Z | LedgerDonjon/2020/ghostbuster/ghostbuster/network/ssh-isolation.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | LedgerDonjon/2020/ghostbuster/ghostbuster/network/ssh-isolation.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 1 | 2021-12-19T11:06:24.000Z | 2021-12-19T11:06:24.000Z | #!/usr/bin/python3 -EIs
"""
Give a different UID to each SSH connection.
Not meant to be secure, just prevent different users from messing with each
other (there is nothing to see here.)
"""
import logging
import os
import re
import shutil
import sys
MIN_UID = 3000
MAX_UID = 3100
WORKDIR = "/tmp/ghostbuster"
def d... | 25.275362 | 90 | 0.629014 |
0c6285e44a644df8cd48cb062c6aea6ebe1b54f2 | 731 | py | Python | Implementation/vibrostudies-backend/db/utils.py | VibroStudies/vibrostudies | 24491d4dd193655e3036354174babc4ab17a8639 | [
"MIT"
] | null | null | null | Implementation/vibrostudies-backend/db/utils.py | VibroStudies/vibrostudies | 24491d4dd193655e3036354174babc4ab17a8639 | [
"MIT"
] | null | null | null | Implementation/vibrostudies-backend/db/utils.py | VibroStudies/vibrostudies | 24491d4dd193655e3036354174babc4ab17a8639 | [
"MIT"
] | null | null | null | from enum import IntEnum
class PermissionTypes(IntEnum):
PARTICIPANT =0
CREATOR = 1
ADMINISTRATOR = 2
@classmethod
def choices(cls):
return [(key.value, key.name) for key in cls]
class StudyStatus(IntEnum):
CREATED = 0
PUBLISHED = 1
FINISHED = 2
@classmethod
def choices(cls):
return ... | 18.74359 | 49 | 0.681259 |
ce01790905ab3413c5b710a96ab3d199cd544867 | 2,178 | py | Python | Textadventure/maps.py | clemens2107/textadventure | 870f3ff98accdadad386a2cae4bd4328341f7eb9 | [
"CC0-1.0"
] | null | null | null | Textadventure/maps.py | clemens2107/textadventure | 870f3ff98accdadad386a2cae4bd4328341f7eb9 | [
"CC0-1.0"
] | null | null | null | Textadventure/maps.py | clemens2107/textadventure | 870f3ff98accdadad386a2cae4bd4328341f7eb9 | [
"CC0-1.0"
] | null | null | null | # -*- coding: utf-8 -*-
import random
from enemies import enemie_list
class field:
def __init__(self, enemies):
self.enemies = enemies
def print_state(self):
print("Du siehst dich um und endeckst")
for i in self.enemies:
print(i.name)
@staticmethod
... | 31.114286 | 162 | 0.553719 |
02191715e77ab2ae1285c4c20c4dd8b65ea68540 | 604 | py | Python | ANN/e06/e06.py | joao-frohlich/BCC | 9ed74eb6d921d1280f48680677a2140c5383368d | [
"Apache-2.0"
] | 10 | 2020-12-08T20:18:15.000Z | 2021-06-07T20:00:07.000Z | ANN/e06/e06.py | joao-frohlich/BCC | 9ed74eb6d921d1280f48680677a2140c5383368d | [
"Apache-2.0"
] | 2 | 2021-06-28T03:42:13.000Z | 2021-06-28T16:53:13.000Z | ANN/e06/e06.py | joao-frohlich/BCC | 9ed74eb6d921d1280f48680677a2140c5383368d | [
"Apache-2.0"
] | 2 | 2021-01-14T19:59:20.000Z | 2021-06-15T11:53:21.000Z | from pprint import pprint
from numpy import array, dot, linalg
def g(x1, x2):
g_1 = x1 * x1 - 3 * x2 * x2 + 5
g_2 = x1 * x1 + 2 * x2 * x2 - 5
return array([g_1, g_2])
def g_(x1, x2):
g_11 = 2 * x1
g_12 = -6 * x2
g_21 = 2 * x1
g_22 = 4 * x2
return array([[g_11, g_12], [g_21, g_22]])
... | 18.875 | 54 | 0.485099 |
5a82ffecf1b44f8786c95672089c12d461606f83 | 447 | py | Python | Proj8/nonpalindrom_words_existing_reversed.py | SnasiCze/ISJ | 2284cb0d53aad5dd0bfc6230224700628be9e454 | [
"MIT"
] | null | null | null | Proj8/nonpalindrom_words_existing_reversed.py | SnasiCze/ISJ | 2284cb0d53aad5dd0bfc6230224700628be9e454 | [
"MIT"
] | null | null | null | Proj8/nonpalindrom_words_existing_reversed.py | SnasiCze/ISJ | 2284cb0d53aad5dd0bfc6230224700628be9e454 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
''' import knihoven '''
import fileinput
''' konec importu '''
''' DEKLARACE ZÁSTUPNÝCH PROMNĚNÝCH '''
MJEDNA=-1
''' Konec deklarace '''
''' DEKLARACE PROMNĚNÝCH '''
words = palin = set()
''' Konec deklarace '''
for line in fileinput.FileInput():
tmp = line.rstrip()
words.add(tmp)
if tmp == t... | 23.526316 | 72 | 0.666667 |
ce94b7073c18fe8083c3c27efc42b703343cbe3b | 495 | py | Python | Python/Courses/LearnToCodeInPython3ProgrammingBeginnerToAdvancedYourProgress/python_course/Section4Modules/27Time.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/27Time.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/27Time.py | JamieBort/LearningDirectory | afca79c5f1333c079d0e96202ff44ca21b2ceb81 | [
"Info-ZIP"
] | null | null | null | import time as t
print("t.localtime(): ", t.localtime())
time_now = t.localtime()
print("Transaction completed at: ", str(time_now.tm_hour) + "h:" + str(time_now.tm_min) + "m" )
time_now = t.time()
print("Number of seconds since the begining of the epoc: 0 seconds 0 minutes 0 hours January 1, 1970: ", time_now)
nsiad =... | 38.076923 | 114 | 0.70101 |
0cabb64bfd71300cbe3983c959d1b0ec82f98515 | 3,531 | py | Python | Utils/github_workflow_scripts/utils_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Utils/github_workflow_scripts/utils_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Utils/github_workflow_scripts/utils_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | #!/usr/bin/env python3
import pytest
from utils import get_env_var, EnvVariableError
class TestGetEnvVar(object):
def test_no_env_var(self):
"""
Scenario: Try getting an environment variable
Given
- Using the 'get_env_var' function
When
- The environment variable ... | 30.704348 | 75 | 0.640045 |
0b9f62e80576a4ba1ebcd6003798c290499f5173 | 11,104 | py | Python | notebooks/utils/knn_impute.py | data-science-workshops/machine-learning-workflow | b7880ccc6c573ee2e8d5d4353e22a2f3a1f45d13 | [
"MIT"
] | null | null | null | notebooks/utils/knn_impute.py | data-science-workshops/machine-learning-workflow | b7880ccc6c573ee2e8d5d4353e22a2f3a1f45d13 | [
"MIT"
] | null | null | null | notebooks/utils/knn_impute.py | data-science-workshops/machine-learning-workflow | b7880ccc6c573ee2e8d5d4353e22a2f3a1f45d13 | [
"MIT"
] | null | null | null | import numpy as np
import pandas as pd
from scipy.stats import hmean
from scipy.spatial.distance import cdist
from scipy import stats
import numbers
# Source: https://gist.github.com/YohanObadia/b310793cd22a4427faaadd9c381a5850
def weighted_hamming(data):
""" Compute weighted hamming distance on categorical vari... | 51.88785 | 126 | 0.650756 |
0bc2b0296c5291b0950cadcfab4923e0af81cedc | 3,400 | py | Python | Agent5_a_0_5_knots_512_d_0_02/gym_Agent5_rewards.py | schigeru/Bachelorarbeit_Code | 261b2552221f768e7022abc60a4e5a7d2fedbbae | [
"MIT"
] | null | null | null | Agent5_a_0_5_knots_512_d_0_02/gym_Agent5_rewards.py | schigeru/Bachelorarbeit_Code | 261b2552221f768e7022abc60a4e5a7d2fedbbae | [
"MIT"
] | null | null | null | Agent5_a_0_5_knots_512_d_0_02/gym_Agent5_rewards.py | schigeru/Bachelorarbeit_Code | 261b2552221f768e7022abc60a4e5a7d2fedbbae | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
'''Gym_Environment zur Steuerung des Panda in Gazebo durch RL-Agent'''
import math
import numpy as np
import os
import time
import sys
import copy
import rospy
import moveit_msgs.msg
import geometry_msgs.msg
import random
import csv
import gym
from gym import spaces
from sensor_msgs.msg import Jo... | 38.636364 | 130 | 0.645 |
0433f830aa30f36dd68b87fa447693e15612421d | 734 | py | Python | _Dist/NeuralNetworks/_Tests/Madelon/TestAutoNN.py | leoatchina/MachineLearning | 071f2c0fc6f5af3d9550cfbeafe8d537c35a76d3 | [
"MIT"
] | 1,107 | 2016-09-21T02:18:36.000Z | 2022-03-29T02:52:12.000Z | _Dist/NeuralNetworks/_Tests/Madelon/TestAutoNN.py | leoatchina/MachineLearning | 071f2c0fc6f5af3d9550cfbeafe8d537c35a76d3 | [
"MIT"
] | 18 | 2016-12-22T10:24:47.000Z | 2022-03-11T23:18:43.000Z | _Dist/NeuralNetworks/_Tests/Madelon/TestAutoNN.py | leoatchina/MachineLearning | 071f2c0fc6f5af3d9550cfbeafe8d537c35a76d3 | [
"MIT"
] | 776 | 2016-12-21T12:08:08.000Z | 2022-03-21T06:12:08.000Z | import os
import sys
root_path = os.path.abspath("../../../../")
if root_path not in sys.path:
sys.path.append(root_path)
from _Dist.NeuralNetworks._Tests.TestUtil import draw_acc
from _Dist.NeuralNetworks.f_AutoNN.NN import AutoBasic, AutoAdvanced
from _Dist.NeuralNetworks._Tests.Madelon.MadelonUtil import get_ma... | 34.952381 | 82 | 0.731608 |
9bd4f15ff9c12fe91cf01a235e5a85a2f1b444e2 | 1,692 | py | Python | RDS/circle1_adapters_and_ports/port_zenodo/tests/lib/test_lib_util.py | Sciebo-RDS/Sciebo-RDS | d71cf449ed045a2a7a049e2cb77c99fd5a9195bd | [
"MIT"
] | 10 | 2020-06-24T08:22:24.000Z | 2022-01-13T16:17:36.000Z | RDS/circle1_adapters_and_ports/port_zenodo/tests/lib/test_lib_util.py | Sciebo-RDS/Sciebo-RDS | d71cf449ed045a2a7a049e2cb77c99fd5a9195bd | [
"MIT"
] | 78 | 2020-01-23T14:32:06.000Z | 2022-03-07T14:11:16.000Z | RDS/circle1_adapters_and_ports/port_zenodo/tests/lib/test_lib_util.py | Sciebo-RDS/Sciebo-RDS | d71cf449ed045a2a7a049e2cb77c99fd5a9195bd | [
"MIT"
] | 1 | 2020-06-24T08:33:48.000Z | 2020-06-24T08:33:48.000Z | import unittest
from lib.Util import from_jsonld, to_jsonld
from constant import req, result
import copy
jsonld = {
"https://schema.org/creator": [
{
"https://schema.org/affiliation": "WWU",
"https://schema.org/name": "Peter Heiss",
},
{"https://schema.org/name": "J... | 34.530612 | 89 | 0.6513 |
4fa7dfc09ecae1627510973c8c5311cb8aa3c138 | 3,222 | py | Python | erntehelfer/models.py | abernten/website | 89167c5b1914953ac67def01b9ec0c169c50658f | [
"MIT"
] | 3 | 2020-03-21T22:32:56.000Z | 2020-03-28T23:06:38.000Z | erntehelfer/models.py | abernten/website | 89167c5b1914953ac67def01b9ec0c169c50658f | [
"MIT"
] | null | null | null | erntehelfer/models.py | abernten/website | 89167c5b1914953ac67def01b9ec0c169c50658f | [
"MIT"
] | null | null | null | from django.db import models
from django.contrib.auth.models import AbstractUser
from datetime import datetime
import requests
from geopy.distance import geodesic
class User(AbstractUser):
phone = models.CharField(max_length=250, blank=True, null=True)
def is_helfer(self):
return self.groups.filter... | 34.645161 | 139 | 0.684047 |
8c09b8292e5f9b78463adb4abd8d48dc41738c25 | 80 | py | Python | scripts/helloworld_wh1zzer.py | breezage/Hacktoberfest-1 | 6f6d52248c79c0e72fd13b599500318fce3f9ab0 | [
"MIT"
] | null | null | null | scripts/helloworld_wh1zzer.py | breezage/Hacktoberfest-1 | 6f6d52248c79c0e72fd13b599500318fce3f9ab0 | [
"MIT"
] | null | null | null | scripts/helloworld_wh1zzer.py | breezage/Hacktoberfest-1 | 6f6d52248c79c0e72fd13b599500318fce3f9ab0 | [
"MIT"
] | 1 | 2019-10-24T06:45:21.000Z | 2019-10-24T06:45:21.000Z | # Language: Python
# Github: http://github.com/wh1zzer/
print('Hello, world!')
| 16 | 36 | 0.6875 |
8c16607b9e73863fbf138df16525a4d80407d171 | 350 | py | Python | demos/Multiscale/uniswap/model/partial_state_update_block.py | w-ghub/demos | 6382676fae89bd5a190626612712fcedf17bca6d | [
"MIT"
] | 56 | 2020-07-08T23:23:15.000Z | 2022-03-11T20:43:09.000Z | demos/Multiscale/uniswap/model/partial_state_update_block.py | w-ghub/demos | 6382676fae89bd5a190626612712fcedf17bca6d | [
"MIT"
] | 41 | 2020-07-11T23:24:06.000Z | 2022-01-28T13:28:07.000Z | demos/Multiscale/uniswap/model/partial_state_update_block.py | w-ghub/demos | 6382676fae89bd5a190626612712fcedf17bca6d | [
"MIT"
] | 39 | 2020-07-15T11:35:04.000Z | 2022-02-01T16:02:51.000Z | from .parts.uniswap_model import *
PSUBs = [
{
'policies': {
'user_action': p_actionDecoder
},
'variables': {
'DAI_balance': s_mechanismHub_DAI,
'ETH_balance': s_mechanismHub_ETH,
'UNI_supply': s_mechanismHub_UNI,
'price_ratio': s_... | 21.875 | 46 | 0.531429 |
8c4a6699861e629f401b8b654fbd47ffaba9db1a | 111 | py | Python | shinrl/_calc/__init__.py | omron-sinicx/ShinRL | 09f4ae274a33d1fc1d9d542f816aef40014af6b5 | [
"MIT"
] | 34 | 2021-12-09T07:12:57.000Z | 2022-03-11T08:17:20.000Z | shinrl/_calc/__init__.py | omron-sinicx/ShinRL | 09f4ae274a33d1fc1d9d542f816aef40014af6b5 | [
"MIT"
] | null | null | null | shinrl/_calc/__init__.py | omron-sinicx/ShinRL | 09f4ae274a33d1fc1d9d542f816aef40014af6b5 | [
"MIT"
] | 4 | 2021-12-11T07:48:01.000Z | 2022-03-01T23:50:33.000Z | """Common mathematical (jittable) functions in ShinRL.
Author: Toshinori Kitamura
Affiliation: NAIST & OSX
"""
| 22.2 | 54 | 0.765766 |
8c863d54adcf2e7de55ffc76bb5e5e93f414775a | 1,700 | py | Python | Class_Ordenador.py | efbatista9/Class_Ordenador | 80286c2725c87cf5d28bb38f6d64e826a2bd887c | [
"Apache-2.0"
] | null | null | null | Class_Ordenador.py | efbatista9/Class_Ordenador | 80286c2725c87cf5d28bb38f6d64e826a2bd887c | [
"Apache-2.0"
] | null | null | null | Class_Ordenador.py | efbatista9/Class_Ordenador | 80286c2725c87cf5d28bb38f6d64e826a2bd887c | [
"Apache-2.0"
] | null | null | null | import random
import time
class Ordenador:
def selecao_direta(self, lista):
fim = len(lista)
for i in range(fim - 1):
# Inicialmente o menor elemento já visto é o i-ésimo
posicao_do_minimo = i
for j in range(i + 1, fim):
# encontrou um elemen... | 27.868852 | 87 | 0.554118 |
0fb061f95d041463a14e518d3867cb6e00126065 | 92 | py | Python | 2015/04/nola-crime-comparison-20150416/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | 14 | 2015-05-08T13:41:51.000Z | 2021-02-24T12:34:55.000Z | 2015/04/nola-crime-comparison-20150416/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | null | null | null | 2015/04/nola-crime-comparison-20150416/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | 7 | 2015-04-04T04:45:54.000Z | 2021-02-18T11:12:48.000Z | #!/usr/bin/env python
COPY_GOOGLE_DOC_KEY = '1MNiU5fZ8-SA9WqDdvlRsg48F8qlh2z5cVK9qtcSpxSI'
| 23 | 68 | 0.836957 |
d7535e4e0593726dbc0dd938ebedb7f3c9f914d3 | 1,204 | py | Python | 71.py | zacharytower/PE71 | ca8e0b6cefe13906eee2211b39bcebc795dbd0e4 | [
"Apache-2.0"
] | null | null | null | 71.py | zacharytower/PE71 | ca8e0b6cefe13906eee2211b39bcebc795dbd0e4 | [
"Apache-2.0"
] | null | null | null | 71.py | zacharytower/PE71 | ca8e0b6cefe13906eee2211b39bcebc795dbd0e4 | [
"Apache-2.0"
] | null | null | null | from fractions import Fraction
def sorted_fractions(n):
'''
prints out a list of sorted fractions for all d <= n
'''
fraction_set = set()
for denominator in range(2, n + 1): # for all denominators <= n:
#print denominator
for numerator in range(1, denominator): # for all numerators < denominator:
fra... | 20.758621 | 77 | 0.698505 |
a8f46bded2ab1755002ba19c00666d2075651e5d | 17,784 | py | Python | samples/transformation-graph/tgraph.py | Matheus158257/projects | 26a6148046533476e625a872a2950c383aa975a8 | [
"Apache-2.0"
] | null | null | null | samples/transformation-graph/tgraph.py | Matheus158257/projects | 26a6148046533476e625a872a2950c383aa975a8 | [
"Apache-2.0"
] | null | null | null | samples/transformation-graph/tgraph.py | Matheus158257/projects | 26a6148046533476e625a872a2950c383aa975a8 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Nov 11 16:16:00 2019
@author: lladeira
Implementation based on the strategy proposed by https://udayankhurana.com/wp-content/uploads/2018/08/58.pdf
"""
import io
import os
import warnings
import random
import numpy as np
import pandas as pd
import networkx as nx
from sklearn.... | 31.644128 | 202 | 0.565565 |
0f3945a0b2fb7ec898e4efc6bda1421bfd6a38cf | 556 | py | Python | tests/onegov/wtfs/test_views_principal.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/wtfs/test_views_principal.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/wtfs/test_views_principal.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null |
def test_view_home(client):
assert 'auth/login' in client.get('/').follow().request.url
client.login_admin()
assert "/scan-jobs" in client.get('/').follow().request.url
add = client.get('/notifications').click(href='/add')
add.form['title'] = "Systemunterbruch"
add.form['text'] = "Am 23. Feb... | 30.888889 | 76 | 0.670863 |
7e42a66d3ae84a30031f683f2d1a55a7d8316996 | 29,042 | py | Python | paddlenlp/transformers/layoutlm/modeling.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | paddlenlp/transformers/layoutlm/modeling.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | paddlenlp/transformers/layoutlm/modeling.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
# Copyright 2021 Microsoft Research and The HuggingFace Inc. team. 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 Li... | 41.667145 | 127 | 0.600269 |
7e792447038b0414795f7cc0ffb2b27551318354 | 960 | py | Python | hello/hello_mongo.py | East196/hello-py | a77c7a0c8e5e2b5e8cefaf0fda335ab0c3b1da21 | [
"Apache-2.0"
] | 1 | 2017-10-23T14:58:47.000Z | 2017-10-23T14:58:47.000Z | hello/hello_mongo.py | East196/hello-py | a77c7a0c8e5e2b5e8cefaf0fda335ab0c3b1da21 | [
"Apache-2.0"
] | null | null | null | hello/hello_mongo.py | East196/hello-py | a77c7a0c8e5e2b5e8cefaf0fda335ab0c3b1da21 | [
"Apache-2.0"
] | 1 | 2018-04-06T07:49:18.000Z | 2018-04-06T07:49:18.000Z | # coding=utf-8
import pymongo
from pymongo import MongoClient
client = MongoClient('mongodb://localhost:27017/')
db = client.test # new a database
peoples = db.people.find().sort('_id', pymongo.ASCENDING).limit(3) # new a table
for people in peoples:
print(people)
muser = db.user
muser.save({'id': 1, 'name':... | 33.103448 | 87 | 0.667708 |
7eb744ef36613ad26afd4183757c58bd56349b0d | 1,342 | py | Python | lintcode/1089-Valid-Parenthesis-String/valid_parenthesis_string.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2015-12-16T04:01:03.000Z | 2015-12-16T04:01:03.000Z | lintcode/1089-Valid-Parenthesis-String/valid_parenthesis_string.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | lintcode/1089-Valid-Parenthesis-String/valid_parenthesis_string.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | '''
cp: the count of "(" plus "*"
df: the count of "(" minus "*"
If cp < 0 during the process, it means that the count of ")" is more than the total of "(" plus "*".
If df > 0 at the end, it means that the count of "(" is more than the total of "*" plus ")".
'''
class Solution1:
"""
@param s: the given stri... | 23.964286 | 100 | 0.382265 |
7d0ec0cc99b55877d21c046929dbfe719629c52d | 3,532 | py | Python | bin/oneoff/fix-animation-urls/commands.py | Edraak/code-dot-or | 414d5a4ffefa1a02ab2406e4da2a894f73f73b11 | [
"Apache-2.0"
] | 772 | 2015-01-01T14:52:37.000Z | 2022-03-29T17:07:10.000Z | bin/oneoff/fix-animation-urls/commands.py | SNOmad1/code-dot-org | 3fd13c77f37823f3f71ae2675e6e4e1fd77905d1 | [
"Apache-2.0"
] | 13,529 | 2015-01-05T19:59:18.000Z | 2022-03-31T23:07:43.000Z | bin/oneoff/fix-animation-urls/commands.py | SNOmad1/code-dot-org | 3fd13c77f37823f3f71ae2675e6e4e1fd77905d1 | [
"Apache-2.0"
] | 494 | 2015-01-09T00:32:46.000Z | 2022-03-29T17:12:02.000Z | """
Used to implement https://github.com/code-dot-org/code-dot-org/pull/31940
One-off script to help fix issue where we needed to replace some bad animation URLs across many level files.
Reads in an old level json from old.json, and the "new" level json (with the fixed URLs) from new.json.
For each name which matches,... | 80.272727 | 2,078 | 0.744621 |
bc279eb4b59c9a83f3d8d105d000ddd002bc6c47 | 276 | py | Python | src/bo4e/enum/energierichtung.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 1 | 2022-03-02T12:49:44.000Z | 2022-03-02T12:49:44.000Z | src/bo4e/enum/energierichtung.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 21 | 2022-02-04T07:38:46.000Z | 2022-03-28T14:01:53.000Z | src/bo4e/enum/energierichtung.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | null | null | null | # pylint:disable=missing-module-docstring
from bo4e.enum.strenum import StrEnum
class Energierichtung(StrEnum):
"""
Spezifiziert die Energierichtung einer Markt- und/oder Messlokation
"""
AUSSP = "AUSSP" #: Ausspeisung
EINSP = "EINSP" #: Einspeisung
| 21.230769 | 71 | 0.706522 |
3800bc5c6da0d55b51e06792921f0f3c5777da8b | 553 | py | Python | Curso-Em-Video-Python/2Exercicios/063_fibonnaci.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso-Em-Video-Python/2Exercicios/063_fibonnaci.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso-Em-Video-Python/2Exercicios/063_fibonnaci.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | ''' guanabara
print('Sequencia de Fibonacci')
n = int(input('Quantos termos você que mostrar? '))
t1 = 0
t2 = 1
print('{} → {}'.format(t1, t2), end='')
cont =3
while cont <= n:
t3 = t1 + t2
print(' → {}'.format(t3), end='')
t1 = t2
t2 = t3
cont += 1
print(' → Fim')'''
print('Feito por mim!!')
fibo =... | 19.068966 | 51 | 0.508137 |
3835873d1109668a3e6a37511dd7fc021ebda427 | 445 | py | Python | Contrib-Microsoft/Olympus_rack_manager/python-ocs/commonapi/controls/__init__.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/controls/__init__.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/controls/__init__.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 bott... | 31.785714 | 68 | 0.777528 |
2d554561717fc8eb5a7bf9ec17efb2a4922062a7 | 701 | py | Python | marsyas-vamp/marsyas/scripts/cmake-test-wrapper.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | marsyas-vamp/marsyas/scripts/cmake-test-wrapper.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | marsyas-vamp/marsyas/scripts/cmake-test-wrapper.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import os
import sys
import subprocess
try:
working_dir = sys.argv[1]
env_vars = sys.argv[2]
bin_cmd_args = sys.argv[3:]
except:
print "Syntax: cmake-test-wrapper.py WORKING_DIR ENV_VARS CMD ARG1 ARG2 ... ARGn "
sys.exit(0)
def run_command(bin_cmd_args, working_dir, env_var... | 24.172414 | 87 | 0.67475 |
9306213501eda701b7e824a1428c1e355fd478e3 | 578 | py | Python | Get Retroativo/2019_10_1.py | paulowiz/AiesecBot | ac77cc5426ed6382772603afa8015208020c0fba | [
"MIT"
] | 6 | 2019-10-18T17:47:30.000Z | 2021-03-18T06:04:06.000Z | Get Retroativo/2019_10_1.py | paulowiz/AiesecBot | ac77cc5426ed6382772603afa8015208020c0fba | [
"MIT"
] | 1 | 2020-09-24T08:17:29.000Z | 2020-09-28T08:16:39.000Z | Get Retroativo/2019_10_1.py | paulowiz/AiesecBot | ac77cc5426ed6382772603afa8015208020c0fba | [
"MIT"
] | 3 | 2019-10-20T18:40:20.000Z | 2021-04-15T01:27:59.000Z | import psycopg2.extras
from controller import RobotRotine as rr
from api import graphqlconsume, querygraphql
import time
import datetime
import numpy as np
robo5 = rr.RobotRotine()
i = 0
dtinit = '2019-11-01T00:00:00.00000'
while i < 15:
print(dtinit)
try:
dtfim = np.datetime64(dtinit) + np.timedelta6... | 24.083333 | 65 | 0.650519 |
93138a8579cb98e572d16d374e087a1a36645934 | 991 | py | Python | src/cospectral.py | jfklorenz/Master-Thesis-ComputerScience | dbf4a5de86b2677c761236d8150b1413b5dabec9 | [
"MIT"
] | null | null | null | src/cospectral.py | jfklorenz/Master-Thesis-ComputerScience | dbf4a5de86b2677c761236d8150b1413b5dabec9 | [
"MIT"
] | null | null | null | src/cospectral.py | jfklorenz/Master-Thesis-ComputerScience | dbf4a5de86b2677c761236d8150b1413b5dabec9 | [
"MIT"
] | null | null | null |
import numpy as np
def areCospectral(A, B):
"""Input: 2 quadratic matrices of size n. Output: True/False depending if A and B are cospectral."""
A_evals, _ = np.linalg.eig(A) # A_evecs
B_evals, _ = np.linalg.eig(B) # B_evecs
cospectral = validateEigenvalues(A_evals, B_evals)
if cospectral:
... | 21.085106 | 104 | 0.57114 |
fae5d213120998ab9ac0c9965b8ea5b2e77b45a9 | 82,676 | py | Python | Packs/qualys/Integrations/Qualysv2/Qualysv2.py | jrauen/content | 81a92be1cbb053a5f26a6f325eff3afc0ca840e0 | [
"MIT"
] | 2 | 2021-12-06T21:38:24.000Z | 2022-01-13T08:23:36.000Z | Packs/qualys/Integrations/Qualysv2/Qualysv2.py | jrauen/content | 81a92be1cbb053a5f26a6f325eff3afc0ca840e0 | [
"MIT"
] | 61 | 2021-10-07T08:54:38.000Z | 2022-03-31T10:25:35.000Z | Packs/qualys/Integrations/Qualysv2/Qualysv2.py | jrauen/content | 81a92be1cbb053a5f26a6f325eff3afc0ca840e0 | [
"MIT"
] | 1 | 2021-12-06T21:38:13.000Z | 2021-12-06T21:38:13.000Z | from typing import Callable, Dict, Tuple
import demistomock as demisto # noqa: F401
import requests
from CommonServerPython import * # noqa: F401
requests.packages.urllib3.disable_warnings() # pylint: disable=no-member
''' CONSTANTS '''
DATE_FORMAT = '%Y-%m-%dT%H:%M:%SZ' # ISO8601 format with UTC, default in XSO... | 38.099539 | 130 | 0.618269 |
ea9c340e001ee5d66c5cab119b0821d0c98d52a2 | 1,782 | py | Python | source-code/Pseudocode/Calculate-Legendre/calculateLegendre.py | keithmannock/LaTeX-examples | 6829f6cf9710b314a4bf0b64abdae5bcf6997fd0 | [
"MIT"
] | 2 | 2017-11-02T10:09:12.000Z | 2017-11-24T22:16:18.000Z | source-code/Pseudocode/Calculate-Legendre/calculateLegendre.py | everbot/LaTeX-examples | 9558d8b3c19776cb068b9753dcd3f88645dd7134 | [
"MIT"
] | null | null | null | source-code/Pseudocode/Calculate-Legendre/calculateLegendre.py | everbot/LaTeX-examples | 9558d8b3c19776cb068b9753dcd3f88645dd7134 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
def isPrime(a):
return all(a % i for i in xrange(2, a))
# http://stackoverflow.com/a/14793082/562769
def factorize(n):
factors = []
p = 2
while True:
while(n % p == 0 and n > 0): #while we can divide by smaller number, do so
factors.ap... | 23.447368 | 82 | 0.607744 |
3504a78e48691aea88f29826f2767e3fd195f937 | 281 | py | Python | listings/chapter04/sine_graph.py | SaschaKersken/Daten-Prozessanalyse | 370f07a75b9465329deb3671adbfbef8483f76f6 | [
"Apache-2.0"
] | 2 | 2021-09-20T06:16:41.000Z | 2022-01-17T14:24:43.000Z | listings/chapter04/sine_graph.py | SaschaKersken/Daten-Prozessanalyse | 370f07a75b9465329deb3671adbfbef8483f76f6 | [
"Apache-2.0"
] | null | null | null | listings/chapter04/sine_graph.py | SaschaKersken/Daten-Prozessanalyse | 370f07a75b9465329deb3671adbfbef8483f76f6 | [
"Apache-2.0"
] | null | null | null | import math
import matplotlib.pyplot as plt
import numpy as np
x = np.linspace(-2 * math.pi, 2 * math.pi, 1000)
y = []
for x_i in x:
y.append(math.sin(x_i))
plt.plot(x,y)
plt.xlabel('x')
plt.ylabel('y')
plt.grid()
plt.axhline(linewidth=2)
plt.axvline(linewidth=2)
plt.show()
| 16.529412 | 48 | 0.679715 |
52f23a33120a07a191ab717fe0fb32c123639c1d | 8,033 | py | Python | local_socket/sensor2hass_mqtt.py | hanyanze/FS_AILPB | 7756551cf926aa6296ec851dd696c97d56e06bca | [
"Apache-2.0"
] | null | null | null | local_socket/sensor2hass_mqtt.py | hanyanze/FS_AILPB | 7756551cf926aa6296ec851dd696c97d56e06bca | [
"Apache-2.0"
] | null | null | null | local_socket/sensor2hass_mqtt.py | hanyanze/FS_AILPB | 7756551cf926aa6296ec851dd696c97d56e06bca | [
"Apache-2.0"
] | null | null | null | # -*- coding:utf-8 -*-
# author:hyz
import sys
import threading
import binascii
import re
import time
from datetime import datetime
import json
from mySerial import myserial
import paho.mqtt.client as mqtt
import config
class mqtt2sensor:
def __init__(self):
self.dict_num = config.doInit()
self.cl... | 48.684848 | 108 | 0.511888 |
5e228b0c78329a23c0949a38a324fa086f593934 | 2,488 | py | Python | demos/System_Dynamics/Compartment_Models/stochastic_seir/model/parts/seir_model.py | w-ghub/demos | 6382676fae89bd5a190626612712fcedf17bca6d | [
"MIT"
] | 56 | 2020-07-08T23:23:15.000Z | 2022-03-11T20:43:09.000Z | demos/System_Dynamics/Compartment_Models/stochastic_seir/model/parts/seir_model.py | w-ghub/demos | 6382676fae89bd5a190626612712fcedf17bca6d | [
"MIT"
] | 41 | 2020-07-11T23:24:06.000Z | 2022-01-28T13:28:07.000Z | demos/System_Dynamics/Compartment_Models/stochastic_seir/model/parts/seir_model.py | w-ghub/demos | 6382676fae89bd5a190626612712fcedf17bca6d | [
"MIT"
] | 39 | 2020-07-15T11:35:04.000Z | 2022-02-01T16:02:51.000Z | from ._utils import init_param_dist
import numpy as np
from scipy.stats import expon
from stochastic_seir.sim_params import MONTE_CARLO_RUNS
rngs = [np.random.RandomState(i) for i in range (MONTE_CARLO_RUNS)]
## Policies
def p_exposed_growth(params, substep, state_history, prev_state):
N = prev_state['susceptible... | 36.588235 | 125 | 0.710611 |
d80ba4a78664c145270009182c15ba85e2b0e71c | 495 | py | Python | python/en/archive/books/udemy-AutomateTheBoringStuffWithPythonProgramming/Ch02-FlowControl-range_function.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/archive/books/udemy-AutomateTheBoringStuffWithPythonProgramming/Ch02-FlowControl-range_function.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/archive/books/udemy-AutomateTheBoringStuffWithPythonProgramming/Ch02-FlowControl-range_function.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | # Ch02-FlowControl-range_function.py
# This is an example for the range() function and a for statement.
#
# https://automatetheboringstuff.com/chapter2/
# The Starting, Stopping, and Stepping Arguments to range()
for i in range(12,16):
print(i)
# Expected results
# 12
# 13
# 14
# 15
# count from zero to eight by ... | 14.558824 | 66 | 0.660606 |
d8251a87b1cda7cf2b65b3fceca91ea2cdde34c3 | 1,222 | py | Python | oneflow/python/vm/id_util.py | xxg1413/oneflow | f2e3c85a25b8aecfb6c0c0af1737833b1a77e135 | [
"Apache-2.0"
] | 1 | 2020-12-04T03:06:16.000Z | 2020-12-04T03:06:16.000Z | oneflow/python/vm/id_util.py | duijiudanggecl/oneflow | d2096ae14cf847509394a3b717021e2bd1d72f62 | [
"Apache-2.0"
] | null | null | null | oneflow/python/vm/id_util.py | duijiudanggecl/oneflow | d2096ae14cf847509394a3b717021e2bd1d72f62 | [
"Apache-2.0"
] | null | null | null | """
Copyright 2020 The OneFlow Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agr... | 28.418605 | 72 | 0.763502 |
d82c480f8390b73d383556d9c3ade9d779b17cef | 541 | py | Python | rev/DownTheRabbitHole/src/hash.py | NoXLaw/RaRCTF2021-Challenges-Public | 1a1b094359b88f8ebbc83a6b26d27ffb2602458f | [
"MIT"
] | null | null | null | rev/DownTheRabbitHole/src/hash.py | NoXLaw/RaRCTF2021-Challenges-Public | 1a1b094359b88f8ebbc83a6b26d27ffb2602458f | [
"MIT"
] | null | null | null | rev/DownTheRabbitHole/src/hash.py | NoXLaw/RaRCTF2021-Challenges-Public | 1a1b094359b88f8ebbc83a6b26d27ffb2602458f | [
"MIT"
] | null | null | null | #!/usr/bin/python3
from hashlib import md5
s1 = b"bnnyr4bbits"
s2 = b"https://i.imgur.com/gub160B.png"
hash1 = md5(s1).digest()
hash2 = md5(s2).digest()
hash3 = md5(hash1 + hash2)
print(hash3.hexdigest())
"""
RESULT - 8a6c1210701e07f386069aecf11ddefe
KEY - 8a6c1210701e07f386069aecf11ddefe
IV - 0... | 24.590909 | 117 | 0.752311 |
dc9711d7c5d8011e2ec7dac9e4647837b8981a04 | 2,174 | py | Python | genesis/quirk_adapter.py | dr-bigfatnoob/quirk | f5025d7139adaf06380c429b436ccbf1e7611a16 | [
"Unlicense"
] | 1 | 2021-03-05T07:44:05.000Z | 2021-03-05T07:44:05.000Z | genesis/quirk_adapter.py | dr-bigfatnoob/quirk | f5025d7139adaf06380c429b436ccbf1e7611a16 | [
"Unlicense"
] | 3 | 2017-06-04T03:01:31.000Z | 2017-08-04T04:04:37.000Z | genesis/quirk_adapter.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 language import template as gt
from utils import cache
from genesis import gen_utils
import networkx as nx
import pydot as dot
__author__ = "bigfatnoob"
def get_node_name(no... | 28.233766 | 83 | 0.679393 |
5e4da3ad031d0ad7458ca68916d0fbadbd32a376 | 1,265 | py | Python | Integrations/python/deephaven/lang/ListBasedSet.py | devinrsmith/deephaven-core | 3a6930046faf1cd556f62a914ce1cfd7860147b9 | [
"MIT"
] | 55 | 2021-05-11T16:01:59.000Z | 2022-03-30T14:30:33.000Z | Integrations/python/deephaven/lang/ListBasedSet.py | devinrsmith/deephaven-core | 3a6930046faf1cd556f62a914ce1cfd7860147b9 | [
"MIT"
] | 943 | 2021-05-10T14:00:02.000Z | 2022-03-31T21:28:15.000Z | Integrations/python/deephaven/lang/ListBasedSet.py | devinrsmith/deephaven-core | 3a6930046faf1cd556f62a914ce1cfd7860147b9 | [
"MIT"
] | 29 | 2021-05-10T11:33:16.000Z | 2022-03-30T21:01:54.000Z |
"""
Alternate set implementation favoring space over speed and not requiring the set elements to be hashable.
**The contents of this module are intended only for internal Deephaven use and may change at any time.**
"""
# See: https://docs.python.org/3/library/collections.abc.html?highlight=orderedset#collections.abc... | 25.816327 | 105 | 0.659289 |
0d7b7aacc421c8490050e776e92c9c65235baa2b | 4,528 | py | Python | src/lecture1/classifier/main.py | Fassial/zju-intern | f421f9c97d3c567e9b97121c5bf5c675c9e2c721 | [
"MIT"
] | 1 | 2020-08-17T07:09:09.000Z | 2020-08-17T07:09:09.000Z | src/lecture1/classifier/main.py | Fassial/zju-intern | f421f9c97d3c567e9b97121c5bf5c675c9e2c721 | [
"MIT"
] | null | null | null | src/lecture1/classifier/main.py | Fassial/zju-intern | f421f9c97d3c567e9b97121c5bf5c675c9e2c721 | [
"MIT"
] | 2 | 2020-07-26T07:27:57.000Z | 2020-08-17T07:09:15.000Z | from get_data.get_data import read_image
from binary_classification.binary_classification import get_hog,get_roc_data,draw_roc_data
from sklearn.model_selection import train_test_split
import configparser
"""
set_config:
set the path of file
@params:
None
@rets:
positive_image_... | 41.541284 | 114 | 0.71886 |
df1399fce467ac1a9e1672c71a1cfd14d251ffe9 | 1,051 | py | Python | SoSe-21/Code-Vorlesungen/Wiederholung/2/Wiederholung-Datentypen.py | jonasrdt/Wirtschaftsinformatik2 | 30d5d896808b98664c55cb6fbb3b30a7f1904d9f | [
"MIT"
] | 1 | 2022-03-23T09:40:39.000Z | 2022-03-23T09:40:39.000Z | SoSe-21/Code-Vorlesungen/Wiederholung/2/Wiederholung-Datentypen.py | jonasrdt/Wirtschaftsinformatik2 | 30d5d896808b98664c55cb6fbb3b30a7f1904d9f | [
"MIT"
] | null | null | null | SoSe-21/Code-Vorlesungen/Wiederholung/2/Wiederholung-Datentypen.py | jonasrdt/Wirtschaftsinformatik2 | 30d5d896808b98664c55cb6fbb3b30a7f1904d9f | [
"MIT"
] | null | null | null | # a = 15 # integer
# b = 15.5 # float
# c = True # Boolean
# d = "Das hier ist ein Satz" # String
# #Index 0 1 2 3 4
# e = ["Das", "ist", "eine", "Liste", ["Verschachtelung", "yeah"]] # Liste
# f = {"Jonas": 2101357,
# "Peter": 2101356} # Dictionary
# Bitte schreiben Sie ein Programm in Pyt... | 37.535714 | 84 | 0.631779 |
df908ad8c1be2bbccaae6ddf0529a4f8b1dadb57 | 907 | py | Python | Algorithms/2_Implementation/54.py | abphilip-codes/Hackerrank_DSA | bb9e233d9d45c5b14c138830602695ad4113fba4 | [
"MIT"
] | 1 | 2021-11-25T13:39:30.000Z | 2021-11-25T13:39:30.000Z | Algorithms/2_Implementation/54.py | abphilip-codes/Hackerrank_DSA | bb9e233d9d45c5b14c138830602695ad4113fba4 | [
"MIT"
] | null | null | null | Algorithms/2_Implementation/54.py | abphilip-codes/Hackerrank_DSA | bb9e233d9d45c5b14c138830602695ad4113fba4 | [
"MIT"
] | null | null | null | # https://www.hackerrank.com/challenges/service-lane/problem
#!/bin/python3
import math
import os
import random
import re
import sys
#
# Complete the 'serviceLane' function below.
#
# The function is expected to return an INTEGER_ARRAY.
# The function accepts following parameters:
# 1. INTEGER n
# 2. 2D_INTEGER_AR... | 20.613636 | 62 | 0.660419 |
33e42ee4bc52d7fb2eff93e25e848943bb1b2d21 | 517 | py | Python | elements/python/12/6/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | 11 | 2019-02-08T06:54:34.000Z | 2021-08-07T18:57:39.000Z | elements/python/12/6/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | 1 | 2019-05-21T08:14:10.000Z | 2019-05-21T08:14:10.000Z | elements/python/12/6/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | null | null | null | def intsqrt(x):
"""
Return the largest integer whose square is less than or equal to x.
"""
if x == 0:
return 0
# invariant: l^2 <= x and x < r^2
l = 1
r = x
while r-l > 1:
m = l + (r-l)//2
s = m*m
if s <= x:
l = m
else:
r =... | 15.666667 | 71 | 0.446809 |
1d4ca817db21ff9742ccf0ee897f2a1d64f40f6f | 7,015 | py | Python | src/test/tests/queries/xrayimage.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 226 | 2018-12-29T01:13:49.000Z | 2022-03-30T19:16:31.000Z | src/test/tests/queries/xrayimage.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 5,100 | 2019-01-14T18:19:25.000Z | 2022-03-31T23:08:36.000Z | src/test/tests/queries/xrayimage.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 84 | 2019-01-24T17:41:50.000Z | 2022-03-10T10:01:46.000Z | # ----------------------------------------------------------------------------
# CLASSES: nightly
#
# Test Case: xrayimage.py
# Tests: queries - xray imagel
#
# Programmer: Eric Brugger
# Date: July 13, 2010
#
# Modifications:
# Kathleen Bonnell, Thu Jul 14 10:44:55 PDT 2011
# Change most of... | 26.078067 | 305 | 0.681112 |
d54bbc78f40337661995f6210b8d268817a225e3 | 8,404 | py | Python | official/cv/posenet/infer/sdk/main.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | official/cv/posenet/infer/sdk/main.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | official/cv/posenet/infer/sdk/main.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.941176 | 117 | 0.489053 |
d5557e3db81b5c0f1c1d59be41cc1ecec67bac26 | 64 | py | Python | sketches/rpg02/settings.py | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 4 | 2018-06-03T02:11:46.000Z | 2021-08-18T19:55:15.000Z | sketches/rpg02/settings.py | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | null | null | null | sketches/rpg02/settings.py | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 3 | 2019-12-23T19:12:51.000Z | 2021-04-30T14:00:31.000Z | WIDTH = 960
HEIGHT = 540
vel = 2
distance = 100
no_enemies = 7
| 9.142857 | 14 | 0.671875 |
d57171d6941e100037e95f6989e0ada7499bcfc3 | 6,986 | py | Python | adventskalender.py | micneu72/adventskalender | 1ef205c94956491747e7a66164e59412072e3882 | [
"Apache-2.0"
] | 1 | 2019-11-28T13:50:50.000Z | 2019-11-28T13:50:50.000Z | adventskalender.py | micneu72/adventskalender | 1ef205c94956491747e7a66164e59412072e3882 | [
"Apache-2.0"
] | null | null | null | adventskalender.py | micneu72/adventskalender | 1ef205c94956491747e7a66164e59412072e3882 | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/env python3
# -*- coding: utf-8 -*-
""".
# Script Name: adventskalender.py
# CreationDate: 04.12.2018
# Last Modified: 19.12.2019 10:20:10
# Copyright: Michael N. (c)2018
# Purpose:
#
## https://www.pyimagesearch.com/2017/07/10/using-tesseract-ocr-python/
# pip3 install boto3
#
"""
fro... | 27.289063 | 133 | 0.587604 |
d59afda0a930a883a723678940cfa5f0f1d91a59 | 1,138 | py | Python | Python/zz_offtopic_sandbox/json/run.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zz_offtopic_sandbox/json/run.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zz_offtopic_sandbox/json/run.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | import json
data = {"v1": "Foo",
"v2": "Bar"}
class Krypto:
def __init__(self, name: str, kurs: float, spread=0.75):
"""
:param name: name of krypto
:param kurs: current amount
:param spread: spread in %
"""
self.name = name
self.kurs = round(kurs, 2)... | 21.074074 | 60 | 0.537786 |
639b7f1c0de7630a676d7bb45e31cc29239e9fd2 | 215 | py | Python | src/onegov/wtfs/collections/payment_types.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/wtfs/collections/payment_types.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/wtfs/collections/payment_types.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.core.collection import GenericCollection
from onegov.wtfs.models import PaymentType
class PaymentTypeCollection(GenericCollection):
@property
def model_class(self):
return PaymentType
| 21.5 | 52 | 0.790698 |
9823fa1484fa84867a35c5668b720b43ca0d235b | 2,562 | py | Python | Bwinf-Aufgabe2-Wildschweine/dijkstra.py | laugengebaeck/Bwinf-36-Runde2 | 0bc410b4708e6e153bd1a44d40754434c57e615f | [
"Apache-2.0"
] | null | null | null | Bwinf-Aufgabe2-Wildschweine/dijkstra.py | laugengebaeck/Bwinf-36-Runde2 | 0bc410b4708e6e153bd1a44d40754434c57e615f | [
"Apache-2.0"
] | null | null | null | Bwinf-Aufgabe2-Wildschweine/dijkstra.py | laugengebaeck/Bwinf-36-Runde2 | 0bc410b4708e6e153bd1a44d40754434c57e615f | [
"Apache-2.0"
] | null | null | null | import networkx as nx
import heapq as hq
def dijkstra_st(G, source, target):
G_succ = G._succ
paths = {source: [source]} # Pfad source->target
dist = {} # Distanzliste
seen = {} # schon besuchte Knoten
queue = [] # Priorityqueue
seen[source] = 0 # source hinzufügen
hq.heappush(queue,... | 36.084507 | 113 | 0.521468 |
d6534f995dc3eeb9e0393f85425a6073930a0a43 | 415 | py | Python | Packs/SlashNextPhishingIncidentResponse/Integrations/SlashNextPhishingIncidentResponse/SlashNextPhishingIncidentResponse_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/SlashNextPhishingIncidentResponse/Integrations/SlashNextPhishingIncidentResponse/SlashNextPhishingIncidentResponse_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/SlashNextPhishingIncidentResponse/Integrations/SlashNextPhishingIncidentResponse/SlashNextPhishingIncidentResponse_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | """
Created on September 26, 2019
@author: Saadat Abid
"""
def test_get_dbot_score():
from SlashNextPhishingIncidentResponse import get_dbot_score
assert 1 == get_dbot_score(verdict='Benign')
assert 1 == get_dbot_score(verdict='Redirector')
assert 2 == get_dbot_score(verdict='Suspicious')
asse... | 21.842105 | 64 | 0.725301 |
1420f70b38f938f562fb99d98d9d11022fd1be9a | 1,941 | py | Python | Tests/Marketplace/Tests/validate_landing_page_sections_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Tests/Marketplace/Tests/validate_landing_page_sections_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Tests/Marketplace/Tests/validate_landing_page_sections_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import pytest
from Tests.Marketplace.validate_landing_page_sections import validate_file_keys, validate_valid_packs_in_sections
def test_validate_file_keys_negative():
"""
Given
- A landingPage_sections.json file with section that's not appearing under the 'sections' key
When
- Validating the fil... | 28.544118 | 113 | 0.633694 |
25f85a9a704db2f9cfa590cb85832d862eb1d235 | 1,018 | py | Python | Uebung5/Uebung5_Aufgabe13_1.py | B0mM3L6000/EiP | f68718f95a2d3cde8ead62b6134ac1b5068881a5 | [
"MIT"
] | 1 | 2018-04-18T19:10:06.000Z | 2018-04-18T19:10:06.000Z | Uebung5/Uebung5_Aufgabe13_1.py | B0mM3L6000/EiP | f68718f95a2d3cde8ead62b6134ac1b5068881a5 | [
"MIT"
] | null | null | null | Uebung5/Uebung5_Aufgabe13_1.py | B0mM3L6000/EiP | f68718f95a2d3cde8ead62b6134ac1b5068881a5 | [
"MIT"
] | 1 | 2018-04-29T08:48:00.000Z | 2018-04-29T08:48:00.000Z | #sauce head:
length = int(input())
b = list()
#Code:
#berechnung Binomialkoeffizienten
def binom(n, k):
b = 1
for i in range(k-1, -1, -1):
b *= n-i
b //= k-i
return b
#erzeugen des felds:
def pascal_d(n):
output = list()
for zeile in range(n):
tmp = list()
for s... | 18.509091 | 70 | 0.522593 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.