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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
d36b6cf827663e0624e3ff99e9e9b8015c016c60 | 5,131 | py | Python | frappe-bench/apps/erpnext/erpnext/stock/doctype/landed_cost_voucher/landed_cost_voucher.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/stock/doctype/landed_cost_voucher/landed_cost_voucher.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/stock/doctype/landed_cost_voucher/landed_cost_voucher.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe, erpnext
from frappe import _
from frappe.utils import flt
from frappe.model.meta import get_field_precision
from frappe.model.document import Doc... | 37.452555 | 126 | 0.746053 |
e2c09dd0cbd74228e2aad0b2bdf79c85c24506b2 | 189 | py | Python | solutions/pedestrian_search/webserver/src/service/datasets/directory.py | naetimus/bootcamp | 0182992df7c54012944b51fe9b70532ab6a0059b | [
"Apache-2.0"
] | 1 | 2021-04-06T06:13:20.000Z | 2021-04-06T06:13:20.000Z | solutions/pedestrian_search/webserver/src/service/datasets/directory.py | naetimus/bootcamp | 0182992df7c54012944b51fe9b70532ab6a0059b | [
"Apache-2.0"
] | null | null | null | solutions/pedestrian_search/webserver/src/service/datasets/directory.py | naetimus/bootcamp | 0182992df7c54012944b51fe9b70532ab6a0059b | [
"Apache-2.0"
] | null | null | null | import os
import json
def makedir(root):
if not os.path.exists(root):
os.makedirs(root)
def write_json(data, root):
with open(root, 'w') as f:
json.dump(data, f)
| 15.75 | 32 | 0.619048 |
e2eb57833a11adc0710b57d49016ba8a3872a6e8 | 3,185 | py | Python | rbac/common/sawtooth/state_client.py | akgunkel/sawtooth-next-directory | a88833033ab30e9091479a38947f04c5e396ca46 | [
"Apache-2.0"
] | null | null | null | rbac/common/sawtooth/state_client.py | akgunkel/sawtooth-next-directory | a88833033ab30e9091479a38947f04c5e396ca46 | [
"Apache-2.0"
] | 1 | 2019-07-08T22:32:43.000Z | 2019-07-08T22:32:43.000Z | rbac/common/sawtooth/state_client.py | akgunkel/sawtooth-next-directory | a88833033ab30e9091479a38947f04c5e396ca46 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Contributors to Hyperledger Sawtooth
#
# 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 ... | 36.609195 | 96 | 0.68854 |
b3bcd52a8195f48454d5871969042378a597bee5 | 5,490 | py | Python | src/onegov/town6/app.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/town6/app.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/town6/app.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.core import utils
from onegov.core.i18n import default_locale_negotiator
from onegov.core.utils import module_path
from onegov.foundation6.integration import FoundationApp
from onegov.town6.custom import get_global_tools
from onegov.town6.initial_content import create_new_organisation
from onegov.org.app im... | 25.774648 | 76 | 0.713115 |
440e4f16b7af56cec35c2945b2d597f623441309 | 1,016 | py | Python | zencad/examples/2.Operations/3.Sweep/revol.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | 5 | 2018-04-11T14:11:40.000Z | 2018-09-12T19:03:36.000Z | zencad/examples/2.Operations/3.Sweep/revol.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | null | null | null | zencad/examples/2.Operations/3.Sweep/revol.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""
ZenCad API example: revol
"""
from zencad import *
# Make revols:
a1 = square(10, center=True)
a2 = circle(10)
a3 = ngon(r=10, n=8)
b1 = a1.rotateX(deg(90)).right(40)
b2 = a2.rotateX(deg(90)).right(40)
b3 = a3.rotateX(deg(90)).right(40)
m1 = revol(b1)
m2 = revol(a2, r=40)
m3 = revol(b3)
... | 21.617021 | 55 | 0.694882 |
4441d81ff9f89ca8ad97eb4f7886d7392a5b6633 | 2,234 | py | Python | src/onegov/election_day/views/upload/election_creation.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/election_day/views/upload/election_creation.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/election_day/views/upload/election_creation.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | """
Canton SZ has over 100 districts.
For compound elections, the election creation view creates:
- All election belonging to the one election compound
- The election compound that registers all these election
- The
"""
import transaction
from onegov.election_day import _
from onegov.core.security import Public
fro... | 29.012987 | 73 | 0.679499 |
44639389eaacd68c5821a70a09599f97e30fdc57 | 530 | py | Python | main.py | JeFaProductions/TextAdventure2 | 4ae690a1e41f30a564a77015f76346d55466c325 | [
"MIT"
] | 2 | 2016-08-28T21:32:39.000Z | 2016-09-02T05:56:53.000Z | main.py | JeFaProductions/TextAdventure2 | 4ae690a1e41f30a564a77015f76346d55466c325 | [
"MIT"
] | 7 | 2016-09-01T22:03:13.000Z | 2019-06-13T21:38:05.000Z | main.py | JeFaProductions/TextAdventure2 | 4ae690a1e41f30a564a77015f76346d55466c325 | [
"MIT"
] | null | null | null | import tead.event as evt
import tead.gui as gui
import tead.command as cmd
import tead.game as game
EVENT_SYSTEM = None
GUI = None
CMD_PARSER = None
WORLD = None
def processInput(text):
args = text.rstrip().lstrip().split()
CMD_PARSER.parse(args)
EVENT_SYSTEM.processEvents()
if __name__ == '__main__':
... | 18.275862 | 46 | 0.70566 |
9271e9675431e3407833d34f5fd9699f93afe015 | 3,432 | py | Python | toolbox/core.py | frollo/the-black-hack | 5a250ce2ffc769a46a630c82066c7d59cb975e57 | [
"Unlicense"
] | 57 | 2016-04-22T12:01:13.000Z | 2021-12-22T01:06:24.000Z | toolbox/core.py | frollo/the-black-hack | 5a250ce2ffc769a46a630c82066c7d59cb975e57 | [
"Unlicense"
] | 52 | 2016-04-18T20:48:59.000Z | 2021-04-14T19:55:04.000Z | toolbox/core.py | frollo/the-black-hack | 5a250ce2ffc769a46a630c82066c7d59cb975e57 | [
"Unlicense"
] | 29 | 2016-05-27T15:30:25.000Z | 2021-05-13T03:06:39.000Z | import os
from string import Template
from os.path import join, abspath, basename
from contextlib import contextmanager
from cached_property import cached_property
import markdown
from markdown.extensions.toc import TocExtension
from mdx_gfm import GithubFlavoredMarkdownExtension
from slugify import slugify
from shell... | 30.105263 | 94 | 0.624126 |
a63fea4e3742fbe89a9ebf0d52c8a3f848dbb9ad | 234 | py | Python | Licence 2/I33/TP 1/ex_11.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | 8 | 2020-11-26T20:45:12.000Z | 2021-11-29T15:46:22.000Z | Licence 2/I33/TP 1/ex_11.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | null | null | null | Licence 2/I33/TP 1/ex_11.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | 6 | 2020-10-23T15:29:24.000Z | 2021-05-05T19:10:45.000Z | def majoritaire(L):
i = 0
n = len(L)
continuer = True
while i < n and continuer:
count = 0
for j in L:
if j == L[i]:
count += 1
continuer = count <= n / 2
i = i + 1
if continuer: return False
else: return L[i - 1] | 18 | 28 | 0.564103 |
a6a4fdf8e39190864dc4a1629d787762970c836a | 3,560 | py | Python | deprecated/benchmark/ps/semantic_matching/args.py | hutuxian/FleetX | 843c7aa33f5a14680becf058a3aaf0327eefafd4 | [
"Apache-2.0"
] | 170 | 2020-08-12T12:07:01.000Z | 2022-03-07T02:38:26.000Z | deprecated/benchmark/ps/semantic_matching/args.py | hutuxian/FleetX | 843c7aa33f5a14680becf058a3aaf0327eefafd4 | [
"Apache-2.0"
] | 195 | 2020-08-13T03:22:15.000Z | 2022-03-30T07:40:25.000Z | deprecated/benchmark/ps/semantic_matching/args.py | hutuxian/FleetX | 843c7aa33f5a14680becf058a3aaf0327eefafd4 | [
"Apache-2.0"
] | 67 | 2020-08-14T02:07:46.000Z | 2022-03-28T10:05:33.000Z | # Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 33.271028 | 107 | 0.622191 |
755e6e0792bdf7176d1ba551d079c20b72e193b1 | 8,041 | py | Python | tools/uiperf/trace-cmp.py | bleonard252-forks/pangolin-mobile | 392df6c8a66d39f31d0e2512caf3d31ae40c758f | [
"Apache-2.0"
] | 1 | 2020-11-06T14:31:34.000Z | 2020-11-06T14:31:34.000Z | tools/uiperf/trace-cmp.py | bleonard252-forks/pangolin-mobile | 392df6c8a66d39f31d0e2512caf3d31ae40c758f | [
"Apache-2.0"
] | null | null | null | tools/uiperf/trace-cmp.py | bleonard252-forks/pangolin-mobile | 392df6c8a66d39f31d0e2512caf3d31ae40c758f | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
#
# Copyright 2018 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
"""
import argparse
import collections
import json
import sys
try:
import matplotlib.patches
import matplotlib.pyplot as plt... | 31.287938 | 128 | 0.635493 |
f337c57a883317029b34aeeb6971c57d2b85a6f5 | 294 | py | Python | src/features/__init__.py | Somsubhra/Enrich | cf1e69b86ceb64c8b09c98b442e09c1196b50125 | [
"MIT"
] | 1 | 2015-11-30T09:27:51.000Z | 2015-11-30T09:27:51.000Z | src/features/__init__.py | Somsubhra/Enrich | cf1e69b86ceb64c8b09c98b442e09c1196b50125 | [
"MIT"
] | null | null | null | src/features/__init__.py | Somsubhra/Enrich | cf1e69b86ceb64c8b09c98b442e09c1196b50125 | [
"MIT"
] | null | null | null | # Headers
__author__ = 'Somsubhra Bairi'
__email__ = 'somsubhra.bairi@gmail.com'
# All imports
from kf_frequency import KFFrequency
from syllable_counter import SyllableCounter
from term_frequency import TermFrequency
from document_frequency import DocumentFrequency
from itfidf import ITFIDF | 26.727273 | 48 | 0.85034 |
3438f6061d66c71f143cb845884c6b43eaae1479 | 460 | py | Python | run.py | lhalb/gfmanager | 449f071b3239faa672b7f06122dfc9bc23e68d79 | [
"MIT"
] | 1 | 2022-01-18T12:53:17.000Z | 2022-01-18T12:53:17.000Z | run.py | lhalb/gfmanager | 449f071b3239faa672b7f06122dfc9bc23e68d79 | [
"MIT"
] | null | null | null | run.py | lhalb/gfmanager | 449f071b3239faa672b7f06122dfc9bc23e68d79 | [
"MIT"
] | null | null | null | import sys
from PyQt5 import QtWidgets
# from gui import appGui as GUI
from gui import minimalGUI as GUI
def main():
if not QtWidgets.QApplication.instance():
app = QtWidgets.QApplication(sys.argv)
else:
app = QtWidgets.QApplication.instance()
form = GUI.App() # We set the form to be our ... | 24.210526 | 67 | 0.669565 |
34768c71fb5d3437716b168cf5919da341010b93 | 2,049 | py | Python | bolt/core/scheduler.py | ph7vc/CL4M-B0T | e992cf63b1215ea7c241cab94edc251653dbaed7 | [
"MIT"
] | 9 | 2019-02-17T06:33:14.000Z | 2021-10-05T02:19:00.000Z | bolt/core/scheduler.py | ns-phennessy/Bolt | e992cf63b1215ea7c241cab94edc251653dbaed7 | [
"MIT"
] | 28 | 2019-02-10T07:48:05.000Z | 2021-12-20T00:15:37.000Z | bolt/core/scheduler.py | ph7vc/CL4M-B0T | e992cf63b1215ea7c241cab94edc251653dbaed7 | [
"MIT"
] | 4 | 2015-03-13T03:58:55.000Z | 2015-05-27T08:29:46.000Z | import gevent
import time
import logging
from croniter import croniter
class Scheduler():
def __init__(self, bot):
self.running = False
self.bot = bot
self.logger = logging.getLogger(__name__)
def start(self):
self.logger.debug('Spawning Scheduler Greenlet')
... | 32.015625 | 80 | 0.494876 |
1bbef59dbd9a33572a2d9fc933be080b1339f6be | 373 | py | Python | 7-assets/past-student-repos/data_struct_and_algo-master/rotation_arr.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/past-student-repos/data_struct_and_algo-master/rotation_arr.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/past-student-repos/data_struct_and_algo-master/rotation_arr.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | #rotation of an element by one step
def left_rotation(arr,d,n):
for i in range(d):
rotate_by_one_step(arr,n)
def rotate_by_one_step(arr,n):
temp = arr[0]
for i in range(n-1):
arr[i] = arr[i+1]
arr[n-1]=temp
def print_array(arr,n):
for i in range(n):
print(arr[i])
arr=[1... | 16.217391 | 35 | 0.608579 |
1bcd449bf3ad625cca28da105097585f3826f710 | 851 | py | Python | Openharmony v1.0/vendor/hisi/hi35xx/third_party/uboot/tools/binman/etype/u_boot_spl_dtb.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.1/device/hisilicon/third_party/uboot/u-boot-2020.01/tools/binman/etype/u_boot_spl_dtb.py | dawmlight/vendor_oh_fun | bc9fb50920f06cd4c27399f60076f5793043c77d | [
"Apache-2.0"
] | null | null | null | hihope_neptune-oh_hid/00_src/v0.1/device/hisilicon/third_party/uboot/u-boot-2020.01/tools/binman/etype/u_boot_spl_dtb.py | dawmlight/vendor_oh_fun | bc9fb50920f06cd4c27399f60076f5793043c77d | [
"Apache-2.0"
] | null | null | null | # SPDX-License-Identifier: GPL-2.0+
# Copyright (c) 2016 Google, Inc
# Written by Simon Glass <sjg@chromium.org>
#
# Entry-type module for U-Boot device tree in SPL (Secondary Program Loader)
#
from entry import Entry
from blob_dtb import Entry_blob_dtb
class Entry_u_boot_spl_dtb(Entry_blob_dtb):
"""U-Boot SPL de... | 29.344828 | 76 | 0.706228 |
ca29017bb54091cf48b71769b54e844b333df6ae | 2,906 | py | Python | oldp/apps/search/models.py | ImgBotApp/oldp | 575dc6f711dde3470d910e21c9440ee9b79a69ed | [
"MIT"
] | 3 | 2020-06-27T08:19:35.000Z | 2020-12-27T17:46:02.000Z | oldp/apps/search/models.py | ImgBotApp/oldp | 575dc6f711dde3470d910e21c9440ee9b79a69ed | [
"MIT"
] | null | null | null | oldp/apps/search/models.py | ImgBotApp/oldp | 575dc6f711dde3470d910e21c9440ee9b79a69ed | [
"MIT"
] | null | null | null | # Create your models here.
from django.db import models
class RelatedContent(models.Model):
seed_content = None
related_content = None
score = models.DecimalField(max_digits=12, decimal_places=8)
class Meta:
abstract = True
def set_relation(self, seed_id, related_id):
self.seed_c... | 25.946429 | 118 | 0.646249 |
04e9ae7def0db21735a40a593ea63a81f87c1439 | 442 | py | Python | ISTp/2014/korsakov_a_a/task_1_34.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | ISTp/2014/korsakov_a_a/task_1_34.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | ISTp/2014/korsakov_a_a/task_1_34.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | # Задача 1. Вариант 34
# Напишите программу, которая будет сообщать род деятельности и псевдоним под
# которым скрывался Борис Николаевич Кампов. После вывода информации
# программа должна дожидаться пока пользователь нажмёт Enter для выхода.
# Korsakov A.A.
# 31.03.2016
print ('Борис Николаевич Кампов, более изв... | 44.2 | 131 | 0.79638 |
8e238c2969b814bf36750a811c15d0c24507157e | 27,341 | py | Python | blockschaltbilder/bsb.py | mp4096/blockschaltbilder | 9253022b5518e42d784176594d4d6fee7baa1050 | [
"MIT"
] | 11 | 2016-08-19T18:11:19.000Z | 2020-07-27T07:04:52.000Z | blockschaltbilder/bsb.py | mp4096/blockschaltbilder | 9253022b5518e42d784176594d4d6fee7baa1050 | [
"MIT"
] | 8 | 2016-09-17T16:46:01.000Z | 2021-04-29T19:59:57.000Z | blockschaltbilder/bsb.py | mp4096/blockschaltbilder | 9253022b5518e42d784176594d4d6fee7baa1050 | [
"MIT"
] | 4 | 2016-09-21T18:45:09.000Z | 2020-07-27T07:08:17.000Z | """Block diagram class."""
from abc import ABCMeta, abstractmethod
import numpy as np
import re
# Export only the Blockschaltbild class
__all__ = ["Blockschaltbild"]
# Constant IDs for scalar-typed and vector-typed connections
# Please do not modify these!
# And in case you do, these must be unique, positive, int ... | 32.743713 | 83 | 0.553564 |
b634ab4a3113373dcbf38761175d428d22daa046 | 720 | py | Python | Packs/CommonScripts/Scripts/ZipStringsArrays/ZipStringsArrays_test.py | jrauen/content | 81a92be1cbb053a5f26a6f325eff3afc0ca840e0 | [
"MIT"
] | 2 | 2021-12-06T21:38:24.000Z | 2022-01-13T08:23:36.000Z | Packs/CommonScripts/Scripts/ZipStringsArrays/ZipStringsArrays_test.py | jrauen/content | 81a92be1cbb053a5f26a6f325eff3afc0ca840e0 | [
"MIT"
] | 61 | 2021-10-07T08:54:38.000Z | 2022-03-31T10:25:35.000Z | Packs/CommonScripts/Scripts/ZipStringsArrays/ZipStringsArrays_test.py | jrauen/content | 81a92be1cbb053a5f26a6f325eff3afc0ca840e0 | [
"MIT"
] | 2 | 2022-01-05T15:27:01.000Z | 2022-02-01T19:27:43.000Z | import pytest
TEST_CASES = [
({'list1': [], 'list2': ['a', 'b']}, []),
({'list1': ['a', 'b'], 'list2': []}, []),
({'list1': ['c', 'd'], 'list2': ['a', 'b']}, ['c-a', 'd-b']),
({'list1': [], 'list2': ['a', 'b'], 'format': '{2}-{1}'}, []),
({'list1': ['a', 'b'], 'list2': [], 'format': '{1}-{2}'}, [])... | 37.894737 | 86 | 0.469444 |
1e349f1dc49c8884a71a84fce6f05d57f5312dab | 2,165 | py | Python | Hello coding/binary_search.py | wooooooogi/SAlgorithm | bf76bb721785a52b6abf158077b554b0626ee1f7 | [
"MIT"
] | null | null | null | Hello coding/binary_search.py | wooooooogi/SAlgorithm | bf76bb721785a52b6abf158077b554b0626ee1f7 | [
"MIT"
] | null | null | null | Hello coding/binary_search.py | wooooooogi/SAlgorithm | bf76bb721785a52b6abf158077b554b0626ee1f7 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# coded by Sungwook Kim
# Date: 2019-07-30
# IDE: Spyder 3
# Python version: 3.6.5
'''
Search: Figure out which is same as input in array. (or bunch of things)
Method(or way, manner, means) 1: Search from the beginning.
Method 2: Binary search, search from middle for all time.
'''
impo... | 28.866667 | 154 | 0.667436 |
1e4b90435a2e4eab176627501fe4ef56ae9308fc | 112,998 | py | Python | test/test_npu/test_npu.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-12-02T03:07:35.000Z | 2021-12-02T03:07:35.000Z | test/test_npu/test_npu.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-11-12T07:23:03.000Z | 2021-11-12T08:28:13.000Z | test/test_npu/test_npu.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2020 Huawei Technologies Co., Ltd
# Copyright (c) 2019, Facebook CORPORATION.
# All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://opensource.org/lice... | 42.368954 | 118 | 0.613604 |
bf7d3cecec0ff02d9159fe3ce7f098da317cdb83 | 397 | py | Python | Python/zz_offtopic_sandbox/kwargs_co.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zz_offtopic_sandbox/kwargs_co.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zz_offtopic_sandbox/kwargs_co.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | def anything(**modenames):
print(create_text(**modenames))
def create_text(first, second, **kwargs):
text = f"{first} und danach {second}"
text += "und danach:\n"
for i in kwargs.values():
text += f"{i}\n"
return text
def nur_args(*args):
print(create_text(*args))
anything(first="du... | 22.055556 | 72 | 0.629723 |
bfa8851f26c9326c8cf50c80d6671b92209189f6 | 8,054 | py | Python | src/Sephrasto/UI/CharakterVorteile.py | Ilaris-Tools/Sephrasto | 8574a5b45da8ebfa5f69a775066fd3136da1c718 | [
"MIT"
] | 1 | 2022-02-02T16:15:59.000Z | 2022-02-02T16:15:59.000Z | src/Sephrasto/UI/CharakterVorteile.py | Ilaris-Tools/Sephrasto | 8574a5b45da8ebfa5f69a775066fd3136da1c718 | [
"MIT"
] | 1 | 2022-01-14T11:04:19.000Z | 2022-01-14T11:04:19.000Z | src/Sephrasto/UI/CharakterVorteile.py | lukruh/Sephrasto | 8574a5b45da8ebfa5f69a775066fd3136da1c718 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'CharakterVorteile.ui'
#
# Created by: PyQt5 UI code generator 5.15.6
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt5 import Qt... | 54.789116 | 179 | 0.723616 |
7841747edfb9ac3025dc366a2239eeee8ca45f76 | 8,634 | py | Python | V1/GES_DDPG/ges_ddpg_v2.py | marsXyr/GESRL | 3d60dfd4ffa1e0ae24d64b09f431d8ee0a9b5c01 | [
"Apache-2.0"
] | null | null | null | V1/GES_DDPG/ges_ddpg_v2.py | marsXyr/GESRL | 3d60dfd4ffa1e0ae24d64b09f431d8ee0a9b5c01 | [
"Apache-2.0"
] | null | null | null | V1/GES_DDPG/ges_ddpg_v2.py | marsXyr/GESRL | 3d60dfd4ffa1e0ae24d64b09f431d8ee0a9b5c01 | [
"Apache-2.0"
] | null | null | null | import argparse
import numpy as np
import gym
from DDPG.ddpg_v2 import DDPG
from utils import logz
from utils.filter import Filter
from utils.tools import get_output_folder
"""
ddpg_v2 + 用ddpg梯度作为代理梯度 + 用RL梯度来更新policy + 无 buffer flush
"""
class Noise:
def __init__(self, size, args):
self.size = size
... | 40.919431 | 110 | 0.62057 |
1528d431cb7141581dbfd850ea6e2caf695338ae | 1,700 | py | Python | profiles/models.py | Thames1990/BadBatBets | 8dffb69561668b8991bf4103919e4b254d4ca56a | [
"MIT"
] | null | null | null | profiles/models.py | Thames1990/BadBatBets | 8dffb69561668b8991bf4103919e4b254d4ca56a | [
"MIT"
] | null | null | null | profiles/models.py | Thames1990/BadBatBets | 8dffb69561668b8991bf4103919e4b254d4ca56a | [
"MIT"
] | null | null | null | from django.db import models
from django.contrib.auth.models import User
from ledger.models import Account
class Profile(models.Model):
# The user that this profile is associated with
# Since each profile is associated with exactly one user, the user is the profiles primary key
user = models.OneToOneFiel... | 36.956522 | 98 | 0.741176 |
15570706648988169fd89b66c35cdac9ce9bb21a | 564 | py | Python | presentations/CNN-Intro/cnn.py | RalfGuder/LaTeX-examples | a1bf9fe422969be1ca4674394ebd2170c07f7693 | [
"MIT"
] | 1,231 | 2015-01-07T04:04:25.000Z | 2022-03-31T17:43:29.000Z | presentations/CNN-Intro/cnn.py | DoubleL61/LaTeX-examples | cd0d97f85fadb59b7c6e9062b37a8bf7d725ba0c | [
"MIT"
] | 5 | 2015-05-10T13:10:47.000Z | 2021-05-02T21:28:49.000Z | presentations/CNN-Intro/cnn.py | DoubleL61/LaTeX-examples | cd0d97f85fadb59b7c6e9062b37a8bf7d725ba0c | [
"MIT"
] | 400 | 2015-01-05T06:22:18.000Z | 2022-03-19T04:07:59.000Z | import data
from keras.layers import Dense, Flatten, Conv2D, MaxPooling2D
from keras.models import Sequential, load_model
model = Sequential()
model.add(Conv2D(16, (3, 3)))
model.add(MaxPooling2D(pool_size=(2, 2)))
model.add(Conv2D(16, (3, 3)))
model.add(Flatten())
model.add(Dense(128, activation='relu'))
model.add(D... | 28.2 | 64 | 0.755319 |
ece110d0f72753ac26f8f0054fc549fef525c48a | 489 | py | Python | site/public/courses/BEW-1.1/Lessons/05-URLs-HTTP-REST-and-Reading-Errors/demo/app.py | KitsuneNoctus/makeschool | 5eec1a18146abf70bb78b4ee3d301f6a43c9ede4 | [
"MIT"
] | 1 | 2021-08-24T20:22:19.000Z | 2021-08-24T20:22:19.000Z | site/public/courses/BEW-1.1/Lessons/05-URLs-HTTP-REST-and-Reading-Errors/demo/app.py | KitsuneNoctus/makeschool | 5eec1a18146abf70bb78b4ee3d301f6a43c9ede4 | [
"MIT"
] | null | null | null | site/public/courses/BEW-1.1/Lessons/05-URLs-HTTP-REST-and-Reading-Errors/demo/app.py | KitsuneNoctus/makeschool | 5eec1a18146abf70bb78b4ee3d301f6a43c9ede4 | [
"MIT"
] | null | null | null | from flask import Flask, request
app = Flask(__name__)
@app.route('/color')
def fav_color():
"""Shows user a form."""
return """
<form action="/color_results">
What is your favorite color?
<input type="text" name="color">
<br>
<input type="submit">
</form>
... | 23.285714 | 54 | 0.588957 |
01e199ca37e506f012b6cb8ba0f58dacd204e6a2 | 1,112 | py | Python | year_3/databases_sem1/lab3/payroll/views.py | honchardev/KPI | f8425681857c02a67127ffb05c0af0563a8473e1 | [
"MIT"
] | null | null | null | year_3/databases_sem1/lab3/payroll/views.py | honchardev/KPI | f8425681857c02a67127ffb05c0af0563a8473e1 | [
"MIT"
] | 21 | 2020-03-24T16:26:04.000Z | 2022-02-18T15:56:16.000Z | year_3/databases_sem1/lab3/payroll/views.py | honchardev/KPI | f8425681857c02a67127ffb05c0af0563a8473e1 | [
"MIT"
] | null | null | null | from django.http import HttpResponse
from django.shortcuts import redirect, render
def index(request):
return render(request, 'index.html')
def payrolls(request):
return render(request, 'payrollsindex.html')
def employees(request):
return render(request, 'employeesindex.html')
def payments(request):... | 27.121951 | 97 | 0.705036 |
97a49826945388c33ebce148665e81043fdd714f | 1,250 | py | Python | Documentation/markdowndoc.py | simonbredemeier/ds100bot | 1318b32b818891f4bc6d24f12fcf0ceae898f8bd | [
"Apache-2.0"
] | 15 | 2019-12-20T08:24:31.000Z | 2022-03-18T09:24:25.000Z | Documentation/markdowndoc.py | simonbredemeier/ds100bot | 1318b32b818891f4bc6d24f12fcf0ceae898f8bd | [
"Apache-2.0"
] | 124 | 2020-04-20T04:36:49.000Z | 2022-01-29T11:08:09.000Z | Documentation/markdowndoc.py | simonbredemeier/ds100bot | 1318b32b818891f4bc6d24f12fcf0ceae898f8bd | [
"Apache-2.0"
] | 12 | 2020-07-08T22:19:39.000Z | 2022-03-19T09:13:11.000Z | """Generates an arbitrary HTML documentation file from a Markdown file"""
from xml.etree import ElementTree as ET
import markdown
from .generator import Generator
class MarkdownDoc(Generator):
def __init__(self, mdfile, navi):
with mdfile.open() as mdin:
self.md = mdin.read()
# wrap in... | 35.714286 | 80 | 0.5672 |
97b69ed6e9ec6d70ba7358c222b2a6ab4a304bca | 70 | py | Python | torba/torba/coin/__init__.py | mittalkartik2000/lbry-sdk | a07b17ec0c9c5d0a88bc730caf6ab955e0971b38 | [
"MIT"
] | 4,076 | 2018-06-01T05:54:24.000Z | 2022-03-07T21:05:52.000Z | torba/torba/coin/__init__.py | mittalkartik2000/lbry-sdk | a07b17ec0c9c5d0a88bc730caf6ab955e0971b38 | [
"MIT"
] | 80 | 2018-06-14T01:02:03.000Z | 2019-06-19T10:45:39.000Z | torba/torba/coin/__init__.py | braveheart12/lbry-sdk | dc709b468f9dce60d206161785def5c7ace2b763 | [
"MIT"
] | 20 | 2018-06-27T21:52:22.000Z | 2022-03-08T11:25:23.000Z | __path__: str = __import__('pkgutil').extend_path(__path__, __name__)
| 35 | 69 | 0.785714 |
c14a4440a9c4fead7796fb1e8871bb768a038388 | 1,486 | py | Python | Code/chap4.py | CPEGM/Swinnen-2012 | ce6a2621cc66ec7818abe4e4cb2b6cff1d6e151b | [
"CC0-1.0"
] | null | null | null | Code/chap4.py | CPEGM/Swinnen-2012 | ce6a2621cc66ec7818abe4e4cb2b6cff1d6e151b | [
"CC0-1.0"
] | null | null | null | Code/chap4.py | CPEGM/Swinnen-2012 | ce6a2621cc66ec7818abe4e4cb2b6cff1d6e151b | [
"CC0-1.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Fri Sep 28 16:52:31 2018
@author: CPEGM
"""
# Exercice 4.2
# Affiche les 20 premiers multiples de 7
for k in range(1, 21):
print(7*k, end=' ')
print()
# Exercice 4.3
# Affiche la conversion euro-dollar pour les 15 premières puissances de 2
euro = 1.65
for k in range(0, 15)... | 22.861538 | 82 | 0.617766 |
c185314437e0df207a7fccd9f15789b0bc3ffeff | 1,147 | py | Python | source/pkgsrc/databases/py-carbon/patches/patch-setup.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-11-20T22:46:39.000Z | 2021-11-20T22:46:39.000Z | source/pkgsrc/databases/py-carbon/patches/patch-setup.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | source/pkgsrc/databases/py-carbon/patches/patch-setup.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | $NetBSD: patch-setup.py,v 1.1 2015/12/11 21:40:50 riz Exp $
Rearrange installation dirs for pkgsrc, and don't install redhat files
--- setup.py.orig 2015-11-27 10:37:07.000000000 -0800
+++ setup.py 2015-12-04 12:53:42.000000000 -0800
@@ -13,19 +13,12 @@
setup_kwargs = dict()
-storage_dirs = [ ('storage/whisper... | 38.233333 | 83 | 0.598954 |
ec0dad733b1e9503dced0d1b0e6e1b2a8b2d319b | 414 | py | Python | src/doc/tutorials/tutorial_examples/dbreak3d/dbreak_animate_pathlines.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 226 | 2018-12-29T01:13:49.000Z | 2022-03-30T19:16:31.000Z | src/doc/tutorials/tutorial_examples/dbreak3d/dbreak_animate_pathlines.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 5,100 | 2019-01-14T18:19:25.000Z | 2022-03-31T23:08:36.000Z | src/doc/tutorials/tutorial_examples/dbreak3d/dbreak_animate_pathlines.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 84 | 2019-01-24T17:41:50.000Z | 2022-03-10T10:01:46.000Z | #
# file: dbreak_animate_pathlines.py
# info: Source in VisIt's Commands window with pathlines
# from dbreak3d_plot_pathlines.py already created.
#
def animate_pathlines():
iatts = IntegralCurveAttributes(1)
iatts.cropValue = iatts.Time
iatts.cropEndFlag = 1
for ts in range(161):
tval = t... | 23 | 56 | 0.693237 |
6b81c21224bf3fb46b566981e90c765984e63f52 | 840 | py | Python | garden/flancian/tools/addheader.py | nikvdp/agora | 9e7607901d9b1b551e03b21a37e3266a5e2fab6a | [
"Apache-2.0"
] | null | null | null | garden/flancian/tools/addheader.py | nikvdp/agora | 9e7607901d9b1b551e03b21a37e3266a5e2fab6a | [
"Apache-2.0"
] | null | null | null | garden/flancian/tools/addheader.py | nikvdp/agora | 9e7607901d9b1b551e03b21a37e3266a5e2fab6a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python3
# not proud of this but it works (tm).
import pathlib
import titlecase
for filename in pathlib.Path('.').glob('**/*.md'):
f = open(filename, 'r')
print('file: %s' % filename)
lines = f.readlines()
if lines:
if lines[0].startswith('#'):
print(filename, 'has a heade... | 35 | 75 | 0.55119 |
2e08822d423804b7d73230ebc38322ae316bff80 | 3,043 | py | Python | ImageClassify/advanced CNN/utils/dataset_xrh.py | Xinrihui/DeepLearningApp | 8d86b88251ee8d37358c642b1ec4a341767bfd17 | [
"Apache-2.0"
] | 2 | 2021-08-25T01:13:29.000Z | 2021-10-10T14:49:59.000Z | ImageClassify/advanced CNN/utils/dataset_xrh.py | Xinrihui/DeepLearningApp | 8d86b88251ee8d37358c642b1ec4a341767bfd17 | [
"Apache-2.0"
] | null | null | null | ImageClassify/advanced CNN/utils/dataset_xrh.py | Xinrihui/DeepLearningApp | 8d86b88251ee8d37358c642b1ec4a341767bfd17 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# -*- coding: UTF-8 -*-
import os
import numpy as np
import tensorflow as tf
import h5py
import math
from builtins import range
from six.moves import cPickle as pickle
import os
from scipy.misc import imread
import platform
def load_signs_dataset(signs_dataset_dir):
train_dataset = h5py.File(o... | 30.737374 | 90 | 0.652645 |
2b78ba9ae9766e22fba831fdd19933a917d63de5 | 10,571 | py | Python | WiFiBroot-master/wireless/captures.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | WiFiBroot-master/wireless/captures.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | WiFiBroot-master/wireless/captures.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-05T18:07:48.000Z | 2022-02-24T21:25:07.000Z | from scapy.layers.dot11 import Dot11
from scapy.layers.dot11 import Raw
from scapy.layers.dot11 import Dot11Auth
from scapy.layers.dot11 import Dot11AssoReq
from scapy.layers.dot11 import Dot11AssoResp
from scapy.layers.dot11 import RadioTap
from scapy.layers.dot11 import Dot11Elt
from scapy.utils import rdpcap
from pb... | 35.833898 | 189 | 0.642513 |
99101382e87559183a5687ded1c5f024c9ee8e51 | 3,398 | py | Python | 21-fs-ias-lec/FrontEnd/socialgraph/models.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 8 | 2020-03-17T21:12:18.000Z | 2021-12-12T15:55:54.000Z | 21-fs-ias-lec/FrontEnd/socialgraph/models.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 2 | 2021-07-19T06:18:43.000Z | 2022-02-10T12:17:58.000Z | 21-fs-ias-lec/FrontEnd/socialgraph/models.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 25 | 2020-03-20T09:32:45.000Z | 2021-07-18T18:12:59.000Z | __author__ = "Philipp Haller, Pascal Kunz, Sebastian Schlachter"
'''This file defines all models and there functions in the used database.'''
from django.contrib.auth.models import User
from django.db import models
from django.urls import reverse
import datetime
class Status(models.Model):
"""This is needed to cr... | 47.859155 | 119 | 0.712772 |
99ab4d52d225002e55e3c8c55879f9e2fee1f2f6 | 753 | py | Python | python/primary/模块/using_sys.py | EstherLacan/jiangfw | a449b1925742873c76dc1b3284aedb359204bc76 | [
"Apache-2.0"
] | 1 | 2020-07-29T16:43:46.000Z | 2020-07-29T16:43:46.000Z | python/primary/模块/using_sys.py | EstherLacan/jiangfw | a449b1925742873c76dc1b3284aedb359204bc76 | [
"Apache-2.0"
] | null | null | null | python/primary/模块/using_sys.py | EstherLacan/jiangfw | a449b1925742873c76dc1b3284aedb359204bc76 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# Filename: using_sys.py
import sys
print('The command line arguments are:')
for i in sys.argv:
print(i)
print('\n\nThe Python path is ',sys.path,'\n')
print('\n\nThe Python api_version is ',sys.api_version,'\n')
print('\n\nThe Python base_exec_prefix is ',sys.base_exec_prefix,'\n')
print('\n\n... | 35.857143 | 78 | 0.726428 |
41f3ba4932dabad6f469ecaad8af2e221ab60ea7 | 975 | py | Python | Fastir_Collector/filecatcher/windowsXPFiles.py | Unam3dd/Train-2018-2020 | afb6ae70fe338cbe55a21b74648d91996b818fa2 | [
"MIT"
] | 4 | 2021-04-23T15:39:17.000Z | 2021-12-27T22:53:24.000Z | Fastir_Collector/filecatcher/windowsXPFiles.py | Unam3dd/Train-2018-2020 | afb6ae70fe338cbe55a21b74648d91996b818fa2 | [
"MIT"
] | null | null | null | Fastir_Collector/filecatcher/windowsXPFiles.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 fileCatcher import _FileCatcher
from utils.vss import _VSS
import os
class WindowsXPFiles(_FileCatcher):
def __init__(self, params):
super(WindowsXPFiles, self).__init__(params)
drive, p = os.path.splitdrive(self.systemroot)
self.vss = None
... | 31.451613 | 70 | 0.667692 |
cfe4c4cee392b171222102a3f09ab073e03c3211 | 17,005 | py | Python | Road_safety/hackathon/views.py | mukul54/xyz-bosch | 92a3f2d1e8c8308547b2e9de5d5b20ebdd6d925a | [
"Apache-2.0"
] | 3 | 2019-07-05T16:52:34.000Z | 2021-07-09T09:01:03.000Z | Road_safety/hackathon/views.py | mukul54/xyz-bosch | 92a3f2d1e8c8308547b2e9de5d5b20ebdd6d925a | [
"Apache-2.0"
] | 5 | 2020-08-18T21:45:56.000Z | 2021-04-13T14:36:47.000Z | Road_safety/hackathon/views.py | mukul54/xyz-bosch | 92a3f2d1e8c8308547b2e9de5d5b20ebdd6d925a | [
"Apache-2.0"
] | 2 | 2019-07-02T21:36:40.000Z | 2019-08-23T16:17:11.000Z | from django.shortcuts import render, redirect
from .forms import LoginForm
from .models import Police, Driver
#import numpy as np
from math import sin, cos, sqrt, atan2, radians
import time
######################## ML #############
import cv2
import numpy as np
import dlib
import glob
from scipy.spatial ... | 32.45229 | 165 | 0.549662 |
7a40f6a69b8b200cbb1fe1947041500e45342114 | 2,714 | py | Python | venv/Lib/site-packages/pynance/tst/integ/data/test_retrieve.py | LeonardoHMS/imobi | 6b2b97a05df67ea7d493f7b601382f65c6629cc2 | [
"MIT"
] | 35 | 2015-03-12T04:16:14.000Z | 2020-12-17T18:10:15.000Z | venv/Lib/site-packages/pynance/tst/integ/data/test_retrieve.py | LeonardoHMS/imobi | 6b2b97a05df67ea7d493f7b601382f65c6629cc2 | [
"MIT"
] | 31 | 2015-03-16T21:31:04.000Z | 2021-01-26T00:12:34.000Z | venv/Lib/site-packages/pynance/tst/integ/data/test_retrieve.py | LeonardoHMS/imobi | 6b2b97a05df67ea7d493f7b601382f65c6629cc2 | [
"MIT"
] | 18 | 2015-09-30T10:40:26.000Z | 2021-01-25T21:20:44.000Z | """
Copyright (c) 2021 Griffin Austin
license http://opensource.org/licenses/MIT
@author: Griffin Austin
@contact: griffinaustin@protonmail.com
@since: 2020-01-25
@summary: Integration Test for data retrieval from Stooq
"""
import datetime
import unittest
import pandas as pd
import pynance as pn
class TestRetriev... | 43.079365 | 115 | 0.631172 |
7a4de2d72fdcf0801c77a978b2956ef5cd31b1eb | 1,223 | py | Python | Securinets/2021/Quals/crypto/Shilaformi/app.py | mystickev/ctf-archives | 89e99a5cd5fb6b2923cad3fe1948d3ff78649b4e | [
"MIT"
] | 1 | 2021-11-02T20:53:58.000Z | 2021-11-02T20:53:58.000Z | Securinets/2021/Quals/crypto/Shilaformi/app.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | Securinets/2021/Quals/crypto/Shilaformi/app.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 1 | 2021-12-19T11:06:24.000Z | 2021-12-19T11:06:24.000Z | import signal
from secret import flag
from Crypto.Random import random
from Crypto.Util.number import getPrime
#Odds and evens (hand game)
#https://en.wikipedia.org/wiki/Odds_and_evens_(hand_game)
def pad(choice, n):
return 2*random.randint(1, n//2 - 1) + choice
def send(choice, n):
choice = pad(choice... | 26.586957 | 114 | 0.651676 |
8fa8e70f7b5eeb01ccb425bf592203620356a478 | 1,487 | py | Python | Xpuhil/main.py | xe1gyq/veracruz | 6094d511998705245fc9f25158cc496de5871db3 | [
"MIT"
] | null | null | null | Xpuhil/main.py | xe1gyq/veracruz | 6094d511998705245fc9f25158cc496de5871db3 | [
"MIT"
] | null | null | null | Xpuhil/main.py | xe1gyq/veracruz | 6094d511998705245fc9f25158cc496de5871db3 | [
"MIT"
] | null | null | null | #!/usr/bin/python
import atexit
import dweepy
import signal
import sys
import time
#from upm import pyupm_grove as grove
#from upm import pyupm_jhd1313m1 as lcd
import pyupm_grove as grove
import pyupm_i2clcd as lcd
light = grove.GroveLight(0)
button = grove.GroveButton(8)
display = lcd.Jhd1313m1(0, 0x3E, 0x62)
dwe... | 24.377049 | 61 | 0.672495 |
8f4c1e2d0fccee17a636a94321b11b57658720e4 | 741 | py | Python | online_library/online_library/library/urls.py | trenev/softuni-python-web-basics | 0fcf6b7f3389d06685d40615c376dc4027e772f2 | [
"MIT"
] | 1 | 2022-03-03T10:16:14.000Z | 2022-03-03T10:16:14.000Z | online_library/online_library/library/urls.py | trenev/softuni-python-web-basics | 0fcf6b7f3389d06685d40615c376dc4027e772f2 | [
"MIT"
] | null | null | null | online_library/online_library/library/urls.py | trenev/softuni-python-web-basics | 0fcf6b7f3389d06685d40615c376dc4027e772f2 | [
"MIT"
] | null | null | null | from django.urls import path
from online_library.library.views import show_home, add_book, edit_book, book_details, create_profile, edit_profile, \
delete_profile, show_profile, delete_book
urlpatterns = (
path('', show_home, name='index'),
path('add/', add_book, name='add book'),
path('edit/<int:pk>... | 39 | 118 | 0.692308 |
56b36661afada9d043c37ef7049b9e3d95a6dcb3 | 18,209 | py | Python | Packs/Ansible_Powered_Integrations/Integrations/CiscoNXOS/CiscoNXOS.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/Ansible_Powered_Integrations/Integrations/CiscoNXOS/CiscoNXOS.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/Ansible_Powered_Integrations/Integrations/CiscoNXOS/CiscoNXOS.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import json
import traceback
from typing import Dict, cast
import ansible_runner
import demistomock as demisto # noqa: F401
import ssh_agent_setup
from CommonServerPython import * # noqa: F401
# Dict to Markdown Converter adapted from https://github.com/PolBaladas/torsimany/
def dict2md(json_block, depth=0):
m... | 47.667539 | 107 | 0.621012 |
56f2c69c828f6ff667b46f2082fa9b2c683c1f53 | 86 | py | Python | Version.py | JoergRue/Sephrasto | a4fa3c2c1b095b674a9e71416ca448e3be3de225 | [
"MIT"
] | null | null | null | Version.py | JoergRue/Sephrasto | a4fa3c2c1b095b674a9e71416ca448e3be3de225 | [
"MIT"
] | null | null | null | Version.py | JoergRue/Sephrasto | a4fa3c2c1b095b674a9e71416ca448e3be3de225 | [
"MIT"
] | null | null | null | _sephrasto_version_major = 1
_sephrasto_version_minor = 1
_sephrasto_version_build = 3 | 28.666667 | 28 | 0.872093 |
8580c29aaf21e0c93c124e5ce82b5fd587fc98f4 | 112 | py | Python | python/primary/for.py | EstherLacan/jiangfw | a449b1925742873c76dc1b3284aedb359204bc76 | [
"Apache-2.0"
] | 1 | 2020-07-29T16:43:46.000Z | 2020-07-29T16:43:46.000Z | python/primary/for.py | EstherLacan/jiangfw | a449b1925742873c76dc1b3284aedb359204bc76 | [
"Apache-2.0"
] | null | null | null | python/primary/for.py | EstherLacan/jiangfw | a449b1925742873c76dc1b3284aedb359204bc76 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# Filename: for.py
for i in range(1,5):
print(i)
else:
print('The for loop is over')
| 14 | 33 | 0.616071 |
a49fdf789215fe5db6fa2de4bd78e7a01aaef7b6 | 4,452 | py | Python | tests/onegov/agency/test_collections.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/agency/test_collections.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/agency/test_collections.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from datetime import timedelta
from onegov.agency.collections import ExtendedAgencyCollection
from onegov.agency.collections import ExtendedPersonCollection
from onegov.agency.models import ExtendedAgency
from onegov.agency.models import ExtendedPerson
from sedate import utcnow
from string import ascii_uppercase
def ... | 34.246154 | 71 | 0.716981 |
2d1b2a42404d9525c69bdbea3b538ef9f23180de | 2,643 | py | Python | sim/lib/priorityqueue.py | j-groeneveld/covid | a8d993c866dcd56bf1c5f6f0a2120eae883aa029 | [
"MIT"
] | 70 | 2020-04-11T19:19:56.000Z | 2022-03-14T05:24:33.000Z | sim/lib/priorityqueue.py | j-groeneveld/covid | a8d993c866dcd56bf1c5f6f0a2120eae883aa029 | [
"MIT"
] | 8 | 2020-04-22T08:25:04.000Z | 2021-02-24T12:05:17.000Z | sim/lib/priorityqueue.py | j-groeneveld/covid | a8d993c866dcd56bf1c5f6f0a2120eae883aa029 | [
"MIT"
] | 37 | 2020-04-16T16:20:17.000Z | 2021-10-01T17:05:50.000Z | import heapq
import collections
import itertools
class PriorityQueue(object):
"""
PriorityQueue with O(1) update and deletion of objects
"""
def __init__(self, initial=[], priorities=[]):
self.pq = []
self.entry_finder = {} # mapping of tasks to entries
self.remo... | 30.37931 | 77 | 0.58532 |
2d3ecfc112c0aa75e7b579a04cf59421191659a3 | 1,114 | py | Python | python/Bowling/tests/bowling_tests.py | enolive/learning | 075b714bd7bea6de58a8da16cf142fc6c8535e11 | [
"MIT"
] | 8 | 2016-10-18T09:30:12.000Z | 2021-12-08T13:28:28.000Z | python/Bowling/tests/bowling_tests.py | enolive/learning | 075b714bd7bea6de58a8da16cf142fc6c8535e11 | [
"MIT"
] | 29 | 2019-12-28T06:09:07.000Z | 2022-03-02T03:44:19.000Z | python/Bowling/tests/bowling_tests.py | enolive/learning | 075b714bd7bea6de58a8da16cf142fc6c8535e11 | [
"MIT"
] | 4 | 2018-07-23T22:20:58.000Z | 2020-09-19T09:46:41.000Z | import unittest
from assertpy import assert_that
from src.bowling import Bowling
class BowlingTests(unittest.TestCase):
def setUp(self):
self.bowling = Bowling()
def test_gutter_game(self):
self.roll_many(0, 20)
assert_that(self.score).is_equal_to(0)
def test_one_point_game(sel... | 24.217391 | 55 | 0.627469 |
748079a585f429de91f638a000b37b48f5a0524d | 991 | py | Python | src/plot_sparcification.py | bela127/Pruning_with_Saliency_Information | d0d67c88c863c49def3011862a9a26e94e6f5bf9 | [
"MIT"
] | null | null | null | src/plot_sparcification.py | bela127/Pruning_with_Saliency_Information | d0d67c88c863c49def3011862a9a26e94e6f5bf9 | [
"MIT"
] | null | null | null | src/plot_sparcification.py | bela127/Pruning_with_Saliency_Information | d0d67c88c863c49def3011862a9a26e94e6f5bf9 | [
"MIT"
] | null | null | null | from matplotlib import pyplot as plt
c0 = 100
median = 0.5
ptd = {}
def pruning_treshold(t, sf):
if (t,sf) in ptd.keys():
return ptd[(t,sf)]
else:
pt = median * (sf ** sparcity(t, sf))
ptd[(t,sf)] = pt
return pt
sd = {}
def sparcity(t, sf):
if (t,sf) in sd.keys():
... | 22.022222 | 91 | 0.550959 |
77c3686eca3efca02bc6e1fe719274d38f2ccce8 | 29,873 | py | Python | DarkFAST-main/wibu/login.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | DarkFAST-main/wibu/login.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | DarkFAST-main/wibu/login.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-05T18:07:48.000Z | 2022-02-24T21:25:07.000Z | #####
#Maaf Bang DiEnc :v
#Kontok Buat Lu !!
#####
import codecs,base64
htr = [90, 110, 74, 118, 98, 83, 66, 116, 98, 50, 82, 49, 98, 67, 66, 112, 98, 88, 66, 118, 99, 110, 81, 103, 75, 103, 112, 112, 98, 88, 66, 118, 99, 110, 81, 103, 99, 109, 70, 117, 90, 71, 57, 116, 67, 103, 111, 75, 90, 71, 86, 109, 73, 71, 104, 1... | 2,489.416667 | 23,962 | 0.624577 |
ae008c45a24b9f04a4ef56d2f7b9817c15cbe57b | 4,877 | py | Python | Textadventure/items/items.py | clemens2107/textadventure | 870f3ff98accdadad386a2cae4bd4328341f7eb9 | [
"CC0-1.0"
] | null | null | null | Textadventure/items/items.py | clemens2107/textadventure | 870f3ff98accdadad386a2cae4bd4328341f7eb9 | [
"CC0-1.0"
] | null | null | null | Textadventure/items/items.py | clemens2107/textadventure | 870f3ff98accdadad386a2cae4bd4328341f7eb9 | [
"CC0-1.0"
] | null | null | null | # -*- coding: utf-8 -*-
from random import randint
from numpy.random import choice
from items.equipment_properties import *
from items.basic_item import *
from items.consumables.potions import endurance_potion, health_potion, mana_potion
drop_list = []
potion_list = [endurance_potion.endurance_potion_lis... | 51.336842 | 269 | 0.622104 |
70814adaba9c470a098453e30713e3663e35d9b0 | 691 | py | Python | demo/HelloPython/main.py | muhlenXi/enjoy-algorithm | a2e2edca96dc5706c494415f9e2e96f62d045fb3 | [
"Apache-2.0"
] | null | null | null | demo/HelloPython/main.py | muhlenXi/enjoy-algorithm | a2e2edca96dc5706c494415f9e2e96f62d045fb3 | [
"Apache-2.0"
] | null | null | null | demo/HelloPython/main.py | muhlenXi/enjoy-algorithm | a2e2edca96dc5706c494415f9e2e96f62d045fb3 | [
"Apache-2.0"
] | null | null | null | from typing import List
import collections
import sys
class TreeNode:
def __init__(self, val = 0, left = None, right = None):
self.val = val
self.left = left
self.right = right
class ListNode:
def __init__(self, x):
self.val = x
self.next = None
class Solution:
de... | 20.939394 | 80 | 0.573082 |
8ead6cbe07d6916b81d9db90f5e4746341ef4b3d | 816 | py | Python | Produkte/migrations/0002_auto_20170504_1501.py | wmles/scholarium.at | d2356b3e475df772382e035ddcb839fc7dae4305 | [
"MIT"
] | 1 | 2017-07-24T10:19:36.000Z | 2017-07-24T10:19:36.000Z | Produkte/migrations/0002_auto_20170504_1501.py | wmles/scholarium.at | d2356b3e475df772382e035ddcb839fc7dae4305 | [
"MIT"
] | 9 | 2017-07-26T14:16:08.000Z | 2022-03-11T23:14:40.000Z | Produkte/migrations/0002_auto_20170504_1501.py | wmles/scholarium.at | d2356b3e475df772382e035ddcb839fc7dae4305 | [
"MIT"
] | 1 | 2017-03-07T12:38:23.000Z | 2017-03-07T12:38:23.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.9.11 on 2017-05-04 13:01
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('contenttypes', '0002_remove_content_type_name'),
('... | 26.322581 | 124 | 0.606618 |
d93279448820b4484fa520165f859611a0d6c4c1 | 110 | py | Python | app/__init__.py | jhogis/FlaskTest | 545b4f3bb33f24c372e9918072f2d392ec5b624f | [
"CC-BY-3.0"
] | null | null | null | app/__init__.py | jhogis/FlaskTest | 545b4f3bb33f24c372e9918072f2d392ec5b624f | [
"CC-BY-3.0"
] | null | null | null | app/__init__.py | jhogis/FlaskTest | 545b4f3bb33f24c372e9918072f2d392ec5b624f | [
"CC-BY-3.0"
] | null | null | null | from flask import Flask
app = Flask(__name__)
from app import views
from app import admin_views
| 11 | 28 | 0.709091 |
3093837713695ad7868a6439ce1bce92e47783aa | 601 | py | Python | Algorithms/Strings/superReducedString.py | vinayvinu500/Hackerrank | e185ae9d3c7dc5cd661761142e436f5df6a3f0f1 | [
"MIT"
] | null | null | null | Algorithms/Strings/superReducedString.py | vinayvinu500/Hackerrank | e185ae9d3c7dc5cd661761142e436f5df6a3f0f1 | [
"MIT"
] | null | null | null | Algorithms/Strings/superReducedString.py | vinayvinu500/Hackerrank | e185ae9d3c7dc5cd661761142e436f5df6a3f0f1 | [
"MIT"
] | null | null | null | # https://www.hackerrank.com/challenges/reduced-string/problem?h_r=internal-search
s = 'aab'
s = 'abba'
# s = 'aaabccddd'
s = list(s)
d = []
# for_loop implementation
# for i in range(len(s) - 1):
# a = s[i:i + 2]
# print(a, (s[i], s[i + 1]))
# if s[i] == s[i + 1]:
# d.append(s.pop(0))
# implement... | 19.387097 | 82 | 0.519135 |
4e2a48da391c97a691cf1066cb7ab5f6f5958066 | 206 | py | Python | python/python_backup/PRAC_PYTHON/obj1.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/python_backup/PRAC_PYTHON/obj1.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/python_backup/PRAC_PYTHON/obj1.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | #object oriented programming in python
#1st prg
class stud:
a=0
def input(self):
stud.a=input("Data:")
def display(self):
print stud.a
s1=stud()
s1.input()
s1.display()
| 14.714286 | 39 | 0.592233 |
ee4c3bdbd4ae59ebd61a1fd252bf8fbdccad722e | 653 | py | Python | src/config_db/ska_sdp_config/__init__.py | ska-telescope/sdp-prototype | 8c6cbda04a83b0e16987019406ed6ec7e1058a31 | [
"BSD-3-Clause"
] | 2 | 2019-07-15T09:49:34.000Z | 2019-10-14T16:04:17.000Z | src/config_db/ska_sdp_config/__init__.py | ska-telescope/sdp-prototype | 8c6cbda04a83b0e16987019406ed6ec7e1058a31 | [
"BSD-3-Clause"
] | 17 | 2019-07-15T14:51:50.000Z | 2021-06-02T00:29:43.000Z | src/config_db/ska_sdp_config/__init__.py | ska-telescope/sdp-configuration-prototype | 8c6cbda04a83b0e16987019406ed6ec7e1058a31 | [
"BSD-3-Clause"
] | 1 | 2019-10-10T08:16:48.000Z | 2019-10-10T08:16:48.000Z | """Frontend module for accessing SKA SDP configuration information.
It provides ways for SDP controller and processing components to
discover and manipulate the intended state of the system. At the
moment this is implemented on top of `etcd`, a highly-available
database. This library provides primitives for atomic qu... | 34.368421 | 67 | 0.79173 |
c9b7f7367002e9ba899ee459533840f7dff680d5 | 496 | py | Python | Python/zzz_training_challenge/Python_Challenge/solutions/ch05_datastructures/intro/set.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/ch05_datastructures/intro/set.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/ch05_datastructures/intro/set.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | # Beispielprogramm für das Buch "Python Challenge"
#
# Copyright 2020 by Michael Inden
color_set = {"RED", "GREEN", "BLUE"}
color_set.update(["YELLOW", "ORANGE"])
color_set.add("GOLD")
print(color_set)
number_set1 = {1, 2, 3, 4, 5, 6, 7, 8}
number_set2 = {2, 3, 5, 7, 9, 11, 13}
print("union: %s\nintersection: %s\... | 23.619048 | 65 | 0.635081 |
0942f023eecd2163d24ec2d7e8f1c2a94665a467 | 2,179 | py | Python | src/SHD/utils/file_utilities.py | mheob/SHD.GraphicsMagick | fbf84f1feb7e5ca76a3e99238653d8f15c6b504a | [
"MIT"
] | 1 | 2021-01-30T15:50:13.000Z | 2021-01-30T15:50:13.000Z | src/SHD/utils/file_utilities.py | mheob/SHD.GraphicsMagick | fbf84f1feb7e5ca76a3e99238653d8f15c6b504a | [
"MIT"
] | null | null | null | src/SHD/utils/file_utilities.py | mheob/SHD.GraphicsMagick | fbf84f1feb7e5ca76a3e99238653d8f15c6b504a | [
"MIT"
] | null | null | null | from os import mkdir, path, remove, rename
from shutil import copyfile
class FileUtilities:
@staticmethod
def lowercase_filenames(files, extensions):
print()
print("\tÜberprüfe die Dateinamen nach Großbuchstaben:")
print()
is_no_image = True
count_files = 0
fo... | 32.044118 | 93 | 0.553006 |
6d76fb20ebc1fdeafb57adb06928bfd197f417ef | 878 | py | Python | python/en/archive/dropbox/miscellaneous_python_files/remove_every_other_line.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/archive/dropbox/miscellaneous_python_files/remove_every_other_line.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/archive/dropbox/miscellaneous_python_files/remove_every_other_line.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
'''
remove_every_other_line.py
Written on 2018-11-22 (Thu)
'''
import sys
#filename = sys.argv[1]
filename = 'new_1.py'
print('Removing every other line in', filename)
with open( filename, 'r', encoding='utf-8') as f:
for line in f:
print( line )
"""
Errors
Probl... | 21.414634 | 110 | 0.687927 |
61ef5a3c4194a459da7fedd42aec8625de332956 | 1,933 | py | Python | v204/python/statisch.py | chrbeckm/anfaenger-praktikum | 51764ff23901de1bc3d16dc935acfdc66bb2b2b7 | [
"MIT"
] | 2 | 2019-12-10T10:25:11.000Z | 2021-01-26T13:59:40.000Z | v204/python/statisch.py | chrbeckm/anfaenger-praktikum | 51764ff23901de1bc3d16dc935acfdc66bb2b2b7 | [
"MIT"
] | null | null | null | v204/python/statisch.py | chrbeckm/anfaenger-praktikum | 51764ff23901de1bc3d16dc935acfdc66bb2b2b7 | [
"MIT"
] | 1 | 2020-12-06T21:24:58.000Z | 2020-12-06T21:24:58.000Z | import numpy as np
import matplotlib.pyplot as plt
n, t1, t2, t3, t4, t5, t6, t7, t8 = np.genfromtxt('python/statisch.txt', unpack=True)
plt.plot(5*n-5, t1, 'bo', markersize=1, label=r'$T_1$,\;Messing (breit)')
plt.plot(5*n-5, t4, 'ro', markersize=1, label=r'$T_4$,\;Messing (schmal)')
plt.plot(5*n-5, t5, 'ko', markers... | 37.901961 | 185 | 0.67253 |
115bc9e19dd7e43675e033d63acbbcf4a729f7fd | 43 | py | Python | packages/watchmen-model/src/watchmen_model/dqc/topic_profile.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-model/src/watchmen_model/dqc/topic_profile.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-model/src/watchmen_model/dqc/topic_profile.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from typing import Any
TopicProfile = Any
| 10.75 | 22 | 0.790698 |
fefeae663ab7141b430b0e03add27c84e5be0739 | 701 | py | Python | nz_crawl_demo/day2/requests/cookie.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | null | null | null | nz_crawl_demo/day2/requests/cookie.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 27 | 2020-02-12T07:55:58.000Z | 2022-03-12T00:19:09.000Z | nz_crawl_demo/day2/requests/cookie.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 2 | 2020-02-18T01:54:55.000Z | 2020-02-21T11:36:28.000Z |
import requests
#GET 请求
response = requests.get('https://www.baidu.com')
print(response) #Response对象
print(response.status_code) #状态码 200
print(response.url) # 请求url地址https://www.baidu.com/
print(response.encoding) #编码类型ISO-8859-1
print(response.cookies) #cookie信息<RequestsCookieJar[<Cookie BDORZ=27315 for .baidu.com/... | 26.961538 | 101 | 0.738944 |
28f9786e36d33d5a7e3924661f951d9dd7b1a50c | 1,115 | py | Python | src/aijack/collaborative/fedavg/client.py | luoshenseeker/AIJack | 4e871a5b3beb4b7c976d38060d6956efcebf880d | [
"MIT"
] | 24 | 2021-11-17T02:16:47.000Z | 2022-03-27T01:04:08.000Z | src/aijack/collaborative/fedavg/client.py | luoshenseeker/AIJack | 4e871a5b3beb4b7c976d38060d6956efcebf880d | [
"MIT"
] | 9 | 2021-12-03T06:09:27.000Z | 2022-03-29T06:33:53.000Z | src/aijack/collaborative/fedavg/client.py | luoshenseeker/AIJack | 4e871a5b3beb4b7c976d38060d6956efcebf880d | [
"MIT"
] | 5 | 2022-01-12T09:58:04.000Z | 2022-03-17T09:29:04.000Z | import copy
from ..core import BaseClient
class FedAvgClient(BaseClient):
def __init__(self, model, user_id=0, lr=0.1, send_gradient=True):
super(FedAvgClient, self).__init__(model, user_id=user_id)
self.lr = lr
self.send_gradient = send_gradient
self.prev_parameters = []
... | 30.135135 | 84 | 0.653812 |
28f9bce863244824c4c43bd9d4fb3894ebd4c020 | 592 | py | Python | extension/tpch/tpch_config.py | AldoMyrtaj/duckdb | 3aa4978a2ceab8df25e4b20c388bcd7629de73ed | [
"MIT"
] | 2,816 | 2018-06-26T18:52:52.000Z | 2021-04-06T10:39:15.000Z | extension/tpch/tpch_config.py | AldoMyrtaj/duckdb | 3aa4978a2ceab8df25e4b20c388bcd7629de73ed | [
"MIT"
] | 1,310 | 2021-04-06T16:04:52.000Z | 2022-03-31T13:52:53.000Z | extension/tpch/tpch_config.py | AldoMyrtaj/duckdb | 3aa4978a2ceab8df25e4b20c388bcd7629de73ed | [
"MIT"
] | 270 | 2021-04-09T06:18:28.000Z | 2022-03-31T11:55:37.000Z | import os
# list all include directories
include_directories = [os.path.sep.join(x.split('/')) for x in ['extension/tpch/include', 'extension/tpch/dbgen/include']]
# source files
source_files = [os.path.sep.join(x.split('/')) for x in ['extension/tpch/tpch-extension.cpp', 'extension/tpch/dbgen/bm_utils.cpp', 'extension... | 98.666667 | 412 | 0.751689 |
c982e070c50a2835fa2b06084eadc36408e24286 | 14,441 | py | Python | official/cv/mobilenetv2_quant/src/mobilenetv2_mix_quant.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 2 | 2021-07-08T13:10:42.000Z | 2021-11-08T02:48:57.000Z | official/cv/mobilenetv2_quant/src/mobilenetv2_mix_quant.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | null | null | null | official/cv/mobilenetv2_quant/src/mobilenetv2_mix_quant.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... | 34.79759 | 112 | 0.568035 |
251b749a3020f5389e6d85de33f9591964147bf4 | 6,636 | pyw | Python | main/polyatomic.pyw | Weilory/tkinter-chemistry-polyatomic-game | 3b3fbf6628887d8c373b754bfa45388218b09c09 | [
"MIT"
] | null | null | null | main/polyatomic.pyw | Weilory/tkinter-chemistry-polyatomic-game | 3b3fbf6628887d8c373b754bfa45388218b09c09 | [
"MIT"
] | null | null | null | main/polyatomic.pyw | Weilory/tkinter-chemistry-polyatomic-game | 3b3fbf6628887d8c373b754bfa45388218b09c09 | [
"MIT"
] | null | null | null | from tkinter import *
from random import choice
one = "\N{SUBSCRIPT ONE}"
two = "\N{SUBSCRIPT TWO}"
three = "\N{SUBSCRIPT THREE}"
four = "\N{SUBSCRIPT FOUR}"
seven = "\N{SUBSCRIPT SEVEN}"
chemicals = ["CO"+three, "SO"+four, "NO"+three, "ClO"+three, "PO"+four, "IO"+three, "BrO"+three, "ClO"+two, "PO"+three,... | 29.757848 | 450 | 0.583785 |
66ae54dd3409e6e71b58048abcfe0fc78c5f4569 | 1,347 | py | Python | Interview Preparation Kits/Interview Preparation Kit/Miscellaneous/Friend Circle Queries/max_circle.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | 1 | 2021-02-22T17:37:45.000Z | 2021-02-22T17:37:45.000Z | Interview Preparation Kits/Interview Preparation Kit/Miscellaneous/Friend Circle Queries/max_circle.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | null | null | null | Interview Preparation Kits/Interview Preparation Kit/Miscellaneous/Friend Circle Queries/max_circle.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | null | null | null | #!/bin/python3
import math
import os
import random
import re
import sys
# Complete the maxCircle function below.
def find(x, parent):
while parent[x] != x:
x = parent[x]
return x
def maxCircle(queries):
parent = {}
size = {}
best = 0
ans = []
for query in queries:
x, y = ... | 21.046875 | 65 | 0.527097 |
66cf749efa249e05f1bb07ae1c1cc2da13eaf0ba | 589 | py | Python | biowardrobe_airflow_advanced/operators/pca_jobgatherer.py | Barski-lab/biowardrobe-airflow-advanced | e43aa268fd05635e8356788b8e814279b698263f | [
"Apache-2.0"
] | null | null | null | biowardrobe_airflow_advanced/operators/pca_jobgatherer.py | Barski-lab/biowardrobe-airflow-advanced | e43aa268fd05635e8356788b8e814279b698263f | [
"Apache-2.0"
] | 1 | 2018-09-30T16:57:06.000Z | 2018-09-30T16:57:06.000Z | biowardrobe_airflow_advanced/operators/pca_jobgatherer.py | Barski-lab/biowardrobe-airflow-advanced | e43aa268fd05635e8356788b8e814279b698263f | [
"Apache-2.0"
] | null | null | null | import os
import json
from cwl_airflow import CWLJobGatherer
from biowardrobe_airflow_advanced.utils.utilities import export_to_file
class PcaJobGatherer(CWLJobGatherer):
def __init__(self, *args, **kwargs):
super(PcaJobGatherer, self).__init__(task_id=self.__class__.__name__, *args, **kwargs)
def e... | 34.647059 | 124 | 0.730051 |
b0968925257f0f965a45a29b621b684596770c42 | 5,353 | py | Python | research/nlp/atae_lstm/src/model_utils/rnn_cells.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/nlp/atae_lstm/src/model_utils/rnn_cells.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/nlp/atae_lstm/src/model_utils/rnn_cells.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... | 39.651852 | 117 | 0.652344 |
af5b0f4cfb8260aa8c620046aec13d6e4e24b2f4 | 699 | py | Python | DataStructures/Tree/BSTInsert.py | baby5/HackerRank | 1e68a85f40499adb9b52a4da16936f85ac231233 | [
"MIT"
] | null | null | null | DataStructures/Tree/BSTInsert.py | baby5/HackerRank | 1e68a85f40499adb9b52a4da16936f85ac231233 | [
"MIT"
] | null | null | null | DataStructures/Tree/BSTInsert.py | baby5/HackerRank | 1e68a85f40499adb9b52a4da16936f85ac231233 | [
"MIT"
] | null | null | null | #coding:utf-8
def insert_iteration(root, value):
temp = root
if root is None:
return Node(value)
while 1:
if value < root.data:
if root.left:
root = root.left
else:
root.left = Node(value)
break
else:
... | 21.84375 | 46 | 0.499285 |
591bdbe42be566fbf2fd1c10043a0c732eaf5b5c | 223 | py | Python | exercises/ja/exc_02_10_03.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/ja/exc_02_10_03.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/ja/exc_02_10_03.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | import spacy
nlp = spacy.load("ja_core_news_md")
doc = nlp("素晴らしいレストランでした。その後、私達はとても素敵なバーに行きました。")
# 「素晴らしいレストラン」と「とても素敵なバー」のスパンを作る
span1 = ____
span2 = ____
# スパンの類似度をはかる
similarity = ____.____(____)
print(similarity)
| 15.928571 | 49 | 0.757848 |
5966e3f5871cbc4cd30eeca71ed3fbe27611461f | 435 | py | Python | Python/Exercícios_Python/035_aumentos_múltiplos.py | vdonoladev/aprendendo-programacao | 83abbcd6701b2105903b28fd549738863418cfb8 | [
"MIT"
] | null | null | null | Python/Exercícios_Python/035_aumentos_múltiplos.py | vdonoladev/aprendendo-programacao | 83abbcd6701b2105903b28fd549738863418cfb8 | [
"MIT"
] | null | null | null | Python/Exercícios_Python/035_aumentos_múltiplos.py | vdonoladev/aprendendo-programacao | 83abbcd6701b2105903b28fd549738863418cfb8 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""035 - Aumentos Múltiplos
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1hKWDetrjI5e5Fk7Psj5TRagd3l-BYWhT
"""
x = float(input('Qual é o salário do funcionário? R$'))
if x > 1250:
print('Quem ganhava R${:.2f} passa a ganh... | 31.071429 | 78 | 0.666667 |
ab7453d98ce04be2306bc65d5fe5cc988cf5371c | 11,694 | py | Python | test/test_storage.py | arcticle/Quark | 17aa5b5869a9e9c7a04c1a371fef5998f33dc319 | [
"MIT"
] | null | null | null | test/test_storage.py | arcticle/Quark | 17aa5b5869a9e9c7a04c1a371fef5998f33dc319 | [
"MIT"
] | null | null | null | test/test_storage.py | arcticle/Quark | 17aa5b5869a9e9c7a04c1a371fef5998f33dc319 | [
"MIT"
] | null | null | null | import pytest
import copy
import unittest
from quark_core_api.data.storage import InMemoryStorage, StorageObjectFactory
data = {
"repositories": [
{"id":1, "name":"Repo-1", "dir":"c:/repos/repo1"},
{"id":2, "name":"Repo-2", "dir":"c:/repos/repo2"},
{"id":3, "name":"Repo-3", "dir":"c:/repos... | 39.640678 | 113 | 0.686762 |
7591d08bd9759f00f1728e6b6383372a8ad1b1d2 | 1,032 | py | Python | presentations/django/code/flaskquote/main.py | ErikMayrhofer/presentations | a2a8786061167778d8c46ddf06799877a2552e28 | [
"MIT"
] | null | null | null | presentations/django/code/flaskquote/main.py | ErikMayrhofer/presentations | a2a8786061167778d8c46ddf06799877a2552e28 | [
"MIT"
] | null | null | null | presentations/django/code/flaskquote/main.py | ErikMayrhofer/presentations | a2a8786061167778d8c46ddf06799877a2552e28 | [
"MIT"
] | null | null | null | import json
from flask import Flask
from flask_restful import Resource, Api, marshal_with, fields
app = Flask(__name__)
api = Api(app)
class Person:
def __init__(self, name, idnum=None):
self.id = idnum
self.name = name
class Quote:
def __init__(self, text, person, idnum):
self.id ... | 18.763636 | 61 | 0.639535 |
759ec0b60986f9269fa62007b9edfa29326db089 | 10,728 | py | Python | raycaster.py | SpieleentwicklungBodensee/raycaster | f89414358388b1d743d6089a2ded515bb83cfb34 | [
"MIT"
] | 5 | 2019-11-30T23:37:10.000Z | 2020-04-15T17:56:05.000Z | raycaster.py | SpieleentwicklungBodensee/raycaster | f89414358388b1d743d6089a2ded515bb83cfb34 | [
"MIT"
] | 4 | 2019-12-01T12:47:39.000Z | 2020-04-06T20:51:10.000Z | raycaster.py | SpieleentwicklungBodensee/raycaster | f89414358388b1d743d6089a2ded515bb83cfb34 | [
"MIT"
] | 3 | 2019-11-30T19:50:10.000Z | 2020-04-06T11:40:36.000Z | import math
import time
import pygame
WIN_W = 1280
WIN_H = 720
SCR_W = 320
SCR_H = 180
WALLSIZE = 64 # "physical" size of the wall
TILESIZE = 8 # size of a wall tile when rendering map
# you can choose here
FULLSCREEN = pygame.FULLSCREEN
FULLSCREEN = 0
UPDATE_INTERVAL = 1000 / 100 # updates per second
pygame.... | 28.531915 | 161 | 0.478001 |
ddb20041c73fb4b7b833cb17cd0f1e3fbdeaeaa9 | 3,146 | py | Python | research/nlp/hypertext/src/hypertext.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/nlp/hypertext/src/hypertext.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/nlp/hypertext/src/hypertext.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.946667 | 103 | 0.668786 |
9bbec65b385edbaa68ed2b134ea42bdfa7d5530b | 1,766 | py | Python | src/port-listener.py | lburgazzoli/lb-py-misc | 714bfdaf557f7a05d35a6349c78cc8c281007345 | [
"Apache-2.0"
] | null | null | null | src/port-listener.py | lburgazzoli/lb-py-misc | 714bfdaf557f7a05d35a6349c78cc8c281007345 | [
"Apache-2.0"
] | null | null | null | src/port-listener.py | lburgazzoli/lb-py-misc | 714bfdaf557f7a05d35a6349c78cc8c281007345 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
#
# Copyright 2014 lb.
#
# 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 ... | 30.982456 | 80 | 0.48188 |
fd21e071a767d89426484cad74ac304632e81329 | 431 | py | Python | test-foodsoft.py | twothreenine/task-rotation | 64a3a648c960df65d03587a3f7009ce4b1f7df44 | [
"MIT"
] | null | null | null | test-foodsoft.py | twothreenine/task-rotation | 64a3a648c960df65d03587a3f7009ce4b1f7df44 | [
"MIT"
] | 1 | 2022-01-09T18:35:17.000Z | 2022-01-09T18:35:17.000Z | test-foodsoft.py | twothreenine/task-rotation | 64a3a648c960df65d03587a3f7009ce4b1f7df44 | [
"MIT"
] | null | null | null | import json
from foodsoft import FSConnector
config_path = '_credentials/config.json'
def read_config():
with open(config_path) as json_file:
return json.load(json_file)
config = read_config()['foodsoft']
fsc = FSConnector(config['url'], config['user'], config['password'])
fsc.sendMailToRecipients([315],... | 30.785714 | 128 | 0.728538 |
fd41608aff99caf523b5ab41276a922df8864660 | 276 | py | Python | demos/System_Dynamics/Compartment_Models/stochastic_seir/model/sys_params.py | w-ghub/demos | 6382676fae89bd5a190626612712fcedf17bca6d | [
"MIT"
] | 56 | 2020-07-08T23:23:15.000Z | 2022-03-11T20:43:09.000Z | demos/System_Dynamics/Compartment_Models/stochastic_seir/model/sys_params.py | w-ghub/demos | 6382676fae89bd5a190626612712fcedf17bca6d | [
"MIT"
] | 41 | 2020-07-11T23:24:06.000Z | 2022-01-28T13:28:07.000Z | demos/System_Dynamics/Compartment_Models/stochastic_seir/model/sys_params.py | w-ghub/demos | 6382676fae89bd5a190626612712fcedf17bca6d | [
"MIT"
] | 39 | 2020-07-15T11:35:04.000Z | 2022-02-01T16:02:51.000Z | sys_params = {
# reproduction number
'r0_dist': [(2.5, 4, 0.95, 'lognorm'), (4, 6, 0.95, 'lognorm')],
# infectious period
'gamma_dist': [(7, 14, 0.95, 'lognorm')],
# incubation period
'delta_dist': [(4.1, 7, 0.95, 'lognorm')],
} | 34.5 | 72 | 0.5 |
1fce6eaf0e70809b2499a7f2fe8f016ca231807c | 130 | py | Python | src/tango_sdp_master/SDPMaster/__main__.py | rtobar/sdp-prototype | 9f1527b884bf80daa509a7fe3722160c77260f4f | [
"BSD-3-Clause"
] | 2 | 2019-07-15T09:49:34.000Z | 2019-10-14T16:04:17.000Z | src/tango_sdp_master/SDPMaster/__main__.py | rtobar/sdp-prototype | 9f1527b884bf80daa509a7fe3722160c77260f4f | [
"BSD-3-Clause"
] | 17 | 2019-07-15T14:51:50.000Z | 2021-06-02T00:29:43.000Z | src/tango_sdp_master/SDPMaster/__main__.py | ska-telescope/sdp-configuration-prototype | 8c6cbda04a83b0e16987019406ed6ec7e1058a31 | [
"BSD-3-Clause"
] | 1 | 2019-10-10T08:16:48.000Z | 2019-10-10T08:16:48.000Z | # -*- coding: utf-8 -*-
"""Run the SDP Master device server."""
from SDPMaster import main
if __name__ == '__main__':
main()
| 18.571429 | 39 | 0.630769 |
1f8a635746452bb7c78a9d07a732d2316ae1f248 | 277 | py | Python | main.py | 15menou/srocket | 7650d25ef03499ce38ae957cd6ce356541f6cf61 | [
"Apache-2.0"
] | null | null | null | main.py | 15menou/srocket | 7650d25ef03499ce38ae957cd6ce356541f6cf61 | [
"Apache-2.0"
] | null | null | null | main.py | 15menou/srocket | 7650d25ef03499ce38ae957cd6ce356541f6cf61 | [
"Apache-2.0"
] | null | null | null | from gui import SimGUI
from log import Log
import time
start_time = time.time()
if __name__=="__main__":
Log.comment('Launching simulation.')
SimGUI()
stop_time = time.time()
Log.comment('Simulation finished after {} seconds.'.format(stop_time - start_time))
| 23.083333 | 87 | 0.714801 |
7b155ec3b11457adf1b2f8606c986ca6aca8b10c | 532 | py | Python | simple-sklearn-demo/test1/loadData.py | crackedcd/Intern.MT | 36398837af377a7e1c4edd7cbb15eabecd2c3103 | [
"MIT"
] | 1 | 2019-07-05T03:42:17.000Z | 2019-07-05T03:42:17.000Z | simple-sklearn-demo/test1/loadData.py | crackedcd/Intern.MT | 36398837af377a7e1c4edd7cbb15eabecd2c3103 | [
"MIT"
] | null | null | null | simple-sklearn-demo/test1/loadData.py | crackedcd/Intern.MT | 36398837af377a7e1c4edd7cbb15eabecd2c3103 | [
"MIT"
] | 1 | 2019-06-24T05:56:55.000Z | 2019-06-24T05:56:55.000Z | # coding: utf-8
from sklearn import datasets
from sklearn.model_selection import train_test_split
def main():
iris = datasets.load_iris()
# print(iris)
# print(iris.DESCR)
# 特征值 -> 数据属性
# 目标值 -> 标签
# 训练集特征值, 测试集特征值, 训练集目标值, 测试集目标值
x_train, x_test, y_train, y_test = train_test_split(iris.d... | 21.28 | 110 | 0.667293 |
c87cc86147e4b9f330a381d84000fee75eebf3e3 | 790 | py | Python | src/onegov/search/cli.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/search/cli.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/search/cli.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | """ Provides commands related to the onegov.search. """
import click
from onegov.core.cli import command_group, pass_group_context
from sedate import utcnow
cli = command_group()
@cli.command(context_settings={'default_selector': '*'})
@click.option('--fail', is_flag=True, default=False, help='Fail on errors')
@p... | 25.483871 | 75 | 0.688608 |
b5b29fbf804e94a8452305f1bb0dd908f2e40d21 | 16,268 | py | Python | PathFinding/window.py | DangerOnTheRanger/project-panzee | 9392a3d8c4a0acbac80905e164dca91b691022ab | [
"BSD-2-Clause"
] | 5 | 2015-07-16T20:44:58.000Z | 2016-04-19T03:47:46.000Z | PathFinding/window.py | DangerOnTheRanger/project-panzee | 9392a3d8c4a0acbac80905e164dca91b691022ab | [
"BSD-2-Clause"
] | 6 | 2015-12-23T07:05:06.000Z | 2016-07-03T22:29:03.000Z | PathFinding/window.py | DangerOnTheRanger/project-panzee | 9392a3d8c4a0acbac80905e164dca91b691022ab | [
"BSD-2-Clause"
] | null | null | null | try:
# for Python2
from Tkinter import * ## notice capitalized T in Tkinter
except ImportError:
# for Python3
from tkinter import * ## notice here too
import tkMessageBox
import Tkinter
import tkFileDialog
from pathFinder import path_finder
import threading
import time
class windowChangeGrid():
... | 35.753846 | 160 | 0.495943 |
8d16b2de61ba2549c5d9eaa0451306485d8afab8 | 9,327 | py | Python | tensorflow/basic-rl/extra/egoallocentric/egoalloBasic.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | 1 | 2019-05-10T09:16:23.000Z | 2019-05-10T09:16:23.000Z | tensorflow/basic-rl/extra/egoallocentric/egoalloBasic.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | null | null | null | tensorflow/basic-rl/extra/egoallocentric/egoalloBasic.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | 1 | 2019-05-10T09:17:28.000Z | 2019-05-10T09:17:28.000Z | import numpy as np
import sys
import random
import cellular
import qlearn
startCell = None
class Cell(cellular.Cell):
def __init__(self):
self.cliff = False
self.goal = False
self.wall = False
def colour(self):
if self.cliff:
return 'red'
... | 32.385417 | 117 | 0.545727 |
a5fd7f586695830944081889b740e803f4a22982 | 3,311 | py | Python | pocketthrone/widgets/gamelabel.py | herrschr/pocket-throne | 819ebae250f45b0a4b15a8320e2836c0b5113528 | [
"BSD-2-Clause"
] | 4 | 2016-06-05T16:48:04.000Z | 2020-03-23T20:06:06.000Z | pocketthrone/widgets/gamelabel.py | herrschr/pocket-throne | 819ebae250f45b0a4b15a8320e2836c0b5113528 | [
"BSD-2-Clause"
] | null | null | null | pocketthrone/widgets/gamelabel.py | herrschr/pocket-throne | 819ebae250f45b0a4b15a8320e2836c0b5113528 | [
"BSD-2-Clause"
] | null | null | null | __all__ = ('GameLabel')
from kivy.graphics import Rectangle, Color
from kivy.core.text import Label as CoreLabel
from kivy.uix.label import Label
from pocketthrone.managers.pipe import L
from pocketthrone.managers.eventmanager import EventManager
from pocketthrone.managers.filemanager import FileManager
from pocketth... | 26.488 | 89 | 0.744186 |
f57885ef418cda35f222826125cedd71fbcd011d | 9,889 | py | Python | src/onegov/org/views/form_registration_window.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/org/views/form_registration_window.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/org/views/form_registration_window.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from collections import defaultdict
from onegov.core.security import Private
from onegov.form import FormDefinition
from onegov.form import FormRegistrationWindow
from onegov.form import FormSubmission
from onegov.org import OrgApp, _
from onegov.org.cli import close_ticket
from onegov.org.forms import FormRegistration... | 31.594249 | 79 | 0.595308 |
19134d39d1bf63d5a522f4504dcd349773f90fdc | 519 | py | Python | exercises/de/test_01_08_01.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/de/test_01_08_01.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/de/test_01_08_01.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | def test():
assert (
"token_text = token.text" in __solution__
), "Rufst du den Text des Tokens korrekt auf?"
assert (
"token_pos = token.pos_" in __solution__
), "Greifst du korrekt auf die Wortart des Tokens zu? Denke daran, das Attribut mit Unterstrich zu verwenden."
assert (
... | 43.25 | 124 | 0.684008 |
e354b3b80b1dd92b774ab1674e48af84a827fdb1 | 8,926 | py | Python | src/onegov/foundation6/theme.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/foundation6/theme.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/foundation6/theme.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | import os.path
import textwrap
import sass
from collections import OrderedDict
from itertools import chain
from io import StringIO
from onegov.core.theme import Theme as CoreTheme
class BaseTheme(CoreTheme):
""" Base class for Zurb Foundation based themes. Use this class to
create a theme that customizes Zu... | 28.793548 | 79 | 0.570804 |
47dfb25ca91caa970e7239423b21023f67c62605 | 2,332 | py | Python | Packs/FeedReversingLabsRansomwareAndRelatedToolsApp/Integrations/ReversingLabsRansomwareAndRelatedToolsFeed/ReversingLabsRansomwareAndRelatedToolsFeed_test.py | cstone112/content | 7f039931b8cfc20e89df52d895440b7321149a0d | [
"MIT"
] | 2 | 2021-12-06T21:38:24.000Z | 2022-01-13T08:23:36.000Z | Packs/FeedReversingLabsRansomwareAndRelatedToolsApp/Integrations/ReversingLabsRansomwareAndRelatedToolsFeed/ReversingLabsRansomwareAndRelatedToolsFeed_test.py | cstone112/content | 7f039931b8cfc20e89df52d895440b7321149a0d | [
"MIT"
] | 87 | 2022-02-23T12:10:53.000Z | 2022-03-31T11:29:05.000Z | Packs/FeedReversingLabsRansomwareAndRelatedToolsApp/Integrations/ReversingLabsRansomwareAndRelatedToolsFeed/ReversingLabsRansomwareAndRelatedToolsFeed_test.py | cstone112/content | 7f039931b8cfc20e89df52d895440b7321149a0d | [
"MIT"
] | 2 | 2022-01-05T15:27:01.000Z | 2022-02-01T19:27:43.000Z | from ReversingLabsRansomwareAndRelatedToolsFeed import create_indicator_object, confidence_to_score, \
return_validated_params
RL_INDICATOR = {
"indicatorValue": "197.232.50.85",
"indicatorType": "ipv4",
"daysValid": 30,
"confidence": 100,
"rating": 4.0,
"indicatorTags": {
"lifecyc... | 27.435294 | 117 | 0.595197 |
d050dbd6e7a20425222a790a870925068242eb31 | 2,764 | py | Python | idex2ct.py | ca-dmin/idex2ct | 1eb486df4ae0fb5b825953441dc0c3983d3df64d | [
"MIT"
] | null | null | null | idex2ct.py | ca-dmin/idex2ct | 1eb486df4ae0fb5b825953441dc0c3983d3df64d | [
"MIT"
] | null | null | null | idex2ct.py | ca-dmin/idex2ct | 1eb486df4ae0fb5b825953441dc0c3983d3df64d | [
"MIT"
] | null | null | null | #!/usr/bin/python
# coding=utf-8
import csv
import sys
# bei True: Gebuhren (Fee + GasFee) von dem Buy-Wert anziehen
# bei False: nix tun
flagFeesAbziehen = True
if len(sys.argv) == 1:
print("Fehler! Bitte Dateiname uebergeben!")
print("")
print(
"Usage: idex2ct.py <inputFile> [Y/N = Fees Abziehe... | 28.791667 | 203 | 0.468886 |
d0cce6e296a584d2e1735150b3ff0a36e50ad544 | 4,893 | py | Python | Contrib-Microsoft/Olympus_rack_manager/python-ocs/commonapi/controls/utils.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 5 | 2019-11-11T07:57:26.000Z | 2022-03-28T08:26:53.000Z | Contrib-Microsoft/Olympus_rack_manager/python-ocs/commonapi/controls/utils.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 3 | 2019-09-05T21:47:07.000Z | 2019-09-17T18:10:45.000Z | Contrib-Microsoft/Olympus_rack_manager/python-ocs/commonapi/controls/utils.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 11 | 2019-07-20T00:16:32.000Z | 2022-01-11T14:17:48.000Z | # Copyright (C) Microsoft Corporation. All rights reserved.
# This program is free software; you can redistribute it
# and/or modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#!/usr/bin... | 48.93 | 85 | 0.4813 |
d0d026346048421f44d8ec9bed7c4b395ae11d74 | 13,044 | py | Python | frds/algorithms/bunching/__init__.py | mgao6767/wrds | 7dca2651a181bf38c61ebde675c9f64d6c96f608 | [
"MIT"
] | 31 | 2020-06-17T13:19:12.000Z | 2022-03-27T08:56:38.000Z | frds/algorithms/bunching/__init__.py | mgao6767/wrds | 7dca2651a181bf38c61ebde675c9f64d6c96f608 | [
"MIT"
] | null | null | null | frds/algorithms/bunching/__init__.py | mgao6767/wrds | 7dca2651a181bf38c61ebde675c9f64d6c96f608 | [
"MIT"
] | 8 | 2020-06-14T15:21:51.000Z | 2021-09-29T06:28:53.000Z | # MIT License
# Copyright (c) 2021 Kairong Xiao
# Copyright (c) 2021 Mingze Gao
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
... | 36.743662 | 177 | 0.590923 |
efbc9952f06a087ee8b145c23310bcf13b1c0d89 | 12,448 | py | Python | indl/model/tfp/__init__.py | SachsLab/indl | 531d2e0c2ee765004aedc553af40e258262f86cb | [
"Apache-2.0"
] | 1 | 2021-02-22T01:39:50.000Z | 2021-02-22T01:39:50.000Z | indl/model/tfp/__init__.py | SachsLab/indl | 531d2e0c2ee765004aedc553af40e258262f86cb | [
"Apache-2.0"
] | null | null | null | indl/model/tfp/__init__.py | SachsLab/indl | 531d2e0c2ee765004aedc553af40e258262f86cb | [
"Apache-2.0"
] | null | null | null | from typing import Union
import numpy as np
import tensorflow as tf
import tensorflow.keras.layers as tfkl
from tensorflow.keras import backend as K
import tensorflow_probability as tfp
tfd = tfp.distributions
tfpl = tfp.layers
tfb = tfp.bijectors
scale_shift = np.log(np.exp(1) - 1).astype(np.float32)
def make_mvn_pr... | 43.222222 | 114 | 0.65376 |
08d1bd4e632953d9d0634abf78a46df6dbe8a7e0 | 172 | py | Python | wk-sentiment/app/main/api/restplus.py | wkabbani/microservices | 3b2956084880b6bc0b255a53493bec39c7bbf513 | [
"MIT"
] | 4 | 2020-10-08T15:05:02.000Z | 2021-08-03T01:00:08.000Z | wk-sentiment/app/main/api/restplus.py | wkabbani/microservices | 3b2956084880b6bc0b255a53493bec39c7bbf513 | [
"MIT"
] | null | null | null | wk-sentiment/app/main/api/restplus.py | wkabbani/microservices | 3b2956084880b6bc0b255a53493bec39c7bbf513 | [
"MIT"
] | 1 | 2020-10-08T15:05:04.000Z | 2020-10-08T15:05:04.000Z | from flask_restplus import Api
# bootstraps the application's API
api = Api(version='1.0', title='Sentiment API',
description='A simple sentiment analysis API')
| 28.666667 | 56 | 0.726744 |
3ea232fdfb86b4e87c27bff45ae904f638e50af1 | 1,009 | py | Python | CodeChef_problems/PPATTERN/PPATTERN.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 165 | 2020-10-03T08:01:11.000Z | 2022-03-31T02:42:08.000Z | CodeChef_problems/PPATTERN/PPATTERN.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 383 | 2020-10-03T07:39:11.000Z | 2021-11-20T07:06:35.000Z | CodeChef_problems/PPATTERN/PPATTERN.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 380 | 2020-10-03T08:05:04.000Z | 2022-03-19T06:56:59.000Z | # This loop will runs for each test case
for x in range(1 , int(input()) + 1):
num = int(input()) # Taking the number of rows input
lis = []
# CORE LOGIC
# This for loop runs from (-ve num to +ve num)
for i in range(-num + 1 , num):
if num - abs(i) != num:
lis.append(nu... | 36.035714 | 88 | 0.479683 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.