hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | 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 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | 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 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | 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 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
48de78818b665dd3fbb2cb85b03940b713e2a9ee | 93 | py | Python | aioazstorage/__init__.py | rcarmo/aioazstorage | cdd06f68fe43b4b9308330744b639dd38ddcedb1 | [
"MIT"
] | 2 | 2019-07-09T13:54:59.000Z | 2021-01-23T15:25:27.000Z | aioazstorage/__init__.py | rcarmo/aioazstorage | cdd06f68fe43b4b9308330744b639dd38ddcedb1 | [
"MIT"
] | 1 | 2020-02-04T15:08:53.000Z | 2020-02-04T15:08:53.000Z | aioazstorage/__init__.py | rcarmo/aioazstorage | cdd06f68fe43b4b9308330744b639dd38ddcedb1 | [
"MIT"
] | 1 | 2021-01-23T15:25:29.000Z | 2021-01-23T15:25:29.000Z | from .tables import TableClient
from .queues import QueueClient
from .blobs import BlobClient | 31 | 31 | 0.849462 |
c21c4b43407b0a45354aff31c8ecbb99d35b30bd | 17,024 | py | Python | encode_utils/MetaDataRegistration/eu_register.py | StanfordBioinformatics/encode_utils | f681f4d928d606d417557d6f3ed26f0affa45193 | [
"MIT"
] | 3 | 2018-02-05T03:18:04.000Z | 2019-01-16T21:40:19.000Z | encode_utils/MetaDataRegistration/eu_register.py | StanfordBioinformatics/encode_utils | f681f4d928d606d417557d6f3ed26f0affa45193 | [
"MIT"
] | 28 | 2018-03-20T18:41:48.000Z | 2022-03-31T23:16:02.000Z | encode_utils/MetaDataRegistration/eu_register.py | StanfordBioinformatics/encode_utils | f681f4d928d606d417557d6f3ed26f0affa45193 | [
"MIT"
] | 12 | 2018-02-12T04:11:20.000Z | 2021-12-09T15:56:36.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
###
# © 2018 The Board of Trustees of the Leland Stanford Junior University
# Nathaniel Watson
# nathankw@stanford.edu
###
"""
Given a tab-delimited or JSON input file containing one or more records belonging to one of the profiles
listed on the ENCODE Portal (such as ht... | 43.651282 | 146 | 0.658717 |
12b1db7a624f0dc1a6669293185c70ce513a904d | 1,915 | py | Python | docs/conf.py | chslink/antispam | 0cf57251d036c46ae934504a0f7f952128bb4f73 | [
"MIT"
] | 117 | 2015-12-10T17:53:21.000Z | 2022-02-13T01:37:31.000Z | docs/conf.py | chslink/antispam | 0cf57251d036c46ae934504a0f7f952128bb4f73 | [
"MIT"
] | 6 | 2016-08-30T14:09:22.000Z | 2021-06-04T22:08:16.000Z | docs/conf.py | chslink/antispam | 0cf57251d036c46ae934504a0f7f952128bb4f73 | [
"MIT"
] | 28 | 2015-12-16T18:35:42.000Z | 2022-02-13T01:37:32.000Z | # Ensure we get the local copy of tornado instead of what's on the standard path
import os
import sys
import time
import antispam
sys.path.insert(0, os.path.abspath(".."))
master_doc = "index"
project = "Antispam"
version = release = antispam.__version__
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.cove... | 29.921875 | 95 | 0.747258 |
b744abebccb01d0ebd476589486800962b928a2e | 372 | py | Python | m3uragen/image.py | TiBeN/m3uragen | 45f6f7c76c7a345d01f43a152f1f815a9891441f | [
"Apache-2.0"
] | 1 | 2020-12-19T09:18:13.000Z | 2020-12-19T09:18:13.000Z | m3uragen/image.py | TiBeN/m3uragen | 45f6f7c76c7a345d01f43a152f1f815a9891441f | [
"Apache-2.0"
] | 1 | 2021-10-22T00:38:17.000Z | 2021-12-15T13:48:18.000Z | m3uragen/image.py | TiBeN/m3uragen | 45f6f7c76c7a345d01f43a152f1f815a9891441f | [
"Apache-2.0"
] | null | null | null | """Software image class"""
import os
class Image:
def __init__(self, path):
self.path = path
def extract_media_flag(self, media_flag_re):
match = media_flag_re.match(self.path.name)
if match:
return match.group(1)
def move_to(self, out_dir):
self.path = self.... | 21.882353 | 76 | 0.637097 |
140b4009aeb24fef058edb22b5629bd045398419 | 1,213 | py | Python | Train/main.py | Sanduoo/OpenCV-Tensorflow | dd7e174fa358287b711845a658caca92ab9a3a61 | [
"Apache-2.0"
] | 5 | 2018-12-14T10:21:16.000Z | 2020-10-16T08:20:00.000Z | Train/main.py | Sanduoo/OpenCV-Tensorflow | dd7e174fa358287b711845a658caca92ab9a3a61 | [
"Apache-2.0"
] | null | null | null | Train/main.py | Sanduoo/OpenCV-Tensorflow | dd7e174fa358287b711845a658caca92ab9a3a61 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import cv2
import time
from grabscreen import grab_screen
from getkeys import key_check
import os
def keys_to_out(keys):
#[A,W,D] A = [1,0,0]
output = [0,0,0]
if 'A' in keys:
output[0] = 1
elif 'W' in keys:
output[1] = 1
else:
output[2] = 1
ret... | 21.280702 | 70 | 0.597692 |
f86c7ab4970b0686748b46e8df7b23d85b685133 | 2,057 | py | Python | webware/MiddleKit/Tests/MKNone.mkmodel/TestEmpty.py | PeaceWorksTechnologySolutions/w4py3-middlekit | a9554e20c47010e7b0c0deee63e1786482c59a1c | [
"MIT"
] | 2 | 2020-10-31T09:12:58.000Z | 2021-02-20T13:52:14.000Z | webware/MiddleKit/Tests/MKNone.mkmodel/TestEmpty.py | WebwareForPython/w4py3-middlekit | f740e2d2d3a5c225d6b8f9eb27ac08f8deed47e6 | [
"MIT"
] | 2 | 2020-01-07T15:24:09.000Z | 2020-01-08T15:39:57.000Z | webware/MiddleKit/Tests/MKNone.mkmodel/TestEmpty.py | PeaceWorksTechnologySolutions/w4py3-middlekit | a9554e20c47010e7b0c0deee63e1786482c59a1c | [
"MIT"
] | 1 | 2021-09-27T21:04:18.000Z | 2021-09-27T21:04:18.000Z | def test(store):
from Foo import Foo
f = Foo()
# legal sets:
f.setRi(1)
f.setNi(2)
f.setRs('a')
f.setNs('b')
f.setNi(None)
f.setNs(None)
# illegal sets:
errMsg = 'Set None for required attribute, but no exception was raised.'
try:
f.setRi(None)
except Excep... | 22.11828 | 76 | 0.55615 |
2db5ec85b013138c52c34c6c1d714a9b7c51ce20 | 35,521 | py | Python | brian2/tests/test_functions.py | Debilski/brian2 | 560377aba16d8ddaba55fd50432b1142f6233f66 | [
"BSD-2-Clause"
] | null | null | null | brian2/tests/test_functions.py | Debilski/brian2 | 560377aba16d8ddaba55fd50432b1142f6233f66 | [
"BSD-2-Clause"
] | null | null | null | brian2/tests/test_functions.py | Debilski/brian2 | 560377aba16d8ddaba55fd50432b1142f6233f66 | [
"BSD-2-Clause"
] | null | null | null | from __future__ import print_function
from __future__ import absolute_import
import os
import pytest
from numpy.testing import assert_equal
from brian2 import *
from brian2.core.functions import timestep
from brian2.parsing.sympytools import str_to_sympy, sympy_to_str
from brian2.utils.logger import catch_logs
from b... | 32.350638 | 100 | 0.585485 |
15310979e7217f14b08fbc4c314d16f7d9279546 | 12,863 | py | Python | train_semseg.py | dsw-jlu-rgzn/Pointnet_Pointnet2_pytorch | 6f61a47729c93964580aa6c89b0f2e16dd3f4324 | [
"MIT"
] | 1 | 2022-03-11T08:34:38.000Z | 2022-03-11T08:34:38.000Z | train_semseg.py | dsw-jlu-rgzn/Pointnet_Pointnet2_pytorch | 6f61a47729c93964580aa6c89b0f2e16dd3f4324 | [
"MIT"
] | null | null | null | train_semseg.py | dsw-jlu-rgzn/Pointnet_Pointnet2_pytorch | 6f61a47729c93964580aa6c89b0f2e16dd3f4324 | [
"MIT"
] | null | null | null | """
Author: Benny
Date: Nov 2019
"""
import argparse
import os
from data_utils.S3DISDataLoader import S3DISDataset
import torch
import datetime
import logging
from pathlib import Path
import sys
import importlib
import shutil
from tqdm import tqdm
import provider
import numpy as np
import time
BASE_DIR = os.path.dirna... | 43.60339 | 159 | 0.613931 |
5d14d1dd31f44e62482cdf0ac16fc5eb1cafa7c3 | 978 | py | Python | fun/linked.py | iganichev/scratch | e570f77abb855a21ec4ef893b5cfc97d331d0ce5 | [
"MIT"
] | null | null | null | fun/linked.py | iganichev/scratch | e570f77abb855a21ec4ef893b5cfc97d331d0ce5 | [
"MIT"
] | null | null | null | fun/linked.py | iganichev/scratch | e570f77abb855a21ec4ef893b5cfc97d331d0ce5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Definition for singly-linked list.
class ListNode(object):
def __init__(self, x):
self.val = x
self.next = None
class Solution(object):
def addTwoNumbers(self, l1, l2):
"""
:type l1: ListNode
:type l2: ListNode
:rtype: ListNode
"... | 24.45 | 56 | 0.45501 |
5bfac40ea42037ccd1118dab9e2bd2b8cdba861f | 5,513 | py | Python | src/dynamic_graph_head/vicon.py | JerryWuZiJie/dynamic_graph_head | bd2f035a62cd282114f45e9635bfd5664670ab0d | [
"BSD-3-Clause"
] | null | null | null | src/dynamic_graph_head/vicon.py | JerryWuZiJie/dynamic_graph_head | bd2f035a62cd282114f45e9635bfd5664670ab0d | [
"BSD-3-Clause"
] | null | null | null | src/dynamic_graph_head/vicon.py | JerryWuZiJie/dynamic_graph_head | bd2f035a62cd282114f45e9635bfd5664670ab0d | [
"BSD-3-Clause"
] | null | null | null | """__init__
License: BSD 3-Clause License
Copyright (C) 2021, New York University
Copyright note valid unless otherwise stated in individual files.
All rights reserved.
"""
import numpy as np
import pinocchio as pin
try:
from vicon_sdk_cpp import ViconClient, ViconFrame
has_real_vicon = True
except:
has_... | 34.45625 | 94 | 0.58353 |
c66910832fff5402c3014f5236740f06aa69feef | 14,615 | py | Python | neutron/db/db_base_plugin_common.py | p0i0/openstack-neutron | df2ee28ae9a43cc511482bd6ece5396eb1288814 | [
"Apache-2.0"
] | null | null | null | neutron/db/db_base_plugin_common.py | p0i0/openstack-neutron | df2ee28ae9a43cc511482bd6ece5396eb1288814 | [
"Apache-2.0"
] | null | null | null | neutron/db/db_base_plugin_common.py | p0i0/openstack-neutron | df2ee28ae9a43cc511482bd6ece5396eb1288814 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2015 OpenStack Foundation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... | 43.497024 | 78 | 0.601984 |
b4d48dbc98e5eaf29b676ae84bed0910cfd4495b | 149 | py | Python | django/contrib/gis/geometry/backend/geos.py | fizista/django | 16f3a6a4c7bab11644d11c2be029374e5095cb56 | [
"BSD-3-Clause"
] | 2 | 2016-09-27T09:30:19.000Z | 2016-10-17T01:47:43.000Z | env/lib/python2.7/site-packages/django/contrib/gis/geometry/backend/geos.py | luiscarlosgph/nas | e5acee61e8bbf12c34785fe971ce7df8dee775d4 | [
"MIT"
] | 10 | 2019-12-26T17:31:31.000Z | 2022-03-21T22:17:33.000Z | env/lib/python2.7/site-packages/django/contrib/gis/geometry/backend/geos.py | luiscarlosgph/nas | e5acee61e8bbf12c34785fe971ce7df8dee775d4 | [
"MIT"
] | 1 | 2021-03-06T14:22:00.000Z | 2021-03-06T14:22:00.000Z | from django.contrib.gis.geos import (
GEOSGeometry as Geometry, GEOSException as GeometryException)
__all__ = ['Geometry', 'GeometryException']
| 29.8 | 65 | 0.778523 |
0bc041db2dd0b1ce16f9c7b139bd9ab2dbc29343 | 145 | py | Python | proxytest/__main__.py | yoleg/proxytest | 63c85b9b14c35de72fce4542ae44080ee6082efb | [
"MIT"
] | 2 | 2020-01-09T14:42:50.000Z | 2020-08-18T10:26:55.000Z | proxytest/__main__.py | yoleg/proxytest | 63c85b9b14c35de72fce4542ae44080ee6082efb | [
"MIT"
] | null | null | null | proxytest/__main__.py | yoleg/proxytest | 63c85b9b14c35de72fce4542ae44080ee6082efb | [
"MIT"
] | null | null | null | """ Entry point for calling with python -m proxytest ... """
import sys
from . import run_from_command_line
sys.exit(run_from_command_line())
| 18.125 | 60 | 0.744828 |
ce7919dc3311ee1057493444a01e3c55975e0b38 | 622 | py | Python | newlines.py | LRjunior/klavir-zakladne-principy-hrania | 490907a5d28b0d0e54525aad2dab4f3bff28b166 | [
"CC0-1.0"
] | null | null | null | newlines.py | LRjunior/klavir-zakladne-principy-hrania | 490907a5d28b0d0e54525aad2dab4f3bff28b166 | [
"CC0-1.0"
] | null | null | null | newlines.py | LRjunior/klavir-zakladne-principy-hrania | 490907a5d28b0d0e54525aad2dab4f3bff28b166 | [
"CC0-1.0"
] | null | null | null | import re
import codecs
filenamein = 'text.tex' #'zaklady_cvicenia_na_klaviri.tex'
filenameout = 'textout.tex'
fh = codecs.open(filenamein, 'r', 'utf-8')
data = fh.read()
fh.close()
lines = data.split("\n")
processed = ''
lineslen = len(lines)
par = False
for i,a in enumerate(lines):
b = a.rstrip... | 17.277778 | 59 | 0.580386 |
e116f3bdf0917e2aeece1bc51499034c142b9bcc | 30,854 | py | Python | frame_2D_alg/alternative versions/comp_slice_flip.py | khanh93vn/CogAlg | b984c12316e266dd8f012dee90ce26bd604fbdd1 | [
"MIT"
] | 11 | 2018-12-01T04:20:06.000Z | 2021-05-18T08:43:51.000Z | frame_2D_alg/alternative versions/comp_slice_flip.py | khanh93vn/CogAlg | b984c12316e266dd8f012dee90ce26bd604fbdd1 | [
"MIT"
] | null | null | null | frame_2D_alg/alternative versions/comp_slice_flip.py | khanh93vn/CogAlg | b984c12316e266dd8f012dee90ce26bd604fbdd1 | [
"MIT"
] | 3 | 2020-03-27T14:01:22.000Z | 2021-07-16T13:54:56.000Z | '''
Comp_slice is a terminal fork of intra_blob.
-
It traces blob axis by cross-comparing vertically adjacent Ps: horizontal slices across an edge blob.
These low-M high-Ma blobs are vectorized into outlines of adjacent flat or high-M blobs.
(high match: M / Ma, roughly corresponds to low gradient: G / Ga)
-
Vectorizat... | 43.579096 | 152 | 0.579568 |
36fa7b701218df7bb6adcf9c47c96f40ba72b2b6 | 1,872 | py | Python | optimisation/optimise_interface.py | kounelisagis/kesko-food-waste-hackathon | 6b66806aeaf4fc72ea96e47f152cd4bbd8b5a43d | [
"MIT"
] | 1 | 2019-12-29T16:16:54.000Z | 2019-12-29T16:16:54.000Z | optimisation/optimise_interface.py | kounelisagis/kesko-food-waste-hackathon | 6b66806aeaf4fc72ea96e47f152cd4bbd8b5a43d | [
"MIT"
] | 14 | 2019-11-16T18:27:51.000Z | 2022-02-26T20:17:01.000Z | optimisation/optimise_interface.py | kounelisagis/kesko-food-waste-hackathon | 6b66806aeaf4fc72ea96e47f152cd4bbd8b5a43d | [
"MIT"
] | 8 | 2019-11-15T20:27:32.000Z | 2020-08-26T16:21:48.000Z | import json
import os
from kesko_food_waste import settings
from optimisation import optimise
from optimisation.utils import get_geodesic_distance, get_market_coordinates
def get_some_ean():
items_json_filename = os.path.join(settings.PRIVATE_DATA_ROOT, "products_all.json")
with open(items_json_filename) as... | 37.44 | 132 | 0.725427 |
5fe8492ca79c800ff579828eb4b2e7f68beabdf6 | 7,673 | py | Python | debruijngraph.py | wuyuMk7/CSCI5481 | b21b7f4e5851aee93ca81728733cd6b44d718e09 | [
"MIT"
] | null | null | null | debruijngraph.py | wuyuMk7/CSCI5481 | b21b7f4e5851aee93ca81728733cd6b44d718e09 | [
"MIT"
] | null | null | null | debruijngraph.py | wuyuMk7/CSCI5481 | b21b7f4e5851aee93ca81728733cd6b44d718e09 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import sys
sys.setrecursionlimit(2000000)
CUTOFF_THRESHOLD = 3
def pairSeq(seq):
base_pairs = { 'A': 'T', 'T': 'A', 'C': 'G', 'G': 'C' }
pair = list(map(lambda x: base_pairs[x], seq))
pair.reverse()
return ''.join(pair)
def readFile(seqFile):
seqs = []
with open(seq_fi... | 31.706612 | 138 | 0.554412 |
aa3a43ae08e0d51a9a19ab3d326e8d098786259d | 4,894 | py | Python | examples/example_07_full_reconstruction_a_grid_scan_step_03_downsample.py | gbzan/algotom | 314f05b6a226e666a8ae4417b151d896606e7db4 | [
"Apache-2.0"
] | null | null | null | examples/example_07_full_reconstruction_a_grid_scan_step_03_downsample.py | gbzan/algotom | 314f05b6a226e666a8ae4417b151d896606e7db4 | [
"Apache-2.0"
] | null | null | null | examples/example_07_full_reconstruction_a_grid_scan_step_03_downsample.py | gbzan/algotom | 314f05b6a226e666a8ae4417b151d896606e7db4 | [
"Apache-2.0"
] | null | null | null | # ===========================================================================
# ===========================================================================
# Copyright (c) 2021 Nghia T. Vo. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in com... | 39.788618 | 103 | 0.650184 |
058985110485fa21e089c569021e3e8de0a75541 | 7,412 | py | Python | idiaptts/src/data_preparation/OpenSMILELabelGen.py | idiap/IdiapTTS | 60413d6847508e269d44aa41885e668db7dfd440 | [
"MIT"
] | 16 | 2019-05-27T09:20:40.000Z | 2022-01-27T23:24:26.000Z | idiaptts/src/data_preparation/OpenSMILELabelGen.py | idiap/IdiapTTS | 60413d6847508e269d44aa41885e668db7dfd440 | [
"MIT"
] | 1 | 2019-07-02T09:53:14.000Z | 2019-08-06T14:37:56.000Z | idiaptts/src/data_preparation/OpenSMILELabelGen.py | idiap/IdiapTTS | 60413d6847508e269d44aa41885e668db7dfd440 | [
"MIT"
] | 5 | 2019-06-01T18:32:12.000Z | 2021-08-03T23:14:56.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (c) 2021 Idiap Research Institute, http://www.idiap.ch/
# Written by Bastian Schnell <bastian.schnell@idiap.ch>
#
# System imports.
import arff
import argparse
import glob
import logging
import os
import shutil
import subprocess
import sys
import tempfile
f... | 35.127962 | 85 | 0.585942 |
f3abc22a8775630e6b48620e42a4073acd5aca7d | 22 | py | Python | Modules/vms/stsdef/stsdef.py | vmssoftware/cpython | b5d2c7f578d33963798a02ca32f0c151c908aa7c | [
"0BSD"
] | 2 | 2021-10-06T15:46:53.000Z | 2022-01-26T02:58:54.000Z | Modules/vms/stsdef/stsdef.py | vmssoftware/cpython | b5d2c7f578d33963798a02ca32f0c151c908aa7c | [
"0BSD"
] | null | null | null | Modules/vms/stsdef/stsdef.py | vmssoftware/cpython | b5d2c7f578d33963798a02ca32f0c151c908aa7c | [
"0BSD"
] | null | null | null | from _stsdef import *
| 11 | 21 | 0.772727 |
557399b3fa3a760af478f4c2d0c9c7fa84058aa2 | 1,636 | py | Python | HiLightFinder.py | zeibou/pyHiLightExtractor | 2a47538405c826a4ee960d9dbcad34e418190aa0 | [
"MIT"
] | 2 | 2019-01-18T13:55:05.000Z | 2019-03-14T02:44:42.000Z | HiLightFinder.py | zeibou/pyHiLightExtractor | 2a47538405c826a4ee960d9dbcad34e418190aa0 | [
"MIT"
] | null | null | null | HiLightFinder.py | zeibou/pyHiLightExtractor | 2a47538405c826a4ee960d9dbcad34e418190aa0 | [
"MIT"
] | 2 | 2020-06-24T22:37:07.000Z | 2020-09-02T06:10:24.000Z | from dataclasses import dataclass
from datetime import timedelta
import struct
@dataclass
class Atom:
name: str
size: int
def yield_box(stream):
while 1:
size = stream.read(4)
if len(size) < 4 : break
n = int(struct.unpack('>I', size)[0])
name = stream.read(4)
yield... | 30.296296 | 106 | 0.487775 |
85b3c2b5432d9e9d35ab33bb518e5462d8ae0675 | 3,100 | py | Python | categorical_embedder/embedders/vae/DiscriminativeTrainer.py | erelcan/categorical-embedder | 376b8779500af2aa459c879f8e525f2ef25d6b31 | [
"Apache-2.0"
] | 3 | 2020-12-19T10:52:58.000Z | 2021-06-08T09:06:44.000Z | categorical_embedder/embedders/vae/DiscriminativeTrainer.py | erelcan/categorical-embedder | 376b8779500af2aa459c879f8e525f2ef25d6b31 | [
"Apache-2.0"
] | null | null | null | categorical_embedder/embedders/vae/DiscriminativeTrainer.py | erelcan/categorical-embedder | 376b8779500af2aa459c879f8e525f2ef25d6b31 | [
"Apache-2.0"
] | null | null | null | import numpy as np
from keras.layers import Input, Dense
from keras.models import Model
from categorical_embedder.embedders.core.vae.VAETrainerABC import VAETrainerABC
from categorical_embedder.embedders.core.vae.concrete.VAE import VAE
from categorical_embedder.processors.DiscriminativeWrapper import DiscriminativeWr... | 58.490566 | 207 | 0.762903 |
cf7a3c32ac5e8fc6ed68217d5d2178340aa1bde1 | 88,809 | py | Python | venv/Lib/site-packages/django/db/models/fields/__init__.py | GiovanniConserva/TestDeploy | 7a8242df6fe996b1029497d2d87295d1531b6139 | [
"BSD-3-Clause"
] | 26 | 2015-01-20T08:02:38.000Z | 2020-06-10T04:57:41.000Z | venv/Lib/site-packages/django/db/models/fields/__init__.py | GiovanniConserva/TestDeploy | 7a8242df6fe996b1029497d2d87295d1531b6139 | [
"BSD-3-Clause"
] | 12 | 2019-12-26T16:40:09.000Z | 2022-03-11T23:17:44.000Z | venv/Lib/site-packages/django/db/models/fields/__init__.py | GiovanniConserva/TestDeploy | 7a8242df6fe996b1029497d2d87295d1531b6139 | [
"BSD-3-Clause"
] | 13 | 2016-02-28T00:14:23.000Z | 2021-05-03T15:47:36.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import collections
import copy
import datetime
import decimal
import math
import uuid
import warnings
from base64 import b64decode, b64encode
from functools import total_ordering
from django import forms
from django.apps import apps
from django.conf impo... | 36.743484 | 101 | 0.590661 |
0a26fef5f46a84fc2708656cb1c71421edea14da | 1,735 | py | Python | preprocess/amr_preprocess/global_node.py | hec44/DCGCN | a6e9c610d847295829a67337536769d678419ec2 | [
"MIT"
] | 75 | 2019-03-12T04:29:40.000Z | 2022-03-19T14:04:04.000Z | preprocess/amr_preprocess/global_node.py | hec44/DCGCN | a6e9c610d847295829a67337536769d678419ec2 | [
"MIT"
] | 3 | 2020-11-06T02:07:03.000Z | 2022-03-11T21:35:57.000Z | preprocess/amr_preprocess/global_node.py | hec44/DCGCN | a6e9c610d847295829a67337536769d678419ec2 | [
"MIT"
] | 8 | 2019-08-22T07:35:30.000Z | 2022-03-01T03:53:11.000Z | import argparse
def add_global_node(dirt, name):
f1 = open(dirt + name + ".amr", "r")
f2 = open(dirt + name + ".grh", "r")
h1 = open(dirt + name + ".amr_g", "w")
h2 = open(dirt + name + ".grh_g", "w")
index_list = []
node = "gnode"
for line in f1:
toks = line.strip().split()
for t in toks:
h1.write(str(... | 19.942529 | 81 | 0.576945 |
40fe52900060e08204e737e890780fd711786c54 | 438 | py | Python | mapshader/tests/test_transforms.py | ianthomas23/mapshader | 3a29f9f2ad355df193896a598825cef12c1e0dae | [
"MIT"
] | null | null | null | mapshader/tests/test_transforms.py | ianthomas23/mapshader | 3a29f9f2ad355df193896a598825cef12c1e0dae | [
"MIT"
] | null | null | null | mapshader/tests/test_transforms.py | ianthomas23/mapshader | 3a29f9f2ad355df193896a598825cef12c1e0dae | [
"MIT"
] | null | null | null | # import json
# from os import path
# from io import BytesIO
# import pytest
# import xarray as xr
# from datashader.transfer_functions import Image
# from mapshader.sources import MapSource
# from mapshader.core import render_map
# from mapshader.core import render_geojson
# from mapshader.sources import elevati... | 20.857143 | 56 | 0.799087 |
639d5ea6e06a700057063bc15001f10824002cb5 | 7,130 | py | Python | preprocess.py | hash2430/pitchtron | b6dbb88774f340b46fd7630bd239f774b139c05c | [
"BSD-3-Clause"
] | 123 | 2020-05-12T08:41:09.000Z | 2022-02-01T14:05:55.000Z | preprocess.py | ts0923/pitchtron | b6dbb88774f340b46fd7630bd239f774b139c05c | [
"BSD-3-Clause"
] | 12 | 2020-06-24T23:40:38.000Z | 2022-02-10T01:41:09.000Z | preprocess.py | ts0923/pitchtron | b6dbb88774f340b46fd7630bd239f774b139c05c | [
"BSD-3-Clause"
] | 24 | 2020-05-16T23:21:14.000Z | 2021-07-14T09:45:14.000Z | import argparse
import os
from tqdm import tqdm
from datasets import libri_tts, selvas_multi_lbl,selvas_multispeaker_pron, public_korean_pron, check_file_integrity, generate_mel_f0, f0_mean
from configs.korean_200113 import create_hparams
hparams = create_hparams()
# WARN: Do not use this without adding trim
# def pr... | 43.742331 | 156 | 0.721739 |
6ffe4ea234612ddbf57a4d9b17bef1a360e2534c | 3,347 | py | Python | mengheng_probability/test.py | bondxue/python_package_example | 7cc171d58f9524111f1a40b23c6a8a11ba244c24 | [
"MIT"
] | null | null | null | mengheng_probability/test.py | bondxue/python_package_example | 7cc171d58f9524111f1a40b23c6a8a11ba244c24 | [
"MIT"
] | null | null | null | mengheng_probability/test.py | bondxue/python_package_example | 7cc171d58f9524111f1a40b23c6a8a11ba244c24 | [
"MIT"
] | null | null | null | import unittest
from mengheng_probability import Gaussian
from mengheng_probability import Binomial
class TestGaussianClass(unittest.TestCase):
def setUp(self):
self.gaussian = Gaussian(25, 2)
self.gaussian.read_data_file('numbers.txt')
def test_initialization(self):
self.assertEqual... | 37.188889 | 118 | 0.654317 |
9bf113e8a073032998ed6a918828292cc4916c40 | 1,785 | py | Python | python/mysite/polls/views.py | kylegalloway/docker-talk | 099d1d3898707c29f6d2e8c48ab6da02b7265a2c | [
"MIT"
] | null | null | null | python/mysite/polls/views.py | kylegalloway/docker-talk | 099d1d3898707c29f6d2e8c48ab6da02b7265a2c | [
"MIT"
] | 3 | 2021-03-19T01:58:37.000Z | 2021-06-09T18:27:19.000Z | python/mysite/polls/views.py | kylegalloway/docker-talk | 099d1d3898707c29f6d2e8c48ab6da02b7265a2c | [
"MIT"
] | null | null | null | from django.http import HttpResponseRedirect
from django.shortcuts import get_object_or_404, render
from django.urls import reverse
from django.utils import timezone
from django.views import generic
from .models import Choice, Question
class IndexView(generic.ListView):
template_name = 'polls/index.html'
con... | 32.454545 | 94 | 0.689076 |
8ccee1a0087b873cc70a169de85afba684f02f37 | 1,123 | py | Python | browniebroke/users/tests/test_forms.py | browniebroke/browniecutter | b0b0d5b1633e68372c1de5d04569c2e15ee720d7 | [
"MIT"
] | null | null | null | browniebroke/users/tests/test_forms.py | browniebroke/browniecutter | b0b0d5b1633e68372c1de5d04569c2e15ee720d7 | [
"MIT"
] | null | null | null | browniebroke/users/tests/test_forms.py | browniebroke/browniecutter | b0b0d5b1633e68372c1de5d04569c2e15ee720d7 | [
"MIT"
] | null | null | null | import pytest
from browniebroke.users.forms import UserCreationForm
from browniebroke.users.tests.factories import UserFactory
pytestmark = pytest.mark.django_db
class TestUserCreationForm:
def test_clean_username(self):
# A user with proto_user params does not exist yet.
proto_user = UserFactor... | 27.390244 | 59 | 0.596616 |
e1fc0e50fccf5ce257b4a28c85e5b92c4886df42 | 1,022 | py | Python | days/04-06-collections/Day06.py | GMillerA/100daysofcode-with-python-course | fcbb7c5ed342b344d43b355d20ca35c6fd712b4a | [
"MIT"
] | null | null | null | days/04-06-collections/Day06.py | GMillerA/100daysofcode-with-python-course | fcbb7c5ed342b344d43b355d20ca35c6fd712b4a | [
"MIT"
] | null | null | null | days/04-06-collections/Day06.py | GMillerA/100daysofcode-with-python-course | fcbb7c5ed342b344d43b355d20ca35c6fd712b4a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Sun Apr 8 12:04:50 2018
@author: Galen Miller
"""
NAMES = ['arnold schwarzenegger', 'alec baldwin', 'bob belderbos',
'julian sequeira', 'sandra bullock', 'keanu reeves',
'julbob pybites', 'bob belderbos', 'julian sequeira',
'al pacino', 'bra... | 30.058824 | 69 | 0.638943 |
f74445b9cfed15e09d045ec81d565f311e4c5117 | 7,347 | py | Python | finrl/commands/data_commands.py | solazu/FinRL-Library | 6cfe00933c16fc8a74efc9fb3d9cfa1b3bf296ea | [
"MIT"
] | 1 | 2021-07-18T13:31:55.000Z | 2021-07-18T13:31:55.000Z | finrl/commands/data_commands.py | solazu/FinRL-Library | 6cfe00933c16fc8a74efc9fb3d9cfa1b3bf296ea | [
"MIT"
] | null | null | null | finrl/commands/data_commands.py | solazu/FinRL-Library | 6cfe00933c16fc8a74efc9fb3d9cfa1b3bf296ea | [
"MIT"
] | null | null | null | import logging
import sys
import yfinance
import pandas as pd
import yfinance as yf
import os
from collections import defaultdict
from datetime import datetime, timedelta
from typing import Any, Dict, List
from finrl.config import TimeRange, setup_utils_configuration
from finrl.data.converter import convert_ohlcv_fo... | 38.067358 | 99 | 0.625017 |
4e6b9343c903b603efc822fda14b1b3a69551eeb | 4,534 | py | Python | onto/source/graphql.py | billyrrr/onto | 72733d36a2583ae4758f7cf33a5229b79773702b | [
"MIT"
] | 1 | 2020-10-04T10:01:45.000Z | 2020-10-04T10:01:45.000Z | onto/source/graphql.py | billyrrr/onto | 72733d36a2583ae4758f7cf33a5229b79773702b | [
"MIT"
] | null | null | null | onto/source/graphql.py | billyrrr/onto | 72733d36a2583ae4758f7cf33a5229b79773702b | [
"MIT"
] | null | null | null | import asyncio
from datetime import datetime
# from graphene import ObjectType, String, Schema, Field
from aiokafka import AIOKafkaConsumer
from stargql.subscription import Subscription
from onto.source.base import Source
"""
[Start] Sample code from aiokafka
ref: https://github.com/aio-libs/aiokafka
"""
loop = asy... | 29.251613 | 78 | 0.61491 |
979cbaf96db5ef94ba020dbe56fa54cd265c1c27 | 1,386 | py | Python | passward_test.py | Bernard2030/passward-locker | 4d654076197d58a78a9c782097c88b79c72a9653 | [
"Unlicense"
] | null | null | null | passward_test.py | Bernard2030/passward-locker | 4d654076197d58a78a9c782097c88b79c72a9653 | [
"Unlicense"
] | null | null | null | passward_test.py | Bernard2030/passward-locker | 4d654076197d58a78a9c782097c88b79c72a9653 | [
"Unlicense"
] | null | null | null | import unittest
from passward import User
class TestOne(unittest.TestCase):
"""
A test One that defines test cases for the User class.
"""
def setUp(self):
"""
A method that runs before the user test method runs
"""
self.new_user = User("BernardOpiyo", "Bro@xyz2030", "brobernard.254@g... | 23.896552 | 83 | 0.655844 |
7f5e0d6950bc62db0cd14c604f72f95143dd7275 | 5,309 | py | Python | emb2emb_autoencoder.py | jczestochowska/emb2emb | 92f05dcbff529c264ec7ff786a3e82b3a3e9f42f | [
"MIT"
] | null | null | null | emb2emb_autoencoder.py | jczestochowska/emb2emb | 92f05dcbff529c264ec7ff786a3e82b3a3e9f42f | [
"MIT"
] | 1 | 2021-11-30T12:52:43.000Z | 2021-12-01T14:48:36.000Z | emb2emb_autoencoder.py | jczestochowska/emb2emb | 92f05dcbff529c264ec7ff786a3e82b3a3e9f42f | [
"MIT"
] | 1 | 2021-11-24T14:02:00.000Z | 2021-11-24T14:02:00.000Z | from torch.nn.utils.rnn import pad_sequence
from autoencoders.autoencoder import AutoEncoder
from autoencoders.rnn_encoder import RNNEncoder
from autoencoders.rnn_decoder import RNNDecoder
from emb2emb.encoding import Encoder, Decoder
from tokenizers import CharBPETokenizer, SentencePieceBPETokenizer
from emb2emb.utils... | 38.194245 | 101 | 0.678847 |
89028b731acff1b6580f561630214fa7b02bcde9 | 2,289 | py | Python | peerdid/core/jwk_okp.py | sicpa-dlab/peer-did-python | c63461860891d7c111abb6b24a51f23dad845a74 | [
"Apache-2.0"
] | 3 | 2021-09-04T19:31:12.000Z | 2022-01-28T12:51:27.000Z | peerdid/core/jwk_okp.py | sicpa-dlab/peer-did-python | c63461860891d7c111abb6b24a51f23dad845a74 | [
"Apache-2.0"
] | 1 | 2021-09-03T07:23:12.000Z | 2021-09-03T07:23:12.000Z | peerdid/core/jwk_okp.py | sicpa-dlab/peer-did-python | c63461860891d7c111abb6b24a51f23dad845a74 | [
"Apache-2.0"
] | 3 | 2021-08-02T12:56:46.000Z | 2021-09-28T09:18:37.000Z | import json
from peerdid.core.utils import urlsafe_b64encode, urlsafe_b64decode
from peerdid.errors import MalformedPeerDIDDocError
from peerdid.types import (
VerificationMethodTypePeerDID,
VerificationMethodTypeAgreement,
VerificationMethodTypeAuthentication,
VerificationMaterialPeerDID,
Verifica... | 31.791667 | 84 | 0.696374 |
801f10984fe3218839d8d1a2ae2be357b38020ce | 15,593 | py | Python | artemis/general/nested_structures.py | wouterkool/artemis | 5ac3143d22ba2e7addc93396d059110104096233 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | artemis/general/nested_structures.py | wouterkool/artemis | 5ac3143d22ba2e7addc93396d059110104096233 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | artemis/general/nested_structures.py | wouterkool/artemis | 5ac3143d22ba2e7addc93396d059110104096233 | [
"BSD-2-Clause-FreeBSD"
] | 1 | 2018-11-25T12:48:03.000Z | 2018-11-25T12:48:03.000Z | from collections import OrderedDict
import numpy as np
from six import string_types, next
from artemis.general.should_be_builtins import all_equal
__author__ = 'peter'
_immutible_types = (int, float, bool, type(None))+string_types
def flatten_struct(struct, primatives = (int, float, np.ndarray, type(None), bool)+... | 46.825826 | 238 | 0.698903 |
8a4ac8e242fa7132266ede9e31a7262cd69c8de5 | 8,703 | py | Python | 1.0.2/tools/makeboards.py | UM-battery-lab/Longan-RP2040 | 81f2f50eac4149cc608acf9662f64641095d49c6 | [
"MIT"
] | null | null | null | 1.0.2/tools/makeboards.py | UM-battery-lab/Longan-RP2040 | 81f2f50eac4149cc608acf9662f64641095d49c6 | [
"MIT"
] | null | null | null | 1.0.2/tools/makeboards.py | UM-battery-lab/Longan-RP2040 | 81f2f50eac4149cc608acf9662f64641095d49c6 | [
"MIT"
] | 1 | 2022-02-15T16:22:47.000Z | 2022-02-15T16:22:47.000Z | #!/usr/bin/env python3
def BuildFlashMenu(name, flashsize, fssizelist):
for fssize in fssizelist:
if fssize == 0:
fssizename = "no FS"
elif fssize < 1024 * 1024:
fssizename = "Sketch: %dKB, FS: %dKB" % ((flashsize - fssize) / 1024, fssize / 1024)
else:
fs... | 58.409396 | 160 | 0.638745 |
82620f7abeac04f703ce1ae528ae1d860cd3bfa9 | 7,418 | py | Python | components/ADC_LCD/lcd.py | minhan74/MIS-Locker | ab7e90000d566e818b4f44bd27165ed45a8f653f | [
"Apache-2.0",
"MIT"
] | 2 | 2020-07-29T13:38:54.000Z | 2021-07-24T13:54:48.000Z | components/ADC_LCD/lcd.py | minhan74/MIS-Locker | ab7e90000d566e818b4f44bd27165ed45a8f653f | [
"Apache-2.0",
"MIT"
] | 4 | 2020-02-27T09:53:34.000Z | 2020-02-27T09:54:35.000Z | components/ADC_LCD/lcd.py | minhan74/MIS-Locker | ab7e90000d566e818b4f44bd27165ed45a8f653f | [
"Apache-2.0",
"MIT"
] | null | null | null | """------------------------------------------------------------*-
LCD application module for Raspberry Pi
Tested on: Raspberry Pi 3 B+
(c) Minh-An Dao 2019
version 1.00 - 02/10/2019
--------------------------------------------------------------
*
*
-----------------------------------------------------------... | 28.530769 | 86 | 0.570504 |
07b5371759e64d152674ef32a773f91f76c6f280 | 317 | py | Python | src/Case1.py | EstudoAAS/linear-algebra-refresher-course | cf5ba417e8bbbb8a6683161e4cd7397ebb384c00 | [
"Apache-2.0"
] | null | null | null | src/Case1.py | EstudoAAS/linear-algebra-refresher-course | cf5ba417e8bbbb8a6683161e4cd7397ebb384c00 | [
"Apache-2.0"
] | null | null | null | src/Case1.py | EstudoAAS/linear-algebra-refresher-course | cf5ba417e8bbbb8a6683161e4cd7397ebb384c00 | [
"Apache-2.0"
] | null | null | null | import vector
def main():
vetor1 = vector.Vector([8.218,-9.341])
print(vetor1.plus(vector.Vector([-1.129,2.111])))
vetor2 = vector.Vector([7.119,8.215])
print(vetor2.minus(vector.Vector([-8.223,0.878])))
vetor3 = vector.Vector([1.671,-1.012,-0.318])
print(vetor3.times_scalar(7.41))
main() | 24.384615 | 54 | 0.637224 |
3a3c6de7224f47c6be61b2e0246429ff72ed86d3 | 9,548 | py | Python | charmhelpers/contrib/openstack/cert_utils.py | cjwatson/charm-helpers | 386a819fb93a3333807c947d8ff5a7ecc348ade1 | [
"Apache-2.0"
] | null | null | null | charmhelpers/contrib/openstack/cert_utils.py | cjwatson/charm-helpers | 386a819fb93a3333807c947d8ff5a7ecc348ade1 | [
"Apache-2.0"
] | null | null | null | charmhelpers/contrib/openstack/cert_utils.py | cjwatson/charm-helpers | 386a819fb93a3333807c947d8ff5a7ecc348ade1 | [
"Apache-2.0"
] | 1 | 2019-01-28T03:42:18.000Z | 2019-01-28T03:42:18.000Z | # Copyright 2014-2018 Canonical Limited.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 34.594203 | 78 | 0.626938 |
ad831b88aded7d99b000fe58454451be76c3d05a | 7,578 | py | Python | analyzeProbaDF.py | alexbovet/twitter_opinion_mining | e071fc0447072877518a14f2f8f59f0dd974167f | [
"BSD-3-Clause"
] | 6 | 2019-02-12T14:41:45.000Z | 2021-12-06T14:48:30.000Z | analyzeProbaDF.py | alexbovet/twitter_opinion_mining | e071fc0447072877518a14f2f8f59f0dd974167f | [
"BSD-3-Clause"
] | null | null | null | analyzeProbaDF.py | alexbovet/twitter_opinion_mining | e071fc0447072877518a14f2f8f59f0dd974167f | [
"BSD-3-Clause"
] | 2 | 2019-02-11T10:50:54.000Z | 2022-03-07T09:13:35.000Z | # Author: Alexandre Bovet <alexandre.bovet@gmail.com>
# License: BSD 3 clause
import numpy as np
import pandas as pd
from multiprocessing import Pool, cpu_count
from functools import partial
import time
def applyParallel(dfGrouped, func, ncpu):
with Pool(ncpu) as p:
ret_list = p.map(func, [group for name... | 36.965854 | 125 | 0.562418 |
4437a9f444281696ce3dcec12b11bf80cdc2780d | 6,329 | py | Python | URSABench/models/imagenet_resnet.py | reml-lab/URSABench | f4cceffbf8ea91d95818867c35fead4e2b272aba | [
"MIT"
] | 10 | 2020-07-18T14:48:35.000Z | 2022-01-18T11:21:27.000Z | URSABench/models/imagenet_resnet.py | reml-lab/URSABench | f4cceffbf8ea91d95818867c35fead4e2b272aba | [
"MIT"
] | null | null | null | URSABench/models/imagenet_resnet.py | reml-lab/URSABench | f4cceffbf8ea91d95818867c35fead4e2b272aba | [
"MIT"
] | 4 | 2020-08-30T02:43:32.000Z | 2021-03-18T03:37:52.000Z | import torch.nn as nn
import torch.nn.functional as F
import torch.nn.init as init
from torchvision.transforms import transforms
__all__ = ['INResNet18', 'INResNet34', 'INResNet50', 'INResNet101',
'INResNet152', 'ResNet_dropout']
def _weights_init(m):
classname = m.__class__.__name__
if isinstance... | 34.966851 | 104 | 0.614157 |
7bc191447a05945884dd23d54714c9b5b885d4dd | 49,671 | py | Python | build/python-env/lib/python2.7/site-packages/pip/_vendor/distlib/database.py | rfraposa/hadoopbeat | 884c0f8e0f2027cb4aa180d8f419f05b4d890e85 | [
"Apache-2.0"
] | 38 | 2017-02-28T05:39:40.000Z | 2019-01-16T04:39:04.000Z | build/python-env/lib/python2.7/site-packages/pip/_vendor/distlib/database.py | rfraposa/hadoopbeat | 884c0f8e0f2027cb4aa180d8f419f05b4d890e85 | [
"Apache-2.0"
] | 24 | 2016-10-06T23:37:43.000Z | 2017-02-18T21:36:37.000Z | build/python-env/lib/python2.7/site-packages/pip/_vendor/distlib/database.py | rfraposa/hadoopbeat | 884c0f8e0f2027cb4aa180d8f419f05b4d890e85 | [
"Apache-2.0"
] | 18 | 2016-09-30T17:44:05.000Z | 2021-12-23T07:55:11.000Z | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012-2016 The Python Software Foundation.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
"""PEP 376 implementation."""
from __future__ import unicode_literals
import base64
import codecs
import contextlib
import hashlib
import logging
import os
import posixpath
import sys
import z... | 37.83016 | 86 | 0.562703 |
1aebea49794d246238656bfc03b521d1b3ac1151 | 662 | py | Python | examples/simple_syslog_example.py | Worvast/python-utils | 1cb4bf9e73b589b1e543685cb0427f05e1731165 | [
"MIT"
] | 4 | 2019-02-20T16:59:39.000Z | 2020-04-08T02:04:58.000Z | examples/simple_syslog_example.py | Worvast/python-utils | 1cb4bf9e73b589b1e543685cb0427f05e1731165 | [
"MIT"
] | 29 | 2019-02-22T16:19:25.000Z | 2022-03-31T13:02:14.000Z | examples/simple_syslog_example.py | Worvast/python-utils | 1cb4bf9e73b589b1e543685cb0427f05e1731165 | [
"MIT"
] | 2 | 2019-02-22T14:32:28.000Z | 2020-03-19T15:46:06.000Z | from devoutils.faker import SyslogFakeGenerator
from devo.sender import Sender
if __name__ == "__main__":
with open("./simple_syslog_template.jinja2", 'r') as myfile:
template = myfile.read()
con = None
# This example need a sender con
# Example
# con = Sender(config="./config.yaml")
... | 30.090909 | 65 | 0.546828 |
3396d85ba0be8afb9996249c9845c983898ffee8 | 312 | py | Python | mover/gametest/persistence-sqlite.py | ismailqau/libxayagame | 21aa17ab6d93d7bdf3882788243a2ae591d7e841 | [
"MIT"
] | 16 | 2018-09-08T02:11:44.000Z | 2022-02-07T00:13:42.000Z | mover/gametest/persistence-sqlite.py | ismailqau/libxayagame | 21aa17ab6d93d7bdf3882788243a2ae591d7e841 | [
"MIT"
] | 47 | 2018-09-04T11:19:27.000Z | 2021-09-14T12:53:25.000Z | mover/gametest/persistence-sqlite.py | ismailqau/libxayagame | 21aa17ab6d93d7bdf3882788243a2ae591d7e841 | [
"MIT"
] | 13 | 2018-12-20T19:50:22.000Z | 2022-03-14T21:47:04.000Z | #!/usr/bin/env python3
# Copyright (C) 2018-2020 The Xaya developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from persistence import PersistenceTest
if __name__ == "__main__":
PersistenceTest ("sqlite").main ()
| 31.2 | 69 | 0.766026 |
d2805130789e5d21e505ff389e4830e24dda7a43 | 1,735 | py | Python | working-with-files.py | Marketionist/py-playground | 8982ac4db4638a4e725da2adcc39fe132d62a65b | [
"MIT"
] | null | null | null | working-with-files.py | Marketionist/py-playground | 8982ac4db4638a4e725da2adcc39fe132d62a65b | [
"MIT"
] | null | null | null | working-with-files.py | Marketionist/py-playground | 8982ac4db4638a4e725da2adcc39fe132d62a65b | [
"MIT"
] | null | null | null | #!/usr/bin/python
# python working-with-files.py
import os
import shutil
import glob
# Source file path
source = 'working-with-files.py'
# Destination file path
destination = source.replace('.py', '_copy.py')
# Print the absolute path to the current directory
print('Current directory absolute path:', os.getcwd())
... | 26.692308 | 73 | 0.732565 |
ec2116b59b16dc219ac09503a9e95c6abc26e062 | 1,961 | py | Python | tests/patterns/test_match_path_patterns.py | hile/pathlib-tree | 73fe3132472548ca2480b3ab3278dfaab252b149 | [
"PSF-2.0"
] | 2 | 2022-01-11T14:50:24.000Z | 2022-03-16T21:37:09.000Z | tests/patterns/test_match_path_patterns.py | hile/pathlib-tree | 73fe3132472548ca2480b3ab3278dfaab252b149 | [
"PSF-2.0"
] | null | null | null | tests/patterns/test_match_path_patterns.py | hile/pathlib-tree | 73fe3132472548ca2480b3ab3278dfaab252b149 | [
"PSF-2.0"
] | null | null | null | """
Unit tests for pathlib_tree.patterns functions
"""
from pathlib_tree.patterns import match_path_patterns
def test_match_simple_patterns_no_match():
"""
Test simple relative tree pattern match case
"""
patterns = (
'*/*.txt',
)
assert not match_path_patterns(
patterns,
... | 19.415842 | 53 | 0.565018 |
dee5f6b70056ae69ca2c8e74471c4c81d3c7e15f | 11,092 | py | Python | app/main/routes_zymatic_api.py | branflakem3/picobrew_pico | bd6a06e459eef4c92bc0ca32f11c190fba292809 | [
"MIT"
] | null | null | null | app/main/routes_zymatic_api.py | branflakem3/picobrew_pico | bd6a06e459eef4c92bc0ca32f11c190fba292809 | [
"MIT"
] | null | null | null | app/main/routes_zymatic_api.py | branflakem3/picobrew_pico | bd6a06e459eef4c92bc0ca32f11c190fba292809 | [
"MIT"
] | null | null | null | import json
import uuid
import os
from datetime import datetime
from webargs import fields
from webargs.flaskparser import use_args, FlaskParser
from .. import socketio
from . import main
from .config import brew_active_sessions_path
from .model import MachineType, PicoBrewSession
from .routes_frontend import get_zyma... | 42.992248 | 196 | 0.642896 |
a3c2668a5af0a6e1d9251203f86d2330914e18ad | 1,471 | py | Python | 2020/day19/solve.py | shiftinv/adventofcode | 650fa2334c0d82a547b04e0f9a417fb359bc557c | [
"MIT"
] | null | null | null | 2020/day19/solve.py | shiftinv/adventofcode | 650fa2334c0d82a547b04e0f9a417fb359bc557c | [
"MIT"
] | null | null | null | 2020/day19/solve.py | shiftinv/adventofcode | 650fa2334c0d82a547b04e0f9a417fb359bc557c | [
"MIT"
] | null | null | null | import re
import functools
def parse_input(lines):
split = lines.index('')
rules = {}
for line in lines[:split]:
n, r = line.split(': ')
if r.startswith('"'):
d = r[1:-1]
else:
d = [list(map(int, a.split())) for a in r.split('|')]
rules[int(n)] = d
... | 26.745455 | 86 | 0.545207 |
616337762a4dde86b96ac55d0ba054bcc732f58e | 33,798 | py | Python | BioClients/chembl/Utils.py | jeremyjyang/BioClients | b78ab2b948c79616fed080112e31d383346bec58 | [
"CC0-1.0"
] | 10 | 2020-05-26T07:29:14.000Z | 2021-12-06T21:33:40.000Z | BioClients/chembl/Utils.py | jeremyjyang/BioClients | b78ab2b948c79616fed080112e31d383346bec58 | [
"CC0-1.0"
] | 1 | 2021-10-05T12:25:30.000Z | 2021-10-05T17:05:56.000Z | BioClients/chembl/Utils.py | jeremyjyang/BioClients | b78ab2b948c79616fed080112e31d383346bec58 | [
"CC0-1.0"
] | 2 | 2021-03-16T03:20:24.000Z | 2021-08-08T20:17:10.000Z | #!/usr/bin/env python3
"""
Utility functions for ChEMBL REST API.
https://chembl.gitbook.io/chembl-interface-documentation/web-services/chembl-data-web-services
http://chembl.blogspot.com/2015/02/using-new-chembl-web-services.html
"""
###
import sys,os,re,json,time,urllib.parse,logging,tqdm
import pandas as pd
#
from .... | 48.145299 | 199 | 0.606574 |
48a763ca25144e0b8da2e5a6c9e945ea3040660a | 9,364 | py | Python | tests/integrations/test_torch.py | borisgrafx/client | c079f7816947a3092b500751eb920fda3866985f | [
"MIT"
] | null | null | null | tests/integrations/test_torch.py | borisgrafx/client | c079f7816947a3092b500751eb920fda3866985f | [
"MIT"
] | null | null | null | tests/integrations/test_torch.py | borisgrafx/client | c079f7816947a3092b500751eb920fda3866985f | [
"MIT"
] | null | null | null | import wandb
import pytest
import sys
if sys.version_info >= (3, 9):
pytest.importorskip("pytorch", reason="pytorch doesnt support py3.9 yet")
try:
import torch
import torch.nn as nn
import torch.nn.functional as F
except ImportError:
class nn:
Module = object
pytestmark = pytest.mark.s... | 32.289655 | 83 | 0.61352 |
8347ef1a445c89b3c8950c6d513a850a7d1a2a59 | 842 | py | Python | SPViT_Swin/data/samplers.py | zhuang-group/SPViT | 74f08c6e55fb6adc0322722cedfd2c25ebdee999 | [
"Apache-2.0"
] | 69 | 2021-11-23T23:44:38.000Z | 2022-03-15T01:27:30.000Z | SPViT_Swin/data/samplers.py | zip-group/SPViT | 74f08c6e55fb6adc0322722cedfd2c25ebdee999 | [
"Apache-2.0"
] | null | null | null | SPViT_Swin/data/samplers.py | zip-group/SPViT | 74f08c6e55fb6adc0322722cedfd2c25ebdee999 | [
"Apache-2.0"
] | 10 | 2021-11-25T01:26:38.000Z | 2022-03-14T04:59:42.000Z | # --------------------------------------------------------
# Swin Transformer
# Copyright (c) 2021 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ze Liu
# --------------------------------------------------------
# Modifications copyright (c) 2021 Zhuang AI Group, Haoyu He
import torc... | 27.16129 | 84 | 0.585511 |
e893ec9131e02d63616c5510a1a5d0f8ae282fb7 | 731 | py | Python | foolbox/__init__.py | mkyybx/foolbox | 00b2dcc5ed30b12f28431e9dabe4d2bbc214d444 | [
"MIT"
] | 4 | 2021-11-12T04:06:32.000Z | 2022-01-27T09:01:41.000Z | foolbox/__init__.py | pige2nd/foolbox | 2daabba8355afce9dfbec3de8d71dadadcfbd10b | [
"MIT"
] | 1 | 2022-02-22T14:00:59.000Z | 2022-02-25T08:57:29.000Z | foolbox/__init__.py | pige2nd/foolbox | 2daabba8355afce9dfbec3de8d71dadadcfbd10b | [
"MIT"
] | 2 | 2020-11-27T00:03:48.000Z | 2020-11-27T00:08:04.000Z | from os.path import join, dirname
with open(join(dirname(__file__), 'VERSION')) as f:
__version__ = f.read().strip()
from .rngs import rng # noqa: F401
from .rngs import nprng # noqa: F401
from .rngs import set_seeds # noqa: F401
from . import models # noqa: F401
from . import criteria # noqa: F401
from . i... | 31.782609 | 67 | 0.733242 |
4d720f7125dc13f1ce2ea73da6991b36621b99d8 | 15,382 | py | Python | mne/io/eeglab/tests/test_eeglab.py | fmamashli/mne-python | 52f064415e7c9fa8fe243d22108dcdf3d86505b9 | [
"BSD-3-Clause"
] | null | null | null | mne/io/eeglab/tests/test_eeglab.py | fmamashli/mne-python | 52f064415e7c9fa8fe243d22108dcdf3d86505b9 | [
"BSD-3-Clause"
] | null | null | null | mne/io/eeglab/tests/test_eeglab.py | fmamashli/mne-python | 52f064415e7c9fa8fe243d22108dcdf3d86505b9 | [
"BSD-3-Clause"
] | null | null | null | # Author: Mainak Jas <mainak.jas@telecom-paristech.fr>
# Mikolaj Magnuski <mmagnuski@swps.edu.pl>
# Stefan Appelhoff <stefan.appelhoff@mailbox.org>
#
# License: BSD (3-clause)
from copy import deepcopy
from distutils.version import LooseVersion
import os.path as op
import shutil
from unittest import Sk... | 42.142466 | 79 | 0.640554 |
d7745a84695df9a56808881d11f44f78afa54f84 | 1,964 | py | Python | xortool/routine.py | emilbayes/xortool | efa8462251afad2156ceed9b6ee1f3a6a98ed89c | [
"MIT"
] | null | null | null | xortool/routine.py | emilbayes/xortool | efa8462251afad2156ceed9b6ee1f3a6a98ed89c | [
"MIT"
] | null | null | null | xortool/routine.py | emilbayes/xortool | efa8462251afad2156ceed9b6ee1f3a6a98ed89c | [
"MIT"
] | null | null | null | #!/usr/bin/env python2
#-*- coding:utf-8 -*-
import os
import sys
import string
class MkdirError(Exception):
pass
def load_file(filename):
if filename == "-":
return sys.stdin.read()
fd = open(filename, "rb")
contents = fd.read()
fd.close()
return contents
def save_file(filename, ... | 19.838384 | 73 | 0.570774 |
b1133c1a8d6aa1372328dcdb2198bda04f2d31ae | 70 | py | Python | rxntools/__init__.py | Xiangyan93/rxntools | b2e3437c70528675cbd019d0c5b6767bb2578151 | [
"MIT"
] | null | null | null | rxntools/__init__.py | Xiangyan93/rxntools | b2e3437c70528675cbd019d0c5b6767bb2578151 | [
"MIT"
] | null | null | null | rxntools/__init__.py | Xiangyan93/rxntools | b2e3437c70528675cbd019d0c5b6767bb2578151 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__version__ = '0.0.2'
| 11.666667 | 23 | 0.557143 |
fa05523da252ef531644d9205021bdfb4b976b37 | 10,207 | py | Python | packages/pegasus-python/test/cli/test_pegasus_graphviz.py | dhruvaop/pegasus-2 | 0ad4d93ca42d54713086ba8729f200c69ab6574d | [
"Apache-2.0"
] | null | null | null | packages/pegasus-python/test/cli/test_pegasus_graphviz.py | dhruvaop/pegasus-2 | 0ad4d93ca42d54713086ba8729f200c69ab6574d | [
"Apache-2.0"
] | null | null | null | packages/pegasus-python/test/cli/test_pegasus_graphviz.py | dhruvaop/pegasus-2 | 0ad4d93ca42d54713086ba8729f200c69ab6574d | [
"Apache-2.0"
] | null | null | null | import importlib
from pathlib import Path
from tempfile import NamedTemporaryFile
import pytest
from Pegasus.api import *
pegasus_graphviz = importlib.import_module("Pegasus.cli.pegasus-graphviz")
graph_node = pegasus_graphviz.Node
@pytest.fixture(scope="module")
def diamond_wf_file():
fa = File("f.a")
fb1... | 41.49187 | 130 | 0.559518 |
3ccf12da23ac62278e7facac2c7233e6567ce2f2 | 5,585 | py | Python | dask_cuda/benchmarks/local_cupy_transpose_sum.py | efajardo-nv/dask-cuda | b5ae4fc872b057f9d71595fccaa6dfd61654e301 | [
"Apache-2.0"
] | null | null | null | dask_cuda/benchmarks/local_cupy_transpose_sum.py | efajardo-nv/dask-cuda | b5ae4fc872b057f9d71595fccaa6dfd61654e301 | [
"Apache-2.0"
] | null | null | null | dask_cuda/benchmarks/local_cupy_transpose_sum.py | efajardo-nv/dask-cuda | b5ae4fc872b057f9d71595fccaa6dfd61654e301 | [
"Apache-2.0"
] | null | null | null | import argparse
import asyncio
from collections import defaultdict
from time import perf_counter as clock
import dask.array as da
from dask.distributed import Client, performance_report, wait
from dask.utils import format_bytes, format_time, parse_bytes
from dask_cuda.local_cuda_cluster import LocalCUDACluster
import... | 33.443114 | 88 | 0.520859 |
ad7f86280d66d5f6689ff0575eccf8ddeeb40e2c | 514 | py | Python | tests/r/test_ethanol.py | hajime9652/observations | 2c8b1ac31025938cb17762e540f2f592e302d5de | [
"Apache-2.0"
] | 199 | 2017-07-24T01:34:27.000Z | 2022-01-29T00:50:55.000Z | tests/r/test_ethanol.py | hajime9652/observations | 2c8b1ac31025938cb17762e540f2f592e302d5de | [
"Apache-2.0"
] | 46 | 2017-09-05T19:27:20.000Z | 2019-01-07T09:47:26.000Z | tests/r/test_ethanol.py | hajime9652/observations | 2c8b1ac31025938cb17762e540f2f592e302d5de | [
"Apache-2.0"
] | 45 | 2017-07-26T00:10:44.000Z | 2022-03-16T20:44:59.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import shutil
import sys
import tempfile
from observations.r.ethanol import ethanol
def test_ethanol():
"""Test module ethanol.py by downloading
ethanol.csv and testing shape of
extracted data has 88... | 21.416667 | 43 | 0.752918 |
d03bc381718a3b77afdf1792234f0e100bfbb35e | 5,284 | py | Python | nonogram.py | micvri/python_scripts | 914b8968db0ccb45ba5695d5acb9840c95f1d9ff | [
"MIT"
] | null | null | null | nonogram.py | micvri/python_scripts | 914b8968db0ccb45ba5695d5acb9840c95f1d9ff | [
"MIT"
] | null | null | null | nonogram.py | micvri/python_scripts | 914b8968db0ccb45ba5695d5acb9840c95f1d9ff | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
#from termcolor import colored
#import copy
import sys
import os
sys.setrecursionlimit(5000)
input_template = [
[0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0]
]
# x, y different lengths possible
puzzle_input = [
[[2], [4], [2], [2, 2], [1]],
[... | 29.853107 | 86 | 0.442468 |
d3ddc3e9abafb7e1f6fb206987e0d139d1a1a117 | 3,794 | py | Python | game_states/Help.py | Atsocs/cobrITA | 3bffe9feafc1da7ed00cc8e8c2914ef6b7ffea02 | [
"MIT"
] | 1 | 2021-04-09T00:22:45.000Z | 2021-04-09T00:22:45.000Z | game_states/Help.py | Atsocs/cobrITA | 3bffe9feafc1da7ed00cc8e8c2914ef6b7ffea02 | [
"MIT"
] | 18 | 2021-04-04T17:53:18.000Z | 2021-05-04T22:28:49.000Z | game_states/Help.py | Atsocs/cobrITA | 3bffe9feafc1da7ed00cc8e8c2914ef6b7ffea02 | [
"MIT"
] | 1 | 2021-05-06T15:46:31.000Z | 2021-05-06T15:46:31.000Z | from game_state_machine.GameState import GameState
from definitions import background_color, L, PX
from utils import sound_path
import pygame
# Inherit from a game_state that does nothing
class Help(GameState):
def __init__(self):
super().__init__()
self.speed_text = "1. The rookie chain (our adap... | 41.692308 | 102 | 0.648392 |
d905ac721a537fdca46cc7572eff4fe887ed4b19 | 1,244 | py | Python | tests/test_simple_glazing.py | louisleroy5/archetypal | 71f13aaed859c10e663e68624e2b74d816de631f | [
"MIT"
] | null | null | null | tests/test_simple_glazing.py | louisleroy5/archetypal | 71f13aaed859c10e663e68624e2b74d816de631f | [
"MIT"
] | null | null | null | tests/test_simple_glazing.py | louisleroy5/archetypal | 71f13aaed859c10e663e68624e2b74d816de631f | [
"MIT"
] | null | null | null | import warnings
import pytest
from archetypal.simple_glazing import calc_simple_glazing
def test_glazing():
"""Simulates a Double Clear Air Glazing System (Window.exe v.7.5)"""
res = calc_simple_glazing(0.704, 2.703, 0.786)
print(res["Thickness"])
def test_absurd():
"""Simulates a Double Clear Air... | 27.644444 | 76 | 0.688907 |
231af0abcba7c88fe48182f59d82aacb3db0dd35 | 5,395 | py | Python | v1.0.0.test/toontown/racing/DistributedRacePadAI.py | TTOFFLINE-LEAK/ttoffline | bb0e91704a755d34983e94288d50288e46b68380 | [
"MIT"
] | 4 | 2019-07-01T15:46:43.000Z | 2021-07-23T16:26:48.000Z | v1.0.0.test/toontown/racing/DistributedRacePadAI.py | TTOFFLINE-LEAK/ttoffline | bb0e91704a755d34983e94288d50288e46b68380 | [
"MIT"
] | 1 | 2019-06-29T03:40:05.000Z | 2021-06-13T01:15:16.000Z | v1.0.0.test/toontown/racing/DistributedRacePadAI.py | TTOFFLINE-LEAK/ttoffline | bb0e91704a755d34983e94288d50288e46b68380 | [
"MIT"
] | 4 | 2019-07-28T21:18:46.000Z | 2021-02-25T06:37:25.000Z | from direct.directnotify import DirectNotifyGlobal
from direct.distributed.ClockDelta import globalClockDelta
from direct.fsm.FSM import FSM
from toontown.racing import RaceGlobals
from toontown.racing.DistributedKartPadAI import DistributedKartPadAI
from toontown.racing.KartShopGlobals import KartGlobals
from toontown... | 38.262411 | 257 | 0.637998 |
1b554d76e467f1a248fb7572ebaa530ce5d1fed8 | 5,824 | py | Python | tests/integration_time_test.py | uncbiag/neuro_shooting | ebf80a9c0a4515fdfffaa0c5418dc866e2776495 | [
"Apache-2.0"
] | 6 | 2020-12-10T19:03:08.000Z | 2021-09-30T09:05:17.000Z | tests/integration_time_test.py | uncbiag/neuro_shooting | ebf80a9c0a4515fdfffaa0c5418dc866e2776495 | [
"Apache-2.0"
] | null | null | null | tests/integration_time_test.py | uncbiag/neuro_shooting | ebf80a9c0a4515fdfffaa0c5418dc866e2776495 | [
"Apache-2.0"
] | 1 | 2020-12-13T08:46:13.000Z | 2020-12-13T08:46:13.000Z | # the goal of this script is to use determine if integration with multiple time-steps works as intended
import numpy as np
import random
seed = 1234
print('Setting the random seed to {:}'.format(seed))
random.seed(seed)
np.random.seed(seed)
import torch
torch.manual_seed(seed)
import neuro_shooting.shooting_blocks a... | 46.222222 | 141 | 0.545673 |
d29f45a76ed07c66f147c5c97c8b9bf2621a184f | 5,847 | py | Python | lib/rucio/web/rest/flaskapi/v1/common.py | andresailer/rucio | 5cdc5387ad4fbd9934973311e0b0ecb0ec198c28 | [
"Apache-2.0"
] | null | null | null | lib/rucio/web/rest/flaskapi/v1/common.py | andresailer/rucio | 5cdc5387ad4fbd9934973311e0b0ecb0ec198c28 | [
"Apache-2.0"
] | null | null | null | lib/rucio/web/rest/flaskapi/v1/common.py | andresailer/rucio | 5cdc5387ad4fbd9934973311e0b0ecb0ec198c28 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2014-2020 CERN
#
# 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 a... | 37.480769 | 212 | 0.703096 |
aef85e465391b069f10e48cdbcebf0192a401e71 | 1,817 | py | Python | tools/mo/unit_tests/mo/front/caffe/proposal_ext_test.py | ryanloney/openvino-1 | 4e0a740eb3ee31062ba0df88fcf438564f67edb7 | [
"Apache-2.0"
] | 1,127 | 2018-10-15T14:36:58.000Z | 2020-04-20T09:29:44.000Z | tools/mo/unit_tests/mo/front/caffe/proposal_ext_test.py | ryanloney/openvino-1 | 4e0a740eb3ee31062ba0df88fcf438564f67edb7 | [
"Apache-2.0"
] | 439 | 2018-10-20T04:40:35.000Z | 2020-04-19T05:56:25.000Z | tools/mo/unit_tests/mo/front/caffe/proposal_ext_test.py | ryanloney/openvino-1 | 4e0a740eb3ee31062ba0df88fcf438564f67edb7 | [
"Apache-2.0"
] | 414 | 2018-10-17T05:53:46.000Z | 2020-04-16T17:29:53.000Z | # Copyright (C) 2018-2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import unittest
from unittest.mock import patch
from openvino.tools.mo.front.caffe.proposal_ext import ProposalFrontExtractor
from openvino.tools.mo.ops.proposal import ProposalOp
from openvino.tools.mo.ops.op import Op
from unit_tests.... | 28.84127 | 79 | 0.621904 |
871c9c77a0110f3fc64bc305a23de26e68c901f0 | 1,368 | py | Python | sources/migrations/versions/919a41af1b56_.py | pablintino/Altium-DBlib-source | 65e85572f84048a7e7c5a116b429e09ac9a33e82 | [
"MIT"
] | 1 | 2021-06-23T20:19:45.000Z | 2021-06-23T20:19:45.000Z | sources/migrations/versions/919a41af1b56_.py | pablintino/Altium-DBlib-source | 65e85572f84048a7e7c5a116b429e09ac9a33e82 | [
"MIT"
] | null | null | null | sources/migrations/versions/919a41af1b56_.py | pablintino/Altium-DBlib-source | 65e85572f84048a7e7c5a116b429e09ac9a33e82 | [
"MIT"
] | null | null | null | """empty message
Revision ID: 919a41af1b56
Revises: afe05e78ec30
Create Date: 2020-07-25 22:41:48.553542
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '919a41af1b56'
down_revision = 'afe05e78ec30'
branch_labels = None
depends_on = None
def upgrade():
# ... | 32.571429 | 73 | 0.692982 |
6b2dc21129e39211430e06f4b27eabfcb61003aa | 55 | py | Python | src/modules/bidding/domain/events.py | pgorecki/python-ddd | 0073ccce35c651be263f5d7d3d63f9a49bc0b78a | [
"MIT"
] | 10 | 2022-03-16T19:26:51.000Z | 2022-03-31T23:50:51.000Z | src/modules/bidding/domain/events.py | pgorecki/python-ddd | 0073ccce35c651be263f5d7d3d63f9a49bc0b78a | [
"MIT"
] | null | null | null | src/modules/bidding/domain/events.py | pgorecki/python-ddd | 0073ccce35c651be263f5d7d3d63f9a49bc0b78a | [
"MIT"
] | 2 | 2022-03-16T19:26:54.000Z | 2022-03-27T13:21:02.000Z | class PlacedBidIsGreaterThanCurrentWinningBid:
...
| 18.333333 | 46 | 0.8 |
7b2f5cb56622a02df561946066434e466e9f5882 | 10,793 | py | Python | cifar/compute_if.py | xszheng2020/memorization | 6270df8db388922fc35d6cd7b23112e74fbbe1f6 | [
"Apache-2.0"
] | 4 | 2022-03-16T12:05:47.000Z | 2022-03-28T12:21:36.000Z | cifar/compute_if.py | xszheng2020/memorization | 6270df8db388922fc35d6cd7b23112e74fbbe1f6 | [
"Apache-2.0"
] | null | null | null | cifar/compute_if.py | xszheng2020/memorization | 6270df8db388922fc35d6cd7b23112e74fbbe1f6 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import os
import config
import random
import numpy as np
import pandas as pd
pd.set_option('max_colwidth', 256)
# +
import matplotlib.pyplot as plt
from IPython.display import set_matplotlib_formats
# %matplotlib inline
set_matplotlib_formats('svg')
# -
import torch
from torch import nn
fr... | 33.209231 | 146 | 0.527008 |
b95c2d9171a1c770e3e273a4dd4a386646d92d4d | 392 | py | Python | rest_api/schemas/errors.py | parisbs/python-rest-api | 97ef302f1613545d8c411b65b55cf7c9c8f5a95d | [
"MIT"
] | null | null | null | rest_api/schemas/errors.py | parisbs/python-rest-api | 97ef302f1613545d8c411b65b55cf7c9c8f5a95d | [
"MIT"
] | 2 | 2021-04-30T20:52:42.000Z | 2021-06-02T00:24:27.000Z | rest_api/schemas/errors.py | parisbs/python-rest-api | 97ef302f1613545d8c411b65b55cf7c9c8f5a95d | [
"MIT"
] | null | null | null | from flask_restplus import fields
common_error_schema = {
'message': fields.String(
title='Message',
description='Error message',
example='Invalid request',
readOnly=True
),
'extra_data': fields.String(
title='Extra data',
description='Extra data fields',
... | 23.058824 | 43 | 0.59949 |
a90f8087323dafd32c7a135a3bef2fa714386432 | 8,598 | py | Python | zazi/apps/loan_ledger/utils/financial_statements.py | felixcheruiyot/zazi-core-banking | 0a2dac42235adcac3cf8c114961e407f54844223 | [
"Apache-2.0"
] | null | null | null | zazi/apps/loan_ledger/utils/financial_statements.py | felixcheruiyot/zazi-core-banking | 0a2dac42235adcac3cf8c114961e407f54844223 | [
"Apache-2.0"
] | 1 | 2021-08-20T06:41:57.000Z | 2021-08-20T06:41:57.000Z | zazi/apps/loan_ledger/utils/financial_statements.py | felixcheruiyot/zazi-core-banking | 0a2dac42235adcac3cf8c114961e407f54844223 | [
"Apache-2.0"
] | null | null | null | from collections import namedtuple
from dateutil.relativedelta import relativedelta
from decimal import Decimal as D
from django.conf import settings
from django.db import transaction as db_transaction, models
from django.core.exceptions import ObjectDoesNotExist
from django.utils import timezone
from zazi.apps.bank... | 36.587234 | 82 | 0.57211 |
a61d9eeff4445bbb04e1f3e38f191f1f9f10720f | 1,939 | py | Python | sdk/keyvault/azure-keyvault-secrets/azure/keyvault/secrets/_shared/_generated/v7_0/aio/_configuration_async.py | kushan2018/azure-sdk-for-python | 08a9296207281f4e90e23cf7a30173863accc867 | [
"MIT"
] | null | null | null | sdk/keyvault/azure-keyvault-secrets/azure/keyvault/secrets/_shared/_generated/v7_0/aio/_configuration_async.py | kushan2018/azure-sdk-for-python | 08a9296207281f4e90e23cf7a30173863accc867 | [
"MIT"
] | 1 | 2019-06-04T18:12:16.000Z | 2019-06-04T18:12:16.000Z | sdk/keyvault/azure-keyvault-secrets/azure/keyvault/secrets/_shared/_generated/v7_0/aio/_configuration_async.py | kushan2018/azure-sdk-for-python | 08a9296207281f4e90e23cf7a30173863accc867 | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 40.395833 | 95 | 0.680763 |
9e8c51f8ec76018811dc62a5379f9806a4f37444 | 37,850 | py | Python | pyNastran/op2/tables/oes_stressStrain/oes_nonlinear.py | 214929177/pyNastran | 73032d6ffd445ef085c124dde6b5e90a516a5b6a | [
"BSD-3-Clause"
] | null | null | null | pyNastran/op2/tables/oes_stressStrain/oes_nonlinear.py | 214929177/pyNastran | 73032d6ffd445ef085c124dde6b5e90a516a5b6a | [
"BSD-3-Clause"
] | 1 | 2021-06-07T16:33:59.000Z | 2021-06-07T16:33:59.000Z | pyNastran/op2/tables/oes_stressStrain/oes_nonlinear.py | daptablade/pyNastran | 247d4ae7a1a3f6a25cc1c3f3c286d6b32f1f84e7 | [
"BSD-3-Clause"
] | 1 | 2021-12-17T10:45:08.000Z | 2021-12-17T10:45:08.000Z | """
defines:
- RealNonlinearPlateArray
"""
from math import isnan
from itertools import count, cycle
from typing import List
import numpy as np
from pyNastran.utils.numpy_utils import integer_types
from pyNastran.op2.result_objects.op2_objects import get_times_dtype
from pyNastran.op2.tables.oes_stressStrain.real.o... | 48.525641 | 151 | 0.472761 |
c312905ab3d15b2d7a0c62aa1f4ddd37e4ad2e19 | 533 | py | Python | code/python/third_party/Deadline/JobTaskLimit.py | mikeroberts3000/ml-hypersim | 75b363ee52fbdbd0cc9b554c34c1aadea404183e | [
"AML"
] | 10 | 2020-11-17T00:33:42.000Z | 2022-02-16T23:31:58.000Z | code/python/third_party/Deadline/JobTaskLimit.py | mikeroberts3000/ml-hypersim | 75b363ee52fbdbd0cc9b554c34c1aadea404183e | [
"AML"
] | null | null | null | code/python/third_party/Deadline/JobTaskLimit.py | mikeroberts3000/ml-hypersim | 75b363ee52fbdbd0cc9b554c34c1aadea404183e | [
"AML"
] | null | null | null | from .ConnectionProperty import ConnectionProperty
class JobTaskLimit:
"""
Class used by DeadlineCon to send Job task limit requests.
Stores the address of the Web Service for use in sending requests.
"""
def __init__(self, connectionProperties):
self.connectionProperties = connect... | 35.533333 | 74 | 0.673546 |
f4c7bb43f1f26c1127760d1f3a445258169f1be5 | 1,180 | py | Python | dsbot/expertise/ExpertiseAnalyzer.py | jefrysastre/dsbot | 5afbfc34b2846f13d118df70160513935331983d | [
"MIT"
] | null | null | null | dsbot/expertise/ExpertiseAnalyzer.py | jefrysastre/dsbot | 5afbfc34b2846f13d118df70160513935331983d | [
"MIT"
] | null | null | null | dsbot/expertise/ExpertiseAnalyzer.py | jefrysastre/dsbot | 5afbfc34b2846f13d118df70160513935331983d | [
"MIT"
] | null | null | null | import numpy as np
import os
import pickle
from .datascience_glossary import DataScienceGlossary
class ExpertiseAnalyzer():
def __init__(self):
self.path = 'data/user.settings.pickle'
self.user_config = {
'text_expertise': 0.5,
'commands':{
'speaking': 0.12... | 26.818182 | 56 | 0.518644 |
d7b419008236dc9e39a7a975c5400d8675323c98 | 15,062 | py | Python | fritzbox_exporter.py | jonilala796/fritzbox_exporter | 04ac1709cee9dfa59b15797e6745812c62afc5f5 | [
"Apache-2.0"
] | null | null | null | fritzbox_exporter.py | jonilala796/fritzbox_exporter | 04ac1709cee9dfa59b15797e6745812c62afc5f5 | [
"Apache-2.0"
] | null | null | null | fritzbox_exporter.py | jonilala796/fritzbox_exporter | 04ac1709cee9dfa59b15797e6745812c62afc5f5 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Patrick Dreker <patrick@dreker.de>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 53.985663 | 139 | 0.621033 |
6b955bea5aeca0b8dc9d7af6c871515b334fc6f2 | 499 | py | Python | setup.py | NativeDesign/python-firmware | f5ecbbef62f57e27f883fab82a680871a00b1b88 | [
"MIT"
] | null | null | null | setup.py | NativeDesign/python-firmware | f5ecbbef62f57e27f883fab82a680871a00b1b88 | [
"MIT"
] | null | null | null | setup.py | NativeDesign/python-firmware | f5ecbbef62f57e27f883fab82a680871a00b1b88 | [
"MIT"
] | null | null | null | from setuptools import setup
setup(name='ntv-firmware',
version='1.0.2',
description='Utility function for locating the serial port of a particular firmware device.',
url='https://git.native.com/ntv/python-firmware',
author='Alan Pich',
author_email='alanp@native.com',
license='MIT'... | 29.352941 | 99 | 0.633267 |
956a29d160d9db68a65b6a65a0b84591c57d4e88 | 3,115 | py | Python | src/stay_classification/metrics_cluster_tools.py | m-salewski/stay_classification | e3f9deadf51c97029a0f9a4bb669a5af68abf7c6 | [
"MIT"
] | null | null | null | src/stay_classification/metrics_cluster_tools.py | m-salewski/stay_classification | e3f9deadf51c97029a0f9a4bb669a5af68abf7c6 | [
"MIT"
] | null | null | null | src/stay_classification/metrics_cluster_tools.py | m-salewski/stay_classification | e3f9deadf51c97029a0f9a4bb669a5af68abf7c6 | [
"MIT"
] | null | null | null | import numpy as np
from synthetic_data.trajectory import get_stay_indices, get_adjusted_stays
from sklearn.metrics import precision_score, recall_score, accuracy_score, confusion_matrix
from stay_classification.cluster_helper import inter_bounds
#TODO
# [x] move all generic functions related to measuring/manipu... | 28.577982 | 93 | 0.697271 |
ef238d6e39f457f53d21e49d49e2904b12483774 | 2,870 | py | Python | api_watchdog/formatters/result_group_html.py | davefol/api-watchdog | c1ba8022e4f8fcaea020d3bd55fa7f88fb7418f7 | [
"MIT"
] | null | null | null | api_watchdog/formatters/result_group_html.py | davefol/api-watchdog | c1ba8022e4f8fcaea020d3bd55fa7f88fb7418f7 | [
"MIT"
] | 7 | 2021-12-03T15:40:10.000Z | 2022-03-31T13:13:24.000Z | api_watchdog/formatters/result_group_html.py | davefol/api-watchdog | c1ba8022e4f8fcaea020d3bd55fa7f88fb7418f7 | [
"MIT"
] | 1 | 2021-12-03T21:50:23.000Z | 2021-12-03T21:50:23.000Z | from api_watchdog.collect import WatchdogResultGroup
from api_watchdog.core import WatchdogResult, ExpectationResult
def html_from_result_group(result_group: WatchdogResultGroup) -> str:
def group_format(result_group: WatchdogResultGroup):
html = (
f'<h2>{result_group.name}</h2>'
)
... | 28.137255 | 134 | 0.605923 |
d9167a48bf830a6d9b18dbdbd253d06539fec6c8 | 643 | py | Python | lecture3/tests/question-3_7.py | ggorman/Introduction-Python-programming-2018 | 739b864c1499ccdbf9010d8fe774087a07bb09ee | [
"CC-BY-3.0"
] | 1 | 2019-01-12T12:43:24.000Z | 2019-01-12T12:43:24.000Z | lecture3/tests/question-3_7.py | ggorman/Introduction-Python-programming-2018 | 739b864c1499ccdbf9010d8fe774087a07bb09ee | [
"CC-BY-3.0"
] | null | null | null | lecture3/tests/question-3_7.py | ggorman/Introduction-Python-programming-2018 | 739b864c1499ccdbf9010d8fe774087a07bb09ee | [
"CC-BY-3.0"
] | 3 | 2019-05-16T21:08:48.000Z | 2022-02-21T06:54:57.000Z | test = {
'name': 'question 3.7',
'points': 1,
'suites': [
{
'cases': [
{
'code': r"""
>>> np.allclose(myprimes, [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97])
True
""",
'hidden': False,
... | 19.484848 | 133 | 0.353033 |
5c09f94273e2c8907ac7a0ad316529ad22a61b0e | 432 | py | Python | running_modes/reinforcement_learning/configurations/link_invent_scoring_strategy_congfiguration.py | lilleswing/Reinvent-1 | ac4e3e6fa6379c6f4af883478dfd1b3407933ada | [
"Apache-2.0"
] | 183 | 2020-04-04T02:01:15.000Z | 2022-03-30T21:56:56.000Z | running_modes/reinforcement_learning/configurations/link_invent_scoring_strategy_congfiguration.py | lilleswing/Reinvent-1 | ac4e3e6fa6379c6f4af883478dfd1b3407933ada | [
"Apache-2.0"
] | 39 | 2020-04-05T15:19:56.000Z | 2022-03-09T12:58:21.000Z | running_modes/reinforcement_learning/configurations/link_invent_scoring_strategy_congfiguration.py | lilleswing/Reinvent-1 | ac4e3e6fa6379c6f4af883478dfd1b3407933ada | [
"Apache-2.0"
] | 70 | 2020-04-05T19:25:43.000Z | 2022-02-22T12:04:39.000Z | from dataclasses import dataclass
from reinvent_scoring.scoring.diversity_filters.reinvent_core.diversity_filter_parameters import \
DiversityFilterParameters
from running_modes.reinforcement_learning.configurations.scoring_strategy_configuration import \
ScoringStrategyConfiguration
@dataclass
class LinkInv... | 33.230769 | 98 | 0.886574 |
61cc72611a4596cd580f9583dcb420a073aec733 | 8,575 | py | Python | indico/modules/events/editing/blueprint.py | ParthS007/indico | 5031dd03e16c8021bb41f419ec9f2b6cdfe2148d | [
"MIT"
] | 1 | 2021-02-24T10:20:14.000Z | 2021-02-24T10:20:14.000Z | indico/modules/events/editing/blueprint.py | ParthS007/indico | 5031dd03e16c8021bb41f419ec9f2b6cdfe2148d | [
"MIT"
] | null | null | null | indico/modules/events/editing/blueprint.py | ParthS007/indico | 5031dd03e16c8021bb41f419ec9f2b6cdfe2148d | [
"MIT"
] | null | null | null | # This file is part of Indico.
# Copyright (C) 2002 - 2021 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from indico.modules.events.editing.controllers import frontend
from indico.modules.events.editing.controll... | 71.458333 | 116 | 0.734344 |
c11fb3d7e6eafcc951eb7b4c042412070a202699 | 15,914 | py | Python | python/ccxt/async_support/__init__.py | jofre-lab/ccxt | 7c4082897bdf91b556fbf0a0e4f0ac9ad5eef365 | [
"MIT"
] | null | null | null | python/ccxt/async_support/__init__.py | jofre-lab/ccxt | 7c4082897bdf91b556fbf0a0e4f0ac9ad5eef365 | [
"MIT"
] | null | null | null | python/ccxt/async_support/__init__.py | jofre-lab/ccxt | 7c4082897bdf91b556fbf0a0e4f0ac9ad5eef365 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""CCXT: CryptoCurrency eXchange Trading Library (Async)"""
# -----------------------------------------------------------------------------
__version__ = '1.40.14'
# -----------------------------------------------------------------------------
from ccxt.async_support.base.exchange import Ex... | 50.84345 | 86 | 0.556554 |
7705002706da21b4282c435cf38c7d3acbde8eb4 | 13,995 | py | Python | frappe/model/naming.py | ssuda777/frappe | d3f3df2ce15154aecc1d9d6d07d947e72c2e8c6e | [
"MIT"
] | 1 | 2021-06-11T10:28:07.000Z | 2021-06-11T10:28:07.000Z | frappe/model/naming.py | JMBodz/frappe | eb218a06d1cbfc3a8f1cc00ba8dac2c927d2f71d | [
"MIT"
] | 3 | 2021-08-23T15:20:28.000Z | 2022-03-27T07:47:36.000Z | frappe/model/naming.py | JMBodz/frappe | eb218a06d1cbfc3a8f1cc00ba8dac2c927d2f71d | [
"MIT"
] | 1 | 2021-04-10T12:01:10.000Z | 2021-04-10T12:01:10.000Z | """utilities to generate a document name based on various rules defined.
NOTE:
Till version 13, whenever a submittable document is amended it's name is set to orig_name-X,
where X is a counter and it increments when amended again and so on.
From Version 14, The naming pattern is changed in a way that amended document... | 30.962389 | 112 | 0.698464 |
6118c3788ac0663b5ca161cf224dcb49d41377c7 | 177 | py | Python | examples/ps_rockstar.py | hoojaoh/rockstar | 2cb911be76fc93692c180d629f0b282d672ea8f7 | [
"MIT"
] | 4,603 | 2015-07-16T20:11:28.000Z | 2022-03-21T23:51:47.000Z | examples/ps_rockstar.py | hoojaoh/rockstar | 2cb911be76fc93692c180d629f0b282d672ea8f7 | [
"MIT"
] | 90 | 2015-07-18T11:51:33.000Z | 2021-05-10T02:45:58.000Z | examples/ps_rockstar.py | hoojaoh/rockstar | 2cb911be76fc93692c180d629f0b282d672ea8f7 | [
"MIT"
] | 436 | 2015-07-16T22:10:50.000Z | 2022-02-15T04:53:19.000Z | from rockstar import RockStar
ps_code = "Write-Host 'Hello World!'"
rock_it_bro = RockStar(days=400, file_name='helloWorld.ps1', code=ps_code)
rock_it_bro.make_me_a_rockstar()
| 29.5 | 74 | 0.79096 |
a97099e252ea9249c4cf2dc169369400d3bcd75c | 224 | py | Python | unit_converter/app.py | clash402/unit-converter | 12bfc741687328c88f2a04fc2dac469ff30ca50f | [
"MIT"
] | null | null | null | unit_converter/app.py | clash402/unit-converter | 12bfc741687328c88f2a04fc2dac469ff30ca50f | [
"MIT"
] | null | null | null | unit_converter/app.py | clash402/unit-converter | 12bfc741687328c88f2a04fc2dac469ff30ca50f | [
"MIT"
] | null | null | null | from unit_converter.ui.ui import UI
from unit_converter.converter import Converter
class App:
def __init__(self):
self.ui = UI(Converter())
# PUBLIC METHODS
def start(self):
self.ui.mainloop()
| 18.666667 | 46 | 0.674107 |
c68e1220a592e203f1cf775fc8de466d12e42533 | 2,741 | py | Python | setup_resnet.py | piotrek-k/nn_robust_attacks | 3995e4daaa2fd913ad89528bcf06557ebf446b59 | [
"BSD-2-Clause"
] | null | null | null | setup_resnet.py | piotrek-k/nn_robust_attacks | 3995e4daaa2fd913ad89528bcf06557ebf446b59 | [
"BSD-2-Clause"
] | null | null | null | setup_resnet.py | piotrek-k/nn_robust_attacks | 3995e4daaa2fd913ad89528bcf06557ebf446b59 | [
"BSD-2-Clause"
] | null | null | null | # https://github.com/shoji9x9/CIFAR-10-By-small-ResNet/blob/master/ResNet-for-CIFAR-10-with-Keras.ipynb
import tensorflow as tf
from keras.models import Sequential
from keras.layers import Dense, Dropout, Activation, Flatten
from keras.layers import Conv2D, MaxPooling2D
from tensorflow.keras.layers import Conv2D, Dens... | 38.605634 | 137 | 0.601605 |
09bead1c803a3caa367bd7245aee16fd14cab1fd | 414 | py | Python | info/modules/index/views.py | xzp820017462/information27 | b48010c7ff8f25da69e98621123a1408573a3cba | [
"MIT"
] | null | null | null | info/modules/index/views.py | xzp820017462/information27 | b48010c7ff8f25da69e98621123a1408573a3cba | [
"MIT"
] | null | null | null | info/modules/index/views.py | xzp820017462/information27 | b48010c7ff8f25da69e98621123a1408573a3cba | [
"MIT"
] | null | null | null | from flask import current_app
from flask import render_template
from . import index_blu
from info import redis_store
@index_blu.route('/')
def index():
#redis_store.set("name","itheima")
#redis_store.set("name","itcast")
return render_template('news/index.html')
#在打开网页的时候.会默认请求根路径favicon.ico
@index_blu.ro... | 27.6 | 59 | 0.753623 |
24afc57ff1e5dcf7eea37be1c0bdfac4419ec2cf | 1,910 | py | Python | python/logger.py | Xanonymous-GitHub/main | 53120110bd8dc9ab33424fa26d1a8ca5b9256ebe | [
"Apache-2.0"
] | 1 | 2019-09-27T17:46:41.000Z | 2019-09-27T17:46:41.000Z | python/logger.py | Xanonymous-GitHub/main | 53120110bd8dc9ab33424fa26d1a8ca5b9256ebe | [
"Apache-2.0"
] | null | null | null | python/logger.py | Xanonymous-GitHub/main | 53120110bd8dc9ab33424fa26d1a8ca5b9256ebe | [
"Apache-2.0"
] | 5 | 2019-09-30T16:41:14.000Z | 2019-10-25T11:13:39.000Z | import pythoncom
import pyHook
import time
'''
def onMouseEvent(event):
"處理鼠標事件"
fobj.writelines('-' * 20 + 'MouseEvent Begin' + '-' * 20 + '\n')
fobj.writelines("Current Time:%s\n" % time.strftime("%a, %d %b %Y %H:%M:%S ", time.gmtime()))
fobj.writelines("MessageName:%s\n" % str(event.Mes... | 31.311475 | 99 | 0.581675 |
2bbbb9e2cb352d9f22fffb931cea8840e73ad57a | 3,997 | py | Python | tests/test_stats.py | FingerCrunch/scrapy | 3225de725720bba246ba8c9845fe4b84bc0c82e7 | [
"BSD-3-Clause"
] | 41,267 | 2015-01-01T07:39:25.000Z | 2022-03-31T20:09:40.000Z | tests/test_stats.py | FingerCrunch/scrapy | 3225de725720bba246ba8c9845fe4b84bc0c82e7 | [
"BSD-3-Clause"
] | 4,420 | 2015-01-02T09:35:38.000Z | 2022-03-31T22:53:32.000Z | tests/test_stats.py | FingerCrunch/scrapy | 3225de725720bba246ba8c9845fe4b84bc0c82e7 | [
"BSD-3-Clause"
] | 11,080 | 2015-01-01T18:11:30.000Z | 2022-03-31T15:33:19.000Z | from datetime import datetime
import unittest
from unittest import mock
from scrapy.extensions.corestats import CoreStats
from scrapy.spiders import Spider
from scrapy.statscollectors import StatsCollector, DummyStatsCollector
from scrapy.utils.test import get_crawler
class CoreStatsExtensionTest(unittest.TestCase):... | 40.373737 | 75 | 0.647736 |
331eba5df083c980430ad023f100803cd734e285 | 541 | py | Python | Chapter05-old/Exercise5_12/Exercise5_12.py | PacktWorkshops/The-Spark-Workshop | f5b052b67d3aaf805eb48c9958c0dcfd237cc841 | [
"MIT"
] | 7 | 2019-11-11T13:17:04.000Z | 2021-01-18T22:09:44.000Z | Chapter05-old/Exercise5_12/Exercise5_12.py | PacktWorkshops/The-Spark-Workshop | f5b052b67d3aaf805eb48c9958c0dcfd237cc841 | [
"MIT"
] | null | null | null | Chapter05-old/Exercise5_12/Exercise5_12.py | PacktWorkshops/The-Spark-Workshop | f5b052b67d3aaf805eb48c9958c0dcfd237cc841 | [
"MIT"
] | 12 | 2020-04-20T16:23:51.000Z | 2021-07-07T20:37:45.000Z | spark = SparkSession \
.builder \
.appName("exercise_twelve") \
.getOrCreate()
csv_pyspark_df1 = spark.read.csv("hdfs://user/your_user_name/data/csv/userdata1.csv"
, sep=","
, inferSchema="true"
, header="true")
csv_pyspark_df2 = spark.read.format("csv").load("hdfs://user/your_user_name/data/csv/userda... | 25.761905 | 99 | 0.674677 |
8754dea24ffb22ca62882b7fc2dd04f44630168b | 645 | py | Python | epidemic_model/sir.py | innovator-zero/Python | f776eb081c6688c2f5a98b0050b33582c1769391 | [
"Apache-2.0"
] | null | null | null | epidemic_model/sir.py | innovator-zero/Python | f776eb081c6688c2f5a98b0050b33582c1769391 | [
"Apache-2.0"
] | 3 | 2020-03-09T03:40:53.000Z | 2020-11-12T15:36:03.000Z | epidemic_model/sir.py | innovator-zero/Python | f776eb081c6688c2f5a98b0050b33582c1769391 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
N = 1e7
T = 70
s = np.zeros([T])
i = np.zeros([T])
r = np.zeros([T])
lamda = 1.0
gamma = 0.5
i[0] = 45.0 / N
s[0] = 1 - i[0]
for t in range(T - 1):
i[t + 1] = i[t] + i[t] * lamda * s[t] - gamma * i[t]
s[t + 1] = s[t] - lamda * s[t] * i[t]
r[t + 1] = r[t... | 20.15625 | 56 | 0.56124 |
4bd91695f59fe3e20d9f882be9f1f9ae627024a4 | 5,413 | py | Python | ivy/functional/backends/torch/linear_algebra.py | uchennayah/ivy-1 | ec422d1f135db54f64df444ed32186e8a31c4599 | [
"Apache-2.0"
] | null | null | null | ivy/functional/backends/torch/linear_algebra.py | uchennayah/ivy-1 | ec422d1f135db54f64df444ed32186e8a31c4599 | [
"Apache-2.0"
] | null | null | null | ivy/functional/backends/torch/linear_algebra.py | uchennayah/ivy-1 | ec422d1f135db54f64df444ed32186e8a31c4599 | [
"Apache-2.0"
] | null | null | null | # global
import torch
from typing import Union, Optional, Tuple, Literal, List
from collections import namedtuple
# local
import ivy as _ivy
from ivy import inf
from collections import namedtuple
import ivy as _ivy
# Array API Standard #
# -------------------#
def eigh(x: torch.Tensor)\
->torch.Tensor:
retur... | 28.640212 | 121 | 0.608904 |
d99b09841f846c7730a7e10de99bf01edcfa0c0e | 5,208 | py | Python | qiskit_nature/results/eigenstate_result.py | jschuhmac/qiskit-nature | b8b1181d951cf8fa76fe0db9e5ea192dad5fb186 | [
"Apache-2.0"
] | 132 | 2021-01-28T14:51:11.000Z | 2022-03-25T21:10:47.000Z | qiskit_nature/results/eigenstate_result.py | jschuhmac/qiskit-nature | b8b1181d951cf8fa76fe0db9e5ea192dad5fb186 | [
"Apache-2.0"
] | 449 | 2021-01-28T19:57:43.000Z | 2022-03-31T17:01:50.000Z | qiskit_nature/results/eigenstate_result.py | jschuhmac/qiskit-nature | b8b1181d951cf8fa76fe0db9e5ea192dad5fb186 | [
"Apache-2.0"
] | 109 | 2021-01-28T13:17:46.000Z | 2022-03-30T23:53:39.000Z | # This code is part of Qiskit.
#
# (C) Copyright IBM 2020, 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... | 28.459016 | 98 | 0.5553 |
6a349dc74cf94f513b8fba69e81e122f8967f2d5 | 1,059 | py | Python | microsoft_atp/komand_microsoft_atp/triggers/get_alert_matching_key/trigger.py | emartin-merrill-r7/insightconnect-plugins | a589745dbcc9f01d3e601431e77ab7221a84c117 | [
"MIT"
] | 1 | 2020-03-18T09:14:55.000Z | 2020-03-18T09:14:55.000Z | microsoft_atp/komand_microsoft_atp/triggers/get_alert_matching_key/trigger.py | OSSSP/insightconnect-plugins | 846758dab745170cf1a8c146211a8bea9592e8ff | [
"MIT"
] | null | null | null | microsoft_atp/komand_microsoft_atp/triggers/get_alert_matching_key/trigger.py | OSSSP/insightconnect-plugins | 846758dab745170cf1a8c146211a8bea9592e8ff | [
"MIT"
] | null | null | null | import komand
import time
from .schema import GetAlertMatchingKeyInput, GetAlertMatchingKeyOutput
# Custom imports below
class GetAlertMatchingKey(komand.Trigger):
def __init__(self):
super(self.__class__, self).__init__(
name='get_alert_matching_key',
description='Get ale... | 30.257143 | 81 | 0.622285 |
e1ec38f0d1745b6539e47d891d6a2a9014d33393 | 17,324 | py | Python | lib/alchemy/__init__.py | nachogentile/PatentsProcessor | 43ae7a727d3368811c828eeca6d6e484af8cb2f6 | [
"BSD-2-Clause"
] | 14 | 2015-09-22T12:58:50.000Z | 2020-07-22T14:05:41.000Z | lib/alchemy/__init__.py | nachogentile/PatentsProcessor | 43ae7a727d3368811c828eeca6d6e484af8cb2f6 | [
"BSD-2-Clause"
] | 1 | 2016-05-31T18:25:32.000Z | 2016-05-31T18:25:32.000Z | lib/alchemy/__init__.py | nachogentile/PatentsProcessor | 43ae7a727d3368811c828eeca6d6e484af8cb2f6 | [
"BSD-2-Clause"
] | 16 | 2015-09-30T03:24:43.000Z | 2020-07-30T03:00:16.000Z | """
Copyright (c) 2013 The Regents of the University of California, AMERICAN INSTITUTES FOR RESEARCH
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the abo... | 33.968627 | 122 | 0.655795 |
01b5f39d47070301708153f824dcc458c568b728 | 4,207 | py | Python | faster-rcnn.pytorch/lib/datasets/vg_eval.py | sadjadasghari/3d-vehicle-tracking | af05d52be81db32fc6a21bf60a757ebc46557998 | [
"BSD-3-Clause"
] | 603 | 2019-05-28T01:53:29.000Z | 2022-03-22T00:26:07.000Z | faster-rcnn.pytorch/lib/datasets/vg_eval.py | reinforcementdriving/3d-vehicle-tracking | f8433f72a51dd1a7190570e63e9fda4a924a81f0 | [
"BSD-3-Clause"
] | 45 | 2019-05-29T05:07:20.000Z | 2022-01-28T04:10:42.000Z | faster-rcnn.pytorch/lib/datasets/vg_eval.py | reinforcementdriving/3d-vehicle-tracking | f8433f72a51dd1a7190570e63e9fda4a924a81f0 | [
"BSD-3-Clause"
] | 149 | 2019-05-28T06:53:12.000Z | 2022-03-24T19:11:58.000Z | from __future__ import absolute_import
# --------------------------------------------------------
# Fast/er R-CNN
# Licensed under The MIT License [see LICENSE for details]
# Written by Bharath Hariharan
# --------------------------------------------------------
import numpy as np
from .voc_eval import voc_ap
def vg... | 33.388889 | 79 | 0.487758 |
39609cfa1b5b828e6e549c4acdf99456b70281cb | 21,580 | py | Python | bot_project/buzzbot/stripAndConvertHTMLTags.py | pbarton666/buzz_bot | 9f44c66e8ecb10e231f70989421f164d7a55029a | [
"MIT"
] | null | null | null | bot_project/buzzbot/stripAndConvertHTMLTags.py | pbarton666/buzz_bot | 9f44c66e8ecb10e231f70989421f164d7a55029a | [
"MIT"
] | null | null | null | bot_project/buzzbot/stripAndConvertHTMLTags.py | pbarton666/buzz_bot | 9f44c66e8ecb10e231f70989421f164d7a55029a | [
"MIT"
] | null | null | null | #scrubHTML.py
#Produces a hash table to convert strange HTML tags and unicode symbols to
#something more readable. This can be maintained manually or build automoatically
#from Pat 's spreadsheet hashBash1.xls)
def makeHashTable():
myTable = []
newEntry = ('&', '&')
myTable.append(newEntry)
... | 31.457726 | 83 | 0.540361 |
edfde695c572192cfdfee3a00d37e1791ca048bf | 4,127 | py | Python | src/training/experiment_hard_label.py | XieResearchGroup/PLANS | 479e97f5944dcc036d5f4204890a371ebafb394a | [
"MIT"
] | null | null | null | src/training/experiment_hard_label.py | XieResearchGroup/PLANS | 479e97f5944dcc036d5f4204890a371ebafb394a | [
"MIT"
] | null | null | null | src/training/experiment_hard_label.py | XieResearchGroup/PLANS | 479e97f5944dcc036d5f4204890a371ebafb394a | [
"MIT"
] | null | null | null | import os
from datetime import datetime
from functools import partial
import tensorflow as tf
import numpy as np
from ..models.hmlc import HMLC, HMLC_M
from ..data_loaders.cvs_loader import CVSLoader
from ..utils.label_convertors import convert2vec, hierarchical, convert2hier
from ..utils.label_convertors import fill... | 30.57037 | 79 | 0.66489 |
20a46dbde289013ba2a5ed040a5fff392045299c | 1,354 | py | Python | contrib_src/inference.py | modelhub-ai/sfm-learner-pose | ea49439ae713d555a87dd55d9d1f07f7461ab1f8 | [
"MIT"
] | null | null | null | contrib_src/inference.py | modelhub-ai/sfm-learner-pose | ea49439ae713d555a87dd55d9d1f07f7461ab1f8 | [
"MIT"
] | null | null | null | contrib_src/inference.py | modelhub-ai/sfm-learner-pose | ea49439ae713d555a87dd55d9d1f07f7461ab1f8 | [
"MIT"
] | null | null | null | #import onnx
import tensorflow as tf
import json
from processing import ImageProcessor
from modelhublib.model import ModelBase
import PIL
import tensorflow as tf
import numpy as np
from tensorflow.python.saved_model import tag_constants
class Model(ModelBase):
def __init__(self):
# load config file
... | 33.02439 | 96 | 0.633678 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.