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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5ad5871c4fa4b53a8b5483f6f783631e9f4ef5db | 2,415 | py | Python | LBCollector.py | wbs306/LabBoard_Collector | ea93d8018bfd5ef65f956ce28f7611bc7b163874 | [
"MIT"
] | null | null | null | LBCollector.py | wbs306/LabBoard_Collector | ea93d8018bfd5ef65f956ce28f7611bc7b163874 | [
"MIT"
] | null | null | null | LBCollector.py | wbs306/LabBoard_Collector | ea93d8018bfd5ef65f956ce28f7611bc7b163874 | [
"MIT"
] | null | null | null | import logging
LOG_FORMAT = "%(levelname)s - %(message)s"
logging.basicConfig(level=logging.DEBUG, format=LOG_FORMAT)
if (__name__ == "__main__"):
LBCollector().run() | 29.096386 | 93 | 0.591304 | import datetime
import logging
import os
import subprocess
import time
from threading import Thread
import GlobalConfig
from DataWriter import DataWriter
from FanCollector import FanCollector
from UPSCollector import UPSCollector
from SensorCollector import SensorCollector
LOG_FORMAT = "%(levelname)s - %(message)s"
l... | 0 | 0 | 0 | 1,174 | 0 | 762 | 0 | 39 | 267 |
d274d8be0f35fddd2c05a005162b1034e03427c5 | 2,855 | py | Python | Obj_to_Photoshop/__init__.py | Yukimituki/Blender_addons | 328c30c487d07ccdd63eb258e6963f55f5fa5b5f | [
"MIT"
] | 3 | 2015-05-01T00:29:24.000Z | 2020-01-03T14:00:06.000Z | Obj_to_Photoshop/__init__.py | iCyP/Blender_addons | ab2df30241576c3d143f0f14ebcda2e267d3f3ed | [
"MIT"
] | null | null | null | Obj_to_Photoshop/__init__.py | iCyP/Blender_addons | ab2df30241576c3d143f0f14ebcda2e267d3f3ed | [
"MIT"
] | 3 | 2018-08-02T08:08:27.000Z | 2019-05-27T08:07:25.000Z | bl_info = {
"name": "3D Object to Photoshop",
"description": "Photoshop3D",
"author": "Yukimi",
"version": (0,4),
"blender": (2, 6, 0),
"location": "object",
"warning": "",
"wiki_url": "",
"tracker_url": "http://yukimi-blend.blogspot.jp/",
"category": "Import-Export"}
... | 33.197674 | 107 | 0.607005 | bl_info = {
"name": "3D Object to Photoshop",
"description": "選択形状をPhotoshopの3Dレイヤに",
"author": "Yukimi",
"version": (0,4),
"blender": (2, 6, 0),
"location": "object",
"warning": "",
"wiki_url": "",
"tracker_url": "http://yukimi-blend.blogspot.jp/",
"category": "Import-... | 465 | 0 | 0 | 279 | 0 | 1,229 | 0 | 18 | 257 |
7f6e5a2764ddc88181c95264a074baf6afa327e9 | 1,035 | py | Python | test/test-GetBetweennessCentr.py | Cam2337/snap-python | 0bf722b461f8b5aae3ecb2757313521e9e9e76f1 | [
"BSD-3-Clause"
] | 242 | 2015-01-01T08:40:28.000Z | 2022-03-18T05:22:09.000Z | test/test-GetBetweennessCentr.py | Cam2337/snap-python | 0bf722b461f8b5aae3ecb2757313521e9e9e76f1 | [
"BSD-3-Clause"
] | 99 | 2015-01-24T07:55:27.000Z | 2021-10-30T18:20:13.000Z | test/test-GetBetweennessCentr.py | Cam2337/snap-python | 0bf722b461f8b5aae3ecb2757313521e9e9e76f1 | [
"BSD-3-Clause"
] | 105 | 2015-03-03T06:45:17.000Z | 2022-02-24T15:52:40.000Z | import snap
Graph = snap.GenRndGnm(snap.PNGraph, 100, 1000)
Nodes = snap.TIntFltH()
Edges = snap.TIntPrFltH()
snap.GetBetweennessCentr(Graph, Nodes, Edges, 1.0)
for node in Nodes:
print("node: %d centrality: %f" % (node, Nodes[node]))
for edge in Edges:
print("edge: (%d, %d) centrality: %f" % (edge.GetVal1(), ... | 33.387097 | 90 | 0.674396 | import snap
Graph = snap.GenRndGnm(snap.PNGraph, 100, 1000)
Nodes = snap.TIntFltH()
Edges = snap.TIntPrFltH()
snap.GetBetweennessCentr(Graph, Nodes, Edges, 1.0)
for node in Nodes:
print("node: %d centrality: %f" % (node, Nodes[node]))
for edge in Edges:
print("edge: (%d, %d) centrality: %f" % (edge.GetVal1(), ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
23b76d522c3c90b8ab31b1723d8fef0dd7bbdc69 | 2,936 | py | Python | rps.py | kapilkeshav/Rock-Paper-Scissors | 742e48385b0a596b102e15f70d9f2eb6ea3e2a65 | [
"MIT"
] | 3 | 2021-05-20T16:38:47.000Z | 2021-06-20T16:03:48.000Z | rps.py | kapilkeshav/Rock-Paper-Scissors | 742e48385b0a596b102e15f70d9f2eb6ea3e2a65 | [
"MIT"
] | null | null | null | rps.py | kapilkeshav/Rock-Paper-Scissors | 742e48385b0a596b102e15f70d9f2eb6ea3e2a65 | [
"MIT"
] | null | null | null |
Choices = ['rock','paper','scissors']
cs = 0
us = 0
u = 0
c = 0
ctr = 0
print("********************** Rock Paper Scissors **********************" )
print(" Made by Keshav Dev Kapil ")
user1 = user(input("Enter name of user1: "))
print("Welcome to Rock, Pap... | 28.230769 | 131 | 0.467302 | import random
class user:
def __init__(self,name):
self.name = name
Choices = ['rock','paper','scissors']
cs = 0
us = 0
u = 0
c = 0
ctr = 0
def computer():
global c
a = random.choice(Choices)
if a==c:
return random.choice(Choices)
else:
return a
d... | 0 | 0 | 0 | 46 | 0 | 608 | 0 | -8 | 96 |
ce23a4a222684bc064ca394c14ac542b3b6722b2 | 278 | py | Python | ForFinance/Examples/emailskeleton.py | enriqueescobar-askida/Kinito.Finance | 5308748b64829ac798a858161f9b4a9e5829db44 | [
"MIT"
] | 2 | 2020-03-04T11:18:38.000Z | 2020-05-10T15:36:42.000Z | ForFinance/Examples/emailskeleton.py | enriqueescobar-askida/Kinito.Finance | 5308748b64829ac798a858161f9b4a9e5829db44 | [
"MIT"
] | 6 | 2020-03-30T16:42:47.000Z | 2021-12-13T20:37:21.000Z | ForFinance/Examples/emailskeleton.py | enriqueescobar-askida/Kinito.Finance | 5308748b64829ac798a858161f9b4a9e5829db44 | [
"MIT"
] | 1 | 2020-04-14T11:26:16.000Z | 2020-04-14T11:26:16.000Z | import os
EMAIL_ADDRESS = os.environ.get('EMAIL_USER')
EMAIL_PASSWORD = os.environ.get('EMAIL_PASS')
| 19.857143 | 45 | 0.81295 | import os
import smtplib
import imghdr
from email.message import EmailMessage
import yfinance as yf
import datetime as dt
import pandas as pd
from pandas_datareader import data as pdr
EMAIL_ADDRESS = os.environ.get('EMAIL_USER')
EMAIL_PASSWORD = os.environ.get('EMAIL_PASS')
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 20 | 155 |
6a75f0f30c77c1824043128e4c9ac90f5ad260d3 | 8,956 | py | Python | pytorch/scratch/analysis.py | tianqizhao-louis/nlp-research | e513d84a02ecd50a0d48418fca7d33c74cc0c9a4 | [
"MIT"
] | null | null | null | pytorch/scratch/analysis.py | tianqizhao-louis/nlp-research | e513d84a02ecd50a0d48418fca7d33c74cc0c9a4 | [
"MIT"
] | null | null | null | pytorch/scratch/analysis.py | tianqizhao-louis/nlp-research | e513d84a02ecd50a0d48418fca7d33c74cc0c9a4 | [
"MIT"
] | null | null | null | from collections import Counter
import csv
import json
import torch
from torchtext.vocab import Vocab
def process_to_pytorch(file_path, max_lines):
""" process the file into a list of tuple (index, sentence)
instead of using pandas, just use csv reader
"""
# read the tsv file
tsv_file = open(fi... | 35.399209 | 128 | 0.645377 | import time
from collections import Counter
from functools import partial
import csv
import json
import torch
from torch import nn
from torch.utils.data import DataLoader
from torch.utils.data.dataset import random_split
from torchtext.vocab import Vocab
from gensim.scripts.glove2word2vec import glove2word2vec
import ... | 0 | 0 | 0 | 905 | 0 | 5,380 | 0 | 73 | 245 |
f3b24427cc87d5514fff008f40bc0df954a1a248 | 939 | py | Python | phase_one_legacy/CPSC2020_challenge_test.py | DeepPSP/cpsc2020 | 47acb884ea1f2f819e564d8a17ad37001ed0df27 | [
"BSD-3-Clause"
] | 1 | 2021-12-07T11:44:48.000Z | 2021-12-07T11:44:48.000Z | phase_one_legacy/CPSC2020_challenge_test.py | wenh06/cpsc2020 | 47acb884ea1f2f819e564d8a17ad37001ed0df27 | [
"BSD-3-Clause"
] | null | null | null | phase_one_legacy/CPSC2020_challenge_test.py | wenh06/cpsc2020 | 47acb884ea1f2f819e564d8a17ad37001ed0df27 | [
"BSD-3-Clause"
] | 1 | 2021-05-25T14:56:02.000Z | 2021-05-25T14:56:02.000Z | """
"""
import argparse
def main(**kwargs):
"""
"""
raise NotImplementedError
if __name__ == "__main__":
ap = argparse.ArgumentParser(
description="CPSC2020 extra configs",
)
ap.add_argument(
"-m", "--mode",
type=str, required=True,
help="running mode, train o... | 23.475 | 87 | 0.664537 | """
"""
import os, sys
import argparse
import numpy as np
from signal_processing.ecg_preproc import preprocess_signal, parallel_preprocess_signal
from signal_processing.ecg_features import compute_ecg_features
from models.load_model import load_model
from models.train_model_ml import train as train_ml
from models.trai... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 177 | 155 |
1956d9a70f228902da751f61514636c08e6b8c2d | 7,953 | py | Python | armspeech/modelling/train.py | MattShannon/armspeech | d9259d1b64fa2e785d34877c6014788f3e16a377 | [
"BSD-3-Clause"
] | 34 | 2015-02-12T15:16:44.000Z | 2020-09-27T17:07:35.000Z | armspeech/modelling/train.py | nd1511/armspeech | d9259d1b64fa2e785d34877c6014788f3e16a377 | [
"BSD-3-Clause"
] | null | null | null | armspeech/modelling/train.py | nd1511/armspeech | d9259d1b64fa2e785d34877c6014788f3e16a377 | [
"BSD-3-Clause"
] | 9 | 2015-02-06T18:32:20.000Z | 2018-10-27T20:11:08.000Z | """Helper functions for training models.
Several of the functions below implement approximate maximum likelihood
estimation by optimizing the scaled log likelihood. The scale factor used in
these cases is the reciprocal of the "count" for the given dist, unless this
count is less than 1.0, in which case the scale fact... | 47.909639 | 317 | 0.707532 | """Helper functions for training models.
Several of the functions below implement approximate maximum likelihood
estimation by optimizing the scaled log likelihood. The scale factor used in
these cases is the reciprocal of the "count" for the given dist, unless this
count is less than 1.0, in which case the scale fact... | 0 | 6,515 | 0 | 0 | 0 | 0 | 0 | 87 | 226 |
c5034b998d5f71121f6a756f7fb2b926e1698808 | 163 | py | Python | app/chat/routing.py | GonnaFlyMethod/simple_chat | 9135003a1def28909c27a50d4cf38e0de52c7285 | [
"MIT"
] | null | null | null | app/chat/routing.py | GonnaFlyMethod/simple_chat | 9135003a1def28909c27a50d4cf38e0de52c7285 | [
"MIT"
] | null | null | null | app/chat/routing.py | GonnaFlyMethod/simple_chat | 9135003a1def28909c27a50d4cf38e0de52c7285 | [
"MIT"
] | null | null | null | from django.urls import path
from . import consumers
app_name = 'chat'
url_patterns = [
path('thread/<int:thread_id>/', consumers.ChatConsumer.as_asgi())
]
| 14.818182 | 68 | 0.717791 | from django.urls import path
from . import consumers
app_name = 'chat'
url_patterns = [
path('thread/<int:thread_id>/', consumers.ChatConsumer.as_asgi())
]
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6b1e02a9ce71584f67989d1a79ec423f1744c121 | 2,544 | py | Python | bundle_plots/plots_to_pdf.py | randomguy4214/poor-almanac-8 | c4c8fc091205e8f5d60ed6d29704d79a0260e7cb | [
"MIT"
] | null | null | null | bundle_plots/plots_to_pdf.py | randomguy4214/poor-almanac-8 | c4c8fc091205e8f5d60ed6d29704d79a0260e7cb | [
"MIT"
] | null | null | null | bundle_plots/plots_to_pdf.py | randomguy4214/poor-almanac-8 | c4c8fc091205e8f5d60ed6d29704d79a0260e7cb | [
"MIT"
] | null | null | null | #!/usr/bin/python
print('merging pdfs for filtered companies')
import os
import pandas as pd
from PyPDF2 import PdfFileMerger, PdfFileReader
from pathlib import Path
pd.options.mode.chained_assignment = None # default='warn'
pd.options.mode.use_inf_as_na = True
# set directories and files
cwd = os.getcwd()
input_fo... | 37.970149 | 125 | 0.711085 | #!/usr/bin/python
print('merging pdfs for filtered companies')
import os
import pandas as pd
import sys
from PyPDF2 import PdfFileMerger, PdfFileReader
from pathlib import Path
pd.options.mode.chained_assignment = None # default='warn'
pd.options.mode.use_inf_as_na = True
# set directories and files
cwd = os.getcwd... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -11 | 22 |
811133e7ccdb80214e9d29d673038fb38dae51a8 | 1,328 | py | Python | limnos/tests/test_transforms.py | WilliamHPNielsen/limnos | ae390ab4262ce79075d9aed46e20ef49e4feb165 | [
"MIT"
] | null | null | null | limnos/tests/test_transforms.py | WilliamHPNielsen/limnos | ae390ab4262ce79075d9aed46e20ef49e4feb165 | [
"MIT"
] | 10 | 2021-04-23T12:06:36.000Z | 2022-03-13T10:48:02.000Z | limnos/tests/test_transforms.py | WilliamHPNielsen/limnos | ae390ab4262ce79075d9aed46e20ef49e4feb165 | [
"MIT"
] | null | null | null | """
Tests of the transforms
"""
two_point_routes = [[(1, 1), (3, 1)],
[(1, 1), (1, 3)],
[(1, 1), (-1, 1)],
[(1, 1), (1, -1)],
[(11, 5), (11, 3)]]
three_point_routes = [[(1, 1), (1, 3), (3, 3)],
[(1, 1), (1, 3), (-1, ... | 34.051282 | 72 | 0.415663 | """
Tests of the transforms
"""
import pytest
from limnos.types import Route
from limnos.transforms import (bender,
flipper,
flattener,
Chirality)
two_point_routes = [[(1, 1), (3, 1)],
[(1, 1), (1, 3)],
... | 0 | 375 | 0 | 0 | 0 | 0 | 0 | 142 | 113 |
e3eef53f128f03a761142aa52528d16cfc4137e7 | 682 | py | Python | dvc/fs/gs.py | tirkarthi/dvc | 61699d1d669159a320f5bb3022cefebf8fe7b9f5 | [
"Apache-2.0"
] | null | null | null | dvc/fs/gs.py | tirkarthi/dvc | 61699d1d669159a320f5bb3022cefebf8fe7b9f5 | [
"Apache-2.0"
] | 41 | 2021-11-16T15:38:50.000Z | 2022-03-30T10:32:14.000Z | dvc/fs/gs.py | jhhuh/dvc | fecc81e951efeaa8130264f726c27e92876422ae | [
"Apache-2.0"
] | null | null | null |
# pylint:disable=abstract-method
| 24.357143 | 58 | 0.695015 | import threading
from funcy import cached_property, wrap_prop
from dvc.scheme import Schemes
# pylint:disable=abstract-method
from .base import ObjectFileSystem
class GSFileSystem(ObjectFileSystem):
scheme = Schemes.GS
REQUIRES = {"gcsfs": "gcsfs"}
PARAM_CHECKSUM = "etag"
def _prepare_credentials(... | 0 | 132 | 0 | 362 | 0 | 0 | 0 | 40 | 113 |
58a3d84faa37da36bab58eded5e88616db2f3973 | 2,674 | py | Python | code/Site/activity_text.py | jbassen/oars | 7b560bf2ce9f2c4026ebf77a1df35da6b1f28ea4 | [
"MIT"
] | 3 | 2018-06-28T15:56:29.000Z | 2021-04-14T07:21:30.000Z | code/Site/activity_text.py | jbassen/oars | 7b560bf2ce9f2c4026ebf77a1df35da6b1f28ea4 | [
"MIT"
] | null | null | null | code/Site/activity_text.py | jbassen/oars | 7b560bf2ce9f2c4026ebf77a1df35da6b1f28ea4 | [
"MIT"
] | null | null | null | # Copyright (c) 2017 Jonathan Bassen, Stanford University
import tornado.escape as escape
import tornado.gen as gen
import tornado.httputil as httputil
import tornado.web as web
| 31.458824 | 77 | 0.666791 | # Copyright (c) 2017 Jonathan Bassen, Stanford University
import os
import tornado.escape as escape
import tornado.gen as gen
import tornado.httputil as httputil
import tornado.web as web
import urllib
from db import upsert_activity_data
def extract_authorized_payload(headers, body, application):
payload = escap... | 0 | 862 | 0 | 25 | 0 | 1,426 | 0 | -6 | 186 |
3658d2f10783df5c6f9f5c64cc38027682ab7c03 | 1,263 | py | Python | inference.py | ussaema/CapsATTEND-GAN | 6967976835ff06d16a1a0ce699f0a5f749e4ebc7 | [
"MIT"
] | 10 | 2020-05-04T00:52:13.000Z | 2022-03-11T06:06:37.000Z | inference.py | ussaema/CapsATTEND-GAN | 6967976835ff06d16a1a0ce699f0a5f749e4ebc7 | [
"MIT"
] | 6 | 2020-07-08T08:21:05.000Z | 2021-06-10T03:24:29.000Z | inference.py | ussaema/CapsATTEND-GAN | 6967976835ff06d16a1a0ce699f0a5f749e4ebc7 | [
"MIT"
] | 1 | 2020-12-24T23:52:16.000Z | 2020-12-24T23:52:16.000Z | import tensorflow as tf
tf.compat.v1.logging.set_verbosity(tf.compat.v1.logging.ERROR)
import argparse
parser = argparse.ArgumentParser(description='Testing')
parser.add_argument('--word_to_idx_dir', type=str, required=True)
parser.add_argument('--image', type=str, required=True)
parser.add_argument('--max_length', ... | 30.804878 | 138 | 0.726841 | import tensorflow as tf
tf.compat.v1.logging.set_verbosity(tf.compat.v1.logging.ERROR)
from core.generator import Generator
from core.discriminator import Discriminator
from core.gan import GAN
import pickle
import argparse
parser = argparse.ArgumentParser(description='Testing')
parser.add_argument('--word_to_idx_dir... | 0 | 0 | 0 | 0 | 0 | 643 | 0 | 33 | 111 |
6cf9a05ce6bc3958bcc674a40c30311812b35c86 | 10,373 | py | Python | example/test/L8_myClass.py | Michael8968/skulpt | 15956a60398fac92ee1dab25bf661ffc003b2eaf | [
"MIT"
] | 2 | 2021-12-18T06:34:26.000Z | 2022-01-05T05:08:47.000Z | example/test/L8_myClass.py | Michael8968/skulpt | 15956a60398fac92ee1dab25bf661ffc003b2eaf | [
"MIT"
] | null | null | null | example/test/L8_myClass.py | Michael8968/skulpt | 15956a60398fac92ee1dab25bf661ffc003b2eaf | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
#! -*-conding:utf-8 -*-
#!@Time :2018/4/11 17:14
#!@Author :@liuweqia
#!@File :class.py
| 34.576667 | 88 | 0.535139 | #!/usr/bin/env python3
#! -*-conding:utf-8 -*-
#!@Time :2018/4/11 17:14
#!@Author :@liuweqia
#!@File :class.py
import pygame,random
from pygame.locals import *
from pygame import Rect
class Arrow(pygame.sprite.Sprite):
def __init__(self, x, y, property=0):
pygame.sprite.Sprite.__init__(self)
#... | 24 | 0 | 0 | 10,059 | 0 | 0 | 0 | 7 | 182 |
11478283a674b9e3405316756faa642a837a73a0 | 3,080 | py | Python | tictactoes/tic_tac_toe_9.py | SeanRavenhill/Python-Playground | bc638be8ec48fa54946395fd93a6944075438fb3 | [
"MIT"
] | null | null | null | tictactoes/tic_tac_toe_9.py | SeanRavenhill/Python-Playground | bc638be8ec48fa54946395fd93a6944075438fb3 | [
"MIT"
] | null | null | null | tictactoes/tic_tac_toe_9.py | SeanRavenhill/Python-Playground | bc638be8ec48fa54946395fd93a6944075438fb3 | [
"MIT"
] | null | null | null |
# used to change marker on players turn
# Sets up initital empty grid
grid = [
[" ", " ", " "],
[" ", " ", " "],
[" ", " ", " "]
]
valid = ["1", "2", "3"]
numbers = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]
coordinates_states = {
0: "You should enter numbers!",
1: "Coordinates shoul... | 26.101695 | 79 | 0.517857 | def print_board():
print("---------")
print("| " + grid[0][0] + " " + grid[0][1] + " " + grid[0][2] + " |")
print("| " + grid[1][0] + " " + grid[1][1] + " " + grid[1][2] + " |")
print("| " + grid[2][0] + " " + grid[2][1] + " " + grid[2][2] + " |")
print("---------")
def make_move():
marker = m... | 0 | 0 | 0 | 0 | 0 | 1,981 | 0 | 0 | 90 |
a283328a237c5df52008309a9e82c9fa219c2a3e | 5,600 | py | Python | python/paddle/fluid/tests/unittests/test_target_assign_op.py | L-Net-1992/Paddle | 4d0ca02ba56760b456f3d4b42a538555b9b6c307 | [
"Apache-2.0"
] | 11 | 2016-08-29T07:43:26.000Z | 2016-08-29T07:51:24.000Z | python/paddle/fluid/tests/unittests/test_target_assign_op.py | L-Net-1992/Paddle | 4d0ca02ba56760b456f3d4b42a538555b9b6c307 | [
"Apache-2.0"
] | null | null | null | python/paddle/fluid/tests/unittests/test_target_assign_op.py | L-Net-1992/Paddle | 4d0ca02ba56760b456f3d4b42a538555b9b6c307 | [
"Apache-2.0"
] | 1 | 2021-12-09T08:59:17.000Z | 2021-12-09T08:59:17.000Z | # Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 32.941176 | 80 | 0.59875 | # Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 0 | 0 | 0 | 2,418 | 0 | 2,309 | 0 | -6 | 158 |
8b1942678948cecc0fe2a2d0d5cb8a4d8f77960f | 2,001 | py | Python | node.py | norx/node | bf33933160148969bf4f00f8686702b44c556220 | [
"BSD-3-Clause"
] | 3 | 2017-04-01T23:56:25.000Z | 2018-01-21T04:27:53.000Z | node.py | norx/NODE | bf33933160148969bf4f00f8686702b44c556220 | [
"BSD-3-Clause"
] | null | null | null | node.py | norx/NODE | bf33933160148969bf4f00f8686702b44c556220 | [
"BSD-3-Clause"
] | 3 | 2016-08-15T06:53:11.000Z | 2020-12-07T01:23:43.000Z | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
node.py
------
This file is part of NODE - the NORX Differential-Search Engine.
:copyright: (c) 2014 Philipp Jovanovic <philipp@jovanovic.io>
:license: BSD (3-Clause), see LICENSE
"""
__author__ = 'Philipp Jovanovic'
__email__ = 'philipp@jovanov... | 29.426471 | 104 | 0.612694 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
node.py
------
This file is part of NODE - the NORX Differential-Search Engine.
:copyright: (c) 2014 Philipp Jovanovic <philipp@jovanovic.io>
:license: BSD (3-Clause), see LICENSE
"""
__author__ = 'Philipp Jovanovic'
__email__ = 'philipp@jovanov... | 0 | 0 | 0 | 0 | 0 | 1,399 | 0 | -6 | 45 |
3ffc2399503ee6128b1d75da462ee199d82a60ed | 163 | py | Python | corepro/models/externalaccountidonly.py | bored117/CorePro | cd05bff7d14cb6937ad6ee2fdbd987bf90f9ea0e | [
"MIT"
] | 1 | 2017-01-12T19:43:28.000Z | 2017-01-12T19:43:28.000Z | corepro/models/externalaccountidonly.py | bored117/CorePro | cd05bff7d14cb6937ad6ee2fdbd987bf90f9ea0e | [
"MIT"
] | null | null | null | corepro/models/externalaccountidonly.py | bored117/CorePro | cd05bff7d14cb6937ad6ee2fdbd987bf90f9ea0e | [
"MIT"
] | 4 | 2017-11-02T21:21:51.000Z | 2021-01-29T21:47:30.000Z | __author__ = 'socialmoneydev'
| 20.375 | 38 | 0.760736 | __author__ = 'socialmoneydev'
from jsonBase import JsonBase
class ExternalAccountIdOnly(JsonBase):
def __init__(self):
self.externalAccountId = None
| 0 | 0 | 0 | 79 | 0 | 0 | 0 | 8 | 45 |
003bd18a523c3cef4bb36e738b3cda593421307e | 3,150 | py | Python | airl_state_scripts/no_transfer_scripts/half_cheetah_irl.py | hsilva664/nstep_airl | c08650d8fddf6a27081d2b63cb8f9eb23d746b6c | [
"MIT"
] | 1 | 2020-05-02T14:32:42.000Z | 2020-05-02T14:32:42.000Z | airl_state_scripts/no_transfer_scripts/half_cheetah_irl.py | hsilva664/nstep_airl | c08650d8fddf6a27081d2b63cb8f9eb23d746b6c | [
"MIT"
] | null | null | null | airl_state_scripts/no_transfer_scripts/half_cheetah_irl.py | hsilva664/nstep_airl | c08650d8fddf6a27081d2b63cb8f9eb23d746b6c | [
"MIT"
] | null | null | null |
from inverse_rl.utils.hyper_sweep import run_sweep_parallel
if __name__ == "__main__":
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--visible_gpus', type=str, default='0')
parser.add_argument('--fusion', action='store_false')
parser.add_argument('--debug', action='stor... | 41.447368 | 137 | 0.711111 | import tensorflow as tf
from sandbox.rocky.tf.policies.gaussian_mlp_policy import GaussianMLPPolicy
from sandbox.rocky.tf.envs.base import TfEnv
from rllab.baselines.linear_feature_baseline import LinearFeatureBaseline
from rllab.envs.gym_env import GymEnv
from inverse_rl.algos.irl_trpo import IRLTRPO
from inverse_r... | 0 | 0 | 0 | 0 | 0 | 1,522 | 0 | 304 | 223 |
c24eba6790bb195936fb85ffcf4d642d51a514da | 2,838 | py | Python | psx/_dump_/54/_dump_ida_/overlay_d/make_psx.py | maoa3/scalpel | 2e7381b516cded28996d290438acc618d00b2aa7 | [
"Unlicense"
] | 15 | 2018-06-28T01:11:25.000Z | 2021-09-27T15:57:18.000Z | psx/_dump_/54/_dump_ida_/overlay_d/make_psx.py | maoa3/scalpel | 2e7381b516cded28996d290438acc618d00b2aa7 | [
"Unlicense"
] | 7 | 2018-06-29T04:08:23.000Z | 2019-10-17T13:57:22.000Z | psx/_dump_/54/_dump_ida_/overlay_d/make_psx.py | maoa3/scalpel | 2e7381b516cded28996d290438acc618d00b2aa7 | [
"Unlicense"
] | 7 | 2018-06-28T01:11:34.000Z | 2020-05-23T09:21:48.000Z | set_name(0x8014AFA0, "EA_cd_seek", SN_NOWARN)
set_name(0x8014AFA8, "MY_CdGetSector", SN_NOWARN)
set_name(0x8014AFDC, "init_cdstream", SN_NOWARN)
set_name(0x8014AFEC, "flush_cdstream", SN_NOWARN)
set_name(0x8014B010, "check_complete_frame", SN_NOWARN)
set_name(0x8014B090, "reset_cdstream", SN_NOWARN)
set_name(0x8014B0B8... | 49.789474 | 58 | 0.82241 | set_name(0x8014AFA0, "EA_cd_seek", SN_NOWARN)
set_name(0x8014AFA8, "MY_CdGetSector", SN_NOWARN)
set_name(0x8014AFDC, "init_cdstream", SN_NOWARN)
set_name(0x8014AFEC, "flush_cdstream", SN_NOWARN)
set_name(0x8014B010, "check_complete_frame", SN_NOWARN)
set_name(0x8014B090, "reset_cdstream", SN_NOWARN)
set_name(0x8014B0B8... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
dcc1dcd7e1201ca623ce3fef0bda140efae7e74d | 1,379 | py | Python | web_website/models/ir_http.py | agenterpgmbh/misc-addons | 27e36d119b1e73089a2ebfcd8d4cfc706c8f1f41 | [
"MIT"
] | null | null | null | web_website/models/ir_http.py | agenterpgmbh/misc-addons | 27e36d119b1e73089a2ebfcd8d4cfc706c8f1f41 | [
"MIT"
] | 1 | 2020-05-03T04:27:29.000Z | 2020-05-03T04:27:29.000Z | web_website/models/ir_http.py | eneldoserrata/misc-addons | 6f3b94d8a71d603d9ad449f96edfc66385e78080 | [
"MIT"
] | 2 | 2020-05-09T02:08:59.000Z | 2022-03-21T06:37:15.000Z | # Copyright 2018,2020 Ivan Yelizariev <https://it-projects.info/team/yelizariev>
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
| 35.358974 | 87 | 0.661349 | # Copyright 2018,2020 Ivan Yelizariev <https://it-projects.info/team/yelizariev>
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
from odoo import models
from odoo.http import request
class Http(models.AbstractModel):
_inherit = "ir.http"
def session_info(self):
res = super(Http, self)... | 0 | 386 | 0 | 770 | 0 | 0 | 0 | 10 | 67 |
98014d40c2f59cfd10592c73f4e063c95fd30fb3 | 8,636 | py | Python | configs/models/gpt2.py | jamesoneill12/LayerFusion | 99cba1030ed8c012a453bc7715830fc99fb980dc | [
"Apache-2.0"
] | null | null | null | configs/models/gpt2.py | jamesoneill12/LayerFusion | 99cba1030ed8c012a453bc7715830fc99fb980dc | [
"Apache-2.0"
] | null | null | null | configs/models/gpt2.py | jamesoneill12/LayerFusion | 99cba1030ed8c012a453bc7715830fc99fb980dc | [
"Apache-2.0"
] | null | null | null | # model_name_or_path 'openai-gpt2' did not work, just gpt2 now
| 63.97037 | 137 | 0.681102 | import argparse
# model_name_or_path 'openai-gpt2' did not work, just gpt2 now
def get_gpt2_config(model_name='gpt2', do_train=True, do_eval=True, do_test=True, context_length=1024,
do_retrain=False, compress_step = 0, start_from_pretrained=True,
distributed=True, vsize_json_fi... | 0 | 0 | 0 | 1,335 | 0 | 7,151 | 0 | -6 | 91 |
c3a02a3c490f967124c689a059b76145f59832f1 | 545 | py | Python | scripts/boke.py | HayatoKitaura/corn_flakes_manzai | 3fac4c34073461f1bff2bf16e52521ebe7a7dae7 | [
"BSD-3-Clause"
] | null | null | null | scripts/boke.py | HayatoKitaura/corn_flakes_manzai | 3fac4c34073461f1bff2bf16e52521ebe7a7dae7 | [
"BSD-3-Clause"
] | null | null | null | scripts/boke.py | HayatoKitaura/corn_flakes_manzai | 3fac4c34073461f1bff2bf16e52521ebe7a7dae7 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
import rospy
import sys
from std_msgs.msg import String
rospy.init_node('boke') # count
pub = rospy.Publisher('funny_boke', String, queue_size=10) # count_up
rate = rospy.Rate(10) # 10Hz
input_line = ""
... | 22.708333 | 81 | 0.622018 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
import rospy
import sys
from std_msgs.msg import String
rospy.init_node('boke') # ノード名「count」に設定
pub = rospy.Publisher('funny_boke', String, queue_size=10) # パブリッシャ「count_up」を作成
rate = rospy.Rate(10) # 10H... | 231 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b0ce253629dcf773833eb1e7d4eec94159249d66 | 5,791 | py | Python | datalidator/blueprints/impl/ObjectBlueprint.py | vitlabuda/datalidator | 539063a98990c6be165baeff6c2a74ac2fd7a130 | [
"BSD-3-Clause"
] | null | null | null | datalidator/blueprints/impl/ObjectBlueprint.py | vitlabuda/datalidator | 539063a98990c6be165baeff6c2a74ac2fd7a130 | [
"BSD-3-Clause"
] | null | null | null | datalidator/blueprints/impl/ObjectBlueprint.py | vitlabuda/datalidator | 539063a98990c6be165baeff6c2a74ac2fd7a130 | [
"BSD-3-Clause"
] | null | null | null | #!/bin/false
# Copyright (c) 2022 Vt Labuda. 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 above copyright notice, this list of conditions and... | 54.632075 | 165 | 0.756864 | #!/bin/false
# Copyright (c) 2022 Vít Labuda. 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 above copyright notice, this list of conditions an... | 2 | 1,176 | 0 | 2,270 | 0 | 0 | 0 | 549 | 222 |
6a4b46473542ce66cbc97ee3b78768c86b74bee6 | 9,042 | py | Python | py3langid/train/IGweight.py | adbar/langid.py | d3b0cc97f20f0f30e2d26f149eab4ef642038230 | [
"BSD-3-Clause"
] | 9 | 2021-11-25T08:43:16.000Z | 2022-03-21T22:35:47.000Z | py3langid/train/IGweight.py | adbar/py3langid | 8c1d9b0a4eb58c68726ad0a5e6b435011e909aca | [
"BSD-3-Clause"
] | 4 | 2022-03-14T12:13:40.000Z | 2022-03-29T15:41:35.000Z | py3langid/train/IGweight.py | adbar/langid.py | d3b0cc97f20f0f30e2d26f149eab4ef642038230 | [
"BSD-3-Clause"
] | 1 | 2022-01-10T23:37:58.000Z | 2022-01-10T23:37:58.000Z | """
IGWeight.py -
Compute IG Weights given a set of tokenized buckets and a feature set
Marco Lui, January 2013
Based on research by Marco Lui and Tim Baldwin.
Copyright 2013 Marco Lui <saffsd@gmail.com>. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are
permi... | 37.675 | 133 | 0.677837 | """
IGWeight.py -
Compute IG Weights given a set of tokenized buckets and a feature set
Marco Lui, January 2013
Based on research by Marco Lui and Tim Baldwin.
Copyright 2013 Marco Lui <saffsd@gmail.com>. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are
permi... | 0 | 0 | 0 | 0 | 0 | 672 | 0 | 9 | 23 |
13bd491c6fb9354d038cf5bc7d3c27beab50b9cb | 5,533 | py | Python | report_building/parse_medication.py | Team-Asesor/Asesor | 93c7de693387722ff07af32d6a588624ebef6da2 | [
"MIT"
] | null | null | null | report_building/parse_medication.py | Team-Asesor/Asesor | 93c7de693387722ff07af32d6a588624ebef6da2 | [
"MIT"
] | null | null | null | report_building/parse_medication.py | Team-Asesor/Asesor | 93c7de693387722ff07af32d6a588624ebef6da2 | [
"MIT"
] | null | null | null | import pandas as pd
import re
import spacy
nlp = spacy.load("en")
print(nlp)
df_medications=pd.read_excel("sample_medication.xlsx")
medication_list=df_medications["text"].tolist()
medication_list_med=df_medications["medication"].tolist()
dosage_list=[]
timing_list=[]
purpose_list=[]
for i in range(len(medication_li... | 30.401099 | 166 | 0.572022 | import pandas as pd
from collections import defaultdict
from collections import OrderedDict
import matplotlib.pyplot as plt
import random
import re
import ast
from nltk.corpus import wordnet as wn
import spacy
from spacy import displacy
from collections import Counter
import en_core_web_sm
nlp = spacy.load("en")
pri... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 50 | 198 |
2e284451120b9c0af34f9ba8c4d7fba922881e13 | 3,434 | py | Python | analyiz.py | mohamedsayed18/Mona_Lisa_EEG_analysis | b0f67e210689a3e3dd57164078bc7da265f4b44a | [
"MIT"
] | null | null | null | analyiz.py | mohamedsayed18/Mona_Lisa_EEG_analysis | b0f67e210689a3e3dd57164078bc7da265f4b44a | [
"MIT"
] | null | null | null | analyiz.py | mohamedsayed18/Mona_Lisa_EEG_analysis | b0f67e210689a3e3dd57164078bc7da265f4b44a | [
"MIT"
] | null | null | null | """
Draw the maximum co-efficient value matrix
TODO: [Done]find the max RMD value, and get coefficient matrix for this value
"""
import numpy as np
import matplotlib.pyplot as plt
# Global arrays
wav_out = []
def co_matrix(data):
"""
I will made the diagonal zeros for calculation
"""
count = 0
#... | 26.828125 | 82 | 0.602796 | """
Draw the maximum co-efficient value matrix
TODO: [Done]find the max RMD value, and get coefficient matrix for this value
"""
import numpy as np
import os
from scipy import signal
from scipy import stats
import matplotlib.pyplot as plt
# Global arrays
wav_out = []
def co_matrix(data):
"""
I will made the... | 0 | 0 | 0 | 0 | 0 | 463 | 0 | -7 | 113 |
6669f0f46790dffa28cfe35de453848285be0960 | 58 | py | Python | 2-ello world/main.py | HADES256/Learning-Python | 45bea556ca0c8f45b8d345dd98c6d8be3514ae9a | [
"Unlicense"
] | null | null | null | 2-ello world/main.py | HADES256/Learning-Python | 45bea556ca0c8f45b8d345dd98c6d8be3514ae9a | [
"Unlicense"
] | null | null | null | 2-ello world/main.py | HADES256/Learning-Python | 45bea556ca0c8f45b8d345dd98c6d8be3514ae9a | [
"Unlicense"
] | null | null | null | #print (text to write on the terminal)
print("ello world") | 29 | 38 | 0.741379 | #print (text to write on the terminal)
print("ello world") | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
15d2449381e4d1840c47dcc238826115e014ec3f | 47,900 | py | Python | code/post_process_data.py | jessecusack/DIMES_eddy_wave_interactions | eee1d2325eaeeda356ad65cfe4a153e69b9bb196 | [
"MIT"
] | 5 | 2020-10-22T04:21:44.000Z | 2021-12-11T10:25:44.000Z | code/post_process_data.py | jessecusack/DIMES_eddy_wave_interactions | eee1d2325eaeeda356ad65cfe4a153e69b9bb196 | [
"MIT"
] | 1 | 2021-06-23T12:10:45.000Z | 2021-07-20T19:12:30.000Z | code/post_process_data.py | jessecusack/DIMES_eddy_wave_interactions | eee1d2325eaeeda356ad65cfe4a153e69b9bb196 | [
"MIT"
] | 2 | 2021-10-05T02:17:02.000Z | 2021-12-11T10:25:45.000Z | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
# %% [markdown]
# # Process the raw mooring data
#
# Contents:
# * <a href=#raw>Raw data reprocessing.</a>
# * <a href=#corrected>Interpolated data processing.</a>
# * <a href=#ADCP>ADCP processing.</a>
# * <a href=#VMP>VMP processing.</a>
#
# Import the needed libraries.
... | 30.724824 | 88 | 0.581106 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
# %% [markdown]
# # Process the raw mooring data
#
# Contents:
# * <a href=#raw>Raw data reprocessing.</a>
# * <a href=#corrected>Interpolated data processing.</a>
# * <a href=#ADCP>ADCP processing.</a>
# * <a href=#VMP>VMP processing.</a>
#
# Import the needed libraries.
... | 0 | 0 | 0 | 0 | 0 | 306 | 0 | 0 | 114 |
e07601e88c917bb2b8484ae28fd7920035a73e74 | 1,229 | py | Python | alembic/versions/4fc3ae9ba717_add_verification_roles_table.py | zd4y/discordbot | 57432b4e577241058e02c609ca36eae4b52911dc | [
"MIT"
] | null | null | null | alembic/versions/4fc3ae9ba717_add_verification_roles_table.py | zd4y/discordbot | 57432b4e577241058e02c609ca36eae4b52911dc | [
"MIT"
] | null | null | null | alembic/versions/4fc3ae9ba717_add_verification_roles_table.py | zd4y/discordbot | 57432b4e577241058e02c609ca36eae4b52911dc | [
"MIT"
] | null | null | null | """add verification_roles table
Revision ID: 4fc3ae9ba717
Revises: 215e9036a3d7
Create Date: 2020-07-05 20:08:18.197783
"""
# revision identifiers, used by Alembic.
revision = '4fc3ae9ba717'
down_revision = '215e9036a3d7'
branch_labels = None
depends_on = None
| 30.725 | 87 | 0.689178 | """add verification_roles table
Revision ID: 4fc3ae9ba717
Revises: 215e9036a3d7
Create Date: 2020-07-05 20:08:18.197783
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '4fc3ae9ba717'
down_revision = '215e9036a3d7'
branch_labels = None
depends_on = None
def up... | 0 | 0 | 0 | 0 | 0 | 869 | 0 | 3 | 90 |
364da00900d3ecd1cbd07ba734ce9dab390064d4 | 5,684 | py | Python | unittests/misc/test_performance.py | electronicvisions/pygccxml | 464825367daff2e364a5095220f173f23538a365 | [
"BSL-1.0"
] | null | null | null | unittests/misc/test_performance.py | electronicvisions/pygccxml | 464825367daff2e364a5095220f173f23538a365 | [
"BSL-1.0"
] | null | null | null | unittests/misc/test_performance.py | electronicvisions/pygccxml | 464825367daff2e364a5095220f173f23538a365 | [
"BSL-1.0"
] | null | null | null | # Copyright 2014-2017 Insight Software Consortium.
# Copyright 2004-2009 Roman Yakovenko.
# Distributed under the Boost Software License, Version 1.0.
# See http://www.boost.org/LICENSE_1_0.txt
import os
import sys
import hotshot
import hotshot.stats
this_module_dir_path = os.path.abspath(
os.path.dirname(sys.mod... | 35.304348 | 79 | 0.69335 | # Copyright 2014-2017 Insight Software Consortium.
# Copyright 2004-2009 Roman Yakovenko.
# Distributed under the Boost Software License, Version 1.0.
# See http://www.boost.org/LICENSE_1_0.txt
import os
import sys
import time
import hotshot
import hotshot.stats
this_module_dir_path = os.path.abspath(
os.path.dir... | 0 | 0 | 0 | 0 | 0 | 3,827 | 0 | 8 | 223 |
6e967df58a0b481923d11963b78a10eb87c22228 | 588 | py | Python | pystratis/api/node/requestmodels/gettxoutrequest.py | TjadenFroyda/pyStratis | 9cc7620d7506637f8a2b84003d931eceb36ac5f2 | [
"MIT"
] | 8 | 2021-06-30T20:44:22.000Z | 2021-12-07T14:42:22.000Z | pystratis/api/node/requestmodels/gettxoutrequest.py | TjadenFroyda/pyStratis | 9cc7620d7506637f8a2b84003d931eceb36ac5f2 | [
"MIT"
] | 2 | 2021-07-01T11:50:18.000Z | 2022-01-25T18:39:49.000Z | pystratis/api/node/requestmodels/gettxoutrequest.py | TjadenFroyda/pyStratis | 9cc7620d7506637f8a2b84003d931eceb36ac5f2 | [
"MIT"
] | 4 | 2021-07-01T04:36:42.000Z | 2021-09-17T10:54:19.000Z |
# noinspection PyUnresolvedReferences
| 32.666667 | 81 | 0.719388 | from typing import Optional
from pydantic import Field, conint
from pystratis.api import Model
from pystratis.core.types import uint256
# noinspection PyUnresolvedReferences
class GetTxOutRequest(Model):
"""A request model for the node/gettxout endpoint.
Args:
trxid (uint256): The trxid to check.
... | 0 | 0 | 0 | 390 | 0 | 0 | 0 | 48 | 110 |
4a274e454f34759f91e9b97175b1709948e54e7e | 1,239 | py | Python | contracts/contract_account.py | fabrice102/create-asa-with-ssc | 616025599b54cc3cff94f5abb012535c7eebcf03 | [
"MIT"
] | 5 | 2021-06-17T18:17:52.000Z | 2021-07-18T07:58:32.000Z | contracts/contract_account.py | fabrice102/create-asa-with-ssc | 616025599b54cc3cff94f5abb012535c7eebcf03 | [
"MIT"
] | null | null | null | contracts/contract_account.py | fabrice102/create-asa-with-ssc | 616025599b54cc3cff94f5abb012535c7eebcf03 | [
"MIT"
] | null | null | null | import sys
if __name__ == "__main__":
arg = int(sys.argv[1])
print(compileTeal(contract_account(arg), Mode.Signature, version=3))
| 29.5 | 80 | 0.625504 | import sys
from pyteal import *
def contract_account(app_id):
asset_close_to_check = Txn.asset_close_to() == Global.zero_address()
rekey_check = Txn.rekey_to() == Global.zero_address()
linked_with_app_call = And(
Gtxn[0].type_enum() == TxnType.ApplicationCall,
Gtxn[0].application_id() == ... | 0 | 0 | 0 | 0 | 0 | 1,054 | 0 | -1 | 45 |
bb576b99c6076a15ff36fb340102246701dd9d73 | 3,655 | py | Python | datapackage_pipelines/lib/load_resource.py | gperonato/datapackage-pipelines | 72b98918db1c19590586a3a85c5b087227cbbc3b | [
"MIT"
] | 109 | 2016-09-01T08:41:55.000Z | 2021-11-10T10:08:35.000Z | datapackage_pipelines/lib/load_resource.py | gperonato/datapackage-pipelines | 72b98918db1c19590586a3a85c5b087227cbbc3b | [
"MIT"
] | 144 | 2016-08-30T16:26:50.000Z | 2021-04-18T09:06:12.000Z | datapackage_pipelines/lib/load_resource.py | gperonato/datapackage-pipelines | 72b98918db1c19590586a3a85c5b087227cbbc3b | [
"MIT"
] | 34 | 2016-09-05T12:46:53.000Z | 2022-03-05T01:53:49.000Z |
if __name__ == '__main__':
ResourceLoader()()
| 38.072917 | 107 | 0.581122 | import itertools
import copy
import logging
import datapackage
from dataflows.helpers.resource_matcher import ResourceMatcher
from datapackage_pipelines.wrapper import ingest, spew, get_dependency_datapackage_url
from datapackage_pipelines.utilities.resources import tabular, PROP_STREAMING, \
PROP_STREAMED_FROM
... | 0 | 0 | 0 | 3,063 | 172 | 0 | 0 | 163 | 203 |
11329167c97d7992b21d5b3de9fb4b37fe2de69c | 732 | py | Python | setup.py | CederGroupHub/alab_management | ba9a49ca85e1caefb96f44ef1182c2bc0115bfdf | [
"MIT"
] | 3 | 2021-12-08T02:09:28.000Z | 2021-12-10T01:49:55.000Z | setup.py | CederGroupHub/alab_management | ba9a49ca85e1caefb96f44ef1182c2bc0115bfdf | [
"MIT"
] | 9 | 2021-12-10T01:22:01.000Z | 2022-03-08T22:26:06.000Z | setup.py | CederGroupHub/alab_management | ba9a49ca85e1caefb96f44ef1182c2bc0115bfdf | [
"MIT"
] | 1 | 2022-03-23T22:42:54.000Z | 2022-03-23T22:42:54.000Z | from pathlib import Path
from setuptools import setup, find_packages
from alab_management import __version__
setup(
name="alab_management",
packages=find_packages(exclude=["tests", "tests.*"]),
package_data={"alab_management": ["py.typed"]},
version=__version__,
author="Alab Project Team",
py... | 28.153846 | 109 | 0.665301 | from pathlib import Path
from setuptools import setup, find_packages
from alab_management import __version__
setup(
name="alab_management",
packages=find_packages(exclude=["tests", "tests.*"]),
package_data={"alab_management": ["py.typed"]},
version=__version__,
author="Alab Project Team",
py... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
5a2b0409b4b0739303914058363066d345fac458 | 10,730 | py | Python | scripts/dm_hmc_hybrid.py | modichirag/VI_reconstruction | 64def5226a5723877a60943c29f592319bbe8e95 | [
"MIT"
] | null | null | null | scripts/dm_hmc_hybrid.py | modichirag/VI_reconstruction | 64def5226a5723877a60943c29f592319bbe8e95 | [
"MIT"
] | null | null | null | scripts/dm_hmc_hybrid.py | modichirag/VI_reconstruction | 64def5226a5723877a60943c29f592319bbe8e95 | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import tensorflow as tf
config = tf.compat.v1.ConfigProto()
config.gpu_options.allow_growth = True
session = tf.compat.v1.Session(config=config)
import tensorflow_probability as tfp
tfd = tfp.distributions
from mpi4py import MP... | 36.25 | 148 | 0.603075 | import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import tensorflow as tf
config = tf.compat.v1.ConfigProto()
config.gpu_options.allow_growth = True
session = tf.compat.v1.Session(config=config)
import tensorflow_probability as tfp
tfd = tfp.distributions
from mpi4py import MP... | 0 | 799 | 0 | 0 | 0 | 0 | 0 | 3 | 67 |
54891e72acd48a9cc8c5bcd08d5de27877e0878a | 2,814 | py | Python | aries_cloudagent/protocols/issue_credential/v2_0/handlers/tests/test_cred_problem_report_handler.py | kuraakhilesh8230/aries-cloudagent-python | ee384d1330f6a50ff45a507392ce54f92900f23a | [
"Apache-2.0"
] | 247 | 2019-07-02T21:10:21.000Z | 2022-03-30T13:55:33.000Z | aries_cloudagent/protocols/issue_credential/v2_0/handlers/tests/test_cred_problem_report_handler.py | kuraakhilesh8230/aries-cloudagent-python | ee384d1330f6a50ff45a507392ce54f92900f23a | [
"Apache-2.0"
] | 1,462 | 2019-07-02T20:57:30.000Z | 2022-03-31T23:13:35.000Z | aries_cloudagent/protocols/issue_credential/v2_0/handlers/tests/test_cred_problem_report_handler.py | kuraakhilesh8230/aries-cloudagent-python | ee384d1330f6a50ff45a507392ce54f92900f23a | [
"Apache-2.0"
] | 377 | 2019-06-20T21:01:31.000Z | 2022-03-30T08:27:53.000Z |
from .. import cred_problem_report_handler as test_module
| 41.382353 | 85 | 0.67022 | from asynctest import mock as async_mock, TestCase as AsyncTestCase
from ......messaging.request_context import RequestContext
from ......messaging.responder import MockResponder
from ......transport.inbound.receipt import MessageReceipt
from ...messages.cred_problem_report import V20CredProblemReport, ProblemReportR... | 0 | 0 | 2,323 | 29 | 0 | 0 | 0 | 214 | 188 |
2d8d36511bec7c5bbf9c959bba3be6c1b2598a70 | 12,249 | py | Python | inference_playground.py | johndpope/PTI | b2594cdfbc02b73eb3bd4ecae7d7a77d5d369234 | [
"BSD-2-Clause",
"MIT"
] | null | null | null | inference_playground.py | johndpope/PTI | b2594cdfbc02b73eb3bd4ecae7d7a77d5d369234 | [
"BSD-2-Clause",
"MIT"
] | null | null | null | inference_playground.py | johndpope/PTI | b2594cdfbc02b73eb3bd4ecae7d7a77d5d369234 | [
"BSD-2-Clause",
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# PyDrive activation Used for bypassing Google Drive download rate limit
# In[ ]:
download_with_pydrive = True #@param {type:"boolean"}
downloader = Downloader(download_with_pydrive)
# ## Step 1 - Install Packages required by PTI
# In[ ]:
## Other packages are already b... | 26.570499 | 165 | 0.751572 | #!/usr/bin/env python
# coding: utf-8
# PyDrive activation Used for bypassing Google Drive download rate limit
# In[ ]:
from pydrive.auth import GoogleAuth
from pydrive.drive import GoogleDrive
from google.colab import auth
from oauth2client.client import GoogleCredentials
download_with_pydrive = True #@param {typ... | 0 | 0 | 0 | 682 | 0 | 1,144 | 0 | 68 | 340 |
8aecaacdf0b404c9bad9cbb2d565b88795b2aa05 | 642 | py | Python | examples/4_reading-and-writing-data-with-spark.py | edrmonteiro/spark-collection | d2c578ece2416cebf9e497eb936607e3f45e4764 | [
"MIT"
] | null | null | null | examples/4_reading-and-writing-data-with-spark.py | edrmonteiro/spark-collection | d2c578ece2416cebf9e497eb936607e3f45e4764 | [
"MIT"
] | null | null | null | examples/4_reading-and-writing-data-with-spark.py | edrmonteiro/spark-collection | d2c578ece2416cebf9e497eb936607e3f45e4764 | [
"MIT"
] | null | null | null | from pyspark.sql import SparkSession
spark = SparkSession \
.builder \
.appName("Our first Python Spark SQL example") \
.getOrCreate()
spark.sparkContext.getConf().getAll()
spark
path = "./data/sparkify_log_small.json"
user_log = spark.read.json(path)
user_log.printSchema()
user_log.describe()
user_l... | 21.4 | 56 | 0.760125 | import pyspark
from pyspark import SparkConf
from pyspark.sql import SparkSession
spark = SparkSession \
.builder \
.appName("Our first Python Spark SQL example") \
.getOrCreate()
spark.sparkContext.getConf().getAll()
spark
path = "./data/sparkify_log_small.json"
user_log = spark.read.json(path)
user_l... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 44 |
f5f6710a4ee39223faf711dc503f5fde54941f07 | 1,009 | py | Python | generators/app/templates/manage.py | andybp85/generator-flask-api-dotenv | 1da51618c07ee6989000fbcefc26a0df2ae426ea | [
"MIT"
] | 1 | 2016-10-10T02:35:03.000Z | 2016-10-10T02:35:03.000Z | generators/app/templates/manage.py | andybp85/generator-flask-api-dotenv | 1da51618c07ee6989000fbcefc26a0df2ae426ea | [
"MIT"
] | null | null | null | generators/app/templates/manage.py | andybp85/generator-flask-api-dotenv | 1da51618c07ee6989000fbcefc26a0df2ae426ea | [
"MIT"
] | null | null | null | #! /usr/bin/env python
from flask.ext.script import Manager
from flask.ext.script.commands import ShowUrls, Clean
from <%= import appName, create_app<% if (databaseMapper === 'sqlalchemy') { -%>, db<% } %>
app = create_app("development")
manager = Manager(app)
manager.add_command("show-urls", ShowUrls())
manager.ad... | 22.931818 | 93 | 0.644202 | #! /usr/bin/env python
from flask.ext.script import Manager
from flask.ext.script.commands import ShowUrls, Clean
from <%= appName %> import create_app<% if (databaseMapper === 'sqlalchemy') { -%>, db<% } %>
app = create_app("development")
manager = Manager(app)
manager.add_command("show-urls", ShowUrls())
manager.... | 0 | 150 | 0 | 0 | 0 | 0 | 0 | 2 | 23 |
3da72bcb2255adc5997f5ca31cf15cd9bdcbfe16 | 233 | py | Python | democelery/network/urls.py | alexdzul/democelery | 4627d155ccc3a6daf21ec4e4b8d554891446288d | [
"MIT"
] | 1 | 2021-12-02T05:29:37.000Z | 2021-12-02T05:29:37.000Z | democelery/network/urls.py | alexdzul/democelery | 4627d155ccc3a6daf21ec4e4b8d554891446288d | [
"MIT"
] | null | null | null | democelery/network/urls.py | alexdzul/democelery | 4627d155ccc3a6daf21ec4e4b8d554891446288d | [
"MIT"
] | null | null | null | from django.urls import path
from . import views
app_name = 'network'
urlpatterns = [
path('', views.Index.as_view(), name='index'),
path('create-subscriber/', views.CreateSubscriber.as_view(), name='create-subscriber'),
]
| 23.3 | 91 | 0.699571 | from django.urls import path
from . import views
app_name = 'network'
urlpatterns = [
path('', views.Index.as_view(), name='index'),
path('create-subscriber/', views.CreateSubscriber.as_view(), name='create-subscriber'),
]
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
5e667ac9d14cbc81260c413c51e8d1efc193b838 | 9,396 | py | Python | apsjournals/pdf.py | JWKennington/apsjournals | c6e956d254b4d7df8b815e34a3591e243d779500 | [
"MIT"
] | 1 | 2019-11-13T01:54:22.000Z | 2019-11-13T01:54:22.000Z | apsjournals/pdf.py | JWKennington/apsjournals | c6e956d254b4d7df8b815e34a3591e243d779500 | [
"MIT"
] | 6 | 2019-02-11T21:13:47.000Z | 2019-03-15T02:28:46.000Z | apsjournals/pdf.py | JWKennington/apsjournals | c6e956d254b4d7df8b815e34a3591e243d779500 | [
"MIT"
] | null | null | null | """PDF utilities
"""
import collections
import os
import PyPDF2 as pypdf
import time
import typing
ArticleMeta = collections.namedtuple('ArticleMeta', 'article file pages')
LinkMeta = collections.namedtuple('LinkMeta', 'source_page target_page x y w h')
BookmarkMeta = collections.namedtuple('BookmarkMeta', 'name pa... | 41.575221 | 163 | 0.557046 | """PDF utilities
"""
import collections
import fpdf
import os
import pathlib
import PyPDF2 as pypdf
import tempfile
import time
import typing
import apsjournals
ArticleMeta = collections.namedtuple('ArticleMeta', 'article file pages')
LinkMeta = collections.namedtuple('LinkMeta', 'source_page target_page x y w h')
... | 0 | 0 | 0 | 8,081 | 0 | 0 | 0 | -26 | 111 |
9c227218e02baffc7c8704f3be5ed89be0101a54 | 5,324 | py | Python | synapse/api/auth_blocking.py | jdreichmann/synapse | 6fde6aa9c02d35e0a908437ea49b275df9b58427 | [
"Apache-2.0"
] | 1 | 2021-04-27T19:04:56.000Z | 2021-04-27T19:04:56.000Z | synapse/api/auth_blocking.py | jdreichmann/synapse | 6fde6aa9c02d35e0a908437ea49b275df9b58427 | [
"Apache-2.0"
] | null | null | null | synapse/api/auth_blocking.py | jdreichmann/synapse | 6fde6aa9c02d35e0a908437ea49b275df9b58427 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2020 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 require... | 41.92126 | 87 | 0.63411 | # -*- coding: utf-8 -*-
# Copyright 2020 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 require... | 0 | 0 | 3,811 | 574 | 0 | 0 | 0 | 130 | 134 |
25f2bc91ea63c2bf4a09141e02af7b9e2d05a0ba | 5,255 | py | Python | resources/lib/services/msl/request_builder.py | otava5/plugin.video.netflix | 761fef0714f44e1fa01ae78a96edb80f88b2dae1 | [
"MIT"
] | null | null | null | resources/lib/services/msl/request_builder.py | otava5/plugin.video.netflix | 761fef0714f44e1fa01ae78a96edb80f88b2dae1 | [
"MIT"
] | null | null | null | resources/lib/services/msl/request_builder.py | otava5/plugin.video.netflix | 761fef0714f44e1fa01ae78a96edb80f88b2dae1 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Copyright (C) 2017 Sebastian Golasch (plugin.video.netflix)
Copyright (C) 2018 Caphm (original implementation module)
MSL request building
SPDX-License-Identifier: MIT
See LICENSES/MIT.md for more information.
"""
from __future__ import absolute_import, division, unicode... | 36.493056 | 94 | 0.63863 | # -*- coding: utf-8 -*-
"""
Copyright (C) 2017 Sebastian Golasch (plugin.video.netflix)
Copyright (C) 2018 Caphm (original implementation module)
MSL request building
SPDX-License-Identifier: MIT
See LICENSES/MIT.md for more information.
"""
from __future__ import absolute_import, division, unicode... | 0 | 1,850 | 0 | 1,659 | 0 | 0 | 0 | 42 | 94 |
e82095967048bf499a855a996bae292b5a5db0ec | 1,334 | py | Python | chart/scripts/start-notebook.d/extra_notebook_config.py | ctiml/primehub | 00c06145d8a07461c923ba09c222e2ebf12b49ff | [
"Apache-2.0"
] | 294 | 2019-04-02T13:09:26.000Z | 2022-03-30T09:09:49.000Z | chart/scripts/start-notebook.d/extra_notebook_config.py | ctiml/primehub | 00c06145d8a07461c923ba09c222e2ebf12b49ff | [
"Apache-2.0"
] | 206 | 2019-04-09T08:41:28.000Z | 2022-03-30T01:28:19.000Z | chart/scripts/start-notebook.d/extra_notebook_config.py | ctiml/primehub | 00c06145d8a07461c923ba09c222e2ebf12b49ff | [
"Apache-2.0"
] | 26 | 2019-04-16T20:53:12.000Z | 2022-03-10T12:37:16.000Z | # from https://github.com/jupyterhub/mybinder.org-deploy/blob/master/appendix/extra_notebook_config.py
import os
# if a user leaves a notebook with a running kernel,
# the effective idle timeout will typically be CULL_TIMEOUT + CULL_KERNEL_TIMEOUT
# as culling the kernel will register activity,
# resetting the no_activ... | 44.466667 | 134 | 0.755622 | # from https://github.com/jupyterhub/mybinder.org-deploy/blob/master/appendix/extra_notebook_config.py
import os
# if a user leaves a notebook with a running kernel,
# the effective idle timeout will typically be CULL_TIMEOUT + CULL_KERNEL_TIMEOUT
# as culling the kernel will register activity,
# resetting the no_activ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
85243098169018cc5d5838d9475fcf78ecd706bf | 3,350 | py | Python | crawl/spiders/stock_details.py | maifusha/dongfangcaifu-stock-crawler | 6d20846b85b601a8b309d9dc47441d4b7409fbc0 | [
"MIT"
] | null | null | null | crawl/spiders/stock_details.py | maifusha/dongfangcaifu-stock-crawler | 6d20846b85b601a8b309d9dc47441d4b7409fbc0 | [
"MIT"
] | null | null | null | crawl/spiders/stock_details.py | maifusha/dongfangcaifu-stock-crawler | 6d20846b85b601a8b309d9dc47441d4b7409fbc0 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
""" """
| 33.838384 | 127 | 0.579403 | # -*- coding: utf-8 -*-
""" 东方财富网:个股详情爬虫 """
import re
import scrapy
import json
import time
from crawl import db
from crawl import helper
from crawl.models.Stock import Stock
from crawl.models.StockDetail import StockDetail
class StockDetailsSpider(scrapy.Spider):
name = "stock_details"
allowed_domains = [... | 309 | 0 | 0 | 3,009 | 0 | 0 | 0 | 4 | 200 |
99b9847323d2a912600184ba1f913a0369ba9259 | 432 | py | Python | test.py | bentrevett/CodeSearchNet | d79d0fde2569e4ed7ab0454e3b019fba3d6c7b90 | [
"MIT"
] | 4 | 2019-11-22T16:17:43.000Z | 2020-04-30T07:42:16.000Z | test.py | bentrevett/CodeSearchNet | d79d0fde2569e4ed7ab0454e3b019fba3d6c7b90 | [
"MIT"
] | 1 | 2019-12-13T13:20:01.000Z | 2019-12-15T07:20:38.000Z | test.py | bentrevett/CodeSearchNet | d79d0fde2569e4ed7ab0454e3b019fba3d6c7b90 | [
"MIT"
] | 3 | 2019-11-05T23:30:48.000Z | 2019-12-14T05:55:51.000Z | import torch
x = torch.randn(10, 5)
print(x)
labels = torch.LongTensor([1,2,3,3,0,0,0,0,0,0])
n_classes = x.shape[-1]
one_hot = torch.nn.functional.one_hot(labels, n_classes)
print(one_hot)
print(x * one_hot)
compare = (x * one_hot).sum(-1).unsqueeze(-1).repeat(1, n_classes)
print(compare)
compared_scores = x... | 16.615385 | 66 | 0.694444 | import torch
x = torch.randn(10, 5)
print(x)
labels = torch.LongTensor([1,2,3,3,0,0,0,0,0,0])
n_classes = x.shape[-1]
one_hot = torch.nn.functional.one_hot(labels, n_classes)
print(one_hot)
print(x * one_hot)
compare = (x * one_hot).sum(-1).unsqueeze(-1).repeat(1, n_classes)
print(compare)
compared_scores = x... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ad84cf0b87cabff0990305293e8baef382e76ec5 | 1,064 | py | Python | software/studio50_fly/examples/read_data.py | willdickson/studio50_fly | 30c6bd7ded493ff49288c53abf78185163825b06 | [
"CC-BY-4.0"
] | 1 | 2021-06-23T06:07:23.000Z | 2021-06-23T06:07:23.000Z | software/studio50_fly/examples/read_data.py | willdickson/studio50_fly | 30c6bd7ded493ff49288c53abf78185163825b06 | [
"CC-BY-4.0"
] | null | null | null | software/studio50_fly/examples/read_data.py | willdickson/studio50_fly | 30c6bd7ded493ff49288c53abf78185163825b06 | [
"CC-BY-4.0"
] | null | null | null | import sys
import h5py
import json
import numpy as np
import matplotlib.pyplot as plt
filename = sys.argv[1]
data = h5py.File(filename,'r')
attr = json.loads(data.attrs['jsonparam'])
#for k,v in attr['config'].items():
# print(k,v)
#print()
#
#for k,v in attr['param'].items():
# print(k,v)
#
#print()
#print()
... | 17.16129 | 57 | 0.665414 | import sys
import h5py
import json
import numpy as np
import matplotlib.pyplot as plt
filename = sys.argv[1]
data = h5py.File(filename,'r')
attr = json.loads(data.attrs['jsonparam'])
#for k,v in attr['config'].items():
# print(k,v)
#print()
#
#for k,v in attr['param'].items():
# print(k,v)
#
#print()
#print()
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7ba6ddc59af7d53a8f3eaee0b39faba368ec8bf6 | 810 | py | Python | scripts/crb/single-particle-vs-radius.py | Jdudre/peri | 98fc046e3e0d50017eb6b242b3b84b3e0fbaa00e | [
"MIT"
] | 9 | 2017-12-02T08:20:50.000Z | 2020-08-07T07:03:04.000Z | scripts/crb/single-particle-vs-radius.py | Jdudre/peri | 98fc046e3e0d50017eb6b242b3b84b3e0fbaa00e | [
"MIT"
] | 10 | 2017-02-28T18:55:39.000Z | 2019-08-08T16:09:22.000Z | scripts/crb/single-particle-vs-radius.py | Jdudre/peri | 98fc046e3e0d50017eb6b242b3b84b3e0fbaa00e | [
"MIT"
] | 7 | 2017-10-30T14:50:38.000Z | 2019-04-14T00:28:17.000Z | import numpy as np
import pylab as pl
from peri.test import init
crbs = []
rads = np.arange(1, 10, 1./5)
rads = np.linspace(1, 10, 39)
rads = np.logspace(0, 1, 50)
s = init.create_single_particle_state(imsize=64, radius=1, sigma=0.05)
blocks = s.blocks_particle(0)
for rad in rads:
print "Radius", rad
s.upda... | 23.823529 | 70 | 0.62716 | import numpy as np
import pylab as pl
from peri.test import init
crbs = []
rads = np.arange(1, 10, 1./5)
rads = np.linspace(1, 10, 39)
rads = np.logspace(0, 1, 50)
s = init.create_single_particle_state(imsize=64, radius=1, sigma=0.05)
blocks = s.blocks_particle(0)
for rad in rads:
print "Radius", rad
s.upda... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2a3a6301c746214408cfa92b908009200e1f2b9d | 70 | py | Python | include/tclap-1.4.0-rc1/tests/test88.py | SpaceKatt/cpp-cli-poc | 02ffefea2fc6e999fa2b27d08a8b3be6830b1b97 | [
"BSL-1.0"
] | 62 | 2021-09-21T18:58:02.000Z | 2022-03-07T02:17:43.000Z | third_party/tclap-1.4.0-rc1/tests/test88.py | Vertexwahn/FlatlandRT | 37d09fde38b25eff5f802200b43628efbd1e3198 | [
"Apache-2.0"
] | null | null | null | third_party/tclap-1.4.0-rc1/tests/test88.py | Vertexwahn/FlatlandRT | 37d09fde38b25eff5f802200b43628efbd1e3198 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
import simple_test
simple_test.test("test27", [])
| 11.666667 | 30 | 0.714286 | #!/usr/bin/python
import simple_test
simple_test.test("test27", [])
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
f99c640e5fe1917fc5f8cef929c4a22759baccb9 | 4,955 | py | Python | 1-lxastro0/code_local/util_json.py | remtav/SpaceNet7_Multi-Temporal_Solutions | ee535c61fc22bffa45331519239c6d1b044b1514 | [
"Apache-2.0"
] | null | null | null | 1-lxastro0/code_local/util_json.py | remtav/SpaceNet7_Multi-Temporal_Solutions | ee535c61fc22bffa45331519239c6d1b044b1514 | [
"Apache-2.0"
] | null | null | null | 1-lxastro0/code_local/util_json.py | remtav/SpaceNet7_Multi-Temporal_Solutions | ee535c61fc22bffa45331519239c6d1b044b1514 | [
"Apache-2.0"
] | null | null | null |
from pathlib import Path
in_json = Path('/media/data/GDL_all_images/data_file.json')
out_json = Path('/media/data/GDL_all_images/data_file_dates.json')
root_cutoff = Path('/media/data/')
img_root_dir = '/media/data/GDL_all_images/WV2'
generate_json(img_root_dir, out_json, root_cutoff, debug=False) | 41.991525 | 120 | 0.57114 | import calendar
import json
import os.path
import warnings
from pathlib import Path
from collections import OrderedDict
in_json = Path('/media/data/GDL_all_images/data_file.json')
out_json = Path('/media/data/GDL_all_images/data_file_dates.json')
root_cutoff = Path('/media/data/')
img_root_dir = '/media/data/GDL_all_... | 0 | 0 | 0 | 0 | 0 | 4,511 | 0 | -15 | 156 |
c641ab611cf5032371575c40b1e57de5b354e993 | 1,275 | py | Python | selfservice-api/src/selfservice_api/models/enums/project.py | bcgov/BCSC-BPS | 3bfe09c100a0f5b98d61228324336d5f45ad93ad | [
"Apache-2.0"
] | 2 | 2020-07-03T18:18:34.000Z | 2021-03-08T10:25:50.000Z | selfservice-api/src/selfservice_api/models/enums/project.py | bcgov/BCSC-BPS | 3bfe09c100a0f5b98d61228324336d5f45ad93ad | [
"Apache-2.0"
] | 312 | 2020-01-10T23:00:08.000Z | 2022-03-29T22:07:00.000Z | selfservice-api/src/selfservice_api/models/enums/project.py | bcgov/BCSC-BPS | 3bfe09c100a0f5b98d61228324336d5f45ad93ad | [
"Apache-2.0"
] | 2 | 2020-03-26T05:10:20.000Z | 2021-02-05T19:22:56.000Z | # Copyright 2019 Province of British Columbia
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | 33.552632 | 74 | 0.723922 | # Copyright © 2019 Province of British Columbia
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | 2 | 0 | 0 | 559 | 0 | 0 | 0 | 17 | 69 |
b734c16ff9206121bf780a2229d7361532c28fa2 | 2,081 | py | Python | ProjectManager/apps/platform_management/models.py | litiian/asyncstudy | a59119f189ca96fdd7f64b0b3212207572165dce | [
"Apache-2.0"
] | null | null | null | ProjectManager/apps/platform_management/models.py | litiian/asyncstudy | a59119f189ca96fdd7f64b0b3212207572165dce | [
"Apache-2.0"
] | null | null | null | ProjectManager/apps/platform_management/models.py | litiian/asyncstudy | a59119f189ca96fdd7f64b0b3212207572165dce | [
"Apache-2.0"
] | null | null | null | ######################################
# Django
######################################
######################################
#
######################################
######################################
#
######################################
######################################
#
########################... | 35.271186 | 130 | 0.590101 | ######################################
# Django 模块
######################################
from django.db import models
from django.db.models import Q
######################################
# 系统模块
######################################
import datetime
######################################
# 自定义模块
####################... | 207 | 0 | 0 | 1,434 | 0 | 0 | 0 | 23 | 132 |
907c7f367753e679043949c71d63e0c423dbaae5 | 2,979 | py | Python | sunpy/lightcurve/tests/test_rhessi.py | s0nskar/sunpy | 60ca4792ded4c3938a78da7055cf2c20e0e8ccfd | [
"MIT"
] | 1 | 2020-01-12T15:06:49.000Z | 2020-01-12T15:06:49.000Z | sunpy/lightcurve/tests/test_rhessi.py | s0nskar/sunpy | 60ca4792ded4c3938a78da7055cf2c20e0e8ccfd | [
"MIT"
] | null | null | null | sunpy/lightcurve/tests/test_rhessi.py | s0nskar/sunpy | 60ca4792ded4c3938a78da7055cf2c20e0e8ccfd | [
"MIT"
] | null | null | null |
"""
RHESSI LightCurve Tests
"""
from __future__ import absolute_import
| 39.197368 | 145 | 0.716348 |
"""
RHESSI LightCurve Tests
"""
from __future__ import absolute_import
import pytest
import sunpy.lightcurve
from sunpy.time import TimeRange
from numpy import all
class TestRHESSISummaryLightCurve(object):
@pytest.fixture
def timerange_a(self):
return TimeRange('2008/06/01', '2008/06/02')
@py... | 0 | 2,498 | 0 | 21 | 0 | 0 | 0 | 5 | 382 |
bfc57dfb5828c76f959c9abd3e47111df9a7d962 | 1,134 | py | Python | app/main/views.py | Juru-10/ubudehe | 7ea31acad95d72472ef3011818e5000f020d5ee6 | [
"MIT"
] | null | null | null | app/main/views.py | Juru-10/ubudehe | 7ea31acad95d72472ef3011818e5000f020d5ee6 | [
"MIT"
] | null | null | null | app/main/views.py | Juru-10/ubudehe | 7ea31acad95d72472ef3011818e5000f020d5ee6 | [
"MIT"
] | null | null | null | from .. import db, photos
| 29.842105 | 96 | 0.708113 | from flask import Flask
from flask import render_template,request,redirect,url_for,abort
from ..models import User,Citizen
from . import main
from .forms import SearchForm,AdminForm
from .. import db,photos
from flask_login import login_required,current_user
import markdown2
@main.route('/',methods = ['GET','POST'])
d... | 0 | 789 | 0 | 0 | 0 | 0 | 0 | 96 | 223 |
16934096d4cd9a091ac2b1eb7cc906869c4ef935 | 1,471 | py | Python | Python/01-matrix.py | bssrdf/LeetCode-5 | 746df5cff523361145a74d9d429dc541a7b99910 | [
"MIT"
] | 68 | 2018-01-13T07:15:37.000Z | 2022-02-20T12:58:24.000Z | Python/01-matrix.py | bssrdf/LeetCode-5 | 746df5cff523361145a74d9d429dc541a7b99910 | [
"MIT"
] | null | null | null | Python/01-matrix.py | bssrdf/LeetCode-5 | 746df5cff523361145a74d9d429dc541a7b99910 | [
"MIT"
] | 63 | 2017-04-10T03:38:25.000Z | 2022-03-17T23:24:51.000Z | # Time: O(m * n)
# Space: O(m * n)
# Given a matrix consists of 0 and 1, find the distance of the nearest 0 for each cell.
# The distance between two adjacent cells is 1.
#
# Example 1:
#
# Input:
# 0 0 0
# 0 1 0
# 0 0 0
#
# Output:
# 0 0 0
# 0 1 0
# 0 0 0
#
# Example 2:
#
# Input:
# 0 0 0
# 0 1 0
# 1 1 1
#
# Outpu... | 23.725806 | 87 | 0.488103 | # Time: O(m * n)
# Space: O(m * n)
# Given a matrix consists of 0 and 1, find the distance of the nearest 0 for each cell.
# The distance between two adjacent cells is 1.
#
# Example 1:
#
# Input:
# 0 0 0
# 0 1 0
# 0 0 0
#
# Output:
# 0 0 0
# 0 1 0
# 0 0 0
#
# Example 2:
#
# Input:
# 0 0 0
# 0 1 0
# 1 1 1
#
# Outpu... | 0 | 0 | 0 | 898 | 0 | 0 | 0 | 0 | 23 |
584111a59a26e967b60ea2f4e6323abcab2cc8b1 | 17,249 | py | Python | rvm.py | aasensio/pyAndres | e952ded9aba145a6d87afec071e0fb44a3131750 | [
"MIT"
] | null | null | null | rvm.py | aasensio/pyAndres | e952ded9aba145a6d87afec071e0fb44a3131750 | [
"MIT"
] | null | null | null | rvm.py | aasensio/pyAndres | e952ded9aba145a6d87afec071e0fb44a3131750 | [
"MIT"
] | null | null | null | __all__ = ['rvm']
#import pdb
#from pyandres import cholInvert
#***************
# Test
#***************
#import matplotlib.pyplot as pl
#N = 10
#M = 11
#XStenflo = np.asarray([-2.83000,-1.18000,0.870000,1.90000,3.96000,5.01000,6.25000,8.10000,9.98000,12.1200]).T
#Outputs = np.asarray([0.0211433,0.0167467,0.00938793,... | 34.292247 | 154 | 0.643168 | __all__ = ['rvm']
import numpy as np
#import pdb
#from pyandres import cholInvert
class rvm(object):
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# Constructor
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
def __init__(self, basis, targets, noise=None):
"""
Class that implements a Relevance... | 0 | 0 | 0 | 16,315 | 0 | 0 | 0 | -3 | 45 |
aca3dd6e545332721c6469a3cb6c5200980062dc | 4,974 | py | Python | src/tests/test_pagure_exclude_group_index.py | yifengyou/learn-pagure | e54ba955368918c92ad2be6347b53bb2c24a228c | [
"Unlicense"
] | null | null | null | src/tests/test_pagure_exclude_group_index.py | yifengyou/learn-pagure | e54ba955368918c92ad2be6347b53bb2c24a228c | [
"Unlicense"
] | null | null | null | src/tests/test_pagure_exclude_group_index.py | yifengyou/learn-pagure | e54ba955368918c92ad2be6347b53bb2c24a228c | [
"Unlicense"
] | null | null | null | # -*- coding: utf-8 -*-
"""
(c) 2017 - Copyright Red Hat Inc
Authors:
Pierre-Yves Chibon <pingou@pingoured.fr>
"""
from __future__ import unicode_literals, absolute_import
import unittest
import sys
import os
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
)
import pag... | 29.258824 | 78 | 0.593285 | # -*- coding: utf-8 -*-
"""
(c) 2017 - Copyright Red Hat Inc
Authors:
Pierre-Yves Chibon <pingou@pingoured.fr>
"""
from __future__ import unicode_literals, absolute_import
import unittest
import shutil
import sys
import os
import mock
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.abspath(__fi... | 0 | 0 | 0 | 4,492 | 0 | 0 | 0 | -25 | 112 |
a5430770a77537b261985730e3490de1a462478b | 2,214 | py | Python | linkedlists/linkinsertion.py | dhruvsharma1999/data-structures | f3b51ebca2f6e28eee3dcb5692f92d2f7f3533e5 | [
"MIT"
] | null | null | null | linkedlists/linkinsertion.py | dhruvsharma1999/data-structures | f3b51ebca2f6e28eee3dcb5692f92d2f7f3533e5 | [
"MIT"
] | null | null | null | linkedlists/linkinsertion.py | dhruvsharma1999/data-structures | f3b51ebca2f6e28eee3dcb5692f92d2f7f3533e5 | [
"MIT"
] | null | null | null | # A complete working python program to demonstrate all
# inertion methods of linked list
#
# Node class
# Linked list class contains a Node object
# code execution
#
if __name__ =='__main__':
llist = LinkedList()
llist.append(6)
llist.push(7)
llist.push(1)
llist.append(4)
llist.insertAfter(... | 21.288462 | 67 | 0.598464 | # A complete working python program to demonstrate all
# inertion methods of linked list
#
# Node class
class Node:
#function to initialize the node object
def __init__(self, data):
self.data = data # assign data
self.next = None # initialize next as null
# Linked list class contains a No... | 0 | 0 | 0 | 1,750 | 0 | 0 | 0 | 0 | 44 |
38d85885d39b397c8de31eb07b6373663bc1a273 | 10,984 | py | Python | ai/main.py | thalvadzhi/AI-for-Pac-Man | 1a9443f0dc030329a0a5592c6f042e4f7ca1501a | [
"MIT"
] | null | null | null | ai/main.py | thalvadzhi/AI-for-Pac-Man | 1a9443f0dc030329a0a5592c6f042e4f7ca1501a | [
"MIT"
] | null | null | null | ai/main.py | thalvadzhi/AI-for-Pac-Man | 1a9443f0dc030329a0a5592c6f042e4f7ca1501a | [
"MIT"
] | null | null | null | import math
import queue
from create_board import create_board
from direction import Direction
map_repr = "oooooooooooooooooooooooooooooooWWWWWWWWWWWWWWWWWWWWWWWWWWWWooWPPPPPPPPPPPPwwPPPPPPPPPPPPWooWPwwwwPwwwwwPwwPwwwwwPwwwwPWooWHwoowPwooowPwwPwooowPwoowHWooWPwwwwPwwwwwPwwPwwwwwPwwwwPWooWPPPPPPPPPPPPPPPPPPPPPPPPPPWooWP... | 37.616438 | 1,003 | 0.690095 | from board import Board
import pacman as pc
import math
import queue
from itertools import permutations
import random
import copy
import time
from create_board import create_board
from ipc import PacmanControls
from direction import Direction
from CONSTANTS import *
map_repr = "oooooooooooooooooooooooooooooooWWWWWWWWWW... | 0 | 0 | 0 | 176 | 0 | 5,688 | 0 | -4 | 540 |
f1f2535f8688b2d9e0221f2b8bdd67525af55896 | 1,554 | py | Python | util.py | OhadRubin/laughing-carnival | 172bfd3b009254cc6e55ec24ca99ec7b45593bfa | [
"Apache-2.0"
] | 20 | 2017-02-06T06:01:58.000Z | 2022-01-06T02:04:51.000Z | util.py | OhadRubin/laughing-carnival | 172bfd3b009254cc6e55ec24ca99ec7b45593bfa | [
"Apache-2.0"
] | 4 | 2017-02-09T02:40:44.000Z | 2019-03-04T09:13:43.000Z | util.py | OhadRubin/laughing-carnival | 172bfd3b009254cc6e55ec24ca99ec7b45593bfa | [
"Apache-2.0"
] | 18 | 2017-01-06T10:56:34.000Z | 2019-11-16T14:34:18.000Z | from __future__ import division
import os
import errno
def mkdirs(dirname):
"""Recurcively (and safely) create dir
It is equivalent to mkdir -p dirname
"""
try:
os.makedirs(dirname)
except OSError as exc:
if exc.errno != errno.EEXIST:
raise exc
| 19.923077 | 55 | 0.642857 | from __future__ import division
import os
import errno
import time
def mkdirs(dirname):
"""Recurcively (and safely) create dir
It is equivalent to mkdir -p dirname
"""
try:
os.makedirs(dirname)
except OSError as exc:
if exc.errno != errno.EEXIST:
raise exc
def fltohm(seconds):
seconds... | 0 | 452 | 0 | 653 | 0 | 114 | 0 | -10 | 68 |
dbb5f3b9b67deebdf7c9d09f6a131956bb4c0361 | 485 | py | Python | members/migrations/0004_auto_20200628_1852.py | yellowjaguar5/lnldb | dea7708f5e4e103ef6ef968c9f3a4deaa58861c5 | [
"MIT"
] | 5 | 2017-09-25T21:24:59.000Z | 2021-12-18T17:08:13.000Z | members/migrations/0004_auto_20200628_1852.py | yellowjaguar5/lnldb | dea7708f5e4e103ef6ef968c9f3a4deaa58861c5 | [
"MIT"
] | 304 | 2015-03-24T17:44:22.000Z | 2022-03-29T14:09:41.000Z | members/migrations/0004_auto_20200628_1852.py | yellowjaguar5/lnldb | dea7708f5e4e103ef6ef968c9f3a4deaa58861c5 | [
"MIT"
] | 10 | 2017-10-24T02:18:12.000Z | 2021-09-20T20:40:25.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2020-06-28 22:52
from __future__ import unicode_literals
| 24.25 | 124 | 0.618557 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2020-06-28 22:52
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('members', '0003_trainings'),
]
operations = [
migrations.AlterModelOptions(
... | 0 | 0 | 0 | 313 | 0 | 0 | 0 | 11 | 46 |
1cae240e82f45e736cec781555c889e90ba9c5a0 | 3,764 | py | Python | Model/BPnet.py | bladezzw/DeepQuantInChina | ce74a9bf8db91e3545ccc3e7af81f80796a536fa | [
"MIT"
] | 8 | 2019-04-14T03:05:19.000Z | 2020-02-13T18:35:41.000Z | Model/BPnet.py | bladezzw/DeepQuantInChina | ce74a9bf8db91e3545ccc3e7af81f80796a536fa | [
"MIT"
] | null | null | null | Model/BPnet.py | bladezzw/DeepQuantInChina | ce74a9bf8db91e3545ccc3e7af81f80796a536fa | [
"MIT"
] | 2 | 2019-05-08T08:23:50.000Z | 2020-01-23T03:54:41.000Z |
import csvdata
# some import works
import pandas as pd
import numpy as np
import torch
from feature.features import features
# Generate dummy data
datapath = csvdata.csvdatapaths[0] #
data = pd.read_csv(datapath) # csv
date = np.array(data['date'])
Time = np.array(data['time'])
open = np.array(data['open'])
... | 26.138889 | 105 | 0.649841 |
import csvdata
# some import works
import pandas as pd
import numpy as np
import torch
from feature.features import features
# Generate dummy data
datapath = csvdata.csvdatapaths[0] # 输入需要训练的文件
data = pd.read_csv(datapath) # 载入csv文件
date = np.array(data['date'])
Time = np.array(data['time'])
open = np.array(d... | 291 | 0 | 0 | 967 | 0 | 0 | 0 | 25 | 90 |
9caeceed1c7db68ad95c3d6b13ca71d78a8a93a4 | 13,828 | py | Python | models/mtl_train.py | marcelampc/aerial_mtl | c6a2033ec89a89ff06836014c619d66bc907d958 | [
"BSD-3-Clause"
] | 58 | 2019-07-23T09:01:58.000Z | 2022-03-31T23:12:37.000Z | models/mtl_train.py | marcelampc/mtl_aerial_images | c6a2033ec89a89ff06836014c619d66bc907d958 | [
"BSD-3-Clause"
] | 5 | 2019-12-09T12:20:35.000Z | 2021-06-23T12:41:48.000Z | models/mtl_train.py | marcelampc/aerial_mtl | c6a2033ec89a89ff06836014c619d66bc907d958 | [
"BSD-3-Clause"
] | 8 | 2019-08-05T11:13:23.000Z | 2021-04-26T00:57:40.000Z | import torch.nn as nn
import util.pytorch_ssim as pytorch_ssim
# Be able to add many loss functions | 44.606452 | 175 | 0.603413 | import os
import time
import torch
import torch.nn as nn
from collections import OrderedDict
from ipdb import set_trace as st
from math import sqrt
from tqdm import tqdm
from .train_model import TrainModel
from networks import networks
import util.pytorch_ssim as pytorch_ssim
from sklearn.metrics import confusion_ma... | 0 | 0 | 0 | 13,380 | 0 | 0 | 0 | 59 | 288 |
a41d49395bc6703994eaddd0867ce92e16544a5e | 182 | py | Python | process.py | marksale/NMTemplater | b5d9fa45801d8894dd12170c20fd04ad687266b7 | [
"MIT"
] | null | null | null | process.py | marksale/NMTemplater | b5d9fa45801d8894dd12170c20fd04ad687266b7 | [
"MIT"
] | null | null | null | process.py | marksale/NMTemplater | b5d9fa45801d8894dd12170c20fd04ad687266b7 | [
"MIT"
] | null | null | null | from subprocess import Popen, PIPE
def runNONMEM:
process = Popen(['echo', 'test.py'], stdout=PIPE, stderr=PIPE)
stdout, stderr = process.communicate()
print stdout | 30.333333 | 67 | 0.681319 | from subprocess import Popen, PIPE
def runNONMEM:
process = Popen(['echo', 'test.py'], stdout=PIPE, stderr=PIPE)
stdout, stderr = process.communicate()
print stdout | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
bb5d82dd025189459a52c1dbe1e1af0e20e2a7b7 | 4,194 | py | Python | link_analysis/converters.py | Rexarrior/ALT | 9271682f433f5c9675cf345026decc1d0d359391 | [
"Apache-2.0"
] | 1 | 2019-06-16T10:04:18.000Z | 2019-06-16T10:04:18.000Z | link_analysis/converters.py | robot-lab/judyst-link-analysis | 9271682f433f5c9675cf345026decc1d0d359391 | [
"Apache-2.0"
] | 44 | 2018-10-11T22:27:59.000Z | 2018-11-24T17:43:02.000Z | link_analysis/converters.py | Rexarrior/ALT | 9271682f433f5c9675cf345026decc1d0d359391 | [
"Apache-2.0"
] | 2 | 2019-04-05T22:52:53.000Z | 2019-04-06T05:18:41.000Z | from typing import Dict, Iterable, Type, List, Union
if __package__:
from link_analysis.models import Header, DocumentHeader, CleanLink
else:
from models import DocumentHeader, CleanLink # type: ignore
# Don't forget to add to this place new classes which contains implementation
# method convert_to_class_for... | 35.846154 | 77 | 0.664521 | import json
import pickle
import os
from typing import Dict, Iterable, TypeVar, Type, List, Union, Any
if __package__:
from link_analysis.models import Header, DocumentHeader, CleanLink
else:
from models import Header, DocumentHeader, CleanLink # type: ignore
# Don't forget to add to this place new classes w... | 0 | 0 | 0 | 0 | 0 | 1,376 | 0 | -8 | 181 |
076d2fea080e29cbc74f57d352833d9acd5feec6 | 29,417 | py | Python | tatk/policy/rule/multiwoz/policy_agenda_multiwoz.py | libing125/tatk | 1473a162cf45a4a40a60473169bc034234412b2e | [
"Apache-2.0"
] | 81 | 2019-03-12T13:40:29.000Z | 2022-01-17T10:59:21.000Z | tatk/policy/rule/multiwoz/policy_agenda_multiwoz.py | zqwerty/tatk | fafabc45d02ad889f59354acac4e3b1367e7d4bf | [
"Apache-2.0"
] | 35 | 2019-03-13T14:05:05.000Z | 2021-08-25T15:38:14.000Z | tatk/policy/rule/multiwoz/policy_agenda_multiwoz.py | zqwerty/tatk | fafabc45d02ad889f59354acac4e3b1367e7d4bf | [
"Apache-2.0"
] | 41 | 2019-03-13T09:40:24.000Z | 2022-03-07T17:59:07.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
"""
__time__ = '2019/1/31 10:24'
import copy
from tatk.util.multiwoz.multiwoz_slot_trans import REF_USR_DA, REF_SYS_DA
DEF_VAL_UNK = '?' # Unknown
DEF_VAL_DNC = 'don\'t care' # Do not care
DEF_VAL_NUL = 'none' # for none
DEF_VAL_BOOKED = 'yes' # for booked
DEF_... | 36.863409 | 137 | 0.548968 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
"""
__time__ = '2019/1/31 10:24'
import copy
import json
import os
import random
import re
import logging
from tatk.policy.policy import Policy
from tatk.task.multiwoz.goal_generator import GoalGenerator
from tatk.util.multiwoz.multiwoz_slot_trans import REF_USR_DA... | 0 | 3,585 | 0 | 23,095 | 0 | 1,615 | 0 | 5 | 316 |
4cef457b560431ad8d0f4248fc3a6e9bc37ce6ff | 20,453 | py | Python | empg_erp/attendence/report/daily_attendance_report/daily_attendance_report.py | shahzadzameen/empghr_erp | ba24a833b7fea8f17b155435064ead761f2a134c | [
"MIT"
] | null | null | null | empg_erp/attendence/report/daily_attendance_report/daily_attendance_report.py | shahzadzameen/empghr_erp | ba24a833b7fea8f17b155435064ead761f2a134c | [
"MIT"
] | null | null | null | empg_erp/attendence/report/daily_attendance_report/daily_attendance_report.py | shahzadzameen/empghr_erp | ba24a833b7fea8f17b155435064ead761f2a134c | [
"MIT"
] | null | null | null | # Copyright (c) 2013, zameen and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
from pypika import Tables
empatt, tabEmp, ats, le = Tables(
'tabAttendance','tabEmployee', 'tabRoster Status', 'tabLeave Application'
)
| 43.332627 | 244 | 0.60397 | # Copyright (c) 2013, zameen and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from datetime import datetime,time, timedelta
from empg_erp.modules.mustang.employee.employee_roster import EmployeeRoster
import json
from pypika i... | 0 | 1,091 | 0 | 0 | 0 | 18,001 | 0 | 622 | 450 |
aa478105847272ef009cefd0d1bfd42ce7de7feb | 8,827 | py | Python | archive/Decathlon-meta-regression/meta_machine_learning.py | tueimage/meta-segmentation-msc-2018 | d497e6ea99b89fdb54e11568452894f022269043 | [
"MIT"
] | 3 | 2019-07-16T12:31:38.000Z | 2020-07-22T17:03:53.000Z | archive/Decathlon-meta-regression/meta_machine_learning.py | tueimage/meta-segmentation-msc-2018 | d497e6ea99b89fdb54e11568452894f022269043 | [
"MIT"
] | null | null | null | archive/Decathlon-meta-regression/meta_machine_learning.py | tueimage/meta-segmentation-msc-2018 | d497e6ea99b89fdb54e11568452894f022269043 | [
"MIT"
] | 1 | 2020-12-10T12:56:06.000Z | 2020-12-10T12:56:06.000Z | # from meta_network import meta_learner
# from utils import subset_index_to_address
# from utils import meta_pred_generator, historyPlot, create_data_subsets, dice_coef_loss, auc, mean_iou, dice_coef
import os
os.environ["CUDA_VISIBLE_DEVICES"] = "1"
if __name__ == '__main__':
main()
| 50.729885 | 327 | 0.690948 | # from meta_network import meta_learner
from data import Data, MetaData
# from utils import subset_index_to_address
# from utils import meta_pred_generator, historyPlot, create_data_subsets, dice_coef_loss, auc, mean_iou, dice_coef
from visualization import visualize_meta_labels, visualize_meta_features, visualize_regr... | 0 | 0 | 0 | 0 | 0 | 7,997 | 0 | 276 | 265 |
22b4659057605339d7dff3cd362ea400ef31712b | 1,467 | py | Python | solvers/c3/solution/dump_1.py | Sayapatri/hackasat | b0cb5ab3f16a14a3434234f745e91ac15ccee733 | [
"MIT"
] | 62 | 2020-09-01T19:47:37.000Z | 2022-03-14T03:21:53.000Z | solvers/c3/solution/dump_1.py | Sayapatri/hackasat | b0cb5ab3f16a14a3434234f745e91ac15ccee733 | [
"MIT"
] | null | null | null | solvers/c3/solution/dump_1.py | Sayapatri/hackasat | b0cb5ab3f16a14a3434234f745e91ac15ccee733 | [
"MIT"
] | 10 | 2020-09-21T22:25:34.000Z | 2022-01-17T11:47:53.000Z | from comms import Radio_Comms
import time
from binascii import hexlify
if __name__ == "__main__":
#comms = UDP_Comms('127.0.0.1', 1234, 1235)
# comms = Serial_Comms("/dev/ttyUSB2")
comms = Radio_Comms('127.0.0.1','127.0.0.1', 5020, 5000)
#comms = Radio_Comms('10.0.0.2','10.0.0.98', 5028, 5000)
#com... | 31.891304 | 82 | 0.545331 | from comms import UDP_Comms, Serial_Comms, Radio_Comms
import socket, time
from binascii import unhexlify, hexlify
if __name__ == "__main__":
#comms = UDP_Comms('127.0.0.1', 1234, 1235)
# comms = Serial_Comms("/dev/ttyUSB2")
comms = Radio_Comms('127.0.0.1','127.0.0.1', 5020, 5000)
#comms = Radio_Comms(... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 44 | 0 |
4142d0b6ad0045aa602a6c3f718fc0c467952452 | 509 | py | Python | COMPILER/main.py | iAziz786/mygolang | 2845bd0148202dbc33b5d04105cce2fa6659fd26 | [
"MIT"
] | 1 | 2022-03-23T21:30:33.000Z | 2022-03-23T21:30:33.000Z | COMPILER/main.py | iAziz786/mygolang | 2845bd0148202dbc33b5d04105cce2fa6659fd26 | [
"MIT"
] | null | null | null | COMPILER/main.py | iAziz786/mygolang | 2845bd0148202dbc33b5d04105cce2fa6659fd26 | [
"MIT"
] | null | null | null | # Link to the problem: https://www.codechef.com/problems/COMPILER
if __name__ == "__main__":
main()
| 19.576923 | 65 | 0.424361 | # Link to the problem: https://www.codechef.com/problems/COMPILER
def main():
test = int(input())
while test:
test = test - 1
exp = input()
count, res = 0, 0
for i, val in enumerate(exp):
if val == "<":
count = count + 1
else:
... | 0 | 0 | 0 | 0 | 0 | 379 | 0 | 0 | 23 |
f202be20aa98fa9a09c4adf6de5787dd60f21919 | 3,019 | py | Python | python/federatedml/ensemble/basic_algorithms/decision_tree/tree_core/tree_plan.py | rubenlozanoaht3m/DataDogm | cd605e8072cca31e8418830c3300657ae2fa5b16 | [
"Apache-2.0"
] | 715 | 2019-01-24T10:52:03.000Z | 2019-10-31T12:19:22.000Z | python/federatedml/ensemble/basic_algorithms/decision_tree/tree_core/tree_plan.py | rubenlozanoaht3m/DataDogm | cd605e8072cca31e8418830c3300657ae2fa5b16 | [
"Apache-2.0"
] | 270 | 2019-02-11T02:57:36.000Z | 2019-08-29T11:22:33.000Z | python/federatedml/ensemble/basic_algorithms/decision_tree/tree_core/tree_plan.py | rubenlozanoaht3m/DataDogm | cd605e8072cca31e8418830c3300657ae2fa5b16 | [
"Apache-2.0"
] | 200 | 2019-01-26T14:21:35.000Z | 2019-11-01T01:14:36.000Z | from federatedml.util import LOGGER
from federatedml.util import consts
tree_type_dict = {
'guest_feat_only': 0, # use only guest feature to build this tree
'host_feat_only': 1, # use only host feature to build this tree
'normal_tree': 2, # a normal decision tree
'layered_tree': 3 # a layered decis... | 33.175824 | 93 | 0.669427 | from typing import Tuple, List
from federatedml.util import LOGGER
from federatedml.util import consts
tree_type_dict = {
'guest_feat_only': 0, # use only guest feature to build this tree
'host_feat_only': 1, # use only host feature to build this tree
'normal_tree': 2, # a normal decision tree
'laye... | 0 | 0 | 0 | 0 | 0 | 1,190 | 0 | 9 | 114 |
81a1e6387bb41774108992fa75dcb08927ad69a2 | 1,378 | py | Python | sandhill/processors/iiif.py | MSU-Libraries/sandhill | 5e3e12114854620c081d50c77558a38d2411f59d | [
"Apache-2.0"
] | 2 | 2021-04-01T13:22:14.000Z | 2021-04-21T13:06:41.000Z | sandhill/processors/iiif.py | MSU-Libraries/sandhill | 5e3e12114854620c081d50c77558a38d2411f59d | [
"Apache-2.0"
] | null | null | null | sandhill/processors/iiif.py | MSU-Libraries/sandhill | 5e3e12114854620c081d50c77558a38d2411f59d | [
"Apache-2.0"
] | null | null | null | '''
Processor for IIIF
'''
| 37.243243 | 96 | 0.701742 | '''
Processor for IIIF
'''
import os
from requests.exceptions import RequestException
from sandhill import app, catch
from sandhill.utils.api import api_get, establish_url
from sandhill.utils.generic import get_config
from sandhill.utils.error_handling import dp_abort
@catch(RequestException, "Call to IIIF Server fail... | 0 | 1,086 | 0 | 0 | 0 | 0 | 0 | 110 | 155 |
61f4a805105b9085eaa0203b8afa21296ec580e9 | 6,118 | py | Python | ws/ws.py | usc-isi-i2/mydig-webservice | 9628f72fed9f33d0fe341c3d8c3324cb198aae74 | [
"MIT"
] | 2 | 2018-12-19T16:41:50.000Z | 2021-11-11T20:52:25.000Z | ws/ws.py | research-software-company/mydig-webservice | 9628f72fed9f33d0fe341c3d8c3324cb198aae74 | [
"MIT"
] | 55 | 2017-06-09T15:53:56.000Z | 2018-04-16T23:53:30.000Z | ws/ws.py | research-software-company/mydig-webservice | 9628f72fed9f33d0fe341c3d8c3324cb198aae74 | [
"MIT"
] | 12 | 2017-08-06T19:49:44.000Z | 2020-02-16T07:12:09.000Z |
if __name__ == '__main__':
try:
# prerequisites
logger.info('ensure sandpaper is on...')
ensure_sandpaper_is_on()
logger.info('ensure etl engine is on...')
ensure_etl_engine_is_on()
logger.info('ensure kafka is on...')
ensure_kafka_is_on()
logge... | 38.968153 | 115 | 0.576822 | from app_base import *
from app_misc import *
from app_data import *
from app_project import *
from app_tag import *
from app_field import *
from app_table import *
from app_annotation import *
from app_spacy import *
from app_glossary import *
from app_search import *
from app_action import *
def ensure_sandpaper_is... | 0 | 0 | 0 | 0 | 0 | 1,309 | 0 | 31 | 356 |
b203682a8ead5f8440163bbfd8b80b3ff73bc584 | 402 | py | Python | transaction.py | mndarren/Blockchain_Security_Python | 95b5b577d7ec5423bdf15e89853b5edfc844be4e | [
"Apache-2.0"
] | null | null | null | transaction.py | mndarren/Blockchain_Security_Python | 95b5b577d7ec5423bdf15e89853b5edfc844be4e | [
"Apache-2.0"
] | null | null | null | transaction.py | mndarren/Blockchain_Security_Python | 95b5b577d7ec5423bdf15e89853b5edfc844be4e | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
# Created by Darren Zhao Xie on 05/28/2018
# Blockchain example by python
"""
| 22.333333 | 86 | 0.659204 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
# Created by Darren Zhao Xie on 05/28/2018
# Blockchain example by python
"""
from typing import NamedTuple
class Transaction(NamedTuple):
"""Represents an transaction"""
sender: str
receiver: str
amount: float
def __repr__(self) -> str:
... | 0 | 0 | 0 | 216 | 0 | 0 | 0 | 8 | 45 |
569752418b0570841ed37c047c241761232a67ce | 27,616 | py | Python | Dots.py | IoannesBracciano/rpi-dots | d9e449cefdc8ae0f65fad94329ddc5a8f2a05c42 | [
"MIT"
] | 2 | 2017-05-30T16:43:02.000Z | 2017-06-19T13:45:33.000Z | Dots.py | IoannesBracciano/rpi-dots | d9e449cefdc8ae0f65fad94329ddc5a8f2a05c42 | [
"MIT"
] | null | null | null | Dots.py | IoannesBracciano/rpi-dots | d9e449cefdc8ae0f65fad94329ddc5a8f2a05c42 | [
"MIT"
] | null | null | null | # Copyright (c) 2017 Ioannes Bracciano
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, d... | 30.855866 | 80 | 0.700753 | # Copyright (c) 2017 Ioannes Bracciano
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, d... | 0 | 32 | 0 | 19,853 | 0 | 1,489 | 0 | 26 | 421 |
4a5fe4d95cbc06652a3ff1f9bab71b28c28f2cd5 | 539 | py | Python | setup.py | Gabaldonlab/phylome_analysis_giaco | f9e4c3e91fd5cb0a21af81ddf5af0fda69b74d3e | [
"MIT"
] | null | null | null | setup.py | Gabaldonlab/phylome_analysis_giaco | f9e4c3e91fd5cb0a21af81ddf5af0fda69b74d3e | [
"MIT"
] | null | null | null | setup.py | Gabaldonlab/phylome_analysis_giaco | f9e4c3e91fd5cb0a21af81ddf5af0fda69b74d3e | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
with open("README.md") as f:
readme = f.read()
with open("LICENSE.txt") as f:
license = f.read()
setup(
name="analyse_phylome",
version="0.0.1",
description="Analyse phylome data",
long_description=readme,
url="https://github.com/giacomomutti/a... | 23.434783 | 60 | 0.675325 | from setuptools import setup, find_packages
with open("README.md") as f:
readme = f.read()
with open("LICENSE.txt") as f:
license = f.read()
setup(
name="analyse_phylome",
version="0.0.1",
description="Analyse phylome data",
long_description=readme,
url="https://github.com/giacomomutti/a... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
60494ec70ac61aaa99c73260a6d91a6ad74b0da0 | 212 | py | Python | Exercicios/ex002.py | Vitmambro/Python9 | d084e6fd8230b71e4dade87086a411210e131320 | [
"MIT"
] | null | null | null | Exercicios/ex002.py | Vitmambro/Python9 | d084e6fd8230b71e4dade87086a411210e131320 | [
"MIT"
] | null | null | null | Exercicios/ex002.py | Vitmambro/Python9 | d084e6fd8230b71e4dade87086a411210e131320 | [
"MIT"
] | null | null | null | n1 = int(input('Digite um numero: '))
n2 = int(input('Digite outro numero: '))
s = n1 + n2
# print('A soma entre ', n1, ' e ', n2, ' vale {}!'.format(s))
print('A soma entre {} e {} vale {}'.format(n1, n2, s))
| 26.5 | 62 | 0.556604 | n1 = int(input('Digite um numero: '))
n2 = int(input('Digite outro numero: '))
s = n1 + n2
# print('A soma entre ', n1, ' e ', n2, ' vale {}!'.format(s))
print('A soma entre {} e {} vale {}'.format(n1, n2, s))
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b822085f0b5b0b92dd523ad152496d13540a68d4 | 2,311 | py | Python | table_cleaner/email.py | akloster/table-cleaner | 1d84e9828b24b9af165b6a597fd5cdf8a9da1a3c | [
"BSD-2-Clause"
] | null | null | null | table_cleaner/email.py | akloster/table-cleaner | 1d84e9828b24b9af165b6a597fd5cdf8a9da1a3c | [
"BSD-2-Clause"
] | null | null | null | table_cleaner/email.py | akloster/table-cleaner | 1d84e9828b24b9af165b6a597fd5cdf8a9da1a3c | [
"BSD-2-Clause"
] | 1 | 2022-01-28T19:35:01.000Z | 2022-01-28T19:35:01.000Z | from __future__ import unicode_literals
default_user_regex = \
r"(^[-!#$%&'*+/=?^_`{}|~0-9A-Z]+(\.[-!#$%&'*+/=?^_`{}|~0-9A-Z]+)*$" \
r'|^"([\001-\010\013\014\016-\037!#-\[\]-\177]|\\[\001-\011\013\014\016-\177])*"$)'
# max length of the domain is 249: 254 (max email length) minus one
# period, two characters... | 37.274194 | 87 | 0.576807 | from __future__ import unicode_literals
import six
import re
from .validator import Verdict, Validator
from .utils import force_text
default_user_regex = \
r"(^[-!#$%&'*+/=?^_`{}|~0-9A-Z]+(\.[-!#$%&'*+/=?^_`{}|~0-9A-Z]+)*$" \
r'|^"([\001-\010\013\014\016-\037!#-\[\]-\177]|\\[\001-\011\013\014\016-\177])*"$)... | 0 | 0 | 0 | 1,712 | 0 | 0 | 0 | 5 | 113 |
92e00a7a78db3be7a639d8f91b9abc1f12b0a035 | 5,374 | py | Python | scripts/export_tracks.py | Esri/tracker-scripts | 283ff2b65564c9285154889b2aa41d7fc4d3579d | [
"Apache-2.0"
] | 13 | 2020-04-23T07:10:02.000Z | 2021-09-25T02:14:12.000Z | scripts/export_tracks.py | Esri/tracker-scripts | 283ff2b65564c9285154889b2aa41d7fc4d3579d | [
"Apache-2.0"
] | 10 | 2020-03-13T23:59:12.000Z | 2020-05-26T14:46:06.000Z | scripts/export_tracks.py | Esri/tracker-scripts | 283ff2b65564c9285154889b2aa41d7fc4d3579d | [
"Apache-2.0"
] | 3 | 2020-02-14T21:28:19.000Z | 2021-01-31T11:39:15.000Z | """
Copyright 2021 Esri
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, sof... | 46.327586 | 145 | 0.643655 | """
Copyright 2021 Esri
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, sof... | 3 | 0 | 0 | 0 | 0 | 2,057 | 0 | -19 | 111 |
25ed4135c3768d7ca5af614744c369f1547794ea | 2,145 | py | Python | pype/scripts/publish_filesequence.py | tws0002/pype | 80b1aad9990f6c7efabf0430a3da6633054bf4a8 | [
"MIT"
] | null | null | null | pype/scripts/publish_filesequence.py | tws0002/pype | 80b1aad9990f6c7efabf0430a3da6633054bf4a8 | [
"MIT"
] | null | null | null | pype/scripts/publish_filesequence.py | tws0002/pype | 80b1aad9990f6c7efabf0430a3da6633054bf4a8 | [
"MIT"
] | null | null | null | """This module is used for command line publishing of image sequences."""
import logging
handler = logging.basicConfig()
log = logging.getLogger("Publish Image Sequences")
log.setLevel(logging.DEBUG)
error_format = "Failed {plugin.__name__}: {error} -- {error.traceback}"
if __name__ == '__main__':
__main__()
| 30.642857 | 76 | 0.59627 | """This module is used for command line publishing of image sequences."""
import os
import logging
import subprocess
import platform
handler = logging.basicConfig()
log = logging.getLogger("Publish Image Sequences")
log.setLevel(logging.DEBUG)
error_format = "Failed {plugin.__name__}: {error} -- {error.traceback}"
... | 0 | 0 | 0 | 0 | 0 | 1,758 | 0 | -22 | 90 |
fa453a960dfc693f4e09356add89bb5818e60ed0 | 1,849 | py | Python | courses/developingapps/demos/gs2ds/gs2ds.py | pranaynanda/training-data-analyst | f10ab778589129239fd5b277cfdefb41638eded5 | [
"Apache-2.0"
] | null | null | null | courses/developingapps/demos/gs2ds/gs2ds.py | pranaynanda/training-data-analyst | f10ab778589129239fd5b277cfdefb41638eded5 | [
"Apache-2.0"
] | null | null | null | courses/developingapps/demos/gs2ds/gs2ds.py | pranaynanda/training-data-analyst | f10ab778589129239fd5b277cfdefb41638eded5 | [
"Apache-2.0"
] | null | null | null | import apache_beam as beam
from apache_beam.options.pipeline_options import PipelineOptions
from apache_beam.io.gcp.datastore.v1.datastoreio import WriteToDatastore
project = '[GCLOUD_PROJECT]' # Replace [GCLOUD_PROJECT] with project
kind = 'President'
options = PipelineOptions(project=project)
p = beam.Pipeline(opt... | 34.886792 | 85 | 0.697134 | from google.cloud.proto.datastore.v1 import entity_pb2
from google.cloud.proto.datastore.v1 import query_pb2
import googledatastore
import apache_beam as beam
from datetime import datetime
from apache_beam.options.pipeline_options import PipelineOptions
from apache_beam.io.gcp.datastore.v1.datastoreio import ReadFromDa... | 0 | 0 | 0 | 0 | 0 | 859 | 0 | 126 | 133 |
6fdadbe2d1b788b063b75b85051f531dd1ff4a04 | 619 | py | Python | examples/plot_randoms.py | ikamensh/pennpaper | 82c8a7a55a2407ed44d095036ed4ae8f2d004b04 | [
"MIT"
] | 2 | 2019-10-11T16:15:20.000Z | 2019-10-18T18:36:00.000Z | examples/plot_randoms.py | ikamensh/ilya_ezplot | 82c8a7a55a2407ed44d095036ed4ae8f2d004b04 | [
"MIT"
] | 4 | 2019-06-21T13:12:07.000Z | 2019-08-28T12:02:24.000Z | examples/plot_randoms.py | ikamensh/ilya_ezplot | 82c8a7a55a2407ed44d095036ed4ae8f2d004b04 | [
"MIT"
] | 1 | 2020-04-16T08:04:32.000Z | 2020-04-16T08:04:32.000Z | import numpy as np
from pennpaper import Metric, plot_group
xs = np.arange(0.1, 5, step=0.01)
uni_noise = lambda x: np.random.uniform(size=x.shape) + x
funcs = {}
funcs['uniform'] = lambda x: np.random.uniform(size=x.shape) + x
funcs['weibull'] = lambda x: np.random.weibull(a=1, size=x.shape) + x
funcs['beta'] = la... | 25.791667 | 69 | 0.672052 | import numpy as np
from pennpaper import Metric, plot_group
xs = np.arange(0.1, 5, step=0.01)
uni_noise = lambda x: np.random.uniform(size=x.shape) + x
funcs = {}
funcs['uniform'] = lambda x: np.random.uniform(size=x.shape) + x
funcs['weibull'] = lambda x: np.random.weibull(a=1, size=x.shape) + x
funcs['beta'] = la... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
521942a7af6a2dc51f40f0f46d31c90e7919363b | 232 | py | Python | setup.py | truenas/py-sgio | bea8d5e7c4b0cdda4c14c8eacf15e7a73b055641 | [
"BSD-3-Clause"
] | 1 | 2021-04-02T20:01:16.000Z | 2021-04-02T20:01:16.000Z | setup.py | truenas/py-sgio | bea8d5e7c4b0cdda4c14c8eacf15e7a73b055641 | [
"BSD-3-Clause"
] | null | null | null | setup.py | truenas/py-sgio | bea8d5e7c4b0cdda4c14c8eacf15e7a73b055641 | [
"BSD-3-Clause"
] | null | null | null | from setuptools import setup
from Cython.Build import cythonize
setup(
name='libsgio',
version='0.0.4',
setup_requires=[
'setuptools>=45.0',
'Cython',
],
ext_modules = cythonize('libsgio.pyx')
)
| 17.846154 | 42 | 0.62069 | from setuptools import setup
from Cython.Build import cythonize
setup(
name='libsgio',
version='0.0.4',
setup_requires=[
'setuptools>=45.0',
'Cython',
],
ext_modules = cythonize('libsgio.pyx')
)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
736a754fef84046212f8fa08c8b9e5813900288a | 2,921 | py | Python | src/test/system/bq_to_ga_dag_system_test.py | phbaudin/TaglessCRM | bed8b75cbb4585d5a50c9cefba015fe99d61cf61 | [
"Apache-2.0"
] | null | null | null | src/test/system/bq_to_ga_dag_system_test.py | phbaudin/TaglessCRM | bed8b75cbb4585d5a50c9cefba015fe99d61cf61 | [
"Apache-2.0"
] | 1 | 2021-06-18T15:07:27.000Z | 2021-06-18T15:07:27.000Z | src/test/system/bq_to_ga_dag_system_test.py | phbaudin/TaglessCRM | bed8b75cbb4585d5a50c9cefba015fe99d61cf61 | [
"Apache-2.0"
] | null | null | null | # python3
# coding=utf-8
# Copyright 2020 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 32.098901 | 77 | 0.779528 | # python3
# coding=utf-8
# Copyright 2020 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 0 | 1,691 | 0 | 0 | 0 | 0 | 0 | 29 | 159 |
32fed1754f2a7605c0516e7fa6e08e502dc6b653 | 1,095 | py | Python | code/scripts/trianglize_tree.py | YimengYang/wol | 0b6aab725e9ffebe3b84330455fd10f21818265a | [
"BSD-3-Clause"
] | null | null | null | code/scripts/trianglize_tree.py | YimengYang/wol | 0b6aab725e9ffebe3b84330455fd10f21818265a | [
"BSD-3-Clause"
] | 5 | 2019-04-06T19:36:01.000Z | 2019-04-17T07:55:18.000Z | code/scripts/trianglize_tree.py | YimengYang/wol | 0b6aab725e9ffebe3b84330455fd10f21818265a | [
"BSD-3-Clause"
] | 4 | 2019-03-29T17:03:37.000Z | 2019-04-11T21:35:20.000Z | #!/usr/bin/env python3
"""Re-arrange tree so that the two basal clades are in increasing and
decreasing node order, respectively. If the input tree is already midpoint-
rooted, the output tree will shape like a triangle.
Usage:
trianglize_tree.py input.nwk > output.nwk
"""
if __name__ == '__main__':
main()
| 27.375 | 75 | 0.571689 | #!/usr/bin/env python3
"""Re-arrange tree so that the two basal clades are in increasing and
decreasing node order, respectively. If the input tree is already midpoint-
rooted, the output tree will shape like a triangle.
Usage:
trianglize_tree.py input.nwk > output.nwk
"""
import sys
import fileinput
from skbio i... | 0 | 0 | 0 | 0 | 0 | 696 | 0 | -11 | 90 |
784e0ab99cc88024a8ede750cd2a3b28982446c6 | 710 | py | Python | app/models/__init__.py | shenhaizhumin/fastapi-demo | bce6ec556b1058f3b213e2698075d72033c2162d | [
"Apache-2.0"
] | null | null | null | app/models/__init__.py | shenhaizhumin/fastapi-demo | bce6ec556b1058f3b213e2698075d72033c2162d | [
"Apache-2.0"
] | null | null | null | app/models/__init__.py | shenhaizhumin/fastapi-demo | bce6ec556b1058f3b213e2698075d72033c2162d | [
"Apache-2.0"
] | null | null | null | from sqlalchemy import create_engine, MetaData
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
# from app.settings import test_db
from app.settings import setting
# db_url = conf.get('db.url', 'pg_url')
# uri = f"postgresql://{test_db['user']}:{test_db['password']}@{test... | 26.296296 | 121 | 0.719718 | from sqlalchemy import create_engine, MetaData
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
# from app.settings import test_db
from app.settings import setting
# db_url = conf.get('db.url', 'pg_url')
# uri = f"postgresql://{test_db['user']}:{test_db['password']}@{test... | 6 | 0 | 0 | 0 | 88 | 0 | 0 | 0 | 23 |
be0e1cd297865811d2a836af6b99a1e31d5b79f9 | 2,485 | py | Python | src/dataflow/unified-computing/python/bkbase/dataflow/batch/tests/test_batch_utils.py | Chromico/bk-base | be822d9bbee544a958bed4831348185a75604791 | [
"MIT"
] | 84 | 2021-06-30T06:20:23.000Z | 2022-03-22T03:05:49.000Z | src/dataflow/unified-computing/python/bkbase/dataflow/batch/tests/test_batch_utils.py | Chromico/bk-base | be822d9bbee544a958bed4831348185a75604791 | [
"MIT"
] | 7 | 2021-06-30T06:21:16.000Z | 2022-03-29T07:36:13.000Z | src/dataflow/unified-computing/python/bkbase/dataflow/batch/tests/test_batch_utils.py | Chromico/bk-base | be822d9bbee544a958bed4831348185a75604791 | [
"MIT"
] | 40 | 2021-06-30T06:21:26.000Z | 2022-03-29T12:42:26.000Z | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making BK-BASE available.
Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
BK-BASE is licensed under the MIT License.
License for BK-BASE :
------------------------------------------------------------... | 46.018519 | 111 | 0.704628 | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making BK-BASE 蓝鲸基础平台 available.
Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
BK-BASE 蓝鲸基础平台 is licensed under the MIT License.
License for BK-BASE 蓝鲸基础平台:
------------------------------------------... | 54 | 0 | 0 | 884 | 0 | 0 | 0 | 159 | 67 |
2bb6ec48c8b9eb653dae0432cfdc52b4c6854c7e | 530 | py | Python | Convolucion_1.py | oartz77/Convolucion | 2790972c7252f73a30310b6cdacc48f9d0089813 | [
"Unlicense"
] | null | null | null | Convolucion_1.py | oartz77/Convolucion | 2790972c7252f73a30310b6cdacc48f9d0089813 | [
"Unlicense"
] | null | null | null | Convolucion_1.py | oartz77/Convolucion | 2790972c7252f73a30310b6cdacc48f9d0089813 | [
"Unlicense"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
from scipy.io.wavfile import write
import wave
file = wave.open('Still.wav')
audio = file.readframes(-1)
audio = np.frombuffer (audio, dtype=np.int16)
#plt.plot(audio)
#plt.title("Still")
#plt.show()
alfa = np.array([1.,0.,0.,0])
audio_modificado = np.... | 22.083333 | 55 | 0.718868 | import numpy as np
import matplotlib.pyplot as plt
from scipy.io.wavfile import write
import wave
file = wave.open('Still.wav')
audio = file.readframes(-1)
audio = np.frombuffer (audio, dtype=np.int16)
#plt.plot(audio)
#plt.title("Still")
#plt.show()
alfa = np.array([1.,0.,0.,0])
audio_modificado = np.... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
89fe87bba7d13c2a159a98e09f756317f5955a27 | 780 | py | Python | 0701-0750/0717-1BitAnd2BitCharacters/1BitAnd2BitCharacters.py | Sun-Zhen/leetcode | 57fe0de95881255393e0d6817e75bfae8f5744dc | [
"Apache-2.0"
] | 3 | 2018-04-12T05:13:52.000Z | 2018-04-15T05:11:51.000Z | 0701-0750/0717-1BitAnd2BitCharacters/1BitAnd2BitCharacters.py | Sun-Zhen/leetcode | 57fe0de95881255393e0d6817e75bfae8f5744dc | [
"Apache-2.0"
] | null | null | null | 0701-0750/0717-1BitAnd2BitCharacters/1BitAnd2BitCharacters.py | Sun-Zhen/leetcode | 57fe0de95881255393e0d6817e75bfae8f5744dc | [
"Apache-2.0"
] | null | null | null | # -*- coding:utf-8 -*-
"""
@author: Alden
@email: sunzhenhy@gmail.com
@date: 2018/3/31
@version: 1.0.0.0
"""
if __name__ == "__main__":
s = Solution()
print s.isOneBitCharacter([1, 0, 0])
print s.isOneBitCharacter([1, 1, 1, 0])
print s.isOneBitCharacter([0, 1, 0])
| 22.285714 | 55 | 0.496154 | # -*- coding:utf-8 -*-
"""
@author: Alden
@email: sunzhenhy@gmail.com
@date: 2018/3/31
@version: 1.0.0.0
"""
class Solution(object):
def isOneBitCharacter(self, bits):
"""
:type bits: List[int]
:rtype: bool
"""
if len(bits) == 1:
return True
elif len(bit... | 0 | 0 | 0 | 473 | 0 | 0 | 0 | 0 | 23 |
7ccb811b4a8f31ecb6d0624eea30860fb0826b77 | 290,387 | py | Python | python/phonenumbers/carrierdata/data2.py | adamchainz/python-phonenumbers | f08189b49060394212aad01b3df7481f591fb0e0 | [
"Apache-2.0"
] | null | null | null | python/phonenumbers/carrierdata/data2.py | adamchainz/python-phonenumbers | f08189b49060394212aad01b3df7481f591fb0e0 | [
"Apache-2.0"
] | null | null | null | python/phonenumbers/carrierdata/data2.py | adamchainz/python-phonenumbers | f08189b49060394212aad01b3df7481f591fb0e0 | [
"Apache-2.0"
] | 1 | 2018-10-24T20:48:56.000Z | 2018-10-24T20:48:56.000Z | """Per-prefix data, mapping each prefix to a dict of locale:name.
Auto-generated file, do not edit by hand.
"""
from ..util import u
# Copyright (C) 2011-2020 The Libphonenumber Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Licens... | 37.181434 | 278 | 0.537676 | """Per-prefix data, mapping each prefix to a dict of locale:name.
Auto-generated file, do not edit by hand.
"""
from ..util import u
# Copyright (C) 2011-2020 The Libphonenumber Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Licens... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4051383fb728bf84a7c454bcf55b75053d336ff1 | 2,527 | py | Python | app/__init__.py | trongdth/python-flask | a9db95a93d828e984399dc40735fe9db9aea974c | [
"MIT"
] | null | null | null | app/__init__.py | trongdth/python-flask | a9db95a93d828e984399dc40735fe9db9aea974c | [
"MIT"
] | 3 | 2021-06-08T21:35:53.000Z | 2022-03-12T00:02:30.000Z | app/__init__.py | trongdth/python-flask | a9db95a93d828e984399dc40735fe9db9aea974c | [
"MIT"
] | null | null | null | from flask import Flask
from app.core import db, jwt, configure_app
from app.routes import init_routes
import logging, logging.config, yaml
app = Flask(__name__)
logging.config.dictConfig(yaml.load(open('logging.conf')))
logfile = logging.getLogger('file')
# add json encoder for decimal type
app.json_encoder = MyJS... | 23.839623 | 63 | 0.771666 | from flask import Flask, g, redirect, request
from app.core import db, jwt, configure_app
from flask_cors import CORS
from app.models import *
from app.helpers.response import response_error
from app.routes import init_routes
from datetime import datetime
import time
import decimal
import flask.json
import logging, lo... | 0 | 409 | 0 | 238 | 0 | 224 | 0 | 44 | 339 |
56f27255fdb7823ba57fadc3321b77932fde0291 | 96 | py | Python | vedastr/models/bodies/registry.py | csmasters/vedastr | 7513384ab503f15dc574c7d92b75ff2092354757 | [
"Apache-2.0"
] | 475 | 2020-03-17T01:46:32.000Z | 2022-03-29T23:30:15.000Z | vedastr/models/bodies/registry.py | csmasters/vedastr | 7513384ab503f15dc574c7d92b75ff2092354757 | [
"Apache-2.0"
] | 71 | 2020-04-01T04:17:47.000Z | 2021-11-18T06:55:14.000Z | vedastr/models/bodies/registry.py | csmasters/vedastr | 7513384ab503f15dc574c7d92b75ff2092354757 | [
"Apache-2.0"
] | 108 | 2020-02-21T10:30:37.000Z | 2022-03-21T12:03:30.000Z | from vedastr.utils import Registry
COMPONENT = Registry('component')
BODIES = Registry('body')
| 19.2 | 34 | 0.770833 | from vedastr.utils import Registry
COMPONENT = Registry('component')
BODIES = Registry('body')
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
56c00cf8794286d9733a104fc6a4d9294afff3fa | 285 | py | Python | script/reset_db.py | OpenASL/HowSignBot | bd9c5bc0edfd6fb50bdce7c7c1d84462e1e704c2 | [
"MIT"
] | 9 | 2021-01-12T07:28:30.000Z | 2021-12-30T09:27:04.000Z | script/reset_db.py | OpenASL/HowSignBot | bd9c5bc0edfd6fb50bdce7c7c1d84462e1e704c2 | [
"MIT"
] | 16 | 2021-03-28T16:31:42.000Z | 2022-03-21T00:18:30.000Z | script/reset_db.py | OpenASL/HowSignBot | bd9c5bc0edfd6fb50bdce7c7c1d84462e1e704c2 | [
"MIT"
] | 1 | 2021-07-18T20:49:19.000Z | 2021-07-18T20:49:19.000Z | #!/usr/bin/env python3
if __name__ == "__main__":
main()
| 19 | 47 | 0.77193 | #!/usr/bin/env python3
from sqlalchemy_utils import create_database
from sqlalchemy_utils import drop_database
from bot import settings
def main():
drop_database(str(settings.DATABASE_URL))
create_database(str(settings.DATABASE_URL))
if __name__ == "__main__":
main()
| 0 | 0 | 0 | 0 | 0 | 84 | 0 | 47 | 90 |
8304d39f3bdfba7a3f70577dfcc61b8c4afff756 | 5,051 | py | Python | utility/codesize.py | ririripley/recipes | 04267c68a7424326b4aa8dd14b1a879b59ab887c | [
"BSD-3-Clause"
] | 1,418 | 2015-01-07T09:40:09.000Z | 2022-03-29T08:37:02.000Z | utility/codesize.py | ririripley/recipes | 04267c68a7424326b4aa8dd14b1a879b59ab887c | [
"BSD-3-Clause"
] | 22 | 2015-02-17T17:31:18.000Z | 2022-02-08T07:00:29.000Z | utility/codesize.py | ririripley/recipes | 04267c68a7424326b4aa8dd14b1a879b59ab887c | [
"BSD-3-Clause"
] | 854 | 2015-01-03T11:56:10.000Z | 2022-03-31T08:50:28.000Z | #!/usr/bin/env python3
import collections, sys
SOURCE_EXTS = set([".cc", ".c", ".h", ".S"])
sizes = collections.defaultdict(CodeSize)
if __name__ == '__main__':
main(sys.argv)
| 28.376404 | 115 | 0.528014 | #!/usr/bin/env python3
import collections, os, sys
SOURCE_EXTS = set([".cc", ".c", ".h", ".S"])
class CodeSize:
def __init__(self):
self.self_bytes = 0
self.self_lines = 0
self.self_files = 0
self.all_bytes = 0
self.all_lines = 0
self.all_files = 0
def __repr_... | 0 | 0 | 0 | 1,776 | 0 | 2,972 | 0 | 4 | 115 |
f8e3bed91090867b662bda73d2bdf12c2610ead3 | 8,806 | py | Python | CDRIB/model/VBGE.py | cjx96/CDRIB | e0d2d2b70ec195a76b479b94fb7758d286350c39 | [
"MIT"
] | 1 | 2022-03-26T06:40:50.000Z | 2022-03-26T06:40:50.000Z | CDRIB/model/VBGE.py | cjx96/CDRIB | e0d2d2b70ec195a76b479b94fb7758d286350c39 | [
"MIT"
] | null | null | null | CDRIB/model/VBGE.py | cjx96/CDRIB | e0d2d2b70ec195a76b479b94fb7758d286350c39 | [
"MIT"
] | null | null | null | import torch.nn as nn
| 36.090164 | 103 | 0.59891 | import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import math
from model.GCN import GCN
from model.GCN import VGAE
from torch.autograd import Variable
from torch.distributions.kl import kl_divergence
from torch.distributions import Normal
class VBGE(nn.Module):
"""
VBGE... | 0 | 0 | 0 | 8,459 | 0 | 0 | 0 | 55 | 267 |
2bd68b7bb32c4be64d97a26f8981b5433db648b4 | 79 | py | Python | scripts/hoi4/hoi4/__init__.py | SaucyPigeon/pyradox | a500a5628f57e056fa019ba1e114118abe6dc205 | [
"MIT"
] | null | null | null | scripts/hoi4/hoi4/__init__.py | SaucyPigeon/pyradox | a500a5628f57e056fa019ba1e114118abe6dc205 | [
"MIT"
] | null | null | null | scripts/hoi4/hoi4/__init__.py | SaucyPigeon/pyradox | a500a5628f57e056fa019ba1e114118abe6dc205 | [
"MIT"
] | null | null | null | import sys
sys.path.append("../..")
import hoi4.load
| 15.8 | 25 | 0.696203 | import sys
sys.path.append("../..")
import hoi4.load
import hoi4.unitstats | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 22 |
3d03bc8b133d53a50b43198e8521f1e48a2190f0 | 25 | py | Python | htcanalyze/__init__.py | TobiasKadelka/HTCAnalyze-1 | af451f46fb68b5f75d4a3a713d368cb8ee9157ee | [
"MIT"
] | null | null | null | htcanalyze/__init__.py | TobiasKadelka/HTCAnalyze-1 | af451f46fb68b5f75d4a3a713d368cb8ee9157ee | [
"MIT"
] | null | null | null | htcanalyze/__init__.py | TobiasKadelka/HTCAnalyze-1 | af451f46fb68b5f75d4a3a713d368cb8ee9157ee | [
"MIT"
] | 1 | 2020-10-22T15:19:09.000Z | 2020-10-22T15:19:09.000Z | """htcanalyze module."""
| 12.5 | 24 | 0.64 | """htcanalyze module."""
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
dcac78a858af9db900a60d0ba037f0fe75b432a2 | 2,185 | py | Python | visualize/plot_gate_vals.py | yttdebaba2/meta-learning-lstm | cdb6a53f4dd6688ceadc365ebe5b959367ca6dab | [
"MIT"
] | 349 | 2017-01-23T10:50:53.000Z | 2021-10-17T12:23:27.000Z | visualize/plot_gate_vals.py | chengbaitai/meta-learning-lstm | 0cffa2481619ce643d0951bd637bf05b23ef827a | [
"MIT"
] | 11 | 2017-04-16T06:22:22.000Z | 2021-09-12T08:46:58.000Z | visualize/plot_gate_vals.py | chengbaitai/meta-learning-lstm | 0cffa2481619ce643d0951bd637bf05b23ef827a | [
"MIT"
] | 164 | 2017-04-07T08:38:06.000Z | 2021-10-17T13:39:14.000Z | import math as math
import matplotlib.pyplot as plt
import numpy as np
import sys
import torchfile
from matplotlib.ticker import MaxNLocator
if __name__ == '__main__':
fileName = sys.argv[1]
nExamples = 20
data = torchfile.load(fileName)
mean = data[0]
stdv = data[1]
examples = []
for i in ra... | 27.658228 | 79 | 0.562929 | import math as math
import matplotlib.pyplot as plt
import numpy as np
import sys
import torchfile
from matplotlib.ticker import MaxNLocator
if __name__ == '__main__':
fileName = sys.argv[1]
nExamples = 20
data = torchfile.load(fileName)
mean = data[0]
stdv = data[1]
examples = []
for i in ra... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |