hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | 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 245 | max_issues_repo_name stringlengths 6 130 | 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 245 | max_forks_repo_name stringlengths 6 130 | 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 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7644579297db8733ab1ac86b3258f095e7ec3a4 | 3,851 | py | Python | cryptoquest/faucets/models.py | silverlogic/cryptoquest-back | 8666024c4664d1ec7bcb3d8f43912d51b806b0b7 | [
"Apache-2.0"
] | 1 | 2018-01-26T20:52:58.000Z | 2018-01-26T20:52:58.000Z | cryptoquest/faucets/models.py | silverlogic/cryptoquest-back | 8666024c4664d1ec7bcb3d8f43912d51b806b0b7 | [
"Apache-2.0"
] | null | null | null | cryptoquest/faucets/models.py | silverlogic/cryptoquest-back | 8666024c4664d1ec7bcb3d8f43912d51b806b0b7 | [
"Apache-2.0"
] | null | null | null | import json
from decimal import Decimal
from django.db import models
from django.conf import settings
from channels import Group
class Location(models.Model):
name = models.CharField(max_length=255)
lat = models.DecimalField(max_digits=40, decimal_places=30, blank=True, null=True)
lng = models.DecimalFi... | 30.808 | 147 | 0.511296 | import json
from decimal import Decimal
from django.db import models
from django.conf import settings
from channels import Group
class Location(models.Model):
name = models.CharField(max_length=255)
lat = models.DecimalField(max_digits=40, decimal_places=30, blank=True, null=True)
lng = models.DecimalFi... | true | true |
f76445e3c9042749dd61a4f87321dcbb8a55a92d | 2,357 | py | Python | webservice/server/server/summ_eval/server/http.py | mymusise/emnlp19-moverscore | 0fa2195fa1f63579b9a1daddf2f839bf7364fb80 | [
"MIT"
] | 141 | 2019-09-04T11:39:10.000Z | 2022-03-29T17:19:53.000Z | webservice/server/server/summ_eval/server/http.py | mymusise/emnlp19-moverscore | 0fa2195fa1f63579b9a1daddf2f839bf7364fb80 | [
"MIT"
] | 21 | 2019-09-16T21:35:50.000Z | 2022-02-24T07:16:00.000Z | webservice/server/server/summ_eval/server/http.py | mymusise/emnlp19-moverscore | 0fa2195fa1f63579b9a1daddf2f839bf7364fb80 | [
"MIT"
] | 24 | 2019-12-05T07:01:27.000Z | 2022-01-17T16:36:19.000Z | from multiprocessing import Process
from termcolor import colored
from .helper import set_logger
class EvalHTTPProxy(Process):
def __init__(self, args):
super().__init__()
self.args = args
def create_flask_app(self):
try:
from flask import Flask, request
from... | 36.828125 | 101 | 0.583369 | from multiprocessing import Process
from termcolor import colored
from .helper import set_logger
class EvalHTTPProxy(Process):
def __init__(self, args):
super().__init__()
self.args = args
def create_flask_app(self):
try:
from flask import Flask, request
from... | true | true |
f7644611d284d763c5e26c46c26f43679acf97b4 | 109 | py | Python | utils/context_processor.py | polinaleonova/Project_Students_DB | 94f90f82e8ec353497244d36516de00b1211d799 | [
"MIT"
] | null | null | null | utils/context_processor.py | polinaleonova/Project_Students_DB | 94f90f82e8ec353497244d36516de00b1211d799 | [
"MIT"
] | null | null | null | utils/context_processor.py | polinaleonova/Project_Students_DB | 94f90f82e8ec353497244d36516de00b1211d799 | [
"MIT"
] | null | null | null | from django.conf import settings
def my_settings(request):
return {
'settings': settings
}
| 13.625 | 32 | 0.651376 | from django.conf import settings
def my_settings(request):
return {
'settings': settings
}
| true | true |
f764465dc3bbb256c2662bb993d224fb879619ff | 1,240 | py | Python | other_methods/extract_features_polaritylist.py | Subh1m/SentimentAnalysis_LexiconGeneration | 4bf78a7cfb0de00990c7e39c2bc92921f25dedf7 | [
"MIT"
] | 2 | 2016-08-04T13:11:36.000Z | 2021-01-12T07:17:59.000Z | other_methods/extract_features_polaritylist.py | Subh1m/SentimentAnalysis_LexiconGeneration | 4bf78a7cfb0de00990c7e39c2bc92921f25dedf7 | [
"MIT"
] | null | null | null | other_methods/extract_features_polaritylist.py | Subh1m/SentimentAnalysis_LexiconGeneration | 4bf78a7cfb0de00990c7e39c2bc92921f25dedf7 | [
"MIT"
] | null | null | null | '''
Extracts features from the raw data extracted from polarity list.
'''
ofile = open('processed_polist.txt','w')
orig_scores = []
def import_scores():
ing1 = open('realresults.txt','r')
ing2 = ing1.read()
ing3 = ing2.split()
for j in range(len(ing3)):
orig_scores.append(int(ing3[j]))
print orig_scores[:10]
... | 18.507463 | 65 | 0.632258 | '''
Extracts features from the raw data extracted from polarity list.
'''
ofile = open('processed_polist.txt','w')
orig_scores = []
def import_scores():
ing1 = open('realresults.txt','r')
ing2 = ing1.read()
ing3 = ing2.split()
for j in range(len(ing3)):
orig_scores.append(int(ing3[j]))
print orig_scores[:10]
... | false | true |
f764469b3b50944c565939272486caa1ae3671ae | 8,233 | py | Python | net/resnet_atrous.py | Ze-Yang/SDR | 623bcb6b4fd6775c10ffd6ed72a59c23a0b1fd8a | [
"Apache-2.0"
] | 31 | 2021-05-31T14:43:35.000Z | 2022-03-30T03:30:32.000Z | net/resnet_atrous.py | Ze-Yang/SDR | 623bcb6b4fd6775c10ffd6ed72a59c23a0b1fd8a | [
"Apache-2.0"
] | 10 | 2021-05-31T23:37:21.000Z | 2022-03-13T13:13:53.000Z | net/resnet_atrous.py | Ze-Yang/SDR | 623bcb6b4fd6775c10ffd6ed72a59c23a0b1fd8a | [
"Apache-2.0"
] | 4 | 2021-06-01T01:11:32.000Z | 2022-03-27T18:03:06.000Z | import torch.nn as nn
import math
import torch.utils.model_zoo as model_zoo
from net.sync_batchnorm import SynchronizedBatchNorm2d
bn_mom = 0.0003
model_urls = {
'resnet18': 'http://download.pytorch.org/models/resnet18-5c106cde.pth',
'resnet34': 'http://download.pytorch.org/models/resnet34-333f7ec4.pth',
'... | 38.115741 | 131 | 0.61132 | import torch.nn as nn
import math
import torch.utils.model_zoo as model_zoo
from net.sync_batchnorm import SynchronizedBatchNorm2d
bn_mom = 0.0003
model_urls = {
'resnet18': 'http://download.pytorch.org/models/resnet18-5c106cde.pth',
'resnet34': 'http://download.pytorch.org/models/resnet34-333f7ec4.pth',
'... | true | true |
f76446d730919f1a2ae4b8912328a70092f7d0b3 | 24,369 | py | Python | src/train_tripletloss.py | thaiph99/facenet | 8d9c8acdae076383e3354b293a1be47ab1f96a63 | [
"MIT"
] | null | null | null | src/train_tripletloss.py | thaiph99/facenet | 8d9c8acdae076383e3354b293a1be47ab1f96a63 | [
"MIT"
] | null | null | null | src/train_tripletloss.py | thaiph99/facenet | 8d9c8acdae076383e3354b293a1be47ab1f96a63 | [
"MIT"
] | null | null | null |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from datetime import datetime
import os.path
import time
import sys
import tensorflow.compat.v1 as tf
import numpy as np
import importlib
import itertools
import argparse
import facenet
import lfw
from tenso... | 48.640719 | 166 | 0.638352 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from datetime import datetime
import os.path
import time
import sys
import tensorflow.compat.v1 as tf
import numpy as np
import importlib
import itertools
import argparse
import facenet
import lfw
from tenso... | true | true |
f7644827a546d546f099a35c8cd066fbedce397f | 8,397 | py | Python | src/config/fabric-ansible/ansible-playbooks/filter_plugins/rma_filters.py | jnpr-pranav/contrail-controller | 428eee37c28c31830fd764315794e1a6e52720c1 | [
"Apache-2.0"
] | 1 | 2020-04-16T20:34:55.000Z | 2020-04-16T20:34:55.000Z | src/config/fabric-ansible/ansible-playbooks/filter_plugins/rma_filters.py | jnpr-pranav/contrail-controller | 428eee37c28c31830fd764315794e1a6e52720c1 | [
"Apache-2.0"
] | null | null | null | src/config/fabric-ansible/ansible-playbooks/filter_plugins/rma_filters.py | jnpr-pranav/contrail-controller | 428eee37c28c31830fd764315794e1a6e52720c1 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
#
# Copyright (c) 2018 Juniper Networks, Inc. All rights reserved.
#
# This file contains code to support the RMA devices feature
#
from builtins import object
from builtins import str
import sys
import traceback
from job_manager.job_utils import JobVncApi
sys.path.append("/opt/contrail/fabric_ansi... | 38.168182 | 96 | 0.609027 |
from builtins import object
from builtins import str
import sys
import traceback
from job_manager.job_utils import JobVncApi
sys.path.append("/opt/contrail/fabric_ansible_playbooks/module_utils")
from filter_utils import FilterLog, _task_error_log, get_job_transaction, \
set_job_transaction from vnc_api.excepti... | true | true |
f76449faa10e10441296590f97fe82542529350d | 417 | py | Python | references/mmdetection/dev/py_abc.py | flystarhe/cvtk | bcfea4c5b13269bdd63899020b9c70f2eb1f5b07 | [
"MIT"
] | 1 | 2021-06-29T07:12:45.000Z | 2021-06-29T07:12:45.000Z | references/mmdetection/dev/py_abc.py | flystarhe/cvtk | bcfea4c5b13269bdd63899020b9c70f2eb1f5b07 | [
"MIT"
] | null | null | null | references/mmdetection/dev/py_abc.py | flystarhe/cvtk | bcfea4c5b13269bdd63899020b9c70f2eb1f5b07 | [
"MIT"
] | null | null | null | from cvtk.io import load_json
from cvtk.transforms.mmdet import RandomCrop, Resize
from mmdet.datasets import CocoDataset as _CocoDataset
class CocoDataset(_CocoDataset):
def load_annotations(self, ann_file):
cats = load_json(ann_file)["categories"]
self.CLASSES = [cat["name"] for cat in cats]
... | 32.076923 | 72 | 0.738609 | from cvtk.io import load_json
from cvtk.transforms.mmdet import RandomCrop, Resize
from mmdet.datasets import CocoDataset as _CocoDataset
class CocoDataset(_CocoDataset):
def load_annotations(self, ann_file):
cats = load_json(ann_file)["categories"]
self.CLASSES = [cat["name"] for cat in cats]
... | true | true |
f7644a0840f3456537a887145219866abbf96f06 | 1,627 | py | Python | tests/test_auth.py | XelK/blog | 7b2065c47c9887cab932ea7e75dce944fc2a6a1a | [
"MIT"
] | null | null | null | tests/test_auth.py | XelK/blog | 7b2065c47c9887cab932ea7e75dce944fc2a6a1a | [
"MIT"
] | null | null | null | tests/test_auth.py | XelK/blog | 7b2065c47c9887cab932ea7e75dce944fc2a6a1a | [
"MIT"
] | null | null | null | import pytest
from flask import g, session
from flaskr.db import get_db
def test_register(client, app):
assert client.get('/auth/register').status_code == 200
response = client.post(
'/auth/register', data = {'username': 'a', 'password': 'a'}
)
assert 'http://localhost/auth/login' == response.h... | 30.12963 | 72 | 0.637984 | import pytest
from flask import g, session
from flaskr.db import get_db
def test_register(client, app):
assert client.get('/auth/register').status_code == 200
response = client.post(
'/auth/register', data = {'username': 'a', 'password': 'a'}
)
assert 'http://localhost/auth/login' == response.h... | true | true |
f7644a61e48a8e3e27dfea91d8595e9111ce5e54 | 1,029 | py | Python | grafanalib/tests/test_opentsdb.py | maxnasonov/grafanalib | 7a29fdba2a62796d8ecb7dfb243c1879ff2ec45a | [
"Apache-2.0"
] | null | null | null | grafanalib/tests/test_opentsdb.py | maxnasonov/grafanalib | 7a29fdba2a62796d8ecb7dfb243c1879ff2ec45a | [
"Apache-2.0"
] | 1 | 2018-02-21T09:30:14.000Z | 2018-02-21T12:25:32.000Z | grafanalib/tests/test_opentsdb.py | maxnasonov/grafanalib | 7a29fdba2a62796d8ecb7dfb243c1879ff2ec45a | [
"Apache-2.0"
] | null | null | null | """Tests for OpenTSDB datasource"""
import grafanalib.core as G
from grafanalib.opentsdb import (
OpenTSDBFilter,
OpenTSDBTarget,
)
from grafanalib import _gen
import sys
if sys.version_info[0] < 3:
from io import BytesIO as StringIO
else:
from io import StringIO
def test_serialization_opentsdb_targ... | 25.725 | 73 | 0.562682 |
import grafanalib.core as G
from grafanalib.opentsdb import (
OpenTSDBFilter,
OpenTSDBTarget,
)
from grafanalib import _gen
import sys
if sys.version_info[0] < 3:
from io import BytesIO as StringIO
else:
from io import StringIO
def test_serialization_opentsdb_target():
graph = G.Graph(
t... | true | true |
f7644a934d0ca650b28f9bf66775d11574333978 | 44,750 | py | Python | tests/unit/test_ui.py | LudvigVidlid/vunit | 8c670cf156478d718325b07628fda00c3b941c7d | [
"Artistic-2.0",
"Apache-2.0"
] | 3 | 2021-03-09T15:01:40.000Z | 2022-02-05T12:11:55.000Z | tests/unit/test_ui.py | LudvigVidlid/vunit | 8c670cf156478d718325b07628fda00c3b941c7d | [
"Artistic-2.0",
"Apache-2.0"
] | 4 | 2022-02-04T08:24:33.000Z | 2022-03-14T17:06:48.000Z | tests/unit/test_ui.py | LudvigVidlid/vunit | 8c670cf156478d718325b07628fda00c3b941c7d | [
"Artistic-2.0",
"Apache-2.0"
] | 4 | 2020-03-25T16:49:30.000Z | 2022-02-01T11:18:12.000Z | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Copyright (c) 2014-2020, Lars Asplund lars.anders.asplund@gmail.com
#
# pylint: disable=too-many-public-methods, too-... | 33.123612 | 113 | 0.588268 |
import unittest
from string import Template
from pathlib import Path
from os import chdir, getcwd
import json
import re
from re import MULTILINE
from shutil import rmtree
from unittest import mock
from tests.common import set_env, with_tempdir, create_vhdl_test_bench_file
from vunit.ui import VUnit
from vunit.source_... | true | true |
f7644d0faa59229997f4f21b77457976ca2567d9 | 499 | py | Python | script/joy_ctrl.py | flymaxty/Max_Robot | bf7d5d0876763faf3b8ed3ddcf1ecad8b32a8284 | [
"MIT"
] | 1 | 2017-02-12T13:06:20.000Z | 2017-02-12T13:06:20.000Z | script/joy_ctrl.py | flymaxty/Max_Robot | bf7d5d0876763faf3b8ed3ddcf1ecad8b32a8284 | [
"MIT"
] | null | null | null | script/joy_ctrl.py | flymaxty/Max_Robot | bf7d5d0876763faf3b8ed3ddcf1ecad8b32a8284 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import rospy
from sensor_msgs.msg import Joy
from geometry_msgs.msg import Twist
global vel
def callback(data):
vel.linear.x = data.axes[1] * 0.4
vel.angular.z = data.axes[2] * 1
if __name__ == '__main__':
pub = rospy.Publisher('cmd_vel', Twist, queue_size=10)
rospy.Subscriber('joy', Joy... | 19.192308 | 55 | 0.703407 |
import rospy
from sensor_msgs.msg import Joy
from geometry_msgs.msg import Twist
global vel
def callback(data):
vel.linear.x = data.axes[1] * 0.4
vel.angular.z = data.axes[2] * 1
if __name__ == '__main__':
pub = rospy.Publisher('cmd_vel', Twist, queue_size=10)
rospy.Subscriber('joy', Joy, callback)
rospy.in... | true | true |
f7644d653842b024630e535566df750996716124 | 1,148 | py | Python | problems/prob067.py | Tony-Tsoi/Proj-Euler-Ans | a9d871a77986fc51e2e85aa5894a8e0c5bfee241 | [
"MIT"
] | null | null | null | problems/prob067.py | Tony-Tsoi/Proj-Euler-Ans | a9d871a77986fc51e2e85aa5894a8e0c5bfee241 | [
"MIT"
] | null | null | null | problems/prob067.py | Tony-Tsoi/Proj-Euler-Ans | a9d871a77986fc51e2e85aa5894a8e0c5bfee241 | [
"MIT"
] | null | null | null | """
Problem 67
By starting at the top of the triangle below and moving to adjacent
numbers on the row below, the maximum total from top to bottom is 23.
3
7 4
2 4 6
8 5 9 3
That is, 3 + 7 + 4 + 9 = 23.
Find the maximum total from top to bottom in triangle.txt (right click
and 'Save Link/Target As...'), a 15K text... | 28.7 | 71 | 0.657666 | def answer():
f = open('data/p067_triangle.txt')
L = []
for line in f:
L.append(list(map(int, line.split())))
for i in range(len(L)-2, -1, -1):
for j in range(len(L[i])):
L[i][j] += max(L[i+1][j], L[i+1][j+1])
print(L[0][0])
if __name__ == "__main__":
import tim... | true | true |
f7644e07f3859a8125aa5ec0368f4e8cd1d7b067 | 3,230 | py | Python | warmup_scheduler/scheduler.py | Haawron/pytorch-gradual-warmup-lr | 56db5a21b81e38cadeaebf70ae2e2436ed5f1088 | [
"MIT"
] | null | null | null | warmup_scheduler/scheduler.py | Haawron/pytorch-gradual-warmup-lr | 56db5a21b81e38cadeaebf70ae2e2436ed5f1088 | [
"MIT"
] | null | null | null | warmup_scheduler/scheduler.py | Haawron/pytorch-gradual-warmup-lr | 56db5a21b81e38cadeaebf70ae2e2436ed5f1088 | [
"MIT"
] | null | null | null | from torch.optim.lr_scheduler import _LRScheduler
from torch.optim.lr_scheduler import ReduceLROnPlateau
class GradualWarmupScheduler(_LRScheduler):
""" Gradually warm-up(increasing) learning rate in optimizer.
Proposed in 'Accurate, Large Minibatch SGD: Training ImageNet in 1 Hour'.
Args:
optimi... | 48.939394 | 152 | 0.647368 | from torch.optim.lr_scheduler import _LRScheduler
from torch.optim.lr_scheduler import ReduceLROnPlateau
class GradualWarmupScheduler(_LRScheduler):
def __init__(self, optimizer, multiplier, total_epoch, after_scheduler=None):
self.multiplier = multiplier
if self.multiplier < 1.:
rais... | true | true |
f7644f4766c3388218f510abb2c340845c8e5682 | 1,771 | py | Python | tests/test_005_external_data.py | ArtesiaWater/nlmod | 99cd0d8c4e6dc92b4a097d74e9a856bd50fb776d | [
"MIT"
] | 2 | 2022-01-26T10:47:04.000Z | 2022-02-22T13:54:27.000Z | tests/test_005_external_data.py | ArtesiaWater/nlmod | 99cd0d8c4e6dc92b4a097d74e9a856bd50fb776d | [
"MIT"
] | 24 | 2021-08-17T14:32:55.000Z | 2022-03-31T08:31:16.000Z | tests/test_005_external_data.py | ArtesiaWater/nlmod | 99cd0d8c4e6dc92b4a097d74e9a856bd50fb776d | [
"MIT"
] | 1 | 2021-10-05T13:01:04.000Z | 2021-10-05T13:01:04.000Z | import nlmod
import test_001_model
def test_get_recharge():
# model with sea
model_ds = test_001_model.test_get_model_ds_from_cache('sea_model_grid')
# add knmi recharge to the model dataset
model_ds.update(nlmod.read.knmi.get_recharge(model_ds))
return model_ds
def test_get_recharge_steady_... | 28.564516 | 76 | 0.635234 | import nlmod
import test_001_model
def test_get_recharge():
model_ds = test_001_model.test_get_model_ds_from_cache('sea_model_grid')
model_ds.update(nlmod.read.knmi.get_recharge(model_ds))
return model_ds
def test_get_recharge_steady_state():
model_ds = test_001_model.test_get_model... | true | true |
f764501e9a052f15137aadf9b9c24123cfc34181 | 3,239 | py | Python | q2_pepsirf/actions/demux.py | LadnerLab/q2-pepsirf | 47de628294cb47d1c1c5881b825e3807b1b5fa02 | [
"Apache-2.0"
] | null | null | null | q2_pepsirf/actions/demux.py | LadnerLab/q2-pepsirf | 47de628294cb47d1c1c5881b825e3807b1b5fa02 | [
"Apache-2.0"
] | null | null | null | q2_pepsirf/actions/demux.py | LadnerLab/q2-pepsirf | 47de628294cb47d1c1c5881b825e3807b1b5fa02 | [
"Apache-2.0"
] | null | null | null | import subprocess, os
import tempfile, qiime2
from q2_pepsirf.format_types import PepsirfContingencyTSVFormat, PepsirfDemuxDiagnosticFormat, PepsirfDemuxFastqFmt, PepsirfDemuxFifFmt, PepsirfDemuxIndexFmt, PepsirfDemuxLibraryFmt, PepsirfDemuxSampleListFmt
# Name: demux
# Process: runs pepsirf's demux module (curre... | 38.105882 | 209 | 0.625502 | import subprocess, os
import tempfile, qiime2
from q2_pepsirf.format_types import PepsirfContingencyTSVFormat, PepsirfDemuxDiagnosticFormat, PepsirfDemuxFastqFmt, PepsirfDemuxFifFmt, PepsirfDemuxIndexFmt, PepsirfDemuxLibraryFmt, PepsirfDemuxSampleListFmt
# Method inputs/parameters: input_r1, index, samplelist, seq... | true | true |
f764522835996f8c43f2defdc3289050da32f288 | 9,032 | py | Python | grr/server/grr_response_server/output_plugins/bigquery_plugin_test.py | certxlm/grr | c2a442a27f656fb18dfa3bce098847e5c5b849d7 | [
"Apache-2.0"
] | 1 | 2019-08-28T23:48:20.000Z | 2019-08-28T23:48:20.000Z | grr/server/grr_response_server/output_plugins/bigquery_plugin_test.py | certxlm/grr | c2a442a27f656fb18dfa3bce098847e5c5b849d7 | [
"Apache-2.0"
] | 2 | 2022-01-15T03:18:12.000Z | 2022-02-13T22:02:43.000Z | grr/server/grr_response_server/output_plugins/bigquery_plugin_test.py | acidburn0zzz/grr | 44e1a5b1630e8101610faaaebe15b19b5ad30cb1 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""Tests for BigQuery output plugin."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import gzip
import os
from absl import app
from future.builtins import range
from future.builtins import str
from futur... | 36.273092 | 80 | 0.656554 | from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import gzip
import os
from absl import app
from future.builtins import range
from future.builtins import str
from future.builtins import zip
import mock
from grr_response_core import config
from grr_respons... | true | true |
f764531e2c609081107c0d91ae94ee5315dd80a0 | 3,406 | py | Python | app/app/settings.py | Nilsen11/django-rest-api | e3a1af8b4df0e648a517556188ddd9ac2291d9c3 | [
"MIT"
] | null | null | null | app/app/settings.py | Nilsen11/django-rest-api | e3a1af8b4df0e648a517556188ddd9ac2291d9c3 | [
"MIT"
] | null | null | null | app/app/settings.py | Nilsen11/django-rest-api | e3a1af8b4df0e648a517556188ddd9ac2291d9c3 | [
"MIT"
] | null | null | null | """
Django settings for app project.
Generated by 'django-admin startproject' using Django 2.1.7.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.1/ref/settings/
"""
import os
# Bui... | 26.403101 | 91 | 0.686142 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = '(1m*hxp*jbbh&0ldl!m#h@jbr^q*6&(f&=4pn#hkolhuy(7zmd'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',... | true | true |
f7645380ed2d7ccec54cd3c5a730ad17db91f0f8 | 193 | py | Python | projects/apps.py | lizschley/number_six | a427202397822fca1f49d43d138c24fffdbe95da | [
"MIT"
] | 1 | 2020-07-14T20:13:05.000Z | 2020-07-14T20:13:05.000Z | projects/apps.py | lizschley/number_six | a427202397822fca1f49d43d138c24fffdbe95da | [
"MIT"
] | 3 | 2021-04-06T20:40:08.000Z | 2021-06-03T21:54:21.000Z | projects/apps.py | lizschley/number_six | a427202397822fca1f49d43d138c24fffdbe95da | [
"MIT"
] | null | null | null | ''' projects app config '''
from django.apps import AppConfig
class ProjectsConfig(AppConfig):
''' project apps, currently everything that is not home or resume '''
name = 'projects'
| 24.125 | 73 | 0.709845 | from django.apps import AppConfig
class ProjectsConfig(AppConfig):
name = 'projects'
| true | true |
f764551340bd82523bf298c595ea2917b0e940f8 | 34,542 | py | Python | dyrep.py | uoguelph-mlrg/LDG | 203695748fb6d12cef40a801e634fbdab5e23692 | [
"ECL-2.0"
] | 80 | 2019-09-24T01:56:58.000Z | 2022-03-10T07:20:52.000Z | dyrep.py | uoguelph-mlrg/LDG | 203695748fb6d12cef40a801e634fbdab5e23692 | [
"ECL-2.0"
] | 9 | 2019-11-14T12:33:21.000Z | 2022-03-14T08:05:54.000Z | dyrep.py | uoguelph-mlrg/LDG | 203695748fb6d12cef40a801e634fbdab5e23692 | [
"ECL-2.0"
] | 25 | 2019-09-26T02:14:22.000Z | 2022-03-09T12:22:03.000Z | import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from encoder import *
from utils import *
class DyRep(nn.Module):
def __init__(self,
node_embeddings,
# n_event_types,
N_nodes,
A_initial=None,
... | 46.240964 | 202 | 0.522147 | import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from encoder import *
from utils import *
class DyRep(nn.Module):
def __init__(self,
node_embeddings,
N_nodes,
A_initial=None,
N_surv_samples=5... | true | true |
f7645582bd2ef3d63ac0d408aecef359ba9a383a | 3,068 | py | Python | okl4_kernel/okl4_2.1.1-patch.9/tools/SCons/Options/BoolOption.py | CyberQueenMara/baseband-research | e1605537e10c37e161fff1a3416b908c9894f204 | [
"MIT"
] | 77 | 2018-12-31T22:12:09.000Z | 2021-12-31T22:56:13.000Z | okl4_kernel/okl4_2.1.1-patch.9/tools/SCons/Options/BoolOption.py | CyberQueenMara/baseband-research | e1605537e10c37e161fff1a3416b908c9894f204 | [
"MIT"
] | null | null | null | okl4_kernel/okl4_2.1.1-patch.9/tools/SCons/Options/BoolOption.py | CyberQueenMara/baseband-research | e1605537e10c37e161fff1a3416b908c9894f204 | [
"MIT"
] | 24 | 2019-01-20T15:51:52.000Z | 2021-12-25T18:29:13.000Z | """engine.SCons.Options.BoolOption
This file defines the option type for SCons implementing true/false values.
Usage example:
opts = Options()
opts.Add(BoolOption('embedded', 'build for an embedded system', 0))
...
if env['embedded'] == 1:
...
"""
#
# Copyright (c) 2001, 2002, 2003, 2004 The SCons Found... | 34.47191 | 141 | 0.70339 | """engine.SCons.Options.BoolOption
This file defines the option type for SCons implementing true/false values.
Usage example:
opts = Options()
opts.Add(BoolOption('embedded', 'build for an embedded system', 0))
...
if env['embedded'] == 1:
...
"""
__revision__ = "/home/scons/scons/branch.0/branch.96/ba... | false | true |
f76455f7881e1992450c0194cd9448fca85fbc5d | 9,351 | py | Python | saleor/graphql/checkout/tests/test_checkout_digital.py | asadrajput2/saleor | 26048fa4ceb30813075716ec04f5ebde1bff14c6 | [
"CC-BY-4.0"
] | 1 | 2021-04-22T12:36:32.000Z | 2021-04-22T12:36:32.000Z | saleor/graphql/checkout/tests/test_checkout_digital.py | asadrajput2/saleor | 26048fa4ceb30813075716ec04f5ebde1bff14c6 | [
"CC-BY-4.0"
] | 2 | 2021-03-20T10:39:06.000Z | 2021-03-26T01:11:13.000Z | saleor/graphql/checkout/tests/test_checkout_digital.py | asadrajput2/saleor | 26048fa4ceb30813075716ec04f5ebde1bff14c6 | [
"CC-BY-4.0"
] | null | null | null | """Test the API's checkout process over full digital orders."""
import graphene
import pytest
from ....account.models import Address
from ....checkout import calculations
from ....checkout.error_codes import CheckoutErrorCode
from ....checkout.models import Checkout
from ....checkout.utils import add_variant_to_checko... | 34.762082 | 86 | 0.734895 | import graphene
import pytest
from ....account.models import Address
from ....checkout import calculations
from ....checkout.error_codes import CheckoutErrorCode
from ....checkout.models import Checkout
from ....checkout.utils import add_variant_to_checkout
from ....order.models import Order
from ...checkout.mutations... | true | true |
f76456ee831f89270b96c93983b5e08291f39708 | 885 | py | Python | AbletonLiveScripts/v10/ComradeEncoders/message.py | lzref/ComradeEncoders | 154a10d7d1c83e6b8f28af7f19ee6cb2a45a88e9 | [
"MIT"
] | 1 | 2021-11-26T01:52:30.000Z | 2021-11-26T01:52:30.000Z | AbletonLiveScripts/v10/ComradeEncoders/message.py | lzref/ComradeEncoders | 154a10d7d1c83e6b8f28af7f19ee6cb2a45a88e9 | [
"MIT"
] | null | null | null | AbletonLiveScripts/v10/ComradeEncoders/message.py | lzref/ComradeEncoders | 154a10d7d1c83e6b8f28af7f19ee6cb2a45a88e9 | [
"MIT"
] | 1 | 2021-11-26T01:52:31.000Z | 2021-11-26T01:52:31.000Z | # uncompyle6 version 3.4.1
# Python bytecode 2.7 (62211)
# Decompiled from: Python 2.7.16 (v2.7.16:413a49145e, Mar 2 2019, 14:32:10)
# [GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)]
# Embedded file name: /Users/versonator/Jenkins/live/output/mac_64_static/Release/python-bundle/MIDI Remote Scripts/SL_MkIII/mes... | 49.166667 | 135 | 0.767232 | from __future__ import absolute_import, print_function, unicode_literals
from itertools import izip
from ableton.v2.control_surface import Component
from ableton.v2.control_surface.control import TextDisplayControl
NUM_MESSAGE_SEGMENTS = 2
class MessageComponent(Component):
display = TextDisplayControl(segments=(u... | true | true |
f76457a3d637d701fa9e02032eecb771bddcce8c | 2,359 | py | Python | app/models/paper.py | oq-Yuki-po/PaperLibrary | 2b86da52af08b487c78d1f9007cb9c02bc160235 | [
"MIT"
] | null | null | null | app/models/paper.py | oq-Yuki-po/PaperLibrary | 2b86da52af08b487c78d1f9007cb9c02bc160235 | [
"MIT"
] | null | null | null | app/models/paper.py | oq-Yuki-po/PaperLibrary | 2b86da52af08b487c78d1f9007cb9c02bc160235 | [
"MIT"
] | null | null | null | from datetime import datetime
from typing import Optional
from sqlalchemy import TEXT, Boolean, Column, Date, Integer
from sqlalchemy.orm import backref, relationship
from sqlalchemy.schema import ForeignKey
from app.models import ArxivQueryModel, BaseModel
class PaperModel(BaseModel):
"""
PaperModel
""... | 36.859375 | 119 | 0.607885 | from datetime import datetime
from typing import Optional
from sqlalchemy import TEXT, Boolean, Column, Date, Integer
from sqlalchemy.orm import backref, relationship
from sqlalchemy.schema import ForeignKey
from app.models import ArxivQueryModel, BaseModel
class PaperModel(BaseModel):
__tablename__ = 'papers'
... | true | true |
f764582172152c700ee5428785a64d6d5ebeb985 | 6,392 | py | Python | assets/src/ba_data/python/ba/_modutils.py | BombSquaders/ballistica | bd1b98dfb9bf1c8c0a05a5feed44a6c8d9513e17 | [
"MIT"
] | null | null | null | assets/src/ba_data/python/ba/_modutils.py | BombSquaders/ballistica | bd1b98dfb9bf1c8c0a05a5feed44a6c8d9513e17 | [
"MIT"
] | null | null | null | assets/src/ba_data/python/ba/_modutils.py | BombSquaders/ballistica | bd1b98dfb9bf1c8c0a05a5feed44a6c8d9513e17 | [
"MIT"
] | null | null | null | # Copyright (c) 2011-2020 Eric Froemling
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish,... | 40.713376 | 79 | 0.657541 | from __future__ import annotations
from typing import TYPE_CHECKING
import os
import _ba
if TYPE_CHECKING:
from typing import Optional
def get_human_readable_user_scripts_path() -> str:
from ba import _lang
app = _ba.app
path: Optional[str] = app.python_directory_user
if path is None:
r... | true | true |
f76458faedc6f45c8f856aa032491de374ffea20 | 1,316 | py | Python | prestoadmin/topology.py | leniartek/trino-admin | 05104a0b35bbc4aeca9469b2fc63a21c814a7855 | [
"Apache-2.0"
] | 34 | 2016-01-08T21:02:13.000Z | 2017-03-10T02:01:03.000Z | prestoadmin/topology.py | starburstdata/presto-admin | 1bb652debefe1e26e9105f8ffb08a8793790967a | [
"Apache-2.0"
] | 19 | 2019-05-16T13:09:25.000Z | 2020-12-04T18:01:39.000Z | prestoadmin/topology.py | starburstdata/presto-admin | 1bb652debefe1e26e9105f8ffb08a8793790967a | [
"Apache-2.0"
] | 15 | 2019-03-07T16:37:06.000Z | 2020-11-12T12:07:46.000Z | # -*- coding: utf-8 -*-
#
# 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, software
... | 29.909091 | 75 | 0.736322 |
import pprint
from fabric.api import env, runs_once, task
from prestoadmin.standalone.config import StandaloneConfig
from prestoadmin.util.base_config import requires_config
import prestoadmin.util.fabricapi as util
@task
@runs_once
@requires_config(StandaloneConfig)
def show():
pprint.pprint(get_conf_from_fa... | true | true |
f7645915b72318123bd82eda8916e205fbd5ab8a | 5,058 | py | Python | realtime_20200825/plot_monit.py | takumihonda/AIP_realtime | 03d6cf3e1405c21b73bf2923cb6914aeb6f3634d | [
"MIT"
] | null | null | null | realtime_20200825/plot_monit.py | takumihonda/AIP_realtime | 03d6cf3e1405c21b73bf2923cb6914aeb6f3634d | [
"MIT"
] | null | null | null | realtime_20200825/plot_monit.py | takumihonda/AIP_realtime | 03d6cf3e1405c21b73bf2923cb6914aeb6f3634d | [
"MIT"
] | null | null | null | import numpy as np
import sys
import os
from netCDF4 import Dataset
from datetime import datetime, timedelta
quick = True
quick = False
#theight = 3000.0
theight = 2000.0
# UTC
stime = datetime( 2020, 8, 24, 7, 0 )
etime = datetime( 2020, 9, 7, 0, 0 )
# Figure x range
stime_ = datetime( 2020, 8, 25, 0, 0 )
... | 24.916256 | 189 | 0.574338 | import numpy as np
import sys
import os
from netCDF4 import Dataset
from datetime import datetime, timedelta
quick = True
quick = False
theight = 2000.0
stime = datetime( 2020, 8, 24, 7, 0 )
etime = datetime( 2020, 9, 7, 0, 0 )
stime_ = datetime( 2020, 8, 25, 0, 0 )
etime_ = datetime( 2020, 9, 7, 0, 0 )
t... | true | true |
f76459a7eb0f9b3e40935e81e7a624dab9fd6bc4 | 175 | py | Python | data/models/wake_snow.py | itsraina/nala | 19a5ff7cda48b7f764f626035b98ed86bd77c301 | [
"ECL-2.0",
"Apache-2.0"
] | 28 | 2018-12-01T19:31:06.000Z | 2022-02-08T17:00:18.000Z | data/models/wake_snow.py | itsraina/nala | 19a5ff7cda48b7f764f626035b98ed86bd77c301 | [
"ECL-2.0",
"Apache-2.0"
] | 4 | 2018-10-15T19:19:16.000Z | 2019-03-30T19:07:19.000Z | data/models/wake_snow.py | itsraina/nala | 19a5ff7cda48b7f764f626035b98ed86bd77c301 | [
"ECL-2.0",
"Apache-2.0"
] | 11 | 2019-10-05T01:57:29.000Z | 2021-03-26T08:43:32.000Z | '''
wake_snow.py
Wake with 'Hey Nala' keyword using snowboy and python2.
Python3 wrapper for python2 with os module.
'''
import os
os.system('python snowboy.py Nala.pmdl')
| 15.909091 | 55 | 0.742857 | import os
os.system('python snowboy.py Nala.pmdl')
| true | true |
f7645a16899e456d0b0e440aad7cf8eb99cef322 | 214 | py | Python | tools/test.py | ZippeyKeys12/enki | 324c503ea59ab9caaad62d197723aac82b6f5f0b | [
"BSD-3-Clause"
] | 1 | 2018-09-27T19:45:28.000Z | 2018-09-27T19:45:28.000Z | tools/test.py | ZippeyKeys12/enki | 324c503ea59ab9caaad62d197723aac82b6f5f0b | [
"BSD-3-Clause"
] | null | null | null | tools/test.py | ZippeyKeys12/enki | 324c503ea59ab9caaad62d197723aac82b6f5f0b | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
import os
from subprocess import run
run(["py", "tools/bobby/build.py", "Enki", "-C", "-V3.3"])
print("Running Steam")
run([r"C:\Program Files (x86)\Steam\Steam.exe", "-applaunch", "2300"])
| 26.75 | 70 | 0.654206 | import os
from subprocess import run
run(["py", "tools/bobby/build.py", "Enki", "-C", "-V3.3"])
print("Running Steam")
run([r"C:\Program Files (x86)\Steam\Steam.exe", "-applaunch", "2300"])
| true | true |
f7645a43c4c1ca781b475f266c2543938ae3de50 | 1,916 | py | Python | info/__init__.py | Alison67/NewsWebsite | 16fc24ac33cf52032f78aecd4631d1c43cd0d42b | [
"MIT"
] | null | null | null | info/__init__.py | Alison67/NewsWebsite | 16fc24ac33cf52032f78aecd4631d1c43cd0d42b | [
"MIT"
] | null | null | null | info/__init__.py | Alison67/NewsWebsite | 16fc24ac33cf52032f78aecd4631d1c43cd0d42b | [
"MIT"
] | null | null | null | import logging
from logging.handlers import RotatingFileHandler
from flask import Flask, session
from flask_session import Session
from flask_sqlalchemy import SQLAlchemy
from flask_wtf import CSRFProtect
from flask_wtf.csrf import generate_csrf
from redis import StrictRedis
from config import config
# 初始化db
from in... | 29.476923 | 124 | 0.751044 | import logging
from logging.handlers import RotatingFileHandler
from flask import Flask, session
from flask_session import Session
from flask_sqlalchemy import SQLAlchemy
from flask_wtf import CSRFProtect
from flask_wtf.csrf import generate_csrf
from redis import StrictRedis
from config import config
from info.utils... | true | true |
f7645aacdade4a77e0588d883f23072cefbaa36c | 3,434 | py | Python | gui shahmeer2.py | sp19bscs0110/cp19project | d4f9d9c899659034c6ec179382be606a552ba367 | [
"Apache-2.0"
] | null | null | null | gui shahmeer2.py | sp19bscs0110/cp19project | d4f9d9c899659034c6ec179382be606a552ba367 | [
"Apache-2.0"
] | 1 | 2019-05-05T15:19:32.000Z | 2019-05-05T15:19:32.000Z | gui shahmeer2.py | sp19bscs0110/TeamHR | d4f9d9c899659034c6ec179382be606a552ba367 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# In[ ]:
from tkinter import *
window = Tk()
window.title("Remote Scren Viewer Taking SS")
window.geometry('220x430')
#heading k lie.......................
lbl = Label(window, text="Welcome to Remote Screen Viewer", font=("Arial Bold", 50))
lbl.grid(column=3, row=7)
... | 20.319527 | 131 | 0.612114 |
from tkinter import *
window = Tk()
window.title("Remote Scren Viewer Taking SS")
window.geometry('220x430')
lbl = Label(window, text="Welcome to Remote Screen Viewer", font=("Arial Bold", 50))
lbl.grid(column=3, row=7)
lbl = Label(window, text=" ")
lbl.grid(column=3, row=9)
def serverconn():
... | true | true |
f7645ad6b947ef2e9aed78c87ecd4bcb4f382303 | 189 | py | Python | tests/test_event.py | yuvadm/nostrpy | 65db6c4c19862e93c3179b298774cbea9d216c5b | [
"MIT"
] | null | null | null | tests/test_event.py | yuvadm/nostrpy | 65db6c4c19862e93c3179b298774cbea9d216c5b | [
"MIT"
] | 1 | 2022-01-17T18:47:48.000Z | 2022-01-17T18:47:48.000Z | tests/test_event.py | yuvadm/nostrpy | 65db6c4c19862e93c3179b298774cbea9d216c5b | [
"MIT"
] | null | null | null | from nostr.event import Event
def test_event_id():
e = Event("1q", "asd", created_at=1641819738)
assert e.id == "bbe84e5f88993ad461f0ee82f746ed5f1aa023c53187185c54d95561deb2651f"
| 27 | 85 | 0.767196 | from nostr.event import Event
def test_event_id():
e = Event("1q", "asd", created_at=1641819738)
assert e.id == "bbe84e5f88993ad461f0ee82f746ed5f1aa023c53187185c54d95561deb2651f"
| true | true |
f7645b1b6762b81ccb5159f500a9aa07e80f593d | 9,049 | py | Python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_load_balancer_frontend_ip_configurations_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 2,728 | 2015-01-09T10:19:32.000Z | 2022-03-31T14:50:33.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_load_balancer_frontend_ip_configurations_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 17,773 | 2015-01-05T15:57:17.000Z | 2022-03-31T23:50:25.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_load_balancer_frontend_ip_configurations_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 1,916 | 2015-01-19T05:05:41.000Z | 2022-03-31T19:36:44.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 48.913514 | 228 | 0.675655 | from typing import TYPE_CHECKING
import warnings
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import HttpR... | true | true |
f7645b30bad1d1b7a134992a7e64c2ac761f88f1 | 1,016 | py | Python | python/src/nnabla/backward_function/acosh.py | daniel-falk/nnabla | 3fe132ea52dc10521cc029a5d6ba8f565cf65ccf | [
"Apache-2.0"
] | 2,792 | 2017-06-26T13:05:44.000Z | 2022-03-28T07:55:26.000Z | python/src/nnabla/backward_function/acosh.py | daniel-falk/nnabla | 3fe132ea52dc10521cc029a5d6ba8f565cf65ccf | [
"Apache-2.0"
] | 138 | 2017-06-27T07:04:44.000Z | 2022-02-28T01:37:15.000Z | python/src/nnabla/backward_function/acosh.py | daniel-falk/nnabla | 3fe132ea52dc10521cc029a5d6ba8f565cf65ccf | [
"Apache-2.0"
] | 380 | 2017-06-26T13:23:52.000Z | 2022-03-25T16:51:30.000Z | # Copyright 2019,2020,2021 Sony Corporation.
#
# 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... | 35.034483 | 86 | 0.709646 |
def acosh_backward(inputs):
dy = inputs[0]
x0 = inputs[1]
dx0 = dy * (x0 ** 2 - 1) ** (-1.0 / 2)
return dx0
| true | true |
f7645c0d1620ce2000cbc30ad3d8047a7eb30a5f | 938 | py | Python | isi_sdk_7_2/test/test_nfs_alias_create_params.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 24 | 2018-06-22T14:13:23.000Z | 2022-03-23T01:21:26.000Z | isi_sdk_7_2/test/test_nfs_alias_create_params.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 46 | 2018-04-30T13:28:22.000Z | 2022-03-21T21:11:07.000Z | isi_sdk_7_2/test/test_nfs_alias_create_params.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 29 | 2018-06-19T00:14:04.000Z | 2022-02-08T17:51:19.000Z | # coding: utf-8
"""
Isilon SDK
Isilon SDK - Language bindings for the OneFS API # noqa: E501
OpenAPI spec version: 2
Contact: sdk@isilon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import isi_sdk_7_2
from isi... | 22.878049 | 97 | 0.716418 |
from __future__ import absolute_import
import unittest
import isi_sdk_7_2
from isi_sdk_7_2.models.nfs_alias_create_params import NfsAliasCreateParams from isi_sdk_7_2.rest import ApiException
class TestNfsAliasCreateParams(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
p... | true | true |
f7645ccc0e3afee8d9b5bae2588667044223cded | 452 | py | Python | setup.py | ljm625/ios-xr-grpc-python | ca9183cb9190b7c9b74357108abe4ae7cb2c4224 | [
"Apache-2.0"
] | null | null | null | setup.py | ljm625/ios-xr-grpc-python | ca9183cb9190b7c9b74357108abe4ae7cb2c4224 | [
"Apache-2.0"
] | null | null | null | setup.py | ljm625/ios-xr-grpc-python | ca9183cb9190b7c9b74357108abe4ae7cb2c4224 | [
"Apache-2.0"
] | null | null | null | from setuptools import setup
setup(name='iosxr_grpc',
version='1.3',
description='gRPC library for IOS-XR > 6.1.1',
url='https://github.com/cisco-grpc-connection-libs/ios-xr-grpc-python',
author='Karthik Kumaravel',
authoer_email='srirudrankumaravel@gmail.com',
licencse='Apache 2.0... | 26.588235 | 77 | 0.617257 | from setuptools import setup
setup(name='iosxr_grpc',
version='1.3',
description='gRPC library for IOS-XR > 6.1.1',
url='https://github.com/cisco-grpc-connection-libs/ios-xr-grpc-python',
author='Karthik Kumaravel',
authoer_email='srirudrankumaravel@gmail.com',
licencse='Apache 2.0... | true | true |
f7645d81ab83023bce9da381899330cae5ae4612 | 181 | py | Python | oscar/lib/python2.7/site-packages/prompt_toolkit/contrib/telnet/log.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/prompt_toolkit/contrib/telnet/log.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/prompt_toolkit/contrib/telnet/log.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | """
Python logger for the telnet server.
"""
from __future__ import unicode_literals
import logging
logger = logging.getLogger(__package__)
__all__ = (
'logger',
)
| 15.083333 | 40 | 0.690608 | from __future__ import unicode_literals
import logging
logger = logging.getLogger(__package__)
__all__ = (
'logger',
)
| true | true |
f7645d895c2fccf609f956ffee59ddd1467cd72e | 2,689 | py | Python | takasago_kx100l.py | molyb/measuringInstrument | a5b07114f00a5b7c287d96857ec427ec1af12f4b | [
"MIT"
] | null | null | null | takasago_kx100l.py | molyb/measuringInstrument | a5b07114f00a5b7c287d96857ec427ec1af12f4b | [
"MIT"
] | null | null | null | takasago_kx100l.py | molyb/measuringInstrument | a5b07114f00a5b7c287d96857ec427ec1af12f4b | [
"MIT"
] | null | null | null | import serial
import time
class TakasagoKX100L:
def __init__(self, com, baudrate, timeout=0.1, target_index=1):
if baudrate not in (2400, 9600, 38400):
baudrate = 9600
if baudrate == 2400:
self.tx_wait = 0.2
elif baudrate == 9600:
self.tx_wait = 0.05
... | 24.445455 | 67 | 0.576051 | import serial
import time
class TakasagoKX100L:
def __init__(self, com, baudrate, timeout=0.1, target_index=1):
if baudrate not in (2400, 9600, 38400):
baudrate = 9600
if baudrate == 2400:
self.tx_wait = 0.2
elif baudrate == 9600:
self.tx_wait = 0.05
... | true | true |
f7645d912e665b7e69a40375fedcfecd8bff8f6f | 5,018 | py | Python | enn/losses/utils.py | MaxGhenis/enn | d830c31da16ea912ea3700aaf79e5e2f841eba8d | [
"Apache-2.0"
] | 130 | 2021-07-21T16:50:07.000Z | 2022-02-21T13:02:29.000Z | enn/losses/utils.py | MaxGhenis/enn | d830c31da16ea912ea3700aaf79e5e2f841eba8d | [
"Apache-2.0"
] | 4 | 2021-07-27T16:46:58.000Z | 2022-01-29T09:27:36.000Z | enn/losses/utils.py | LaudateCorpus1/enn | d830c31da16ea912ea3700aaf79e5e2f841eba8d | [
"Apache-2.0"
] | 26 | 2021-07-23T16:27:17.000Z | 2022-01-06T08:14:36.000Z | # python3
# pylint: disable=g-bad-file-header
# Copyright 2021 DeepMind Technologies Limited. 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... | 37.17037 | 80 | 0.680151 |
from typing import Any, Dict, Callable, List, Optional, Sequence, Tuple, Union
import dataclasses
from enn import base
from enn.losses import single_index
import haiku as hk
import jax
import jax.numpy as jnp
PredicateFn = Callable[[str, str, Any], bool]
def l2_weights_with_predicate(
params: hk.Params,
p... | true | true |
f7645db2c790537412f9048ca9836efac4c6d8ff | 1,166 | py | Python | huddle/dbtest.py | hopscott/huddle-covie19 | 0d5d8973de4196b9ab5191f0278c47aa170d3e11 | [
"MIT"
] | null | null | null | huddle/dbtest.py | hopscott/huddle-covie19 | 0d5d8973de4196b9ab5191f0278c47aa170d3e11 | [
"MIT"
] | 3 | 2020-04-11T02:13:38.000Z | 2020-04-11T02:13:40.000Z | huddle/dbtest.py | hopscott/huddle-covie19 | 0d5d8973de4196b9ab5191f0278c47aa170d3e11 | [
"MIT"
] | null | null | null | # pip install mysql-connector-python-rf
# https://stackoverflow.com/questions/10757169/location-of-my-cnf-file-on-macos
import mysql.connector
from mysql.connector import Error
def run():
try:
print('*'*50)
connection = mysql.connector.connect(host='localhost',
... | 40.206897 | 80 | 0.539451 | import mysql.connector
from mysql.connector import Error
def run():
try:
print('*'*50)
connection = mysql.connector.connect(host='localhost',
database='icu_bed_covid19',
user='root',
... | true | true |
f7645e95332d353f3d6b8955c72927bfe7500399 | 2,996 | py | Python | tests/test_server_events.py | artificial-aidan/grpclib | 948e32a29a4ad82ebbfdbb681f7a797f6233bff3 | [
"BSD-3-Clause"
] | 754 | 2017-08-01T23:41:24.000Z | 2022-03-31T09:03:24.000Z | tests/test_server_events.py | artificial-aidan/grpclib | 948e32a29a4ad82ebbfdbb681f7a797f6233bff3 | [
"BSD-3-Clause"
] | 154 | 2017-09-17T21:58:38.000Z | 2022-03-10T20:58:39.000Z | tests/test_server_events.py | artificial-aidan/grpclib | 948e32a29a4ad82ebbfdbb681f7a797f6233bff3 | [
"BSD-3-Clause"
] | 86 | 2017-09-17T12:53:23.000Z | 2022-02-16T21:59:24.000Z | import pytest
from multidict import MultiDict
from google.rpc.error_details_pb2 import ResourceInfo
from grpclib.const import Status
from grpclib.events import listen, RecvRequest, RecvMessage, SendMessage
from grpclib.events import SendInitialMetadata, SendTrailingMetadata
from grpclib.exceptions import GRPCError
fr... | 30.886598 | 72 | 0.702937 | import pytest
from multidict import MultiDict
from google.rpc.error_details_pb2 import ResourceInfo
from grpclib.const import Status
from grpclib.events import listen, RecvRequest, RecvMessage, SendMessage
from grpclib.events import SendInitialMetadata, SendTrailingMetadata
from grpclib.exceptions import GRPCError
fr... | true | true |
f7645f9aba94bd53f7c3b151c7657d3cf090f7de | 606 | py | Python | python3/tuple.py | novemberde/lang-practice | 997b50f41b765001c395530919d3f17679209b5d | [
"MIT"
] | 1 | 2018-02-15T11:02:55.000Z | 2018-02-15T11:02:55.000Z | python3/tuple.py | novemberde/lang-practice | 997b50f41b765001c395530919d3f17679209b5d | [
"MIT"
] | 1 | 2022-01-23T05:01:02.000Z | 2022-01-23T05:01:02.000Z | python3/tuple.py | novemberde/lang-practice | 997b50f41b765001c395530919d3f17679209b5d | [
"MIT"
] | null | null | null | # list is using [], but tuple is using ()
# list can create, delete and modify values, but tuple cannot modify values that are already declared.
t1 = ()
t2 = (1,)
t3 = (1,2,3)
t4 = 1,2,3
t5 = ('a', 'b', ('ab', 'cd'))
print(t1);
print(t2);
print(t3);
print(t4);
print(t5);
# ()
# (1,)
# (1, 2, 3)
# (1, 2, 3)
# ('a', 'b... | 20.2 | 102 | 0.50495 |
t1 = ()
t2 = (1,)
t3 = (1,2,3)
t4 = 1,2,3
t5 = ('a', 'b', ('ab', 'cd'))
print(t1);
print(t2);
print(t3);
print(t4);
print(t5);
# t1 = (1,2,'a', 'b')
# del t1[0]
t6 = (1, 2, 3, 4)
print(t6[0]) # 1
print(t6[:2]) # (1, 2)
print(t5 + t6) # ('a', 'b', ('ab', 'cd'), 1, 2, 3, 4)
print(t6 * 2) # (1, 2, 3, 4, 1, 2, ... | true | true |
f764607fb3eb3817727d7b30e9cbe51824d1a86c | 360 | py | Python | bibcheck/schemas.py | rmcgibbo/bibcheck | f33d426a1ac596c51a9ba6e3e0b617958a503513 | [
"MIT",
"Unlicense"
] | 2 | 2015-02-15T22:04:46.000Z | 2016-02-04T01:51:24.000Z | bibcheck/schemas.py | rmcgibbo/bibcheck | f33d426a1ac596c51a9ba6e3e0b617958a503513 | [
"MIT",
"Unlicense"
] | null | null | null | bibcheck/schemas.py | rmcgibbo/bibcheck | f33d426a1ac596c51a9ba6e3e0b617958a503513 | [
"MIT",
"Unlicense"
] | null | null | null | ACS = {
'article': {
'author': [],
'title': [],
'volume': [],
'issued': [],
'volume': [],
'page': [],
'doi': [],
},
'book': {
'author': [],
'title': [],
'issued': []
},
'inproceedings': {
'author': [],
't... | 16.363636 | 22 | 0.269444 | ACS = {
'article': {
'author': [],
'title': [],
'volume': [],
'issued': [],
'volume': [],
'page': [],
'doi': [],
},
'book': {
'author': [],
'title': [],
'issued': []
},
'inproceedings': {
'author': [],
't... | true | true |
f76460bc4bc3e63ebcd31c4696bce8e37a0a668a | 546 | py | Python | WebMirror/management/rss_parser_funcs/feed_parse_extractWwwTealnovelCom.py | fake-name/ReadableWebProxy | ed5c7abe38706acc2684a1e6cd80242a03c5f010 | [
"BSD-3-Clause"
] | 193 | 2016-08-02T22:04:35.000Z | 2022-03-09T20:45:41.000Z | WebMirror/management/rss_parser_funcs/feed_parse_extractWwwTealnovelCom.py | fake-name/ReadableWebProxy | ed5c7abe38706acc2684a1e6cd80242a03c5f010 | [
"BSD-3-Clause"
] | 533 | 2016-08-23T20:48:23.000Z | 2022-03-28T15:55:13.000Z | WebMirror/management/rss_parser_funcs/feed_parse_extractWwwTealnovelCom.py | rrosajp/ReadableWebProxy | ed5c7abe38706acc2684a1e6cd80242a03c5f010 | [
"BSD-3-Clause"
] | 19 | 2015-08-13T18:01:08.000Z | 2021-07-12T17:13:09.000Z |
def extractWwwTealnovelCom(item):
'''
Parser for 'www.tealnovel.com'
'''
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].lower():
return None
tagmap = [
('PRC', 'PRC', 'translated'),
('Loiterous', 'Loit... | 24.818182 | 104 | 0.630037 |
def extractWwwTealnovelCom(item):
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].lower():
return None
tagmap = [
('PRC', 'PRC', 'translated'),
('Loiterous', 'Loiterous', 'oel'),
]
for ta... | true | true |
f76462d3c58ae4e4b265798230c2f8a21dd5aa40 | 3,286 | py | Python | play-1.2.4/python/Lib/site-packages/Rpyc/Utils/Serving.py | AppSecAI-TEST/restcommander | a2523f31356938f5c7fc6d379b7678da0b1e077a | [
"Apache-2.0"
] | 550 | 2015-01-05T16:59:00.000Z | 2022-03-20T16:55:25.000Z | framework/python/Lib/site-packages/Rpyc/Utils/Serving.py | lafayette/JBTT | 94bde9d90abbb274d29ecd82e632d43a4320876e | [
"MIT"
] | 15 | 2015-02-05T06:00:47.000Z | 2018-07-07T14:34:04.000Z | framework/python/Lib/site-packages/Rpyc/Utils/Serving.py | lafayette/JBTT | 94bde9d90abbb274d29ecd82e632d43a4320876e | [
"MIT"
] | 119 | 2015-01-08T00:48:24.000Z | 2022-01-27T14:13:15.000Z | import os
import socket
import sys
import gc
import struct
from threading import Thread
from Rpyc.Connection import Connection
from Rpyc.Stream import SocketStream, PipeStream
from Rpyc.Channel import Channel
from Discovery import UDP_DISCOVERY_PORT, MAX_DGRAM_SIZE, QUERY_MAGIC
DEFAULT_PORT = 18812
#
# utilities
#
c... | 25.874016 | 81 | 0.63664 | import os
import socket
import sys
import gc
import struct
from threading import Thread
from Rpyc.Connection import Connection
from Rpyc.Stream import SocketStream, PipeStream
from Rpyc.Channel import Channel
from Discovery import UDP_DISCOVERY_PORT, MAX_DGRAM_SIZE, QUERY_MAGIC
DEFAULT_PORT = 18812
class _Logger(obj... | true | true |
f76462e6361812340f7bb04ecd818de4580c5644 | 268 | py | Python | week_3/02_lesson.py | SekachVitaliy/Python | 4d199a571cfedca51ec6e724e4d8c98e086e984d | [
"Unlicense"
] | null | null | null | week_3/02_lesson.py | SekachVitaliy/Python | 4d199a571cfedca51ec6e724e4d8c98e086e984d | [
"Unlicense"
] | null | null | null | week_3/02_lesson.py | SekachVitaliy/Python | 4d199a571cfedca51ec6e724e4d8c98e086e984d | [
"Unlicense"
] | null | null | null | """
Даны длины сторон треугольника. Вычислите площадь треугольника.
Формат ввода
Вводятся три положительных действительных числа.
"""
a = float(input())
b = float(input())
c = float(input())
p = (a + b + c) / 2
s = ((p * (p - a) * (p - b) * (p - c)) ** 0.5)
print(s)
| 20.615385 | 63 | 0.608209 | a = float(input())
b = float(input())
c = float(input())
p = (a + b + c) / 2
s = ((p * (p - a) * (p - b) * (p - c)) ** 0.5)
print(s)
| true | true |
f76462f11abe6fa80fc7d8b27f55e528d8c91f91 | 1,994 | py | Python | utilities/query-test-cases.py | cspace-deployment/cspace-solr-ucb | 9c04fe6089a5eacc0f736027f9a01c14f5fea3e2 | [
"ECL-2.0"
] | null | null | null | utilities/query-test-cases.py | cspace-deployment/cspace-solr-ucb | 9c04fe6089a5eacc0f736027f9a01c14f5fea3e2 | [
"ECL-2.0"
] | null | null | null | utilities/query-test-cases.py | cspace-deployment/cspace-solr-ucb | 9c04fe6089a5eacc0f736027f9a01c14f5fea3e2 | [
"ECL-2.0"
] | null | null | null | import sys
from xml.etree import ElementTree as ET
import requests
def run(solr_url, query_terms_file):
successes = 0
failures = 0
tested = 0
with open(query_terms_file, 'r') as query_terms:
for i, row in enumerate(query_terms):
row = row.strip()
if row == '': continue
... | 36.254545 | 122 | 0.48997 | import sys
from xml.etree import ElementTree as ET
import requests
def run(solr_url, query_terms_file):
successes = 0
failures = 0
tested = 0
with open(query_terms_file, 'r') as query_terms:
for i, row in enumerate(query_terms):
row = row.strip()
if row == '': continue
... | true | true |
f76463b5d6e9429a7110d7a21b366215b9a2384f | 990 | py | Python | jtnn/datautils.py | Sniel/icml18-jtnn | d0c7a6fe759a5f2bfd3bc2d3cd76e26a9cd5bf6d | [
"MIT"
] | 1 | 2020-02-06T12:56:33.000Z | 2020-02-06T12:56:33.000Z | jtnn/datautils.py | baohq1595/vae-jt | eb35c73458dff160b2319b73a5aa8fdc1a8b3783 | [
"MIT"
] | null | null | null | jtnn/datautils.py | baohq1595/vae-jt | eb35c73458dff160b2319b73a5aa8fdc1a8b3783 | [
"MIT"
] | 1 | 2018-12-09T00:05:29.000Z | 2018-12-09T00:05:29.000Z | from torch.utils.data import Dataset
from jtnn.mol_tree import MolTree
import numpy as np
class MoleculeDataset(Dataset):
def __init__(self, data_file):
with open(data_file) as f:
self.data = [line.strip("\r\n ").split()[0] for line in f]
def __len__(self):
return len(self.data)
... | 26.052632 | 70 | 0.615152 | from torch.utils.data import Dataset
from jtnn.mol_tree import MolTree
import numpy as np
class MoleculeDataset(Dataset):
def __init__(self, data_file):
with open(data_file) as f:
self.data = [line.strip("\r\n ").split()[0] for line in f]
def __len__(self):
return len(self.data)
... | true | true |
f764644c96c0e1a1d600e3eb423912e766993d73 | 257 | py | Python | web/app/errors/controllers.py | mcodegeeks/containerized_webapp | 39c02ed04efee4b49f2bb906177b392410d468dd | [
"MIT"
] | null | null | null | web/app/errors/controllers.py | mcodegeeks/containerized_webapp | 39c02ed04efee4b49f2bb906177b392410d468dd | [
"MIT"
] | null | null | null | web/app/errors/controllers.py | mcodegeeks/containerized_webapp | 39c02ed04efee4b49f2bb906177b392410d468dd | [
"MIT"
] | null | null | null | from flask import render_template
from app.errors import bp
@bp.app_errorhandler(404)
def not_found_error(error):
return render_template('404.html'), 404
@bp.app_errorhandler(500)
def internal_error(error):
return render_template('500.html'), 500 | 23.363636 | 43 | 0.77821 | from flask import render_template
from app.errors import bp
@bp.app_errorhandler(404)
def not_found_error(error):
return render_template('404.html'), 404
@bp.app_errorhandler(500)
def internal_error(error):
return render_template('500.html'), 500 | true | true |
f764646dcf7538d6373d9499a5f2dc722b1aa77d | 992 | py | Python | release/stubs.min/System/ComponentModel/__init___parts/INestedContainer.py | htlcnn/ironpython-stubs | 780d829e2104b2789d5f4d6f32b0ec9f2930ca03 | [
"MIT"
] | 182 | 2017-06-27T02:26:15.000Z | 2022-03-30T18:53:43.000Z | release/stubs.min/System/ComponentModel/__init___parts/INestedContainer.py | htlcnn/ironpython-stubs | 780d829e2104b2789d5f4d6f32b0ec9f2930ca03 | [
"MIT"
] | 28 | 2017-06-27T13:38:23.000Z | 2022-03-15T11:19:44.000Z | release/stubs.min/System/ComponentModel/__init___parts/INestedContainer.py | htlcnn/ironpython-stubs | 780d829e2104b2789d5f4d6f32b0ec9f2930ca03 | [
"MIT"
] | 67 | 2017-06-28T09:43:59.000Z | 2022-03-20T21:17:10.000Z | class INestedContainer(IContainer,IDisposable):
""" Provides functionality for nested containers,which logically contain zero or more other components and are owned by a parent component. """
def __enter__(self,*args):
"""
__enter__(self: IDisposable) -> object
Provides the implementation of __ent... | 29.176471 | 147 | 0.714718 | class INestedContainer(IContainer,IDisposable):
def __enter__(self,*args):
pass
def __exit__(self,*args):
pass
def __init__(self,*args):
pass
Owner=property(lambda self: object(),lambda self,v: None,lambda self: None)
| true | true |
f7646590e3cfdebaf5618dcfb72d34840ea9f5d6 | 1,169 | py | Python | package/statetoinput/state_estimator_wrapper.py | Data-Science-in-Mechanical-Engineering/furuta-pixel-to-torque-control | 41da2099c8a913f77b3b557dcc8f08b44d282cbb | [
"MIT"
] | null | null | null | package/statetoinput/state_estimator_wrapper.py | Data-Science-in-Mechanical-Engineering/furuta-pixel-to-torque-control | 41da2099c8a913f77b3b557dcc8f08b44d282cbb | [
"MIT"
] | null | null | null | package/statetoinput/state_estimator_wrapper.py | Data-Science-in-Mechanical-Engineering/furuta-pixel-to-torque-control | 41da2099c8a913f77b3b557dcc8f08b44d282cbb | [
"MIT"
] | null | null | null | """
OpenAI Gym environments with predicted state vector of specified VisionToState model (data_id, model_name) as state
@Author: Steffen Bleher
"""
from gym import spaces
from gym_brt.data.config.configuration import FREQUENCY
import numpy as np
from gym_brt.envs.reinforcementlearning_extensions.vision_wrapping_clas... | 40.310345 | 115 | 0.751069 | from gym import spaces
from gym_brt.data.config.configuration import FREQUENCY
import numpy as np
from gym_brt.envs.reinforcementlearning_extensions.vision_wrapping_classes import VisionQubeBeginDownEnv
from visiontostate.vision_predictor import VisionPredictor
OBS_MAX = np.asarray([1, 1, 1, 1, np.inf, np.inf], dtyp... | true | true |
f76466a2bbeb04ccc8d795c1a3734657dd4a3291 | 1,282 | py | Python | app/__init__.py | josylad/Movie-Watchlist | fd40aa6a867934b55570d9beeb20eba62767aed1 | [
"MIT"
] | null | null | null | app/__init__.py | josylad/Movie-Watchlist | fd40aa6a867934b55570d9beeb20eba62767aed1 | [
"MIT"
] | null | null | null | app/__init__.py | josylad/Movie-Watchlist | fd40aa6a867934b55570d9beeb20eba62767aed1 | [
"MIT"
] | null | null | null | from flask import Flask
from flask_bootstrap import Bootstrap
from config import config_options
from flask_sqlalchemy import SQLAlchemy
from flask_login import LoginManager
from flask_uploads import UploadSet, configure_uploads, IMAGES
from flask_mail import Mail
from flask_simplemde import SimpleMDE
login_manager = ... | 24.653846 | 72 | 0.76053 | from flask import Flask
from flask_bootstrap import Bootstrap
from config import config_options
from flask_sqlalchemy import SQLAlchemy
from flask_login import LoginManager
from flask_uploads import UploadSet, configure_uploads, IMAGES
from flask_mail import Mail
from flask_simplemde import SimpleMDE
login_manager = ... | true | true |
f76466f548f0b315e092a115903a1e96d39f0592 | 7,809 | py | Python | sdk/lusid_asyncio/models/property_interval.py | finbourne/lusid-sdk-python-asyncio-preview | 290f93590ab5485661216c8622d3de9f7af0ed60 | [
"MIT"
] | null | null | null | sdk/lusid_asyncio/models/property_interval.py | finbourne/lusid-sdk-python-asyncio-preview | 290f93590ab5485661216c8622d3de9f7af0ed60 | [
"MIT"
] | null | null | null | sdk/lusid_asyncio/models/property_interval.py | finbourne/lusid-sdk-python-asyncio-preview | 290f93590ab5485661216c8622d3de9f7af0ed60 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
LUSID API
FINBOURNE Technology # noqa: E501
The version of the OpenAPI document: 0.11.3923
Contact: info@finbourne.com
Generated by: https://openapi-generator.tech
"""
try:
from inspect import getfullargspec
except ImportError:
from inspect import getargspec as getf... | 32.949367 | 200 | 0.621975 |
try:
from inspect import getfullargspec
except ImportError:
from inspect import getargspec as getfullargspec
import pprint
import re import six
from lusid_asyncio.configuration import Configuration
class PropertyInterval(object):
openapi_types = {
'value': 'PropertyValue',
'effective... | true | true |
f764698e5e1f88abf8b80daa74e4312ba6849c2e | 11,037 | py | Python | e2cnn/nn/modules/nonlinearities/gated1.py | steven-lang/e2cnn | 48f49760766ec958b52d0dd7b02483886dfa2096 | [
"BSD-3-Clause"
] | 356 | 2019-11-22T10:37:22.000Z | 2022-03-25T14:42:45.000Z | e2cnn/nn/modules/nonlinearities/gated1.py | steven-lang/e2cnn | 48f49760766ec958b52d0dd7b02483886dfa2096 | [
"BSD-3-Clause"
] | 52 | 2020-01-20T16:51:36.000Z | 2022-03-31T21:40:19.000Z | e2cnn/nn/modules/nonlinearities/gated1.py | steven-lang/e2cnn | 48f49760766ec958b52d0dd7b02483886dfa2096 | [
"BSD-3-Clause"
] | 48 | 2019-12-11T09:29:30.000Z | 2022-03-18T17:51:55.000Z |
from typing import List, Tuple, Any
import numpy as np
from collections import defaultdict
from e2cnn.gspaces import *
from e2cnn.nn import FieldType
from e2cnn.nn import GeometricTensor
from ..equivariant_module import EquivariantModule
import torch
from torch.nn import Parameter
__all__ = ["GatedNonLinearit... | 38.456446 | 120 | 0.563197 |
from typing import List, Tuple, Any
import numpy as np
from collections import defaultdict
from e2cnn.gspaces import *
from e2cnn.nn import FieldType
from e2cnn.nn import GeometricTensor
from ..equivariant_module import EquivariantModule
import torch
from torch.nn import Parameter
__all__ = ["GatedNonLinearit... | true | true |
f76469eff7cc62390dc5b1942eae8f7abfed5dec | 77,807 | py | Python | zerver/tests/test_users.py | whoodes/zulip | c690fa117426a9d58c0b2e88c34170a89fdf08d9 | [
"Apache-2.0"
] | null | null | null | zerver/tests/test_users.py | whoodes/zulip | c690fa117426a9d58c0b2e88c34170a89fdf08d9 | [
"Apache-2.0"
] | null | null | null | zerver/tests/test_users.py | whoodes/zulip | c690fa117426a9d58c0b2e88c34170a89fdf08d9 | [
"Apache-2.0"
] | null | null | null | import datetime
from email.headerregistry import Address
from typing import Any, Dict, Iterable, List, Mapping, Optional, TypeVar, Union
from unittest import mock
import orjson
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import ValidationError... | 40.189566 | 112 | 0.644518 | import datetime
from email.headerregistry import Address
from typing import Any, Dict, Iterable, List, Mapping, Optional, TypeVar, Union
from unittest import mock
import orjson
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import ValidationError... | true | true |
f7646a01a6b9d46e062300aa65da322eeabf5913 | 3,543 | py | Python | src/clikraken/api/public/ohlc.py | jroulin/clikraken | d9064ffc608e709615bf0552c778e37edad29e10 | [
"Apache-2.0"
] | null | null | null | src/clikraken/api/public/ohlc.py | jroulin/clikraken | d9064ffc608e709615bf0552c778e37edad29e10 | [
"Apache-2.0"
] | null | null | null | src/clikraken/api/public/ohlc.py | jroulin/clikraken | d9064ffc608e709615bf0552c778e37edad29e10 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
clikraken.api.public.ohlc
This module queries the OHLC method of Kraken's API
and outputs the results in a tabular format.
Licensed under the Apache License, Version 2.0. See the LICENSE file.
"""
import argparse
from collections import OrderedDict
import clikraken.global_vars as gv
fr... | 28.119048 | 107 | 0.626588 |
import argparse
from collections import OrderedDict
import clikraken.global_vars as gv
from clikraken.api.api_utils import query_api
from clikraken.clikraken_utils import format_timestamp, asset_pair_short
from clikraken.clikraken_utils import _tabulate as tabulate
from clikraken.clikraken_utils import csv
from cli... | true | true |
f7646b30fad5ac9a2a0c244af4069f5b006df306 | 4,363 | py | Python | examples/xfam-loop.plot_u.box.seq.py | carbonscott/pyrotein | 4c41eade0d014e70aadf9f9c475cbc4255a0a32e | [
"MIT"
] | 1 | 2021-11-05T21:09:23.000Z | 2021-11-05T21:09:23.000Z | examples/xfam-loop.plot_u.box.seq.py | carbonscott/pyrotein | 4c41eade0d014e70aadf9f9c475cbc4255a0a32e | [
"MIT"
] | null | null | null | examples/xfam-loop.plot_u.box.seq.py | carbonscott/pyrotein | 4c41eade0d014e70aadf9f9c475cbc4255a0a32e | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import numpy as np
import pyrotein as pr
import givens as gv
from display import plot_dmat, plot_singular, plot_left_singular, plot_coeff
import multiprocessing as mp
from loaddata import load_gpcrdb_xlsx
import colorsimple as cs
def reverse_sign(u, vh, rank, index_from... | 30.298611 | 77 | 0.528306 |
import numpy as np
import pyrotein as pr
import givens as gv
from display import plot_dmat, plot_singular, plot_left_singular, plot_coeff
import multiprocessing as mp
from loaddata import load_gpcrdb_xlsx
import colorsimple as cs
def reverse_sign(u, vh, rank, index_from_zero = True):
rank_in_data = rank if i... | true | true |
f7646c59899114b0626ce43db2c049c11d6f2c0b | 636 | py | Python | Concepts/exam_vector.py | achoi007/CloudComputing | 2b23243ff2e61339cc11ac5748277507f53a5980 | [
"MIT"
] | null | null | null | Concepts/exam_vector.py | achoi007/CloudComputing | 2b23243ff2e61339cc11ac5748277507f53a5980 | [
"MIT"
] | null | null | null | Concepts/exam_vector.py | achoi007/CloudComputing | 2b23243ff2e61339cc11ac5748277507f53a5980 | [
"MIT"
] | null | null | null | from lamport import LamportTimestamp
from vectorclock import VectorClock
def exam_vector(ts):
ts.sendMesg(4, 3, "m9")
ts.halfSend(1, "m1")
ts.halfSend(3, "m8")
ts.halfSend(4, "m10")
ts.halfSend(1, "m2")
ts.halfRecv(2, "m8")
ts.halfRecv(3, "m1")
ts.sendMesg(1, 4, "m3")
ts.halfSend(2,... | 19.875 | 36 | 0.558176 | from lamport import LamportTimestamp
from vectorclock import VectorClock
def exam_vector(ts):
ts.sendMesg(4, 3, "m9")
ts.halfSend(1, "m1")
ts.halfSend(3, "m8")
ts.halfSend(4, "m10")
ts.halfSend(1, "m2")
ts.halfRecv(2, "m8")
ts.halfRecv(3, "m1")
ts.sendMesg(1, 4, "m3")
ts.halfSend(2,... | true | true |
f7646c8414a0693145f309c763ae51ac3f4b3077 | 1,072 | py | Python | pages/tests/test_checks.py | timbortnik/django-page-cms | 4640dca210d89f22ba87cbf4376cb34147e591fa | [
"BSD-3-Clause"
] | 113 | 2015-01-08T08:21:11.000Z | 2022-03-11T21:44:10.000Z | pages/tests/test_checks.py | timbortnik/django-page-cms | 4640dca210d89f22ba87cbf4376cb34147e591fa | [
"BSD-3-Clause"
] | 63 | 2015-03-06T06:38:38.000Z | 2022-02-15T17:07:48.000Z | pages/tests/test_checks.py | timbortnik/django-page-cms | 4640dca210d89f22ba87cbf4376cb34147e591fa | [
"BSD-3-Clause"
] | 53 | 2015-01-07T15:25:48.000Z | 2022-02-15T16:21:54.000Z | from pages.checks import page_templates_loading_check
from django.test import TestCase
from django.core.checks import Warning
from django.template import TemplateSyntaxError
class PageTemplatesLoadingCheckTestCase(TestCase):
def test_check_detects_unexistant_template(self):
unexistant = ('does_not_exists... | 38.285714 | 75 | 0.715485 | from pages.checks import page_templates_loading_check
from django.test import TestCase
from django.core.checks import Warning
from django.template import TemplateSyntaxError
class PageTemplatesLoadingCheckTestCase(TestCase):
def test_check_detects_unexistant_template(self):
unexistant = ('does_not_exists... | true | true |
f7646df945d4138da87fea20f4d2f4a0bfed078f | 4,657 | py | Python | tests/model/search_test.py | Nibblecomm/EmmaPython | 61dca6d5ff36714547120a6410c3b5734bc59d50 | [
"MIT"
] | null | null | null | tests/model/search_test.py | Nibblecomm/EmmaPython | 61dca6d5ff36714547120a6410c3b5734bc59d50 | [
"MIT"
] | null | null | null | tests/model/search_test.py | Nibblecomm/EmmaPython | 61dca6d5ff36714547120a6410c3b5734bc59d50 | [
"MIT"
] | null | null | null | from datetime import datetime
import unittest
from emma import exceptions as ex
from emma.model.account import Account
from emma.model.search import Search
from emma.model import SERIALIZED_DATETIME_FORMAT
from emma.model.member import Member
from tests.model import MockAdapter
class SearchTest(unittest.TestCase):
... | 34.753731 | 81 | 0.607043 | from datetime import datetime
import unittest
from emma import exceptions as ex
from emma.model.account import Account
from emma.model.search import Search
from emma.model import SERIALIZED_DATETIME_FORMAT
from emma.model.member import Member
from tests.model import MockAdapter
class SearchTest(unittest.TestCase):
... | true | true |
f7646e02b9c97ffe75be59cbd16299ce59267f86 | 14,483 | py | Python | google/cloud/dataflow_v1beta3/services/templates_service/async_client.py | LaudateCorpus1/python-dataflow-client | 888664b70baefe7acb7e46c82a06c24e7ba06af2 | [
"Apache-2.0"
] | null | null | null | google/cloud/dataflow_v1beta3/services/templates_service/async_client.py | LaudateCorpus1/python-dataflow-client | 888664b70baefe7acb7e46c82a06c24e7ba06af2 | [
"Apache-2.0"
] | null | null | null | google/cloud/dataflow_v1beta3/services/templates_service/async_client.py | LaudateCorpus1/python-dataflow-client | 888664b70baefe7acb7e46c82a06c24e7ba06af2 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 40.912429 | 144 | 0.676586 | from collections import OrderedDict
import functools
import re
from typing import Dict, Optional, Sequence, Tuple, Type, Union
import pkg_resources
from google.api_core.client_options import ClientOptions
from google.api_core import exceptions as core_exceptions
from google.api_core import gapic_v1
from google.api_cor... | true | true |
f7646f83adec3568660e02687e02191f2dd042d9 | 4,170 | py | Python | monitors/host_monitor.py | chuckablack/quokka-prime | 6429c09039f37887f4b0d5a196f1df2712136de7 | [
"MIT"
] | 5 | 2021-05-29T20:15:16.000Z | 2021-11-01T18:35:55.000Z | monitors/host_monitor.py | chuckablack/quokka-prime | 6429c09039f37887f4b0d5a196f1df2712136de7 | [
"MIT"
] | null | null | null | monitors/host_monitor.py | chuckablack/quokka-prime | 6429c09039f37887f4b0d5a196f1df2712136de7 | [
"MIT"
] | 4 | 2021-05-18T06:50:34.000Z | 2021-09-23T10:23:09.000Z | import subprocess
import argparse
import re
from datetime import datetime, timedelta
from time import sleep
import socket
import requests
import scapy.all as scapy
from concurrent.futures import ThreadPoolExecutor
MONITOR_INTERVAL = 60
DISCOVERY_INTERVAL = 300
parser = argparse.ArgumentParser(description="Host Monito... | 28.758621 | 110 | 0.616307 | import subprocess
import argparse
import re
from datetime import datetime, timedelta
from time import sleep
import socket
import requests
import scapy.all as scapy
from concurrent.futures import ThreadPoolExecutor
MONITOR_INTERVAL = 60
DISCOVERY_INTERVAL = 300
parser = argparse.ArgumentParser(description="Host Monito... | true | true |
f76470b6cc2d63eccce910376c0a9579d815288f | 1,613 | py | Python | bot/middlewares/throttling.py | darksidecat/telegram-2048-bot | 2c5efbb8fc7c02e0139502506fa2104a1495d1b8 | [
"MIT"
] | 9 | 2021-09-28T11:47:11.000Z | 2022-03-07T10:08:45.000Z | bot/middlewares/throttling.py | darksidecat/telegram-2048-bot | 2c5efbb8fc7c02e0139502506fa2104a1495d1b8 | [
"MIT"
] | null | null | null | bot/middlewares/throttling.py | darksidecat/telegram-2048-bot | 2c5efbb8fc7c02e0139502506fa2104a1495d1b8 | [
"MIT"
] | 2 | 2022-03-06T20:58:53.000Z | 2022-03-31T06:38:13.000Z | import logging
from typing import Any, Awaitable, Callable, Dict, Optional
from aiogram import BaseMiddleware
from aiogram.dispatcher.event.handler import HandlerObject
from aiogram.types import TelegramObject, User
from aiolimiter import AsyncLimiter
logger = logging.getLogger(__name__)
class ThrottlingMiddleware(... | 32.918367 | 86 | 0.641042 | import logging
from typing import Any, Awaitable, Callable, Dict, Optional
from aiogram import BaseMiddleware
from aiogram.dispatcher.event.handler import HandlerObject
from aiogram.types import TelegramObject, User
from aiolimiter import AsyncLimiter
logger = logging.getLogger(__name__)
class ThrottlingMiddleware(... | true | true |
f7647211994ab0c6896c5a66d18f536bb81ae2b2 | 5,192 | py | Python | tests/test_matcher.py | XZhouQD/nonebot2 | 059b1faa22f782ad3b160bc24324c9de14fea250 | [
"MIT"
] | null | null | null | tests/test_matcher.py | XZhouQD/nonebot2 | 059b1faa22f782ad3b160bc24324c9de14fea250 | [
"MIT"
] | null | null | null | tests/test_matcher.py | XZhouQD/nonebot2 | 059b1faa22f782ad3b160bc24324c9de14fea250 | [
"MIT"
] | null | null | null | import pytest
from nonebug import App
from utils import load_plugin, make_fake_event, make_fake_message
@pytest.mark.asyncio
async def test_matcher(app: App, load_plugin):
from plugins.matcher.matcher_process import (
test_got,
test_handle,
test_preset,
test_combine,
test_... | 31.658537 | 72 | 0.662365 | import pytest
from nonebug import App
from utils import load_plugin, make_fake_event, make_fake_message
@pytest.mark.asyncio
async def test_matcher(app: App, load_plugin):
from plugins.matcher.matcher_process import (
test_got,
test_handle,
test_preset,
test_combine,
test_... | true | true |
f764723486d332982372a79af205c445db1320d6 | 3,198 | py | Python | conformance-suites/2.0.0/deqp/functional/gles3/shaderindexing/shaderindexing_test_generator.py | dyna-dot/WebGL | e27538ce22753999c7418e66aa45a245d13e461d | [
"MIT"
] | 2,151 | 2020-04-18T07:31:17.000Z | 2022-03-31T08:39:18.000Z | conformance-suites/2.0.0/deqp/functional/gles3/shaderindexing/shaderindexing_test_generator.py | dyna-dot/WebGL | e27538ce22753999c7418e66aa45a245d13e461d | [
"MIT"
] | 2,313 | 2015-01-05T11:39:14.000Z | 2022-03-30T21:27:47.000Z | conformance-suites/2.0.0/deqp/functional/gles3/shaderindexing/shaderindexing_test_generator.py | dyna-dot/WebGL | e27538ce22753999c7418e66aa45a245d13e461d | [
"MIT"
] | 613 | 2015-01-03T21:47:15.000Z | 2022-03-28T09:46:13.000Z | #!/usr/bin/env python
# Copyright (c) 2016 The Khronos Group Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and/or associated documentation files (the
# "Materials"), to deal in the Materials without restriction, including
# without limitation the rights to use... | 27.808696 | 74 | 0.695747 |
import sys
_DO_NOT_EDIT_WARNING = """<!--
This file is auto-generated from shaderindexing_test_generator.py
DO NOT EDIT!
-->
"""
_HTML_TEMPLATE = """<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>WebGL Shader Indexing Conformance Tests</title>
<link rel="stylesheet" hre... | true | true |
f764740e9d840e0f01849234eea71d431abfec6f | 103,181 | py | Python | comparisons_among_different_model_formulations/on_AgeDB/DOEL_3groups_resnet18/train_1_4.py | Xiejiu/second_age_estimation | 89e9ef371a07aba0bbba496697176381e4e9432c | [
"MIT"
] | 1 | 2021-09-27T06:34:03.000Z | 2021-09-27T06:34:03.000Z | comparisons_among_different_model_formulations/on_AgeDB/DOEL_3groups_resnet18/train_1_4.py | Xiejiu/second_age_estimation | 89e9ef371a07aba0bbba496697176381e4e9432c | [
"MIT"
] | 1 | 2021-07-29T01:14:11.000Z | 2021-07-29T01:54:33.000Z | comparisons_among_different_model_formulations/on_AgeDB/DOEL_3groups_resnet18/train_1_4.py | Xiejiu/second_age_estimation | 89e9ef371a07aba0bbba496697176381e4e9432c | [
"MIT"
] | 1 | 2021-09-27T07:14:48.000Z | 2021-09-27T07:14:48.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Mar 27 10:09:57 2019
@author: xjc
"""
import math
import numpy as np
import fire
import os
import time
import torch
import torch.nn as nn
import torch.nn.functional as F
from torchvision import models, transforms
from Dataset_folder import Dataset_f... | 77.872453 | 160 | 0.677334 |
import math
import numpy as np
import fire
import os
import time
import torch
import torch.nn as nn
import torch.nn.functional as F
from torchvision import models, transforms
from Dataset_folder import Dataset_floder as data_prepare
from ensemble_learning_resnet_three_group_AgeDB import el_resnet18
import torch.uti... | true | true |
f76475c2f867f6c4135b92ef7f4cefced61f7d4a | 6,998 | py | Python | great_expectations/render/renderer/slack_renderer.py | jaidparmar/great_expectations | dac57e3638a0ca2c7adc62a8c0cee8525ea706a5 | [
"Apache-2.0"
] | null | null | null | great_expectations/render/renderer/slack_renderer.py | jaidparmar/great_expectations | dac57e3638a0ca2c7adc62a8c0cee8525ea706a5 | [
"Apache-2.0"
] | null | null | null | great_expectations/render/renderer/slack_renderer.py | jaidparmar/great_expectations | dac57e3638a0ca2c7adc62a8c0cee8525ea706a5 | [
"Apache-2.0"
] | null | null | null | import logging
from great_expectations.exceptions import InvalidKeyError
logger = logging.getLogger(__name__)
from ...core.id_dict import BatchKwargs
from .renderer import Renderer
class SlackRenderer(Renderer):
def __init__(self):
super().__init__()
def render(
self, validation_result=Non... | 41.654762 | 224 | 0.502715 | import logging
from great_expectations.exceptions import InvalidKeyError
logger = logging.getLogger(__name__)
from ...core.id_dict import BatchKwargs
from .renderer import Renderer
class SlackRenderer(Renderer):
def __init__(self):
super().__init__()
def render(
self, validation_result=Non... | true | true |
f76476108d12294cb98bcb518d31fd4f4bd7b798 | 69 | py | Python | trainer/__init__.py | sourabbapusridhar/handwritten-digit-generation-using-gans | 9489dc8786dcd926a084c35d3df56d3253640c92 | [
"MIT"
] | 2 | 2021-12-06T12:55:28.000Z | 2022-02-08T09:17:21.000Z | trainer/__init__.py | sourabbapusridhar/handwritten-digit-generation-using-gans | 9489dc8786dcd926a084c35d3df56d3253640c92 | [
"MIT"
] | 1 | 2021-06-21T16:31:54.000Z | 2021-07-18T16:41:15.000Z | trainer/__init__.py | sourabbapusridhar/master-thesis | 7ca0b36230dcab2e37a9501bcb519390d68b3b26 | [
"MIT"
] | null | null | null | # Import complete functionality from package
from .trainer import *
| 17.25 | 44 | 0.797101 |
from .trainer import *
| true | true |
f76476a6eab4cfc5cb1cd653c36b206037f64013 | 3,478 | py | Python | corepy/arch/x86_64/isa/__init__.py | matthiaskramm/corepy | b2aad4e86adca10420e825fb65dcbd031cf44bb1 | [
"BSD-3-Clause"
] | 8 | 2016-02-20T03:52:58.000Z | 2022-01-24T15:04:14.000Z | corepy/arch/x86_64/isa/__init__.py | matthiaskramm/corepy | b2aad4e86adca10420e825fb65dcbd031cf44bb1 | [
"BSD-3-Clause"
] | null | null | null | corepy/arch/x86_64/isa/__init__.py | matthiaskramm/corepy | b2aad4e86adca10420e825fb65dcbd031cf44bb1 | [
"BSD-3-Clause"
] | 6 | 2015-12-11T05:21:15.000Z | 2020-12-11T10:59:15.000Z | # Copyright (c) 2006-2009 The Trustees of Indiana University.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without ... | 41.903614 | 80 | 0.599482 |
from x86_64_isa import *
__active_code = None
def set_active_code(code):
global __active_code
if __active_code is not None:
__active_code.set_active_callback(None)
__active_code = code
if code is not None:
code.set_active_callback(set_active_code)
return
def __get_active_code(self):
global _... | true | true |
f76478227dd7ec6a76c95e68b58550359dc3127d | 639 | py | Python | lib/tarsier/executor.py | motomizuki/simple-data-checker | 6d78730b40418ccd0698c21193d1c3c2432de2e2 | [
"MIT"
] | null | null | null | lib/tarsier/executor.py | motomizuki/simple-data-checker | 6d78730b40418ccd0698c21193d1c3c2432de2e2 | [
"MIT"
] | null | null | null | lib/tarsier/executor.py | motomizuki/simple-data-checker | 6d78730b40418ccd0698c21193d1c3c2432de2e2 | [
"MIT"
] | null | null | null | from .plugins.tarsier_checker_base import TarsierCheckerPlugin
from .plugins.tarsier_input_base import TarsierInputPlugin
from .plugins.tarsier_output_base import TarsierOutputPlugin
class Executor:
def __init__(self, input_plugin: TarsierInputPlugin, checker_plugin: TarsierCheckerPlugin,
output_... | 35.5 | 94 | 0.730829 | from .plugins.tarsier_checker_base import TarsierCheckerPlugin
from .plugins.tarsier_input_base import TarsierInputPlugin
from .plugins.tarsier_output_base import TarsierOutputPlugin
class Executor:
def __init__(self, input_plugin: TarsierInputPlugin, checker_plugin: TarsierCheckerPlugin,
output_... | true | true |
f76478acfefdabcfde39505302af16fdafb48dc0 | 1,681 | py | Python | src/tf_manual_doc_setup.py | bingo-todd/tensorfow-docset-maker | b0f6792d90b8e8cc8c33c44673c6f255fe248ce1 | [
"MIT"
] | 10 | 2020-01-23T09:33:38.000Z | 2021-09-25T13:15:53.000Z | src/tf_manual_doc_setup.py | bingo-todd/tensorfow-docset-maker | b0f6792d90b8e8cc8c33c44673c6f255fe248ce1 | [
"MIT"
] | 1 | 2021-02-01T14:51:48.000Z | 2021-02-02T07:21:43.000Z | src/tf_manual_doc_setup.py | bingo-todd/tensorfow-docset-maker | b0f6792d90b8e8cc8c33c44673c6f255fe248ce1 | [
"MIT"
] | 2 | 2020-02-12T01:56:05.000Z | 2020-06-27T07:29:53.000Z | import json
import os
from .tf_doc_setup import TFDocSetup
from .dashing import DASHING
class TFManualDocSetup(TFDocSetup):
""" This class is designed to create DocSet for all versions of TensorFlow 2.x automatically."""
def __init__(self, md_dir_path, html_dir_path, version=''):
"""
Initiali... | 33.62 | 100 | 0.618084 | import json
import os
from .tf_doc_setup import TFDocSetup
from .dashing import DASHING
class TFManualDocSetup(TFDocSetup):
def __init__(self, md_dir_path, html_dir_path, version=''):
self.md_dir_path = os.path.join(md_dir_path)
self.html_dir_path = os.path.join(html_dir_path)
os.makedir... | true | true |
f764792abc7db049e5c9bf26a7139c01d85e8f46 | 1,228 | py | Python | interview/leet/016_3Sum_Closest_v2.py | eroicaleo/LearningPython | 297d46eddce6e43ce0c160d2660dff5f5d616800 | [
"MIT"
] | 1 | 2020-10-12T13:33:29.000Z | 2020-10-12T13:33:29.000Z | interview/leet/016_3Sum_Closest_v2.py | eroicaleo/LearningPython | 297d46eddce6e43ce0c160d2660dff5f5d616800 | [
"MIT"
] | null | null | null | interview/leet/016_3Sum_Closest_v2.py | eroicaleo/LearningPython | 297d46eddce6e43ce0c160d2660dff5f5d616800 | [
"MIT"
] | 1 | 2016-11-09T07:28:45.000Z | 2016-11-09T07:28:45.000Z | #!/usr/bin/env python
# After sort it O(nlogn)
# For every iteration, fix the first number.
# Then the problem reduces to find 2 numbers whose sum is closest to a new target
# Then it's same as given a 2-D array, columns rows are all sorted, check if k is inside
# For example:
# 1, 2, 3, 4
# 1 3 4 5
# 2 5... | 26.695652 | 88 | 0.493485 |
# For example:
# 1, 2, 3, 4
# 1 3 4 5
# 2 5 6
# 3 7
# 4
class Solution:
def threeSumClosest(self, nums, target):
nums = sorted(nums)
end = len(nums)-1
threeSum = sum(nums[0:3])
for start in range(end-1):
i, j = start+1, end
while (i < ... | true | true |
f764792c040b7382e016c8ec6b3c93baf1acbdf6 | 3,870 | py | Python | conditionals.py | Fame1772-cmis/fame1772-cmis-cs2 | e05c11a7f96b6f0082a7fc54fb6e7cd4db3bb758 | [
"CC0-1.0"
] | null | null | null | conditionals.py | Fame1772-cmis/fame1772-cmis-cs2 | e05c11a7f96b6f0082a7fc54fb6e7cd4db3bb758 | [
"CC0-1.0"
] | null | null | null | conditionals.py | Fame1772-cmis/fame1772-cmis-cs2 | e05c11a7f96b6f0082a7fc54fb6e7cd4db3bb758 | [
"CC0-1.0"
] | null | null | null | #The computer will take determine the age at which you start your occupation, the age at which you quit your job, and and what your occupation might be.
import random
def agecalculations(Currentage, Finishschool, Thinkstartwork):
return (Currentage * Finishschool) // Thinkstartwork
def oldoryoung(Currentage):
if int... | 30 | 152 | 0.687855 | import random
def agecalculations(Currentage, Finishschool, Thinkstartwork):
return (Currentage * Finishschool) // Thinkstartwork
def oldoryoung(Currentage):
if int(Currentage) >= 20:
return True
elif int(Currentage) <= 19:
return False
def thinkfuture(oldoryoung):
if oldoryoung == True:
return "It's... | false | true |
f7647a3128279e92ec8f6729eabfa79bdc3623c0 | 6,987 | py | Python | bench.py | netoferraz/benchmark-mongodb-pipeline | 4ee60e12ac5f3717d75e089541b045b1ae18ceb9 | [
"MIT"
] | null | null | null | bench.py | netoferraz/benchmark-mongodb-pipeline | 4ee60e12ac5f3717d75e089541b045b1ae18ceb9 | [
"MIT"
] | null | null | null | bench.py | netoferraz/benchmark-mongodb-pipeline | 4ee60e12ac5f3717d75e089541b045b1ae18ceb9 | [
"MIT"
] | 1 | 2021-11-24T17:54:06.000Z | 2021-11-24T17:54:06.000Z | import subprocess
import os
import click
import statistics
import scrapy
import codespeedinfo
class commandoption(object):
def __init__(self, n_runs, only_result, upload_result, book_url, vmprof, set):
self.n_runs = n_runs
self.only_result = only_result
self.upload_result = upload_result... | 26.366038 | 101 | 0.61228 | import subprocess
import os
import click
import statistics
import scrapy
import codespeedinfo
class commandoption(object):
def __init__(self, n_runs, only_result, upload_result, book_url, vmprof, set):
self.n_runs = n_runs
self.only_result = only_result
self.upload_result = upload_result... | true | true |
f7647a3e0b0d2636443c1f35a5276b4d2493a276 | 186 | py | Python | PredictiveModels/__init__.py | marchcarax/Portfolio-stats | 0c52ac18d376e1adbb226fe8c41caf9573c6c517 | [
"MIT"
] | 2 | 2021-05-04T01:24:45.000Z | 2021-10-05T15:03:56.000Z | PredictiveModels/__init__.py | marchcarax/Portfolio-stats | 0c52ac18d376e1adbb226fe8c41caf9573c6c517 | [
"MIT"
] | null | null | null | PredictiveModels/__init__.py | marchcarax/Portfolio-stats | 0c52ac18d376e1adbb226fe8c41caf9573c6c517 | [
"MIT"
] | null | null | null | __all__ = ['Arima_model, LSTM_Keras_predict_main, montecarlo']
from Arima_Model import arima_model
from montecarlo import montecarlo_model
from LSTM_Keras_predict_main import keras_calc | 37.2 | 62 | 0.870968 | __all__ = ['Arima_model, LSTM_Keras_predict_main, montecarlo']
from Arima_Model import arima_model
from montecarlo import montecarlo_model
from LSTM_Keras_predict_main import keras_calc | true | true |
f7647b40a2e22c3b1347477e433a5e264b8ddad2 | 259 | py | Python | web3data/chains.py | dmuhs/web3data-py | c91cc2e02481df144220e8e7e17e07fd6ceb660c | [
"MIT"
] | 8 | 2020-03-16T01:46:01.000Z | 2021-08-04T19:54:25.000Z | web3data/chains.py | dmuhs/web3data-py | c91cc2e02481df144220e8e7e17e07fd6ceb660c | [
"MIT"
] | 21 | 2020-03-15T12:14:32.000Z | 2022-03-01T20:37:13.000Z | web3data/chains.py | dmuhs/web3data-py | c91cc2e02481df144220e8e7e17e07fd6ceb660c | [
"MIT"
] | 3 | 2020-05-21T17:42:28.000Z | 2020-12-17T23:00:54.000Z | """This module contains an enum with names of supported chains."""
from enum import Enum
class Chains(Enum):
"""Blockchains supported by the Amberdata API."""
BTC = 1
BCH = 2
BSV = 3
ETH = 4
ETH_RINKEBY = 5
LTC = 6
ZEC = 7
| 16.1875 | 66 | 0.602317 |
from enum import Enum
class Chains(Enum):
BTC = 1
BCH = 2
BSV = 3
ETH = 4
ETH_RINKEBY = 5
LTC = 6
ZEC = 7
| true | true |
f7647bad8e40ddde16b2c8c00e945d1300748b55 | 5,722 | py | Python | tensorbay/opendataset/SegTrack2/loader.py | rexzheng324-c/tensorbay-python-sdk | 764c28f34069229daa41474e2f104786dbfa973f | [
"MIT"
] | null | null | null | tensorbay/opendataset/SegTrack2/loader.py | rexzheng324-c/tensorbay-python-sdk | 764c28f34069229daa41474e2f104786dbfa973f | [
"MIT"
] | null | null | null | tensorbay/opendataset/SegTrack2/loader.py | rexzheng324-c/tensorbay-python-sdk | 764c28f34069229daa41474e2f104786dbfa973f | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
#
# Copytright 2021 Graviti. Licensed under MIT License.
#
# pylint: disable=invalid-name
# pylint: disable=missing-module-docstring
import os
from typing import Callable, Dict
import numpy as np
from tensorbay.dataset import Data, Dataset
from tensorbay.label import InstanceMask
from tensorba... | 33.461988 | 98 | 0.616043 |
import os
from typing import Callable, Dict
import numpy as np
from tensorbay.dataset import Data, Dataset
from tensorbay.label import InstanceMask
from tensorbay.opendataset._utility import glob
try:
from PIL import Image
except ModuleNotFoundError:
from tensorbay.opendataset._utility.mocker import Image ... | true | true |
f7647beadeb2b4fd07fbbf3202e020ca3ff0677d | 1,703 | py | Python | python/tvm/relay/param_dict.py | mostafaelhoushi/tvm | ae21eddf5f13ffa82d514e8311c87f38bcac559a | [
"Apache-2.0"
] | 1 | 2021-03-07T15:30:16.000Z | 2021-03-07T15:30:16.000Z | python/tvm/relay/param_dict.py | mostafaelhoushi/tvm | ae21eddf5f13ffa82d514e8311c87f38bcac559a | [
"Apache-2.0"
] | null | null | null | python/tvm/relay/param_dict.py | mostafaelhoushi/tvm | ae21eddf5f13ffa82d514e8311c87f38bcac559a | [
"Apache-2.0"
] | 1 | 2020-02-09T10:42:31.000Z | 2020-02-09T10:42:31.000Z | # pylint: disable=invalid-name
"""Helper utility to save parameter dicts."""
import tvm
_save_param_dict = tvm.get_global_func("tvm.relay._save_param_dict")
_load_param_dict = tvm.get_global_func("tvm.relay._load_param_dict")
def save_param_dict(params):
"""Save parameter dictionary to binary bytes.
The resu... | 27.918033 | 79 | 0.658837 | import tvm
_save_param_dict = tvm.get_global_func("tvm.relay._save_param_dict")
_load_param_dict = tvm.get_global_func("tvm.relay._load_param_dict")
def save_param_dict(params):
args = []
for k, v in params.items():
args.append(k)
args.append(tvm.nd.array(v))
return _save_param_dict(*args)... | true | true |
f7647c473c8921ca694c175970b38272ee05fb42 | 10,486 | py | Python | pypressruby/widgets_logic.py | gfabbris/pypressruby | ce5b89821b0bd829c0aac85f1b364a6f0202716e | [
"BSD-3-Clause"
] | null | null | null | pypressruby/widgets_logic.py | gfabbris/pypressruby | ce5b89821b0bd829c0aac85f1b364a6f0202716e | [
"BSD-3-Clause"
] | null | null | null | pypressruby/widgets_logic.py | gfabbris/pypressruby | ce5b89821b0bd829c0aac85f1b364a6f0202716e | [
"BSD-3-Clause"
] | null | null | null | """
Copyright (c) 2018-2021, UChicago Argonne, LLC
See LICENSE file.
"""
import seabreeze.spectrometers as sb
from PyQt5.QtCore import QObject
import numpy as np
from time import sleep
import _thread as thread
from pypressruby.logic import make_dummy, fit_data, calculate_pressure
class LogicWidgets(QObject):
d... | 29.96 | 79 | 0.573145 |
import seabreeze.spectrometers as sb
from PyQt5.QtCore import QObject
import numpy as np
from time import sleep
import _thread as thread
from pypressruby.logic import make_dummy, fit_data, calculate_pressure
class LogicWidgets(QObject):
def __init__(self, status, options, plot):
super(LogicWidgets, self... | true | true |
f7647e9f145b50185fa8282f9b5163c8e2a70b5f | 114 | py | Python | automation/pytest-bdd/tests/config/__init__.py | jmt-transloc/python_automation_frameworks | e25d893d16ef68e06a0b08cc0f27d287bec512b3 | [
"MIT"
] | null | null | null | automation/pytest-bdd/tests/config/__init__.py | jmt-transloc/python_automation_frameworks | e25d893d16ef68e06a0b08cc0f27d287bec512b3 | [
"MIT"
] | 4 | 2021-06-02T00:37:48.000Z | 2021-06-02T00:48:51.000Z | automation/pytest-bdd/tests/config/__init__.py | jmt-transloc/python_automation_frameworks | e25d893d16ef68e06a0b08cc0f27d287bec512b3 | [
"MIT"
] | null | null | null | from config._config import _vault as options
from config._config import parse_env_variables, parse_json_variables
| 38 | 68 | 0.877193 | from config._config import _vault as options
from config._config import parse_env_variables, parse_json_variables
| true | true |
f7647f1c21ed20b05bb45bd0d2f1affec49c8ed4 | 648 | py | Python | src/rofi_rbw/entry.py | fdw/rofi-rbw | 839f4101e6e0b8d8d5035877bf35f179faf1679d | [
"MIT"
] | 58 | 2020-08-05T18:34:23.000Z | 2022-03-29T16:01:12.000Z | src/rofi_rbw/entry.py | fdw/rofi-rbw | 839f4101e6e0b8d8d5035877bf35f179faf1679d | [
"MIT"
] | 37 | 2020-08-05T15:25:28.000Z | 2022-03-30T16:48:12.000Z | src/rofi_rbw/entry.py | fdw/rofi-rbw | 839f4101e6e0b8d8d5035877bf35f179faf1679d | [
"MIT"
] | 17 | 2020-07-25T21:40:13.000Z | 2022-03-27T04:32:42.000Z | from typing import Union, List
class Entry:
def __init__(self, data: str) -> None:
self.name = ''
self.folder = ''
self.username = ''
fields = data.split('\t')
self.name = fields[1]
self.folder = fields[0]
self.length = len(self.name) + len(self.folder) + ... | 24.923077 | 101 | 0.557099 | from typing import Union, List
class Entry:
def __init__(self, data: str) -> None:
self.name = ''
self.folder = ''
self.username = ''
fields = data.split('\t')
self.name = fields[1]
self.folder = fields[0]
self.length = len(self.name) + len(self.folder) + ... | true | true |
f7648076132a0049075e03a7be3edd7d45fc14f3 | 3,893 | py | Python | fixture/group.py | anreysolovyev/python_training | ab109a4a64997ea4a668ec7004c2169d962c8d61 | [
"Apache-2.0"
] | null | null | null | fixture/group.py | anreysolovyev/python_training | ab109a4a64997ea4a668ec7004c2169d962c8d61 | [
"Apache-2.0"
] | null | null | null | fixture/group.py | anreysolovyev/python_training | ab109a4a64997ea4a668ec7004c2169d962c8d61 | [
"Apache-2.0"
] | null | null | null | from model.group import Group
class GroupHelper:
def __init__(self, app):
self.app = app
def open_groups_page(self):
wd = self.app.wd
if not (wd.current_url.endswith("group.php") and len(wd.find_elements_by_name("new")) > 0):
wd.find_element_by_link_text("groups").click()... | 32.991525 | 99 | 0.637811 | from model.group import Group
class GroupHelper:
def __init__(self, app):
self.app = app
def open_groups_page(self):
wd = self.app.wd
if not (wd.current_url.endswith("group.php") and len(wd.find_elements_by_name("new")) > 0):
wd.find_element_by_link_text("groups").click()... | true | true |
f764809ed5fbb95fb7ffbed5a739943af80ee4a7 | 47,409 | py | Python | src/natcap/invest/ndr/ndr.py | danielgis/invest | b9687d249361556b874750368e856ef049447b5a | [
"BSD-3-Clause"
] | null | null | null | src/natcap/invest/ndr/ndr.py | danielgis/invest | b9687d249361556b874750368e856ef049447b5a | [
"BSD-3-Clause"
] | null | null | null | src/natcap/invest/ndr/ndr.py | danielgis/invest | b9687d249361556b874750368e856ef049447b5a | [
"BSD-3-Clause"
] | 1 | 2021-04-21T10:46:17.000Z | 2021-04-21T10:46:17.000Z | """InVEST Nutrient Delivery Ratio (NDR) module."""
from __future__ import absolute_import
import pickle
import itertools
import logging
import os
from osgeo import gdal
from osgeo import ogr
import numpy
import taskgraph
import pygeoprocessing
import pygeoprocessing.routing
from .. import validation
from .. import ut... | 40.177119 | 79 | 0.655424 | from __future__ import absolute_import
import pickle
import itertools
import logging
import os
from osgeo import gdal
from osgeo import ogr
import numpy
import taskgraph
import pygeoprocessing
import pygeoprocessing.routing
from .. import validation
from .. import utils
from . import ndr_core
LOGGER = logging.getLog... | true | true |
f764814d4b5d9420cfb3f0bbd446529424983d4a | 555 | py | Python | scripts/quest/q38074s.py | lynsone/swordie | 7e9d564c1f2659a87e01c376089e1ee0a3842c5b | [
"MIT"
] | 2 | 2020-04-15T03:16:07.000Z | 2020-08-12T23:28:32.000Z | scripts/quest/q38074s.py | lynsone/swordie | 7e9d564c1f2659a87e01c376089e1ee0a3842c5b | [
"MIT"
] | null | null | null | scripts/quest/q38074s.py | lynsone/swordie | 7e9d564c1f2659a87e01c376089e1ee0a3842c5b | [
"MIT"
] | 3 | 2020-08-25T06:55:25.000Z | 2020-12-01T13:07:43.000Z | sm.flipDialoguePlayerAsSpeaker()
sm.sendNext("There's no question that I... have been erased from everyone's memories. But if it's just me, then they must have holes in their memories. They would know that at least SOMEONE was there.")
sm.setPlayerAsSpeaker()
if sm.sendAskAccept("If it's not just that my existence is b... | 69.375 | 223 | 0.756757 | sm.flipDialoguePlayerAsSpeaker()
sm.sendNext("There's no question that I... have been erased from everyone's memories. But if it's just me, then they must have holes in their memories. They would know that at least SOMEONE was there.")
sm.setPlayerAsSpeaker()
if sm.sendAskAccept("If it's not just that my existence is b... | true | true |
f764816f53ed9c33107e5b5ab19b9565af93858a | 15,563 | py | Python | pyAudioAnalysis/MidTermFeatures.py | slowglow/pyAudioAnalysis | 67587e5b24eb1430641823a6add085a65c8affe5 | [
"Apache-2.0"
] | null | null | null | pyAudioAnalysis/MidTermFeatures.py | slowglow/pyAudioAnalysis | 67587e5b24eb1430641823a6add085a65c8affe5 | [
"Apache-2.0"
] | null | null | null | pyAudioAnalysis/MidTermFeatures.py | slowglow/pyAudioAnalysis | 67587e5b24eb1430641823a6add085a65c8affe5 | [
"Apache-2.0"
] | null | null | null | from __future__ import print_function
import os
import time
import glob
import numpy as np
import matplotlib.pyplot as plt
import sys
sys.path.insert(0, os.path.join(
os.path.dirname(os.path.realpath(__file__)), "../"))
from pyAudioAnalysis import utilities
from pyAudioAnalysis import audioBasicIO
from pyAudioAnaly... | 41.171958 | 80 | 0.586776 | from __future__ import print_function
import os
import time
import glob
import numpy as np
import matplotlib.pyplot as plt
import sys
sys.path.insert(0, os.path.join(
os.path.dirname(os.path.realpath(__file__)), "../"))
from pyAudioAnalysis import utilities
from pyAudioAnalysis import audioBasicIO
from pyAudioAnaly... | true | true |
f76481dff4ae18d465f2a7aecc1d7ec6d45116ca | 3,060 | py | Python | neutron/plugins/cisco/cfg_agent/device_drivers/dummy_driver.py | alliedtelesis/neutron | 80c9ab86edb922dcd27aaa8c5b99731097e52652 | [
"Apache-2.0"
] | null | null | null | neutron/plugins/cisco/cfg_agent/device_drivers/dummy_driver.py | alliedtelesis/neutron | 80c9ab86edb922dcd27aaa8c5b99731097e52652 | [
"Apache-2.0"
] | null | null | null | neutron/plugins/cisco/cfg_agent/device_drivers/dummy_driver.py | alliedtelesis/neutron | 80c9ab86edb922dcd27aaa8c5b99731097e52652 | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 Cisco Systems, Inc. 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 requir... | 39.230769 | 78 | 0.688562 |
import logging
from oslo_serialization import jsonutils
from neutron.plugins.cisco.cfg_agent.device_drivers import devicedriver_api
LOG = logging.getLogger(__name__)
class DummyRoutingDriver(devicedriver_api.RoutingDriverBase):
def __init__(self, **device_params):
my_device_params = device_params
... | true | true |
f76482fb496e2a25aaa1658f2d43f8e54cc55095 | 4,367 | py | Python | services/perso/persotool.py | mkuyper/basicmac | 2d2f247a2853a5eeb31b4044978eb5bf198947e3 | [
"BSD-3-Clause"
] | 11 | 2020-04-18T18:24:05.000Z | 2021-10-17T03:22:50.000Z | services/perso/persotool.py | mkuyper/basicmac | 2d2f247a2853a5eeb31b4044978eb5bf198947e3 | [
"BSD-3-Clause"
] | 6 | 2020-09-21T22:18:18.000Z | 2021-05-29T14:30:48.000Z | services/perso/persotool.py | mkuyper/basicmac | 2d2f247a2853a5eeb31b4044978eb5bf198947e3 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# Copyright (C) 2020-2020 Michael Kuyper. All rights reserved.
#
# This file is subject to the terms and conditions defined in file 'LICENSE',
# which is part of this source code package.
from typing import Optional
import aioserial
import asyncio
import click
import functools
from perso impo... | 32.110294 | 148 | 0.666361 |
from typing import Optional
import aioserial
import asyncio
import click
import functools
from perso import PTE, PTESerialPort, PersoData, PersoDataV1
from rtlib import Eui
class PhysicalPTESerialPort(PTESerialPort):
def __init__(self, port:str, baudrate:int) -> None:
self.serial = aioserial.AioSerial(... | true | true |
f764835597a751739f9f6b2c5e0d236b04a36800 | 90,612 | py | Python | bin/mpfit.py | t-arae/empirical-JTK_CYCLE-with-asymmetry | f2a5fd76b8ff902443ea9e1824c49f9e66a5e217 | [
"MIT"
] | null | null | null | bin/mpfit.py | t-arae/empirical-JTK_CYCLE-with-asymmetry | f2a5fd76b8ff902443ea9e1824c49f9e66a5e217 | [
"MIT"
] | null | null | null | bin/mpfit.py | t-arae/empirical-JTK_CYCLE-with-asymmetry | f2a5fd76b8ff902443ea9e1824c49f9e66a5e217 | [
"MIT"
] | null | null | null | """
Perform Levenberg-Marquardt least-squares minimization, based on MINPACK-1.
AUTHORS
The original version of this software, called LMFIT, was written in FORTRAN
as part of the MINPACK-1 package by XXX.
Craig Markwardt converted the FORTRAN code to IDL. The informati... | 40.147098 | 98 | 0.574692 |
import numpy
import types
class mpfit:
def __init__(self, fcn, xall=None, functkw={}, parinfo=None,
ftol=1.e-10, xtol=1.e-10, gtol=1.e-10,
damp=0., maxiter=200, factor=100., nprint=1,
iterfunct='default', iterkw={}, nocovar=0,
fastnorm=... | true | true |
f7648369e30d54f58c193d3648a441ad1be69dbb | 5,967 | py | Python | av_03/scripts/visualizer_node.py | arekmula/autonomous_vehicle | 6d9b2d2556be11de5dc470d241d6e9807178f031 | [
"MIT"
] | 2 | 2021-04-01T13:39:27.000Z | 2021-04-02T00:19:13.000Z | av_03/scripts/visualizer_node.py | arekmula/autonomous_vehicle | 6d9b2d2556be11de5dc470d241d6e9807178f031 | [
"MIT"
] | null | null | null | av_03/scripts/visualizer_node.py | arekmula/autonomous_vehicle | 6d9b2d2556be11de5dc470d241d6e9807178f031 | [
"MIT"
] | 4 | 2021-04-01T13:43:05.000Z | 2022-01-21T14:50:36.000Z | #!/usr/bin/env python
# ROS imports
import rospy
from sensor_msgs.msg import Image
from cv_bridge import CvBridge, CvBridgeError
# Custom ROS imports
from av_msgs.msg import Mode, States
from prius_msgs.msg import Control
# Python imports
import cv2
class Visualizer:
def __init__(self):
# Front camera... | 39.256579 | 113 | 0.597955 |
import rospy
from sensor_msgs.msg import Image
from cv_bridge import CvBridge, CvBridgeError
from av_msgs.msg import Mode, States
from prius_msgs.msg import Control
import cv2
class Visualizer:
def __init__(self):
self.front_camera_topic_name = "/prius/front_camera/image_raw"
self.fron... | true | true |
f7648455814bf00b06773ab6880d872d16dedebb | 3,285 | py | Python | src/main.py | BonfireScratch/workflowAutomator | 44f6981ade1d006c2ec2daee08fa0908ae03108f | [
"MIT"
] | 1 | 2020-11-07T09:01:47.000Z | 2020-11-07T09:01:47.000Z | src/main.py | BonfireScratch/workflowAutomator | 44f6981ade1d006c2ec2daee08fa0908ae03108f | [
"MIT"
] | null | null | null | src/main.py | BonfireScratch/workflowAutomator | 44f6981ade1d006c2ec2daee08fa0908ae03108f | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import sys, os, json, requests, configparser, colorama
from termcolor import colored
from datetime import datetime
colorama.init()
def makeSettingsFile():
config = configparser.ConfigParser()
config.add_section('settings')
while True:
path = input(colored("Input a base ... | 31.285714 | 159 | 0.595738 |
import sys, os, json, requests, configparser, colorama
from termcolor import colored
from datetime import datetime
colorama.init()
def makeSettingsFile():
config = configparser.ConfigParser()
config.add_section('settings')
while True:
path = input(colored("Input a base path where your projec... | true | true |
f764862a3d37ed16659a8930dc5aa04b7357ab35 | 19,569 | py | Python | sportsipy/nfl/constants.py | MArtinherz/sportsipy | 24f4c1d5e3bb8ecc56e21568961588491e9cfd2a | [
"MIT"
] | 221 | 2018-05-15T19:48:03.000Z | 2021-01-05T15:36:21.000Z | sportsipy/nfl/constants.py | MArtinherz/sportsipy | 24f4c1d5e3bb8ecc56e21568961588491e9cfd2a | [
"MIT"
] | 502 | 2018-07-25T03:09:26.000Z | 2021-01-06T16:07:02.000Z | sportsipy/nfl/constants.py | MArtinherz/sportsipy | 24f4c1d5e3bb8ecc56e21568961588491e9cfd2a | [
"MIT"
] | 72 | 2021-01-21T13:17:00.000Z | 2022-03-31T21:43:25.000Z | PARSING_SCHEME = {
'name': 'a',
'games_played': 'td[data-stat="g"]:first',
'wins': 'td[data-stat="wins"]:first',
'losses': 'td[data-stat="losses"]:first',
'win_percentage': 'td[data-stat="win_loss_perc"]:first',
'points_for': 'td[data-stat="points"]:first',
'points_against': 'td[data-stat="p... | 46.592857 | 79 | 0.68956 | PARSING_SCHEME = {
'name': 'a',
'games_played': 'td[data-stat="g"]:first',
'wins': 'td[data-stat="wins"]:first',
'losses': 'td[data-stat="losses"]:first',
'win_percentage': 'td[data-stat="win_loss_perc"]:first',
'points_for': 'td[data-stat="points"]:first',
'points_against': 'td[data-stat="p... | true | true |
f7648668c89a4becdbabf3dd8700f5251a4a7233 | 12,620 | py | Python | ABSORBAROO/absorbaroo.py | ryutamura/absorbaroo | dcb188ceafe4925af4631bb39c6cdafba69581bf | [
"Apache-2.0"
] | null | null | null | ABSORBAROO/absorbaroo.py | ryutamura/absorbaroo | dcb188ceafe4925af4631bb39c6cdafba69581bf | [
"Apache-2.0"
] | null | null | null | ABSORBAROO/absorbaroo.py | ryutamura/absorbaroo | dcb188ceafe4925af4631bb39c6cdafba69581bf | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 BlueCat Networks (USA) Inc. and its affiliates
#
# 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 appli... | 34.386921 | 112 | 0.594216 |
import os
import sys
import datetime
import re
import pytz
import json
import hashlib
import functools
from threading import Lock
from apscheduler.schedulers.background import BackgroundScheduler
from o365.endpoints import EndpointsAPI
from dnsedge.edgeapi import EdgeAPI
from sdwan.merakiapi import MerakiAPI
class A... | true | true |
f764869fbcb41827a16c64ec7396c5c4f896cd07 | 7,898 | py | Python | packages/gtmcore/gtmcore/environment/tests/test_pip.py | jjwatts/gigantum-client | 88ce0475fb6880322bdd06d987c494e29064f278 | [
"MIT"
] | null | null | null | packages/gtmcore/gtmcore/environment/tests/test_pip.py | jjwatts/gigantum-client | 88ce0475fb6880322bdd06d987c494e29064f278 | [
"MIT"
] | null | null | null | packages/gtmcore/gtmcore/environment/tests/test_pip.py | jjwatts/gigantum-client | 88ce0475fb6880322bdd06d987c494e29064f278 | [
"MIT"
] | null | null | null | # Copyright (c) 2017 FlashX, LLC
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distrib... | 40.92228 | 116 | 0.651557 | import pytest
from gtmcore.environment.pip import PipPackageManager
from gtmcore.fixtures.container import mock_config_with_repo, build_lb_image_for_env
class TestPipPackageManager(object):
def test_search(self, mock_config_with_repo, build_lb_image_for_env):
mrg = PipPackageManager()
lb = build_... | true | true |
f76486f0046270f76a1033800951ca28d69b0a7c | 6,683 | py | Python | sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_percentile_target_operations.py | beltr0n/azure-sdk-for-python | 2f7fb8bee881b0fc0386a0ad5385755ceedd0453 | [
"MIT"
] | 1 | 2021-09-07T18:35:49.000Z | 2021-09-07T18:35:49.000Z | sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_percentile_target_operations.py | beltr0n/azure-sdk-for-python | 2f7fb8bee881b0fc0386a0ad5385755ceedd0453 | [
"MIT"
] | 4 | 2019-04-17T17:57:49.000Z | 2020-04-24T21:11:22.000Z | sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_percentile_target_operations.py | beltr0n/azure-sdk-for-python | 2f7fb8bee881b0fc0386a0ad5385755ceedd0453 | [
"MIT"
] | 2 | 2021-05-23T16:46:31.000Z | 2021-05-26T23:51:09.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 49.873134 | 230 | 0.661529 | from typing import TYPE_CHECKING
import warnings
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import HttpR... | true | true |
f764873b9698d439e863276c92e02768402a4bd2 | 12,812 | py | Python | project/apps/birth_registration/tests.py | kostik/vrs | a347c2d901e1a6b60a85480c9d2b247157881fce | [
"BSD-3-Clause"
] | 1 | 2016-11-09T18:57:23.000Z | 2016-11-09T18:57:23.000Z | project/apps/birth_registration/tests.py | kostik/vrs | a347c2d901e1a6b60a85480c9d2b247157881fce | [
"BSD-3-Clause"
] | null | null | null | project/apps/birth_registration/tests.py | kostik/vrs | a347c2d901e1a6b60a85480c9d2b247157881fce | [
"BSD-3-Clause"
] | 4 | 2016-09-30T08:24:09.000Z | 2019-02-28T14:09:19.000Z | # import json
# import os
# import random
#
# from dateutil.parser import parse
# from django.core.urlresolvers import reverse
# from django.contrib.auth.models import User, Permission
# from django.test import TestCase, RequestFactory
# from django.utils import timezone
# import reversion
#
# from birth_registration.a... | 35.988764 | 118 | 0.588511 | true | true | |
f76487995ccbf1800b47afe2ec1ea17c687d1447 | 731 | py | Python | utilities/arguments_parser.py | Jwuthri/GtfsTools | d0db0c89588f936f02d4e6cccb70034ec1e4b9b1 | [
"MIT"
] | 2 | 2017-10-30T07:27:02.000Z | 2021-11-09T18:50:13.000Z | utilities/arguments_parser.py | Jwuthri/GtfsTools | d0db0c89588f936f02d4e6cccb70034ec1e4b9b1 | [
"MIT"
] | 1 | 2017-02-24T20:50:10.000Z | 2017-02-24T22:40:33.000Z | utilities/arguments_parser.py | Jwuthri/GtfsTools | d0db0c89588f936f02d4e6cccb70034ec1e4b9b1 | [
"MIT"
] | null | null | null | """Arguments Parser."""
import argparse
class ArgumentsParser(object):
"""Arguments parser"""
def __init__(self, params=[]):
"""Constructor"""
self.params = params
self.parser = argparse.ArgumentParser()
for arg, msg, choices in self.params:
if not choi... | 28.115385 | 73 | 0.543092 | import argparse
class ArgumentsParser(object):
def __init__(self, params=[]):
self.params = params
self.parser = argparse.ArgumentParser()
for arg, msg, choices in self.params:
if not choices:
self.parser.add_argument(arg, help=msg)
else:... | true | true |
f76487e88ee792ad3481ea23f609c9ef6f41860e | 5,783 | py | Python | src/DataHandler.py | jrddunbr/telephone-rfc | 13c78b0e952d2f716426b5971ca59b546c685e21 | [
"MIT"
] | null | null | null | src/DataHandler.py | jrddunbr/telephone-rfc | 13c78b0e952d2f716426b5971ca59b546c685e21 | [
"MIT"
] | null | null | null | src/DataHandler.py | jrddunbr/telephone-rfc | 13c78b0e952d2f716426b5971ca59b546c685e21 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import string, pprint, Checksum, iplib, random, platform, sys, datetime
class DataHandler:
def __init__(self, charset, le):
self.raw_data = "" # raw data from client
self.raw_headers = "" # raw headers from client
self.raw_lheaders = "" # raw headers from client converte... | 43.156716 | 176 | 0.570292 |
import string, pprint, Checksum, iplib, random, platform, sys, datetime
class DataHandler:
def __init__(self, charset, le):
self.raw_data = "" self.raw_headers = "" self.raw_lheaders = "" self.raw_message = "" self.le = le self.hdata = {} self.charset = char... | true | true |
f764881cb358d9068aef280d855e3e62d091e0ae | 9,500 | py | Python | zhaquirks/tuya/ts0601_cover.py | jasonwragg/zha-device-handlers | 6745c28bfbd7c12afacd30b3d42b878cd4841489 | [
"Apache-2.0"
] | null | null | null | zhaquirks/tuya/ts0601_cover.py | jasonwragg/zha-device-handlers | 6745c28bfbd7c12afacd30b3d42b878cd4841489 | [
"Apache-2.0"
] | null | null | null | zhaquirks/tuya/ts0601_cover.py | jasonwragg/zha-device-handlers | 6745c28bfbd7c12afacd30b3d42b878cd4841489 | [
"Apache-2.0"
] | null | null | null | """Tuya based cover and blinds."""
from zigpy.profiles import zha
from zigpy.zcl.clusters.general import Basic, Groups, Identify, OnOff, Ota, Scenes, Time
from zhaquirks.const import (
DEVICE_TYPE,
ENDPOINTS,
INPUT_CLUSTERS,
MODELS_INFO,
OUTPUT_CLUSTERS,
PROFILE_ID,
)
from zhaquirks.tuya import... | 35.447761 | 154 | 0.523474 | from zigpy.profiles import zha
from zigpy.zcl.clusters.general import Basic, Groups, Identify, OnOff, Ota, Scenes, Time
from zhaquirks.const import (
DEVICE_TYPE,
ENDPOINTS,
INPUT_CLUSTERS,
MODELS_INFO,
OUTPUT_CLUSTERS,
PROFILE_ID,
)
from zhaquirks.tuya import (
TuyaManufacturerWindowCover,... | true | true |
f7648866f300e95e76e4c5bef1962e0b03e55732 | 8,340 | py | Python | molo/core/tests/test_admin_view.py | Ishma59/molo | 4fd31df9266bc251e09e9339a132d3ccd4143c69 | [
"BSD-2-Clause"
] | null | null | null | molo/core/tests/test_admin_view.py | Ishma59/molo | 4fd31df9266bc251e09e9339a132d3ccd4143c69 | [
"BSD-2-Clause"
] | null | null | null | molo/core/tests/test_admin_view.py | Ishma59/molo | 4fd31df9266bc251e09e9339a132d3ccd4143c69 | [
"BSD-2-Clause"
] | null | null | null | from django.test import TestCase
from django.contrib.auth.models import User, Group, Permission
from django.contrib.contenttypes.models import ContentType
from wagtail.images.tests.utils import get_test_image_file, Image
from molo.core.models import (
Main, SiteLanguageRelation, Languages,
ArticlePage, Reactio... | 40.485437 | 79 | 0.656835 | from django.test import TestCase
from django.contrib.auth.models import User, Group, Permission
from django.contrib.contenttypes.models import ContentType
from wagtail.images.tests.utils import get_test_image_file, Image
from molo.core.models import (
Main, SiteLanguageRelation, Languages,
ArticlePage, Reactio... | true | true |
f76488fc60769c409ae92586f494253c79325bed | 29,391 | py | Python | worms/search.py | natteruw/worms | 6530505d4fca3229bb93738a0bae0463a17229b8 | [
"Apache-2.0"
] | null | null | null | worms/search.py | natteruw/worms | 6530505d4fca3229bb93738a0bae0463a17229b8 | [
"Apache-2.0"
] | null | null | null | worms/search.py | natteruw/worms | 6530505d4fca3229bb93738a0bae0463a17229b8 | [
"Apache-2.0"
] | null | null | null | 'search stuff'
import sys
import os
import pickle
import itertools as it
import numpy as np
from collections import defaultdict
from xbin import XformBinner
from homog import hinv, hrot
from concurrent.futures import ProcessPoolExecutor
from .worms import Segment, Segments, Worms
from .criteria import CriteriaList, Cy... | 41.279494 | 174 | 0.56684 |
import sys
import os
import pickle
import itertools as it
import numpy as np
from collections import defaultdict
from xbin import XformBinner
from homog import hinv, hrot
from concurrent.futures import ProcessPoolExecutor
from .worms import Segment, Segments, Worms
from .criteria import CriteriaList, Cyclic, WormCrite... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.