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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
069a8c756f8159366e8d14f1a2917fc100cc2bf1 | 810 | py | Python | hm/roomList.py | debauer/HomematicToInflux | 233a837f0da031f331d771f0e6f7b55f488cd747 | [
"MIT"
] | null | null | null | hm/roomList.py | debauer/HomematicToInflux | 233a837f0da031f331d771f0e6f7b55f488cd747 | [
"MIT"
] | null | null | null | hm/roomList.py | debauer/HomematicToInflux | 233a837f0da031f331d771f0e6f7b55f488cd747 | [
"MIT"
] | null | null | null | from hm import BaseList, Room
import xml.etree.ElementTree as ET
class RoomList(BaseList):
def __init__(self, xml):
BaseList.__init__(self, xml)
self.rooms = []
self.rebuild(xml)
def rebuild(self, xml):
self.rooms = []
xmlp = ET.XMLParser(encoding=self.encoding)
... | 26.129032 | 56 | 0.569136 |
0013b72bad2899bb5ab4e83fa215d861bae91864 | 886 | py | Python | back-end/src/analysis/outagePrefixAnalysis/run_query.py | akshah/iodb | 80fbad1cb639e2cad304d6565cf4918ee5b4e4c0 | [
"Apache-2.0"
] | null | null | null | back-end/src/analysis/outagePrefixAnalysis/run_query.py | akshah/iodb | 80fbad1cb639e2cad304d6565cf4918ee5b4e4c0 | [
"Apache-2.0"
] | null | null | null | back-end/src/analysis/outagePrefixAnalysis/run_query.py | akshah/iodb | 80fbad1cb639e2cad304d6565cf4918ee5b4e4c0 | [
"Apache-2.0"
] | null | null | null |
#!/usr/bin/python
from __future__ import print_function
from collections import defaultdict
from contextlib import closing
import pymysql
import re
import sys
import os
from os import listdir
from os.path import isfile, join
def run_query(db,query):
with closing( db.cursor() ) as cur:
try:
cur.execute(qu... | 23.945946 | 219 | 0.687359 |
001b34ca4d7eca656b15eb2c05440ab913b7042c | 2,685 | py | Python | Beginner/03. Python/Data Structures Implementation/doublyimp.py | ankita080208/Hacktoberfest | 2be849e89285260e7b6672f42979943ad6bbec78 | [
"MIT"
] | 3 | 2021-03-16T16:44:04.000Z | 2021-06-07T17:32:51.000Z | Beginner/03. Python/Data Structures Implementation/doublyimp.py | ankita080208/Hacktoberfest | 2be849e89285260e7b6672f42979943ad6bbec78 | [
"MIT"
] | null | null | null | Beginner/03. Python/Data Structures Implementation/doublyimp.py | ankita080208/Hacktoberfest | 2be849e89285260e7b6672f42979943ad6bbec78 | [
"MIT"
] | 1 | 2020-10-26T08:44:01.000Z | 2020-10-26T08:44:01.000Z | # Making a Node class to specify a blueprint for the node
class Node:
def __init__(self, value):
self.value = value
self.next = None
self.prev = None
self.node = {
'value': self.value,
'next': self.next,
'prev': self.prev
}
# defining Link... | 25.817308 | 57 | 0.524767 |
9dc2e57565276f83ca981420d7d3d36284de692f | 13,670 | py | Python | Packs/Indeni/Integrations/Indeni/Indeni.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/Indeni/Integrations/Indeni/Indeni.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/Indeni/Integrations/Indeni/Indeni.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | from CommonServerPython import *
''' IMPORTS '''
from typing import List
import json
import requests
# Disable insecure warnings
requests.packages.urllib3.disable_warnings()
''' GLOBALS/PARAMS '''
API_KEY = demisto.params().get('apikey')
# Remove trailing slash to prevent wrong URL path to serviceaa
SERVER = demisto... | 33.753086 | 122 | 0.616533 |
9dda643825d79a9c6238e4ecd03f837da9acb886 | 1,332 | py | Python | gridland-metro.py | kautuk-desai/HackerRank | 6c0b22800ea2e40d118d6a0a5c0ece067a0a69bf | [
"MIT"
] | null | null | null | gridland-metro.py | kautuk-desai/HackerRank | 6c0b22800ea2e40d118d6a0a5c0ece067a0a69bf | [
"MIT"
] | null | null | null | gridland-metro.py | kautuk-desai/HackerRank | 6c0b22800ea2e40d118d6a0a5c0ece067a0a69bf | [
"MIT"
] | null | null | null | #!/bin/python3
import sys
import operator
def gridlandMetro(n, m, k, track):
# Complete this function
possible_locs = n*m
start_idx = end_idx = skip_idx = 0
track_dict = dict()
track_arr = []
row_idx = 0
for ele in track:
track_dict = {}
row_idx = ele[0]*m
track_dic... | 27.183673 | 80 | 0.543544 |
ee18da2f0fc8dff3627859a2f0c21e38674efd0b | 525 | py | Python | src/conftest.py | guruvamsi-policharla/noisy-krotov | c5397d9dbde68d06f17e88620d6a6b2c74664841 | [
"BSD-3-Clause"
] | 49 | 2018-11-07T06:43:33.000Z | 2022-03-18T20:53:06.000Z | src/conftest.py | guruvamsi-policharla/noisy-krotov | c5397d9dbde68d06f17e88620d6a6b2c74664841 | [
"BSD-3-Clause"
] | 94 | 2018-11-06T20:15:04.000Z | 2022-01-06T09:06:15.000Z | src/conftest.py | qucontrol/krotov | 9f9a22336c433dc3a37637ce8cc8324df4290b46 | [
"BSD-3-Clause"
] | 20 | 2018-11-06T20:03:11.000Z | 2022-03-12T05:29:21.000Z | """Set up the environment for doctests
This file is automatically evaluated by py.test. It ensures that we can write
doctests without distracting import statements in the doctest.
"""
import inspect
from collections import OrderedDict
import numpy
import pytest
import krotov
@pytest.fixture(autouse=True)
def set_d... | 25 | 77 | 0.784762 |
a01db004cb65adac6649bdcb86066ab49836ca55 | 5,701 | py | Python | Openharmony v1.0/third_party/ltp/testcases/kernel/power_management/pm_cpu_consolidation.py | clkbit123/TheOpenHarmony | 0e6bcd9dee9f1a2481d762966b8bbd24baad6159 | [
"MIT"
] | 1 | 2022-02-15T08:51:55.000Z | 2022-02-15T08:51:55.000Z | hihope_neptune-oh_hid/00_src/v0.3/third_party/ltp/testcases/kernel/power_management/pm_cpu_consolidation.py | dawmlight/vendor_oh_fun | bc9fb50920f06cd4c27399f60076f5793043c77d | [
"Apache-2.0"
] | null | null | null | hihope_neptune-oh_hid/00_src/v0.3/third_party/ltp/testcases/kernel/power_management/pm_cpu_consolidation.py | dawmlight/vendor_oh_fun | bc9fb50920f06cd4c27399f60076f5793043c77d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
''' This Python script interprets various sched stats values.
Validates cpu consolidation for given sched_mc_power_saving value
'''
import os
import sys
import time
from optparse import OptionParser
from pm_sched_mc import *
__author__ = "Poornima Nayak <mpnayak@linux.vnet.ibm.com>"
class ... | 39.590278 | 120 | 0.584283 |
0134a296e40230b63f161b5aaaa26ce041b479a9 | 272 | py | Python | examples/myqueryset/get_/admin.py | zhengtong0898/django-decode | 69680853a4a5b07f6a9c4b65c7d86b2d401a92b1 | [
"MIT"
] | 5 | 2020-07-14T07:48:10.000Z | 2021-12-20T21:20:10.000Z | examples/myqueryset/bulk_create_/admin.py | zhengtong0898/django-decode | 69680853a4a5b07f6a9c4b65c7d86b2d401a92b1 | [
"MIT"
] | 7 | 2021-03-26T03:13:38.000Z | 2022-03-12T00:42:03.000Z | examples/myqueryset/get_/admin.py | zhengtong0898/django-decode | 69680853a4a5b07f6a9c4b65c7d86b2d401a92b1 | [
"MIT"
] | 1 | 2021-02-16T07:04:25.000Z | 2021-02-16T07:04:25.000Z | from django.contrib import admin
from .models import product
# Register your models here.
class ProductModel(admin.ModelAdmin):
list_display = ('name', 'price', 'short_description', 'production_date', 'expiration_date')
admin.site.register(product, ProductModel)
| 22.666667 | 95 | 0.768382 |
6df9eca0c8a0fafd290ab7c26d85d0e7da9fa6a4 | 3,645 | py | Python | pandemie/web/server.py | marvinsxtr/informaticup-2020-pandemie | 0d37d5236eadfe7bb3cbd7cbfd0e1b7afca74c89 | [
"MIT"
] | null | null | null | pandemie/web/server.py | marvinsxtr/informaticup-2020-pandemie | 0d37d5236eadfe7bb3cbd7cbfd0e1b7afca74c89 | [
"MIT"
] | null | null | null | pandemie/web/server.py | marvinsxtr/informaticup-2020-pandemie | 0d37d5236eadfe7bb3cbd7cbfd0e1b7afca74c89 | [
"MIT"
] | 1 | 2020-03-28T00:02:41.000Z | 2020-03-28T00:02:41.000Z | # !/usr/bin/env python3
import time
import threading
from bottle import Bottle, request, BaseRequest, json_loads
from gevent import monkey
from gevent.pywsgi import WSGIServer
from pandemie.util.operations import end_round
from pandemie.tester import AbstractStrategy
BaseRequest.MEMFILE_MAX = 1024 * 1024
SLEEP_TIM... | 31.973684 | 116 | 0.564883 |
28af2c49c6bf7e5a4a9b23fc460157a77419abc0 | 3,447 | py | Python | inventory.py | I4-Projektseminar-HHU-2016/seminar-project-marionline03 | ec2b2d2b588baa647c7a5e542e1d20a39cd0fc09 | [
"CC0-1.0"
] | null | null | null | inventory.py | I4-Projektseminar-HHU-2016/seminar-project-marionline03 | ec2b2d2b588baa647c7a5e542e1d20a39cd0fc09 | [
"CC0-1.0"
] | null | null | null | inventory.py | I4-Projektseminar-HHU-2016/seminar-project-marionline03 | ec2b2d2b588baa647c7a5e542e1d20a39cd0fc09 | [
"CC0-1.0"
] | null | null | null | # -*- coding: utf-8 -*-
import logging
# for DB usage
import sqlite3
logging.basicConfig(filename='log.txt',level=logging.DEBUG)
#inventory
def make_tabel_inventory():
try:
con = sqlite3.connect('game.db')
con.execute('''CREATE TABLE IF NOT EXISTS inventory (
id INTEGER PRIMARY KEY,
... | 29.715517 | 107 | 0.602263 |
c9795af56b432bc6c7e17e1504d52e6442136218 | 2,347 | py | Python | research/cv/DeepID/preprocess.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/DeepID/preprocess.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/DeepID/preprocess.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... | 41.175439 | 104 | 0.680017 |
a30a7fe5106b7686df39448f677de223e172a0a8 | 941 | py | Python | Projekteuler/Loesungen/projecteuler_aufgabe001_loesung.py | kilian-funk/Python-Kurs | f5ef5a2fb2a875d2e80d77c1a6c3596a0e577d7f | [
"MIT"
] | null | null | null | Projekteuler/Loesungen/projecteuler_aufgabe001_loesung.py | kilian-funk/Python-Kurs | f5ef5a2fb2a875d2e80d77c1a6c3596a0e577d7f | [
"MIT"
] | null | null | null | Projekteuler/Loesungen/projecteuler_aufgabe001_loesung.py | kilian-funk/Python-Kurs | f5ef5a2fb2a875d2e80d77c1a6c3596a0e577d7f | [
"MIT"
] | null | null | null | """
Aufgabe 1 aus http://projecteuler.net
(Deutsche Übersetzung auf http://projekteuler.de)
Wenn wir alle natürlichen Zahlen unter 10 auflisten, die Vielfache von 3
oder 5 sind, so erhalten wir 3, 5, 6 und 9. Die Summe dieser Vielfachen ist 23.
Finden Sie die Summe aller Vielfachen von 3 oder 5 unter 1000.
"""
# Ein... | 29.40625 | 79 | 0.652497 |
a339969304dc58ae6d12d89f2709e809ee401162 | 10,527 | py | Python | 20-hs-redez-sem/groups/05-decentGames/src/DGA.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 8 | 2020-03-17T21:12:18.000Z | 2021-12-12T15:55:54.000Z | 20-hs-redez-sem/groups/05-decentGames/src/DGA.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 2 | 2021-07-19T06:18:43.000Z | 2022-02-10T12:17:58.000Z | 20-hs-redez-sem/groups/05-decentGames/src/DGA.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 25 | 2020-03-20T09:32:45.000Z | 2021-07-18T18:12:59.000Z | import copy
import json
import random
import sys
import State
from getmac import get_mac_address as gma
class DGA:
BLUE: str = 'B'
RED = 'R'
YELLOW = 'Y'
EMPTY = 'O'
INNER_FIELD = 'x'
GOAL = 'X'
B_START_POS = '0'
B_PATH_START = 27
R_START_POS = '9'
R_PATH_START = 31
Y_STAR... | 32.192661 | 138 | 0.507932 |
42bb56383d06b24e9510337b454e84ac9ac06266 | 2,237 | py | Python | project.py | argifood/Be2 | df190bc784d0e1de18d38f370bc5be590d2421e2 | [
"Apache-2.0"
] | null | null | null | project.py | argifood/Be2 | df190bc784d0e1de18d38f370bc5be590d2421e2 | [
"Apache-2.0"
] | null | null | null | project.py | argifood/Be2 | df190bc784d0e1de18d38f370bc5be590d2421e2 | [
"Apache-2.0"
] | null | null | null | from bigchaindb_driver import BigchainDB
from bigchaindb_driver.crypto import generate_keypair
from time import sleep
from sys import exit
def asset_creation(farmer, tomatos, tomatos_metadata, bdb):
prepare_cr_tx = bdb.transactions.prepare(
operation = 'CREATE',
signers = farmer.public_key,
asset = tomatos,
... | 29.051948 | 83 | 0.715691 |
2817aee4d0e6db3f32540ecc1fe7297df2cf3321 | 22,585 | py | Python | ImageCaption/lib/build_dataset_xrh.py | Xinrihui/DeepLearningApp | 8d86b88251ee8d37358c642b1ec4a341767bfd17 | [
"Apache-2.0"
] | 2 | 2021-08-25T01:13:29.000Z | 2021-10-10T14:49:59.000Z | ImageCaption/lib/build_dataset_xrh.py | Xinrihui/DeepLearningApp | 8d86b88251ee8d37358c642b1ec4a341767bfd17 | [
"Apache-2.0"
] | null | null | null | ImageCaption/lib/build_dataset_xrh.py | Xinrihui/DeepLearningApp | 8d86b88251ee8d37358c642b1ec4a341767bfd17 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# -*- coding: UTF-8 -*-
from tensorflow.keras.applications.inception_v3 import InceptionV3
from tensorflow.keras.models import Model
from tensorflow.keras.preprocessing import image
from tensorflow.keras.preprocessing import sequence
# from deprecated import deprecated
import os
from tqdm import t... | 30.315436 | 209 | 0.604295 |
28a0855d810870f31f7229d301a4ec7a311302af | 1,176 | py | Python | klufweb/feed/models.py | mseln/klufweb | a785d44415fde933723220fab7f18f2ae4fd748d | [
"Apache-2.0"
] | null | null | null | klufweb/feed/models.py | mseln/klufweb | a785d44415fde933723220fab7f18f2ae4fd748d | [
"Apache-2.0"
] | 5 | 2015-05-22T12:05:54.000Z | 2015-05-22T12:09:06.000Z | klufweb/feed/models.py | mseln/klufweb | a785d44415fde933723220fab7f18f2ae4fd748d | [
"Apache-2.0"
] | null | null | null | from django.db import models
from django.contrib import admin
from ckeditor.fields import RichTextField
from django.template.defaultfilters import slugify
import datetime, time
class BaseArticle(models.Model):
headline = models.CharField(max_length=200)
body = RichTextField()
created = models.DateTimeFie... | 23.058824 | 59 | 0.690476 |
957f505fc194866a5d0fbe5b844bea7515c1ad3c | 150 | py | Python | selfservice/admin.py | KSIUJ/erc-backend | a78a6ee85c2865c8d25c15f40dc72fe32ba4bfd3 | [
"MIT"
] | null | null | null | selfservice/admin.py | KSIUJ/erc-backend | a78a6ee85c2865c8d25c15f40dc72fe32ba4bfd3 | [
"MIT"
] | 5 | 2020-10-10T00:21:37.000Z | 2021-09-22T18:01:46.000Z | selfservice/admin.py | KSIUJ/erc-backend | a78a6ee85c2865c8d25c15f40dc72fe32ba4bfd3 | [
"MIT"
] | null | null | null | from django.contrib import admin
# Register your models here.
from selfservice.models import SelfServiceToken
admin.site.register(SelfServiceToken)
| 21.428571 | 47 | 0.84 |
dd6aaf4e9e84ded1c4ff43c860b30b5c456d17d5 | 613 | py | Python | pacman-arch/test/pacman/tests/sync400.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/sync400.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/sync400.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-09-26T08:44:40.000Z | 2021-09-26T08:44:40.000Z | self.description = "Install package with dep that conflicts with older version of package"
sp1 = pmpkg("pkg1", "1.0-2")
sp1.depends = ["pkg2=1.0-2"]
self.addpkg2db("sync", sp1)
sp2 = pmpkg("pkg2", "1.0-2")
sp2.conflicts = [ "pkg1=1.0-1" ]
self.addpkg2db("sync", sp2)
lp1 = pmpkg("pkg1", "1.0-1")
lp1.depends = ["pkg2=... | 24.52 | 90 | 0.675367 |
dd6b08e8844cd1ef0c188667871598eb91576e28 | 8,566 | py | Python | Packs/Smokescreen_IllusionBLACK/Integrations/Smokescreen_IllusionBLACK/Smokescreen_IllusionBLACK_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/Smokescreen_IllusionBLACK/Integrations/Smokescreen_IllusionBLACK/Smokescreen_IllusionBLACK_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/Smokescreen_IllusionBLACK/Integrations/Smokescreen_IllusionBLACK/Smokescreen_IllusionBLACK_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import pytest
from Smokescreen_IllusionBLACK import Client
CLIENT = Client("", False, "", "", False)
RECON_DECOYS = {
"items": [
{
"name": "experience.illusionblack.com",
"ip": "1.2.3.4",
"server_type": "nginx",
"dataset": "generic"
}
]
}
USERS ... | 37.735683 | 119 | 0.54191 |
dd98d2fcbfc6b5bacd468c3b83ef0ff1bbd08f67 | 5,217 | py | Python | research/cv/ssd_resnet50/infer/sdk/perf/generate_map_report.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/ssd_resnet50/infer/sdk/perf/generate_map_report.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/ssd_resnet50/infer/sdk/perf/generate_map_report.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... | 30.508772 | 78 | 0.628714 |
9ff18d0046200f989d8f1a5c7bbfa1f955d87b5f | 22,655 | py | Python | api/views.py | scholaronroad/guts_2021_hackathon | 482b7b59317b67fc37f67f1ccfeaadbf811c00ca | [
"MIT"
] | null | null | null | api/views.py | scholaronroad/guts_2021_hackathon | 482b7b59317b67fc37f67f1ccfeaadbf811c00ca | [
"MIT"
] | 2 | 2021-02-06T13:54:45.000Z | 2021-02-06T20:05:18.000Z | api/views.py | scholaronroad/guts_2021_hackathon | 482b7b59317b67fc37f67f1ccfeaadbf811c00ca | [
"MIT"
] | null | null | null | from datetime import timedelta
import json
import random
import string
from api.models import Address, CharityAccount, CharityDietaryOptions, DiertaryRequirements, FoodRequest, User, UserDietaryPreferences
from django.utils import timezone
from django.views import View
from django.core.serializers import serialize
from... | 39.885563 | 188 | 0.561819 |
b004737ceac29c4a87a2c0578e6914535e778034 | 230 | py | Python | python/gdal_cookbook/cookbook_geometry/create_geometry_from_gml.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/gdal_cookbook/cookbook_geometry/create_geometry_from_gml.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/gdal_cookbook/cookbook_geometry/create_geometry_from_gml.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | from osgeo import ogr
gml = """<gml:Point xmlns:gml="http://www.opengis.net/gml"><gml:coordinates>108420.33,753808.59</gml:coordinates></gml:Point>"""
point = ogr.CreateGeometryFromGML(gml)
print(f'{point.GetX()},{point.GetY()}') | 46 | 128 | 0.717391 |
b04c26ad2bbb8a9044df88515d388af73901ddfa | 1,249 | py | Python | project/forms/reference.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | 1 | 2021-06-01T14:49:18.000Z | 2021-06-01T14:49:18.000Z | project/forms/reference.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | 286 | 2020-12-04T14:13:00.000Z | 2022-03-09T19:05:16.000Z | project/forms/reference.py | DanielGrams/gsevpt | a92f71694388e227e65ed1b24446246ee688d00e | [
"MIT"
] | null | null | null | from flask_babelex import lazy_gettext
from flask_wtf import FlaskForm
from wtforms import SelectField, SubmitField
from wtforms.validators import DataRequired
from project.forms.common import event_rating_choices
class CreateEventReferenceForm(FlaskForm):
admin_unit_id = SelectField(
lazy_gettext("Organ... | 31.225 | 118 | 0.705364 |
c67e7c3a3b2890e252fdada43bf09d43e7fa9e00 | 9,490 | py | Python | generate.py | PanderMusubi/lunar-phase-calendar | f35449b8bb6ef1787129c3d85b46b74d96535c3b | [
"Apache-2.0"
] | 9 | 2019-02-28T15:07:43.000Z | 2022-01-24T08:09:43.000Z | generate.py | PanderMusubi/lunar-phase-calendar | f35449b8bb6ef1787129c3d85b46b74d96535c3b | [
"Apache-2.0"
] | 1 | 2021-03-08T12:01:46.000Z | 2021-03-08T12:01:46.000Z | generate.py | PanderMusubi/lunar-phase-calendar | f35449b8bb6ef1787129c3d85b46b74d96535c3b | [
"Apache-2.0"
] | 2 | 2021-08-02T13:26:02.000Z | 2022-03-17T10:40:25.000Z | #!/usr/bin/env python3
'''Generates calendars with lunar phase in iCal format.'''
from datetime import date, datetime, timedelta
from json import load
from os.path import isdir, realpath, join, dirname
from os import makedirs, chdir, getpid, getcwd
from socket import getfqdn
from astral import moon
__location__ = re... | 38.734694 | 116 | 0.550158 |
05f526b23a1505b026504cd627b05cdf0b970878 | 2,460 | py | Python | Utils/py/SimsparkTests/Utils.py | tarsoly/NaoTH | dcd2b67ef6bf9953c81d3e1b26e543b5922b7d52 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | Utils/py/SimsparkTests/Utils.py | tarsoly/NaoTH | dcd2b67ef6bf9953c81d3e1b26e543b5922b7d52 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | Utils/py/SimsparkTests/Utils.py | tarsoly/NaoTH | dcd2b67ef6bf9953c81d3e1b26e543b5922b7d52 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | import logging
import time
import os
from AgentController import AgentController
def wait_for(condition:callable, sleeper:float, min_time:float=0.0, max_time:float=3600.0, *kwargs):
"""
Waits as long as the condition doesn't return True. The condition is a callable, which returns True or False.
Between t... | 43.928571 | 136 | 0.696341 |
b1f77b90d712716d50d7f798bcac5d33a4f4c636 | 111 | py | Python | transonic/path_data_tests.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 88 | 2019-01-08T16:39:08.000Z | 2022-02-06T14:19:23.000Z | transonic/path_data_tests.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 13 | 2019-06-20T15:53:10.000Z | 2021-02-09T11:03:29.000Z | transonic/path_data_tests.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 1 | 2019-11-05T03:03:14.000Z | 2019-11-05T03:03:14.000Z | from pathlib import Path
here = Path(__file__).parent.absolute()
path_data_tests = here.parent / "data_tests"
| 22.2 | 44 | 0.774775 |
f9551fcbf9673b09d1075a3e3eb4fb0b1fa65f3c | 923 | py | Python | packages/watchmen-storage-postgresql/src/watchmen_storage_postgresql/sort_build.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-storage-postgresql/src/watchmen_storage_postgresql/sort_build.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-storage-postgresql/src/watchmen_storage_postgresql/sort_build.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from typing import Union # noqa
from sqlalchemy import asc, desc
from watchmen_storage import EntitySort, EntitySortColumn, EntitySortMethod, UnsupportedSortMethodException
from watchmen_utilities import ArrayHelper
from .types import SQLAlchemyStatement
def build_sort_column(column: EntitySortColumn):
if column.... | 28.84375 | 107 | 0.79415 |
f9a60f3cb28c420c49b5585ffaa3a450aec71f9b | 318 | py | Python | experiment/images/facenet/resize.py | corganhejijun/FaceFill | 6914f3ee680b41161817fe5eafc09b82e59d9113 | [
"MIT"
] | null | null | null | experiment/images/facenet/resize.py | corganhejijun/FaceFill | 6914f3ee680b41161817fe5eafc09b82e59d9113 | [
"MIT"
] | null | null | null | experiment/images/facenet/resize.py | corganhejijun/FaceFill | 6914f3ee680b41161817fe5eafc09b82e59d9113 | [
"MIT"
] | null | null | null | import cv2
import os
folder = 'George_W_Bush'
folder_dest = 'origin_128'
if not os.path.isdir(folder_dest):
os.mkdir(folder_dest)
for file in os.listdir(folder):
img = cv2.imread(os.path.join(folder, file))
resizeImg = cv2.resize(img, (128,128))
cv2.imwrite(os.path.join(folder_dest, file), resizeImg) | 28.909091 | 59 | 0.720126 |
34ea3db49c5af3271e147586e647cd10c7d2a807 | 136 | py | Python | books/PythonCleanCode/ch1_code_format/before_black.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | books/PythonCleanCode/ch1_code_format/before_black.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | books/PythonCleanCode/ch1_code_format/before_black.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | def my_function(name):
"""
>>> my_function('black')
'received Black'
"""
return 'received {0}'.format(name.title())
| 19.428571 | 46 | 0.566176 |
b5d749a545b43a1cf49093fef81445acacb527f1 | 686 | py | Python | gestionNeuroLab_Panel_de_Control/admin.py | AnuTor/UniNeuroLab | 5825f440d4663650f038083f3da05229cc5ada4f | [
"Apache-2.0"
] | 1 | 2021-01-09T01:20:45.000Z | 2021-01-09T01:20:45.000Z | gestionNeuroLab_Panel_de_Control/admin.py | AnuTor/UniNeuroLab | 5825f440d4663650f038083f3da05229cc5ada4f | [
"Apache-2.0"
] | 1 | 2021-01-09T00:53:55.000Z | 2021-01-09T00:53:55.000Z | gestionNeuroLab_Panel_de_Control/admin.py | AnuTor/UniNeuroLab | 5825f440d4663650f038083f3da05229cc5ada4f | [
"Apache-2.0"
] | 1 | 2021-01-07T23:57:28.000Z | 2021-01-07T23:57:28.000Z | # GESTION PANEL DE CONTROL
from django.contrib import admin
from gestionNeuroLab_Panel_de_Control.models import APP_TableroControl #, gestionTomaDatos , gestionProcesamientoDatos, gestionProtocolos_y_Estudios, gestionResultadosProtocolo, gestionPlanificacion_y_Desarrollo_Proyectos_Nuevos
# Register your models here.
... | 38.111111 | 228 | 0.832362 |
bd25f15d789bad40d4e07acfb1021c4beb804ab5 | 245 | py | Python | frappe-bench/apps/erpnext/erpnext/patches/v8_8/add_new_fields_in_accounts_settings.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:55:29.000Z | 2021-04-29T14:55:29.000Z | frappe-bench/apps/erpnext/erpnext/patches/v8_8/add_new_fields_in_accounts_settings.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v8_8/add_new_fields_in_accounts_settings.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:39:01.000Z | 2021-04-29T14:39:01.000Z | from __future__ import unicode_literals
import frappe
def execute():
frappe.db.sql(
"INSERT INTO `tabSingles` (`doctype`, `field`, `value`) VALUES ('Accounts Settings', 'allow_stale', '1'), "
"('Accounts Settings', 'stale_days', '1')"
)
| 24.5 | 109 | 0.681633 |
23b6dc1bb2ae5c328a83902ad1b9dcbeb9251b0c | 2,772 | py | Python | python/generator/s3filereader.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/generator/s3filereader.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/generator/s3filereader.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | import boto3
class S3FileReader:
"""
Class to encapsulate boto3 calls to access an S3 resource
and allow clients to stream the contents of the file iteratively,
via a generator function: __iter__()
"""
def __init__(self, cfg, resource_key, bucket=None):
"""
S3FileReader constr... | 31.5 | 77 | 0.61544 |
b596400d56f262c14d91842149bc9daf6b41a783 | 1,323 | py | Python | mumath/core.py | fourpoints/mumath | f1c36c4a5b3c32a3e7f8e7a922eafea8b7a14fd4 | [
"MIT"
] | null | null | null | mumath/core.py | fourpoints/mumath | f1c36c4a5b3c32a3e7f8e7a922eafea8b7a14fd4 | [
"MIT"
] | null | null | null | mumath/core.py | fourpoints/mumath | f1c36c4a5b3c32a3e7f8e7a922eafea8b7a14fd4 | [
"MIT"
] | null | null | null | from .glyph import Glyph
from .lex import Lexer
from .grammar import MathParser
from .node.writer import tostring
# inspired by
# https://github.com/Python-Markdown/markdown/blob/master/markdown/core.py
# https://github.com/pygments/pygments/blob/master/pygments/__init__.py
class MuMath:
def __init__(self, glyph... | 28.148936 | 74 | 0.631897 |
f54cff5af1e1117cc4530f5431ea02e8a4f4096b | 1,105 | py | Python | backend/app/schemas/user_solution.py | jinnn-dev/patholearn | b4e6a18cfbf963e71640ed6cac3fc3a618a7ae15 | [
"MIT"
] | 1 | 2021-11-04T17:06:07.000Z | 2021-11-04T17:06:07.000Z | backend/app/schemas/user_solution.py | JamesNeumann/learning-by-annotations | c2b5e4b653eeb1c973aa5a7dad35ac8be18cb1ad | [
"MIT"
] | 21 | 2021-11-01T10:13:56.000Z | 2021-12-02T10:02:13.000Z | backend/app/schemas/user_solution.py | jinnn-dev/patholearn | b4e6a18cfbf963e71640ed6cac3fc3a618a7ae15 | [
"MIT"
] | 1 | 2021-12-16T18:20:55.000Z | 2021-12-16T18:20:55.000Z | from typing import Any, List, Optional, Union
from pydantic import BaseModel
from app.schemas.polygon_data import AnnotationData
from app.schemas.task import TaskFeedback
class UserSolutionBase(BaseModel):
percentage_solved: float
solution_data: Union[List[AnnotationData], List[str]]
task_res... | 23.510638 | 58 | 0.710407 |
f57a0c49df7521474db936029e1e532fb3247146 | 4,393 | py | Python | bolt/bot.py | ph7vc/CL4M-B0T | e992cf63b1215ea7c241cab94edc251653dbaed7 | [
"MIT"
] | 9 | 2019-02-17T06:33:14.000Z | 2021-10-05T02:19:00.000Z | bolt/bot.py | ns-phennessy/Bolt | e992cf63b1215ea7c241cab94edc251653dbaed7 | [
"MIT"
] | 28 | 2019-02-10T07:48:05.000Z | 2021-12-20T00:15:37.000Z | bolt/bot.py | ph7vc/Philbot | e992cf63b1215ea7c241cab94edc251653dbaed7 | [
"MIT"
] | 4 | 2015-03-13T03:58:55.000Z | 2015-05-27T08:29:46.000Z | # flake8: noqa: E402
"""
Description:
Main entry point for the bot to function
Composes multiple things to allow for an interface to plugins
Contributors:
- Patrick Hennessy
"""
import gevent
from gevent import monkey, queue
monkey.patch_all()
from gevent.backdoor import BackdoorServer
... | 33.792308 | 149 | 0.636695 |
27a42888505c43de9a1e740687b90fcf1846fd73 | 425 | py | Python | experiments/subspace_preservation/ex_ssc_omp.py | shailesh1729/ssc | 6baec02037fc3563bd3b671dd3e7a1fbe16a0841 | [
"Apache-2.0"
] | 1 | 2021-12-10T04:25:08.000Z | 2021-12-10T04:25:08.000Z | experiments/subspace_preservation/ex_ssc_omp.py | shailesh1729/ssc | 6baec02037fc3563bd3b671dd3e7a1fbe16a0841 | [
"Apache-2.0"
] | null | null | null | experiments/subspace_preservation/ex_ssc_omp.py | shailesh1729/ssc | 6baec02037fc3563bd3b671dd3e7a1fbe16a0841 | [
"Apache-2.0"
] | null | null | null | # Configure JAX for 64-bit computing
from jax.config import config
config.update("jax_enable_x64", True)
from jax import random
from ssc.subspace_preservation import bench_subspace_preservation
import cr.sparse.cluster.ssc as ssc
key = random.PRNGKey(0)
solver = lambda X, K: ssc.batch_build_representation_omp_jit(X,... | 30.357143 | 71 | 0.807059 |
7e061f265bc099f098a3210f613513589e827d9c | 7,161 | py | Python | src/bo4e/com/regionaleraufabschlag.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 1 | 2022-03-02T12:49:44.000Z | 2022-03-02T12:49:44.000Z | src/bo4e/com/regionaleraufabschlag.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 21 | 2022-02-04T07:38:46.000Z | 2022-03-28T14:01:53.000Z | src/bo4e/com/regionaleraufabschlag.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | null | null | null | """
Contains RegionalerAufAbschlag class and corresponding marshmallow schema for de-/serialization
"""
from typing import List, Optional
import attr
from marshmallow import fields
from marshmallow_enum import EnumField # type:ignore[import]
from bo4e.com.com import COM, COMSchema
from bo4e.com.energiemix import En... | 44.203704 | 197 | 0.757995 |
e34a5f541d97833aedfb942b00d7549c1b84cae7 | 1,982 | py | Python | Python/zzz_training_challenge/Python_Challenge/solutions/ch06_arrays/intro/intro.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/ch06_arrays/intro/intro.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/ch06_arrays/intro/intro.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | # Beispielprogramm für das Buch "Python Challenge"
#
# Copyright 2020 by Michael Inden
import numpy as np
def swap(values, first, second):
value1 = values[first]
value2 = values[second]
values[first] = value2
values[second] = value1
def swap(values, first, second):
tmp = values[first]
va... | 20.645833 | 65 | 0.618063 |
e364134777d8aacdd177e50da22473e6fac92f8c | 442 | py | Python | 2_Iterables/Lists/list_indexing_slicing.py | felixdittrich92/Python3 | 16b767465e4bdf0adc652c195d15384bb9faa4cf | [
"MIT"
] | 1 | 2022-03-02T07:16:30.000Z | 2022-03-02T07:16:30.000Z | 2_Iterables/Lists/list_indexing_slicing.py | felixdittrich92/Python3 | 16b767465e4bdf0adc652c195d15384bb9faa4cf | [
"MIT"
] | null | null | null | 2_Iterables/Lists/list_indexing_slicing.py | felixdittrich92/Python3 | 16b767465e4bdf0adc652c195d15384bb9faa4cf | [
"MIT"
] | null | null | null | # Indexing
list1 = [-1, 1, -2, 2, -3, 3]
print(list1[1]) # zweites Element Element
print(list1[-1]) # letzte Element
# Slicing: START:END:STEP
list1 = [-1, 1, -2, 2, -3, 3]
list2 = list1[-3:] # letzten 3 Werte
print(list2)
list3 = list1[:4] # index 0 bis 3, da 4 non inclusive ist
print(list3)
list4 = list1[2:4] #... | 21.047619 | 69 | 0.653846 |
8b567e73d7e208409ede93d7835692d9201da6d6 | 3,383 | py | Python | altpapierNotifier.py | dgnaegi/altpapierBot | 287d7e446eabf189189713067d8ac7405416d720 | [
"WTFPL"
] | 5 | 2019-07-17T04:36:14.000Z | 2020-05-04T12:48:10.000Z | altpapierNotifier.py | dgnaegi/altpapierBot | 287d7e446eabf189189713067d8ac7405416d720 | [
"WTFPL"
] | 8 | 2019-08-04T19:16:00.000Z | 2021-09-10T10:11:47.000Z | altpapierNotifier.py | dgnaegi/altpapierBot | 287d7e446eabf189189713067d8ac7405416d720 | [
"WTFPL"
] | 3 | 2019-07-17T06:37:56.000Z | 2021-09-06T19:59:18.000Z | from datetime import datetime
from helper.zurichApi import zurichApi
from helper.stgallenApi import stgallenApi
from dataStorage.dataAccess import dataAccess
from helper.bot import bot
import json
with open('config.json') as data_file:
data = json.load(data_file)
token = data["token"]
bot = bot(token)
log... | 46.986111 | 97 | 0.783328 |
8beb7f76c22e77074840d1753c10525ef913774f | 886 | py | Python | backend/app/models/course.py | jinnn-dev/patholearn | b4e6a18cfbf963e71640ed6cac3fc3a618a7ae15 | [
"MIT"
] | 1 | 2022-02-20T12:45:04.000Z | 2022-02-20T12:45:04.000Z | backend/app/models/course.py | JamesNeumann/learning-by-annotations | c2b5e4b653eeb1c973aa5a7dad35ac8be18cb1ad | [
"MIT"
] | 21 | 2021-11-01T10:13:56.000Z | 2021-12-02T10:02:13.000Z | backend/app/models/course.py | jinnn-dev/patholearn | b4e6a18cfbf963e71640ed6cac3fc3a618a7ae15 | [
"MIT"
] | 1 | 2021-12-16T18:20:55.000Z | 2021-12-16T18:20:55.000Z | from datetime import datetime
import shortuuid
from app.db.base_class import Base
# noinspection PyUnresolvedReferences
from app.models.task_group import TaskGroup
from sqlalchemy import Column, DateTime, ForeignKey, Integer, String, Text
from sqlalchemy.orm import relationship
class Course(Base):
i... | 40.272727 | 88 | 0.742664 |
d0448c8068cf0b07f782c7def71b24e6c6b231d6 | 2,653 | py | Python | dblp/python/citationsTest.py | DocSeven/spark | a88330f554a4afc70696dac8d00bcf4d2f512acf | [
"Apache-2.0"
] | null | null | null | dblp/python/citationsTest.py | DocSeven/spark | a88330f554a4afc70696dac8d00bcf4d2f512acf | [
"Apache-2.0"
] | null | null | null | dblp/python/citationsTest.py | DocSeven/spark | a88330f554a4afc70696dac8d00bcf4d2f512acf | [
"Apache-2.0"
] | 1 | 2019-11-06T11:29:31.000Z | 2019-11-06T11:29:31.000Z | import pytest
from . import citations,citationsCommon
from pyspark.sql import Row
pytestmark = pytest.mark.usefixtures("with_spark_context")
def test_pairs_to_array():
pairs = [(1, 2), (3, 6), (4, 8)]
arr = citationsCommon.pairsToArrayHelper.pairsToArray(pairs)
assert arr == [0, 2, 0, 6, 8]
def test_coun... | 34.907895 | 70 | 0.590275 |
4bd1b7fd53a8a19104ab27dec1ea038c18801884 | 108 | py | Python | Licence 2/I33/TP 2/ex_6.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | 8 | 2020-11-26T20:45:12.000Z | 2021-11-29T15:46:22.000Z | Licence 2/I33/TP 2/ex_6.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | null | null | null | Licence 2/I33/TP 2/ex_6.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | 6 | 2020-10-23T15:29:24.000Z | 2021-05-05T19:10:45.000Z | def valeur(L,b):
p, somme = 1, 0
for i in range(len(L)):
somme += L[::-1][i] * p
p *= b
return somme
| 15.428571 | 25 | 0.518519 |
c234b174585a5099b2be5c03123f35465cfc8c46 | 5,139 | py | Python | EX2/PGModel.py | CSUpengyuyan/DLExperiment | 4b4d8384215da85cca1915b5630dbf3fbb381b38 | [
"MIT"
] | null | null | null | EX2/PGModel.py | CSUpengyuyan/DLExperiment | 4b4d8384215da85cca1915b5630dbf3fbb381b38 | [
"MIT"
] | null | null | null | EX2/PGModel.py | CSUpengyuyan/DLExperiment | 4b4d8384215da85cca1915b5630dbf3fbb381b38 | [
"MIT"
] | 1 | 2021-05-11T09:29:28.000Z | 2021-05-11T09:29:28.000Z | import pandas as pd
import numpy as np
from random import shuffle
from numpy.linalg import inv
import os
def dataProcess_X(rawData):
#sex 只有两个属性 先drop之后处理
if "income" in rawData.columns:
Data = rawData.drop(["sex", 'income'], axis=1) #删掉性别,收入两行
else:
Data = rawData.drop(["sex"], axis=1)
... | 35.441379 | 127 | 0.617046 |
26c016c808edd005a288cfb27ed1785ac111d0b1 | 377 | py | Python | Grundlagen/TigerJython/07.1-Trinker.py | jneug/schule-projekte | 4f1d56d6bb74a47ca019cf96d2d6cc89779803c9 | [
"MIT"
] | 2 | 2020-09-24T12:11:16.000Z | 2022-03-31T04:47:24.000Z | Grundlagen/TigerJython/07.1-Trinker.py | jneug/schule-projekte | 4f1d56d6bb74a47ca019cf96d2d6cc89779803c9 | [
"MIT"
] | 1 | 2021-02-27T15:06:27.000Z | 2021-03-01T16:32:48.000Z | Grundlagen/TigerJython/07.1-Trinker.py | jneug/schule-projekte | 4f1d56d6bb74a47ca019cf96d2d6cc89779803c9 | [
"MIT"
] | 1 | 2021-02-24T05:12:35.000Z | 2021-02-24T05:12:35.000Z | from gturtle import *
from random import *
makeTurtle("sprites/alien.gif")
repeat 100:
forward(20)
zufall = randint(1, 100)
if zufall < 25:
left(45)
elif zufall >= 25 and zufall < 50:
# 'elif' steht kurz für 'else-if'
right(135)
elif zufall >= 50 and zufall < 90:... | 23.5625 | 42 | 0.554377 |
f84c7711753a37a21c18782c535e9ec0d31cbf33 | 675 | py | Python | PyLabs/lab2.py | XeroDef/labs50 | a71e9474e395d7814326ac7dc56754fc8c94d123 | [
"MIT"
] | null | null | null | PyLabs/lab2.py | XeroDef/labs50 | a71e9474e395d7814326ac7dc56754fc8c94d123 | [
"MIT"
] | null | null | null | PyLabs/lab2.py | XeroDef/labs50 | a71e9474e395d7814326ac7dc56754fc8c94d123 | [
"MIT"
] | null | null | null | import math
a = float(input('Введите а: '))
x = float(input('Введите х: '))
b = 0
var = int(input('введи значение:'))
if var == 1:
G = -(10*(18*a*a+11*a*x-24*x*x))/(-(a*a)+a*x+6*x*x)
if (-(a*a)+a*x+6*x*x) == 0:
print('Введены неверные данные')
else:
print(G)
elif var == 2:
z = math.cos(2... | 25.961538 | 55 | 0.511111 |
f8b3b205b61d98dc5d4f2b7c40984a6b4fc32bf6 | 674 | py | Python | Fastir_Collector/memory/windows2003ServerR2Memory.py | Unam3dd/Train-2018-2020 | afb6ae70fe338cbe55a21b74648d91996b818fa2 | [
"MIT"
] | 4 | 2021-04-23T15:39:17.000Z | 2021-12-27T22:53:24.000Z | Fastir_Collector/memory/windows2003ServerR2Memory.py | Unam3dd/Train-2018-2020 | afb6ae70fe338cbe55a21b74648d91996b818fa2 | [
"MIT"
] | null | null | null | Fastir_Collector/memory/windows2003ServerR2Memory.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 memory.mem import _Memory
class Windows2003ServerR2Memory(_Memory):
def __init__(self, params):
super(Windows2003ServerR2Memory, self).__init__(params)
def csv_all_modules_dll(self):
super(Windows2003ServerR2Memory, self)._csv_all_modules_dll()
... | 35.473684 | 79 | 0.783383 |
e440475c3a26bb02665533a997cdd55ee296f72e | 1,372 | py | Python | WikiAnalyser/Main.py | Simocracy/PwrBot | feac80393072f3c79e1978466c54c84a4e74ff85 | [
"MIT"
] | null | null | null | WikiAnalyser/Main.py | Simocracy/PwrBot | feac80393072f3c79e1978466c54c84a4e74ff85 | [
"MIT"
] | null | null | null | WikiAnalyser/Main.py | Simocracy/PwrBot | feac80393072f3c79e1978466c54c84a4e74ff85 | [
"MIT"
] | null | null | null | import sys
import os
import configparser
sys.path.append(os.path.abspath("../simocraPy/"))
from simocracy import wiki
from footballMatchAnalyzer import footballMatch
def main():
config = configparser.ConfigParser()
config.read("pwrbot.cfg")
# read wiki login
wikiSect = "WIKI"
userOpt = "username"
pwOpt = "pas... | 28 | 88 | 0.719388 |
902936c0906b27dfcf6fd5caf6e0a9ef7669ef86 | 6,095 | py | Python | Templates/Integrations/DataEnrichmentThreatIntelligence/DataEnrichmentThreatIntelligence_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Templates/Integrations/DataEnrichmentThreatIntelligence/DataEnrichmentThreatIntelligence_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Templates/Integrations/DataEnrichmentThreatIntelligence/DataEnrichmentThreatIntelligence_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | from typing import Dict
import pytest
from CommonServerPython import *
from DataEnrichmentThreatIntelligence import Client
from pytest import raises
BASE_URL = 'https://example.com/api/v1/'
FILE_RESULTS = {
'result': [
{
'id': 1,
'severity': 75,
'md5': 'd1e09edea866f35... | 40.098684 | 113 | 0.666448 |
399bca048fbb982382399acfae91a6d673129b37 | 6,280 | py | Python | src/ingestion/sources/postgresql.py | monosidev/monosi | a88b689fc74010b10dbabb32f4b2bdeae865f4d5 | [
"Apache-2.0"
] | 156 | 2021-11-19T18:50:14.000Z | 2022-03-31T19:48:59.000Z | src/ingestion/sources/postgresql.py | monosidev/monosi | a88b689fc74010b10dbabb32f4b2bdeae865f4d5 | [
"Apache-2.0"
] | 30 | 2021-12-27T19:30:56.000Z | 2022-03-30T17:49:00.000Z | src/ingestion/sources/postgresql.py | monosidev/monosi | a88b689fc74010b10dbabb32f4b2bdeae865f4d5 | [
"Apache-2.0"
] | 14 | 2022-01-17T23:24:34.000Z | 2022-03-29T09:27:47.000Z | import json
from ingestion.task import TaskUnit
from .base import MetricsQueryBuilder, SQLAlchemyExtractor, SourceConfiguration, SQLAlchemySourceDialect, SQLAlchemySource
class PostgreSQLMetricsQueryBuilder(MetricsQueryBuilder):
def _base_query_backfill(self, select_sql, table, timestamp_field): # TODO
r... | 37.380952 | 191 | 0.599682 |
f2c6a0267189577586d49132a01e8ea772182265 | 6,787 | py | Python | Tests/test_controler.py | dereklm12880/rssticker | d90e8c00811d67bd9fb8104bbb6ec98aae5221f4 | [
"MIT"
] | 2 | 2020-02-26T01:54:26.000Z | 2020-04-27T20:09:14.000Z | Tests/test_controler.py | dereklm12880/rssticker | d90e8c00811d67bd9fb8104bbb6ec98aae5221f4 | [
"MIT"
] | 17 | 2020-02-29T02:43:44.000Z | 2020-04-27T20:38:44.000Z | Tests/test_controler.py | dereklm12880/rssticker | d90e8c00811d67bd9fb8104bbb6ec98aae5221f4 | [
"MIT"
] | 8 | 2020-02-26T21:37:36.000Z | 2020-06-23T00:01:27.000Z | # https://ongspxm.github.io/blog/2016/11/assertraises-testing-for-errors-in-unittest/
import unittest
from unittest import mock
from unittest.mock import patch, Mock
from RSS.controller.rssfeed import RssController
from RSS.model.rssfeed import RssModel
from RSS.model.settings import SettingsModel
class TestRssModel(... | 54.733871 | 110 | 0.662738 |
6a808710d1b50f971a6165c5429b3ed45f6e2341 | 424 | py | Python | baccoapp/mysandwich/migrations/0010_ingredient_price.py | msienkiewicz7/baccoapp | d647ca205fdf06fe57fda7b6db164ae7d3387dad | [
"MIT"
] | null | null | null | baccoapp/mysandwich/migrations/0010_ingredient_price.py | msienkiewicz7/baccoapp | d647ca205fdf06fe57fda7b6db164ae7d3387dad | [
"MIT"
] | null | null | null | baccoapp/mysandwich/migrations/0010_ingredient_price.py | msienkiewicz7/baccoapp | d647ca205fdf06fe57fda7b6db164ae7d3387dad | [
"MIT"
] | null | null | null | # Generated by Django 2.2 on 2019-06-22 13:05
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('mysandwich', '0009_remove_ingredient_price'),
]
operations = [
migrations.AddField(
model_name='ingredient',
name='pri... | 22.315789 | 81 | 0.622642 |
0a81ff3733f82e192f09c4c20b9dc7fba01db19f | 3,150 | py | Python | pyScript/custom_src/Log.py | Shirazbello/Pyscriptining | 0f2c80a9bb10477d65966faeccc7783f20385c1b | [
"MIT"
] | null | null | null | pyScript/custom_src/Log.py | Shirazbello/Pyscriptining | 0f2c80a9bb10477d65966faeccc7783f20385c1b | [
"MIT"
] | null | null | null | pyScript/custom_src/Log.py | Shirazbello/Pyscriptining | 0f2c80a9bb10477d65966faeccc7783f20385c1b | [
"MIT"
] | null | null | null | from PySide2.QtWidgets import QWidget, QScrollArea, QHBoxLayout, QVBoxLayout, QGridLayout, QPushButton, QPlainTextEdit, QLabel, QLayout
from PySide2.QtCore import Qt, QSize
from PySide2.QtGui import QFont
class Logger(QWidget):
def __init__(self, script):
super(Logger, self).__init__()
# UI
... | 27.631579 | 135 | 0.619048 |
0aa19171122e8e9fd2ebad90063e72d2a3a7912c | 6,293 | py | Python | methods/transformers/tests/test_modeling_pegasus.py | INK-USC/RiddleSense | a3d57eaf084da9cf6b77692c608e2cd2870fbd97 | [
"MIT"
] | 3 | 2021-07-06T20:02:31.000Z | 2022-03-27T13:13:01.000Z | methods/transformers/tests/test_modeling_pegasus.py | INK-USC/RiddleSense | a3d57eaf084da9cf6b77692c608e2cd2870fbd97 | [
"MIT"
] | null | null | null | methods/transformers/tests/test_modeling_pegasus.py | INK-USC/RiddleSense | a3d57eaf084da9cf6b77692c608e2cd2870fbd97 | [
"MIT"
] | null | null | null | import unittest
from transformers import AutoConfig, AutoTokenizer, is_torch_available
from transformers.configuration_pegasus import task_specific_params
from transformers.file_utils import cached_property
from transformers.testing_utils import require_sentencepiece, require_tokenizers, require_torch, slow, torc... | 55.201754 | 1,814 | 0.714445 |
7c6994631e6ac78c1b83b67cf97483a911b717f7 | 1,023 | py | Python | bot/exts/fun/fun.py | thecoderkitty/fluffington-bot | f518e7b66487aaf9e6c507ced43e15760d604be2 | [
"MIT"
] | null | null | null | bot/exts/fun/fun.py | thecoderkitty/fluffington-bot | f518e7b66487aaf9e6c507ced43e15760d604be2 | [
"MIT"
] | null | null | null | bot/exts/fun/fun.py | thecoderkitty/fluffington-bot | f518e7b66487aaf9e6c507ced43e15760d604be2 | [
"MIT"
] | null | null | null | import random
import typing
import discord
from discord.ext import commands
from bot.bot import Bot
VERBS = ("Pet", "Eat", "Get", "See", "Go to", "Talk to", "Touch")
NOUNS = ("your Cat", "some Food", "your Toys", "the Stars", "Sleep", "Someone", "Grass")
class Fun(commands.Cog):
def __init__(self, bot: Bot) ->... | 24.95122 | 88 | 0.565005 |
7c97076d6dc56151f486e1a875911c5cf30aa1ea | 1,515 | py | Python | HackTon/HiddenEye/Defs/ThemesManager.py | GitInitDev/ZohoUniv | 966704837e65f58b52492b56d08e7958df3d220a | [
"Unlicense"
] | null | null | null | HackTon/HiddenEye/Defs/ThemesManager.py | GitInitDev/ZohoUniv | 966704837e65f58b52492b56d08e7958df3d220a | [
"Unlicense"
] | null | null | null | HackTon/HiddenEye/Defs/ThemesManager.py | GitInitDev/ZohoUniv | 966704837e65f58b52492b56d08e7958df3d220a | [
"Unlicense"
] | null | null | null | # Themes Manager
import sys
from Defs.Configurations import readConfig, ifSettingsNotExists
color = [0, 0, 0, 0, 0]
config = readConfig()
def colorSelector():
ifSettingsNotExists()
for arg in sys.argv:
if arg in ['--theme']:
for arg in sys.argv:
if arg in ['anaglyph', '3da... | 42.083333 | 81 | 0.490429 |
7cbf1add7c16a1b2ad1464a90cc47aa4bb7f6b45 | 820 | py | Python | algorithm/sorting_algorithms_in_python/sorting_timer.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | algorithm/sorting_algorithms_in_python/sorting_timer.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | algorithm/sorting_algorithms_in_python/sorting_timer.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | from random import randint
from timeit import repeat
ARRAY_LENGTH = 10000
def run_sorting_algorithm(algorithm: str, array: list) -> None:
# Set up the context and prepare the call to the specified
# algorithm using the supplied array. Only import the
# algorithm function if it's not the built-in... | 35.652174 | 75 | 0.682927 |
7ccd0ac0ec2aa7e19bb02b24ee85be83c8ea0b97 | 924 | py | Python | theblog/urls.py | clowdcap/ablog | 1a31c8ec83777c35ff3fde5da8e5e89181bd5d34 | [
"MIT"
] | null | null | null | theblog/urls.py | clowdcap/ablog | 1a31c8ec83777c35ff3fde5da8e5e89181bd5d34 | [
"MIT"
] | null | null | null | theblog/urls.py | clowdcap/ablog | 1a31c8ec83777c35ff3fde5da8e5e89181bd5d34 | [
"MIT"
] | null | null | null | from django.urls import path
from .views import AddCategoryView, ArticleDetailView, HomeView, AddPostView, UpdatePostView, DeletePostView, CategoryView, CategoryListView, LikeView, ContactView
# from .views import *
urlpatterns = [
path('', HomeView.as_view(), name='home'),
path('article/<int:pk>', ArticleDeta... | 57.75 | 163 | 0.712121 |
869c985da556983beb5ff64192ff0b5bc276b6aa | 10,249 | py | Python | Packs/PaloAltoNetworks_IoT/Integrations/PaloAltoNetworks_IoT/PaloAltoNetworks_IoT_test.py | cstone112/content | 7f039931b8cfc20e89df52d895440b7321149a0d | [
"MIT"
] | 2 | 2021-12-06T21:38:24.000Z | 2022-01-13T08:23:36.000Z | Packs/PaloAltoNetworks_IoT/Integrations/PaloAltoNetworks_IoT/PaloAltoNetworks_IoT_test.py | cstone112/content | 7f039931b8cfc20e89df52d895440b7321149a0d | [
"MIT"
] | 87 | 2022-02-23T12:10:53.000Z | 2022-03-31T11:29:05.000Z | Packs/PaloAltoNetworks_IoT/Integrations/PaloAltoNetworks_IoT/PaloAltoNetworks_IoT_test.py | cstone112/content | 7f039931b8cfc20e89df52d895440b7321149a0d | [
"MIT"
] | 2 | 2022-01-05T15:27:01.000Z | 2022-02-01T19:27:43.000Z | import json
import demistomock as demisto
from PaloAltoNetworks_IoT import Client, iot_get_device, fetch_incidents, iot_list_devices, \
iot_resolve_alert, iot_resolve_vuln, iot_get_device_by_ip
def test_iot_get_device(requests_mock):
"""
Scenario: Get a device details from IoT Security Portal by device I... | 35.835664 | 130 | 0.633525 |
811ce8257cea2308b11983c3d738c31c9cf5c22b | 1,501 | py | Python | common/models/food/Food.py | yao6891/FlaskOrdering | cbd24bd8d95afaba91ce4d6b1b3548c4e82e3807 | [
"Apache-2.0"
] | 2 | 2019-06-10T08:57:47.000Z | 2021-06-12T16:22:15.000Z | common/models/food/Food.py | yao6891/FlaskOrdering | cbd24bd8d95afaba91ce4d6b1b3548c4e82e3807 | [
"Apache-2.0"
] | null | null | null | common/models/food/Food.py | yao6891/FlaskOrdering | cbd24bd8d95afaba91ce4d6b1b3548c4e82e3807 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
from sqlalchemy import Column, DateTime, Integer, Numeric, String
from sqlalchemy.schema import FetchedValue
from application import db
class Food(db.Model):
__tablename__ = 'food'
id = db.Column(db.Integer, primary_key=True)
cat_id = db.Column(db.Integer, nullable=False, server_default=d... | 60.04 | 92 | 0.755496 |
d4e1c605e01dc20c20df54ed3e5ba7a4c264e23a | 1,025 | py | Python | PyQT5/simple_signal/event_send.py | ptracton/ExperimentalPython | a3159226982ec9656bb0f81f6997687da22f4466 | [
"MIT"
] | null | null | null | PyQT5/simple_signal/event_send.py | ptracton/ExperimentalPython | a3159226982ec9656bb0f81f6997687da22f4466 | [
"MIT"
] | null | null | null | PyQT5/simple_signal/event_send.py | ptracton/ExperimentalPython | a3159226982ec9656bb0f81f6997687da22f4466 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
ZetCode PyQt5 tutorial
In this example, we determine the event sender
object.
Author: Jan Bodnar
Website: zetcode.com
Last edited: August 2017
"""
import sys
from PyQt5.QtWidgets import QMainWindow, QPushButton, QApplication
class Example(QMainWindow):
def __i... | 18.981481 | 68 | 0.632195 |
d4f0e99f9f3fdf0ce0e720d2123fec6047b2e40a | 3,822 | py | Python | t1nkuy/apps/users/serializers.py | qq453388937/drf | 63ef7c5f89cf8f597fd09828f8ce94ce809ce287 | [
"MIT"
] | null | null | null | t1nkuy/apps/users/serializers.py | qq453388937/drf | 63ef7c5f89cf8f597fd09828f8ce94ce809ce287 | [
"MIT"
] | null | null | null | t1nkuy/apps/users/serializers.py | qq453388937/drf | 63ef7c5f89cf8f597fd09828f8ce94ce809ce287 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
__author__ = 'bobby'
import re
from rest_framework import serializers
from django.contrib.auth import get_user_model
from datetime import datetime
from datetime import timedelta
from rest_framework.validators import UniqueValidator
from .models import VerifyCode
from MxShop.settings... | 35.388889 | 114 | 0.587389 |
b9c2ca5ff3aac382f63ec2fa197327f6c673b057 | 1,302 | py | Python | quant/markets/_liqui.py | doubleDragon/QuantBot | 53a1d6c62ecece47bf777da0c0754430b706b7fd | [
"MIT"
] | 7 | 2017-10-22T15:00:09.000Z | 2019-09-19T11:45:43.000Z | quant/markets/_liqui.py | doubleDragon/QuantBot | 53a1d6c62ecece47bf777da0c0754430b706b7fd | [
"MIT"
] | 1 | 2018-01-19T16:19:40.000Z | 2018-01-19T16:19:40.000Z | quant/markets/_liqui.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 quant.api.liqui import PublicClient
import market_util
from .market import Market
class Liqui(Market):
def __init__(self, pair_code):
base_currency, market_currency = self.get_available_pairs(pair_code)
super(Liqui, self).__init__(base_currency,... | 31.756098 | 85 | 0.639017 |
b9f95dc469c00f5a144bda8193f4b98b5bf4c90c | 151 | py | Python | exercises/ja/exc_01_02_03.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | 2 | 2020-07-07T01:46:37.000Z | 2021-04-20T03:19:43.000Z | exercises/ja/exc_01_02_03.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/ja/exc_01_02_03.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | # spacyをインポート
import ____
# スペイン語のnlpオブジェクトを作成
nlp = ____
# テキストを処理(スペイン語で「おげんきですか?」の意味)
doc = nlp("¿Cómo estás?")
# docのテキストをプリント
print(____.text)
| 12.583333 | 30 | 0.728477 |
0ec7f12c39e4d495c2ab8937f433a43b1233ded9 | 260 | py | Python | refactoru/optimusPrime.py | fvcproductions/coding-interviews | 9761ac5e0b8e34ec4fbf97fd344dea917c7dd96e | [
"MIT"
] | 1 | 2020-04-03T23:28:25.000Z | 2020-04-03T23:28:25.000Z | refactoru/optimusPrime.py | fvcproductions/coding-interviews | 9761ac5e0b8e34ec4fbf97fd344dea917c7dd96e | [
"MIT"
] | null | null | null | refactoru/optimusPrime.py | fvcproductions/coding-interviews | 9761ac5e0b8e34ec4fbf97fd344dea917c7dd96e | [
"MIT"
] | null | null | null | #optimusPrime come to save the day?
#oh yes.
#fvcproductions
import math
def optimusPrime(number):
if number < 2:
return False
for i in range(2,number):
if not number % i:
return False
return True
#thankyoucodecademy!#
print(optimusPrime(10)); | 14.444444 | 35 | 0.715385 |
0ef01f0f1aa2c52426399b018abd856603a00038 | 620 | py | Python | bind/pyevt/setup.py | harrywong/evt | 95985384619e0f5ff4021e8838d421ac4b4b946d | [
"BSD-3-Clause"
] | 1,411 | 2018-04-23T03:57:30.000Z | 2022-02-13T10:34:22.000Z | bind/pyevt/setup.py | Zhang-Zexi/evt | e90fe4dbab4b9512d120c79f33ecc62791e088bd | [
"Apache-2.0"
] | 27 | 2018-06-11T10:34:42.000Z | 2019-07-27T08:50:02.000Z | bind/pyevt/setup.py | Zhang-Zexi/evt | e90fe4dbab4b9512d120c79f33ecc62791e088bd | [
"Apache-2.0"
] | 364 | 2018-06-09T12:11:53.000Z | 2020-12-15T03:26:48.000Z | from setuptools import setup, find_packages
setup(
name="pyevt",
version="0.3",
author="everiToken",
author_email="help@everitoken.io",
description="Python bind library for everiToken",
long_description=open("README.rst").read(),
license="MIT",
url="https://github.com/everitoken/evt/tre... | 29.52381 | 67 | 0.637097 |
160ba2934cdf6de7806f4fb645092663f795710b | 147 | py | Python | python/testlint/test/test_example.py | mpsonntag/snippets | fc3cc42ea49b885c1f29c0aef1379055a931a978 | [
"BSD-3-Clause"
] | null | null | null | python/testlint/test/test_example.py | mpsonntag/snippets | fc3cc42ea49b885c1f29c0aef1379055a931a978 | [
"BSD-3-Clause"
] | null | null | null | python/testlint/test/test_example.py | mpsonntag/snippets | fc3cc42ea49b885c1f29c0aef1379055a931a978 | [
"BSD-3-Clause"
] | null | null | null | def i_am_ignored():
assert "a" == "b"
def test_i_am_included_success():
assert 1 == 1
def test_i_am_included_fail():
assert 1 == 2
| 13.363636 | 33 | 0.639456 |
160ea48cb4cac57a656e1ec7b4f078b185439e54 | 1,384 | py | Python | app/eua_tools.py | student1304/co2 | dc83bb19d1f75ac7b04273e8d9c3f14a3a44153c | [
"Apache-2.0"
] | null | null | null | app/eua_tools.py | student1304/co2 | dc83bb19d1f75ac7b04273e8d9c3f14a3a44153c | [
"Apache-2.0"
] | null | null | null | app/eua_tools.py | student1304/co2 | dc83bb19d1f75ac7b04273e8d9c3f14a3a44153c | [
"Apache-2.0"
] | null | null | null | from bs4 import BeautifulSoup
import requests
from sqlite_cache.sqlite_cache import SqliteCache
import time
cache = SqliteCache('./app/data/eua_cache') # co2 is starting dir
url = "https://markets.businessinsider.com/commodities/co2-european-emission-allowances/euro"
timestamp = time.strftime("%Y-%M-%d", time.localtim... | 32.952381 | 107 | 0.656069 |
bc711afc2644a3f49897b775066960500648c831 | 8,387 | py | Python | datasets/spider/data_loader.py | inyukwo1/qgm_decoder | 70e60afec140ec3e2ee04f980a384e1cf28d761c | [
"MIT"
] | null | null | null | datasets/spider/data_loader.py | inyukwo1/qgm_decoder | 70e60afec140ec3e2ee04f980a384e1cf28d761c | [
"MIT"
] | null | null | null | datasets/spider/data_loader.py | inyukwo1/qgm_decoder | 70e60afec140ec3e2ee04f980a384e1cf28d761c | [
"MIT"
] | null | null | null | import os
import json
import tqdm
import random
from datasets.schema import Schema
WHERE_OPS = ('not', 'between', '=', '>', '<', '>=', '<=', '!=', 'in', 'like', 'is', 'exists')
UNIT_OPS = ('none', '-', '+', "*", '/')
AGG_OPS = ('none', 'max', 'min', 'count', 'sum', 'avg')
class DataLoader():
def __init__(self, H... | 37.609865 | 137 | 0.523787 |
d5b857012e114730ee006648d9c53131b48086f0 | 300 | py | Python | src/python/py-accepted/546A.py | cbarnson/UVa | 0dd73fae656613e28b5aaf5880c5dad529316270 | [
"Unlicense",
"MIT"
] | 2 | 2019-09-07T17:00:26.000Z | 2020-08-05T02:08:35.000Z | src/python/py-accepted/546A.py | cbarnson/UVa | 0dd73fae656613e28b5aaf5880c5dad529316270 | [
"Unlicense",
"MIT"
] | null | null | null | src/python/py-accepted/546A.py | cbarnson/UVa | 0dd73fae656613e28b5aaf5880c5dad529316270 | [
"Unlicense",
"MIT"
] | null | null | null | #! python
# Problem # : 546A
# Created on : 2019-01-15 19:53:54
def Main():
k, n, w = map(int, input().split(' '))
tot = 0
for i in range(1, w+1):
tot += k * i
if n >= tot:
print(0)
else:
print(tot - n)
if __name__ == '__main__':
Main()
| 14.285714 | 42 | 0.453333 |
e6b624e0c2a98e9070be395ed01025147b8abd58 | 92 | py | Python | 2015/02/poll-foreign-aid/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | 14 | 2015-05-08T13:41:51.000Z | 2021-02-24T12:34:55.000Z | 2015/02/poll-foreign-aid/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | null | null | null | 2015/02/poll-foreign-aid/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 = '1JzjZ4FTIm--tFIGE1d27cQM-HzMbT7_-_RYKvjdhUxg'
| 23 | 68 | 0.804348 |
fc2177f8da41ebabccb7042249586932afdddc28 | 485 | py | Python | python/socket/address_packing.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/socket/address_packing.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/socket/address_packing.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | """
Network programs written in C use the data type struct sockaddr to represent
IP addresses as binary value (instead of the string addresses usually found in
Python programs)
"""
import binascii
import socket
import struct
import sys
for string_address in ['192.168.1.1', '127.0.0.1']:
packed = socket.inet_aton(... | 26.944444 | 78 | 0.734021 |
fc73dc25bf6e36d9482d6e75a3063e07fa0029c6 | 48,884 | py | Python | isp/mpdf.py | MePyDo/pygqa | 61cde42ee815968fdd029cc5056ede3badea3d91 | [
"MIT"
] | null | null | null | isp/mpdf.py | MePyDo/pygqa | 61cde42ee815968fdd029cc5056ede3badea3d91 | [
"MIT"
] | null | null | null | isp/mpdf.py | MePyDo/pygqa | 61cde42ee815968fdd029cc5056ede3badea3d91 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
mpdf
====
This mpdf class allows creating pdf files like the corresponding PHP class.
It is based on weasyprint, jinja and html5lib
* Automatic integration of header and footer areas
* Images via path information with positions and sizes
* SVG files
* Generated graphics
* Long texts ... | 32.611074 | 209 | 0.550794 |
5d7fd62ab7928767c0bdb20c4b5307203609a0c2 | 5,256 | py | Python | mangaid.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | mangaid.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | mangaid.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-05T18:07:48.000Z | 2022-02-24T21:25:07.000Z | import os,sys,time,requests,json
from bs4 import BeautifulSoup as bs
from time import sleep
from concurrent.futures import ThreadPoolExecutor
b="\033[94m"
c="\033[96m"
g="\033[92m"
r="\033[91m"
p="\033[1;97m"
d="\033[00m"
dn=f"{d}[{g}√{d}]{p}"
er=f"{d}[{r}!{d}]{p}"
pr=f"{d}[{c}*{d}]{p}"
url="https://mangaid.click/"
ses... | 32.85 | 151 | 0.513889 |
5d2b63c353d816954a16e9fe0496e30e6bedaf7e | 92 | py | Python | 2015/04/table-superpac-2016-20150413/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | 14 | 2015-05-08T13:41:51.000Z | 2021-02-24T12:34:55.000Z | 2015/04/table-superpac-2016-20150413/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | null | null | null | 2015/04/table-superpac-2016-20150413/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 = '1wZA5Lpl79eji4Ttxxy1V71AR2ufXsmaXbQ1ftW1VZDU'
| 23 | 68 | 0.847826 |
5d705f42d4cb70f50bc38ee4921b62ef5d52cf53 | 1,899 | py | Python | apps/projects/migrations/0005_auto_20190125_1436.py | IT-PM-OpenAdaptronik/Webapp | c3bdde0ca56b6d77f49bc830fa2b8bb41a26bae4 | [
"MIT"
] | 2 | 2017-12-17T21:28:22.000Z | 2018-02-02T14:44:58.000Z | apps/projects/migrations/0005_auto_20190125_1436.py | IT-PM-OpenAdaptronik/Webapp | c3bdde0ca56b6d77f49bc830fa2b8bb41a26bae4 | [
"MIT"
] | 118 | 2017-10-31T13:45:09.000Z | 2018-02-24T20:51:42.000Z | apps/projects/migrations/0005_auto_20190125_1436.py | OpenAdaptronik/Rattler | c3bdde0ca56b6d77f49bc830fa2b8bb41a26bae4 | [
"MIT"
] | null | null | null | # Generated by Django 2.0 on 2019-01-25 14:36
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('projects', '0004_auto_20180517_1028'),
]
operations = [
migrations.AddField(
model_name='datarow',
name='data_format',... | 32.186441 | 86 | 0.576093 |
53797dc8b1188468147621f71846e60bb5832cb9 | 5,543 | py | Python | tests/components/utils.py | Matheus158257/projects | 26a6148046533476e625a872a2950c383aa975a8 | [
"Apache-2.0"
] | null | null | null | tests/components/utils.py | Matheus158257/projects | 26a6148046533476e625a872a2950c383aa975a8 | [
"Apache-2.0"
] | null | null | null | tests/components/utils.py | Matheus158257/projects | 26a6148046533476e625a872a2950c383aa975a8 | [
"Apache-2.0"
] | null | null | null | from io import BytesIO
from json import dumps
from minio.error import BucketAlreadyOwnedByYou, ResponseError
from projects.object_storage import BUCKET_NAME, MINIO_CLIENT
def creates_boston_metadata(dataset_object_name):
"""Create boston metadata into which the model will import.
Args:
dataset_obje... | 37.201342 | 109 | 0.61519 |
0706980793927d0184a2b330c9344c02f26c9b89 | 504 | py | Python | ___Python/KarPoo/po1_kennenlernen/p01_kennenlernen/meinebibliothek.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | ___Python/KarPoo/po1_kennenlernen/p01_kennenlernen/meinebibliothek.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | ___Python/KarPoo/po1_kennenlernen/p01_kennenlernen/meinebibliothek.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | from datetime import date
# Funktion alter mit einem Parameter geburtsdatum
def alter(geburtsdatum):
heute = date.today()
jahre = heute.year - geburtsdatum.year
if (geburtsdatum.month, geburtsdatum.day) > (heute.month, heute.day): # hatte die Person dieses Jahr noch nicht geburtstag?
jahre -... | 31.5 | 128 | 0.680556 |
4ad1ad77b71e64f3df33353272af95610a6b90f5 | 10,542 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/cs_instance_facts.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/cs_instance_facts.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/cs_instance_facts.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2016, René Moser <mail@renemoser.net>
# 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',
... | 28.037234 | 126 | 0.639158 |
9184300c8f3bace34bf228a2eae27e2570b7fcf7 | 374 | py | Python | 003-C99-RemoveOldFiles/__main__.py | somePythonProgrammer/PythonCode | fb2b2245db631cefd916a960768f411969b0e78f | [
"MIT"
] | 2 | 2021-09-28T13:55:20.000Z | 2021-11-15T10:08:49.000Z | 003-C99-RemoveOldFiles/__main__.py | somePythonProgrammer/PythonCode | fb2b2245db631cefd916a960768f411969b0e78f | [
"MIT"
] | null | null | null | 003-C99-RemoveOldFiles/__main__.py | somePythonProgrammer/PythonCode | fb2b2245db631cefd916a960768f411969b0e78f | [
"MIT"
] | 1 | 2022-01-20T03:02:20.000Z | 2022-01-20T03:02:20.000Z | # Folder Cleaner
# Made by somePythonProgrammer as a WhiteHat project.
import os
import time
dir_path = input('Enter folder path: ')
treshold = time.time() - 30*86400
for i in os.listdir(dir_path):
try:
if os.path.getmtime(dir_path + '\\' + i) < treshold:
os.remove(dir_path + '\\' + i)
... | 22 | 60 | 0.601604 |
72aece12fcd122daa8790342c60e5b54c6838d1a | 2,722 | py | Python | frappe-bench/env/lib/python2.7/site-packages/github/tests/__main__.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/env/lib/python2.7/site-packages/github/tests/__main__.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/env/lib/python2.7/site-packages/github/tests/__main__.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
############################ Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2012 Zearin <zearin@gonk.net> ... | 52.346154 | 80 | 0.450404 |
fe87efde67a2b31b2a4568084c11152188719a4e | 278 | py | Python | Programming Languages/Python/Theory/100_Python_Exercises/Exercises/Exercise 74/74.py | jaswinder9051998/Resources | fd468af37bf24ca57555d153ee64693c018e822e | [
"MIT"
] | 101 | 2021-12-20T11:57:11.000Z | 2022-03-23T09:49:13.000Z | Programming Languages/Python/Theory/100_Python_Exercises/Exercises/Exercise 74/74.py | jaswinder9051998/Resources | fd468af37bf24ca57555d153ee64693c018e822e | [
"MIT"
] | 4 | 2022-01-12T11:55:56.000Z | 2022-02-12T04:53:33.000Z | Programming Languages/Python/Theory/100_Python_Exercises/Exercises/Exercise 74/74.py | jaswinder9051998/Resources | fd468af37bf24ca57555d153ee64693c018e822e | [
"MIT"
] | 38 | 2022-01-12T11:56:16.000Z | 2022-03-23T10:07:52.000Z | #Concatenate the two txt files into one file
import pandas
data1 = pandas.read_csv("http://www.pythonhow.com/data/sampledata.txt")
data2 = pandas.read_csv("sampledata_x_2.txt")
data12 = pandas.concat([data1, data2])
data12.to_csv("sampledata12.txt", index=None)
print(data12)
| 27.8 | 71 | 0.769784 |
feabc08e0cda449a81bb8443fc30349d5a89070e | 32 | py | Python | 1_basics/1_kommentare.py | Coding-for-the-Arts/drawbot-samples-solutions | 7191610d6efd7d788056070e7826d255b7ef496b | [
"CC0-1.0"
] | null | null | null | 1_basics/1_kommentare.py | Coding-for-the-Arts/drawbot-samples-solutions | 7191610d6efd7d788056070e7826d255b7ef496b | [
"CC0-1.0"
] | null | null | null | 1_basics/1_kommentare.py | Coding-for-the-Arts/drawbot-samples-solutions | 7191610d6efd7d788056070e7826d255b7ef496b | [
"CC0-1.0"
] | null | null | null | """
Kommentare
Keine Lösung
""" | 6.4 | 12 | 0.65625 |
a3f5d89efbd23d97775d7210909474c7f03f6c66 | 738 | py | Python | jd.py | weibk/webauto | f494f8043d05739935d1fc22b941bbc9a7ba75b7 | [
"MIT"
] | null | null | null | jd.py | weibk/webauto | f494f8043d05739935d1fc22b941bbc9a7ba75b7 | [
"MIT"
] | null | null | null | jd.py | weibk/webauto | f494f8043d05739935d1fc22b941bbc9a7ba75b7 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
# encoding='utf-8'
# author:weibk
# @time:2021/10/22 11:27
from selenium import webdriver
from selenium.webdriver.common import keys
driver = webdriver.Chrome()
driver.get('https://www.jd.com')
driver.maximize_window()
driver.find_element_by_xpath('//*[@id="key"]').send_keys('小米11')
driver.find_ele... | 28.384615 | 73 | 0.746612 |
43d2e90fdb40afd33503c1017a0299b43c4f0933 | 67 | py | Python | akinola-itunu-028/resize.py | cornelia247/cil-internship-cohort-01 | b8184337056d378eab16d26b40b26ed58cd177bb | [
"MIT"
] | null | null | null | akinola-itunu-028/resize.py | cornelia247/cil-internship-cohort-01 | b8184337056d378eab16d26b40b26ed58cd177bb | [
"MIT"
] | null | null | null | akinola-itunu-028/resize.py | cornelia247/cil-internship-cohort-01 | b8184337056d378eab16d26b40b26ed58cd177bb | [
"MIT"
] | null | null | null | from PIL import image
im = image.open("images/svg.jp")
print(im) | 13.4 | 32 | 0.701493 |
714fcf95f08fd8492fa82788696bc0879468e39f | 2,290 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/network/nos/test_nos_facts.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/network/nos/test_nos_facts.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/network/nos/test_nos_facts.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | #
# (c) 2018 Extreme Networks Inc.
#
# This file is part of Ansible
#
# Ansible 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 3 of the License, or
# (at your option) any later version.
#
# Ans... | 36.935484 | 130 | 0.709607 |
719187b2bb7b4638ca76b74f6a0762145ad1af59 | 990 | py | Python | Packs/CommonScripts/Scripts/JsonToTable/JsonToTable.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/CommonScripts/Scripts/JsonToTable/JsonToTable.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/CommonScripts/Scripts/JsonToTable/JsonToTable.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | from CommonServerPython import *
import demistomock as demisto
def main():
args = demisto.args()
value = args.get('value')
if isinstance(value, str):
value = safe_load_json(value)
title = args.get('title')
headers = argToList(args.get('headers'))
is_auto_json_transform = argToBoolean(a... | 38.076923 | 103 | 0.718182 |
1cb352455230d325cf75080c9482f5ee15985f7f | 790 | py | Python | BayesianInference/code/random_extract.py | lance52587/MachineLearningNote | 0184f8de178990ee31ace2a43809830874313697 | [
"MIT"
] | 37 | 2018-06-06T05:58:54.000Z | 2022-02-21T04:49:54.000Z | BayesianInference/code/random_extract.py | YYangjlu/MachineLearningNote | d34a9b57af3b2c6f276d14c2a7a3dccadb585421 | [
"MIT"
] | null | null | null | BayesianInference/code/random_extract.py | YYangjlu/MachineLearningNote | d34a9b57af3b2c6f276d14c2a7a3dccadb585421 | [
"MIT"
] | 35 | 2018-10-01T16:12:34.000Z | 2022-02-21T03:35:33.000Z | # -*- coding: utf-8 -*-
# @Date : 2017-05-09 13:06:56
# @Author : Alan Lau (rlalan@outlook.com)
# @Language : Python3.5
import random
import shutil
import os
def fileWalker(path):
fileArray = []
for root, dirs, files in os.walk(path):
for fn in files:
eachpath = str(root+'\\'+fn)
... | 22.571429 | 65 | 0.570886 |
1cc1472bf04de1d8c2b73f02f5d777272bff9e6c | 1,300 | py | Python | .venv/Lib/site-packages/dexpy/model.py | AI-Assistant/FEMAG-Python | ff86e8f41485ae9df6034e6b8e810b59f8094c70 | [
"MIT"
] | 21 | 2016-10-19T18:13:03.000Z | 2021-11-02T13:58:31.000Z | .venv/Lib/site-packages/dexpy/model.py | AI-Assistant/FEMAG-Python | ff86e8f41485ae9df6034e6b8e810b59f8094c70 | [
"MIT"
] | 43 | 2016-10-11T20:56:28.000Z | 2020-08-20T16:39:38.000Z | .venv/Lib/site-packages/dexpy/model.py | AI-Assistant/FEMAG-Python | ff86e8f41485ae9df6034e6b8e810b59f8094c70 | [
"MIT"
] | 6 | 2017-12-22T03:47:37.000Z | 2021-03-13T03:45:26.000Z | """Functions for creating and working with a model."""
from enum import Enum
class ModelOrder(Enum):
"""Represents a full model order."""
constant = 0
linear = 1
quadratic = 2
cubic = 3
def make_quadratic_model(factor_names, include_squared = True):
"""Creates patsy formula representing a qu... | 37.142857 | 74 | 0.663846 |
1cc4ecc542f46f5cfc7428abad4092f662c0845a | 830 | py | Python | INBa/2014/MOCHALOV_V_V/task_7_15.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | INBa/2014/MOCHALOV_V_V/task_7_15.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | INBa/2014/MOCHALOV_V_V/task_7_15.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | # -*- coding: UTF-8 -*-
# Задача 7. Вариант 15.
#
# Разработайте систему начисления очков для задачи 6, в соответствии с которой игрок получал бы большее количество баллов за меньшее количество попыток.
# Mochalov V. V.
# 04.04.2016
import random
k=12
x=random.randint(1, 12)
while True:
y=input("Введ... | 18.863636 | 153 | 0.563855 |
1cc7c2e362f8893dd8e4638af94d9969f918cb3e | 13,364 | py | Python | main_seml.py | scott-mao/CroP | f1e0a25224e341683cf47e7ce451ce0fe996e950 | [
"MIT"
] | null | null | null | main_seml.py | scott-mao/CroP | f1e0a25224e341683cf47e7ce451ce0fe996e950 | [
"MIT"
] | null | null | null | main_seml.py | scott-mao/CroP | f1e0a25224e341683cf47e7ce451ce0fe996e950 | [
"MIT"
] | 1 | 2021-11-08T16:34:45.000Z | 2021-11-08T16:34:45.000Z | import sys
import warnings
from models import GeneralModel
from models.statistics.Metrics import Metrics
from utils.config_utils import *
from utils.model_utils import *
from utils.system_utils import *
# from rigl_torch.RigL import RigLScheduler
warnings.filterwarnings("ignore")
import logging
from sacred import Ex... | 41.12 | 175 | 0.675696 |
e80c74bec29ce83876f4a5da2dfa6a454cfdf637 | 8,508 | py | Python | python/oneflow/test/models/test_alexnet_model.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 3,285 | 2020-07-31T05:51:22.000Z | 2022-03-31T15:20:16.000Z | python/oneflow/test/models/test_alexnet_model.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 2,417 | 2020-07-31T06:28:58.000Z | 2022-03-31T23:04:14.000Z | python/oneflow/test/models/test_alexnet_model.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... | 33.234375 | 84 | 0.658204 |
98d059eb3eb443b37d43c93e3d79a2632c3bcba4 | 382 | py | Python | 926/Fcat_926_prefix_sum.py | Leetcode-Secret-Society/warehouse | 40d7969683b1296f361e799cda37f15ceec52af8 | [
"MIT"
] | null | null | null | 926/Fcat_926_prefix_sum.py | Leetcode-Secret-Society/warehouse | 40d7969683b1296f361e799cda37f15ceec52af8 | [
"MIT"
] | null | null | null | 926/Fcat_926_prefix_sum.py | Leetcode-Secret-Society/warehouse | 40d7969683b1296f361e799cda37f15ceec52af8 | [
"MIT"
] | null | null | null | class Solution:
def minFlipsMonoIncr(self, s: str) -> int:
prefix = [0]
one_count = 0
for d in s:
if d == '1':
one_count += 1
prefix.append(one_count)
return min(prefix[i] + len(s) - i - 1 - (prefix[-1] - prefix[i + 1]) for i in range(len(s)))... | 27.285714 | 100 | 0.531414 |
c740d70f979127103243561805c82541c0520bff | 8,517 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/cs_ip_address.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/cs_ip_address.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/cs_ip_address.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2015, Darren Worrall <darren@iweb.co.uk>
# Copyright (c) 2015, René Moser <mail@renemoser.net>
# 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
__meta... | 29.77972 | 99 | 0.642832 |
c76095d02c1d66f68c50cc56e1efba03f2fc6e65 | 3,377 | py | Python | assets/code/python/ppg_hrm.py | agarrharr/fronzbot.github.io | 702f5a9d5ab15046f0dad539e57766a24f583d1d | [
"MIT"
] | 3 | 2020-04-08T03:01:05.000Z | 2021-11-04T11:10:52.000Z | assets/code/python/ppg_hrm.py | agarrharr/fronzbot.github.io | 702f5a9d5ab15046f0dad539e57766a24f583d1d | [
"MIT"
] | 20 | 2017-07-28T02:54:39.000Z | 2022-02-26T03:34:48.000Z | assets/code/python/ppg_hrm.py | agarrharr/fronzbot.github.io | 702f5a9d5ab15046f0dad539e57766a24f583d1d | [
"MIT"
] | 4 | 2019-03-04T19:56:13.000Z | 2020-04-09T00:31:09.000Z | '''
ppg_hrm.py
Author: Kevin Fronczak
Date: September 22, 2017
Description: Measure heart-rate from phone camera video
'''
import os
import numpy as np
import matplotlib.pylot as plt
import imageio
# Variables to set by user
filename = 'ppg-resting'
videofile = '{}/{}.mp4'.format(os.getcwd(), filename)
fps = 30 # fra... | 28.863248 | 94 | 0.655908 |
c7c45f65f2399d806b34cad03c06a9ddb88b8a32 | 2,058 | py | Python | research/nlp/senta/src/data/field.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/nlp/senta/src/data/field.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/nlp/senta/src/data/field.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... | 34.3 | 78 | 0.63897 |
c7d326c4290d1cdecfba4d7b482ea8825726a433 | 431 | py | Python | Mongols/util/io.py | kkysen/Soft-Dev | b19881b1fcc9c7daefc817e6b975ff6bce545d81 | [
"Apache-2.0"
] | null | null | null | Mongols/util/io.py | kkysen/Soft-Dev | b19881b1fcc9c7daefc817e6b975ff6bce545d81 | [
"Apache-2.0"
] | 9 | 2018-05-18T16:19:27.000Z | 2022-02-26T03:48:31.000Z | Mongols/util/io.py | kkysen/Soft-Dev | b19881b1fcc9c7daefc817e6b975ff6bce545d81 | [
"Apache-2.0"
] | 1 | 2018-06-14T04:06:14.000Z | 2018-06-14T04:06:14.000Z | import errno
import os
from typing import Union
def mkdir_if_not_exists(dir_path):
# type: (str) -> None
try:
os.makedirs(dir_path)
except OSError as e:
if e.errno != errno.EEXIST:
raise
def sanitize_filename(filename):
# type: (Union[str, unicode]) -> str
illegal_ch... | 19.590909 | 43 | 0.610209 |
90b65bd35aad12f1d570827a3dbf07f200eea04f | 4,198 | py | Python | frappe-bench/apps/erpnext/erpnext/buying/doctype/supplier_scorecard_period/supplier_scorecard_period.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/buying/doctype/supplier_scorecard_period/supplier_scorecard_period.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/buying/doctype/supplier_scorecard_period/supplier_scorecard_period.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import throw, _
from frappe.model.document import Document
from frappe.model.mapper import get_mapped_doc
impo... | 31.328358 | 153 | 0.708909 |
29708646e29d4c9e116c7a491e427268850a1324 | 1,486 | py | Python | Fortgeschrittenenpraktikum/Protokolle/V01_kosmische_Myonen/Python/tabelle.py | smjhnits/Praktikum | 92c9df3ee7dfa2417f464036d18ac33b70765fdd | [
"MIT"
] | 2 | 2019-03-07T08:55:36.000Z | 2019-04-22T18:13:03.000Z | Fortgeschrittenenpraktikum/Protokolle/V01_kosmische_Myonen/Python/tabelle.py | smjhnits/Praktikum | 92c9df3ee7dfa2417f464036d18ac33b70765fdd | [
"MIT"
] | null | null | null | Fortgeschrittenenpraktikum/Protokolle/V01_kosmische_Myonen/Python/tabelle.py | smjhnits/Praktikum | 92c9df3ee7dfa2417f464036d18ac33b70765fdd | [
"MIT"
] | 2 | 2017-10-27T13:26:43.000Z | 2018-01-13T09:12:24.000Z | import numpy as np
Kanaele = np.linspace(1, 512, 512)
Messwerte = np.genfromtxt('Messwert_table.tex', unpack=True)
Kanal1 = Kanaele[0:80]
Kanal2 = Kanaele[80:160]
Kanal3 = Kanaele[160:240]
Kanal4 = Kanaele[240:320]
Kanal5 = Kanaele[320:400]
Kanal6 = Kanaele[400:480]
Kanal7 = Kanaele[480:518]
Mess1 = Messwerte[0:80]
... | 27.018182 | 257 | 0.590175 |
46a3263579be7d1acbebea9792c2fe30c7484656 | 781 | py | Python | Contests/ECOO 2018/ECOO '18 R1 P2 - Rue's Rings.py | MastaCoder/Projects | ebb0a3134522b12f052fec8d753005f384adf1b1 | [
"MIT"
] | 5 | 2018-10-11T01:55:40.000Z | 2021-12-25T23:38:22.000Z | Contests/ECOO 2018/ECOO '18 R1 P2 - Rue's Rings.py | MastaCoder/mini_projects | ebb0a3134522b12f052fec8d753005f384adf1b1 | [
"MIT"
] | null | null | null | Contests/ECOO 2018/ECOO '18 R1 P2 - Rue's Rings.py | MastaCoder/mini_projects | ebb0a3134522b12f052fec8d753005f384adf1b1 | [
"MIT"
] | 1 | 2019-02-22T14:42:50.000Z | 2019-02-22T14:42:50.000Z | for a in range(10):
cu = int(input())
roads = {}
counter = [0 for n in range(cu)]
imin = []
for b in range(cu):
N = list(map(int, input().split()))
roads[N[0]] = N[2:]
mi = min(N[2:])
imin.append(mi)
#print(mi)
absmin = min(imin)
print(absmin, end = " ... | 21.694444 | 43 | 0.377721 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.