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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f776c5ae88e92cc79de0d0347798cf856a633fcf | 852 | py | Python | departure/provider/nexus/bus_data_model.py | Woll78/departure-python | 86eccd40291ad560d5859a120dd6c99aa5c4bd12 | [
"MIT"
] | null | null | null | departure/provider/nexus/bus_data_model.py | Woll78/departure-python | 86eccd40291ad560d5859a120dd6c99aa5c4bd12 | [
"MIT"
] | null | null | null | departure/provider/nexus/bus_data_model.py | Woll78/departure-python | 86eccd40291ad560d5859a120dd6c99aa5c4bd12 | [
"MIT"
] | null | null | null | import time
import datetime as datetime
class BusData:
def __init__(self, number, destination, timeLiteral, operator):
self.number = number
self.destination = destination
self.timeLiteral = timeLiteral
self.operator = operator
self.time = prepare_departure_time(timeLiteral)
def prepare_departure... | 25.818182 | 83 | 0.683099 | import time
import datetime as datetime
class BusData:
def __init__(self, number, destination, timeLiteral, operator):
self.number = number
self.destination = destination
self.timeLiteral = timeLiteral
self.operator = operator
self.time = prepare_departure_time(timeLiteral)
def prepare_departure... | true | true |
f776c5ba047670a4d29d8a7ca42b940c6fbacc33 | 15,134 | py | Python | nfl/fo.py | sansbacon/nfl | 11605b1a7725cce062ce0d7f15ebcf0a2f91a86e | [
"MIT"
] | 2 | 2019-12-07T18:45:34.000Z | 2021-06-13T00:45:44.000Z | nfl/fo.py | sansbacon/nfl | 11605b1a7725cce062ce0d7f15ebcf0a2f91a86e | [
"MIT"
] | 4 | 2017-01-07T20:19:23.000Z | 2018-11-01T18:19:50.000Z | nfl/fo.py | sansbacon/nfl | 11605b1a7725cce062ce0d7f15ebcf0a2f91a86e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# fo.py
# classes to scrape and parse footballoutsiders.com
import logging
import time
from bs4 import BeautifulSoup
from sportscraper.scraper import RequestScraper
from sportscraper.utility import merge_two
class Scraper(RequestScraper):
def dl(self, season=""):
"""
Gets... | 28.554717 | 110 | 0.460685 |
import logging
import time
from bs4 import BeautifulSoup
from sportscraper.scraper import RequestScraper
from sportscraper.utility import merge_two
class Scraper(RequestScraper):
def dl(self, season=""):
url = "http://www.footballoutsiders.com/stats/dl{}"
return self.get(url.format(season))
... | true | true |
f776c5c07849c3c8c12b8d1001136e791a657f15 | 4,147 | py | Python | pipeline.py | dimitrymindlin/DenseNetMuraPytorch | ef3a872d739b015e3618c00265acb481dc251342 | [
"MIT"
] | null | null | null | pipeline.py | dimitrymindlin/DenseNetMuraPytorch | ef3a872d739b015e3618c00265acb481dc251342 | [
"MIT"
] | null | null | null | pipeline.py | dimitrymindlin/DenseNetMuraPytorch | ef3a872d739b015e3618c00265acb481dc251342 | [
"MIT"
] | null | null | null | import os
import pandas as pd
from tqdm import tqdm
import torch
from torchvision import transforms
from torch.utils.data import DataLoader, Dataset
from torchvision.datasets.folder import pil_loader
from configs.mura_config import mura_config
data_cat = ['train', 'valid'] # data categories
def get_study_level_data(... | 40.656863 | 122 | 0.577044 | import os
import pandas as pd
from tqdm import tqdm
import torch
from torchvision import transforms
from torch.utils.data import DataLoader, Dataset
from torchvision.datasets.folder import pil_loader
from configs.mura_config import mura_config
data_cat = ['train', 'valid']
def get_study_level_data(study_types):
... | true | true |
f776c6332943bfe2de37dad18c0a518b69121f30 | 1,836 | py | Python | recipes/sota/2019/raw_lm_corpus/get_titles.py | Zilv1128/test1 | 49fbb1392e69b5194c077df9847505ec995b4e3d | [
"BSD-3-Clause"
] | 5,921 | 2017-12-29T17:04:46.000Z | 2021-04-16T00:37:35.000Z | recipes/sota/2019/raw_lm_corpus/get_titles.py | piEYj/wav2letter | 49fbb1392e69b5194c077df9847505ec995b4e3d | [
"BSD-3-Clause"
] | 949 | 2018-01-01T06:36:58.000Z | 2021-04-16T06:49:05.000Z | recipes/sota/2019/raw_lm_corpus/get_titles.py | piEYj/wav2letter | 49fbb1392e69b5194c077df9847505ec995b4e3d | [
"BSD-3-Clause"
] | 1,032 | 2017-12-30T09:47:51.000Z | 2021-04-11T11:40:00.000Z | import argparse
import os
import xml.etree.ElementTree as ET
from multiprocessing.pool import ThreadPool
from gutenberg.query import get_metadata
CACHE_PATH = ""
def get_one_title_from_cache(book_id):
return (book_id, get_metadata("title", int(book_id)))
def get_one_title(book_id):
try:
title = (... | 26.608696 | 98 | 0.626362 | import argparse
import os
import xml.etree.ElementTree as ET
from multiprocessing.pool import ThreadPool
from gutenberg.query import get_metadata
CACHE_PATH = ""
def get_one_title_from_cache(book_id):
return (book_id, get_metadata("title", int(book_id)))
def get_one_title(book_id):
try:
title = (... | true | true |
f776c664d9a262959f37a2648cf09b76add09397 | 16,316 | py | Python | Tools/resultsdbpy/resultsdbpy/model/repository.py | jacadcaps/webkitty | 9aebd2081349f9a7b5d168673c6f676a1450a66d | [
"BSD-2-Clause"
] | 6 | 2021-07-05T16:09:39.000Z | 2022-03-06T22:44:42.000Z | Tools/resultsdbpy/resultsdbpy/model/repository.py | jacadcaps/webkitty | 9aebd2081349f9a7b5d168673c6f676a1450a66d | [
"BSD-2-Clause"
] | 7 | 2022-03-15T13:25:39.000Z | 2022-03-15T13:25:44.000Z | Tools/resultsdbpy/resultsdbpy/model/repository.py | jacadcaps/webkitty | 9aebd2081349f9a7b5d168673c6f676a1450a66d | [
"BSD-2-Clause"
] | null | null | null | # Copyright (C) 2019 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | 41.835897 | 157 | 0.596531 |
import datetime
import contextlib
import json
import re
import requests
import threading
import urllib
import xmltodict
from resultsdbpy.controller.commit import Commit
from xml.parsers.expat import ExpatError
class SCMException(RuntimeError):
pass
class Repository(object):
DEFAULT_BRANCH = 'master'
... | true | true |
f776c8edcfcd2e4f667eaad8be1b6fbe7e8b9448 | 15,033 | py | Python | lib/fast_rcnn/test.py | wk910930/ccnn | 7d1d34aa575b745cbd95e3a47886d85c5e636940 | [
"MIT"
] | 25 | 2017-10-21T02:27:22.000Z | 2021-04-19T09:01:49.000Z | lib/fast_rcnn/test.py | ParanoidW/ccnn | 7d1d34aa575b745cbd95e3a47886d85c5e636940 | [
"MIT"
] | 2 | 2017-11-03T07:51:56.000Z | 2018-07-12T08:18:45.000Z | lib/fast_rcnn/test.py | ParanoidW/ccnn | 7d1d34aa575b745cbd95e3a47886d85c5e636940 | [
"MIT"
] | 9 | 2017-09-19T07:42:52.000Z | 2020-06-21T00:39:43.000Z | # --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
"""Test a Fast R-CNN network on an imdb (image database)."""
from fast... | 39.875332 | 105 | 0.610923 |
"""Test a Fast R-CNN network on an imdb (image database)."""
from fast_rcnn.config import cfg, get_output_dir
from fast_rcnn.bbox_transform import clip_boxes, bbox_transform_inv, bbox_voting
import argparse
import math
from utils.timer import Timer
import numpy as np
import cv2
import caffe
from fast_rcnn.nms_wrapper... | false | true |
f776cad505cc31707bbb8b152f586729ee81a925 | 1,728 | py | Python | libraries/deep_sort/deep_sort/deep/feature_extractor.py | ruidongjr/Aldi | b50101314bcca55994883eb447e30fff71527b6b | [
"MIT"
] | 24 | 2021-01-05T02:23:09.000Z | 2022-03-21T11:39:23.000Z | libraries/deep_sort/deep_sort/deep/feature_extractor.py | nathnim/track_and_count | 0d2dad1ab180abb59bee15d9e5e851e4de4e8cd5 | [
"MIT"
] | 7 | 2021-01-25T12:45:03.000Z | 2022-01-12T05:14:05.000Z | libraries/deep_sort/deep_sort/deep/feature_extractor.py | nathnim/track_and_count | 0d2dad1ab180abb59bee15d9e5e851e4de4e8cd5 | [
"MIT"
] | 16 | 2021-03-14T04:14:09.000Z | 2022-03-24T06:15:45.000Z | import torch
import torchvision.transforms as transforms
import numpy as np
import cv2
import logging
from .model import Net
class Extractor(object):
def __init__(self, model_path, use_cuda=True):
self.net = Net(reid=True)
self.device = "cuda" if torch.cuda.is_available() and use_cuda else "cpu"
... | 32 | 112 | 0.606481 | import torch
import torchvision.transforms as transforms
import numpy as np
import cv2
import logging
from .model import Net
class Extractor(object):
def __init__(self, model_path, use_cuda=True):
self.net = Net(reid=True)
self.device = "cuda" if torch.cuda.is_available() and use_cuda else "cpu"
... | true | true |
f776cb0f24adba9daefad5898989218f27a881aa | 1,275 | py | Python | suzieq/poller/worker/inventory/dir.py | LucaNicosia/suzieq | c281807ea2c4f44a9d6cd6c80fd5b71277b3cdcd | [
"Apache-2.0"
] | null | null | null | suzieq/poller/worker/inventory/dir.py | LucaNicosia/suzieq | c281807ea2c4f44a9d6cd6c80fd5b71277b3cdcd | [
"Apache-2.0"
] | null | null | null | suzieq/poller/worker/inventory/dir.py | LucaNicosia/suzieq | c281807ea2c4f44a9d6cd6c80fd5b71277b3cdcd | [
"Apache-2.0"
] | null | null | null | """
This module contains the logic of the plugin
in charge of creating fake nodes returning
the the data inside an input directory
"""
from typing import Dict, List
from suzieq.poller.worker.inventory.inventory import Inventory
from suzieq.poller.worker.nodes.files import FileNode
class InputDirInventory(Inventory)... | 30.357143 | 71 | 0.680784 |
from typing import Dict, List
from suzieq.poller.worker.inventory.inventory import Inventory
from suzieq.poller.worker.nodes.files import FileNode
class InputDirInventory(Inventory):
def __init__(self, add_task_fn, **kwargs) -> None:
self.input_dir = kwargs.pop('input_dir', None)
super().__init_... | true | true |
f776cc3d6ab422fe5cd0e6e506bb59704c44c887 | 509 | py | Python | tests/extension/thread_/stream_fsm_as_module/test_thread_stream_fsm_as_module.py | akmaru/veriloggen | 74f998139e8cf613f7703fa4cffd571bbf069bbc | [
"Apache-2.0"
] | 232 | 2015-09-01T16:07:48.000Z | 2022-03-28T14:53:28.000Z | tests/extension/thread_/stream_fsm_as_module/test_thread_stream_fsm_as_module.py | akmaru/veriloggen | 74f998139e8cf613f7703fa4cffd571bbf069bbc | [
"Apache-2.0"
] | 34 | 2015-08-21T09:13:03.000Z | 2022-03-21T23:52:44.000Z | tests/extension/thread_/stream_fsm_as_module/test_thread_stream_fsm_as_module.py | akmaru/veriloggen | 74f998139e8cf613f7703fa4cffd571bbf069bbc | [
"Apache-2.0"
] | 46 | 2015-09-24T14:39:57.000Z | 2022-02-23T21:59:56.000Z | from __future__ import absolute_import
from __future__ import print_function
import os
import veriloggen
import thread_stream_fsm_as_module
def test(request):
veriloggen.reset()
simtype = request.config.getoption('--sim')
rslt = thread_stream_fsm_as_module.run(filename=None, simtype=simtype,
... | 26.789474 | 111 | 0.691552 | from __future__ import absolute_import
from __future__ import print_function
import os
import veriloggen
import thread_stream_fsm_as_module
def test(request):
veriloggen.reset()
simtype = request.config.getoption('--sim')
rslt = thread_stream_fsm_as_module.run(filename=None, simtype=simtype,
... | true | true |
f776cc3ece5f1a2fbc68bff882e116b873cb579c | 17,688 | py | Python | sparse_operation_kit/unit_test/test_scripts/tf1/test_sparse_emb_demo.py | aalbersk/DeepRec | f673a950780959b44dcda99398880a1d883ab338 | [
"Apache-2.0"
] | 292 | 2021-12-24T03:24:33.000Z | 2022-03-31T15:41:05.000Z | sparse_operation_kit/unit_test/test_scripts/tf1/test_sparse_emb_demo.py | aalbersk/DeepRec | f673a950780959b44dcda99398880a1d883ab338 | [
"Apache-2.0"
] | 54 | 2021-12-24T06:40:09.000Z | 2022-03-30T07:57:24.000Z | sparse_operation_kit/unit_test/test_scripts/tf1/test_sparse_emb_demo.py | aalbersk/DeepRec | f673a950780959b44dcda99398880a1d883ab338 | [
"Apache-2.0"
] | 75 | 2021-12-24T04:48:21.000Z | 2022-03-29T10:13:39.000Z | """
Copyright (c) 2021, NVIDIA 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 to in ... | 47.548387 | 128 | 0.639925 |
import argparse
import sys, os
sys.path.append(os.path.abspath(os.path.join(
os.path.dirname(os.path.abspath(__file__)), "../../../")))
import sparse_operation_kit as sok
import tensorflow as tf
import utils
from sparse_models import SOKDemo, TFDemo
from test_dense_emb_demo import check_saved_embedding_variabl... | true | true |
f776ce8964c4084bd24cb3fdf18cc062433cb57e | 2,425 | py | Python | molo/core/cookiecutter/scaffold/{{cookiecutter.directory}}/{{cookiecutter.app_name}}/urls.py | Ishma59/molo | 4fd31df9266bc251e09e9339a132d3ccd4143c69 | [
"BSD-2-Clause"
] | null | null | null | molo/core/cookiecutter/scaffold/{{cookiecutter.directory}}/{{cookiecutter.app_name}}/urls.py | Ishma59/molo | 4fd31df9266bc251e09e9339a132d3ccd4143c69 | [
"BSD-2-Clause"
] | null | null | null | molo/core/cookiecutter/scaffold/{{cookiecutter.directory}}/{{cookiecutter.app_name}}/urls.py | Ishma59/molo | 4fd31df9266bc251e09e9339a132d3ccd4143c69 | [
"BSD-2-Clause"
] | null | null | null | import os
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.conf import settings
from django.contrib import admin
from django.views.generic.base import TemplateView
from django_cas_ng import views as cas_views
from wagtail.admin import urls as wagtailadmin_urls
from wagta... | 36.19403 | 76 | 0.685773 | import os
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.conf import settings
from django.contrib import admin
from django.views.generic.base import TemplateView
from django_cas_ng import views as cas_views
from wagtail.admin import urls as wagtailadmin_urls
from wagta... | false | true |
f776d148cebe2be696729f3e720b3b4740b2e7eb | 842 | py | Python | sorting.py | harsh793/Algorithms | a6b1c4d23d81434f7eea6b40f35c95136d28cd11 | [
"BSD-3-Clause"
] | null | null | null | sorting.py | harsh793/Algorithms | a6b1c4d23d81434f7eea6b40f35c95136d28cd11 | [
"BSD-3-Clause"
] | null | null | null | sorting.py | harsh793/Algorithms | a6b1c4d23d81434f7eea6b40f35c95136d28cd11 | [
"BSD-3-Clause"
] | null | null | null | import random
def quick_sort(data):
left = 0
right = len(data) - 1
output = randomized_quick_sort(data, left, right)
return output
def randomized_quick_sort(data, left, right):
if left <= right:
temp = random.randint(left, right)
data[left], data[temp] = data[temp], data[left]
... | 27.16129 | 55 | 0.551069 | import random
def quick_sort(data):
left = 0
right = len(data) - 1
output = randomized_quick_sort(data, left, right)
return output
def randomized_quick_sort(data, left, right):
if left <= right:
temp = random.randint(left, right)
data[left], data[temp] = data[temp], data[left]
... | true | true |
f776d1d4654a9773cddc3b7e19645aa96ed6960b | 11,601 | py | Python | keylime/ima.py | font/keylime | bd83bd1ce2a3249044b22865d5e95dfd95d09135 | [
"BSD-2-Clause"
] | null | null | null | keylime/ima.py | font/keylime | bd83bd1ce2a3249044b22865d5e95dfd95d09135 | [
"BSD-2-Clause"
] | null | null | null | keylime/ima.py | font/keylime | bd83bd1ce2a3249044b22865d5e95dfd95d09135 | [
"BSD-2-Clause"
] | null | null | null | '''
SPDX-License-Identifier: Apache-2.0
Copyright 2017 Massachusetts Institute of Technology.
'''
import ast
import codecs
import sys
import hashlib
import struct
import re
import os
from keylime import common
from keylime import keylime_logging
logger = keylime_logging.init_logging('ima')
config = common.get_config... | 32.405028 | 125 | 0.594863 |
import ast
import codecs
import sys
import hashlib
import struct
import re
import os
from keylime import common
from keylime import keylime_logging
logger = keylime_logging.init_logging('ima')
config = common.get_config()
START_HASH = (codecs.decode('0000000000000000000000000000000000000000', 'hex'))
FF_HASH = (co... | true | true |
f776d430c3ce044d4bdef8a8cf8ffcc360ecf4aa | 1,853 | py | Python | jenkins_jobs/errors.py | kei-yamazaki/jenkins-job-builder | 1bff1dfda9045ee42a78a433441101e2603197e1 | [
"Apache-2.0"
] | null | null | null | jenkins_jobs/errors.py | kei-yamazaki/jenkins-job-builder | 1bff1dfda9045ee42a78a433441101e2603197e1 | [
"Apache-2.0"
] | null | null | null | jenkins_jobs/errors.py | kei-yamazaki/jenkins-job-builder | 1bff1dfda9045ee42a78a433441101e2603197e1 | [
"Apache-2.0"
] | null | null | null | """Exception classes for jenkins_jobs errors"""
import inspect
def is_sequence(arg):
return (not hasattr(arg, "strip") and
(hasattr(arg, "__getitem__") or
hasattr(arg, "__iter__")))
class JenkinsJobsException(Exception):
pass
class ModuleError(JenkinsJobsException):
def get_... | 29.412698 | 78 | 0.600108 |
import inspect
def is_sequence(arg):
return (not hasattr(arg, "strip") and
(hasattr(arg, "__getitem__") or
hasattr(arg, "__iter__")))
class JenkinsJobsException(Exception):
pass
class ModuleError(JenkinsJobsException):
def get_module_name(self):
frame = inspect.curre... | true | true |
f776d481e9ce90d87a880f8251220f8d5d1db07a | 1,635 | py | Python | state-change-localization-classification/slowFast-perceiver/utils/parser.py | EGO4D/hands-and-objects | 76d6ce6af1a9db4007ea24eb315f3f0eaea26bc2 | [
"MIT"
] | 24 | 2021-10-15T20:17:38.000Z | 2022-03-30T18:54:55.000Z | state-change-localization-classification/slowFast-perceiver/utils/parser.py | EGO4D/hands-and-objects | 76d6ce6af1a9db4007ea24eb315f3f0eaea26bc2 | [
"MIT"
] | 1 | 2022-03-09T03:35:42.000Z | 2022-03-10T20:50:24.000Z | state-change-localization-classification/slowFast-perceiver/utils/parser.py | EGO4D/hands-and-objects | 76d6ce6af1a9db4007ea24eb315f3f0eaea26bc2 | [
"MIT"
] | 4 | 2021-11-18T19:22:16.000Z | 2022-03-21T02:51:35.000Z | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
"""Argument parser functions."""
import argparse
import sys
from configs.defaults import get_cfg_defaults
def parse_args():
"""
Parse the following arguments for a default parser for PySlowFast users.
Args:
... | 27.711864 | 77 | 0.633028 |
import argparse
import sys
from configs.defaults import get_cfg_defaults
def parse_args():
parser = argparse.ArgumentParser(
description=("Provide Keyframe localization video training and "
"testing pipeline.")
)
parser.add_argument(
"--cfg",
dest="cfg_file"... | true | true |
f776d515d75efe12e2f23725f21643a7fad08664 | 22,505 | py | Python | tensorflow_graphics/rendering/opengl/math.py | richardrl/graphics | c05ee5b947bc462881968b4a109a9ba59ff8c6a8 | [
"Apache-2.0"
] | 2 | 2021-06-25T15:03:50.000Z | 2021-07-06T12:56:12.000Z | tensorflow_graphics/rendering/opengl/math.py | richardrl/graphics | c05ee5b947bc462881968b4a109a9ba59ff8c6a8 | [
"Apache-2.0"
] | null | null | null | tensorflow_graphics/rendering/opengl/math.py | richardrl/graphics | c05ee5b947bc462881968b4a109a9ba59ff8c6a8 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 The TensorFlow Authors
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 42.223265 | 80 | 0.671095 |
import tensorflow as tf
from tensorflow_graphics.geometry.transformation import look_at
from tensorflow_graphics.math.interpolation import weighted
from tensorflow_graphics.rendering.camera import perspective
from tensorflow_graphics.util import asserts
from tensorflow_graphics.util import export_api
from tensorflow_... | true | true |
f776d68618a74070a0b502f49f70b41a0e978e5f | 1,896 | py | Python | tests/test_state_passing.py | LaudateCorpus1/flink-statefun-tasks | bf12e6aaf3793a6a7d226fe006d9d41a1c6b3577 | [
"Apache-2.0"
] | null | null | null | tests/test_state_passing.py | LaudateCorpus1/flink-statefun-tasks | bf12e6aaf3793a6a7d226fe006d9d41a1c6b3577 | [
"Apache-2.0"
] | null | null | null | tests/test_state_passing.py | LaudateCorpus1/flink-statefun-tasks | bf12e6aaf3793a6a7d226fe006d9d41a1c6b3577 | [
"Apache-2.0"
] | 1 | 2022-01-28T03:32:09.000Z | 2022-01-28T03:32:09.000Z | import unittest
from tests.utils import TestHarness, tasks
_final_state = None
@tasks.bind()
def state_passing_workflow():
return _create_workflow_state.send(initial_state=123) \
.continue_with(_add_two_numbers, 3, 5) \
.continue_with(_update_workflow_state) \
.continue_with(_noop) \
... | 24.623377 | 68 | 0.720464 | import unittest
from tests.utils import TestHarness, tasks
_final_state = None
@tasks.bind()
def state_passing_workflow():
return _create_workflow_state.send(initial_state=123) \
.continue_with(_add_two_numbers, 3, 5) \
.continue_with(_update_workflow_state) \
.continue_with(_noop) \
... | true | true |
f776d6c85cded5351a72a721bf8348d1cd8cf5eb | 727 | py | Python | webapp/apps/taxbrain/urls.py | codekansas/PolicyBrain | 83c459db883536bae70cc78ca92ebdcff554ac2d | [
"MIT"
] | null | null | null | webapp/apps/taxbrain/urls.py | codekansas/PolicyBrain | 83c459db883536bae70cc78ca92ebdcff554ac2d | [
"MIT"
] | null | null | null | webapp/apps/taxbrain/urls.py | codekansas/PolicyBrain | 83c459db883536bae70cc78ca92ebdcff554ac2d | [
"MIT"
] | null | null | null | from django.conf.urls import patterns, include, url
from .views import (personal_results, output_detail, csv_input, csv_output,
pdf_view, edit_personal_results, submit_micro, file_input)
urlpatterns = patterns('',
url(r'^$', personal_results, name='tax_form'),
url(r'^file/$', file_input,... | 40.388889 | 84 | 0.646492 | from django.conf.urls import patterns, include, url
from .views import (personal_results, output_detail, csv_input, csv_output,
pdf_view, edit_personal_results, submit_micro, file_input)
urlpatterns = patterns('',
url(r'^$', personal_results, name='tax_form'),
url(r'^file/$', file_input,... | true | true |
f776dad48e2c1e6feeae589ddaa7d6003a6c22c0 | 5,240 | py | Python | bdd100k/vis/viewer.py | Anthuang/bdd100k | b7e1781317784317e4e715ab325515ade73978a9 | [
"BSD-3-Clause"
] | null | null | null | bdd100k/vis/viewer.py | Anthuang/bdd100k | b7e1781317784317e4e715ab325515ade73978a9 | [
"BSD-3-Clause"
] | null | null | null | bdd100k/vis/viewer.py | Anthuang/bdd100k | b7e1781317784317e4e715ab325515ade73978a9 | [
"BSD-3-Clause"
] | null | null | null | """An offline label visualizer for BDD100K file.
Works for 2D / 3D bounding box, segmentation masks, etc.
"""
import argparse
import concurrent.futures
from typing import Dict
import numpy as np
from scalabel.common.parallel import NPROC
from scalabel.common.typing import NDArrayF64
from scalabel.label.typing import... | 28.02139 | 79 | 0.59771 |
import argparse
import concurrent.futures
from typing import Dict
import numpy as np
from scalabel.common.parallel import NPROC
from scalabel.common.typing import NDArrayF64
from scalabel.label.typing import Label
from scalabel.vis.controller import (
ControllerConfig,
DisplayConfig,
ViewController,
)
fro... | true | true |
f776db2e314f162d7e83d84d7297f88c3b007459 | 42 | py | Python | test/login.py | 252319634/test001 | 261cfe508a914047d94eee03ddc8ffb22e729058 | [
"MIT"
] | null | null | null | test/login.py | 252319634/test001 | 261cfe508a914047d94eee03ddc8ffb22e729058 | [
"MIT"
] | null | null | null | test/login.py | 252319634/test001 | 261cfe508a914047d94eee03ddc8ffb22e729058 | [
"MIT"
] | null | null | null | num1 = 10
num2 = 20
num3 = 300
num4 = 500
| 8.4 | 10 | 0.619048 | num1 = 10
num2 = 20
num3 = 300
num4 = 500
| true | true |
f776dbc1dd8e0ba26dd31ed56ef462b3d09fc606 | 18,936 | py | Python | pytests/gsi/smart_batching.py | couchbase/testrunner | a23e4885fdf86d91b490e91e992e7445e61e9690 | [
"Apache-2.0"
] | 14 | 2015-02-06T02:47:57.000Z | 2020-03-14T15:06:05.000Z | pytests/gsi/smart_batching.py | couchbase/testrunner | a23e4885fdf86d91b490e91e992e7445e61e9690 | [
"Apache-2.0"
] | 3 | 2019-02-27T19:29:11.000Z | 2021-06-02T02:14:27.000Z | pytests/gsi/smart_batching.py | couchbase/testrunner | a23e4885fdf86d91b490e91e992e7445e61e9690 | [
"Apache-2.0"
] | 108 | 2015-03-26T08:58:49.000Z | 2022-03-21T05:21:39.000Z | """smart_batching.py: "This class test smart batching improvemnt for gsi indexer nodes during rebalance. MB-33546"
__author__ = "Hemant Rajput"
__maintainer = "Hemant Rajput"
__email__ = "Hemant.Rajput@couchbase.com"
__git_user__ = "hrajput89"
__created_on__ = "15/09/21 03:45 pm"
"""
import random
import time
from g... | 56.694611 | 118 | 0.60715 | import random
import time
from gsi.base_gsi import BaseSecondaryIndexingTests
from gsi.collections_concurrent_indexes import powerset
from couchbase_helper.query_definitions import QueryDefinition
from membase.api.rest_client import RestHelper
class SmartBatching(BaseSecondaryIndexingTests):
def setUp(self):
... | true | true |
f776dc8d7cd415f22c431c87458ead9a86ad551e | 782 | py | Python | sorts/odd_even_transposition_single_threaded.py | mateuszz0000/Python | 9e2206e5fb5d8570ee1d8b357df38ab61da92672 | [
"MIT"
] | 1 | 2020-06-08T07:03:14.000Z | 2020-06-08T07:03:14.000Z | sorts/odd_even_transposition_single_threaded.py | mateuszz0000/Python | 9e2206e5fb5d8570ee1d8b357df38ab61da92672 | [
"MIT"
] | 3 | 2020-06-08T07:03:15.000Z | 2020-06-08T08:41:22.000Z | sorts/odd_even_transposition_single_threaded.py | mateuszz0000/Python | 9e2206e5fb5d8570ee1d8b357df38ab61da92672 | [
"MIT"
] | null | null | null | """
This is a non-parallelized implementation of odd-even transpostiion sort.
Normally the swaps in each set happen simultaneously, without that the algorithm
is no better than bubble sort.
"""
def OddEvenTransposition(arr):
"""
>>> OddEvenTransposition([5, 4, 3, 2, 1])
[1, 2, 3, 4, 5]
>>> OddEvenTr... | 25.225806 | 80 | 0.558824 |
def OddEvenTransposition(arr):
for i in range(0, len(arr)):
for i in range(i % 2, len(arr) - 1, 2):
if arr[i + 1] < arr[i]:
arr[i], arr[i + 1] = arr[i + 1], arr[i]
return arr
if __name__ == "__main__":
arr = list(range(10, 0, -1))
print(f"Original: {arr}. Sorted:... | true | true |
f776dccedc264ffa23f67bda71522e24854b709c | 452 | py | Python | generix/core/data/statistics.py | K9173A/Generix | 214ac660fd2a03ecf5d999a6cd1f4fb2b47502b4 | [
"MIT"
] | null | null | null | generix/core/data/statistics.py | K9173A/Generix | 214ac660fd2a03ecf5d999a6cd1f4fb2b47502b4 | [
"MIT"
] | null | null | null | generix/core/data/statistics.py | K9173A/Generix | 214ac660fd2a03ecf5d999a6cd1f4fb2b47502b4 | [
"MIT"
] | null | null | null | """
"""
class IterationStatistics:
def __init__(self):
self._cells_counter = {}
@property
def cells_counter(self):
return self._cells_counter
def update(self, cell_id):
"""
Updates cell counter.
:param cell_id: CellId enum (id).
:return: None.
"... | 20.545455 | 45 | 0.553097 | class IterationStatistics:
def __init__(self):
self._cells_counter = {}
@property
def cells_counter(self):
return self._cells_counter
def update(self, cell_id):
try:
self._cells_counter[cell_id] += 1
except KeyError:
self._cells_counter[cell_id] ... | true | true |
f776dea14edf3e533cd164a4be800717620c6eca | 13,142 | py | Python | src/utils/graphs.py | PedroRisquez/c19norge-data | ac38460800d5d311877b949c74444b44a0916575 | [
"MIT"
] | null | null | null | src/utils/graphs.py | PedroRisquez/c19norge-data | ac38460800d5d311877b949c74444b44a0916575 | [
"MIT"
] | 1 | 2021-04-30T07:42:38.000Z | 2021-04-30T07:42:38.000Z | src/utils/graphs.py | PedroRisquez/c19norge-data | ac38460800d5d311877b949c74444b44a0916575 | [
"MIT"
] | 2 | 2021-03-29T10:57:52.000Z | 2021-03-29T13:01:55.000Z | import os
from datetime import date
import altair as alt
import pandas as pd
def tested_lab():
data = "data/tested_lab.csv"
filename = "graphs/tested_lab.png"
if os.path.exists(filename):
os.remove(filename)
df = pd.read_csv(data)
mapping = {
"new_neg": "New (Negative)",
... | 28.947137 | 124 | 0.51849 | import os
from datetime import date
import altair as alt
import pandas as pd
def tested_lab():
data = "data/tested_lab.csv"
filename = "graphs/tested_lab.png"
if os.path.exists(filename):
os.remove(filename)
df = pd.read_csv(data)
mapping = {
"new_neg": "New (Negative)",
... | true | true |
f776dea599d98270122c22a97b2ce49964c0c862 | 7,114 | py | Python | aiosqlite3/utils.py | zeromake/aiosqlite3 | 1a74a062507e2df8f833a70885e69dca0ab3e7e7 | [
"MIT"
] | 20 | 2017-12-12T06:37:27.000Z | 2022-03-24T10:42:22.000Z | aiosqlite3/utils.py | zeromake/aiosqlite3 | 1a74a062507e2df8f833a70885e69dca0ab3e7e7 | [
"MIT"
] | null | null | null | aiosqlite3/utils.py | zeromake/aiosqlite3 | 1a74a062507e2df8f833a70885e69dca0ab3e7e7 | [
"MIT"
] | 3 | 2017-12-13T14:11:12.000Z | 2020-11-16T11:30:37.000Z | """
代理方法工具
"""
import asyncio
import sys
PY_35 = sys.version_info >= (3, 5)
if PY_35:
from collections.abc import Coroutine
BASE = Coroutine
else:
# pragma: no cover
BASE = object
def create_future(loop):
# pragma: no cover
"""Compatibility wrapper for the loop.create_future() call introduce... | 23.172638 | 79 | 0.563396 | import asyncio
import sys
PY_35 = sys.version_info >= (3, 5)
if PY_35:
from collections.abc import Coroutine
BASE = Coroutine
else:
BASE = object
def create_future(loop):
if hasattr(loop, 'create_future'):
return loop.create_future()
return asyncio.Future(loop=loop)
def create_... | true | true |
f776dee16fe83cf5eebb5c1216a3d999d0ff2a2f | 1,545 | py | Python | main/decode-ways-ii/decode-ways-ii.py | EliahKagan/old-practice-snapshot | 1b53897eac6902f8d867c8f154ce2a489abb8133 | [
"0BSD"
] | null | null | null | main/decode-ways-ii/decode-ways-ii.py | EliahKagan/old-practice-snapshot | 1b53897eac6902f8d867c8f154ce2a489abb8133 | [
"0BSD"
] | null | null | null | main/decode-ways-ii/decode-ways-ii.py | EliahKagan/old-practice-snapshot | 1b53897eac6902f8d867c8f154ce2a489abb8133 | [
"0BSD"
] | null | null | null | MOD = 10**9 + 7
class Solution:
def numDecodings(self, s):
"""
:type s: str
:rtype: int
"""
if not s:
# Should be 1, but for a related problem (#91) the leetcode.com
# online judge wanted 0, so I assume that's preferred here too.
return 0
... | 26.186441 | 76 | 0.417476 | MOD = 10**9 + 7
class Solution:
def numDecodings(self, s):
if not s:
return 0
first = s[-1]
far = 1
near = self._narrowWays(first)
for i in range(len(s) - 2, -1, -1):
first, second = s[i], first
far, near = near, ... | true | true |
f776df218cd73f99bdc302e7e8df86abb109f912 | 1,466 | py | Python | setup.py | estampa/pix-plot | 8a68cc324e744c29fab13ff35604baca97b854d4 | [
"MIT"
] | null | null | null | setup.py | estampa/pix-plot | 8a68cc324e744c29fab13ff35604baca97b854d4 | [
"MIT"
] | null | null | null | setup.py | estampa/pix-plot | 8a68cc324e744c29fab13ff35604baca97b854d4 | [
"MIT"
] | null | null | null | from os.path import join, exists, dirname, realpath
from setuptools import setup
import os, sys
# validate python version
if sys.version_info < (3,6):
sys.exit('Sorry, PixPlot requires Python 3.6 or later')
# populate list of all paths in `./pixplot/web`
web = []
dirs = [join('pixplot', 'web'), join('pixplot', 'mod... | 25.719298 | 88 | 0.61869 | from os.path import join, exists, dirname, realpath
from setuptools import setup
import os, sys
if sys.version_info < (3,6):
sys.exit('Sorry, PixPlot requires Python 3.6 or later')
web = []
dirs = [join('pixplot', 'web'), join('pixplot', 'models')]
for i in dirs:
for root, subdirs, files in os.walk(i):
if not... | true | true |
f776df4e91f33c3708960a63576c363d4a0758cb | 1,346 | py | Python | scripts/artifacts/adb_hosts.py | JamieSharpe/ALEAPP | acb06736d772d75c9dc0fd58b9f2a1726e795fb4 | [
"MIT"
] | null | null | null | scripts/artifacts/adb_hosts.py | JamieSharpe/ALEAPP | acb06736d772d75c9dc0fd58b9f2a1726e795fb4 | [
"MIT"
] | null | null | null | scripts/artifacts/adb_hosts.py | JamieSharpe/ALEAPP | acb06736d772d75c9dc0fd58b9f2a1726e795fb4 | [
"MIT"
] | null | null | null | from scripts.plugin_base import ArtefactPlugin
from scripts.ilapfuncs import logfunc, tsv
from scripts import artifact_report
class AdbHostsPlugin(ArtefactPlugin):
"""
"""
def __init__(self):
super().__init__()
self.author = 'Unknown'
self.author_email = ''
se... | 32.047619 | 119 | 0.600297 | from scripts.plugin_base import ArtefactPlugin
from scripts.ilapfuncs import logfunc, tsv
from scripts import artifact_report
class AdbHostsPlugin(ArtefactPlugin):
def __init__(self):
super().__init__()
self.author = 'Unknown'
self.author_email = ''
self.author_url = ''... | true | true |
f776df5a5c7a2a4c170afcb09a12c693988f7db0 | 14,338 | py | Python | tools/include/device_utils.py | nullaus/B2G | 2118ac5c049e9dfe58766723fef45857fc63314a | [
"Apache-2.0"
] | 1 | 2015-02-23T10:15:28.000Z | 2015-02-23T10:15:28.000Z | tools/include/device_utils.py | nullaus/B2G | 2118ac5c049e9dfe58766723fef45857fc63314a | [
"Apache-2.0"
] | null | null | null | tools/include/device_utils.py | nullaus/B2G | 2118ac5c049e9dfe58766723fef45857fc63314a | [
"Apache-2.0"
] | 3 | 2015-02-19T17:05:01.000Z | 2016-09-19T10:22:17.000Z | """Utilities for interacting with a remote device."""
from __future__ import print_function
from __future__ import division
import os
import sys
import re
import subprocess
import textwrap
from time import sleep
def remote_shell(cmd, verbose=True):
"""Run the given command on on the device and return stdout. T... | 37.049096 | 100 | 0.663761 | """Utilities for interacting with a remote device."""
from __future__ import print_function
from __future__ import division
import os
import sys
import re
import subprocess
import textwrap
from time import sleep
def remote_shell(cmd, verbose=True):
"""Run the given command on on the device and return stdout. T... | false | true |
f776e0b33a58ed712051db74c50199aa2aca8416 | 120 | py | Python | src/routes/__init__.py | RohithVikramathithan/flaskPoc1 | a25b6c50ce7cd7684077272f65df4af799395909 | [
"MIT"
] | null | null | null | src/routes/__init__.py | RohithVikramathithan/flaskPoc1 | a25b6c50ce7cd7684077272f65df4af799395909 | [
"MIT"
] | null | null | null | src/routes/__init__.py | RohithVikramathithan/flaskPoc1 | a25b6c50ce7cd7684077272f65df4af799395909 | [
"MIT"
] | null | null | null | from .user import USER_BLUEPRINT
from .learning_history import LEARNER_BLUEPRINT
from .reports import REPORTS_BLUEPRINT
| 30 | 47 | 0.875 | from .user import USER_BLUEPRINT
from .learning_history import LEARNER_BLUEPRINT
from .reports import REPORTS_BLUEPRINT
| true | true |
f776e2d513ea77b20200317b83b9714af6c81580 | 1,461 | py | Python | ironic/tests/unit/cmd/test_status.py | yanndegat/ironic | 8857ec76443dea7778bb9c0d66568304e52495e5 | [
"Apache-2.0"
] | 350 | 2015-01-02T09:35:49.000Z | 2022-03-28T09:25:59.000Z | ironic/tests/unit/cmd/test_status.py | yanndegat/ironic | 8857ec76443dea7778bb9c0d66568304e52495e5 | [
"Apache-2.0"
] | 7 | 2015-05-04T16:12:41.000Z | 2021-08-31T12:27:27.000Z | ironic/tests/unit/cmd/test_status.py | yanndegat/ironic | 8857ec76443dea7778bb9c0d66568304e52495e5 | [
"Apache-2.0"
] | 333 | 2015-01-06T09:09:22.000Z | 2022-02-20T08:11:40.000Z | # Copyright (c) 2018 NEC, Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | 35.634146 | 78 | 0.727584 |
from unittest import mock
from oslo_upgradecheck.upgradecheck import Code
from ironic.cmd import dbsync
from ironic.cmd import status
from ironic.tests.unit.db import base as db_base
class TestUpgradeChecks(db_base.DbTestCase):
def setUp(self):
super(TestUpgradeChecks, self).setUp()
self.cmd =... | true | true |
f776e361f17d0d00e8c0a46d63e7097bd5c3f031 | 9,693 | py | Python | tool/fan.py | xdark21/miner.al | 2788cb630d9f013aec9e9005f4d270b0ff7a8141 | [
"MIT"
] | null | null | null | tool/fan.py | xdark21/miner.al | 2788cb630d9f013aec9e9005f4d270b0ff7a8141 | [
"MIT"
] | null | null | null | tool/fan.py | xdark21/miner.al | 2788cb630d9f013aec9e9005f4d270b0ff7a8141 | [
"MIT"
] | null | null | null | #!/usr/bin/python2.7
# Copyright https://github.com/kovaxalive
from __future__ import print_function
import subprocess, time, sys, os
import argparse, numpy
import curses
parser = argparse.ArgumentParser(
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument('-u', '--update-time',
help="Time... | 27.615385 | 92 | 0.698958 |
from __future__ import print_function
import subprocess, time, sys, os
import argparse, numpy
import curses
parser = argparse.ArgumentParser(
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument('-u', '--update-time',
help="Time between fan adjustments/checks in seconds",type=int, default=1... | true | true |
f776e3a9d9b5bcff3830197f311bc30b61a3e31c | 24 | py | Python | slack_entities/__init__.py | chimplie/slack-entities | 9d0b57550a91de920ff254a108497db5e4209295 | [
"MIT"
] | 3 | 2018-08-18T06:10:36.000Z | 2018-10-29T14:40:08.000Z | slack_entities/__init__.py | chimplie/slack-entities | 9d0b57550a91de920ff254a108497db5e4209295 | [
"MIT"
] | 2 | 2018-08-29T09:48:56.000Z | 2020-05-25T13:12:02.000Z | slack_entities/__init__.py | chimplie/slack-entities | 9d0b57550a91de920ff254a108497db5e4209295 | [
"MIT"
] | null | null | null | name = "slack-entities"
| 12 | 23 | 0.708333 | name = "slack-entities"
| true | true |
f776e45dbbfe03b7fe474c85430762accb9524b2 | 7,635 | py | Python | Davies_etal_GMD_2021/analytical_comparisons/smooth/spherical/free_slip/stokes_trilinear.py | sghelichkhani/G-ADOPT | fc0144a6779b59899151b845a828d5357c36a372 | [
"MIT"
] | 6 | 2021-11-04T02:49:30.000Z | 2022-02-11T10:01:04.000Z | Davies_etal_GMD_2021/analytical_comparisons/smooth/spherical/free_slip/stokes_trilinear.py | sghelichkhani/G-ADOPT | fc0144a6779b59899151b845a828d5357c36a372 | [
"MIT"
] | null | null | null | Davies_etal_GMD_2021/analytical_comparisons/smooth/spherical/free_slip/stokes_trilinear.py | sghelichkhani/G-ADOPT | fc0144a6779b59899151b845a828d5357c36a372 | [
"MIT"
] | null | null | null | from firedrake import *
from firedrake.petsc import PETSc
from mpi4py import MPI # noqa: F401
import sys
import assess
import math
# Set up geometry and key parameters:
rmin, rmax = 1.22, 2.22
k = int(sys.argv[1]) # radial degree
l = int(sys.argv[2]) # spherical harmonic degree
m = int(sys.argv[3]) # spherical har... | 39.765625 | 117 | 0.671906 | from firedrake import *
from firedrake.petsc import PETSc
from mpi4py import MPI import sys
import assess
import math
rmin, rmax = 1.22, 2.22
k = int(sys.argv[1]) l = int(sys.argv[2]) m = int(sys.argv[3]) nlevels = int(sys.argv[4]) nlayers = int(sys.argv[5])
def log(*args):
PETSc.Sys.Print(*args)
def log... | true | true |
f776e47087823852d84e2959425c124b3199764b | 1,216 | py | Python | tests/test_ulcer_index.py | LeeDongGeon1996/Stock.Indicators.Python | b706d00279a8ab5f2794417ddef1bf45e1c48587 | [
"Apache-2.0"
] | 13 | 2021-11-09T13:16:31.000Z | 2022-03-28T00:30:30.000Z | tests/test_ulcer_index.py | LeeDongGeon1996/Stock.Indicators.Python | b706d00279a8ab5f2794417ddef1bf45e1c48587 | [
"Apache-2.0"
] | 162 | 2021-11-03T15:57:17.000Z | 2022-03-30T15:32:20.000Z | tests/test_ulcer_index.py | LeeDongGeon1996/Stock.Indicators.Python | b706d00279a8ab5f2794417ddef1bf45e1c48587 | [
"Apache-2.0"
] | 5 | 2021-11-04T13:35:05.000Z | 2022-01-06T10:27:38.000Z | import pytest
from stock_indicators import indicators
class TestUlcerIndex:
def test_standard(self, quotes):
results = indicators.get_ulcer_index(quotes, 14)
assert 502 == len(results)
assert 489 == len(list(filter(lambda x: x.ui is not None, results)))
r = results... | 32 | 76 | 0.601974 | import pytest
from stock_indicators import indicators
class TestUlcerIndex:
def test_standard(self, quotes):
results = indicators.get_ulcer_index(quotes, 14)
assert 502 == len(results)
assert 489 == len(list(filter(lambda x: x.ui is not None, results)))
r = results... | true | true |
f776e4bd10b701e976f92e445a83d0e89632644b | 135 | py | Python | hdwallet/exceptions.py | ethereum/py-hdwallet | fc4b6b94cd5b5cf663087880f9c18090ec574474 | [
"MIT"
] | 6 | 2019-09-09T19:07:03.000Z | 2021-11-04T14:21:02.000Z | hdwallet/exceptions.py | davesque/py-hdwallet | fc4b6b94cd5b5cf663087880f9c18090ec574474 | [
"MIT"
] | 1 | 2020-02-02T03:31:51.000Z | 2020-02-02T03:31:51.000Z | hdwallet/exceptions.py | davesque/py-hdwallet | fc4b6b94cd5b5cf663087880f9c18090ec574474 | [
"MIT"
] | 5 | 2020-03-06T16:50:22.000Z | 2022-03-28T19:02:43.000Z | class KeyGenerationError(Exception):
"""
Raised when unsuitable values are encountered during key generation.
"""
pass
| 22.5 | 72 | 0.703704 | class KeyGenerationError(Exception):
pass
| true | true |
f776e597538bb01355a60a77056546c8450a182f | 62,647 | py | Python | lib/sqlalchemy/engine/cursor.py | zcattacz/sqlalchemy | 882afe4c3718f741800809003c6c465d835de213 | [
"MIT"
] | null | null | null | lib/sqlalchemy/engine/cursor.py | zcattacz/sqlalchemy | 882afe4c3718f741800809003c6c465d835de213 | [
"MIT"
] | null | null | null | lib/sqlalchemy/engine/cursor.py | zcattacz/sqlalchemy | 882afe4c3718f741800809003c6c465d835de213 | [
"MIT"
] | null | null | null | # engine/cursor.py
# Copyright (C) 2005-2022 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""Define cursor-specific result set constructs including
:class:`.BaseCursorResul... | 35.473952 | 83 | 0.614906 |
from __future__ import annotations
import collections
import functools
import typing
from typing import Any
from typing import cast
from typing import ClassVar
from typing import Dict
from typing import Iterator
from typing import List
from typing import Optional
from typing import Sequence
from typing import Tuple... | true | true |
f776e626dff28b7f92ac919966226df4451a172a | 14,051 | py | Python | nebullvm/api/frontend/torch.py | nebuly-ai/nebullvm | 368286af1b5dc5672f446ce96c912665b3d3720e | [
"Apache-2.0"
] | 821 | 2022-02-21T13:21:24.000Z | 2022-03-31T20:09:21.000Z | nebullvm/api/frontend/torch.py | nebuly-ai/nebullvm | 368286af1b5dc5672f446ce96c912665b3d3720e | [
"Apache-2.0"
] | 21 | 2022-02-22T14:31:07.000Z | 2022-03-31T16:08:14.000Z | nebullvm/api/frontend/torch.py | nebuly-ai/nebullvm | 368286af1b5dc5672f446ce96c912665b3d3720e | [
"Apache-2.0"
] | 36 | 2022-02-21T15:02:59.000Z | 2022-03-24T12:20:00.000Z | import os
import warnings
from pathlib import Path
from tempfile import TemporaryDirectory
from typing import List, Tuple, Dict, Optional, Callable, Union, Sequence
import numpy as np
import torch
from torch.utils.data import DataLoader
from nebullvm.api.frontend.utils import (
check_inputs,
ifnone,
inspe... | 40.727536 | 79 | 0.648922 | import os
import warnings
from pathlib import Path
from tempfile import TemporaryDirectory
from typing import List, Tuple, Dict, Optional, Callable, Union, Sequence
import numpy as np
import torch
from torch.utils.data import DataLoader
from nebullvm.api.frontend.utils import (
check_inputs,
ifnone,
inspe... | true | true |
f776e729471143859177332551256fd88cd8ca86 | 5,332 | py | Python | ixnetwork_restpy/testplatform/sessions/ixnetwork/vport/protocols/ipv6prefixes_c177f4d9bea9094ba2cc6f15470cd1b2.py | Vibaswan/ixnetwork_restpy | 239fedc7050890746cbabd71ea1e91c68d9e5cad | [
"MIT"
] | null | null | null | ixnetwork_restpy/testplatform/sessions/ixnetwork/vport/protocols/ipv6prefixes_c177f4d9bea9094ba2cc6f15470cd1b2.py | Vibaswan/ixnetwork_restpy | 239fedc7050890746cbabd71ea1e91c68d9e5cad | [
"MIT"
] | null | null | null | ixnetwork_restpy/testplatform/sessions/ixnetwork/vport/protocols/ipv6prefixes_c177f4d9bea9094ba2cc6f15470cd1b2.py | Vibaswan/ixnetwork_restpy | 239fedc7050890746cbabd71ea1e91c68d9e5cad | [
"MIT"
] | null | null | null | # MIT LICENSE
#
# Copyright 1997 - 2020 by IXIA Keysight
#
# 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,... | 34.623377 | 166 | 0.645536 | from ixnetwork_restpy.base import Base
from ixnetwork_restpy.files import Files
class Ipv6Prefixes(Base):
__slots__ = ()
_SDM_NAME = 'ipv6Prefixes'
_SDM_ATT_MAP = {
'Age': 'age',
'HostName': 'hostName',
'Ipv6Prefix': 'ipv6Prefix',
'LearnedVia': 'learnedVia',
'LspId... | true | true |
f776e778441db88d610040e248a955ac78302882 | 190 | py | Python | fart/__init__.py | asabellico/jart | 4e755bcea3e45e4f2e5d092d655a223fe6553906 | [
"MIT"
] | 3 | 2019-02-03T17:59:08.000Z | 2019-02-25T09:54:05.000Z | fart/__init__.py | asabellico/jart | 4e755bcea3e45e4f2e5d092d655a223fe6553906 | [
"MIT"
] | null | null | null | fart/__init__.py | asabellico/jart | 4e755bcea3e45e4f2e5d092d655a223fe6553906 | [
"MIT"
] | 1 | 2019-02-20T06:32:04.000Z | 2019-02-20T06:32:04.000Z | # -*- coding: utf-8 -*-
""""""
from fart import metadata
__version__ = metadata.version
__author__ = metadata.authors[0]
__license__ = metadata.license
__copyright__ = metadata.copyright
| 17.272727 | 34 | 0.736842 |
from fart import metadata
__version__ = metadata.version
__author__ = metadata.authors[0]
__license__ = metadata.license
__copyright__ = metadata.copyright
| true | true |
f776e782a0cf9d4fabe7ecc81c6a398abea6aa3f | 8,525 | py | Python | pysal/weights/_contW_binning.py | cubensys/pysal | 8d50990f6e6603ba79ae1a887a20a1e3a0734e51 | [
"MIT",
"BSD-3-Clause"
] | null | null | null | pysal/weights/_contW_binning.py | cubensys/pysal | 8d50990f6e6603ba79ae1a887a20a1e3a0734e51 | [
"MIT",
"BSD-3-Clause"
] | null | null | null | pysal/weights/_contW_binning.py | cubensys/pysal | 8d50990f6e6603ba79ae1a887a20a1e3a0734e51 | [
"MIT",
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python
#import math
import pysal
from pysal.cg.standalone import get_shared_segments, get_bounding_box
__author__ = "Sergio J. Rey <srey@asu.edu> "
__all__ = ["QUEEN", "ROOK", "ContiguityWeights_binning",
"ContiguityWeightsPolygons"]
import time
# delta to get buckets right
DELTA = 0.000001
Q... | 34.795918 | 81 | 0.485982 | import pysal
from pysal.cg.standalone import get_shared_segments, get_bounding_box
__author__ = "Sergio J. Rey <srey@asu.edu> "
__all__ = ["QUEEN", "ROOK", "ContiguityWeights_binning",
"ContiguityWeightsPolygons"]
import time
DELTA = 0.000001
QUEEN = 1
ROOK = 2
BUCK_SM = 8
BUCK_LG = 80
SHP_SMALL = 1000... | true | true |
f776ea1dab0ad7c1b83aabcf106c91d24a414df1 | 5,066 | py | Python | orchestrator/common/interfaces/maja_xml_input_angles.py | spacebel/MAJA | 3e5d20bc9c744c610e608cfcf1f4c5c738d4de9e | [
"Apache-2.0"
] | 57 | 2020-09-30T08:51:22.000Z | 2021-12-19T20:28:30.000Z | orchestrator/common/interfaces/maja_xml_input_angles.py | spacebel/MAJA | 3e5d20bc9c744c610e608cfcf1f4c5c738d4de9e | [
"Apache-2.0"
] | 34 | 2020-09-29T21:27:22.000Z | 2022-02-03T09:56:45.000Z | orchestrator/common/interfaces/maja_xml_input_angles.py | spacebel/MAJA | 3e5d20bc9c744c610e608cfcf1f4c5c738d4de9e | [
"Apache-2.0"
] | 14 | 2020-10-11T13:17:59.000Z | 2022-03-09T15:58:19.000Z | # -*- coding: utf-8 -*-
#
# Copyright (C) 2020 Centre National d'Etudes Spatiales (CNES)
#
# 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
#
# ... | 42.571429 | 210 | 0.600869 | #
# 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
# distributed under t... | true | true |
f776ea4683bf4937982f2e933d24b177ef645922 | 2,777 | py | Python | homeassistant/components/esphome/sensor.py | kdschlosser/home-assistant | a94a24f6f83508642e220fadf2799789dc32a25b | [
"Apache-2.0"
] | 3 | 2019-01-24T20:32:14.000Z | 2022-03-22T14:25:48.000Z | homeassistant/components/esphome/sensor.py | kdschlosser/home-assistant | a94a24f6f83508642e220fadf2799789dc32a25b | [
"Apache-2.0"
] | 6 | 2021-02-08T21:02:40.000Z | 2022-03-12T00:52:16.000Z | homeassistant/components/esphome/sensor.py | kdschlosser/home-assistant | a94a24f6f83508642e220fadf2799789dc32a25b | [
"Apache-2.0"
] | 1 | 2020-01-09T12:36:16.000Z | 2020-01-09T12:36:16.000Z | """Support for esphome sensors."""
import logging
import math
from typing import Optional, TYPE_CHECKING
from homeassistant.components.esphome import EsphomeEntity, \
platform_async_setup_entry
from homeassistant.config_entries import ConfigEntry
from homeassistant.helpers.typing import HomeAssistantType
if TYPE_... | 29.231579 | 76 | 0.670508 | import logging
import math
from typing import Optional, TYPE_CHECKING
from homeassistant.components.esphome import EsphomeEntity, \
platform_async_setup_entry
from homeassistant.config_entries import ConfigEntry
from homeassistant.helpers.typing import HomeAssistantType
if TYPE_CHECKING:
from aioesphomeap... | true | true |
f776ea61aa9e34ddd95efa63fc49a19d82c9c74e | 5,184 | py | Python | patch/cfs/tools/gen_app_code/app_code_configs.py | cypher-me/HAS-Qualifier-Challenges | bb795303716155dad4a930880a58fecb5d9b50c5 | [
"MIT"
] | 75 | 2020-07-20T20:54:00.000Z | 2022-03-09T09:18:37.000Z | patch/cfs/tools/gen_app_code/app_code_configs.py | cypher-me/HAS-Qualifier-Challenges | bb795303716155dad4a930880a58fecb5d9b50c5 | [
"MIT"
] | 3 | 2020-09-13T00:46:49.000Z | 2021-07-06T16:18:22.000Z | patch/cfs/tools/gen_app_code/app_code_configs.py | cypher-me/HAS-Qualifier-Challenges | bb795303716155dad4a930880a58fecb5d9b50c5 | [
"MIT"
] | 14 | 2020-07-22T16:34:51.000Z | 2021-09-13T12:19:59.000Z | #========================================================================================
# File: app_code_configs.py
# Author: Tam Ngo/JSC
# Date: 2012-02-22
#========================================================================================
import os, sys, time, datetime, app_utils
#===========... | 30.494118 | 94 | 0.383102 |
import os, sys, time, datetime, app_utils
g_Date = ""
g_Owner = "unk"
g_Mission = "unk"
g_OutDir = "."
g_Apps = []
g_Tbls = []
g_Subdirs2 = ['for_build', 'mission_inc', 'platform_inc', 'src', 'tables', 'unit_test']
def parse_configs():
global g_OutDir, g_Mission, g_Date, g_Owner, g_A... | false | true |
f776eac9bc33a05a3ba6ce2992209f8fc4eabe4b | 657 | py | Python | todo/manage.py | gelloguiam/togo | 38440a6f832abadaab3d6d6a10d35d28a39f6a25 | [
"MIT"
] | null | null | null | todo/manage.py | gelloguiam/togo | 38440a6f832abadaab3d6d6a10d35d28a39f6a25 | [
"MIT"
] | null | null | null | todo/manage.py | gelloguiam/togo | 38440a6f832abadaab3d6d6a10d35d28a39f6a25 | [
"MIT"
] | null | null | null | #../env/bin python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'togo.settings')
try:
from django.core.management import execute_from_command_line
except ImportErro... | 28.565217 | 73 | 0.675799 | import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'togo.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
... | true | true |
f776eb56ad0449986d069841bfb4ac8c24aac7eb | 2,801 | py | Python | tests/contrib/operators/test_azure_cosmos_insertdocument_operator.py | InigoSJ/airflow | 8b97a387dc30d8c88390d500ec99333798c20f1c | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 15 | 2017-04-06T09:01:50.000Z | 2021-10-02T13:54:31.000Z | tests/contrib/operators/test_azure_cosmos_insertdocument_operator.py | InigoSJ/airflow | 8b97a387dc30d8c88390d500ec99333798c20f1c | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 26 | 2019-08-05T13:44:11.000Z | 2022-03-30T10:06:18.000Z | tests/contrib/operators/test_azure_cosmos_insertdocument_operator.py | InigoSJ/airflow | 8b97a387dc30d8c88390d500ec99333798c20f1c | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 21 | 2017-08-20T03:01:05.000Z | 2021-09-07T06:47:51.000Z | # -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... | 37.346667 | 93 | 0.693681 |
import json
import unittest
import uuid
from airflow.contrib.operators.azure_cosmos_operator import AzureCosmosInsertDocumentOperator
from airflow.models import Connection
from airflow.utils import db
from tests.compat import mock
class TestAzureCosmosDbHook(unittest.TestCase):
def setUp(self):
... | true | true |
f776eb5c267727f84c7cabcd5dbecb70a3894123 | 806 | py | Python | manage.py | marceloBarrand/fase4-gr17 | 46b4920c220dd035a9c2c722064d3f98a5b7a4ae | [
"MIT"
] | 5 | 2020-03-26T14:05:27.000Z | 2021-06-23T09:52:54.000Z | manage.py | marceloBarrand/fase4-gr17 | 46b4920c220dd035a9c2c722064d3f98a5b7a4ae | [
"MIT"
] | 7 | 2020-06-06T01:33:42.000Z | 2022-01-13T02:21:42.000Z | manage.py | marceloBarrand/fase4-gr17 | 46b4920c220dd035a9c2c722064d3f98a5b7a4ae | [
"MIT"
] | 6 | 2020-03-26T15:25:08.000Z | 2020-12-18T09:48:36.000Z | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "katacoda.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure that the... | 35.043478 | 77 | 0.64268 | import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "katacoda.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
try:
import django
except ImportError:
... | true | true |
f776ebfd4683b3c49c00db6b7f92a0307d32a714 | 47,860 | py | Python | isi_sdk_7_2/isi_sdk_7_2/models/nfs_export.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 24 | 2018-06-22T14:13:23.000Z | 2022-03-23T01:21:26.000Z | isi_sdk_7_2/isi_sdk_7_2/models/nfs_export.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 46 | 2018-04-30T13:28:22.000Z | 2022-03-21T21:11:07.000Z | isi_sdk_7_2/isi_sdk_7_2/models/nfs_export.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
"""
import pprint
import re # noqa: F401
import six
from isi_sdk_7_2.models.nfs_expor... | 33.236111 | 1,061 | 0.641141 |
import pprint
import re
import six
from isi_sdk_7_2.models.nfs_export_map_all import NfsExportMapAll
class NfsExport(object):
swagger_types = {
'all_dirs': 'bool',
'block_size': 'int',
'can_set_time': 'bool',
'case_insensitive': 'bool',
'case_preserving': 'bool',
... | true | true |
f776ec18b69c6166c178322de2dfcb3653d1be20 | 6,039 | py | Python | disvae/training.py | jnsrch/disentangling-vae-cwt | 0e927bdcd3d149cadb30aa107331f0c071138c41 | [
"MIT"
] | null | null | null | disvae/training.py | jnsrch/disentangling-vae-cwt | 0e927bdcd3d149cadb30aa107331f0c071138c41 | [
"MIT"
] | null | null | null | disvae/training.py | jnsrch/disentangling-vae-cwt | 0e927bdcd3d149cadb30aa107331f0c071138c41 | [
"MIT"
] | null | null | null | import imageio
import logging
import os
from timeit import default_timer
from collections import defaultdict
from utils.datasets import DATASETS_DICT
from tqdm import trange
import torch
from torch.nn import functional as F
from disvae.utils.modelIO import save_model
TRAIN_LOSSES_LOGFILE = "train_losses.log"
clas... | 30.346734 | 96 | 0.593641 | import imageio
import logging
import os
from timeit import default_timer
from collections import defaultdict
from utils.datasets import DATASETS_DICT
from tqdm import trange
import torch
from torch.nn import functional as F
from disvae.utils.modelIO import save_model
TRAIN_LOSSES_LOGFILE = "train_losses.log"
clas... | true | true |
f776ec28fbc5f97e1aa696698b9913c659242d3e | 1,230 | py | Python | mysite/polls/migrations/0001_initial.py | Bimosatriyo/django-mysite | 9555edbb56eb9bdb066fc25da52b8be76b8db3e5 | [
"BSD-2-Clause"
] | null | null | null | mysite/polls/migrations/0001_initial.py | Bimosatriyo/django-mysite | 9555edbb56eb9bdb066fc25da52b8be76b8db3e5 | [
"BSD-2-Clause"
] | null | null | null | mysite/polls/migrations/0001_initial.py | Bimosatriyo/django-mysite | 9555edbb56eb9bdb066fc25da52b8be76b8db3e5 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2017-11-08 13:01
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.Crea... | 31.538462 | 114 | 0.585366 | from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Choice',
fields=[
... | true | true |
f776ec3121057c0c7c11d191434a35f5efcf526b | 4,298 | py | Python | pytorch_pretrained_bert/optimization_fp16.py | shubhamphal/WebQA_Baseline | e1b3ea50464ae276d614316fe44ca70545ae1143 | [
"Apache-2.0"
] | 8 | 2021-09-17T22:42:33.000Z | 2022-03-08T02:16:57.000Z | pytorch_pretrained_bert/optimization_fp16.py | shubhamphal/WebQA_Baseline | e1b3ea50464ae276d614316fe44ca70545ae1143 | [
"Apache-2.0"
] | 6 | 2021-09-22T09:58:45.000Z | 2022-03-25T01:35:52.000Z | pytorch_pretrained_bert/optimization_fp16.py | shubhamphal/WebQA_Baseline | e1b3ea50464ae276d614316fe44ca70545ae1143 | [
"Apache-2.0"
] | 6 | 2021-09-26T03:57:18.000Z | 2022-03-27T19:35:39.000Z | # coding=utf-8
"""PyTorch optimization for BERT model."""
from apex.fp16_utils import FP16_Optimizer
class FP16_Optimizer_State(FP16_Optimizer):
def __init__(self,
init_optimizer,
static_loss_scale=1.0,
dynamic_loss_scale=False,
dynam... | 53.061728 | 118 | 0.643555 |
from apex.fp16_utils import FP16_Optimizer
class FP16_Optimizer_State(FP16_Optimizer):
def __init__(self,
init_optimizer,
static_loss_scale=1.0,
dynamic_loss_scale=False,
dynamic_loss_args=None,
verbose=True):
... | true | true |
f776ecb0ae2bc88f9e1d0086935cdc5aee608148 | 6,735 | py | Python | ClusterGivenGraph/main.py | alaaib/NetworkAnalysis | bf45d616b3a2f40cec3879515fe8ecdbe19b0537 | [
"MIT"
] | null | null | null | ClusterGivenGraph/main.py | alaaib/NetworkAnalysis | bf45d616b3a2f40cec3879515fe8ecdbe19b0537 | [
"MIT"
] | null | null | null | ClusterGivenGraph/main.py | alaaib/NetworkAnalysis | bf45d616b3a2f40cec3879515fe8ecdbe19b0537 | [
"MIT"
] | null | null | null | import datetime
import sys
import time
import os
from ClusterGivenGraph.Graph import Graph
from ClusterGivenGraph.GraphHelper import get_graph_based_degree_sequence, create_motifs, export_to_pajek, \
motifs_main_calculation, calc_z_score, export_to_pajek_by_z_score
import networkx as nx
from matplotlib import pypl... | 36.803279 | 108 | 0.630141 | import datetime
import sys
import time
import os
from ClusterGivenGraph.Graph import Graph
from ClusterGivenGraph.GraphHelper import get_graph_based_degree_sequence, create_motifs, export_to_pajek, \
motifs_main_calculation, calc_z_score, export_to_pajek_by_z_score
import networkx as nx
from matplotlib import pypl... | true | true |
f776ed33106a643f23ba0af276a9f2238ac3237a | 68,219 | py | Python | jet_django/deps/rest_framework/fields.py | lukejamison/jet-dasboard | 5dce66b6ea2f107d7120e5e0256346d2d3bc8ed9 | [
"MIT"
] | 193 | 2018-08-27T06:10:48.000Z | 2022-03-08T13:04:55.000Z | jet_django/deps/rest_framework/fields.py | lukejamison/jet-dasboard | 5dce66b6ea2f107d7120e5e0256346d2d3bc8ed9 | [
"MIT"
] | 23 | 2018-10-21T15:05:41.000Z | 2020-12-20T15:18:58.000Z | jet_django/deps/rest_framework/fields.py | lukejamison/jet-dasboard | 5dce66b6ea2f107d7120e5e0256346d2d3bc8ed9 | [
"MIT"
] | 38 | 2018-10-31T16:19:25.000Z | 2022-02-10T05:08:24.000Z | from __future__ import unicode_literals
import collections
import copy
import datetime
import decimal
import functools
import inspect
import re
import uuid
from collections import OrderedDict
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist
from django.core.exceptions import Vali... | 35.942571 | 127 | 0.614799 | from __future__ import unicode_literals
import collections
import copy
import datetime
import decimal
import functools
import inspect
import re
import uuid
from collections import OrderedDict
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist
from django.core.exceptions import Vali... | true | true |
f776eed15c787817e90b80236661d31ba88a25fe | 3,013 | py | Python | huaweicloud-sdk-ddm/huaweicloudsdkddm/v1/model/delete_user_response.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 64 | 2020-06-12T07:05:07.000Z | 2022-03-30T03:32:50.000Z | huaweicloud-sdk-ddm/huaweicloudsdkddm/v1/model/delete_user_response.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 11 | 2020-07-06T07:56:54.000Z | 2022-01-11T11:14:40.000Z | huaweicloud-sdk-ddm/huaweicloudsdkddm/v1/model/delete_user_response.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 24 | 2020-06-08T11:42:13.000Z | 2022-03-04T06:44:08.000Z | # coding: utf-8
import re
import six
from huaweicloudsdkcore.sdk_response import SdkResponse
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class DeleteUserResponse(SdkResponse):
"""
Attributes:
openapi_types (dict): The key is attribute name
... | 26.2 | 79 | 0.543976 |
import re
import six
from huaweicloudsdkcore.sdk_response import SdkResponse
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class DeleteUserResponse(SdkResponse):
sensitive_list = []
openapi_types = {
'name': 'str'
}
attribute_map = {
'name': 'name'
... | true | true |
f776eef6cd7e5dbdf729ee5376888e4466bb353c | 7,114 | py | Python | backend/empty_rice_28410/settings.py | crowdbotics-apps/ula-28410 | 8c022c3350871ace49f6ec50b3735c4904c9e6fb | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/empty_rice_28410/settings.py | crowdbotics-apps/ula-28410 | 8c022c3350871ace49f6ec50b3735c4904c9e6fb | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/empty_rice_28410/settings.py | crowdbotics-apps/ula-28410 | 8c022c3350871ace49f6ec50b3735c4904c9e6fb | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | """
Django settings for empty_rice_28410 project.
Generated by 'django-admin startproject' using Django 2.2.2.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
imp... | 28.918699 | 112 | 0.728985 |
import os
import environ
import logging
env = environ.Env()
DEBUG = env.bool("DEBUG", default=False)
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Quick-start development settings - unsuitable for production
# See h... | true | true |
f776ef033e06022ed9d61f4d45948cadece0a47d | 26,069 | py | Python | MangaTaggerLib/MangaTaggerLib.py | Inpacchi/Manga-Tagger | d459df30dab06afc28b9c32d521aaa97dea388e9 | [
"MIT"
] | 106 | 2020-12-08T05:28:52.000Z | 2022-03-11T19:23:50.000Z | MangaTaggerLib/MangaTaggerLib.py | Inpacchi/Manga-Tagger | d459df30dab06afc28b9c32d521aaa97dea388e9 | [
"MIT"
] | 23 | 2020-12-08T07:51:05.000Z | 2021-12-24T03:01:14.000Z | MangaTaggerLib/MangaTaggerLib.py | Inpacchi/Manga-Tagger | d459df30dab06afc28b9c32d521aaa97dea388e9 | [
"MIT"
] | 9 | 2020-12-09T18:07:59.000Z | 2022-02-23T03:52:37.000Z | import logging
import time
from datetime import datetime
from os import path
from pathlib import Path
from requests.exceptions import ConnectionError
from xml.etree.ElementTree import SubElement, Element, Comment, tostring
from xml.dom.minidom import parseString
from zipfile import ZipFile
from jikanpy.excep... | 43.232172 | 121 | 0.635851 | import logging
import time
from datetime import datetime
from os import path
from pathlib import Path
from requests.exceptions import ConnectionError
from xml.etree.ElementTree import SubElement, Element, Comment, tostring
from xml.dom.minidom import parseString
from zipfile import ZipFile
from jikanpy.excep... | true | true |
f776f018b8e60369ec884d45e45675ba36336ca3 | 2,668 | py | Python | VQAloss.py | lidq92/MDTVSFA | 22f49a9c1b2faec4a643c92b0f6b69297f4e4121 | [
"MIT"
] | 48 | 2020-11-09T02:53:23.000Z | 2021-12-10T06:12:30.000Z | VQAloss.py | lidq92/MDTVSFA | 22f49a9c1b2faec4a643c92b0f6b69297f4e4121 | [
"MIT"
] | 13 | 2020-12-08T08:41:13.000Z | 2021-09-24T07:27:14.000Z | VQAloss.py | lidq92/MDTVSFA | 22f49a9c1b2faec4a643c92b0f6b69297f4e4121 | [
"MIT"
] | 12 | 2020-11-08T04:03:54.000Z | 2021-09-24T02:03:10.000Z | import torch
import torch.nn as nn
import torch.nn.functional as F
class VQALoss(nn.Module):
def __init__(self, scale, loss_type='mixed', m=None):
super(VQALoss, self).__init__()
self.loss_type = loss_type
self.scale = scale
self.m = m #
def forward(self, y_pred, y):
r... | 49.407407 | 150 | 0.594453 | import torch
import torch.nn as nn
import torch.nn.functional as F
class VQALoss(nn.Module):
def __init__(self, scale, loss_type='mixed', m=None):
super(VQALoss, self).__init__()
self.loss_type = loss_type
self.scale = scale
self.m = m
def forward(self, y_pred, y):
rel... | true | true |
f776f0269ac47fe74e1761b2c4a43d07bb2fb9a0 | 2,911 | py | Python | airbyte-integrations/connectors/source-microsoft-teams/source_microsoft_teams/source.py | DominusKelvin/airbyte | 355c798572b89f11bf2f6eafe7e086bf97d5c8ff | [
"MIT"
] | null | null | null | airbyte-integrations/connectors/source-microsoft-teams/source_microsoft_teams/source.py | DominusKelvin/airbyte | 355c798572b89f11bf2f6eafe7e086bf97d5c8ff | [
"MIT"
] | null | null | null | airbyte-integrations/connectors/source-microsoft-teams/source_microsoft_teams/source.py | DominusKelvin/airbyte | 355c798572b89f11bf2f6eafe7e086bf97d5c8ff | [
"MIT"
] | null | null | null | """
MIT License
Copyright (c) 2020 Airbyte
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, distr... | 39.876712 | 113 | 0.721402 |
import json
from datetime import datetime
from typing import Dict, Generator
import requests
from airbyte_protocol import AirbyteCatalog, AirbyteMessage, AirbyteRecordMessage, ConfiguredAirbyteCatalog, Type
from base_python import AirbyteLogger, BaseSource
from .client import Client
class SourceMicrosoftTeams(Base... | true | true |
f776f02fe91c3375a66bf5f24aea570b2144271a | 10,428 | py | Python | mmwave/dsp/doppler_processing.py | 7FM/OpenRadar | d90eea23feb062830dd71b00064f06f70ba6783c | [
"Apache-2.0"
] | 2 | 2021-05-05T14:41:33.000Z | 2021-06-18T05:48:30.000Z | mmwave/dsp/doppler_processing.py | 7FM/OpenRadar | d90eea23feb062830dd71b00064f06f70ba6783c | [
"Apache-2.0"
] | null | null | null | mmwave/dsp/doppler_processing.py | 7FM/OpenRadar | d90eea23feb062830dd71b00064f06f70ba6783c | [
"Apache-2.0"
] | 1 | 2021-07-07T09:46:25.000Z | 2021-07-07T09:46:25.000Z | # Copyright 2019 The OpenRadar Authors. All Rights Reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law... | 49.188679 | 125 | 0.685462 |
import numpy as np
from numba import njit, jit
from . import compensation
from . import utils
def doppler_resolution(band_width, start_freq_const=77, ramp_end_time=62, idle_time_const=100, num_loops_per_frame=128,
num_tx_antennas=3):
light_speed_meter_per_sec = 299792458
center_frequ... | true | true |
f776f106798acb3d4d48b119cf0b567881f70159 | 2,746 | py | Python | xknx/remote_value/remote_value_datetime.py | spacegaier/xknx | 2c2420670da88fea386d573f78a78c5a342186e9 | [
"MIT"
] | null | null | null | xknx/remote_value/remote_value_datetime.py | spacegaier/xknx | 2c2420670da88fea386d573f78a78c5a342186e9 | [
"MIT"
] | null | null | null | xknx/remote_value/remote_value_datetime.py | spacegaier/xknx | 2c2420670da88fea386d573f78a78c5a342186e9 | [
"MIT"
] | null | null | null | """
Module for managing a remote date and time values.
DPT 10.001, 11.001 and 19.001
"""
from enum import Enum
import time
from typing import TYPE_CHECKING, List, Optional, Type, Union
from xknx.dpt import DPTArray, DPTBinary, DPTDate, DPTDateTime, DPTTime
from xknx.exceptions import ConversionError
from .remote_val... | 32.305882 | 94 | 0.638383 | from enum import Enum
import time
from typing import TYPE_CHECKING, List, Optional, Type, Union
from xknx.dpt import DPTArray, DPTBinary, DPTDate, DPTDateTime, DPTTime
from xknx.exceptions import ConversionError
from .remote_value import AsyncCallbackType, RemoteValue
if TYPE_CHECKING:
from xknx.telegram.address... | true | true |
f776f2090bdfd5281c6d7f88d3936e5aa994b81e | 12,789 | py | Python | psp/main_gcp.py | amckenna41/CDBLSTM_PSP | d4e5d874af65c1264c3a459ecad19e71610d1f82 | [
"MIT"
] | 1 | 2021-05-06T09:48:45.000Z | 2021-05-06T09:48:45.000Z | psp/main_gcp.py | amckenna41/CDBLSTM_PSP | d4e5d874af65c1264c3a459ecad19e71610d1f82 | [
"MIT"
] | null | null | null | psp/main_gcp.py | amckenna41/CDBLSTM_PSP | d4e5d874af65c1264c3a459ecad19e71610d1f82 | [
"MIT"
] | null | null | null | ################################################################################
##### Entry script for psp_gcp dir for training on Google Cloud Platform #####
################################################################################
#import required modules and dependancies
import tensorflow as tf
import arg... | 44.40625 | 133 | 0.701697 |
import tensorflow as tf
import argparse
from tensorflow.keras.models import Model
from tensorflow.keras.layers import Bidirectional, LSTM, Input, Conv1D, \
Embedding, Dense, Dropout, Activation, Concatenate, Reshape,MaxPooling1D, Convolution1D,BatchNormalization
from tensorflow.keras.optimizers import Adam
from t... | true | true |
f776f37aef8afa3dbf77c9a165b95f3b86b33279 | 1,375 | py | Python | tests/tracer/test_filters.py | mbmblbelt/dd-trace-py | 906fb7fa91d0ed59d263df74e14aacc8b2d70251 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | tests/tracer/test_filters.py | mbmblbelt/dd-trace-py | 906fb7fa91d0ed59d263df74e14aacc8b2d70251 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | tests/tracer/test_filters.py | mbmblbelt/dd-trace-py | 906fb7fa91d0ed59d263df74e14aacc8b2d70251 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | from unittest import TestCase
from ddtrace.ext.http import URL
from ddtrace.filters import FilterRequestsOnUrl
from ddtrace.span import Span
class FilterRequestOnUrlTests(TestCase):
def test_is_match(self):
span = Span(name="Name", tracer=None)
span.set_tag(URL, r"http://example.com")
fil... | 38.194444 | 108 | 0.664727 | from unittest import TestCase
from ddtrace.ext.http import URL
from ddtrace.filters import FilterRequestsOnUrl
from ddtrace.span import Span
class FilterRequestOnUrlTests(TestCase):
def test_is_match(self):
span = Span(name="Name", tracer=None)
span.set_tag(URL, r"http://example.com")
fil... | true | true |
f776f380682dccad1010af6ca6b78136df5f704d | 1,071 | py | Python | tradition/svm.py | susht3/Text_Mutil_Classification_keras | 82e43bec29588c620a731323c5bf95c50c94c119 | [
"MIT"
] | null | null | null | tradition/svm.py | susht3/Text_Mutil_Classification_keras | 82e43bec29588c620a731323c5bf95c50c94c119 | [
"MIT"
] | null | null | null | tradition/svm.py | susht3/Text_Mutil_Classification_keras | 82e43bec29588c620a731323c5bf95c50c94c119 | [
"MIT"
] | null | null | null | #coding=utf-8
from sklearn import metrics
from sklearn import cross_validation
from sklearn.svm import SVC
from sklearn.multiclass import OneVsRestClassifier
from sklearn.preprocessing import MultiLabelBinarizer
import numpy as np
from numpy import random
X=np.arange(15).reshape(5,3)
y=np.arange(5)
Y_1 = np.arange(5)
... | 28.184211 | 113 | 0.743231 | from sklearn import metrics
from sklearn import cross_validation
from sklearn.svm import SVC
from sklearn.multiclass import OneVsRestClassifier
from sklearn.preprocessing import MultiLabelBinarizer
import numpy as np
from numpy import random
X=np.arange(15).reshape(5,3)
y=np.arange(5)
Y_1 = np.arange(5)
random.shuffle... | false | true |
f776f3f80d9c85bddb63005fcb8f622fd0a42c20 | 1,609 | py | Python | covid19/risikogebiete.py | easystef/covid-analysis | 42a07844115c8751e95428741d8ad96f3fb805be | [
"MIT"
] | null | null | null | covid19/risikogebiete.py | easystef/covid-analysis | 42a07844115c8751e95428741d8ad96f3fb805be | [
"MIT"
] | null | null | null | covid19/risikogebiete.py | easystef/covid-analysis | 42a07844115c8751e95428741d8ad96f3fb805be | [
"MIT"
] | null | null | null | from bs4 import BeautifulSoup
import requests
RKI_URL = 'https://www.rki.de/DE/Content/InfAZ/N/Neuartiges_Coronavirus/Risikogebiete_neu.html'
# THIS CODE IS NOT USED YET BY THE APPLICATION!!!
def main():
rki = requests.get(RKI_URL)
soup = BeautifulSoup(rki.text, 'html.parser')
main_div = soup.find('div... | 23.318841 | 120 | 0.577377 | from bs4 import BeautifulSoup
import requests
RKI_URL = 'https://www.rki.de/DE/Content/InfAZ/N/Neuartiges_Coronavirus/Risikogebiete_neu.html'
def main():
rki = requests.get(RKI_URL)
soup = BeautifulSoup(rki.text, 'html.parser')
main_div = soup.find('div', {'id': 'main'})
countries = []
line_i... | true | true |
f776f45e8f4ad6d5a18090acc91b36b536cdf592 | 751 | py | Python | alipay/aop/api/response/AlipayOpenPublicAccountResetResponse.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/response/AlipayOpenPublicAccountResetResponse.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/response/AlipayOpenPublicAccountResetResponse.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
class AlipayOpenPublicAccountResetResponse(AlipayResponse):
def __init__(self):
super(AlipayOpenPublicAccountResetResponse, self).__init__()
self._agreement_id = None
... | 28.884615 | 109 | 0.728362 | import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
class AlipayOpenPublicAccountResetResponse(AlipayResponse):
def __init__(self):
super(AlipayOpenPublicAccountResetResponse, self).__init__()
self._agreement_id = None
@property
def agreement_id(self):
... | true | true |
f776f4b637867543b842bdbc4a110debcdecb8c3 | 1,077 | py | Python | student_sys/student/models.py | the5fire/student_house | 9b8a16f6b175883ca17a205dda05c7e75c3ec09f | [
"MIT"
] | null | null | null | student_sys/student/models.py | the5fire/student_house | 9b8a16f6b175883ca17a205dda05c7e75c3ec09f | [
"MIT"
] | null | null | null | student_sys/student/models.py | the5fire/student_house | 9b8a16f6b175883ca17a205dda05c7e75c3ec09f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models
class Student(models.Model):
SEX_ITEMS = [
(1, '男'),
(2, '女'),
(0, '未知'),
]
STATUS_ITEMS = [
(0, '申请'),
(1, '通过'),
(2, '拒绝'),
]
name = models.CharField(max_... | 28.342105 | 95 | 0.63974 | from __future__ import unicode_literals
from django.db import models
class Student(models.Model):
SEX_ITEMS = [
(1, '男'),
(2, '女'),
(0, '未知'),
]
STATUS_ITEMS = [
(0, '申请'),
(1, '通过'),
(2, '拒绝'),
]
name = models.CharField(max_length=128, verbose_name... | true | true |
f776f538bbc0be167f51ef1460b4b9f41515c52f | 164 | py | Python | shadowsocks_manager/dynamicmethod/tests.py | alexzhangs/shadowsocks-manager | 211be82a796ee124075687b99c3af5018d6cca2c | [
"MIT"
] | 5 | 2019-09-26T10:47:12.000Z | 2022-03-31T10:33:27.000Z | shadowsocks_manager/dynamicmethod/tests.py | alexzhangs/shadowsocks-manager | 211be82a796ee124075687b99c3af5018d6cca2c | [
"MIT"
] | 4 | 2019-09-26T10:53:53.000Z | 2021-04-03T18:14:19.000Z | shadowsocks_manager/singleton/tests.py | alexzhangs/shadowsocks-manager | 211be82a796ee124075687b99c3af5018d6cca2c | [
"MIT"
] | 1 | 2021-03-30T07:25:27.000Z | 2021-03-30T07:25:27.000Z | # -*- coding: utf-8 -*-
# py2.7 and py3 compatibility imports
from __future__ import unicode_literals
from django.test import TestCase
# Create your tests here.
| 18.222222 | 39 | 0.75 |
from __future__ import unicode_literals
from django.test import TestCase
| true | true |
f776f7431837e78386f678eac8b3fd4c948bdd0e | 2,828 | py | Python | dev.py | oraluben/pyperformance | 74acfa5fbf801ce79fdadc9e92355c99460e91e4 | [
"MIT"
] | 255 | 2016-08-27T05:38:56.000Z | 2019-05-27T16:15:38.000Z | dev.py | oraluben/pyperformance | 74acfa5fbf801ce79fdadc9e92355c99460e91e4 | [
"MIT"
] | 43 | 2016-08-30T15:22:01.000Z | 2019-05-24T10:59:54.000Z | dev.py | oraluben/pyperformance | 74acfa5fbf801ce79fdadc9e92355c99460e91e4 | [
"MIT"
] | 55 | 2016-08-30T15:19:45.000Z | 2019-05-20T12:41:02.000Z | # A script for running pyperformance out of the repo in dev-mode.
import os.path
import sys
REPO_ROOT = os.path.dirname(os.path.abspath(__file__))
VENVS = os.path.join(REPO_ROOT, '.venvs')
def resolve_venv_root(kind='dev', venvsdir=VENVS):
import sysconfig
if sysconfig.is_python_build():
sys.exit('... | 33.270588 | 86 | 0.607496 |
import os.path
import sys
REPO_ROOT = os.path.dirname(os.path.abspath(__file__))
VENVS = os.path.join(REPO_ROOT, '.venvs')
def resolve_venv_root(kind='dev', venvsdir=VENVS):
import sysconfig
if sysconfig.is_python_build():
sys.exit('please install your built Python first (or pass it using --python)... | true | true |
f776f772a3aeb8974903507b8d06138f3865212e | 1,081 | py | Python | tests/test_build_linkcheck.py | merwok-forks/sphinx | b7cada236f765003a73ab5dca48f975d54c0c298 | [
"BSD-2-Clause"
] | null | null | null | tests/test_build_linkcheck.py | merwok-forks/sphinx | b7cada236f765003a73ab5dca48f975d54c0c298 | [
"BSD-2-Clause"
] | null | null | null | tests/test_build_linkcheck.py | merwok-forks/sphinx | b7cada236f765003a73ab5dca48f975d54c0c298 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
test_build_linkcheck
~~~~~~~~~~~~~~~~~~~~
Test the build process with manpage builder with the test root.
:copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from __future__ import print_function
import pytest
... | 27.025 | 69 | 0.666975 | from __future__ import print_function
import pytest
@pytest.mark.sphinx('linkcheck', testroot='linkcheck', freshenv=True)
def test_defaults(app, status, warning):
app.builder.build_all()
assert (app.outdir / 'output.txt').exists()
content = (app.outdir / 'output.txt').text()
print(content)
... | true | true |
f776f832875d870f02a5ccf0a4190ccbdbf1ee03 | 2,724 | py | Python | local-setup/launch.py | integritee-network/teeracle | 70fc6196e3f2fb2ddfde13619fcb35cc057990de | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | local-setup/launch.py | integritee-network/teeracle | 70fc6196e3f2fb2ddfde13619fcb35cc057990de | [
"ECL-2.0",
"Apache-2.0"
] | 18 | 2022-01-04T08:01:51.000Z | 2022-03-23T10:16:20.000Z | local-setup/launch.py | integritee-network/teeracle | 70fc6196e3f2fb2ddfde13619fcb35cc057990de | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
"""
Launch handily a local dev setup consisting of one integritee-node and some workers.
Example usage: `./local-setup/launch.py /local-setup/simple-config.py`
The node and workers logs are piped to `./log/node.log` etc. folder in the current-working dir.
run: `cd local-setup && tmux_logger.sh... | 31.310345 | 105 | 0.690529 | import argparse
import json
import signal
from subprocess import Popen, STDOUT
from time import sleep
from typing import Union, IO
from py.worker import Worker
from py.helpers import GracefulKiller, mkdir_p
log_dir = 'log'
mkdir_p(log_dir)
node_log = open(f'{log_dir}/node.log', 'w+')
def setup_worker(work_dir: str,... | true | true |
f776f873c8fab7d6ea0c1008d200e571351a6ca2 | 18,911 | py | Python | azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/security_rules_operations.py | v-Ajnava/azure-sdk-for-python | a1f6f80eb5869c5b710e8bfb66146546697e2a6f | [
"MIT"
] | 4 | 2016-06-17T23:25:29.000Z | 2022-03-30T22:37:45.000Z | azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/security_rules_operations.py | v-Ajnava/azure-sdk-for-python | a1f6f80eb5869c5b710e8bfb66146546697e2a6f | [
"MIT"
] | 2 | 2016-09-30T21:40:24.000Z | 2017-11-10T18:16:18.000Z | azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/security_rules_operations.py | v-Ajnava/azure-sdk-for-python | a1f6f80eb5869c5b710e8bfb66146546697e2a6f | [
"MIT"
] | 3 | 2016-05-03T20:49:46.000Z | 2017-10-05T21:05:27.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 ... | 46.464373 | 192 | 0.673894 |
import uuid
from msrest.pipeline import ClientRawResponse
from msrestazure.azure_exceptions import CloudError
from msrest.exceptions import DeserializationError
from msrestazure.azure_operation import AzureOperationPoller
from .. import models
class SecurityRulesOperations(object):
models = models
def __i... | true | true |
f776f8f770a146f4b3d3a010373ce32466ab74a3 | 1,646 | py | Python | test/terminal.py | ltouroumov/yarl | c9dca5fe4edfc25a19a257d9931abedfc4d7732f | [
"Unlicense"
] | null | null | null | test/terminal.py | ltouroumov/yarl | c9dca5fe4edfc25a19a257d9931abedfc4d7732f | [
"Unlicense"
] | null | null | null | test/terminal.py | ltouroumov/yarl | c9dca5fe4edfc25a19a257d9931abedfc4d7732f | [
"Unlicense"
] | null | null | null | from bearlibterminal import terminal
def draw_page(tx, ty, page):
for y in range(16):
for x in range(16):
terminal.put((x * 2) + tx, y + ty, page + (16 * y) + x)
def main():
terminal.open()
terminal.set("window: title='Test!', size=80x25, cellsize=16x32;")
terminal.se... | 27.898305 | 81 | 0.535237 | from bearlibterminal import terminal
def draw_page(tx, ty, page):
for y in range(16):
for x in range(16):
terminal.put((x * 2) + tx, y + ty, page + (16 * y) + x)
def main():
terminal.open()
terminal.set("window: title='Test!', size=80x25, cellsize=16x32;")
terminal.se... | true | true |
f776f93b6793b0e22a3c634f0eed87d70ea7bed5 | 16,830 | py | Python | tfmesos/scheduler.py | ariesdevil/tfmesos | d30081450faa2d718ad2867dd0e9366ecfa8b8c9 | [
"BSD-3-Clause"
] | null | null | null | tfmesos/scheduler.py | ariesdevil/tfmesos | d30081450faa2d718ad2867dd0e9366ecfa8b8c9 | [
"BSD-3-Clause"
] | null | null | null | tfmesos/scheduler.py | ariesdevil/tfmesos | d30081450faa2d718ad2867dd0e9366ecfa8b8c9 | [
"BSD-3-Clause"
] | null | null | null | import os
import sys
import math
import select
import socket
import getpass
import logging
import textwrap
from addict import Dict
from six import iteritems
from six.moves import urllib
from pymesos import Scheduler, MesosSchedulerDriver
from tfmesos.utils import send, recv, setup_logger
import uuid
FOREVER = 0xFFFFF... | 35.209205 | 79 | 0.499168 | import os
import sys
import math
import select
import socket
import getpass
import logging
import textwrap
from addict import Dict
from six import iteritems
from six.moves import urllib
from pymesos import Scheduler, MesosSchedulerDriver
from tfmesos.utils import send, recv, setup_logger
import uuid
FOREVER = 0xFFFFF... | true | true |
f776f9715a0886f4d4106469d7a5fd7cbbe5a489 | 1,762 | py | Python | schemapi/tests/test_codegen.py | CDyWeb/schemapi | ad02a69bd4c64f30e6d49bcda15555cd154ba586 | [
"BSD-3-Clause"
] | null | null | null | schemapi/tests/test_codegen.py | CDyWeb/schemapi | ad02a69bd4c64f30e6d49bcda15555cd154ba586 | [
"BSD-3-Clause"
] | null | null | null | schemapi/tests/test_codegen.py | CDyWeb/schemapi | ad02a69bd4c64f30e6d49bcda15555cd154ba586 | [
"BSD-3-Clause"
] | null | null | null | import pytest
from schemapi import SchemaBase, SchemaModuleGenerator
@pytest.fixture
def schema():
return {
'definitions': {
'Person': {
'properties': {
'name': {'type': 'string'},
'age': {'type': 'integer'},
}
... | 29.366667 | 88 | 0.582293 | import pytest
from schemapi import SchemaBase, SchemaModuleGenerator
@pytest.fixture
def schema():
return {
'definitions': {
'Person': {
'properties': {
'name': {'type': 'string'},
'age': {'type': 'integer'},
}
... | true | true |
f776fb62d58d13738ec249f792a4bc109f034622 | 11,652 | py | Python | tests/components/sonos/conftest.py | mib1185/core | b17d4ac65cde9a27ff6032d70b148792e5eba8df | [
"Apache-2.0"
] | null | null | null | tests/components/sonos/conftest.py | mib1185/core | b17d4ac65cde9a27ff6032d70b148792e5eba8df | [
"Apache-2.0"
] | null | null | null | tests/components/sonos/conftest.py | mib1185/core | b17d4ac65cde9a27ff6032d70b148792e5eba8df | [
"Apache-2.0"
] | null | null | null | """Configuration for Sonos tests."""
from copy import copy
from unittest.mock import AsyncMock, MagicMock, Mock, patch
import pytest
from soco import SoCo
from homeassistant.components import ssdp, zeroconf
from homeassistant.components.media_player import DOMAIN as MP_DOMAIN
from homeassistant.components.sonos impor... | 33.482759 | 125 | 0.649331 | from copy import copy
from unittest.mock import AsyncMock, MagicMock, Mock, patch
import pytest
from soco import SoCo
from homeassistant.components import ssdp, zeroconf
from homeassistant.components.media_player import DOMAIN as MP_DOMAIN
from homeassistant.components.sonos import DOMAIN
from homeassistant.const imp... | true | true |
f776fbc8651cacec2cd2586587f695d25b00a8d9 | 1,586 | py | Python | moringa_flask/post_review/app/views.py | Gomax-07/quote2 | 7996d379c92853d88018f08659aa6f2de0f1b268 | [
"Unlicense"
] | null | null | null | moringa_flask/post_review/app/views.py | Gomax-07/quote2 | 7996d379c92853d88018f08659aa6f2de0f1b268 | [
"Unlicense"
] | null | null | null | moringa_flask/post_review/app/views.py | Gomax-07/quote2 | 7996d379c92853d88018f08659aa6f2de0f1b268 | [
"Unlicense"
] | null | null | null | from flask import Flask,render_template, url_for, flash, redirect
from forms import RegistrationForm, LoginForm
from app import app
app = Flask(__name__)
app.config['SECRET_KEY'] = '4da30bd01c4cd12344b9a7d1b4fb7784'
reviews = [
{
'author': 'John james',
'title': 'Blog Review ',
'content': ... | 29.37037 | 85 | 0.633039 | from flask import Flask,render_template, url_for, flash, redirect
from forms import RegistrationForm, LoginForm
from app import app
app = Flask(__name__)
app.config['SECRET_KEY'] = '4da30bd01c4cd12344b9a7d1b4fb7784'
reviews = [
{
'author': 'John james',
'title': 'Blog Review ',
'content': ... | true | true |
f776fc57a6c9f081c528de48333d0bdf4a12f017 | 21,033 | py | Python | binance_chain/signing/http.py | rzchangcheng/python-binance-chain | 9193517f6272fdf39f34ef630c4be94be5ce43a4 | [
"MIT"
] | 241 | 2019-03-02T06:41:39.000Z | 2022-03-31T11:40:36.000Z | binance_chain/signing/http.py | rzchangcheng/python-binance-chain | 9193517f6272fdf39f34ef630c4be94be5ce43a4 | [
"MIT"
] | 47 | 2019-04-16T11:31:58.000Z | 2022-03-03T06:10:17.000Z | binance_chain/signing/http.py | rzchangcheng/python-binance-chain | 9193517f6272fdf39f34ef630c4be94be5ce43a4 | [
"MIT"
] | 90 | 2019-03-31T21:11:25.000Z | 2022-03-12T09:30:21.000Z | import ujson
from typing import Optional, Dict
import asyncio
import aiohttp
import requests
import binance_chain.messages
from binance_chain.exceptions import (
BinanceChainAPIException, BinanceChainRequestException,
BinanceChainSigningAuthenticationException
)
requests.models.json = ujson
class BaseApiS... | 32.013699 | 114 | 0.608092 | import ujson
from typing import Optional, Dict
import asyncio
import aiohttp
import requests
import binance_chain.messages
from binance_chain.exceptions import (
BinanceChainAPIException, BinanceChainRequestException,
BinanceChainSigningAuthenticationException
)
requests.models.json = ujson
class BaseApiS... | true | true |
f776fc7eaf9422868ac563d329e1fdaed77a1395 | 2,427 | py | Python | api.py | htcr/deeplab-pytorch | 8cea35415112fefb6a886d0d98ab64350ed09601 | [
"MIT"
] | null | null | null | api.py | htcr/deeplab-pytorch | 8cea35415112fefb6a886d0d98ab64350ed09601 | [
"MIT"
] | null | null | null | api.py | htcr/deeplab-pytorch | 8cea35415112fefb6a886d0d98ab64350ed09601 | [
"MIT"
] | null | null | null | import numpy as np
import cv2
import os
import os.path as osp
import torch
import yaml
from addict import Dict
import matplotlib.pyplot as plt
from .libs.models import *
from .libs.utils import DenseCRF
from demo import preprocessing, inference
class DeepLabV2Masker(object):
def __init__(self, crf=True):
... | 29.962963 | 114 | 0.589205 | import numpy as np
import cv2
import os
import os.path as osp
import torch
import yaml
from addict import Dict
import matplotlib.pyplot as plt
from .libs.models import *
from .libs.utils import DenseCRF
from demo import preprocessing, inference
class DeepLabV2Masker(object):
def __init__(self, crf=True):
... | true | true |
f776ff39af99e98b0190e0c1f2f3974caee7736f | 1,480 | py | Python | src/utils.py | sxinger/pubmed-literature-mining | a06731e37ee59a9c9cc701c30359d1de10cf2e39 | [
"MIT"
] | null | null | null | src/utils.py | sxinger/pubmed-literature-mining | a06731e37ee59a9c9cc701c30359d1de10cf2e39 | [
"MIT"
] | null | null | null | src/utils.py | sxinger/pubmed-literature-mining | a06731e37ee59a9c9cc701c30359d1de10cf2e39 | [
"MIT"
] | null | null | null | def word_dist_over_year(fw:list,kw:list,yr_key:list,w:int,top_k:int):
yr_words = dict.fromkeys(yr_key,[])
yr_docs = dict.fromkeys(yr_key,0)
for k, v in ab.items():
# pre-screening
incld_fw = [i for i in range(len(v)) if v[i] in fw]
incld_kw = [i for i in range(len(v)) if v[i] in kw... | 37 | 108 | 0.514189 | def word_dist_over_year(fw:list,kw:list,yr_key:list,w:int,top_k:int):
yr_words = dict.fromkeys(yr_key,[])
yr_docs = dict.fromkeys(yr_key,0)
for k, v in ab.items():
incld_fw = [i for i in range(len(v)) if v[i] in fw]
incld_kw = [i for i in range(len(v)) if v[i] in kw]
if not... | true | true |
f77700660788caf050e5b0a4c3175a5cb9b986f5 | 717 | py | Python | Python/Lapindrome.py | thefool76/hacktoberfest2021 | 237751e17a4fc325ded29fca013fb9f5853cd27c | [
"CC0-1.0"
] | 448 | 2021-10-01T04:24:14.000Z | 2022-03-06T14:34:20.000Z | Python/Lapindrome.py | Chanaka-Madushan-Herath/hacktoberfest2021 | 8473df9e058ccb6049720dd372342e0ea60f0e59 | [
"CC0-1.0"
] | 282 | 2021-10-01T04:29:06.000Z | 2022-03-07T12:42:57.000Z | Python/Lapindrome.py | Chanaka-Madushan-Herath/hacktoberfest2021 | 8473df9e058ccb6049720dd372342e0ea60f0e59 | [
"CC0-1.0"
] | 1,807 | 2021-10-01T04:24:02.000Z | 2022-03-28T04:51:25.000Z | x=int(input())
arr=[]
res=[]
def split(word):
return [char for char in word]
for i in range(x):
b=[]
c=[]
arr.append(str(input()))
y=len(arr[i])
p=int(len(arr[i]) /2)
if(y%2!=0):
b.append(split(arr[i][p+1:]))
c.append(split(arr[i][:p]))
... | 21.088235 | 39 | 0.421199 | x=int(input())
arr=[]
res=[]
def split(word):
return [char for char in word]
for i in range(x):
b=[]
c=[]
arr.append(str(input()))
y=len(arr[i])
p=int(len(arr[i]) /2)
if(y%2!=0):
b.append(split(arr[i][p+1:]))
c.append(split(arr[i][:p]))
... | true | true |
f777014662bfd7307c1f9230afb026180f14e6da | 1,817 | py | Python | I2CLCD1602.py | vito-royeca/gpio-tutorials | 548f4ad9ef44a4d21c1465e0d054a70572c61549 | [
"MIT"
] | null | null | null | I2CLCD1602.py | vito-royeca/gpio-tutorials | 548f4ad9ef44a4d21c1465e0d054a70572c61549 | [
"MIT"
] | null | null | null | I2CLCD1602.py | vito-royeca/gpio-tutorials | 548f4ad9ef44a4d21c1465e0d054a70572c61549 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
########################################################################
# Filename : I2CLCD1602.py
# Description : Use the LCD display data
# Author : freenove
# modification: 2018/08/03
########################################################################
from PCF8574 import PCF8574_... | 31.327586 | 108 | 0.589433 | from PCF8574 import PCF8574_GPIO
from Adafruit_LCD1602 import Adafruit_CharLCD
from time import sleep, strftime
from datetime import datetime
def get_cpu_temp(): tmp = open('/sys/class/thermal/thermal_zone0/temp')
cpu = tmp.read()
tmp.close()
return '{:.2f}'.format( float(cpu)/1000 ) + ' C'
def... | true | true |
f777015c5903b7fa2939576825bbeaee8db63a4d | 971 | py | Python | scripts/utils/sysroot-relativelinks.py | Topguy/rpi-buildqt | c1430481ca1ae1d5973da97bf1966ad21dc4274c | [
"MIT"
] | 43 | 2017-02-24T11:39:32.000Z | 2020-10-29T11:52:55.000Z | scripts/utils/sysroot-relativelinks.py | diesel437/rpi-buildqt | c1430481ca1ae1d5973da97bf1966ad21dc4274c | [
"MIT"
] | 24 | 2017-03-13T13:29:02.000Z | 2018-06-23T05:43:48.000Z | scripts/utils/sysroot-relativelinks.py | diesel437/rpi-buildqt | c1430481ca1ae1d5973da97bf1966ad21dc4274c | [
"MIT"
] | 29 | 2017-04-24T03:18:29.000Z | 2022-03-23T02:43:33.000Z | #!/usr/bin/env python
import sys
import os
# source: https://raw.githubusercontent.com/riscv/riscv-poky/master/scripts/sysroot-relativelinks.py
# Take a sysroot directory and turn all the absolute symlinks and turn them into
# relative ones such that the sysroot is usable within another system.
if len(sys.argv) != 2... | 27.742857 | 100 | 0.668383 | import sys
import os
if len(sys.argv) != 2:
print("Usage is " + sys.argv[0] + "<directory>")
sys.exit(1)
topdir = sys.argv[1]
topdir = os.path.abspath(topdir)
def handlelink(filePath, subdir):
link = os.readlink(filePath)
if link[0] != "/":
return
if link.startswith(topdir):
ret... | true | true |
f77701722cbd0b903761460645559b548d9814e3 | 8,275 | py | Python | binary_task.py | alicechi2/LargeScaleCoverSongId | d33a8425ce8761f09537d657d29c0e4b87e05249 | [
"MIT"
] | 35 | 2015-07-08T17:51:08.000Z | 2021-12-24T07:28:49.000Z | binary_task.py | alicechi2/LargeScaleCoverSongId | d33a8425ce8761f09537d657d29c0e4b87e05249 | [
"MIT"
] | 1 | 2017-08-07T13:37:05.000Z | 2017-08-07T13:37:05.000Z | binary_task.py | alicechi2/LargeScaleCoverSongId | d33a8425ce8761f09537d657d29c0e4b87e05249 | [
"MIT"
] | 8 | 2016-07-27T08:46:44.000Z | 2020-11-12T02:45:56.000Z | #!/usr/bin/env python
"""
Binary task of cover song identification using the Millions Song Dataset
and the Second Hand Song dataset.
It takes the Million Song Dataset path as an argument.
The list of queries to test must be located in:
./SHS/list_500queries.txt
The training set of the Second Hand Song dataset must... | 32.073643 | 79 | 0.634079 |
import argparse
import cPickle
import numpy as np
import os
import sys
import time
import pca
import hdf5_getters as GETTERS
import dan_tools
import utils
from transforms import load_transform
WIN = 75
PWR = 1.96
PATCH_LEN = WIN*12
# Set up logger
logger = utils.configure_logger()
def extract_feats(filename, td=No... | true | true |
f7770196dbab327348356ee26da400520b4b0348 | 7,635 | py | Python | analysis/moar/samples.py | bmorris3/mosfire_wasp6 | df802640eeb717a649c18caa1e940b684eeb99dc | [
"MIT"
] | null | null | null | analysis/moar/samples.py | bmorris3/mosfire_wasp6 | df802640eeb717a649c18caa1e940b684eeb99dc | [
"MIT"
] | null | null | null | analysis/moar/samples.py | bmorris3/mosfire_wasp6 | df802640eeb717a649c18caa1e940b684eeb99dc | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Tue Mar 24 09:33:04 2015
@author: bmmorris
"""
import numpy as np
import triangle
from matplotlib import pyplot as plt
def splitchain(infile, outfile, tossfraction=0.9):
'''
Take the last `savefraction` of file `infile`, save it as the
smaller file `outfile`.
''... | 37.426471 | 79 | 0.500982 |
import numpy as np
import triangle
from matplotlib import pyplot as plt
def splitchain(infile, outfile, tossfraction=0.9):
with open(outfile, 'w') as out:
with open(infile, 'r') as f:
alllines = f.readlines()
lastXpercent = int(tossfraction*len(alllines))
shortlines = a... | true | true |
f77703ddf9e95f466218f0b7be290038a60211d8 | 1,729 | py | Python | run.py | ConstellationBJUT/kaggle-2014-criteo | c693cded081e2eb17da41605cb5cb6fc64b3d5b9 | [
"Apache-2.0"
] | 999 | 2015-01-05T10:28:33.000Z | 2019-04-10T06:40:46.000Z | run.py | PandasCute/kaggle-2014-criteo | c693cded081e2eb17da41605cb5cb6fc64b3d5b9 | [
"Apache-2.0"
] | 10 | 2016-04-28T10:54:01.000Z | 2018-08-20T13:04:53.000Z | run.py | PandasCute/kaggle-2014-criteo | c693cded081e2eb17da41605cb5cb6fc64b3d5b9 | [
"Apache-2.0"
] | 563 | 2015-01-16T03:34:40.000Z | 2019-04-03T07:47:38.000Z | #!/usr/bin/env python3
import subprocess, sys, os, time
NR_THREAD = 1
start = time.time()
cmd = './utils/count.py tr.csv > fc.trva.t10.txt'
subprocess.call(cmd, shell=True)
cmd = 'converters/parallelizer-a.py -s {nr_thread} converters/pre-a.py tr.csv tr.gbdt.dense tr.gbdt.sparse'.format(nr_thread=NR_THREAD)
subpr... | 37.586957 | 146 | 0.738577 |
import subprocess, sys, os, time
NR_THREAD = 1
start = time.time()
cmd = './utils/count.py tr.csv > fc.trva.t10.txt'
subprocess.call(cmd, shell=True)
cmd = 'converters/parallelizer-a.py -s {nr_thread} converters/pre-a.py tr.csv tr.gbdt.dense tr.gbdt.sparse'.format(nr_thread=NR_THREAD)
subprocess.call(cmd, shell=T... | true | true |
f7770460646cd4e0e72a42d971a55010e97226de | 2,746 | py | Python | gizer/collection_reader.py | racker/gizer | 4600999c35e99bce54071ea4f952b09b3fd5dc9b | [
"Apache-2.0"
] | null | null | null | gizer/collection_reader.py | racker/gizer | 4600999c35e99bce54071ea4f952b09b3fd5dc9b | [
"Apache-2.0"
] | null | null | null | gizer/collection_reader.py | racker/gizer | 4600999c35e99bce54071ea4f952b09b3fd5dc9b | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
""" Mongo Collection records reader that is using parallel processing
for handling records that read. """
__author__ = "Yaroslav Litvinov"
__copyright__ = "Copyright 2016, Rackspace Inc."
__email__ = "yaroslav.litvinov@rackspace.com"
from gizer.etl_mongo_reader import EtlMongoReader
from mo... | 44.290323 | 80 | 0.655863 |
__author__ = "Yaroslav Litvinov"
__copyright__ = "Copyright 2016, Rackspace Inc."
__email__ = "yaroslav.litvinov@rackspace.com"
from gizer.etl_mongo_reader import EtlMongoReader
from mongo_reader.prepare_mongo_request import prepare_mongo_request_for_list
from mongo_schema.schema_engine import create_tables_load_bso... | true | true |
f7770510a5c5ee4d87a37035fcf1ad4bac6bbfc7 | 2,021 | py | Python | src/unicon/plugins/tests/mock/mock_device_iosxr_spitfire.py | nielsvanhooy/unicon.plugins | 3416fd8223f070cbb67a2cbe604e3c5d13584318 | [
"Apache-2.0"
] | 18 | 2019-11-23T23:14:53.000Z | 2022-01-10T01:17:08.000Z | src/unicon/plugins/tests/mock/mock_device_iosxr_spitfire.py | nielsvanhooy/unicon.plugins | 3416fd8223f070cbb67a2cbe604e3c5d13584318 | [
"Apache-2.0"
] | 12 | 2020-11-09T20:39:25.000Z | 2022-03-22T12:46:59.000Z | src/unicon/plugins/tests/mock/mock_device_iosxr_spitfire.py | nielsvanhooy/unicon.plugins | 3416fd8223f070cbb67a2cbe604e3c5d13584318 | [
"Apache-2.0"
] | 32 | 2020-02-12T15:42:22.000Z | 2022-03-15T16:42:10.000Z | #!/usr/bin/env python3
import re
import sys
import logging
import argparse
from unicon.mock.mock_device import MockDevice, MockDeviceTcpWrapper
logger = logging.getLogger(__name__)
class MockDeviceSpitfire(MockDevice):
def __init__(self, *args, **kwargs):
super().__init__(*args, device_os='iosxr', **kw... | 26.946667 | 101 | 0.636319 |
import re
import sys
import logging
import argparse
from unicon.mock.mock_device import MockDevice, MockDeviceTcpWrapper
logger = logging.getLogger(__name__)
class MockDeviceSpitfire(MockDevice):
def __init__(self, *args, **kwargs):
super().__init__(*args, device_os='iosxr', **kwargs)
def enable(s... | true | true |
f777064bec6f94ee2cfdb560aa08fcd0b3d0a26d | 44,909 | py | Python | kitsune/dashboards/readouts.py | AndrewDVXI/kitsune | 84bd4fa60346681c3fc5a03b0b1540fd1335cee2 | [
"BSD-3-Clause"
] | 929 | 2015-01-04T08:08:51.000Z | 2022-03-31T06:20:44.000Z | kitsune/dashboards/readouts.py | hafixo/kitsune | d7756872e16590eea1c6adaeb5bc78f83414d753 | [
"BSD-3-Clause"
] | 1,751 | 2015-01-02T00:04:37.000Z | 2022-03-31T10:24:30.000Z | kitsune/dashboards/readouts.py | Whoerr/kitsune | 2428573b4920a824c3e712b8a4870f8c1ada8f64 | [
"BSD-3-Clause"
] | 605 | 2015-01-01T14:08:36.000Z | 2022-03-28T15:39:45.000Z | """Data aggregators for dashboards
For the purposes of all these numbers, we pretend as if Documents with
is_localizable=False or is_archived=True and Revisions with
is_ready_for_localization=False do not exist.
"""
import logging
from collections import OrderedDict
from datetime import datetime
from django.conf im... | 35.9272 | 99 | 0.616424 | import logging
from collections import OrderedDict
from datetime import datetime
from django.conf import settings
from django.db import connections, router
from django.template.loader import render_to_string
from django.utils.translation import ugettext as _, ugettext_lazy as _lazy, pgettext_lazy
from jinja2 import ... | true | true |
f777068da71b6cc13d426d85bba2f3024ffb0670 | 3,123 | py | Python | huaweicloud-sdk-iam/huaweicloudsdkiam/v3/model/show_user_mfa_device_request.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 64 | 2020-06-12T07:05:07.000Z | 2022-03-30T03:32:50.000Z | huaweicloud-sdk-iam/huaweicloudsdkiam/v3/model/show_user_mfa_device_request.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 11 | 2020-07-06T07:56:54.000Z | 2022-01-11T11:14:40.000Z | huaweicloud-sdk-iam/huaweicloudsdkiam/v3/model/show_user_mfa_device_request.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 24 | 2020-06-08T11:42:13.000Z | 2022-03-04T06:44:08.000Z | # coding: utf-8
import re
import six
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class ShowUserMfaDeviceRequest:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): T... | 27.394737 | 95 | 0.560359 |
import re
import six
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class ShowUserMfaDeviceRequest:
sensitive_list = []
openapi_types = {
'user_id': 'str'
}
attribute_map = {
'user_id': 'user_id'
}
def __init__(self, user_id=None):
... | true | true |
f77707c75bbeddf60cf9b20ceba85e735af4d00d | 756 | py | Python | tests/utils.py | 3D-Beacons/3d-beacons-hub-api | d381d0dc255bbdcc8d3fcd7f43788443b357a4b3 | [
"Apache-2.0"
] | 2 | 2021-09-18T03:45:23.000Z | 2021-11-09T11:44:01.000Z | tests/utils.py | 3D-Beacons/3d-beacons-hub-api | d381d0dc255bbdcc8d3fcd7f43788443b357a4b3 | [
"Apache-2.0"
] | 1 | 2020-10-19T20:47:12.000Z | 2020-10-19T20:47:43.000Z | tests/utils.py | 3D-Beacons/3d-beacons-hub-api | d381d0dc255bbdcc8d3fcd7f43788443b357a4b3 | [
"Apache-2.0"
] | null | null | null | import json
async def request_get_stub(url: str, stub_for: str, status_code: int = 200):
"""Returns an object with stub response.
Args:
url (str): A request URL.
stub_for (str): Type of stub required.
Returns:
StubResponse: A StubResponse object.
"""
return StubResponse(s... | 25.2 | 76 | 0.630952 | import json
async def request_get_stub(url: str, stub_for: str, status_code: int = 200):
return StubResponse(stub_for=stub_for, status_code=status_code)
class StubResponse:
def __init__(self, status_code: int, stub_for: str) -> None:
self.status_code = status_code
self.prefix = "tests/stubs... | true | true |
f77708de928236b4e6b18f63a46462807b5e1ea3 | 2,804 | py | Python | moire/nn/recurrents/gru.py | speedcell4/moire | d5acaee4ee0690627f1382debdd6a6f11cec77c7 | [
"MIT"
] | 2 | 2018-03-12T19:53:35.000Z | 2018-04-12T08:36:22.000Z | moire/nn/recurrents/gru.py | speedcell4/moire | d5acaee4ee0690627f1382debdd6a6f11cec77c7 | [
"MIT"
] | 4 | 2018-03-11T06:01:04.000Z | 2020-01-15T16:27:35.000Z | moire/nn/recurrents/gru.py | speedcell4/moire | d5acaee4ee0690627f1382debdd6a6f11cec77c7 | [
"MIT"
] | null | null | null | import dynet as dy
import moire
from moire import nn, ParameterCollection, Expression
class GRUCell(nn.Module):
def __init__(self, pc: ParameterCollection, input_size: int, hidden_size: int,
activation=dy.tanh, recurrent_activation=dy.logistic) -> None:
super(GRUCell, self).__init__(pc)
... | 43.138462 | 111 | 0.666548 | import dynet as dy
import moire
from moire import nn, ParameterCollection, Expression
class GRUCell(nn.Module):
def __init__(self, pc: ParameterCollection, input_size: int, hidden_size: int,
activation=dy.tanh, recurrent_activation=dy.logistic) -> None:
super(GRUCell, self).__init__(pc)
... | true | true |
f77709000daab3d0f411d5e64e2a46ff4604e788 | 259,030 | py | Python | instances/passenger_demand/pas-20210422-1717-int2e-1/6.py | LHcau/scheduling-shared-passenger-and-freight-transport-on-a-fixed-infrastructure | bba1e6af5bc8d9deaa2dc3b83f6fe9ddf15d2a11 | [
"BSD-3-Clause"
] | null | null | null | instances/passenger_demand/pas-20210422-1717-int2e-1/6.py | LHcau/scheduling-shared-passenger-and-freight-transport-on-a-fixed-infrastructure | bba1e6af5bc8d9deaa2dc3b83f6fe9ddf15d2a11 | [
"BSD-3-Clause"
] | null | null | null | instances/passenger_demand/pas-20210422-1717-int2e-1/6.py | LHcau/scheduling-shared-passenger-and-freight-transport-on-a-fixed-infrastructure | bba1e6af5bc8d9deaa2dc3b83f6fe9ddf15d2a11 | [
"BSD-3-Clause"
] | null | null | null |
"""
PASSENGERS
"""
numPassengers = 3769
passenger_arriving = (
(0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 2, 2, 0, 0, 1, 0, 0, 0), # 0
(2, 1, 0, 3, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 2, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0), # 1
(0, 0, 1, 1, 1, 1, 0, 1, 2, 0, 0, 0, 0, 1, 0, 1, 3, 1, 0, 1, 0, 1, 0, 1, 0, 0), #... | 277.037433 | 512 | 0.770204 |
numPassengers = 3769
passenger_arriving = (
(0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 2, 2, 0, 0, 1, 0, 0, 0), (2, 1, 0, 3, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 2, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0), (0, 0, 1, 1, 1, 1, 0, 1, 2, 0, 0, 0, 0, 1, 0, 1, 3, 1, 0, 1, 0, 1, 0, 1, 0, 0), (3, 2, 0, 0, 2, 0, 0, 2, 0, 0... | true | true |
f77709ae0654fc3e42269dac2a21597375ab7a6e | 123,208 | py | Python | kubernetes/client/api/batch_v1beta1_api.py | carloscastrojumo/python | f461dd42d48650a4ae1b41d630875cad9fcb68ad | [
"Apache-2.0"
] | 2 | 2021-03-09T12:42:05.000Z | 2021-03-09T13:27:50.000Z | kubernetes/client/api/batch_v1beta1_api.py | carloscastrojumo/python | f461dd42d48650a4ae1b41d630875cad9fcb68ad | [
"Apache-2.0"
] | 7 | 2021-04-13T03:04:42.000Z | 2022-03-02T03:10:18.000Z | kubernetes/client/api/batch_v1beta1_api.py | carloscastrojumo/python | f461dd42d48650a4ae1b41d630875cad9fcb68ad | [
"Apache-2.0"
] | 1 | 2021-06-13T09:21:37.000Z | 2021-06-13T09:21:37.000Z | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: release-1.17
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import r... | 68.86976 | 1,390 | 0.665022 |
from __future__ import absolute_import
import re
import six
from kubernetes.client.api_client import ApiClient
from kubernetes.client.exceptions import ( ApiTypeError,
ApiValueError
)
class BatchV1beta1Api(object):
def __init__(self, api_client=None):
if api_client is None:
ap... | true | true |
f7770a397722610ae0f0f3e1b359837c16e171ef | 2,888 | py | Python | getaway/binance_ws.py | mn3711698/singlecoin | 63f0154ba17c7a21295b2ff6ef94929cf708a47c | [
"MIT"
] | 33 | 2021-05-14T03:21:53.000Z | 2021-11-07T20:27:53.000Z | getaway/binance_ws.py | mn3711698/singlecoin | 63f0154ba17c7a21295b2ff6ef94929cf708a47c | [
"MIT"
] | 2 | 2021-06-04T15:31:01.000Z | 2021-09-25T12:24:02.000Z | getaway/binance_ws.py | mn3711698/singlecoin | 63f0154ba17c7a21295b2ff6ef94929cf708a47c | [
"MIT"
] | 14 | 2021-05-14T03:34:30.000Z | 2021-11-10T12:35:39.000Z | # -*- coding: utf-8 -*-
##############################################################################
# Author:QQ173782910
##############################################################################
import json
from datetime import datetime
from getaway.base_websocket import BaseWebsocket
from utils.event.engine ... | 34.795181 | 89 | 0.478878 |
import json
from datetime import datetime
from getaway.base_websocket import BaseWebsocket
from utils.event.engine import EventEngine, Event
from constant.constant import EVENT_TICKER, EVENT_DEPTH
class BinanceDataWebsocket(BaseWebsocket):
def __init__(self, broker=None, ping_interval=20):
self.broker =... | true | true |
f7770b23717ddea2c5812935ad62a650ac6a5a64 | 1,885 | py | Python | awssg/Client.py | danilocgsilva/aws-sg | 76e3b7325f01e75e1364901e156c392ccb097ac5 | [
"MIT"
] | null | null | null | awssg/Client.py | danilocgsilva/aws-sg | 76e3b7325f01e75e1364901e156c392ccb097ac5 | [
"MIT"
] | null | null | null | awssg/Client.py | danilocgsilva/aws-sg | 76e3b7325f01e75e1364901e156c392ccb097ac5 | [
"MIT"
] | null | null | null | from awssg.Client_Interface import Client_Interface
from awssg.VPC_Client import VPC_Client
import boto3
class Client(Client_Interface):
def __init__(self):
self.ec2_client = boto3.client('ec2')
def describe_security_groups(self) -> dict:
return self.ec2_client.describe_security_groups()
... | 30.901639 | 84 | 0.680106 | from awssg.Client_Interface import Client_Interface
from awssg.VPC_Client import VPC_Client
import boto3
class Client(Client_Interface):
def __init__(self):
self.ec2_client = boto3.client('ec2')
def describe_security_groups(self) -> dict:
return self.ec2_client.describe_security_groups()
... | true | true |
f7770b2a52919265b2b37cc7d471f87987e01f57 | 9,045 | py | Python | tests/compiler/dataflow/test_model_assignment.py | inmanta/inmanta-core | ae2153d57f124d00ad1b58e6d4bc6818364be4a8 | [
"Apache-2.0"
] | 6 | 2021-03-09T10:24:02.000Z | 2022-01-16T03:52:11.000Z | tests/compiler/dataflow/test_model_assignment.py | inmanta/inmanta-core | ae2153d57f124d00ad1b58e6d4bc6818364be4a8 | [
"Apache-2.0"
] | 1,319 | 2020-12-18T08:52:29.000Z | 2022-03-31T18:17:32.000Z | tests/compiler/dataflow/test_model_assignment.py | inmanta/inmanta-core | ae2153d57f124d00ad1b58e6d4bc6818364be4a8 | [
"Apache-2.0"
] | 4 | 2021-03-03T15:36:50.000Z | 2022-03-11T11:41:51.000Z | """
Copyright 2020 Inmanta
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 ... | 29.083601 | 119 | 0.694306 |
from typing import Dict, List, Optional
import pytest
import inmanta.ast.type as inmanta_type
from compiler.dataflow.conftest import DataflowTestHelper, get_dataflow_node
from inmanta.ast import DoubleSetException, NotFoundException, RuntimeException
from inmanta.ast.entity import Entity
from inmanta.ast.statements ... | true | true |
f7770c4855a5f82e9212f6e448ea4025ae8f4338 | 3,171 | py | Python | qa/rpc-tests/mempool_resurrect_test.py | kazucoin/kazugold | 7b0e034b08eceacf907b18913be7043c9cdcf5f4 | [
"MIT"
] | 1 | 2019-06-02T17:21:29.000Z | 2019-06-02T17:21:29.000Z | qa/rpc-tests/mempool_resurrect_test.py | kazucoin/kazugold | 7b0e034b08eceacf907b18913be7043c9cdcf5f4 | [
"MIT"
] | null | null | null | qa/rpc-tests/mempool_resurrect_test.py | kazucoin/kazugold | 7b0e034b08eceacf907b18913be7043c9cdcf5f4 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test resurrection of mined transactions when
# the blockchain is re-organized.
#
from test_framework... | 38.670732 | 105 | 0.654368 |
from test_framework.test_framework import KazuGoldTestFramework
from test_framework.util import *
class MempoolCoinbaseTest(KazuGoldTestFramework):
def __init__(self):
super().__init__()
self.num_nodes = 1
self.setup_clean_chain = False
def setup_network(self):
args ... | true | true |
f7770caddab65fc7b9902e1d8854a5dbc22a99b2 | 664 | py | Python | videoanalyst/utils/__init__.py | TragedyN/SiamFCpp | 65d80a66eb40d81ca09fa2dbf32636fbc414ec0d | [
"MIT"
] | 737 | 2019-12-24T13:34:43.000Z | 2022-03-28T11:38:24.000Z | videoanalyst/utils/__init__.py | ShiAngWang/video_analyst | de4f86363cc408695428b423e8d6e346aa35149b | [
"MIT"
] | 129 | 2020-02-13T04:08:28.000Z | 2022-03-17T04:13:09.000Z | videoanalyst/utils/__init__.py | ShiAngWang/video_analyst | de4f86363cc408695428b423e8d6e346aa35149b | [
"MIT"
] | 179 | 2019-12-31T04:53:12.000Z | 2022-03-25T06:32:20.000Z | # -*- coding: utf-8 -*
from .image import load_image
from .misc import Registry, Timer, load_cfg, md5sum, merge_cfg_into_hps
from .path import complete_path_wt_root_in_cfg, ensure_dir
from .torch_module import (average_gradients, convert_numpy_to_tensor,
convert_tensor_to_numpy, move_data_to_... | 41.5 | 74 | 0.754518 | from .image import load_image
from .misc import Registry, Timer, load_cfg, md5sum, merge_cfg_into_hps
from .path import complete_path_wt_root_in_cfg, ensure_dir
from .torch_module import (average_gradients, convert_numpy_to_tensor,
convert_tensor_to_numpy, move_data_to_device,
... | true | true |
f7770d42852367b9ffc6119005375d1d3a8fcf8f | 719 | py | Python | venv/Scripts/rstpep2html.py | lellisls/rentomatic | 777af27f202ee9c773f8a485a06ba960b6a1654e | [
"MIT"
] | null | null | null | venv/Scripts/rstpep2html.py | lellisls/rentomatic | 777af27f202ee9c773f8a485a06ba960b6a1654e | [
"MIT"
] | null | null | null | venv/Scripts/rstpep2html.py | lellisls/rentomatic | 777af27f202ee9c773f8a485a06ba960b6a1654e | [
"MIT"
] | null | null | null | #!c:\users\batle\pycharmprojects\rentomatic\venv\scripts\python.exe
# $Id: rstpep2html.py 4564 2006-05-21 20:44:42Z wiemann $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
A minimal front end to the Docutils Publisher, producing HTML from PEP
(Python E... | 27.653846 | 76 | 0.734353 |
try:
import locale
locale.setlocale(locale.LC_ALL, '')
except:
pass
from docutils.core import publish_cmdline, default_description
description = ('Generates (X)HTML from reStructuredText-format PEP files. '
+ default_description)
publish_cmdline(reader_name='pep', writer_name='pep_htm... | true | true |
f7770d6f5a5a0e66cb6579d1f394aa3a6b13f1f8 | 2,460 | py | Python | tempy/places.py | yudataguy/TemPy | e935c431de94d3e29d7f38c0fdc2d15dc408cf14 | [
"Apache-2.0"
] | null | null | null | tempy/places.py | yudataguy/TemPy | e935c431de94d3e29d7f38c0fdc2d15dc408cf14 | [
"Apache-2.0"
] | null | null | null | tempy/places.py | yudataguy/TemPy | e935c431de94d3e29d7f38c0fdc2d15dc408cf14 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
@author: Federico Cerchiari <federicocerchiari@gmail.com>
Places used by Tempy to choose the right TempyREPR to use.
Magically created starting from the tags module.
"""
import importlib
from .tempyrepr import TempyPlace
class Inside(TempyPlace):
"""Check if a TempyREPR object's contai... | 37.846154 | 105 | 0.69878 | import importlib
from .tempyrepr import TempyPlace
class Inside(TempyPlace):
def _reprscore_container_parent(self, container, child):
if container.parent.__class__ == self._pointer_class:
return 1
return 0
class Sibling(TempyPlace):
@classmethod
def _check_container_siblings... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.