hexsha stringlengths 40 40 | size int64 5 2.06M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 248 | max_stars_repo_name stringlengths 5 125 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 248 | max_issues_repo_name stringlengths 5 125 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 248 | max_forks_repo_name stringlengths 5 125 | 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 5 2.06M | avg_line_length float64 1 1.02M | max_line_length int64 3 1.03M | alphanum_fraction float64 0 1 | count_classes int64 0 1.6M | score_classes float64 0 1 | count_generators int64 0 651k | score_generators float64 0 1 | count_decorators int64 0 990k | score_decorators float64 0 1 | count_async_functions int64 0 235k | score_async_functions float64 0 1 | count_documentation int64 0 1.04M | score_documentation float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3a79851a367aea689a1293265d02727ae30bb330 | 7,877 | py | Python | cvstudio/view/widgets/common/treeview_model.py | haruiz/PytorchCvStudio | ccf79dd0cc0d61f3fd01b1b5d96f7cda7b681eef | [
"MIT"
] | 32 | 2019-10-31T03:10:52.000Z | 2020-12-23T11:50:53.000Z | cvstudio/view/widgets/common/treeview_model.py | haruiz/CvStudio | ccf79dd0cc0d61f3fd01b1b5d96f7cda7b681eef | [
"MIT"
] | 19 | 2019-10-31T15:06:05.000Z | 2020-06-15T02:21:55.000Z | cvstudio/view/widgets/common/treeview_model.py | haruiz/PytorchCvStudio | ccf79dd0cc0d61f3fd01b1b5d96f7cda7b681eef | [
"MIT"
] | 8 | 2019-10-31T03:32:50.000Z | 2020-07-17T20:47:37.000Z | import itertools
import typing
from typing import Any
from PyQt5 import QtCore
from PyQt5.QtCore import QModelIndex, pyqtSignal, QObject
from PyQt5.QtGui import QColor
from PyQt5.QtWidgets import QAbstractItemDelegate, QWidget, QStyleOptionViewItem, QSpinBox
class CustomNode(object):
def __init__(self, data=None... | 30.296154 | 116 | 0.612416 | 7,605 | 0.965469 | 0 | 0 | 1,300 | 0.165037 | 0 | 0 | 209 | 0.026533 |
3a7af5581758219d8326f2091b7b6047cf305d66 | 1,761 | py | Python | pyrallel/tests/test_map_reduce.py | usc-isi-i2/paralyzer | 2991e9e74f17e35d8c7d9f86d57c5c7f7a311915 | [
"MIT"
] | 13 | 2019-07-02T22:41:46.000Z | 2022-02-20T13:30:00.000Z | pyrallel/tests/test_map_reduce.py | usc-isi-i2/paralyzer | 2991e9e74f17e35d8c7d9f86d57c5c7f7a311915 | [
"MIT"
] | 14 | 2019-07-03T18:04:25.000Z | 2021-05-20T20:45:33.000Z | pyrallel/tests/test_map_reduce.py | usc-isi-i2/paralyzer | 2991e9e74f17e35d8c7d9f86d57c5c7f7a311915 | [
"MIT"
] | 3 | 2020-02-12T21:54:17.000Z | 2020-08-24T20:41:18.000Z | import multiprocessing as mp
from pyrallel.map_reduce import MapReduce
NUM_OF_PROCESSOR = max(2, int(mp.cpu_count() / 2))
def test_map_reduce_number():
def mapper(x):
return x
def reducer(r1, r2):
return r1 + r2
mr = MapReduce(3, mapper, reducer)
mr.start()
mr.add_task(1)
... | 21.216867 | 53 | 0.540034 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 24 | 0.013629 |
3a7bafa3c7ab3354d60a1fcd0376c7ade47cb21d | 707 | py | Python | evtx_to_dataframe.py | esua/evtx_to_dataframe | 390bf470e92092e66827373ed7e8b012a4fe94f6 | [
"Apache-2.0"
] | null | null | null | evtx_to_dataframe.py | esua/evtx_to_dataframe | 390bf470e92092e66827373ed7e8b012a4fe94f6 | [
"Apache-2.0"
] | null | null | null | evtx_to_dataframe.py | esua/evtx_to_dataframe | 390bf470e92092e66827373ed7e8b012a4fe94f6 | [
"Apache-2.0"
] | null | null | null | import argparse
import Evtx.Evtx as evtx
import pandas as pd
import xmltodict
import re
parser = argparse.ArgumentParser(description="Convert Windows EVTX event log file to DataFrame.")
parser.add_argument("evtx", type=str, help="Path to the Windows EVTX event log file")
args = parser.parse_args()
with evtx.Evtx(args... | 33.666667 | 110 | 0.693069 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 226 | 0.319661 |
3a7bc36048999e619539f1b4ea6519f544722e26 | 562 | py | Python | test/sandwich.py | DynamicCai/Dynamic-Explorer | c909206b3db52f76f23499b1cb43520d3475b14e | [
"MIT"
] | null | null | null | test/sandwich.py | DynamicCai/Dynamic-Explorer | c909206b3db52f76f23499b1cb43520d3475b14e | [
"MIT"
] | null | null | null | test/sandwich.py | DynamicCai/Dynamic-Explorer | c909206b3db52f76f23499b1cb43520d3475b14e | [
"MIT"
] | null | null | null |
sandwich_meat={
1:{'chicken':3},
2:{'beef':5},
3:{'pork':4},
4:{'bacon':4},
5:{'sausage':4},
6:{'omelette':2},
7:{'none':0}
}
sandwich_sauce=['mayonnaise','ketchup','yellow mustard','black pepper sauce','cheese','none']
sandwich_vegetable=['lettuce','sliced tomatoes','sliced pickles','... | 18.733333 | 101 | 0.565836 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 299 | 0.522727 |
3a7c85d6a1879df3d91cd853104103d5c1ce8afa | 1,553 | py | Python | paprotka/feature/cepstral.py | michalsosn/paprotka | d6079eefbade2cb8be5896777a7d50ac968d42ec | [
"MIT"
] | 1 | 2019-10-29T04:14:40.000Z | 2019-10-29T04:14:40.000Z | paprotka/feature/cepstral.py | michalsosn/paprotka | d6079eefbade2cb8be5896777a7d50ac968d42ec | [
"MIT"
] | null | null | null | paprotka/feature/cepstral.py | michalsosn/paprotka | d6079eefbade2cb8be5896777a7d50ac968d42ec | [
"MIT"
] | null | null | null | import math
import numpy as np
from scipy import signal, fftpack
def pre_emphasize(data, pre_emphasis=0.97):
return np.append(data[0], data[1:] - pre_emphasis * data[:-1])
def hz_to_mel(hz):
return 2595 * math.log10(1 + hz / 700)
def mel_to_hz(mel):
return 700 * (10 ** (mel / 2595) - 1)
def make_mel... | 33.042553 | 90 | 0.675467 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 | 0.004507 |
3a7d8a539d82fbecac85da845cd748fe400b1a12 | 2,688 | py | Python | arelle/plugin/unpackSecEisFile.py | DataFinnovation/Arelle | d4bf45f56fc9249f75ab22e6217dbe55f0510841 | [
"Apache-2.0"
] | 292 | 2015-01-27T03:31:51.000Z | 2022-03-26T07:00:05.000Z | arelle/plugin/unpackSecEisFile.py | DataFinnovation/Arelle | d4bf45f56fc9249f75ab22e6217dbe55f0510841 | [
"Apache-2.0"
] | 94 | 2015-04-18T23:03:00.000Z | 2022-03-28T17:24:55.000Z | arelle/plugin/unpackSecEisFile.py | DataFinnovation/Arelle | d4bf45f56fc9249f75ab22e6217dbe55f0510841 | [
"Apache-2.0"
] | 200 | 2015-01-13T03:55:47.000Z | 2022-03-29T12:38:56.000Z | '''
Unpack SEC EIS File is an example of a plug-in to the GUI menu
that will save the unpacked contents of an SEC EIS File in a directory.
(c) Copyright 2012 Mark V Systems Limited, All rights reserved.
'''
def unpackEIS(cntlr, eisFile, unpackToDir):
from arelle.FileSource import openFileSource
filesource = ... | 43.354839 | 134 | 0.604911 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 907 | 0.337426 |
3a7e02c43c6ebf2859a5eb96f826707b1b0a7b33 | 2,251 | py | Python | fpcalc.py | johnlawsharrison/pyacoustid | 55321b316f09e782a1c0914826419be799908e01 | [
"MIT"
] | 203 | 2016-01-18T14:05:49.000Z | 2022-03-25T04:04:42.000Z | fpcalc.py | johnlawsharrison/pyacoustid | 55321b316f09e782a1c0914826419be799908e01 | [
"MIT"
] | 41 | 2016-03-08T10:28:14.000Z | 2021-11-26T20:53:15.000Z | fpcalc.py | johnlawsharrison/pyacoustid | 55321b316f09e782a1c0914826419be799908e01 | [
"MIT"
] | 56 | 2016-01-09T04:22:40.000Z | 2022-01-29T16:01:39.000Z | #!/usr/bin/env python
# This file is part of pyacoustid.
# Copyright 2012, Lukas Lalinsky.
#
# 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 limitati... | 34.106061 | 77 | 0.660595 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,140 | 0.506442 |
3a7e4975152b719956030d04fd87b6aff71f9b39 | 203 | py | Python | app/views/dashboard/leadership/__init__.py | Wern-rm/raton.by | 68f862f2bc0551bf2327e9d6352c0cde93f45301 | [
"MIT"
] | null | null | null | app/views/dashboard/leadership/__init__.py | Wern-rm/raton.by | 68f862f2bc0551bf2327e9d6352c0cde93f45301 | [
"MIT"
] | null | null | null | app/views/dashboard/leadership/__init__.py | Wern-rm/raton.by | 68f862f2bc0551bf2327e9d6352c0cde93f45301 | [
"MIT"
] | null | null | null | from app.views.dashboard.leadership.index import leaderships
from app.views.dashboard.leadership.delete import leadership_delete
from app.views.dashboard.leadership.activation import leadership_activated | 67.666667 | 74 | 0.8867 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
3a7ec9858eb7869bba6e4129ded3a123b302b0e2 | 3,071 | py | Python | Learning/button groups.py | atharva0300/PyQt5-Practice | 0feacca6518190646a345ce2ea75e071e7861ac5 | [
"MIT"
] | null | null | null | Learning/button groups.py | atharva0300/PyQt5-Practice | 0feacca6518190646a345ce2ea75e071e7861ac5 | [
"MIT"
] | null | null | null | Learning/button groups.py | atharva0300/PyQt5-Practice | 0feacca6518190646a345ce2ea75e071e7861ac5 | [
"MIT"
] | 1 | 2021-11-16T10:18:07.000Z | 2021-11-16T10:18:07.000Z | # Button Groups in Python
import PyQt5
from PyQt5.QtWidgets import QApplication, QHBoxLayout, QLabel, QButtonGroup, QMainWindow, QDialog, QPushButton, QVBoxLayout
import sys
from PyQt5 import QtGui
from PyQt5.QtGui import QFont, QPixmap
from PyQt5.QtCore import QSize
class window(QDialog):
def __init__(... | 28.700935 | 124 | 0.581895 | 2,673 | 0.870401 | 0 | 0 | 0 | 0 | 0 | 0 | 774 | 0.252035 |
3a7f65074a8ce42ce2f4be7f8b8b5034567b834f | 20,126 | py | Python | ct-tests/lib/crus_integration_test.py | Cray-HPE/cray-crus | 6643aa3eb3debe5cbe0088f6a30b7e56ca1b1f17 | [
"MIT"
] | null | null | null | ct-tests/lib/crus_integration_test.py | Cray-HPE/cray-crus | 6643aa3eb3debe5cbe0088f6a30b7e56ca1b1f17 | [
"MIT"
] | 1 | 2022-03-02T21:06:21.000Z | 2022-03-04T17:32:14.000Z | ct-tests/lib/crus_integration_test.py | Cray-HPE/cray-crus | 6643aa3eb3debe5cbe0088f6a30b7e56ca1b1f17 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
#
# MIT License
#
# (C) Copyright 2020-2022 Hewlett Packard Enterprise Development LP
#
# 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 w... | 45.226966 | 138 | 0.673507 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 8,083 | 0.40162 |
3a80351f1ae9d22c12f2dfa0609670916e8b44d0 | 3,071 | py | Python | backend/transaction/models.py | elielagmay/react-budgeteer | 49a25dbd6dd6ea5d8bc93421eefbc12808f585af | [
"Unlicense"
] | 2 | 2018-10-23T00:40:53.000Z | 2021-05-31T08:19:40.000Z | backend/transaction/models.py | elielagmay/react-budgeteer | 49a25dbd6dd6ea5d8bc93421eefbc12808f585af | [
"Unlicense"
] | null | null | null | backend/transaction/models.py | elielagmay/react-budgeteer | 49a25dbd6dd6ea5d8bc93421eefbc12808f585af | [
"Unlicense"
] | null | null | null | from decimal import Decimal
from django.core.exceptions import ValidationError
from django.db import models
from app.utils import get_balances
class Transaction(models.Model):
ledger = models.ForeignKey(
'ledger.Ledger',
on_delete=models.PROTECT,
related_name='transactions'
)
date ... | 29.528846 | 75 | 0.626506 | 2,922 | 0.951482 | 0 | 0 | 0 | 0 | 0 | 0 | 409 | 0.133181 |
3a804a776b085e92ef90bbf2391ea52e871ea437 | 2,335 | py | Python | src/games/textquiz.py | aleksandrgordienko/melissa-quiz | 49b165acc9aae0ad84cf751cbeb4f6a27dd5ab0f | [
"MIT"
] | null | null | null | src/games/textquiz.py | aleksandrgordienko/melissa-quiz | 49b165acc9aae0ad84cf751cbeb4f6a27dd5ab0f | [
"MIT"
] | null | null | null | src/games/textquiz.py | aleksandrgordienko/melissa-quiz | 49b165acc9aae0ad84cf751cbeb4f6a27dd5ab0f | [
"MIT"
] | null | null | null | # python-telegram-quiz
# @author: Aleksandr Gordienko
# @site: https://github.com/aleksandrgordienko/melissa-quiz
from random import randint
from sqlalchemy import Column, Integer, String
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
class Question(Base):
__tablename__ = 'qu... | 33.357143 | 81 | 0.621842 | 2,056 | 0.880514 | 0 | 0 | 0 | 0 | 0 | 0 | 318 | 0.136188 |
3a818c77d8d52a71bd103be2681594c2e4e919a8 | 1,246 | py | Python | Automate the Boring Stuff with Python/readDocx.py | m-barnes/Python | 0940d5f9b832c28703a32691db287b1361ce6ecc | [
"MIT"
] | null | null | null | Automate the Boring Stuff with Python/readDocx.py | m-barnes/Python | 0940d5f9b832c28703a32691db287b1361ce6ecc | [
"MIT"
] | null | null | null | Automate the Boring Stuff with Python/readDocx.py | m-barnes/Python | 0940d5f9b832c28703a32691db287b1361ce6ecc | [
"MIT"
] | null | null | null | import docx
import time
import os
from os import system
from pprint import pprint
finished = False
def getText(filename):
print(filename)
doc = docx.Document(filename)
fullText = []
for para in doc.paragraphs:
fullText.append(para.text)
pprint(fullText)
def clear():
try:
system('cls')
except:
system('... | 20.766667 | 139 | 0.652488 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 402 | 0.322632 |
3a83a000f0a9ae9cf8e818fa8a8f6b2e52f61077 | 2,014 | py | Python | Leetcode/Python/_1207.py | Xrenya/algorithms | aded82cacde2f4f2114241907861251e0e2e5638 | [
"MIT"
] | 1 | 2021-11-28T15:03:32.000Z | 2021-11-28T15:03:32.000Z | Leetcode/Python/_1207.py | Xrenya/algorithms | aded82cacde2f4f2114241907861251e0e2e5638 | [
"MIT"
] | null | null | null | Leetcode/Python/_1207.py | Xrenya/algorithms | aded82cacde2f4f2114241907861251e0e2e5638 | [
"MIT"
] | null | null | null | class Solution:
def uniqueOccurrences(self, arr: List[int]) -> bool:
hashMap = {}
for num in arr:
if num not in hashMap:
hashMap[num] = 1
else:
hashMap[num] += 1
array = hashMap.values()
unique = {}
for num in array:
... | 27.589041 | 57 | 0.456802 | 1,991 | 0.98858 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
3a84202d32e5e1c571adc31fc572e8596c4a5a08 | 87 | py | Python | rura/pipeline/__init__.py | fdabek1/rura | 6779733149d7e4181be54ecb72fbd4de6d71c678 | [
"MIT"
] | null | null | null | rura/pipeline/__init__.py | fdabek1/rura | 6779733149d7e4181be54ecb72fbd4de6d71c678 | [
"MIT"
] | null | null | null | rura/pipeline/__init__.py | fdabek1/rura | 6779733149d7e4181be54ecb72fbd4de6d71c678 | [
"MIT"
] | null | null | null | from .dataset import Dataset
from .model import Model
from .transform import Transform
| 21.75 | 32 | 0.827586 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
3a8504e3359b503e6fccca39bd8d8317686a767b | 5,707 | py | Python | originalCode_JMG/data/dataimportallIN.py | dataforgoodfr/batch9_validalab | f333bea8203fd1e4ed098b6e2d51a7f7b05ae530 | [
"MIT"
] | null | null | null | originalCode_JMG/data/dataimportallIN.py | dataforgoodfr/batch9_validalab | f333bea8203fd1e4ed098b6e2d51a7f7b05ae530 | [
"MIT"
] | null | null | null | originalCode_JMG/data/dataimportallIN.py | dataforgoodfr/batch9_validalab | f333bea8203fd1e4ed098b6e2d51a7f7b05ae530 | [
"MIT"
] | 1 | 2021-04-19T21:27:58.000Z | 2021-04-19T21:27:58.000Z | import networkx as nx
from py2neo import Graph, Node, Relationship
import pandas as pd
import random
graph = Graph("bolt://localhost:7687", auth=("neo4j", "Password"))
def importGexf(gexffilepath, depth = 0):
'''
Reads gexf network file from hyphe, update or create all nodes and relationships in neo4j data... | 38.823129 | 126 | 0.58805 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,772 | 0.310496 |
3a851eb1905fe0976754043eca815207cc550202 | 4,023 | py | Python | code_base/excess_mortality/decode_args.py | Mlad-en/COV-BG | dabc6875e49b1fdb113ed691fbf70d5bdcb1846c | [
"MIT"
] | null | null | null | code_base/excess_mortality/decode_args.py | Mlad-en/COV-BG | dabc6875e49b1fdb113ed691fbf70d5bdcb1846c | [
"MIT"
] | null | null | null | code_base/excess_mortality/decode_args.py | Mlad-en/COV-BG | dabc6875e49b1fdb113ed691fbf70d5bdcb1846c | [
"MIT"
] | null | null | null | from code_base.excess_mortality.decode_loc_vars import *
DECODE_DEMO_COL = {
'excess_mortality_by_sex_age_country': 'age,sex,unit,geo\\time',
'excess_mortality_by_sex_age_nuts3': 'unit,sex,age,geo\\time',
'europe_population_by_age_and_sex': 'freq;unit;sex;age;geo\TIME_PERIOD'
}
DECODE_DEMO_REPL = {
'e... | 27 | 87 | 0.505096 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2,643 | 0.656972 |
3a862072dc82d94cea5c675c09cf65fbf2cd377c | 4,510 | py | Python | concord/ext/audio/middleware.py | nariman/concord-ext-audio | c7662507f641bfdba277509838433dbb24fe11a3 | [
"MIT"
] | null | null | null | concord/ext/audio/middleware.py | nariman/concord-ext-audio | c7662507f641bfdba277509838433dbb24fe11a3 | [
"MIT"
] | 14 | 2019-02-19T03:14:07.000Z | 2021-06-25T15:15:55.000Z | concord/ext/audio/middleware.py | narimanized/concord-ext-audio | c7662507f641bfdba277509838433dbb24fe11a3 | [
"MIT"
] | null | null | null | """
The MIT License (MIT)
Copyright (c) 2017-2018 Nariman Safiulin
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, modif... | 34.166667 | 80 | 0.645455 | 3,196 | 0.708647 | 0 | 0 | 0 | 0 | 2,923 | 0.648115 | 1,851 | 0.410421 |
3a862c1dfb4c8e4aff3392df9183017ab88ec2ab | 775 | py | Python | umtk/image/utils.py | kyle0x54/umtk | 883090d84fce924e65184847e6b3048014616f5d | [
"Apache-2.0"
] | 1 | 2020-08-03T12:27:02.000Z | 2020-08-03T12:27:02.000Z | umtk/image/utils.py | kyle0x54/umtk | 883090d84fce924e65184847e6b3048014616f5d | [
"Apache-2.0"
] | null | null | null | umtk/image/utils.py | kyle0x54/umtk | 883090d84fce924e65184847e6b3048014616f5d | [
"Apache-2.0"
] | 1 | 2020-11-28T03:27:10.000Z | 2020-11-28T03:27:10.000Z | import os
from pathlib import Path
from typing import Any, Dict, Union
import numpy as np
def isdicom(path: Union[str, Path]) -> bool:
""" Judge whether a given file is a valid dicom.
Args:
path: given file path.
Returns:
True if given path is a valid dicom, otherwise False.
"""
... | 22.142857 | 61 | 0.618065 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 286 | 0.369032 |
3a866ce737d90dd7710156bcd56f1d122772201c | 28,704 | py | Python | tf_rl/common/utils.py | Rowing0914/TF_RL | 68e5e9a23e38ed2d8ac5f97d380567b919a3d2e7 | [
"MIT"
] | 23 | 2019-04-04T17:34:56.000Z | 2021-12-14T19:34:10.000Z | tf_rl/common/utils.py | Rowing0914/TF_RL | 68e5e9a23e38ed2d8ac5f97d380567b919a3d2e7 | [
"MIT"
] | null | null | null | tf_rl/common/utils.py | Rowing0914/TF_RL | 68e5e9a23e38ed2d8ac5f97d380567b919a3d2e7 | [
"MIT"
] | 3 | 2019-07-17T23:56:36.000Z | 2022-03-13T03:55:21.000Z | import tensorflow as tf
import numpy as np
import os, datetime, itertools, shutil, gym, sys
from tf_rl.common.visualise import plot_Q_values
from tf_rl.common.wrappers import MyWrapper, CartPole_Pixel, wrap_deepmind, make_atari
"""
TF basic Utility functions
"""
def eager_setup():
"""
it eables an eager ex... | 35.745953 | 162 | 0.610089 | 6,839 | 0.238259 | 0 | 0 | 402 | 0.014005 | 0 | 0 | 10,357 | 0.360821 |
3a8780a44ac5da348e337c07269fb06faa67e8cd | 2,284 | py | Python | common/serializers.py | kollad/turbo-ninja | 9c3f66b2af64aec01f522d19b309cfdd723e67cf | [
"MIT"
] | null | null | null | common/serializers.py | kollad/turbo-ninja | 9c3f66b2af64aec01f522d19b309cfdd723e67cf | [
"MIT"
] | 1 | 2017-12-14T05:35:38.000Z | 2017-12-14T05:35:38.000Z | common/serializers.py | kollad/turbo-ninja | 9c3f66b2af64aec01f522d19b309cfdd723e67cf | [
"MIT"
] | null | null | null | from collections import namedtuple, OrderedDict
import json
__author__ = 'kollad'
def isnamedtuple(obj):
"""Heuristic check if an object is a namedtuple."""
return isinstance(obj, tuple) \
and hasattr(obj, "_fields") \
and hasattr(obj, "_asdict") \
and callable(obj._asdict)
... | 34.606061 | 83 | 0.609019 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 482 | 0.211033 |
3a8812b8a7ce8889a96abd8e38c4d8b8f1956ab6 | 1,079 | py | Python | setup.py | mjw99/Musketeer | 0299a7974ad90c09d8d9206fcf862e45f9fddf30 | [
"MIT"
] | null | null | null | setup.py | mjw99/Musketeer | 0299a7974ad90c09d8d9206fcf862e45f9fddf30 | [
"MIT"
] | null | null | null | setup.py | mjw99/Musketeer | 0299a7974ad90c09d8d9206fcf862e45f9fddf30 | [
"MIT"
] | null | null | null | import setuptools
with open("README.md") as readmeFile:
long_description = readmeFile.read()
setuptools.setup(
name="musketeer",
version="0.0.1",
author="Daniil Soloviev",
author_email="dos23@cam.ac.uk",
description="A tool for fitting data from titration experiments.",
long_description=lo... | 29.162162 | 70 | 0.624652 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 534 | 0.494903 |
3a886dc473f6df44d24e2498829541fd798461f5 | 1,358 | py | Python | webapp/tests.py | carolFrohlich/string_checker | 27a96ab9a315d47304b0eb6bdfd671be7a34b6f1 | [
"MIT"
] | null | null | null | webapp/tests.py | carolFrohlich/string_checker | 27a96ab9a315d47304b0eb6bdfd671be7a34b6f1 | [
"MIT"
] | null | null | null | webapp/tests.py | carolFrohlich/string_checker | 27a96ab9a315d47304b0eb6bdfd671be7a34b6f1 | [
"MIT"
] | null | null | null | from django.test import TestCase
# Create your tests here.
from webapp.forms import contains_all_letters
class SCheckerTestCase(TestCase):
def setup(self):
pass
def test_lower_case(self):
text = 'abcdefghijklmnopqrstuvwxyz'
answer = contains_all_letters(text)
self.assertEqual(answer,True)
def test_upper... | 24.690909 | 55 | 0.734904 | 1,247 | 0.918262 | 0 | 0 | 0 | 0 | 0 | 0 | 322 | 0.237113 |
3a89f586494444a77daa3b34a1bc45b72a73f85e | 16,338 | py | Python | EvolutiveStrategies.py | ignacioct/GeneticAlgorithms | 6a92c3d5ec6f2796333576d93c3b6b421055b7a4 | [
"MIT"
] | 4 | 2020-11-26T16:18:23.000Z | 2021-06-28T08:43:35.000Z | EvolutiveStrategies.py | ignacioct/GeneticAlgorithms | 6a92c3d5ec6f2796333576d93c3b6b421055b7a4 | [
"MIT"
] | null | null | null | EvolutiveStrategies.py | ignacioct/GeneticAlgorithms | 6a92c3d5ec6f2796333576d93c3b6b421055b7a4 | [
"MIT"
] | null | null | null | import copy
import math
import operator
import random
import sys
from concurrent import futures
import numpy as np
import requests
class FitnessFunctionCaller:
"""Class for returning the fitness function of an individual."""
def __init__(self, *args):
functional_parts = []
# Full case with ... | 35.135484 | 144 | 0.580487 | 15,805 | 0.967377 | 0 | 0 | 0 | 0 | 0 | 0 | 4,581 | 0.280389 |
3a8ac6ed77639549d9368218a7f979d0a6bcc7b7 | 1,638 | py | Python | src/arago/hiro/client/exception.py | 166MMX/hiro-python-library | fb29e3247a8fe1b0f7dc4e68141cf7340a8dd0a5 | [
"MIT"
] | null | null | null | src/arago/hiro/client/exception.py | 166MMX/hiro-python-library | fb29e3247a8fe1b0f7dc4e68141cf7340a8dd0a5 | [
"MIT"
] | null | null | null | src/arago/hiro/client/exception.py | 166MMX/hiro-python-library | fb29e3247a8fe1b0f7dc4e68141cf7340a8dd0a5 | [
"MIT"
] | null | null | null | from typing import Mapping, Any, List
class HiroClientError(Exception):
def __init__(self, *args: object) -> None:
super().__init__(*args)
class OntologyValidatorError(HiroClientError):
message: str
warnings: List[str]
errors: List[str]
def __init__(self, data: Mapping[str, Any]) -> Non... | 27.762712 | 96 | 0.525031 | 1,591 | 0.971306 | 0 | 0 | 982 | 0.599512 | 0 | 0 | 387 | 0.236264 |
3a8c95437dc709e3b0251893e5436db0d7890d0f | 8,098 | py | Python | yoongram/users/views.py | happyjy/yoonGram | 20555619721065296d5dab88e80c763b4a3f295e | [
"MIT"
] | null | null | null | yoongram/users/views.py | happyjy/yoonGram | 20555619721065296d5dab88e80c763b4a3f295e | [
"MIT"
] | 9 | 2021-03-09T02:00:36.000Z | 2022-02-26T10:13:36.000Z | yoongram/users/views.py | happyjy/yoonGram | 20555619721065296d5dab88e80c763b4a3f295e | [
"MIT"
] | null | null | null | from rest_framework import status
from rest_framework.response import Response
from rest_framework.views import APIView
from . import models, serializers
from yoongram.notifications import views as notifications_views
class ExploreUsers(APIView):
def get(self, request, format=None):
last_five = models.Us... | 39.120773 | 261 | 0.645098 | 7,351 | 0.898216 | 0 | 0 | 0 | 0 | 0 | 0 | 2,328 | 0.284457 |
3a8cac712e69f85d4085b70791e0d285fbcb5630 | 2,507 | py | Python | BabysFirstNeuralNetwork/ToyNN.py | dwpicott/BasicNeuralNetwork | ad4f5878098e5ad167ee2280f5b9b03af02dfa27 | [
"MIT"
] | null | null | null | BabysFirstNeuralNetwork/ToyNN.py | dwpicott/BasicNeuralNetwork | ad4f5878098e5ad167ee2280f5b9b03af02dfa27 | [
"MIT"
] | null | null | null | BabysFirstNeuralNetwork/ToyNN.py | dwpicott/BasicNeuralNetwork | ad4f5878098e5ad167ee2280f5b9b03af02dfa27 | [
"MIT"
] | null | null | null | '''
Basic Python tutorial neural network.
Based on "A Neural Network in 11 Lines of Python" by i am trask
https://iamtrask.github.io/2015/07/12/basic-python-network/
'''
import numpy as np
class ToyNN(object):
'''
Simple two-layer toy neural network
'''
def __init__(self, inputs=3, outputs=1):
... | 27.25 | 83 | 0.59274 | 1,317 | 0.525329 | 0 | 0 | 0 | 0 | 0 | 0 | 1,015 | 0.404866 |
3a8dcfa7190ecc79bdaa94535eba0d246aff05b9 | 1,122 | py | Python | gaphor/UML/deployments/tests/test_connector.py | MartinIIOT/gaphor | b08bf6ddb8c92ec87fccabc2ddee697609f73e67 | [
"Apache-2.0"
] | null | null | null | gaphor/UML/deployments/tests/test_connector.py | MartinIIOT/gaphor | b08bf6ddb8c92ec87fccabc2ddee697609f73e67 | [
"Apache-2.0"
] | null | null | null | gaphor/UML/deployments/tests/test_connector.py | MartinIIOT/gaphor | b08bf6ddb8c92ec87fccabc2ddee697609f73e67 | [
"Apache-2.0"
] | null | null | null | import pytest
from gaphor import UML
from gaphor.core.modeling import Diagram
from gaphor.core.modeling.modelinglanguage import (
CoreModelingLanguage,
MockModelingLanguage,
)
from gaphor.SysML.modelinglanguage import SysMLModelingLanguage
from gaphor.UML.deployments.connector import ConnectorItem
from gaphor.... | 27.365854 | 78 | 0.762923 | 0 | 0 | 0 | 0 | 158 | 0.14082 | 0 | 0 | 79 | 0.07041 |
3a8e21c35da0565b1474e19643e2481a81691a35 | 14,317 | py | Python | utils/lists.py | luciano1337/legion-bot | 022d1ef9eb77a26b57929f800dd55770206f8852 | [
"MIT"
] | null | null | null | utils/lists.py | luciano1337/legion-bot | 022d1ef9eb77a26b57929f800dd55770206f8852 | [
"MIT"
] | null | null | null | utils/lists.py | luciano1337/legion-bot | 022d1ef9eb77a26b57929f800dd55770206f8852 | [
"MIT"
] | null | null | null | pozehug = [
'https://media1.tenor.com/images/4d89d7f963b41a416ec8a55230dab31b/tenor.gif?itemid=5166500',
'https://media1.tenor.com/images/c7efda563983124a76d319813155bd8e/tenor.gif?itemid=15900664',
'https://media1.tenor.com/images/daffa3b7992a08767168614178cce7d6/tenor.gif?itemid=15249774',
'https://media1.... | 91.775641 | 1,661 | 0.777607 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 13,841 | 0.95885 |
3a8f0982e03b38e05aa03eb45840308eeb8e3dc5 | 3,730 | py | Python | py_ti/helper_loops.py | tlpcap/tlp_ti | 8d72b316b332fd5e20785dbf19401883958c0666 | [
"MIT"
] | 7 | 2021-01-31T19:23:07.000Z | 2022-03-10T21:22:41.000Z | py_ti/helper_loops.py | tlpcap/tlp_ti | 8d72b316b332fd5e20785dbf19401883958c0666 | [
"MIT"
] | null | null | null | py_ti/helper_loops.py | tlpcap/tlp_ti | 8d72b316b332fd5e20785dbf19401883958c0666 | [
"MIT"
] | null | null | null | import numpy as np
from numba import jit
@jit
def wilders_loop(data, n):
"""
Wilder's Moving Average Helper Loop
Jit used to improve performance
"""
for i in range(n, len(data)):
data[i] = (data[i-1] * (n-1) + data[i]) / n
return data
@jit
def kama_loop(data, sc, n_er, length):
... | 24.866667 | 77 | 0.507507 | 0 | 0 | 0 | 0 | 3,673 | 0.984718 | 0 | 0 | 502 | 0.134584 |
3a8feafe3391c0ddd2f78fb39a9371d4374c0a73 | 1,441 | py | Python | netlog_viewer/netlog_viewer_build/netlog_viewer_dev_server_config.py | tingshao/catapult | a8fe19e0c492472a8ed5710be9077e24cc517c5c | [
"BSD-3-Clause"
] | 2,151 | 2020-04-18T07:31:17.000Z | 2022-03-31T08:39:18.000Z | netlog_viewer/netlog_viewer_build/netlog_viewer_dev_server_config.py | tingshao/catapult | a8fe19e0c492472a8ed5710be9077e24cc517c5c | [
"BSD-3-Clause"
] | 4,640 | 2015-07-08T16:19:08.000Z | 2019-12-02T15:01:27.000Z | netlog_viewer/netlog_viewer_build/netlog_viewer_dev_server_config.py | tingshao/catapult | a8fe19e0c492472a8ed5710be9077e24cc517c5c | [
"BSD-3-Clause"
] | 698 | 2015-06-02T19:18:35.000Z | 2022-03-29T16:57:15.000Z | # Copyright (c) 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import json
import os
import netlog_viewer_project
import webapp2
from webapp2 import Route
def _RelPathToUnixPath(p):
return p.replace(os.sep, '/'... | 26.2 | 72 | 0.727967 | 1,113 | 0.77238 | 0 | 0 | 0 | 0 | 0 | 0 | 398 | 0.276197 |
3a9084ba87c0f5c49b0d1b1f5827e460b297b88e | 3,991 | py | Python | src/app.py | eug/cron-rest | 2d0a2e0d0cf0cb464b71293802b85ac7076f9944 | [
"MIT"
] | 3 | 2021-05-10T13:42:59.000Z | 2022-03-28T02:07:23.000Z | src/app.py | eug/cron-rest | 2d0a2e0d0cf0cb464b71293802b85ac7076f9944 | [
"MIT"
] | null | null | null | src/app.py | eug/cron-rest | 2d0a2e0d0cf0cb464b71293802b85ac7076f9944 | [
"MIT"
] | 4 | 2018-05-12T13:43:00.000Z | 2021-10-30T01:23:00.000Z | # -*- coding: utf-8 -*-
import json
import os
from crontab import CronTab
from flask import Flask, request
from pathlib import Path
from pretty_cron import prettify_cron
app = Flask(__name__)
@app.route('/', methods=['GET'])
def home():
return Path(app.root_path + '/index.html').read_text()
@app.route('/create'... | 26.256579 | 76 | 0.540466 | 0 | 0 | 0 | 0 | 3,745 | 0.938361 | 0 | 0 | 911 | 0.228264 |
3a90d1f158c36003df58478dbdda2afff682b6b2 | 1,196 | py | Python | 2017/examples/05_randomization.py | limunan/stanford-tensorflow-tutorials | 51e53daaa2a32cfe7a1966f060b28dbbd081791c | [
"MIT"
] | 9,180 | 2017-07-27T23:43:41.000Z | 2022-03-29T17:10:14.000Z | 2017/examples/05_randomization.py | Nianze/stanford-tensorflow-tutorials | 51e53daaa2a32cfe7a1966f060b28dbbd081791c | [
"MIT"
] | 86 | 2017-08-04T12:38:38.000Z | 2020-12-09T03:34:02.000Z | 2017/examples/05_randomization.py | joshosu/stanford-tensorflow-tutorials | b16899102bf07964a15494452a2e91c1b9f88e46 | [
"MIT"
] | 4,115 | 2017-07-28T06:53:12.000Z | 2022-03-23T12:36:55.000Z | """ Examples to demonstrate ops level randomization
Author: Chip Huyen
Prepared for the class CS 20SI: "TensorFlow for Deep Learning Research"
cs20si.stanford.edu
"""
import os
os.environ['TF_CPP_MIN_LOG_LEVEL']='2'
import tensorflow as tf
# Example 1: session is the thing that keeps track of random state
c = tf.rand... | 27.813953 | 74 | 0.664716 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 538 | 0.449833 |
3a91c8f71ed1bbfb503d86a5235097fd88dfae4a | 5,651 | py | Python | python-CSDN博客爬虫/CSDN_article/utils/myutils.py | wangchuanli001/Project-experience | b563c5c3afc07c913c2e1fd25dff41c70533f8de | [
"Apache-2.0"
] | 12 | 2019-12-07T01:44:55.000Z | 2022-01-27T14:13:30.000Z | python-CSDN博客爬虫/CSDN_article/utils/myutils.py | hujiese/Project-experience | b563c5c3afc07c913c2e1fd25dff41c70533f8de | [
"Apache-2.0"
] | 23 | 2020-05-23T03:56:33.000Z | 2022-02-28T07:54:45.000Z | python-CSDN博客爬虫/CSDN_article/utils/myutils.py | hujiese/Project-experience | b563c5c3afc07c913c2e1fd25dff41c70533f8de | [
"Apache-2.0"
] | 7 | 2019-12-20T04:48:56.000Z | 2021-11-19T02:23:45.000Z | # -*- coding: utf-8 -*-
'''
通用工具类
'''
import time
import MySQLdb
import jieba
import ast
import random, sys
# 日志类
import requests
sys.setrecursionlimit(1000000)
class Logger(object):
def __init__(self, filename='default.log', stream=sys.stdout):
self.terminal = stream
self.log = open(filename, ... | 33.838323 | 121 | 0.599186 | 579 | 0.09957 | 0 | 0 | 0 | 0 | 0 | 0 | 3,499 | 0.60172 |
3a92948a079a2d3f3db1feb98db4697c887b4594 | 140 | py | Python | Contest/DDCC2020-qual/b/main.py | mpses/AtCoder | 9c101fcc0a1394754fcf2385af54b05c30a5ae2a | [
"CC0-1.0"
] | null | null | null | Contest/DDCC2020-qual/b/main.py | mpses/AtCoder | 9c101fcc0a1394754fcf2385af54b05c30a5ae2a | [
"CC0-1.0"
] | null | null | null | Contest/DDCC2020-qual/b/main.py | mpses/AtCoder | 9c101fcc0a1394754fcf2385af54b05c30a5ae2a | [
"CC0-1.0"
] | null | null | null | #!/usr/bin/env python3
from numpy import*
n, *a = map(int, open(0).read().split())
a = array(a)
print(int(min(abs(cumsum(a)-(sum(a)/2)))*2)) | 28 | 44 | 0.621429 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 22 | 0.157143 |
3a948fad21b8a67c7efb20bb30784138fb309c60 | 11,836 | py | Python | oanda-api-v20-master/tests/test_contrib_orders.py | cdibble2011/OANDA | 68327d6d65dd92952d7a1dc49fe29efca766d900 | [
"MIT"
] | 389 | 2016-07-22T17:19:17.000Z | 2022-03-18T21:14:55.000Z | oanda-api-v20-master/tests/test_contrib_orders.py | cdibble2011/OANDA | 68327d6d65dd92952d7a1dc49fe29efca766d900 | [
"MIT"
] | 162 | 2016-10-04T18:17:48.000Z | 2021-12-22T10:53:54.000Z | oanda-api-v20-master/tests/test_contrib_orders.py | cdibble2011/OANDA | 68327d6d65dd92952d7a1dc49fe29efca766d900 | [
"MIT"
] | 120 | 2016-08-08T18:52:41.000Z | 2022-03-24T06:53:38.000Z | import unittest
try:
from nose_parameterized import parameterized
except:
print("*** Please install 'nose_parameterized' to run these tests ***")
exit(0)
import oandapyV20.contrib.requests as req
import oandapyV20.definitions.orders as OD
import oandapyV20.types as types
class TestContribRequests(unitt... | 30.193878 | 75 | 0.468233 | 11,496 | 0.971274 | 0 | 0 | 11,129 | 0.940267 | 0 | 0 | 4,686 | 0.395911 |
3a951812ae9cbf0b5d1410cb7713acbb37c91294 | 371 | py | Python | ci_screen/automators/job_item.py | garyjohnson/ci_screen_2 | ea6a0ebd686148bb8977bd2d842e33e71fc2c3f0 | [
"MIT"
] | null | null | null | ci_screen/automators/job_item.py | garyjohnson/ci_screen_2 | ea6a0ebd686148bb8977bd2d842e33e71fc2c3f0 | [
"MIT"
] | null | null | null | ci_screen/automators/job_item.py | garyjohnson/ci_screen_2 | ea6a0ebd686148bb8977bd2d842e33e71fc2c3f0 | [
"MIT"
] | 1 | 2018-08-10T15:04:24.000Z | 2018-08-10T15:04:24.000Z | from kvaut.automator.custom_automator import CustomAutomator
class JobItemAutomator(CustomAutomator):
def is_match(self, value=None, **custom_attributes):
if 'status' not in custom_attributes:
return False
project = self._target.project
return value == project.name and custom... | 30.916667 | 97 | 0.727763 | 307 | 0.827493 | 0 | 0 | 0 | 0 | 0 | 0 | 16 | 0.043127 |
3a95ae559435a30a68aba572eee4bea130369136 | 12,225 | py | Python | models/context.py | Hilbert70403/Infrared-Small-Target | 0b7bddc13ed3b2362735ea858af6e7d18d4374cd | [
"MIT"
] | 21 | 2021-11-08T08:06:36.000Z | 2022-03-26T14:22:35.000Z | models/context.py | Hilbert70403/Infrared-Small-Target | 0b7bddc13ed3b2362735ea858af6e7d18d4374cd | [
"MIT"
] | 4 | 2022-01-19T11:37:13.000Z | 2022-02-28T07:45:19.000Z | models/context.py | Hilbert70403/Infrared-Small-Target | 0b7bddc13ed3b2362735ea858af6e7d18d4374cd | [
"MIT"
] | 9 | 2021-11-15T09:24:41.000Z | 2022-03-24T08:11:00.000Z | import torch
import torch.nn as nn
import torch.nn.functional as F
__all__ = ['NonLocalBlock', 'GCA_Channel', 'GCA_Element', 'AGCB_Element', 'AGCB_Patch', 'CPM']
class NonLocalBlock(nn.Module):
def __init__(self, planes, reduce_ratio=8):
super(NonLocalBlock, self).__init__()
inter_planes = plan... | 35.641399 | 109 | 0.558937 | 12,041 | 0.984949 | 0 | 0 | 0 | 0 | 0 | 0 | 505 | 0.041309 |
3a96f177bdadd6a1d79e415e623de1950e19535a | 17,315 | py | Python | build/fbcode_builder/getdeps/cargo.py | dmitryvinn/watchman | 668d3536031acd9b65950c29d6e956bb42b972bb | [
"MIT"
] | null | null | null | build/fbcode_builder/getdeps/cargo.py | dmitryvinn/watchman | 668d3536031acd9b65950c29d6e956bb42b972bb | [
"MIT"
] | null | null | null | build/fbcode_builder/getdeps/cargo.py | dmitryvinn/watchman | 668d3536031acd9b65950c29d6e956bb42b972bb | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import os
import re
import shutil
from .builder import BuilderBase
class CargoBuilder(BuilderBase):
def __init... | 40.081019 | 119 | 0.551372 | 17,041 | 0.984176 | 0 | 0 | 1,273 | 0.07352 | 0 | 0 | 4,939 | 0.285244 |
3a97bee3b980525a2f4756251f4575984854cc03 | 500 | py | Python | setup.py | EricCWWong/GSimulator | aee7dc81d2a709beb94c02ffc8a288cd7ba06747 | [
"MIT"
] | null | null | null | setup.py | EricCWWong/GSimulator | aee7dc81d2a709beb94c02ffc8a288cd7ba06747 | [
"MIT"
] | 7 | 2020-02-01T02:19:49.000Z | 2020-07-10T12:49:28.000Z | setup.py | EricCWWong/GSimulator | aee7dc81d2a709beb94c02ffc8a288cd7ba06747 | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
setup(
name="GSimulator",
packages=find_packages(exclude=['*test']),
version="0.1.1",
author="Eric Wong",
description='This package allows user to \
simulate conductance of quantum wires',
author_email='c.wing.wong.19@ucl.ac.uk',
install_r... | 29.411765 | 77 | 0.644 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 243 | 0.486 |
3a98425fabf2f4efae0310710f9d76f3fbba768a | 3,995 | py | Python | donn/layers.py | sharan-amutharasu/DONN | c14557e8ef57f3e1c1b73c1fa98cb6ba19a82904 | [
"MIT"
] | 3 | 2018-08-17T05:31:25.000Z | 2020-02-13T19:43:02.000Z | tests/donn/layers.py | sharan-amutharasu/DONN | c14557e8ef57f3e1c1b73c1fa98cb6ba19a82904 | [
"MIT"
] | 1 | 2018-11-19T06:16:50.000Z | 2018-11-19T06:17:53.000Z | tests/donn/layers.py | sharan-amutharasu/DONN | c14557e8ef57f3e1c1b73c1fa98cb6ba19a82904 | [
"MIT"
] | 2 | 2018-12-06T05:01:07.000Z | 2018-12-06T11:59:47.000Z |
# coding: utf-8
# In[4]:
from keras.layers import Activation, Dense, Dropout
from keras.layers.advanced_activations import LeakyReLU, PReLU, ThresholdedReLU, ELU
from keras import regularizers
# In[5]:
def get_activation_layer(activation):
"""
Returns the activation layer given its name
"""
if a... | 37.336449 | 163 | 0.606758 | 2,686 | 0.67234 | 0 | 0 | 0 | 0 | 0 | 0 | 1,316 | 0.329412 |
3a9b8204ffb1f187d8be96695d1cf97c47ce3c0a | 3,618 | py | Python | tournament.py | karol-prz/predictor | 2774fe2a88a9bf5f7aa58f884cdcf879182c64c7 | [
"MIT"
] | null | null | null | tournament.py | karol-prz/predictor | 2774fe2a88a9bf5f7aa58f884cdcf879182c64c7 | [
"MIT"
] | null | null | null | tournament.py | karol-prz/predictor | 2774fe2a88a9bf5f7aa58f884cdcf879182c64c7 | [
"MIT"
] | null | null | null |
class Tournament:
def __init__(self):
# Dictionary of games played, scored, conceded, gd, points
self.tables = {'A': {}, 'B': {}, 'C': {}, 'D': {}, 'E': {}, 'F': {}, 'G': {}, 'H':{}}
self.groups_finished = False
self.records = {}
self.references = {}
from parsers.utils import read_json
self.r = read_js... | 22.060976 | 97 | 0.622443 | 3,608 | 0.997236 | 0 | 0 | 0 | 0 | 0 | 0 | 243 | 0.067164 |
3a9e23b66225e7784226027da5b0c2acadfbb17f | 4,905 | py | Python | rurina5/input/map.py | TeaCondemns/rurina | 43725ebea5872953125271a9abb300a4e3a80a64 | [
"MIT"
] | null | null | null | rurina5/input/map.py | TeaCondemns/rurina | 43725ebea5872953125271a9abb300a4e3a80a64 | [
"MIT"
] | null | null | null | rurina5/input/map.py | TeaCondemns/rurina | 43725ebea5872953125271a9abb300a4e3a80a64 | [
"MIT"
] | null | null | null | from typing import Union, Sequence
import event
_actions = {}
"""_actions = {
'action_name': {
'event1event2':
{
'event1': ...,
'event2': ...
}
}
}"""
def addaction(name: str):
if name not in _actions:
_actions[name] = {}
def rem... | 29.196429 | 117 | 0.648114 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 317 | 0.064628 |
3a9f119bf4f058c5f85a03cbf6f4da2b349b8dd5 | 1,604 | py | Python | data/ABC/filter_out_tiny_models.py | YoungXIAO13/6DPoseEstimationDatasets | b9cb1d9842870860a15bf3cf600cdfb68d1e195e | [
"MIT"
] | 383 | 2019-09-03T15:29:22.000Z | 2022-03-28T02:01:15.000Z | data/ABC/filter_out_tiny_models.py | Fang-Haoshu/ObjectPoseEstimationSummary | 2a11797e6b01e1820105740fcaeb7c049094c57f | [
"MIT"
] | 5 | 2019-10-18T13:04:07.000Z | 2021-09-29T05:26:52.000Z | data/ABC/filter_out_tiny_models.py | Fang-Haoshu/ObjectPoseEstimationSummary | 2a11797e6b01e1820105740fcaeb7c049094c57f | [
"MIT"
] | 63 | 2019-09-17T12:13:51.000Z | 2022-03-28T03:06:05.000Z | import os
from os.path import join, getsize
from PIL import Image
from tqdm import tqdm
import numpy as np
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--dataset_dir', type=str, help='dataset directory')
parser.add_argument('--model', type=str, default='abc_0000', help='subdirectory containi... | 39.121951 | 106 | 0.639027 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 256 | 0.159601 |
3aa041de8b903df622c3ee51ddf1f6842ee18d8c | 59 | py | Python | perception/navigator_vision/navigator_vision/__init__.py | czk100/NaviGator | c078c68768c1df4ad48c4c9a60a8c0bf4bdab63a | [
"MIT"
] | null | null | null | perception/navigator_vision/navigator_vision/__init__.py | czk100/NaviGator | c078c68768c1df4ad48c4c9a60a8c0bf4bdab63a | [
"MIT"
] | null | null | null | perception/navigator_vision/navigator_vision/__init__.py | czk100/NaviGator | c078c68768c1df4ad48c4c9a60a8c0bf4bdab63a | [
"MIT"
] | null | null | null | from scan_the_code_classifier import ScanTheCodeClassifier
| 29.5 | 58 | 0.932203 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
3aa10622900b7fd3873b3fb7ab47170cdb7c2440 | 2,959 | py | Python | assignments/06-python-first-lines/first_lines.py | patarajarina/biosys-analytics | a5e8845211797364ec6f7f8679911ed3b5312887 | [
"MIT"
] | null | null | null | assignments/06-python-first-lines/first_lines.py | patarajarina/biosys-analytics | a5e8845211797364ec6f7f8679911ed3b5312887 | [
"MIT"
] | null | null | null | assignments/06-python-first-lines/first_lines.py | patarajarina/biosys-analytics | a5e8845211797364ec6f7f8679911ed3b5312887 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""
Author : patarajarina
Date : 2019-02-25
Purpose: Rock the Casbah
"""
import argparse
import sys
import os
# --------------------------------------------------
def get_args():
"""get command-line arguments"""
parser = argparse.ArgumentParser(
description='Argparse Python sc... | 26.9 | 82 | 0.460967 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,351 | 0.456573 |
3aa3c3abf98c6d1ad3b59e984112889aa463ffaf | 4,251 | py | Python | inocybe_dhcp/rfc2131.py | kot-begemot-uk/opx-dhcp | 683c7c52f19eedc57196403213c9695ac3439526 | [
"Apache-2.0"
] | null | null | null | inocybe_dhcp/rfc2131.py | kot-begemot-uk/opx-dhcp | 683c7c52f19eedc57196403213c9695ac3439526 | [
"Apache-2.0"
] | null | null | null | inocybe_dhcp/rfc2131.py | kot-begemot-uk/opx-dhcp | 683c7c52f19eedc57196403213c9695ac3439526 | [
"Apache-2.0"
] | 2 | 2018-09-05T07:59:21.000Z | 2018-09-14T07:15:17.000Z | #!/usr/bin/env python3
'''RFC 2131 DHCP message structures.'''
# Copyright (c) 2018 Inocybe Technologies.
#
# 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/LICE... | 42.51 | 119 | 0.639379 | 3,284 | 0.772524 | 0 | 0 | 3,316 | 0.780052 | 0 | 0 | 2,793 | 0.657022 |
3aa5d9d21b6bad4cb5b8740e530181d78e841342 | 1,883 | py | Python | src/data/get_raw_data.py | vivek1739/titanic | 39058f7ecef3ae0e1962fc1dfc550b654e97e1f0 | [
"MIT"
] | null | null | null | src/data/get_raw_data.py | vivek1739/titanic | 39058f7ecef3ae0e1962fc1dfc550b654e97e1f0 | [
"MIT"
] | null | null | null | src/data/get_raw_data.py | vivek1739/titanic | 39058f7ecef3ae0e1962fc1dfc550b654e97e1f0 | [
"MIT"
] | null | null | null | # encoding utf-8
import os
from dotenv import find_dotenv,load_dotenv
from requests import session
import logging
#payload for login to kaggle
payload = {
'action':'login',
'username': os.environ.get("KAGGLE_USERNAME"),
'password': os.environ.get("KAGGLE_PASSWORD")
}
def extract_data(url, file_path):
... | 30.868852 | 77 | 0.668083 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 668 | 0.354753 |
3aa64d8b8830c4c3c052d815f3baf34b10969969 | 168 | py | Python | core/admin.py | yasminfarza/country-state-address-api | 39c8d349095dcca4f2411f7097497d6a8f39c1e1 | [
"MIT"
] | 4 | 2021-06-06T14:16:33.000Z | 2021-06-09T03:42:11.000Z | core/admin.py | yasminfarza/country-state-address-api | 39c8d349095dcca4f2411f7097497d6a8f39c1e1 | [
"MIT"
] | null | null | null | core/admin.py | yasminfarza/country-state-address-api | 39c8d349095dcca4f2411f7097497d6a8f39c1e1 | [
"MIT"
] | null | null | null | from django.contrib import admin
from core.models import Country, State, Address
admin.site.register(Country)
admin.site.register(State)
admin.site.register(Address)
| 21 | 47 | 0.815476 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
3aa8e8a10f90ca6b21d728f7a1f51b3d5e590506 | 770 | py | Python | apps/splash/migrations/0006_auto_20151213_0309.py | Kpaubert/onlineweb4 | 9ac79f163bc3a816db57ffa8477ea88770d97807 | [
"MIT"
] | 32 | 2017-02-22T13:38:38.000Z | 2022-03-31T23:29:54.000Z | apps/splash/migrations/0006_auto_20151213_0309.py | Kpaubert/onlineweb4 | 9ac79f163bc3a816db57ffa8477ea88770d97807 | [
"MIT"
] | 694 | 2017-02-15T23:09:52.000Z | 2022-03-31T23:16:07.000Z | apps/splash/migrations/0006_auto_20151213_0309.py | Kpaubert/onlineweb4 | 9ac79f163bc3a816db57ffa8477ea88770d97807 | [
"MIT"
] | 35 | 2017-09-02T21:13:09.000Z | 2022-02-21T11:30:30.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import django_extensions.db.fields
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("splash", "0005_auto_20150422_2236")]
operations = [
migrations.AlterField(
model_name="spl... | 27.5 | 72 | 0.614286 | 626 | 0.812987 | 0 | 0 | 0 | 0 | 0 | 0 | 120 | 0.155844 |
3aaa3f49b8735100881fb406c235065fe7efe4e9 | 314 | py | Python | Ekeopara_Praise/Phase 1/Python Basic 1/Day 3 Tasks/Task 10.py | nkem1010/python-challenge-solutions | 203cedc691094a83b110fc75764aac51dbbc1a03 | [
"MIT"
] | null | null | null | Ekeopara_Praise/Phase 1/Python Basic 1/Day 3 Tasks/Task 10.py | nkem1010/python-challenge-solutions | 203cedc691094a83b110fc75764aac51dbbc1a03 | [
"MIT"
] | null | null | null | Ekeopara_Praise/Phase 1/Python Basic 1/Day 3 Tasks/Task 10.py | nkem1010/python-challenge-solutions | 203cedc691094a83b110fc75764aac51dbbc1a03 | [
"MIT"
] | null | null | null | '''10. Write a Python program to get a string which is n (non-negative integer) copies of a given string.
Tools: input function, slicing'''
word = str(input("Type in any string or word: "))
n = int(input("Enter the number of repititions: "))
ans = ""
for i in range(n):
ans = ans + word
print(ans)
| 24.153846 | 105 | 0.656051 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 210 | 0.66879 |
3aab0f40c2920df9397a92bef8cc72257b4908bd | 19,245 | py | Python | hajosUtil.py | eej/hajos-search | 9a8e80b3002e814475c61e8d6aa7e5b860c04e83 | [
"FSFAP"
] | 1 | 2021-04-10T21:29:39.000Z | 2021-04-10T21:29:39.000Z | hajosUtil.py | eej/hajos-search | 9a8e80b3002e814475c61e8d6aa7e5b860c04e83 | [
"FSFAP"
] | null | null | null | hajosUtil.py | eej/hajos-search | 9a8e80b3002e814475c61e8d6aa7e5b860c04e83 | [
"FSFAP"
] | null | null | null | #!/usr/bin/env python
"""
Hajos utilities.
"""
from util import *
# Hajos Sum
def hajosSum(G1, G2, x1, y1, x2, y2):
G = []
for i in range(len(G1)):
G.append(G1[i][:])
G[i].extend([0 for x in range(len(G2)-1)])
for i in range(len(G2)-1):
G.append([0 for x in range(len(G1) + l... | 31.809917 | 108 | 0.412679 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3,895 | 0.20239 |
3aac3f6414867b633dea9c7d45394cdd79f87b50 | 39 | py | Python | cont.py | peterkimutai/continue1 | fe6dd88f6beeb0a93a41deef942d753b0d914cbc | [
"Unlicense"
] | null | null | null | cont.py | peterkimutai/continue1 | fe6dd88f6beeb0a93a41deef942d753b0d914cbc | [
"Unlicense"
] | null | null | null | cont.py | peterkimutai/continue1 | fe6dd88f6beeb0a93a41deef942d753b0d914cbc | [
"Unlicense"
] | null | null | null |
i="meee"
u="you"
print(i," and ",u)
| 5.571429 | 18 | 0.487179 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 18 | 0.461538 |
3aac4e1d77f4bf335aa448746527f97c1db73e42 | 2,085 | py | Python | tests/test_api.py | sebaacuna/bigcommerce-api-python | 59ef206d7296c196a0ae0400b6bf9bdb5c2f72af | [
"MIT"
] | null | null | null | tests/test_api.py | sebaacuna/bigcommerce-api-python | 59ef206d7296c196a0ae0400b6bf9bdb5c2f72af | [
"MIT"
] | null | null | null | tests/test_api.py | sebaacuna/bigcommerce-api-python | 59ef206d7296c196a0ae0400b6bf9bdb5c2f72af | [
"MIT"
] | null | null | null | import unittest
import bigcommerce.api
from bigcommerce.connection import Connection, OAuthConnection
from bigcommerce.resources import ApiResource
from mock import MagicMock, patch, Mock
class TestBigcommerceApi(unittest.TestCase):
""" Test API client creation and helpers"""
def test_create_basic(self):
... | 36.578947 | 130 | 0.729976 | 1,888 | 0.905516 | 0 | 0 | 393 | 0.188489 | 0 | 0 | 204 | 0.097842 |
3aad54a74724c543c7739f87f3d7419f9de3dd0e | 638 | py | Python | media.py | anuraglahon16/Make_a_movie_website | 4d5371b7cc1286f2444376a221595d8c6bb0d492 | [
"MIT"
] | null | null | null | media.py | anuraglahon16/Make_a_movie_website | 4d5371b7cc1286f2444376a221595d8c6bb0d492 | [
"MIT"
] | null | null | null | media.py | anuraglahon16/Make_a_movie_website | 4d5371b7cc1286f2444376a221595d8c6bb0d492 | [
"MIT"
] | null | null | null | """Defines the Movie class"""
import webbrowser
class Movie(object):
"""This class provides a way to store movie related information."""
def __init__(self, movie_title, movie_storyline, poster_image,
trailer_youtube, movie_release_date):
self.title = movie_title
sel... | 33.578947 | 72 | 0.677116 | 584 | 0.915361 | 0 | 0 | 0 | 0 | 0 | 0 | 145 | 0.227273 |
3aad9a8258616eab59c6be93afe08dd7ebf88b02 | 722 | py | Python | slalom/migrations/0003_auto_20210502_2148.py | caro-oviedo/DjangoApp2-UserProgress-Salom | 5f3adf796764dd880f4761c818997f75516f2c24 | [
"Apache-2.0"
] | null | null | null | slalom/migrations/0003_auto_20210502_2148.py | caro-oviedo/DjangoApp2-UserProgress-Salom | 5f3adf796764dd880f4761c818997f75516f2c24 | [
"Apache-2.0"
] | null | null | null | slalom/migrations/0003_auto_20210502_2148.py | caro-oviedo/DjangoApp2-UserProgress-Salom | 5f3adf796764dd880f4761c818997f75516f2c24 | [
"Apache-2.0"
] | null | null | null | # Generated by Django 3.2 on 2021-05-02 21:48
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('slalom', '0002_remove_trick_owner'),
]
operations = [
migrations.AddField(
model_name='trick',
name='video1',
... | 24.896552 | 64 | 0.558172 | 631 | 0.873961 | 0 | 0 | 0 | 0 | 0 | 0 | 132 | 0.182825 |
3ab1c994ef22b2ed6be0bfd91c5d34915c683650 | 629 | py | Python | sync_binlog/output_log.py | liusl104/py_sync_binlog | 33a67f545159767d38a522d28d2f79b3ac3802ca | [
"Apache-2.0"
] | 3 | 2018-09-18T03:29:33.000Z | 2020-01-13T03:34:39.000Z | sync_binlog/output_log.py | liusl104/py_sync_binlog | 33a67f545159767d38a522d28d2f79b3ac3802ca | [
"Apache-2.0"
] | null | null | null | sync_binlog/output_log.py | liusl104/py_sync_binlog | 33a67f545159767d38a522d28d2f79b3ac3802ca | [
"Apache-2.0"
] | 1 | 2022-01-25T09:39:17.000Z | 2022-01-25T09:39:17.000Z | # encoding=utf8
import logging # 引入logging模块
from logging.handlers import TimedRotatingFileHandler
from sync_conf import log_bese_path, log_backup_count, log_msg_level
# 日志
logfile = log_bese_path + '/logs/' + 'binlog_sync.log'
logger = logging.getLogger()
logger.setLevel(log_msg_level)
# 按日分割日志,默认日志保留7份
fh = Tim... | 28.590909 | 90 | 0.761526 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 222 | 0.331839 |
3ab2efc455ab899be68173e51b6cd65e6052c754 | 12,208 | py | Python | src/LDPC/pycodes/build/lib.cygwin-1.5.10-i686-2.3/pycodes/utils/CodeMaker.py | Horacehxw/Multi-label | 76095c72327e9aa379eaa653dbbb775ca638e6db | [
"MIT"
] | 1 | 2019-04-24T15:24:48.000Z | 2019-04-24T15:24:48.000Z | src/LDPC/pycodes/utils/CodeMaker.py | Horacehxw/Multi-label | 76095c72327e9aa379eaa653dbbb775ca638e6db | [
"MIT"
] | null | null | null | src/LDPC/pycodes/utils/CodeMaker.py | Horacehxw/Multi-label | 76095c72327e9aa379eaa653dbbb775ca638e6db | [
"MIT"
] | null | null | null | """
Copyright 2003 Mitsubishi Electric Research Laboratories All Rights
Reserved. Permission to use, copy and modify this software and its
documentation without fee for educational, research and non-profit
purposes, is hereby granted, provided that the above copyright
notice and the following... | 38.755556 | 117 | 0.648263 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6,603 | 0.540875 |
3ab3e2941b6f403af41700077d7767ce4d038166 | 457 | py | Python | catalyst/contrib/nn/modules/__init__.py | denyhoof/catalyst | a340450076f7846007bc5695e5163e15b7ad9575 | [
"Apache-2.0"
] | 1 | 2020-09-24T00:34:06.000Z | 2020-09-24T00:34:06.000Z | catalyst/contrib/nn/modules/__init__.py | denyhoof/catalyst | a340450076f7846007bc5695e5163e15b7ad9575 | [
"Apache-2.0"
] | null | null | null | catalyst/contrib/nn/modules/__init__.py | denyhoof/catalyst | a340450076f7846007bc5695e5163e15b7ad9575 | [
"Apache-2.0"
] | 1 | 2020-09-24T00:34:07.000Z | 2020-09-24T00:34:07.000Z | # flake8: noqa
from torch.nn.modules import *
from .common import Flatten, GaussianNoise, Lambda, Normalize
from .lama import LamaPooling, TemporalAttentionPooling, TemporalConcatPooling
from .pooling import (
GlobalAttnPool2d,
GlobalAvgAttnPool2d,
GlobalAvgPool2d,
GlobalConcatAttnPool2d,
GlobalCon... | 21.761905 | 78 | 0.750547 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 14 | 0.030635 |
3ab4a94d8c1d32caca854e9194abb1b42f0cfa0c | 1,559 | py | Python | pogopowerupcost/pogopowerupcost.py | HankB/pogopowerupcost | 348f2414029b15909b82ea109429b8f96937f019 | [
"MIT"
] | null | null | null | pogopowerupcost/pogopowerupcost.py | HankB/pogopowerupcost | 348f2414029b15909b82ea109429b8f96937f019 | [
"MIT"
] | null | null | null | pogopowerupcost/pogopowerupcost.py | HankB/pogopowerupcost | 348f2414029b15909b82ea109429b8f96937f019 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# coding=utf-8
"""
Strategy to eliminate redundant lines.
- remove redundant lines
- calculate the correct key for a given level
"""
NORMAL_COST_PER_POWERUP = {
# level: [stardust, candy]
2.5: [ 200, 1],
4.5: [ 400, 1],
6.5: [ 600, 1],
8.5: [ 800, 1],
10.5: [ 1000, 1],
12.5:... | 21.067568 | 85 | 0.550994 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 248 | 0.159076 |
3ab542c9882e6ca1b34d6c4578175afe66cf3890 | 516 | py | Python | Source/Ventanas/login.py | NicolasTangredi/grupo4 | 4261f34c6600409434fc548d764dbb43bfb9c2f1 | [
"MIT"
] | null | null | null | Source/Ventanas/login.py | NicolasTangredi/grupo4 | 4261f34c6600409434fc548d764dbb43bfb9c2f1 | [
"MIT"
] | null | null | null | Source/Ventanas/login.py | NicolasTangredi/grupo4 | 4261f34c6600409434fc548d764dbb43bfb9c2f1 | [
"MIT"
] | null | null | null | import PySimpleGUI as sg
def build_login():
""" Construye la ventana del inicio de sesion del usuario"""
layout =[[sg.T("Usuario", size=(8,1)), sg.InputText(key='-USER-')],
[sg.T("Contraseña", size=(8,1)), sg.InputText(key='-PASS-')],
[sg.Submit("LogIn", size=(15,1), pad=(0,15))],
... | 34.4 | 82 | 0.585271 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 166 | 0.321083 |
3ab65f9233f5b33fe212c56ac9a65bed2532c487 | 446 | py | Python | tests/core/test_formatter.py | My-Novel-Management/storybuilderunite | c003d3451e237f574c54a87ea7d4fd8da8e833be | [
"MIT"
] | 1 | 2020-06-18T01:38:55.000Z | 2020-06-18T01:38:55.000Z | tests/core/test_formatter.py | My-Novel-Management/storybuilder | 1f36e56a74dbb55a25d60fce3ce81f3c650f521a | [
"MIT"
] | 143 | 2019-11-13T00:21:11.000Z | 2020-08-15T05:47:41.000Z | tests/core/test_formatter.py | My-Novel-Management/storybuilderunite | c003d3451e237f574c54a87ea7d4fd8da8e833be | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
'''
Formatter class test
====================
'''
import unittest
from tests.testutils import print_testtitle, validate_with_fail
from builder.core import formatter as fm
class FormatterTest(unittest.TestCase):
@classmethod
def setUpClass(cls):
print_testtitle(fm.__name__, 'F... | 20.272727 | 63 | 0.674888 | 246 | 0.55157 | 0 | 0 | 93 | 0.20852 | 0 | 0 | 89 | 0.199552 |
3ab8056bbcfb11d7cb0f257beb6843279b5e80cf | 86 | py | Python | reliabilipy/__init__.py | rafaelvalero/omegapy | 5cc6288f9b0d6101de87229ce0f3a392ff3d1e8a | [
"MIT"
] | 1 | 2022-01-08T20:46:43.000Z | 2022-01-08T20:46:43.000Z | reliabilipy/__init__.py | rafaelvalero/omegapy | 5cc6288f9b0d6101de87229ce0f3a392ff3d1e8a | [
"MIT"
] | null | null | null | reliabilipy/__init__.py | rafaelvalero/omegapy | 5cc6288f9b0d6101de87229ce0f3a392ff3d1e8a | [
"MIT"
] | null | null | null | from ._reliabili import reliability_analysis
__all__ = [
"reliability_analysis",
] | 21.5 | 44 | 0.77907 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 22 | 0.255814 |
3aba1d78d37e1173705ea143efeb8730018f6cb1 | 1,296 | py | Python | pynasqm/trajectories/get_reference_job.py | PotentialParadox/pynasqm | 1bd51299b6ca7f8229d8a15428515d53a358903c | [
"MIT"
] | 1 | 2020-03-13T22:34:03.000Z | 2020-03-13T22:34:03.000Z | pynasqm/trajectories/get_reference_job.py | PotentialParadox/pynasqm | 1bd51299b6ca7f8229d8a15428515d53a358903c | [
"MIT"
] | null | null | null | pynasqm/trajectories/get_reference_job.py | PotentialParadox/pynasqm | 1bd51299b6ca7f8229d8a15428515d53a358903c | [
"MIT"
] | null | null | null | from functools import singledispatch
from pynasqm.trajectories.fluorescence import Fluorescence
from pynasqm.trajectories.absorption import Absorption
@singledispatch
def get_reference_job(traj_data):
raise NotImplementedError(f"traj_data type not supported by get_refer\n"\
f"{traj_da... | 35.027027 | 91 | 0.765432 | 0 | 0 | 0 | 0 | 1,133 | 0.874228 | 0 | 0 | 219 | 0.168981 |
3aba773aa612d9acfa1ae100f08af08822858dc4 | 6,283 | py | Python | tests/fire_groups/test_damage_profile.py | spascou/ps2-analysis | 00f99b009d15d4c401a3338ddd0408ac7eedcc0b | [
"MIT"
] | 2 | 2020-06-25T17:19:05.000Z | 2020-10-13T06:08:39.000Z | tests/fire_groups/test_damage_profile.py | spascou/ps2-analysis | 00f99b009d15d4c401a3338ddd0408ac7eedcc0b | [
"MIT"
] | null | null | null | tests/fire_groups/test_damage_profile.py | spascou/ps2-analysis | 00f99b009d15d4c401a3338ddd0408ac7eedcc0b | [
"MIT"
] | null | null | null | from ps2_census.enums import ResistType
from ps2_analysis.enums import DamageTargetType
from ps2_analysis.fire_groups.damage_profile import DamageLocation, DamageProfile
def test_damage_delta():
dp: DamageProfile = DamageProfile(
max_damage=100,
max_damage_range=1234,
min_damage=100,
... | 29.087963 | 87 | 0.665287 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
3aba7ed065768797a2e46990d868b26246bb0ccc | 5,418 | py | Python | EM6436_singlephasemode.py | saishibu/EM6400_Modbus_RPi | 9025d159d84407b92275208b874c140f86f1d306 | [
"MIT"
] | 2 | 2021-09-15T11:14:18.000Z | 2021-09-19T23:40:09.000Z | EM6436_singlephasemode.py | saishibu/EM6400_Modbus_RPi | 9025d159d84407b92275208b874c140f86f1d306 | [
"MIT"
] | null | null | null | EM6436_singlephasemode.py | saishibu/EM6400_Modbus_RPi | 9025d159d84407b92275208b874c140f86f1d306 | [
"MIT"
] | 3 | 2017-09-23T05:28:21.000Z | 2019-12-26T01:29:17.000Z | #ModBUS Communication between Schneider EM6436 Meter and Raspberry Pi
#First beta version.
#The meter is set with the following settings
#Communication : (RS484 to RS232 to USB) - BaudRate = 19200, Parity = N, Stopbits = 1, Device ID=1 (Hardcode in meter)
#Electical Settings: APri:50, Asec: 5, VPri: 415, Vsec:415, SYS:... | 30.1 | 118 | 0.622924 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2,302 | 0.42488 |
3abaf7778575fb33671c68f93238545045ace437 | 2,350 | py | Python | webapp.py | eyan02/WebApp | 4df02491dc6c27985e39c9d003eca1e662740000 | [
"MIT"
] | null | null | null | webapp.py | eyan02/WebApp | 4df02491dc6c27985e39c9d003eca1e662740000 | [
"MIT"
] | null | null | null | webapp.py | eyan02/WebApp | 4df02491dc6c27985e39c9d003eca1e662740000 | [
"MIT"
] | null | null | null | from flask import Flask, render_template, json, request, redirect, session, jsonify
from flaskext.mysql import MySQL
from werkzeug import generate_password_hash, check_password_hash
mysql = MySQL()
app = Flask(__name__)
# randomly generated encryption & decryption key, ensures security of a communications session
app... | 35.074627 | 94 | 0.514043 | 0 | 0 | 0 | 0 | 1,105 | 0.470213 | 0 | 0 | 1,093 | 0.465106 |
3ac0403526cc926b39bbe5158b35b86efdd85742 | 1,359 | py | Python | core/models.py | RafaelAparecidoSilva/Projeto_Django_DIO | 430b0166b39bc74f895805e51b1332c9184eccad | [
"MIT"
] | null | null | null | core/models.py | RafaelAparecidoSilva/Projeto_Django_DIO | 430b0166b39bc74f895805e51b1332c9184eccad | [
"MIT"
] | null | null | null | core/models.py | RafaelAparecidoSilva/Projeto_Django_DIO | 430b0166b39bc74f895805e51b1332c9184eccad | [
"MIT"
] | null | null | null | from django.db import models
# Importamos o User do sistema para utilizar os dados dos usuários que registramos no admin do django
# (desta forma não precisamos criar uma tabela específica no models para representar os usuários).
from django.contrib.auth.models import User
from datetime import datetime
class Event... | 41.181818 | 132 | 0.717439 | 1,057 | 0.77097 | 0 | 0 | 0 | 0 | 0 | 0 | 576 | 0.420131 |
3ac1c768c158dc838dfae0e6094464208e94f0f5 | 434 | py | Python | feature_generation/normalize/rolling_mean.py | s0lvang/ideal-pancake | f7a55f622b02b03a987d74cfdff1c51288bfb657 | [
"MIT"
] | 6 | 2020-09-22T06:54:51.000Z | 2021-03-25T05:38:05.000Z | feature_generation/normalize/rolling_mean.py | s0lvang/ideal-pancake | f7a55f622b02b03a987d74cfdff1c51288bfb657 | [
"MIT"
] | 12 | 2020-09-21T13:20:49.000Z | 2021-04-07T08:01:12.000Z | feature_generation/normalize/rolling_mean.py | s0lvang/ideal-pancake | f7a55f622b02b03a987d74cfdff1c51288bfb657 | [
"MIT"
] | null | null | null | def rolling_mean(data):
return [take_rolling_mean(df) for df in data]
def take_rolling_mean(df):
window = 20
columns_to_take_rolling_mean = [
"pupil_diameter",
"saccade_duration",
"duration",
"saccade_length",
]
for column in columns_to_take_rolling_mean:
df... | 25.529412 | 67 | 0.645161 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 102 | 0.235023 |
3ac339e728b9d10c187e2b092542a9efcdb4b687 | 2,264 | py | Python | backend/utils.py | wanghaiqing2015/fastapi-vue-cms | 0cd1f8e08ea2389287530d04872c7d5bfccdeb62 | [
"MIT"
] | 7 | 2020-08-07T23:51:57.000Z | 2022-02-12T05:13:18.000Z | backend/utils.py | wanghaiqing2015/fastapi-vue-cms | 0cd1f8e08ea2389287530d04872c7d5bfccdeb62 | [
"MIT"
] | 2 | 2020-04-12T16:50:55.000Z | 2020-08-08T06:04:00.000Z | backend/utils.py | hjlarry/fastapi-vue-cms | 4157b2064ce77e35fc280573a2198cbc9a5db9b4 | [
"MIT"
] | null | null | null | import json
from datetime import datetime, timedelta
from typing import Any
import jwt
from starlette.requests import Request
from starlette.responses import JSONResponse
from starlette.status import HTTP_403_FORBIDDEN
from passlib.context import CryptContext
from fastapi import Depends, Security, HTTPException
from f... | 29.402597 | 83 | 0.706714 | 359 | 0.158569 | 0 | 0 | 0 | 0 | 0 | 0 | 140 | 0.061837 |
3ac4d21f2d05e601832ebe89aa297f1bde8e8600 | 2,577 | py | Python | tests/test_ex1.py | loriab/resp_gm | 36974ca2caf262ef40bf7a9586c12d65e0a29be5 | [
"BSD-3-Clause"
] | null | null | null | tests/test_ex1.py | loriab/resp_gm | 36974ca2caf262ef40bf7a9586c12d65e0a29be5 | [
"BSD-3-Clause"
] | 1 | 2019-01-15T20:33:32.000Z | 2019-01-15T20:33:32.000Z | tests/test_ex1.py | loriab/resp_gm | 36974ca2caf262ef40bf7a9586c12d65e0a29be5 | [
"BSD-3-Clause"
] | null | null | null | def test_ex1():
import psi4
import numpy as np
import resp
# Initialize molecule
mol = psi4.geometry(""" C 1.45051389 -0.06628932 0.00000000
H 1.75521613 -0.62865986 -0.87500146
H 1.75521613 -0.62865986 0.87500146
H 1.92173244 0.90485897 0.00000000
C -0.... | 36.295775 | 79 | 0.593326 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,036 | 0.402018 |
3ac6b31791c0cfaed3de6874a765f1f48fec4c3e | 741 | py | Python | tunobase/social_media/facebook/utils.py | unomena/tunobase | 9219e6c5a49eecd1c66dd1b518640c5d678acab6 | [
"BSD-3-Clause"
] | null | null | null | tunobase/social_media/facebook/utils.py | unomena/tunobase | 9219e6c5a49eecd1c66dd1b518640c5d678acab6 | [
"BSD-3-Clause"
] | null | null | null | tunobase/social_media/facebook/utils.py | unomena/tunobase | 9219e6c5a49eecd1c66dd1b518640c5d678acab6 | [
"BSD-3-Clause"
] | null | null | null | '''
Created on 09 Nov 2013
@author: michael
'''
import json
import urllib2
import urllib
from django.conf import settings
import facebook
def validate_access_token(access_token):
'''
Validate a Facebook access token
'''
# Get an app access token
app_token = facebook.get_app_access_token(
... | 19.5 | 74 | 0.645074 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 220 | 0.296896 |
3ac803ff9e5c1fc42b5e6459752425d80c4ba39a | 2,776 | py | Python | src/list_ideas.py | lxk1170/ideas-with-emotion | 89f5322189faca0ba2c00de8a87168ab54f2caa0 | [
"MIT"
] | null | null | null | src/list_ideas.py | lxk1170/ideas-with-emotion | 89f5322189faca0ba2c00de8a87168ab54f2caa0 | [
"MIT"
] | null | null | null | src/list_ideas.py | lxk1170/ideas-with-emotion | 89f5322189faca0ba2c00de8a87168ab54f2caa0 | [
"MIT"
] | null | null | null | import db
from pen import Pen
from idea import Idea
MIN_ENJOYMENT = 0.5
MIN_RELEVANT = 2
MAX_DEPTH = 3
MIN_ACCEPTABLE_SCORE = 0.5
def list_ideas(pen):
ideas = db.load_all_ideas()
# double link all relevant ideas
for name, data in ideas.items():
for other_name, other_data in ideas.items():
... | 31.908046 | 92 | 0.636527 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 576 | 0.207493 |
3acea141522edbabbe9dcfc8fdb02306077a23f4 | 6,988 | py | Python | pysc2/agents/myAgent/myAgent_6/decisionMaker/hierarchical_learning_structure.py | Hotpotfish/pysc2 | 3d7f7ffc01a50ab69d435b65c892cd0bc11265a8 | [
"Apache-2.0"
] | null | null | null | pysc2/agents/myAgent/myAgent_6/decisionMaker/hierarchical_learning_structure.py | Hotpotfish/pysc2 | 3d7f7ffc01a50ab69d435b65c892cd0bc11265a8 | [
"Apache-2.0"
] | null | null | null | pysc2/agents/myAgent/myAgent_6/decisionMaker/hierarchical_learning_structure.py | Hotpotfish/pysc2 | 3d7f7ffc01a50ab69d435b65c892cd0bc11265a8 | [
"Apache-2.0"
] | null | null | null | import datetime
import pysc2.agents.myAgent.myAgent_6.config.config as config
from pysc2.agents.myAgent.myAgent_6.decisionMaker.DQN import DQN
import pysc2.agents.myAgent.myAgent_6.smart_actions as sa
import pysc2.agents.myAgent.myAgent_6.tools.handcraft_function as handcraft_function
from pysc2.env.environment impor... | 50.637681 | 148 | 0.680309 | 6,719 | 0.948208 | 0 | 0 | 0 | 0 | 0 | 0 | 340 | 0.047982 |
3acee6b394ee9cc776b0a34e348bdc806db4720e | 2,064 | py | Python | brudnopis.py | Shandelier/py-tf-movenet-fork | f3eb866665f9e23ec313edf68df6302dd5786ed6 | [
"Apache-2.0"
] | 1 | 2021-06-09T07:05:23.000Z | 2021-06-09T07:05:23.000Z | brudnopis.py | Shandelier/python-movenet | f3eb866665f9e23ec313edf68df6302dd5786ed6 | [
"Apache-2.0"
] | null | null | null | brudnopis.py | Shandelier/python-movenet | f3eb866665f9e23ec313edf68df6302dd5786ed6 | [
"Apache-2.0"
] | null | null | null | # from sklearn.utils import shuffle
# import util as ut
# import os
# import pandas as pd
# import training_util as tut
# import numpy as np
# def sample_2000():
# file_paths, file_names, pose_type = ut.get_csvs_paths(
# os.path.join("5-people-csvs"))
# init = list.pop(file_paths)
# ds = pd.read_... | 23.724138 | 89 | 0.601744 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,857 | 0.899709 |
3acef1e57e1e1cdd81c2829c115eefd77da35670 | 8,696 | py | Python | tfx/components/transform/executor_utils_test.py | avelez93/tfx | 75fbb6a7d50e99138609be3ca4c3a204a13a2195 | [
"Apache-2.0"
] | 1 | 2021-08-22T21:10:48.000Z | 2021-08-22T21:10:48.000Z | tfx/components/transform/executor_utils_test.py | avelez93/tfx | 75fbb6a7d50e99138609be3ca4c3a204a13a2195 | [
"Apache-2.0"
] | null | null | null | tfx/components/transform/executor_utils_test.py | avelez93/tfx | 75fbb6a7d50e99138609be3ca4c3a204a13a2195 | [
"Apache-2.0"
] | 1 | 2020-12-13T22:07:53.000Z | 2020-12-13T22:07:53.000Z | # Copyright 2021 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 39.889908 | 80 | 0.722516 | 7,678 | 0.882935 | 0 | 0 | 0 | 0 | 0 | 0 | 1,648 | 0.189512 |
3ad380b2ffcde7df6679cbb1d4378e9417a3ee46 | 5,675 | py | Python | modules/decompressor/uatg_decompressor_floating_01.py | incoresemi/chromite_uatg_tests | ff3116407c16eef0e73a1f3527075efdb2a4eb14 | [
"BSD-3-Clause"
] | 3 | 2021-09-17T04:53:08.000Z | 2021-09-17T06:14:23.000Z | modules/decompressor/uatg_decompressor_floating_01.py | incoresemi/chromite_uatg_tests | ff3116407c16eef0e73a1f3527075efdb2a4eb14 | [
"BSD-3-Clause"
] | 3 | 2022-01-04T06:52:50.000Z | 2022-02-09T13:25:29.000Z | modules/decompressor/uatg_decompressor_floating_01.py | incoresemi/chromite_uatg_tests | ff3116407c16eef0e73a1f3527075efdb2a4eb14 | [
"BSD-3-Clause"
] | 2 | 2022-01-04T04:36:40.000Z | 2022-01-04T05:32:24.000Z | # python program to generate an assembly file which checks if mis-predictions
# occur In addition to this, the GHR is also filled with ones (additional
# test case) uses assembly macros
from typing import Dict, List, Union, Any
# To-Do -> Create another function which prints the includes and other
# assembler directi... | 37.091503 | 91 | 0.514185 | 5,244 | 0.924053 | 3,191 | 0.562291 | 0 | 0 | 0 | 0 | 2,488 | 0.438414 |
3ad446c1b07e34f2fa0ee1ef1453cf07206ea6ad | 975 | py | Python | backend/account_request/migrations/0002_auto_20190214_2145.py | adabutch/account_tracker | 2ae6e287266262557268f080cff821a736d6ec8b | [
"MIT"
] | null | null | null | backend/account_request/migrations/0002_auto_20190214_2145.py | adabutch/account_tracker | 2ae6e287266262557268f080cff821a736d6ec8b | [
"MIT"
] | 2 | 2020-02-11T15:45:51.000Z | 2020-07-17T16:47:06.000Z | backend/account_request/migrations/0002_auto_20190214_2145.py | adabutch/account_tracker | 2ae6e287266262557268f080cff821a736d6ec8b | [
"MIT"
] | null | null | null | # Generated by Django 2.1.5 on 2019-02-14 21:45
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('account_request', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='accountrequest',
name='divisi... | 28.676471 | 73 | 0.585641 | 882 | 0.904615 | 0 | 0 | 0 | 0 | 0 | 0 | 183 | 0.187692 |
3ad6ff269fcd4396a9cf1a6ea13465342af4b41c | 2,017 | py | Python | kingfisher_scrapy/spiders/uruguay_historical.py | open-contracting/kingfisher-collect | 2fbbd6361a0ec959e0603343a4b363f97fae3815 | [
"BSD-3-Clause"
] | 7 | 2020-07-24T13:15:37.000Z | 2021-12-11T22:40:07.000Z | kingfisher_scrapy/spiders/uruguay_historical.py | open-contracting/kingfisher-collect | 2fbbd6361a0ec959e0603343a4b363f97fae3815 | [
"BSD-3-Clause"
] | 418 | 2020-04-27T22:15:27.000Z | 2022-03-31T23:49:34.000Z | kingfisher_scrapy/spiders/uruguay_historical.py | open-contracting/kingfisher-collect | 2fbbd6361a0ec959e0603343a4b363f97fae3815 | [
"BSD-3-Clause"
] | 6 | 2020-05-28T16:06:53.000Z | 2021-03-16T02:54:15.000Z | import datetime
import scrapy
from kingfisher_scrapy.base_spider import CompressedFileSpider
from kingfisher_scrapy.util import components, handle_http_error
class UruguayHistorical(CompressedFileSpider):
"""
Domain
Agencia Reguladora de Compras Estatales (ARCE)
Spider arguments
from_date
... | 38.056604 | 110 | 0.644522 | 1,854 | 0.919187 | 985 | 0.488349 | 747 | 0.370352 | 0 | 0 | 941 | 0.466534 |
3ad6ff65fc6e55b853f7c971880fa3dab4b97d0c | 1,136 | py | Python | toSpcy/toSpacy.py | patrick013/toSpcy | 8c10bc01e4a549dc177e1efb18c9c87a4dbd6f4c | [
"Apache-2.0"
] | 3 | 2019-11-07T17:29:57.000Z | 2022-03-21T01:45:04.000Z | toSpcy/toSpacy.py | patrick013/toSpcy | 8c10bc01e4a549dc177e1efb18c9c87a4dbd6f4c | [
"Apache-2.0"
] | null | null | null | toSpcy/toSpacy.py | patrick013/toSpcy | 8c10bc01e4a549dc177e1efb18c9c87a4dbd6f4c | [
"Apache-2.0"
] | null | null | null | import re
class Convertor():
def __init__(self, tagslabels={}):
self._tagslabels = tagslabels
def _handleLabel(self, tag):
if tag in self._tagslabels.keys():
return self._tagslabels[tag]
return tag
def _handleSingle(self, t):
entities = []
index = 0
... | 31.555556 | 80 | 0.491197 | 1,124 | 0.989437 | 0 | 0 | 0 | 0 | 0 | 0 | 161 | 0.141725 |
3ad7245b008d3289d24d032c2d3cd8b153b127c9 | 634 | py | Python | main.py | iarwain8a/pydlbot | 3d471795da3f5f17f2e784a9fa508f9dd5613bd3 | [
"MIT"
] | null | null | null | main.py | iarwain8a/pydlbot | 3d471795da3f5f17f2e784a9fa508f9dd5613bd3 | [
"MIT"
] | null | null | null | main.py | iarwain8a/pydlbot | 3d471795da3f5f17f2e784a9fa508f9dd5613bd3 | [
"MIT"
] | null | null | null | import pydlbot_ui as Ui
import sys
from PyQt5 import QtGui, QtCore, QtWidgets
from PyQt5.QtGui import *
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
import time
import threading
if __name__ == '__main__':
p = threading.Thread(target=main)
p.start()
for i in range(3):
t = th... | 22.642857 | 56 | 0.656151 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 27 | 0.042587 |
3ad734bd68154710d060d7aea6f8d2354fbd9080 | 6,832 | py | Python | src/view/deprecated/files.py | fred-yu-2013/Elastos.Hive.Node | 1dcc9178c12efefc786bc653bacec50a1f79161b | [
"MIT"
] | 5 | 2020-11-18T09:14:24.000Z | 2021-08-17T13:55:49.000Z | src/view/deprecated/files.py | fred-yu-2013/Elastos.Hive.Node | 1dcc9178c12efefc786bc653bacec50a1f79161b | [
"MIT"
] | 45 | 2020-11-09T03:40:53.000Z | 2021-11-02T08:43:49.000Z | src/view/deprecated/files.py | fred-yu-2013/Elastos.Hive.Node | 1dcc9178c12efefc786bc653bacec50a1f79161b | [
"MIT"
] | 5 | 2021-01-25T16:25:59.000Z | 2021-09-23T20:18:12.000Z | # -*- coding: utf-8 -*-
"""
The view of files module.
"""
from flask import Blueprint, request
from src.modules.files.files import Files
from src.utils.http_exception import BadRequestException
blueprint = Blueprint('files-deprecated', __name__)
files: Files = None
def init_app(app):
""" This will be called by... | 17.884817 | 102 | 0.562207 | 0 | 0 | 0 | 0 | 6,479 | 0.936813 | 0 | 0 | 5,759 | 0.832707 |
3ad8fecb1b29ee0733883fd90b75697788d9e406 | 2,109 | py | Python | backend_final/apartacho/users/views.py | cenavia/skylynx | 6286294a8cd57279e3c176d8fcae656cef4b40a8 | [
"MIT"
] | 3 | 2020-04-29T18:07:40.000Z | 2020-05-20T20:52:52.000Z | backend_final/apartacho/users/views.py | cenavia/Apartacho | 6286294a8cd57279e3c176d8fcae656cef4b40a8 | [
"MIT"
] | 53 | 2020-05-13T03:27:41.000Z | 2022-03-12T00:32:46.000Z | backend_final/apartacho/users/views.py | cenavia/Apartacho | 6286294a8cd57279e3c176d8fcae656cef4b40a8 | [
"MIT"
] | 2 | 2020-05-16T05:34:45.000Z | 2020-06-11T14:47:50.000Z | """Users views."""
# Django REST Framework
from rest_framework.viewsets import GenericViewSet
from rest_framework.mixins import (ListModelMixin,
RetrieveModelMixin,
UpdateModelMixin)
from rest_framework import status
from rest_framework.decorators i... | 31.954545 | 69 | 0.662399 | 1,509 | 0.715505 | 0 | 0 | 1,144 | 0.542437 | 0 | 0 | 298 | 0.141299 |
3ad9ef77b1856ec357338eec91418078b9e1ee31 | 1,069 | py | Python | examples/cpp/simplicial_complex.py | TripleEss/TDALayer | 25a2da5eab50fad2d006167c2d1c97ec5efb53e0 | [
"MIT"
] | null | null | null | examples/cpp/simplicial_complex.py | TripleEss/TDALayer | 25a2da5eab50fad2d006167c2d1c97ec5efb53e0 | [
"MIT"
] | null | null | null | examples/cpp/simplicial_complex.py | TripleEss/TDALayer | 25a2da5eab50fad2d006167c2d1c97ec5efb53e0 | [
"MIT"
] | null | null | null | from __future__ import print_function
from topologylayer.functional.persistence import SimplicialComplex, persistenceForwardCohom
from topologylayer.util.process import remove_zero_bars
import torch
# first, we build our complex
s = SimplicialComplex()
# a cycle graph on vertices 1,2,3,4
# cone with vertex... | 20.960784 | 92 | 0.669785 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 337 | 0.315248 |
3ada4a4b168c9f32d42b44792e037eaf4b8ba00b | 4,020 | py | Python | python/featureextraction/subscriber.py | JonathanCamargo/Eris | 34c389f0808c8b47933605ed19d98e62280e56dd | [
"MIT"
] | null | null | null | python/featureextraction/subscriber.py | JonathanCamargo/Eris | 34c389f0808c8b47933605ed19d98e62280e56dd | [
"MIT"
] | null | null | null | python/featureextraction/subscriber.py | JonathanCamargo/Eris | 34c389f0808c8b47933605ed19d98e62280e56dd | [
"MIT"
] | null | null | null | import rospy
import threading
import importlib
from collections import deque
from custom_msgs.msg import *
def Subscriber(topic_name,type_str, window):
#creates a subscriber for topic topic_name
#using the class given as a string: type_str
# in the form package_name/message_type
# or in the form package_name.msg.mess... | 34.358974 | 116 | 0.615672 | 2,637 | 0.65597 | 0 | 0 | 0 | 0 | 0 | 0 | 1,047 | 0.260448 |
3adcb0e64f1098771d6fe0dddfcf3ecb6a0a3c9a | 19,324 | py | Python | scripts/condinst.py | Spritaro/condinst_tensorrt | 22063a75e015bba45b588cdb6ebf1ac663ff1924 | [
"MIT"
] | 3 | 2021-11-14T14:11:10.000Z | 2022-02-16T11:42:40.000Z | scripts/condinst.py | datomi79/condinst_tensorrt | 22063a75e015bba45b588cdb6ebf1ac663ff1924 | [
"MIT"
] | null | null | null | scripts/condinst.py | datomi79/condinst_tensorrt | 22063a75e015bba45b588cdb6ebf1ac663ff1924 | [
"MIT"
] | 1 | 2022-02-14T21:47:55.000Z | 2022-02-14T21:47:55.000Z | import math
import numpy as np
import torch
import torch.nn.functional as F
from torch import nn
from torch.utils.data import DataLoader, random_split
from torch.utils.tensorboard import SummaryWriter
import torchvision
# from torchvision.models.detection.backbone_utils import resnet_fpn_backbone
# from torchvision.o... | 48.431078 | 188 | 0.644328 | 15,202 | 0.78669 | 0 | 0 | 0 | 0 | 0 | 0 | 5,214 | 0.26982 |
3adcf1fe5d6dea4fb1870fe9017321b2ad54e8fe | 3,278 | py | Python | Blocky-autoPWN.py | z3rObyte/HackTheBox-Autopwn | 6477f43a0a845adee715ffe1bc4ade62aeb3e679 | [
"Apache-2.0"
] | 1 | 2021-08-25T14:01:13.000Z | 2021-08-25T14:01:13.000Z | Blocky-autoPWN.py | z3rObyte/HackTheBox-Autopwn | 6477f43a0a845adee715ffe1bc4ade62aeb3e679 | [
"Apache-2.0"
] | null | null | null | Blocky-autoPWN.py | z3rObyte/HackTheBox-Autopwn | 6477f43a0a845adee715ffe1bc4ade62aeb3e679 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python3
import zipfile
from pwn import * # pip3 install pwn
banner = """
____ __ __ __ ____ _ ___ __
/ __ )/ /___ _____/ /____ __ ____ ___ __/ /_____ / __ \ | / / | / /
/ __ / / __ \/ ___/ //_/ / / /_____/ __ `/ / / / __/ __ \/ /_/ ... | 28.017094 | 136 | 0.566809 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,771 | 0.539446 |
3add20f0867b88372260c1d964a87cf06a4f4b64 | 1,621 | py | Python | verification/conf.py | HosseinMohammadii/django-rest-verification | 0e0d4633f4420896fbfa0005f9df49eb4ed68f88 | [
"MIT"
] | 1 | 2020-10-23T08:20:59.000Z | 2020-10-23T08:20:59.000Z | verification/conf.py | HosseinMohammadii/django-rest-verification | 0e0d4633f4420896fbfa0005f9df49eb4ed68f88 | [
"MIT"
] | null | null | null | verification/conf.py | HosseinMohammadii/django-rest-verification | 0e0d4633f4420896fbfa0005f9df49eb4ed68f88 | [
"MIT"
] | null | null | null | from django.conf import settings
from django.utils import timezone
from .base import default_config, numeric, lowercase_alphabetic, uppercase_alphabetic
config = default_config
config.update(settings.VERIFICATION)
VERIFICATION_CODE_FIELD = 'verification_code'
VERIFICATIONS = config.get('VERIFICATIONS')
CODE_LENGTH = ... | 33.770833 | 85 | 0.805676 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 306 | 0.188772 |
3adedc706a3e7e55655cf8dce7e7f4c1476ebd61 | 13,078 | py | Python | nxbt/controller/server.py | Yamakaky/nxbt | 0fe9acaaf0fac8014f9aaee53943711a106b572c | [
"MIT"
] | null | null | null | nxbt/controller/server.py | Yamakaky/nxbt | 0fe9acaaf0fac8014f9aaee53943711a106b572c | [
"MIT"
] | null | null | null | nxbt/controller/server.py | Yamakaky/nxbt | 0fe9acaaf0fac8014f9aaee53943711a106b572c | [
"MIT"
] | null | null | null | import socket
import fcntl
import os
import time
import queue
import logging
import traceback
from .controller import Controller, ControllerTypes
from ..bluez import BlueZ
from .protocol import ControllerProtocol
from .input import InputParser
from .utils import format_msg_controller, format_msg_switch
class Control... | 34.415789 | 90 | 0.558878 | 12,770 | 0.976449 | 0 | 0 | 0 | 0 | 0 | 0 | 2,822 | 0.215782 |
3adefdd3fa592b7c580b21e49f739074251c1d6b | 391 | py | Python | mfi_customization/mfi/patch/set_first_responded_on_issue.py | anuradha-88/mfi_customization | eb19ed43d0178b461f1d9914d2f7b6b55c9d030c | [
"MIT"
] | null | null | null | mfi_customization/mfi/patch/set_first_responded_on_issue.py | anuradha-88/mfi_customization | eb19ed43d0178b461f1d9914d2f7b6b55c9d030c | [
"MIT"
] | null | null | null | mfi_customization/mfi/patch/set_first_responded_on_issue.py | anuradha-88/mfi_customization | eb19ed43d0178b461f1d9914d2f7b6b55c9d030c | [
"MIT"
] | null | null | null | import frappe
from datetime import datetime
# bench execute mfi_customization.mfi.patch.set_first_responded_on_issue.execute
def execute():
for d in frappe.get_all("Issue"):
for tk in frappe.get_all("Task",{"issue": d.name}, ['attended_date_time', 'status']):
if tk.attended_date_time:
frappe.db.set_value("Is... | 35.545455 | 93 | 0.749361 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 161 | 0.411765 |
3adf36991cec5979dbe14a96fcb6614f4fd9f191 | 12,144 | py | Python | team_9/cocos/utest/test_euclid.py | Donnyvdm/dojo19 | 3cf043a84e3ad6d3c4d59cd9c50b160e1ff03400 | [
"BSD-3-Clause"
] | 1 | 2019-09-15T18:59:49.000Z | 2019-09-15T18:59:49.000Z | team_9/cocos/utest/test_euclid.py | Donnyvdm/dojo19 | 3cf043a84e3ad6d3c4d59cd9c50b160e1ff03400 | [
"BSD-3-Clause"
] | null | null | null | team_9/cocos/utest/test_euclid.py | Donnyvdm/dojo19 | 3cf043a84e3ad6d3c4d59cd9c50b160e1ff03400 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import division, print_function, unicode_literals
import cocos.euclid as eu
import unittest
import copy
try:
import cPickle as pickle
except Exception:
import pickle
import io
class Test_Vector2(unittest.TestCase):
def test_instantiate(self):
xy = (1.0, 2.0)
v2 = eu.Vector... | 30.512563 | 81 | 0.525115 | 11,872 | 0.977602 | 0 | 0 | 0 | 0 | 0 | 0 | 628 | 0.051713 |
3adf530cc79f1ef10e5ff6f32271340c43c7203b | 3,769 | py | Python | main.py | aHeraud/cgp-tetris | a3483b279bf0bc53edcb3a871873dd576a33c01c | [
"MIT"
] | null | null | null | main.py | aHeraud/cgp-tetris | a3483b279bf0bc53edcb3a871873dd576a33c01c | [
"MIT"
] | null | null | null | main.py | aHeraud/cgp-tetris | a3483b279bf0bc53edcb3a871873dd576a33c01c | [
"MIT"
] | null | null | null | #!/usr/local/bin/python3
import sys
from multiprocessing import Pool
from timeit import default_timer as timer
from config import Config
from cgp.functionset import FunctionSet
from cgp.genome import Genome
import numpy as np
import numpy.random
from random import randint
from tetris_learning_environment import E... | 30.395161 | 137 | 0.644733 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 448 | 0.118864 |
3ae00d3abfc861f7559fd9d0fd444be28cadc9c5 | 3,175 | py | Python | test/molecular_map_test/single_protein_explicit_mapping/test_single_protein_explicit_mapping.py | fieryd/cgmap | 8b09cf1392d22be4f735d3259ee9d624f3e45210 | [
"Apache-2.0"
] | 5 | 2018-03-05T07:10:09.000Z | 2019-09-11T19:33:56.000Z | test/molecular_map_test/single_protein_explicit_mapping/test_single_protein_explicit_mapping.py | fieryd/cgmap | 8b09cf1392d22be4f735d3259ee9d624f3e45210 | [
"Apache-2.0"
] | 3 | 2017-05-02T21:47:38.000Z | 2020-07-16T20:12:19.000Z | test/molecular_map_test/single_protein_explicit_mapping/test_single_protein_explicit_mapping.py | fieryd/cgmap | 8b09cf1392d22be4f735d3259ee9d624f3e45210 | [
"Apache-2.0"
] | 4 | 2017-09-18T20:02:33.000Z | 2021-11-01T15:51:51.000Z | #!/usr/bin/env python2
import sys
sys.path.append('../../../src/')
import cgmap as cg
import mdtraj as md
import md_check as check
############################### config #####################################
input_traj = "protein.trr"
input_top = "protein.pdb"
output_traj = "protein.trr"
output_top = "protein.pdb... | 28.097345 | 128 | 0.589606 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 817 | 0.257323 |
3ae33afc12f8987d0c85ee05a95ac1ec3a4be0c6 | 3,726 | py | Python | image_classifier/model_lib.py | JMarcan/computer_vision_perception | a5aa7bfb316e7b45596d8c5916638f5ce2b6d654 | [
"MIT"
] | null | null | null | image_classifier/model_lib.py | JMarcan/computer_vision_perception | a5aa7bfb316e7b45596d8c5916638f5ce2b6d654 | [
"MIT"
] | null | null | null | image_classifier/model_lib.py | JMarcan/computer_vision_perception | a5aa7bfb316e7b45596d8c5916638f5ce2b6d654 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Function that loads a checkpoint and rebuilds the model
import torch
from torch import nn
from collections import OrderedDict
from torchvision import datasets, transforms, models
def save_checkpoint(model, checkpoint_path, output_categories):
'''
Save the trained deep... | 31.846154 | 165 | 0.630972 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2,046 | 0.549114 |
3ae4b2634727a7a3c18f2473fe0c51212182326b | 7,689 | py | Python | pytorch/utils/utils.py | XinyiYS/CollaborativeFairFederatedLearning | 1372f74230b366a41243f809ce0fc15586cd40fe | [
"MIT"
] | 25 | 2020-07-29T03:46:12.000Z | 2022-03-23T07:15:53.000Z | pytorch/utils/utils.py | lingjuanlv/CollaborativeFairFederatedLearning | 1372f74230b366a41243f809ce0fc15586cd40fe | [
"MIT"
] | null | null | null | pytorch/utils/utils.py | lingjuanlv/CollaborativeFairFederatedLearning | 1372f74230b366a41243f809ce0fc15586cd40fe | [
"MIT"
] | 7 | 2020-09-15T19:06:27.000Z | 2022-02-22T06:51:52.000Z | import copy
import torch
from torch import nn
from torch.utils.data import DataLoader
from torchtext.data import Batch
def averge_models(models, device=None):
final_model = copy.deepcopy(models[0])
if device:
models = [model.to(device) for model in models]
final_model = final_model.to(device)
averaged_paramete... | 35.109589 | 123 | 0.757836 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,737 | 0.225907 |
3ae65789d9458479266b8a51662e5436d0fc02db | 525 | py | Python | TNP Cell Website/classroom/views/classroom.py | kaustubh240897/Quizapplication | dcdf05670da649b602f26013a95b89b5c3a1585a | [
"MIT"
] | 2 | 2018-11-04T06:44:58.000Z | 2018-11-15T19:19:19.000Z | TNP Cell Website/classroom/views/classroom.py | kaustubh240897/Quizapplication | dcdf05670da649b602f26013a95b89b5c3a1585a | [
"MIT"
] | 2 | 2018-10-29T15:27:16.000Z | 2018-10-30T08:38:37.000Z | TNP Cell Website/classroom/views/classroom.py | kaustubh240897/Training_and_Placement_cell_IIITV | dcdf05670da649b602f26013a95b89b5c3a1585a | [
"MIT"
] | 3 | 2018-10-29T15:00:44.000Z | 2020-10-14T13:05:10.000Z | from django.shortcuts import redirect, render
from django.views.generic import TemplateView
class SignUpView(TemplateView):
template_name = 'registration/signup.html'
#homePage
def home(request):
if request.user.is_authenticated:
if request.user.is_teacher:
return redirect('teachers:my_jo... | 25 | 52 | 0.72 | 78 | 0.148571 | 0 | 0 | 0 | 0 | 0 | 0 | 127 | 0.241905 |
3ae6ca75f3d3a8c0e269c42286630443d12eadfe | 102 | py | Python | fseval/pipelines/rank_and_validate/__init__.py | dunnkers/fseval | 49a11a63e09e65b1f14389b6ba3a9ae3aeae086d | [
"MIT"
] | 5 | 2020-07-08T11:58:46.000Z | 2022-01-26T13:58:00.000Z | fseval/pipelines/rank_and_validate/__init__.py | shenlong95/fseval | 4d2e6618b8838f9e52fe60621b08595dc4c5b4fb | [
"MIT"
] | 63 | 2021-05-09T06:18:24.000Z | 2022-03-27T18:05:58.000Z | fseval/pipelines/rank_and_validate/__init__.py | shenlong95/fseval | 4d2e6618b8838f9e52fe60621b08595dc4c5b4fb | [
"MIT"
] | 1 | 2022-02-11T03:24:14.000Z | 2022-02-11T03:24:14.000Z | from .rank_and_validate import BootstrappedRankAndValidate
__all__ = ["BootstrappedRankAndValidate"]
| 25.5 | 58 | 0.862745 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 29 | 0.284314 |
3ae8972b7f0c8d8ea6d2f5706159829160fedc21 | 6,119 | py | Python | kolab/yk/yk.py | roy029/kolab | 10a3054da5e7c96c575de1336056eee65368c087 | [
"MIT"
] | null | null | null | kolab/yk/yk.py | roy029/kolab | 10a3054da5e7c96c575de1336056eee65368c087 | [
"MIT"
] | 1 | 2021-11-14T05:38:27.000Z | 2021-11-14T05:38:27.000Z | kolab/yk/yk.py | roy029/kolab | 10a3054da5e7c96c575de1336056eee65368c087 | [
"MIT"
] | 7 | 2020-11-02T13:05:44.000Z | 2022-01-09T11:06:04.000Z | from os import read
import sys
import pegtree as pg
import csv
from pegtree.optimizer import optimize
peg = pg.grammar('yk.tpeg')
parse = pg.generate(peg)
VAR_literal = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'
NAME_literal = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'
VAL_literal = 'abcdefgh... | 32.897849 | 86 | 0.484393 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 833 | 0.134855 |
3ae9c27cb433dee341880c12a91958034dceafbb | 270 | py | Python | Task2/02_list-dicts.py | telecomprofi/Cisco-DevOps-MDP-02 | f44173d468319a90dc6b7c5ea92cd6b8b3762b45 | [
"Apache-2.0"
] | null | null | null | Task2/02_list-dicts.py | telecomprofi/Cisco-DevOps-MDP-02 | f44173d468319a90dc6b7c5ea92cd6b8b3762b45 | [
"Apache-2.0"
] | null | null | null | Task2/02_list-dicts.py | telecomprofi/Cisco-DevOps-MDP-02 | f44173d468319a90dc6b7c5ea92cd6b8b3762b45 | [
"Apache-2.0"
] | null | null | null | country=["Brazil","Russia","India","China","South Africa"]
capitals={"Brazil":"Brasilia","Russia":"Moscow","India":"New Delhi",
"China":"Beijing","South Africa":["Pretoria","Cape Town","Bloemfontein"]}
print(country)
print(capitals)
print(capitals["South Africa"][1])
| 33.75 | 74 | 0.696296 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 175 | 0.648148 |
3aea02ea9b227434bbb8b250a3ff42f885040255 | 17,501 | py | Python | Interface/Windows/WildernessTravelManagerWindow.py | Snackhole/SerpentRPG | 9e5ae019893592a46dd7681daba56af8e8e29744 | [
"MIT"
] | 1 | 2021-02-27T16:33:53.000Z | 2021-02-27T16:33:53.000Z | Interface/Windows/WildernessTravelManagerWindow.py | Snackhole/SerpentRPG | 9e5ae019893592a46dd7681daba56af8e8e29744 | [
"MIT"
] | null | null | null | Interface/Windows/WildernessTravelManagerWindow.py | Snackhole/SerpentRPG | 9e5ae019893592a46dd7681daba56af8e8e29744 | [
"MIT"
] | null | null | null | import math
import os
from PyQt5 import QtCore
from PyQt5.QtWidgets import QGridLayout, QLabel, QPushButton, QFrame, QTextEdit, QInputDialog, QSizePolicy, QAction, QMessageBox
from Core.DieClock import DieClock
from Core.WildernessTravelManager import WildernessTravelManager
from Interface.Widgets.LineEditMouseWheelE... | 52.241791 | 203 | 0.746186 | 17,032 | 0.973202 | 0 | 0 | 0 | 0 | 0 | 0 | 1,799 | 0.102794 |