hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ec0fa75da1da950123487ff1c1ac616b527627ae | 42,108 | py | Python | test/test_video_reader.py | junjihashimoto/vision | 791c172a337d98012018f98ffde93b1020ba3ed5 | [
"BSD-3-Clause"
] | 2 | 2020-05-14T03:17:00.000Z | 2021-02-24T10:39:23.000Z | test/test_video_reader.py | JXQJ/vision | b6f28ec1a8c5fdb8d01cc61946e8f87dddcfa830 | [
"BSD-3-Clause"
] | null | null | null | test/test_video_reader.py | JXQJ/vision | b6f28ec1a8c5fdb8d01cc61946e8f87dddcfa830 | [
"BSD-3-Clause"
] | 1 | 2020-11-15T10:28:20.000Z | 2020-11-15T10:28:20.000Z | import collections
import math
import os
import sys
import time
import unittest
from fractions import Fraction
import numpy as np
import torch
import torchvision.io as io
from numpy.random import randint
from torchvision.io import _HAS_VIDEO_OPT
try:
import av
# Do a version test too
io.video._check_av_... | 36.969271 | 94 | 0.565807 |
359e6b4a1cbefb45fc2ffde0db786877e9868f52 | 248 | py | Python | utils.py | Animenosekai/Vinted-Alert | 9857a93fd18244bfacba8f2ec5696cddadeddb6a | [
"MIT"
] | 1 | 2021-11-21T21:59:07.000Z | 2021-11-21T21:59:07.000Z | utils.py | Animenosekai/Vinted-Alert | 9857a93fd18244bfacba8f2ec5696cddadeddb6a | [
"MIT"
] | null | null | null | utils.py | Animenosekai/Vinted-Alert | 9857a93fd18244bfacba8f2ec5696cddadeddb6a | [
"MIT"
] | 1 | 2021-07-07T14:10:19.000Z | 2021-07-07T14:10:19.000Z | from time import time
def log(message: str = "Log", domain: str = "app"):
print("\033[90m{timestamp}\033[0m|[Vinted-Alert] [{domain}] {message}".format(
timestamp = int(time()),
domain = domain,
message = message
)) | 31 | 82 | 0.58871 |
e83ba548e236b9ecdd29b32f57700b7c81636b9b | 9,305 | py | Python | zulip_bots/zulip_bots/tests/test_lib.py | dimisjim/python-zulip-api | 095d5d8f4e1854a98025b8ee92d004fe373d6a88 | [
"Apache-2.0"
] | 351 | 2017-07-07T22:44:48.000Z | 2022-03-30T04:52:12.000Z | zulip_bots/zulip_bots/tests/test_lib.py | dimisjim/python-zulip-api | 095d5d8f4e1854a98025b8ee92d004fe373d6a88 | [
"Apache-2.0"
] | 631 | 2017-07-06T18:56:47.000Z | 2022-03-16T20:32:50.000Z | zulip_bots/zulip_bots/tests/test_lib.py | dimisjim/python-zulip-api | 095d5d8f4e1854a98025b8ee92d004fe373d6a88 | [
"Apache-2.0"
] | 371 | 2017-07-06T19:56:29.000Z | 2022-03-31T16:07:30.000Z | import io
from unittest import TestCase
from unittest.mock import ANY, MagicMock, create_autospec, patch
from zulip_bots.lib import (
ExternalBotHandler,
StateHandler,
extract_query_without_mention,
is_private_message_but_not_group_pm,
run_message_handler_for_bot,
)
class FakeClient:
def __in... | 35.788462 | 96 | 0.602472 |
3b43ee7f056db621b30dfd9b53e14d0ebed0e4ec | 6,469 | py | Python | tests/property/test_group.py | votingworks/electionguard-python | a730e401719e90aae7a94029d8639d34fdfaeb4a | [
"MIT"
] | 3 | 2020-11-06T22:00:27.000Z | 2021-08-11T01:56:19.000Z | tests/property/test_group.py | votingworks/electionguard-python | a730e401719e90aae7a94029d8639d34fdfaeb4a | [
"MIT"
] | 8 | 2021-04-06T18:39:06.000Z | 2021-07-13T19:15:28.000Z | tests/property/test_group.py | votingworks/electionguard-python | a730e401719e90aae7a94029d8639d34fdfaeb4a | [
"MIT"
] | 1 | 2021-08-11T01:56:46.000Z | 2021-08-11T01:56:46.000Z | import unittest
import pickle
from typing import Optional
from hypothesis import given
from electionguard.group import (
P,
Q,
ElementModP,
ElementModQ,
a_minus_b_q,
mult_inv_p,
ONE_MOD_P,
mult_p,
ZERO_MOD_P,
G,
ONE_MOD_Q,
g_pow_p,
ZERO_MOD_Q,
R,
int_to_p,
... | 31.402913 | 83 | 0.662235 |
abec0d59f1ff02700337f25e05dfa0103cdfd69e | 28,424 | py | Python | python/src/keyczar/util.py | piplcom/keyczar | ac750b95c2dd496f906e5d0cc5e5ebdb42925fa8 | [
"Apache-2.0"
] | null | null | null | python/src/keyczar/util.py | piplcom/keyczar | ac750b95c2dd496f906e5d0cc5e5ebdb42925fa8 | [
"Apache-2.0"
] | null | null | null | python/src/keyczar/util.py | piplcom/keyczar | ac750b95c2dd496f906e5d0cc5e5ebdb42925fa8 | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2008 Google Inc.
#
# 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 writin... | 32.226757 | 91 | 0.686075 |
90d7172d13587c188929c980fb405285aee557fc | 483 | py | Python | src/aws_scatter_gather/util/s3_event.py | cbuschka/aws-scatter-gather | abebd22aa6449369845a08d4260607745098bb28 | [
"Apache-2.0"
] | 2 | 2020-06-23T08:27:56.000Z | 2020-06-25T08:44:57.000Z | src/aws_scatter_gather/util/s3_event.py | cbuschka/aws-scatter-gather | abebd22aa6449369845a08d4260607745098bb28 | [
"Apache-2.0"
] | null | null | null | src/aws_scatter_gather/util/s3_event.py | cbuschka/aws-scatter-gather | abebd22aa6449369845a08d4260607745098bb28 | [
"Apache-2.0"
] | null | null | null | def is_s3_test_event(event):
return event.get("Event", None) == "s3:TestEvent"
def get_s3_objects(event):
records = event.get("Records", [])
return [(record["s3"]["bucket"]["name"], record["s3"]["object"]["key"],) for record in records]
def get_single_s3_object(event):
s3_objects = get_s3_objects(ev... | 28.411765 | 99 | 0.652174 |
494f81ed355634e29ef93d64246c5ff60d7a6dd5 | 835 | py | Python | 04.09/Usolve.py | yuanxuecs/s19-lecture-files | 1c0d4d6e70629db4a083188f452ef75f120f12b4 | [
"MIT"
] | null | null | null | 04.09/Usolve.py | yuanxuecs/s19-lecture-files | 1c0d4d6e70629db4a083188f452ef75f120f12b4 | [
"MIT"
] | null | null | null | 04.09/Usolve.py | yuanxuecs/s19-lecture-files | 1c0d4d6e70629db4a083188f452ef75f120f12b4 | [
"MIT"
] | null | null | null | import numpy as np
def Usolve(U, y):
"""Backward solve an upper triangular system Ux = y for x
Parameters:
U: the matrix, must be square, upper triangular, with nonzeros on the diagonal
y: the right-hand side vector
Output:
x: the solution vector to U @ x == y
"""
m, n = U.shape
... | 29.821429 | 84 | 0.597605 |
6e62fab48223cf9eb05f832f8b3bf714df621f95 | 1,785 | py | Python | rdkit/ML/DecTree/SigTree.py | darkreactions/rdkit | 0c388029c1f9386d832f6c321e59a11589c373d8 | [
"PostgreSQL"
] | null | null | null | rdkit/ML/DecTree/SigTree.py | darkreactions/rdkit | 0c388029c1f9386d832f6c321e59a11589c373d8 | [
"PostgreSQL"
] | null | null | null | rdkit/ML/DecTree/SigTree.py | darkreactions/rdkit | 0c388029c1f9386d832f6c321e59a11589c373d8 | [
"PostgreSQL"
] | 2 | 2017-12-04T02:28:18.000Z | 2018-11-29T01:18:46.000Z | #
# Copyright (C) 2003-2005 Rational Discovery LLC
# All Rights Reserved
#
""" Defines the class SigTreeNode, used to represent trees that
use signatures (bit vectors) to represent data. As inputs (examples),
SigTreeNode's expect 3-sequences: (label,sig,act)
_SigTreeNode_ is derived from _DecTree.DecTreeNode_... | 27.890625 | 87 | 0.660504 |
88e843c2538ed06c22b9bfe9875be001cda4b25c | 1,085 | py | Python | poc/Whoareu.py | rabbitmask/Weblogic- | 05cee3a69cf403e4db5f057c569a923c107cb97b | [
"MIT"
] | 1,593 | 2019-05-14T05:58:32.000Z | 2022-03-30T05:23:52.000Z | poc/Whoareu.py | secfb/WeblogicScan | 05cee3a69cf403e4db5f057c569a923c107cb97b | [
"MIT"
] | 13 | 2019-09-03T17:27:29.000Z | 2022-02-16T04:51:05.000Z | poc/Whoareu.py | secfb/WeblogicScan | 05cee3a69cf403e4db5f057c569a923c107cb97b | [
"MIT"
] | 365 | 2019-05-14T06:11:09.000Z | 2022-03-31T13:57:03.000Z | #!/usr/bin/env python3
# _*_ coding:utf-8 _*_
'''
____ _ _ _ _ __ __ _
| _ \ __ _| |__ | |__ (_) |_| \/ | __ _ ___| | __
| |_) / _` | '_ \| '_ \| | __| |\/| |/ _` / __| |/ /
| _ < (_| | |_) | |_) | | |_| | | | (_| \__ \ <
|_| \_\__,_|_.__/|_.__/|_|\__|_| |_|\__,_|___/_|\_\
'''
import... | 36.166667 | 104 | 0.547465 |
e2fa230dd5cdbe44c138ec4c9b59ae9a235a9a78 | 15,985 | py | Python | models/models.py | Bilal-A-Qureshi/Point-GNN | 401eba8f7afaaa811ee1d001f38405629071a42a | [
"MIT"
] | 418 | 2020-02-29T16:48:37.000Z | 2022-03-29T03:07:27.000Z | models/models.py | Bilal-A-Qureshi/Point-GNN | 401eba8f7afaaa811ee1d001f38405629071a42a | [
"MIT"
] | 91 | 2020-03-13T08:25:52.000Z | 2022-03-10T01:56:52.000Z | models/models.py | Bilal-A-Qureshi/Point-GNN | 401eba8f7afaaa811ee1d001f38405629071a42a | [
"MIT"
] | 120 | 2020-03-04T16:21:30.000Z | 2022-03-11T08:20:52.000Z | """This file implements models for object detection. """
from functools import partial
import tensorflow as tf
import tensorflow.contrib.slim as slim
from models.loss import focal_loss_sigmoid, focal_loss_softmax
from models import gnn
regularizer_dict = {
'l2': slim.l2_regularizer,
'l1': slim.l1_regularize... | 49.953125 | 79 | 0.605067 |
bed6b5f46562627b6b75936df3852e61dcacd534 | 1,010 | py | Python | examples/gps/learned/mf_lqr.py | Oak2d2/trajopt | 82d69e81571d06d61ff9b472f1e715c48999cd78 | [
"MIT"
] | null | null | null | examples/gps/learned/mf_lqr.py | Oak2d2/trajopt | 82d69e81571d06d61ff9b472f1e715c48999cd78 | [
"MIT"
] | null | null | null | examples/gps/learned/mf_lqr.py | Oak2d2/trajopt | 82d69e81571d06d61ff9b472f1e715c48999cd78 | [
"MIT"
] | null | null | null | import autograd.numpy as np
import gym
from trajopt.gps import MFGPS
import matplotlib.pyplot as plt
import warnings
warnings.filterwarnings("ignore")
np.random.seed(1337)
# lqr task
env = gym.make('LQR-TO-v0')
env._max_episode_steps = 100000
env.seed(1337)
prior = {'K': 1e-6, 'psi': 1e-6, 'nu': 0.1}
alg = MFGP... | 19.056604 | 67 | 0.637624 |
9e08fc37cc3f7a01b3da9144fc7b4eb6849031d6 | 14,728 | py | Python | imagetests/test_color_module.py | martinmcbride/pytexture | 96bf7d530eeeb272552625dc7e8d2d5d105a493c | [
"MIT"
] | null | null | null | imagetests/test_color_module.py | martinmcbride/pytexture | 96bf7d530eeeb272552625dc7e8d2d5d105a493c | [
"MIT"
] | null | null | null | imagetests/test_color_module.py | martinmcbride/pytexture | 96bf7d530eeeb272552625dc7e8d2d5d105a493c | [
"MIT"
] | null | null | null | import unittest
from generativepy.geometry import Transform, Square
from generativepy.color import Color, ArtisticColorScheme, DarkColorScheme
from generativepy.drawing import make_image, setup
from image_test_helper import run_image_test
"""
Test each function of the color module
"""
class TestDrawingModule(unit... | 39.170213 | 112 | 0.539449 |
c5900612a4827be2d1c927c183198e054b87d2e1 | 518 | py | Python | examples/process.py | kernsuite-debian/python-graphviz | ca9a5c16a99a33601a312053bddda148684cb0ea | [
"MIT"
] | null | null | null | examples/process.py | kernsuite-debian/python-graphviz | ca9a5c16a99a33601a312053bddda148684cb0ea | [
"MIT"
] | null | null | null | examples/process.py | kernsuite-debian/python-graphviz | ca9a5c16a99a33601a312053bddda148684cb0ea | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# process.py - http://www.graphviz.org/content/process
from graphviz import Graph
g = Graph('G', filename='process.gv', engine='sfdp')
g.edge('run', 'intr')
g.edge('intr', 'runbl')
g.edge('runbl', 'run')
g.edge('run', 'kernel')
g.edge('kernel', 'zombie')
g.edge('kernel', 'sleep')
g... | 22.521739 | 55 | 0.606178 |
16e010792f3b12a090f6510ff04db8196575ce8f | 8,514 | py | Python | setup.py | jiayisunx/intel-extension-for-pytorch | ed82813091b8a49bd2db2d87280e7be5e7821335 | [
"Apache-2.0"
] | null | null | null | setup.py | jiayisunx/intel-extension-for-pytorch | ed82813091b8a49bd2db2d87280e7be5e7821335 | [
"Apache-2.0"
] | null | null | null | setup.py | jiayisunx/intel-extension-for-pytorch | ed82813091b8a49bd2db2d87280e7be5e7821335 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
from __future__ import print_function
try:
import torch
except ImportError as e:
print('Unable to import torch. Error:')
print('\t', e)
print('You need to install pytorch first.')
sys.exit(1)
from subprocess import check_call
from setuptools import setup, Extension, find_pack... | 32.25 | 106 | 0.666784 |
34b066151cd56bc1c8c8ca3df7739598d74a381b | 8,325 | py | Python | courses/cs231n/assignment1/cs231n/classifiers/k_nearest_neighbor.py | harisriaz17/deep-learning-projects | b68ed72b0bbcedf5bb9ba0ede2ef8936cc41905a | [
"MIT"
] | null | null | null | courses/cs231n/assignment1/cs231n/classifiers/k_nearest_neighbor.py | harisriaz17/deep-learning-projects | b68ed72b0bbcedf5bb9ba0ede2ef8936cc41905a | [
"MIT"
] | null | null | null | courses/cs231n/assignment1/cs231n/classifiers/k_nearest_neighbor.py | harisriaz17/deep-learning-projects | b68ed72b0bbcedf5bb9ba0ede2ef8936cc41905a | [
"MIT"
] | null | null | null | import numpy as np
class KNearestNeighbor(object):
""" a kNN classifier with L2 distance """
def __init__(self):
pass
def train(self, X, y):
"""
Train the classifier. For k-nearest neighbors this is just
memorizing the training data.
Inputs:
- X: A numpy array of shape (num_train, D)... | 45.741758 | 123 | 0.464505 |
8b3a38e1f1250fb151af48fa89bca784d3dd822c | 973 | py | Python | day1/platform_1.py | kaka8686/practise | 010632e68694d9e7e0e60f8c7b8aaa8489f557c7 | [
"Apache-2.0"
] | null | null | null | day1/platform_1.py | kaka8686/practise | 010632e68694d9e7e0e60f8c7b8aaa8489f557c7 | [
"Apache-2.0"
] | 7 | 2019-12-26T17:33:01.000Z | 2022-03-21T22:18:02.000Z | day1/platform_1.py | kaka8686/practise | 010632e68694d9e7e0e60f8c7b8aaa8489f557c7 | [
"Apache-2.0"
] | null | null | null | """
Version: 0.1
Author: Spike
"""
#!/bin/python
import platform
def TestPlatform():
print ("----------Operation System--------------------------")
#Windows will be : (32bit, WindowsPE)
#Linux will be : (32bit, ELF)
print(platform.architecture())
#Windows will be : Windows-XP-5.1.2600-SP3 or ... | 24.325 | 81 | 0.597122 |
73da648c0a748f03ab258a891a19e51963061934 | 26 | py | Python | google/__init__.py | willgeorgetaylor/alfred-elixir-search | e94dbf3adb3999d51cac4a4956b475a1f81d6d42 | [
"MIT"
] | null | null | null | google/__init__.py | willgeorgetaylor/alfred-elixir-search | e94dbf3adb3999d51cac4a4956b475a1f81d6d42 | [
"MIT"
] | null | null | null | google/__init__.py | willgeorgetaylor/alfred-elixir-search | e94dbf3adb3999d51cac4a4956b475a1f81d6d42 | [
"MIT"
] | null | null | null | from google import search
| 13 | 25 | 0.846154 |
146428b5d14152d90c85ed1b415596fc7357f853 | 8,175 | py | Python | openmdao.util/src/openmdao/util/test/test_decorators.py | swryan/OpenMDAO-Framework | f50d60e1a8cadac7fe03d26ffad5fb660b2a15ec | [
"Apache-2.0"
] | null | null | null | openmdao.util/src/openmdao/util/test/test_decorators.py | swryan/OpenMDAO-Framework | f50d60e1a8cadac7fe03d26ffad5fb660b2a15ec | [
"Apache-2.0"
] | null | null | null | openmdao.util/src/openmdao/util/test/test_decorators.py | swryan/OpenMDAO-Framework | f50d60e1a8cadac7fe03d26ffad5fb660b2a15ec | [
"Apache-2.0"
] | null | null | null |
import unittest
from inspect import getmembers, ismethod, isfunction
from enthought.traits.api import HasTraits, Float
from zope.interface import Interface, implements, implementedBy
from openmdao.main.interfaces import obj_has_interface
from openmdao.util.decorators import add_delegate, stub_if_missing_deps
clas... | 31.442308 | 172 | 0.585933 |
640cedbdec58f9983caae84207d932c17630b9b8 | 19,089 | py | Python | mmdetection/mmdet/core/evaluation/mean_ap.py | lizhaoliu-Lec/Conformer | 577cff26b78b338f035c075727c408fca3272208 | [
"Apache-2.0"
] | null | null | null | mmdetection/mmdet/core/evaluation/mean_ap.py | lizhaoliu-Lec/Conformer | 577cff26b78b338f035c075727c408fca3272208 | [
"Apache-2.0"
] | null | null | null | mmdetection/mmdet/core/evaluation/mean_ap.py | lizhaoliu-Lec/Conformer | 577cff26b78b338f035c075727c408fca3272208 | [
"Apache-2.0"
] | null | null | null | from multiprocessing import Pool
import mmcv
import numpy as np
from mmcv.utils import print_log
from terminaltables import AsciiTable
from .bbox_overlaps import bbox_overlaps
from .class_names import get_classes
def average_precision(recalls, precisions, mode='area'):
"""Calculate average precision (for single... | 40.614894 | 78 | 0.567971 |
75c82701ef81f9b17ffd6ac6f9c2b62a76545d0c | 4,855 | py | Python | python/src/nnabla/utils/converter/tensorflow/refine_parser.py | Mattlk13/nnabla | 09b7dfd03bd88366d1d1f6cc61492b42175e35e7 | [
"Apache-2.0"
] | null | null | null | python/src/nnabla/utils/converter/tensorflow/refine_parser.py | Mattlk13/nnabla | 09b7dfd03bd88366d1d1f6cc61492b42175e35e7 | [
"Apache-2.0"
] | 1 | 2020-11-09T07:33:29.000Z | 2020-11-09T07:33:29.000Z | python/src/nnabla/utils/converter/tensorflow/refine_parser.py | Mattlk13/nnabla | 09b7dfd03bd88366d1d1f6cc61492b42175e35e7 | [
"Apache-2.0"
] | null | null | null | import tensorflow as tf
from ply import yacc
import re
from .refine_graph import Token, RefineGraph
class RefineParser:
def __init__(self, graph):
self.graph = graph
self.tokens = Token.tokens
self.parser = yacc.yacc(module=self,
start='rf_net',
... | 33.951049 | 108 | 0.415448 |
4c1906f580d361bc498437a1bde4f753342f1479 | 1,209 | py | Python | corehq/apps/users/views/utils.py | dimagilg/commcare-hq | ea1786238eae556bb7f1cbd8d2460171af1b619c | [
"BSD-3-Clause"
] | 1 | 2020-07-14T13:00:23.000Z | 2020-07-14T13:00:23.000Z | corehq/apps/users/views/utils.py | dimagilg/commcare-hq | ea1786238eae556bb7f1cbd8d2460171af1b619c | [
"BSD-3-Clause"
] | 94 | 2020-12-11T06:57:31.000Z | 2022-03-15T10:24:06.000Z | corehq/apps/users/views/utils.py | dimagilg/commcare-hq | ea1786238eae556bb7f1cbd8d2460171af1b619c | [
"BSD-3-Clause"
] | null | null | null | from django.utils.translation import ugettext as _
from corehq.apps.users.models import (
AdminUserRole,
DomainMembershipError,
UserRole,
)
def get_editable_role_choices(domain, couch_user, allow_admin_role, use_qualified_id=True):
"""
:param domain: roles for domain
:param couch_user: user a... | 34.542857 | 92 | 0.684036 |
e041585b576acd10e595af826d5078d403561384 | 915 | py | Python | src/bert_summarizer/trainers/lr_lambda.py | k-tahiro/bert-summarizer | 03a09676130e4706b42ba6ab53c545fd10b84bce | [
"MIT"
] | 8 | 2020-10-05T02:34:40.000Z | 2021-11-29T01:38:41.000Z | src/bert_summarizer/trainers/lr_lambda.py | k-tahiro/bert-summarizer | 03a09676130e4706b42ba6ab53c545fd10b84bce | [
"MIT"
] | 5 | 2021-04-01T07:15:26.000Z | 2022-03-15T02:48:18.000Z | src/bert_summarizer/trainers/lr_lambda.py | k-tahiro/bert-summarizer | 03a09676130e4706b42ba6ab53c545fd10b84bce | [
"MIT"
] | 2 | 2021-09-30T09:10:55.000Z | 2022-01-29T03:05:46.000Z | from typing import List, Union
from torch.optim import Optimizer
from torch.optim.lr_scheduler import LambdaLR
class TransformerScheduler:
def __init__(self, num_warmup_steps: int):
self.num_warmup_steps = num_warmup_steps
def __call__(self, current_step: int) -> float:
if current_step < sel... | 32.678571 | 87 | 0.722404 |
20c8aa74c1adbe05e15dd86469482785c8364c22 | 1,540 | py | Python | phenotype/States/Duration.py | kamalm87/phenotype | 92ff1c3ec6b21cd540caf10880ef532270d85110 | [
"MIT"
] | null | null | null | phenotype/States/Duration.py | kamalm87/phenotype | 92ff1c3ec6b21cd540caf10880ef532270d85110 | [
"MIT"
] | null | null | null | phenotype/States/Duration.py | kamalm87/phenotype | 92ff1c3ec6b21cd540caf10880ef532270d85110 | [
"MIT"
] | null | null | null | from datetime import timedelta as __dt_time_delta__
from math import floor as __math_floor__
class Duration(object):
''' '''
__slots__ = '_time_delta'
days = property( lambda self : self._time_delta.days )
seconds = property( lambda self : self._time_delta.seconds )
total_seco... | 30.196078 | 87 | 0.57013 |
57567505ab733a0124618b9e15a90ba4db09c57f | 684 | py | Python | mbed_project/exceptions.py | ARMmbed/mbed-project | 9ab0a7f519196560f53a028e2d796179297b7321 | [
"Apache-2.0"
] | 4 | 2020-03-05T23:24:13.000Z | 2021-09-04T22:36:16.000Z | mbed_project/exceptions.py | ARMmbed/mbed-project | 9ab0a7f519196560f53a028e2d796179297b7321 | [
"Apache-2.0"
] | 19 | 2020-03-26T14:00:22.000Z | 2020-07-09T21:53:46.000Z | mbed_project/exceptions.py | ARMmbed/mbed-project | 9ab0a7f519196560f53a028e2d796179297b7321 | [
"Apache-2.0"
] | null | null | null | #
# Copyright (C) 2020 Arm Mbed. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
"""Public exceptions exposed by the package."""
from mbed_tools_lib.exceptions import ToolsError
class MbedProjectError(ToolsError):
"""Base exception for mbed-project."""
class VersionControlError(MbedProjectError):
... | 24.428571 | 67 | 0.744152 |
10160026d29a13225e870866600be66680213cb6 | 542 | py | Python | setup.py | anvilerp/dockerized_app | f9cafe24d9f743430c7c61ab12363233c419b7de | [
"MIT"
] | null | null | null | setup.py | anvilerp/dockerized_app | f9cafe24d9f743430c7c61ab12363233c419b7de | [
"MIT"
] | null | null | null | setup.py | anvilerp/dockerized_app | f9cafe24d9f743430c7c61ab12363233c419b7de | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from setuptools import setup, find_packages
with open('requirements.txt') as f:
install_requires = f.read().strip().split('\n')
# get version from __version__ variable in dockerized_app/__init__.py
from dockerized_app import __version__ as version
setup(
name='dockerized_app',
version=vers... | 25.809524 | 69 | 0.771218 |
f0714c86c847f65438d0d2b977bff8f1741d35ae | 120,879 | py | Python | test/augmentables/test_polys.py | alisure-fork/imgaug | 037abbd0d9f8dd8949c10858bf4aa2f7762c6add | [
"MIT"
] | 2 | 2020-07-09T07:42:42.000Z | 2020-11-17T14:49:49.000Z | test/augmentables/test_polys.py | alisure-fork/imgaug | 037abbd0d9f8dd8949c10858bf4aa2f7762c6add | [
"MIT"
] | 3 | 2020-01-28T23:03:44.000Z | 2020-11-13T18:26:39.000Z | test/augmentables/test_polys.py | alisure-fork/imgaug | 037abbd0d9f8dd8949c10858bf4aa2f7762c6add | [
"MIT"
] | 1 | 2020-08-29T07:48:48.000Z | 2020-08-29T07:48:48.000Z | from __future__ import print_function, division, absolute_import
import time
import warnings
import sys
# unittest only added in 3.4 self.subTest()
if sys.version_info[0] < 3 or sys.version_info[1] < 4:
import unittest2 as unittest
else:
import unittest
# unittest.mock is not available in 2.7 (though unittest2... | 41.115306 | 101 | 0.539233 |
37bbdf4178415d40bddb092b2e7cbbb74f2b30bf | 12,652 | py | Python | onnxruntime/python/tools/quantization/quantize.py | surepassio/onnxruntime | 8d134edf8d67fd8dadb8039b2bd53ae839920a0c | [
"MIT"
] | 1 | 2020-10-21T11:54:26.000Z | 2020-10-21T11:54:26.000Z | onnxruntime/python/tools/quantization/quantize.py | surepassio/onnxruntime | 8d134edf8d67fd8dadb8039b2bd53ae839920a0c | [
"MIT"
] | null | null | null | onnxruntime/python/tools/quantization/quantize.py | surepassio/onnxruntime | 8d134edf8d67fd8dadb8039b2bd53ae839920a0c | [
"MIT"
] | 1 | 2020-09-11T02:23:48.000Z | 2020-09-11T02:23:48.000Z | # -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
import os
... | 43.180887 | 162 | 0.683765 |
ca7aaf0d27786d0d1b6110d5b7821183f0fa08f7 | 2,383 | py | Python | main.py | Plouffi/Feh-Pass-Reviews | 0e4722da7f752a1b82ef7a65f43f7a76389f22b3 | [
"MIT"
] | 3 | 2020-02-18T20:40:11.000Z | 2020-03-16T15:05:13.000Z | main.py | Plouffi/Feh-Pass-Reviews | 0e4722da7f752a1b82ef7a65f43f7a76389f22b3 | [
"MIT"
] | null | null | null | main.py | Plouffi/Feh-Pass-Reviews | 0e4722da7f752a1b82ef7a65f43f7a76389f22b3 | [
"MIT"
] | null | null | null | from data_manager import DataManager, plot_fehpass_mention, plot_score_distribution
from scraper import Scraper
from datetime import date as dt
from cloud import Cloud
import sys
import json
def load_config():
with open("./ressources/config.json") as f:
config = json.load(f)
return config
def save_last_import()... | 25.351064 | 97 | 0.738984 |
afc6aaec48300fd2e6b3fc10a8fd2a7fc89321bf | 9,345 | py | Python | tools/inference_net.py | bqhuyy/SlowFast-clean | 3dc000dc9fe1951ab70cb835bfb91b71a07d8f63 | [
"Apache-2.0"
] | null | null | null | tools/inference_net.py | bqhuyy/SlowFast-clean | 3dc000dc9fe1951ab70cb835bfb91b71a07d8f63 | [
"Apache-2.0"
] | null | null | null | tools/inference_net.py | bqhuyy/SlowFast-clean | 3dc000dc9fe1951ab70cb835bfb91b71a07d8f63 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import torch
import os
import pandas as pd
import torch.nn as nn
import torchfunc
import slowfast.utils.checkpoint as cu
import slowfast.utils.distributed as du
import slowfast.utils.logging as logging
import slowfast.utils.misc as misc
from slowfast.models import build_model
import slowfast.models.... | 37.38 | 102 | 0.592081 |
e51e73549326a80290ab831503dbfc476c6b672c | 42,084 | py | Python | stable_projects/fMRI_dynamics/Kong2021_pMFM/part2_pMFM_control_analysis/Individual_analysis/scripts/CBIG_pMFM_basic_functions.py | marielacour81/CBIG | 511af756c6ddabbd3a9681ce3514b79ef5aaaf3f | [
"MIT"
] | 1 | 2021-12-18T09:35:59.000Z | 2021-12-18T09:35:59.000Z | stable_projects/fMRI_dynamics/Kong2021_pMFM/part2_pMFM_control_analysis/Individual_analysis/scripts/CBIG_pMFM_basic_functions.py | marielacour81/CBIG | 511af756c6ddabbd3a9681ce3514b79ef5aaaf3f | [
"MIT"
] | null | null | null | stable_projects/fMRI_dynamics/Kong2021_pMFM/part2_pMFM_control_analysis/Individual_analysis/scripts/CBIG_pMFM_basic_functions.py | marielacour81/CBIG | 511af756c6ddabbd3a9681ce3514b79ef5aaaf3f | [
"MIT"
] | null | null | null | # /usr/bin/env python
'''
Written by Kong Xiaolu and CBIG under MIT license:
https://github.com/ThomasYeoLab/CBIG/blob/master/LICENSE.md
'''
import csv
import math
import time
import numpy as np
import torch
import scipy.io as sio
'''******************** Functions for computing simulated BOLD signals **************... | 37.209549 | 102 | 0.588181 |
bd89cc9df64ba53864ad75440a631ed99f323159 | 4,208 | py | Python | Monotop/python/NoTagPFSelection.py | GuillelmoGomezCeballos/PandaAnalysis | 87a62effbe320d0d981e032f240c057e5ab2d3fc | [
"MIT"
] | null | null | null | Monotop/python/NoTagPFSelection.py | GuillelmoGomezCeballos/PandaAnalysis | 87a62effbe320d0d981e032f240c057e5ab2d3fc | [
"MIT"
] | 3 | 2017-12-09T06:50:57.000Z | 2018-02-22T08:58:12.000Z | Monotop/python/NoTagPFSelection.py | GuillelmoGomezCeballos/PandaAnalysis | 87a62effbe320d0d981e032f240c057e5ab2d3fc | [
"MIT"
] | 1 | 2017-09-24T18:29:16.000Z | 2017-09-24T18:29:16.000Z | from PandaCore.Tools.Misc import *
from re import sub
triggers = {
'met':'(trigger&1)!=0',
'ele':'(trigger&2)!=0',
'pho':'(trigger&4)!=0',
}
metFilter='metFilter==1'
topTagSF = '%f*(fj1IsMatched==1)+%f*(fj1IsMatched==0)'%(1.,1.)
#ak4bTagSF = 'sf_btag0*(isojetNBtags==0)+sf_btag1*(isojetNBtags==1)+1*(isojet... | 63.757576 | 199 | 0.682034 |
0ab34ac7a9ba6ac72297d075e39f83af6b1af811 | 123 | py | Python | 3. Python Advanced (September 2021)/3.2 Python OOP (October 2021)/12. Exercise - Polymorphism and Abstraction/05_animals/project/cat.py | kzborisov/SoftUni | ccb2b8850adc79bfb2652a45124c3ff11183412e | [
"MIT"
] | 1 | 2021-02-07T07:51:12.000Z | 2021-02-07T07:51:12.000Z | 3. Python Advanced (September 2021)/3.2 Python OOP (October 2021)/12. Exercise - Polymorphism and Abstraction/05_animals/project/cat.py | kzborisov/softuni | 9c5b45c74fa7d9748e9b3ea65a5ae4e15c142751 | [
"MIT"
] | null | null | null | 3. Python Advanced (September 2021)/3.2 Python OOP (October 2021)/12. Exercise - Polymorphism and Abstraction/05_animals/project/cat.py | kzborisov/softuni | 9c5b45c74fa7d9748e9b3ea65a5ae4e15c142751 | [
"MIT"
] | null | null | null | from project.animal import Animal
class Cat(Animal):
@staticmethod
def make_sound():
return "Meow meow!"
| 15.375 | 33 | 0.666667 |
a8fb8e02ed64d9ac157bf1f6bd4ad49056dfcae8 | 91,590 | py | Python | pkgs/statsmodels-0.6.1-np110py27_0/lib/python2.7/site-packages/statsmodels/genmod/generalized_estimating_equations.py | wangyum/anaconda | 6e5a0dbead3327661d73a61e85414cf92aa52be6 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | pkgs/statsmodels-0.6.1-np110py27_0/lib/python2.7/site-packages/statsmodels/genmod/generalized_estimating_equations.py | wangyum/anaconda | 6e5a0dbead3327661d73a61e85414cf92aa52be6 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | pkgs/statsmodels-0.6.1-np110py27_0/lib/python2.7/site-packages/statsmodels/genmod/generalized_estimating_equations.py | wangyum/anaconda | 6e5a0dbead3327661d73a61e85414cf92aa52be6 | [
"Apache-2.0",
"BSD-3-Clause"
] | 1 | 2021-05-02T10:50:15.000Z | 2021-05-02T10:50:15.000Z | """
Procedures for fitting marginal regression models to dependent data
using Generalized Estimating Equations.
References
----------
KY Liang and S Zeger. "Longitudinal data analysis using
generalized linear models". Biometrika (1986) 73 (1): 13-22.
S Zeger and KY Liang. "Longitudinal Data Analysis for Discrete and
... | 36.044864 | 89 | 0.572082 |
1de602adf1571368610109f1a21b494038dd8f75 | 1,810 | py | Python | cms/utils/md5_file_field.py | ninapavlich/smartclock | 83301cc9efc1170f1921c9e8a51355eb1d10d88e | [
"MIT"
] | 1 | 2018-12-20T09:39:07.000Z | 2018-12-20T09:39:07.000Z | cms/utils/md5_file_field.py | ninapavlich/smartclock | 83301cc9efc1170f1921c9e8a51355eb1d10d88e | [
"MIT"
] | 3 | 2020-06-05T17:37:07.000Z | 2021-06-10T19:27:13.000Z | cms/utils/md5_file_field.py | ninapavlich/smartclock | 83301cc9efc1170f1921c9e8a51355eb1d10d88e | [
"MIT"
] | 1 | 2021-04-10T01:16:24.000Z | 2021-04-10T01:16:24.000Z | import hashlib
from django.db import models
from django.db.models.fields.files import FileDescriptor, FieldFile, ImageFieldFile, ImageFileDescriptor
class MD5FieldFileMixin(object):
_md5 = None
def __init__(self, *args, **kwargs):
file_field = args[1]
self.md5_field = file_field.md5_field
... | 28.730159 | 104 | 0.69116 |
308671dfe33aae62116a48c81824ec282510c918 | 10,919 | py | Python | imagedObject.py | s-neilson/CORNISH-CNN-classifier | 983754c582276a80f0bc28ccf5e8124840958d03 | [
"MIT"
] | 2 | 2019-06-23T06:58:51.000Z | 2019-11-21T01:36:48.000Z | imagedObject.py | s-neilson/CORNISH-CNN-classifier | 983754c582276a80f0bc28ccf5e8124840958d03 | [
"MIT"
] | null | null | null | imagedObject.py | s-neilson/CORNISH-CNN-classifier | 983754c582276a80f0bc28ccf5e8124840958d03 | [
"MIT"
] | null | null | null | import copy
import os
from astropy.io import fits
from astropy.visualization import MinMaxInterval
from scipy.misc import imresize
import numpy
import keras_preprocessing
class ImagedObject:
name=""
label=()
imageSize=0
imageData=None #All of the data from the fits files in a 3d numpy array. ... | 56.283505 | 216 | 0.69173 |
f7dc1f7b2630e19f4c8d338b8af2401b5b97cb00 | 3,977 | py | Python | trinity/components/builtin/syncer/cli.py | dendisuhubdy/trinity | 001664781259c7dd0779a0ef6f822451b608ded4 | [
"MIT"
] | null | null | null | trinity/components/builtin/syncer/cli.py | dendisuhubdy/trinity | 001664781259c7dd0779a0ef6f822451b608ded4 | [
"MIT"
] | null | null | null | trinity/components/builtin/syncer/cli.py | dendisuhubdy/trinity | 001664781259c7dd0779a0ef6f822451b608ded4 | [
"MIT"
] | null | null | null | import argparse
import os
from pathlib import PurePosixPath
import re
import urllib
from typing import (
Any,
)
from eth_typing import (
Hash32,
HexStr,
)
from eth_utils import (
decode_hex,
is_hex,
to_int,
remove_0x_prefix,
ValidationError,
)
from trinity.sync.common.checkpoint impor... | 29.459259 | 99 | 0.682424 |
3882853126b6109ac480a2649474d3bdfeaebc44 | 974 | py | Python | website/project/commentable.py | DanielSBrown/osf.io | 98dda2ac237377197acacce78274bc0a4ce8f303 | [
"Apache-2.0"
] | 1 | 2015-10-02T18:35:53.000Z | 2015-10-02T18:35:53.000Z | website/project/commentable.py | DanielSBrown/osf.io | 98dda2ac237377197acacce78274bc0a4ce8f303 | [
"Apache-2.0"
] | 18 | 2020-03-24T15:26:02.000Z | 2022-03-08T21:30:39.000Z | website/project/commentable.py | DanielSBrown/osf.io | 98dda2ac237377197acacce78274bc0a4ce8f303 | [
"Apache-2.0"
] | 1 | 2018-11-06T11:03:48.000Z | 2018-11-06T11:03:48.000Z | class Commentable(object):
"""Abstract class that defines the interface for models that have comments attached to them."""
@property
def target_type(self):
""" The object "type" used in the OSF v2 API. E.g. Comment objects have the type 'comments'."""
raise NotImplementedError
@propert... | 36.074074 | 103 | 0.667351 |
7d097abc2dad41abc87bfbf1b7714a39bfa565d4 | 367 | py | Python | accounts/urls.py | SLAteam/sla-mgmt | 4ec9c300e923c9e1ca15821ba1ab6d9c0c12f63e | [
"BSD-3-Clause"
] | null | null | null | accounts/urls.py | SLAteam/sla-mgmt | 4ec9c300e923c9e1ca15821ba1ab6d9c0c12f63e | [
"BSD-3-Clause"
] | 7 | 2018-12-03T22:59:16.000Z | 2018-12-31T12:41:20.000Z | accounts/urls.py | SLAteam/sla-mgmt | 4ec9c300e923c9e1ca15821ba1ab6d9c0c12f63e | [
"BSD-3-Clause"
] | null | null | null | #from django.conf.urls import url
from . import views
#from django.contrib.auth import views as auth_views
from django.urls import path
urlpatterns = [
# url(r'^$', views.home),
# url(r'^loggedin$', views.loggedin),
# url(r'^login/$', auth_views.LoginView.as_view(template_name='accounts/login.html'), name='lo... | 33.363636 | 103 | 0.697548 |
5fc702c6c802cd5f4c9e283890493f6c826fa7ec | 509 | py | Python | API/PlayingWithAPIsUsingPython/01/01.py | JamieBort/LearningDirectory | afca79c5f1333c079d0e96202ff44ca21b2ceb81 | [
"Info-ZIP"
] | 1 | 2022-02-02T21:56:08.000Z | 2022-02-02T21:56:08.000Z | API/PlayingWithAPIsUsingPython/01/01.py | JamieBort/LearningDirectory | afca79c5f1333c079d0e96202ff44ca21b2ceb81 | [
"Info-ZIP"
] | 27 | 2020-06-27T23:25:59.000Z | 2022-02-27T20:40:56.000Z | API/PlayingWithAPIsUsingPython/01/01.py | JamieBort/LearningDirectory | afca79c5f1333c079d0e96202ff44ca21b2ceb81 | [
"Info-ZIP"
] | null | null | null | import requests
try:
r = requests.get("https://opentdb.com/api.php?amount=1&category=12&difficulty=easy&type=multiple")
# r = requests.get("")
print("The response/status code:")
print(r.status_code) # Hoping for a 200 response.
# The following is the response:
# 200
# print(x)
except NameE... | 36.357143 | 102 | 0.685658 |
4d47c6ef9b6de504cd31ee8d5f4aecee975b38ea | 920 | py | Python | src/blender/blender_autocomplete-master/2.92/bpy/ops/palette.py | JonasWard/ClayAdventures | a716445ac690e4792e70658319aa1d5299f9c9e9 | [
"MIT"
] | 1 | 2020-03-25T10:55:10.000Z | 2020-03-25T10:55:10.000Z | src/blender/blender_autocomplete-master/2.92/bpy/ops/palette.py | JonasWard/ClayAdventures | a716445ac690e4792e70658319aa1d5299f9c9e9 | [
"MIT"
] | null | null | null | src/blender/blender_autocomplete-master/2.92/bpy/ops/palette.py | JonasWard/ClayAdventures | a716445ac690e4792e70658319aa1d5299f9c9e9 | [
"MIT"
] | null | null | null | import sys
import typing
def color_add():
''' Add new color to active palette
'''
pass
def color_delete():
''' Remove active color from palette
'''
pass
def color_move(type: typing.Union[int, str] = 'UP'):
''' Move the active Color up/down in the list
:param type: Type
:ty... | 13.731343 | 61 | 0.591304 |
044a4420da651b6c2719aa5d9767d5cc0869f94d | 5,550 | py | Python | test/test_bossutil.py | jhuapl-boss/ndingest | 9e6efc9c51b0fc639a34ae414f360cf09323a2c1 | [
"Apache-2.0"
] | 1 | 2018-08-04T21:58:12.000Z | 2018-08-04T21:58:12.000Z | test/test_bossutil.py | jhuapl-boss/ndingest | 9e6efc9c51b0fc639a34ae414f360cf09323a2c1 | [
"Apache-2.0"
] | 2 | 2018-05-30T23:07:26.000Z | 2018-06-20T15:31:33.000Z | test/test_bossutil.py | jhuapl-boss/ndingest | 9e6efc9c51b0fc639a34ae414f360cf09323a2c1 | [
"Apache-2.0"
] | 1 | 2018-04-05T16:37:23.000Z | 2018-04-05T16:37:23.000Z | # Copyright 2016 The Johns Hopkins University Applied Physics Laboratory
#
# 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... | 38.013699 | 75 | 0.603243 |
75bc02146eb8a1946ded21cb925897f307ca6169 | 95,478 | py | Python | tests/hwsim/test_wpas_mesh.py | majacQ/fragattacks | 282660acab6547e542d4ca830e40708c97fdcc06 | [
"Unlicense"
] | 1,104 | 2021-05-11T18:45:36.000Z | 2022-03-30T22:39:34.000Z | tests/hwsim/test_wpas_mesh.py | majacQ/fragattacks | 282660acab6547e542d4ca830e40708c97fdcc06 | [
"Unlicense"
] | 44 | 2021-05-12T01:12:58.000Z | 2022-03-31T07:09:52.000Z | tests/hwsim/test_wpas_mesh.py | majacQ/fragattacks | 282660acab6547e542d4ca830e40708c97fdcc06 | [
"Unlicense"
] | 168 | 2021-05-11T22:02:54.000Z | 2022-03-24T03:21:51.000Z | # wpa_supplicant mesh mode tests
# Copyright (c) 2014, cozybit Inc.
#
# This software may be distributed under the terms of the BSD license.
# See README for more details.
import logging
logger = logging.getLogger()
import os
import struct
import subprocess
import time
import json
import binascii
import hwsim_utils
i... | 37.663905 | 311 | 0.641928 |
8da3b6d255e530f90ed059628979ce7746dc4611 | 3,271 | py | Python | toolbox/nn/TuckERTTT.py | LinXueyuanStdio/KGE-toolbox | 916842835e61ba99dde1409592977a2ec55f8aae | [
"Apache-2.0"
] | 2 | 2021-10-17T17:50:24.000Z | 2021-12-13T05:22:46.000Z | toolbox/nn/TuckERTTT.py | LinXueyuanStdio/KGE-toolbox | 916842835e61ba99dde1409592977a2ec55f8aae | [
"Apache-2.0"
] | null | null | null | toolbox/nn/TuckERTTT.py | LinXueyuanStdio/KGE-toolbox | 916842835e61ba99dde1409592977a2ec55f8aae | [
"Apache-2.0"
] | null | null | null | import numpy as np
import torch
import torch.nn as nn
class TuckERTTT(nn.Module):
def __init__(self, d, de, dr, dt, ranks, device='cpu', input_dropout=0., hidden_dropout1=0., hidden_dropout2=0., **kwargs):
super(TuckERTTT, self).__init__()
self.device = device
# Embeddings dimensionality... | 33.040404 | 158 | 0.579028 |
9889bffe7b8ece8de975e8db9c1206dcb444df1e | 2,283 | py | Python | mosqito/functions/sound_level_meter/LN.py | Igarciac117/MoSQITo | a52f9ff120db9f9c46f4309d28d9e1568a5b4120 | [
"Apache-2.0"
] | 1 | 2022-02-20T15:09:32.000Z | 2022-02-20T15:09:32.000Z | mosqito/functions/sound_level_meter/LN.py | Igarciac117/MoSQITo | a52f9ff120db9f9c46f4309d28d9e1568a5b4120 | [
"Apache-2.0"
] | null | null | null | mosqito/functions/sound_level_meter/LN.py | Igarciac117/MoSQITo | a52f9ff120db9f9c46f4309d28d9e1568a5b4120 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Wen Dic 1 18:08:08 2021
@author: Igarciac117
"""
# Third party imports
import numpy as np
import math
# Local imports
from mosqito.functions.shared.load import load
from mosqito.functions.oct3filter.calc_third_octave_levels import calc_third_octave_levels
def LN(db_samples_si... | 35.123077 | 117 | 0.689882 |
1af680fbb6fc1d24c15ae6d565654b2e6a51c365 | 208 | py | Python | Numpy/create_4_by_3_matrix.py | abhishekkulkarni24/Machine-Learning | 8bf49a5c9c669ce078250f164376606546c9e81f | [
"MIT"
] | 1 | 2021-03-18T14:25:33.000Z | 2021-03-18T14:25:33.000Z | Numpy/create_4_by_3_matrix.py | abhishekkulkarni24/Machine-Learning | 8bf49a5c9c669ce078250f164376606546c9e81f | [
"MIT"
] | null | null | null | Numpy/create_4_by_3_matrix.py | abhishekkulkarni24/Machine-Learning | 8bf49a5c9c669ce078250f164376606546c9e81f | [
"MIT"
] | null | null | null | #Write code to create a 4x3 matrix with values ranging from 2 to 13
import numpy as np
matrix = np.arange(2,14).reshape(4,3);
print(matrix)
'''
Output
[[ 2 3 4]
[ 5 6 7]
[ 8 9 10]
[11 12 13]]
''' | 13 | 67 | 0.610577 |
92e0b453c99e092b3e684dbb3b8dacfcfb13823b | 637 | py | Python | 第11章/program/baidu/spiders/exercise11_2.py | kingname/SourceCodeOfBook | ab7275108994dca564905818b678bbd2f771c18e | [
"MIT"
] | 274 | 2018-10-01T11:07:25.000Z | 2022-03-17T13:48:45.000Z | 第11章/program/baidu/spiders/exercise11_2.py | kingname/SourceCodeOfBook | ab7275108994dca564905818b678bbd2f771c18e | [
"MIT"
] | 6 | 2019-02-28T14:18:21.000Z | 2022-03-02T14:57:39.000Z | 第11章/program/baidu/spiders/exercise11_2.py | kingname/SourceCodeOfBook | ab7275108994dca564905818b678bbd2f771c18e | [
"MIT"
] | 110 | 2018-10-16T06:08:37.000Z | 2022-03-16T08:19:29.000Z | # -*- coding: utf-8 -*-
import scrapy
class Exercise112Spider(scrapy.Spider):
name = "exercise11_2"
allowed_domains = ["exercise.kingname.info"]
start_urls = ['http://exercise.kingname.info/exercise_xpath_2.html']
def parse(self, response):
item_list = response.xpath('//ul[@class="item"]')
... | 35.388889 | 72 | 0.587127 |
8a1249b8ee32aa136d40f1d5d55506fe19e4ba08 | 2,979 | py | Python | src/hiding_adversarial_attacks/classifiers/utils.py | inovex/hiding-adversarial-attacks | d00ce66349e8fd9c27c6207289ee73c23f1b3f99 | [
"MIT"
] | 1 | 2022-01-14T16:07:01.000Z | 2022-01-14T16:07:01.000Z | src/hiding_adversarial_attacks/classifiers/utils.py | inovex/hiding-adversarial-attacks | d00ce66349e8fd9c27c6207289ee73c23f1b3f99 | [
"MIT"
] | null | null | null | src/hiding_adversarial_attacks/classifiers/utils.py | inovex/hiding-adversarial-attacks | d00ce66349e8fd9c27c6207289ee73c23f1b3f99 | [
"MIT"
] | 1 | 2022-01-14T16:07:06.000Z | 2022-01-14T16:07:06.000Z | import torch
from torch import nn
from hiding_adversarial_attacks.classifiers.cifar_net import CifarNet
from hiding_adversarial_attacks.classifiers.mnist_net import MNISTNet
from hiding_adversarial_attacks.config.classifiers.classifier_config import (
ClassifierNames,
)
from hiding_adversarial_attacks.config.data_... | 35.464286 | 84 | 0.724404 |
777ff297d5444d2228cb1a33fc4d365aea823fbd | 287 | py | Python | prediction/drug_central/parser.py | hassanmohsin/ligandnet2 | 06cf02da8a4781b3c47892b47b449eb4d7c42a48 | [
"MIT"
] | null | null | null | prediction/drug_central/parser.py | hassanmohsin/ligandnet2 | 06cf02da8a4781b3c47892b47b449eb4d7c42a48 | [
"MIT"
] | 2 | 2020-01-24T00:51:48.000Z | 2020-01-30T03:45:57.000Z | prediction/drug_central/parser.py | hassanmohsin/ligandnet2 | 06cf02da8a4781b3c47892b47b449eb4d7c42a48 | [
"MIT"
] | 1 | 2020-01-14T05:01:30.000Z | 2020-01-14T05:01:30.000Z | import json
results = json.load(open('py27_results.json', 'r'))
results.update(json.load(open('py35_results.json', 'r')))
with open('active_compounds.txt', 'w') as f:
for k, v in results.items():
f.write("PROTEIN: {}\nACTIVE COMPOUNDS: {}\n\n".format(k, v))
#break
| 28.7 | 69 | 0.634146 |
56843f20589447d6ba410a942dba0153729cce2d | 10,512 | py | Python | configs/scene_graph/VG_PredCls_motif_mask_X_rcnn_x101_64x4d_fpn_1x.py | Kenneth-Wong/MMSceneGraph | bc5e0f3385205404c712ae9f702a61a3191da0a1 | [
"MIT"
] | 24 | 2021-10-14T03:28:28.000Z | 2022-03-29T09:30:04.000Z | configs/scene_graph/VG_PredCls_motif_mask_X_rcnn_x101_64x4d_fpn_1x.py | Kenneth-Wong/MMSceneGraph | bc5e0f3385205404c712ae9f702a61a3191da0a1 | [
"MIT"
] | 4 | 2021-12-14T15:04:49.000Z | 2022-02-19T09:54:42.000Z | configs/scene_graph/VG_PredCls_motif_mask_X_rcnn_x101_64x4d_fpn_1x.py | Kenneth-Wong/MMSceneGraph | bc5e0f3385205404c712ae9f702a61a3191da0a1 | [
"MIT"
] | 4 | 2021-10-31T11:23:06.000Z | 2021-12-17T06:38:50.000Z | # dataset settings
dataset_type = 'VisualGenomeDataset'
data_root = 'data/visualgenome/'
img_norm_cfg = dict(
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
train_pipeline = [
dict(type='LoadImageFromFile'),
dict(type='LoadAnnotations', with_bbox=True, with_rel=True),
... | 36.755245 | 115 | 0.586473 |
a67c08389e4aea6a6c8d54a03ea47a964ac64a4c | 1,604 | py | Python | mw4py/client.py | ry00001/wikipydia | 48640b771a7863fb7e6f46d066d0ef9e5e82ad8b | [
"MIT"
] | 3 | 2018-02-02T19:33:10.000Z | 2018-02-09T19:16:40.000Z | mw4py/client.py | ry00001/wikipydia | 48640b771a7863fb7e6f46d066d0ef9e5e82ad8b | [
"MIT"
] | 1 | 2018-02-18T16:14:01.000Z | 2018-07-23T22:33:21.000Z | mw4py/client.py | ry00001/mw4py | 48640b771a7863fb7e6f46d066d0ef9e5e82ad8b | [
"MIT"
] | 1 | 2018-02-03T16:03:12.000Z | 2018-02-03T16:03:12.000Z | import aiohttp
import asyncio
from mw4py import logs
from mw4py import classes
import urllib
class Client:
'Base client class for mw4py applications.'
def __init__(self, token=None, username=None, password=None):
if username and password:
logs.warn('Username + password combinations are depr... | 39.121951 | 103 | 0.622195 |
6549e661b03ea8d3cf8715bf57b0474927600fe7 | 2,271 | py | Python | linear_regression.py | IanSullivan/Neuralnet | 33934d4608f44c7640495e6d298c67fad1c2ad6f | [
"MIT"
] | null | null | null | linear_regression.py | IanSullivan/Neuralnet | 33934d4608f44c7640495e6d298c67fad1c2ad6f | [
"MIT"
] | null | null | null | linear_regression.py | IanSullivan/Neuralnet | 33934d4608f44c7640495e6d298c67fad1c2ad6f | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
import time
class LinearRegression:
def __init__(self):
data_points = 10
self.data_x = 2 * np.random.rand(data_points, 1)
noise = np.random.normal(-0.1, 0.1, (data_points, 1))
self.data_y = 3 * self.data_x + 5 + noise
... | 29.881579 | 87 | 0.575077 |
01a6e81264dd619aa42e7e7f145e91de7bd7d36f | 11,961 | py | Python | python/run-tests.py | UtkarshMe/spark | b4dea313c45042e4094d14ebdeb8ad27be4cc695 | [
"Apache-2.0"
] | 1 | 2019-01-13T22:36:36.000Z | 2019-01-13T22:36:36.000Z | python/run-tests.py | UtkarshMe/spark | b4dea313c45042e4094d14ebdeb8ad27be4cc695 | [
"Apache-2.0"
] | 1 | 2021-01-21T01:39:39.000Z | 2021-01-21T01:39:39.000Z | python/run-tests.py | UtkarshMe/spark | b4dea313c45042e4094d14ebdeb8ad27be4cc695 | [
"Apache-2.0"
] | 1 | 2021-04-22T02:56:00.000Z | 2021-04-22T02:56:00.000Z | #!/usr/bin/env python
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "Li... | 40.137584 | 100 | 0.641084 |
e70226e1b25e2b0c34cb73f6d61afb822d52b980 | 1,569 | py | Python | iapetus/data_points.py | choderalab/iapetus | ff49b48d73a8bad5bd2d604c09667543e9fb11bd | [
"MIT"
] | null | null | null | iapetus/data_points.py | choderalab/iapetus | ff49b48d73a8bad5bd2d604c09667543e9fb11bd | [
"MIT"
] | 8 | 2018-08-08T20:40:52.000Z | 2018-11-08T17:47:29.000Z | iapetus/data_points.py | choderalab/iapetus | ff49b48d73a8bad5bd2d604c09667543e9fb11bd | [
"MIT"
] | 2 | 2018-08-13T22:57:13.000Z | 2021-04-01T00:57:29.000Z | """
This module extracts the coordinates to be used in the cylinder fitting.
"""
import sys
import numpy as np
import mdtraj as md
import parmed as pmd
from mdtraj import geometry
from simtk import unit
class DataPoints(object):
def __init__(self, structure, topology):
self.structure = structure
... | 34.108696 | 89 | 0.609305 |
3df9e55123f506559df7df216161ab93cf6c5505 | 41,673 | py | Python | python/ccxt/idex.py | orikalinski/ccxt_new | 318caa4f8db7ffb719edab2c060a0989d2a9cd28 | [
"MIT"
] | 1 | 2021-09-06T00:09:11.000Z | 2021-09-06T00:09:11.000Z | python/ccxt/idex.py | orikalinski/ccxt_new | 318caa4f8db7ffb719edab2c060a0989d2a9cd28 | [
"MIT"
] | 1 | 2020-09-03T10:11:29.000Z | 2020-09-03T10:11:29.000Z | python/ccxt/idex.py | orikalinski/ccxt_new | 318caa4f8db7ffb719edab2c060a0989d2a9cd28 | [
"MIT"
] | 3 | 2019-09-26T09:17:26.000Z | 2021-02-01T11:51:49.000Z | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.base.exchange import Exchange
import math
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import AuthenticationE... | 40.302708 | 202 | 0.509371 |
0927dd657e557da4d6ea08c68dac0de5e37d2a9a | 686 | py | Python | vitrage/datasources/alarm_properties.py | mail2nsrajesh/vitrage | 41f863bbb7568f70d347feeab8eaca13085f81ba | [
"Apache-2.0"
] | null | null | null | vitrage/datasources/alarm_properties.py | mail2nsrajesh/vitrage | 41f863bbb7568f70d347feeab8eaca13085f81ba | [
"Apache-2.0"
] | null | null | null | vitrage/datasources/alarm_properties.py | mail2nsrajesh/vitrage | 41f863bbb7568f70d347feeab8eaca13085f81ba | [
"Apache-2.0"
] | null | null | null | # Copyright 2016 - Nokia
#
# 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... | 34.3 | 75 | 0.750729 |
4d41991f25908cb2eb37a9431c8ebd18556a8335 | 616 | py | Python | setup.py | willnx/vlab_inventory | 947a94df0f0eeb6790360bc0cc5836631839ca6c | [
"Apache-2.0"
] | 1 | 2019-04-10T16:17:19.000Z | 2019-04-10T16:17:19.000Z | setup.py | willnx/vlab_inventory | 947a94df0f0eeb6790360bc0cc5836631839ca6c | [
"Apache-2.0"
] | 1 | 2018-11-05T23:45:20.000Z | 2018-11-06T15:59:15.000Z | setup.py | willnx/vlab_inventory | 947a94df0f0eeb6790360bc0cc5836631839ca6c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
Inventory RESTful endpoints for vLab
"""
from setuptools import setup, find_packages
setup(name="vlab-inventory-api",
author="Nicholas Willhite,",
author_email='willnx84@gmail.com',
version='2019.06.24',
packages=find_packages(),
include_... | 30.8 | 78 | 0.637987 |
56ec0cf8aaa7ac38ff253fbbb452d25f9bfcf8f6 | 3,335 | py | Python | Currency Converter/task/tests.py | drtierney/hyperskill-CurrencyConverter-python | 301780533edf1e9a34e240b231bf6c4ee8072ccb | [
"MIT"
] | null | null | null | Currency Converter/task/tests.py | drtierney/hyperskill-CurrencyConverter-python | 301780533edf1e9a34e240b231bf6c4ee8072ccb | [
"MIT"
] | null | null | null | Currency Converter/task/tests.py | drtierney/hyperskill-CurrencyConverter-python | 301780533edf1e9a34e240b231bf6c4ee8072ccb | [
"MIT"
] | null | null | null | from typing import List, Any
from hstest.stage_test import StageTest
from hstest.test_case import TestCase
from hstest.check_result import CheckResult
import requests, json
class TestStage6(StageTest):
def generate(self) -> List[TestCase]:
inputs = [['usd', 'eur', '20', 'nok', '45', 'sek', '75', 'nok', '... | 48.333333 | 112 | 0.517841 |
f8066fc4c2293984628cefb8c695ca7e95a1e521 | 2,683 | py | Python | openclean/function/eval/null.py | remram44/openclean-core | 8c09c8302cadbb3bb02c959907f91a3ae343f939 | [
"BSD-3-Clause"
] | 4 | 2021-04-20T09:06:26.000Z | 2021-11-20T20:31:28.000Z | openclean/function/eval/null.py | remram44/openclean-core | 8c09c8302cadbb3bb02c959907f91a3ae343f939 | [
"BSD-3-Clause"
] | 14 | 2021-01-19T19:23:16.000Z | 2021-04-28T14:31:03.000Z | openclean/function/eval/null.py | remram44/openclean-core | 8c09c8302cadbb3bb02c959907f91a3ae343f939 | [
"BSD-3-Clause"
] | 5 | 2021-08-24T11:57:21.000Z | 2022-03-17T04:39:04.000Z | # This file is part of the Data Cleaning Library (openclean).
#
# Copyright (C) 2018-2021 New York University.
#
# openclean is released under the Revised BSD License. See file LICENSE for
# full license details.
"""Predicates that test whether a given value (or list of values) is empty. A
value is defined as empty if... | 34.397436 | 79 | 0.655982 |
f7fd2f5a3f4427884533dedeb7ae9d2ef7ea9094 | 701 | py | Python | multiprocessing/5_concurrent_futures.py | BenedictusAryo/python_threading | 8133315ed59b2ad927dfe748f63a1f41dda3d0bc | [
"MIT"
] | 1 | 2021-02-01T10:14:22.000Z | 2021-02-01T10:14:22.000Z | multiprocessing/5_concurrent_futures.py | BenedictusAryo/python_threading | 8133315ed59b2ad927dfe748f63a1f41dda3d0bc | [
"MIT"
] | null | null | null | multiprocessing/5_concurrent_futures.py | BenedictusAryo/python_threading | 8133315ed59b2ad927dfe748f63a1f41dda3d0bc | [
"MIT"
] | null | null | null | # 5 Using concurrent future multiprocessing in python
import concurrent.futures
import time
# Create simple function that sleep in 1 second
def do_something(seconds):
print(f'Sleeping {seconds} second(s) ..')
time.sleep(seconds)
return 'Done Sleeping...'
if __name__ == '__main__':
# Start counting
... | 29.208333 | 62 | 0.687589 |
0e90354ecde6d4962c950f4a0fd0db0690675106 | 226 | py | Python | paymentech/resources/__init__.py | natinwave/paymentech | 01694844c6600e396aab3b4afe692d3220073319 | [
"Unlicense"
] | 1 | 2021-03-09T00:55:46.000Z | 2021-03-09T00:55:46.000Z | paymentech/resources/__init__.py | natinwave/paymentech | 01694844c6600e396aab3b4afe692d3220073319 | [
"Unlicense"
] | null | null | null | paymentech/resources/__init__.py | natinwave/paymentech | 01694844c6600e396aab3b4afe692d3220073319 | [
"Unlicense"
] | 1 | 2020-09-15T21:34:23.000Z | 2020-09-15T21:34:23.000Z | from .authorization import MarkForCapture # noqa: F401
from .inquiry import Inquiry # noqa: F401
from .order import Order # noqa: F401
from .profile import Profile # noqa: F401
from .reversal import Reversal # noqa: F401
| 37.666667 | 55 | 0.756637 |
e791cb489a8ec813f9ecdd20cecc080ad53f6072 | 5,282 | py | Python | ocrd_models/ocrd_page_user_methods/get_AllRegions.py | hnesk/core | 5a79220bc31572410e705d13ca178cf284cdc9fb | [
"Apache-2.0"
] | 91 | 2018-05-23T12:52:11.000Z | 2022-03-19T20:43:49.000Z | ocrd_models/ocrd_page_user_methods/get_AllRegions.py | hnesk/core | 5a79220bc31572410e705d13ca178cf284cdc9fb | [
"Apache-2.0"
] | 636 | 2018-04-23T15:57:31.000Z | 2022-03-31T11:46:11.000Z | ocrd_models/ocrd_page_user_methods/get_AllRegions.py | hnesk/core | 5a79220bc31572410e705d13ca178cf284cdc9fb | [
"Apache-2.0"
] | 25 | 2018-05-22T11:53:09.000Z | 2021-07-20T13:07:43.000Z | # pylint: disable=line-too-long,invalid-name,protected-access,missing-module-docstring
def _region_class(self, x): # pylint: disable=unused-argument
return x.__class__.__name__.replace('RegionType', '')
def _get_recursive_regions(self, regions, level, classes=None):
from .constants import PAGE_REGION_TYPES # ... | 53.353535 | 134 | 0.648997 |
e5631a720cc0a8184c6ceb536ee8c87c49dd3138 | 435 | py | Python | setup.py | vikalibrate/FortesFit | 0681b8792a374a6bd79dcfe7b03e76ea6b4b2b97 | [
"MIT"
] | 11 | 2018-05-30T21:34:57.000Z | 2022-03-18T16:10:44.000Z | setup.py | vikalibrate/FortesFit | 0681b8792a374a6bd79dcfe7b03e76ea6b4b2b97 | [
"MIT"
] | null | null | null | setup.py | vikalibrate/FortesFit | 0681b8792a374a6bd79dcfe7b03e76ea6b4b2b97 | [
"MIT"
] | null | null | null | from setuptools import setup
setup(name='fortesfit',
version='1.0.6',
install_requires=['numpy','scipy','matplotlib',
'astropy','emcee','h5py','corner'],
description='Flexible SED fitting for astrophysics',
url='http://github.com/vikalibrate/FortesFit',
author='Dav... | 31.071429 | 59 | 0.62069 |
051f014448e25aa564d25f186fdff3208141e622 | 3,753 | py | Python | src/NodeGenerators/FacetedVolumeRejecters.py | as1m0n/spheral | 4d72822f56aca76d70724c543d389d15ff6ca48e | [
"BSD-Source-Code",
"BSD-3-Clause-LBNL",
"FSFAP"
] | null | null | null | src/NodeGenerators/FacetedVolumeRejecters.py | as1m0n/spheral | 4d72822f56aca76d70724c543d389d15ff6ca48e | [
"BSD-Source-Code",
"BSD-3-Clause-LBNL",
"FSFAP"
] | null | null | null | src/NodeGenerators/FacetedVolumeRejecters.py | as1m0n/spheral | 4d72822f56aca76d70724c543d389d15ff6ca48e | [
"BSD-Source-Code",
"BSD-3-Clause-LBNL",
"FSFAP"
] | null | null | null | import mpi
from SpheralCompiledPackages import Vector2d, Vector3d
#-------------------------------------------------------------------------------
# Reject in a polygonal surface
#-------------------------------------------------------------------------------
class PolygonalSurfaceRejecter:
def __init__(self, sur... | 34.431193 | 80 | 0.5004 |
a24cc59ef255ff9ad458db7ae7cc4b66bf9009f7 | 461 | py | Python | api/serializers/story_serializer.py | invinst/CPDB | c2d8ae8888b13d956cc1068742f18d45736d4121 | [
"Apache-2.0"
] | 16 | 2016-05-20T09:03:32.000Z | 2020-09-13T14:23:06.000Z | api/serializers/story_serializer.py | invinst/CPDB | c2d8ae8888b13d956cc1068742f18d45736d4121 | [
"Apache-2.0"
] | 2 | 2016-05-24T01:44:14.000Z | 2016-06-17T22:19:45.000Z | api/serializers/story_serializer.py | invinst/CPDB | c2d8ae8888b13d956cc1068742f18d45736d4121 | [
"Apache-2.0"
] | 2 | 2016-10-10T16:14:19.000Z | 2020-10-26T00:17:02.000Z | from rest_framework import serializers
from officer.models import Story
class StorySerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Story
fields = ('id',
'officer',
'title',
'slug',
'short_description',... | 24.263158 | 62 | 0.45987 |
17457e107f6174cc4eaea47d0f7677b831310a0e | 4,026 | py | Python | modules/NatureRemo.py | SWhardfish/WeatherPiDisplay | b5a2b4c8c1e199930ded562f0dda94dfb07bc41b | [
"Apache-2.0"
] | 5 | 2019-10-16T05:52:57.000Z | 2020-09-20T15:00:08.000Z | modules/NatureRemo.py | miyaichi/WeatherPi_TFT | ba8f000a070b12f17cff80a56554e68f183df55f | [
"Apache-2.0"
] | 2 | 2020-05-10T14:57:05.000Z | 2020-05-16T08:09:26.000Z | modules/NatureRemo.py | miyaichi/WeatherPi_TFT | ba8f000a070b12f17cff80a56554e68f183df55f | [
"Apache-2.0"
] | null | null | null | # pylint: disable=invalid-name, too-many-locals, broad-except
"""NatureRemo module
"""
import logging
import requests
from modules.TemperatureModule import TemperatureModule
from modules.WeatherModule import Utils
def read_temperature_and_humidity(token, name, correction_value):
"""Read Temperature and humidity ... | 35.008696 | 79 | 0.568058 |
85ee3a3b15c6e8e6d67bf8bf24dba7a2d767e4a3 | 7,591 | py | Python | aior/components/http_handler.py | Dephin/aior | f0810eb5dadecc3ca2597094a7636509ef69584d | [
"MIT"
] | null | null | null | aior/components/http_handler.py | Dephin/aior | f0810eb5dadecc3ca2597094a7636509ef69584d | [
"MIT"
] | null | null | null | aior/components/http_handler.py | Dephin/aior | f0810eb5dadecc3ca2597094a7636509ef69584d | [
"MIT"
] | null | null | null | import json
from json import JSONEncoder
from typing import Type, Any, Union, overload, List
from aiohttp import web, hdrs
from aiohttp.abc import Request
from aiohttp.typedefs import LooseHeaders
from aiohttp.web_exceptions import HTTPBadRequest
from aiohttp.web_response import Response
from pydantic import BaseModel... | 25.64527 | 79 | 0.581742 |
af7688679e57f591c5fdbc79b41c8d6902036c5a | 10,649 | py | Python | orchestra/contrib/saas/settings.py | RubenPX/django-orchestra | 5ab4779e1ae12ec99569d682601b7810587ed381 | [
"Unlicense"
] | null | null | null | orchestra/contrib/saas/settings.py | RubenPX/django-orchestra | 5ab4779e1ae12ec99569d682601b7810587ed381 | [
"Unlicense"
] | 4 | 2021-01-30T14:26:46.000Z | 2022-03-18T16:28:39.000Z | orchestra/contrib/saas/settings.py | RubenPX/django-orchestra | 5ab4779e1ae12ec99569d682601b7810587ed381 | [
"Unlicense"
] | 3 | 2022-02-06T04:35:59.000Z | 2022-03-17T00:40:17.000Z | from django.utils.translation import ugettext_lazy as _
from orchestra.contrib.settings import Setting
from orchestra.core.validators import validate_ip_address
from orchestra.settings import ORCHESTRA_BASE_DOMAIN
from . import validators
from .. import saas
SAAS_ENABLED_SERVICES = Setting('SAAS_ENABLED_SERVICES',
... | 31.137427 | 165 | 0.7319 |
b6bf64ccfdd81281af6d5480fd43c98fd5e2b058 | 6,119 | py | Python | test/sagemaker_tests/pytorch/training/resources/gpt2/data_pipeline.py | whn09/deep-learning-containers | 45493c141ad7bcadc4293f3efa5b1ad983f942b7 | [
"Apache-2.0"
] | 1 | 2022-03-17T00:41:27.000Z | 2022-03-17T00:41:27.000Z | test/sagemaker_tests/pytorch/training/resources/gpt2/data_pipeline.py | nam-nd-d3/deep-learning-containers | 4c03f5cf7eda3276c6a03516e6823872bd8eeb42 | [
"Apache-2.0"
] | 19 | 2022-01-12T16:00:45.000Z | 2022-03-31T14:33:29.000Z | test/sagemaker_tests/pytorch/training/resources/gpt2/data_pipeline.py | ashahba/deep-learning-containers | 48c3948b3d11f4fe2aac6bb25e5d82230d777076 | [
"Apache-2.0"
] | null | null | null | import gzip
import json
import os
import h5py
from typing import List, Tuple
import random
import numpy as np
import smdistributed.modelparallel.torch as smp
import torch
class BertPretrainingDataset(torch.utils.data.Dataset):
def __init__(self, input_file, max_pred_length):
self.input_file = input_file
... | 35.994118 | 137 | 0.612845 |
2423ed05baf4f9cde421e6b378beac098ffc1a1a | 1,666 | py | Python | examples/RST_Editor/main.py | Galland/kivy | 95a6bf279883d706f645e4629c16d5ee1038f0ec | [
"MIT"
] | 13,889 | 2015-01-01T06:43:41.000Z | 2022-03-31T17:37:56.000Z | examples/RST_Editor/main.py | Galland/kivy | 95a6bf279883d706f645e4629c16d5ee1038f0ec | [
"MIT"
] | 4,570 | 2015-01-01T17:58:52.000Z | 2022-03-31T18:42:16.000Z | examples/RST_Editor/main.py | Galland/kivy | 95a6bf279883d706f645e4629c16d5ee1038f0ec | [
"MIT"
] | 3,786 | 2015-01-01T09:20:45.000Z | 2022-03-30T21:15:05.000Z | from kivy.app import App
from kivy.uix.floatlayout import FloatLayout
from kivy.factory import Factory
from kivy.properties import ObjectProperty
from kivy.uix.popup import Popup
import os
class LoadDialog(FloatLayout):
load = ObjectProperty(None)
cancel = ObjectProperty(None)
class SaveDialog(FloatLayout)... | 25.630769 | 71 | 0.663265 |
a463529d47d242c42918ab2f10bbaa467823b6be | 3,531 | py | Python | src/file_handler.py | dewhurstwill/tfvm | d9a2ad5c4f21efc91b9df9c56ebabe617244dac7 | [
"Apache-2.0"
] | null | null | null | src/file_handler.py | dewhurstwill/tfvm | d9a2ad5c4f21efc91b9df9c56ebabe617244dac7 | [
"Apache-2.0"
] | 7 | 2020-12-30T15:49:01.000Z | 2021-01-25T17:22:53.000Z | src/file_handler.py | dewhurstwill/tfvm | d9a2ad5c4f21efc91b9df9c56ebabe617244dac7 | [
"Apache-2.0"
] | null | null | null | # Packages
import platform, requests, sys, stat
from zipfile import ZipFile as zipfile
from os import mkdir, rmdir, rename, walk, chmod
from os import stat as os_stat
from os import remove as deletefile
from os.path import exists, expanduser, isfile, isdir
# Helper Modules
from sys_handler import get_architecture, is_... | 33 | 130 | 0.705749 |
116f7920513acfdbd79f91b96dab627ddb81b6d1 | 661 | py | Python | src/daipecore/function/input_decorator_function_import_test/decorator_functions.py | daipe-ai/daipe-core | aa205495fa6b464fa6078d17e439c60345ac99ea | [
"MIT"
] | 1 | 2021-09-17T09:07:09.000Z | 2021-09-17T09:07:09.000Z | src/daipecore/function/input_decorator_function_import_test/decorator_functions.py | daipe-ai/daipe-core | aa205495fa6b464fa6078d17e439c60345ac99ea | [
"MIT"
] | 2 | 2021-12-20T07:46:33.000Z | 2022-02-24T07:02:05.000Z | src/daipecore/function/input_decorator_function_import_test/decorator_functions.py | daipe-ai/daipe-core | aa205495fa6b464fa6078d17e439c60345ac99ea | [
"MIT"
] | null | null | null | from daipecore.function.input_decorator_function import input_decorator_function
from injecta.container.ContainerInterface import ContainerInterface
@input_decorator_function
def test_input_function1():
def wrapper(container: ContainerInterface):
raise Exception("Method must not be called when load_data()... | 34.789474 | 123 | 0.803328 |
7e859d3558839337ea2395b9b432b683fede77cc | 12,241 | py | Python | myprojectenv/lib/python3.5/site-packages/ansible/modules/net_tools/dnsimple.py | lancerenteria/doFlask | 2d4e242469b108c6c8316ee18a540307497bfb53 | [
"MIT"
] | null | null | null | myprojectenv/lib/python3.5/site-packages/ansible/modules/net_tools/dnsimple.py | lancerenteria/doFlask | 2d4e242469b108c6c8316ee18a540307497bfb53 | [
"MIT"
] | null | null | null | myprojectenv/lib/python3.5/site-packages/ansible/modules/net_tools/dnsimple.py | lancerenteria/doFlask | 2d4e242469b108c6c8316ee18a540307497bfb53 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed... | 34.677054 | 151 | 0.569643 |
35351dbe85d1ecbb38f12f15960157c01def0854 | 1,868 | py | Python | tasks/runtime.py | auto-ndp/faasm-python | f144332fea6d03412d5a76501bd5a9fe4c2fa8ac | [
"Apache-2.0"
] | 3 | 2021-08-05T05:09:36.000Z | 2021-11-29T23:59:35.000Z | tasks/runtime.py | auto-ndp/faasm-python | f144332fea6d03412d5a76501bd5a9fe4c2fa8ac | [
"Apache-2.0"
] | 1 | 2021-09-09T09:19:03.000Z | 2022-02-14T13:49:10.000Z | tasks/runtime.py | auto-ndp/faasm-python | f144332fea6d03412d5a76501bd5a9fe4c2fa8ac | [
"Apache-2.0"
] | 2 | 2021-07-06T13:06:06.000Z | 2021-08-21T00:02:02.000Z | import glob
from os.path import join, exists
from shutil import rmtree
from subprocess import run
from os import makedirs, remove
from invoke import task
from tasks.env import PROJ_ROOT, THIRD_PARTY_DIR, FAASM_RUNTIME_ROOT
CPYTHON_SRC = join(THIRD_PARTY_DIR, "cpython")
CPYTHON_INSTALL_DIR = join(CPYTHON_SRC, "insta... | 27.880597 | 79 | 0.699143 |
5653a499b300f78cce47f3e74f1f414263eee2aa | 2,561 | py | Python | main.py | iMro0t/insta-changer | 84e8ee43ddd50175067daa164d83fe92b1050c5a | [
"MIT"
] | 1 | 2019-08-26T10:17:21.000Z | 2019-08-26T10:17:21.000Z | main.py | iMro0t/insta-changer | 84e8ee43ddd50175067daa164d83fe92b1050c5a | [
"MIT"
] | 1 | 2020-05-15T15:08:03.000Z | 2021-01-08T23:30:11.000Z | main.py | iMro0t/insta-changer | 84e8ee43ddd50175067daa164d83fe92b1050c5a | [
"MIT"
] | null | null | null | import os,requests,getpass,json,io,time
X_SECOND = 10
BASE_URL = "https://www.instagram.com/"
LOGIN_URL = BASE_URL + "accounts/login/ajax/"
USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; ) Gecko/20100101 Firefox/65.0"
CHANGE_URL = "https://www.instagram.com/accounts/web_change_profile_picture/"
CHNAGE_DATA = {"Con... | 33.697368 | 132 | 0.609528 |
a2d0dad80cdd7bd8f03400a39ad365cb9cff9193 | 6,782 | py | Python | web/demo/bff/flaskr/service/socket_manager.py | trisacrypto/testnet | 46574df999a82ad72dc47c38eb3a36ddef00fdb4 | [
"MIT"
] | 1 | 2022-01-20T23:49:28.000Z | 2022-01-20T23:49:28.000Z | web/demo/bff/flaskr/service/socket_manager.py | trisacrypto/testnet | 46574df999a82ad72dc47c38eb3a36ddef00fdb4 | [
"MIT"
] | 23 | 2020-12-16T18:26:41.000Z | 2021-06-14T20:18:41.000Z | web/demo/bff/flaskr/service/socket_manager.py | trisacrypto/testnet | 46574df999a82ad72dc47c38eb3a36ddef00fdb4 | [
"MIT"
] | 1 | 2021-07-21T01:59:56.000Z | 2021-07-21T01:59:56.000Z | # Tracks sockets and the context that they're subscribed to
# context is tied to the end user's session.
# User could be viewing multiple VASPs UIs in the same context.
# This allows one user to perform actions across multiple vasps and each UI session receive appropriate data
# for that context.
import json
import tim... | 41.607362 | 108 | 0.645827 |
aa3dced960466b24cf914aff85e38b117bcba377 | 9,583 | py | Python | src/crypto/crypto_ops_builder/ref10CommentedCombined/MakeCryptoOps.py | blbruegg/The-Other-Cryptonight-Coin | 8500d43087d6954e6161c1c08d421c55acb458f8 | [
"BSD-3-Clause"
] | null | null | null | src/crypto/crypto_ops_builder/ref10CommentedCombined/MakeCryptoOps.py | blbruegg/The-Other-Cryptonight-Coin | 8500d43087d6954e6161c1c08d421c55acb458f8 | [
"BSD-3-Clause"
] | null | null | null | src/crypto/crypto_ops_builder/ref10CommentedCombined/MakeCryptoOps.py | blbruegg/The-Other-Cryptonight-Coin | 8500d43087d6954e6161c1c08d421c55acb458f8 | [
"BSD-3-Clause"
] | null | null | null | #assumes you have gnu sed, osx sed might need slight syntax changeo
#c.f. http://unix.stackexchange.com/questions/112023/how-can-i-replace-a-string-in-a-files
#written by shen-noether Monero Research Labs
import os #for copying and sed etc.
import glob #for copy files
import textwrap #for comments etc
print("make su... | 36.576336 | 214 | 0.65324 |
11577ff1591efa7999712b25cd6cf324392afd74 | 45,701 | py | Python | tests/mail/tests.py | xavfernandez/django | daaeb8415823444a9020460cf825efc3fae866a2 | [
"BSD-3-Clause"
] | 2 | 2016-07-23T18:08:37.000Z | 2016-07-24T09:54:34.000Z | tests/mail/tests.py | rmutter/django | 5d044339037be879a11b03fe8bd8c3ef1d520b1a | [
"BSD-3-Clause"
] | null | null | null | tests/mail/tests.py | rmutter/django | 5d044339037be879a11b03fe8bd8c3ef1d520b1a | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import asyncore
from email.mime.text import MIMEText
import os
import shutil
import smtpd
import sys
import tempfile
import threading
from smtplib import SMTPException
from ssl import SSLError
from django.core import mail
from django.core.mail import (Em... | 45.338294 | 216 | 0.648345 |
473ef7bd0e7d85da7ecccbb350fd56fc64c3c70f | 1,516 | py | Python | 03_estimating_error.py | mustafa-sarshar/Deep-Learning-From-Scratch | d5e98f984291f41465d4b74abc16185e28678507 | [
"MIT"
] | null | null | null | 03_estimating_error.py | mustafa-sarshar/Deep-Learning-From-Scratch | d5e98f984291f41465d4b74abc16185e28678507 | [
"MIT"
] | null | null | null | 03_estimating_error.py | mustafa-sarshar/Deep-Learning-From-Scratch | d5e98f984291f41465d4b74abc16185e28678507 | [
"MIT"
] | null | null | null | # In[] Libs
import numpy as np
import matplotlib.pyplot as plt
from neural_network_classes.layers import Dense
from neural_network_classes.activations import ReLU, Softmax
from neural_network_classes.error_estimation import CategoricalCrossentropy, Accuracy
from utils.generate_dataset import generate_spiral_data
# In[... | 34.454545 | 104 | 0.709763 |
ded849dd06279aea54f08501baaa0b98a92fc6d5 | 123 | py | Python | users/admin.py | viisualworks/instanoir | e1ab476b61b1cdb1abc7546ef06de51579b8f24e | [
"MIT"
] | null | null | null | users/admin.py | viisualworks/instanoir | e1ab476b61b1cdb1abc7546ef06de51579b8f24e | [
"MIT"
] | 1 | 2021-09-08T00:51:50.000Z | 2021-09-08T00:51:50.000Z | users/admin.py | viisualworks/instanoir | e1ab476b61b1cdb1abc7546ef06de51579b8f24e | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Profile
# Register your models here.
admin.site.register(Profile)
| 17.571429 | 32 | 0.788618 |
685a32cda32c02e27812f26d932ea1e518a023bc | 376 | py | Python | dataset/__main__.py | mitiku1/All-In-One | 8d63877941ef3e935bcd395ccecb24b600e5d2b0 | [
"MIT"
] | null | null | null | dataset/__main__.py | mitiku1/All-In-One | 8d63877941ef3e935bcd395ccecb24b600e5d2b0 | [
"MIT"
] | null | null | null | dataset/__main__.py | mitiku1/All-In-One | 8d63877941ef3e935bcd395ccecb24b600e5d2b0 | [
"MIT"
] | 3 | 2018-05-02T09:13:35.000Z | 2018-11-14T05:39:30.000Z | from dataset.aflw import AflwDataset
import cv2
import os
import dlib
def main():
aflwDataset= AflwDataset("",None)
dataset_dir = "/home/mtk/dataset/aflw/aflw/data/flickr/0/"
for img_file in os.listdir(dataset_dir):
img = cv2.imread(os.path.join(dataset_dir,img_file))
aflwDataset.selective... | 23.5 | 62 | 0.696809 |
5513fa16195bafe1c52b90d2a658c82edfc49d83 | 3,437 | py | Python | tests/unit_tests/poly_line_tests.py | EuroPOND/deformetrica | 29cb3a4ecd40d6a19b3ee2a1c5827c4ebab54062 | [
"BSD-3-Clause"
] | 1 | 2020-10-27T07:30:56.000Z | 2020-10-27T07:30:56.000Z | tests/unit_tests/poly_line_tests.py | EuroPOND/deformetrica | 29cb3a4ecd40d6a19b3ee2a1c5827c4ebab54062 | [
"BSD-3-Clause"
] | null | null | null | tests/unit_tests/poly_line_tests.py | EuroPOND/deformetrica | 29cb3a4ecd40d6a19b3ee2a1c5827c4ebab54062 | [
"BSD-3-Clause"
] | null | null | null | import os
import unittest
import numpy as np
from in_out.deformable_object_reader import DeformableObjectReader
from support.utilities.general_settings import Settings
#Tests are done both in 2 and 3d.
class PolyLineTests(unittest.TestCase):
"""
Methods with names starting by "test" will be run
"""
... | 41.409639 | 105 | 0.675007 |
36aba00ed2718ccde88e368539e5d97b7403b044 | 155 | py | Python | boa3_test/test_sc/union_test/UnionIntNone.py | hal0x2328/neo3-boa | 6825a3533384cb01660773050719402a9703065b | [
"Apache-2.0"
] | 25 | 2020-07-22T19:37:43.000Z | 2022-03-08T03:23:55.000Z | boa3_test/test_sc/union_test/UnionIntNone.py | hal0x2328/neo3-boa | 6825a3533384cb01660773050719402a9703065b | [
"Apache-2.0"
] | 419 | 2020-04-23T17:48:14.000Z | 2022-03-31T13:17:45.000Z | boa3_test/test_sc/union_test/UnionIntNone.py | hal0x2328/neo3-boa | 6825a3533384cb01660773050719402a9703065b | [
"Apache-2.0"
] | 15 | 2020-05-21T21:54:24.000Z | 2021-11-18T06:17:24.000Z | from typing import Union
from boa3.builtin import public
@public
def main() -> Union[int, None]:
x: Union[int, None] = None
x = 42
return x
| 14.090909 | 31 | 0.645161 |
a0b269d1af2a7fbc4c5a1c7e989bd79011c4afbd | 2,524 | py | Python | evaluate.py | SeongJunKang/pytorch-bert-crf-ner | 2affbd1674517e662e2be93a41102ceedbb9ff1f | [
"Apache-2.0"
] | 353 | 2019-11-01T18:23:27.000Z | 2022-03-29T06:07:35.000Z | evaluate.py | SeongJunKang/pytorch-bert-crf-ner | 2affbd1674517e662e2be93a41102ceedbb9ff1f | [
"Apache-2.0"
] | 33 | 2020-02-12T10:37:26.000Z | 2020-02-17T02:44:37.000Z | evaluate.py | SeongJunKang/pytorch-bert-crf-ner | 2affbd1674517e662e2be93a41102ceedbb9ff1f | [
"Apache-2.0"
] | 95 | 2019-11-01T20:40:07.000Z | 2022-03-10T11:48:53.000Z | # from tqdm import tqdm
# import torch
# from metric import correct_sum
# from chatspace import ChatSpace
# spacer = ChatSpace()
#
# def evaluate(model, data_loader, metrics, device, tokenizer=None):
# if model.training:
# model.eval()
#
# summary = {metric: 0 for metric in metrics}
# num_correct_e... | 36.057143 | 115 | 0.596276 |
5beb096a3b419752b704346fc4232e46279f44b9 | 4,196 | py | Python | svelte_frontend/test_frontend/test_e2e.py | BurnySc2/python-template | ff95adfb72afa1f06cc880467713dc4408783209 | [
"MIT"
] | null | null | null | svelte_frontend/test_frontend/test_e2e.py | BurnySc2/python-template | ff95adfb72afa1f06cc880467713dc4408783209 | [
"MIT"
] | null | null | null | svelte_frontend/test_frontend/test_e2e.py | BurnySc2/python-template | ff95adfb72afa1f06cc880467713dc4408783209 | [
"MIT"
] | null | null | null | from typing import Optional, Set
import pytest
from pytest_benchmark.fixture import BenchmarkFixture
from seleniumbase import BaseCase
from burny_common.integration_test_helper import (
find_next_free_port,
get_website_address,
kill_processes,
start_svelte_dev_server,
)
# see https://github.com/selen... | 32.78125 | 115 | 0.661582 |
0ad1854159c2b9b6c5edeb6ba3f0f9c82a6a546a | 9,630 | py | Python | examples/mxnet/sampling/dis_sampling/gcn_trainer.py | sufeidechabei/dgl-1 | 23f78c0539bdda55722d425be90ac460fa9a6983 | [
"Apache-2.0"
] | null | null | null | examples/mxnet/sampling/dis_sampling/gcn_trainer.py | sufeidechabei/dgl-1 | 23f78c0539bdda55722d425be90ac460fa9a6983 | [
"Apache-2.0"
] | null | null | null | examples/mxnet/sampling/dis_sampling/gcn_trainer.py | sufeidechabei/dgl-1 | 23f78c0539bdda55722d425be90ac460fa9a6983 | [
"Apache-2.0"
] | null | null | null | import argparse, time, math
import numpy as np
import mxnet as mx
from mxnet import gluon
from functools import partial
import dgl
import dgl.function as fn
from dgl import DGLGraph
from dgl.data import register_data_args, load_data
class NodeUpdate(gluon.Block):
def __init__(self, in_feats, out_feats, activation... | 35.535055 | 105 | 0.555659 |
0fb19963ee108b11e72a8def1460cfea2645e634 | 3,709 | py | Python | landlab/plot/drainage_plot.py | saraahsimon/landlab | 1cf809b685efbccaaa149b5899a600c3ccedf30f | [
"MIT"
] | null | null | null | landlab/plot/drainage_plot.py | saraahsimon/landlab | 1cf809b685efbccaaa149b5899a600c3ccedf30f | [
"MIT"
] | null | null | null | landlab/plot/drainage_plot.py | saraahsimon/landlab | 1cf809b685efbccaaa149b5899a600c3ccedf30f | [
"MIT"
] | null | null | null | """Plot drainage network.
"""
import matplotlib.pylab as plt
import numpy as np
# KRB, FEB 2017.
import six
from landlab import (
CLOSED_BOUNDARY,
CORE_NODE,
FIXED_GRADIENT_BOUNDARY,
FIXED_VALUE_BOUNDARY,
)
from landlab.plot.imshow import imshow_node_grid
def drainage_plot(
mg,
surface="top... | 25.756944 | 82 | 0.58075 |
cfbadaff76f62c97aa694c6d21c805f79f80ef35 | 2,793 | py | Python | python/setup.py | springrider/ccxt | 39570694e5cfc9a315a0f05b2d06cf8b1d550c24 | [
"MIT"
] | null | null | null | python/setup.py | springrider/ccxt | 39570694e5cfc9a315a0f05b2d06cf8b1d550c24 | [
"MIT"
] | null | null | null | python/setup.py | springrider/ccxt | 39570694e5cfc9a315a0f05b2d06cf8b1d550c24 | [
"MIT"
] | null | null | null | # prefer setuptools over distutils
from setuptools import setup, find_packages
# use a consistent encoding
from codecs import open
from os import path
import json
import sys
is_python_2 = sys.version_info < (3, 0)
here = path.abspath(path.dirname(__file__))
root = path.dirname(here)
readme = path.join(here, 'README... | 28.793814 | 83 | 0.610455 |
b068f140fc5a139827e37ecd01f5190167d21b9b | 7,529 | py | Python | client/rpc.py | cs460-group1/chat-client | 92074bbd787073fd0f1d8fa8ea8aace07da03e03 | [
"MIT"
] | 1 | 2016-05-03T22:04:07.000Z | 2016-05-03T22:04:07.000Z | server/rpc.py | cs460-group1/chat-server | e7d0f799f401bce8b1b776193e5ad2b3ee8c8bbf | [
"MIT"
] | null | null | null | server/rpc.py | cs460-group1/chat-server | e7d0f799f401bce8b1b776193e5ad2b3ee8c8bbf | [
"MIT"
] | null | null | null | import json
import logging
import socket
import threading
"""
Exception thrown if the peer sends an error.
"""
class RpcException(Exception):
pass
"""
Connects to a remote RPC peer.
"""
def connect(address, port, handler, timeout=5):
connection = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
connect... | 29.069498 | 102 | 0.574578 |
ba84ee26e195d387f5293214a092a25f8c8412ac | 1,092 | py | Python | jojo/default.py | spiarh/jojo | 074ec90b216341a1fac5252ebfc7e3f7e2864b4c | [
"MIT"
] | null | null | null | jojo/default.py | spiarh/jojo | 074ec90b216341a1fac5252ebfc7e3f7e2864b4c | [
"MIT"
] | null | null | null | jojo/default.py | spiarh/jojo | 074ec90b216341a1fac5252ebfc7e3f7e2864b4c | [
"MIT"
] | null | null | null | import enum
class Alpine(enum.Enum):
'''
Default Alpine configuration.
'''
PACKAGE = 'ALPINE_PACKAGE'
REPO = 'ALPINE_REPO'
VERSION_ID = 'ALPINE_VERSION_ID'
MIRROR = 'http://dl-cdn.alpinelinux.org'
class Github(enum.Enum):
'''
Default GitHub configuration.
'''
OWNER = 'GIT... | 18.508475 | 44 | 0.626374 |
e51203fdc7c61184979b28d9117be803a192479b | 1,001 | py | Python | test.py | beevabeeva/Automated-Whatsapp-Messages | 506da90b8cec688b7ab5686afd6e21fe2611972b | [
"Apache-2.0"
] | null | null | null | test.py | beevabeeva/Automated-Whatsapp-Messages | 506da90b8cec688b7ab5686afd6e21fe2611972b | [
"Apache-2.0"
] | null | null | null | test.py | beevabeeva/Automated-Whatsapp-Messages | 506da90b8cec688b7ab5686afd6e21fe2611972b | [
"Apache-2.0"
] | null | null | null |
import time
import datetime as dt
import json
import os
import requests
import shutil
from PIL import Image
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.keys import Keys
from selenium.webdriver... | 30.333333 | 157 | 0.835165 |
0c8333d1b5738e919036630a22b38f308341ebd6 | 307 | py | Python | week1/lecture1/nestedConds.py | nobodysshadow/edX_MITx_6.00.1x | d2e5ab0bd9951153ddc5fa09f01425c54854178e | [
"MIT"
] | null | null | null | week1/lecture1/nestedConds.py | nobodysshadow/edX_MITx_6.00.1x | d2e5ab0bd9951153ddc5fa09f01425c54854178e | [
"MIT"
] | null | null | null | week1/lecture1/nestedConds.py | nobodysshadow/edX_MITx_6.00.1x | d2e5ab0bd9951153ddc5fa09f01425c54854178e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Wed Jun 8 11:07:33 2016
@author: ericgrimson
"""
x = int(input('Enter an integer: '))
if x%2 == 0:
if x%3 == 0:
print('Divisible by 2 and 3')
else:
print('Divisible by 2 and not by 3')
elif x%3 == 0:
print('Divisible by 3 and not by 2')
| 19.1875 | 44 | 0.553746 |
a872db3df29974b4574183adf266e725a6286e80 | 1,185 | py | Python | setup.py | Hardtack/Flask-aiohttp | 50cfc8c1f71bae9e10a4a475b06b5f6bd124e33b | [
"MIT"
] | 142 | 2015-04-05T06:28:11.000Z | 2021-05-05T14:40:04.000Z | setup.py | Hardtack/Flask-aiohttp | 50cfc8c1f71bae9e10a4a475b06b5f6bd124e33b | [
"MIT"
] | 9 | 2015-06-01T18:45:35.000Z | 2018-08-29T16:39:01.000Z | setup.py | chgeonu/Flask-aiohttp | 50cfc8c1f71bae9e10a4a475b06b5f6bd124e33b | [
"MIT"
] | 20 | 2015-04-09T15:09:10.000Z | 2021-11-04T12:24:59.000Z | import sys
import setuptools
from setuptools import setup
from setuptools.command.test import test as TestCommand
class PyTest(TestCommand):
user_options = [('pytest-args=', 'a', "Arguments to pass to py.test")]
def initialize_options(self):
TestCommand.initialize_options(self)
self.pytest_a... | 22.788462 | 74 | 0.628692 |
c9dbb8594f8fc6b6e2de905e63c8b009f362ef73 | 1,798 | py | Python | read_sensor_data.py | Pavlos1/SensoringJMSS | a49b9f39e7a2f9e6c3166811c53866f3cd748035 | [
"BSD-3-Clause"
] | 1 | 2015-11-12T00:50:21.000Z | 2015-11-12T00:50:21.000Z | read_sensor_data.py | Pavlos1/SensoringJMSS | a49b9f39e7a2f9e6c3166811c53866f3cd748035 | [
"BSD-3-Clause"
] | null | null | null | read_sensor_data.py | Pavlos1/SensoringJMSS | a49b9f39e7a2f9e6c3166811c53866f3cd748035 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/local/bin/python
# Written by Pavel
# License: BSD
import sqlite3
import time
import os
import mraa
light = mraa.Aio(0)
sound = mraa.Aio(1)
i2c = mraa.I2c(0)
#pins A0 and A1 tied to ground, so address is 0x40
i2c.address(0x40)
#reset hdc1008
i2c.writeReg(0x02, 144L)
#configuration; see datasheet. sets hdc1008 ... | 32.690909 | 147 | 0.580089 |
30538d875f99ba97ba1486a87e067ae664c09562 | 2,739 | py | Python | graph_partitioning.py | necaisej/graph-partitioning-dqm | 924f53359b160a513c26c081b68ff6d203c864b0 | [
"Apache-2.0"
] | null | null | null | graph_partitioning.py | necaisej/graph-partitioning-dqm | 924f53359b160a513c26c081b68ff6d203c864b0 | [
"Apache-2.0"
] | null | null | null | graph_partitioning.py | necaisej/graph-partitioning-dqm | 924f53359b160a513c26c081b68ff6d203c864b0 | [
"Apache-2.0"
] | 1 | 2021-05-13T13:12:50.000Z | 2021-05-13T13:12:50.000Z | # Copyright 2020 D-Wave Systems Inc.
#
# 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 w... | 33.402439 | 82 | 0.746988 |
fd7a175c3ee0837f204bfd35351c2e3fccb44113 | 1,348 | py | Python | aoomuki_comp/app/migrations/0044_auto_20210201_1449.py | Kamelgasmi/aoomuki_competences | e02f3546f7efb54b825dbcfab968296607775903 | [
"MIT"
] | null | null | null | aoomuki_comp/app/migrations/0044_auto_20210201_1449.py | Kamelgasmi/aoomuki_competences | e02f3546f7efb54b825dbcfab968296607775903 | [
"MIT"
] | null | null | null | aoomuki_comp/app/migrations/0044_auto_20210201_1449.py | Kamelgasmi/aoomuki_competences | e02f3546f7efb54b825dbcfab968296607775903 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.5 on 2021-02-01 13:49
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('app', '0043_auto_20210128_1416'),
]
operations = [
migrations.AlterField(
model_n... | 38.514286 | 151 | 0.631306 |
8c45874977d83cf51fe804f6800271a26358de2a | 4,626 | py | Python | tools/extract_mrcn_ann_feats.py | hsuanlyh1997/MAttNet | de6f41ce5dc541425e5bd8ab96949ca09fb3de94 | [
"MIT"
] | 312 | 2018-02-19T23:56:49.000Z | 2022-03-28T08:38:04.000Z | tools/extract_mrcn_ann_feats.py | hsuanlyh1997/MAttNet | de6f41ce5dc541425e5bd8ab96949ca09fb3de94 | [
"MIT"
] | 39 | 2018-03-02T07:28:00.000Z | 2021-12-06T06:22:41.000Z | tools/extract_mrcn_ann_feats.py | hsuanlyh1997/MAttNet | de6f41ce5dc541425e5bd8ab96949ca09fb3de94 | [
"MIT"
] | 85 | 2018-02-20T18:38:09.000Z | 2022-03-02T07:55:12.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import os
import os.path as osp
import sys
import json
import time
import numpy as np
import h5py
import pprint
from scipy.misc import imread, imresize
import cv2
import torch
from torch.autogr... | 31.903448 | 122 | 0.68396 |
dbb47d58cfe89a55d12eb4f89ccc48863be45447 | 16,213 | py | Python | yadll/model.py | pchavanne/dl | 6114234a8a25cfda7a596b9a6e75bb121de6f4d2 | [
"MIT"
] | 6 | 2016-09-05T22:45:26.000Z | 2022-03-24T09:18:54.000Z | yadll/model.py | pchavanne/dl | 6114234a8a25cfda7a596b9a6e75bb121de6f4d2 | [
"MIT"
] | null | null | null | yadll/model.py | pchavanne/dl | 6114234a8a25cfda7a596b9a6e75bb121de6f4d2 | [
"MIT"
] | 1 | 2016-09-05T23:48:31.000Z | 2016-09-05T23:48:31.000Z | # -*- coding: UTF-8 -*-
import pickle
import sys
import yadll
from .layers import *
from .exceptions import *
import logging
logger = logging.getLogger(__name__)
def save_model(model, file=None):
"""
Save the model to file with cPickle
This function is used by the training function to save the model.
... | 40.032099 | 177 | 0.562943 |
25dcc057d628eacb427fd2c7b0d054cfb57292e7 | 10,450 | py | Python | paddlex/restful/model.py | SunAhong1993/PaddleX | d170c7cec69a211ee83abe41d27203bff2fd5a59 | [
"Apache-2.0"
] | 1 | 2021-09-26T16:00:54.000Z | 2021-09-26T16:00:54.000Z | paddlex/restful/model.py | kyanaww/PaddleX | b68e48b12ae7fe74554f8e2537cf638e6a462a57 | [
"Apache-2.0"
] | null | null | null | paddlex/restful/model.py | kyanaww/PaddleX | b68e48b12ae7fe74554f8e2537cf638e6a462a57 | [
"Apache-2.0"
] | null | null | null | import time
import os
import shutil
import pickle
from os import path as osp
from .utils import set_folder_status, TaskStatus, copy_pretrained_model, PretrainedModelStatus
from . import workspace_pb2 as w
def list_pretrained_models(workspace):
"""列出预训练模型列表
"""
pretrained_model_list = list()
for id in ... | 34.949833 | 94 | 0.64201 |
e1a6fe94733af6b81d3710c51b8ba265c8b7c6c3 | 2,809 | py | Python | decibel/file_scraper/midi_scraper.py | DaphneO/DECIBEL | 5350cdc738b228a46fc94b93f2e50787480a11a6 | [
"MIT"
] | 13 | 2019-09-23T07:45:22.000Z | 2021-09-28T03:59:43.000Z | decibel/file_scraper/midi_scraper.py | mtfbs/scalableDECIBEL | 4ae0d064c21abc6fc9afd8b8e3fb41ef1c249d48 | [
"MIT"
] | 2 | 2019-10-18T12:42:29.000Z | 2019-10-18T12:44:51.000Z | decibel/file_scraper/midi_scraper.py | mtfbs/scalableDECIBEL | 4ae0d064c21abc6fc9afd8b8e3fb41ef1c249d48 | [
"MIT"
] | 2 | 2020-12-22T12:27:50.000Z | 2021-02-10T17:22:11.000Z | """
This module contains all the methods you need for scraping either a single MIDI file or a predefined set of MIDI files
from the Internet.
"""
from os import path
import urllib.request
def download_midi(midi_url: str, midi_directory: str, midi_name: str) -> (bool, str):
"""
Download a MIDI file from the I... | 41.308824 | 118 | 0.704877 |
36b02c8699f4204a96df3538fd9f43a531df0595 | 601 | py | Python | day_32/challenge_01/main.py | steveanlorn/python_bootcamp_100_days | e542df58406ecae54c76fc8d5cbe08b81243b92f | [
"MIT"
] | null | null | null | day_32/challenge_01/main.py | steveanlorn/python_bootcamp_100_days | e542df58406ecae54c76fc8d5cbe08b81243b92f | [
"MIT"
] | null | null | null | day_32/challenge_01/main.py | steveanlorn/python_bootcamp_100_days | e542df58406ecae54c76fc8d5cbe08b81243b92f | [
"MIT"
] | 1 | 2021-06-04T03:37:22.000Z | 2021-06-04T03:37:22.000Z | import random
import datetime as dt
import smtplib
EMAIL = ""
PASSWORD = ""
def get_quote():
with open("quotes.txt") as quote_file:
quote_list = quote_file.readlines()
return random.choice(quote_list)
now = dt.datetime.now()
if now.weekday() == 5:
with smtplib.SMTP("smtp.mail.yahoo.com") as... | 23.115385 | 66 | 0.638935 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.