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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
fa3599f510c09d54ae3c47a8d82ad12666c3ee50 | 968 | py | Python | servers/docker-python/test/test.py | veaba/ncov | 6019f6b90761fd39363f8a7182ffcee22b9cb7ed | [
"MIT"
] | 288 | 2020-01-21T06:12:03.000Z | 2022-01-16T08:03:13.000Z | servers/docker-python/test/test.py | kayan12/ncov | 90f828208d1eea7cc20e933da41638f328e0411d | [
"MIT"
] | 26 | 2020-01-20T05:07:31.000Z | 2022-03-12T00:24:56.000Z | servers/docker-python/test/test.py | kayan12/ncov | 90f828208d1eea7cc20e933da41638f328e0411d | [
"MIT"
] | 48 | 2020-01-22T09:05:59.000Z | 2022-01-16T08:03:11.000Z | # import time
# import asyncio
#
#
# # 定义异步函数
# async def hello1(x):
# await asyncio.sleep(1)
# print(x, time.time())
#
#
# async def hello2(o):
# await asyncio.sleep(1)
# print(o, time.time())
#
#
# async def hello3(o):
# await asyncio.sleep(1)
# print(o, time.time())
#
#
# def run():
# # w... | 16.689655 | 50 | 0.596074 |
ad0882319dc0b7c72fedfd7c37cb9f2e6226af43 | 2,619 | py | Python | CLI Tools/test_getBoundingBox.py | Geosoft2/Geosoftware-II-AALLH | bdb61d9a1111b9082ec2b9f309998c5f2166975e | [
"MIT"
] | null | null | null | CLI Tools/test_getBoundingBox.py | Geosoft2/Geosoftware-II-AALLH | bdb61d9a1111b9082ec2b9f309998c5f2166975e | [
"MIT"
] | 38 | 2018-10-24T08:51:58.000Z | 2021-12-13T19:54:39.000Z | CLI Tools/test_getBoundingBox.py | Geosoft2/Geosoftware-II-AALLH | bdb61d9a1111b9082ec2b9f309998c5f2166975e | [
"MIT"
] | 12 | 2018-10-24T08:20:13.000Z | 2019-08-12T08:10:14.000Z | '''
Created on 16.01.2019
@author: Aysel Tandik
'''
import os
import sys
import tempfile
# add local modules folder
file_path = os.path.join('..', 'Testdata')
sys.path.append(file_path)
import unittest
import getBoundingBox
# Dataformat Geojson testing Polygon, Line, Point
def test_getBBJsonPolygon():
# Dijon (... | 37.956522 | 107 | 0.746086 |
a8e9a435af5e877fc91ccb249db8bc5d5f96d811 | 96 | py | Python | Shivani/third angle.py | 63Shivani/Python-BootCamp | 2ed0ef95af35d35c0602031670fecfc92d8cea0a | [
"MIT"
] | null | null | null | Shivani/third angle.py | 63Shivani/Python-BootCamp | 2ed0ef95af35d35c0602031670fecfc92d8cea0a | [
"MIT"
] | null | null | null | Shivani/third angle.py | 63Shivani/Python-BootCamp | 2ed0ef95af35d35c0602031670fecfc92d8cea0a | [
"MIT"
] | null | null | null | a=int(input("first angle\n"))
b=int(input("second angle\n"))
c=180-(a+b)
print("third angle",c)
| 19.2 | 30 | 0.65625 |
d11f2d13116b2a4a44b3bf5bdd1c35031499b3da | 1,033 | py | Python | zencad/examples/2.Operations/1.AphineTrans/rotate_array.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | 5 | 2018-04-11T14:11:40.000Z | 2018-09-12T19:03:36.000Z | zencad/examples/2.Operations/1.AphineTrans/rotate_array.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | null | null | null | zencad/examples/2.Operations/1.AphineTrans/rotate_array.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""
ZenCad API example: rotate_array
"""
from zencad import *
import zencad.internal_models
a = box(15, center=True)
b = cylinder(r=15, h=10)
c = ellipse(10,5)
d = square(10, center=True, wire=True)
k1 = rotate_array(n=6, unit=True)(a.right(25))
k2 = rotate_array(n=4, yaw=deg(180), endpoint=T... | 26.487179 | 93 | 0.658277 |
d12502749c89c7f697a4c11010ac146da4fe3505 | 302 | py | Python | ___Python/Michael/p10/m01_panda.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | ___Python/Michael/p10/m01_panda.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | ___Python/Michael/p10/m01_panda.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null |
import pandas as pd
import xlrd
pfad = "O:\___Python"
# df = pd.read("O:\___Python"+"\personen.xlsx")
xl = pd.ExcelFile("O:\___Python"+"\personen.xlsx")
# Print the sheet names
print(xl.sheet_names)
# Load a sheet into a DataFrame by name: df1
df1 = xl.parse('Tabelle1')
print(df1)
| 18.875 | 51 | 0.662252 |
7d1273a8fd473ef93c4fbc4cae012f2c4e429632 | 4,001 | py | Python | Licence 2/I32/Projet-Camping/menus.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | 8 | 2020-11-26T20:45:12.000Z | 2021-11-29T15:46:22.000Z | Licence 2/I32/Projet-Camping/menus.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | null | null | null | Licence 2/I32/Projet-Camping/menus.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | 6 | 2020-10-23T15:29:24.000Z | 2021-05-05T19:10:45.000Z | first_menu = {
"CLIENTS": {
"id": 1,
"title": "Gestion des clients"
},
"CAMPING": {
"id": 2,
"title": "Gestion du camping"
},
"STATS": {
"id": 3,
"title": "Statistiques"
},
}
clients_menu = {
"__S_CLIENT": {
"subtitle": True,
"... | 22.60452 | 77 | 0.48163 |
7d381412763ee213fe3ce5ea0fb5aab7dcecad72 | 408 | py | Python | pacman-arch/test/pacman/tests/fileconflict031.py | Maxython/pacman-for-termux | 3b208eb9274cbfc7a27fca673ea8a58f09ebad47 | [
"MIT"
] | 23 | 2021-05-21T19:11:06.000Z | 2022-03-31T18:14:20.000Z | source/pacman-6.0.1/test/pacman/tests/fileconflict031.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 11 | 2021-05-21T12:08:44.000Z | 2021-12-21T08:30:08.000Z | source/pacman-6.0.1/test/pacman/tests/fileconflict031.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-09-26T08:44:40.000Z | 2021-09-26T08:44:40.000Z | self.description = "Dir->file transition filesystem conflict resolved by removal (with subdirectory)"
lp1 = pmpkg("foo")
lp1.files = ["foo/bar/"]
self.addpkg2db("local", lp1)
sp1 = pmpkg("foo", "2-1")
sp1.conflicts = ["foo"]
sp1.files = ["foo"]
self.addpkg2db("sync", sp1)
self.args = "-S %s" % sp1.name
self.addrule... | 24 | 101 | 0.691176 |
addb38094166392363e0678e660e055cc9efb40b | 1,952 | py | Python | retro/cores/gba/src/platform/python/test_cinema.py | MatPoliquin/retro | c70c174a9818d1e97bc36e61abb4694d28fc68e1 | [
"MIT-0",
"MIT"
] | 2,706 | 2018-04-05T18:28:50.000Z | 2022-03-29T16:56:59.000Z | retro/cores/gba/src/platform/python/test_cinema.py | MatPoliquin/retro | c70c174a9818d1e97bc36e61abb4694d28fc68e1 | [
"MIT-0",
"MIT"
] | 242 | 2018-04-05T22:30:42.000Z | 2022-03-19T01:55:11.000Z | retro/cores/gba/src/platform/python/test_cinema.py | MatPoliquin/retro | c70c174a9818d1e97bc36e61abb4694d28fc68e1 | [
"MIT-0",
"MIT"
] | 464 | 2018-04-05T19:10:34.000Z | 2022-03-28T13:33:32.000Z | import pytest
import cinema.test
import mgba.log
import os.path
import yaml
mgba.log.installDefault(mgba.log.NullLogger())
def flatten(d):
l = []
for k, v in d.tests.items():
if v.tests:
l.extend(flatten(v))
else:
l.append(v)
l.sort()
return l
def pytest_genera... | 31.483871 | 108 | 0.558914 |
cb7e7d0b857bf493dc8a6936aec05aa105c65848 | 407 | py | Python | setup.py | mp4096/blockschaltbilder | 9253022b5518e42d784176594d4d6fee7baa1050 | [
"MIT"
] | 11 | 2016-08-19T18:11:19.000Z | 2020-07-27T07:04:52.000Z | setup.py | mp4096/blockschaltbilder | 9253022b5518e42d784176594d4d6fee7baa1050 | [
"MIT"
] | 8 | 2016-09-17T16:46:01.000Z | 2021-04-29T19:59:57.000Z | setup.py | mp4096/blockschaltbilder | 9253022b5518e42d784176594d4d6fee7baa1050 | [
"MIT"
] | 4 | 2016-09-21T18:45:09.000Z | 2020-07-27T07:08:17.000Z | from setuptools import setup
setup(
name="Blockschaltbilder",
version="0.1",
description="Blockschaltbilder: Boilerplate code generator",
author="Mikhail Pak",
author_email="mikhail.pak@tum.de",
url="https://github.com/mp4096/blockschaltbilder",
packages=["blockschaltbilder"],
install_... | 25.4375 | 64 | 0.695332 |
69f9772dd027461f6d09941089c4795872e4db7e | 138 | py | Python | hello/setup.py | East196/hello-py | a77c7a0c8e5e2b5e8cefaf0fda335ab0c3b1da21 | [
"Apache-2.0"
] | 1 | 2017-10-23T14:58:47.000Z | 2017-10-23T14:58:47.000Z | hello/setup.py | East196/hello-py | a77c7a0c8e5e2b5e8cefaf0fda335ab0c3b1da21 | [
"Apache-2.0"
] | null | null | null | hello/setup.py | East196/hello-py | a77c7a0c8e5e2b5e8cefaf0fda335ab0c3b1da21 | [
"Apache-2.0"
] | 1 | 2018-04-06T07:49:18.000Z | 2018-04-06T07:49:18.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# setup.py
from distutils.core import setup
import py2exe
setup(console=["hello_redis.py"]) | 19.714286 | 33 | 0.702899 |
38a516440858013cdcb986a78759a444220ac1bb | 700 | py | Python | lib/services/backend.py | moreorem/graphdener | ad8a4b98ad79afb2da820248d656384614721882 | [
"BSD-3-Clause"
] | null | null | null | lib/services/backend.py | moreorem/graphdener | ad8a4b98ad79afb2da820248d656384614721882 | [
"BSD-3-Clause"
] | null | null | null | lib/services/backend.py | moreorem/graphdener | ad8a4b98ad79afb2da820248d656384614721882 | [
"BSD-3-Clause"
] | null | null | null | from PyQt5.QtCore import QProcess
from . import config
BPATH = config.get_directory('backend')
class Backend(object):
proc = None
parent = None
def start():
Backend.proc = QProcess()
Backend.proc.start(BPATH + "graphdener-backend")
# Wait for server to start and then connect
... | 26.923077 | 56 | 0.582857 |
fa93a2f516286a98fbadd42a987ed83605dd45a2 | 1,785 | py | Python | ListenUp/api/secrets.py | kkysen/Soft-Dev | b19881b1fcc9c7daefc817e6b975ff6bce545d81 | [
"Apache-2.0"
] | null | null | null | ListenUp/api/secrets.py | kkysen/Soft-Dev | b19881b1fcc9c7daefc817e6b975ff6bce545d81 | [
"Apache-2.0"
] | null | null | null | ListenUp/api/secrets.py | kkysen/Soft-Dev | b19881b1fcc9c7daefc817e6b975ff6bce545d81 | [
"Apache-2.0"
] | null | null | null | import os
import simplejson as json
from typing import Tuple
from util.annotations import override
from util.tupleable import Tupleable
from util.types import Json
class Watson(Tupleable):
def __init__(self, username, password):
# type: (str, str) -> None
self.username = username
... | 27.461538 | 88 | 0.62577 |
87890672042fc28d84ca4f349eeb5208afd4068c | 272 | py | Python | 2011-final-value-of-variable-after-performing-operations/2011-final-value-of-variable-after-performing-operations.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | 2 | 2021-12-05T14:29:06.000Z | 2022-01-01T05:46:13.000Z | 2011-final-value-of-variable-after-performing-operations/2011-final-value-of-variable-after-performing-operations.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | 2011-final-value-of-variable-after-performing-operations/2011-final-value-of-variable-after-performing-operations.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | class Solution:
def finalValueAfterOperations(self, operations: List[str]) -> int:
value = 0
for operation in operations:
if "+" in operation:
value+=1
else:
value-=1
return value
| 27.2 | 70 | 0.496324 |
35b5124416fa3d33c87f4c6c4f3643c2bf23429d | 17,994 | py | Python | Packs/AWS-CloudWatchLogs/Integrations/AWS-CloudWatchLogs/AWS-CloudWatchLogs.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/AWS-CloudWatchLogs/Integrations/AWS-CloudWatchLogs/AWS-CloudWatchLogs.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/AWS-CloudWatchLogs/Integrations/AWS-CloudWatchLogs/AWS-CloudWatchLogs.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import demistomock as demisto # noqa: F401
from CommonServerPython import * # noqa: F401
from datetime import date
class DatetimeEncoder(json.JSONEncoder):
def default(self, obj): # pylint: disable=E0202
if isinstance(obj, datetime):
return obj.strftime('%Y-%m-%dT%H:%M:%S')
elif isi... | 36.948665 | 114 | 0.611482 |
35c59fd571ffc6be11535a0832ccfced51799a06 | 1,545 | py | Python | 1_basics/8_variablen2.py | Coding-for-the-Arts/drawbot-samples | e37994f3497aca252312431100b53548b4573f15 | [
"CC0-1.0"
] | null | null | null | 1_basics/8_variablen2.py | Coding-for-the-Arts/drawbot-samples | e37994f3497aca252312431100b53548b4573f15 | [
"CC0-1.0"
] | null | null | null | 1_basics/8_variablen2.py | Coding-for-the-Arts/drawbot-samples | e37994f3497aca252312431100b53548b4573f15 | [
"CC0-1.0"
] | null | null | null | """
Variablen schreiben
"""
newPage(1000, 1000)
rect1x = 200 + 200
rect1y = 5 * 100
rect1width = 1000 - 500
rect1height = 1000 - 600
rect2x = 1000 % 300 # Rest der Division: 100
rect2y = 5 * 24
rect2width = width() // 2
rect2height = height() / 3
rect(rect1x, rect1y, rect1width, rect1height)
rect(rect2x, rect2y, re... | 28.611111 | 64 | 0.752104 |
57e7f3f1045300422dc527db2ba13e331991e111 | 1,222 | py | Python | sakf/utils/netUtils.py | spdir/sakf | 9a07c5f90765201a42d524dc6d4554f4ccd3c750 | [
"Apache-2.0"
] | null | null | null | sakf/utils/netUtils.py | spdir/sakf | 9a07c5f90765201a42d524dc6d4554f4ccd3c750 | [
"Apache-2.0"
] | null | null | null | sakf/utils/netUtils.py | spdir/sakf | 9a07c5f90765201a42d524dc6d4554f4ccd3c750 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import ipaddress
import re
try:
from types import UnicodeType
except ImportError:
UnicodeType = str
numeric = re.compile(r'[0-9]+$')
allowed = re.compile(r'(?!-)[a-z0-9-]{1,63}(?<!-)$', re.IGNORECASE)
def to_str(bstr, encoding='utf-8'):
if isinstance(bstr, bytes):
return bstr.decod... | 19.709677 | 67 | 0.690671 |
17bb266b0b6468c7f5fb3ce642ad61cef5c48dd0 | 16,230 | py | Python | GZP_GTO_QGIS/INSTALLATION/GeoTaskOrganizer/gto_commands.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/gto_commands.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/gto_commands.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 builtins import str
from PyQt5.QtWidgets import QMessageBox, QDockWidget, QPlainTextEdit, QStackedWidget, QToolBar, QInputDialog, QLineEdit, \
QToolButton
from PyQt5.QtCore import Qt
from qgis.core import QgsProject, QgsDataSourceUri, QgsRectangle, QgsPointXY, QgsGeo... | 39.682152 | 216 | 0.578127 |
52f66514c6ab6478076a0215e664741f891377da | 16,793 | py | Python | Solver2.py | timwuu/SokobanSolver | ae6d73516efa70fbf56ed4ca920b5ddc427d095d | [
"MIT"
] | null | null | null | Solver2.py | timwuu/SokobanSolver | ae6d73516efa70fbf56ed4ca920b5ddc427d095d | [
"MIT"
] | null | null | null | Solver2.py | timwuu/SokobanSolver | ae6d73516efa70fbf56ed4ca920b5ddc427d095d | [
"MIT"
] | null | null | null | import hashlib
import copy
import datetime
import threading
# Notation: [ROW][COL]
# Note: Add Forbidden Cells to improve the efficiency
# Check duplicate state in the search tree, keep DEPTH info
# ?keep DEPTH or STEPS
# Add Progress Monitoring
# ?Store Search Nodes for next batch
# ... | 26.404088 | 125 | 0.572858 |
5e30683c2a6d0626c17b6d7a833c2094ef19aa00 | 3,778 | py | Python | AP_SS16/504/python/fit.py | DimensionalScoop/kautschuk | 90403f97cd60b9716cb6a06668196891d5d96578 | [
"MIT"
] | 3 | 2016-04-27T17:07:00.000Z | 2022-02-02T15:43:15.000Z | AP_SS16/503/python/fit.py | DimensionalScoop/kautschuk | 90403f97cd60b9716cb6a06668196891d5d96578 | [
"MIT"
] | 5 | 2016-04-27T17:10:03.000Z | 2017-06-20T14:54:20.000Z | AP_SS16/504/python/fit.py | DimensionalScoop/kautschuk | 90403f97cd60b9716cb6a06668196891d5d96578 | [
"MIT"
] | null | null | null | import logging
import os
from logging import info
import numpy as np
import uncertainties as ucs
from scipy.optimize import curve_fit
from uncertainties.unumpy import uarray
import data
import helpers as hel
import simplex
from table import make_table
# remove this line if you aren't Max
os.chdir("/home/elayn/Projec... | 39.768421 | 183 | 0.673372 |
0ddc411f1f66f12d0e3b435c8ee565d28644beb8 | 3,011 | py | Python | yolov5-coreml-tflite-converter/tflite/test_converter.py | SchweizerischeBundesbahnen/sbb-ml-models | 485356aeb0a277907c160d435f7f654154046a70 | [
"MIT"
] | null | null | null | yolov5-coreml-tflite-converter/tflite/test_converter.py | SchweizerischeBundesbahnen/sbb-ml-models | 485356aeb0a277907c160d435f7f654154046a70 | [
"MIT"
] | null | null | null | yolov5-coreml-tflite-converter/tflite/test_converter.py | SchweizerischeBundesbahnen/sbb-ml-models | 485356aeb0a277907c160d435f7f654154046a70 | [
"MIT"
] | null | null | null | import os
import unittest
import tensorflow as tf
from constants import DEFAULT_PT_MODEL, OUTPUT_DIR, FLOAT32, FULLINT8, INT8, FLOAT16
from tf_converter.pytorch_to_tf_converter import PytorchToTFConverter
from tf_utils.parameters import ModelParameters, ConversionParameters
class ConverterTest(unittest.TestCase):
... | 45.621212 | 141 | 0.678844 |
df00165864ae09b9779931c976a51b712bb48497 | 952 | py | Python | tmp/convert.py | falkoschumann/activity-sampling-macos | 5f497bba3faefd3132e73f17bc8508ffdb81d328 | [
"MIT"
] | null | null | null | tmp/convert.py | falkoschumann/activity-sampling-macos | 5f497bba3faefd3132e73f17bc8508ffdb81d328 | [
"MIT"
] | 12 | 2018-11-09T18:57:07.000Z | 2018-12-13T10:15:09.000Z | tmp/convert.py | falkoschumann/macos-activity-sampling | 5f497bba3faefd3132e73f17bc8508ffdb81d328 | [
"MIT"
] | null | null | null | #!/usr/local/bin/python3
# Columns: timestamp,period,tags,activity
import csv
import re
with open('activity-log.csv', newline='', encoding='utf-8') as infile:
with open('activity-log.converted.csv', 'w', newline='', encoding='utf-8') as outfile:
writer = csv.DictWriter(outfile,
... | 32.827586 | 90 | 0.519958 |
33dfd85ea49559c4dd909dfb65fa02ec9fb1bfca | 2,825 | py | Python | tensorflow/basic-rl/tutorial11/code/cross_entropy_method.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | 1 | 2019-05-10T09:16:23.000Z | 2019-05-10T09:16:23.000Z | tensorflow/basic-rl/tutorial11/code/cross_entropy_method.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | null | null | null | tensorflow/basic-rl/tutorial11/code/cross_entropy_method.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | 1 | 2019-05-10T09:17:28.000Z | 2019-05-10T09:17:28.000Z | # modified from https://gist.github.com/sorenbouma/6502fbf55ecdf988aa247ef7f60a9546
import gym
import numpy as np
import matplotlib.pyplot as plt
env = gym.make('CartPole-v0')
env.render(close=True)
#vector of means(mu) and standard dev(sigma) for each paramater
mu=np.random.uniform(size=env.observation_space.shape)
s... | 38.69863 | 94 | 0.612035 |
6388be438dbff9a8fa1c649d3de085ff39de1c80 | 437 | py | Python | frappe-bench/apps/erpnext/erpnext/patches/v7_2/set_null_value_to_fields.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:55:29.000Z | 2021-04-29T14:55:29.000Z | frappe-bench/apps/erpnext/erpnext/patches/v7_2/set_null_value_to_fields.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v7_2/set_null_value_to_fields.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():
fields = {"Cost Center": "project", "Project": "cost_center"}
for budget_against, field in fields.items():
frappe.db.s... | 36.416667 | 71 | 0.732265 |
89705191ed87213da10c7a295e456435a0eecc66 | 2,261 | py | Python | Packs/ExpanseV2/Scripts/ExpansePrintSuggestions/ExpansePrintSuggestions_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/ExpanseV2/Scripts/ExpansePrintSuggestions/ExpansePrintSuggestions_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/ExpanseV2/Scripts/ExpansePrintSuggestions/ExpansePrintSuggestions_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | from ExpansePrintSuggestions import expanse_print_suggestions
import demistomock as demisto # noqa # pylint: disable=unused-wildcard-import
import json
import io
MOCK_IP = "198.51.101.1"
MOCK_PORT = "8888"
MOCK_FQDN = "test.developers.example.com"
MOCK_REGION = "us-west-2"
MOCK_SERVICE = "EC2"
MOCK_PROVIDER = "Amazo... | 31.84507 | 78 | 0.681115 |
988db947e505e4e11bff177a30f6e7b7156da49d | 12,664 | py | Python | chinahtz.py | qzcool/chinahtz | e3c7e5621c56d9966ec5ed24df951b04c56def05 | [
"MIT"
] | 2 | 2020-04-07T15:52:43.000Z | 2020-09-11T05:33:01.000Z | chinahtz.py | qzcool/chinahtz | e3c7e5621c56d9966ec5ed24df951b04c56def05 | [
"MIT"
] | null | null | null | chinahtz.py | qzcool/chinahtz | e3c7e5621c56d9966ec5ed24df951b04c56def05 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""中国高新区科技金融信息服务平台的爬虫。"""
__author__ = 'Qiao Zhang'
import time
import json
import codecs
import pandas as pd
import pyautogui
from selenium import webdriver
from bs4 import BeautifulSoup
from collections import OrderedDict
from tqdm import tqdm
class Chinaahtz:
... | 41.385621 | 236 | 0.51982 |
124ef3e09ed15a84e8c903c976ab81474754eed7 | 3,369 | py | Python | server/bumf/core/models/account.py | bumfiness/bumf | 71c404c0a8f804b8f0e127df3de6d8916db4c660 | [
"Apache-2.0"
] | 6 | 2017-01-07T17:59:46.000Z | 2017-02-10T13:19:46.000Z | server/bumf/core/models/account.py | rixx/bumf | 71c404c0a8f804b8f0e127df3de6d8916db4c660 | [
"Apache-2.0"
] | null | null | null | server/bumf/core/models/account.py | rixx/bumf | 71c404c0a8f804b8f0e127df3de6d8916db4c660 | [
"Apache-2.0"
] | null | null | null | from functools import partial
from django.core.exceptions import ValidationError
from django.db import models
from bumf.core.models.utils import Choices
from bumf.core.utils.mixins import CalculateTotal
class VirtualAccountVariants(Choices):
"""
There is one main virtual account type, the budget account, us... | 32.085714 | 98 | 0.703176 |
7f0408547e1aaad98236c2543b76a5b73c18d56a | 590 | py | Python | Algorithms/Sort_Algorithms/Merge_Sort/mergeSort.py | hussamEL-Hwary/DS-Algo-Handbook | 86a97d586a4ca8b17168c0a9f5a9f43f856eba58 | [
"MIT"
] | 18 | 2016-11-01T04:00:36.000Z | 2021-09-13T14:26:35.000Z | Algorithms/Sort_Algorithms/Merge_Sort/mergeSort.py | JEERU/DS-Algo-Handbook | 86a97d586a4ca8b17168c0a9f5a9f43f856eba58 | [
"MIT"
] | 60 | 2016-10-11T14:50:47.000Z | 2016-10-31T11:05:01.000Z | Algorithms/Sort_Algorithms/Merge_Sort/mergeSort.py | JEERU/DS-Algo-Handbook | 86a97d586a4ca8b17168c0a9f5a9f43f856eba58 | [
"MIT"
] | 87 | 2016-09-08T05:04:50.000Z | 2016-10-30T19:19:53.000Z | def mergeSort(l):
if len(l) > 1:
mid = len(l) // 2
left = mergeSort(l[:mid])
right = mergeSort(l[mid:])
i = j = k = 0;
while i < len(left) and j < len(right):
if left[i] > right[j]:
l[k] = right[j]
j += 1
else:
... | 21.851852 | 47 | 0.316949 |
145130bcc3a8be66e4dd382e5bdb4fba4a3341d3 | 883 | py | Python | UnityPython.FrontEnd/test.py | franklin1dev/Traffy.UnityPython-main | b616e4c0043af05f5c34ebd245c09b21bfa79a10 | [
"MIT"
] | null | null | null | UnityPython.FrontEnd/test.py | franklin1dev/Traffy.UnityPython-main | b616e4c0043af05f5c34ebd245c09b21bfa79a10 | [
"MIT"
] | null | null | null | UnityPython.FrontEnd/test.py | franklin1dev/Traffy.UnityPython-main | b616e4c0043af05f5c34ebd245c09b21bfa79a10 | [
"MIT"
] | null | null | null | import cProfile, pstats, io
from functools import total_ordering
from typing import SupportsRound, Type, TypeGuard, TypeVar
pr = cProfile.Profile()
pr.enable()
from unitypython.Transpile import compile_module
from unitypython.TraffyAsm import fast_asdict
from unitypython.JSON import dump_json
src = open("test.src.py... | 20.534884 | 58 | 0.699887 |
d38569257dac622297d95f98c2d64e2c86be7351 | 542 | py | Python | python/data_sutram/pypath/PyPath/json_sqlite/13_get_route_path_bw_2_stops.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/data_sutram/pypath/PyPath/json_sqlite/13_get_route_path_bw_2_stops.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/data_sutram/pypath/PyPath/json_sqlite/13_get_route_path_bw_2_stops.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | """
Check "get_all_routes" table to get all the start and end stopages along with the routeId. Get the corresponding stopId from get_all_stoppages
table. This is too static.
INPUT : route_code,from_stop_id,to_stop_id
route_code/routeId can be found out from the "get_all_routes" table.
OUTPUT : {
"linkId... | 28.526316 | 142 | 0.662362 |
6c9f5d34fd865016c12349fb5b3301ee03bcef4c | 404 | py | Python | huTools/fs.py | gadventures/huTools | 8bc58d63491bcd3cfc3e78d219be703d943ffeb5 | [
"BSD-3-Clause"
] | null | null | null | huTools/fs.py | gadventures/huTools | 8bc58d63491bcd3cfc3e78d219be703d943ffeb5 | [
"BSD-3-Clause"
] | null | null | null | huTools/fs.py | gadventures/huTools | 8bc58d63491bcd3cfc3e78d219be703d943ffeb5 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# encoding: utf-8
"""
fs.py filesystem-related functions
Created by Maximillian Dornseif on 2008-08-16.
Copyright (c) 2008 HUDORA. Consider it BSD Licensed.
"""
from __future__ import unicode_literals
import os
def makedirhier(dirnmame):
"""Created 'dirname' if needes and all intermediate ... | 21.263158 | 71 | 0.732673 |
2c47695ac419dfa7802984c5a86e7f3cf7e3954a | 729 | py | Python | challenges/concatenateNumbers/python3/concatenateNumbers.py | jimmynguyen/codefights | f4924fcffdb4ff14930618bb1a781e4e02e9aa09 | [
"MIT"
] | 5 | 2020-05-21T03:02:34.000Z | 2021-09-06T04:24:26.000Z | challenges/concatenateNumbers/python3/concatenateNumbers.py | jimmynguyen/codefights | f4924fcffdb4ff14930618bb1a781e4e02e9aa09 | [
"MIT"
] | 6 | 2019-04-24T03:39:26.000Z | 2019-05-03T02:10:59.000Z | challenges/concatenateNumbers/python3/concatenateNumbers.py | jimmynguyen/codefights | f4924fcffdb4ff14930618bb1a781e4e02e9aa09 | [
"MIT"
] | 1 | 2021-09-06T04:24:27.000Z | 2021-09-06T04:24:27.000Z | def concatenateNumbers(a, b):
return int(str(a) + str(b))
if __name__ == '__main__':
input0 = [23, 962]
input1 = [45, 12345]
expectedOutput = [2345, 96212345]
assert len(input0) == len(expectedOutput), '# input0 = {}, # expectedOutput = {}'.format(len(input0), len(expectedOutput))
assert len(input1) == len(expec... | 56.076923 | 133 | 0.689986 |
2c7fc5847beabfc7fcc71c9cd941648308d1cb80 | 145 | py | Python | python/unittest/mock/medium/04_patching_builtins/worker.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/unittest/mock/medium/04_patching_builtins/worker.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/unittest/mock/medium/04_patching_builtins/worker.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | import os
def work_on_env():
path = os.path.join(os.getcwd(), os.environ["MY_VAR"])
print(f"Working on {path}")
return path
| 18.125 | 59 | 0.606897 |
1a773b0257f68c8472976426b8e717e1d5f79b14 | 1,570 | pyde | Python | sketches/gol/gol.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 4 | 2018-06-03T02:11:46.000Z | 2021-08-18T19:55:15.000Z | sketches/gol/gol.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | null | null | null | sketches/gol/gol.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 3 | 2019-12-23T19:12:51.000Z | 2021-04-30T14:00:31.000Z | from copy import deepcopy
resolution = 10
grid = []
next = []
def setup():
global grid, next, cols, rows
size(600, 400)
this.surface.setTitle("Conways Game of Life")
cols = width / resolution
rows = height / resolution
grid = [[floor(random(2)) for _ in range(rows)] for _ in range(cols)]
... | 26.610169 | 73 | 0.476433 |
46eee31e9011532568b32ec2ad3cb432b39e7c99 | 16,589 | py | Python | frappe-bench/apps/erpnext/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import flt, cint, nowdate
from frappe import throw, _
import frappe.defaults
from frappe.utils import getdate
from erp... | 38.668998 | 154 | 0.734523 |
2001c7bfd50fc03f9a3cbdf87074237877a9afed | 6,264 | py | Python | api/scripts/dias/creodiasCARDchips.py | CsabaWirnhardt/cbm | 1822addd72881057af34ac6a7c2a1f02ea511225 | [
"BSD-3-Clause"
] | 17 | 2021-01-18T07:27:01.000Z | 2022-03-10T12:26:21.000Z | api/scripts/dias/creodiasCARDchips.py | CsabaWirnhardt/cbm | 1822addd72881057af34ac6a7c2a1f02ea511225 | [
"BSD-3-Clause"
] | 4 | 2021-04-29T11:20:44.000Z | 2021-12-06T10:19:17.000Z | api/scripts/dias/creodiasCARDchips.py | CsabaWirnhardt/cbm | 1822addd72881057af34ac6a7c2a1f02ea511225 | [
"BSD-3-Clause"
] | 47 | 2021-01-21T08:25:22.000Z | 2022-03-21T14:28:42.000Z | #!/usr/bin/env python
# coding: utf-8
#
# Get key to relevant CARD products in CREODIAS catalog
# Version 1.3 - 2020-05-14
# - Make end date inclusive
#
# Version 1.2 - 2020-04-14
# - Changed to JSON format parsing
# - added s1 selection
#
# Version 1.1 - 2020-03-24
# - Include intersection calculation
#
import reque... | 36 | 256 | 0.661398 |
6481e7a2dc3052e1bc15f1e74ae9d37c0b5513a7 | 42 | py | Python | pandemie/web/__init__.py | marvinsxtr/informaticup-2020-pandemie | 0d37d5236eadfe7bb3cbd7cbfd0e1b7afca74c89 | [
"MIT"
] | null | null | null | pandemie/web/__init__.py | marvinsxtr/informaticup-2020-pandemie | 0d37d5236eadfe7bb3cbd7cbfd0e1b7afca74c89 | [
"MIT"
] | null | null | null | pandemie/web/__init__.py | marvinsxtr/informaticup-2020-pandemie | 0d37d5236eadfe7bb3cbd7cbfd0e1b7afca74c89 | [
"MIT"
] | 1 | 2020-03-28T00:02:41.000Z | 2020-03-28T00:02:41.000Z | from pandemie.web.server import WebServer
| 21 | 41 | 0.857143 |
20b77c7325dec7688b610f819d0a9f079141330c | 7,664 | py | Python | etl/op2dw/extractor.py | cloud-cds/cds-stack | d68a1654d4f604369a071f784cdb5c42fc855d6e | [
"Apache-2.0"
] | 6 | 2018-06-27T00:09:55.000Z | 2019-03-07T14:06:53.000Z | etl/op2dw/extractor.py | cloud-cds/cds-stack | d68a1654d4f604369a071f784cdb5c42fc855d6e | [
"Apache-2.0"
] | 3 | 2021-03-31T18:37:46.000Z | 2021-06-01T21:49:41.000Z | etl/op2dw/extractor.py | cloud-cds/cds-stack | d68a1654d4f604369a071f784cdb5c42fc855d6e | [
"Apache-2.0"
] | 3 | 2020-01-24T16:40:49.000Z | 2021-09-30T02:28:55.000Z | import asyncio
import asyncpg
import json
import copy
import logging
class Extractor:
def __init__(self, remote_server, dataset_id, model_id,
source_tbl, dest_tbl=None,
field_map=None, primary_key=None,
version_extension='dataset',
r... | 38.512563 | 125 | 0.654228 |
2fb2bc1ab154cea62eaacf0936c972c9a3d1256e | 2,530 | py | Python | src/Sephrasto/UI/Hilfe.py | qeqar/Sephrasto | ce46d46299b2c793f015e25c98908773c39b1dee | [
"MIT"
] | null | null | null | src/Sephrasto/UI/Hilfe.py | qeqar/Sephrasto | ce46d46299b2c793f015e25c98908773c39b1dee | [
"MIT"
] | null | null | null | src/Sephrasto/UI/Hilfe.py | qeqar/Sephrasto | ce46d46299b2c793f015e25c98908773c39b1dee | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'Hilfe.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 QtCore, QtGui,... | 42.166667 | 114 | 0.715415 |
2fe930bba3428d0f1971418e9acb242edc92c318 | 155 | py | Python | ODAW/tf/tagfilter/services/web/project/stdout.py | joao-frohlich/BCC | 9ed74eb6d921d1280f48680677a2140c5383368d | [
"Apache-2.0"
] | 10 | 2020-12-08T20:18:15.000Z | 2021-06-07T20:00:07.000Z | stdout.py | VGasparini/tagfilter | 2f93d427f977a1ceea63d965eeb35f8187f79ac0 | [
"MIT"
] | 2 | 2021-06-28T03:42:13.000Z | 2021-06-28T16:53:13.000Z | stdout.py | VGasparini/tagfilter | 2f93d427f977a1ceea63d965eeb35f8187f79ac0 | [
"MIT"
] | 2 | 2021-01-14T19:59:20.000Z | 2021-06-15T11:53:21.000Z | from datetime import datetime
def log(*message):
date = "[" + str(datetime.now()) + "]"
text = "".join(message)
print(date, text)
return
| 17.222222 | 42 | 0.587097 |
9209cbabbab50ff36dbe1d880156207185c82d6b | 1,048 | py | Python | tests/onegov/core/test_debug.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/core/test_debug.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/core/test_debug.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | import click
from onegov.core.orm import debug
def test_analyze_simple_sql_query(session, capsys):
with debug.analyze_sql_queries('summary'):
session.execute('select 1')
session.execute('select 1') # must not be caught
out = click.unstyle(capsys.readouterr()[0])
assert out == 'executed 1 ... | 25.560976 | 67 | 0.677481 |
5b335e77626863dc87f2dce8f1f4db07c0169a67 | 10,343 | py | Python | src/resources/movietemplates/curveoverlay.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 226 | 2018-12-29T01:13:49.000Z | 2022-03-30T19:16:31.000Z | src/resources/movietemplates/curveoverlay.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 5,100 | 2019-01-14T18:19:25.000Z | 2022-03-31T23:08:36.000Z | src/resources/movietemplates/curveoverlay.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 84 | 2019-01-24T17:41:50.000Z | 2022-03-10T10:01:46.000Z | ###############################################################################
# Function: Sequence1Frames_set_timeslider
#
# Purpose:
# This is a callback function for sequence 1's IterateCallbackAndSaveFrames
# function. This function sets the time and updates the time slider so
# it has the right time value.
... | 35.421233 | 115 | 0.584163 |
f3b3c2f292ba5871ff6eab177b0e8da0cddd7428 | 507 | py | Python | project/requests.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | 1 | 2021-06-01T14:49:18.000Z | 2021-06-01T14:49:18.000Z | project/requests.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | 286 | 2020-12-04T14:13:00.000Z | 2022-03-09T19:05:16.000Z | project/requests.py | DanielGrams/gsevpt | a92f71694388e227e65ed1b24446246ee688d00e | [
"MIT"
] | null | null | null | from datetime import datetime, timedelta
from flask import g
from flask_login.utils import encode_cookie
from project import app
@app.after_request
def set_manage_admin_unit_cookie(response):
admin_unit = getattr(g, "manage_admin_unit", None)
if admin_unit:
encoded = encode_cookie(str(admin_unit.id... | 23.045455 | 60 | 0.69428 |
45f935b621d8f688ddbe67a8fd8fbc16d0f7da7e | 379 | py | Python | Algorithms/Strings/two_characters.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | Algorithms/Strings/two_characters.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | Algorithms/Strings/two_characters.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
from itertools import combinations
s_len = int(input().strip())
S = input()
set_s = set(S)
max_len = 0
for p in combinations(set_s, 2):
temp = [s for s in S if p[0] == s or p[1] == s]
if len(set(temp[0::2])) == 1 and len(set(temp[1::2])) == 1:
if max_len < len(temp):
... | 22.294118 | 63 | 0.591029 |
342c13dafa6b3713d4b6670d600a0e40d3a2bc7a | 855 | py | Python | zplus_scraper/main.py | tstaec/ZplusScraper | 38c4f9534b8ee3822a80b48a6827ef4f52793c0b | [
"MIT"
] | null | null | null | zplus_scraper/main.py | tstaec/ZplusScraper | 38c4f9534b8ee3822a80b48a6827ef4f52793c0b | [
"MIT"
] | 1 | 2021-07-04T12:02:57.000Z | 2021-07-04T12:02:57.000Z | zplus_scraper/main.py | tstaec/ZplusScraper | 38c4f9534b8ee3822a80b48a6827ef4f52793c0b | [
"MIT"
] | null | null | null | from scrapy.crawler import CrawlerProcess
from scrapy.utils.project import get_project_settings
from spiders.zplus_spider import ZplusSpider
from twisted.internet import reactor
from twisted.internet.task import deferLater
def sleep(self, *args, seconds):
"""Non blocking sleep callback"""
return deferLater(re... | 26.71875 | 88 | 0.757895 |
942f142ff8280858fb76bdde16e5816d67f9ff96 | 497 | py | Python | exercises/en/test_03_09_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/en/test_03_09_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/en/test_03_09_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | def test():
assert Token.has_extension(
"reversed"
), "Did you register the extension on the token?"
ext = Token.get_extension("reversed")
assert ext[2] is not None, "Did you set the getter correctly?"
assert (
"getter=get_reversed" in __solution__
), "Did you assign get_reversed... | 38.230769 | 88 | 0.684105 |
04d10bbccbc0dcba2c256c93bfd55f19478e1ff1 | 1,723 | py | Python | MyBrowser.py | hakimkt/SAIVS | c310bd7c9426f0d21efeea8866cf6b881b7e8530 | [
"Apache-2.0"
] | 40 | 2018-10-29T02:29:13.000Z | 2021-11-23T13:14:50.000Z | MyBrowser.py | 5l1v3r1/SAIVS | aa62451665b6398ba329d68592bf4313be60a886 | [
"Apache-2.0"
] | 1 | 2021-02-23T12:27:28.000Z | 2021-02-23T12:27:28.000Z | MyBrowser.py | 5l1v3r1/SAIVS | aa62451665b6398ba329d68592bf4313be60a886 | [
"Apache-2.0"
] | 29 | 2018-10-29T02:29:17.000Z | 2022-03-17T06:31:35.000Z | #!/usr/bin/python
#coding:utf-8
import os
import time
from selenium import webdriver
import codecs
# const variable
SIZE_WIDTH = 780
SIZE_HEIGHT = 480
POS_WIDTH = 520
POS_HEIGHT = 1
# 様々なブラウザ連携を行う
class Browser():
# ブラウザの初期設定
def __init__(self):
# ブラウザの定義
# obj_options = we... | 31.907407 | 134 | 0.669182 |
b6e522a10fa941a29ebed88e526e12fe8562d6cf | 2,420 | py | Python | packages/watchmen-model/src/watchmen_model/admin/pipeline_graphic.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-model/src/watchmen_model/admin/pipeline_graphic.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-model/src/watchmen_model/admin/pipeline_graphic.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from datetime import datetime
from typing import List, Optional, Union
from pydantic import BaseModel
from watchmen_model.common import DataModel, GraphicPosition, GraphicRect, PipelineGraphicId, TopicId, UserBasedTuple
from watchmen_utilities import ArrayHelper
def construct_rect(rect: Optional[Union[dict, Graphic... | 26.304348 | 117 | 0.75 |
6d01f40087c24db2ed8636ce65c1b1c18803ee29 | 200 | py | Python | Projeto1/Projeto1/views.py | Muhiton/TecWeb | 42e6e4e128eeca2807273a404b77839def353816 | [
"Apache-2.0"
] | null | null | null | Projeto1/Projeto1/views.py | Muhiton/TecWeb | 42e6e4e128eeca2807273a404b77839def353816 | [
"Apache-2.0"
] | null | null | null | Projeto1/Projeto1/views.py | Muhiton/TecWeb | 42e6e4e128eeca2807273a404b77839def353816 | [
"Apache-2.0"
] | null | null | null | from django.http import HttpResponse
def ola(request):
return HttpResponse("<h1 style='color:Red'>Projeto 1</h1></br><h3>Coisas para colocar.</h3></br><h3>Mais coisas para colocar.</h3>")
| 28.571429 | 134 | 0.69 |
6d1fd14a4c533d12ed04d1c8218a8dad78f36a8b | 762 | py | Python | Algorithms/Sorting/QuickSortRunTime.py | baby5/HackerRank | 1e68a85f40499adb9b52a4da16936f85ac231233 | [
"MIT"
] | null | null | null | Algorithms/Sorting/QuickSortRunTime.py | baby5/HackerRank | 1e68a85f40499adb9b52a4da16936f85ac231233 | [
"MIT"
] | null | null | null | Algorithms/Sorting/QuickSortRunTime.py | baby5/HackerRank | 1e68a85f40499adb9b52a4da16936f85ac231233 | [
"MIT"
] | null | null | null | #coding:utf-8
n = int(raw_input())
ar = map(int, raw_input().split())
ar1 = ar[:]
insert_swaps = 0
for i in xrange(1, n):
j = i
key = ar1[i]
while j > 0 and ar1[j-1] > key:
ar1[j] = ar1[j-1]
j -= 1
insert_swaps += 1
ar1[j] = key
quick_swaps = 0
def quick_sort(ar, lo, hi):
... | 19.05 | 43 | 0.454068 |
edeab00aa8f616c67dffb1d0cac8cb977081d97c | 66 | py | Python | scheduleSynchronizer/debug.py | 497022407/Shifts-manager | beccb63c8622c015a9a453f586d4c3bb5d5066b9 | [
"Apache-2.0"
] | null | null | null | scheduleSynchronizer/debug.py | 497022407/Shifts-manager | beccb63c8622c015a9a453f586d4c3bb5d5066b9 | [
"Apache-2.0"
] | null | null | null | scheduleSynchronizer/debug.py | 497022407/Shifts-manager | beccb63c8622c015a9a453f586d4c3bb5d5066b9 | [
"Apache-2.0"
] | null | null | null |
import json
def print_json(j):
print (json.dumps(j,indent=4)) | 16.5 | 34 | 0.69697 |
b63f8842d6d158fea1f710b577f685b78d8720ea | 7,447 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/network/icx/icx_command.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/network/icx/icx_command.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/network/icx/icx_command.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | 31.961373 | 113 | 0.652075 |
1ed489024f6fbca70c7a9f31de502db06efdbf2a | 143 | py | Python | hardware/chip/rtl872xd/hal/hal_test/dac/ucube.py | wstong999/AliOS-Things | 6554769cb5b797e28a30a4aa89b3f4cb2ef2f5d9 | [
"Apache-2.0"
] | 4,538 | 2017-10-20T05:19:03.000Z | 2022-03-30T02:29:30.000Z | hardware/chip/rtl872xd/hal/hal_test/dac/ucube.py | wstong999/AliOS-Things | 6554769cb5b797e28a30a4aa89b3f4cb2ef2f5d9 | [
"Apache-2.0"
] | 1,088 | 2017-10-21T07:57:22.000Z | 2022-03-31T08:15:49.000Z | hardware/chip/rtl872xd/hal/hal_test/dac/ucube.py | willianchanlovegithub/AliOS-Things | 637c0802cab667b872d3b97a121e18c66f256eab | [
"Apache-2.0"
] | 1,860 | 2017-10-20T05:22:35.000Z | 2022-03-27T10:54:14.000Z | src = Split('''
dac_test.c
''')
component = aos_component('dac_test', src)
component.add_cflags('-Wall')
component.add_cflags('-Werror')
| 15.888889 | 42 | 0.685315 |
bf8055444aebaaa0511c7c31b00cb3e91c058da2 | 1,188 | py | Python | TreeModelLib/GrowthAndDeathDynamics/GrowthAndDeathDynamics.py | jvollhueter/pyMANGA-1 | 414204a394d44405225b4b8224b19464c1006f1d | [
"MIT"
] | null | null | null | TreeModelLib/GrowthAndDeathDynamics/GrowthAndDeathDynamics.py | jvollhueter/pyMANGA-1 | 414204a394d44405225b4b8224b19464c1006f1d | [
"MIT"
] | null | null | null | TreeModelLib/GrowthAndDeathDynamics/GrowthAndDeathDynamics.py | jvollhueter/pyMANGA-1 | 414204a394d44405225b4b8224b19464c1006f1d | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from TreeModelLib import TreeModel
class GrowthAndDeathDynamics(TreeModel):
## Concept for tree growth and death dynamics
# @param case: tree dynamic concept to be used for the model
# @date: 2019 - Today
# @author: jasper.bathmann@ufz.de
def __in... | 31.263158 | 72 | 0.643098 |
7872bc7d284854b449ceb835696991b388136cc7 | 1,496 | py | Python | rateable/views.py | TheKiddos/StaRat | 33807d73276563f636b430e1bbfcb65b645869f7 | [
"MIT"
] | 1 | 2021-05-18T16:33:10.000Z | 2021-05-18T16:33:10.000Z | rateable/views.py | TheKiddos/StaRat | 33807d73276563f636b430e1bbfcb65b645869f7 | [
"MIT"
] | 3 | 2021-05-18T16:02:32.000Z | 2021-05-21T15:20:12.000Z | rateable/views.py | TheKiddos/StaRat | 33807d73276563f636b430e1bbfcb65b645869f7 | [
"MIT"
] | 1 | 2021-09-12T22:56:09.000Z | 2021-09-12T22:56:09.000Z | from rest_framework import viewsets, authentication, permissions, mixins
from .models import Rateable, Rating
from . import serializers
from utils.mixins import PublicListRetrieveViewSetMixin
# TODO: Make Public And Private View Instead?
class RateableViewSet(PublicListRetrieveViewSetMixin,
view... | 37.4 | 125 | 0.709225 |
1573e795241ee1a9ee80f5705f14d6ce6a67e758 | 499 | py | Python | day24/snake/food.py | nurmatthias/100DaysOfCode | 22002e4b31d13e6b52e6b9222d2e91c2070c5744 | [
"Apache-2.0"
] | null | null | null | day24/snake/food.py | nurmatthias/100DaysOfCode | 22002e4b31d13e6b52e6b9222d2e91c2070c5744 | [
"Apache-2.0"
] | null | null | null | day24/snake/food.py | nurmatthias/100DaysOfCode | 22002e4b31d13e6b52e6b9222d2e91c2070c5744 | [
"Apache-2.0"
] | null | null | null | import random
from turtle import Turtle
class Food(Turtle):
def __init__(self) -> None:
super().__init__()
self.shape("circle")
self.penup()
self.shapesize(stretch_len=0.5, stretch_wid=0.5)
self.color("blue")
self.speed("fastest")
self.refresh()
def r... | 20.791667 | 71 | 0.589178 |
01a0264443294ce4c7958481b971d9da0ec76150 | 151 | py | Python | main.py | DrBumm/Minibyte-Engine | 833bf00ff86603419476c8755f551c0f6b4ac86b | [
"Unlicense"
] | 4 | 2019-08-16T20:48:33.000Z | 2021-05-23T20:10:08.000Z | main.py | DrBumm/Minibyte-Engine | 833bf00ff86603419476c8755f551c0f6b4ac86b | [
"Unlicense"
] | 16 | 2019-08-21T19:06:15.000Z | 2020-06-02T11:31:32.000Z | main.py | DrBumm/Minibyte-Engine | 833bf00ff86603419476c8755f551c0f6b4ac86b | [
"Unlicense"
] | null | null | null | # How to use
from src import mnlp
lvl = ['XXXXXXXXXX',
'X G PX',
'XF XXX',
'XXXXXXXXXX']
mnlp.start(lvl, True)
| 15.1 | 22 | 0.483444 |
e5b6295923291b7a8ba0f80723a6209aa93ff56d | 677 | py | Python | angstrom/2020/misc/Noisy/Noisey.py | mystickev/ctf-archives | 89e99a5cd5fb6b2923cad3fe1948d3ff78649b4e | [
"MIT"
] | 1 | 2021-11-02T20:53:58.000Z | 2021-11-02T20:53:58.000Z | angstrom/2020/misc/Noisy/Noisey.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | angstrom/2020/misc/Noisy/Noisey.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 1 | 2021-12-19T11:06:24.000Z | 2021-12-19T11:06:24.000Z | import numpy as np
from random import gauss
morse = REDACTED
repeats = REDACTED
pointed = []
for c in morse:
if c == ".":
pointed.extend([1 for x in range(10)])
if c == "-":
pointed.extend([1 for x in range(20)])
if c == " ":
pointed.extend([0 for x in range(20)])
poi... | 27.08 | 58 | 0.533235 |
f906b6434b4eee8edbfe09349345cce350492d74 | 2,444 | py | Python | common subseq.py | aertoria/MiscCode | a2e94d0fe0890e6620972f84adcb7976ca9f1408 | [
"Apache-2.0"
] | null | null | null | common subseq.py | aertoria/MiscCode | a2e94d0fe0890e6620972f84adcb7976ca9f1408 | [
"Apache-2.0"
] | null | null | null | common subseq.py | aertoria/MiscCode | a2e94d0fe0890e6620972f84adcb7976ca9f1408 | [
"Apache-2.0"
] | null | null | null | '''
Given a string S and a string T, count the number of distinct subsequences of T in S.
A subsequence of a string is a new string which is formed from the original string by deleting some (can be none) of the characters without disturbing the relative positions of the remaining characters. (ie, "ACE" is a subsequenc... | 19.396825 | 262 | 0.654664 |
dab49569361999d7177225bc8ada4d1da3461ead | 11,661 | py | Python | repo/script.module.urlresolver/lib/urlresolver/hmf.py | dbiesecke/dbiesecke.github.io | 5894473591f078fd22d1cb33794c5e656ae9b8dd | [
"MIT"
] | 1 | 2017-11-26T18:18:46.000Z | 2017-11-26T18:18:46.000Z | repo/script.module.urlresolver/lib/urlresolver/hmf.py | dbiesecke/dbiesecke.github.io | 5894473591f078fd22d1cb33794c5e656ae9b8dd | [
"MIT"
] | null | null | null | repo/script.module.urlresolver/lib/urlresolver/hmf.py | dbiesecke/dbiesecke.github.io | 5894473591f078fd22d1cb33794c5e656ae9b8dd | [
"MIT"
] | 3 | 2019-09-30T19:52:05.000Z | 2020-04-12T21:20:56.000Z | """
urlresolver Addon for Kodi
Copyright (C) 2016 t0mm0, tknorris
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 3 of the License, or
(at your option) any late... | 39.39527 | 132 | 0.589058 |
a9c49df4337f942f7dda22343ffd8ffb7c132b32 | 350 | py | Python | tests/onegov/file/conftest.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/file/conftest.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/file/conftest.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | import pytest
from depot.manager import DepotManager
@pytest.fixture(scope='function', autouse=True)
def depot(temporary_directory):
DepotManager.configure('default', {
'depot.backend': 'depot.io.local.LocalFileStorage',
'depot.storage_path': temporary_directory
})
yield DepotManager.get... | 21.875 | 59 | 0.72 |
e73f54a4c368e01d1e66eddcd9fc7c29cf0ea842 | 4,850 | py | Python | SendWidget.py | plageon/Mailbox | 7f975dbffe880c466647cdd58819602c2bc8c0f2 | [
"MIT"
] | 1 | 2021-08-15T03:30:07.000Z | 2021-08-15T03:30:07.000Z | SendWidget.py | plageon/Mailbox | 7f975dbffe880c466647cdd58819602c2bc8c0f2 | [
"MIT"
] | null | null | null | SendWidget.py | plageon/Mailbox | 7f975dbffe880c466647cdd58819602c2bc8c0f2 | [
"MIT"
] | null | null | null | import os
import smtplib
from email.header import Header
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from PyQt5.QtWidgets import QWidget, QLineEdit, QLabel, QPushButton, QTextEdit, QFileDialog,QMessageBox
class SendWidget(QWidget):
def __init__(self):
super(SendWid... | 37.890625 | 133 | 0.626804 |
e74a41ff723d105ad7aa66175947021e3a860088 | 6,143 | py | Python | model_zoo/ernie-3.0/compress_qa.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | model_zoo/ernie-3.0/compress_qa.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | model_zoo/ernie-3.0/compress_qa.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 34.511236 | 103 | 0.698193 |
823af84e7accc8f12f25aa8be0199ce13d866c2a | 2,356 | py | Python | src/server/app/endpoints/profile_redesign/controllers.py | MatthiasRiener/DigiPen | 9b4aff4a1c431e06d73733dc3dd3f3f3d4631704 | [
"MIT"
] | null | null | null | src/server/app/endpoints/profile_redesign/controllers.py | MatthiasRiener/DigiPen | 9b4aff4a1c431e06d73733dc3dd3f3f3d4631704 | [
"MIT"
] | null | null | null | src/server/app/endpoints/profile_redesign/controllers.py | MatthiasRiener/DigiPen | 9b4aff4a1c431e06d73733dc3dd3f3f3d4631704 | [
"MIT"
] | null | null | null | from flask import Flask, render_template, Blueprint
# von Friesi :)
from flask_jwt_extended import jwt_required, get_jwt_identity
import json
from ...repository.LanguageRepository import getLanguages
from ...repository.UserRepositoryNew import getAdditionalInformations, getRelatedUsers, getUser
profile_redesign = Bl... | 33.657143 | 215 | 0.716044 |
414feeb9ef82d3994819667904ffb20e6c27a8fe | 945 | py | Python | packages/watchmen-dqc/src/watchmen_dqc/monitor/rule/factor_quantile_not_in_range.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-dqc/src/watchmen_dqc/monitor/rule/factor_quantile_not_in_range.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-dqc/src/watchmen_dqc/monitor/rule/factor_quantile_not_in_range.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from datetime import datetime
from typing import Any, List, Tuple
from watchmen_data_kernel.storage import TopicDataService
from watchmen_dqc.util import build_data_frame, convert_data_frame_type_by_types
from watchmen_model.admin import Factor, FactorType
from watchmen_model.dqc import MonitorRule
from .types import ... | 36.346154 | 88 | 0.816931 |
68f57da157db2a0b73ac58b56cea3f52ad087666 | 2,088 | py | Python | plugins/tff_backend/models/document.py | threefoldfoundation/app_backend | b3cea2a3ff9e10efcc90d3d6e5e8e46b9e84312a | [
"Apache-2.0"
] | null | null | null | plugins/tff_backend/models/document.py | threefoldfoundation/app_backend | b3cea2a3ff9e10efcc90d3d6e5e8e46b9e84312a | [
"Apache-2.0"
] | 178 | 2017-08-02T12:58:06.000Z | 2017-12-20T15:01:12.000Z | plugins/tff_backend/models/document.py | threefoldfoundation/app_backend | b3cea2a3ff9e10efcc90d3d6e5e8e46b9e84312a | [
"Apache-2.0"
] | 2 | 2018-01-10T10:43:12.000Z | 2018-03-18T10:42:23.000Z | # -*- coding: utf-8 -*-
# Copyright 2018 GIG Technology NV
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 31.164179 | 117 | 0.73228 |
68ff95b5ed77ce5f09ce6a187b776e5c0a759fb2 | 627 | py | Python | frappe-bench/apps/erpnext/erpnext/patches/v8_0/change_in_words_varchar_length.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/change_in_words_varchar_length.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v8_0/change_in_words_varchar_length.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:39:01.000Z | 2021-04-29T14:39:01.000Z | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
doctypes = frappe.db.sql_list("""select parent from tabDocField where fieldname = 'in_words'""")
for dt in doctype... | 36.882353 | 97 | 0.727273 |
6bc2030bba8c1fd71e171d25e88b531dee92760f | 116 | py | Python | python/primary/模块/mymodule.py | EstherLacan/jiangfw | a449b1925742873c76dc1b3284aedb359204bc76 | [
"Apache-2.0"
] | 1 | 2020-07-29T16:43:46.000Z | 2020-07-29T16:43:46.000Z | python/primary/模块/mymodule.py | EstherLacan/jiangfw | a449b1925742873c76dc1b3284aedb359204bc76 | [
"Apache-2.0"
] | null | null | null | python/primary/模块/mymodule.py | EstherLacan/jiangfw | a449b1925742873c76dc1b3284aedb359204bc76 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# Filename: mymodule.py
def sayhi():
print('Hi, this is mymodule speaking.')
version = '0.1'
| 16.571429 | 43 | 0.655172 |
d43d1d64375ceb887938c8fae61e02e733272a49 | 1,840 | py | Python | plugins/tff_backend/migrations/_009_change_token_value.py | threefoldfoundation/app_backend | b3cea2a3ff9e10efcc90d3d6e5e8e46b9e84312a | [
"Apache-2.0"
] | null | null | null | plugins/tff_backend/migrations/_009_change_token_value.py | threefoldfoundation/app_backend | b3cea2a3ff9e10efcc90d3d6e5e8e46b9e84312a | [
"Apache-2.0"
] | 178 | 2017-08-02T12:58:06.000Z | 2017-12-20T15:01:12.000Z | plugins/tff_backend/migrations/_009_change_token_value.py | threefoldfoundation/app_backend | b3cea2a3ff9e10efcc90d3d6e5e8e46b9e84312a | [
"Apache-2.0"
] | 2 | 2018-01-10T10:43:12.000Z | 2018-03-18T10:42:23.000Z | # -*- coding: utf-8 -*-
# Copyright 2018 GIG Technology NV
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 41.818182 | 99 | 0.741304 |
d84e8dedf6a1d89cf0422633b7a822cc18fe04b8 | 1,837 | py | Python | external/argh/constants.py | richardseifert/Hydra_pipeline | a31d782219359bae7fa82fa9b081fb72bef69fce | [
"MIT"
] | 1 | 2017-11-04T15:08:42.000Z | 2017-11-04T15:08:42.000Z | pythonlib/argh/constants.py | Jumpscale/web | 8e8ec2ce01f3105c7647ee8a0c90af09311cbbeb | [
"Apache-2.0"
] | 1 | 2018-11-05T17:28:58.000Z | 2018-11-05T18:20:00.000Z | external/argh/constants.py | richardseifert/Hydra_pipeline | a31d782219359bae7fa82fa9b081fb72bef69fce | [
"MIT"
] | null | null | null | # coding: utf-8
#
# Copyright © 2010—2014 Andrey Mikhaylenko and contributors
#
# This file is part of Argh.
#
# Argh is free software under terms of the GNU Lesser
# General Public License version 3 (LGPLv3) as published by the Free
# Software Foundation. See the file README.rst for copying conditions.
#
import a... | 26.623188 | 78 | 0.744148 |
d8d5933e191e73ae6ffacbbeac6723f23153c295 | 475 | py | Python | GPIO/BeagleBone(dev)/python/script.py | DockerComposeFiles/ARM | b0faddb525ad134ff8c589c370d8e61ab030c216 | [
"MIT"
] | null | null | null | GPIO/BeagleBone(dev)/python/script.py | DockerComposeFiles/ARM | b0faddb525ad134ff8c589c370d8e61ab030c216 | [
"MIT"
] | null | null | null | GPIO/BeagleBone(dev)/python/script.py | DockerComposeFiles/ARM | b0faddb525ad134ff8c589c370d8e61ab030c216 | [
"MIT"
] | null | null | null | import os
import Adafruit_BBIO.GPIO as GPIO
from Adafruit_I2C import Adafruit_I2C
i2c = Adafruit_I2C(0x77)
# konfiguriere 2 - shared I2C PINS
GPIO.setup("P9_19", GPIO.IN)
GPIO.setup("P9_20", GPIO.IN)
# konfiguriere 2 - I2C PINS
GPIO.setup("P9_21", GPIO.IN)
GPIO.setup("P9_22", GPIO.IN)
GPIO.cleanup()
# Prüfen der G... | 19 | 37 | 0.724211 |
cfa8373221b225142d144da4d4f1d75ea1332fce | 5,251 | py | Python | utils/replay_buffer.py | yerfor/Soft-DRGN | 0c96d1ea295077b949229261c37d8dde25001a03 | [
"MIT"
] | 2 | 2022-02-24T08:21:49.000Z | 2022-03-10T08:57:35.000Z | utils/replay_buffer.py | yerfor/Soft-DRGN | 0c96d1ea295077b949229261c37d8dde25001a03 | [
"MIT"
] | 1 | 2022-02-24T08:40:21.000Z | 2022-02-24T12:01:58.000Z | utils/replay_buffer.py | yerfor/Soft-DRGN | 0c96d1ea295077b949229261c37d8dde25001a03 | [
"MIT"
] | null | null | null | import torch
import numpy as np
from utils.hparams import hparams
from utils.torch_utils import *
import logging
class ReplayBuffer:
def __init__(self):
self.capacity = int(hparams['buffer_capacity'])
self.current_idx = 0 # should be within [0, capacity-1]
self.num_stored_sample = 0 # ho... | 48.62037 | 119 | 0.539897 |
cfcf8f5e9bf267a25cf52c775bd46e3c55aec01a | 651 | py | Python | src/onegov/wtfs/forms/notification.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/wtfs/forms/notification.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/wtfs/forms/notification.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.form import Form
from onegov.wtfs import _
from wtforms import StringField
from wtforms import TextAreaField
from wtforms.validators import InputRequired
class NotificationForm(Form):
title = StringField(
label=_("Title"),
validators=[
InputRequired()
]
)
... | 21 | 44 | 0.619048 |
320b51e084c1c581fa8a80ca56d197a49d9e4efa | 848 | py | Python | data_builder.py | ottermegazord/nmt-graph | 7e2f73cd617fe262d984eb05f2157f7aebac8982 | [
"MIT"
] | null | null | null | data_builder.py | ottermegazord/nmt-graph | 7e2f73cd617fe262d984eb05f2157f7aebac8982 | [
"MIT"
] | null | null | null | data_builder.py | ottermegazord/nmt-graph | 7e2f73cd617fe262d984eb05f2157f7aebac8982 | [
"MIT"
] | null | null | null | import os
import numpy as np
import glob2
def txt_concatenator(DIR_PATH, OUTPUT_PATH):
"""
Joins all text files in a directory into one
:param DIR_PATH: Directory to text files
:param OUTPUT_PATH: Path to output file
:return:
"""
filenames = glob2.glob(DIR_PATH + '/' +'*.txt') # list of... | 24.228571 | 94 | 0.70283 |
320de317d9c71f483fca78a02c3e91582df6f5ca | 28,538 | py | Python | DHParser/configuration.py | jecki/DHParser | c6c1bd7db2de85b5997a3640242f4f444532304e | [
"Apache-2.0"
] | 2 | 2020-12-25T19:37:42.000Z | 2021-03-26T04:59:12.000Z | DHParser/configuration.py | jecki/DHParser | c6c1bd7db2de85b5997a3640242f4f444532304e | [
"Apache-2.0"
] | 6 | 2018-08-07T22:48:52.000Z | 2021-10-07T18:38:20.000Z | DHParser/configuration.py | jecki/DHParser | c6c1bd7db2de85b5997a3640242f4f444532304e | [
"Apache-2.0"
] | null | null | null | # configuration.py - default configuration values for DHParser
#
# Copyright 2016 by Eckhart Arnold (arnold@badw.de)
# Bavarian Academy of Sciences an Humanities (badw.de)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Licen... | 41.419448 | 102 | 0.663186 |
5cbf990b7739460152f81e93ddef06d934a5679b | 1,289 | py | Python | novel/swallows/not_the_swallows.py | East196/hello-py | a77c7a0c8e5e2b5e8cefaf0fda335ab0c3b1da21 | [
"Apache-2.0"
] | 1 | 2017-10-23T14:58:47.000Z | 2017-10-23T14:58:47.000Z | novel/swallows/not_the_swallows.py | East196/hello-py | a77c7a0c8e5e2b5e8cefaf0fda335ab0c3b1da21 | [
"Apache-2.0"
] | null | null | null | novel/swallows/not_the_swallows.py | East196/hello-py | a77c7a0c8e5e2b5e8cefaf0fda335ab0c3b1da21 | [
"Apache-2.0"
] | 1 | 2018-04-06T07:49:18.000Z | 2018-04-06T07:49:18.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Example of extending _The Swallows_ world to produce a different story.
#
import sys
# Example of using _The Swallows_ engine, but not its world,
# to produce a different story.
#
import sys
from os.path import realpath, dirname, join
# get the ../src/ directory on... | 21.847458 | 73 | 0.709853 |
7a34666f313752d01f7787beb2fb5ea92a6c81fe | 10,148 | py | Python | aemter/migrations/0001_initial.py | mribrgr/StuRa-Mitgliederdatenbank | 87a261d66c279ff86056e315b05e6966b79df9fa | [
"MIT"
] | 8 | 2019-11-26T13:34:46.000Z | 2021-06-21T13:41:57.000Z | src/aemter/migrations/0001_initial.py | Sumarbrander/Stura-Mitgliederdatenbank | 691dbd33683b2c2d408efe7a3eb28e083ebcd62a | [
"MIT"
] | 93 | 2019-12-16T09:29:10.000Z | 2021-04-24T12:03:33.000Z | src/aemter/migrations/0001_initial.py | Sumarbrander/Stura-Mitgliederdatenbank | 691dbd33683b2c2d408efe7a3eb28e083ebcd62a | [
"MIT"
] | 2 | 2020-12-03T12:43:19.000Z | 2020-12-22T21:48:47.000Z | # Generated by Django 3.0.8 on 2020-08-13 15:51
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import simple_history.models
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUT... | 54.55914 | 204 | 0.588096 |
8f44187ce47691525b0c3d712776bb753b25d07d | 147,138 | py | Python | pockint-master/utils.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 237 | 2019-04-25T07:15:07.000Z | 2022-02-16T23:23:38.000Z | pockint-master/utils.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 35 | 2019-05-29T11:35:06.000Z | 2021-06-02T00:41:36.000Z | pockint-master/utils.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 52 | 2019-05-30T15:18:53.000Z | 2021-12-21T11:07:28.000Z | #!/usr/bin/env python
import base64
import datetime
import dns.resolver
import IndicatorTypes
import json
import os
from OTXv2 import OTXv2
import re
import requests
import socket as sock
import shodan
import sqlite3
import sys
import tempfile
from urllib.parse import urlparse
import validators
impor... | 58.527446 | 142 | 0.560318 |
855d11a2a262982441ea352f306a7a06119202d1 | 580 | py | Python | brick/example/util.py | xsank/bottle | 4c228043ea31811fffd8eb30914d025c1fd43dc0 | [
"MIT"
] | 9 | 2015-01-06T01:32:43.000Z | 2017-03-01T18:34:54.000Z | brick/example/util.py | jude90/bottle | 4c228043ea31811fffd8eb30914d025c1fd43dc0 | [
"MIT"
] | null | null | null | brick/example/util.py | jude90/bottle | 4c228043ea31811fffd8eb30914d025c1fd43dc0 | [
"MIT"
] | 4 | 2015-02-05T09:48:43.000Z | 2016-02-22T15:04:35.000Z | import markdown
def load_page(name):
try:
body=open("pages/"+name+".md").read().decode("utf-8")
except:
body=u'Empty Page'
body_html=markdown.markdown(body).encode('utf-8')
return dict(name=name,body=body,body_html=body_html)
def load_words():
try:
words=open("pages/Index... | 23.2 | 61 | 0.606897 |
f10f4e362b1e4d20c6b331ae9b34c44ac4949868 | 344 | py | Python | exercises/pt/solution_02_05_01.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/pt/solution_02_05_01.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/pt/solution_02_05_01.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | from spacy.lang.en import English
nlp = English()
# Importe a classe Doc
from spacy.tokens import Doc
# Texto desejado: "spaCy is cool!"
words = ["spaCy", "is", "cool", "!"]
spaces = [True, True, False, False]
# Crie um Doc a partir das palavras words e o espaçamento spaces
doc = Doc(nlp.vocab, words=words, spaces=... | 22.933333 | 64 | 0.703488 |
3b5ad573e1441edb428a57daff9d6eca9b5cdea7 | 246 | py | Python | 96-unique-binary-search-trees/96-unique-binary-search-trees.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | 2 | 2021-12-05T14:29:06.000Z | 2022-01-01T05:46:13.000Z | 96-unique-binary-search-trees/96-unique-binary-search-trees.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | 96-unique-binary-search-trees/96-unique-binary-search-trees.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | class Solution:
def numTrees(self, n: int) -> int:
dp=[1,1]
for i in range(2, n+1):
result=0
for j in range(i):
result+=dp[j]*dp[i-j-1]
dp.append(result)
return dp[n] | 27.333333 | 39 | 0.443089 |
7975f151f7128228ddf4ab2a2af531021c7fb55b | 4,160 | py | Python | Marlin/src/HAL/LPC1768/upload_extra_script.py | tom-2273/Tronxy_SKR_mini_E3_V20 | bc4a8dc2c6c627e4bd7aa423794246f5b051448d | [
"CC0-1.0"
] | null | null | null | Marlin/src/HAL/LPC1768/upload_extra_script.py | tom-2273/Tronxy_SKR_mini_E3_V20 | bc4a8dc2c6c627e4bd7aa423794246f5b051448d | [
"CC0-1.0"
] | null | null | null | Marlin/src/HAL/LPC1768/upload_extra_script.py | tom-2273/Tronxy_SKR_mini_E3_V20 | bc4a8dc2c6c627e4bd7aa423794246f5b051448d | [
"CC0-1.0"
] | null | null | null | #
# upload_extra_script.py
# set the output_port
# if target_filename is found then that drive is used
# else if target_drive is found then that drive is used
#
from __future__ import print_function
import pioutil
if pioutil.is_pio_build():
target_filename = "FIRMWARE.CUR"
target_drive = "REARM"
import os,getpa... | 32.5 | 114 | 0.671394 |
797720614f58dec174b60f317b3b8f0fecaff4c6 | 1,957 | py | Python | Projects/simple/DomainSlice.py | BALAVIGNESHDOSTRIX/pyexpert | 300498f66a3a4f6b3060d51b3d6643d8e63cf746 | [
"CC0-1.0"
] | null | null | null | Projects/simple/DomainSlice.py | BALAVIGNESHDOSTRIX/pyexpert | 300498f66a3a4f6b3060d51b3d6643d8e63cf746 | [
"CC0-1.0"
] | null | null | null | Projects/simple/DomainSlice.py | BALAVIGNESHDOSTRIX/pyexpert | 300498f66a3a4f6b3060d51b3d6643d8e63cf746 | [
"CC0-1.0"
] | null | null | null | '''
DEVELOPER NAME: BALAVIGNESH.M
IMPLEMENTED DATE : 17-11-2018
ProjectName : DomainSlice
Project Scope Details:
This project is intresting to slice the user entered string to get the seprate information from
that string about the user
Implementati... | 35.581818 | 112 | 0.588656 |
6903c82fe7451803e1692c38f246122a64cc74a7 | 128 | py | Python | Python/Courses/Python-Tutorials.Telusko/00.Fundamentals/07.07-break-Statment.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Courses/Python-Tutorials.Telusko/00.Fundamentals/07.07-break-Statment.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Courses/Python-Tutorials.Telusko/00.Fundamentals/07.07-break-Statment.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | # Use of break statement inside the loop
for val in "string":
if val == "i":
break
print(val)
print("The end") | 16 | 40 | 0.59375 |
693f93fe17893e1328df2f74ca3b0b68267d15ae | 2,261 | py | Python | site/public/courses/CS-1.2/src/linked-list/whole_linked_list.py | KitsuneNoctus/makeschool | 5eec1a18146abf70bb78b4ee3d301f6a43c9ede4 | [
"MIT"
] | 1 | 2021-08-24T20:22:19.000Z | 2021-08-24T20:22:19.000Z | site/public/courses/CS-1.2/src/linked-list/whole_linked_list.py | KitsuneNoctus/makeschool | 5eec1a18146abf70bb78b4ee3d301f6a43c9ede4 | [
"MIT"
] | null | null | null | site/public/courses/CS-1.2/src/linked-list/whole_linked_list.py | KitsuneNoctus/makeschool | 5eec1a18146abf70bb78b4ee3d301f6a43c9ede4 | [
"MIT"
] | null | null | null | class Node:
def __init__(self,initdata):
self.data = initdata # Data part
self.next = None # Address part
def getData(self): # getter method
return self.data
def getNext(self): # getter method
return self.next
def setData(self,newdata): # setter method
... | 22.386139 | 48 | 0.533835 |
695310675dc6e6f2567143461fd9a8a59f480570 | 420 | py | Python | crawlab/spiders/spiders/pipelines.py | anhilo/crawlab | 363f4bf7a4ccc192a99850998c1bd0fc363832a1 | [
"BSD-3-Clause"
] | 1 | 2019-08-20T14:26:39.000Z | 2019-08-20T14:26:39.000Z | crawlab/spiders/spiders/pipelines.py | anhilo/crawlab | 363f4bf7a4ccc192a99850998c1bd0fc363832a1 | [
"BSD-3-Clause"
] | null | null | null | crawlab/spiders/spiders/pipelines.py | anhilo/crawlab | 363f4bf7a4ccc192a99850998c1bd0fc363832a1 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: https://doc.scrapy.org/en/latest/topics/item-pipeline.html
from spiders.db import db, col_name, task_id
class SpidersPipeline(object):
col = db[col_name]
def process_item(self... | 23.333333 | 65 | 0.683333 |
d68e179b8a9fe39274378f41529a19cd083d585c | 266 | py | Python | python/decorator/return_from_decorator.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/decorator/return_from_decorator.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/decorator/return_from_decorator.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | def my_decorator(func):
def wrapper(*args, **kwargs):
print(f'in: {func.__name__}')
return func(*args, **kwargs)
return wrapper
@my_decorator
def doubled(number):
return number * 2
# Introspect
print(doubled.__name__)
print(doubled(10)) | 20.461538 | 37 | 0.665414 |
d6e2afad0477487364e61583f8b9ea2442f614ce | 4,095 | py | Python | parse_stats.py | elmoee/wazuh-agent-docker | 97ea0e3c7c36bfcfd531d2e056f6923f09b784e6 | [
"MIT"
] | 1 | 2022-03-30T13:56:59.000Z | 2022-03-30T13:56:59.000Z | parse_stats.py | elmoee/wazuh-agent-docker | 97ea0e3c7c36bfcfd531d2e056f6923f09b784e6 | [
"MIT"
] | null | null | null | parse_stats.py | elmoee/wazuh-agent-docker | 97ea0e3c7c36bfcfd531d2e056f6923f09b784e6 | [
"MIT"
] | null | null | null | import sys
import csv
import os
from enum import Enum
BASE_DIR = os.path.abspath(os.path.dirname(__file__))
# row indexes
class Stat(Enum):
def __init__(self, value, index):
self._value_ = value
self.index = index
CMD = ("cmd", 0)
PERC_CPU = ("%cpu", 1)
PERC_MEM = (... | 29.890511 | 120 | 0.537241 |
babcab88ecf7ac315da4cb3d82a72f2b3f369dfd | 999 | py | Python | 1_DeepLearning-Basics/02_NeuralNetwork_Basics_1/4-Gradientenabstiegsverfahren_in_TF.py | felixdittrich92/DeepLearning-tensorflow-keras | 2880d8ed28ba87f28851affa92b6fa99d2e47be9 | [
"Apache-2.0"
] | null | null | null | 1_DeepLearning-Basics/02_NeuralNetwork_Basics_1/4-Gradientenabstiegsverfahren_in_TF.py | felixdittrich92/DeepLearning-tensorflow-keras | 2880d8ed28ba87f28851affa92b6fa99d2e47be9 | [
"Apache-2.0"
] | null | null | null | 1_DeepLearning-Basics/02_NeuralNetwork_Basics_1/4-Gradientenabstiegsverfahren_in_TF.py | felixdittrich92/DeepLearning-tensorflow-keras | 2880d8ed28ba87f28851affa92b6fa99d2e47be9 | [
"Apache-2.0"
] | null | null | null | import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
from helper import *
class Model:
def __init__(self):
self.x = tf.Variable(tf.random.uniform(shape=[2], minval=-2.0, maxval=2.0)) # x = [x0, x1]
self.learning_rate = 0.001 # eta
self.optimizer = tf.optimizers.SGD(le... | 33.3 | 114 | 0.652653 |
30413becf73f26d1441bc7899f41c5dc5c608f6c | 2,778 | py | Python | accounts/views.py | JanakiRaman-2002/Arre-yaar | c0b44ca1f8884a09116241dcd0bf7cfcee3b785d | [
"Apache-2.0"
] | null | null | null | accounts/views.py | JanakiRaman-2002/Arre-yaar | c0b44ca1f8884a09116241dcd0bf7cfcee3b785d | [
"Apache-2.0"
] | null | null | null | accounts/views.py | JanakiRaman-2002/Arre-yaar | c0b44ca1f8884a09116241dcd0bf7cfcee3b785d | [
"Apache-2.0"
] | null | null | null | from django.contrib.auth.models import User
from django.http.response import HttpResponse, HttpResponseRedirect
from django.shortcuts import redirect, render
from django.urls import reverse_lazy
from django.contrib.auth import login as auth_login,logout,authenticate
from django.urls.base import reverse
from .models imp... | 26.207547 | 93 | 0.576314 |
0681b370e336771d73b2ef3a937c54d3805ccec8 | 3,563 | py | Python | apps/util/templatetags/bootstrap_form.py | LvanArkel/sbzwebsite | a26efbb050585312c53010f14f86c23616a8071f | [
"BSD-3-Clause"
] | 1 | 2017-01-08T13:21:43.000Z | 2017-01-08T13:21:43.000Z | apps/util/templatetags/bootstrap_form.py | LvanArkel/sbzwebsite | a26efbb050585312c53010f14f86c23616a8071f | [
"BSD-3-Clause"
] | 17 | 2018-12-03T14:22:14.000Z | 2021-07-14T15:15:12.000Z | apps/util/templatetags/bootstrap_form.py | LvanArkel/sbzwebsite | a26efbb050585312c53010f14f86c23616a8071f | [
"BSD-3-Clause"
] | 2 | 2018-12-03T14:58:49.000Z | 2019-12-01T13:24:42.000Z | from django import template
from django.forms import fields, ModelMultipleChoiceField, ModelChoiceField, BoundField, widgets
from django.template.loader import render_to_string
from django.urls import reverse
from django.utils.safestring import mark_safe
register = template.Library()
@register.filter
def bootstrap_f... | 35.277228 | 96 | 0.712321 |
069afd0e4cec742ef168d090c58ea61e1a75a929 | 275 | py | Python | python/python_backup/PRAC_PYTHON/ab27.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/python_backup/PRAC_PYTHON/ab27.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/python_backup/PRAC_PYTHON/ab27.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | # input a string and print each word reverse order
s=input("enter string:")
w=""
s=s+" "
for i in range(0,len(s),1):
if s[i]==' ':
for j in range(len(w)-1, -1,-1):
print w[j]," ",
w=""
else:
w=w+s[i]
| 19.642857 | 51 | 0.418182 |
06a29648ec04f6b15347a592fdbc5abfdb760198 | 6,350 | py | Python | tests/onegov/gazette/test_layout.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/gazette/test_layout.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/gazette/test_layout.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from datetime import date
from datetime import datetime
from freezegun import freeze_time
from onegov.gazette.layout import Layout
from onegov.gazette.models import Issue
from onegov.gazette.models import GazetteNotice
from pytest import raises
from sedate import standardize_date
class DummyPrincipal(object):
def... | 33.597884 | 79 | 0.622047 |
9d8ad993e5bc37bfe94d1bf1e1eb4b1b572be0c5 | 5,560 | py | Python | Models/trainingTemplateTF/util/util.py | guillaumedescoteauxisabelle/compai | b1f4c0c7c1995233461dd3a3a73c6f6bafbf98f2 | [
"Apache-2.0"
] | null | null | null | Models/trainingTemplateTF/util/util.py | guillaumedescoteauxisabelle/compai | b1f4c0c7c1995233461dd3a3a73c6f6bafbf98f2 | [
"Apache-2.0"
] | null | null | null | Models/trainingTemplateTF/util/util.py | guillaumedescoteauxisabelle/compai | b1f4c0c7c1995233461dd3a3a73c6f6bafbf98f2 | [
"Apache-2.0"
] | 1 | 2020-01-07T17:57:57.000Z | 2020-01-07T17:57:57.000Z | # Copyright (c) 2019 Foundry.
#
# 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,... | 41.492537 | 111 | 0.654856 |
9dcd74972b1e4ea8ab9a4eb714756c07bbc3d5d0 | 2,353 | py | Python | Packs/PhishLabs/Scripts/PhishLabsPopulateIndicators/PhishLabsPopulateIndicators_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/PhishLabs/Scripts/PhishLabsPopulateIndicators/PhishLabsPopulateIndicators_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/PhishLabs/Scripts/PhishLabsPopulateIndicators/PhishLabsPopulateIndicators_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import json
def test_indicator_type_and_value_finder_email_recognition():
from PhishLabsPopulateIndicators import indicator_type_and_value_finder
indicator_data_1 = {
'value': 'email@email.com',
'type': "Sender"
}
indicator_type_1, indicator_value_1 = indicator_type_and_value_finder(i... | 36.2 | 91 | 0.556311 |
ae81bd2fe7209208196ab7977ecafdb1a2b2f9b0 | 1,998 | py | Python | plugins/tff_backend/bizz/installations.py | threefoldfoundation/app_backend | b3cea2a3ff9e10efcc90d3d6e5e8e46b9e84312a | [
"Apache-2.0"
] | null | null | null | plugins/tff_backend/bizz/installations.py | threefoldfoundation/app_backend | b3cea2a3ff9e10efcc90d3d6e5e8e46b9e84312a | [
"Apache-2.0"
] | 178 | 2017-08-02T12:58:06.000Z | 2017-12-20T15:01:12.000Z | plugins/tff_backend/bizz/installations.py | threefoldfoundation/app_backend | b3cea2a3ff9e10efcc90d3d6e5e8e46b9e84312a | [
"Apache-2.0"
] | 2 | 2018-01-10T10:43:12.000Z | 2018-03-18T10:42:23.000Z | # -*- coding: utf-8 -*-
# Copyright 2018 GIG Technology NV
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 39.176471 | 114 | 0.759259 |
ae9b47241cede6b3d6b7a1e1eb04127fdabfab69 | 3,922 | py | Python | DataProcess/my_paper/analysis.py | ZhangQiHang-98/RFID_Scirpt | 0f74087add4cf16e2d201ad4f31cc1abd287db7e | [
"MIT"
] | 3 | 2021-12-24T04:52:03.000Z | 2021-12-27T02:14:49.000Z | DataProcess/my_paper/analysis.py | ZhangQiHang-98/RFID_Scirpt | 0f74087add4cf16e2d201ad4f31cc1abd287db7e | [
"MIT"
] | null | null | null | DataProcess/my_paper/analysis.py | ZhangQiHang-98/RFID_Scirpt | 0f74087add4cf16e2d201ad4f31cc1abd287db7e | [
"MIT"
] | null | null | null | # !/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
@Project :DataProcess
@File :analysis.py
@Author :Zhang Qihang
@Description: 对数据进行分析
@Date :2021/12/13 14:48
"""
import aug_utils
from filters import *
from reproduce_gyro import *
from aug_utils import *
from my_augment import *
from os import lis... | 33.237288 | 104 | 0.609893 |
8852bc10e44ee745a47e7582fd202098a2ba351e | 630 | py | Python | setup.py | josefmtd/usgs-quake | 10c6573b5e63bd20294dce29aafbbf27b07096e6 | [
"MIT"
] | null | null | null | setup.py | josefmtd/usgs-quake | 10c6573b5e63bd20294dce29aafbbf27b07096e6 | [
"MIT"
] | null | null | null | setup.py | josefmtd/usgs-quake | 10c6573b5e63bd20294dce29aafbbf27b07096e6 | [
"MIT"
] | null | null | null | from setuptools import setup
setup(name = 'usgs_quake',
author = 'Josef Matondang',
author_email = 'admin@josefmtd.com',
version = '1.0.2',
description = 'USGS Earthquake Real-time Feed and Historical Data',
classifiers = [
'Development Status :: 4 - Beta',
'License :: OSI Approved ... | 28.636364 | 71 | 0.607937 |
4e5d9ecc31bce5b65ad57d3147ad13618618f5e1 | 19,924 | py | Python | novel/swallows/story/characters.py | East196/hello-py | a77c7a0c8e5e2b5e8cefaf0fda335ab0c3b1da21 | [
"Apache-2.0"
] | 1 | 2017-10-23T14:58:47.000Z | 2017-10-23T14:58:47.000Z | novel/swallows/story/characters.py | East196/hello-py | a77c7a0c8e5e2b5e8cefaf0fda335ab0c3b1da21 | [
"Apache-2.0"
] | null | null | null | novel/swallows/story/characters.py | East196/hello-py | a77c7a0c8e5e2b5e8cefaf0fda335ab0c3b1da21 | [
"Apache-2.0"
] | 1 | 2018-04-06T07:49:18.000Z | 2018-04-06T07:49:18.000Z | # coding=utf-8
import random
from novel.swallows import (
Animate, ProperMixin, MasculineMixin, FeminineMixin,
Topic,
GreetTopic, SpeechTopic, QuestionTopic,
Belief, ItemLocation, Goal,
)
# 各种点子...
# 他们可以隐藏的东西,然后看到其他携带它,然后检查
# 它仍然是隐藏的,而感到惊讶,它不再有。
# “你好,爱丽丝,”鲍伯说。“你好,鲍伯,”爱丽丝回答。永远不会变老
# 他们应该总是尖叫看见尸体时。尖... | 38.990215 | 97 | 0.472847 |
14f750b0eb9911ba74b9a0941e09572f84f5a599 | 1,260 | py | Python | pykasso/cli.py | pekh/pykasso | 86ece737d62ce28aef00805a19a789714e788453 | [
"MIT"
] | null | null | null | pykasso/cli.py | pekh/pykasso | 86ece737d62ce28aef00805a19a789714e788453 | [
"MIT"
] | null | null | null | pykasso/cli.py | pekh/pykasso | 86ece737d62ce28aef00805a19a789714e788453 | [
"MIT"
] | null | null | null |
import csv
import os.path
from typing import List
import click
from .abrechnung import abrechnungen_aus_transaktionen
from .pdf_abrechnung import PDFAbrechnung
DEFAULT_AUSGABEVERZEICHNIS = 'pdfs/'
def schreibe_in_ausgabeverzeichnis(ausgabeverzeichnis: str, pdf_abrechnungen: List[PDFAbrechnung]):
for abrechnu... | 32.307692 | 99 | 0.756349 |
e9023c04fda55cccfb0d4305a3f1115ba595ec26 | 9,864 | py | Python | Project2/main.py | veronikadim99/Wissenschaftliches-Rechnen | 3b7c86e9488bf434f3ad1d590f5b9bb9b4cdf218 | [
"Apache-2.0"
] | null | null | null | Project2/main.py | veronikadim99/Wissenschaftliches-Rechnen | 3b7c86e9488bf434f3ad1d590f5b9bb9b4cdf218 | [
"Apache-2.0"
] | null | null | null | Project2/main.py | veronikadim99/Wissenschaftliches-Rechnen | 3b7c86e9488bf434f3ad1d590f5b9bb9b4cdf218 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import tomograph
def gaussian_elimination(A: np.ndarray, b: np.ndarray, use_pivoting: bool = True) -> (np.ndarray, np.ndarray):
"""
Gaussian Elimination of Ax=b with or without pivoting without use of numpy.linalg
Arguments:
A : matrix, representing left side of equation system of ... | 31.514377 | 129 | 0.56762 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.