hexsha stringlengths 40 40 | size int64 6 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | 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 247 | max_issues_repo_name stringlengths 4 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | 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 247 | max_forks_repo_name stringlengths 4 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.04M | avg_line_length float64 1.53 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 6 1.04M | filtered:remove_non_ascii int64 0 538k | filtered:remove_decorators int64 0 917k | filtered:remove_async int64 0 722k | filtered:remove_classes int64 -45 1M | filtered:remove_generators int64 0 814k | filtered:remove_function_no_docstring int64 -102 850k | filtered:remove_class_no_docstring int64 -3 5.46k | filtered:remove_unused_imports int64 -1,350 52.4k | filtered:remove_delete_markers int64 0 59.6k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
e134eca658f6b3c6715f2461726f071c23915ead | 773 | py | Python | dashboard/admin.py | avisionx/fms-portal-iiitd | 1b78112dc0fb92ab8c53512fd76d14f5ea06b587 | [
"MIT"
] | null | null | null | dashboard/admin.py | avisionx/fms-portal-iiitd | 1b78112dc0fb92ab8c53512fd76d14f5ea06b587 | [
"MIT"
] | 1 | 2021-05-29T06:13:21.000Z | 2021-05-29T06:13:21.000Z | dashboard/admin.py | avisionx/fms-portal-iiitd | 1b78112dc0fb92ab8c53512fd76d14f5ea06b587 | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Complaint, Notification
admin.site.register(Notification, NotifAdmin)
admin.site.register(Complaint, ComplaintAdmin)
| 20.342105 | 72 | 0.61837 | from django.contrib import admin
from .models import Complaint, Notification
class ComplaintAdmin(admin.ModelAdmin):
model = Complaint
verbose_name_plural = 'Complaints'
list_display = (
'complaint_id',
'customer',
'category',
'location',
'created_at',
'act... | 0 | 0 | 0 | 552 | 0 | 0 | 0 | 0 | 46 |
4477e3642a343862afd32bfdb254fdd48f6d7b21 | 1,641 | py | Python | binaries/setup.py | meryacine/shaka-streamer | 7b7e90143f531c52d96c162cc7393862db0830b7 | [
"Apache-2.0"
] | 154 | 2019-08-29T16:53:24.000Z | 2022-02-25T00:29:56.000Z | binaries/setup.py | meryacine/shaka-streamer | 7b7e90143f531c52d96c162cc7393862db0830b7 | [
"Apache-2.0"
] | 101 | 2019-08-30T17:34:51.000Z | 2022-03-02T18:46:22.000Z | binaries/setup.py | meryacine/shaka-streamer | 7b7e90143f531c52d96c162cc7393862db0830b7 | [
"Apache-2.0"
] | 56 | 2019-09-08T17:47:22.000Z | 2022-02-23T17:35:11.000Z | # Copyright 2021 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 36.466667 | 88 | 0.728215 | # Copyright 2021 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
bab48fc4bbab67505fa893b469125721ab5426d4 | 9,047 | py | Python | tests/preprocess/task.py | jarokaz/nvidia-merlin-on-vertex | f40fe997108395a310b9a9ec4d97110967d725ac | [
"Apache-2.0"
] | 1 | 2021-11-16T13:11:38.000Z | 2021-11-16T13:11:38.000Z | tests/preprocess/task.py | jarokaz/nvidia-merlin-on-vertex | f40fe997108395a310b9a9ec4d97110967d725ac | [
"Apache-2.0"
] | null | null | null | tests/preprocess/task.py | jarokaz/nvidia-merlin-on-vertex | f40fe997108395a310b9a9ec4d97110967d725ac | [
"Apache-2.0"
] | 1 | 2021-11-16T13:11:41.000Z | 2021-11-16T13:11:41.000Z | import argparse
import logging
import os
import sys
import time
from dask.distributed import Client
from dask_cuda import LocalCUDACluster
import fsspec
import nvtabular as nvt
from nvtabular.io.shuffle import Shuffle
from nvtabular.ops import Categorify
from nvtabular.ops import Clip
from nvtabular.ops import FillMis... | 25.922636 | 80 | 0.623522 | import argparse
import logging
import os
import sys
import time
from dask.distributed import Client
from dask_cuda import LocalCUDACluster
import fsspec
import nvtabular as nvt
from nvtabular.io.shuffle import Shuffle
from nvtabular.ops import Categorify
from nvtabular.ops import Clip
from nvtabular.ops import FillMis... | 0 | 0 | 0 | 0 | 0 | 1,796 | 0 | 6 | 66 |
737f31f4d982127703765a37410e7fd674578fdd | 20,144 | py | Python | pipopipette.py | itskatt/pipopipette | a39ecc1997f1a64a5539c4642b1197e9f719ba1c | [
"MIT"
] | null | null | null | pipopipette.py | itskatt/pipopipette | a39ecc1997f1a64a5539c4642b1197e9f719ba1c | [
"MIT"
] | null | null | null | pipopipette.py | itskatt/pipopipette | a39ecc1997f1a64a5539c4642b1197e9f719ba1c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Fri Mar 19 10:23:29 2021
@author: caldwell
"""
# from pprint import pprint
## --- Paramtres de jeu ------------------------------
# si on joue contre l'IA (True) ou JvJ (False)
MODE_IA = True
# la taille de la grille de jeu (largeur, hauteur)
TAILLE_GRILLE = (3, 2)
# la taill... | 33.022951 | 99 | 0.548203 | # -*- coding: utf-8 -*-
"""
Created on Fri Mar 19 10:23:29 2021
@author: caldwell ©
"""
import pygame as pg
from random import choice
# from pprint import pprint
## --- Paramètres de jeu ------------------------------
# si on joue contre l'IA (True) ou JvJ (False)
MODE_IA = True
# la taille de la grille de jeu (lar... | 106 | 0 | 0 | 19,111 | 0 | 0 | 0 | 2 | 91 |
18bdb26f9ceaedbf555e6c644de7130ee2b447ae | 1,800 | py | Python | examples/tilechain_coals.py | pauljones0/lifxlan | 292cdbbe3515da4b40cf348d91b7a1480832fff9 | [
"MIT"
] | 464 | 2015-07-08T11:44:12.000Z | 2022-03-22T04:18:19.000Z | examples/tilechain_coals.py | pauljones0/lifxlan | 292cdbbe3515da4b40cf348d91b7a1480832fff9 | [
"MIT"
] | 147 | 2015-07-08T15:33:32.000Z | 2022-02-14T17:46:38.000Z | examples/tilechain_coals.py | pauljones0/lifxlan | 292cdbbe3515da4b40cf348d91b7a1480832fff9 | [
"MIT"
] | 134 | 2015-09-25T12:20:26.000Z | 2022-03-23T08:33:11.000Z |
if __name__=="__main__":
main()
| 36.734694 | 133 | 0.582222 | from lifxlan import *
from random import randint, betavariate
from time import sleep
def main():
lan = LifxLAN()
tilechain_lights = lan.get_tilechain_lights()
if len(tilechain_lights) != 0:
t = lan.get_tilechain_lights()[0] #grab the first tilechain
print("Selected TileChain light: {}".form... | 0 | 0 | 0 | 0 | 0 | 1,632 | 0 | 19 | 112 |
5177877a677eab63ecd6710fa86ccb89f8ec69d7 | 23,158 | py | Python | webroot/cgi-bin/gameslist.py | elocemearg/atropine | 894010bcc89d4e6962cf3fc15ef526068c38898d | [
"CC-BY-4.0"
] | null | null | null | webroot/cgi-bin/gameslist.py | elocemearg/atropine | 894010bcc89d4e6962cf3fc15ef526068c38898d | [
"CC-BY-4.0"
] | null | null | null | webroot/cgi-bin/gameslist.py | elocemearg/atropine | 894010bcc89d4e6962cf3fc15ef526068c38898d | [
"CC-BY-4.0"
] | null | null | null | #!/usr/bin/python3
import sys;
import cgicommon;
import urllib.request, urllib.parse, urllib.error;
import cgi;
import cgitb;
import os;
import re;
CONFLICT_STRATEGY_FORCE = 0
CONFLICT_STRATEGY_DO_NOT_EMBLANKIFY = 1
CONFLICT_STRATEGY_ONLY_FILL_BLANKS = 2
CONFLICT_STRATEGY_DISCARD = 3
cgitb.enable();
cgicommon.writ... | 47.748454 | 310 | 0.60912 | #!/usr/bin/python3
import sys;
import cgicommon;
import urllib.request, urllib.parse, urllib.error;
import cgi;
import cgitb;
import os;
import re;
import random;
CONFLICT_STRATEGY_FORCE = 0
CONFLICT_STRATEGY_DO_NOT_EMBLANKIFY = 1
CONFLICT_STRATEGY_ONLY_FILL_BLANKS = 2
CONFLICT_STRATEGY_DISCARD = 3
def int_or_none(s... | 0 | 0 | 0 | 0 | 0 | 10,371 | 0 | -8 | 138 |
c68efaf3e88073a6ef86b995eddf8209d73c8cc2 | 5,329 | py | Python | syzoj_tools/__init__.py | syzoj/syzoj-tools | ade6a4e05422894881b242e517933843fab71756 | [
"MIT"
] | 34 | 2018-11-04T16:11:11.000Z | 2022-01-26T15:09:39.000Z | syzoj_tools/__init__.py | syzoj/syzoj-tools | ade6a4e05422894881b242e517933843fab71756 | [
"MIT"
] | 6 | 2018-11-04T15:58:29.000Z | 2019-07-03T06:58:48.000Z | syzoj_tools/__init__.py | syzoj/syzoj-tools | ade6a4e05422894881b242e517933843fab71756 | [
"MIT"
] | 6 | 2018-12-01T05:45:31.000Z | 2020-01-08T08:06:44.000Z | #!/usr/bin/python3
| 41.310078 | 160 | 0.682867 | #!/usr/bin/python3
import argparse
import logging
from .problem import Problem
from .contest import Contest
def main():
parser = argparse.ArgumentParser(prog="syzoj")
subparser = parser.add_subparsers(dest="subcommands")
parser.add_argument("--path", dest="path", default=".")
parser.add_argument('-v', ... | 0 | 0 | 0 | 0 | 0 | 5,002 | 0 | 1 | 307 |
beb60eaaf0df87866ceb9d7435941b848c78cc78 | 512 | py | Python | .archive/projectlib/common/number/functional.py | abhmul/projects-repo | 6d3a8110ce69219e769e0e56d14fbe394f6389c6 | [
"MIT"
] | null | null | null | .archive/projectlib/common/number/functional.py | abhmul/projects-repo | 6d3a8110ce69219e769e0e56d14fbe394f6389c6 | [
"MIT"
] | null | null | null | .archive/projectlib/common/number/functional.py | abhmul/projects-repo | 6d3a8110ce69219e769e0e56d14fbe394f6389c6 | [
"MIT"
] | null | null | null | import itertools
flatten_iter = itertools.chain.from_iterable
# https://stackoverflow.com/a/6909532/5538273
| 20.48 | 92 | 0.673828 | import math
import itertools
from collections import defaultdict
flatten_iter = itertools.chain.from_iterable
# https://stackoverflow.com/a/6909532/5538273
def factors(n):
return set(flatten_iter((i, n//i) for i in range(1, int(math.sqrt(n)+1)) if n % i == 0))
def binary(x, padding=0):
return format(x, f"0... | 0 | 0 | 0 | 0 | 0 | 260 | 0 | 4 | 135 |
d82f7ebd4c8e0f662bc9dace46a30fecf0fddce5 | 1,616 | py | Python | ex_03_session_object.py | albertgreinoecker/python-flask-examples | 86cd4dd214241910c20fcd21550aaea2fd9eb0b5 | [
"Apache-2.0"
] | null | null | null | ex_03_session_object.py | albertgreinoecker/python-flask-examples | 86cd4dd214241910c20fcd21550aaea2fd9eb0b5 | [
"Apache-2.0"
] | null | null | null | ex_03_session_object.py | albertgreinoecker/python-flask-examples | 86cd4dd214241910c20fcd21550aaea2fd9eb0b5 | [
"Apache-2.0"
] | null | null | null | from flask import Flask
from flask_session import Session # new style
'''
Mchte man z.B.: Objekte in der Session speichern, gibt es bei der normalen Verwendung ein Problem,
weil Flask die Session Info als JSON-String (verschlsselt!) in einem Cookie speichert.
Es gbe die Mglichkeit, das Schreiben als JSON selbst zu ... | 36.727273 | 155 | 0.689356 | from flask import Flask, render_template, session, jsonify
from flask_session import Session # new style
'''
Möchte man z.B.: Objekte in der Session speichern, gibt es bei der normalen Verwendung ein Problem,
weil Flask die Session Info als JSON-String (verschlüsselt!) in einem Cookie speichert.
Es gäbe die Möglich... | 10 | 556 | 0 | 164 | 0 | 0 | 0 | 35 | 46 |
281a66a4818f868ede0abdbd047f61165264375d | 8,172 | py | Python | cvxpy_tinoco/constraints.py | EnjoyLifeFund/macHighSierra-py36-pkgs | 5668b5785296b314ea1321057420bcd077dba9ea | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | null | null | null | cvxpy_tinoco/constraints.py | EnjoyLifeFund/macHighSierra-py36-pkgs | 5668b5785296b314ea1321057420bcd077dba9ea | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | null | null | null | cvxpy_tinoco/constraints.py | EnjoyLifeFund/macHighSierra-py36-pkgs | 5668b5785296b314ea1321057420bcd077dba9ea | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | null | null | null | #***********************************************************************#
# Copyright (C) 2010-2012 Tomas Tinoco De Rubira #
# #
# This file is part of CVXPY #
# ... | 33.768595 | 78 | 0.488253 | #***********************************************************************#
# Copyright (C) 2010-2012 Tomas Tinoco De Rubira #
# #
# This file is part of CVXPY #
# ... | 0 | 0 | 0 | 3,993 | 0 | 0 | 0 | 5 | 88 |
ae705d599832a8e29581cd28be7198a946fe8002 | 5,141 | py | Python | TestCaseCodes/Saadat/OLDVersion/RecomendWeb.py | Dieuzu/SDGP-Nullpoint-G22 | 1080e1c77dddb59057de1ea9bccd97ec987ae202 | [
"MIT"
] | null | null | null | TestCaseCodes/Saadat/OLDVersion/RecomendWeb.py | Dieuzu/SDGP-Nullpoint-G22 | 1080e1c77dddb59057de1ea9bccd97ec987ae202 | [
"MIT"
] | null | null | null | TestCaseCodes/Saadat/OLDVersion/RecomendWeb.py | Dieuzu/SDGP-Nullpoint-G22 | 1080e1c77dddb59057de1ea9bccd97ec987ae202 | [
"MIT"
] | null | null | null | # write-html.py
if __name__ == "__main__":
main() | 51.41 | 229 | 0.541723 | # write-html.py
import webbrowser
def main():
f = open('4_RefferenceResultGen\TestFolder\TaskResults.html','a')
r = open('4_RefferenceResultGen\TestFolder\Refined_Links.txt','r')
P1 = """<!DOCTYPE html>
<html style="font-size: 16px;">
<head>
<meta ... | 0 | 0 | 0 | 0 | 0 | 5,036 | 0 | -4 | 45 |
48846ea3e6c8c54699820da1a89594fc5a229ad0 | 6,852 | py | Python | third_party/tlslite/tlslite/integration/clienthelper.py | Acidburn0zzz/chromium-1 | 4c08f442d2588a2c7cfaa117a55bd87d2ac32f9a | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | third_party/tlslite/tlslite/integration/clienthelper.py | Acidburn0zzz/chromium-1 | 4c08f442d2588a2c7cfaa117a55bd87d2ac32f9a | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | third_party/tlslite/tlslite/integration/clienthelper.py | Acidburn0zzz/chromium-1 | 4c08f442d2588a2c7cfaa117a55bd87d2ac32f9a | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | """
A helper class for using TLS Lite with stdlib clients
(httplib, xmlrpclib, imaplib, poplib).
"""
| 41.780488 | 76 | 0.619527 | """
A helper class for using TLS Lite with stdlib clients
(httplib, xmlrpclib, imaplib, poplib).
"""
from tlslite.checker import Checker
class ClientHelper:
"""This is a helper class used to integrate TLS Lite with various
TLS clients (e.g. poplib, smtplib, httplib, etc.)"""
def __init__(self,
... | 0 | 0 | 0 | 6,691 | 0 | 0 | 0 | 14 | 46 |
8e9db4c6e20bbfa8232bbeefe8a9e0178b83da57 | 161 | py | Python | 050_Soma_dos_pares.py | fabioeomedeiros/Python-Base | ef9c1c66b3221f71d1c8dcaf4c2f86503712e9f1 | [
"MIT"
] | null | null | null | 050_Soma_dos_pares.py | fabioeomedeiros/Python-Base | ef9c1c66b3221f71d1c8dcaf4c2f86503712e9f1 | [
"MIT"
] | null | null | null | 050_Soma_dos_pares.py | fabioeomedeiros/Python-Base | ef9c1c66b3221f71d1c8dcaf4c2f86503712e9f1 | [
"MIT"
] | null | null | null | #050_Soma_dos_pares.py
soma = 0
for c in range(1, 6):
num = int(input(f"{c} Nmero: "))
if (num % 2 == 0):
soma += num
print (f"Soma = {soma}") | 20.125 | 38 | 0.534161 | #050_Soma_dos_pares.py
soma = 0
for c in range(1, 6):
num = int(input(f"{c}º Número: "))
if (num % 2 == 0):
soma += num
print (f"Soma = {soma}") | 4 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
01fa47b5572e9be6d9fb493eb70734e1c33edeab | 22,313 | py | Python | libs/csvfile.py | hokaze123/ChartViewer | f9ee0ca5c23ad36dfe780fa573eed1d43c93f11b | [
"MIT"
] | 3 | 2020-09-13T10:51:58.000Z | 2021-06-09T10:07:01.000Z | libs/csvfile.py | Lihao2017-11-15/ChartViewer | 7295ee462ab4a25d585210bad4568f8685b0ee61 | [
"MIT"
] | null | null | null | libs/csvfile.py | Lihao2017-11-15/ChartViewer | 7295ee462ab4a25d585210bad4568f8685b0ee61 | [
"MIT"
] | 1 | 2020-09-13T10:48:09.000Z | 2020-09-13T10:48:09.000Z | import logging
logger = logging.getLogger()
| 36.942053 | 120 | 0.558105 | import re
import math
from .datetime_string import to_seconds, to_timedelta
import logging
import os
logger = logging.getLogger()
class CSVFile:
indexes = {}
columns = []
headers_dict = {}
file_name = ''
@staticmethod
def read_rows_from_file(source_file_name):
rows = []
try:
... | 0 | 8,659 | 0 | 13,451 | 0 | 0 | 0 | -2 | 157 |
fa62c70a7a9c4ffda7faccbae1d471d4594d9dce | 22,791 | py | Python | tools/visual_utils/visualize_utils.py | ElectronicElephant/OpenPCDet-PX-fork | 7f5f792c38d1052c550e34bd7acc085bc4bebc4f | [
"Apache-2.0"
] | 1 | 2021-07-12T07:07:40.000Z | 2021-07-12T07:07:40.000Z | tools/visual_utils/visualize_utils.py | ElectronicElephant/OpenPCDet-PX-fork | 7f5f792c38d1052c550e34bd7acc085bc4bebc4f | [
"Apache-2.0"
] | null | null | null | tools/visual_utils/visualize_utils.py | ElectronicElephant/OpenPCDet-PX-fork | 7f5f792c38d1052c550e34bd7acc085bc4bebc4f | [
"Apache-2.0"
] | 1 | 2021-06-30T08:54:25.000Z | 2021-06-30T08:54:25.000Z | import mayavi.mlab as mlab
import numpy as np
import torch
box_colormap = [
[1, 1, 1],
[0, 1, 0],
[0, 1, 1],
[1, 1, 0],
]
label_dict = {0:"background", 1:"Car", 2:"Ped", 3:"Cycler", 4:"Truck"}
color_dict = {"0":[255, 255, 255], "1":[255, 255, 0], "2":[51, 153, 255], "3":[255, 0, 255], "4":[0, 0, 0]}
... | 43.66092 | 184 | 0.555263 | import mayavi.mlab as mlab
import numpy as np
import torch
import cv2
import matplotlib.pyplot as plt
box_colormap = [
[1, 1, 1],
[0, 1, 0],
[0, 1, 1],
[1, 1, 0],
]
label_dict = {0:"background", 1:"Car", 2:"Ped", 3:"Cycler", 4:"Truck"}
color_dict = {"0":[255, 255, 255], "1":[255, 255, 0], "2":[51, 153,... | 0 | 0 | 0 | 0 | 0 | 10,167 | 0 | -1 | 274 |
2bc44aa34b4bc1b094fb35d6ffe1882200ba961b | 68 | py | Python | lombscargle/__init__.py | jakevdp/nfftls | 01aebd51189a6ed96e44c58cd55b74b8691cbe77 | [
"BSD-3-Clause"
] | 2 | 2017-07-29T13:11:34.000Z | 2019-11-12T01:41:42.000Z | lombscargle/__init__.py | jakevdp/nfftls | 01aebd51189a6ed96e44c58cd55b74b8691cbe77 | [
"BSD-3-Clause"
] | null | null | null | lombscargle/__init__.py | jakevdp/nfftls | 01aebd51189a6ed96e44c58cd55b74b8691cbe77 | [
"BSD-3-Clause"
] | null | null | null | """Fast Lomb-Scargle Periodograms"""
| 17 | 36 | 0.764706 | """Fast Lomb-Scargle Periodograms"""
from .core import LombScargle
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 8 | 23 |
22b110f5e6e266f87ccb45082c2eba1d4494b357 | 724 | py | Python | scormxblock/views.py | eol-uchile/edx_xblock_scorm | af72761ad08d5570e85d35d3ed7908618e707dac | [
"Apache-2.0"
] | null | null | null | scormxblock/views.py | eol-uchile/edx_xblock_scorm | af72761ad08d5570e85d35d3ed7908618e707dac | [
"Apache-2.0"
] | null | null | null | scormxblock/views.py | eol-uchile/edx_xblock_scorm | af72761ad08d5570e85d35d3ed7908618e707dac | [
"Apache-2.0"
] | 1 | 2022-01-13T19:22:17.000Z | 2022-01-13T19:22:17.000Z | import mimetypes
from django.http import HttpResponse
from .utils import get_scorm_storage
import logging
logger = logging.getLogger(__name__)
def proxy_scorm_media(request, block_id, file, sha1=None):
"""
Render the media objects by proxy, as the files
must be in the same domain as the LMS
"""
... | 23.354839 | 62 | 0.667127 | import os.path
import mimetypes
from django.http import HttpResponse
from .utils import get_scorm_storage
import logging
logger = logging.getLogger(__name__)
def proxy_scorm_media(request, block_id, file, sha1=None):
"""
Render the media objects by proxy, as the files
must be in the same domain as the ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -7 | 22 |
46a92d70b54fe3bf5b3629c2905e334570a0b744 | 2,367 | py | Python | data_quality_problem_set2_area.py | mugofjoe/dand-data-wrangling | c415219cc8178a59494599f2f84a3692bdc7d87f | [
"MIT"
] | null | null | null | data_quality_problem_set2_area.py | mugofjoe/dand-data-wrangling | c415219cc8178a59494599f2f84a3692bdc7d87f | [
"MIT"
] | null | null | null | data_quality_problem_set2_area.py | mugofjoe/dand-data-wrangling | c415219cc8178a59494599f2f84a3692bdc7d87f | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
TOPIC: Decide what to do with a field that has multiple items in it.
In this problem set you work with cities infobox data, audit it, come up with a
cleaning idea and then clean it up.
Since in the previous quiz you made a decision on which value to keep for t... | 28.178571 | 80 | 0.613012 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
TOPIC: Decide what to do with a field that has multiple items in it.
In this problem set you work with cities infobox data, audit it, come up with a
cleaning idea and then clean it up.
Since in the previous quiz you made a decision on which value to keep for t... | 0 | 0 | 0 | 0 | 0 | 1,415 | 0 | -37 | 167 |
6028501e1702c0232cceb1c713386a86d37a048d | 754 | py | Python | constrainmol/examples/parmed_box/example_parmed_box.py | rsdefever/constrainmol | 0baa4c25abf2d01ad4c3078a541b4fd943514121 | [
"BSD-3-Clause"
] | 7 | 2020-12-15T05:08:36.000Z | 2022-01-03T02:20:25.000Z | constrainmol/examples/parmed_box/example_parmed_box.py | rsdefever/constrainmol | 0baa4c25abf2d01ad4c3078a541b4fd943514121 | [
"BSD-3-Clause"
] | 5 | 2020-11-06T21:17:51.000Z | 2020-11-18T22:44:18.000Z | constrainmol/examples/parmed_box/example_parmed_box.py | rsdefever/constrainmol | 0baa4c25abf2d01ad4c3078a541b4fd943514121 | [
"BSD-3-Clause"
] | 1 | 2020-12-15T05:08:44.000Z | 2020-12-15T05:08:44.000Z | import parmed
import numpy as np
from constrainmol import ConstrainedMolecule
# Load from gro/topology
system = parmed.load_file("system.top", xyz="system.gro")
system.save("unconstrained.pdb", overwrite=True)
constrained_coordinates = np.zeros(system.coordinates.shape)
unique_res = system.split()
for (res, resids)... | 30.16 | 79 | 0.753316 | import parmed
import numpy as np
from constrainmol import ConstrainedMolecule
# Load from gro/topology
system = parmed.load_file("system.top", xyz="system.gro")
system.save("unconstrained.pdb", overwrite=True)
constrained_coordinates = np.zeros(system.coordinates.shape)
unique_res = system.split()
for (res, resids)... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
1dbcfb56385522b7d409b3f30b741f3688d38d67 | 3,392 | py | Python | regexlib/python_re_test_file/regexlib_1091.py | yetingli/ReDoS-Benchmarks | f5b5094d835649e957bf3fec6b8bd4f6efdb35fc | [
"MIT"
] | 1 | 2022-01-24T14:43:23.000Z | 2022-01-24T14:43:23.000Z | regexlib/python_re_test_file/regexlib_1091.py | yetingli/ReDoS-Benchmarks | f5b5094d835649e957bf3fec6b8bd4f6efdb35fc | [
"MIT"
] | null | null | null | regexlib/python_re_test_file/regexlib_1091.py | yetingli/ReDoS-Benchmarks | f5b5094d835649e957bf3fec6b8bd4f6efdb35fc | [
"MIT"
] | null | null | null | # 1091
# (?:(?:w{3}\.)(?:[a-zA-Z0-9/;\?&=:\-_\$\+!\*'\(\|\\~\[\]#%\.])+[\.com|\.edu|\.gov|\.int|\.mil|\.net|\.org|\.biz|\.info|\.name|\.pro|\.aero|\.coop|\.museum|\.cat|\.jobs|\.travel|\.arpa|\.mobi|\.ac|\.ad|\.ae|\.af|\.ag|\.ai|\.al|\.am|\.an|\.ao|\.aq|\.ar|\.as|\.at|\.au|\.aw|\.az|\.ax|\.ba|\.bb|\.bd|\.be|\.bf|\.bg|\... | 178.526316 | 1,495 | 0.420106 | # 1091
# (?:(?:w{3}\.)(?:[a-zA-Z0-9/;\?&=:\-_\$\+!\*'\(\|\\~\[\]#%\.])+[\.com|\.edu|\.gov|\.int|\.mil|\.net|\.org|\.biz|\.info|\.name|\.pro|\.aero|\.coop|\.museum|\.cat|\.jobs|\.travel|\.arpa|\.mobi|\.ac|\.ad|\.ae|\.af|\.ag|\.ai|\.al|\.am|\.an|\.ao|\.aq|\.ar|\.as|\.at|\.au|\.aw|\.az|\.ax|\.ba|\.bb|\.bd|\.be|\.bf|\.bg|\... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4475be2c905f13e27a18554229e89144691feca4 | 1,294 | py | Python | met/scripts/met-merger.py | DoggySmooth/MET | 91e6e5a9ecd66d60059abbcaf9389c6780ba7ce7 | [
"MIT"
] | null | null | null | met/scripts/met-merger.py | DoggySmooth/MET | 91e6e5a9ecd66d60059abbcaf9389c6780ba7ce7 | [
"MIT"
] | 3 | 2021-03-31T18:53:02.000Z | 2021-12-13T19:49:33.000Z | met/scripts/met-merger.py | DoggySmooth/MET | 91e6e5a9ecd66d60059abbcaf9389c6780ba7ce7 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""
This module merge to xml files into one. First it checks if its sha's are the same to avoid merging of different projects an finally merge it into one called merged.xml.
"""
import argparse
USAGE = './met-merger firstXml.xml secondXml.xml'
parser = argparse.ArgumentParser(
description=_... | 26.408163 | 169 | 0.692427 | #!/usr/bin/env python3
"""
This module merge to xml files into one. First it checks if its sha's are the same to avoid merging of different projects an finally merge it into one called merged.xml.
"""
import sys
import argparse
from lxml import etree
import met.xmlMerger as merger
USAGE = './met-merger firstXml.xml s... | 0 | 0 | 0 | 0 | 0 | 647 | 0 | -1 | 90 |
d9ffa1e8e2159ccdee3a14fac64ce819ff327cc8 | 2,291 | py | Python | app/db_config.py | queenfiona/SendITc3 | 7bb2ed5165e07ec307bbd4f5abe2e53073f05f9c | [
"MIT"
] | null | null | null | app/db_config.py | queenfiona/SendITc3 | 7bb2ed5165e07ec307bbd4f5abe2e53073f05f9c | [
"MIT"
] | 13 | 2020-02-12T01:22:14.000Z | 2022-03-11T23:34:38.000Z | app/db_config.py | queenfiona/SendITc3 | 7bb2ed5165e07ec307bbd4f5abe2e53073f05f9c | [
"MIT"
] | 1 | 2018-11-23T02:35:32.000Z | 2018-11-23T02:35:32.000Z | """Docstring for db_config file."""
import psycopg2
import os
from instance.config import app_config
# from boto.s3.connection import S3Connection
# s3 = S3Connection(os.environ['S3_KEY'], os.environ['S3_SECRET'])
env = os.getenv("FLASK_ENV")
if not env:
url = app_config["production"].DATABASE_URL
else:
url ... | 30.546667 | 82 | 0.709297 | """Docstring for db_config file."""
import psycopg2
import os
from instance.config import app_config
# from boto.s3.connection import S3Connection
# s3 = S3Connection(os.environ['S3_KEY'], os.environ['S3_SECRET'])
env = os.getenv("FLASK_ENV")
if not env:
url = app_config["production"].DATABASE_URL
else:
url ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
880d5fbb50cdf9cfc0405f5b88ac61839cc441ce | 3,222 | py | Python | code/gaze_ocr.py | wolfmanstout/knausj_talon | 4763a45f6f17b925a5e37061c0ccaab2c1c487ec | [
"MIT"
] | null | null | null | code/gaze_ocr.py | wolfmanstout/knausj_talon | 4763a45f6f17b925a5e37061c0ccaab2c1c487ec | [
"MIT"
] | null | null | null | code/gaze_ocr.py | wolfmanstout/knausj_talon | 4763a45f6f17b925a5e37061c0ccaab2c1c487ec | [
"MIT"
] | null | null | null |
from talon import Module, app
mod = Module()
setting_ocr_logging_dir = mod.setting(
"ocr_logging_dir",
type=str,
default=None,
desc="If specified, log OCR'ed images to this directory.",
)
app.register("ready", on_ready) | 39.777778 | 86 | 0.678771 | from typing import Union
from talon import Context, Module, actions, app
from talon.grammar import Phrase
import gaze_ocr
import screen_ocr # dependency of gaze-ocr
from gaze_ocr import _talon_wrappers as talon_wrappers
mod = Module()
setting_ocr_logging_dir = mod.setting(
"ocr_logging_dir",
type=str,
... | 0 | 2,191 | 0 | 0 | 0 | 508 | 0 | 55 | 229 |
6ed97324166b2fdbbae89b96cecf9a98cd36aeb0 | 471 | py | Python | Students/chase/extra3.py | MikelShifrin/Python1 | 0096a327023a28e0c639042ae01268b07e61943e | [
"MIT"
] | 3 | 2019-07-02T13:46:23.000Z | 2019-08-19T14:41:25.000Z | Students/chase/extra3.py | MikelShifrin/Python1 | 0096a327023a28e0c639042ae01268b07e61943e | [
"MIT"
] | null | null | null | Students/chase/extra3.py | MikelShifrin/Python1 | 0096a327023a28e0c639042ae01268b07e61943e | [
"MIT"
] | null | null | null | main()
| 33.642857 | 74 | 0.675159 | def main():
number_of_item=float(input("how many number of item do you want buy"))
if(number_of_item<10):
print(number_of_item*99)
elif(number_of_item>=10 and number_of_item<=19):
print(number_of_item*99*0.9)
elif(number_of_item>=20 and number_of_item<=49):
print(number_of_item*9... | 0 | 0 | 0 | 0 | 0 | 442 | 0 | 0 | 22 |
31cb143e2377343eee8f33cd17f412399d49b638 | 10,226 | py | Python | ocs_ci/deployment/disconnected.py | kesavanvt/ocs-ci | f120044486631f49133c9f3a137842673d765a1c | [
"MIT"
] | null | null | null | ocs_ci/deployment/disconnected.py | kesavanvt/ocs-ci | f120044486631f49133c9f3a137842673d765a1c | [
"MIT"
] | null | null | null | ocs_ci/deployment/disconnected.py | kesavanvt/ocs-ci | f120044486631f49133c9f3a137842673d765a1c | [
"MIT"
] | null | null | null | """
This module contains functionality required for disconnected installation.
"""
import logging
import os
import tempfile
import yaml
from ocs_ci.framework import config
from ocs_ci.helpers.disconnected import get_opm_tool
from ocs_ci.ocs import constants
from ocs_ci.ocs.exceptions import NotFoundError
from ocs_ci... | 37.457875 | 107 | 0.663896 | """
This module contains functionality required for disconnected installation.
"""
import logging
import os
import tempfile
import yaml
from ocs_ci.framework import config
from ocs_ci.helpers.disconnected import get_opm_tool
from ocs_ci.ocs import constants
from ocs_ci.ocs.exceptions import NotFoundError
from ocs_ci... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 35 | 0 |
0455f230ec9eb1646bbd8b355eef81e8a026f547 | 5,969 | py | Python | tests/test_adapters.py | bernt-matthias/cutadapt | 9ba5b705ba0e6cc5e32d4ce3810788b05b16a306 | [
"MIT"
] | null | null | null | tests/test_adapters.py | bernt-matthias/cutadapt | 9ba5b705ba0e6cc5e32d4ce3810788b05b16a306 | [
"MIT"
] | null | null | null | tests/test_adapters.py | bernt-matthias/cutadapt | 9ba5b705ba0e6cc5e32d4ce3810788b05b16a306 | [
"MIT"
] | null | null | null |
from dnaio import Sequence
from cutadapt.adapters import Adapter, Where, LinkedAdapter
def test_issue_265():
"""Crash when accessing the matches property of non-anchored linked adapters"""
s = Sequence('name', 'AAAATTTT')
front_adapter = Adapter('GGG', where=Where.FRONT)
back_adapter = Adapter... | 33.346369 | 107 | 0.640978 | import pytest
from dnaio import Sequence
from cutadapt.adapters import Adapter, Match, Where, LinkedAdapter
def test_issue_52():
adapter = Adapter(
sequence='GAACTCCAGTCACNNNNN',
where=Where.BACK,
remove='suffix',
max_error_rate=0.12,
min_overlap=5,
read_wildcards=... | 0 | 215 | 0 | 0 | 0 | 5,055 | 0 | -1 | 206 |
77524bcd98a60ce23ba96fe03b7a6453cc256460 | 6,815 | py | Python | pooch/hashes.py | rabernat/pooch | bc32d4eecec115e1fdf9bd4e306df5a6c22661fd | [
"BSD-3-Clause"
] | 214 | 2018-07-21T19:21:45.000Z | 2022-03-25T01:46:41.000Z | pooch/hashes.py | rabernat/pooch | bc32d4eecec115e1fdf9bd4e306df5a6c22661fd | [
"BSD-3-Clause"
] | 194 | 2018-07-20T23:09:05.000Z | 2022-03-14T14:50:29.000Z | pooch/hashes.py | rabernat/pooch | bc32d4eecec115e1fdf9bd4e306df5a6c22661fd | [
"BSD-3-Clause"
] | 48 | 2018-07-23T21:20:55.000Z | 2022-03-25T01:46:46.000Z | # Copyright (c) 2018 The Pooch Developers.
# Distributed under the terms of the BSD 3-Clause License.
# SPDX-License-Identifier: BSD-3-Clause
#
# This code is part of the Fatiando a Terra project (https://www.fatiando.org)
#
"""
Calculating and checking file hashes.
"""
import hashlib
import functools
from pathlib impo... | 30.288889 | 84 | 0.639765 | # Copyright (c) 2018 The Pooch Developers.
# Distributed under the terms of the BSD 3-Clause License.
# SPDX-License-Identifier: BSD-3-Clause
#
# This code is part of the Fatiando a Terra project (https://www.fatiando.org)
#
"""
Calculating and checking file hashes.
"""
import hashlib
import functools
from pathlib impo... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
79b5eb78dad043dccbf2b484e3afb8079f17cc47 | 15,153 | py | Python | crowdsourcing/util/multibox/model.py | sbranson/online_crowdsourcing | d1f7c814bb60aae9cf5e76e0b299713246f98ce3 | [
"MIT"
] | 4 | 2019-08-14T21:14:18.000Z | 2021-11-04T09:32:37.000Z | crowdsourcing/util/multibox/model.py | sbranson/online_crowdsourcing | d1f7c814bb60aae9cf5e76e0b299713246f98ce3 | [
"MIT"
] | null | null | null | crowdsourcing/util/multibox/model.py | sbranson/online_crowdsourcing | d1f7c814bb60aae9cf5e76e0b299713246f98ce3 | [
"MIT"
] | 1 | 2019-11-09T08:20:27.000Z | 2019-11-09T08:20:27.000Z | import tensorflow as tf
slim = tf.contrib.slim
def block35(net, scale=1.0, activation_fn=tf.nn.relu, scope=None, reuse=None):
"""Builds the 35x35 resnet block."""
with tf.variable_scope(scope, 'Block35', [net], reuse=reuse):
with tf.variable_scope('Branch_0'):
tower_conv = slim.conv2d(net, 32, 1, scope... | 44.831361 | 178 | 0.613806 | import tensorflow as tf
slim = tf.contrib.slim
def block35(net, scale=1.0, activation_fn=tf.nn.relu, scope=None, reuse=None):
"""Builds the 35x35 resnet block."""
with tf.variable_scope(scope, 'Block35', [net], reuse=reuse):
with tf.variable_scope('Branch_0'):
tower_conv = slim.conv2d(net, 32, 1, scope... | 0 | 0 | 0 | 0 | 0 | 6,190 | 0 | 0 | 46 |
2caf5ed64f41a475eb0f6f365fe1d8e6d8d66bac | 747 | py | Python | train/minimalistic_train.py | imagelint/focusfinder | 834b4e2dd873739ba7dbe8389fdfeeaa12c03c87 | [
"MIT"
] | null | null | null | train/minimalistic_train.py | imagelint/focusfinder | 834b4e2dd873739ba7dbe8389fdfeeaa12c03c87 | [
"MIT"
] | null | null | null | train/minimalistic_train.py | imagelint/focusfinder | 834b4e2dd873739ba7dbe8389fdfeeaa12c03c87 | [
"MIT"
] | null | null | null |
df = pd.read_csv(Path('download/labels/train_labels.csv'), names=['name','x_p','y_p'], header=0)
imgs = DataBlock(blocks=(ImageBlock, PointBlock), get_items=get_image_files, get_y=get_focus_point, splitter=RandomSplitter(valid_pct=0.2, seed=42), batch_tfms=[*aug_transforms(size=(244, 244)), Normalize.from_stats(*image... | 62.25 | 258 | 0.726908 | from fastai.vision.all import *
import re
def get_focus_point(path_name):
dfb = next(iter(df[df['name']==path_name.name].index), ('no match for '+path_name.name))
return tensor([float(df['x_p'][dfb]), float(df['y_p'][dfb])])
df = pd.read_csv(Path('download/labels/train_labels.csv'), names=['name','x_p','y_p']... | 0 | 0 | 0 | 0 | 0 | 169 | 0 | -2 | 67 |
5ad5b0dce0aebfcc0decf69ea1433b9412ccc9bb | 5,230 | py | Python | scripts/create_fluseverity_figs/Supp_zOR_epiduration_state.py | eclee25/flu-SDI-exploratory-age | 2f5a4d97b84d2116e179e85fe334edf4556aa946 | [
"MIT"
] | 3 | 2018-03-29T23:02:43.000Z | 2020-08-10T12:01:50.000Z | scripts/create_fluseverity_figs/Supp_zOR_epiduration_state.py | eclee25/flu-SDI-exploratory-age | 2f5a4d97b84d2116e179e85fe334edf4556aa946 | [
"MIT"
] | null | null | null | scripts/create_fluseverity_figs/Supp_zOR_epiduration_state.py | eclee25/flu-SDI-exploratory-age | 2f5a4d97b84d2116e179e85fe334edf4556aa946 | [
"MIT"
] | null | null | null | #!/usr/bin/python
##############################################
###Python template
###Author: Elizabeth Lee
###Date: 8/1/14
###Function: scatter plot zOR metrics vs. epidemic duration at state level, using the state peak retrospective classification
## one plot per season per classification period vs. epidemic durati... | 43.583333 | 214 | 0.736329 | #!/usr/bin/python
##############################################
###Python template
###Author: Elizabeth Lee
###Date: 8/1/14
###Function: scatter plot zOR metrics vs. epidemic duration at state level, using the state peak retrospective classification
## one plot per season per classification period vs. epidemic durati... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
686738f8c5cb3f4321168859c030d4ecc830fda5 | 988 | py | Python | scripts/filter_actions.py | heyjoakim/munaiah-analyser | d76056cecd3b7f4a6cd72d7fd526cea18aa671d6 | [
"MIT"
] | 1 | 2022-01-03T17:47:20.000Z | 2022-01-03T17:47:20.000Z | scripts/filter_actions.py | heyjoakim/munaiah-analyser | d76056cecd3b7f4a6cd72d7fd526cea18aa671d6 | [
"MIT"
] | null | null | null | scripts/filter_actions.py | heyjoakim/munaiah-analyser | d76056cecd3b7f4a6cd72d7fd526cea18aa671d6 | [
"MIT"
] | 1 | 2021-12-22T13:59:34.000Z | 2021-12-22T13:59:34.000Z | import pandas as pd
# Generate raw data file
# call("./get_actions.sh") // Add this if you dont have the out raw data TODO: Replace this with the go script
# Do we add a count for each category a action has or ???
all_actions = open("data/actions_out/actions_raw.txt", "r")
no_ver_actions = open("data/actions_out/no_v... | 27.444444 | 110 | 0.711538 | import pandas as pd
from subprocess import call
# Generate raw data file
# call("./get_actions.sh") // Add this if you dont have the out raw data TODO: Replace this with the go script
# Do we add a count for each category a action has or ???
all_actions = open("data/actions_out/actions_raw.txt", "r")
no_ver_actions =... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 | 22 |
7609dac71fe6ef641efd49318b3e76b0364b2b33 | 4,936 | py | Python | utils/sigproc/dsp.py | cyx669521/Conv-TasNet-PyTorch | 64188ffa48971218fdd68b66906970f215d7eca2 | [
"MIT"
] | 39 | 2019-04-03T03:25:40.000Z | 2021-11-12T01:05:07.000Z | utils/sigproc/dsp.py | cyx669521/Conv-TasNet-PyTorch | 64188ffa48971218fdd68b66906970f215d7eca2 | [
"MIT"
] | 5 | 2019-11-23T14:16:39.000Z | 2021-08-30T05:33:59.000Z | utils/sigproc/dsp.py | wangkenpu/Conv-TasNet-PyTorch | 64188ffa48971218fdd68b66906970f215d7eca2 | [
"MIT"
] | 10 | 2019-04-03T08:17:42.000Z | 2021-12-14T01:23:51.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2018 ASLP@NPU Ke Wang
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import librosa
import numpy as np
MAX_INT16 = np.iinfo(np.int16).max
EPSILON = np.finfo(np.float32).eps
MAX_EXP = np.log(n... | 30.469136 | 71 | 0.632496 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2018 ASLP@NPU Ke Wang
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import math
import os
import sys
import librosa
import numpy as np
import soundfile as sf
from scipy.io import wavfile
MA... | 0 | 0 | 0 | 0 | 0 | 295 | 0 | -25 | 180 |
cd064f19699be74497beed14a6f016f0c582cc7d | 874 | py | Python | recipes/Python/576431_export_variable_win32_like/recipe-576431.py | tdiprima/code | 61a74f5f93da087d27c70b2efe779ac6bd2a3b4f | [
"MIT"
] | 2,023 | 2017-07-29T09:34:46.000Z | 2022-03-24T08:00:45.000Z | recipes/Python/576431_export_variable_win32_like/recipe-576431.py | unhacker/code | 73b09edc1b9850c557a79296655f140ce5e853db | [
"MIT"
] | 32 | 2017-09-02T17:20:08.000Z | 2022-02-11T17:49:37.000Z | recipes/Python/576431_export_variable_win32_like/recipe-576431.py | unhacker/code | 73b09edc1b9850c557a79296655f140ce5e853db | [
"MIT"
] | 780 | 2017-07-28T19:23:28.000Z | 2022-03-25T20:39:41.000Z | """
vim: set enc=utf-8
Author : winterTTr
Mail : winterTTr@gmail.com
Desc : Tools for Operation on Win32 Environment variables
Module : win32export.py
"""
| 26.484848 | 158 | 0.713959 | """
vim: set enc=utf-8
Author : winterTTr
Mail : winterTTr@gmail.com
Desc : Tools for Operation on Win32 Environment variables
Module : win32export.py
"""
import win32gui
import win32con
import win32api
def export ( name , value , update_system = True ):
try :
modifyVariableInRegister( name , val... | 0 | 0 | 0 | 0 | 0 | 592 | 0 | -18 | 136 |
3debe193f06ad7a3963adeec17ffcb14130e01d6 | 201 | py | Python | execpeewee/__init__.py | supplayer/exec_peewee | 095b94d0a82e2f9d13e983d5cb6d22a09710b7c7 | [
"MIT"
] | null | null | null | execpeewee/__init__.py | supplayer/exec_peewee | 095b94d0a82e2f9d13e983d5cb6d22a09710b7c7 | [
"MIT"
] | null | null | null | execpeewee/__init__.py | supplayer/exec_peewee | 095b94d0a82e2f9d13e983d5cb6d22a09710b7c7 | [
"MIT"
] | null | null | null | from execpeewee.builder import PeeweeModel
from execpeewee.handler import ExecPeewee
from execpeewee.mapping import PeeweeFields
__all__ = [
'PeeweeModel',
'ExecPeewee',
'PeeweeFields'
]
| 18.272727 | 43 | 0.766169 | from execpeewee.builder import PeeweeModel
from execpeewee.handler import ExecPeewee
from execpeewee.mapping import PeeweeFields
__all__ = [
'PeeweeModel',
'ExecPeewee',
'PeeweeFields'
]
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b8d2ac159ea46c08c77cc17cbe99d12772509c45 | 181 | py | Python | tests/bytecode/mp-tests/fun4.py | LabAixBidouille/micropython | 11aa6ba456287d6c80598a7ebbebd2887ce8f5a2 | [
"MIT"
] | 303 | 2015-07-11T17:12:55.000Z | 2018-01-08T03:02:37.000Z | tests/bytecode/mp-tests/fun4.py | LabAixBidouille/micropython | 11aa6ba456287d6c80598a7ebbebd2887ce8f5a2 | [
"MIT"
] | 13 | 2016-05-12T16:51:22.000Z | 2018-01-10T22:33:25.000Z | tests/bytecode/mp-tests/fun4.py | LabAixBidouille/micropython | 11aa6ba456287d6c80598a7ebbebd2887ce8f5a2 | [
"MIT"
] | 26 | 2018-01-18T09:15:33.000Z | 2022-02-07T13:09:14.000Z | f = lambda a, b, *c, d: None # default arg
#f = lambda a, b=1, *c, d: None # default arg for lambda not implemented
| 30.166667 | 72 | 0.574586 | def f(a, b=1, *c, d):
pass
#print(a,b,c,d) # bug in uPy!
f = lambda a, b, *c, d: None # default arg
#f = lambda a, b=1, *c, d: None # default arg for lambda not implemented
| 0 | 0 | 0 | 0 | 0 | 43 | 0 | 0 | 22 |
7651b47a04e65ce5e0188647bc79ee8630ac895a | 633 | py | Python | fsdviz/stocking/migrations/0017_stocking_colorfields.py | AdamCottrill/fsdivz | 98dd1f35a08dba26424e2951a40715e01399478c | [
"MIT"
] | null | null | null | fsdviz/stocking/migrations/0017_stocking_colorfields.py | AdamCottrill/fsdivz | 98dd1f35a08dba26424e2951a40715e01399478c | [
"MIT"
] | 6 | 2020-02-12T00:03:40.000Z | 2020-11-30T01:20:56.000Z | fsdviz/stocking/migrations/0017_stocking_colorfields.py | AdamCottrill/fsdviz | 98dd1f35a08dba26424e2951a40715e01399478c | [
"MIT"
] | null | null | null | # Generated by Django 2.2.24 on 2021-09-13 15:58
| 25.32 | 81 | 0.612954 | # Generated by Django 2.2.24 on 2021-09-13 15:58
import colorfield.fields
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("stocking", "0016_stocking_event_fk_defaults"),
]
operations = [
migrations.AddField(
model_name="lifestage",
... | 0 | 0 | 0 | 501 | 0 | 0 | 0 | 14 | 68 |
6268a654cc967f8b117fefbd98f4b6bf0ecac528 | 2,277 | py | Python | source/ccit2021.py | simon242/CampusCyberInspectionTool2021 | 5f585afa2ad9473082e690df8e7ca44dbac943ca | [
"MIT"
] | null | null | null | source/ccit2021.py | simon242/CampusCyberInspectionTool2021 | 5f585afa2ad9473082e690df8e7ca44dbac943ca | [
"MIT"
] | null | null | null | source/ccit2021.py | simon242/CampusCyberInspectionTool2021 | 5f585afa2ad9473082e690df8e7ca44dbac943ca | [
"MIT"
] | null | null | null |
if __name__ == "__main__":
main()
| 30.36 | 127 | 0.59552 | import argparse
import os
import webbrowser
from Option import Option
from functions.Clock import Clock
from functions.shut import shut
from functions.Ipconfig import Showip
from functions.CryptoSystem import *
from functions.Nslookup import Nslookup
from functions.PortScanner import Scanport
def main():
# 準備參數解析
... | 285 | 0 | 0 | 0 | 0 | 1,825 | 0 | 74 | 243 |
7aab91c67e5a0b014d8044e8f2712e2c85d03816 | 1,598 | py | Python | soft_delete_history/templatetags/soft_delete_extras.py | ThiloSavary/django-soft-delete-history | d511d3b3a13ddb56691d807c919fe312b5e2f3cf | [
"MIT"
] | null | null | null | soft_delete_history/templatetags/soft_delete_extras.py | ThiloSavary/django-soft-delete-history | d511d3b3a13ddb56691d807c919fe312b5e2f3cf | [
"MIT"
] | null | null | null | soft_delete_history/templatetags/soft_delete_extras.py | ThiloSavary/django-soft-delete-history | d511d3b3a13ddb56691d807c919fe312b5e2f3cf | [
"MIT"
] | null | null | null | from django import template
register = template.Library()
| 51.548387 | 133 | 0.702753 | from django import template
from django.contrib.auth import get_permission_codename
from django.utils.translation import gettext_lazy as _
from django.utils.safestring import mark_safe
register = template.Library()
@register.simple_tag(takes_context=True)
def admin_soft_delete_bar(context, *args, **kwargs):
# Cou... | 0 | 1,359 | 0 | 0 | 0 | 0 | 0 | 91 | 89 |
c963e25a39c48d1cf87711a245bad7fb912e676d | 49 | py | Python | discoin/config.py | Discoin/discoin.py | 4a3459dfaab6695fe88d05290465a1b7842b3606 | [
"MIT"
] | 2 | 2020-07-26T11:29:47.000Z | 2021-09-08T22:38:35.000Z | discoin/config.py | Discoin/discoin.py | 4a3459dfaab6695fe88d05290465a1b7842b3606 | [
"MIT"
] | 8 | 2020-02-11T14:23:38.000Z | 2021-04-16T21:38:15.000Z | discoin/config.py | Discoin/discoin.py | 4a3459dfaab6695fe88d05290465a1b7842b3606 | [
"MIT"
] | null | null | null | DOMAIN = "https://discoin.zws.im"
VERSION = "4.0" | 24.5 | 33 | 0.653061 | DOMAIN = "https://discoin.zws.im"
VERSION = "4.0" | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4861ebbaa0bdbe504fad249efcbe04c8dded3b16 | 3,882 | py | Python | a1-supervised-learning/decision_tree.py | changrybirds/ml-2019fall | 1097530cdfa378c3c69d0ff5a3f95f9d8959cce4 | [
"MIT"
] | null | null | null | a1-supervised-learning/decision_tree.py | changrybirds/ml-2019fall | 1097530cdfa378c3c69d0ff5a3f95f9d8959cce4 | [
"MIT"
] | null | null | null | a1-supervised-learning/decision_tree.py | changrybirds/ml-2019fall | 1097530cdfa378c3c69d0ff5a3f95f9d8959cce4 | [
"MIT"
] | null | null | null |
if __name__ == "__main__":
abalone(verbose=False, show_plots=False)
online_shopping(verbose=False, show_plots=False)
| 31.306452 | 100 | 0.679547 | import numpy as np
import pandas as pd
from sklearn.tree import DecisionTreeClassifier
from sklearn.model_selection import cross_val_score
import matplotlib.pyplot as plt
import dataset_processing as data_proc
def model_complexity_curve(X_train, y_train, hp, hp_vals, cv=None):
df = pd.DataFrame(index=hp_vals, co... | 0 | 0 | 0 | 0 | 0 | 3,448 | 0 | 78 | 225 |
bc6fe1c7e25e8e6fad2daceba284a8044930c8c3 | 7,347 | py | Python | pysnmp/MY-PROCESS-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 11 | 2021-02-02T16:27:16.000Z | 2021-08-31T06:22:49.000Z | pysnmp/MY-PROCESS-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 75 | 2021-02-24T17:30:31.000Z | 2021-12-08T00:01:18.000Z | pysnmp/MY-PROCESS-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module MY-PROCESS-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/MY-PROCESS-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 20:06:38 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2... | 109.656716 | 1,073 | 0.755138 | #
# PySNMP MIB module MY-PROCESS-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/MY-PROCESS-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 20:06:38 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2... | 0 | 0 | 0 | 117 | 0 | 0 | 0 | 0 | 22 |
8f5f8c1e792333da6b38cc2cd4606e00cf00f23c | 19,153 | py | Python | openforcefield/typing/engines/smirnoff/forcefield_utils.py | pschmidtke/openforcefield | d0868c78a8dff9df6750c5212fa918d7dc0e7bd8 | [
"MIT"
] | null | null | null | openforcefield/typing/engines/smirnoff/forcefield_utils.py | pschmidtke/openforcefield | d0868c78a8dff9df6750c5212fa918d7dc0e7bd8 | [
"MIT"
] | null | null | null | openforcefield/typing/engines/smirnoff/forcefield_utils.py | pschmidtke/openforcefield | d0868c78a8dff9df6750c5212fa918d7dc0e7bd8 | [
"MIT"
] | null | null | null | #!/bin/env python
#=============================================================================================
# MODULE DOCSTRING
#=============================================================================================
"""
forcefield_utils.py
Utilities relating to OpenMM ForceField replacement using SMIRKS-b... | 40.407173 | 313 | 0.661567 | #!/bin/env python
#=============================================================================================
# MODULE DOCSTRING
#=============================================================================================
"""
forcefield_utils.py
Utilities relating to OpenMM ForceField replacement using SMIRKS-b... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 67 | 111 |
45dcabbf64ec5140e782fbc10fcddaccf3c13f9e | 30,301 | py | Python | util.py | ourresearch/jump-api | 5252da53656389f9bd53811929d5156ff8f7620c | [
"MIT"
] | 15 | 2019-11-07T09:57:56.000Z | 2022-01-03T22:45:28.000Z | util.py | ourresearch/jump-api | 5252da53656389f9bd53811929d5156ff8f7620c | [
"MIT"
] | 6 | 2021-03-19T23:15:14.000Z | 2021-09-23T16:46:19.000Z | util.py | ourresearch/jump-api | 5252da53656389f9bd53811929d5156ff8f7620c | [
"MIT"
] | 1 | 2021-12-17T05:50:47.000Z | 2021-12-17T05:50:47.000Z | # coding: utf-8
import datetime
import locale
try:
locale.setlocale(locale.LC_ALL, 'en_US.UTF-8') #use locale.format for commafication
except locale.Error:
locale.setlocale(locale.LC_ALL, '') #set to default locale (works on windows)
# from http://stackoverflow.com/a/3233356/596939
# returns dict with value... | 30.030723 | 145 | 0.624171 | # coding: utf-8
import bisect
import codecs
import collections
import datetime
import locale
import logging
import math
import os
import re
import tempfile
import time
import traceback
import unicodedata
import urllib.parse
from codecs import BOM_UTF8, BOM_UTF16_BE, BOM_UTF16_LE, BOM_UTF32_BE, BOM_UTF32_LE
import char... | 0 | 0 | 0 | 2,944 | 826 | 20,803 | 0 | 57 | 2,169 |
d13dc9b857e96a7e9d8ab8282640f8d59ecf3e70 | 415 | py | Python | trik/trik.py | Zeyu-Li/kattis_solutions | 1599725facc32945f62acc9a5c3982d5834ba9ba | [
"MIT"
] | null | null | null | trik/trik.py | Zeyu-Li/kattis_solutions | 1599725facc32945f62acc9a5c3982d5834ba9ba | [
"MIT"
] | null | null | null | trik/trik.py | Zeyu-Li/kattis_solutions | 1599725facc32945f62acc9a5c3982d5834ba9ba | [
"MIT"
] | null | null | null |
if __name__ == "__main__":
main()
| 18.043478 | 35 | 0.375904 | def main():
counts = input()
a = [1,0,0]
for char in counts:
if char == 'A':
a[0], a[1] = a[1], a[0]
elif char == 'B':
a[1], a[2] = a[2], a[1]
else:
a[0], a[2] = a[2], a[0]
# print(a)
for index, i in enumerate(a):
if i == 1:
... | 0 | 0 | 0 | 0 | 0 | 354 | 0 | 0 | 22 |
b17485bf75669c3ce0838b5ddff2c0e6f5259d55 | 1,140 | py | Python | server/app/views/index.py | TrafficStuck/ts-server | 6d4f197d6f8542b85133dbb3cbfb3738a1caaeb5 | [
"MIT"
] | null | null | null | server/app/views/index.py | TrafficStuck/ts-server | 6d4f197d6f8542b85133dbb3cbfb3738a1caaeb5 | [
"MIT"
] | 21 | 2021-03-02T10:50:50.000Z | 2021-09-29T12:55:29.000Z | server/app/views/index.py | TrafficStuck/ts-server | 6d4f197d6f8542b85133dbb3cbfb3738a1caaeb5 | [
"MIT"
] | null | null | null | """This module provides basic server endpoints."""
from flask import Blueprint, request
from app.utils.misc import make_response
internal_blueprint = Blueprint('traffic-stuck-internal', __name__)
def handle_404(error):
"""Return custom response for 404 http status code."""
return make_response(
F... | 25.909091 | 112 | 0.676316 | """This module provides basic server endpoints."""
from http import HTTPStatus
from flask import Blueprint, request
from app.utils.misc import make_response
internal_blueprint = Blueprint('traffic-stuck-internal', __name__)
@internal_blueprint.route("/health", methods=['GET'])
def get_health():
"""Return hea... | 0 | 142 | 0 | 0 | 0 | 0 | 0 | 6 | 46 |
a2198a5c61777794140e87db46e40df1259fb8da | 7,397 | py | Python | client/starwhale/utils/config.py | star-whale/starwhale | 11cfe86d3a0c2972b508812d101f1b32e4166706 | [
"Apache-2.0"
] | 13 | 2022-03-09T15:27:29.000Z | 2022-03-29T06:12:47.000Z | client/starwhale/utils/config.py | star-whale/starwhale | 11cfe86d3a0c2972b508812d101f1b32e4166706 | [
"Apache-2.0"
] | 7 | 2022-03-14T08:59:39.000Z | 2022-03-30T00:50:40.000Z | client/starwhale/utils/config.py | star-whale/starwhale | 11cfe86d3a0c2972b508812d101f1b32e4166706 | [
"Apache-2.0"
] | 9 | 2022-03-10T08:12:44.000Z | 2022-03-26T15:00:13.000Z | import typing as t
import getpass
_config: t.Dict[str, t.Any] = {}
_CURRENT_SHELL_USERNAME = getpass.getuser()
# TODO: abstract better common base or mixed class
| 30.566116 | 128 | 0.615925 | import os
import typing as t
import getpass
from pathlib import Path
import yaml
from starwhale.consts import (
UserRoleType,
SW_CLI_CONFIG,
DEFAULT_PROJECT,
DEFAULT_INSTANCE,
SW_LOCAL_STORAGE,
ENV_SW_CLI_CONFIG,
STANDALONE_INSTANCE,
LOCAL_CONFIG_VERSION,
)
from starwhale.utils.error i... | 0 | 1,010 | 0 | 3,493 | 0 | 2,192 | 0 | 238 | 294 |
e9c3e27af9aa4a410f686d7b95c805d8ffce192d | 126 | py | Python | Euler1-5/euler3.py | jokkebk/livecoding | b925c5d8d30f5186c6f4c83a44e5704ceb92be48 | [
"MIT"
] | null | null | null | Euler1-5/euler3.py | jokkebk/livecoding | b925c5d8d30f5186c6f4c83a44e5704ceb92be48 | [
"MIT"
] | null | null | null | Euler1-5/euler3.py | jokkebk/livecoding | b925c5d8d30f5186c6f4c83a44e5704ceb92be48 | [
"MIT"
] | null | null | null |
n, i = 600851475143, 2
while n > 1:
if n % i == 0:
print(i)
n /= i
else:
i += 1
| 11.454545 | 22 | 0.404762 | import math
n, i = 600851475143, 2
while n > 1:
if n % i == 0:
print(i)
n /= i
else:
i += 1
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | -10 | 22 |
5def1f05872b830bf36955bb002ba0e01e02e1a2 | 4,658 | py | Python | 2020/day-15/process.py | MatthieuMichon/advent-of-code | 2749d92de71d544a1b993577e300ee2026cecc94 | [
"MIT"
] | 1 | 2020-12-08T23:25:23.000Z | 2020-12-08T23:25:23.000Z | 2020/day-15/process.py | MatthieuMichon/advent-of-code | 2749d92de71d544a1b993577e300ee2026cecc94 | [
"MIT"
] | null | null | null | 2020/day-15/process.py | MatthieuMichon/advent-of-code | 2749d92de71d544a1b993577e300ee2026cecc94 | [
"MIT"
] | 1 | 2021-02-22T09:50:07.000Z | 2021-02-22T09:50:07.000Z | #!/usr/bin/env python
"""
Advent of Code 2020: Day 15
"""
import signal
import sys
from types import FrameType
from typing import List
from pathlib import Path
DEBUG = False
def spoken_number(starting_numbers: List[int], turns: int) -> int:
"""
Compute spoken number after a given number of turns
:param... | 26.316384 | 107 | 0.636539 | #!/usr/bin/env python
"""
Advent of Code 2020: Day 15
"""
import os
import re
import signal
import sys
from types import FrameType
from typing import List, Mapping
from pathlib import Path
DEBUG = False
def spoken_number(starting_numbers: List[int], turns: int) -> int:
"""
Compute spoken number after a giv... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -15 | 45 |
188af2b09335bf525da1e101ccdddb4de53fc716 | 4,602 | py | Python | yangram/conversations/views.py | LuceteYang/yangram | 922c4924c06043d5d27410611f4a76904452d44e | [
"MIT"
] | 1 | 2019-02-26T21:39:10.000Z | 2019-02-26T21:39:10.000Z | yangram/conversations/views.py | LuceteYang/yangram | 922c4924c06043d5d27410611f4a76904452d44e | [
"MIT"
] | 11 | 2020-06-05T20:02:33.000Z | 2022-02-26T09:55:09.000Z | yangram/conversations/views.py | LuceteYang/yangram | 922c4924c06043d5d27410611f4a76904452d44e | [
"MIT"
] | 1 | 2020-05-05T18:37:11.000Z | 2020-05-05T18:37:11.000Z | from django.shortcuts import render
from django.contrib.auth import get_user_model
User = get_user_model()
# Create your views here.
| 46.02 | 147 | 0.779009 | from django.shortcuts import render
from django.shortcuts import render
from django.contrib.auth.decorators import login_required
from yangram.conversations.models import *
from django.http import JsonResponse
from . import constants, sqls, serializers
from rest_framework import status
from django.shortcuts import get_... | 39 | 3,853 | 0 | 0 | 0 | 57 | 0 | 235 | 311 |
24791f571ad3e592f184b1d470e2aeeb137bb64a | 948 | py | Python | BuildingCyberLexicon/spiders/twitter/TweetScraper/scrapeTwitter.py | eneyi/CyberLexicon | b5d3e0245675fd692eae4a98df5d0c85604cfaba | [
"MIT"
] | 1 | 2020-10-13T11:55:48.000Z | 2020-10-13T11:55:48.000Z | BuildingCyberLexicon/spiders/twitter/TweetScraper/scrapeTwitter.py | eneyi/CyberLexicon | b5d3e0245675fd692eae4a98df5d0c85604cfaba | [
"MIT"
] | null | null | null | BuildingCyberLexicon/spiders/twitter/TweetScraper/scrapeTwitter.py | eneyi/CyberLexicon | b5d3e0245675fd692eae4a98df5d0c85604cfaba | [
"MIT"
] | 1 | 2020-10-13T11:56:04.000Z | 2020-10-13T11:56:04.000Z | import os
from time import sleep
#use hastags and mentions from cyber war news articles as filters on twitter
if __name__ == "__main__":
hashtags = getMentionsAndHashtags()
for hashtag in hashtags:
outfile = "../../../outputfiles/twitter/"+str(hashtag).replace("#","").replace("@","")+".json"
... | 36.461538 | 127 | 0.594937 | import os
from time import sleep
import json
#use hastags and mentions from cyber war news articles as filters on twitter
def getMentionsAndHashtags():
with open("../../../outputfiles/cwn.json", "r+") as ff:
data = ff.read()
hashtagsMentions, data =[], json.loads(data)
for dd in data:
... | 0 | 0 | 0 | 0 | 0 | 408 | 0 | -10 | 44 |
3cb2f495379fa87b1682362e4c498ac0e66b256e | 590 | py | Python | jira.py | 317brian/rando-scripts | ae50080563f8a23783a2806735f508fe0a3bcea2 | [
"Apache-2.0"
] | null | null | null | jira.py | 317brian/rando-scripts | ae50080563f8a23783a2806735f508fe0a3bcea2 | [
"Apache-2.0"
] | null | null | null | jira.py | 317brian/rando-scripts | ae50080563f8a23783a2806735f508fe0a3bcea2 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# You can create the script manually or clone the script and use it script via a symlink:
# For example `ln -s /Users/brian/rando-scripts/jira.py /usr/local/bin/jira`
# Make sure you create an environment variable named JIRA_URL for your terminal, such as .zshenv. Set the env variable equal to h... | 32.777778 | 157 | 0.740678 | #!/usr/bin/env python3
# You can create the script manually or clone the script and use it script via a symlink:
# For example `ln -s /Users/brian/rando-scripts/jira.py /usr/local/bin/jira`
# Make sure you create an environment variable named JIRA_URL for your terminal, such as .zshenv. Set the env variable equal to h... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
53a43e6290b908719c9b324da356c61fb8a8fb1c | 1,159 | py | Python | ps/samsung/treetech.py | underflow101/code-example | 1010a7ec6f8b5bf3ef5dbfad2ba075fd785b0cb0 | [
"MIT"
] | null | null | null | ps/samsung/treetech.py | underflow101/code-example | 1010a7ec6f8b5bf3ef5dbfad2ba075fd785b0cb0 | [
"MIT"
] | null | null | null | ps/samsung/treetech.py | underflow101/code-example | 1010a7ec6f8b5bf3ef5dbfad2ba075fd785b0cb0 | [
"MIT"
] | null | null | null | # treetech.py
# boj 16235
# input = stdin.readline
dx = (-1, -1, -1, 0, 0, 1, 1, 1)
dy = (-1, 0, 1, -1, 1, -1, 0, 1)
n, m, k = map(int, input().split())
mp = [[5] * n for _ in range(n)]
fert = [list(map(int, input().split())) for _ in range(n)]
tree = list()
for _ in range(m):
_x, _y, _z = map(int, input().split... | 25.195652 | 71 | 0.459879 | # treetech.py
# boj 16235
from sys import stdin
# input = stdin.readline
dx = (-1, -1, -1, 0, 0, 1, 1, 1)
dy = (-1, 0, 1, -1, 1, -1, 0, 1)
n, m, k = map(int, input().split())
mp = [[5] * n for _ in range(n)]
fert = [list(map(int, input().split())) for _ in range(n)]
tree = list()
for _ in range(m):
_x, _y, _z =... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 23 |
fbf7afe96ab301b5ab9ef4b0a41511d602b18303 | 1,502 | py | Python | checker/constants.py | OrphicHymns/Monolith | cacc453945f8d6209cc40d54f7212e7555898c86 | [
"MIT"
] | 2 | 2021-10-17T04:39:50.000Z | 2022-01-10T12:35:25.000Z | checker/constants.py | OrphicHymns/Monolith | cacc453945f8d6209cc40d54f7212e7555898c86 | [
"MIT"
] | null | null | null | checker/constants.py | OrphicHymns/Monolith | cacc453945f8d6209cc40d54f7212e7555898c86 | [
"MIT"
] | null | null | null | MOJANG_AUTH = "https://authserver.mojang.com/authenticate"
JSON_POST_HEADERS = {
"Content-Type": "application/json",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) "
"Chrome/91.0.4472.164 Safari/537.36 "
}
HTTP_HEADERS = {
"Upgrade-... | 42.914286 | 102 | 0.310919 | MOJANG_AUTH = "https://authserver.mojang.com/authenticate"
JSON_POST_HEADERS = {
"Content-Type": "application/json",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) "
"Chrome/91.0.4472.164 Safari/537.36 "
}
HTTP_HEADERS = {
"Upgrade-... | 1,065 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4ff1fa100f6d7beea43b3e70fc84a6e50a168c19 | 3,811 | py | Python | django_usda/management/commands/import_r27.py | alexBLR/django-usda | e9b6a63da5e1dddb347e0c8f965b3d1d8f6ae55e | [
"MIT"
] | 3 | 2015-01-27T12:52:34.000Z | 2020-04-24T16:24:07.000Z | django_usda/management/commands/import_r27.py | alexBLR/django-usda | e9b6a63da5e1dddb347e0c8f965b3d1d8f6ae55e | [
"MIT"
] | null | null | null | django_usda/management/commands/import_r27.py | alexBLR/django-usda | e9b6a63da5e1dddb347e0c8f965b3d1d8f6ae55e | [
"MIT"
] | 3 | 2015-07-03T14:24:30.000Z | 2020-04-25T00:43:40.000Z | from django_usda.models import Food, FoodGroup, FoodLanguaLFactor, LanguaLFactor, NutrientData, Nutrient, Source, Derivation, Weight, Footnote, DataLink, DataSource
appLabel = "django_usda"
modelMap = [
{"fileName": "DATA_SRC.txt", "model": DataSource},
{"fileName": "FD_GROUP.txt", "model": FoodGroup},
{... | 33.725664 | 211 | 0.609027 | from django.core.management.base import BaseCommand, CommandError
from django.db.models.loading import get_model
from django_usda.models import Food, FoodGroup, FoodLanguaLFactor, LanguaLFactor, NutrientData, Nutrient, Source, Derivation, Weight, Footnote, DataLink, DataSource, DeletedFood, DeletedNutrient, DeletedFoot... | 0 | 0 | 0 | 453 | 56 | 2,008 | 0 | 93 | 337 |
d199bc3cf4c227e15be15f7274aef821de06b5f4 | 2,518 | py | Python | vermouth/tests/helper_functions.py | biomolsim/vermouth-martinize | 332295078bfea680da7f488d2a9d61a97b8c9ae9 | [
"Apache-2.0"
] | 35 | 2018-02-16T12:39:33.000Z | 2022-03-24T12:18:36.000Z | vermouth/tests/helper_functions.py | biomolsim/vermouth-martinize | 332295078bfea680da7f488d2a9d61a97b8c9ae9 | [
"Apache-2.0"
] | 300 | 2018-02-16T12:24:32.000Z | 2022-03-31T13:41:36.000Z | vermouth/tests/helper_functions.py | biomolsim/vermouth-martinize | 332295078bfea680da7f488d2a9d61a97b8c9ae9 | [
"Apache-2.0"
] | 25 | 2018-11-07T18:52:07.000Z | 2022-03-06T08:34:38.000Z | # Copyright 2018 University of Groningen
#
# 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 i... | 31.08642 | 95 | 0.662033 | # Copyright 2018 University of Groningen
#
# 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 i... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
22d81486520b473e33b27fff2cfa30651a6f94c5 | 4,123 | py | Python | mne/selection.py | ARudiuk/mne-python | 63feb683cd1f8ddd598a78d12c8ef522f9ca2d78 | [
"BSD-3-Clause"
] | 1 | 2016-05-26T19:37:19.000Z | 2016-05-26T19:37:19.000Z | mne/selection.py | ARudiuk/mne-python | 63feb683cd1f8ddd598a78d12c8ef522f9ca2d78 | [
"BSD-3-Clause"
] | null | null | null | mne/selection.py | ARudiuk/mne-python | 63feb683cd1f8ddd598a78d12c8ef522f9ca2d78 | [
"BSD-3-Clause"
] | null | null | null | # Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Matti Hamalainen <msh@nmr.mgh.harvard.edu>
# Martin Luessi <mluessi@nmr.mgh.harvard.edu>
#
# License: BSD (3-clause)
| 35.239316 | 79 | 0.583071 | # Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Matti Hamalainen <msh@nmr.mgh.harvard.edu>
# Martin Luessi <mluessi@nmr.mgh.harvard.edu>
#
# License: BSD (3-clause)
from os import path
from .io.meas_info import Info
from . import pick_types
from .utils import logger, verbos... | 0 | 3,777 | 0 | 0 | 0 | 0 | 0 | 23 | 113 |
6c3bad3d96508cbe3f4195973059baf235ed402d | 1,364 | py | Python | apply_fortran_template.py | elmanuelito/simple-fortran-parser | 42138901870fa4359bc650049f232ca3720fb01a | [
"MIT"
] | 4 | 2015-11-27T11:13:57.000Z | 2018-05-08T09:01:15.000Z | apply_fortran_template.py | ebranlard/simple-fortran-parser | 42138901870fa4359bc650049f232ca3720fb01a | [
"MIT"
] | null | null | null | apply_fortran_template.py | ebranlard/simple-fortran-parser | 42138901870fa4359bc650049f232ca3720fb01a | [
"MIT"
] | 1 | 2018-08-03T22:02:34.000Z | 2018-08-03T22:02:34.000Z | #!/usr/bin/env python
# --------------------------------------------------------------------------------
# --- PARAMS
# --------------------------------------------------------------------------------
Types=['integer','double precision','real','logical']
Dims =[1,0]
# --------------------------------------------... | 23.118644 | 82 | 0.34824 | #!/usr/bin/env python
# --------------------------------------------------------------------------------
# --- PARAMS
# --------------------------------------------------------------------------------
Types=['integer','double precision','real','logical']
Dims =[1,0]
# --------------------------------------------... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -12 | 22 |
d48cafa96ed56253b58bb41919d2655791e02dea | 281 | py | Python | dummy_device/register_classes.py | fretchen/synqs_devices | ec4bb24639e9d0d4cb707e1c2a6296a47dfe9f02 | [
"MIT"
] | null | null | null | dummy_device/register_classes.py | fretchen/synqs_devices | ec4bb24639e9d0d4cb707e1c2a6296a47dfe9f02 | [
"MIT"
] | 4 | 2020-04-06T14:20:58.000Z | 2020-04-17T10:47:11.000Z | dummy_device/register_classes.py | fretchen/synqs_devices | ec4bb24639e9d0d4cb707e1c2a6296a47dfe9f02 | [
"MIT"
] | 2 | 2020-04-10T08:56:28.000Z | 2020-09-06T20:08:29.000Z | """Register the YunTemp to blacs.
This is boilerplate and should be only minimally changed.
"""
from labscript_devices import register_classes
register_classes(
"DummyDevice",
BLACS_tab="user_devices.dummy_device.blacs_tabs.DummyDeviceTab",
runviewer_parser=None,
)
| 21.615385 | 68 | 0.782918 | """Register the YunTemp to blacs.
This is boilerplate and should be only minimally changed.
"""
from labscript_devices import register_classes
register_classes(
"DummyDevice",
BLACS_tab="user_devices.dummy_device.blacs_tabs.DummyDeviceTab",
runviewer_parser=None,
)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
33ea139d5c0bdc9ba532bf85b6a211c71b4ae8a2 | 790 | py | Python | aplpy/conftest.py | senchp/aplpy | 0081433f8d061073c2f19980d371a8ae76994ea9 | [
"MIT"
] | 1 | 2020-08-12T03:52:50.000Z | 2020-08-12T03:52:50.000Z | aplpy/conftest.py | senchp/aplpy | 0081433f8d061073c2f19980d371a8ae76994ea9 | [
"MIT"
] | null | null | null | aplpy/conftest.py | senchp/aplpy | 0081433f8d061073c2f19980d371a8ae76994ea9 | [
"MIT"
] | null | null | null | # this contains imports plugins that configure py.test for astropy tests.
# by importing them here in conftest.py they are discoverable by py.test
# no matter how it is invoked within the source tree.
# Uncomment the following line to treat all DeprecationWarnings as
# exceptions
enable_deprecations_as_exceptions()
| 34.347826 | 112 | 0.805063 | # this contains imports plugins that configure py.test for astropy tests.
# by importing them here in conftest.py they are discoverable by py.test
# no matter how it is invoked within the source tree.
from astropy.tests.pytest_plugins import *
from astropy.tests.pytest_plugins import pytest_addoption as astropy_pytest... | 0 | 79 | 0 | 0 | 0 | 165 | 0 | 91 | 136 |
732ad0dfe6e7089832beb01c637675ca162227f6 | 2,231 | py | Python | graphql_compiler/tests/integration_tests/integration_backend_config.py | justinaustin/graphql-compiler | 4e68d592fc97855ca043dc20bdf59be4298647ab | [
"Apache-2.0"
] | null | null | null | graphql_compiler/tests/integration_tests/integration_backend_config.py | justinaustin/graphql-compiler | 4e68d592fc97855ca043dc20bdf59be4298647ab | [
"Apache-2.0"
] | null | null | null | graphql_compiler/tests/integration_tests/integration_backend_config.py | justinaustin/graphql-compiler | 4e68d592fc97855ca043dc20bdf59be4298647ab | [
"Apache-2.0"
] | null | null | null | # Copyright 2018-present Kensho Technologies, LLC.
from collections import namedtuple
from six.moves.urllib.parse import quote_plus
from .. import test_backend
DEFAULT_ROOT_PASSWORD = "root" # nosec
SQL_BACKENDS = {
test_backend.POSTGRES,
test_backend.MYSQL,
test_backend.MARIADB,
test_backend.MSSQ... | 29.355263 | 99 | 0.693411 | # Copyright 2018-present Kensho Technologies, LLC.
from collections import namedtuple
from six.moves.urllib.parse import quote_plus
from .. import test_backend
DEFAULT_ROOT_PASSWORD = "root" # nosec
SQL_BACKENDS = {
test_backend.POSTGRES,
test_backend.MYSQL,
test_backend.MARIADB,
test_backend.MSSQ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
517ccb527d0a92db701ebf0e219f5fcbbb838e0e | 1,413 | py | Python | examples/service/arg_check_example.py | ooici/pyon | 122c629290d27f32f2f41dafd5c12469295e8acf | [
"BSD-2-Clause"
] | 2 | 2015-06-09T16:07:09.000Z | 2015-07-28T10:06:31.000Z | examples/service/arg_check_example.py | ooici/pyon | 122c629290d27f32f2f41dafd5c12469295e8acf | [
"BSD-2-Clause"
] | 3 | 2020-07-22T15:14:55.000Z | 2021-12-13T19:35:06.000Z | examples/service/arg_check_example.py | ooici/pyon | 122c629290d27f32f2f41dafd5c12469295e8acf | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
'''
@author Luke Campbel <LCampbell@ASAScience.com>
@file
@date 03/27/12 15:30
@description DESCRIPTION
'''
| 27.173077 | 96 | 0.604388 | #!/usr/bin/env python
'''
@author Luke Campbel <LCampbell@ASAScience.com>
@file
@date 03/27/12 15:30
@description DESCRIPTION
'''
from pyon.util.arg_check import validate_is_instance, validate_in, validate_equal, validate_true
class ArgCheckService(object):
'''
Example Service illustrating how to use the var... | 0 | 0 | 0 | 1,160 | 0 | 0 | 0 | 75 | 45 |
61c5161b9f9bd6ce0d40bbd88906570121b82373 | 1,057 | py | Python | python_version/plateau.py | k3nnywilliam/rover-simulator | c250af46c838fab2dc20161bb1d8a3f6470f1045 | [
"MIT"
] | 1 | 2020-02-18T23:20:44.000Z | 2020-02-18T23:20:44.000Z | python_version/plateau.py | k3nnywilliam/rover-simulator | c250af46c838fab2dc20161bb1d8a3f6470f1045 | [
"MIT"
] | null | null | null | python_version/plateau.py | k3nnywilliam/rover-simulator | c250af46c838fab2dc20161bb1d8a3f6470f1045 | [
"MIT"
] | null | null | null | '''
Written by Kenny William Nyallau 2020
This is a python implementation of Rover challenge
'''
| 26.425 | 82 | 0.525071 | '''
Written by Kenny William Nyallau ©2020
This is a python implementation of Rover challenge
'''
class Plateau:
def __init__(self):
self.px = 0
self.py = 0
self.x = 0
self.y = 0
self.name = ""
def setRoverCoordinates(self, x, y):
self.x = x
self.y = y
... | 2 | 0 | 0 | 935 | 0 | 0 | 0 | 0 | 23 |
166da20936646259d249f9f96026f0761b83bcf2 | 663 | py | Python | obsvail/tests/load_experts.py | sandipan1/robo_rl | 3bcb7caabeba71dd747fadf2355ac42408b7f340 | [
"MIT"
] | 5 | 2018-10-16T03:48:02.000Z | 2021-10-01T08:58:05.000Z | obsvail/tests/load_experts.py | sandipan1/robo_rl | 3bcb7caabeba71dd747fadf2355ac42408b7f340 | [
"MIT"
] | 1 | 2018-10-17T16:19:14.000Z | 2018-10-31T06:19:30.000Z | obsvail/tests/load_experts.py | sandipan1/robo_rl | 3bcb7caabeba71dd747fadf2355ac42408b7f340 | [
"MIT"
] | null | null | null | import pickle
experts_file_path = "../experts/sampled_experts.obs"
with open(experts_file_path, "rb") as f:
expert_trajectories = pickle.load(f)
# (num_experts)
print(len(expert_trajectories))
# (trajectory_length)
print(len(expert_trajectories[0]["trajectory"]))
# (num_observations, 1)
print(expert_trajectori... | 27.625 | 91 | 0.751131 | import pickle
experts_file_path = "../experts/sampled_experts.obs"
with open(experts_file_path, "rb") as f:
expert_trajectories = pickle.load(f)
# (num_experts)
print(len(expert_trajectories))
# (trajectory_length)
print(len(expert_trajectories[0]["trajectory"]))
# (num_observations, 1)
print(expert_trajectori... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
51132cf221eac7d2bc80d0b8468825911b58e7ae | 4,646 | py | Python | navio_tasks/commands/cli_pylint.py | matthewdeanmartin/random_names | 5c78a96e62c7924864c7ef802f995eb55d5a520f | [
"MIT"
] | 8 | 2019-05-24T19:31:38.000Z | 2019-05-28T14:13:56.000Z | navio_tasks/commands/cli_pylint.py | matthewdeanmartin/random_names | 5c78a96e62c7924864c7ef802f995eb55d5a520f | [
"MIT"
] | 17 | 2018-07-14T17:04:49.000Z | 2022-03-24T15:59:11.000Z | navio_tasks/commands/cli_pylint.py | matthewdeanmartin/so_pip | 0ff7ab096352ae3dc316606d1acd5582cfaee25a | [
"MIT"
] | 2 | 2021-03-26T18:34:41.000Z | 2022-03-14T16:27:23.000Z | """
Lots of code gripes.
"""
import os
import shlex
import subprocess
import sys
from typing import List
from navio_tasks import settings as settings
from navio_tasks.cli_commands import check_command_exists, config_pythonpath
from navio_tasks.output import say_and_exit
from navio_tasks.pure_reports.cli_pygount import... | 31.605442 | 87 | 0.602238 | """
Lots of code gripes.
"""
import os
import shlex
import subprocess
import sys
from typing import List
from navio_tasks import settings as settings
from navio_tasks.cli_commands import check_command_exists, config_pythonpath
from navio_tasks.output import say_and_exit
from navio_tasks.pure_reports.cli_pygount import... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 23 | 0 |
27aae263b75fff183863589ccb93f7732b2a47d8 | 763 | py | Python | ckuser/config.py | ds19991999/CKUser | c66ebda6ef5068a79b816de2c57a443b25d7096d | [
"MIT"
] | null | null | null | ckuser/config.py | ds19991999/CKUser | c66ebda6ef5068a79b816de2c57a443b25d7096d | [
"MIT"
] | null | null | null | ckuser/config.py | ds19991999/CKUser | c66ebda6ef5068a79b816de2c57a443b25d7096d | [
"MIT"
] | null | null | null | #!/usr/bin/python3
# -*- coding:utf-8 -*-
"""
mysql> desc userinfors;
+----------+----------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+----------+----------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_incre... | 30.52 | 63 | 0.349934 | #!/usr/bin/python3
# -*- coding:utf-8 -*-
"""
mysql> desc userinfors;
+----------+----------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+----------+----------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_incre... | 0 | 0 | 0 | 0 | 0 | 152 | 0 | 0 | 23 |
12e25ddc4af0bf599e86ed3d6dcf5866baa2d81b | 1,436 | py | Python | generate_computational_graph.py | TalkToTheGAN/RelaxTextGAN | 6d0846392c8a1267eaa103dd70492cb80024079e | [
"Apache-2.0"
] | 3 | 2019-05-30T03:40:38.000Z | 2021-04-12T06:50:41.000Z | generate_computational_graph.py | TalkToTheGAN/RelaxTextGAN | 6d0846392c8a1267eaa103dd70492cb80024079e | [
"Apache-2.0"
] | 1 | 2020-06-15T12:27:56.000Z | 2020-06-15T12:27:56.000Z | generate_computational_graph.py | TalkToTheGAN/RelaxTextGAN | 6d0846392c8a1267eaa103dd70492cb80024079e | [
"Apache-2.0"
] | null | null | null | import torch.nn as nn
import torch.optim as optim
import torch.autograd as autograd
import argparse
parser = argparse.ArgumentParser(description='Training Parameter')
parser.add_argument('--cuda', action='store', default=None, type=int)
opt = parser.parse_args()
print(opt)
# all constants
total_epochs = 20
batch_siz... | 27.09434 | 76 | 0.727716 | import os
import random
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
import torch.autograd as autograd
from torch.autograd import Variable
from models.plain_lstm import PlainLSTM
from utils import Utils
from data_loader import DataLoader
import argpar... | 0 | 0 | 0 | 0 | 0 | 564 | 0 | 64 | 287 |
e5af07709463973f94d2c5f0008791ffee86f7e8 | 7,928 | py | Python | course_selection/scrape_parse.py | recalapp/recal | 1464d5922f3a1fcc0d756565a3a0e8689e9e154d | [
"MIT"
] | 13 | 2017-01-27T18:07:04.000Z | 2022-02-11T19:32:29.000Z | course_selection/scrape_parse.py | kl29/recal | 1464d5922f3a1fcc0d756565a3a0e8689e9e154d | [
"MIT"
] | 14 | 2017-01-08T22:28:49.000Z | 2020-02-05T03:08:08.000Z | course_selection/scrape_parse.py | kl29/recal | 1464d5922f3a1fcc0d756565a3a0e8689e9e154d | [
"MIT"
] | 5 | 2017-12-07T17:41:35.000Z | 2020-04-27T18:24:52.000Z | """
Scrapes OIT's Web Feeds to add courses and sections to database.
Procedure:
- Get list of departments (3-letter department codes)
- Run this: http://etcweb.princeton.edu/webfeeds/courseofferings/?term=current&subject=COS
- Parse it for courses, sections, and lecture times (as recurring events)
"""
| 34.469565 | 97 | 0.577699 | """
Scrapes OIT's Web Feeds to add courses and sections to database.
Procedure:
- Get list of departments (3-letter department codes)
- Run this: http://etcweb.princeton.edu/webfeeds/courseofferings/?term=current&subject=COS
- Parse it for courses, sections, and lecture times (as recurring events)
"""
from lxml impo... | 0 | 0 | 0 | 122 | 0 | 7,356 | 0 | -14 | 157 |
f2ca13584c91841e3c1379b5d63aa670e6391478 | 757 | py | Python | kotti/views/file.py | IonicaBizauKitchen/Kotti | 8f2363a058c77d5d42adb2d12715e4d0530d5208 | [
"PostgreSQL"
] | 191 | 2015-01-05T23:04:06.000Z | 2022-02-15T21:36:34.000Z | kotti/views/file.py | IonicaBizauKitchen/Kotti | 8f2363a058c77d5d42adb2d12715e4d0530d5208 | [
"PostgreSQL"
] | 198 | 2015-01-01T06:27:33.000Z | 2021-02-23T16:39:28.000Z | kotti/views/file.py | IonicaBizauKitchen/Kotti | 8f2363a058c77d5d42adb2d12715e4d0530d5208 | [
"PostgreSQL"
] | 83 | 2015-01-12T14:29:48.000Z | 2022-02-13T09:41:36.000Z |
def includeme(config):
""" Pyramid includeme hook.
:param config: app config
:type config: :class:`pyramid.config.Configurator`
"""
config.scan(__name__)
| 22.264706 | 70 | 0.726552 | from pyramid.view import view_config
from kotti.interfaces import IFile
@view_config(
name="view",
context=IFile,
permission="view",
renderer="kotti:templates/view/file.pt",
)
def view(context, request):
return {}
@view_config(name="inline-view", context=IFile, permission="view")
def inline_vie... | 0 | 434 | 0 | 0 | 0 | 0 | 0 | 28 | 114 |
3644fc77790a588e2cb4c844af28ad7dff6408a8 | 2,721 | py | Python | src/trusted/validator_mips/dgen/dgen_input.py | kapkic/native_client | 51c8bc8c249d55606232ae011bdfc8b4cab3d794 | [
"BSD-3-Clause"
] | 1 | 2021-12-23T00:36:43.000Z | 2021-12-23T00:36:43.000Z | src/trusted/validator_mips/dgen/dgen_input.py | kapkic/native_client | 51c8bc8c249d55606232ae011bdfc8b4cab3d794 | [
"BSD-3-Clause"
] | null | null | null | src/trusted/validator_mips/dgen/dgen_input.py | kapkic/native_client | 51c8bc8c249d55606232ae011bdfc8b4cab3d794 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python2
# Copyright (c) 2012 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
A simple recursive-descent parser for the table file format.
The grammar implemented here is roughly (taking some liberties ... | 21.768 | 80 | 0.603087 | #!/usr/bin/python2
# Copyright (c) 2012 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
A simple recursive-descent parser for the table file format.
The grammar implemented here is roughly (taking some liberties ... | 0 | 0 | 0 | 0 | 0 | 1,311 | 0 | -17 | 206 |
d830915f8e3e69a3330d6ff63d4fe215fdf4d734 | 1,254 | py | Python | app.py | wieczszy/CVsudoku | 2338d4ee8c75c556966022363d636143abd600c9 | [
"MIT"
] | null | null | null | app.py | wieczszy/CVsudoku | 2338d4ee8c75c556966022363d636143abd600c9 | [
"MIT"
] | 1 | 2022-02-10T00:37:26.000Z | 2022-02-10T00:37:26.000Z | app.py | wieczszy/CVsudoku | 2338d4ee8c75c556966022363d636143abd600c9 | [
"MIT"
] | null | null | null | import logging
from argparse import ArgumentParser
from src.classifier import Classifier
from src.reader import ImageReader
from src.solver import SudokuSolver
if __name__ == "__main__":
parser = ArgumentParser()
parser.add_argument("image", help="Input image")
parser.add_argument("-w", "--weights", help=... | 29.162791 | 93 | 0.668262 | import cv2
import numpy as np
import logging
from argparse import ArgumentParser
from src.classifier import Classifier
from src.reader import ImageReader
from src.solver import SudokuSolver
if __name__ == "__main__":
parser = ArgumentParser()
parser.add_argument("image", help="Input image")
parser.add_arg... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -14 | 44 |
e2abc012a866c8d1954bf677e77b2c3d1ef6d887 | 2,011 | py | Python | addressBook/tests.py | rahman-ishtiyak/Directory | f6f66aaa38e596da231c555cb18c53a0669f98a9 | [
"MIT"
] | null | null | null | addressBook/tests.py | rahman-ishtiyak/Directory | f6f66aaa38e596da231c555cb18c53a0669f98a9 | [
"MIT"
] | null | null | null | addressBook/tests.py | rahman-ishtiyak/Directory | f6f66aaa38e596da231c555cb18c53a0669f98a9 | [
"MIT"
] | null | null | null | from django.test import TestCase
# Create your tests here.
"""
Data is not testing or returning 0 due to authentication. Turn off authentication to get proper result
we can use more test case as CRUD.
Instead of testing every possible scenario i have tried to test on local and client and model.
"""
| 32.967213 | 102 | 0.652909 | from django.test import TestCase
from django.test import Client
# Create your tests here.
from django.conf import settings
from django.test import TestCase
from .models import *
class TestModels(TestCase):
def test_model_str_country(self):
data = Country.objects.count()
self.assertEqual(data, 0)
... | 0 | 0 | 0 | 1,565 | 0 | 0 | 0 | 31 | 111 |
81c6e929131f5087231b8a102174208c5768f655 | 7,687 | py | Python | arviz/plots/backends/__init__.py | zaxtax/arviz | c78deefeeb355d3cee11a93fc148f9198dde8b35 | [
"Apache-2.0"
] | 55 | 2015-07-29T12:06:34.000Z | 2018-03-17T05:42:01.000Z | arviz/plots/backends/__init__.py | zaxtax/arviz | c78deefeeb355d3cee11a93fc148f9198dde8b35 | [
"Apache-2.0"
] | 11 | 2015-08-07T20:56:41.000Z | 2018-03-21T15:24:08.000Z | arviz/plots/backends/__init__.py | zaxtax/arviz | c78deefeeb355d3cee11a93fc148f9198dde8b35 | [
"Apache-2.0"
] | 17 | 2015-07-29T13:55:01.000Z | 2018-03-02T17:16:12.000Z | # pylint: disable=no-member,invalid-name,redefined-outer-name
"""ArviZ plotting backends."""
import re
import numpy as np
from pandas import DataFrame
from ...rcparams import rcParams
__all__ = [
"to_cds",
"output_notebook",
"output_file",
"ColumnDataSource",
"create_layout",
"show_layout",
]... | 34.626126 | 98 | 0.619748 | # pylint: disable=no-member,invalid-name,redefined-outer-name
"""ArviZ plotting backends."""
import re
import numpy as np
from pandas import DataFrame
from ...rcparams import rcParams
__all__ = [
"to_cds",
"output_notebook",
"output_file",
"ColumnDataSource",
"create_layout",
"show_layout",
]... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4038bdf4d214176cf5c3d3b92c8642280a111fe2 | 513 | py | Python | web/wsgi.py | apsun/VNaaS | d7f8c3c367068bc14778e7182a342ef1b6c0c634 | [
"MIT"
] | 6 | 2016-05-18T16:11:29.000Z | 2021-02-25T00:54:31.000Z | web/wsgi.py | apsun/VNaaS | d7f8c3c367068bc14778e7182a342ef1b6c0c634 | [
"MIT"
] | null | null | null | web/wsgi.py | apsun/VNaaS | d7f8c3c367068bc14778e7182a342ef1b6c0c634 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
PORT = 8080
if __name__ == "__main__":
main()
| 20.52 | 54 | 0.653021 | #!/usr/bin/env python
import sys
from tornado.wsgi import WSGIContainer
from tornado.httpserver import HTTPServer
from tornado.ioloop import IOLoop
import vnaas
PORT = 8080
def main():
if len(sys.argv) == 1:
port = PORT
elif len(sys.argv) == 2:
port = int(sys.argv[1])
else:
print("... | 0 | 0 | 0 | 0 | 0 | 276 | 0 | 29 | 133 |
3c3122c833af7f81253516b14e983bfae91fa68f | 266 | py | Python | Python-Programing-Basics/First Steps in Coding/First Steps in Coding - Lab/06_concatenate_data/concatanate_date.py | alexanderivanov2/Softuni-Software-Engineering | 8adb96f445f1da17dbb6eded9e9594319154c7e7 | [
"MIT"
] | null | null | null | Python-Programing-Basics/First Steps in Coding/First Steps in Coding - Lab/06_concatenate_data/concatanate_date.py | alexanderivanov2/Softuni-Software-Engineering | 8adb96f445f1da17dbb6eded9e9594319154c7e7 | [
"MIT"
] | null | null | null | Python-Programing-Basics/First Steps in Coding/First Steps in Coding - Lab/06_concatenate_data/concatanate_date.py | alexanderivanov2/Softuni-Software-Engineering | 8adb96f445f1da17dbb6eded9e9594319154c7e7 | [
"MIT"
] | null | null | null | first_name = input()
last_name = input()
age = int(input())
town = input()
concatanate_variables(first_name, last_name, age, town)
| 22.166667 | 77 | 0.703008 | first_name = input()
last_name = input()
age = int(input())
town = input()
def concatanate_variables(fn, ln, ages, place_town):
print(f"You are {fn} {ln}, a {ages}-years old person from {place_town}.")
concatanate_variables(first_name, last_name, age, town)
| 0 | 0 | 0 | 0 | 0 | 109 | 0 | 0 | 23 |
30b872192e3b8c3c9605c77fdc5fa1954cca85e6 | 1,033 | py | Python | aiida_vasp/io/tests/test_outcar_io.py | chrisjsewell/aiida-vasp | 11b6abf728efdba475c2fa24ede41c4ffe8fac64 | [
"MIT"
] | 1 | 2021-06-13T14:40:31.000Z | 2021-06-13T14:40:31.000Z | aiida_vasp/io/tests/test_outcar_io.py | chrisjsewell/aiida-vasp | 11b6abf728efdba475c2fa24ede41c4ffe8fac64 | [
"MIT"
] | null | null | null | aiida_vasp/io/tests/test_outcar_io.py | chrisjsewell/aiida-vasp | 11b6abf728efdba475c2fa24ede41c4ffe8fac64 | [
"MIT"
] | null | null | null | """Test the OUTCAR io interface"""
# pylint: disable=unused-import,redefined-outer-name,unused-argument,unused-wildcard-import,wildcard-import
from aiida_vasp.utils.fixtures.testdata import data_path
from aiida_vasp.io.outcar import OutcarParser
def test_parse_outcar():
"""Parse a reference OUTCAR file with the O... | 41.32 | 107 | 0.734753 | """Test the OUTCAR io interface"""
# pylint: disable=unused-import,redefined-outer-name,unused-argument,unused-wildcard-import,wildcard-import
import pytest
from aiida_vasp.utils.fixtures import *
from aiida_vasp.utils.fixtures.testdata import data_path
from aiida_vasp.io.outcar import OutcarParser
def test_parse_o... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 10 | 46 |
78dfb0de46f72805031b6ac3304e2e0cb7627623 | 7,591 | py | Python | my_models/action_conv.py | Yifanfanfanfan/sifar-pytorch | 888a18414f7187a6fe7dddc2bf5deb9fa2700e63 | [
"Apache-2.0"
] | 20 | 2022-02-19T13:16:07.000Z | 2022-03-24T02:24:00.000Z | my_models/action_conv.py | Yifanfanfanfan/sifar-pytorch | 888a18414f7187a6fe7dddc2bf5deb9fa2700e63 | [
"Apache-2.0"
] | null | null | null | my_models/action_conv.py | Yifanfanfanfan/sifar-pytorch | 888a18414f7187a6fe7dddc2bf5deb9fa2700e63 | [
"Apache-2.0"
] | 5 | 2022-02-07T16:43:11.000Z | 2022-02-21T10:53:15.000Z | # --------------------------------------------------------
# Swin Transformer
# Copyright (c) 2021 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ze Liu
# --------------------------------------------------------
import torch.nn as nn
import logging
import torchvision.models as models
... | 39.536458 | 151 | 0.661178 | # --------------------------------------------------------
# Swin Transformer
# Copyright (c) 2021 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ze Liu
# --------------------------------------------------------
import torch
import torch.nn as nn
from timm.models.layers import DropPa... | 0 | 907 | 0 | 4,263 | 0 | 316 | 0 | 167 | 248 |
aefa93d7bcd48c97f558b280687e6727b5aa6b07 | 1,276 | py | Python | typing/crawl.py | zhuning1999/PythonCode | 8ca9aed385af64763c79a13f1bf9c5b67b0c8a63 | [
"MIT"
] | 28 | 2019-11-08T03:09:59.000Z | 2022-03-09T06:59:04.000Z | typing/crawl.py | zhuning1999/PythonCode | 8ca9aed385af64763c79a13f1bf9c5b67b0c8a63 | [
"MIT"
] | null | null | null | typing/crawl.py | zhuning1999/PythonCode | 8ca9aed385af64763c79a13f1bf9c5b67b0c8a63 | [
"MIT"
] | 50 | 2019-09-17T15:28:34.000Z | 2022-03-29T09:10:12.000Z |
headers = {
"UserAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36"
}
if __name__ == "__main__":
crawl_main()
| 23.2 | 135 | 0.552508 | import time
import random
import requests
from lxml import etree
headers = {
"UserAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36"
}
def is_chinese(word):
# 判断是不是中文
for ch in word:
if '\u4e00' <= ch <= '\u... | 78 | 0 | 0 | 0 | 0 | 867 | 0 | -23 | 192 |
0ee16d8c95d934e2d3c6b60aa7145bb28cff6d95 | 1,429 | py | Python | endtoend_tests/grep.py | pchaigno/grr | 69c81624c281216a45c4bb88a9d4e4b0613a3556 | [
"Apache-2.0"
] | 1 | 2015-01-07T05:29:57.000Z | 2015-01-07T05:29:57.000Z | endtoend_tests/grep.py | pchaigno/grr | 69c81624c281216a45c4bb88a9d4e4b0613a3556 | [
"Apache-2.0"
] | null | null | null | endtoend_tests/grep.py | pchaigno/grr | 69c81624c281216a45c4bb88a9d4e4b0613a3556 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""End to end tests for lib.flows.general.grep."""
| 32.477273 | 74 | 0.6662 | #!/usr/bin/env python
"""End to end tests for lib.flows.general.grep."""
from grr.endtoend_tests import base
from grr.lib import aff4
from grr.lib.rdfvalues import client as rdf_client
class TestSearchFiles(base.AutomatedTest):
"""Test SearchFileContent."""
platforms = ["Linux"]
flow = "SearchFileContent"
t... | 0 | 0 | 0 | 1,194 | 0 | 0 | 0 | 46 | 113 |
6f7d6c235f928d355357114c1a117ab955e5f493 | 298 | py | Python | core/apps/attendance/admin.py | yavuzbektas/StudentAnalayze | 794f433f650633f646bee5cbe08d04afdbd75e84 | [
"MIT"
] | null | null | null | core/apps/attendance/admin.py | yavuzbektas/StudentAnalayze | 794f433f650633f646bee5cbe08d04afdbd75e84 | [
"MIT"
] | null | null | null | core/apps/attendance/admin.py | yavuzbektas/StudentAnalayze | 794f433f650633f646bee5cbe08d04afdbd75e84 | [
"MIT"
] | null | null | null | from django.contrib import admin
# from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
# from django.contrib.auth.models import User
# Register your models here.
from .models import LessonPeriods, DailyAttendance
admin.site.register(LessonPeriods)
admin.site.register(DailyAttendance)
| 33.111111 | 66 | 0.83557 | from django.contrib import admin
# from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
# from django.contrib.auth.models import User
# Register your models here.
from .models import LessonPeriods,DailyAttendance
admin.site.register(LessonPeriods)
admin.site.register(DailyAttendance)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | -1 | 0 |
6e31c41793bea851900f354d8d475f0c33a394ce | 7,904 | py | Python | mobtexting_sms/models/send_sms.py | mobtexting/mobtexting-odoo | 01b1a6f87fc41b8c9f4099476d00023ff84b8372 | [
"MIT"
] | null | null | null | mobtexting_sms/models/send_sms.py | mobtexting/mobtexting-odoo | 01b1a6f87fc41b8c9f4099476d00023ff84b8372 | [
"MIT"
] | null | null | null | mobtexting_sms/models/send_sms.py | mobtexting/mobtexting-odoo | 01b1a6f87fc41b8c9f4099476d00023ff84b8372 | [
"MIT"
] | null | null | null | import logging
import datetime
from urllib.parse import urlencode, quote as quote
from functools import reduce
_logger = logging.getLogger(__name__)
try:
from jinja2.sandbox import SandboxedEnvironment
mako_template_env = SandboxedEnvironment(
block_start_string="<%",
block_end_string="%>",
... | 42.042553 | 207 | 0.573001 | import logging
from odoo import http
from odoo.exceptions import except_orm, UserError, Warning
from odoo.http import request, serialize_exception as _serialize_exception, content_disposition
from odoo import api, fields, models, tools, _
import datetime
from urllib.parse import urlencode, quote as quote
import urllib.... | 0 | 0 | 0 | 6,384 | 0 | 0 | 0 | 106 | 198 |
5fe7c27af5807b5b054a2d1aaee39cfae6b4adb3 | 606 | py | Python | OpenSees/SRC/interpreter/test.py | kuanshi/ductile-fracture | ccb350564df54f5c5ec3a079100effe261b46650 | [
"MIT"
] | 8 | 2019-03-05T16:25:10.000Z | 2020-04-17T14:12:03.000Z | examples/test.py | ElsevierSoftwareX/SOFTX-D-17-00072 | b7aa03d0243dce5fa3c79e53a753ceb871926908 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | examples/test.py | ElsevierSoftwareX/SOFTX-D-17-00072 | b7aa03d0243dce5fa3c79e53a753ceb871926908 | [
"BSD-2-Clause-FreeBSD"
] | 5 | 2018-02-26T09:38:24.000Z | 2020-11-26T15:38:56.000Z | import opensees as ops
ops.wipe()
ops.uniaxialMaterial("Elastic", 1, 1000.);
ops.testUniaxialMaterial(1);
for strain in [0.01, 0.02, 0.03, 0.04, 0.05]:
ops.setStrain(strain);
print("strain: ", str(ops.getStrain()), " stress: ", str(ops.getStress()), " tangent: ", str(ops.getTangent()));
ops.uniaxialMaterial... | 31.894737 | 116 | 0.650165 | import opensees as ops
ops.wipe()
ops.uniaxialMaterial("Elastic", 1, 1000.);
ops.testUniaxialMaterial(1);
for strain in [0.01, 0.02, 0.03, 0.04, 0.05]:
ops.setStrain(strain);
print("strain: ", str(ops.getStrain()), " stress: ", str(ops.getStress()), " tangent: ", str(ops.getTangent()));
ops.uniaxialMaterial... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c7e6af834f54b88f53d67454458b733d57a12bf3 | 9,923 | py | Python | know/scrap/pieces.py | otosense/know | 1e0688dedb48335644464c6be35ca91afdb5b2e3 | [
"Apache-2.0"
] | null | null | null | know/scrap/pieces.py | otosense/know | 1e0688dedb48335644464c6be35ca91afdb5b2e3 | [
"Apache-2.0"
] | 1 | 2021-11-24T20:46:33.000Z | 2021-11-24T20:46:33.000Z | know/scrap/pieces.py | otosense/know | 1e0688dedb48335644464c6be35ca91afdb5b2e3 | [
"Apache-2.0"
] | null | null | null | """pieces of thing for inspiration
"""
from i2 import Pipe
from typing import Callable, Any
from i2 import Pipe
from know.util import (FiltFunc)
always: FiltFunc
Hunker: HunkerType
# TODO: Make smart default for stop_condition. If finite iterable, use any_value_is_none?
no_more_data = type('no_more_data', (), {})
... | 31.009375 | 89 | 0.620377 | """pieces of thing for inspiration
"""
import itertools
from dataclasses import dataclass
from itertools import takewhile as itertools_takewhile
from atypes import Slab
from creek import Creek
from creek.util import to_iterator
from i2 import MultiObj, FuncFanout, ContextFanout, Pipe
from typing import Callable, Iter... | 0 | 3,199 | 0 | 2,677 | 0 | 1,717 | 0 | 290 | 362 |
2ef422cadf4f6a9f51b16cd6259af716310db401 | 722 | py | Python | core/migrations/0015_auto_20210116_1202.py | Specialistik/my_internet | fedbc0266b2646f0ec19ea89ead7d0342ff79d81 | [
"MIT"
] | null | null | null | core/migrations/0015_auto_20210116_1202.py | Specialistik/my_internet | fedbc0266b2646f0ec19ea89ead7d0342ff79d81 | [
"MIT"
] | null | null | null | core/migrations/0015_auto_20210116_1202.py | Specialistik/my_internet | fedbc0266b2646f0ec19ea89ead7d0342ff79d81 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.4 on 2021-01-16 09:02
| 28.88 | 134 | 0.619114 | # Generated by Django 3.1.4 on 2021-01-16 09:02
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0014_auto_20210116_1202'),
]
operations = [
migrations.AlterField(
model_name='payment',
nam... | 64 | 0 | 0 | 560 | 0 | 0 | 0 | 13 | 68 |
8773f63df6fbc10b6d52360a5354fbed727f45aa | 890 | py | Python | apps/vars/site_config.py | wizzzet/todo_backend | 58d27a639899514a3b10058cebb82c9b420a5bcc | [
"MIT"
] | null | null | null | apps/vars/site_config.py | wizzzet/todo_backend | 58d27a639899514a3b10058cebb82c9b420a5bcc | [
"MIT"
] | null | null | null | apps/vars/site_config.py | wizzzet/todo_backend | 58d27a639899514a3b10058cebb82c9b420a5bcc | [
"MIT"
] | null | null | null | import datetime
CACHE_TIMEOUT = datetime.timedelta(0, 30)
site_config = SiteConfigs()
| 22.25 | 63 | 0.626966 | import datetime
from snippets.utils.datetime import utcnow
from vars.models import SiteConfig
CACHE_TIMEOUT = datetime.timedelta(0, 30)
class SiteConfigs(object):
def __init__(self):
self.last_modified = None
self.configs = None
def index(self, force=False):
now = utcnow()
... | 0 | 0 | 0 | 697 | 0 | 0 | 0 | 34 | 68 |
0249338edf6fa8f543122d623322698d0e9205f4 | 16,213 | py | Python | plotting_functions.py | h-mayorquin/attractor_sequences | 885271f30d73a58a7aad83b55949e4e32ba0b45a | [
"MIT"
] | 1 | 2016-08-19T18:58:51.000Z | 2016-08-19T18:58:51.000Z | plotting_functions.py | h-mayorquin/attractor_sequences | 885271f30d73a58a7aad83b55949e4e32ba0b45a | [
"MIT"
] | null | null | null | plotting_functions.py | h-mayorquin/attractor_sequences | 885271f30d73a58a7aad83b55949e4e32ba0b45a | [
"MIT"
] | null | null | null | import seaborn as sns
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
from analysis_functions import calculate_angle_from_history, calculate_winning_pattern_from_distances
from analysis_functions import calculate_patterns_timings
def set_text(ax, coordinate_... | 33.428866 | 120 | 0.645593 | import seaborn as sns
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
from mpl_toolkits.axes_grid1 import make_axes_locatable
from data_transformer import transform_neural_to_normal
from analysis_functions import calculate_angle_from_history, calculate_winni... | 0 | 0 | 0 | 0 | 0 | 11,424 | 0 | 68 | 230 |
12c890bdbd604a4966085d68d959b37602ac980f | 2,704 | py | Python | synapse/_scripts/export_signing_key.py | Fizzadar/synapse | 6b46c3eb3d526d903e1e4833b2e8ae9b73de8502 | [
"Apache-2.0"
] | null | null | null | synapse/_scripts/export_signing_key.py | Fizzadar/synapse | 6b46c3eb3d526d903e1e4833b2e8ae9b73de8502 | [
"Apache-2.0"
] | null | null | null | synapse/_scripts/export_signing_key.py | Fizzadar/synapse | 6b46c3eb3d526d903e1e4833b2e8ae9b73de8502 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright 2019 The Matrix.org Foundation C.I.C.
#
# 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 ... | 26.252427 | 86 | 0.60503 | #!/usr/bin/env python
# Copyright 2019 The Matrix.org Foundation C.I.C.
#
# 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 ... | 0 | 0 | 0 | 0 | 0 | 1,746 | 0 | 71 | 225 |
13bb8da2ca5eeda7d756f842c47cc33eab784784 | 8,620 | py | Python | data_loader/data_loader.py | SigureMo/shoeprint-recognition | fe9288938827497c8b555f4fea98e96487943d44 | [
"MIT"
] | 1 | 2020-04-06T05:37:03.000Z | 2020-04-06T05:37:03.000Z | data_loader/data_loader.py | cattidea/shoeprint-recognition | fe9288938827497c8b555f4fea98e96487943d44 | [
"MIT"
] | 2 | 2019-12-16T23:43:38.000Z | 2020-02-01T07:01:39.000Z | data_loader/data_loader.py | cattidea/shoeprint-recognition | fe9288938827497c8b555f4fea98e96487943d44 | [
"MIT"
] | 1 | 2019-11-29T16:41:28.000Z | 2019-11-29T16:41:28.000Z | import os
import json
import h5py
import numpy as np
from config_parser.config import PATHS
H5_PATH = PATHS["h5_path"]
JSON_PATH = PATHS["json_path"]
SHOEPRINT_DIR = PATHS["shoeprint_dir"]
SAMPLE_DIR = PATHS["sample_dir"]
SHOEPRINT_DIR_TEST = PATHS["shoeprint_test_dir"]
DETERMINE_FILE = PATHS["determine_file"]
DETERM... | 32.900763 | 103 | 0.594896 | import os
import json
import h5py
import random
import numpy as np
from config_parser.config import PATHS, DEBUG
from data_loader.base import CacheLoader
from data_loader.image import image2array
H5_PATH = PATHS["h5_path"]
JSON_PATH = PATHS["json_path"]
SHOEPRINT_DIR = PATHS["shoeprint_dir"]
SAMPLE_DIR = PATHS["sampl... | 813 | 6,505 | 0 | 0 | 0 | 0 | 0 | 38 | 181 |
a2e702854416df3867f7115a181a4fd224ad1bcc | 6,444 | py | Python | src/utils.py | annihilatorrrr/opentele | ff90c36a867cf7902e80f480a35041c5e7902e4c | [
"MIT"
] | 30 | 2022-01-17T20:46:02.000Z | 2022-03-31T18:49:07.000Z | src/utils.py | studasd/opentele | ff90c36a867cf7902e80f480a35041c5e7902e4c | [
"MIT"
] | 4 | 2022-02-13T10:21:12.000Z | 2022-03-28T16:05:51.000Z | src/utils.py | studasd/opentele | ff90c36a867cf7902e80f480a35041c5e7902e4c | [
"MIT"
] | 9 | 2022-01-24T18:02:08.000Z | 2022-03-24T14:23:16.000Z | from __future__ import annotations
from typing import Callable, TypeVar, Any
APP_VERSION = 3004000
TDF_MAGIC = b"TDF$"
_T = TypeVar("_T")
_TCLS = TypeVar("_TCLS", bound=type)
_RT = TypeVar("_RT")
_F = TypeVar("_F", bound=Callable[..., Any])
| 30.980769 | 123 | 0.575109 | from __future__ import annotations
from . import debug
from typing import Coroutine, Tuple, Type, Callable, TypeVar, Optional, List, Any, Dict
from types import FunctionType
import abc
APP_VERSION = 3004000
TDF_MAGIC = b"TDF$"
_T = TypeVar("_T")
_TCLS = TypeVar("_TCLS", bound=type)
_RT = TypeVar("_RT")
_F = TypeVa... | 0 | 1,017 | 0 | 4,929 | 0 | 0 | 0 | 42 | 206 |
d06f09440a6a5fcdcc7fe798643dc77e8de50601 | 5,021 | py | Python | qa/tasks/cram.py | rpratap-bot/ceph | 9834961a66927ae856935591f2fd51082e2ee484 | [
"MIT"
] | 4 | 2020-04-08T03:42:02.000Z | 2020-10-01T20:34:48.000Z | qa/tasks/cram.py | rpratap-bot/ceph | 9834961a66927ae856935591f2fd51082e2ee484 | [
"MIT"
] | 93 | 2020-03-26T14:29:14.000Z | 2020-11-12T05:54:55.000Z | qa/tasks/cram.py | rpratap-bot/ceph | 9834961a66927ae856935591f2fd51082e2ee484 | [
"MIT"
] | 23 | 2020-03-24T10:28:44.000Z | 2020-09-24T09:42:19.000Z | """
Cram tests
"""
import logging
import os
import six
from tasks.util.workunit import get_refspec_after_overrides
from teuthology import misc as teuthology
from teuthology.parallel import parallel
from teuthology.orchestra import run
from teuthology.config import config as teuth_config
log = logging.getLogger(__na... | 33.032895 | 87 | 0.5238 | """
Cram tests
"""
import logging
import os
import six
from tasks.util.workunit import get_refspec_after_overrides
from teuthology import misc as teuthology
from teuthology.parallel import parallel
from teuthology.orchestra import run
from teuthology.config import config as teuth_config
log = logging.getLogger(__na... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
aa18e439d183a51bf3e6d04d8f0c183825d9ae89 | 4,211 | py | Python | codes/unique1_pairs_review.py | gordeli/JCR_LIARspaper | cd2eee016e0dfe36d9c947be9c1523cfa1badac2 | [
"MIT"
] | null | null | null | codes/unique1_pairs_review.py | gordeli/JCR_LIARspaper | cd2eee016e0dfe36d9c947be9c1523cfa1badac2 | [
"MIT"
] | null | null | null | codes/unique1_pairs_review.py | gordeli/JCR_LIARspaper | cd2eee016e0dfe36d9c947be9c1523cfa1badac2 | [
"MIT"
] | null | null | null | # This code calculates the number of unique words in each review:
# from pathos.multiprocessing import ProcessingPool as Pool
import multiprocessing
from multiprocessing.pool import Pool
from tqdm import tqdm
import time
# import timing
from nltk.tokenize import sent_tokenize, word_tokenize
import sqlite3
import shu... | 35.686441 | 223 | 0.666588 | # This code calculates the number of unique words in each review:
# from pathos.multiprocessing import ProcessingPool as Pool
import multiprocessing
from multiprocessing.pool import Pool
from tqdm import tqdm
import time
# import timing
import re # import the library for regular expressions
from nltk.tokenize import ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -12 | 67 |
8cdb7958b0bb8caf4566be41008f5ddad98b4203 | 4,450 | py | Python | apps/flaskexample/views.py | joelmpiper/bill_taxonomy | 9284dfae905ca8efa558b4fd93469d03cf4b8074 | [
"MIT"
] | null | null | null | apps/flaskexample/views.py | joelmpiper/bill_taxonomy | 9284dfae905ca8efa558b4fd93469d03cf4b8074 | [
"MIT"
] | null | null | null | apps/flaskexample/views.py | joelmpiper/bill_taxonomy | 9284dfae905ca8efa558b4fd93469d03cf4b8074 | [
"MIT"
] | null | null | null | from sqlalchemy import create_engine
import psycopg2
import yaml
ymlfile = open("../configs.yml", 'r')
cfg = yaml.load(ymlfile)
ymlfile.close()
dbname = cfg['dbname']
user = cfg['username']
host = 'localhost'
db = create_engine('postgres://%s%s/%s' % (user, host, dbname))
con = None
con = psycopg2.connect(database=db... | 29.865772 | 72 | 0.63618 | from flask import render_template
from flask import request
from flaskexample import app
from sqlalchemy import create_engine
import pandas as pd
import psycopg2
import yaml
from a_Model import ModelIt
from flaskexample.support_functions import formatted_query
ymlfile = open("../configs.yml", 'r')
cfg = yaml.load(ymlf... | 0 | 3,725 | 0 | 0 | 0 | 0 | 0 | 64 | 316 |
919c91b562b34a6a6b8fa222823d83beb6c23d2d | 71 | py | Python | bempy/django/blocks/cssreset/__init__.py | svetlyak40wt/bempy | ad87982d17c2d14c344d9e3d91a48c37dfb72535 | [
"BSD-3-Clause"
] | 1 | 2015-04-29T15:19:45.000Z | 2015-04-29T15:19:45.000Z | bempy/django/blocks/cssreset/__init__.py | svetlyak40wt/bempy | ad87982d17c2d14c344d9e3d91a48c37dfb72535 | [
"BSD-3-Clause"
] | null | null | null | bempy/django/blocks/cssreset/__init__.py | svetlyak40wt/bempy | ad87982d17c2d14c344d9e3d91a48c37dfb72535 | [
"BSD-3-Clause"
] | 1 | 2019-06-10T16:08:54.000Z | 2019-06-10T16:08:54.000Z | from bempy import context_blocks
context_blocks('cssreset', locals())
| 17.75 | 36 | 0.802817 | from bempy import context_blocks
context_blocks('cssreset', locals())
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c5098c62114ee7e651fe7e22098a41baf587b44f | 2,457 | py | Python | tests/functional/tabloid/test_dbp_2146_distinct_not_in.py | FirebirdSQL/firebird-qa | 96af2def7f905a06f178e2a80a2c8be4a4b44782 | [
"MIT"
] | 1 | 2022-02-05T11:37:13.000Z | 2022-02-05T11:37:13.000Z | tests/functional/tabloid/test_dbp_2146_distinct_not_in.py | FirebirdSQL/firebird-qa | 96af2def7f905a06f178e2a80a2c8be4a4b44782 | [
"MIT"
] | 1 | 2021-09-03T11:47:00.000Z | 2021-09-03T12:42:10.000Z | tests/functional/tabloid/test_dbp_2146_distinct_not_in.py | FirebirdSQL/firebird-qa | 96af2def7f905a06f178e2a80a2c8be4a4b44782 | [
"MIT"
] | 1 | 2021-06-30T14:14:16.000Z | 2021-06-30T14:14:16.000Z | #coding:utf-8
#
# id: functional.tabloid.dbp_2146_distinct_not_in
# title: Common SQL. Check correctness of the results
# decription:
# tracker_id:
# min_versions: ['2.5']
# versions: 2.5
# qmid: None
from firebird.qa import db_factory, isql_act
# version: 2.5
# resources: None
subs... | 23.4 | 73 | 0.49654 | #coding:utf-8
#
# id: functional.tabloid.dbp_2146_distinct_not_in
# title: Common SQL. Check correctness of the results
# decription:
# tracker_id:
# min_versions: ['2.5']
# versions: 2.5
# qmid: None
import pytest
from firebird.qa import db_factory, isql_act, Action
# version: 2.5
... | 0 | 162 | 0 | 0 | 0 | 0 | 0 | 0 | 46 |
c5cc06f128837cada07ecbefad07ffa87dff0290 | 240 | py | Python | exemplos/connect.py | Fr4ncisTaylor/HubSale-api | 30a2c0900b2c37503e9ba1df7b93381552eef746 | [
"Apache-2.0"
] | 1 | 2021-02-26T16:25:26.000Z | 2021-02-26T16:25:26.000Z | exemplos/connect.py | Fr4ncisTaylor/hubsaleapi | 30a2c0900b2c37503e9ba1df7b93381552eef746 | [
"Apache-2.0"
] | null | null | null | exemplos/connect.py | Fr4ncisTaylor/hubsaleapi | 30a2c0900b2c37503e9ba1df7b93381552eef746 | [
"Apache-2.0"
] | null | null | null | from HubSale import HubSale
client_id = ""
client_secret = ""
hubsale = HubSale(client_id, client_secret)
code, message = hubsale.connect()
if code:
print("Success!!!")
else:
print('Oops,', message) | 18.461538 | 49 | 0.695833 | from HubSale import HubSale
from pprint import pprint
client_id = ""
client_secret = ""
hubsale = HubSale(client_id, client_secret)
code, message = hubsale.connect()
if code:
print("Success!!!")
else:
print('Oops,', message) | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 | 22 |
39199a0dac7cb4544d8a1d3056e6f89535893cd2 | 1,816 | py | Python | p22.py | nymoral/euler | 9dcc1bb6c733e3164e06e97f2363993fb932f5fc | [
"MIT"
] | null | null | null | p22.py | nymoral/euler | 9dcc1bb6c733e3164e06e97f2363993fb932f5fc | [
"MIT"
] | null | null | null | p22.py | nymoral/euler | 9dcc1bb6c733e3164e06e97f2363993fb932f5fc | [
"MIT"
] | null | null | null | """"""
Using names.txt (right click and 'Save Link/Target As...'), a 46K text file containing over five-thousand first names,
begin by sorting it into alphabetical order. Then working out the alphabetical value for each name,
multiply this value by its alphabetical position in the list to obtain a name score.
For examp... | 46.564103 | 118 | 0.686123 | """"""
Using names.txt (right click and 'Save Link/Target As...'), a 46K text file containing over five-thousand first names,
begin by sorting it into alphabetical order. Then working out the alphabetical value for each name,
multiply this value by its alphabetical position in the list to obtain a name score.
For examp... | 4 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
1dee287b2d62edc7d71ebd34ed6960379afab04b | 1,489 | py | Python | seapy/subsystems/subsystemstructural.py | FRidh/seapy | de63acdb3722c2558fc1ad1e1eca92abdd027932 | [
"BSD-3-Clause"
] | 8 | 2015-07-02T13:34:06.000Z | 2021-05-17T21:34:07.000Z | seapy/subsystems/subsystemstructural.py | FRidh/seapy | de63acdb3722c2558fc1ad1e1eca92abdd027932 | [
"BSD-3-Clause"
] | 2 | 2015-11-09T17:16:07.000Z | 2020-02-19T14:00:20.000Z | seapy/subsystems/subsystemstructural.py | FRidh/seapy | de63acdb3722c2558fc1ad1e1eca92abdd027932 | [
"BSD-3-Clause"
] | 2 | 2021-02-03T08:56:10.000Z | 2022-01-22T02:21:43.000Z | """
Structural subsystem
--------------------
"""
| 24.409836 | 78 | 0.549362 | """
Structural subsystem
--------------------
"""
import numpy as np
from .subsystem import Subsystem
class SubsystemStructural(Subsystem):
"""
Abstract base class for all structural subsystems.
"""
@property
def conductance_point_average(self):
"""
Average point conductance of a... | 0 | 1,167 | 0 | 195 | 0 | 0 | 0 | 8 | 67 |
2de3988f5f3f55418bcf982e177c0e4958dcc16d | 658 | py | Python | src/bpp/migrations/0209_auto_20200421_0013.py | iplweb/django-bpp | 85f183a99d8d5027ae4772efac1e4a9f21675849 | [
"BSD-3-Clause"
] | 1 | 2017-04-27T19:50:02.000Z | 2017-04-27T19:50:02.000Z | src/bpp/migrations/0209_auto_20200421_0013.py | mpasternak/django-bpp | 434338821d5ad1aaee598f6327151aba0af66f5e | [
"BSD-3-Clause"
] | 41 | 2019-11-07T00:07:02.000Z | 2022-02-27T22:09:39.000Z | src/bpp/migrations/0209_auto_20200421_0013.py | iplweb/bpp | f027415cc3faf1ca79082bf7bacd4be35b1a6fdf | [
"BSD-3-Clause"
] | null | null | null | # Generated by Django 3.0.4 on 2020-04-20 22:13
| 24.37037 | 57 | 0.541033 | # Generated by Django 3.0.4 on 2020-04-20 22:13
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("bpp", "0208_auto_20200329_1719"),
]
operations = [
migrations.AddField(
model_name="jednostka",
name="kolejnosc",
... | 0 | 0 | 0 | 544 | 0 | 0 | 0 | 19 | 46 |
4442a9eecfc51a9e00395d578a891bed115d0a95 | 3,159 | py | Python | setup.py | aerophile/python-irtrans | 20eee51b91d58d2b8dc18612003e67f9282f542f | [
"MIT"
] | null | null | null | setup.py | aerophile/python-irtrans | 20eee51b91d58d2b8dc18612003e67f9282f542f | [
"MIT"
] | null | null | null | setup.py | aerophile/python-irtrans | 20eee51b91d58d2b8dc18612003e67f9282f542f | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import os
import sys
import warnings
from setuptools import setup, Extension
from Cython.Distutils import build_ext
dist_dir = os.path.dirname(os.path.abspath(__file__))
os.system("gunzip -kf %s/irtrans/models/* 2> /dev/null" %dist_d... | 30.375 | 135 | 0.623615 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import os
import sys
import warnings
from setuptools import setup, Extension
from Cython.Distutils import build_ext
dist_dir = os.path.dirname(os.path.abspath(__file__))
os.system("gunzip -kf %s/irtrans/models/* 2> /dev/null" %dist_d... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -8 | 26 |
19e75cc217ce5dc119f9366c8c80e75e7a2d1ef1 | 1,286 | py | Python | ycsb/data.py | basicthinker/scripts | ba4057e37234754f689205dee7b63577e0856854 | [
"Apache-2.0"
] | null | null | null | ycsb/data.py | basicthinker/scripts | ba4057e37234754f689205dee7b63577e0856854 | [
"Apache-2.0"
] | null | null | null | ycsb/data.py | basicthinker/scripts | ba4057e37234754f689205dee7b63577e0856854 | [
"Apache-2.0"
] | null | null | null | # Created on Jan 12 2015
__author__ = "Jinglei Ren"
__copyright__ = "Copyright (c) 2015 Jinglei Ren"
__email__ = "jinglei@ren.systems"
RESULTS_FILE = 'ycsb-redis.results'
| 27.956522 | 75 | 0.598756 | # Created on Jan 12 2015
import statistics
import math
import os
__author__ = "Jinglei Ren"
__copyright__ = "Copyright (c) 2015 Jinglei Ren"
__email__ = "jinglei@ren.systems"
RESULTS_FILE = 'ycsb-redis.results'
def parse(output):
run = {}
for line in output.split('\n'):
segs = [seg.strip() for seg ... | 0 | 0 | 0 | 0 | 0 | 1,001 | 0 | -26 | 136 |
94fdd0fca38bc277dfec464921116db4b10e633c | 11,123 | py | Python | shell/export_candidates.py | malks/carreiras | 014b95c985c36186fabe46b1f238b8fe871e724e | [
"MIT"
] | null | null | null | shell/export_candidates.py | malks/carreiras | 014b95c985c36186fabe46b1f238b8fe871e724e | [
"MIT"
] | null | null | null | shell/export_candidates.py | malks/carreiras | 014b95c985c36186fabe46b1f238b8fe871e724e | [
"MIT"
] | null | null | null | from oracle_conn import new_conn as oc_conn
from mysql_connection import run_select as sql_select, new_conn as sql_conn
from datetime import datetime
#Get country code from senior based on country name
#Get city code from senior based on city name
#Get state code from senior based on state name
#Get district code... | 45.773663 | 838 | 0.711229 | from oracle_conn import run_select as oc_select, run_insert as oc_insert, run_sql as oc_sql, new_conn as oc_conn
from mysql_connection import run_select as sql_select,run_sql,new_conn as sql_conn
from datetime import datetime
import re
#Get country code from senior based on country name
def get_country_code_from_name... | 40 | 0 | 0 | 0 | 0 | 6,538 | 0 | 64 | 308 |