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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
46135609e0c34d082ea2df6dffe2192083f191d8 | 8,635 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/postgresql_schema.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/postgresql_schema.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/postgresql_schema.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2016, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | 30.839286 | 115 | 0.671453 |
1cb55b5630bc8873c8481d142cbb71c6d79ae382 | 7,404 | py | Python | dcapy/wiener/brownian.py | scuervo91/dcapy | 46c9277e607baff437e5707167476d5f7e2cf80c | [
"MIT"
] | 4 | 2021-05-21T13:26:10.000Z | 2021-11-15T17:17:01.000Z | dcapy/wiener/brownian.py | scuervo91/dcapy | 46c9277e607baff437e5707167476d5f7e2cf80c | [
"MIT"
] | null | null | null | dcapy/wiener/brownian.py | scuervo91/dcapy | 46c9277e607baff437e5707167476d5f7e2cf80c | [
"MIT"
] | null | null | null | # External Imports
import numpy as np
import pandas as pd
from scipy import stats
from pydantic import BaseModel, Field, Extra
from typing import List, Union, Optional
from datetime import date
#Local Imports
from ..dca import list_freq, converter_factor, ProbVar
from ..dca import FreqEnum
#from ..models import ChgPts... | 33.053571 | 105 | 0.574959 |
1c28f6b12f7f6b5d94a6b3d3d64dd6f940a06ceb | 614 | py | Python | loesungen/chapter06/image_scaler.py | SaschaKersken/Daten-Prozessanalyse | 370f07a75b9465329deb3671adbfbef8483f76f6 | [
"Apache-2.0"
] | 2 | 2021-09-20T06:16:41.000Z | 2022-01-17T14:24:43.000Z | loesungen/chapter06/image_scaler.py | SaschaKersken/Daten-Prozessanalyse | 370f07a75b9465329deb3671adbfbef8483f76f6 | [
"Apache-2.0"
] | null | null | null | loesungen/chapter06/image_scaler.py | SaschaKersken/Daten-Prozessanalyse | 370f07a75b9465329deb3671adbfbef8483f76f6 | [
"Apache-2.0"
] | null | null | null | import matplotlib.pyplot as plt
from skimage.io import imread, imshow
from skimage.transform import resize
from sys import argv, exit
if len(argv) < 3:
print(f"Verwendung: python3 {argv[0]} BILDDATEI PIXEL")
exit()
image = imread(argv[1], as_gray = True)
height, width = image.shape
if height > width:
star... | 27.909091 | 59 | 0.687296 |
c7b1a4d3e7276e9434269e1e3fb138b0fd8feab9 | 1,668 | py | Python | HW1/test_objects.py | kvswim/kv_jhu_cv | 2ddf7a9d497aef116a7c043157b8631cea45000d | [
"MIT"
] | null | null | null | HW1/test_objects.py | kvswim/kv_jhu_cv | 2ddf7a9d497aef116a7c043157b8631cea45000d | [
"MIT"
] | null | null | null | HW1/test_objects.py | kvswim/kv_jhu_cv | 2ddf7a9d497aef116a7c043157b8631cea45000d | [
"MIT"
] | null | null | null | #Kyle Verdeyen
#kverdey1@jhu.edu
#Computer Vision EN.601.461
#Assignment 1
#Programming section 1, p1-4
#test_objects.py: test imaging functions p1-p4.
import numpy as np
import matplotlib.pyplot as plt
import cv2
from p1 import p1
from p2 import p2
from p3 import p3
from p4 import p4
two_objects = cv2.imread('two_ob... | 42.769231 | 86 | 0.808153 |
9084c91469c12a20f6ff372df5bb87541b14747e | 11,126 | py | Python | src/onegov/form/widgets.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/form/widgets.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/form/widgets.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | import chameleon
import humanize
from contextlib import suppress
from html import escape
from morepath.error import LinkError
from onegov.file.utils import IMAGE_MIME_TYPES_AND_SVG
from onegov.form import _
from wtforms.widgets import FileInput
from wtforms.widgets import ListWidget
from wtforms.widgets import Select
... | 34.024465 | 79 | 0.526874 |
3121b6623637e94248154cfc52090866ad98c054 | 7,303 | py | Python | scripts/dim-reduction/suzhou-process-cache.py | jenniferxkuo/ultramisc | 65bff53c97715eb9a24acc62b77460f22e0dabc6 | [
"MIT"
] | null | null | null | scripts/dim-reduction/suzhou-process-cache.py | jenniferxkuo/ultramisc | 65bff53c97715eb9a24acc62b77460f22e0dabc6 | [
"MIT"
] | null | null | null | scripts/dim-reduction/suzhou-process-cache.py | jenniferxkuo/ultramisc | 65bff53c97715eb9a24acc62b77460f22e0dabc6 | [
"MIT"
] | null | null | null | import os, sys, glob, re
import argparse
import numpy as np
import pandas as pd
from ultratils.pysonix.scanconvert import Converter
from hashlib import sha1
from sklearn.decomposition import PCA
from scipy.ndimage import median_filter
from sklearn.discriminant_analysis import LinearDiscriminantAnalysis as LDA
... | 37.64433 | 161 | 0.679173 |
7338fb4739ea0971e8e724c44102b0bfcc1e7648 | 2,128 | py | Python | tests/onegov/gis/test_fields.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/gis/test_fields.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/gis/test_fields.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | import re
from base64 import b64encode, b64decode
from onegov.core.custom import json
from onegov.form import Form
from onegov.gis.models import Coordinates
from onegov.gis.forms import CoordinatesField
def test_coordinates_field():
value = re.compile(r'value="([a-zA-Z0-9=]+)"')
# initially the field contai... | 29.150685 | 70 | 0.681391 |
b4555d05919be75c357a92420def2b191b56acee | 763 | py | Python | src/test/tests/hybrid/time_deriv_cmfe.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 226 | 2018-12-29T01:13:49.000Z | 2022-03-30T19:16:31.000Z | src/test/tests/hybrid/time_deriv_cmfe.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/hybrid/time_deriv_cmfe.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: time_deriv_cmfe.py
#
# Defect ID: '2715, '6897
#
# Programmer: Hank Childs
# Date: January 12, 2006
#
# Modifications:
#
# Mark C. Miller, Wed Jan 20 07:37:11 PST 2010
# Added ability to ... | 21.8 | 78 | 0.577982 |
c343f305a49b427048f984b3b765a3481f93cb15 | 1,957 | py | Python | spider/worker_korea.py | iecasszyjy/tweet_search-master | e4978521a39964c22ae46bf35d6ff17710e8e6c6 | [
"MIT"
] | null | null | null | spider/worker_korea.py | iecasszyjy/tweet_search-master | e4978521a39964c22ae46bf35d6ff17710e8e6c6 | [
"MIT"
] | 2 | 2021-03-31T18:54:16.000Z | 2021-12-13T19:49:08.000Z | spider/worker_korea.py | iecasszyjy/tweet_search-master | e4978521a39964c22ae46bf35d6ff17710e8e6c6 | [
"MIT"
] | null | null | null | import sys
if sys.version_info[0] < 3:
import got
else:
import got3 as got
import time
import json
import multiprocessing
from multiprocessing import Pool
from datetime import datetime
from Config import get_noau_config
_,db,r = get_noau_config()
def advance_search_korea(q,f,num,s,u):
collection = db.ko... | 31.063492 | 138 | 0.712315 |
6f20d0a894ff9cb12b1d7080f86e6fe6d0b47fe7 | 4,008 | py | Python | AnaliseZipf/analysis.py | Superar/PLN | 2ed5ea1f0ebb28ca8dd3729c064758bc5c2abcee | [
"MIT"
] | null | null | null | AnaliseZipf/analysis.py | Superar/PLN | 2ed5ea1f0ebb28ca8dd3729c064758bc5c2abcee | [
"MIT"
] | null | null | null | AnaliseZipf/analysis.py | Superar/PLN | 2ed5ea1f0ebb28ca8dd3729c064758bc5c2abcee | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import argparse
import string
import os
import random
import matplotlib.pyplot as plt
import numpy as np
from nltk.tokenize import word_tokenize
import scipy.stats as stats
from scipy.stats import norm
import math
PARSER = argparse.ArgumentParser()
PARSER.add_argument('--dataset', '-d', type=st... | 28.628571 | 109 | 0.627495 |
48bf901945695907bd736cddfa6985a5a19211f7 | 1,459 | py | Python | 03-BFS-DFS/bfs.py | explodingnuggets/Grafos-UFSCar | d149157a9f7ecfd2f519cc52e1bdfcb910c2ffad | [
"MIT"
] | 2 | 2017-11-13T02:51:28.000Z | 2017-11-15T02:42:23.000Z | 03-BFS-DFS/bfs.py | explodingnuggets/Grafos-UFSCar | d149157a9f7ecfd2f519cc52e1bdfcb910c2ffad | [
"MIT"
] | null | null | null | 03-BFS-DFS/bfs.py | explodingnuggets/Grafos-UFSCar | d149157a9f7ecfd2f519cc52e1bdfcb910c2ffad | [
"MIT"
] | 1 | 2017-11-13T02:51:32.000Z | 2017-11-13T02:51:32.000Z | import networkx as nx
import matplotlib.pyplot as plt
def bfs(graph, start):
# Make a copy of the original graph to work on
graph_cpy = graph.copy()
# Initialize all nodes to white color, infinite distance and no parent
for node in graph_cpy:
nx.set_node_attributes(graph_cpy, 'white', 'color')... | 34.738095 | 104 | 0.640164 |
81578edf6e441942f1955bca6b7d72f963418d25 | 3,173 | py | Python | Webpage/jollen/migrations/0001_initial.py | ASV-Aachen/Website | bbfc02d71dde67fdf89a4b819b795a73435da7cf | [
"Apache-2.0"
] | null | null | null | Webpage/jollen/migrations/0001_initial.py | ASV-Aachen/Website | bbfc02d71dde67fdf89a4b819b795a73435da7cf | [
"Apache-2.0"
] | 46 | 2022-01-08T12:03:24.000Z | 2022-03-30T08:51:05.000Z | Webpage/jollen/migrations/0001_initial.py | ASV-Aachen/Website | bbfc02d71dde67fdf89a4b819b795a73435da7cf | [
"Apache-2.0"
] | null | null | null | # Generated by Django 3.1.8 on 2021-04-29 18:52
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import django_resized.forms
import jollen.models
import tinymce.models
class Migration(migrations.Migration):
initial = True
... | 50.365079 | 201 | 0.620233 |
816f6ff6ac737d6f4cbad7ae782e75cfd86b999d | 562 | py | Python | dewar/account/views.py | shonenada-archives/dewar | 392b996771a35bc26e9c301cc2a25bad973e8f61 | [
"MIT"
] | null | null | null | dewar/account/views.py | shonenada-archives/dewar | 392b996771a35bc26e9c301cc2a25bad973e8f61 | [
"MIT"
] | null | null | null | dewar/account/views.py | shonenada-archives/dewar | 392b996771a35bc26e9c301cc2a25bad973e8f61 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from flask import Blueprint, render_template, url_for, redirect
account_app = Blueprint('account', __name__, url_prefix='/account',
template_folder='templates')
@account_app.route('/signin', methods=['GET', 'POST'])
def signin():
return render_template('account/si... | 25.545455 | 67 | 0.676157 |
967df2b6cf89c1cb572fb2df650957a2d998c729 | 5,155 | py | Python | koissu-master/main.py | jaakaappi/archived-projects | be1f754eca7c1434f3a363b0ea8ebcd190a42436 | [
"MIT"
] | null | null | null | koissu-master/main.py | jaakaappi/archived-projects | be1f754eca7c1434f3a363b0ea8ebcd190a42436 | [
"MIT"
] | 3 | 2021-03-10T13:18:31.000Z | 2021-05-11T09:20:11.000Z | koissu-master/main.py | jaakaappi/archived-projects | be1f754eca7c1434f3a363b0ea8ebcd190a42436 | [
"MIT"
] | null | null | null | import busio
import time
from adafruit_motor import servo
from adafruit_pca9685 import PCA9685
from board import SCL, SDA
ACTUATION_RANGE = 270
i2c = busio.I2C(SCL, SDA)
pca = PCA9685(i2c)
pca.frequency = 50
# assign servo numbers to groups
servos = []
left_hips = [2, 6, 10]
right_hips = [0, 4, 8]
left_knees = [3, ... | 22.316017 | 104 | 0.542968 |
fb4fb3cea068c8b52b4d8ddb0848180812b8baee | 1,394 | py | Python | stiefo/wordlist.py | effjot/stiefogen | da149f22912fa3b31fc2660ff01e4e0ca08d5efe | [
"MIT"
] | 14 | 2015-04-30T08:50:53.000Z | 2021-08-23T13:58:12.000Z | stiefo/wordlist.py | effjot/stiefogen | da149f22912fa3b31fc2660ff01e4e0ca08d5efe | [
"MIT"
] | 4 | 2020-08-28T20:45:47.000Z | 2021-04-06T21:56:25.000Z | stiefo/wordlist.py | effjot/stiefogen | da149f22912fa3b31fc2660ff01e4e0ca08d5efe | [
"MIT"
] | 5 | 2015-05-01T06:40:40.000Z | 2019-12-12T22:17:29.000Z | import doctest
import collections
import re
class wordlist(collections.MutableMapping):
def __init__(self, *args, **kwargs):
self.store = dict()
self.update(dict(*args, **kwargs)) # use the free update to set keys
self.rx = r"(\S+)\s*=\s*(.+)"
def __getitem__(self, key... | 23.627119 | 78 | 0.516499 |
f7cbd910ef3c233eb4313d9506cee2cefd1e9746 | 15,595 | py | Python | Paddle_Industry_Practice_Sample_Library/Football_Action/PaddleVideo/paddlevideo/modeling/heads/cfbi_head.py | linuxonly801/awesome-DeepLearning | b063757fa130c4d56aea5cce2e592610f1e169f9 | [
"Apache-2.0"
] | 5 | 2022-01-30T07:35:58.000Z | 2022-02-08T05:45:20.000Z | Paddle_Industry_Practice_Sample_Library/Football_Action/PaddleVideo/paddlevideo/modeling/heads/cfbi_head.py | linuxonly801/awesome-DeepLearning | b063757fa130c4d56aea5cce2e592610f1e169f9 | [
"Apache-2.0"
] | 1 | 2022-01-14T02:33:28.000Z | 2022-01-14T02:33:28.000Z | Paddle_Industry_Practice_Sample_Library/Football_Action/PaddleVideo/paddlevideo/modeling/heads/cfbi_head.py | linuxonly801/awesome-DeepLearning | b063757fa130c4d56aea5cce2e592610f1e169f9 | [
"Apache-2.0"
] | 1 | 2022-03-07T10:51:21.000Z | 2022-03-07T10:51:21.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 applic... | 34.732739 | 104 | 0.533633 |
f7e3fb8e81d7ee4338b63b3925ab53d9c524c026 | 456 | py | Python | RasPi/network.py | Jugendhackt/SMocket | 6aa495f3052c85f503ebf0e81b3ee5799cea37b2 | [
"MIT"
] | null | null | null | RasPi/network.py | Jugendhackt/SMocket | 6aa495f3052c85f503ebf0e81b3ee5799cea37b2 | [
"MIT"
] | null | null | null | RasPi/network.py | Jugendhackt/SMocket | 6aa495f3052c85f503ebf0e81b3ee5799cea37b2 | [
"MIT"
] | null | null | null | import socket
import subprocess
import sys
from datetime import datetime
def recognize():
len = 0
string = str("wlan0")
out = str(subprocess.check_output(["iw", "dev", "wlan0", "station", "dump"], shell=False)).split("seconds")
if out == "":
value = 0
for i in out:
if ... | 20.727273 | 112 | 0.52193 |
f7ec0e0c838a182cdeb2bdbd902ef800b2c273d8 | 323 | py | Python | Fastir_Collector/dump/windows8_1Dump.py | Unam3dd/Train-2018-2020 | afb6ae70fe338cbe55a21b74648d91996b818fa2 | [
"MIT"
] | 4 | 2021-04-23T15:39:17.000Z | 2021-12-27T22:53:24.000Z | Fastir_Collector/dump/windows8_1Dump.py | Unam3dd/Train-2018-2020 | afb6ae70fe338cbe55a21b74648d91996b818fa2 | [
"MIT"
] | null | null | null | Fastir_Collector/dump/windows8_1Dump.py | Unam3dd/Train-2018-2020 | afb6ae70fe338cbe55a21b74648d91996b818fa2 | [
"MIT"
] | 2 | 2021-04-19T08:28:54.000Z | 2022-01-19T13:23:29.000Z | from __future__ import unicode_literals
from dump import _Dump
from utils.vss import _VSS
import os
class Windows8_1Dump(_Dump):
def __init__(self, params):
super(Windows8_1Dump, self).__init__(params)
self.root_reg = os.path.join(_VSS._get_instance(params)._return_root(), 'Windows\System32\config'... | 29.363636 | 106 | 0.758514 |
e39aba20c28eeea317fc8dbb77483db0fcd38f10 | 835 | py | Python | Python/Buch_Python3_Das_umfassende_Praxisbuch/Kapitel_07_Sequenzen_Mengen_und_Generatoren/02_recursive_sum_of_sequences.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | null | null | null | Python/Buch_Python3_Das_umfassende_Praxisbuch/Kapitel_07_Sequenzen_Mengen_und_Generatoren/02_recursive_sum_of_sequences.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | 6 | 2020-12-24T15:15:09.000Z | 2022-01-13T01:58:35.000Z | Python/Buch_Python3_Das_umfassende_Praxisbuch/Kapitel_07_Sequenzen_Mengen_und_Generatoren/02_recursive_sum_of_sequences.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
###
# File: 02_recursive_sum_of_sequences.py
# Project: Kapitel_07_Sequenzen_Mengen_und_Generatoren
# Created Date: Tuesday 26.02.2019, 11:51
# Author: Apop85
# -----
# Last Modified: Monday 04.03.2019, 12:18
# -----
# Copyright (c) 2019 Apop85
# This software is published ... | 29.821429 | 94 | 0.71018 |
583ebd468cef6868b65c46832b60f26be026ee53 | 1,406 | py | Python | aecb/api/auth.py | snvc00/aecb-backend | 96847008d7b8d986099c0ce08e1026926ef3c68d | [
"MIT"
] | null | null | null | aecb/api/auth.py | snvc00/aecb-backend | 96847008d7b8d986099c0ce08e1026926ef3c68d | [
"MIT"
] | null | null | null | aecb/api/auth.py | snvc00/aecb-backend | 96847008d7b8d986099c0ce08e1026926ef3c68d | [
"MIT"
] | null | null | null | from google.oauth2 import id_token
from google.auth.transport import requests
from .models import Account
class AuthException(Exception):
def __init__(self, message) -> None:
self.message = message
super().__init__(self.message)
def __str__(self) -> str:
return super().__str__()
cla... | 31.244444 | 100 | 0.630868 |
49dd2002284342aa3d004dbab5bb6c74dbea154f | 779 | py | Python | Project Euler Qusetions 51 - 60/Project Euler Question 52.py | Clayton-Threm/Coding-Practice | 6671e8a15f9e797338caa617dae45093f4157bc1 | [
"MIT"
] | 1 | 2020-02-11T02:03:02.000Z | 2020-02-11T02:03:02.000Z | Project Euler Qusetions 51 - 60/Project Euler Question 52.py | Clayton-Threm/Coding-Practice | 6671e8a15f9e797338caa617dae45093f4157bc1 | [
"MIT"
] | null | null | null | Project Euler Qusetions 51 - 60/Project Euler Question 52.py | Clayton-Threm/Coding-Practice | 6671e8a15f9e797338caa617dae45093f4157bc1 | [
"MIT"
] | null | null | null | #Project Euler Question 52
#Permuted multiples
def same_digits(x, y):
ld = x
nld = y
for digit in nld:
if digit in ld:
ld.remove(digit)
else:
return False
else:
return True
def multiples(num):
x = 9
while True:
x += 1
m = x
... | 22.911765 | 72 | 0.49294 |
3fb6cd5a967e45dd5bcbc62ea55ec40d991a7171 | 1,376 | py | Python | exercises/es/test_04_03.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/es/test_04_03.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/es/test_04_03.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | def test():
assert len(pattern1) == 2, "El pattern1 debería describir dos tokens."
assert len(pattern2) == 2, "El pattern2 debería describir dos tokens."
assert (
len(pattern1[0]) == 1
), "El primer token de pattern1 solo necesita un atributo."
assert any(
pattern1[0].get(l) == "adid... | 41.69697 | 79 | 0.62718 |
4d0a1d467e6d28ed635a60aba4d015dd2777b5df | 2,786 | py | Python | File_Statistik.py | UlrichBerntien/Uebungen-Python | 67e6d885dd2319e999979410448364ec4d59dc51 | [
"Apache-2.0"
] | null | null | null | File_Statistik.py | UlrichBerntien/Uebungen-Python | 67e6d885dd2319e999979410448364ec4d59dc51 | [
"Apache-2.0"
] | null | null | null | File_Statistik.py | UlrichBerntien/Uebungen-Python | 67e6d885dd2319e999979410448364ec4d59dc51 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
File Statistik
https://www.programmieraufgaben.ch/aufgabe/file-statistik/gcx87ud7
"""
# Programmieraufgabe:
#
# Schreiben Sie ein Programm, das von einer Datei (Textdatei oder Programm-
# Quellcode) die Anzahl Zeilen, die Anzahl Wörter und die Anzahl Buchstab... | 35.717949 | 85 | 0.640345 |
4d1f6dd8b2db63f69f076eeec97dddf4bb6f6ae7 | 7,697 | py | Python | hdmiceccontroller.py | stg93/blaulichtsms_einsatzmonitor | db595f535ece0f944ec70a9eac70af7b667f63ef | [
"MIT"
] | 18 | 2017-07-24T18:08:04.000Z | 2021-05-06T06:50:22.000Z | hdmiceccontroller.py | stg93/blaulichtsms_einsatzmonitor | db595f535ece0f944ec70a9eac70af7b667f63ef | [
"MIT"
] | 19 | 2018-09-25T20:42:17.000Z | 2021-11-23T21:26:18.000Z | hdmiceccontroller.py | stg93/blaulichtsms_einsatzmonitor | db595f535ece0f944ec70a9eac70af7b667f63ef | [
"MIT"
] | 11 | 2018-05-05T04:49:41.000Z | 2022-02-18T17:33:13.000Z | import logging
import re
import subprocess
from abc import ABC, abstractmethod
from enum import IntEnum
from queue import Empty, Queue
from threading import Thread
import cec
class CecMode(IntEnum):
LIB_CEC = 1
PYTHON_CEC = 2
class CecLogging(IntEnum):
# see https://github.com/Pulse-Eight/libcec/blob/m... | 31.288618 | 98 | 0.619982 |
4230c9160d48bac5c31992d470b3bc37801aa500 | 22 | py | Python | HelloWorld.py | reshma2772/Hacktoberfest-2021 | da292ab429a2d9a3eef1fa34a3b5b9ac25c19074 | [
"MIT"
] | null | null | null | HelloWorld.py | reshma2772/Hacktoberfest-2021 | da292ab429a2d9a3eef1fa34a3b5b9ac25c19074 | [
"MIT"
] | null | null | null | HelloWorld.py | reshma2772/Hacktoberfest-2021 | da292ab429a2d9a3eef1fa34a3b5b9ac25c19074 | [
"MIT"
] | null | null | null | print("Hello Worlds")
| 11 | 21 | 0.727273 |
c424a9e6e525df84e87b57adc617fbd67340b531 | 45,722 | py | Python | tuta/tokenizer.py | PseudoLabs-Demo/TUTA_table_understanding | d0f3fe2f15c56a5ea9f593b210296f170fc74558 | [
"MIT"
] | 36 | 2021-06-15T01:04:27.000Z | 2022-03-19T16:36:54.000Z | tuta/tokenizer.py | PseudoLabs-Demo/TUTA_table_understanding | d0f3fe2f15c56a5ea9f593b210296f170fc74558 | [
"MIT"
] | 6 | 2021-09-03T11:29:36.000Z | 2021-12-15T11:33:57.000Z | tuta/tokenizer.py | PseudoLabs-Demo/TUTA_table_understanding | d0f3fe2f15c56a5ea9f593b210296f170fc74558 | [
"MIT"
] | 8 | 2021-11-03T04:32:36.000Z | 2022-02-02T13:43:47.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Tokenize tables (the reader output) to generate model inputs
with pre-processing for three pre-training objectives:
MLM: Masked Language Model
CLC: Cell Level Cloze
TCR: Table Context Retrieval
"""
from typing import Dict, List
import os
impo... | 43.75311 | 149 | 0.563099 |
c43488070389fbc7ad51c5618b01a493b87c3efe | 9,878 | py | Python | examples/sentiment_analysis/skep/train_opinion.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | examples/sentiment_analysis/skep/train_opinion.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | examples/sentiment_analysis/skep/train_opinion.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 45.520737 | 141 | 0.62705 |
6784a85f9c14212090b8a5c076034427c4a42a6c | 258 | py | Python | Online-Judges/LeetCode/2011.Final_Value_of_Variable_After_Performing_Operations.py | shihab4t/Competitive-Programming | e8eec7d4f7d86bfa1c00b7fbbedfd6a1518f19be | [
"Unlicense"
] | 3 | 2021-06-15T01:19:23.000Z | 2022-03-16T18:23:53.000Z | Online-Judges/LeetCode/2011.Final_Value_of_Variable_After_Performing_Operations.py | shihab4t/Competitive-Programming | e8eec7d4f7d86bfa1c00b7fbbedfd6a1518f19be | [
"Unlicense"
] | null | null | null | Online-Judges/LeetCode/2011.Final_Value_of_Variable_After_Performing_Operations.py | shihab4t/Competitive-Programming | e8eec7d4f7d86bfa1c00b7fbbedfd6a1518f19be | [
"Unlicense"
] | null | null | null | class Solution:
def finalValueAfterOperations(self, operations: List[str]) -> int:
x = 0
for ith in operations:
if ith == "++X" or ith == "X++":
x += 1
else:
x -= 1
return x
| 25.8 | 70 | 0.434109 |
c04e6c0e264f59e4ef9e95301f3d5fc66131760b | 3,083 | py | Python | Board.py | Mathias-Mo/Zauberwald_v05 | 7c67b7ed086feb8e3897f4b6c2122b8b66256331 | [
"MIT"
] | null | null | null | Board.py | Mathias-Mo/Zauberwald_v05 | 7c67b7ed086feb8e3897f4b6c2122b8b66256331 | [
"MIT"
] | null | null | null | Board.py | Mathias-Mo/Zauberwald_v05 | 7c67b7ed086feb8e3897f4b6c2122b8b66256331 | [
"MIT"
] | null | null | null | from player import message_output
from random import shuffle
from data import features
class Board:
def __init__(self, params):
self.size = params['size']
self.char = params['char']
self.char_fight = params['char_fight']
self.char_list = params['char_list']
# ##################... | 33.51087 | 114 | 0.570548 |
22192fbbcd26d0605a43313f38fe398aa0f33964 | 856 | py | Python | admin-tutorial/AdminDateHierarchy/simple_relate/models.py | zhengtong0898/django-decode | 69680853a4a5b07f6a9c4b65c7d86b2d401a92b1 | [
"MIT"
] | 5 | 2020-07-14T07:48:10.000Z | 2021-12-20T21:20:10.000Z | admin-tutorial/AdminDateHierarchy/simple_relate/models.py | zhengtong0898/django-decode | 69680853a4a5b07f6a9c4b65c7d86b2d401a92b1 | [
"MIT"
] | 7 | 2021-03-26T03:13:38.000Z | 2022-03-12T00:42:03.000Z | admin-tutorial/AdminDateHierarchy/simple_relate/models.py | zhengtong0898/django-decode | 69680853a4a5b07f6a9c4b65c7d86b2d401a92b1 | [
"MIT"
] | 1 | 2021-02-16T07:04:25.000Z | 2021-02-16T07:04:25.000Z | from django.db import models
# Create your models here.
class AuthorModel(models.Model):
name = models.CharField(verbose_name="作者姓名", max_length=50)
date_joined = models.DateTimeField(verbose_name="作者加入时间", auto_now=True)
def __str__(self):
return self.name
class ArticleModel(models.Model):
... | 32.923077 | 112 | 0.738318 |
58c74f8820799936aba8677c4018a66a6e20fae8 | 4,213 | py | Python | Liter_Client/TLineEdit.py | Drelf2018/Liter | e12ffdd22ee7b2724722c38e852fc9c1b2f180ad | [
"MIT"
] | null | null | null | Liter_Client/TLineEdit.py | Drelf2018/Liter | e12ffdd22ee7b2724722c38e852fc9c1b2f180ad | [
"MIT"
] | null | null | null | Liter_Client/TLineEdit.py | Drelf2018/Liter | e12ffdd22ee7b2724722c38e852fc9c1b2f180ad | [
"MIT"
] | null | null | null | from PyQt5.QtCore import (Qt, QPointF, QRect)
from PyQt5.QtGui import (QPainter, QColor, QPen)
from PyQt5.QtWidgets import (QLineEdit, QWidget)
class EXEdit(QLineEdit):
def __init__(self, parent=None):
super(EXEdit, self).__init__(parent)
def enterEvent(self, QMouseEvent):
QMouseEvent.ignore(... | 35.108333 | 113 | 0.582958 |
18ee34921b8c7407c05c8552393bd16730f1f77d | 9,750 | py | Python | tests/views/test_admin_unit.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | 1 | 2021-06-01T14:49:18.000Z | 2021-06-01T14:49:18.000Z | tests/views/test_admin_unit.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | 286 | 2020-12-04T14:13:00.000Z | 2022-03-09T19:05:16.000Z | tests/views/test_admin_unit.py | DanielGrams/gsevpt | a92f71694388e227e65ed1b24446246ee688d00e | [
"MIT"
] | null | null | null | def create_form_data(response, utils):
return {
"csrf_token": utils.get_csrf(response),
"name": "Meine Crew",
"short_name": "meine_crew",
"location-csrf_token": utils.get_csrf(response, "location"),
"location-postalCode": "38640",
"location-city": "Goslar",
"l... | 32.5 | 86 | 0.670564 |
e153670580162438b6fd23dbdfbb46df4cfa6aff | 666 | py | Python | Xtendgpiozero/example.py | Hofei90/picoffee | 6b2a00f2b4631790b90495d736afeb331d759241 | [
"MIT"
] | 3 | 2019-05-04T21:34:33.000Z | 2022-01-25T10:00:25.000Z | Xtendgpiozero/example.py | Hofei90/picoffee | 6b2a00f2b4631790b90495d736afeb331d759241 | [
"MIT"
] | 4 | 2019-04-11T05:03:55.000Z | 2020-07-09T06:52:58.000Z | Xtendgpiozero/example.py | Hofei90/picoffee | 6b2a00f2b4631790b90495d736afeb331d759241 | [
"MIT"
] | 1 | 2020-02-13T19:04:31.000Z | 2020-02-13T19:04:31.000Z | import buttonxtendgpiozero
import time
def main():
with buttonxtendgpiozero.Button(20) as taster:
taster.when_pressed = taster.when_pressed_
taster.when_released = taster.when_released_
while True:
if taster.check_status():
print("Taster wurde gedrückt")
... | 26.64 | 94 | 0.597598 |
83230ecb5a6dacfbe28b70db82fd345515ec61fe | 654 | py | Python | apps/hygiene/migrations/0002_auto_20190618_1521.py | LvanArkel/sbzwebsite | a26efbb050585312c53010f14f86c23616a8071f | [
"BSD-3-Clause"
] | 1 | 2017-01-08T13:21:43.000Z | 2017-01-08T13:21:43.000Z | apps/hygiene/migrations/0002_auto_20190618_1521.py | LvanArkel/sbzwebsite | a26efbb050585312c53010f14f86c23616a8071f | [
"BSD-3-Clause"
] | 17 | 2018-12-03T14:22:14.000Z | 2021-07-14T15:15:12.000Z | apps/hygiene/migrations/0002_auto_20190618_1521.py | LvanArkel/sbzwebsite | a26efbb050585312c53010f14f86c23616a8071f | [
"BSD-3-Clause"
] | 2 | 2018-12-03T14:58:49.000Z | 2019-12-01T13:24:42.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.14 on 2019-06-18 13:21
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('hygiene', '0001_initial'),
]
operations = [
migrations.AddField(
... | 25.153846 | 105 | 0.565749 |
833d493ed7adcda720fa771eed7631ce08ac3b07 | 3,421 | py | Python | retro/cores/gba/src/platform/python/cinema/test.py | MatPoliquin/retro | c70c174a9818d1e97bc36e61abb4694d28fc68e1 | [
"MIT-0",
"MIT"
] | 2,706 | 2018-04-05T18:28:50.000Z | 2022-03-29T16:56:59.000Z | retro/cores/gba/src/platform/python/cinema/test.py | MatPoliquin/retro | c70c174a9818d1e97bc36e61abb4694d28fc68e1 | [
"MIT-0",
"MIT"
] | 242 | 2018-04-05T22:30:42.000Z | 2022-03-19T01:55:11.000Z | retro/cores/gba/src/platform/python/cinema/test.py | MatPoliquin/retro | c70c174a9818d1e97bc36e61abb4694d28fc68e1 | [
"MIT-0",
"MIT"
] | 464 | 2018-04-05T19:10:34.000Z | 2022-03-28T13:33:32.000Z | import os, os.path
import mgba.core, mgba.image
import cinema.movie
import itertools
import glob
import re
import yaml
from copy import deepcopy
from cinema import VideoFrame
from cinema.util import dictMerge
class CinemaTest(object):
TEST = 'test.(mvl|gb|gba|nds)'
def __init__(self, path, root, settings={}):... | 35.268041 | 102 | 0.611225 |
360df282cbca61ab8e2738bc52a26cb64548f027 | 996 | py | Python | solution/two_pointer/15961/main.py | gkgg123/baekjoon | 4ff8a1238a5809e4958258b5f2eeab7b22105ce9 | [
"MIT"
] | 2,236 | 2019-08-05T00:36:59.000Z | 2022-03-31T16:03:53.000Z | solution/two_pointer/15961/main.py | juy4556/baekjoon | bc0b0a0ebaa45a5bbd32751f84c458a9cfdd9f92 | [
"MIT"
] | 225 | 2020-12-17T10:20:45.000Z | 2022-01-05T17:44:16.000Z | solution/two_pointer/15961/main.py | juy4556/baekjoon | bc0b0a0ebaa45a5bbd32751f84c458a9cfdd9f92 | [
"MIT"
] | 602 | 2019-08-05T00:46:25.000Z | 2022-03-31T13:38:23.000Z | # Authored by : kis03160
# Co-authored by : tony9402
# Link : http://boj.kr/a074da0ce3c34775a50d386da92800e4
import sys
def input():
return sys.stdin.readline().rstrip()
def answer(line, max_seq, coupon):
count = 0
for i in range(max_seq):
food_number = line[i]
if not eat[food_number]:
... | 23.714286 | 55 | 0.533133 |
3668280e3c2fc7e7aeb8d27f2ed330a6c752196c | 2,096 | py | Python | lms-teste/lms_app/models.py | gabrielmdsantos/LMSBD | dff3001a560f8cccb938957bf2d5732d4ae3d163 | [
"Apache-2.0"
] | null | null | null | lms-teste/lms_app/models.py | gabrielmdsantos/LMSBD | dff3001a560f8cccb938957bf2d5732d4ae3d163 | [
"Apache-2.0"
] | null | null | null | lms-teste/lms_app/models.py | gabrielmdsantos/LMSBD | dff3001a560f8cccb938957bf2d5732d4ae3d163 | [
"Apache-2.0"
] | null | null | null | from django.db import models
from lms_app.professor import *
from lms_app.disciplina import *
from lms_app.disciofertada import *
from lms_app.aluno import *
'''
class Professor(models.Model):
def __str__(self):
return self.nome +self.email
def save(self):
#print('estou salvando!')
if(... | 31.283582 | 159 | 0.650286 |
3d0cdc8c1d9cff56ab01d908209df821d7ce1b43 | 2,905 | py | Python | mumath/lex.py | fourpoints/mumath | f1c36c4a5b3c32a3e7f8e7a922eafea8b7a14fd4 | [
"MIT"
] | null | null | null | mumath/lex.py | fourpoints/mumath | f1c36c4a5b3c32a3e7f8e7a922eafea8b7a14fd4 | [
"MIT"
] | null | null | null | mumath/lex.py | fourpoints/mumath | f1c36c4a5b3c32a3e7f8e7a922eafea8b7a14fd4 | [
"MIT"
] | null | null | null | import xml.etree.ElementTree as ET
import re
import io
from typing import NamedTuple
from itertools import chain
from .context.tokens import tok_name
try:
from functools import cache
except importError:
from functools import lru_cache as cache
# fun equivalent
# def TokenInfo(type: str, string: str, start: st... | 29.343434 | 97 | 0.565921 |
a1e29a21231e28d4a6d70091870face173b2edb3 | 5,585 | py | Python | methods/transformers/src/transformers/convert_dpr_original_checkpoint_to_pytorch.py | INK-USC/RiddleSense | a3d57eaf084da9cf6b77692c608e2cd2870fbd97 | [
"MIT"
] | 3 | 2021-07-06T20:02:31.000Z | 2022-03-27T13:13:01.000Z | methods/transformers/src/transformers/convert_dpr_original_checkpoint_to_pytorch.py | INK-USC/RiddleSense | a3d57eaf084da9cf6b77692c608e2cd2870fbd97 | [
"MIT"
] | null | null | null | methods/transformers/src/transformers/convert_dpr_original_checkpoint_to_pytorch.py | INK-USC/RiddleSense | a3d57eaf084da9cf6b77692c608e2cd2870fbd97 | [
"MIT"
] | null | null | null | import argparse
import collections
from pathlib import Path
import torch
from torch.serialization import default_restore_location
from transformers import BertConfig, DPRConfig, DPRContextEncoder, DPRQuestionEncoder, DPRReader
CheckpointState = collections.namedtuple(
"CheckpointState", ["model_dict"... | 44.325397 | 229 | 0.675739 |
b8fb2120146f594de24b6221b63e4f03cd311eb1 | 3,338 | py | Python | official_examples/Using_TensorFlow_to_Create_a_MNIST_Dataset_Recognition_Application/codes/train_mnist_tf.py | RuichunWang/ModelArts-Lab | cfa9a853e3a76a21eac2818f055b36978ac2bb69 | [
"Apache-2.0"
] | 1,045 | 2019-05-09T02:50:43.000Z | 2022-03-31T06:22:11.000Z | official_examples/Using_TensorFlow_to_Create_a_MNIST_Dataset_Recognition_Application/codes/train_mnist_tf.py | RuichunWang/ModelArts-Lab | cfa9a853e3a76a21eac2818f055b36978ac2bb69 | [
"Apache-2.0"
] | 1,468 | 2019-05-16T00:48:18.000Z | 2022-03-08T04:12:44.000Z | official_examples/Using_TensorFlow_to_Create_a_MNIST_Dataset_Recognition_Application/codes/train_mnist_tf.py | RuichunWang/ModelArts-Lab | cfa9a853e3a76a21eac2818f055b36978ac2bb69 | [
"Apache-2.0"
] | 1,077 | 2019-05-09T02:50:53.000Z | 2022-03-27T11:05:32.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
import moxing as mox
tf.flags.DEFINE_integer('max_steps', 1000, 'number of training iterations.')
tf.flags.DEFINE_... | 39.738095 | 98 | 0.677651 |
774c1b7cd94c439f96b9647d2dd17ad8486602ac | 25,332 | py | Python | preprocessing/tokenization.py | dainst/chronoi-corpus-processing | 7f508a7572e1022c4c88d1477db029e6619a1f0c | [
"MIT"
] | null | null | null | preprocessing/tokenization.py | dainst/chronoi-corpus-processing | 7f508a7572e1022c4c88d1477db029e6619a1f0c | [
"MIT"
] | null | null | null | preprocessing/tokenization.py | dainst/chronoi-corpus-processing | 7f508a7572e1022c4c88d1477db029e6619a1f0c | [
"MIT"
] | null | null | null |
from nltk.data import load
import string
# We use one set of abbreviations for multiple languages as they share some of them
# and a falsely concatenated sentence is not too bad for us.
abbreviations = [
# from german texts
"s", "jh", "jhs", "ca", "abb", "vs", "a", "o", "n", "z", "p", "x", "c",
"jahresh",... | 305.204819 | 21,027 | 0.613138 |
6239a44b0aa5471a408d31ec09e5b677d54a8dc4 | 122 | py | Python | py/jpy-integration/src/javaToPython/python/io/deephaven/jpy/integration/my_class.py | devinrsmith/deephaven-core | 3a6930046faf1cd556f62a914ce1cfd7860147b9 | [
"MIT"
] | 55 | 2021-05-11T16:01:59.000Z | 2022-03-30T14:30:33.000Z | py/jpy-integration/src/javaToPython/python/io/deephaven/jpy/integration/my_class.py | devinrsmith/deephaven-core | 3a6930046faf1cd556f62a914ce1cfd7860147b9 | [
"MIT"
] | 943 | 2021-05-10T14:00:02.000Z | 2022-03-31T21:28:15.000Z | py/jpy-integration/src/javaToPython/python/io/deephaven/jpy/integration/my_class.py | devinrsmith/deephaven-core | 3a6930046faf1cd556f62a914ce1cfd7860147b9 | [
"MIT"
] | 29 | 2021-05-10T11:33:16.000Z | 2022-03-30T21:01:54.000Z | class MyClass:
def __init__(self):
pass
def plus43(self, x):
return x + 43
def echo(self, x):
return x | 13.555556 | 22 | 0.598361 |
65602abd0e41b095a45acf065702f24d87c82a71 | 695 | py | Python | source/pkgsrc/graphics/py-ggplot/patches/patch-ggplot_stats_smoothers.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-11-20T22:46:39.000Z | 2021-11-20T22:46:39.000Z | source/pkgsrc/graphics/py-ggplot/patches/patch-ggplot_stats_smoothers.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | source/pkgsrc/graphics/py-ggplot/patches/patch-ggplot_stats_smoothers.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | $NetBSD: patch-ggplot_stats_smoothers.py,v 1.1 2019/06/17 20:27:16 adam Exp $
Fix for newer Pandas.
--- ggplot/stats/smoothers.py.orig 2019-06-17 20:04:57.000000000 +0000
+++ ggplot/stats/smoothers.py
@@ -1,7 +1,6 @@
from __future__ import (absolute_import, division, print_function,
unicode_... | 28.958333 | 77 | 0.709353 |
b882eb7709da8d847d07dfe85573f0c9ba3ac998 | 402 | py | Python | nltk_chatbot/train_chatbot.py | liniribeiro/lie | 0b73e57ffd594f90b7e9ebc8bfd637bdf06a2ac8 | [
"MIT"
] | null | null | null | nltk_chatbot/train_chatbot.py | liniribeiro/lie | 0b73e57ffd594f90b7e9ebc8bfd637bdf06a2ac8 | [
"MIT"
] | null | null | null | nltk_chatbot/train_chatbot.py | liniribeiro/lie | 0b73e57ffd594f90b7e9ebc8bfd637bdf06a2ac8 | [
"MIT"
] | null | null | null | import nltk
from nltk.stem import WordNetLemmatizer
lemmatizer = WordNetLemmatizer()
import json
import pickle
import numpy as np
from keras.models import Sequential
from keras.layers import Dense, Activation, Dropout
from keras.optimizers import SGD
import random
words=[]
classes = []
documents = []
ignore_words = ... | 21.157895 | 51 | 0.768657 |
a2a05523c815d715842901b035950c1c93af586f | 512 | py | Python | Packs/CommonScripts/Scripts/JSONtoCSV/JSONtoCSV_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/CommonScripts/Scripts/JSONtoCSV/JSONtoCSV_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/CommonScripts/Scripts/JSONtoCSV/JSONtoCSV_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | from CommonServerPython import *
def test_main(mocker):
from JSONtoCSV import main
mocker.patch.object(demisto, 'args', return_value={
'entryid': 'something@something'
})
mocker.patch.object(demisto, 'executeCommand', return_value=[
{"Contents": [
{"Test": "value"},
... | 25.6 | 65 | 0.605469 |
a7cb08f3dca9e0f09d5ca817133d6940187df53d | 782 | py | Python | leetcode/229-Majority-Element-II/MajorityElementII_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2015-12-16T04:01:03.000Z | 2015-12-16T04:01:03.000Z | leetcode/229-Majority-Element-II/MajorityElementII_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | leetcode/229-Majority-Element-II/MajorityElementII_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | class Solution(object):
def majorityElement(self, nums):
"""
:type nums: List[int]
:rtype: List[int]
"""
c1, c2, num1, num2 = 0, 0, 0, 0
for c in nums:
if c == c1:
num1 += 1
elif c == c2:
num2 += 1
el... | 23.69697 | 47 | 0.347826 |
0ce4249372dd085ff17d5e5fee5a1312026a74d2 | 1,690 | py | Python | python/data_sutram/scraper/img_crop.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/data_sutram/scraper/img_crop.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/data_sutram/scraper/img_crop.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | from __future__ import print_function
import sys
from PIL import Image
from PIL import ImageFilter
from PIL import ImageEnhance
for infile in sys.argv[1:]:
try:
im = Image.open(infile)
"""
box = (100, 100, 400, 400)
region = im.crop(box)
#region.show()
out = im.resiz... | 24.852941 | 69 | 0.527219 |
f05ba7ef9d0d881d4b28fb8eab9c2c34287aeb5a | 393 | py | Python | LoremPizzum/products/migrations/0002_auto_20210323_1823.py | BruhMano/LoremPizzum | 8909a9f21ea2878cf9accf035989edbd15c3d285 | [
"BSD-3-Clause"
] | null | null | null | LoremPizzum/products/migrations/0002_auto_20210323_1823.py | BruhMano/LoremPizzum | 8909a9f21ea2878cf9accf035989edbd15c3d285 | [
"BSD-3-Clause"
] | null | null | null | LoremPizzum/products/migrations/0002_auto_20210323_1823.py | BruhMano/LoremPizzum | 8909a9f21ea2878cf9accf035989edbd15c3d285 | [
"BSD-3-Clause"
] | null | null | null | # Generated by Django 3.1.6 on 2021-03-23 14:23
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('products', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='product',
name='id',
fie... | 20.684211 | 70 | 0.597964 |
3326b938aabb77dde1df548fc404822bc98c04ef | 4,094 | py | Python | test/test_npu/test_network_ops/test_zero.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-12-02T03:07:35.000Z | 2021-12-02T03:07:35.000Z | test/test_npu/test_network_ops/test_zero.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-11-12T07:23:03.000Z | 2021-11-12T08:28:13.000Z | test/test_npu/test_network_ops/test_zero.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2020, Huawei Technologies.All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
#
# Unless required by applicable law... | 37.218182 | 78 | 0.670738 |
334d40ab3d638199ebca8007542013b40eb78029 | 735 | py | Python | src/standard_module/logging_module.py | HuangHuaBingZiGe/GitHub-Demo | f3710f73b0828ef500343932d46c61d3b1e04ba9 | [
"Apache-2.0"
] | null | null | null | src/standard_module/logging_module.py | HuangHuaBingZiGe/GitHub-Demo | f3710f73b0828ef500343932d46c61d3b1e04ba9 | [
"Apache-2.0"
] | null | null | null | src/standard_module/logging_module.py | HuangHuaBingZiGe/GitHub-Demo | f3710f73b0828ef500343932d46c61d3b1e04ba9 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
logging.getLogger
logging.basicConfig
logging.INFO
logging.error
logging.debug
"""
import logging
from functools import wraps
def logger(fn):
@wraps(fn)
def wrapper(*args, **kwargs):
log = logging.getLogger(fn.__name__)
log.debug('Start to run %s... | 19.342105 | 69 | 0.586395 |
686991d36d3a19fdd67f0b4bf3b69368738cf131 | 4,233 | py | Python | Website/db/taskdb.py | NeonCrafter13/easyvoc | 605f3394565df8192615bc9ced27c0fa8d1ee51a | [
"MIT"
] | null | null | null | Website/db/taskdb.py | NeonCrafter13/easyvoc | 605f3394565df8192615bc9ced27c0fa8d1ee51a | [
"MIT"
] | null | null | null | Website/db/taskdb.py | NeonCrafter13/easyvoc | 605f3394565df8192615bc9ced27c0fa8d1ee51a | [
"MIT"
] | null | null | null | import pymysql
import json
import random
import os
from dotenv import load_dotenv
load_dotenv(dotenv_path=".envvar")
conn = pymysql.connect(
host=os.getenv("MYSQL_HOST"),
passwd=os.getenv("MYSQL_PASSWORD"),
user=os.getenv("MYSQL_USER"),
db="task",
port=int(os.getenv("MYSQL_PORT")),
... | 25.969325 | 82 | 0.584455 |
f0e861949e2718caca7d8fdffda629a4f527dbb2 | 651 | py | Python | challenges/leapYear/python3/leapYear.py | jimmynguyen/codefights | f4924fcffdb4ff14930618bb1a781e4e02e9aa09 | [
"MIT"
] | 5 | 2020-05-21T03:02:34.000Z | 2021-09-06T04:24:26.000Z | challenges/leapYear/python3/leapYear.py | jimmynguyen/codefights | f4924fcffdb4ff14930618bb1a781e4e02e9aa09 | [
"MIT"
] | 6 | 2019-04-24T03:39:26.000Z | 2019-05-03T02:10:59.000Z | challenges/leapYear/python3/leapYear.py | jimmynguyen/codefights | f4924fcffdb4ff14930618bb1a781e4e02e9aa09 | [
"MIT"
] | 1 | 2021-09-06T04:24:27.000Z | 2021-09-06T04:24:27.000Z | def leapYear(year):
return year % 4 == 0 and year % 100 != 0 or year % 400 == 0
if __name__ == '__main__':
input0 = [2000, 1993, 1000, 0, 100, 200, 42, 1200, 123, 124]
expectedOutput = [True, False, False, True, False, False, False, True, False, True]
assert len(input0) == len(expectedOutput), '# input0 = {}, # ex... | 59.181818 | 123 | 0.675883 |
f0e8675ed0a2fba37dbb83d0d545d1060e680c6a | 121 | py | Python | PYTHON/Numpy/shape.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | PYTHON/Numpy/shape.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | PYTHON/Numpy/shape.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import numpy
arr = list(map(int, input().strip().split(' ')))
print(numpy.reshape(arr, (3, 3)))
| 17.285714 | 48 | 0.636364 |
ace95e78ffe24e7909528c9e784e49039bbb59ab | 6,392 | py | Python | mongodb/mongodb_consistent_backup/official/mongodb_consistent_backup/Oplog/Resolver/Resolver.py | smthkissinger/docker-images | 35e868295d04fa780325ada4168381f1e80e8fe4 | [
"BSD-3-Clause"
] | 63 | 2018-02-04T03:31:22.000Z | 2022-03-07T08:27:39.000Z | mongodb/mongodb_consistent_backup/official/mongodb_consistent_backup/Oplog/Resolver/Resolver.py | smthkissinger/docker-images | 35e868295d04fa780325ada4168381f1e80e8fe4 | [
"BSD-3-Clause"
] | 3 | 2020-06-15T03:41:03.000Z | 2020-06-15T03:41:04.000Z | mongodb/mongodb_consistent_backup/official/mongodb_consistent_backup/Oplog/Resolver/Resolver.py | smthkissinger/docker-images | 35e868295d04fa780325ada4168381f1e80e8fe4 | [
"BSD-3-Clause"
] | 40 | 2018-01-22T16:31:16.000Z | 2022-03-08T04:40:42.000Z | import logging
# Skip bson in requirements , pymongo provides
# noinspection PyPackageRequirements
from bson.timestamp import Timestamp
from copy_reg import pickle
from multiprocessing import Pool, TimeoutError
from types import MethodType
from ResolverThread import ResolverThread
from mongodb_consistent_backup.Commo... | 41.777778 | 137 | 0.581352 |
c57b6c6bdb9afcc1a0e63e4dc3840a48535ced6b | 364 | pyde | Python | sketches/sillyballs/sillyballs.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 4 | 2018-06-03T02:11:46.000Z | 2021-08-18T19:55:15.000Z | sketches/sillyballs/sillyballs.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | null | null | null | sketches/sillyballs/sillyballs.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 3 | 2019-12-23T19:12:51.000Z | 2021-04-30T14:00:31.000Z | def setup():
size(400, 300)
frameRate(20)
background(255)
noStroke()
def draw():
xPos = random(width)
yPos = random(height)
groesse = random(10, 50)
rot = random(255)
gruen = random(255)
blau = random(255)
a = random(255)
fill(color(rot, gruen, blau, a))
ellipse(xPos... | 20.222222 | 41 | 0.563187 |
96f9ad7a47e6a452c52417b734b7bf558410e851 | 372 | py | Python | book/translation/deu/book/website/scripts/clean.py | AndreaSanchezTapia/the-turing-way | fe3e1a8ad36f9086edb4f36ec8e398f253fd8e0f | [
"CC-BY-4.0"
] | 1 | 2021-11-09T20:43:06.000Z | 2021-11-09T20:43:06.000Z | book/translation/deu/book/website/scripts/clean.py | AndreaSanchezTapia/the-turing-way | fe3e1a8ad36f9086edb4f36ec8e398f253fd8e0f | [
"CC-BY-4.0"
] | null | null | null | book/translation/deu/book/website/scripts/clean.py | AndreaSanchezTapia/the-turing-way | fe3e1a8ad36f9086edb4f36ec8e398f253fd8e0f | [
"CC-BY-4.0"
] | 2 | 2021-12-21T17:35:45.000Z | 2021-12-21T20:43:01.000Z | """Ein Helferskript zum "Bereinigen" all Ihrer generierten Markdown und HTML-Dateien."""
Shutil als sh importieren
von pathlib-Importpfad
path_root = Pfad(__file__).parent.parent
paths = [path_root.joinpath('_site'),
path_root.joinpath('_build')]
für Pfad in Pfaden:
print(f'Entferne {path}...')
sh.rm... | 26.571429 | 88 | 0.725806 |
4fd259b15a984a47c1b8fe8bb76f4b55d3bce871 | 1,134 | py | Python | exercises/python/data-types/basic/list-commands-interpreter.py | rogeriosantosf/hacker-rank-profile | d4b9c131524d138c415e5c5de4e38c6b8c35dd77 | [
"MIT"
] | null | null | null | exercises/python/data-types/basic/list-commands-interpreter.py | rogeriosantosf/hacker-rank-profile | d4b9c131524d138c415e5c5de4e38c6b8c35dd77 | [
"MIT"
] | null | null | null | exercises/python/data-types/basic/list-commands-interpreter.py | rogeriosantosf/hacker-rank-profile | d4b9c131524d138c415e5c5de4e38c6b8c35dd77 | [
"MIT"
] | null | null | null | # Sample Input 0
# 12
# insert 0 5
# insert 1 10
# insert 0 6
# print
# remove 6
# append 9
# append 1
# sort
# print
# pop
# reverse
# print
# Sample Output 0
# [6, 5, 10]
# [1, 5, 9, 10]
# [9, 5, 1]
class Command():
def __init__(self, command_type, arguments_number):
self.command_type = command_type
... | 20.25 | 55 | 0.626102 |
8b2d311fe527ee99d98819617e41e85be9e209a9 | 684 | py | Python | 2-resources/__DATA-Structures/Data-Structures-Algos-Codebase-master/ALGO/__PYTHON/sun_finder.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 2-resources/__DATA-Structures/Data-Structures-Algos-Codebase-master/ALGO/__PYTHON/sun_finder.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 2-resources/__DATA-Structures/Data-Structures-Algos-Codebase-master/ALGO/__PYTHON/sun_finder.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | # def twoSum(arr,n,target):
# for i in range(n):
# for j in range(1,n):
# result=arr[i]+arr[j]
# if result==target:
# print("["+str(i)+","+str(j)+"]")
# arr=[2,7,11,15]
# twoSum(arr,len(arr),9)
class Solution:
# def __init__(self,arr,n,target):
# self.... | 23.586207 | 52 | 0.47807 |
8b46a28af5284f87ce333d66c8ecc5efa1dd94d2 | 902 | py | Python | src/venn-diagrams/venn.py | Ellon-M/visualizations | 5a42c213ea8fd0597e2035778d9ae6460eb9e821 | [
"MIT"
] | null | null | null | src/venn-diagrams/venn.py | Ellon-M/visualizations | 5a42c213ea8fd0597e2035778d9ae6460eb9e821 | [
"MIT"
] | null | null | null | src/venn-diagrams/venn.py | Ellon-M/visualizations | 5a42c213ea8fd0597e2035778d9ae6460eb9e821 | [
"MIT"
] | null | null | null | # venn
import plotly.graph_objects as go
fig = go.Figure()
# Create scatter trace of text labels
fig.add_trace(go.Scatter(
x=[1, 1.75, 2.5],
y=[1, 1, 1],
text=["$A$", "$A+B$", "$B$"],
mode="text",
textfont=dict(
color="black",
size=18,
family="Arail",
)
))
# Update ax... | 17.686275 | 50 | 0.611973 |
50ba32bc8c4a1555b6b6c3e30c097f48954a5d8f | 339 | py | Python | Python/examples/tkinter.py | bunny8469/Hello-World | 722b5961cbcd9b2c2eec2cb6aa700eaa451e008b | [
"MIT"
] | 133 | 2021-01-15T16:29:40.000Z | 2022-03-21T16:35:42.000Z | Python/examples/tkinter.py | bunny8469/Hello-World | 722b5961cbcd9b2c2eec2cb6aa700eaa451e008b | [
"MIT"
] | 117 | 2021-01-17T08:54:22.000Z | 2022-01-17T16:38:11.000Z | Python/examples/tkinter.py | bunny8469/Hello-World | 722b5961cbcd9b2c2eec2cb6aa700eaa451e008b | [
"MIT"
] | 146 | 2021-01-15T12:57:19.000Z | 2022-03-15T20:10:23.000Z | from tkinter import *
root = Tk()
root.title("My Program")
root.geometry('200x300')
def function():
pass
lbl_show_hello = Label(
root,
text = "Hello, World!",
bg = 'red',
rg = 'black'
).pack() # you can use grid to have indexable page
btn = Button(
root,
text = "Click Me!"
command = function
).pack(... | 14.125 | 50 | 0.634218 |
50cadc56ef55e6145dda9e9055e6ef2daa1cc5f1 | 2,765 | py | Python | test/test_npu/test_network_ops/test_triu.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-12-02T03:07:35.000Z | 2021-12-02T03:07:35.000Z | test/test_npu/test_network_ops/test_triu.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-11-12T07:23:03.000Z | 2021-11-12T08:28:13.000Z | test/test_npu/test_network_ops/test_triu.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2020 Huawei Technologies Co., Ltd
# Copyright (c) 2019, Facebook CORPORATION.
# All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://opensource.org/lice... | 35 | 82 | 0.659675 |
0fa69f47df0cd44437bcd05e72980f9c697efe65 | 1,099 | py | Python | components/amp-utility/python/usocket.py | ekmixon/AliOS-Things | 00334295af8aa474d818724149726ca93da4645d | [
"Apache-2.0"
] | 4,538 | 2017-10-20T05:19:03.000Z | 2022-03-30T02:29:30.000Z | components/amp-utility/python/usocket.py | ekmixon/AliOS-Things | 00334295af8aa474d818724149726ca93da4645d | [
"Apache-2.0"
] | 1,088 | 2017-10-21T07:57:22.000Z | 2022-03-31T08:15:49.000Z | components/amp-utility/python/usocket.py | willianchanlovegithub/AliOS-Things | 637c0802cab667b872d3b97a121e18c66f256eab | [
"Apache-2.0"
] | 1,860 | 2017-10-20T05:22:35.000Z | 2022-03-27T10:54:14.000Z | # -*- coding: UTF-8 -*-
"""
模块功能:提供socket server和client相关的接口
"""
AF_INET = 0
AF_INET6 = 1
SOCK_STREAM = 2
SOCK_DGRAM = 3
SOCK_RAW = 4
class socket(object):
"""
初始化socket类,获取socket实例
:param 空:
:returns: client对象
"""
def __init__(self,af=AF_INET):
"""
param af(... | 12.929412 | 45 | 0.505914 |
fa311eedb6e77c07514024af3b81548f876a4bae | 1,267 | py | Python | SBTK_League_Helper/src/interfacing/players.py | juanchodepisa/sbtk | 7cba7748e75a02b491e551d6c1be9bd7987c5051 | [
"MIT"
] | null | null | null | SBTK_League_Helper/src/interfacing/players.py | juanchodepisa/sbtk | 7cba7748e75a02b491e551d6c1be9bd7987c5051 | [
"MIT"
] | null | null | null | SBTK_League_Helper/src/interfacing/players.py | juanchodepisa/sbtk | 7cba7748e75a02b491e551d6c1be9bd7987c5051 | [
"MIT"
] | null | null | null | from src import application_timeformat
from datetime import datetime
from .abstract import ServerElement
class Player (ServerElement):
# ABSTRACT OVERRIDES:
def to_builtin(self):
d = self.data.copy()
try:
d['registration_date'] = d['registration_date'].strftime(application_ti... | 30.166667 | 108 | 0.592739 |
ad2e5fe1844a19051f2069ae2fece093457acc26 | 292 | py | Python | inn_checker/inn_check/admin.py | bmu0/inn_checker | 3c5f736c179af5c3a4bb80a5c403aee0969ea5e9 | [
"MIT"
] | null | null | null | inn_checker/inn_check/admin.py | bmu0/inn_checker | 3c5f736c179af5c3a4bb80a5c403aee0969ea5e9 | [
"MIT"
] | null | null | null | inn_checker/inn_check/admin.py | bmu0/inn_checker | 3c5f736c179af5c3a4bb80a5c403aee0969ea5e9 | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import INNModel
@admin.register(INNModel)
class INNModelAdmin(admin.ModelAdmin):
list_display = ('pk', 'pub_date', 'INN', 'is_correct', 'IP')
search_fields = ('INN',)
list_filter = ('pub_date',)
empty_value_display = '-пусто-'
| 24.333333 | 64 | 0.691781 |
7e23ba42e6d6446486869dd3fc8d123eee57e60f | 1,397 | py | Python | aoc2020/day_21/part_2.py | en0/aoc2020 | a2f41b909dffe1f366682b3d03fd5fbdbc924ec0 | [
"MIT"
] | null | null | null | aoc2020/day_21/part_2.py | en0/aoc2020 | a2f41b909dffe1f366682b3d03fd5fbdbc924ec0 | [
"MIT"
] | null | null | null | aoc2020/day_21/part_2.py | en0/aoc2020 | a2f41b909dffe1f366682b3d03fd5fbdbc924ec0 | [
"MIT"
] | null | null | null | from functools import reduce
from aoc2020 import *
from collections import deque
class Solution(SolutionABC):
expected = "mxmxvkd,sqjhc,fvjkl"
@classmethod
def parse_food(cls, line):
ing, alr = line.split(" (contains ")
ing = ing.split(" ")
alr = alr.rstrip(")").split(", ")
... | 29.723404 | 82 | 0.49821 |
7e34818517e5187456fbf91e1fc7bbe8a6c46998 | 1,035 | py | Python | chemist/chemist/pipelines.py | ChineseGardenCat/chemist_crawler | 28fdf1e93c38cddc5f8b16e7098a60e2a51b1a7a | [
"MIT"
] | null | null | null | chemist/chemist/pipelines.py | ChineseGardenCat/chemist_crawler | 28fdf1e93c38cddc5f8b16e7098a60e2a51b1a7a | [
"MIT"
] | null | null | null | chemist/chemist/pipelines.py | ChineseGardenCat/chemist_crawler | 28fdf1e93c38cddc5f8b16e7098a60e2a51b1a7a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: https://doc.scrapy.org/en/latest/topics/item-pipeline.html
import firebase_admin
from firebase_admin import credentials
from firebase_admin import firestore
cred = credentials.Applicat... | 29.571429 | 130 | 0.659903 |
7ebc2c86574fe3fd6deb0837496cbbcf621977dc | 13,143 | py | Python | files/meas/Experiment_12/Exp12_Simulation.py | mimeiners/ans | 382e000e687d5ec0c80a84223087e60ed656a1dd | [
"MIT"
] | null | null | null | files/meas/Experiment_12/Exp12_Simulation.py | mimeiners/ans | 382e000e687d5ec0c80a84223087e60ed656a1dd | [
"MIT"
] | null | null | null | files/meas/Experiment_12/Exp12_Simulation.py | mimeiners/ans | 382e000e687d5ec0c80a84223087e60ed656a1dd | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Thu Apr 9 18:28:54 2020
@author: Timo Stelter,
Patrice Bönig,
Jan Dröst
"""
import numpy as np
import pandas as pd
from scipy import signal
import matplotlib.pyplot as plt
import os
plt.rcParams.update({'font.size':22})
plt.close("all")
os.chdir("./")
... | 30.006849 | 115 | 0.685764 |
adaeb4d3ddcc4a4b30178c4170d8524981c3863e | 111 | py | Python | Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-009.02-tuple/ph-9.24-tuple-immutabel.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-009.02-tuple/ph-9.24-tuple-immutabel.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-009.02-tuple/ph-9.24-tuple-immutabel.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | li = [1, 2, 3]
print("li =", li)
li[0] = 5
print("li =", li)
tpl = (1, 2, 3)
print("tpl =", tpl)
tpl[0] = 5
| 10.090909 | 19 | 0.441441 |
bc153d08f3e2b3811f4d94393ab2cb77e7f3f501 | 664 | py | Python | python/overload/using_decorator.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/overload/using_decorator.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/overload/using_decorator.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | import time
def my_decorator(fn):
"""my_decorator is a custom decorator that wraps any function
and prints on stdout the time for execution.
"""
def wrapper_function(*args, **kwargs):
start_time = time.time()
# invoking the wrapped function and getting the return value
value =... | 23.714286 | 82 | 0.653614 |
93638ab6b2a7e8e5db48497e2c7a862f1c23475b | 4,077 | py | Python | sources/Presentations/GPUComputingLviv/SpeedUpYourLanguageWithCUDA/examples/PyCUDA/matrixMul.py | dmuh/istuff | 5469a0db9cfca1112c1b12252baaeff8c6e4c2fd | [
"MIT"
] | null | null | null | sources/Presentations/GPUComputingLviv/SpeedUpYourLanguageWithCUDA/examples/PyCUDA/matrixMul.py | dmuh/istuff | 5469a0db9cfca1112c1b12252baaeff8c6e4c2fd | [
"MIT"
] | null | null | null | sources/Presentations/GPUComputingLviv/SpeedUpYourLanguageWithCUDA/examples/PyCUDA/matrixMul.py | dmuh/istuff | 5469a0db9cfca1112c1b12252baaeff8c6e4c2fd | [
"MIT"
] | null | null | null | import pycuda.driver as cuda
import pycuda.autoinit
from pycuda.compiler import SourceModule
import pycuda.gpuarray as gpuarray
import numpy as np
from jinja2 import Template
start, end = cuda.Event(), cuda.Event()
matrixWidth = 640
matrixSize = matrixWidth*matrixWidth
matrixA = np.full(matrixSize, 1.0, dtype=np.float... | 27.924658 | 105 | 0.654403 |
87c39f4f5febf0c6e72b4e14c8d55b3511655526 | 1,702 | py | Python | nz_django/day5/csv_demo/csv_demo/views.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | null | null | null | nz_django/day5/csv_demo/csv_demo/views.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 27 | 2020-02-12T07:55:58.000Z | 2022-03-12T00:19:09.000Z | nz_django/day5/csv_demo/csv_demo/views.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 2 | 2020-02-18T01:54:55.000Z | 2020-02-21T11:36:28.000Z | from django.http import HttpResponse,StreamingHttpResponse
from django.template import loader
import csv
def index(request):
#第一步 告诉浏览器这是一个csv文件 不再是html文件
response = HttpResponse(content_type='text/csv')
# response.content = '我是返回给浏览器的内容'
# response.write('我写到content中')
#也就是告诉浏览器这是个附件 可以点击就会下载
... | 37 | 74 | 0.685076 |
ea1c2a2f675115a68d5cd147e4050093e58d4f1b | 1,685 | py | Python | gene/tpl.py | East196/hello-py | a77c7a0c8e5e2b5e8cefaf0fda335ab0c3b1da21 | [
"Apache-2.0"
] | 1 | 2017-10-23T14:58:47.000Z | 2017-10-23T14:58:47.000Z | gene/tpl.py | East196/hello-py | a77c7a0c8e5e2b5e8cefaf0fda335ab0c3b1da21 | [
"Apache-2.0"
] | null | null | null | gene/tpl.py | East196/hello-py | a77c7a0c8e5e2b5e8cefaf0fda335ab0c3b1da21 | [
"Apache-2.0"
] | 1 | 2018-04-06T07:49:18.000Z | 2018-04-06T07:49:18.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from tinydb import TinyDB, Query
# init db
db = TinyDB('gene.json')
# init table
tpls = db.table('tpl')
Tpl= Query()
from appJar import gui
# init gui
app = gui()
app.startLabelFrame("模版")
def edit(btn):
print(("edit: %s" % btn, app.getListBox(btn)))
if not a... | 15.601852 | 70 | 0.550148 |
57b77160f9d63101e128d74d87e55629cd1cfadc | 1,330 | py | Python | bets/urls.py | Thames1990/BadBatBets | 8dffb69561668b8991bf4103919e4b254d4ca56a | [
"MIT"
] | null | null | null | bets/urls.py | Thames1990/BadBatBets | 8dffb69561668b8991bf4103919e4b254d4ca56a | [
"MIT"
] | null | null | null | bets/urls.py | Thames1990/BadBatBets | 8dffb69561668b8991bf4103919e4b254d4ca56a | [
"MIT"
] | null | null | null | from django.conf.urls import url
from . import views
app_name = 'bets'
urlpatterns = [
# Bet page
url(
r'^(?P<prim_key>[0-9]+)/$',
views.bet_view,
name='bet'
),
# Place a bet
url(
r'^(?P<prim_key>[0-9]+)/bet$',
views.place_bet,
name='place_bet'
... | 18.732394 | 43 | 0.509774 |
17d5f5d55890387e7c7a4c409a97c881665bf8af | 1,282 | py | Python | ProjectEuler_plus/euler_035.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | ProjectEuler_plus/euler_035.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | ProjectEuler_plus/euler_035.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
from math import sqrt
def is_prime(n):
if n == 2:
return True
if not n & 1:
return False
return pow(n - 2, n - 1, n) == 1
def prime_sieve(sieveSize):
# Returns a list of prime numbers calculated using
# the Sieve of Eratosthenes algorithm.
si... | 21.728814 | 58 | 0.563183 |
aa47bebdef72551dd79aacc32a7253c234f7916b | 139 | py | Python | etl/transforms/primitives/row/__init__.py | cloud-cds/cds-stack | d68a1654d4f604369a071f784cdb5c42fc855d6e | [
"Apache-2.0"
] | 6 | 2018-06-27T00:09:55.000Z | 2019-03-07T14:06:53.000Z | etl/transforms/primitives/row/__init__.py | cloud-cds/cds-stack | d68a1654d4f604369a071f784cdb5c42fc855d6e | [
"Apache-2.0"
] | 3 | 2021-03-31T18:37:46.000Z | 2021-06-01T21:49:41.000Z | etl/transforms/primitives/row/__init__.py | cloud-cds/cds-stack | d68a1654d4f604369a071f784cdb5c42fc855d6e | [
"Apache-2.0"
] | 3 | 2020-01-24T16:40:49.000Z | 2021-09-30T02:28:55.000Z | # from etl.transforms.primitives.load_discharge_json import *
# from convert_salmeterol_dose import *
# from convert_gender_to_int import * | 46.333333 | 61 | 0.834532 |
d816eb80e31ecef08d3f1e23d17d8575ae675dfc | 2,870 | py | Python | gpt3/01-engines.py | sixvo-labs/Sapir | 07ba6fe1c83e2d5fbf139f1601a28df6b6740483 | [
"MIT"
] | null | null | null | gpt3/01-engines.py | sixvo-labs/Sapir | 07ba6fe1c83e2d5fbf139f1601a28df6b6740483 | [
"MIT"
] | null | null | null | gpt3/01-engines.py | sixvo-labs/Sapir | 07ba6fe1c83e2d5fbf139f1601a28df6b6740483 | [
"MIT"
] | null | null | null | #engines.py
"""
Q&A
engine="text-davinci-001",
"""
"""
Grammar correction
engine="text-davinci-001",
"""
"""
Summarize for a 2nd grader
engine="text-davinci-001",
"""
"""
Natural language to OpenAI API
engine="code-davinci-001",
"""
"""
Text to command
engine="text-davinci-001",
"""
"""
English to other lang... | 14.207921 | 37 | 0.653659 |
f4dfb8c932703a4c6095d386086aa65d23eaa51e | 1,809 | py | Python | GUI/compiler.py | DrBumm/Minibyte-Engine | 833bf00ff86603419476c8755f551c0f6b4ac86b | [
"Unlicense"
] | 4 | 2019-08-16T20:48:33.000Z | 2021-05-23T20:10:08.000Z | GUI/compiler.py | DrBumm/Minibyte-Engine | 833bf00ff86603419476c8755f551c0f6b4ac86b | [
"Unlicense"
] | 16 | 2019-08-21T19:06:15.000Z | 2020-06-02T11:31:32.000Z | GUI/compiler.py | DrBumm/Minibyte-Engine | 833bf00ff86603419476c8755f551c0f6b4ac86b | [
"Unlicense"
] | null | null | null | import os
from tkinter import *
from shutil import *
def compiler(self):
def save_info(map, author, map_name, self):
game_name = map.get()
author = author.get()
map_name = map_name.get()
compile_(game_name, author, map_name)
screen.destroy()
screen = Tk()
... | 32.303571 | 159 | 0.608624 |
0ddc5766dcd4ecb0c1140157190a655cbc3d48f3 | 21,966 | py | Python | hihope_neptune-oh_hid/00_src/v0.1/test/xdevice/src/xdevice/_core/environment/device_lite.py | dawmlight/vendor_oh_fun | bc9fb50920f06cd4c27399f60076f5793043c77d | [
"Apache-2.0"
] | 1 | 2022-02-15T08:51:55.000Z | 2022-02-15T08:51:55.000Z | hihope_neptune-oh_hid/00_src/v0.3/test/xdevice/src/xdevice/_core/environment/device_lite.py | dawmlight/vendor_oh_fun | bc9fb50920f06cd4c27399f60076f5793043c77d | [
"Apache-2.0"
] | null | null | null | hihope_neptune-oh_hid/00_src/v0.3/test/xdevice/src/xdevice/_core/environment/device_lite.py | dawmlight/vendor_oh_fun | bc9fb50920f06cd4c27399f60076f5793043c77d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# coding=utf-8
#
# Copyright (c) 2020-2021 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#... | 36.307438 | 79 | 0.555722 |
33c799e5c8df646c357051d327d9bb69a9e6d587 | 869 | py | Python | lego/calculus/nodes/constant.py | tipptop3d/Horst-oder-Klaus | 2afda1a64b5ccace74ebc7b806a5e5501c0f12bb | [
"MIT"
] | null | null | null | lego/calculus/nodes/constant.py | tipptop3d/Horst-oder-Klaus | 2afda1a64b5ccace74ebc7b806a5e5501c0f12bb | [
"MIT"
] | null | null | null | lego/calculus/nodes/constant.py | tipptop3d/Horst-oder-Klaus | 2afda1a64b5ccace74ebc7b806a5e5501c0f12bb | [
"MIT"
] | null | null | null | """Constant node"""
import math
from ..exception import UnknownConstant
from . import node, number
class Constant(node.Node):
"""Constant node. Multiton. Looks up the math module"""
_instances = dict()
def __new__(cls, name):
if name in cls._instances:
return cls._instances[name]
... | 21.195122 | 77 | 0.586881 |
33e937f3bdf6938383943f6522d43dac8cdebf97 | 2,733 | py | Python | src/pepper_ddpg_model_runner.py | Cibah/Pepper_RL | a105aead34c74ac8c49fa058ee1613f578bcde41 | [
"MIT"
] | null | null | null | src/pepper_ddpg_model_runner.py | Cibah/Pepper_RL | a105aead34c74ac8c49fa058ee1613f578bcde41 | [
"MIT"
] | null | null | null | src/pepper_ddpg_model_runner.py | Cibah/Pepper_RL | a105aead34c74ac8c49fa058ee1613f578bcde41 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
'''
Ausführen eines trainierten Models
'''
import glob
import tensorflow as tf
import numpy as np
from ddpg.ddpg import getReward, ActorNetwork, \
OrnsteinUhlenbeckActionNoise
from src.Pepper import Pepper
from src.BallTracker import ballTracker
from src.Pepper.Pepper import readAngle
from ... | 31.413793 | 117 | 0.585071 |
7f2bee2d3d652d1dc453fac42afb9171d2e730a3 | 916 | py | Python | PINp/2014/Chernov_M_S/task_4_27.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | PINp/2014/Chernov_M_S/task_4_27.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | PINp/2014/Chernov_M_S/task_4_27.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | # Задание 4. Вариант 27.
# Напишите программу, которая выводит имя, под которым скрывается Доменико
# Теотокопули. Дополнительно необходимо вывести область интересов указанной
# личности, место рождения, годы рождения и смерти (если человек умер), вычислить
# возраст на данный момент (или момент смерти). Для хранения в... | 45.8 | 105 | 0.778384 |
1019affe876f5ddefea0eb42bfe6c68dcccd00b1 | 1,745 | py | Python | display/_general_menu_view.py | ihrigb/stagebuzzer | dbce1c5fa59a6f22e74d84ccc96d4d1a28a5b680 | [
"Apache-2.0"
] | null | null | null | display/_general_menu_view.py | ihrigb/stagebuzzer | dbce1c5fa59a6f22e74d84ccc96d4d1a28a5b680 | [
"Apache-2.0"
] | null | null | null | display/_general_menu_view.py | ihrigb/stagebuzzer | dbce1c5fa59a6f22e74d84ccc96d4d1a28a5b680 | [
"Apache-2.0"
] | null | null | null | from ._button_lights import ButtonLights
from ._view import View
from ._display import Display
from config import GeneralConfig
general_menu_view_name = "general_menu_view"
class GeneralMenuView(View):
_edit_mode = False
def __init__(self, button_lights: ButtonLights, general_config: GeneralConfig):
... | 26.846154 | 88 | 0.605158 |
122621fb346426bde1492a27cde9e0a3a348a9cc | 2,456 | py | Python | tests/etl/epic2op/predictor_server_long.py | cloud-cds/cds-stack | d68a1654d4f604369a071f784cdb5c42fc855d6e | [
"Apache-2.0"
] | 6 | 2018-06-27T00:09:55.000Z | 2019-03-07T14:06:53.000Z | tests/etl/epic2op/predictor_server_long.py | cloud-cds/cds-stack | d68a1654d4f604369a071f784cdb5c42fc855d6e | [
"Apache-2.0"
] | 3 | 2021-03-31T18:37:46.000Z | 2021-06-01T21:49:41.000Z | tests/etl/epic2op/predictor_server_long.py | cloud-cds/cds-stack | d68a1654d4f604369a071f784cdb5c42fc855d6e | [
"Apache-2.0"
] | 3 | 2020-01-24T16:40:49.000Z | 2021-09-30T02:28:55.000Z | import asyncio
import logging
import os
import json
import etl.io_config.server_protocol as protocol
alert_dns = '127.0.0.1'
predictor_dns = '0.0.0.0'
SRV_LOG_FMT = '%(asctime)s|%(name)s|%(process)s-%(thread)s|%(levelname)s|%(message)s'
logging.basicConfig(level=logging.INFO, format=SRV_LOG_FMT)
async def start_pre... | 26.408602 | 106 | 0.680782 |
4eece4132327213a32702aa23e393b0b3b1844cb | 3,776 | py | Python | src/service/DatasetService.py | dreaming-coder/RadarSet | c912298d0d6058c6647986524e5d95a205b51c1d | [
"MIT"
] | null | null | null | src/service/DatasetService.py | dreaming-coder/RadarSet | c912298d0d6058c6647986524e5d95a205b51c1d | [
"MIT"
] | null | null | null | src/service/DatasetService.py | dreaming-coder/RadarSet | c912298d0d6058c6647986524e5d95a205b51c1d | [
"MIT"
] | null | null | null | import os
import shutil
from collections import deque
from datetime import datetime
from pathlib import Path
from typing import List
from settings import preprocess_dir, mask_dir, data_dir
from type import PathLike
from utils.io.XLoader import get_rainy_days
import numpy as np
from numpy import ndarray
from src.log im... | 29.046154 | 96 | 0.635064 |
f66a943256f457d7c28151c9f0f9a31be82719be | 11,293 | py | Python | tests/onegov/org/test_cronjobs.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/org/test_cronjobs.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/org/test_cronjobs.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | import transaction
from datetime import datetime
from freezegun import freeze_time
from onegov.core.utils import Bunch
from onegov.org.models.resource import RoomResource
from onegov.ticket import Handler, Ticket, TicketCollection
from onegov.user import UserCollection
from onegov.newsletter import NewsletterCollectio... | 30.276139 | 77 | 0.633755 |
9ccfe78a1b8ff41a2181f95000b04d3b719a0daa | 2,860 | py | Python | collocations_surface.py | melandresen/DHd2020 | 62a53be823364dd3360e377d569e706ffeb738f9 | [
"Apache-2.0"
] | null | null | null | collocations_surface.py | melandresen/DHd2020 | 62a53be823364dd3360e377d569e706ffeb738f9 | [
"Apache-2.0"
] | null | null | null | collocations_surface.py | melandresen/DHd2020 | 62a53be823364dd3360e377d569e706ffeb738f9 | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# Python 3.7
# Author: Melanie Andresen (melanie.andresen@uni-hamburg.de)
# written in the context of the research project hermA (www.herma.uni-hamburg.de)
# funded by Landesforschungsförderung Hamburg
#####################################################################... | 32.5 | 93 | 0.631469 |
145ba9a48a452fcf331b174e80cd4d366d0b53d7 | 963 | py | Python | sdss/scripts/fits_getTypes.py | zhewang/rdm | b2c00c5db6ee4861c1b7214e3a63b630be30bb31 | [
"Apache-2.0"
] | null | null | null | sdss/scripts/fits_getTypes.py | zhewang/rdm | b2c00c5db6ee4861c1b7214e3a63b630be30bb31 | [
"Apache-2.0"
] | null | null | null | sdss/scripts/fits_getTypes.py | zhewang/rdm | b2c00c5db6ee4861c1b7214e3a63b630be30bb31 | [
"Apache-2.0"
] | null | null | null | import argparse
import csv
import itertools
import struct
import sys
from astropy.io import fits
def set2dict(s):
s = sorted(list(s))
m = {}
for i, e in enumerate(s):
m[e] = i
return m
def body(filepath):
f = fits.open(filepath)
rowCounts = f[1].data.shape[0]
set1 = set()
set2 ... | 23.487805 | 102 | 0.627207 |
14bfd614e84e26efa634234d99f539c9e5779cdb | 1,658 | py | Python | Interview Preparation Kits/Interview Preparation Kit/Dynamic Programming/Decibinary Numbers/decibinary_numbers.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | 1 | 2021-02-22T17:37:45.000Z | 2021-02-22T17:37:45.000Z | Interview Preparation Kits/Interview Preparation Kit/Dynamic Programming/Decibinary Numbers/decibinary_numbers.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | null | null | null | Interview Preparation Kits/Interview Preparation Kit/Dynamic Programming/Decibinary Numbers/decibinary_numbers.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | null | null | null | #!/bin/python3
import math
import os
import random
import re
import sys
import bisect
# Complete the decibinaryNumbers function below.
# def db_to_dec(x):
# ans = 0
# power = 1
# while x:
# rest = x % 10
# ans += power * rest
# power *= 2
# x = x//10
# return ans
MAX =... | 21.532468 | 64 | 0.522316 |
2587212056c4ab1905a3555ab9958138e7b11a2c | 4,441 | py | Python | Packs/AnsibleCiscoIOS/Integrations/AnsibleCiscoIOS/AnsibleCiscoIOS.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/AnsibleCiscoIOS/Integrations/AnsibleCiscoIOS/AnsibleCiscoIOS.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/AnsibleCiscoIOS/Integrations/AnsibleCiscoIOS/AnsibleCiscoIOS.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import traceback
import ssh_agent_setup
import demistomock as demisto # noqa: F401
from CommonServerPython import * # noqa: F401
# Import Generated code
from AnsibleApiModule import * # noqa: E402
host_type = 'ios'
# MAIN FUNCTION
def main() -> None:
"""main function, parses params and runs command function... | 45.783505 | 107 | 0.659311 |
d307f3849bd08ed92df504d552efbc3a1f4b38c5 | 6,121 | py | Python | src/generate-statistics.py | Haus4/studienarbeit-stau | 10921f8850df67c797cf174b42fbc5dcec257251 | [
"MIT"
] | 2 | 2018-10-16T08:09:13.000Z | 2019-02-18T13:33:11.000Z | src/generate-statistics.py | Haus4/studienarbeit-stau | 10921f8850df67c797cf174b42fbc5dcec257251 | [
"MIT"
] | 7 | 2019-02-28T18:10:44.000Z | 2019-03-04T21:09:03.000Z | src/generate-statistics.py | Haus4/studienarbeit-stau | 10921f8850df67c797cf174b42fbc5dcec257251 | [
"MIT"
] | 1 | 2020-04-05T08:53:13.000Z | 2020-04-05T08:53:13.000Z | import os
import cv2
import json
import time
import email.utils as eut
from threading import Lock
import return_thread
import process_null
import process_bgs
import process_luminocity
import process_haar
import process_canny
# --- CONFIGURE HERE-------
skipImages = 5 # Images to skip from evaluation to train the pr... | 27.204444 | 192 | 0.60709 |
6cd6cf0e48a7005f42043f1ef155631a9c6d59b0 | 316 | py | Python | accounts/models.py | JanakiRaman-2002/Arre-yaar | c0b44ca1f8884a09116241dcd0bf7cfcee3b785d | [
"Apache-2.0"
] | null | null | null | accounts/models.py | JanakiRaman-2002/Arre-yaar | c0b44ca1f8884a09116241dcd0bf7cfcee3b785d | [
"Apache-2.0"
] | null | null | null | accounts/models.py | JanakiRaman-2002/Arre-yaar | c0b44ca1f8884a09116241dcd0bf7cfcee3b785d | [
"Apache-2.0"
] | null | null | null | from django.db import models
from django.contrib.auth.models import User
class customer(models.Model):
user = models.OneToOneField("auth.User",on_delete=models.CASCADE)
address = models.TextField()
phone_no = models.CharField(max_length=10)
def __str__(self):
return str(self.user.username)
| 31.6 | 69 | 0.740506 |
4cb82d0d6b9d586125f1f74f1cc763f9bcaf4a53 | 2,455 | py | Python | Co-Simulation/Sumo/sumo-1.7.0/tools/sumolib/net/generator/corridor.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | 4 | 2020-11-13T02:35:56.000Z | 2021-03-29T20:15:54.000Z | sumolib/net/generator/corridor.py | KhalidHALBA-GR-NIST/UCEFSUMOV2V | 4eb7ac761303a171718a10e4131184746bded9fd | [
"MIT"
] | 9 | 2020-12-09T02:12:39.000Z | 2021-02-18T00:15:28.000Z | sumolib/net/generator/corridor.py | KhalidHALBA-GR-NIST/UCEFSUMOV2V | 4eb7ac761303a171718a10e4131184746bded9fd | [
"MIT"
] | 1 | 2020-11-20T19:31:26.000Z | 2020-11-20T19:31:26.000Z | #!/usr/bin/env python
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
# Copyright (C) 2013-2020 German Aerospace Center (DLR) and others.
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is available at
# https://www.ec... | 42.327586 | 107 | 0.633809 |
e2bbf4957aadf560312ff84d3a2a624e57d5c475 | 2,009 | py | Python | quant/markets/_huobi.py | doubleDragon/QuantBot | 53a1d6c62ecece47bf777da0c0754430b706b7fd | [
"MIT"
] | 7 | 2017-10-22T15:00:09.000Z | 2019-09-19T11:45:43.000Z | quant/markets/_huobi.py | doubleDragon/QuantBot | 53a1d6c62ecece47bf777da0c0754430b706b7fd | [
"MIT"
] | 1 | 2018-01-19T16:19:40.000Z | 2018-01-19T16:19:40.000Z | quant/markets/_huobi.py | doubleDragon/QuantBot | 53a1d6c62ecece47bf777da0c0754430b706b7fd | [
"MIT"
] | 5 | 2017-12-11T15:10:29.000Z | 2018-12-21T17:40:58.000Z | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
from .market import Market
from quant.api.huobi import PublicClient as Client
import market_util
class Huobi(Market):
def __init__(self, pair_code):
base_currency, market_currency = self.get_available_pairs(pair_code)
super(Huobi, self).__init__(base_... | 34.637931 | 85 | 0.582379 |
e2fcdfd70ad0ba4e52dd5dc278e25665936335d0 | 190 | py | Python | lbry/lbry/blob/__init__.py | mittalkartik2000/lbry-sdk | a07b17ec0c9c5d0a88bc730caf6ab955e0971b38 | [
"MIT"
] | null | null | null | lbry/lbry/blob/__init__.py | mittalkartik2000/lbry-sdk | a07b17ec0c9c5d0a88bc730caf6ab955e0971b38 | [
"MIT"
] | 4 | 2020-10-27T21:53:05.000Z | 2022-02-11T03:10:54.000Z | lbry/lbry/blob/__init__.py | braveheart12/lbry-sdk | dc709b468f9dce60d206161785def5c7ace2b763 | [
"MIT"
] | null | null | null | from lbry.cryptoutils import get_lbry_hash_obj
MAX_BLOB_SIZE = 2 * 2 ** 20
# digest_size is in bytes, and blob hashes are hex encoded
blobhash_length = get_lbry_hash_obj().digest_size * 2
| 27.142857 | 58 | 0.784211 |
3759d26b3332a4078a8231de1d3fe477e7999a6a | 165 | py | Python | Contests/German Nouns.py | MastaCoder/Projects | ebb0a3134522b12f052fec8d753005f384adf1b1 | [
"MIT"
] | 5 | 2018-10-11T01:55:40.000Z | 2021-12-25T23:38:22.000Z | Contests/German Nouns.py | MastaCoder/mini_projects | ebb0a3134522b12f052fec8d753005f384adf1b1 | [
"MIT"
] | null | null | null | Contests/German Nouns.py | MastaCoder/mini_projects | ebb0a3134522b12f052fec8d753005f384adf1b1 | [
"MIT"
] | 1 | 2019-02-22T14:42:50.000Z | 2019-02-22T14:42:50.000Z | a = int(input())
for z in range(a):
w = input().split(" ")
b = 0
for x in range(len(w)):
if w[x].lower() != w[x]:
b += 1
print(b) | 20.625 | 32 | 0.412121 |
375d675aefd3deacba66b2bcf5f25440d24f5abd | 391 | py | Python | src/bo4e/enum/ausschreibungsstatus.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 1 | 2022-03-02T12:49:44.000Z | 2022-03-02T12:49:44.000Z | src/bo4e/enum/ausschreibungsstatus.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 21 | 2022-02-04T07:38:46.000Z | 2022-03-28T14:01:53.000Z | src/bo4e/enum/ausschreibungsstatus.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | null | null | null | # pylint: disable=missing-module-docstring
from bo4e.enum.strenum import StrEnum
class Ausschreibungsstatus(StrEnum):
"""
Bezeichnungen für die Ausschreibungsphasen
"""
PHASE1 = "PHASE1" #: Phase1: Teilnahmewettbewerb
PHASE2 = "PHASE2" #: Phase2: Angebotsphase
PHASE3 = "PHASE3" #: Phase3: ... | 27.928571 | 53 | 0.70844 |
37a54a784693accc221eaca7f00e039d41badc88 | 80 | py | Python | SBTK_League_Helper/src/interfacing/ogs/utility.py | juanchodepisa/sbtk | 7cba7748e75a02b491e551d6c1be9bd7987c5051 | [
"MIT"
] | null | null | null | SBTK_League_Helper/src/interfacing/ogs/utility.py | juanchodepisa/sbtk | 7cba7748e75a02b491e551d6c1be9bd7987c5051 | [
"MIT"
] | null | null | null | SBTK_League_Helper/src/interfacing/ogs/utility.py | juanchodepisa/sbtk | 7cba7748e75a02b491e551d6c1be9bd7987c5051 | [
"MIT"
] | null | null | null | # TO DO:
# parser and unparser of OGS date strings into application wide format. | 40 | 71 | 0.775 |
45db3d8143c8b4608567e2baf1a8ae0997a6e223 | 1,603 | py | Python | setup.py | yaph/logya | 9647f58a0b8653b56ad64332e235a76cab3acda9 | [
"MIT"
] | 12 | 2015-03-04T03:23:56.000Z | 2020-11-17T08:09:17.000Z | setup.py | elaOnMars/logya | a9f256ac8840e21b348ac842b35683224e25b613 | [
"MIT"
] | 78 | 2015-01-05T11:40:41.000Z | 2022-01-23T21:05:39.000Z | setup.py | elaOnMars/logya | a9f256ac8840e21b348ac842b35683224e25b613 | [
"MIT"
] | 6 | 2015-04-20T06:58:42.000Z | 2022-01-31T00:36:29.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from pathlib import Path
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
from logya import __version__
setup(
name='logya',
version=__version__,
description='Logya: easy to use and flexible static site generator... | 30.826923 | 73 | 0.621335 |
7538b3379f81b3336b56937642f468e4689958df | 957 | py | Python | IdeaProjects/stock/stock_dev1/MA.py | sinomiko/project | 00fadb0033645f103692f5b06c861939a9d4aa0e | [
"BSD-3-Clause"
] | 1 | 2018-12-30T14:07:42.000Z | 2018-12-30T14:07:42.000Z | IdeaProjects/stock/stock_dev1/MA.py | sinomiko/project | 00fadb0033645f103692f5b06c861939a9d4aa0e | [
"BSD-3-Clause"
] | null | null | null | IdeaProjects/stock/stock_dev1/MA.py | sinomiko/project | 00fadb0033645f103692f5b06c861939a9d4aa0e | [
"BSD-3-Clause"
] | null | null | null | # 计算(MA)均线
# 方法一:最原始的手工计算,只用到了DataFrame,通过mean方法逐行计算多日平均数。
import numpy as np
import pandas as pd
from pandas import Series, DataFrame
# 获得上证指数日行情
df = DataAPI.MktIdxdGet(tradeDate=u"",indexID=u"",ticker=u"000001",beginDate=u"20140101",endDate=u"20160717",field=u"tradeDate,closeIndex",pandas="1")
# 添加5、10、20、60日均线值列,... | 29.90625 | 150 | 0.632184 |
f33f7d1b62787c7c13e2f17c237146afff88af70 | 357 | py | Python | diversos/exercicios.py | lcarlin/guppe | a0ee7b85e8687e8fb8243fbb509119a94bc6460f | [
"Apache-2.0"
] | 1 | 2021-12-18T15:29:24.000Z | 2021-12-18T15:29:24.000Z | diversos/exercicios.py | lcarlin/guppe | a0ee7b85e8687e8fb8243fbb509119a94bc6460f | [
"Apache-2.0"
] | null | null | null | diversos/exercicios.py | lcarlin/guppe | a0ee7b85e8687e8fb8243fbb509119a94bc6460f | [
"Apache-2.0"
] | 3 | 2021-08-23T22:45:20.000Z | 2022-02-17T13:17:09.000Z | # -*- coding: utf-8 -*-
"""
# Recebendo textos
meu_texto = input("Digite um texto: ")
# Recebendo números
numero_inteiro = int(input("Digite um numero inteiro: "))
numero_decimal = float(input("Digite um numero decimal: "))
"""
idade = int(input("Digite a idade :-> "))
if idade >= 18:
print ("Maior de idade ")
el... | 23.8 | 59 | 0.638655 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.