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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
bb798309fd6ffccdeb34a76a2f9077e427e0d89f | 2,488 | py | Python | code/selfish_proxy/strategy/matrix.py | simonmulser/master-thesis | 5ca2ddda377a0eede5a3c50866e0f90292c5448f | [
"CC-BY-4.0"
] | null | null | null | code/selfish_proxy/strategy/matrix.py | simonmulser/master-thesis | 5ca2ddda377a0eede5a3c50866e0f90292c5448f | [
"CC-BY-4.0"
] | null | null | null | code/selfish_proxy/strategy/matrix.py | simonmulser/master-thesis | 5ca2ddda377a0eede5a3c50866e0f90292c5448f | [
"CC-BY-4.0"
] | 1 | 2019-06-05T09:10:30.000Z | 2019-06-05T09:10:30.000Z | import logging
from strategy import ForkState
from strategy import Action
from strategy import ActionException
from strategy import BlockOrigin
class Strategy:
def __init__(self, strategy):
self.fork_state = ForkState.irrelevant
self.strategy = strategy
logging.warn('this strategy is not u... | 46.943396 | 118 | 0.668006 |
bbdcf5cf3cac79835d3bae1515b46419271a45d4 | 798 | py | Python | frappe-bench/apps/erpnext/erpnext/patches/v7_0/set_party_name_in_payment_entry.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/v7_0/set_party_name_in_payment_entry.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v7_0/set_party_name_in_payment_entry.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:39:01.000Z | 2021-04-29T14:39:01.000Z | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
customers = frappe._dict(frappe.db.sql("select name, customer_name from tabCustomer"))
suppliers = frappe._dict(frappe.... | 38 | 96 | 0.749373 |
a54319ff6e16cfc091a05f8b04364e53187ac617 | 908 | py | Python | pacman-arch/test/scripts/pacman-db-upgrade-v9.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/scripts/pacman-db-upgrade-v9.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/scripts/pacman-db-upgrade-v9.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-09-26T08:44:40.000Z | 2021-09-26T08:44:40.000Z | self.description = "pacman-db-upgrade DB version 9 (symlink support removal)"
self.filesystem = [ "mnt_real/subdir/", "mnt -> mnt_real/subdir/", "bar -> ./" ]
fpkg = pmpkg("filesystem")
fpkg.files = ["mnt_real/", "mnt/", "mnt/foo", "bar/", "bar/baz"]
fpkg.backup = ["mnt/foo"]
self.addpkg2db("local", fpkg)
self.dbver... | 34.923077 | 80 | 0.702643 |
b1e0751ec91c7497f5579fab47a0226f3c328282 | 2,177 | py | Python | yolov5-coreml-tflite-converter/coreml/coreml_model/model_spec_generator.py | SchweizerischeBundesbahnen/sbb-ml-models | 485356aeb0a277907c160d435f7f654154046a70 | [
"MIT"
] | null | null | null | yolov5-coreml-tflite-converter/coreml/coreml_model/model_spec_generator.py | SchweizerischeBundesbahnen/sbb-ml-models | 485356aeb0a277907c160d435f7f654154046a70 | [
"MIT"
] | null | null | null | yolov5-coreml-tflite-converter/coreml/coreml_model/model_spec_generator.py | SchweizerischeBundesbahnen/sbb-ml-models | 485356aeb0a277907c160d435f7f654154046a70 | [
"MIT"
] | null | null | null | import logging
import coremltools as ct
from constants import CONFIDENCE_NAME, COORDINATES_NAME, IMAGE_NAME, IOU_NAME, CONF_NAME, DEFAULT_IOU_THRESHOLD, \
DEFAULT_CONF_THRESHOLD, \
BATCH_SIZE, END_COLOR, BLUE
class ModelSpecGenerator:
def __init__(self, model):
self.model = model
def genera... | 41.075472 | 114 | 0.668351 |
597e1238812a24514bdf8da2a13e710110f699b5 | 1,145 | py | Python | Sorting/src/recursive_sorting/notes/quicksort_brian.py | tobias-fyi/02_algorithms | ab1a8a07c3560ad66712992e3af906e8fd316fe2 | [
"MIT"
] | null | null | null | Sorting/src/recursive_sorting/notes/quicksort_brian.py | tobias-fyi/02_algorithms | ab1a8a07c3560ad66712992e3af906e8fd316fe2 | [
"MIT"
] | 8 | 2020-03-24T17:47:23.000Z | 2022-03-12T00:33:21.000Z | cs/lambda_cs/02_algorithms/Sorting/src/recursive_sorting/notes/quicksort_brian.py | tobias-fyi/vela | b0b3d3c6dc3fa397c8c7a492098a02cf75e0ff82 | [
"MIT"
] | null | null | null | # quick sort
[ 5 9 3 7 2 8 1 6]
# pick first mumber
# append all smaller to new array left
# append all bigger to new array right
[3 2 1] [5] [9 7 8 6]
# recurse left
[2 1 ][3][] [5] [9 7 8 6]
#recurse left
[1][2][][3][] [5] [9 7 8 6]
#recurse left
# 1 is sorted, base case
#recurse right
# ... | 18.467742 | 75 | 0.560699 |
abdf8ab809bef34c18f90c0c38a8deac6abd809d | 7,587 | py | Python | commons/embeddings/schema_encoder.py | inyukwo1/qgm_decoder | 70e60afec140ec3e2ee04f980a384e1cf28d761c | [
"MIT"
] | null | null | null | commons/embeddings/schema_encoder.py | inyukwo1/qgm_decoder | 70e60afec140ec3e2ee04f980a384e1cf28d761c | [
"MIT"
] | null | null | null | commons/embeddings/schema_encoder.py | inyukwo1/qgm_decoder | 70e60afec140ec3e2ee04f980a384e1cf28d761c | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
from torch.autograd import Variable
import dgl
from dgl import DGLGraph
import dgl.function as fn
from .net_utils import col_tab_name_encode
def table_to_dgl_graph(par_tab_nums, foreign_keys, col_enc, tab_enc):
g = DGLGraph()
... | 43.354286 | 135 | 0.669039 |
054dc446ae82babc6a019f3946b00e905a2bbb71 | 3,584 | py | Python | CS303/lab4-6/work/SA.py | Wycers/Codelib | 86d83787aa577b8f2d66b5410e73102411c45e46 | [
"MIT"
] | 22 | 2018-08-07T06:55:10.000Z | 2021-06-12T02:12:19.000Z | CS303/lab4-6/work/SA.py | Wycers/Codelib | 86d83787aa577b8f2d66b5410e73102411c45e46 | [
"MIT"
] | 28 | 2020-03-04T23:47:22.000Z | 2022-02-26T18:50:00.000Z | CS303/lab4-6/work/SA.py | Wycers/Codelib | 86d83787aa577b8f2d66b5410e73102411c45e46 | [
"MIT"
] | 4 | 2019-11-09T15:41:26.000Z | 2021-10-10T08:56:57.000Z | from multiprocessing import Pool
from algorithm_ncs import ncs_c as ncs
from math import exp
import numpy as np
import json, os, time
p = 6
class Parameter():
def __init__(self, r, l, e, n, val=None):
self.r = r
self.l = l
self.e = e
self.n = n
self._val = val
@classme... | 30.117647 | 111 | 0.490792 |
553e6a7d62c1b5eef99980d59f4b358e83d20352 | 3,266 | py | Python | reads/reference-data/gtf2bed.py | broadinstitute/gnomadjs | 00da72cdc2cb0753f822c51456ec15147c024a1d | [
"MIT"
] | 38 | 2018-02-24T02:33:52.000Z | 2020-03-03T23:17:04.000Z | reads/reference-data/gtf2bed.py | broadinstitute/gnomadjs | 00da72cdc2cb0753f822c51456ec15147c024a1d | [
"MIT"
] | 385 | 2018-02-21T16:53:13.000Z | 2020-03-04T00:52:40.000Z | reads/reference-data/gtf2bed.py | leklab/sfari_browser | d75a593f13e879f1c92334b1a5e583991d3eebc5 | [
"MIT"
] | 13 | 2020-05-01T13:03:54.000Z | 2022-02-28T13:12:57.000Z | import argparse
import os
import hail as hl
def gtf2bed(gtf: hl.Table) -> hl.Table:
transcripts = gtf.filter(gtf.feature == "transcript")
transcripts = transcripts.select(
transcript_id=transcripts.transcript_id,
chrom=transcripts.interval.start.seqname,
strand=transcripts.strand,
... | 34.378947 | 114 | 0.620331 |
2f2b1b8b69b836958985d1ea2e52a1c1123b09a3 | 1,284 | py | Python | research/cv/FaceDetection/mindspore_hub_conf.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/FaceDetection/mindspore_hub_conf.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/FaceDetection/mindspore_hub_conf.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... | 42.8 | 80 | 0.700935 |
a942934b5cb8ffaf6922554d1f8072ba388a0ed5 | 197 | py | Python | day10/funcWithOutput.py | nurmatthias/100DaysOfCode | 22002e4b31d13e6b52e6b9222d2e91c2070c5744 | [
"Apache-2.0"
] | null | null | null | day10/funcWithOutput.py | nurmatthias/100DaysOfCode | 22002e4b31d13e6b52e6b9222d2e91c2070c5744 | [
"Apache-2.0"
] | null | null | null | day10/funcWithOutput.py | nurmatthias/100DaysOfCode | 22002e4b31d13e6b52e6b9222d2e91c2070c5744 | [
"Apache-2.0"
] | null | null | null |
def format_name(f_name, l_name):
formated_f_name = f_name.title()
formated_l_name = l_name.title()
return f"{formated_f_name} {formated_l_name}"
print(format_name("MATTHias", "ICH")) | 24.625 | 49 | 0.720812 |
19145d30b8cd536819392dfd86e3ceedd719ad1b | 469 | py | Python | docs/_ext/email_role.py | saschajullmann/oso | 85d07c6a1825acba5ec043c917bff6e0f5c7128f | [
"Apache-2.0"
] | null | null | null | docs/_ext/email_role.py | saschajullmann/oso | 85d07c6a1825acba5ec043c917bff6e0f5c7128f | [
"Apache-2.0"
] | 2 | 2021-03-24T19:24:40.000Z | 2021-03-24T19:54:46.000Z | docs/_ext/email_role.py | saschajullmann/oso | 85d07c6a1825acba5ec043c917bff6e0f5c7128f | [
"Apache-2.0"
] | 1 | 2021-03-24T19:51:45.000Z | 2021-03-24T19:51:45.000Z | from docutils import nodes
def email_role(typ, rawtext, text, lineno, inliner, options={}, content=[]):
"""
Role to insert e-mail addresses.
"""
mailto = """<a href="mailto:%s">%s</a>""" % (text, text)
node = nodes.raw("", mailto, format="html")
return [node], []
def setup(app):
app.add_... | 22.333333 | 76 | 0.569296 |
e3158b0b1706f7a814a2be512bd91697df5fe8e0 | 4,915 | py | Python | src/gui.py | austinweis/mp-tetris | b8d0f8ca907414c93962facd79c1e19fdf214394 | [
"MIT"
] | 1 | 2022-02-23T18:19:13.000Z | 2022-02-23T18:19:13.000Z | src/gui.py | austinweis/mp-tetris | b8d0f8ca907414c93962facd79c1e19fdf214394 | [
"MIT"
] | null | null | null | src/gui.py | austinweis/mp-tetris | b8d0f8ca907414c93962facd79c1e19fdf214394 | [
"MIT"
] | null | null | null | import pygame
pygame.font.init()
pygame.init()
font_size = 60
font = pygame.font.Font('./assets/font.ttf', font_size)
buttons = []
labels = []
inputs = []
def draw(target_surface):
for button in buttons:
text_surface = font.render(button.text, True, "white")
pygame.draw.rect(ta... | 46.367925 | 161 | 0.632757 |
8b86936fdb818e47be3152d83ea16b06f6180046 | 1,764 | py | Python | monitor/monitor.py | magns12/python-hwmonitor | 12bceb82303ebcd22a2ef1be1c5afee0c29da269 | [
"MIT"
] | null | null | null | monitor/monitor.py | magns12/python-hwmonitor | 12bceb82303ebcd22a2ef1be1c5afee0c29da269 | [
"MIT"
] | null | null | null | monitor/monitor.py | magns12/python-hwmonitor | 12bceb82303ebcd22a2ef1be1c5afee0c29da269 | [
"MIT"
] | 2 | 2021-03-22T09:32:14.000Z | 2021-03-22T09:43:14.000Z | # Maik Günes - BS-FISI-01 - LF5
# Python-Monitor
# Zeigt die aktuellen Werte des RAMs, der CPU und die minimal- und maximalwerte an.
# Module importieren
import csv
import psutil
import mysql.connector
import sys
import os
import time
from monitorfunctions import executeSQL
# Befehlszeile leeren (Windows)
os.system(... | 29.4 | 130 | 0.649093 |
9a1469545dd809c0f380ffefa33d4f343d7418da | 2,912 | py | Python | project/views/admin_unit_member.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | 1 | 2021-06-01T14:49:18.000Z | 2021-06-01T14:49:18.000Z | project/views/admin_unit_member.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | 286 | 2020-12-04T14:13:00.000Z | 2022-03-09T19:05:16.000Z | project/views/admin_unit_member.py | DanielGrams/gsevpt | a92f71694388e227e65ed1b24446246ee688d00e | [
"MIT"
] | null | null | null | from flask import flash, redirect, render_template, url_for
from flask_babelex import gettext
from flask_security import auth_required
from sqlalchemy.exc import SQLAlchemyError
from project import app, db
from project.access import has_access
from project.forms.admin_unit_member import (
DeleteAdminUnitMemberForm... | 35.084337 | 88 | 0.698489 |
7bf803f5617e89efb3dba10a3f1694e3e2df1938 | 4,999 | py | Python | test/test_tag24.py | kopp/pyventskalender | 6f6455f3c1db07f65a772b2716e4be95fbcd1804 | [
"MIT"
] | null | null | null | test/test_tag24.py | kopp/pyventskalender | 6f6455f3c1db07f65a772b2716e4be95fbcd1804 | [
"MIT"
] | null | null | null | test/test_tag24.py | kopp/pyventskalender | 6f6455f3c1db07f65a772b2716e4be95fbcd1804 | [
"MIT"
] | null | null | null | from unittest import TestCase
from unittest.mock import MagicMock, patch
try:
from pyventskalender import tag24_loesung as heute
MODULE_NAME = "pyventskalender.tag24_loesung"
except ImportError:
from pyventskalender import tag24 as heute
MODULE_NAME = "pyventskalender.tag24"
import pyventskalender
tr... | 48.067308 | 135 | 0.629326 |
d0066dd87fc9a9c81c6ab1d1acb02b1f800a8956 | 8,383 | py | Python | official/cv/ctpn/src/create_dataset.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | official/cv/ctpn/src/create_dataset.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | official/cv/ctpn/src/create_dataset.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... | 47.095506 | 120 | 0.621019 |
41192de1c9a66affa3279c641de03d8fe6138920 | 820 | py | Python | ds/practice/daily_practice/20-07/assets/code/perm2.py | tobias-fyi/vela | b0b3d3c6dc3fa397c8c7a492098a02cf75e0ff82 | [
"MIT"
] | null | null | null | ds/practice/daily_practice/20-07/assets/code/perm2.py | tobias-fyi/vela | b0b3d3c6dc3fa397c8c7a492098a02cf75e0ff82 | [
"MIT"
] | 8 | 2020-03-24T17:47:23.000Z | 2022-03-12T00:33:21.000Z | ds/practice/daily_practice/20-07/assets/code/perm2.py | tobias-fyi/vela | b0b3d3c6dc3fa397c8c7a492098a02cf75e0ff82 | [
"MIT"
] | null | null | null | # === Not my solution === #
# def permute(nums):
# if not nums:
# yield []
# yield from (
# [nums[i], *p] for i in range(len(nums)) for p in permute(nums[:i] + nums[i + 1 :])
# )
from typing import List
# def permute(nums: List[int]) -> List[List[int]]:
# if not nums:
# yield ... | 23.428571 | 92 | 0.507317 |
de51e515b0c0c9912aacac9eacb98aff5c3cd33e | 6,161 | py | Python | 0CTF/2021/Quals/crypto/zer0lfsr/task.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 1 | 2021-11-02T20:53:58.000Z | 2021-11-02T20:53:58.000Z | 0CTF/2021/Quals/crypto/zer0lfsr/task.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | 0CTF/2021/Quals/crypto/zer0lfsr/task.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import random
import signal
import socketserver
import string
from hashlib import sha256
from os import urandom
from secret import flag
def _prod(L):
p = 1
for x in L:
p *= x
return p
def _sum(L):
s = 0
for x in L:
s ^= x
return s
def n2l(x, l):
ret... | 32.771277 | 167 | 0.480928 |
de7d7137c30e1ee68a0037f9f9768480a48e8340 | 1,849 | py | Python | reports/forms.py | Daniel-Hoerauf/cs3240-f16-team11 | 0377bcb8ede9599c04daf7683b065abb2a47f893 | [
"MIT"
] | null | null | null | reports/forms.py | Daniel-Hoerauf/cs3240-f16-team11 | 0377bcb8ede9599c04daf7683b065abb2a47f893 | [
"MIT"
] | null | null | null | reports/forms.py | Daniel-Hoerauf/cs3240-f16-team11 | 0377bcb8ede9599c04daf7683b065abb2a47f893 | [
"MIT"
] | null | null | null | from django import forms
from .models import Report, Folder
from web.models import UserGroup
class ReportForm(forms.ModelForm):
file_field = forms.FileField(required=False,
widget=forms.ClearableFileInput(attrs={'multiple': True}))
def __init__(self, *args, **kwargs):
... | 32.438596 | 91 | 0.601406 |
dfe8593ef0dcd39ef09ff85511890e93e43fc843 | 2,919 | py | Python | runners/great_expectations/runner.py | omio-labs/richterin | c4165fe4910a556f5bba3c7224fed6d35c3fea57 | [
"MIT"
] | null | null | null | runners/great_expectations/runner.py | omio-labs/richterin | c4165fe4910a556f5bba3c7224fed6d35c3fea57 | [
"MIT"
] | null | null | null | runners/great_expectations/runner.py | omio-labs/richterin | c4165fe4910a556f5bba3c7224fed6d35c3fea57 | [
"MIT"
] | null | null | null | from great_expectations.dataset import SqlAlchemyDataset
from jinja2 import Template
from sqlalchemy import create_engine
from job_config import *
DEFAULT_GE_RESULT_FORMAT = "SUMMARY"
class GERunner:
def __init__(self, config: Dict[str, str]):
credentials_path = config.get('GOOGLE_APPLICATION_CREDENTIAL... | 50.327586 | 115 | 0.690647 |
5f1b1000b448fc65af573b3f8f128136d1060481 | 63 | py | Python | x2paddle/torch2paddle.py | usertianqin/X2Paddle | b554a8094ca3e255ef4bd2e80337222a35625133 | [
"Apache-2.0"
] | 559 | 2019-01-14T06:01:55.000Z | 2022-03-31T02:52:43.000Z | x2paddle/torch2paddle.py | usertianqin/X2Paddle | b554a8094ca3e255ef4bd2e80337222a35625133 | [
"Apache-2.0"
] | 353 | 2019-05-07T13:20:03.000Z | 2022-03-31T05:30:12.000Z | x2paddle/torch2paddle.py | usertianqin/X2Paddle | b554a8094ca3e255ef4bd2e80337222a35625133 | [
"Apache-2.0"
] | 241 | 2018-12-25T02:13:51.000Z | 2022-03-27T23:21:43.000Z | from x2paddle.project_convertor.pytorch.torch2paddle import *
| 31.5 | 62 | 0.857143 |
26d6117791c5188cef6d2288150ed0eb0fc8eb53 | 772 | py | Python | python_experiments/data_analysis/parallel_statistics/speedup_analysis_over_origin.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | 8 | 2020-04-14T23:17:00.000Z | 2021-06-21T12:34:04.000Z | python_experiments/data_analysis/parallel_statistics/speedup_analysis_over_origin.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | null | null | null | python_experiments/data_analysis/parallel_statistics/speedup_analysis_over_origin.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | 1 | 2021-01-17T16:26:50.000Z | 2021-01-17T16:26:50.000Z | if __name__ == '__main__':
with open('../data-markdown/parallel/speedup_04_28.md') as ifs:
lines = map(lambda my_str: my_str.strip(), ifs.readlines()[115:])
three_tuple_lst = [map(float, line.split('|')[-3:]) for line in lines]
data_set_lst = [
'ca-GrQc', 'ca-HepTh', 'p2p-Gnutell... | 48.25 | 97 | 0.598446 |
f2f89adc6cd5ac61ef264a571529f0236c0ffb70 | 587 | py | Python | data-pipeline/src/data_pipeline/pipelines/exac_coverage.py | broadinstitute/gnomadjs | 00da72cdc2cb0753f822c51456ec15147c024a1d | [
"MIT"
] | 38 | 2018-02-24T02:33:52.000Z | 2020-03-03T23:17:04.000Z | data-pipeline/src/data_pipeline/pipelines/exac_coverage.py | broadinstitute/gnomadjs | 00da72cdc2cb0753f822c51456ec15147c024a1d | [
"MIT"
] | 385 | 2018-02-21T16:53:13.000Z | 2020-03-04T00:52:40.000Z | data-pipeline/src/data_pipeline/pipelines/exac_coverage.py | broadinstitute/gnomadjs | 00da72cdc2cb0753f822c51456ec15147c024a1d | [
"MIT"
] | 13 | 2020-05-01T13:03:54.000Z | 2022-02-28T13:12:57.000Z | from data_pipeline.pipeline import Pipeline, run_pipeline
from data_pipeline.datasets.exac.exac_coverage import import_exac_coverage
pipeline = Pipeline()
pipeline.add_task(
"import_exac_coverage", import_exac_coverage, "/exac/exac_coverage.ht",
)
###############################################
# Outputs
#####... | 24.458333 | 75 | 0.529813 |
f22917f1474a7531e58c31a8dfb17f45a4a7069c | 3,391 | py | Python | genesis/gen_utils.py | dr-bigfatnoob/quirk | f5025d7139adaf06380c429b436ccbf1e7611a16 | [
"Unlicense"
] | 1 | 2021-03-05T07:44:05.000Z | 2021-03-05T07:44:05.000Z | genesis/gen_utils.py | dr-bigfatnoob/quirk | f5025d7139adaf06380c429b436ccbf1e7611a16 | [
"Unlicense"
] | 3 | 2017-06-04T03:01:31.000Z | 2017-08-04T04:04:37.000Z | genesis/gen_utils.py | dr-bigfatnoob/quirk | f5025d7139adaf06380c429b436ccbf1e7611a16 | [
"Unlicense"
] | null | null | null | from __future__ import print_function, division
import sys
import os
sys.path.append(os.path.abspath("."))
sys.dont_write_bytecode = True
import networkx as nx
from utils.lib import O
import random
import re
__author__ = "bigfatnoob"
class Objective(O):
"""
Objective for a model
"""
def __init__(self, name... | 24.572464 | 104 | 0.663816 |
d9fd7818e4779f52abecd69e4c3aed59c78a7801 | 2,129 | py | Python | research/cv/Auto-DeepLab/src/modules/bn.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/Auto-DeepLab/src/modules/bn.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/Auto-DeepLab/src/modules/bn.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... | 35.483333 | 94 | 0.648192 |
8a8d4eaeef9acb3e9dee31f3c35cae98a03f430f | 652 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/module_utils/xenserver/test_misc.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/module_utils/xenserver/test_misc.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/module_utils/xenserver/test_misc.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright: (c) 2019, Bojan Vitnik <bvitnik@mainstream.rs>
# 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
def test_xapi_to_module_vm_power_state_bad_power_sta... | 36.222222 | 92 | 0.769939 |
6b38ba31519e4cf2157850762db48fc2f849cfb2 | 2,057 | py | Python | INBa/2015/Shemenev_A_V/task_100_30.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | INBa/2015/Shemenev_A_V/task_100_30.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | INBa/2015/Shemenev_A_V/task_100_30.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | #Задача №10, Вариант 30
#Напишите программу "Генератор персонажей" для игры.Пользователю должно быть предоставлено 30 пунктов,
#которые можно распределить между четырьмя характеристиками: Сила, Здоровье, Мудрость и Ловкость.
#Надо сделать так, чтобы пользователь мог не только брать эти пункты из общего "пула", но ... | 33.177419 | 148 | 0.710258 |
6b43c6379979e25f2289bd4ab0a2a9cbce75f484 | 11,672 | py | Python | frappe-bench/apps/erpnext/erpnext/manufacturing/doctype/work_order/test_work_order.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/manufacturing/doctype/work_order/test_work_order.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/manufacturing/doctype/work_order/test_work_order.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import unittest
import frappe
from frappe.utils import flt, time_diff_in_hours, now, add_days, cint
from erpnext.stock.doctype.purchase_receipt.test_pu... | 36.475 | 98 | 0.776474 |
81176e59834cf39d47f53e4b2040c8a355a138cd | 1,185 | py | Python | angstrom/2019/web/Madlibbin/app.py | mystickev/ctf-archives | 89e99a5cd5fb6b2923cad3fe1948d3ff78649b4e | [
"MIT"
] | 1 | 2021-11-02T20:53:58.000Z | 2021-11-02T20:53:58.000Z | angstrom/2019/web/Madlibbin/app.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | angstrom/2019/web/Madlibbin/app.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 1 | 2021-12-19T11:06:24.000Z | 2021-12-19T11:06:24.000Z | import binascii
import json
import os
import re
import redis
from flask import Flask
from flask import request
from flask import redirect, render_template
from flask import abort
app = Flask(__name__)
app.secret_key = os.environ.get('FLAG')
redis = redis.Redis(host='madlibbin_redis', port=6379, db=0)
generate = lam... | 25.212766 | 92 | 0.686076 |
d4ca9d23a407bccfcd03d09adb1ef3fcd4953430 | 7,420 | py | Python | official/nlp/fasttext/eval.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | official/nlp/fasttext/eval.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | official/nlp/fasttext/eval.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2020 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... | 38.848168 | 120 | 0.657951 |
be0f01f7b451b48556d4fc9aae7d5ecd3b4335ae | 1,356 | py | Python | qmk_firmware/util/wavetable_parser.py | DanTupi/personal_setup | 911b4951e4d8b78d6ea8ca335229e2e970fda871 | [
"MIT"
] | 2 | 2021-04-16T23:29:01.000Z | 2021-04-17T02:26:22.000Z | qmk_firmware/util/wavetable_parser.py | DanTupi/personal_setup | 911b4951e4d8b78d6ea8ca335229e2e970fda871 | [
"MIT"
] | null | null | null | qmk_firmware/util/wavetable_parser.py | DanTupi/personal_setup | 911b4951e4d8b78d6ea8ca335229e2e970fda871 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
#
# Copyright 2019 Jack Humbert
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# This progra... | 33.073171 | 95 | 0.64233 |
078f86f8d51af5b107df7994202a66f21d5ed2c9 | 3,210 | py | Python | riqc/libs/bam_sparse.py | ratschlab/software-m53 | affc6b8bffc72c5dbaa9d4eca513c42962de01fe | [
"MIT"
] | null | null | null | riqc/libs/bam_sparse.py | ratschlab/software-m53 | affc6b8bffc72c5dbaa9d4eca513c42962de01fe | [
"MIT"
] | null | null | null | riqc/libs/bam_sparse.py | ratschlab/software-m53 | affc6b8bffc72c5dbaa9d4eca513c42962de01fe | [
"MIT"
] | null | null | null | import pysam
import time
import scipy.sparse as spst
import numpy as np
import sys
import os
import warnings
import h5py
def get_counts_from_single_bam_sparse(fn_bam, regions):
"""This function extracts read counts from a given sparse bam file spanning
a set of given intervals."""
if not os.stat(fn_ba... | 34.891304 | 113 | 0.524922 |
92d2f4f6910ff8ebc3da1ed78cef5ca7df3a479d | 332 | py | Python | 7-assets/past-student-repos/data_struct_and_algo-master/all_zeros.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | 4 | 2021-08-31T00:56:40.000Z | 2021-11-29T03:08:55.000Z | 7-assets/past-student-repos/data_struct_and_algo-master/all_zeros.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | 3 | 2022-02-14T18:48:11.000Z | 2022-03-30T05:26:26.000Z | 7-assets/past-student-repos/data_struct_and_algo-master/all_zeros.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | 1 | 2021-08-31T00:54:51.000Z | 2021-08-31T00:54:51.000Z | def zeros(arr,n):
count=0
for i in range(n):
if arr[i]!=0:
arr[count]=arr[i]
count+=1
while count<n:
arr[count]=0
count+=1
def print_arr(arr,n):
for i in range(n):
print(arr[i],end=" ")
arr=[1,0,0,2,5,0]
zeros(arr,len(arr))
print_arr(a... | 16.6 | 29 | 0.487952 |
92e730cf3553045b47c2e453bf79cc16941b41ea | 3,751 | py | Python | doc/for_dev/scikit-image/future/_hessian_det_appx.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 88 | 2019-01-08T16:39:08.000Z | 2022-02-06T14:19:23.000Z | doc/for_dev/scikit-image/future/_hessian_det_appx.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 13 | 2019-06-20T15:53:10.000Z | 2021-02-09T11:03:29.000Z | doc/for_dev/scikit-image/future/_hessian_det_appx.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 1 | 2019-11-05T03:03:14.000Z | 2019-11-05T03:03:14.000Z | import numpy as np
from transonic import boost
def _clip(x, low, high):
"""Clips coordinate between high and low.
This method was created so that `hessian_det_appx` does not have to make
a Python call.
Parameters
----------
x : int
Coordinate to be clipped.
low : int
The... | 26.230769 | 79 | 0.545188 |
13f33075e306e2a913a97ca3cb232d170f6ab0bf | 941 | py | Python | Algorithms/14_Debugging/2.py | abphilip-codes/Hackerrank_DSA | bb9e233d9d45c5b14c138830602695ad4113fba4 | [
"MIT"
] | 1 | 2021-11-25T13:39:30.000Z | 2021-11-25T13:39:30.000Z | Algorithms/14_Debugging/2.py | abphilip-codes/Hackerrank_DSA | bb9e233d9d45c5b14c138830602695ad4113fba4 | [
"MIT"
] | null | null | null | Algorithms/14_Debugging/2.py | abphilip-codes/Hackerrank_DSA | bb9e233d9d45c5b14c138830602695ad4113fba4 | [
"MIT"
] | null | null | null | # https://www.hackerrank.com/challenges/minimum-operations/problem
def min_operations(red, green, blue):
dp = [[(1<<30) for x in range(8)] for y in range(len(red)+1)]
n = len(red)
dp[0][0] = 0
for i in range(0, n):
for j in range(0, 8):
dp[i + 1][j | 1] = min(dp[i + 1][j | 1], dp[i]... | 26.138889 | 83 | 0.45271 |
e0075fce8e8c944f172673a3916d3e4adc54fc03 | 5,709 | py | Python | official/nlp/q8bert/eval.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 1 | 2021-07-03T06:52:20.000Z | 2021-07-03T06:52:20.000Z | official/nlp/q8bert/eval.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | null | null | null | official/nlp/q8bert/eval.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 2 | 2019-09-01T06:17:04.000Z | 2019-10-04T08:39:45.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 39.372414 | 120 | 0.650552 |
bce6824c67ff2e4e0981370c58f948e7029df36e | 3,217 | py | Python | python_experiments/data_analysis/new_datasets_statistics/reads_querying_time_statistics.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | 8 | 2020-04-14T23:17:00.000Z | 2021-06-21T12:34:04.000Z | python_experiments/data_analysis/new_datasets_statistics/reads_querying_time_statistics.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | null | null | null | python_experiments/data_analysis/new_datasets_statistics/reads_querying_time_statistics.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | 1 | 2021-01-17T16:26:50.000Z | 2021-01-17T16:26:50.000Z | import os
from data_analysis.vldbj_data_parsing.generate_accuracy_markdown import get_tag_info, reads_d_tag, reads_rq_tag, json, \
bprw_tag, bflpmc_tag, flpmc_tag, cw_tag, isp_tag, lind_tag, sling_tag, tsf_tag
from data_analysis.vldbj_data_parsing.probesim_querying_time_statistics import probesim_tag
pair_num_lst... | 44.068493 | 120 | 0.717749 |
9124c37f2634a5080144279043195418fc43a0c1 | 220 | py | Python | Euler-1.py | TFabijo/euler | 58dc07b9adb236890556ccd5d75ca9dbd2b50df9 | [
"MIT"
] | null | null | null | Euler-1.py | TFabijo/euler | 58dc07b9adb236890556ccd5d75ca9dbd2b50df9 | [
"MIT"
] | null | null | null | Euler-1.py | TFabijo/euler | 58dc07b9adb236890556ccd5d75ca9dbd2b50df9 | [
"MIT"
] | null | null | null | def vsota_stevil_delivih_z_5_in3(n):
delitelji = []
for x in range(1,n):
if x % 5 == 0 or x % 3 == 0:
delitelji.append(x)
return sum(delitelji)
vsota_stevil_delivih_z_5_in3(1000) | 24.444444 | 37 | 0.590909 |
fc1df27464eb123e5c86ed7bd9b0a39736f76e3d | 5,612 | py | Python | 7-assets/past-student-repos/LambdaSchool-master/m6/63d1/robot_sort/robot_sort.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/past-student-repos/LambdaSchool-master/m6/63d1/robot_sort/robot_sort.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/past-student-repos/LambdaSchool-master/m6/63d1/robot_sort/robot_sort.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null |
class SortingRobot:
def __init__(self, l):
"""
SortingRobot takes a list and sorts it.
"""
self._list = l # The list the robot is tasked with sorting
self._item = None # The item the robot is holding
self._position = 0 # The list position the ro... | 36.921053 | 398 | 0.538845 |
5d0e1a538dc6771e9aed1b991b960507370cb37d | 1,138 | py | Python | INBa/2015/KODZOKOV_M_M/task_9_9.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | INBa/2015/KODZOKOV_M_M/task_9_9.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | INBa/2015/KODZOKOV_M_M/task_9_9.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | #Создайте игру, в которой компьютер выбирает какое-либо слово, а игрок должен его отгадать.
#Компьютер сообщает игроку, сколько букв в слове, и дает пять попыток узнать,
#есть ли какая-либо буква в слове, причем программа может отвечать только "Да" и "Нет".
#Вслед за тем игрок должен попробовать отгадать слово.
#Ко... | 39.241379 | 152 | 0.739895 |
db4c4a90bce966e45197657bbd81f47ba0d0e2b5 | 4,574 | py | Python | test/test_npu/test_network_ops/test_conv_tbc_backward.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_conv_tbc_backward.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_conv_tbc_backward.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... | 47.154639 | 102 | 0.637298 |
db4f94748e1b60e5e3bbc1ea0dc65dae1e957f15 | 478 | py | Python | frappe-bench/apps/erpnext/erpnext/patches/v8_6/set_write_permission_for_quotation_for_sales_manager.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_6/set_write_permission_for_quotation_for_sales_manager.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v8_6/set_write_permission_for_quotation_for_sales_manager.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:39:01.000Z | 2021-04-29T14:39:01.000Z | # Copyright (c) 2017, Frappe and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
# Set write permission to permlevel 1 for sales manager role in Quotation doctype
frappe.db.sql(""" update `tabCustom DocPerm` set `tabCustom D... | 43.454545 | 95 | 0.759414 |
be4f35d3fb75c7f76e633323f3b8367e858a62eb | 2,386 | py | Python | src/onegov/org/models/form.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/org/models/form.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/org/models/form.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.form.models import FormDefinition
from onegov.org.models.extensions import AccessExtension
from onegov.org.models.extensions import ContactExtension
from onegov.org.models.extensions import CoordinatesExtension
from onegov.org.models.extensions import HoneyPotExtension
from onegov.org.models.extensions impo... | 36.151515 | 75 | 0.69363 |
be6674df614416a572a7b3abedf01eef2801693c | 2,911 | py | Python | docker/build.py | Killerhaschen/marvin-telegram-bot | c65e890a00450ed6ed4312d93e259db0c080ef6d | [
"MIT"
] | 1 | 2020-01-16T08:40:00.000Z | 2020-01-16T08:40:00.000Z | docker/build.py | Killerhaschen/marvin-telegram-bot | c65e890a00450ed6ed4312d93e259db0c080ef6d | [
"MIT"
] | null | null | null | docker/build.py | Killerhaschen/marvin-telegram-bot | c65e890a00450ed6ed4312d93e259db0c080ef6d | [
"MIT"
] | 1 | 2019-10-16T08:11:51.000Z | 2019-10-16T08:11:51.000Z | from pathlib import Path
from os import chdir, system
import os
from shutil import copyfile
config_template = """[general]
# Sets the log level for stdout
logging = "DEBUG"
[bot]
# The Bot API token
token = "{}"
"""
bot_template = """from samt import Bot, Context
bot = Bot()
@bot.default_answer
def echo():
r... | 23.103175 | 77 | 0.588114 |
fe3f7a093a9e8e57efeaaaf83c48b8765ea07307 | 1,051 | py | Python | Python/Exercícios_Python/011_pintando_parede.py | vdonoladev/aprendendo-programacao | 83abbcd6701b2105903b28fd549738863418cfb8 | [
"MIT"
] | null | null | null | Python/Exercícios_Python/011_pintando_parede.py | vdonoladev/aprendendo-programacao | 83abbcd6701b2105903b28fd549738863418cfb8 | [
"MIT"
] | null | null | null | Python/Exercícios_Python/011_pintando_parede.py | vdonoladev/aprendendo-programacao | 83abbcd6701b2105903b28fd549738863418cfb8 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""011 - Pintando parede
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1KC8GS6at3kDF3m_NS4JP_xhOsH6XFHeQ
"""
larg = float(input('Qual a largura da sua parede?'))
alt = float(input('Qual a altura da sua parede?'))
area = larg ... | 30.911765 | 94 | 0.686013 |
fe43945e2baf2c3ff44b19f279edc993ef118ad3 | 1,441 | py | Python | auswertung.py | Hofei90/kuehltest_wertelogging | ae8be084d077c886312275c7fa0366aa28d27beb | [
"MIT"
] | null | null | null | auswertung.py | Hofei90/kuehltest_wertelogging | ae8be084d077c886312275c7fa0366aa28d27beb | [
"MIT"
] | null | null | null | auswertung.py | Hofei90/kuehltest_wertelogging | ae8be084d077c886312275c7fa0366aa28d27beb | [
"MIT"
] | null | null | null | from db_modell import Log, Kuehlvarianten, db_create_table
import datetime
NOW = datetime.datetime.now()
def varianten_auslesen():
varianten = Kuehlvarianten.select().dicts()
return varianten
def anzahl_messungen_last_ermitteln(variante):
anzahl = Log.select().where(Log.variante == variante["id"], Log.... | 30.659574 | 90 | 0.690493 |
fe4cb745be07c4dce19c8f3f8dc1501deaaa4f63 | 15,753 | py | Python | dev/Training.py | betaros/traffic_sign | 6f5ef4afb7093c929cc2e94c7f72daebbd149b7e | [
"MIT"
] | null | null | null | dev/Training.py | betaros/traffic_sign | 6f5ef4afb7093c929cc2e94c7f72daebbd149b7e | [
"MIT"
] | null | null | null | dev/Training.py | betaros/traffic_sign | 6f5ef4afb7093c929cc2e94c7f72daebbd149b7e | [
"MIT"
] | null | null | null | """
Authors: Jan Fuesting
Last edited: 10.09.2018
"""
from Misc import Misc
import cv2
import os
import pandas as pd
import tarfile
import urllib.request
import zipfile
class Training:
"""
Training class
"""
def __init__(self):
"""
Initialising
"""
self.misc ... | 43.277473 | 133 | 0.523964 |
2280b06b05928cc19ce39aa9ef7d82c881844192 | 428 | py | Python | list_translator.py | SvenElyes/SvenFPQualityMatch | 31a4681568786139d2e31c8a4d32346f24c047c4 | [
"MIT"
] | 1 | 2020-12-31T01:57:33.000Z | 2020-12-31T01:57:33.000Z | list_translator.py | SvenElyes/SvenFPQualityMatch | 31a4681568786139d2e31c8a4d32346f24c047c4 | [
"MIT"
] | null | null | null | list_translator.py | SvenElyes/SvenFPQualityMatch | 31a4681568786139d2e31c8a4d32346f24c047c4 | [
"MIT"
] | null | null | null | import webcolors
import json
#file to translate the hex values in class_list.json file to rgb
class_list=json.load(open('class_list.json'))
return_list={}
for keysss in class_list.keys():
c=webcolors.hex_to_rgb(keysss)
return_key='{:03}{:03}{:03}'.format(c[0],c[1],c[2])
return_list[int(return_key)]=... | 25.176471 | 65 | 0.712617 |
431ed3f685bbce0a7e2525fc1dfb47b406295dcd | 5,236 | py | Python | pipeline.py | danielvh8/RP-granzyme-B | fcb29321f8ad55bfaa56e31f45eeab907e1ed1af | [
"MIT"
] | null | null | null | pipeline.py | danielvh8/RP-granzyme-B | fcb29321f8ad55bfaa56e31f45eeab907e1ed1af | [
"MIT"
] | null | null | null | pipeline.py | danielvh8/RP-granzyme-B | fcb29321f8ad55bfaa56e31f45eeab907e1ed1af | [
"MIT"
] | null | null | null | import gzip, csv, re
from pathlib import Path
from tqdm import tqdm
from configparser import ConfigParser
from collections import Counter
from util import Matches
from util import Match
from util import Proteome
from util import Protein
from util import Target
from Statistics import Significant
parser = ConfigParser(... | 40.276923 | 140 | 0.569519 |
4a7a996acd77017f97fa73fe53de431b1ce35e52 | 19,047 | py | Python | suds/bindings/binding.py | koocieyu/interactive-tutorials | 873851b37f0a13b6218ba1e656d51169010981fe | [
"Apache-2.0"
] | 46 | 2018-10-22T23:34:03.000Z | 2022-03-31T09:31:34.000Z | suds/bindings/binding.py | koocieyu/interactive-tutorials | 873851b37f0a13b6218ba1e656d51169010981fe | [
"Apache-2.0"
] | 317 | 2018-10-05T23:51:48.000Z | 2022-03-22T17:38:52.000Z | suds/bindings/binding.py | koocieyu/interactive-tutorials | 873851b37f0a13b6218ba1e656d51169010981fe | [
"Apache-2.0"
] | 46 | 2018-10-10T18:55:00.000Z | 2022-03-28T07:27:04.000Z | # This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) GNU Lesser General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will ... | 35.403346 | 87 | 0.571271 |
434e58acc1bc913a7a76eeaa03b7e4f6abf1978a | 937 | py | Python | genutil/datatypes.py | MZH-bust/genutil | f17190ec484d5844f8950908cc07556a5b1429e7 | [
"MIT"
] | null | null | null | genutil/datatypes.py | MZH-bust/genutil | f17190ec484d5844f8950908cc07556a5b1429e7 | [
"MIT"
] | null | null | null | genutil/datatypes.py | MZH-bust/genutil | f17190ec484d5844f8950908cc07556a5b1429e7 | [
"MIT"
] | null | null | null | """Dieses Modul stellt Hilfsfunktionen im Bezug auf Datentypen zur Verfügung.
z.B.: Überprüfung von Datentypen"""
def is_list_of_strings(obj: any) -> bool:
"""Gibt zurück, ob es sich bei einer übergebenen Variable um eine Liste von Strings handelt.
Examples
--------
>>> is_list_of_strings(["String1",... | 26.027778 | 96 | 0.649947 |
60db75543ccf98472ad6b413269219b2df116233 | 4,828 | py | Python | Project6/main.py | veronikadim99/Wissenschaftliches-Rechnen | 3b7c86e9488bf434f3ad1d590f5b9bb9b4cdf218 | [
"Apache-2.0"
] | null | null | null | Project6/main.py | veronikadim99/Wissenschaftliches-Rechnen | 3b7c86e9488bf434f3ad1d590f5b9bb9b4cdf218 | [
"Apache-2.0"
] | null | null | null | Project6/main.py | veronikadim99/Wissenschaftliches-Rechnen | 3b7c86e9488bf434f3ad1d590f5b9bb9b4cdf218 | [
"Apache-2.0"
] | null | null | null | import numpy as np
def find_root_bisection(f: object, lival: np.floating, rival: np.floating, ival_size: np.floating = -1.0,
n_iters_max: int = 256) -> np.floating:
"""
Find a root of function f(x) in (lival, rival) with bisection method.
Arguments:
f: function object (assumed... | 31.97351 | 116 | 0.618268 |
716eaa52dc80d73438383398e7fc76f1ee342698 | 1,858 | py | Python | leetcode/008-String-to-Integer/Str2Int_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2017-05-18T06:11:02.000Z | 2017-05-18T06:11:02.000Z | leetcode/008-String-to-Integer/Str2Int_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | leetcode/008-String-to-Integer/Str2Int_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | # @author: cchen
# Terrible code, and it will be updated and simplified later.
class Solution:
# @param {string} str
# @return {integer}
def extractnum(self, ss):
num = 0
for i in range(len(ss)):
if ss[i].isdigit() == False:
break
else:
... | 27.731343 | 61 | 0.412809 |
e0c24274c35aa65834cfacfb1828c6f92dafcd5f | 3,539 | py | Python | examples/nowcoder/SQL2/tests.py | zhengtong0898/django-decode | 69680853a4a5b07f6a9c4b65c7d86b2d401a92b1 | [
"MIT"
] | 5 | 2020-07-14T07:48:10.000Z | 2021-12-20T21:20:10.000Z | examples/nowcoder/SQL2/tests.py | zhengtong0898/django-decode | 69680853a4a5b07f6a9c4b65c7d86b2d401a92b1 | [
"MIT"
] | 7 | 2021-03-26T03:13:38.000Z | 2022-03-12T00:42:03.000Z | examples/nowcoder/SQL2/tests.py | zhengtong0898/django-decode | 69680853a4a5b07f6a9c4b65c7d86b2d401a92b1 | [
"MIT"
] | 1 | 2021-02-16T07:04:25.000Z | 2021-02-16T07:04:25.000Z | from datetime import date
from django.db import connections
from django.test import TestCase, TransactionTestCase
from .models import employees
from django.db.models import Max
from django.db.models.expressions import Subquery, OuterRef
# Create your tests here.
class SimpleTest(TransactionTestCase):
reset_seque... | 46.565789 | 124 | 0.620797 |
e0ec71d11644d4f9c13e6aef1ec4b416adbfd9b4 | 271 | py | Python | py-basics/src/lectures/basics/hello-world.py | AndrasTarlos/s4f | bfe2d631a9a2715953d8ac5ddc8ef97d3cefb426 | [
"CC0-1.0"
] | null | null | null | py-basics/src/lectures/basics/hello-world.py | AndrasTarlos/s4f | bfe2d631a9a2715953d8ac5ddc8ef97d3cefb426 | [
"CC0-1.0"
] | null | null | null | py-basics/src/lectures/basics/hello-world.py | AndrasTarlos/s4f | bfe2d631a9a2715953d8ac5ddc8ef97d3cefb426 | [
"CC0-1.0"
] | 4 | 2021-12-13T15:52:00.000Z | 2022-03-28T13:54:53.000Z | """
8kyu | Classic Hello World
https://www.codewars.com/kata/57036f007fd72e3b77000023/python
"""
class Solution:
@staticmethod
def main(*args):
print("Hello World!")
Solution.main("greetings from Python!") # -> displays "Hello World!" to the console
| 19.357143 | 84 | 0.686347 |
c72acb76b0eff3e1220ad8f97d2223822b2251a9 | 22,171 | py | Python | assets/udk/python/oood/oood.py | brnnnfx/openoffice-org | 8b1023c59fd9c7a58d108bb0b01dd1f8884c9163 | [
"Apache-2.0"
] | 5 | 2019-10-14T23:00:48.000Z | 2021-11-06T22:21:06.000Z | assets/udk/python/oood/oood.py | brnnnfx/openoffice-org | 8b1023c59fd9c7a58d108bb0b01dd1f8884c9163 | [
"Apache-2.0"
] | 31 | 2020-11-14T09:27:16.000Z | 2022-03-08T17:09:15.000Z | assets/udk/python/oood/oood.py | brnnnfx/openoffice-org | 8b1023c59fd9c7a58d108bb0b01dd1f8884c9163 | [
"Apache-2.0"
] | 15 | 2020-11-10T17:04:25.000Z | 2022-01-31T12:12:48.000Z | #*************************************************************************
#
# $RCSfile: oood.py,v $
#
# $Revision: 1.1 $
#
# last change: $Author: jbu $ $Date: 2004/10/03 17:41:40 $
#
# The Contents of this file are made available subject to the terms of
# either of the following licenses
#
# - GNU ... | 32.65243 | 93 | 0.579631 |
c72e458f2e9f9880c956d2144329676f270150bb | 6,125 | py | Python | test/distributed/_sharded_optim/test_sharded_optim.py | vuanvin/pytorch | 9267fd8d7395074001ad7cf2a8f28082dbff6b0b | [
"Intel"
] | 5 | 2018-04-24T13:41:12.000Z | 2019-07-09T07:32:09.000Z | test/distributed/_sharded_optim/test_sharded_optim.py | vuanvin/pytorch | 9267fd8d7395074001ad7cf2a8f28082dbff6b0b | [
"Intel"
] | 14 | 2021-10-14T06:58:50.000Z | 2021-12-17T11:51:07.000Z | test/distributed/_sharded_optim/test_sharded_optim.py | vuanvin/pytorch | 9267fd8d7395074001ad7cf2a8f28082dbff6b0b | [
"Intel"
] | 7 | 2020-08-31T22:49:59.000Z | 2020-09-15T14:29:07.000Z | # Owner(s): ["oncall: distributed"]
import torch
import torch.optim as optim
import torch.distributed._sharded_tensor as sharded_tensor
from copy import deepcopy
from torch.distributed._sharding_spec import (
ChunkShardingSpec,
)
from torch.distributed._sharded_optim import (
ShardedOptimizer,
named_param... | 32.930108 | 107 | 0.619429 |
90eee530b601ffd5529f4c0668e64f0087231365 | 24,316 | py | Python | Packs/WolkenITSM/Integrations/WolkenITSM/WolkenITSM.py | cstone112/content | 7f039931b8cfc20e89df52d895440b7321149a0d | [
"MIT"
] | 2 | 2021-12-06T21:38:24.000Z | 2022-01-13T08:23:36.000Z | Packs/WolkenITSM/Integrations/WolkenITSM/WolkenITSM.py | cstone112/content | 7f039931b8cfc20e89df52d895440b7321149a0d | [
"MIT"
] | 87 | 2022-02-23T12:10:53.000Z | 2022-03-31T11:29:05.000Z | Packs/WolkenITSM/Integrations/WolkenITSM/WolkenITSM.py | cstone112/content | 7f039931b8cfc20e89df52d895440b7321149a0d | [
"MIT"
] | 2 | 2022-01-05T15:27:01.000Z | 2022-02-01T19:27:43.000Z | import demistomock as demisto # noqa: F401
from CommonServerPython import * # noqa: F401
'''IMPORTS'''
import traceback
from typing import Any, Dict
# from _collections import defaultdict
class Client(BaseClient):
def __init__(self, server_url, verify, proxy, headers, auth, clientId, domain, serviceAccount, ... | 39.410049 | 120 | 0.64694 |
462fef4a321ded42733058f2e1654b405113dbc7 | 61 | py | Python | Shivani/sphere vol.py | 63Shivani/Python-BootCamp | 2ed0ef95af35d35c0602031670fecfc92d8cea0a | [
"MIT"
] | null | null | null | Shivani/sphere vol.py | 63Shivani/Python-BootCamp | 2ed0ef95af35d35c0602031670fecfc92d8cea0a | [
"MIT"
] | null | null | null | Shivani/sphere vol.py | 63Shivani/Python-BootCamp | 2ed0ef95af35d35c0602031670fecfc92d8cea0a | [
"MIT"
] | null | null | null | r=6
volume=(4*3.14*r*r*r)/3
print("volume of sphere",volume)
| 15.25 | 32 | 0.672131 |
d3e2427e9dd9bfd28021281d99a7de8d1b5efd8b | 11,711 | py | Python | kicker/view_game.py | GeorgJohn/2D_Kicker_git | 8a451f2d573d703ceac1c2011f26e6ff953d2090 | [
"MIT"
] | null | null | null | kicker/view_game.py | GeorgJohn/2D_Kicker_git | 8a451f2d573d703ceac1c2011f26e6ff953d2090 | [
"MIT"
] | null | null | null | kicker/view_game.py | GeorgJohn/2D_Kicker_git | 8a451f2d573d703ceac1c2011f26e6ff953d2090 | [
"MIT"
] | 1 | 2018-08-24T17:53:41.000Z | 2018-08-24T17:53:41.000Z | import pygame
from kicker.CONST_VIEW import *
from kicker.CONST_BALL import Coordinate
class View:
def __init__(self):
pygame.init()
self.screen = pygame.display.set_mode((SCREEN_WIDTH, SCREEN_HIGH))
self.smallfont = pygame.font.SysFont("comicsansms", 72)
pygame.display.set_caption... | 62.625668 | 119 | 0.656562 |
9ec77335d5e8c23b8133c0ba14450a7745dd81e9 | 470 | py | Python | Programming Languages/Python/Theory/100_Python_Challenges/Section_3_List/57. Transform a list of characters into a list of dictionaries.py | jaswinder9051998/Resources | fd468af37bf24ca57555d153ee64693c018e822e | [
"MIT"
] | 101 | 2021-12-20T11:57:11.000Z | 2022-03-23T09:49:13.000Z | Programming Languages/Python/Theory/100_Python_Challenges/Section_3_List/57. Transform a list of characters into a list of dictionaries.py | Sid-1164/Resources | 3987dcaeddc8825f9bc79609ff26094282b8ece1 | [
"MIT"
] | 4 | 2022-01-12T11:55:56.000Z | 2022-02-12T04:53:33.000Z | Programming Languages/Python/Theory/100_Python_Challenges/Section_3_List/57. Transform a list of characters into a list of dictionaries.py | Sid-1164/Resources | 3987dcaeddc8825f9bc79609ff26094282b8ece1 | [
"MIT"
] | 38 | 2022-01-12T11:56:16.000Z | 2022-03-23T10:07:52.000Z | """
Write a function that transforms a list of characters into a list of dictionaries.
The keys are the characters themselves and the values are the ASCII codes of those characters.
input_list = ['P', 'y', 't', 'h', 'o', 'n']
Expected output = [{'P': 80}, {'y': 121}, {'t': 116}, {'h': 104}, {'o': 111}, {'n': 110}]
"... | 29.375 | 94 | 0.614894 |
c37e9771927603c4e6178b92ea3eb14c35840861 | 1,930 | py | Python | Week 6/kmeans_code.py | mayankpadhi/AI_Codes | 8631f18cd9d1bba9ffc142b1ede0197b512157e2 | [
"MIT"
] | null | null | null | Week 6/kmeans_code.py | mayankpadhi/AI_Codes | 8631f18cd9d1bba9ffc142b1ede0197b512157e2 | [
"MIT"
] | null | null | null | Week 6/kmeans_code.py | mayankpadhi/AI_Codes | 8631f18cd9d1bba9ffc142b1ede0197b512157e2 | [
"MIT"
] | null | null | null | import numpy as np
def em(x, n_clusters, eps):
n_examples, n_features = x.shape
last_log_estimate = None
mean = np.random.uniform(np.min(x, axis=0), np.max(x, axis=0), size=(n_clusters, n_features))
cov = [np.identity(n_features) for _ in range(n_clusters)]
p = np.full((n_clusters,), 1.0 / n_clust... | 33.859649 | 106 | 0.604145 |
82af485850cfc220820a08ce2832e8a8a47a216d | 5,507 | py | Python | api.py | reviforks/imgtl | b2141f9f0d7f2d318661f6ff6ab9594cff5b80f3 | [
"MIT"
] | null | null | null | api.py | reviforks/imgtl | b2141f9f0d7f2d318661f6ff6ab9594cff5b80f3 | [
"MIT"
] | null | null | null | api.py | reviforks/imgtl | b2141f9f0d7f2d318661f6ff6ab9594cff5b80f3 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import requests
from flask import Flask
from flask.ext.restful import Api, Resource
from flask.ext.restful.reqparse import RequestParser, Argument
from werkzeug.datastructures import FileStorage
from imgtl.db import db, log_db, User
from imgtl.const import BASE... | 39.056738 | 296 | 0.633376 |
817eb380991ba04dcf81c3574d7f070bd9530008 | 1,969 | py | Python | python_experiments/run_vldbj_experiments/run_local_push_dynamic_update.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | 8 | 2020-04-14T23:17:00.000Z | 2021-06-21T12:34:04.000Z | python_experiments/run_vldbj_experiments/run_local_push_dynamic_update.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | null | null | null | python_experiments/run_vldbj_experiments/run_local_push_dynamic_update.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | 1 | 2021-01-17T16:26:50.000Z | 2021-01-17T16:26:50.000Z | import datetime
from exec_utilities import time_out_util
from exec_utilities.exec_utils import *
def run_exp():
our_exec_path = '/homes/ywangby/workspace/yche/git-repos/SimRank/APS/build'
data_set_lst = [
# 'ca-GrQc', 'ca-HepTh', 'p2p-Gnutella06', 'wiki-Vote',
# 'email-Enron', 'email-EuAll',... | 35.8 | 120 | 0.609954 |
f206d6d0d5176cdf0c208e2d34b1c97275a3c607 | 6,662 | py | Python | src/onegov/election_day/views/manage/data_sources.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/election_day/views/manage/data_sources.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/election_day/views/manage/data_sources.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | """ The manage subscription views. """
import morepath
from onegov.election_day import _
from onegov.election_day import ElectionDayApp
from onegov.election_day.collections import DataSourceCollection
from onegov.election_day.collections import DataSourceItemCollection
from onegov.election_day.forms import DataSource... | 26.97166 | 69 | 0.65716 |
f20717090b5a7a2d2167c8612c5ad20d0447ac4f | 1,766 | py | Python | Openharmony v1.0/third_party/ltp/testcases/kernel/power_management/pm_ilb_test.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_ilb_test.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_ilb_test.py | dawmlight/vendor_oh_fun | bc9fb50920f06cd4c27399f60076f5793043c77d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
''' This Python script interprets interrupt values.
Validates Ideal load balancer runs in same package where workload is running
'''
import os
import sys
from optparse import OptionParser
from pm_sched_mc import *
__author__ = "Poornima Nayak <mpnayak@linux.vnet.ibm.com>"
class Usage(Excep... | 30.448276 | 107 | 0.64949 |
480f6f2bb9c3faa153208d28fe8978d91c03911f | 150 | py | Python | exercises/zh/solution_01_02_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/zh/solution_01_02_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/zh/solution_01_02_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | # 导入德语类
from spacy.lang.de import German
# 创建nlp对象
nlp = German()
# 处理文本 (这是德语"Kind regards!"的意思)
doc = nlp("Liebe Grüße!")
# 打印文本
print(doc.text)
| 12.5 | 32 | 0.68 |
482c249c14feba3547935d0878fef9f1940cf9c6 | 8,034 | py | Python | backend/songwriter/models.py | giliam/turbo-songwriter | 3d100b08dc19c60d7a1324120e06bd9f971eea5a | [
"MIT"
] | null | null | null | backend/songwriter/models.py | giliam/turbo-songwriter | 3d100b08dc19c60d7a1324120e06bd9f971eea5a | [
"MIT"
] | 12 | 2017-09-25T20:13:29.000Z | 2020-02-12T00:12:41.000Z | backend/songwriter/models.py | giliam/turbo-songwriter | 3d100b08dc19c60d7a1324120e06bd9f971eea5a | [
"MIT"
] | null | null | null | # coding:utf-8
from datetime import timedelta
from django.db import models
from django.utils.translation import ugettext_lazy as _
class Author(models.Model):
firstname = models.CharField(
max_length=150,
default="",
blank=True
)
lastname = models.CharField(
max_length=1... | 23.286957 | 94 | 0.606298 |
4888662eb1bbe61b148f0edba6094d4059a4c534 | 35 | py | Python | lib/python3.5/copyreg.py | hwroitzsch/BikersLifeSaver | 469c738fdd6352c44a3f20689b17fa8ac04ad8a2 | [
"MIT"
] | 1 | 2020-08-16T04:04:23.000Z | 2020-08-16T04:04:23.000Z | lib/python3.5/copyreg.py | hwroitzsch/BikersLifeSaver | 469c738fdd6352c44a3f20689b17fa8ac04ad8a2 | [
"MIT"
] | 5 | 2020-06-05T18:53:24.000Z | 2021-12-13T19:49:15.000Z | lib/python3.5/copyreg.py | hwroitzsch/BikersLifeSaver | 469c738fdd6352c44a3f20689b17fa8ac04ad8a2 | [
"MIT"
] | null | null | null | /usr/local/lib/python3.5/copyreg.py | 35 | 35 | 0.8 |
83b679c858835422f20ea41b4681aae9efcdae64 | 3,982 | py | Python | Liter_Client/PicWindow.py | Drelf2018/Liter | e12ffdd22ee7b2724722c38e852fc9c1b2f180ad | [
"MIT"
] | null | null | null | Liter_Client/PicWindow.py | Drelf2018/Liter | e12ffdd22ee7b2724722c38e852fc9c1b2f180ad | [
"MIT"
] | null | null | null | Liter_Client/PicWindow.py | Drelf2018/Liter | e12ffdd22ee7b2724722c38e852fc9c1b2f180ad | [
"MIT"
] | null | null | null | from PyQt5.QtCore import Qt, QRect, QPointF
from PyQt5.QtGui import QPainter, QColor, QBrush, QWheelEvent
from PyQt5.QtWidgets import QWidget, QDesktopWidget
from math import sqrt
from PIL import ImageQt
import time
class PicWindow(QWidget):
'''
圆角边框类\n
width, height 去掉边框后界面的长宽\n
r 界面圆角半径\n
s 阴影扩散... | 32.639344 | 95 | 0.582622 |
f7a2058164f3717dce9a99771aac5a614ee3d7aa | 637 | py | Python | my-cs/intern/java_details/java_sort_selection_details/partioners_test.py | zaqwes8811/cs-courses | aa9cf5ad109c9cfcacaadc11bf2defb2188ddce2 | [
"Apache-2.0"
] | null | null | null | my-cs/intern/java_details/java_sort_selection_details/partioners_test.py | zaqwes8811/cs-courses | aa9cf5ad109c9cfcacaadc11bf2defb2188ddce2 | [
"Apache-2.0"
] | null | null | null | my-cs/intern/java_details/java_sort_selection_details/partioners_test.py | zaqwes8811/cs-courses | aa9cf5ad109c9cfcacaadc11bf2defb2188ddce2 | [
"Apache-2.0"
] | null | null | null | import unittest
import random
from stanford_algoritms_part1.build_blocks import partioners
class TestSequenceFunctions(unittest.TestCase):
def setUp(self):
self.seq = range(10)
def test_shuffle(self):
# make sure the shuffled sequence does not lose any elements
random.shuffle(self.se... | 28.954545 | 68 | 0.66248 |
f70a87ce62cba398e7370660217593d337998146 | 140 | py | Python | python/data_sutram/scraper/test.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/data_sutram/scraper/test.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/data_sutram/scraper/test.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | def test_func(i):
print(i)
if i>10:
return
else:
test_func(i+1)
if __name__ == "__main__":
test_func(2) | 15.555556 | 26 | 0.521429 |
f775b997b3475935390c99168c02ac6d888ce4b2 | 5,397 | py | Python | Packs/Arduino/Integrations/Arduino/Arduino.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/Arduino/Integrations/Arduino/Arduino.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/Arduino/Integrations/Arduino/Arduino.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import socket
import demistomock as demisto # noqa: F401
from CommonServerPython import * # noqa: F401
''' CONSTANTS '''
''' CLIENT CLASS '''
class Server():
def __init__(self, host, port):
self.host = host
self.port = port
self.validate()
def validate(self):
is_ip = Fals... | 30.491525 | 106 | 0.607189 |
e3d125fabd6a9e58c6078faea6102f7932417e29 | 17,588 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/gcp_sql_instance_info.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/gcp_sql_instance_info.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/gcp_sql_instance_info.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Google
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
... | 37.341826 | 124 | 0.596145 |
542ac11e3f26e47cef29dee9069fe26c0b5b19a4 | 346 | py | Python | frappe-bench/apps/erpnext/erpnext/patches/v7_2/delete_fleet_management_module_def.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/v7_2/delete_fleet_management_module_def.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v7_2/delete_fleet_management_module_def.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:39:01.000Z | 2021-04-29T14:39:01.000Z | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
if frappe.db.exists('Module Def', 'Fleet Management'):
frappe.db.sql("""delete from `tabModule Def`
where module_nam... | 34.6 | 68 | 0.751445 |
49dec5a74632ad15c2c13c7b53a3049fc07f9533 | 252,537 | py | Python | deutschland/destatis/api/default_api.py | kiranmusze/deutschland | 86d8ead3f38ad88ad66bb338b9f5a8db06992344 | [
"Apache-2.0"
] | null | null | null | deutschland/destatis/api/default_api.py | kiranmusze/deutschland | 86d8ead3f38ad88ad66bb338b9f5a8db06992344 | [
"Apache-2.0"
] | null | null | null | deutschland/destatis/api/default_api.py | kiranmusze/deutschland | 86d8ead3f38ad88ad66bb338b9f5a8db06992344 | [
"Apache-2.0"
] | null | null | null | """
Destatis-API
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: 1.0
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
from deutschland.desta... | 43.117125 | 124 | 0.48518 |
b20278ff28cad2bb560d6ee1f751e05043874c1c | 13,855 | py | Python | official/cv/ctpn/src/dataset.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 1 | 2021-11-18T08:17:44.000Z | 2021-11-18T08:17:44.000Z | official/cv/ctpn/src/dataset.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | null | null | null | official/cv/ctpn/src/dataset.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 2 | 2019-09-01T06:17:04.000Z | 2019-10-04T08:39:45.000Z | # Copyright 2020 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... | 42.5 | 120 | 0.632479 |
4d60563e7ab27cf7e91ac1fc07d886d23cafe08d | 553 | py | Python | envs/rpg/levels/slash_spike.py | etigerstudio/zilong-on-fire | 5144a471b2d39ea38a47d394e648de00dd13cd8b | [
"MIT"
] | 2 | 2021-01-07T01:10:49.000Z | 2022-01-21T09:37:16.000Z | envs/rpg/levels/slash_spike.py | etigerstudio/zilong-on-fire | 5144a471b2d39ea38a47d394e648de00dd13cd8b | [
"MIT"
] | null | null | null | envs/rpg/levels/slash_spike.py | etigerstudio/zilong-on-fire | 5144a471b2d39ea38a47d394e648de00dd13cd8b | [
"MIT"
] | null | null | null | from envs.rpg.level import Level
from envs.rpg.entities.actor import Actor
from envs.rpg.entities.treasure import Treasure
from envs.rpg.entities.spike import Spike
from envs.rpg.entities.barrier import Barrier
from random import randrange
class SlashSpike(Level):
@staticmethod
def init():
entities = ... | 27.65 | 54 | 0.647378 |
4d993bc171a0c3c3565f53f9550d5a06ec614fd9 | 1,831 | py | Python | plugins/tff_backend/migrations/_006_investor_todo_list.py | threefoldfoundation/app_backend | b3cea2a3ff9e10efcc90d3d6e5e8e46b9e84312a | [
"Apache-2.0"
] | null | null | null | plugins/tff_backend/migrations/_006_investor_todo_list.py | threefoldfoundation/app_backend | b3cea2a3ff9e10efcc90d3d6e5e8e46b9e84312a | [
"Apache-2.0"
] | 178 | 2017-08-02T12:58:06.000Z | 2017-12-20T15:01:12.000Z | plugins/tff_backend/migrations/_006_investor_todo_list.py | threefoldfoundation/app_backend | b3cea2a3ff9e10efcc90d3d6e5e8e46b9e84312a | [
"Apache-2.0"
] | 2 | 2018-01-10T10:43:12.000Z | 2018-03-18T10:42:23.000Z | # -*- coding: utf-8 -*-
# Copyright 2017 GIG Technology NV
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 44.658537 | 92 | 0.765702 |
12a7144218c1fb0b442bf1353bae126b872c347e | 216 | py | Python | Algorithms/Greedy/marcs_cakewalk.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | Algorithms/Greedy/marcs_cakewalk.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | Algorithms/Greedy/marcs_cakewalk.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
n = int(input().strip())
calories = list(map(int, input().strip().split(' ')))
calories = sorted(calories, reverse=True)
print(sum([(2 ** i) *c for i, c in enumerate(calories)]))
| 21.6 | 57 | 0.648148 |
fbfb8e2ada3a0506292a4d9be14cbd3ff6c59f6f | 548 | py | Python | components/amp-utility/python/uzlib.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/uzlib.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/uzlib.py | willianchanlovegithub/AliOS-Things | 637c0802cab667b872d3b97a121e18c66f256eab | [
"Apache-2.0"
] | 1,860 | 2017-10-20T05:22:35.000Z | 2022-03-27T10:54:14.000Z | # * coding: UTF8 *
"""
该模块实现相应CPython模块的子集,如下所示
"""
def decompress(data, wbits=0, bufsize=0):
"""
**入参**
- wbits 是压缩时使用的DEFLATE字典窗口大小(8-15,字典的大小为该数值的2次幂)。 另外,若该值为正, data 则被假定为zlib流(带有zlib首标)。否则,若该值为负, 则假定为原始DEFLATE流。
- bufsize 参数是为与CPython兼容,此处忽略。
**返回值**
将解压缩数据作为bytes类型返回
"""
... | 16.606061 | 116 | 0.638686 |
3f64f8582339cdae20c0d69362961ab172616b5e | 187 | py | Python | src/log/__init__.py | dreaming-coder/RadarSet | c912298d0d6058c6647986524e5d95a205b51c1d | [
"MIT"
] | null | null | null | src/log/__init__.py | dreaming-coder/RadarSet | c912298d0d6058c6647986524e5d95a205b51c1d | [
"MIT"
] | null | null | null | src/log/__init__.py | dreaming-coder/RadarSet | c912298d0d6058c6647986524e5d95a205b51c1d | [
"MIT"
] | null | null | null | from .LoggerSession import LoggerSession
from .config_parser import load_config
__all__ = ["LoggerSession", "load_config", "logger"]
logger = LoggerSession()
logger.load(load_config())
| 23.375 | 52 | 0.786096 |
83397f86eaa2cd9a2950c8681fa4b5d4d64319fc | 4,859 | py | Python | venv/Lib/site-packages/pynance/tech/simple.py | LeonardoHMS/imobi | 6b2b97a05df67ea7d493f7b601382f65c6629cc2 | [
"MIT"
] | 35 | 2015-03-12T04:16:14.000Z | 2020-12-17T18:10:15.000Z | venv/Lib/site-packages/pynance/tech/simple.py | LeonardoHMS/imobi | 6b2b97a05df67ea7d493f7b601382f65c6629cc2 | [
"MIT"
] | 31 | 2015-03-16T21:31:04.000Z | 2021-01-26T00:12:34.000Z | venv/Lib/site-packages/pynance/tech/simple.py | LeonardoHMS/imobi | 6b2b97a05df67ea7d493f7b601382f65c6629cc2 | [
"MIT"
] | 18 | 2015-09-30T10:40:26.000Z | 2021-01-25T21:20:44.000Z | """
.. Copyright (c) 2014- Marshall Farrier
license http://opensource.org/licenses/MIT
Technical analysis - basic metrics (:mod:`pynance.tech.simple`)
==================================================================
.. currentmodule:: pynance.tech.simple
"""
from __future__ import absolute_import
import numpy ... | 35.467153 | 103 | 0.645606 |
83691c729d0d04609684b17120b62cb4e2f1287f | 1,342 | py | Python | components/amp-utility/python/AI.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/AI.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/AI.py | willianchanlovegithub/AliOS-Things | 637c0802cab667b872d3b97a121e18c66f256eab | [
"Apache-2.0"
] | 1,860 | 2017-10-20T05:22:35.000Z | 2022-03-27T10:54:14.000Z | # * coding: UTF8 *
"""
=================================================================================================
"""
def open(MLEngineType_t):
"""
打开推理引擎功能模块
:param MLEngineType_t: 引擎类型
:returns: 0: 成功,其他: 失败
:raises OSError: EINVAL
"""
pass
def config(key,secret,region_id,endpoint,url... | 14.586957 | 97 | 0.534277 |
36aa45fa018ac23d8ba3fb8136c9b51aa62ea57f | 714 | py | Python | tools/generate_header_list.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 3,285 | 2020-07-31T05:51:22.000Z | 2022-03-31T15:20:16.000Z | tools/generate_header_list.py | duijiudanggecl/oneflow | d2096ae14cf847509394a3b717021e2bd1d72f62 | [
"Apache-2.0"
] | 2,417 | 2020-07-31T06:28:58.000Z | 2022-03-31T23:04:14.000Z | tools/generate_header_list.py | duijiudanggecl/oneflow | d2096ae14cf847509394a3b717021e2bd1d72f62 | [
"Apache-2.0"
] | 520 | 2020-07-31T05:52:42.000Z | 2022-03-29T02:38:11.000Z | import glob
import argparse
import os
parser = argparse.ArgumentParser()
parser.add_argument("-i", "--src_path", type=str, required=True)
parser.add_argument("-o", "--dst_file", type=str, required=True)
args = parser.parse_args()
def glob_by_pattern(pattern):
result = []
for x in glob.glob(os.path.join(args.... | 25.5 | 77 | 0.648459 |
3d3460e743a55b08ee9e6ad085ea2c8bf5861fb1 | 419 | py | Python | exercises/python/data-types/strings/text-wrap.py | rogeriosantosf/hacker-rank-profile | d4b9c131524d138c415e5c5de4e38c6b8c35dd77 | [
"MIT"
] | null | null | null | exercises/python/data-types/strings/text-wrap.py | rogeriosantosf/hacker-rank-profile | d4b9c131524d138c415e5c5de4e38c6b8c35dd77 | [
"MIT"
] | null | null | null | exercises/python/data-types/strings/text-wrap.py | rogeriosantosf/hacker-rank-profile | d4b9c131524d138c415e5c5de4e38c6b8c35dd77 | [
"MIT"
] | null | null | null | # Sample Input 0
# ABCDEFGHIJKLIMNOQRSTUVWXYZ
# 4
# Sample Output 0
# ABCD
# EFGH
# IJKL
# IMNO
# QRST
# UVWX
# YZ
import textwrap
from functools import reduce
def wrap(string, max_width):
return reduce(lambda acc, value: acc + value + "\n", textwrap.wrap(string, max_width), '')
if __name__ == '__main__':
... | 15.518519 | 94 | 0.675418 |
3dc4b5770db212e24f1275bca486a4f85a36d056 | 1,451 | py | Python | AccessPoint03/AccessPoint/serializers.py | test1lax1/Toy | 52ea70ee92959bd59a0afc8baa30b3a455e394d3 | [
"MIT"
] | null | null | null | AccessPoint03/AccessPoint/serializers.py | test1lax1/Toy | 52ea70ee92959bd59a0afc8baa30b3a455e394d3 | [
"MIT"
] | 5 | 2021-03-30T13:53:38.000Z | 2021-09-22T19:18:06.000Z | AccessPoint03/AccessPoint/serializers.py | test1lax1/Toy | 52ea70ee92959bd59a0afc8baa30b3a455e394d3 | [
"MIT"
] | null | null | null | """
Book: Django RESTful Web Services
Author: Gaston C. Hillar - Twitter.com/gastonhillar
Publisher: Packt Publishing Ltd. - http://www.packtpub.com
"""
from rest_framework import serializers
from AccessPoint.models import *
class AccessPointSerializer(serializers.ModelSerializer):
class Meta:
mode... | 32.977273 | 102 | 0.675396 |
3dfa170505b6fbe342151c315adc0f23b7f4472b | 6,391 | py | Python | tag_3/p_13_tic_tac_toe.py | techrabbit58/uebung_informatik_vorkurs | e99312ae66ccccd6bfe45bfd3c3f43c01690659c | [
"Unlicense"
] | null | null | null | tag_3/p_13_tic_tac_toe.py | techrabbit58/uebung_informatik_vorkurs | e99312ae66ccccd6bfe45bfd3c3f43c01690659c | [
"Unlicense"
] | null | null | null | tag_3/p_13_tic_tac_toe.py | techrabbit58/uebung_informatik_vorkurs | e99312ae66ccccd6bfe45bfd3c3f43c01690659c | [
"Unlicense"
] | null | null | null | """
Schreiben Sie ein Programm, das das Spiel "Tic, Tac, Toe" zu spielen erlaubt.
"Tic, Tac, Toe" ist ein Spiel für zwei Personen, wie z.B. in diesem Artikel der
deutschen Wikipedia beschrieben: https://de.wikipedia.org/wiki/Tic-Tac-Toe.
Diese Implementierung geht von zwei spielenden Personen aus, deren Spielzüge
abw... | 34.545946 | 116 | 0.656548 |
9a91feb95a28d70ea551271721c2615f93f06d72 | 1,298 | py | Python | pyetl/stagingetl.py | febridev/portfoliode | ef2cea76c92b9676102cb76ca476f663a920b659 | [
"MIT"
] | null | null | null | pyetl/stagingetl.py | febridev/portfoliode | ef2cea76c92b9676102cb76ca476f663a920b659 | [
"MIT"
] | null | null | null | pyetl/stagingetl.py | febridev/portfoliode | ef2cea76c92b9676102cb76ca476f663a920b659 | [
"MIT"
] | null | null | null | #import libraries
import mysql.connector
import os
import pandas as pd
from dotenv import load_dotenv
#load .env file
load_dotenv()
# #Connection String dbdemo
dbcondemo = mysql.connector.connect(
host=os.getenv('hostdbdemo'),
port=os.getenv('portdbdemo'),
user=os.getenv('userdbdemo'),
passwd=os.geten... | 22.37931 | 89 | 0.696456 |
b8c67973133e469f31d4f7b87072856e4d677085 | 6,041 | py | Python | frds/mktstructure/utils.py | mgao6767/wrds | 7dca2651a181bf38c61ebde675c9f64d6c96f608 | [
"MIT"
] | 1 | 2022-03-06T20:36:06.000Z | 2022-03-06T20:36:06.000Z | mktstructure/utils.py | mgao6767/mktstructure | 5432c1bed163f838209d34b74c09629bea620ba8 | [
"MIT"
] | null | null | null | mktstructure/utils.py | mgao6767/mktstructure | 5432c1bed163f838209d34b74c09629bea620ba8 | [
"MIT"
] | null | null | null | import os
import json
from typing import List, Dict
from numba import jit
import pandas as pd
import numpy as np
from .request_templates import INDEX_COMPONENTS, INTRADAY_TICKS
SP500_RIC = "0#.SPX"
NASDAQ_RIC = "0#.NDX"
NYSE_RIC = "0#.NYA"
def extract_index_components_ric(chain_result_json, mkt_index: List[str]):
... | 38.477707 | 164 | 0.650555 |
622fcba5362a0a4355757225b16b09972f79da77 | 964 | py | Python | Algorithms/Implementation/SuperComputer.py | baby5/HackerRank | 1e68a85f40499adb9b52a4da16936f85ac231233 | [
"MIT"
] | null | null | null | Algorithms/Implementation/SuperComputer.py | baby5/HackerRank | 1e68a85f40499adb9b52a4da16936f85ac231233 | [
"MIT"
] | null | null | null | Algorithms/Implementation/SuperComputer.py | baby5/HackerRank | 1e68a85f40499adb9b52a4da16936f85ac231233 | [
"MIT"
] | null | null | null | #coding:utf-8
from itertools import combinations
N, M = map(int, raw_input().split())
grid = [list(raw_input()) for _ in xrange(N)]
valid_plus = []
import pdb
for i in xrange(N):
for j in xrange(M):
if grid[i][j] == 'B':
continue
valid_plus.append(set(tuple([(i, j)]))... | 24.717949 | 69 | 0.495851 |
625e567a29441ffb09371c8c3f82800d713a244a | 35,949 | py | Python | tests/onegov/ballot/models/test_proporz_election.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/ballot/models/test_proporz_election.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/ballot/models/test_proporz_election.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from datetime import date
from freezegun import freeze_time
from onegov.ballot import Candidate
from onegov.ballot import CandidateResult
from onegov.ballot import ElectionResult
from onegov.ballot import List
from onegov.ballot import ListConnection
from onegov.ballot import ListResult
from onegov.ballot import Panach... | 28.418182 | 79 | 0.592701 |
656eef29e8362bc518029b1d39224c1fd0cc54f5 | 332 | py | Python | leetcode/461-Hamming-Distance/or_minus_and.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2017-05-18T06:11:02.000Z | 2017-05-18T06:11:02.000Z | leetcode/461-Hamming-Distance/or_minus_and.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | leetcode/461-Hamming-Distance/or_minus_and.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | class Solution:
def hammingDistance(self, x, y):
"""
:type x: int
:type y: int
:rtype: int
"""
res = 0
for i in bin(x | y):
if i == '1':
res += 1
for i in bin(x & y):
if i == '1':
res -= 1
... | 20.75 | 36 | 0.337349 |
b84c86a56d6d566e6408e686ce922a30cf6754bb | 2,311 | py | Python | tests/onegov/core/test_widgets.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/core/test_widgets.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/core/test_widgets.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | import pytest
from lxml import etree
from onegov.core.widgets import inject_variables
from onegov.core.widgets import parse_structure
from onegov.core.widgets import transform_structure
from wtforms import ValidationError
class TextWidget:
tag = 'text'
template = """
<xsl:template match="text">
... | 25.677778 | 71 | 0.584595 |
b21bb0342487a82ddac2545c55f6e64f5d1cb20d | 4,368 | py | Python | .venv/Lib/site-packages/ipopt-0.1.9/test/exception_handling.py | AI-Assistant/FEMAG-Python | ff86e8f41485ae9df6034e6b8e810b59f8094c70 | [
"MIT"
] | null | null | null | .venv/Lib/site-packages/ipopt-0.1.9/test/exception_handling.py | AI-Assistant/FEMAG-Python | ff86e8f41485ae9df6034e6b8e810b59f8094c70 | [
"MIT"
] | null | null | null | .venv/Lib/site-packages/ipopt-0.1.9/test/exception_handling.py | AI-Assistant/FEMAG-Python | ff86e8f41485ae9df6034e6b8e810b59f8094c70 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
cyipopt: Python wrapper for the Ipopt optimization package, written in Cython.
Copyright (C) 2012-2015 Amit Aides
Copyright (C) 2015-2018 Matthias Kümmerer
Author: Matthias Kümmerer <matthias.kuemmerer@bethgelab.org>
(original Author: Amit Aides <amitibo@tx.technion.a... | 24.96 | 83 | 0.509844 |
ac89b72bc1464b2bc65fc4b3e2755376ab2508b9 | 7,183 | py | Python | HW3/p1a.py | kvswim/kv_jhu_cv | 2ddf7a9d497aef116a7c043157b8631cea45000d | [
"MIT"
] | null | null | null | HW3/p1a.py | kvswim/kv_jhu_cv | 2ddf7a9d497aef116a7c043157b8631cea45000d | [
"MIT"
] | null | null | null | HW3/p1a.py | kvswim/kv_jhu_cv | 2ddf7a9d497aef116a7c043157b8631cea45000d | [
"MIT"
] | null | null | null | #Kyle Verdeyen
#Computer Vision EN.600.461 HW3
#p1a.py
#Performs BCE (binary entropy classification) using a siamese network.
#Operation requires >4GB VRAM and a NVIDIA CUDA-enabled GPU. 6GB or higher recommended.
#Assumes images are in ./lfw and train.txt + test.txt are in the same root directory as pyscripts
import ... | 41.281609 | 230 | 0.739245 |
f04cbb9ad6111bb878878575e1b450d6b6a0bd47 | 3,972 | py | Python | quant/observers/c_diff_eth.py | doubleDragon/QuantBot | 53a1d6c62ecece47bf777da0c0754430b706b7fd | [
"MIT"
] | 7 | 2017-10-22T15:00:09.000Z | 2019-09-19T11:45:43.000Z | quant/observers/c_diff_eth.py | doubleDragon/QuantBot | 53a1d6c62ecece47bf777da0c0754430b706b7fd | [
"MIT"
] | 1 | 2018-01-19T16:19:40.000Z | 2018-01-19T16:19:40.000Z | quant/observers/c_diff_eth.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 -*-
import logging
from quant.observers.basicbot import BasicBot
"""
./venv/bin/python -m quant.cli -mBitfinex_ETH_BTC,Binance_ETH_BTC -oC_Diff_ETH -f=c_diff_eth -v
"""
class C_Diff_ETH(BasicBot):
def __init__(self):
super(C_Diff_ETH, self).__init__()
... | 38.192308 | 100 | 0.621601 |
333e3ffb92001a915ac3e4a1d5b2b60f68f1680f | 585 | py | Python | euler-10.py | TFabijo/euler | 58dc07b9adb236890556ccd5d75ca9dbd2b50df9 | [
"MIT"
] | null | null | null | euler-10.py | TFabijo/euler | 58dc07b9adb236890556ccd5d75ca9dbd2b50df9 | [
"MIT"
] | null | null | null | euler-10.py | TFabijo/euler | 58dc07b9adb236890556ccd5d75ca9dbd2b50df9 | [
"MIT"
] | null | null | null | def eden_iz_sez_deli_n(n,sez):
for x in sez:
if n % x == 0:
return True
return False
def vsota_praštevil_do_n(n=2000000):
pra = [2]
for x in range(3,n):
if eden_iz_sez_deli_n(x,pra) == False:
pra.append(x)
return sum(pra)
vsota_praštevil_do_... | 17.727273 | 47 | 0.466667 |
6840084dd7ea200b47e0599f9ccfbc12ceb6627d | 547 | py | Python | ebenezer/atencion/migrations/0012_level_taxonomy.py | davrv93/ebenezer-backend | d3db4dafd9a8c35bea9f32afe2be1dd451f64298 | [
"Apache-2.0"
] | null | null | null | ebenezer/atencion/migrations/0012_level_taxonomy.py | davrv93/ebenezer-backend | d3db4dafd9a8c35bea9f32afe2be1dd451f64298 | [
"Apache-2.0"
] | 3 | 2020-02-11T23:15:00.000Z | 2021-06-10T20:52:17.000Z | ebenezer/atencion/migrations/0012_level_taxonomy.py | davrv93/ebenezer-backend | d3db4dafd9a8c35bea9f32afe2be1dd451f64298 | [
"Apache-2.0"
] | null | null | null | # Generated by Django 2.1.2 on 2018-10-05 17:35
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('atencion', '0011_taxonomy'),
]
operations = [
migrations.AddField(
model_name='level',
... | 27.35 | 188 | 0.659963 |
684efed5944e5e68099e217cb40cbb8f77e08259 | 487 | py | Python | exercises/de/exc_03_10_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/de/exc_03_10_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/de/exc_03_10_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | from spacy.lang.de import German
from spacy.tokens import Span
nlp = German()
# Definiere die Methode
def to_html(span, tag):
# Verpacke den Text der Span in einem HTML-Tag und gebe ihn zurück
return f"<{tag}>{span.text}</{tag}>"
# Registriere die Span-Erweiterung "to_html" mit der Methode to_html
____.____... | 25.631579 | 75 | 0.722793 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.