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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f951a3081a9479fc8cdfcab21fdc9658fdb7afc1 | 851 | py | Python | Beginner/03. Python/fallingdown.py | ankita080208/Hacktoberfest | 2be849e89285260e7b6672f42979943ad6bbec78 | [
"MIT"
] | 3 | 2021-03-16T16:44:04.000Z | 2021-06-07T17:32:51.000Z | Beginner/03. Python/fallingdown.py | ankita080208/Hacktoberfest | 2be849e89285260e7b6672f42979943ad6bbec78 | [
"MIT"
] | 1 | 2020-10-03T16:21:40.000Z | 2020-10-03T16:21:40.000Z | Beginner/03. Python/fallingdown.py | ankita080208/Hacktoberfest | 2be849e89285260e7b6672f42979943ad6bbec78 | [
"MIT"
] | 2 | 2021-10-31T07:40:09.000Z | 2021-11-22T05:10:54.000Z | import pygame
# games initial
pygame.init()
# create game screen
screen = pygame.display.set_mode((400, 300))
# create game frame rate
clock = pygame.time.Clock()
done = False
x = 0
y = 0
color = 0
# create games system
while not done:
# create games event
for event in pygame.event.get():
if eve... | 21.820513 | 66 | 0.575793 |
f9a60858b285dd3e8c46ee21e285fb94cd1ef5a8 | 1,389 | py | Python | lintcode/051-[DUP]-N-Queens/NQueens_003.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2015-12-16T04:01:03.000Z | 2015-12-16T04:01:03.000Z | lintcode/051-[DUP]-N-Queens/NQueens_003.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | lintcode/051-[DUP]-N-Queens/NQueens_003.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | # The idea is the same as the answer: http://www.jiuzhang.com/solutions/n-queens/
# Just BRUTE FORCE, in fact, it's my first idea I had never tried until I take a look at the answer
# What I learned from this problem is that SET operation is not necessarily fast!!!!
class Solution:
"""
Get all distinct N-Queen... | 27.78 | 99 | 0.49964 |
f9bb56a3a135f97bba956497703501fc05a3e78b | 144 | py | Python | quant/example/ex_gate.py | doubleDragon/QuantBot | 53a1d6c62ecece47bf777da0c0754430b706b7fd | [
"MIT"
] | 7 | 2017-10-22T15:00:09.000Z | 2019-09-19T11:45:43.000Z | quant/example/ex_gate.py | doubleDragon/QuantBot | 53a1d6c62ecece47bf777da0c0754430b706b7fd | [
"MIT"
] | 1 | 2018-01-19T16:19:40.000Z | 2018-01-19T16:19:40.000Z | quant/example/ex_gate.py | doubleDragon/QuantBot | 53a1d6c62ecece47bf777da0c0754430b706b7fd | [
"MIT"
] | 5 | 2017-12-11T15:10:29.000Z | 2018-12-21T17:40:58.000Z | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
from quant.api.gate import PublicClient
client = PublicClient()
print(client.depth('eth_btc'))
| 16 | 39 | 0.694444 |
fb21f9a6c035442e8e7f616e18739c5f183bd3a6 | 11,461 | py | Python | Properties/API/O.O/objectO/FileMetrics.py | NazaninBayati/SCA | 74e670462dd0da5e24147aab86df393b38405176 | [
"MIT"
] | null | null | null | Properties/API/O.O/objectO/FileMetrics.py | NazaninBayati/SCA | 74e670462dd0da5e24147aab86df393b38405176 | [
"MIT"
] | null | null | null | Properties/API/O.O/objectO/FileMetrics.py | NazaninBayati/SCA | 74e670462dd0da5e24147aab86df393b38405176 | [
"MIT"
] | null | null | null | import understand
import sys
import MainMetrics
File_Metrics={}
file_dependency={}
file_dependentby={}
cls_CallPairs={}
CallPairs={}
db = MainMetrics.Metrics.DBlodb("/home/nazanin/cephDB.udb")
class fileMetrics(MainMetrics.Metrics):
def included_files(self , db):
self.db = db
for file in sorte... | 42.136029 | 832 | 0.57002 |
34a9d39bb1eb76f1a5f344700f7d59e28a8b701c | 210 | py | Python | 1941-check-if-all-characters-have-equal-number-of-occurrences/1941-check-if-all-characters-have-equal-number-of-occurrences.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | 2 | 2021-12-05T14:29:06.000Z | 2022-01-01T05:46:13.000Z | 1941-check-if-all-characters-have-equal-number-of-occurrences/1941-check-if-all-characters-have-equal-number-of-occurrences.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | 1941-check-if-all-characters-have-equal-number-of-occurrences/1941-check-if-all-characters-have-equal-number-of-occurrences.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | class Solution:
def areOccurrencesEqual(self, s: str) -> bool:
samefreq = s.count(s[0])
for c in set(s):
if s.count(c)!=samefreq:
return False
return True | 30 | 50 | 0.528571 |
34bde01c43781d03b162df3ff160255bf59ea4ed | 1,143 | py | Python | migrations/versions/6d5dc21ec10c_.py | DanielGrams/cityservice | c487c34b5ba6541dcb441fe903ab2012c2256893 | [
"MIT"
] | null | null | null | migrations/versions/6d5dc21ec10c_.py | DanielGrams/cityservice | c487c34b5ba6541dcb441fe903ab2012c2256893 | [
"MIT"
] | 35 | 2022-01-24T22:15:59.000Z | 2022-03-31T15:01:35.000Z | migrations/versions/6d5dc21ec10c_.py | DanielGrams/cityservice | c487c34b5ba6541dcb441fe903ab2012c2256893 | [
"MIT"
] | null | null | null | """empty message
Revision ID: 6d5dc21ec10c
Revises:
Create Date: 2020-03-20 11:32:33.349715
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = "6d5dc21ec10c"
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto genera... | 29.307692 | 74 | 0.654418 |
55058ea5bd10375723ea63453722397938a3221f | 815 | py | Python | aiohttp_server/staticServer.py | gregjhansell97/sandbox | d565da5db2c10af404ce62aa747d5e682bc02a86 | [
"MIT"
] | null | null | null | aiohttp_server/staticServer.py | gregjhansell97/sandbox | d565da5db2c10af404ce62aa747d5e682bc02a86 | [
"MIT"
] | null | null | null | aiohttp_server/staticServer.py | gregjhansell97/sandbox | d565da5db2c10af404ce62aa747d5e682bc02a86 | [
"MIT"
] | null | null | null | '''
https://docs.aiohttp.org/en/stable/web_quickstart.html
'''
from aiohttp import web
import aiohttp_cors
import signal
signal.signal(signal.SIGINT, signal.SIG_DFL)
class StaticServer:
def run(self):
app = web.Application()
cors = aiohttp_cors.setup(app, defaults={
"*": aiohttp_cor... | 24.69697 | 61 | 0.581595 |
fd2c8738a78d57b841317f4ba5ac29c97ee00a01 | 2,045 | py | Python | test/defense/dp/test_accountant.py | luoshenseeker/AIJack | 4e871a5b3beb4b7c976d38060d6956efcebf880d | [
"MIT"
] | 24 | 2021-11-17T02:16:47.000Z | 2022-03-27T01:04:08.000Z | test/defense/dp/test_accountant.py | luoshenseeker/AIJack | 4e871a5b3beb4b7c976d38060d6956efcebf880d | [
"MIT"
] | 9 | 2021-12-03T06:09:27.000Z | 2022-03-29T06:33:53.000Z | test/defense/dp/test_accountant.py | luoshenseeker/AIJack | 4e871a5b3beb4b7c976d38060d6956efcebf880d | [
"MIT"
] | 5 | 2022-01-12T09:58:04.000Z | 2022-03-17T09:29:04.000Z | import pytest
def test_rdp_tight_upperbound():
from aijack.defense import GeneralMomentAccountant
sigma = 1.5
sampling_rate = 0.04
num_steps = int(90 / 0.04)
accountant = GeneralMomentAccountant(
noise_type="Gaussian",
search="greedy",
orders=list(range(2, 73)),
m... | 26.907895 | 83 | 0.658191 |
bd08a76b6fd2431fa1f8562fcdd49bd36305237e | 8,642 | py | Python | client.py | inspurer/SocketQQ | 2d34e797106cb9e74ec79d46582ed3942de46d7f | [
"Apache-2.0"
] | 5 | 2019-03-04T01:08:23.000Z | 2020-11-10T11:35:20.000Z | client.py | inspurer/SocketQQ | 2d34e797106cb9e74ec79d46582ed3942de46d7f | [
"Apache-2.0"
] | null | null | null | client.py | inspurer/SocketQQ | 2d34e797106cb9e74ec79d46582ed3942de46d7f | [
"Apache-2.0"
] | 1 | 2019-04-06T03:39:10.000Z | 2019-04-06T03:39:10.000Z | # -*- coding: utf-8 -*-
# author: inspurer(月小水长)
# pc_type lenovo
# create_date: 2018/12/15
# file_name: client.py
# description: 月小水长,热血未凉
from socket import *
from threading import Thread
import wx
import os
from tkinter import filedialog
import tkinter
import json
import wx.lib.... | 34.706827 | 98 | 0.552534 |
1f937bb8af8f204853cad25a958730422722518d | 661 | py | Python | frappe-bench/apps/erpnext/erpnext/patches/v8_0/update_stock_qty_value_in_bom_item.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_0/update_stock_qty_value_in_bom_item.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v8_0/update_stock_qty_value_in_bom_item.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():
frappe.reload_doc('manufacturing', 'doctype', 'bom_item')
frappe.reload_doc('manufacturing', 'doctype', 'bom_explosion_item')
frappe.reload_do... | 47.214286 | 98 | 0.75643 |
f19f00aceaf1358ef209641000f0244526e2a00f | 783 | py | Python | test/test_tag04.py | kopp/pyventskalender | 6f6455f3c1db07f65a772b2716e4be95fbcd1804 | [
"MIT"
] | null | null | null | test/test_tag04.py | kopp/pyventskalender | 6f6455f3c1db07f65a772b2716e4be95fbcd1804 | [
"MIT"
] | null | null | null | test/test_tag04.py | kopp/pyventskalender | 6f6455f3c1db07f65a772b2716e4be95fbcd1804 | [
"MIT"
] | null | null | null | from unittest import TestCase
try:
from pyventskalender import tag04_loesung as heute
except ImportError:
from pyventskalender import tag04 as heute
class Tag04Tests(TestCase):
def test_10_ich_haette_gerne_so_viele_katzen(self):
self.assertEqual(
heute.ich_haette_gerne_so_viele_katzen... | 31.32 | 70 | 0.679438 |
7b08e560c145f1328d622b8ea53f34644c0d94a7 | 204 | py | Python | Python/Courses/Python-Tutorials.Zulkarnine-Mahmud/00.Fundamentals/02.02-Program-Flow-In-Function.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Courses/Python-Tutorials.Zulkarnine-Mahmud/00.Fundamentals/02.02-Program-Flow-In-Function.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Courses/Python-Tutorials.Zulkarnine-Mahmud/00.Fundamentals/02.02-Program-Flow-In-Function.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | print("i")
def complicated_logic(first, second):
print(f"You passed: {first}, {second}")
number1 = 10
number2 = 3
print("2")
complicated_logic(number1, number2)
complicated_logic(3, 4)
print("3")
| 14.571429 | 43 | 0.696078 |
b5907b546d9a6f8a4fedcf83703de0c937a56ce2 | 1,876 | py | Python | main.py | oguzdemir/MovieFetcher | 53fae62bdb5abcfb4ad9bf704c6d3aa0478abcc7 | [
"MIT"
] | null | null | null | main.py | oguzdemir/MovieFetcher | 53fae62bdb5abcfb4ad9bf704c6d3aa0478abcc7 | [
"MIT"
] | null | null | null | main.py | oguzdemir/MovieFetcher | 53fae62bdb5abcfb4ad9bf704c6d3aa0478abcc7 | [
"MIT"
] | null | null | null | import tmdbsimple as tmdb
import urllib
import os
import string
valid_chars = "-_.() %s%s" % (string.ascii_letters, string.digits)
if __name__ == "__main__":
tmdb.API_KEY = 'x'
search = tmdb.Movies()
base = tmdb.Configuration().info().get("images").get("secure_base_url")
genres = tmdb.Genres().list()... | 32.344828 | 96 | 0.55597 |
27b2a20f5b8685da7808dca5fb0b824b059dc1c1 | 1,235 | py | Python | fg/tournaments/views.py | alex-evans/fgolf | 8fcdfd72d168e25204a914e57d4c3478382fd473 | [
"MIT"
] | null | null | null | fg/tournaments/views.py | alex-evans/fgolf | 8fcdfd72d168e25204a914e57d4c3478382fd473 | [
"MIT"
] | null | null | null | fg/tournaments/views.py | alex-evans/fgolf | 8fcdfd72d168e25204a914e57d4c3478382fd473 | [
"MIT"
] | null | null | null | from django.http import HttpResponseRedirect
from django.shortcuts import get_object_or_404, render
from django.urls import reverse
from django.views import generic
from .models import Tournament, TournamentPick, Player, TournamentPlayer, Person
from bs4 import BeautifulSoup
import requests
def index(request):
l... | 41.166667 | 121 | 0.774089 |
8ba994774777712b8bbf7d7843ce02b9328b773c | 252 | py | Python | Pythonjunior2020/Woche2/Aufgabe_2_6_1.py | Zeyecx/HPI-Potsdam | ed45ca471cee204dde74dd2c3efae3877ee71036 | [
"MIT"
] | null | null | null | Pythonjunior2020/Woche2/Aufgabe_2_6_1.py | Zeyecx/HPI-Potsdam | ed45ca471cee204dde74dd2c3efae3877ee71036 | [
"MIT"
] | null | null | null | Pythonjunior2020/Woche2/Aufgabe_2_6_1.py | Zeyecx/HPI-Potsdam | ed45ca471cee204dde74dd2c3efae3877ee71036 | [
"MIT"
] | null | null | null | # 2.6.1, Woche 2, Block 6, Aufgabe 1
# String
satz = "Folgt?weiter?dem?Pfad"
# Split String
satz = satz.split("?")
satz += ["."]
# String combine
ausgabe = ""
for i in range(len(satz)):
ausgabe += satz[i] + " "
# Ausgabe String
print(ausgabe) | 15.75 | 36 | 0.611111 |
8bd021a7f655d8afc4f17cb2f9f409b6d7cea17f | 1,611 | py | Python | mcsf/commands/down.py | beremaran/mcsf | 7651e849b860cf4f0517fa8e4fc4b7a417bbc3a4 | [
"MIT"
] | null | null | null | mcsf/commands/down.py | beremaran/mcsf | 7651e849b860cf4f0517fa8e4fc4b7a417bbc3a4 | [
"MIT"
] | null | null | null | mcsf/commands/down.py | beremaran/mcsf | 7651e849b860cf4f0517fa8e4fc4b7a417bbc3a4 | [
"MIT"
] | null | null | null | import logging
from vultr import VultrError
from mcsf.commands.base import Command
from mcsf.services.backup import BackupService
from mcsf.services.json_storage import JsonStorage
from mcsf.services.ssh import SshService
from mcsf.services.vultr import VultrService
class DownCommand(Command):
def __init__(self... | 27.775862 | 78 | 0.638113 |
47aada7ee9c8c9280eb24c2d4c6f64a63ee109ab | 56 | py | Python | src/aijack/attack/labelleakage/__init__.py | luoshenseeker/AIJack | 4e871a5b3beb4b7c976d38060d6956efcebf880d | [
"MIT"
] | 1 | 2022-03-17T21:17:44.000Z | 2022-03-17T21:17:44.000Z | src/aijack/attack/labelleakage/__init__.py | luoshenseeker/AIJack | 4e871a5b3beb4b7c976d38060d6956efcebf880d | [
"MIT"
] | null | null | null | src/aijack/attack/labelleakage/__init__.py | luoshenseeker/AIJack | 4e871a5b3beb4b7c976d38060d6956efcebf880d | [
"MIT"
] | 2 | 2022-01-17T07:28:22.000Z | 2022-01-30T00:12:53.000Z | from .normattack import SplitNNNormAttack # noqa: F401
| 28 | 55 | 0.803571 |
d0971048180f3059f06d0c75920bec23ac232efd | 18 | py | Python | Python/takeinput.py | bunny8469/Hello-World | 722b5961cbcd9b2c2eec2cb6aa700eaa451e008b | [
"MIT"
] | 133 | 2021-01-15T16:29:40.000Z | 2022-03-21T16:35:42.000Z | Python/takeinput.py | bunny8469/Hello-World | 722b5961cbcd9b2c2eec2cb6aa700eaa451e008b | [
"MIT"
] | 117 | 2021-01-17T08:54:22.000Z | 2022-01-17T16:38:11.000Z | Python/takeinput.py | bunny8469/Hello-World | 722b5961cbcd9b2c2eec2cb6aa700eaa451e008b | [
"MIT"
] | 146 | 2021-01-15T12:57:19.000Z | 2022-03-15T20:10:23.000Z | t=input()
print(t) | 9 | 9 | 0.666667 |
4befc4254d79db3f5cc732fae22a79bab91cf61d | 147 | py | Python | pages/themes/beginners/sequenceDataTypes/Tasks_and_HW/task3_solution_with_while.py | ProgressBG-Python-Course/ProgressBG-Python | 6429833696c2c50d9f902f62cc3a65ca62659c69 | [
"MIT"
] | null | null | null | pages/themes/beginners/sequenceDataTypes/Tasks_and_HW/task3_solution_with_while.py | ProgressBG-Python-Course/ProgressBG-Python | 6429833696c2c50d9f902f62cc3a65ca62659c69 | [
"MIT"
] | null | null | null | pages/themes/beginners/sequenceDataTypes/Tasks_and_HW/task3_solution_with_while.py | ProgressBG-Python-Course/ProgressBG-Python | 6429833696c2c50d9f902f62cc3a65ca62659c69 | [
"MIT"
] | null | null | null | sum = 0
first_num = 1000
last_num = 1200
num = first_num
while num <= last_num:
if num % 2 == 0:
sum += num
num += 1
print(sum)
| 11.307692 | 22 | 0.557823 |
3249248fb2802d69530dee9ae737415509af8aa1 | 1,238 | py | Python | server/weather/PollWeatherSource.py | EveryOtherUsernameWasAlreadyTaken/BIS | e132ce42dcc74e634231398dfecb08834d478cba | [
"MIT"
] | 3 | 2019-07-09T08:51:20.000Z | 2019-09-16T17:27:54.000Z | server/weather/PollWeatherSource.py | thomasw-mitutoyo-ctl/BIS | 08525cc12164902dfe968ae41beb6de0cd5bc411 | [
"MIT"
] | 24 | 2019-06-17T12:33:35.000Z | 2020-03-27T08:17:35.000Z | server/weather/PollWeatherSource.py | EveryOtherUsernameWasAlreadyTaken/BIS | e132ce42dcc74e634231398dfecb08834d478cba | [
"MIT"
] | 1 | 2020-03-24T17:54:07.000Z | 2020-03-24T17:54:07.000Z | import logging
import time
from WeatherSource import WeatherSource
log = logging.getLogger(__name__)
class PollWeatherSource(WeatherSource):
"""
This class abstracts a WeatherSource which polls the data frequently
"""
def __init__(self, interval, repository):
WeatherSource.__init__(self)
... | 29.47619 | 86 | 0.632472 |
328b0ff99f95e04312fcde38daf6e6267a7d71b9 | 818 | py | Python | contest_server/pjkiserver/ruleserver/WinConditions.py | amrohendawi/AlphaZero-implementation | 42103e63308ba256208b6dd6ddcbef2e797e9932 | [
"MIT"
] | null | null | null | contest_server/pjkiserver/ruleserver/WinConditions.py | amrohendawi/AlphaZero-implementation | 42103e63308ba256208b6dd6ddcbef2e797e9932 | [
"MIT"
] | null | null | null | contest_server/pjkiserver/ruleserver/WinConditions.py | amrohendawi/AlphaZero-implementation | 42103e63308ba256208b6dd6ddcbef2e797e9932 | [
"MIT"
] | null | null | null | '''
Jumpsturdy
input:board ,player
player "w" oder "b"
output true
false
Racing Kings
input board
output true false
'''
import numpy as np
from .bitboard import Board
MASKJS1 = np.uint64(9079256848778919936)
MASKJS2 = np.uint64(126)
def reihencheckjs(board , player=None):
if player==None:
player ... | 19.95122 | 73 | 0.647922 |
3293ecf1aca92266f9590c9a4e18ec89f4f4da24 | 3,453 | py | Python | bindings/python/ensmallen/__init__.py | LucaCappelletti94/EnsmallenGraph | 572532b6d3f4352bf58f9ccca955376acd95fd89 | [
"MIT"
] | null | null | null | bindings/python/ensmallen/__init__.py | LucaCappelletti94/EnsmallenGraph | 572532b6d3f4352bf58f9ccca955376acd95fd89 | [
"MIT"
] | null | null | null | bindings/python/ensmallen/__init__.py | LucaCappelletti94/EnsmallenGraph | 572532b6d3f4352bf58f9ccca955376acd95fd89 | [
"MIT"
] | null | null | null | """Module offering fast graph processing and graph datasets."""
import logging
import warnings
import platform
from environments_utils import is_x86_64, is_arm
if is_x86_64():
import cpuinfo
HASWELL_FLAGS = [
"avx2",
"bmi2",
"popcnt",
]
CORE2_AVX_FLAGS = [
"ssse3", ... | 46.04 | 117 | 0.652187 |
eb0cc5957ffb9b53fff90e409000f89db5a40245 | 10,607 | py | Python | src/main/apps/mlops/views.py | Nouvellie/django-tflite | 1d08fdc8a2ec58886d7d2b8d40e7b3598613caca | [
"MIT"
] | 2 | 2021-08-23T21:56:07.000Z | 2022-01-20T13:52:19.000Z | src/main/apps/mlops/views.py | Nouvellie/django-tflite | 1d08fdc8a2ec58886d7d2b8d40e7b3598613caca | [
"MIT"
] | null | null | null | src/main/apps/mlops/views.py | Nouvellie/django-tflite | 1d08fdc8a2ec58886d7d2b8d40e7b3598613caca | [
"MIT"
] | null | null | null | from .serializers import (
FASHION_MNIST_HELP_TEXT,
FashionMnistSerializer,
IMDB_SENTIMENT_HELP_TEXT,
ImdbSentimentSerializer,
STACKOVERFLOW_HELP_TEXT,
StackoverflowSerializer,
CATS_VS_DOGS_HELP_TEXT,
CatsVsDogsSerializer,
)
from .utils.model_loader import (
CheckpointModelLoader,... | 40.796154 | 103 | 0.685396 |
de2937aa59c8e788c62a60fbf2f9a45d92efeb4d | 171 | py | Python | python/primary/模块/dydt.py | EstherLacan/jiangfw | a449b1925742873c76dc1b3284aedb359204bc76 | [
"Apache-2.0"
] | 1 | 2020-07-29T16:43:46.000Z | 2020-07-29T16:43:46.000Z | python/primary/模块/dydt.py | EstherLacan/jiangfw | a449b1925742873c76dc1b3284aedb359204bc76 | [
"Apache-2.0"
] | null | null | null | python/primary/模块/dydt.py | EstherLacan/jiangfw | a449b1925742873c76dc1b3284aedb359204bc76 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# Filename: using_sys.py
import numpy as np
import scipy as sp
import matplotlib as mpl
import matplotlib.pyplot as plt
def dy_dt(y,t):
return np.
| 15.545455 | 31 | 0.74269 |
723424e77d8562bf8f318f4b8e4a7f934fb0b237 | 4,445 | py | Python | pycsw/tests/unittests/test_fmt_json.py | Geosoft2/Geosoftware-II-AALLH | bdb61d9a1111b9082ec2b9f309998c5f2166975e | [
"MIT"
] | 118 | 2015-01-07T00:24:09.000Z | 2022-03-19T15:35:43.000Z | pycsw/tests/unittests/test_fmt_json.py | Geosoft2/Geosoftware-II-AALLH | bdb61d9a1111b9082ec2b9f309998c5f2166975e | [
"MIT"
] | 319 | 2015-01-06T23:51:46.000Z | 2022-03-20T11:22:57.000Z | pycsw/tests/unittests/test_fmt_json.py | Geosoft2/Geosoftware-II-AALLH | bdb61d9a1111b9082ec2b9f309998c5f2166975e | [
"MIT"
] | 113 | 2015-01-07T00:42:23.000Z | 2022-02-19T18:05:08.000Z | # -*- coding: utf-8 -*-
# =================================================================
#
# Authors: Ricardo Garcia Silva <ricardo.garcia.silva@gmail.com>
#
# Copyright (c) 2017 Ricardo Garcia Silva
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated do... | 47.287234 | 84 | 0.608099 |
5fb9e2fdedc0fd4519028d5829b3edb6e9b62e03 | 8,519 | py | Python | lib/go/expander.py | nullputra/nlptr-lib | 618c2c74c3d3033bae04de9ba9a253bb6eb31a6c | [
"CC0-1.0"
] | null | null | null | lib/go/expander.py | nullputra/nlptr-lib | 618c2c74c3d3033bae04de9ba9a253bb6eb31a6c | [
"CC0-1.0"
] | null | null | null | lib/go/expander.py | nullputra/nlptr-lib | 618c2c74c3d3033bae04de9ba9a253bb6eb31a6c | [
"CC0-1.0"
] | null | null | null | #!/usr/bin/python3
# Ref: https://github.com/rust-lang-ja/ac-library-rs/blob/master/expand.py
import getopt
import os
import re
import subprocess
import sys
import tempfile
usage = """USAGE: $ expander.py [options] <PATH>
e.g.) lib/go/expander.py -f src_go/memo/memo.go
e.g.) lib/go/expander.py -f src_go/memo/... | 37.364035 | 97 | 0.52154 |
f2f64bd43de615075807a9396a49e13ddb7c1d62 | 6,679 | py | Python | lib/automl.py | djajetic/AutoML3Final | 36a89c6f00c713101feaffc0d6b9ccbb529ed317 | [
"MIT"
] | null | null | null | lib/automl.py | djajetic/AutoML3Final | 36a89c6f00c713101feaffc0d6b9ccbb529ed317 | [
"MIT"
] | null | null | null | lib/automl.py | djajetic/AutoML3Final | 36a89c6f00c713101feaffc0d6b9ccbb529ed317 | [
"MIT"
] | null | null | null | #Damir Jajetic, 2016, MIT licence
def predict (LD, output_dir, basename):
import copy
import os
import numpy as np
import libscores
import data_converter
from sklearn import preprocessing, ensemble
from sklearn.utils import shuffle
LD.data['X_train'], LD.data['Y_train'] = shuffle(LD.data['X_train'], LD.data... | 33.395 | 151 | 0.711184 |
8431a6180daa9c8c41328e05944eeeb546b4764d | 3,970 | py | Python | GZP_GTO_QGIS/INSTALLATION/GeoTaskOrganizer/mActionGTOcomposer.py | msgis/swwat-gzp-template | 080afbe9d49fb34ed60ba45654383d9cfca01e24 | [
"MIT"
] | 3 | 2019-06-18T15:28:09.000Z | 2019-07-11T07:31:45.000Z | GZP_GTO_QGIS/INSTALLATION/GeoTaskOrganizer/mActionGTOcomposer.py | msgis/swwat-gzp-template | 080afbe9d49fb34ed60ba45654383d9cfca01e24 | [
"MIT"
] | 2 | 2019-07-11T14:03:25.000Z | 2021-02-08T16:14:04.000Z | GZP_GTO_QGIS/INSTALLATION/GeoTaskOrganizer/mActionGTOcomposer.py | msgis/swwat-gzp-template | 080afbe9d49fb34ed60ba45654383d9cfca01e24 | [
"MIT"
] | 1 | 2019-06-12T11:07:37.000Z | 2019-06-12T11:07:37.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from PyQt5.QtCore import QObject
from qgis.PyQt.QtXml import QDomDocument
from qgis.core import QgsLayout, QgsRectangle,QgsProject,QgsLayoutManager,QgsMasterLayoutInterface,QgsReadWriteContext,QgsPathResolver,QgsPrintLayout,QgsLayoutIte... | 41.789474 | 176 | 0.576574 |
29e337b11f4c7dd7106779a8f66b2cf8359f8457 | 6,777 | py | Python | api/elec.py | Latent-Lxx/dazhou-dw | 902b4b625cda4c9e4eb205017b8955b81f37a0b5 | [
"MIT"
] | null | null | null | api/elec.py | Latent-Lxx/dazhou-dw | 902b4b625cda4c9e4eb205017b8955b81f37a0b5 | [
"MIT"
] | null | null | null | api/elec.py | Latent-Lxx/dazhou-dw | 902b4b625cda4c9e4eb205017b8955b81f37a0b5 | [
"MIT"
] | 1 | 2022-02-11T04:44:37.000Z | 2022-02-11T04:44:37.000Z | # !/usr/bin/python3
# -*- coding: utf-8 -*-
# @Time : 2021/6/8 上午11:03
# @Author : Latent
# @Email : latentsky@gmail.com
# @File : run.py
# @Software: PyCharm
# @class : Get all the data from the api
from api_request import API_Request
from sequence import Sequence
from db.mongo_db import Mongo
from db.redis_mq import ... | 35.857143 | 117 | 0.513944 |
29e64698bbb533e281f633f5aa4c27a8a3dc17df | 1,321 | py | Python | josefluispelz/EX2/ex2.py | appfs/appfs | 8cbbfa0e40e4d4a75a498ce8dd894bb2fbc3a9e3 | [
"MIT"
] | 11 | 2017-04-21T11:39:55.000Z | 2022-02-11T20:25:18.000Z | josefluispelz/EX2/ex2.py | appfs/appfs | 8cbbfa0e40e4d4a75a498ce8dd894bb2fbc3a9e3 | [
"MIT"
] | 69 | 2017-04-26T09:30:38.000Z | 2017-08-01T11:31:21.000Z | josefluispelz/EX2/ex2.py | appfs/appfs | 8cbbfa0e40e4d4a75a498ce8dd894bb2fbc3a9e3 | [
"MIT"
] | 53 | 2017-04-20T16:16:11.000Z | 2017-07-19T12:53:01.000Z | import sys
try:
import cElementTree as ET
except ImportError:
try: #Python 2.5 need to import a different module
import xml.etree.cElementTree as ET
except ImportError:
sys.stderr = "Failed to import cElementTree from any known place\n)"
print(sys.stderr)
filename = sys.argv[-1]... | 28.106383 | 112 | 0.573051 |
6ae31b04c23b2d15cc07a0d1e8e097b35ae694db | 5,722 | py | Python | official/nlp/dgu/src/finetune_eval_model.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | official/nlp/dgu/src/finetune_eval_model.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | official/nlp/dgu/src/finetune_eval_model.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... | 45.776 | 117 | 0.670744 |
6b1707bdb0d5d54bf41c01475744d887a88f7d0e | 2,783 | py | Python | Liquid-experiments/main.py | PasaLab/YAO | 2e70203197cd79f9522d65731ee5dc0eb236b005 | [
"Apache-2.0"
] | 2 | 2021-08-30T14:12:09.000Z | 2022-01-20T02:14:22.000Z | Liquid-experiments/main.py | PasaLab/YAO | 2e70203197cd79f9522d65731ee5dc0eb236b005 | [
"Apache-2.0"
] | null | null | null | Liquid-experiments/main.py | PasaLab/YAO | 2e70203197cd79f9522d65731ee5dc0eb236b005 | [
"Apache-2.0"
] | null | null | null | import time
import os
import argparse
import util.jobModel as jm
import util.api as api
def test():
apiInstance = api.API(base_url='http://yao.pasalab.jluapp.com')
apiInstance.login()
apiInstance.get_sys_status()
job = jm.get_job('cnn', 0)
msg = apiInstance.submit_job(job)
if msg['errno'] == 0:... | 28.397959 | 96 | 0.661157 |
86a3f9ba42a98e6d6dcfcf354c0b4c431ef830de | 5,765 | py | Python | src/test/tests/hybrid/field_operators.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 226 | 2018-12-29T01:13:49.000Z | 2022-03-30T19:16:31.000Z | src/test/tests/hybrid/field_operators.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 5,100 | 2019-01-14T18:19:25.000Z | 2022-03-31T23:08:36.000Z | src/test/tests/hybrid/field_operators.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 84 | 2019-01-24T17:41:50.000Z | 2022-03-10T10:01:46.000Z | # ----------------------------------------------------------------------------
# CLASSES: nightly
#
# Test Case: field_operators.py
#
# Tests: mesh - rectilinear, curvilinear
# plots - vector, contour
#
# Defect ID: '4141, '5343, '6297, '6460, '7063, '8025
#
# Programmer: Hank Childs
#... | 22.69685 | 78 | 0.709107 |
86fc95bdc17025033c99b209810fe48da97bb683 | 1,667 | py | Python | official/cv/warpctc/preprocess.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | official/cv/warpctc/preprocess.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | official/cv/warpctc/preprocess.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2020-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 agre... | 37.886364 | 78 | 0.638872 |
be2c4c4ea0adaeed9f08805f98ff5054793a1526 | 992 | py | Python | python/coursera_python/FUND_OF_COMP_RICE/FUND_OF_COMPUTING_RICE2/week1/task_list.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/coursera_python/FUND_OF_COMP_RICE/FUND_OF_COMPUTING_RICE2/week1/task_list.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/coursera_python/FUND_OF_COMP_RICE/FUND_OF_COMPUTING_RICE2/week1/task_list.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | # Simple task list
import simplegui
tasks = []
# Handler for button
def clear():
global tasks
tasks = []
# Handler for new task
def new(task):
tasks.append(task)
# Handler for remove number
def remove_num(tasknum):
n = int(tasknum)
if n > 0 and n <= len(tasks):
tasks.pop(n-1)
#... | 22.044444 | 69 | 0.648185 |
ed6f14b3605a807fd496ad5e94019cfb07c40a92 | 788 | py | Python | AdvancePython-master/chapter12/gen_to_coroutine.py | xuyifeiCoco/python | 83af27b3baf1caf157b330c580f356a94095e44d | [
"MIT"
] | 26 | 2019-09-17T12:48:36.000Z | 2022-02-24T12:27:01.000Z | AdvancePython-master/chapter12/gen_to_coroutine.py | xuyifeiCoco/python | 83af27b3baf1caf157b330c580f356a94095e44d | [
"MIT"
] | 2 | 2021-03-25T22:00:07.000Z | 2022-01-20T15:51:48.000Z | coding-200/chapter12/gen_to_coroutine.py | qsunny/python | ace8c3178a9a9619de2b60ca242c2079dd2f825e | [
"MIT"
] | 20 | 2019-05-31T14:21:00.000Z | 2021-07-27T15:58:25.000Z | #生成器是可以暂停的函数
import inspect
# def gen_func():
# value=yield from
# #第一返回值给调用方, 第二调用方通过send方式返回值给gen
# return "bobby"
#1. 用同步的方式编写异步的代码, 在适当的时候暂停函数并在适当的时候启动函数
import socket
def get_socket_data():
yield "bobby"
def downloader(url):
client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
client... | 23.878788 | 72 | 0.686548 |
136451251a6366fbfaaa979366b04dc3e26c4783 | 2,076 | py | Python | pvs_suban/views.py | hackit90/django-invoices | 770d5cffe7831539b885c517b0a435cc764e0a8c | [
"MIT"
] | null | null | null | pvs_suban/views.py | hackit90/django-invoices | 770d5cffe7831539b885c517b0a435cc764e0a8c | [
"MIT"
] | null | null | null | pvs_suban/views.py | hackit90/django-invoices | 770d5cffe7831539b885c517b0a435cc764e0a8c | [
"MIT"
] | null | null | null | from django.shortcuts import render
from rest_framework.viewsets import ModelViewSet
from .serializers import ContactSerializer, InvoiceSerializer, AddressSerializer, InvoicePositionSerializer, CountrySerializer
from .models import Contact, Invoice, Address, InvoicePosition, Country
from django_filters.rest_framework i... | 42.367347 | 126 | 0.773121 |
b95515d03454ef93d56d22ae327e96181adeb8a4 | 14,540 | py | Python | project/cli/test.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | 1 | 2021-06-01T14:49:18.000Z | 2021-06-01T14:49:18.000Z | project/cli/test.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | 286 | 2020-12-04T14:13:00.000Z | 2022-03-09T19:05:16.000Z | project/cli/test.py | DanielGrams/gsevpt | a92f71694388e227e65ed1b24446246ee688d00e | [
"MIT"
] | null | null | null | import json
import click
from flask.cli import AppGroup
from flask_migrate import stamp
from flask_security.confirmable import confirm_user
from sqlalchemy import MetaData
from project import app, db
from project.api import scope_list
from project.init_data import create_initial_data
from project.models import (
... | 30.22869 | 88 | 0.744292 |
b99be8c37dafaa8a2a5f4a583e4533a33d10b7ab | 668 | py | Python | asyncio_demos/low_level.py | gregjhansell97/sandbox | d565da5db2c10af404ce62aa747d5e682bc02a86 | [
"MIT"
] | null | null | null | asyncio_demos/low_level.py | gregjhansell97/sandbox | d565da5db2c10af404ce62aa747d5e682bc02a86 | [
"MIT"
] | null | null | null | asyncio_demos/low_level.py | gregjhansell97/sandbox | d565da5db2c10af404ce62aa747d5e682bc02a86 | [
"MIT"
] | null | null | null | import asyncio
from threading import Thread
if __name__ == "__main__":
loop = asyncio.get_event_loop()
t = Thread(target=loop.run_forever)
t.start()
print(loop.is_running())
# loop is in another thread so thats how you stop it
loop.call_soon_threadsafe(loop.stop)
#loop.close()
print("j... | 19.647059 | 56 | 0.649701 |
6a2db79ac4933ec0d4b9a023a674e432345d1998 | 789 | py | Python | tests/test_posts.py | Lanseuo/lucas-blog | fd6932952aac3a3055026551700bc86adef279f4 | [
"MIT"
] | 1 | 2019-01-29T15:57:20.000Z | 2019-01-29T15:57:20.000Z | tests/test_posts.py | Lanseuo/lucas-blog | fd6932952aac3a3055026551700bc86adef279f4 | [
"MIT"
] | 1 | 2018-05-05T19:43:28.000Z | 2018-05-05T19:43:28.000Z | tests/test_posts.py | Lanseuo/lucas-blog | fd6932952aac3a3055026551700bc86adef279f4 | [
"MIT"
] | 1 | 2018-04-24T09:36:57.000Z | 2018-04-24T09:36:57.000Z | import random
from blog.post import Post
from blog.posts import Posts
def test_get_posts():
posts = Posts.get_posts()
for post in posts:
assert isinstance(post, Post)
def test_get_posts_as_json():
posts = Posts.get_posts_as_json()
for post in posts:
assert "title" in post.keys()
... | 21.324324 | 43 | 0.647655 |
1648c3d3610a78cf1b36dd2ae9ab1ffbdfe070c9 | 807 | py | Python | tensorflow/tf-adversarial/PIL_video.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | 1 | 2019-05-10T09:16:23.000Z | 2019-05-10T09:16:23.000Z | tensorflow/tf-adversarial/PIL_video.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | null | null | null | tensorflow/tf-adversarial/PIL_video.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | 1 | 2019-10-14T07:30:18.000Z | 2019-10-14T07:30:18.000Z | import tempfile
import subprocess
import shutil
import base64
import os
from IPython.display import HTML
def make_video(frames, out_file="out.mp4"):
with tempfile.TemporaryDirectory() as d:
frame_files = []
for i, frame in enumerate(frames):
file_name = os.path.join(d, "frame_%06d.png... | 31.038462 | 88 | 0.596035 |
4c26ff5bb35d2f194e5075e41f8e192fdebecf8f | 11,954 | py | Python | easyp2p/p2p_session.py | Ceystyle/easyp2p | 99c32e3ec0ff5a34733f157dd1b53d1aa9bc9edc | [
"MIT"
] | 4 | 2019-07-18T10:58:28.000Z | 2021-11-18T16:57:45.000Z | easyp2p/p2p_session.py | Ceystyle/easyp2p | 99c32e3ec0ff5a34733f157dd1b53d1aa9bc9edc | [
"MIT"
] | 1 | 2019-07-05T09:21:47.000Z | 2019-07-05T09:21:47.000Z | easyp2p/p2p_session.py | Ceystyle/easyp2p | 99c32e3ec0ff5a34733f157dd1b53d1aa9bc9edc | [
"MIT"
] | 2 | 2019-07-05T08:56:34.000Z | 2020-06-09T10:03:42.000Z | # Copyright (c) 2018-2020 Niko Sandschneider
"""
Module implementing P2PSession, a class representing a P2P platform.
This module defines the P2PSession class. It contains code for performing log
in, log out, generating and downloading the account statement. It relies mainly
on functionality provided by the requests... | 33.673239 | 79 | 0.601472 |
fc085a7134dd5ef62a0905d29c7da649c46d815a | 1,739 | py | Python | pioncoo.py | ikeikeikeike/scrapy-2ch-summary-spider | 7142693f25025a09390377649a727cfd33d15af3 | [
"MIT"
] | 2 | 2015-01-12T08:23:35.000Z | 2017-07-28T15:02:26.000Z | pioncoo.py | ikeikeikeike/scrapy-2ch-summary-spider | 7142693f25025a09390377649a727cfd33d15af3 | [
"MIT"
] | null | null | null | pioncoo.py | ikeikeikeike/scrapy-2ch-summary-spider | 7142693f25025a09390377649a727cfd33d15af3 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import re
import itertools
from scrapy.selector import Selector
from summaries.items import SummariesItem
import thread_float_bbs
class PioncooSpider(thread_float_bbs.ThreadFloatBbsSpider):
""" for pioncoo.net
"""
name = 'pioncoo'
allowed_domains = ['pioncoo.net']
start_... | 28.983333 | 94 | 0.53939 |
5d75f096b3a22c947a0ba3e02793ee5474473501 | 397 | py | Python | frappe-bench/apps/erpnext/erpnext/patches/v4_0/save_default_letterhead.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/v4_0/save_default_letterhead.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v4_0/save_default_letterhead.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():
"""save default letterhead to set default_letter_head_content"""
try:
letter_head = frappe.get_doc("Letter Head", {"is... | 28.357143 | 68 | 0.768262 |
5380ec2bffb543869ee08741b03338c85d19bbd8 | 1,204 | py | Python | LNCS_articles_parser.py | pku601/LDA | a4bcd3e40ed2920dc29bf0270eab05b245ea003e | [
"Apache-2.0"
] | null | null | null | LNCS_articles_parser.py | pku601/LDA | a4bcd3e40ed2920dc29bf0270eab05b245ea003e | [
"Apache-2.0"
] | null | null | null | LNCS_articles_parser.py | pku601/LDA | a4bcd3e40ed2920dc29bf0270eab05b245ea003e | [
"Apache-2.0"
] | null | null | null | import os
from bs4 import BeautifulSoup
import re
input_dir = 'LNCS_articles'
files = os.listdir(input_dir)
none_count = 0
valid_count = 0
total_count = len(files)
fp = open('abstracts.txt', 'wb')
count = 0
for _file in files:
count += 1
if count % 1000 == 0:
print count
with open(input_dir + "/"... | 26.173913 | 70 | 0.549834 |
4aeb984f9a4ca1c1dfc1c8c41dd9b2a84c18dbd2 | 587 | py | Python | demos/Agent_Based_Modeling/prey_predator_abm/model/config.py | w-ghub/demos | 6382676fae89bd5a190626612712fcedf17bca6d | [
"MIT"
] | 56 | 2020-07-08T23:23:15.000Z | 2022-03-11T20:43:09.000Z | demos/Agent_Based_Modeling/prey_predator_abm/model/config.py | w-ghub/demos | 6382676fae89bd5a190626612712fcedf17bca6d | [
"MIT"
] | 41 | 2020-07-11T23:24:06.000Z | 2022-01-28T13:28:07.000Z | demos/Agent_Based_Modeling/prey_predator_abm/model/config.py | w-ghub/demos | 6382676fae89bd5a190626612712fcedf17bca6d | [
"MIT"
] | 39 | 2020-07-15T11:35:04.000Z | 2022-02-01T16:02:51.000Z | from cadCAD.configuration import Experiment
from cadCAD.configuration.utils import config_sim
from .state_variables import genesis_states
from .partial_state_update_block import partial_state_update_block
from .sys_params import sys_params
sim_config = config_sim (
{
'N': 3, # number of monte carlo runs
... | 26.681818 | 66 | 0.759796 |
ab22512632330d74b7873a711070bb3b42379c42 | 5,219 | py | Python | tensorflow/basic-rl/tutorial5/tests/dqn_gym.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | 1 | 2019-05-10T09:16:23.000Z | 2019-05-10T09:16:23.000Z | tensorflow/basic-rl/tutorial5/tests/dqn_gym.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | null | null | null | tensorflow/basic-rl/tutorial5/tests/dqn_gym.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | 1 | 2019-10-14T07:30:18.000Z | 2019-10-14T07:30:18.000Z | '''
Deep Q-learning approach for different RL problems
as part of the basic series on reinforcement learning @
https://github.com/vmayoral/basic_reinforcement_learning
@author: Victor Mayoral Vilches <victor@erlerobotics.com>
'''
import gym
import numpy
import random
import pandas
class QLearn:
def __init... | 38.659259 | 109 | 0.596091 |
db52db25352480e9517322acf4ec6b829a8f6f89 | 1,604 | py | Python | Packs/GoogleKubernetesEngine/Integrations/GoogleKubernetesEngine/GoogleKubernetesEngine_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/GoogleKubernetesEngine/Integrations/GoogleKubernetesEngine/GoogleKubernetesEngine_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/GoogleKubernetesEngine/Integrations/GoogleKubernetesEngine/GoogleKubernetesEngine_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import json
def load_json_from_file(path):
with open(path, 'r') as _json_file:
return json.load(_json_file)
def test_parse_cluster(datadir):
from GoogleKubernetesEngine import parse_cluster
parsed_act = parse_cluster(load_json_from_file(datadir["cluster_raw_response.json"]))
expected = load_... | 38.190476 | 100 | 0.799252 |
dbd48db445bd6a9d5f227f564eb92186e5e1b492 | 1,126 | py | Python | python/oneflow/compatible/single_client/nn/modules/broadcast_like.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 1 | 2021-09-13T02:34:53.000Z | 2021-09-13T02:34:53.000Z | python/oneflow/compatible/single_client/nn/modules/broadcast_like.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | null | null | null | python/oneflow/compatible/single_client/nn/modules/broadcast_like.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 1 | 2021-01-17T03:34:39.000Z | 2021-01-17T03:34:39.000Z | """
Copyright 2020 The OneFlow Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agr... | 36.322581 | 88 | 0.775311 |
916bd1db66f69fa067d7c08cfa01902525363777 | 1,656 | py | Python | src/onegov/ballot/models/vote/mixins.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/ballot/models/vote/mixins.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/ballot/models/vote/mixins.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from sqlalchemy import case
from sqlalchemy import func
from sqlalchemy.ext.hybrid import hybrid_property
class DerivedAttributesMixin(object):
""" A simple mixin to add commonly used functions to ballots and their
results. """
@hybrid_property
def yeas_percentage(self):
""" The percentage o... | 28.551724 | 75 | 0.6407 |
53420fb4d9847dd58a7b6b74766477e8c5e734c1 | 4,167 | py | Python | Python/zzz_training_challenge/Python_Challenge/solutions/ch07_recursion_advanced/solutions/ex05_sudoku_solver_better_checks.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/ch07_recursion_advanced/solutions/ex05_sudoku_solver_better_checks.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/ch07_recursion_advanced/solutions/ex05_sudoku_solver_better_checks.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | # Beispielprogramm für das Buch "Python Challenge"
#
# Copyright 2020 by Michael Inden
from ch06_arrays.intro.intro import print_array
##################################################
def solve_sudoku(board):
return solve_sudoku_helper(board, 0, 0)
def solve_sudoku_helper(board, start_row, start_col):
... | 26.207547 | 77 | 0.541157 |
72b471c0909e12f60ac3ba226ed5a77c8bd5de1d | 3,366 | py | Python | home-assistant/custom_components/nodered/discovery.py | Adamvg/SmartHouse | 740b010260f6f6b38a19e2a75d431446abd54253 | [
"MIT"
] | 3 | 2020-09-28T11:41:01.000Z | 2022-03-12T20:02:47.000Z | home-assistant/custom_components/nodered/discovery.py | Venkysgithu/SmartHouse | d4e42dbbbb1f535f1684d507de411a4421b92e4d | [
"MIT"
] | 1 | 2022-02-09T22:45:33.000Z | 2022-02-09T22:45:33.000Z | home-assistant/custom_components/nodered/discovery.py | Venkysgithu/SmartHouse | d4e42dbbbb1f535f1684d507de411a4421b92e4d | [
"MIT"
] | null | null | null | """Support for Node-RED discovery."""
import asyncio
import logging
from homeassistant.helpers.dispatcher import (
async_dispatcher_connect,
async_dispatcher_send,
)
from homeassistant.helpers.typing import HomeAssistantType
from .const import (
CONF_BINARY_SENSOR,
CONF_COMPONENT,
CONF_NODE_ID,
... | 31.166667 | 87 | 0.663102 |
72bbd7554b2183437d5f6fd796447173eb8a08a8 | 624 | py | Python | models/hr_replacement.py | aroodooteam/aro_hr | bf26f026593493486b4b5c13b26b9b47b9fe3825 | [
"BSD-2-Clause"
] | null | null | null | models/hr_replacement.py | aroodooteam/aro_hr | bf26f026593493486b4b5c13b26b9b47b9fe3825 | [
"BSD-2-Clause"
] | null | null | null | models/hr_replacement.py | aroodooteam/aro_hr | bf26f026593493486b4b5c13b26b9b47b9fe3825 | [
"BSD-2-Clause"
] | 3 | 2017-09-11T08:02:11.000Z | 2020-04-04T08:13:23.000Z | # -*- coding: utf-8 -*-
from openerp import models, api, fields, tools, _
import logging
_logger = logging.getLogger(__name__)
class HrReplacement(models.Model):
_name = 'hr.replacement'
employee_id = fields.Many2one(string=u'Remplaçant', comodel_name='hr.employee')
name = fields.Many2one(string=u'Cong... | 34.666667 | 105 | 0.738782 |
f4617329b4e06d91df950a59c9597071eecd49cf | 2,018 | py | Python | Python/Buch_ATBS/Teil_2/Kapitel_10_Debugging/02_errors_in_log_ausgeben/34-2_errors_loggen.py | Apop85/Scripts | e71e1c18539e67543e3509c424c7f2d6528da654 | [
"MIT"
] | null | null | null | Python/Buch_ATBS/Teil_2/Kapitel_10_Debugging/02_errors_in_log_ausgeben/34-2_errors_loggen.py | Apop85/Scripts | e71e1c18539e67543e3509c424c7f2d6528da654 | [
"MIT"
] | 6 | 2020-12-24T15:15:09.000Z | 2022-01-13T01:58:35.000Z | Python/Buch_ATBS/Teil_2/Kapitel_10_Debugging/02_errors_in_log_ausgeben/34-2_errors_loggen.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | null | null | null | # 34-2_errors_loggen.py
# In dieser Variante wird das Modul logging verwendet um Fehler aufzuspüren
import logging, re, os
os.chdir(os.path.dirname(__file__))
####################################### Modul logging ######################################
logging.basicConfig(level=logging.DEBUG, format=' %(asctime)s - %(le... | 42.93617 | 133 | 0.628345 |
be820980520d91c9fd05325239e7b412bab68abf | 653 | py | Python | time_conversion.py | nirobio/puzzles | fda8c84d8eefd93b40594636fb9b7f0fde02b014 | [
"MIT"
] | null | null | null | time_conversion.py | nirobio/puzzles | fda8c84d8eefd93b40594636fb9b7f0fde02b014 | [
"MIT"
] | null | null | null | time_conversion.py | nirobio/puzzles | fda8c84d8eefd93b40594636fb9b7f0fde02b014 | [
"MIT"
] | null | null | null | #!/bin/python3
import os
import sys
import datetime
# https://www.hackerrank.com/challenges/time-conversion/problem
def timeConversion(s):
if "PM" in s:
s=s.replace("PM"," ")
t= s.split(":")
if t[0] != '12':
t[0]=str(int(t[0])+12)
s= (":").join(t)
return s
... | 18.138889 | 63 | 0.470138 |
fe6844ff9aaa3a3029ceb9ffc3851d8ddff6d9d9 | 5,168 | py | Python | loesungen/chapter03/fractions4.py | SaschaKersken/Daten-Prozessanalyse | 370f07a75b9465329deb3671adbfbef8483f76f6 | [
"Apache-2.0"
] | 2 | 2021-09-20T06:16:41.000Z | 2022-01-17T14:24:43.000Z | loesungen/chapter03/fractions4.py | SaschaKersken/Daten-Prozessanalyse | 370f07a75b9465329deb3671adbfbef8483f76f6 | [
"Apache-2.0"
] | null | null | null | loesungen/chapter03/fractions4.py | SaschaKersken/Daten-Prozessanalyse | 370f07a75b9465329deb3671adbfbef8483f76f6 | [
"Apache-2.0"
] | null | null | null | class Fraction:
def __init__(self, numerator, denominator):
self.numerator = numerator
self.denominator = denominator
if denominator == 0:
raise ZeroDivisionError("Nenner darf nicht 0 sein!")
# Vorzeichen (Minus)
def __neg__(self):
return Fraction(-self.numerato... | 34.453333 | 106 | 0.605457 |
430c457f3d4f9e9d70cdfbc4e7487f639931fa24 | 4,277 | py | Python | test/demonst_3_bitcoin.py | saeyoung/tslb | 5f52646260e14f44c61a670cfc75509951e5e794 | [
"MIT"
] | null | null | null | test/demonst_3_bitcoin.py | saeyoung/tslb | 5f52646260e14f44c61a670cfc75509951e5e794 | [
"MIT"
] | 3 | 2020-03-24T18:18:21.000Z | 2021-08-23T20:37:09.000Z | test/demonst_3_bitcoin.py | saeyoung/tslb | 5f52646260e14f44c61a670cfc75509951e5e794 | [
"MIT"
] | null | null | null | #############################################################
#
# Real-world Data 3. Bitcoin
#
#############################################################
import sys, os
sys.path.append("../..")
sys.path.append("..")
sys.path.append(os.getcwd())
import numpy as np
import pandas as pd
import copy
import pickle
from m... | 30.55 | 132 | 0.559037 |
608abf83fa3efa3e23b7f1e94d886eed7f3d3a28 | 2,514 | py | Python | lbry/lbry/blob/writer.py | mittalkartik2000/lbry-sdk | a07b17ec0c9c5d0a88bc730caf6ab955e0971b38 | [
"MIT"
] | null | null | null | lbry/lbry/blob/writer.py | mittalkartik2000/lbry-sdk | a07b17ec0c9c5d0a88bc730caf6ab955e0971b38 | [
"MIT"
] | 4 | 2020-10-27T21:53:05.000Z | 2022-02-11T03:10:54.000Z | lbry/lbry/blob/writer.py | braveheart12/lbry-sdk | dc709b468f9dce60d206161785def5c7ace2b763 | [
"MIT"
] | null | null | null | import typing
import logging
import asyncio
from io import BytesIO
from lbry.error import InvalidBlobHashError, InvalidDataError
from lbry.cryptoutils import get_lbry_hash_obj
log = logging.getLogger(__name__)
class HashBlobWriter:
def __init__(self, expected_blob_hash: str, get_length: typing.Callable[[], int],... | 36.434783 | 108 | 0.628878 |
60d3301fc921de7fa4497814c2994ca67f08b9d4 | 631 | py | Python | tools/utils.py | madkarl/scmt | 1250eb4681f1a5dac91c5a75f15af5b2a9ae0cd5 | [
"Apache-2.0"
] | null | null | null | tools/utils.py | madkarl/scmt | 1250eb4681f1a5dac91c5a75f15af5b2a9ae0cd5 | [
"Apache-2.0"
] | null | null | null | tools/utils.py | madkarl/scmt | 1250eb4681f1a5dac91c5a75f15af5b2a9ae0cd5 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python3
# -*- coding : utf8 -*-
import os
import platform
def make_dir(path):
platform_info = platform.architecture()
is_linux = False if not platform_info[1].find("Windows") else True
split_ch = "/" if is_linux else "\\"
path = os.path.abspath(path)
split_dir_name = path.split(split_... | 26.291667 | 80 | 0.614897 |
60e4f005aefcb2cfbcc765743db8296d88ad21e4 | 2,684 | py | Python | Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/khmer-1.1-py2.7-linux-x86_64.egg/EGG-INFO/scripts/filter-stoptags.py | poojavade/Genomics_Docker | 829b5094bba18bbe03ae97daf925fee40a8476e8 | [
"Apache-2.0"
] | 1 | 2019-07-29T02:53:51.000Z | 2019-07-29T02:53:51.000Z | Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/khmer-1.1-py2.7-linux-x86_64.egg/EGG-INFO/scripts/filter-stoptags.py | poojavade/Genomics_Docker | 829b5094bba18bbe03ae97daf925fee40a8476e8 | [
"Apache-2.0"
] | 1 | 2021-09-11T14:30:32.000Z | 2021-09-11T14:30:32.000Z | Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/khmer-1.1-py2.7-linux-x86_64.egg/EGG-INFO/scripts/filter-stoptags.py | poojavade/Genomics_Docker | 829b5094bba18bbe03ae97daf925fee40a8476e8 | [
"Apache-2.0"
] | 2 | 2016-12-19T02:27:46.000Z | 2019-07-29T02:53:54.000Z | #!/usr/bin/python2.7
#
# This file is part of khmer, http://github.com/ged-lab/khmer/, and is
# Copyright (C) Michigan State University, 2009-2014. It is licensed under
# the three-clause BSD license; see doc/LICENSE.txt.
# Contact: khmer-project@idyll.org
#
# pylint: disable=invalid-name,missing-docstring
"""
Trim seq... | 29.173913 | 78 | 0.666915 |
1cd4d3adfdb022db53a66450283289636db545ad | 751 | py | Python | spider/Config_Armed_Attacks_od.py | iecasszyjy/tweet_search-master | e4978521a39964c22ae46bf35d6ff17710e8e6c6 | [
"MIT"
] | null | null | null | spider/Config_Armed_Attacks_od.py | iecasszyjy/tweet_search-master | e4978521a39964c22ae46bf35d6ff17710e8e6c6 | [
"MIT"
] | 2 | 2021-03-31T18:54:16.000Z | 2021-12-13T19:49:08.000Z | spider/Config_Armed_Attacks_od.py | iecasszyjy/tweet_search-master | e4978521a39964c22ae46bf35d6ff17710e8e6c6 | [
"MIT"
] | null | null | null | # -*- coding:utf-8 -*-
# got文件、MongoDB数据库和Redis数据库配置文件
# 开放域Disasters_Accidents事件的配置信息
import os
import sys
import pymongo
import redis
def get_noau_config():
# got文件
if sys.version_info[0] < 3:
import got
else:
import got3 as got
# MongoDB数据库
client = pymongo... | 24.225806 | 73 | 0.647137 |
1cff2957e882f7319e632b5e8e1ce905bf7fcc33 | 2,386 | py | Python | appengine-config/main.py | sshyran/WebFundamentals | 5556a0756b410de95e9547b78bce6d7310b836e6 | [
"Apache-2.0"
] | 4 | 2017-04-04T04:51:09.000Z | 2022-02-10T17:10:28.000Z | appengine-config/main.py | sshyran/WebFundamentals | 5556a0756b410de95e9547b78bce6d7310b836e6 | [
"Apache-2.0"
] | 3 | 2021-05-20T20:19:33.000Z | 2022-02-26T09:21:33.000Z | appengine-config/main.py | sshyran/WebFundamentals | 5556a0756b410de95e9547b78bce6d7310b836e6 | [
"Apache-2.0"
] | 2 | 2017-04-04T04:52:09.000Z | 2017-10-09T15:44:02.000Z | #!/usr/bin/env python
#
# Copyright 2014 Google Inc.
#
# 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 o... | 35.088235 | 94 | 0.663873 |
1c7836d8c7c66b55a92aef0fcad7c056d6a0b2a2 | 1,817 | py | Python | bearpi-hm_nano-oh_flower/00_src/bearpi-hm_nano_oh_fun/build/lite/build.py | dawmlight/vendor_oh_fun | bc9fb50920f06cd4c27399f60076f5793043c77d | [
"Apache-2.0"
] | 1 | 2022-02-15T08:51:55.000Z | 2022-02-15T08:51:55.000Z | hihope_neptune-oh_hid/00_src/v0.3/build/lite/build.py | dawmlight/vendor_oh_fun | bc9fb50920f06cd4c27399f60076f5793043c77d | [
"Apache-2.0"
] | null | null | null | hihope_neptune-oh_hid/00_src/v0.3/build/lite/build.py | dawmlight/vendor_oh_fun | bc9fb50920f06cd4c27399f60076f5793043c77d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2020 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
... | 27.953846 | 74 | 0.638965 |
c704ed39cee6337f5faad51b45c40852e0e221b6 | 9,697 | py | Python | official/nlp/pangu_alpha/src/generate.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | official/nlp/pangu_alpha/src/generate.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | official/nlp/pangu_alpha/src/generate.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.088983 | 122 | 0.682582 |
90525d891aafe9e33350ff3948f0c4faa95f0bbe | 626 | py | Python | saku/account/urls.py | Mehdi-MosTafavi/Saku-Backend | 348a1a676ffc8ddd9077f8c94733c5f6dce98fbd | [
"MIT"
] | null | null | null | saku/account/urls.py | Mehdi-MosTafavi/Saku-Backend | 348a1a676ffc8ddd9077f8c94733c5f6dce98fbd | [
"MIT"
] | null | null | null | saku/account/urls.py | Mehdi-MosTafavi/Saku-Backend | 348a1a676ffc8ddd9077f8c94733c5f6dce98fbd | [
"MIT"
] | null | null | null | from django.urls import path
from rest_framework_simplejwt import views as jwt_views
from .views import Register, ChangePassword, ForgotPassword
app_name = "account"
urlpatterns = [
path('login/', jwt_views.TokenObtainPairView.as_view(), name='login'),
path("logout/", jwt_views.TokenRefreshView.as_view(), name... | 48.153846 | 79 | 0.741214 |
d3fb5afc10a18dfd9fce1efdfe0a0a55e755ed85 | 3,976 | py | Python | test/test_npu/test_network_ops/test_logspace.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_logspace.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_logspace.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... | 42.752688 | 110 | 0.600101 |
730d86045438b9dfc8c1e1bf7f0bc0e835019144 | 896 | py | Python | proto_cube/diagramm.py | DerKenGuru/my_slides | c0d9d9098d87e47ffa1beb7f09ed9a863a7331bd | [
"MIT"
] | null | null | null | proto_cube/diagramm.py | DerKenGuru/my_slides | c0d9d9098d87e47ffa1beb7f09ed9a863a7331bd | [
"MIT"
] | null | null | null | proto_cube/diagramm.py | DerKenGuru/my_slides | c0d9d9098d87e47ffa1beb7f09ed9a863a7331bd | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
import numpy as np
series = [
0,0,0,0,0,
1,1,1,2,2,
5,5,5,5,2,
1,1,0,0,0,
0,0,0,0,0,
1,2,2,5,5,
5,5,5,2,2,
5,5,5,2,1,
0,0,0,0,0
]
plt.step(np.arange(len(series)), series, linewidth=3)
plt.yticks([0,1,2,5], labels=['Aus', 'Standby', 'Leerlauf', '... | 24.888889 | 75 | 0.575893 |
732db517f98379230c6b72c4f0d0ab95c81d3068 | 5,954 | py | Python | xmlns/SpecGen/gspecgen.py | danja/danja.github.io | 26662fdf910b8121e14b8470fc4abb94707c574a | [
"Apache-2.0"
] | null | null | null | xmlns/SpecGen/gspecgen.py | danja/danja.github.io | 26662fdf910b8121e14b8470fc4abb94707c574a | [
"Apache-2.0"
] | null | null | null | xmlns/SpecGen/gspecgen.py | danja/danja.github.io | 26662fdf910b8121e14b8470fc4abb94707c574a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf8 -*-
# A GTK front-end for SpecGen
# (compatible with SpecGen v5)
# This software is licensed under the terms of the MIT License.
#
# Copyright (c) 2008 Sergio Fernández <sergio.fernandez@fundacionctic.org>
#
# Permission is hereby granted, free of charge, to any person obtaining... | 37.2125 | 157 | 0.671649 |
735b668698f0f1a0c43ffbcd992f023428f141a9 | 111 | py | Python | Shivani/cylinder.py | 63Shivani/Python-BootCamp | 2ed0ef95af35d35c0602031670fecfc92d8cea0a | [
"MIT"
] | null | null | null | Shivani/cylinder.py | 63Shivani/Python-BootCamp | 2ed0ef95af35d35c0602031670fecfc92d8cea0a | [
"MIT"
] | null | null | null | Shivani/cylinder.py | 63Shivani/Python-BootCamp | 2ed0ef95af35d35c0602031670fecfc92d8cea0a | [
"MIT"
] | null | null | null | r=int(input("enter radius"))
h=int(input("enter heigth"))
volume=3.14*r*r*h
print("volume of cylinder",volume)
| 22.2 | 34 | 0.711712 |
7df7338e99334d5f9af467adbfe3a2a4b24ae78b | 2,833 | py | Python | tarefas-poo/lista-03/navio/view/paineis/painel_gerencia_containers.py | victoriaduarte/POO_UFSC | 0c65b4f26383d1e3038d8469bd91fd2c0cb98c1a | [
"MIT"
] | null | null | null | tarefas-poo/lista-03/navio/view/paineis/painel_gerencia_containers.py | victoriaduarte/POO_UFSC | 0c65b4f26383d1e3038d8469bd91fd2c0cb98c1a | [
"MIT"
] | null | null | null | tarefas-poo/lista-03/navio/view/paineis/painel_gerencia_containers.py | victoriaduarte/POO_UFSC | 0c65b4f26383d1e3038d8469bd91fd2c0cb98c1a | [
"MIT"
] | null | null | null | # --------------------------
# UFSC - CTC - INE - INE5603
# Exercício do Navio
# --------------------------
# Classe que permite gerenciar os containers de um navio.
#
from view.menu import Menu
class PainelGerenciaContainer:
def gerencie(self, navio):
opcoes = {
0: 'Voltar',
1: '... | 36.320513 | 97 | 0.555948 |
81ea6c98ce14f662d498e3368ebdba4799584b03 | 11,570 | py | Python | python/en/archive/books/Python_Natural_Language_Processing/src/4_text_classification-english_sentiment_analysis/pnlp-4_english-2_data_preprocessing.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/archive/books/Python_Natural_Language_Processing/src/4_text_classification-english_sentiment_analysis/pnlp-4_english-2_data_preprocessing.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/archive/books/Python_Natural_Language_Processing/src/4_text_classification-english_sentiment_analysis/pnlp-4_english-2_data_preprocessing.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
pnlp-4_english-2_data_preprocessing.py
pnlp-4_text_classification-english_sentiment_analysis-2_data_preprocessing.py
Source: Python Natural Language Processing
Advanced machine learning and deep learning techniques for natural language processing
Jalaj Thanaki... | 49.87069 | 2,306 | 0.710977 |
81fc196ce71b8727c4d0635306c7f46e699b7db1 | 331 | py | Python | Python/M01_ProgrammingBasics/L05_WhileLoop/Exercises/Solutions/P01_OldBooks.py | todorkrastev/softuni-software-engineering | cfc0b5eaeb82951ff4d4668332ec3a31c59a5f84 | [
"MIT"
] | null | null | null | Python/M01_ProgrammingBasics/L05_WhileLoop/Exercises/Solutions/P01_OldBooks.py | todorkrastev/softuni-software-engineering | cfc0b5eaeb82951ff4d4668332ec3a31c59a5f84 | [
"MIT"
] | null | null | null | Python/M01_ProgrammingBasics/L05_WhileLoop/Exercises/Solutions/P01_OldBooks.py | todorkrastev/softuni-software-engineering | cfc0b5eaeb82951ff4d4668332ec3a31c59a5f84 | [
"MIT"
] | 1 | 2022-02-23T13:03:14.000Z | 2022-02-23T13:03:14.000Z | needed_book = input()
counter = 0
while True:
line = input()
if line == needed_book:
print(f"You checked {counter} books and found it.")
break
if line == "No More Books":
print(f"The book you search is not here!")
print(f"You checked {counter} books.")
break
c... | 20.6875 | 59 | 0.577039 |
6f4274ed9b218f81c1fca0ecc6f434234573359a | 259 | py | Python | session4/02_einstieg.py | NeumannSven/pyshb_programmierkurs | 518da3766dff36e938b36c49d410edb52c0cb32c | [
"MIT"
] | 2 | 2019-10-26T12:47:05.000Z | 2020-07-07T16:36:19.000Z | session4/02_einstieg.py | NeumannSven/pyshb_programmierkurs | 518da3766dff36e938b36c49d410edb52c0cb32c | [
"MIT"
] | null | null | null | session4/02_einstieg.py | NeumannSven/pyshb_programmierkurs | 518da3766dff36e938b36c49d410edb52c0cb32c | [
"MIT"
] | 4 | 2020-02-28T13:43:05.000Z | 2020-12-02T10:39:46.000Z | import tkinter as tk
# Hauptfenster erzeugen
root = tk.Tk()
# Label Widget erzeugen
testlabel = tk.Label(root, text="Hallo PySpace Bremen!")
# Label Widget auf das Hauptfenster legen
testlabel.grid(row=0)
# Mainloop starten
root.mainloop()
print("Ende")
| 16.1875 | 56 | 0.745174 |
48d3e18885d397e260ac67884e236433a1d5ec8a | 1,435 | py | Python | loadtest/locustfile.py | andymaier/execute-app-utils | c684898b93e6ef7cf0c777580ae7700cef02e62d | [
"Apache-2.0"
] | 3 | 2018-03-20T15:13:54.000Z | 2019-03-06T15:29:50.000Z | loadtest/locustfile.py | andymaier/execute-app-utils | c684898b93e6ef7cf0c777580ae7700cef02e62d | [
"Apache-2.0"
] | null | null | null | loadtest/locustfile.py | andymaier/execute-app-utils | c684898b93e6ef7cf0c777580ae7700cef02e62d | [
"Apache-2.0"
] | 8 | 2018-01-22T08:31:02.000Z | 2019-09-23T08:32:16.000Z | from locust import HttpLocust, TaskSet, task
import random
class UserBehavior(TaskSet):
def on_start(self):
""" on_start is called when a Locust start before any task is scheduled """
#self.login()
@task(100)
def profile(self):
self.client.post("/checkouts",
jso... | 29.895833 | 95 | 0.526829 |
d2ae759bd34e84f090b2a9778c47f50ec23a60ce | 1,048 | py | Python | mytoken.py | dongdawang/ssrmgr | a9abedf8dc012bf6f421f95a1c215b5788f34322 | [
"MIT"
] | null | null | null | mytoken.py | dongdawang/ssrmgr | a9abedf8dc012bf6f421f95a1c215b5788f34322 | [
"MIT"
] | 1 | 2021-06-01T22:59:31.000Z | 2021-06-01T22:59:31.000Z | mytoken.py | dongjinhai/ssrmgr | a9abedf8dc012bf6f421f95a1c215b5788f34322 | [
"MIT"
] | 1 | 2019-09-24T09:37:52.000Z | 2019-09-24T09:37:52.000Z | import config
import requests
import json
import logging
class MyToken(object):
def __init__(self):
self._username = config.TOKEN_USERNAME
self._password = config.TOKEN_PASSWORD
self.token = None
if not self.token:
self.token = self.access_token()
def access_token(... | 28.324324 | 97 | 0.535305 |
9607bbbd39f8a2a040b6acb8b65fd90bb5d6ca5d | 21,038 | py | Python | test.py | Scauting-Burgum/ScautDB | d848671aff29a14b458966820dbb8275cd2c3154 | [
"MIT"
] | null | null | null | test.py | Scauting-Burgum/ScautDB | d848671aff29a14b458966820dbb8275cd2c3154 | [
"MIT"
] | null | null | null | test.py | Scauting-Burgum/ScautDB | d848671aff29a14b458966820dbb8275cd2c3154 | [
"MIT"
] | null | null | null | import unittest
class TestRow(unittest.TestCase):
def test___init__(self):
from row import Row
from database import Database
try:
import os
os.remove('test_Row.__init__.db')
except OSError:
pass
db = Database('test_Row.__init__.db')
... | 26.596713 | 130 | 0.566641 |
825191830f814e4a2f345df4d67648c245e19793 | 1,270 | py | Python | OxoCard/battery.py | ckuehnel/MicroPython | c57d0df744fe5301e755bd139b6cc56d69c442fd | [
"MIT"
] | 1 | 2021-03-22T18:38:43.000Z | 2021-03-22T18:38:43.000Z | OxoCard/battery.py | ckuehnel/MicroPython | c57d0df744fe5301e755bd139b6cc56d69c442fd | [
"MIT"
] | null | null | null | OxoCard/battery.py | ckuehnel/MicroPython | c57d0df744fe5301e755bd139b6cc56d69c442fd | [
"MIT"
] | 1 | 2021-02-06T10:07:36.000Z | 2021-02-06T10:07:36.000Z | '''
File: battery.py
needs: machine, oxocard
based on https://www.tigerjython4kids.ch/index.php?inhalt_links=robotik/navigation.inc.php&inhalt_mitte=robotik/iot/push.inc.php
This program will show the battery voltage internally measured.
One Neopixel of the Matrix Display is used as an indicator for the battery level... | 33.421053 | 128 | 0.702362 |
6f8cab96534b92ba69357b0d6d9577d1bb1e9b9f | 769 | py | Python | 437-path-sum-iii/437-path-sum-iii.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | 2 | 2021-12-05T14:29:06.000Z | 2022-01-01T05:46:13.000Z | 437-path-sum-iii/437-path-sum-iii.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | 437-path-sum-iii/437-path-sum-iii.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | # Definition for a binary tree node.
# class TreeNode:
# def __init__(self, val=0, left=None, right=None):
# self.val = val
# self.left = left
# self.right = right
class Solution:
def pathSum(self, root: Optional[TreeNode], targetSum: int) -> int:
if not root:
return ... | 34.954545 | 71 | 0.526658 |
d20b902d1fdfc7984d6e44e40f89ae1456f55223 | 468 | py | Python | PMIa/2015/NIKISHIN_P_S/task_3_22.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | PMIa/2015/NIKISHIN_P_S/task_3_22.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | PMIa/2015/NIKISHIN_P_S/task_3_22.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | # Задача 3. Вариант 22.
# Напишите программу, которая выводит имя "Филип Ауреол Теофраст Бомбаст фон Гогенгейм", и запрашивает его псевдоним. Программа должна сцеплять две эти строки и выводить полученную строку, разделяя имя и псевдоним с помощью тире.
# Nikishin P. S.
# 14.04.2016
name = input("Псевдоним Филипа... | 42.545455 | 230 | 0.764957 |
fbaf8042b37863996151ccd01e3a7d0215502f62 | 6,207 | py | Python | zencad/geombase.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | 5 | 2018-04-11T14:11:40.000Z | 2018-09-12T19:03:36.000Z | zencad/geombase.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | null | null | null | zencad/geombase.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | null | null | null | import math
import os
import numpy
import sys
from OCC.Core.gp import gp_Pnt, gp_Vec, gp_Dir, gp_XYZ, gp_Quaternion
from OCC.Core.TopoDS import TopoDS_Vertex
from OCC.Core.BRep import BRep_Tool
from OCC.Core.BRepBuilderAPI import BRepBuilderAPI_MakeVertex
from OCC.Core.Geom import Geom_CartesianPoint
import zencad.ge... | 25.334694 | 76 | 0.551796 |
83baf2f56a90b71705e015f0db2c00e26c65381f | 602 | py | Python | src/scheduler/db.py | monosidev/monosi | a88b689fc74010b10dbabb32f4b2bdeae865f4d5 | [
"Apache-2.0"
] | 156 | 2021-11-19T18:50:14.000Z | 2022-03-31T19:48:59.000Z | src/scheduler/db.py | monosidev/monosi | a88b689fc74010b10dbabb32f4b2bdeae865f4d5 | [
"Apache-2.0"
] | 30 | 2021-12-27T19:30:56.000Z | 2022-03-30T17:49:00.000Z | src/scheduler/db.py | monosidev/monosi | a88b689fc74010b10dbabb32f4b2bdeae865f4d5 | [
"Apache-2.0"
] | 14 | 2022-01-17T23:24:34.000Z | 2022-03-29T09:27:47.000Z | from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from .models import mapper_registry
class SchedulerDatabase:
def __init__(self, url):
self.engine = self._create_engine(url)
def _create_engine(self, url):
try:
engine = create_engine(url)
map... | 24.08 | 55 | 0.634551 |
f7e402654665343ecc3553f62bb81282941d36bf | 2,312 | py | Python | python/en/archive/topics/temp/audio/digital_filters/test-scipy-butterworth_lowpass_filter.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/archive/topics/temp/audio/digital_filters/test-scipy-butterworth_lowpass_filter.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/archive/topics/temp/audio/digital_filters/test-scipy-butterworth_lowpass_filter.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
test-scipy-butterworth_lowpass_filter.py
Creating lowpass filter in SciPy - understanding methods and units
https://stackoverflow.com/questions/25191620/creating-lowpass-filter-in-scipy-understanding-methods-and-units
Butterworth Bandpass
https://scipy-cookbook.readt... | 29.641026 | 109 | 0.607699 |
e3eb4921c1ea137650170ae8d1300ddefe957bec | 1,353 | py | Python | tests/onegov/election_day/collections/test_screen_collection.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/election_day/collections/test_screen_collection.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/election_day/collections/test_screen_collection.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.election_day.collections import ScreenCollection
from onegov.election_day.models import Screen
def test_screen_collection(session):
collection = ScreenCollection(session)
collection.add(Screen(number=10, type='proporz', structure='<title />'))
collection.add(Screen(number=12, type='proporz', s... | 35.605263 | 76 | 0.672579 |
3fd26ebb67310bbe37da408afb0a379e1e970238 | 2,498 | py | Python | Tasteless/2020/movcode/chall.py | mystickev/ctf-archives | 89e99a5cd5fb6b2923cad3fe1948d3ff78649b4e | [
"MIT"
] | 1 | 2021-11-02T20:53:58.000Z | 2021-11-02T20:53:58.000Z | Tasteless/2020/movcode/chall.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | Tasteless/2020/movcode/chall.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 1 | 2021-12-19T11:06:24.000Z | 2021-12-19T11:06:24.000Z | #!/usr/bin/env python3
import re
import sys
import subprocess
from time import sleep
from shutil import rmtree
from tempfile import TemporaryDirectory
COMPILE_CMD = ['gcc', '-c', 'movcode.s']
LINK_CMD = ['ld', '-melf_x86_64', '-z', 'noexecstack', 'movcode.o']
RUN_CMD = ['setarch', 'x86_64', '-R', './a.out']
TEMPLAT... | 20.145161 | 74 | 0.594876 |
b767496ac7f051bcce16675daedb3e7216ac5438 | 2,685 | py | Python | pyventskalender/tag04.py | kopp/pyventskalender | 6f6455f3c1db07f65a772b2716e4be95fbcd1804 | [
"MIT"
] | null | null | null | pyventskalender/tag04.py | kopp/pyventskalender | 6f6455f3c1db07f65a772b2716e4be95fbcd1804 | [
"MIT"
] | null | null | null | pyventskalender/tag04.py | kopp/pyventskalender | 6f6455f3c1db07f65a772b2716e4be95fbcd1804 | [
"MIT"
] | null | null | null | # Ein wichtiger Baustein in der Programmierung ist die Verzweigung, also die
# Wenn-Dann-Beziehung.
# Dabei wird geprüft, ob (`if`) eine bestimmte Bedingung wahr ist.
# Ist dem so, so wird ein bestimmter Code-Block ausgeführt.
# Ist dem nicht so (`else`), wird optional ein anderer Code-Block ausgeführt.
# Optional bede... | 35.328947 | 79 | 0.711359 |
b7902b1f619f41c6d985b70b1f77358d9ab9ebfc | 2,027 | py | Python | azext_keyvault/_completers.py | jdmartinez36/azure-keyvault-cli-extension | 4dc674b9c30cac13e27347782c49b3ed7dca2e2f | [
"MIT"
] | 2 | 2019-06-12T13:44:34.000Z | 2020-06-01T13:24:04.000Z | azext_keyvault/_completers.py | jdmartinez36/azure-keyvault-cli-extension | 4dc674b9c30cac13e27347782c49b3ed7dca2e2f | [
"MIT"
] | 5 | 2018-04-26T01:14:29.000Z | 2021-01-05T00:45:39.000Z | azext_keyvault/_completers.py | jdmartinez36/azure-keyvault-cli-extension | 4dc674b9c30cac13e27347782c49b3ed7dca2e2f | [
"MIT"
] | 8 | 2018-04-24T22:52:48.000Z | 2021-11-16T06:29:28.000Z | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 43.12766 | 125 | 0.636902 |
b7cd98026f1cad1cee236450f7b31f766431d6e5 | 5,950 | py | Python | bp-revok/python/lib/python2.7/site-packages/cryptography-0.5.2-py2.7-linux-x86_64.egg/cryptography/hazmat/backends/openssl/ec.py | fkolacek/FIT-VUT | bb6f7f6eb1fea1f13952e0ab463e5aa69a84084c | [
"Apache-2.0"
] | null | null | null | bp-revok/python/lib/python2.7/site-packages/cryptography-0.5.2-py2.7-linux-x86_64.egg/cryptography/hazmat/backends/openssl/ec.py | fkolacek/FIT-VUT | bb6f7f6eb1fea1f13952e0ab463e5aa69a84084c | [
"Apache-2.0"
] | null | null | null | bp-revok/python/lib/python2.7/site-packages/cryptography-0.5.2-py2.7-linux-x86_64.egg/cryptography/hazmat/backends/openssl/ec.py | fkolacek/FIT-VUT | bb6f7f6eb1fea1f13952e0ab463e5aa69a84084c | [
"Apache-2.0"
] | 3 | 2017-04-07T12:02:22.000Z | 2020-03-23T12:11:55.000Z | # 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 in writing, software
# distributed under the... | 30.989583 | 78 | 0.667731 |
4d503cfe7b7a41bfa6474253db9c81fd27566c3b | 9,229 | py | Python | rad/_anomaly_detection.py | dlegor/rad | 7a34bf55ce21adc860ff28a2c9d66943acd6ae6a | [
"BSD-3-Clause"
] | 10 | 2020-10-08T21:57:23.000Z | 2022-02-18T04:30:46.000Z | rad/_anomaly_detection.py | dlegor/rad | 7a34bf55ce21adc860ff28a2c9d66943acd6ae6a | [
"BSD-3-Clause"
] | 1 | 2020-07-07T17:27:27.000Z | 2020-07-09T12:20:43.000Z | rad/_anomaly_detection.py | dlegor/rad | 7a34bf55ce21adc860ff28a2c9d66943acd6ae6a | [
"BSD-3-Clause"
] | 1 | 2021-01-18T15:46:29.000Z | 2021-01-18T15:46:29.000Z | """Robust Principal Component Analysis for Time Series"""
# @DLegorreta: d.legorreta.anguiano@gmail.com
import pandas as pd
import numpy as np
from matplotlib import pyplot as plt
from math import sqrt
from statsmodels.tsa.stattools import adfuller
from statsmodels import robust
from sklearn.preprocessing import Min... | 25.078804 | 110 | 0.697584 |
12e3932a42fac70d901d3b8c38f121f8ee6752dc | 1,651 | py | Python | clean_data.py | noahsolomon0518/rengine | a544951c6b7dd707586cd3c4f84ddec554f1c96a | [
"MIT"
] | null | null | null | clean_data.py | noahsolomon0518/rengine | a544951c6b7dd707586cd3c4f84ddec554f1c96a | [
"MIT"
] | null | null | null | clean_data.py | noahsolomon0518/rengine | a544951c6b7dd707586cd3c4f84ddec554f1c96a | [
"MIT"
] | null | null | null | import pandas as pd
from rengine import data
from argparse import ArgumentParser
def clean_data():
df = pd.read_excel(data.__file__.rstrip("__init__.py") + "exercises.xlsx", header=1)
df = df.iloc[:,:-1]
df["MaxReps"] = df.apply(lambda x: 1 if x["Endurance"] == 2 else 0,axis=1)
df = df.rename(colum... | 32.372549 | 107 | 0.690491 |
12ea656b4736d710b1f2ea459ea52ca77816ea74 | 1,110 | py | Python | Packs/PassiveTotal/Scripts/RiskIQPassiveTotalSSLWidgetScript/RiskIQPassiveTotalSSLWidgetScript_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/PassiveTotal/Scripts/RiskIQPassiveTotalSSLWidgetScript/RiskIQPassiveTotalSSLWidgetScript_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/PassiveTotal/Scripts/RiskIQPassiveTotalSSLWidgetScript/RiskIQPassiveTotalSSLWidgetScript_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | from RiskIQPassiveTotalSSLWidgetScript import set_arguments_for_widget_view
def test_for_ssl_widget_set_arguments_for_widget_view_when_indicator_type_file_sha_1():
# Configure
# set argument for command
indicator_data = {
'indicator_type': 'file sha-1',
'value': 'dummy file sha-1'
}
... | 27.75 | 95 | 0.695495 |
427dbdb38d407d1662e03cadfa348d0148503074 | 536 | py | Python | leetcode/055-Jump-Game/JumpGame_003.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2015-12-16T04:01:03.000Z | 2015-12-16T04:01:03.000Z | leetcode/055-Jump-Game/JumpGame_003.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | leetcode/055-Jump-Game/JumpGame_003.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | class Solution(object):
def canJump(self, nums):
"""
:type nums: List[int]
:rtype: bool
"""
n = len(nums)
if n < 2:
return True
start, end, newend = 0, nums[0], nums[0]
for cnt in range(1, n):
for i in range(start, end + 1):
... | 26.8 | 49 | 0.41791 |
c4056bc85011eed22d380b52899925655917a722 | 6,044 | py | Python | pkg/build/builder/ansible/werf/tee_popen.py | kayanme/werf | 655dbdc5f5ddba6e604274d29ee3d885ed79559e | [
"Apache-2.0"
] | 1,426 | 2020-06-05T13:43:08.000Z | 2022-03-31T19:58:57.000Z | pkg/build/builder/ansible/werf/tee_popen.py | kayanme/werf | 655dbdc5f5ddba6e604274d29ee3d885ed79559e | [
"Apache-2.0"
] | 1,053 | 2020-06-17T14:58:08.000Z | 2022-03-31T15:44:52.000Z | pkg/build/builder/ansible/werf/tee_popen.py | kayanme/werf | 655dbdc5f5ddba6e604274d29ee3d885ed79559e | [
"Apache-2.0"
] | 84 | 2020-06-05T14:28:46.000Z | 2022-03-29T22:42:05.000Z | # -*- coding: utf-8 -*-
# TeePopen is a reader from stdout and stderr of subprocess.Popen into
# pipes to return to ansible and into unix socket to send to werf logger (logboek).
#
# stdout from subprocess.Popen (original_popen)
# |
# | looped read by TeeSplitter and write into 2 streams:
# ↓--------------------------... | 33.392265 | 84 | 0.587359 |
c44068dae0affa0b034732021e065e879e90c907 | 93 | py | Python | Yakisizwe/apps.py | NAL0/nalbt | c411ead60fac8923e960e67f4bbad5c7aeffc614 | [
"MIT"
] | null | null | null | Yakisizwe/apps.py | NAL0/nalbt | c411ead60fac8923e960e67f4bbad5c7aeffc614 | [
"MIT"
] | null | null | null | Yakisizwe/apps.py | NAL0/nalbt | c411ead60fac8923e960e67f4bbad5c7aeffc614 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class YakisizweConfig(AppConfig):
name = 'Yakisizwe'
| 15.5 | 33 | 0.763441 |
6725a3e294805f95ce5fcfa12cdb960a3cef18e6 | 448 | py | Python | frappe-bench/apps/erpnext/erpnext/templates/pages/partners.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/templates/pages/partners.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/templates/pages/partners.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
import frappe.website.render
page_title = "Partners"
def get_context(context):
partners = frappe.db.sql("""select * from `tabSales Part... | 24.888889 | 68 | 0.752232 |
67f0c0390d4a1837df11c2789e842f4e74ce0554 | 477 | py | Python | girlsgoit/settings/production.py | girlsgoit/GirlsGoIT | 447cd15c44ebee4af9e942a079d681be8683239f | [
"MIT"
] | 1 | 2019-02-27T21:20:54.000Z | 2019-02-27T21:20:54.000Z | girlsgoit/settings/production.py | girlsgoit/GirlsGoIT | 447cd15c44ebee4af9e942a079d681be8683239f | [
"MIT"
] | null | null | null | girlsgoit/settings/production.py | girlsgoit/GirlsGoIT | 447cd15c44ebee4af9e942a079d681be8683239f | [
"MIT"
] | null | null | null | from .local import *
env = os.environ.get
INSTALLED_APPS += [
'django.contrib.postgres'
]
# DATABASE CONFIGURATION
# ------------------------------------------------------------------------------
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': env('RDS_DB_NAME'),... | 22.714286 | 80 | 0.477987 |
22100b32df19ed327e66cb52c04f81e8566ad591 | 12,284 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/network/exos/test_exos_config.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/network/exos/test_exos_config.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/network/exos/test_exos_config.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | #
# (c) 2018 Extreme Networks Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ans... | 46.180451 | 145 | 0.712797 |
58ad61bf9d8b2464786136d936b7dce639c48b90 | 1,344 | py | Python | year_3/comppi_1/managers/models.py | honchardev/KPI | f8425681857c02a67127ffb05c0af0563a8473e1 | [
"MIT"
] | null | null | null | year_3/comppi_1/managers/models.py | honchardev/KPI | f8425681857c02a67127ffb05c0af0563a8473e1 | [
"MIT"
] | 21 | 2020-03-24T16:26:04.000Z | 2022-02-18T15:56:16.000Z | year_3/comppi_1/managers/models.py | honchardev/KPI | f8425681857c02a67127ffb05c0af0563a8473e1 | [
"MIT"
] | null | null | null | import datetime
from django.contrib.auth.models import User
from django.core.serializers.json import DjangoJSONEncoder
from django.db import models
class ManagersModelsJSONEncoder(DjangoJSONEncoder):
def default(self, value):
if isinstance(value, datetime.date):
return DjangoJSONEncoder.defau... | 38.4 | 84 | 0.730655 |
188e14b57abda9c193c5f095959a2bc7b80d20f4 | 8,197 | py | Python | python_playground/data/inc_exp.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | 8 | 2020-04-14T23:17:00.000Z | 2021-06-21T12:34:04.000Z | python_playground/data/inc_exp.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | null | null | null | python_playground/data/inc_exp.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | 1 | 2021-01-17T16:26:50.000Z | 2021-01-17T16:26:50.000Z | # experiments on inc simrank
import os
from reads.readsd import readsd
from tabulate import tabulate
from IncSimRank import *
from queryGen import queryGen
from test_readsd import cal_reads_N
NEW_DATA = ["odlis", "ca-GrQc", "p2p-Gnutella06", "ca-HepTh", "wiki-Vote", "web-NotreDame", "web-Stanford", \
"we... | 31.40613 | 116 | 0.539466 |
18c10000be8282f86c2b2ee9df9416e5f47cdc2f | 795 | py | Python | EC3/pagerank.py | CSUpengyuyan/ECExperiment | 4ea41837de421f18884be31248d57e88ea32b84b | [
"MIT"
] | null | null | null | EC3/pagerank.py | CSUpengyuyan/ECExperiment | 4ea41837de421f18884be31248d57e88ea32b84b | [
"MIT"
] | null | null | null | EC3/pagerank.py | CSUpengyuyan/ECExperiment | 4ea41837de421f18884be31248d57e88ea32b84b | [
"MIT"
] | null | null | null | import numpy as np
from scipy.sparse import csc_matrix
def pageRank(G, s=.85, maxerr=.0001):
n = G.shape[0]
# 将 G into 马尔科夫 A
A = csc_matrix(G, dtype=np.float)
rsums = np.array(A.sum(1))[:, 0]
ri, ci = A.nonzero()
A.data /= rsums[ri]
sink = rsums == 0
# 计算PR值,直到满足收敛条件
ro, r = np.zeros(n), np.ones(n)
while np.s... | 26.5 | 48 | 0.493082 |
18fe69e5659d20578c27b3c2e764aa7de8a8da66 | 937 | py | Python | src/actions.py | t-azubi/text-adventure | 6106f1bd070bb884e5f369346f7f97bec89dd919 | [
"MIT"
] | null | null | null | src/actions.py | t-azubi/text-adventure | 6106f1bd070bb884e5f369346f7f97bec89dd919 | [
"MIT"
] | 9 | 2019-07-15T08:49:00.000Z | 2019-08-28T15:05:08.000Z | src/actions.py | t-azubi/text-adventure | 6106f1bd070bb884e5f369346f7f97bec89dd919 | [
"MIT"
] | null | null | null | from Player import Character as Player
class Action():
"""The base class for all actions"""
def __init__(self, method, name, **kwargs):
"""Creates a new action
:param method: the function object to execute
:param name: the name of the action
:param ends_turn: True if the playe... | 26.027778 | 93 | 0.64461 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.