hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
43e8e42e3e7a0ebef3e26cd9916e4fbad9594d1c | 1,996 | py | Python | diffnet/class/ParserConf.py | mIXs222/diffnet | 1f580332254a5113ed7b88b9b2e0aa467344e94d | [
"MIT"
] | null | null | null | diffnet/class/ParserConf.py | mIXs222/diffnet | 1f580332254a5113ed7b88b9b2e0aa467344e94d | [
"MIT"
] | null | null | null | diffnet/class/ParserConf.py | mIXs222/diffnet | 1f580332254a5113ed7b88b9b2e0aa467344e94d | [
"MIT"
] | null | null | null | '''
author: Peijie Sun
e-mail: sun.hfut@gmail.com
released date: 04/18/2019
'''
import configparser as cp
import re, os
class ParserConf():
def __init__(self, config_path):
self.config_path = config_path
def processValue(self, key, value):
#print(key, value)
tmp = value.... | 36.962963 | 110 | 0.558116 |
f611453fffb5a9264da97cf63f52b5c297c22434 | 417 | py | Python | notifications/serializers.py | mohamed17717/Like-Reddit-Backend-Clone | d60d7a4625ee0f7354a21e53c26c7c52746d735f | [
"MIT"
] | 1 | 2022-01-10T12:00:59.000Z | 2022-01-10T12:00:59.000Z | notifications/serializers.py | mohamed17717/Like-Reddit-Backend-Clone | d60d7a4625ee0f7354a21e53c26c7c52746d735f | [
"MIT"
] | null | null | null | notifications/serializers.py | mohamed17717/Like-Reddit-Backend-Clone | d60d7a4625ee0f7354a21e53c26c7c52746d735f | [
"MIT"
] | null | null | null | from rest_framework import serializers
from notifications.models import Notification
class NotificationSerializer(serializers.ModelSerializer):
url = serializers.URLField(source='sender.sender_object.get_notification_url')
message = serializers.CharField(source='sender.sender_object.get_notification_message')
... | 29.785714 | 89 | 0.791367 |
9e9d83f2829475031f9152f812cc0a0f30b0462b | 29,729 | py | Python | neutron/plugins/cisco/cfg_agent/device_drivers/csr1kv/csr1kv_routing_driver.py | alliedtelesis/neutron | 80c9ab86edb922dcd27aaa8c5b99731097e52652 | [
"Apache-2.0"
] | null | null | null | neutron/plugins/cisco/cfg_agent/device_drivers/csr1kv/csr1kv_routing_driver.py | alliedtelesis/neutron | 80c9ab86edb922dcd27aaa8c5b99731097e52652 | [
"Apache-2.0"
] | null | null | null | neutron/plugins/cisco/cfg_agent/device_drivers/csr1kv/csr1kv_routing_driver.py | alliedtelesis/neutron | 80c9ab86edb922dcd27aaa8c5b99731097e52652 | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 Cisco Systems, Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | 43.273654 | 79 | 0.644186 |
115a2e1fafebda7e484bf222753fb1f1c807f6e0 | 1,050 | py | Python | bin/points_to_features.py | digital-land/dataset | 31b20eef25305f2ad3273238d38e0c7da9689cad | [
"MIT"
] | 1 | 2020-03-17T19:10:14.000Z | 2020-03-17T19:10:14.000Z | bin/points_to_features.py | digital-land/dataset | 31b20eef25305f2ad3273238d38e0c7da9689cad | [
"MIT"
] | 10 | 2020-03-17T08:41:31.000Z | 2021-10-05T09:48:52.000Z | bin/points_to_features.py | digital-land/dataset | 31b20eef25305f2ad3273238d38e0c7da9689cad | [
"MIT"
] | 1 | 2020-02-24T13:55:33.000Z | 2020-02-24T13:55:33.000Z | #!/usr/bin/env python3
import sys
import json
# add parent directory
sys.path.append(".")
from utils import get
from digital_land_frontend.render import wkt_to_json_geometry
sample_file = "docs/brownfield-land/organisation/local-authority-eng/HAG/sites.json"
def create_feature_collection(features):
return {"t... | 22.826087 | 87 | 0.700952 |
23c7c1c805ab1c70b1901c1d8751a37d0fe73052 | 2,901 | py | Python | pytorch/m2nistDataSet.py | leonardohaig/m2nist-segmentation | e02bebef8946e083f3a2d1dba98ad667a9f3e0cd | [
"MIT"
] | 2 | 2020-04-18T02:46:29.000Z | 2021-01-15T08:20:11.000Z | pytorch/m2nistDataSet.py | leonardohaig/m2nist-segmentation | e02bebef8946e083f3a2d1dba98ad667a9f3e0cd | [
"MIT"
] | 1 | 2021-01-15T08:46:54.000Z | 2021-01-15T09:01:40.000Z | pytorch/m2nistDataSet.py | leonardohaig/m2nist-segmentation | e02bebef8946e083f3a2d1dba98ad667a9f3e0cd | [
"MIT"
] | 1 | 2021-08-08T15:33:15.000Z | 2021-08-08T15:33:15.000Z | #!/usr/bin/env python3
# coding=utf-8
# ============================#
# Program:m2nistDataSet.py
# 数据加载模块
# Date:20-4-16
# Author:liheng
# Version:V1.0
# ============================#
import os
import sys
import numpy as np
import torch
from torch.utils.data import Dataset, DataLoader
import utils_torch
from mu... | 27.894231 | 98 | 0.602551 |
08c72cb912ebe7a9018d7b45f83a63b9fe3556a3 | 209 | py | Python | 10_SentenceSimilarity.py | pemagrg1/SPACY-for-Beginners | b4647a5b7b1a784cfe86d594cb045337bef198fc | [
"MIT"
] | 4 | 2019-03-16T04:16:27.000Z | 2020-02-15T13:46:26.000Z | 10_SentenceSimilarity.py | pemagrg1/Natural-Language-Processing-NLP-using-Spacy | b4647a5b7b1a784cfe86d594cb045337bef198fc | [
"MIT"
] | null | null | null | 10_SentenceSimilarity.py | pemagrg1/Natural-Language-Processing-NLP-using-Spacy | b4647a5b7b1a784cfe86d594cb045337bef198fc | [
"MIT"
] | 1 | 2019-10-17T14:55:41.000Z | 2019-10-17T14:55:41.000Z | import spacy
# install: python -m spacy download en_core_web_lg
nlp = spacy.load('en_core_web_md')
doc1 = nlp(u"Do you have an ice cream?")
doc2 = nlp(u"Is ice cream available?")
print (doc1.similarity(doc2)) | 29.857143 | 50 | 0.741627 |
179051772adf27cf4aac23c63638cf7f6cb05655 | 151 | py | Python | cimcb/__version__.py | CIMCB/cimcb | 5d30f80423ed94e1068871b30e465b38d451581a | [
"MIT"
] | 5 | 2020-05-26T23:45:40.000Z | 2022-01-13T00:40:14.000Z | cimcb/__version__.py | CIMCB/cimcb | 5d30f80423ed94e1068871b30e465b38d451581a | [
"MIT"
] | 3 | 2020-10-20T09:03:18.000Z | 2021-11-01T14:22:05.000Z | cimcb/__version__.py | CIMCB/cimcb | 5d30f80423ed94e1068871b30e465b38d451581a | [
"MIT"
] | 4 | 2020-10-12T07:17:43.000Z | 2022-03-28T06:28:44.000Z | from __future__ import division, absolute_import, print_function
major = 2
minor = 1
micro = 2
version = "%(major)d.%(minor)d.%(micro)d" % (locals())
| 21.571429 | 64 | 0.701987 |
1313e6d503537aa739b76ffb30ed81327f696da0 | 142 | py | Python | Algorithms/Maths/Odd_Even/odd_even.py | njha6185/interview-techdev-guide | f033e8e472b658dc0543b5a19c86448dcda86784 | [
"MIT"
] | null | null | null | Algorithms/Maths/Odd_Even/odd_even.py | njha6185/interview-techdev-guide | f033e8e472b658dc0543b5a19c86448dcda86784 | [
"MIT"
] | null | null | null | Algorithms/Maths/Odd_Even/odd_even.py | njha6185/interview-techdev-guide | f033e8e472b658dc0543b5a19c86448dcda86784 | [
"MIT"
] | null | null | null | num = input("Enter a Number to check for odd or even : ")
if ((int(num) % 2) == 0) :
print ("Even Number")
else :
print("ODD Number")
| 23.666667 | 57 | 0.577465 |
9dbe54bfaf0e52ad8b69c1971f6f528c8d951d6f | 7,044 | py | Python | main.py | WilliamDASILVA/TheMysteryOfSchweitzer | f81edc2e202bd5009fc96ccfbbfcc40bc135a17a | [
"MIT"
] | null | null | null | main.py | WilliamDASILVA/TheMysteryOfSchweitzer | f81edc2e202bd5009fc96ccfbbfcc40bc135a17a | [
"MIT"
] | null | null | null | main.py | WilliamDASILVA/TheMysteryOfSchweitzer | f81edc2e202bd5009fc96ccfbbfcc40bc135a17a | [
"MIT"
] | null | null | null | # --------------------------------------------------- *\
# Projet ISN - 2015 / 2016
# William DA SILVA
# Démarré le 6/10/15
# License MIT
#
#
#
# Import modules
# --------------------------------------------------- */
import pygame;
import sys;
import os;
from copy import deepcopy;
from engine.World import World;
... | 24.629371 | 125 | 0.723027 |
f1856ab6db8f444c036584e80a3a8ce9eb91c709 | 173 | py | Python | guidelines/models.py | leniangraeni/Seroja | 5b64671c89c51d45777e937a23c48969c3c59af6 | [
"MIT"
] | null | null | null | guidelines/models.py | leniangraeni/Seroja | 5b64671c89c51d45777e937a23c48969c3c59af6 | [
"MIT"
] | null | null | null | guidelines/models.py | leniangraeni/Seroja | 5b64671c89c51d45777e937a23c48969c3c59af6 | [
"MIT"
] | null | null | null | from django.db import models
class Guideline(models.Model):
guide = models.ImageField(upload_to='images/guidelines/')
keterangan = models.CharField(max_length=200)
| 28.833333 | 61 | 0.768786 |
c6c5dad26657415798c4c75de251ceb65ff84238 | 706 | py | Python | Recursion/Aditya_Verma/Hypothesis_Method/Remove_Kth_Element_From_Stack.py | prash-kr-meena/GoogleR | 27aca71e51cc2442e604e07ab00406a98d8d63a4 | [
"Apache-2.0"
] | null | null | null | Recursion/Aditya_Verma/Hypothesis_Method/Remove_Kth_Element_From_Stack.py | prash-kr-meena/GoogleR | 27aca71e51cc2442e604e07ab00406a98d8d63a4 | [
"Apache-2.0"
] | null | null | null | Recursion/Aditya_Verma/Hypothesis_Method/Remove_Kth_Element_From_Stack.py | prash-kr-meena/GoogleR | 27aca71e51cc2442e604e07ab00406a98d8d63a4 | [
"Apache-2.0"
] | null | null | null | from Abstract_Data_Type.StackADT import StackADT
# Here we treat k as 1 indexed
def remove_kth_element_from_top_of_stack(stack, kth):
if stack is None or kth <= 0:
raise ValueError("Invalid Parameters")
if kth == 1:
return stack.pop()
top_element = stack.pop()
removed_element = remov... | 26.148148 | 74 | 0.665722 |
a5df2799d530e3115997bd20a41f889fb8e38ea6 | 26,504 | py | Python | actionlib-1.11.13/src/actionlib/action_client.py | k-sawa/action_test_case2 | 40bc1a4f2984dc66392a852ef62d878596274666 | [
"BSD-3-Clause"
] | 17 | 2020-03-13T00:10:28.000Z | 2021-09-06T17:13:17.000Z | actionlib-1.11.13/src/actionlib/action_client.py | k-sawa/action_test_case2 | 40bc1a4f2984dc66392a852ef62d878596274666 | [
"BSD-3-Clause"
] | 1 | 2020-03-12T08:10:07.000Z | 2020-03-12T08:10:07.000Z | actionlib-1.11.13/src/actionlib/action_client.py | k-sawa/action_test_case2 | 40bc1a4f2984dc66392a852ef62d878596274666 | [
"BSD-3-Clause"
] | 3 | 2018-01-21T17:53:17.000Z | 2021-09-08T10:22:05.000Z | #! /usr/bin/env python
# Copyright (c) 2009, Willow Garage, 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:
#
# * Redistributions of source code must retain the above copyright
# no... | 42.136725 | 161 | 0.660768 |
8ebed95ed7a0d7fc4cc4a41515ee986b6c375f87 | 1,443 | py | Python | day18/main.py | kzabashta/advent-of-code-17 | e37ff0a211791b7c120c78269b7927d8d40583fe | [
"MIT"
] | null | null | null | day18/main.py | kzabashta/advent-of-code-17 | e37ff0a211791b7c120c78269b7927d8d40583fe | [
"MIT"
] | null | null | null | day18/main.py | kzabashta/advent-of-code-17 | e37ff0a211791b7c120c78269b7927d8d40583fe | [
"MIT"
] | null | null | null | #!/usr/bin/env python
registers = {}
def get_value(val):
try:
return int(val)
except:
return get_value(registers[val])
def play(instructions):
last_sound = 0
i = 0
while i < len(instructions):
instruction = instructions[i].strip()
command = instructio... | 27.226415 | 71 | 0.531532 |
b00e36896b1d8cf3fa8218d9a0a1291d3c9c17d1 | 793 | py | Python | src/abp_sim/scripts/plot_distance.py | koverman47/ABP-Simulation-Platform | ccaf5591fbf1967ae8df5cf3efd4a7e8e64ddd10 | [
"MIT"
] | 3 | 2020-11-14T02:21:34.000Z | 2020-11-14T02:23:30.000Z | src/abp_sim/scripts/plot_distance.py | koverman47/ABP-Simulation-Platform | ccaf5591fbf1967ae8df5cf3efd4a7e8e64ddd10 | [
"MIT"
] | null | null | null | src/abp_sim/scripts/plot_distance.py | koverman47/ABP-Simulation-Platform | ccaf5591fbf1967ae8df5cf3efd4a7e8e64ddd10 | [
"MIT"
] | 2 | 2020-12-03T01:50:22.000Z | 2022-03-22T22:18:49.000Z | #!/usr/bin/env python
import matplotlib.pyplot as plt
from math import sqrt
f = open('../logs/states.log', 'r')
truth = []
estimate = []
for line in f:
l = line.split(",")
assert len(l) == 5
l[4] = l[4].strip('\n')
if l[4] == 't':
truth.append(l[1:3])
elif l[4] == 'e':
estimate.a... | 19.825 | 47 | 0.556116 |
7046ea8889d2f2fe3b2a5843dc8d0b851ad68e44 | 1,660 | py | Python | tests/test_integration.py | mfussenegger/cr8ingest | 2511562c145210f361075cfaf5584604c27ebc6f | [
"BSD-3-Clause"
] | null | null | null | tests/test_integration.py | mfussenegger/cr8ingest | 2511562c145210f361075cfaf5584604c27ebc6f | [
"BSD-3-Clause"
] | null | null | null | tests/test_integration.py | mfussenegger/cr8ingest | 2511562c145210f361075cfaf5584604c27ebc6f | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
import os
import doctest
import subprocess
import functools
from cr8.run_crate import CrateNode, get_crate
crate_dir = get_crate('latest-nightly')
node = CrateNode(
crate_dir=crate_dir,
settings={
'cluster.name': 'cr8ingest-tests',
'http.port': '44200-44250'
})
de... | 22.739726 | 68 | 0.578313 |
21b0f3c2ebae5ce20139add00aca705513ea9a7f | 422 | py | Python | scripts/config.py | rameziophobia/top_video_creator | 6c8cbcf1577685ab8ddb37fb923ef4620a1062e9 | [
"MIT"
] | 1 | 2020-07-12T16:02:32.000Z | 2020-07-12T16:02:32.000Z | scripts/config.py | rameziophobia/top_video_creator | 6c8cbcf1577685ab8ddb37fb923ef4620a1062e9 | [
"MIT"
] | null | null | null | scripts/config.py | rameziophobia/top_video_creator | 6c8cbcf1577685ab8ddb37fb923ef4620a1062e9 | [
"MIT"
] | null | null | null | from datetime import timedelta
FIRST_VIDEO = 0
LAST_VIDEO = 100
CUT_PERCENT = 0.30
FILTER_BY_MONTH = True
TARGET_MONTH = 5
SINGLE_VIDEO_LENGTH = timedelta(seconds=25)
MONTH = ["Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "none"]
CARDS_TARGET_PAGE = 3
CARDS_START_PAGE = 0
... | 32.461538 | 101 | 0.706161 |
fa6a057c30212b4fe233eab4bffb1cdb7f020c34 | 7,032 | py | Python | skfda/representation/extrapolation.py | alejandro-ariza/scikit-fda | a3626eeaac81aac14660233ff7554ae9a1550434 | [
"BSD-3-Clause"
] | null | null | null | skfda/representation/extrapolation.py | alejandro-ariza/scikit-fda | a3626eeaac81aac14660233ff7554ae9a1550434 | [
"BSD-3-Clause"
] | null | null | null | skfda/representation/extrapolation.py | alejandro-ariza/scikit-fda | a3626eeaac81aac14660233ff7554ae9a1550434 | [
"BSD-3-Clause"
] | null | null | null | """Module with the extrapolation methods.
Defines methods to evaluate points outside the :term:`domain` range.
"""
import numpy as np
from .evaluator import Evaluator
class PeriodicExtrapolation(Evaluator):
"""Extends the :term:`domain` range periodically.
Examples:
>>> from skfda.datasets impor... | 29.923404 | 78 | 0.553612 |
98c3a4f29d1b923764799241f0eef037cf972009 | 26,617 | py | Python | topy/topology.py | iitrabhi/topy-1 | 970b18624ce1e720b6812f2c8a32341c749cb8d3 | [
"MIT"
] | 2 | 2021-06-23T12:41:21.000Z | 2021-06-23T13:44:05.000Z | topy/topology.py | iitrabhi/topy-1 | 970b18624ce1e720b6812f2c8a32341c749cb8d3 | [
"MIT"
] | null | null | null | topy/topology.py | iitrabhi/topy-1 | 970b18624ce1e720b6812f2c8a32341c749cb8d3 | [
"MIT"
] | null | null | null | """
# =============================================================================
# A class to optimise the topology of a design domain for defined boundary
# conditions. Data is read from an input file, see 'examples' directory.
#
# Author: William Hunter
# Copyright (C) 2008, 2015, William Hunter.
# ==============... | 45.499145 | 147 | 0.522936 |
72613a4eb8e2c09e80c2c105125e14b988afa6aa | 17,309 | py | Python | QFlow-lite/QFlow_class.py | jpzwolak/QFlow-suite | d34d74d8690908137adbce0e71587884758b5ecf | [
"MIT"
] | 30 | 2018-06-27T17:19:59.000Z | 2022-02-14T17:34:14.000Z | QFlow_class.py | jpzwolak/QFlow-lite | eff47b9cf5ae9c7248238f261ce91adb5cf58efa | [
"MIT"
] | null | null | null | QFlow_class.py | jpzwolak/QFlow-lite | eff47b9cf5ae9c7248238f261ce91adb5cf58efa | [
"MIT"
] | 7 | 2018-04-20T06:00:58.000Z | 2021-08-18T15:31:13.000Z | # Copyright 2017 The QFlow Team. All Rights Reserved.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOU... | 37.384449 | 117 | 0.561789 |
8a4d0b684e91504ef61717aa2f311daccf6bd769 | 373 | py | Python | codeEval/medium/reverse_groups.py | gauravsingh58/algo | 397859a53429e7a585e5f6964ad24146c6261326 | [
"WTFPL"
] | 1 | 2020-09-30T19:53:08.000Z | 2020-09-30T19:53:08.000Z | codeEval/medium/reverse_groups.py | gauravsingh58/algo | 397859a53429e7a585e5f6964ad24146c6261326 | [
"WTFPL"
] | null | null | null | codeEval/medium/reverse_groups.py | gauravsingh58/algo | 397859a53429e7a585e5f6964ad24146c6261326 | [
"WTFPL"
] | 1 | 2020-10-15T09:10:57.000Z | 2020-10-15T09:10:57.000Z | import sys
def reverse_groups(ls, k):
res = []
for i in xrange(len(ls)//k):
l = ls[i*k:(i+1)*k]
l.reverse()
res.append(l)
res.append(ls[(len(ls)//k) * k:])
return ",".join([x for l in res for x in l])
test_cases = open(sys.argv[1], 'r')
for test in test_cases:
ls, k = test.split(";")
print rev... | 23.3125 | 46 | 0.589812 |
0bb95a9ae3df04d82ef6f6aa588400a90ca3b238 | 28,855 | py | Python | tencentcloud/cms/v20190321/models.py | fxh123/tencentcloud-sdk-python | 32decd510b13a4d86ed805643f8d3b7b088494fc | [
"Apache-2.0"
] | null | null | null | tencentcloud/cms/v20190321/models.py | fxh123/tencentcloud-sdk-python | 32decd510b13a4d86ed805643f8d3b7b088494fc | [
"Apache-2.0"
] | null | null | null | tencentcloud/cms/v20190321/models.py | fxh123/tencentcloud-sdk-python | 32decd510b13a4d86ed805643f8d3b7b088494fc | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf8 -*-
# Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. 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... | 25.311404 | 150 | 0.59598 |
6f387fcadb3d13cbe5aea1c9ab662a618d55b569 | 18,236 | py | Python | tests/test_text.py | chouette254/quo | 8979afd118e77d3d0f93f9fbe8711efada7158c5 | [
"MIT"
] | 5 | 2021-06-17T21:06:39.000Z | 2022-03-11T06:45:51.000Z | tests/test_text.py | chouette254/quo | 8979afd118e77d3d0f93f9fbe8711efada7158c5 | [
"MIT"
] | 39 | 2021-07-19T19:36:18.000Z | 2022-02-23T14:55:08.000Z | tests/test_text.py | secretuminc/quo | c4f77d52f015c612d32ed0fc2fc79545af598f10 | [
"MIT"
] | 1 | 2021-05-31T17:19:15.000Z | 2021-05-31T17:19:15.000Z | from io import StringIO
import pytest
from quo import Console
from quo.text import Span, Text
from quo.measure import Measurement
from quo.style import Style
def test_span():
span = Span(1, 10, "foo")
repr(span)
assert bool(span)
assert not Span(10, 10, "foo")
def test_span_split():
assert Span... | 25.757062 | 184 | 0.579349 |
b59ef237d09a95dfd20fc594929265cc5818d39e | 1,785 | py | Python | openGaussBase/testcase/utils/ComThread.py | opengauss-mirror/Yat | aef107a8304b94e5d99b4f1f36eb46755eb8919e | [
"MulanPSL-1.0"
] | null | null | null | openGaussBase/testcase/utils/ComThread.py | opengauss-mirror/Yat | aef107a8304b94e5d99b4f1f36eb46755eb8919e | [
"MulanPSL-1.0"
] | null | null | null | openGaussBase/testcase/utils/ComThread.py | opengauss-mirror/Yat | aef107a8304b94e5d99b4f1f36eb46755eb8919e | [
"MulanPSL-1.0"
] | null | null | null | """
Copyright (c) 2022 Huawei Technologies Co.,Ltd.
openGauss is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, W... | 26.25 | 84 | 0.653221 |
e4bb2c28b5395dbf027b09aa55acf65cf1c5f656 | 3,224 | py | Python | jwql/utils/constants.py | DanielKuebi/jwql | 4c48b0a359fdcf92f15e0a6e92b5ddf85d1f91fd | [
"BSD-3-Clause"
] | null | null | null | jwql/utils/constants.py | DanielKuebi/jwql | 4c48b0a359fdcf92f15e0a6e92b5ddf85d1f91fd | [
"BSD-3-Clause"
] | null | null | null | jwql/utils/constants.py | DanielKuebi/jwql | 4c48b0a359fdcf92f15e0a6e92b5ddf85d1f91fd | [
"BSD-3-Clause"
] | null | null | null | """Globally defined and used variables for the ``jwql`` project.
Authors
-------
- Johannes Sahlmann
Use
---
To print the JWST instrument names do:
::
from jwql.utils import constants
print(constants.JWST_INSTRUMENT_NAMES)
inventory, keywords = monitor_mast.jwst_inventory()
Refe... | 39.317073 | 92 | 0.568238 |
b942bc7d49ded4f4c159d254d0eb0d5431077c14 | 2,208 | py | Python | tests/unit/varmour/test_VarmourSyslogMsg.py | aristanetworks/DirectFlowAssist | 16c594cb42edd8aa084c6dbb931c87bbdff81ed0 | [
"Apache-2.0"
] | null | null | null | tests/unit/varmour/test_VarmourSyslogMsg.py | aristanetworks/DirectFlowAssist | 16c594cb42edd8aa084c6dbb931c87bbdff81ed0 | [
"Apache-2.0"
] | null | null | null | tests/unit/varmour/test_VarmourSyslogMsg.py | aristanetworks/DirectFlowAssist | 16c594cb42edd8aa084c6dbb931c87bbdff81ed0 | [
"Apache-2.0"
] | null | null | null | #
# Copyright (c) 2015 Arista Networks, Inc. All rights reserved.
# Arista Networks, Inc. Confidential and Proprietary.
#
# pylint: disable = line-too-long
import sys
# sys.path.extend(['./persist_common', './persist_chkp'])
import unittest
import logging
from directflow_assist import VarmourSyslogMsg
# Test data
P... | 39.428571 | 273 | 0.689764 |
0ffa846e2ce0ede0d7e4ea56ae11759859f65c1b | 3,318 | py | Python | tests/common/fixtures/conn_graph_facts.py | shubav/sonic-mgmt | 0ff71b907a55489bb4ed7d17b1682380fd459bf2 | [
"Apache-2.0"
] | 132 | 2016-10-19T12:34:44.000Z | 2022-03-16T09:00:39.000Z | tests/common/fixtures/conn_graph_facts.py | shubav/sonic-mgmt | 0ff71b907a55489bb4ed7d17b1682380fd459bf2 | [
"Apache-2.0"
] | 3,152 | 2016-09-21T23:05:58.000Z | 2022-03-31T23:29:08.000Z | tests/common/fixtures/conn_graph_facts.py | shubav/sonic-mgmt | 0ff71b907a55489bb4ed7d17b1682380fd459bf2 | [
"Apache-2.0"
] | 563 | 2016-09-20T01:00:15.000Z | 2022-03-31T22:43:54.000Z | import pytest
import os
import six
import yaml
@pytest.fixture(scope="module")
def conn_graph_facts(duthosts, localhost):
return get_graph_facts(duthosts[0], localhost,
[dh.hostname for dh in duthosts])
@pytest.fixture(scope="module")
def fanout_graph_facts(localhost, duthosts, rand_o... | 42 | 106 | 0.66094 |
4307773e19e3d5cca1e8bd68927a833817439e00 | 93 | py | Python | example.py | vins9100/code-refiney-bq | c6d31fea11e4ac81df245a4bac5ecc8bdb31ebf3 | [
"Apache-2.0"
] | null | null | null | example.py | vins9100/code-refiney-bq | c6d31fea11e4ac81df245a4bac5ecc8bdb31ebf3 | [
"Apache-2.0"
] | 1 | 2021-06-07T09:56:38.000Z | 2021-06-07T10:15:05.000Z | example.py | vins9100/code-refiney-bq | c6d31fea11e4ac81df245a4bac5ecc8bdb31ebf3 | [
"Apache-2.0"
] | 2 | 2021-06-07T09:27:20.000Z | 2021-06-08T13:22:10.000Z | def add(a, b):
return a+b
def substract(a,b):
return a*b
def divide(a,b):
return a/b
| 10.333333 | 19 | 0.612903 |
5191e93246258c9cab3c0983f7f5ec20de92a3e9 | 31,579 | py | Python | src/masonite/orm/grammar/BaseGrammar.py | corentinalcoy/orm | 9c6d5c636613019af6cf010a1383be28f9726bc7 | [
"MIT"
] | null | null | null | src/masonite/orm/grammar/BaseGrammar.py | corentinalcoy/orm | 9c6d5c636613019af6cf010a1383be28f9726bc7 | [
"MIT"
] | null | null | null | src/masonite/orm/grammar/BaseGrammar.py | corentinalcoy/orm | 9c6d5c636613019af6cf010a1383be28f9726bc7 | [
"MIT"
] | null | null | null | import re
from ..expressions.expressions import (
SubGroupExpression,
SubSelectExpression,
SelectExpression,
BetweenExpression,
)
class BaseGrammar:
"""The keys in this dictionary is how the ORM will reference these aggregates
The values on the right are the matching functions for the gramm... | 31.674022 | 98 | 0.535419 |
c2fa65d2e4453cf712298e50075f47c236a04850 | 1,030 | py | Python | LeetCode/0005_longest_palindromic_substr.py | KanegaeGabriel/ye-olde-interview-prep-grind | 868362872523a5688f49ab48efb09c3008e0db4d | [
"MIT"
] | 1 | 2020-05-13T19:16:23.000Z | 2020-05-13T19:16:23.000Z | LeetCode/0005_longest_palindromic_substr.py | KanegaeGabriel/ye-olde-interview-prep-grind | 868362872523a5688f49ab48efb09c3008e0db4d | [
"MIT"
] | null | null | null | LeetCode/0005_longest_palindromic_substr.py | KanegaeGabriel/ye-olde-interview-prep-grind | 868362872523a5688f49ab48efb09c3008e0db4d | [
"MIT"
] | null | null | null | def isPalindrome(s):
return s == s[::-1]
# O(n^3) time, O(1) space
def longestPalindrome1(s):
start, end = 0, 0
for i in range(len(s)):
for j in range(i, len(s)):
if isPalindrome(s[i:j+1]):
if len(s[i:j+1]) > end-start:
start, end = i, j+1... | 27.105263 | 58 | 0.524272 |
45f6534776eeb22de85c69c5fcfd0e0c78e3512e | 2,869 | py | Python | src/nn.py | shilpakk95/TIPR-Assignment-1 | 24db36f7a515a8a247b0023dae44756e9281b240 | [
"MIT"
] | null | null | null | src/nn.py | shilpakk95/TIPR-Assignment-1 | 24db36f7a515a8a247b0023dae44756e9281b240 | [
"MIT"
] | null | null | null | src/nn.py | shilpakk95/TIPR-Assignment-1 | 24db36f7a515a8a247b0023dae44756e9281b240 | [
"MIT"
] | null | null | null | import math
import lsh
import sklearn
import operator
import numpy as np
from sklearn.neighbors import KNeighborsClassifier
from sklearn.metrics import f1_score
def euclidean_distance(v1, v2, length):
distance = 0
D = np.subtract(v1,v2)
distance = math.sqrt(np.dot(D,np.transpose(D)))
retu... | 33.752941 | 83 | 0.66504 |
4d5bcc1056673c7262f9de38cd78aaa346353b7d | 1,641 | py | Python | test/test_routing.py | flubshi/script.module.inputstreamhelper | a5febb67922e11d8cbe2dfb297754e3951ca9678 | [
"MIT"
] | null | null | null | test/test_routing.py | flubshi/script.module.inputstreamhelper | a5febb67922e11d8cbe2dfb297754e3951ca9678 | [
"MIT"
] | null | null | null | test/test_routing.py | flubshi/script.module.inputstreamhelper | a5febb67922e11d8cbe2dfb297754e3951ca9678 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# pylint: disable=missing-docstring
from __future__ import absolute_import, division, print_function, unicode_literals
import unittest
import addon
xbmc = __import__('xbmc')
xbmcaddon = __import__('xbmcaddon')
xbmcgui = __import__('xbmcgui')
xbmcvfs = __import__('xbmcvfs')
plugin = addon.plug... | 41.025 | 160 | 0.712371 |
8c63ea667717dfc0c0c0eef24db090f8eb43a31b | 727 | py | Python | uz/tests/client/test_model.py | rubmu/telegram-uz-bot | df13d098121debaad7f25ec303371c3374a17fea | [
"MIT"
] | 57 | 2016-06-13T21:06:37.000Z | 2022-02-19T13:49:51.000Z | uz/tests/client/test_model.py | rubmu/telegram-uz-bot | df13d098121debaad7f25ec303371c3374a17fea | [
"MIT"
] | 7 | 2016-05-19T16:16:32.000Z | 2016-07-02T06:54:00.000Z | uz/tests/client/test_model.py | rubmu/telegram-uz-bot | df13d098121debaad7f25ec303371c3374a17fea | [
"MIT"
] | 28 | 2016-05-19T08:29:18.000Z | 2021-12-06T02:06:05.000Z | from uz.client.model import Train, CoachType, Coach, Station, UZTimestamp
def assert_model(klass, dikt):
instance = klass.from_dict(dikt)
assert instance.to_dict() == dikt
exec('assert %r.to_dict() == %r' % (instance, dikt))
assert instance == klass.from_dict(dikt)
assert str(instance)
return ... | 22.71875 | 73 | 0.735901 |
cf3e16fcc1f75e88b742b71dbe7d6afc39414b9c | 4,829 | py | Python | PLM/ui/layouts/SignIn.py | vtta2008/pipelineTool | 2431d2fc987e3b31f2a6a63427fee456fa0765a0 | [
"Apache-2.0"
] | 7 | 2017-12-22T02:49:58.000Z | 2018-05-09T05:29:06.000Z | PLM/ui/layouts/SignIn.py | vtta2008/pipelineTool | 2431d2fc987e3b31f2a6a63427fee456fa0765a0 | [
"Apache-2.0"
] | null | null | null | PLM/ui/layouts/SignIn.py | vtta2008/pipelineTool | 2431d2fc987e3b31f2a6a63427fee456fa0765a0 | [
"Apache-2.0"
] | 3 | 2019-03-11T21:54:52.000Z | 2019-11-25T11:23:17.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Script Name: SignIn.py
Author: Do Trinh/Jimmy - 3D artist.
Description:
Sign In layout.
"""
# -------------------------------------------------------------------------------------------------------------
""" Import """
# Python
import sys, requests
from functo... | 34.492857 | 148 | 0.549803 |
09621071fe07998bd7b8482c617135a62e76de56 | 4,779 | py | Python | ppo_agent/vit.py | Zed-Wu/ManiSkill-Learn | 8056fe327752cd0863f8730672fe62bd85a0ec12 | [
"Apache-2.0"
] | null | null | null | ppo_agent/vit.py | Zed-Wu/ManiSkill-Learn | 8056fe327752cd0863f8730672fe62bd85a0ec12 | [
"Apache-2.0"
] | null | null | null | ppo_agent/vit.py | Zed-Wu/ManiSkill-Learn | 8056fe327752cd0863f8730672fe62bd85a0ec12 | [
"Apache-2.0"
] | null | null | null | import torch
from torch import nn
from einops import rearrange, repeat
from einops.layers.torch import Rearrange
# helpers
def pair(t):
return t if isinstance(t, tuple) else (t, t)
# classes
class PreNorm(nn.Module):
def __init__(self, dim, fn):
super().__init__()
self.norm = nn.LayerNorm... | 31.649007 | 139 | 0.574388 |
0eb616545638ffe3fe104e3fd745a9c8d05e7677 | 16,046 | py | Python | tests/test_confirmable.py | pffs/flask-security | 89616523a8e66802e2377ff6e7a89ab6aecce6f0 | [
"MIT"
] | null | null | null | tests/test_confirmable.py | pffs/flask-security | 89616523a8e66802e2377ff6e7a89ab6aecce6f0 | [
"MIT"
] | null | null | null | tests/test_confirmable.py | pffs/flask-security | 89616523a8e66802e2377ff6e7a89ab6aecce6f0 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
test_confirmable
~~~~~~~~~~~~~~~~
Confirmable tests
"""
import json
import time
import pytest
from flask import Flask
from utils import authenticate, logout
from flask_security.core import UserMixin
from flask_security.confirmable import generate_confirmation_token
from flask... | 36.468182 | 88 | 0.682226 |
f8c8094ac0d1fee5b40102ebb5eb67c85c88f78d | 89,106 | py | Python | awx/main/tests/unit/test_tasks.py | shrinaththube/awx | d0ac02826537343880b09282666639cf5135779c | [
"Apache-2.0"
] | 1 | 2020-07-10T14:44:16.000Z | 2020-07-10T14:44:16.000Z | awx/main/tests/unit/test_tasks.py | shrinaththube/awx | d0ac02826537343880b09282666639cf5135779c | [
"Apache-2.0"
] | null | null | null | awx/main/tests/unit/test_tasks.py | shrinaththube/awx | d0ac02826537343880b09282666639cf5135779c | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import configparser
import json
import os
import shutil
import tempfile
from backports.tempfile import TemporaryDirectory
import fcntl
from unittest import mock
import pytest
import yaml
import jinja2
from django.conf import settings
from awx.main.models import (
AdHocCommand,
Creden... | 37.804837 | 153 | 0.603888 |
ef5328a531462424e754c96fd7b78df31e8eb4b1 | 4,548 | py | Python | tests/bs3/test_horizontal_fields.py | rpkilby/django-template-forms | 5099d87d661a6a313df49fa484afd94f145e65bc | [
"BSD-3-Clause"
] | 1 | 2021-01-29T11:53:32.000Z | 2021-01-29T11:53:32.000Z | tests/bs3/test_horizontal_fields.py | rpkilby/django-template-forms | 5099d87d661a6a313df49fa484afd94f145e65bc | [
"BSD-3-Clause"
] | 5 | 2017-11-29T11:01:56.000Z | 2018-02-05T23:34:08.000Z | tests/bs3/test_horizontal_fields.py | rpkilby/django-template-forms | 5099d87d661a6a313df49fa484afd94f145e65bc | [
"BSD-3-Clause"
] | null | null | null |
from django import forms
from django.test import TestCase
from template_forms import bs3
def startswith_a(value):
if value.startswith('a'):
return value
raise forms.ValidationError('Value must start with "a".')
def not_now(value):
if value:
raise forms.ValidationError('I cannot let you... | 31.583333 | 104 | 0.511873 |
0a1c218876c57a3dbea923ea532e66f4e0e0f2b0 | 465 | py | Python | setup.py | afroisalreadyinu/logfigure | 7d52b2c3afab9069a40592389d7e2855d1ec2b2c | [
"MIT"
] | 3 | 2016-05-10T13:14:48.000Z | 2022-03-16T08:47:09.000Z | setup.py | afroisalreadyinu/logfigure | 7d52b2c3afab9069a40592389d7e2855d1ec2b2c | [
"MIT"
] | null | null | null | setup.py | afroisalreadyinu/logfigure | 7d52b2c3afab9069a40592389d7e2855d1ec2b2c | [
"MIT"
] | null | null | null | import os
from setuptools import setup
dependencies = []
setup(
name = "logfigure",
version = "0.01",
author = "Ulas Tuerkmen",
author_email = "ulas.tuerkmen@gmail.com",
description = ("Logging configuration that respects your sanity"),
install_requires = dependencies,
packages=['logfigure... | 27.352941 | 79 | 0.688172 |
ec221842e51e10b16efcf40b54293a60cd98add1 | 2,981 | py | Python | deluca/igpc/ilqr.py | google/deluca | 626ade7bfa44afc52e6ffb9a9e6e94258b4dc024 | [
"Apache-2.0"
] | 105 | 2020-12-10T05:08:28.000Z | 2022-03-17T03:53:10.000Z | deluca/igpc/ilqr.py | google/deluca | 626ade7bfa44afc52e6ffb9a9e6e94258b4dc024 | [
"Apache-2.0"
] | 36 | 2020-12-11T11:47:36.000Z | 2021-08-25T09:40:07.000Z | deluca/igpc/ilqr.py | google/deluca | 626ade7bfa44afc52e6ffb9a9e6e94258b4dc024 | [
"Apache-2.0"
] | 16 | 2020-12-10T16:43:31.000Z | 2022-03-17T02:02:18.000Z | # Copyright 2021 The Deluca 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | 26.149123 | 80 | 0.5421 |
1f1c9ff1768ac666b2f5d26d4ac3dc62b28177e1 | 3,204 | py | Python | flaskutils/db/elasticsearch/connection.py | felipepina01/flask-philo | ad726f8e7a9204e8cc8977195c8989812710d04d | [
"Apache-2.0"
] | 1 | 2018-08-28T11:03:18.000Z | 2018-08-28T11:03:18.000Z | flaskutils/db/elasticsearch/connection.py | felipepina01/flask-philo | ad726f8e7a9204e8cc8977195c8989812710d04d | [
"Apache-2.0"
] | 32 | 2016-09-30T14:42:21.000Z | 2017-11-02T14:34:34.000Z | flaskutils/db/elasticsearch/connection.py | felipepina01/flask-philo | ad726f8e7a9204e8cc8977195c8989812710d04d | [
"Apache-2.0"
] | 7 | 2016-06-28T10:03:21.000Z | 2017-01-23T17:29:29.000Z | from .client import ElasticSearchClient
import elasticsearch
import sys
class ElasticSearchPool:
"""
"""
_shared_state = {}
def __init__(self):
self.__dict__ = self._shared_state
def ping(self, db='DEFAULT'):
return self.connections[db].ping()
def get_alias(self, db='DEFAUL... | 29.394495 | 79 | 0.615793 |
b205856c604ce06ba1a796ac013c120ff329b954 | 2,155 | py | Python | share/qt/extract_strings_qt.py | smartyinvestor/zijacoin | 6d4cccb0bbc8b5e0f283f7566a3822fa4c989e30 | [
"MIT"
] | 4 | 2019-01-04T22:39:29.000Z | 2019-03-07T09:35:44.000Z | share/qt/extract_strings_qt.py | smartyinvestor/zijacoin | 6d4cccb0bbc8b5e0f283f7566a3822fa4c989e30 | [
"MIT"
] | null | null | null | share/qt/extract_strings_qt.py | smartyinvestor/zijacoin | 6d4cccb0bbc8b5e0f283f7566a3822fa4c989e30 | [
"MIT"
] | 7 | 2018-08-18T09:42:44.000Z | 2019-06-06T05:28:29.000Z | #!/usr/bin/python
'''
Extract _("...") strings for translation and convert to Qt stringdefs so that
they can be picked up by Qt linguist.
'''
from __future__ import division,print_function,unicode_literals
from subprocess import Popen, PIPE
import glob
import operator
import os
import sys
OUT_CPP="qt/zijastrings.cpp"
... | 25.654762 | 105 | 0.618097 |
7fcce006ddcbaaf34e21249c9893ff83bb116b1f | 2,445 | py | Python | test/test_list_unspent_transaction_outputs_by_address_ri_blockchain_specific.py | Crypto-APIs/Crypto_APIs_2.0_SDK_Python | c59ebd914850622b2c6500c4c30af31fb9cecf0e | [
"MIT"
] | 5 | 2021-05-17T04:45:03.000Z | 2022-03-23T12:51:46.000Z | test/test_list_unspent_transaction_outputs_by_address_ri_blockchain_specific.py | Crypto-APIs/Crypto_APIs_2.0_SDK_Python | c59ebd914850622b2c6500c4c30af31fb9cecf0e | [
"MIT"
] | null | null | null | test/test_list_unspent_transaction_outputs_by_address_ri_blockchain_specific.py | Crypto-APIs/Crypto_APIs_2.0_SDK_Python | c59ebd914850622b2c6500c4c30af31fb9cecf0e | [
"MIT"
] | 2 | 2021-06-02T07:32:26.000Z | 2022-02-12T02:36:23.000Z | """
CryptoAPIs
Crypto APIs 2.0 is a complex and innovative infrastructure layer that radically simplifies the development of any Blockchain and Crypto related applications. Organized around REST, Crypto APIs 2.0 can assist both novice Bitcoin/Ethereum enthusiasts and crypto experts with the development of thei... | 56.860465 | 484 | 0.854397 |
75e1a7360b5bec965044efec18b982d7a0fdb284 | 5,281 | py | Python | source/code/services/lambda_service.py | eshack94/aws-ops-automator | 92e2419c133d79962cca4dc2ec473c6c1e2f1c66 | [
"MIT"
] | 1 | 2019-08-25T18:59:06.000Z | 2019-08-25T18:59:06.000Z | source/code/services/lambda_service.py | eshack94/aws-ops-automator | 92e2419c133d79962cca4dc2ec473c6c1e2f1c66 | [
"MIT"
] | null | null | null | source/code/services/lambda_service.py | eshack94/aws-ops-automator | 92e2419c133d79962cca4dc2ec473c6c1e2f1c66 | [
"MIT"
] | null | null | null | ######################################################################################################################
# Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. #
# ... | 46.734513 | 123 | 0.562393 |
8316afbd1474c2cb741ef3e00876f9a480a77c6a | 597 | py | Python | examples/save_trends_to_mongo.py | miaotiaotech/DouYin | e996ad99ce27e0d13f2856c497fd4b4f05f95b56 | [
"MIT"
] | 657 | 2018-10-24T16:58:04.000Z | 2022-03-15T03:58:04.000Z | examples/save_trends_to_mongo.py | 1997lw/DouYin | 5859f4db5258ad10926fddaa2b4074c85581d419 | [
"MIT"
] | 15 | 2018-10-30T09:40:11.000Z | 2020-08-09T13:58:31.000Z | examples/save_trends_to_mongo.py | 1997lw/DouYin | 5859f4db5258ad10926fddaa2b4074c85581d419 | [
"MIT"
] | 249 | 2018-10-25T07:12:14.000Z | 2022-02-21T07:49:58.000Z | import douyin
from douyin.structures import Topic, Music
# define handler
mongo_handler = douyin.handlers.MongoHandler()
# define downloader and specify handler
downloader = douyin.downloaders.VideoDownloader([mongo_handler])
for result in douyin.hot.trend():
for item in result.data:
# download videos of ... | 33.166667 | 64 | 0.686767 |
7091216ee8250868d640ae6cbd8fabcaf95a05cf | 1,701 | py | Python | plotly/validators/surface/hoverlabel/_font.py | faezs/plotly.py | 6009b5b9c746e5d2a2849ad255a4eb234b551ed7 | [
"MIT"
] | 1 | 2018-07-16T01:51:47.000Z | 2018-07-16T01:51:47.000Z | plotly/validators/surface/hoverlabel/_font.py | faezs/plotly.py | 6009b5b9c746e5d2a2849ad255a4eb234b551ed7 | [
"MIT"
] | null | null | null | plotly/validators/surface/hoverlabel/_font.py | faezs/plotly.py | 6009b5b9c746e5d2a2849ad255a4eb234b551ed7 | [
"MIT"
] | 1 | 2019-02-18T04:12:56.000Z | 2019-02-18T04:12:56.000Z | import _plotly_utils.basevalidators
class FontValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(
self, plotly_name='font', parent_name='surface.hoverlabel', **kwargs
):
super(FontValidator, self).__init__(
plotly_name=plotly_name,
parent_name=pare... | 37.8 | 76 | 0.544386 |
9130efb5d363b8b0fcb81aa5c461ef4f5d38588a | 8,865 | py | Python | src/validate_event.py | org97/incredible-citizen-bot | 08b8ce7a9761d0af0d10febd5c6ccbbf7ac2b0f4 | [
"MIT"
] | 2 | 2020-11-02T21:04:35.000Z | 2020-11-02T22:42:12.000Z | src/validate_event.py | org97/incredible-citizen-bot | 08b8ce7a9761d0af0d10febd5c6ccbbf7ac2b0f4 | [
"MIT"
] | null | null | null | src/validate_event.py | org97/incredible-citizen-bot | 08b8ce7a9761d0af0d10febd5c6ccbbf7ac2b0f4 | [
"MIT"
] | null | null | null | from telegram.ext import ConversationHandler, MessageHandler, Filters, CallbackQueryHandler, CallbackContext
from telegram import Update, InlineKeyboardButton, InlineKeyboardMarkup, ParseMode, ReplyKeyboardRemove
from models import User, Event, Validation
import strings as s
from menu import default_markup
from utils i... | 38.376623 | 110 | 0.6652 |
80ce8ba6556e1dc7f6333f0b7706194da13e1278 | 1,582 | py | Python | fasteners/__init__.py | gthiemonge/fasteners | 8c4c7d93322d6eb75bd02c551ec61679962a2024 | [
"Apache-2.0"
] | 2 | 2022-01-08T11:18:20.000Z | 2022-01-26T13:41:34.000Z | fasteners/__init__.py | gthiemonge/fasteners | 8c4c7d93322d6eb75bd02c551ec61679962a2024 | [
"Apache-2.0"
] | 4 | 2022-01-05T09:16:30.000Z | 2022-03-29T09:32:44.000Z | fasteners/__init__.py | gthiemonge/fasteners | 8c4c7d93322d6eb75bd02c551ec61679962a2024 | [
"Apache-2.0"
] | 1 | 2022-01-05T08:56:59.000Z | 2022-01-05T08:56:59.000Z | # -*- coding: utf-8 -*-
# Copyright (C) 2014 Yahoo! Inc. All Rights Reserved.
#
# 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.... | 32.285714 | 78 | 0.769279 |
31c4faf6f4c9e192b02940757bbf38fd2f49dfb1 | 2,427 | py | Python | revoice/trueenvelope.py | tuxzz/roca_prototype | cd2ba182b7b81c56314766f2f95ed2d9dd844dd6 | [
"Apache-2.0"
] | null | null | null | revoice/trueenvelope.py | tuxzz/roca_prototype | cd2ba182b7b81c56314766f2f95ed2d9dd844dd6 | [
"Apache-2.0"
] | null | null | null | revoice/trueenvelope.py | tuxzz/roca_prototype | cd2ba182b7b81c56314766f2f95ed2d9dd844dd6 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import scipy.signal as sp
from .common import *
from . import adaptivestft
def calcTrueEnvelope(x, order, nIter = 24, maxStep = 1.5):
nX = len(x)
assert(nX > order * 2)
# initialize the iteration using A0(k) = log(|X(k)|)
a = x.copy().astype(np.complex128)
# prepare iter
... | 32.797297 | 143 | 0.574784 |
9b65ea19ffdf9566c991f19718338a6c2c1e4e93 | 4,295 | py | Python | 2013/codegate-quals/vuln100/doit.py | sigma-random/pwntools-write-ups | b4b2d217d702e5e9bc2bede8e11105c89c2770a4 | [
"MIT"
] | 1 | 2015-06-14T14:59:35.000Z | 2015-06-14T14:59:35.000Z | 2013/codegate-quals/vuln100/doit.py | sigma-random/pwntools-write-ups | b4b2d217d702e5e9bc2bede8e11105c89c2770a4 | [
"MIT"
] | null | null | null | 2013/codegate-quals/vuln100/doit.py | sigma-random/pwntools-write-ups | b4b2d217d702e5e9bc2bede8e11105c89c2770a4 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from pwn import *
context(os='linux',arch='amd64')
# If a HOST is given on the cmdline, then assume that it is already running there
if 'HOST' in pwn.args:
HOST = pwn.args['HOST']
PORT = int(pwn.args.get('PORT', 6666))
else:
# Otherwise start the binary locally
HOST = 'localhost'
... | 31.580882 | 95 | 0.565541 |
efc1868b11e609ebb17a38e40c576637bd798445 | 27,053 | py | Python | Tests/Marketplace/Tests/upload_packs_test.py | SergeBakharev/content | d66cc274f5bf6f9f0e9ed7e4df1af7b6f305aacf | [
"MIT"
] | null | null | null | Tests/Marketplace/Tests/upload_packs_test.py | SergeBakharev/content | d66cc274f5bf6f9f0e9ed7e4df1af7b6f305aacf | [
"MIT"
] | 42 | 2022-03-11T10:52:26.000Z | 2022-03-31T01:50:42.000Z | Tests/Marketplace/Tests/upload_packs_test.py | SergeBakharev/content | d66cc274f5bf6f9f0e9ed7e4df1af7b6f305aacf | [
"MIT"
] | 1 | 2021-07-25T10:48:59.000Z | 2021-07-25T10:48:59.000Z | import copy
import json
import os
import pytest
from unittest.mock import patch
from Tests.Marketplace.upload_packs import get_packs_names, get_updated_private_packs, is_private_packs_updated
# disable-secrets-detection-start
class TestModifiedPacks:
@pytest.mark.parametrize("packs_names_input, expected_result",... | 44.568369 | 120 | 0.630614 |
db6a5537caea6805a1e1325b7f688f0d4bbd4319 | 1,826 | py | Python | apps/fifth_edition/migrations/0016_auto_20200402_2107.py | tylerfrenchx13/django-dnd | b0c78c51aebeed4195fd91a3e55c313c645f9c3b | [
"MIT"
] | null | null | null | apps/fifth_edition/migrations/0016_auto_20200402_2107.py | tylerfrenchx13/django-dnd | b0c78c51aebeed4195fd91a3e55c313c645f9c3b | [
"MIT"
] | null | null | null | apps/fifth_edition/migrations/0016_auto_20200402_2107.py | tylerfrenchx13/django-dnd | b0c78c51aebeed4195fd91a3e55c313c645f9c3b | [
"MIT"
] | null | null | null | # Generated by Django 3.0.2 on 2020-04-03 03:07
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('fifth_edition', '0015_equipment'),
]
operations = [
migrations.AddField(
model_name='physicalattack',
name='properti... | 39.695652 | 326 | 0.543812 |
796ee6de46b004f16b0adc85799532af11555895 | 7,731 | py | Python | DDPG & TD3/main.py | baturaysaglam/AC-Off-POC | 0bf1b450190f0f16fd42423e303b0e558fd51015 | [
"MIT"
] | null | null | null | DDPG & TD3/main.py | baturaysaglam/AC-Off-POC | 0bf1b450190f0f16fd42423e303b0e558fd51015 | [
"MIT"
] | null | null | null | DDPG & TD3/main.py | baturaysaglam/AC-Off-POC | 0bf1b450190f0f16fd42423e303b0e558fd51015 | [
"MIT"
] | null | null | null | import argparse
import os
import socket
import gym
import numpy as np
import torch
import DDPG
import AC_Off_POC_DDPG
import TD3
import AC_Off_POC_TD3
import utils
# Runs policy for X episodes and returns average reward
# A fixed seed is used for the eval environment
def evaluate_policy(agent, env_name, seed, eval_... | 41.789189 | 130 | 0.611952 |
2663c42c30e26c941abfb1119ad29c4bce4ce4cb | 4,079 | py | Python | parts/convert_Graph_to_Pseudodescendant.py | mlaradji/dtd | e971e2e67b68f3146443eadf220015542d28b7f6 | [
"MIT"
] | 1 | 2018-07-27T00:39:20.000Z | 2018-07-27T00:39:20.000Z | parts/convert_Graph_to_Pseudodescendant.py | mlaradji/dtd | e971e2e67b68f3146443eadf220015542d28b7f6 | [
"MIT"
] | null | null | null | parts/convert_Graph_to_Pseudodescendant.py | mlaradji/dtd | e971e2e67b68f3146443eadf220015542d28b7f6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Jun 25 11:19:42 2018
@author: mohamed
"""
# =============================================================================
# This library could be imported via:
# from k5descendants import chainlist as cl
# ============================================... | 29.345324 | 87 | 0.499142 |
533370bbc533416b829b9fe6f4bd3471d07f8555 | 10,166 | py | Python | engr/engineering/doc_events/delivery_note.py | mohsinalimat/engr | 4ad423e967cf975ba1c94d6e40fccd9a19a41a46 | [
"MIT"
] | 2 | 2021-08-03T12:40:50.000Z | 2021-08-03T19:31:48.000Z | engr/engineering/doc_events/delivery_note.py | mohsinalimat/engr | 4ad423e967cf975ba1c94d6e40fccd9a19a41a46 | [
"MIT"
] | null | null | null | engr/engineering/doc_events/delivery_note.py | mohsinalimat/engr | 4ad423e967cf975ba1c94d6e40fccd9a19a41a46 | [
"MIT"
] | 4 | 2021-04-29T16:14:58.000Z | 2022-02-16T20:47:25.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import frappe
from frappe.model.mapper import get_mapped_doc
from frappe import _
from frappe.utils import flt, cint, get_url_to_form
from erpnext.stock.doctype.batch.batch import set_batch_nos
from erpnext.stock.doctype.delivery_note.delivery_note import... | 36.177936 | 202 | 0.728999 |
52d4b78b109513417a84ffa0d91e1822fd03f4d3 | 1,660 | py | Python | config/wsgi.py | arnelimperial/anserably | 2c8b58547450f6b647b145c30a8821f307d9cd25 | [
"MIT"
] | null | null | null | config/wsgi.py | arnelimperial/anserably | 2c8b58547450f6b647b145c30a8821f307d9cd25 | [
"MIT"
] | 10 | 2021-03-19T03:59:42.000Z | 2022-01-13T02:46:24.000Z | config/wsgi.py | arnelimperial/anserably | 2c8b58547450f6b647b145c30a8821f307d9cd25 | [
"MIT"
] | null | null | null | """
WSGI config for Anserably Project project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPL... | 42.564103 | 79 | 0.801807 |
3abe706b66503ef442894dc540d118cd6caa27a9 | 4,278 | py | Python | pyunitree/parsers/low_level.py | RumblingTurtle/unitreepy | 4153b948abdd631e6b19b2df49588721a32fcdf4 | [
"MIT"
] | null | null | null | pyunitree/parsers/low_level.py | RumblingTurtle/unitreepy | 4153b948abdd631e6b19b2df49588721a32fcdf4 | [
"MIT"
] | null | null | null | pyunitree/parsers/low_level.py | RumblingTurtle/unitreepy | 4153b948abdd631e6b19b2df49588721a32fcdf4 | [
"MIT"
] | 2 | 2021-10-01T12:25:31.000Z | 2021-10-01T12:28:59.000Z | from numpy import zeros, float32
from ..robots._default.constants import NUM_MOTORS, NUM_LEGS
# TODO: Add parsing
# ///////////////////////////////
# LEGGED SDK LOW LEVEL SEND PACKET STRUCTURE
# ///////////////////////////////
# Low level send packet is the array of 60 floats according to joint mapping of 12 motors:... | 33.162791 | 90 | 0.612669 |
a0347419ed77a536a407193db67bcd2ca63b56a7 | 10,197 | py | Python | tests/vasp/test_structure.py | pmrv/pyiron | 3631053231761510a2fd4b1416a93adee44fd6f7 | [
"BSD-3-Clause"
] | null | null | null | tests/vasp/test_structure.py | pmrv/pyiron | 3631053231761510a2fd4b1416a93adee44fd6f7 | [
"BSD-3-Clause"
] | null | null | null | tests/vasp/test_structure.py | pmrv/pyiron | 3631053231761510a2fd4b1416a93adee44fd6f7 | [
"BSD-3-Clause"
] | null | null | null | # coding: utf-8
# Copyright (c) Max-Planck-Institut für Eisenforschung GmbH - Computational Materials Design (CM) Department
# Distributed under the terms of "New BSD License", see the LICENSE file.
import unittest
import os
import posixpath
import numpy as np
from pyiron.atomistics.structure.atoms import Atoms
from ... | 46.990783 | 108 | 0.584388 |
91d6f7facd74bec607396cd4dd591e21a6b0ba69 | 1,543 | py | Python | tests/local/warehouse/metrics/test_min_max_length.py | udemy/soda-sql | 53dd2218770c74367787f1d85ee0d48d498b51eb | [
"Apache-2.0"
] | null | null | null | tests/local/warehouse/metrics/test_min_max_length.py | udemy/soda-sql | 53dd2218770c74367787f1d85ee0d48d498b51eb | [
"Apache-2.0"
] | 1 | 2021-02-23T20:47:40.000Z | 2021-03-06T09:03:48.000Z | tests/local/warehouse/metrics/test_min_max_length.py | udemy/soda-sql | 53dd2218770c74367787f1d85ee0d48d498b51eb | [
"Apache-2.0"
] | 1 | 2021-02-23T20:41:24.000Z | 2021-02-23T20:41:24.000Z | # Copyright 2020 Soda
# 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
#... | 35.883721 | 82 | 0.668179 |
a2dad7c33334e0a763aaf87c4b198c86deae60cc | 69,754 | py | Python | core/teachers.py | neuroailab/RAFT | 03e532cdcad35d3582b053035ec10257c73cbaaa | [
"BSD-3-Clause"
] | null | null | null | core/teachers.py | neuroailab/RAFT | 03e532cdcad35d3582b053035ec10257c73cbaaa | [
"BSD-3-Clause"
] | null | null | null | core/teachers.py | neuroailab/RAFT | 03e532cdcad35d3582b053035ec10257c73cbaaa | [
"BSD-3-Clause"
] | null | null | null | from functools import partial
from pathlib import Path
import argparse, yaml
import copy
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torchvision import transforms
from raft import (RAFT,
CentroidRegressor,
ThingsClassifier,
... | 37.786566 | 141 | 0.577874 |
47479541c1b75b760f54f90ec5f74bfff0ceda4b | 4,367 | py | Python | gibson2/external/motion/motion_planners/rrt_star.py | y-veys/iGibson | 1442c50187f8fcef118b097c195fef707eef04cb | [
"MIT"
] | 2 | 2020-10-29T02:21:27.000Z | 2021-07-26T07:38:23.000Z | gibson2/external/motion/motion_planners/rrt_star.py | y-veys/iGibson | 1442c50187f8fcef118b097c195fef707eef04cb | [
"MIT"
] | null | null | null | gibson2/external/motion/motion_planners/rrt_star.py | y-veys/iGibson | 1442c50187f8fcef118b097c195fef707eef04cb | [
"MIT"
] | 1 | 2021-07-30T16:56:56.000Z | 2021-07-30T16:56:56.000Z | from random import random
from time import time
from .utils import INF, argmin
class OptimalNode(object):
def __init__(self, config, parent=None, d=0, path=[], iteration=None):
self.config = config
self.parent = parent
self.children = set()
self.d = d
self.path = path
... | 34.385827 | 141 | 0.578429 |
0516258f048a6653513e1c6ffac1ef6a26bae89c | 2,823 | py | Python | dbdaora/geospatial/service/__init__.py | dutradda/sqldataclass | 5c87a3818e9d736bbf5e1438edc5929a2f5acd3f | [
"MIT"
] | 21 | 2019-10-14T14:33:33.000Z | 2022-02-11T04:43:07.000Z | dbdaora/geospatial/service/__init__.py | dutradda/sqldataclass | 5c87a3818e9d736bbf5e1438edc5929a2f5acd3f | [
"MIT"
] | null | null | null | dbdaora/geospatial/service/__init__.py | dutradda/sqldataclass | 5c87a3818e9d736bbf5e1438edc5929a2f5acd3f | [
"MIT"
] | 1 | 2019-09-29T23:51:44.000Z | 2019-09-29T23:51:44.000Z | from logging import Logger, getLogger
from typing import Any, AsyncGenerator, Optional, Sequence, Tuple, Union
from cachetools import Cache
from ...circuitbreaker import AsyncCircuitBreaker
from ...entity import Entity
from ...keys import FallbackKey
from ...repository import MemoryRepository
from ...service import C... | 34.012048 | 79 | 0.65108 |
8cd2b1f3576287f6560eafd65ce2b6e8d501362c | 128 | py | Python | tests/example_labeller/admin.py | shril/image-annotation | a4fba3d73c7de74e0c4238a744872497b8ca2fb6 | [
"MIT"
] | 94 | 2020-08-05T09:46:52.000Z | 2022-03-31T19:10:26.000Z | tests/example_labeller/admin.py | shril/image-annotation | a4fba3d73c7de74e0c4238a744872497b8ca2fb6 | [
"MIT"
] | 15 | 2020-11-14T16:26:18.000Z | 2022-01-24T16:38:45.000Z | tests/example_labeller/admin.py | shril/image-annotation | a4fba3d73c7de74e0c4238a744872497b8ca2fb6 | [
"MIT"
] | 20 | 2020-07-19T12:17:04.000Z | 2021-12-11T13:13:18.000Z | from django.contrib import admin
from . import models
# Register your models here.
admin.site.register(models.ImageWithLabels)
| 21.333333 | 43 | 0.8125 |
ccebc2a4b8c9de511e22fed61ee9953cd03190a7 | 3,601 | py | Python | load/load_nrrd_small_1.py | ZhixiangWang-CN/simple-faster-rcnn-pytorch | 67110d9877bc37bfa428ad7c30edaac7dcd7cb96 | [
"MIT"
] | null | null | null | load/load_nrrd_small_1.py | ZhixiangWang-CN/simple-faster-rcnn-pytorch | 67110d9877bc37bfa428ad7c30edaac7dcd7cb96 | [
"MIT"
] | null | null | null | load/load_nrrd_small_1.py | ZhixiangWang-CN/simple-faster-rcnn-pytorch | 67110d9877bc37bfa428ad7c30edaac7dcd7cb96 | [
"MIT"
] | null | null | null | import torch
from torch.utils.data import Dataset, DataLoader
from load.normalization import min_max_normalize
from skimage.transform import resize
import nrrd
import os
import matplotlib.pyplot as plt
import numpy as np
import cv2
root = ""
# -----------------ready the dataset--------------------------
def read_i... | 29.516393 | 90 | 0.615107 |
19449204348b364cb9c56c27103f8e1b41f38770 | 391 | py | Python | instructors/need-rework/5_control_statements_and_exceptions_hierarchy/jason_guess.py | mgadagin/PythonClass | 70b370362d75720b3fb0e1d6cc8158f9445e9708 | [
"MIT"
] | 46 | 2017-09-27T20:19:36.000Z | 2020-12-08T10:07:19.000Z | instructors/need-rework/5_control_statements_and_exceptions_hierarchy/jason_guess.py | mgadagin/PythonClass | 70b370362d75720b3fb0e1d6cc8158f9445e9708 | [
"MIT"
] | 6 | 2018-01-09T08:07:37.000Z | 2020-09-07T12:25:13.000Z | instructors/need-rework/5_control_statements_and_exceptions_hierarchy/jason_guess.py | mgadagin/PythonClass | 70b370362d75720b3fb0e1d6cc8158f9445e9708 | [
"MIT"
] | 18 | 2017-10-10T02:06:51.000Z | 2019-12-01T10:18:13.000Z | def guess_number():
answer=None
our_number=21
while answer != our_number:
answer=int(raw_input('guess me'))
if answer == our_number:
print "correct"
return
elif answer > our_number:
print "no, higher"
else:
print "no, lower"
... | 20.578947 | 41 | 0.547315 |
8a51d6fab21df8168fdd4fed3aee2bd137e68c8a | 597 | py | Python | kube/task_generation/pick_edge.py | ZettaAI/Synaptor | e425b4c744fca093ee5c63f41b82b3cae7898af4 | [
"MIT"
] | 7 | 2018-04-01T18:18:23.000Z | 2021-09-13T07:02:16.000Z | kube/task_generation/pick_edge.py | ZettaAI/Synaptor | e425b4c744fca093ee5c63f41b82b3cae7898af4 | [
"MIT"
] | 5 | 2018-10-24T19:36:03.000Z | 2020-10-30T02:13:38.000Z | kube/task_generation/pick_edge.py | ZettaAI/Synaptor | e425b4c744fca093ee5c63f41b82b3cae7898af4 | [
"MIT"
] | 6 | 2018-07-12T17:59:54.000Z | 2020-10-30T02:29:50.000Z | import argparse
from taskqueue import TaskQueue
import synaptor.cloud.kube.parser as parser
import synaptor.cloud.kube.task_creation as tc
def main(configfilename):
config = parser.parse(configfilename)
iterator = tc.create_pick_edge_tasks(
config["storagestrs"][0], config["nummergetask... | 19.9 | 68 | 0.693467 |
27c00fc5b4a8d64a87321826f5e5417cd37f0c99 | 1,751 | py | Python | setup.py | akode/snorkel | 8816ef618f831944aace79d98415d7c50d27f715 | [
"Apache-2.0"
] | null | null | null | setup.py | akode/snorkel | 8816ef618f831944aace79d98415d7c50d27f715 | [
"Apache-2.0"
] | null | null | null | setup.py | akode/snorkel | 8816ef618f831944aace79d98415d7c50d27f715 | [
"Apache-2.0"
] | null | null | null | from typing import Dict
from setuptools import find_packages, setup
# version.py defines the VERSION and VERSION_SHORT variables.
# We use exec here so we don't import snorkel.
VERSION: Dict[str, str] = {}
with open("snorkel/version.py", "r") as version_file:
exec(version_file.read(), VERSION)
# Use README.md as... | 34.333333 | 86 | 0.63735 |
beba26c733253403a7fb62a74e98883552e399be | 1,075 | py | Python | distribution.py | Simon-Swenson-8351/hs-bot | af2613ffa71c34e1d66c9f9d65249962d21a6b4a | [
"BSD-3-Clause"
] | null | null | null | distribution.py | Simon-Swenson-8351/hs-bot | af2613ffa71c34e1d66c9f9d65249962d21a6b4a | [
"BSD-3-Clause"
] | null | null | null | distribution.py | Simon-Swenson-8351/hs-bot | af2613ffa71c34e1d66c9f9d65249962d21a6b4a | [
"BSD-3-Clause"
] | null | null | null | import abc
import random
class Distribution(abc.ABC):
@abc.abstractmethod
def sample(self):
pass
class Uniform(Distribution):
def __init__(self, low: float, high: float):
self.low = low
self.high = high
def sample(self):
return random.uniform(self.low, self.high)
cl... | 23.369565 | 87 | 0.595349 |
6e3b83f7f6a4da86bf0aa407830a5f73423d2fe2 | 743 | py | Python | 9/swagger_client/__init__.py | apitore/apitore-sdk-python | c0814c5635ddd09e9a20fcb155b62122bee41d33 | [
"Apache-2.0"
] | 3 | 2018-08-21T06:14:33.000Z | 2019-10-18T23:05:50.000Z | 9/swagger_client/__init__.py | apitore/apitore-sdk-python | c0814c5635ddd09e9a20fcb155b62122bee41d33 | [
"Apache-2.0"
] | null | null | null | 9/swagger_client/__init__.py | apitore/apitore-sdk-python | c0814c5635ddd09e9a20fcb155b62122bee41d33 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
# flake8: noqa
"""
Synonym APIs
Return synonymous words. (equal to \"word2vec distance\")<BR />[Endpoint] https://api.apitore.com/api/9 # noqa: E501
OpenAPI spec version: 1.0.1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolut... | 27.518519 | 121 | 0.792732 |
5c6ff361ddb18751ad62525868482d8e308dd085 | 6,315 | py | Python | ParlAI/projects/memnn_feedback/tasks/dbll_babi/agents.py | UmaTaru/run | be29e4d41a4de3dee27cd6796801bfe51382d294 | [
"MIT"
] | 163 | 2019-06-23T14:07:57.000Z | 2022-02-25T23:06:07.000Z | ParlAI/projects/memnn_feedback/tasks/dbll_babi/agents.py | UmaTaru/run | be29e4d41a4de3dee27cd6796801bfe51382d294 | [
"MIT"
] | 8 | 2019-07-24T12:41:31.000Z | 2022-02-10T00:17:20.000Z | ParlAI/projects/memnn_feedback/tasks/dbll_babi/agents.py | UmaTaru/run | be29e4d41a4de3dee27cd6796801bfe51382d294 | [
"MIT"
] | 31 | 2019-06-26T01:21:07.000Z | 2021-09-06T17:23:24.000Z | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
#
# Accessing the tasks can be done with something like:
#
# python examples/display_data.py -t "projects.memnn_feedbac... | 34.697802 | 115 | 0.507363 |
f4547a448d1035dd07e50cb80102dfcd93860352 | 999 | py | Python | tests/test-runners/subject/package/sub_package1/tests/test_subsomething1.py | jayvdb/Nuitka | 0ff702e065b1b53231ba0cae451385a3da0fe766 | [
"Apache-2.0"
] | 1 | 2019-03-31T09:56:11.000Z | 2019-03-31T09:56:11.000Z | tests/test-runners/subject/package/sub_package1/tests/test_subsomething1.py | jayvdb/Nuitka | 0ff702e065b1b53231ba0cae451385a3da0fe766 | [
"Apache-2.0"
] | 1 | 2019-03-01T11:33:40.000Z | 2019-03-01T11:33:40.000Z | tests/test-runners/subject/package/sub_package1/tests/test_subsomething1.py | jayvdb/Nuitka | 0ff702e065b1b53231ba0cae451385a3da0fe766 | [
"Apache-2.0"
] | 1 | 2019-03-26T16:56:21.000Z | 2019-03-26T16:56:21.000Z | # Copyright 2019, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Python test originally created or extracted from other peoples work. The
# parts from me are licensed as below. It is at least Free Software where
# it's copied from other people. In these cases, that will normally be
# indicated.
#
# L... | 39.96 | 78 | 0.714715 |
f272d8d4d30ad42959894175aff616e004af13ad | 578 | py | Python | index/redislight.py | seyedmo30/mo30 | b34a4b828e0f2e6ec144fa5ae015aab1ed206c37 | [
"MIT"
] | 3 | 2021-06-23T06:47:19.000Z | 2022-01-08T17:20:48.000Z | index/redislight.py | seyedmo30/mo30 | b34a4b828e0f2e6ec144fa5ae015aab1ed206c37 | [
"MIT"
] | 1 | 2022-02-28T04:33:58.000Z | 2022-02-28T04:33:58.000Z | index/redislight.py | seyedmo30/mo30 | b34a4b828e0f2e6ec144fa5ae015aab1ed206c37 | [
"MIT"
] | null | null | null | from redislite import Redis
from json import dumps
from django.core.serializers.json import DjangoJSONEncoder
class RedisLight():
def __init__(self) :
self.redis_instance = self.__call__()
def __call__(self):
redis_instance = Redis('/tmp/redis.db')
return redis_instance
def get_re... | 30.421053 | 89 | 0.716263 |
8c7ea8af663c4b2d2de6989f545a94c558f977c7 | 12,565 | py | Python | jacket/tests/storage/unit/test_tintri.py | bopopescu/jacket | d7ad3147fcb43131098c2a5210847634ff5fb325 | [
"Apache-2.0"
] | null | null | null | jacket/tests/storage/unit/test_tintri.py | bopopescu/jacket | d7ad3147fcb43131098c2a5210847634ff5fb325 | [
"Apache-2.0"
] | null | null | null | jacket/tests/storage/unit/test_tintri.py | bopopescu/jacket | d7ad3147fcb43131098c2a5210847634ff5fb325 | [
"Apache-2.0"
] | 2 | 2016-08-10T02:21:49.000Z | 2020-07-24T01:57:21.000Z | # Copyright (c) 2015 Tintri. 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 ap... | 44.399293 | 78 | 0.660247 |
081b6d7aace8a02269caa408f6c476b8ae07f203 | 9,222 | py | Python | downstream/votenet/models/backbone/sparseconv/voxelizer.py | ut-amrl/ContrastiveSceneContexts | 622b9cd32ea2dcf8307d25eb2e7ee1c09d220134 | [
"MIT"
] | 135 | 2021-05-25T00:07:04.000Z | 2022-03-24T02:52:22.000Z | downstream/votenet/models/backbone/sparseconv/voxelizer.py | ut-amrl/ContrastiveSceneContexts | 622b9cd32ea2dcf8307d25eb2e7ee1c09d220134 | [
"MIT"
] | 25 | 2021-06-17T03:45:44.000Z | 2022-03-04T16:04:42.000Z | downstream/votenet/models/backbone/sparseconv/voxelizer.py | ut-amrl/ContrastiveSceneContexts | 622b9cd32ea2dcf8307d25eb2e7ee1c09d220134 | [
"MIT"
] | 21 | 2021-05-25T07:52:36.000Z | 2022-02-18T06:10:45.000Z | import collections
import numpy as np
import MinkowskiEngine as ME
from scipy.linalg import expm, norm
# Rotation matrix along axis with angle theta
def M(axis, theta):
return expm(np.cross(np.eye(3), axis / norm(axis) * theta))
class Voxelizer:
def __init__(self,
voxel_size=1,
... | 42.109589 | 108 | 0.562785 |
718c26e4b1fd6ae9bb31ae8871975613099303de | 1,147 | py | Python | imhd/setup.py | DDMGNI/viIMHD2D | d7c3546a6245fa0b12538a785146af3895f16e18 | [
"MIT"
] | null | null | null | imhd/setup.py | DDMGNI/viIMHD2D | d7c3546a6245fa0b12538a785146af3895f16e18 | [
"MIT"
] | null | null | null | imhd/setup.py | DDMGNI/viIMHD2D | d7c3546a6245fa0b12538a785146af3895f16e18 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#$ python setup.py build_ext --inplace
from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
import os
from os.path import join, isdir
INCLUDE_DIRS = [os.curdir]
LIBRARY_DIRS = []
LIBRARIES = []
CARGS = ['-O3', '-std... | 28.675 | 128 | 0.601569 |
06fb467b07d2db900b25cee32294eda468d71d2b | 17,375 | py | Python | tests/test_reporting.py | danielgis/invest | b9687d249361556b874750368e856ef049447b5a | [
"BSD-3-Clause"
] | null | null | null | tests/test_reporting.py | danielgis/invest | b9687d249361556b874750368e856ef049447b5a | [
"BSD-3-Clause"
] | null | null | null | tests/test_reporting.py | danielgis/invest | b9687d249361556b874750368e856ef049447b5a | [
"BSD-3-Clause"
] | 1 | 2021-04-21T10:46:17.000Z | 2021-04-21T10:46:17.000Z | """Module for Testing the InVEST Reporting module."""
import unittest
import tempfile
import shutil
import os
import codecs
import pygeoprocessing.testing
from pygeoprocessing.testing import scm
REGRESSION_DATA = os.path.join(
os.path.dirname(__file__), '..', 'data', 'invest-test-data', 'reporting')
... | 40.786385 | 80 | 0.573525 |
c5fa4d50ec692646c4bb5489f8c050645c99c09a | 1,132 | py | Python | napari/layers/surface/tests/test_surface.py | vigji/napari | f747495fb45fb1d5c9eec339641d4be6a676e737 | [
"BSD-3-Clause"
] | null | null | null | napari/layers/surface/tests/test_surface.py | vigji/napari | f747495fb45fb1d5c9eec339641d4be6a676e737 | [
"BSD-3-Clause"
] | null | null | null | napari/layers/surface/tests/test_surface.py | vigji/napari | f747495fb45fb1d5c9eec339641d4be6a676e737 | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
from xml.etree.ElementTree import Element
from napari.layers import Surface
def test_random_surface():
"""Test instantiating Surface layer with random 2D data."""
np.random.seed(0)
vertices = np.random.random((10, 2))
faces = np.random.randint(10, size=(6, 3))
values = np.random... | 33.294118 | 71 | 0.664311 |
21667f31f37bc9879ac318a86e35ebe584b8b273 | 5,761 | py | Python | new_adaption_method_in_developing/model.py | chi6/Model-based-meta-learning-rl | fda134dcbd87ef3e91f339ea2f836f28ec5f7784 | [
"MIT"
] | 2 | 2019-09-10T10:13:20.000Z | 2020-07-17T01:37:27.000Z | new_adaption_method_in_developing/model.py | chi6/Model-based-meta-learning-rl | fda134dcbd87ef3e91f339ea2f836f28ec5f7784 | [
"MIT"
] | null | null | null | new_adaption_method_in_developing/model.py | chi6/Model-based-meta-learning-rl | fda134dcbd87ef3e91f339ea2f836f28ec5f7784 | [
"MIT"
] | null | null | null | import tensorflow as tf
import numpy as np
import tensorflow.contrib.slim as slim
import tensorflow.contrib as contr
class LSTM_network():
def __init__(self, s_size, a_size, scope, trainer, num_hidden = 100):
print("init network: " + str(scope))
with tf.variable_scope(scope + "lstm_tuning"):
... | 61.287234 | 153 | 0.636869 |
a36194947fe9f29241c54b6245c861519cb9c9fa | 8,126 | py | Python | data_creation/utils/create.py | sefalab/Spatial_Project | 28534d30bbc80777bca245f1dfe7f7e9f3f51255 | [
"Apache-2.0"
] | 1 | 2021-12-10T10:58:12.000Z | 2021-12-10T10:58:12.000Z | data_creation/utils/create.py | sefalab/Spatial_Project | 28534d30bbc80777bca245f1dfe7f7e9f3f51255 | [
"Apache-2.0"
] | null | null | null | data_creation/utils/create.py | sefalab/Spatial_Project | 28534d30bbc80777bca245f1dfe7f7e9f3f51255 | [
"Apache-2.0"
] | null | null | null | import rasterio
from utils import config
import multiprocessing
import cv2
import numpy as np
import matplotlib.pyplot as plt
import fiona
import rasterio
import os
from rasterio.mask import mask
from osgeo import gdal, osr, ogr
from PIL import Image
import glob
Image.MAX_IMAGE_PIXELS = None
def in_polygon(raster,ve... | 25.796825 | 82 | 0.558577 |
f78b8116eaa538b29e6d7b39d0b6e31d9dba2606 | 14,238 | py | Python | tepsimulation/packages/ui_tep/main_window.py | hsaafan/TEPSimulation | 86743fab499d8ffb690df63308e2a835fa59c6fd | [
"MIT"
] | null | null | null | tepsimulation/packages/ui_tep/main_window.py | hsaafan/TEPSimulation | 86743fab499d8ffb690df63308e2a835fa59c6fd | [
"MIT"
] | null | null | null | tepsimulation/packages/ui_tep/main_window.py | hsaafan/TEPSimulation | 86743fab499d8ffb690df63308e2a835fa59c6fd | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '/home/karamelm1nt/Documents/Code/TEPSimulation/ui/ui_main.ui'
#
# Created by: PyQt5 UI code generator 5.14.1
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_main_window(object)... | 60.075949 | 136 | 0.739992 |
9128c2d4284ba9da5e18eee9df0937552b37acd8 | 492 | py | Python | Zoocmd/core/helpers/version.py | helicontech/zoo | a33ba547f553bcce415f7a54bd89c444f82e48ee | [
"Apache-2.0"
] | 2 | 2017-05-01T07:35:24.000Z | 2018-04-12T13:36:03.000Z | Zoocmd/core/helpers/version.py | helicontech/zoo | a33ba547f553bcce415f7a54bd89c444f82e48ee | [
"Apache-2.0"
] | 2 | 2017-03-23T17:28:37.000Z | 2018-06-07T06:38:08.000Z | Zoocmd/core/helpers/version.py | helicontech/zoo | a33ba547f553bcce415f7a54bd89c444f82e48ee | [
"Apache-2.0"
] | 3 | 2016-06-22T11:11:16.000Z | 2019-10-25T15:09:46.000Z | # -*- coding: utf-8 -*-
import logging
from core.helpers.distutil_version import LooseVersion
def compare_versions(v1: str, v2: str)-> int:
"""
Compares version strings formatted as '1.2.3.4'.
:param v1:
:param v2:
:return: -1 if less, 0 if equals, 1 if greater
"""
try:
return Loo... | 25.894737 | 75 | 0.619919 |
8e620a488be4f6cb017269dfe1c5f2bf6a16ebdd | 18,482 | py | Python | neurokit2/hrv/hrv_nonlinear.py | 1110sillabo/NeuroKit | b12315465db559ef0228470a4c31b85371775896 | [
"MIT"
] | 1 | 2021-11-14T21:18:43.000Z | 2021-11-14T21:18:43.000Z | neurokit2/hrv/hrv_nonlinear.py | 1110sillabo/NeuroKit | b12315465db559ef0228470a4c31b85371775896 | [
"MIT"
] | null | null | null | neurokit2/hrv/hrv_nonlinear.py | 1110sillabo/NeuroKit | b12315465db559ef0228470a4c31b85371775896 | [
"MIT"
] | 1 | 2021-11-14T21:18:48.000Z | 2021-11-14T21:18:48.000Z | # -*- coding: utf-8 -*-
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import scipy.stats
from ..complexity import entropy_approximate, entropy_sample
from ..misc import find_consecutive
from ..signal import signal_zerocrossings
from .hrv_utils import _hrv_get_rri, _hrv_saniti... | 38.107216 | 118 | 0.624391 |
3556f52ba3c74e1870a19c0f241636da801175c1 | 890 | py | Python | formatdata/bin/search_dup_bim.py | lvclark/h3agwas | 5e42e60123b819d3c331a91b25ee50846e55af3b | [
"MIT"
] | 62 | 2016-08-29T11:27:35.000Z | 2022-03-10T17:16:14.000Z | formatdata/bin/search_dup_bim.py | lvclark/h3agwas | 5e42e60123b819d3c331a91b25ee50846e55af3b | [
"MIT"
] | 33 | 2016-12-26T13:48:19.000Z | 2021-12-05T13:34:06.000Z | formatdata/bin/search_dup_bim.py | lvclark/h3agwas | 5e42e60123b819d3c331a91b25ee50846e55af3b | [
"MIT"
] | 50 | 2017-04-15T04:17:43.000Z | 2022-03-30T07:26:01.000Z | #!/usr/bin/env python3
# extract from bim file duplicate bim
import sys
listfilebim=sys.argv[1].split(',')
listrs=set([])
listinfopos=set([])
listrsdup=set([])
listpos=set([])
listposdup=set([])
writedel=open(sys.argv[3], 'w')
for File in listfilebim :
print(File)
read=open(File)
for x in read :
tx=x.... | 22.25 | 68 | 0.596629 |
247ad1ccfd7246bd43dc2c0f9f80038428ff1934 | 359 | py | Python | examples/sklearn_workflow.py | s0tt/modAL | 87f64be9678eff755f4cff2f9ba79379a2f63108 | [
"MIT"
] | null | null | null | examples/sklearn_workflow.py | s0tt/modAL | 87f64be9678eff755f4cff2f9ba79379a2f63108 | [
"MIT"
] | 3 | 2021-02-08T17:27:24.000Z | 2021-02-21T16:58:47.000Z | examples/sklearn_workflow.py | s0tt/modAL | 87f64be9678eff755f4cff2f9ba79379a2f63108 | [
"MIT"
] | null | null | null | from modAL.models import ActiveLearner
from sklearn.datasets import load_iris
from sklearn.ensemble import RandomForestClassifier
from sklearn.model_selection import cross_val_score
X_train, y_train = load_iris().data, load_iris().target
learner = ActiveLearner(estimator=RandomForestClassifier())
scores = cross_val_s... | 35.9 | 59 | 0.83844 |
6c26fa6840b0f6aabdff43544bac5bb028c199aa | 1,534 | py | Python | backbone.py | chensheng19/Yolo3_study | 1f5839ca8235434c34709435a06bee4cdbf4a8e3 | [
"Apache-2.0"
] | 1 | 2020-09-11T10:19:36.000Z | 2020-09-11T10:19:36.000Z | backbone.py | chensheng19/Yolo3_study | 1f5839ca8235434c34709435a06bee4cdbf4a8e3 | [
"Apache-2.0"
] | null | null | null | backbone.py | chensheng19/Yolo3_study | 1f5839ca8235434c34709435a06bee4cdbf4a8e3 | [
"Apache-2.0"
] | null | null | null | #! usr/bin/env python
# coding:utf-8
#=====================================================
# Copyright (C) 2020 * Ltd. All rights reserved.
#
# Author : Chen_Sheng19
# Editor : VIM
# Create time : 2020-04-29
# File name : backbone.py
# Description : Implement the darknet53
#
#============================... | 31.306122 | 76 | 0.605606 |
28ccd9231952aa44fc9c41919538958b1cddcb7d | 3,432 | py | Python | ascii_video.py | justicesuh/ascii-video | 1c843ba9d15a384e547dbac8e475e4c375d9823c | [
"MIT"
] | null | null | null | ascii_video.py | justicesuh/ascii-video | 1c843ba9d15a384e547dbac8e475e4c375d9823c | [
"MIT"
] | 4 | 2018-09-27T04:04:00.000Z | 2018-09-29T01:59:49.000Z | ascii_video.py | justicesuh/ascii-video | 1c843ba9d15a384e547dbac8e475e4c375d9823c | [
"MIT"
] | null | null | null | import os
import shutil
import subprocess
import sys
import time
from PIL import Image
class AVFile():
def __init__(self, filename, mode, debug=False):
'''
Signature Width Height Frame_Count FPS Data
'''
self.grayscale = '$@B%8&WM#*oahkbdpqwmZO0QLCJUYXzcvunxrjft/\\|()1{}[]?-_+~<>i... | 31.486239 | 124 | 0.562354 |
6fdb62cdccdaee50944a96c8057c203c058961c5 | 3,387 | py | Python | src/annalist_root/annalist/models/recordvocab.py | gklyne/annalist | 82e7ef2d56a400325e7618fa9e590072ee8a71d3 | [
"MIT"
] | 18 | 2015-02-20T23:09:13.000Z | 2020-11-13T06:06:43.000Z | src/annalist_root/annalist/models/recordvocab.py | gklyne/annalist | 82e7ef2d56a400325e7618fa9e590072ee8a71d3 | [
"MIT"
] | 30 | 2015-01-03T09:56:28.000Z | 2021-06-10T20:58:55.000Z | src/annalist_root/annalist/models/recordvocab.py | gklyne/annalist | 82e7ef2d56a400325e7618fa9e590072ee8a71d3 | [
"MIT"
] | 5 | 2015-02-02T09:01:23.000Z | 2018-06-14T20:05:28.000Z | """
Annalist vocabulary record
"""
from __future__ import unicode_literals
from __future__ import absolute_import, division, print_function
__author__ = "Graham Klyne (GK@ACM.ORG)"
__copyright__ = "Copyright 2015, G. Klyne"
__license__ = "MIT (http://opensource.org/licenses/MIT)"
import logging
log = logg... | 33.534653 | 91 | 0.661057 |
e8a465e61912caf7b5294aaa03543389b6f8b1e7 | 906 | py | Python | PokerHand/Deck.py | tushortz/PokerHand.py | 220cc7155507e3eee3786fc5a6678b17623f8e99 | [
"MIT"
] | 1 | 2021-11-06T11:51:28.000Z | 2021-11-06T11:51:28.000Z | PokerHand/Deck.py | tushortz/PokerHand | 220cc7155507e3eee3786fc5a6678b17623f8e99 | [
"MIT"
] | null | null | null | PokerHand/Deck.py | tushortz/PokerHand | 220cc7155507e3eee3786fc5a6678b17623f8e99 | [
"MIT"
] | null | null | null | # By Taiwo Kareem <taiwo.kareem36@gmail.com>
# Github <https://github.com/tushortz>
# Last updated (08-February-2016)
# Import needed modules and classes
from CardCollection import CardCollection
from Card import Card
import random
# Create Deck class
class Deck(CardCollection):
# Initialise necessary class variable... | 25.166667 | 57 | 0.666667 |
aeb38f4149d71a788fc7aa92cdfa8c8f88837c1f | 8,866 | py | Python | tests/robotcode/jsonrpc/test_jsonrpcprotocol.py | d-biehl/robotcode | e5c002f9810e71880e876be1602fcfb78e028d79 | [
"Apache-2.0"
] | 21 | 2021-03-11T19:37:31.000Z | 2022-02-28T05:26:33.000Z | tests/robotcode/jsonrpc/test_jsonrpcprotocol.py | d-biehl/robotcode | e5c002f9810e71880e876be1602fcfb78e028d79 | [
"Apache-2.0"
] | 46 | 2021-03-11T10:58:38.000Z | 2022-03-31T10:15:54.000Z | tests/robotcode/jsonrpc/test_jsonrpcprotocol.py | d-biehl/robotcode | e5c002f9810e71880e876be1602fcfb78e028d79 | [
"Apache-2.0"
] | 1 | 2021-11-08T10:32:57.000Z | 2021-11-08T10:32:57.000Z | import asyncio
import json
from typing import Any, Dict, Generator, List, Optional, cast
import pytest
from robotcode.jsonrpc2.protocol import (
JsonRPCError,
JsonRPCErrorObject,
JsonRPCErrors,
JsonRPCMessage,
JsonRPCProtocol,
JsonRPCRequest,
JsonRPCResponse,
)
from robotcode.jsonrpc2.serv... | 33.583333 | 120 | 0.713738 |
08d460b425073ca083c405f13515a65028beb905 | 2,845 | py | Python | lib/spack/spack/cmd/common/env_utility.py | BenCasses/spack | 912dcd320a1ec624cc12986a4c0dd881276c925b | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | lib/spack/spack/cmd/common/env_utility.py | BenCasses/spack | 912dcd320a1ec624cc12986a4c0dd881276c925b | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | lib/spack/spack/cmd/common/env_utility.py | BenCasses/spack | 912dcd320a1ec624cc12986a4c0dd881276c925b | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from __future__ import print_function
import argparse
import os
import llnl.util.tty as tty
import spack.build_environmen... | 34.277108 | 79 | 0.653427 |
14d4f8b55cda39bfad7ec33d74e9db0e671fb18a | 29,968 | py | Python | src/azure-cli/azure/cli/command_modules/acr/connected_registry.py | GalGrinblat/azure-cli | b30b9cf9f90d01b9b6708cc56b82e32cd7182dae | [
"MIT"
] | 1 | 2021-09-07T18:53:37.000Z | 2021-09-07T18:53:37.000Z | src/azure-cli/azure/cli/command_modules/acr/connected_registry.py | GalGrinblat/azure-cli | b30b9cf9f90d01b9b6708cc56b82e32cd7182dae | [
"MIT"
] | 2 | 2020-05-04T22:45:39.000Z | 2021-12-02T22:45:10.000Z | src/azure-cli/azure/cli/command_modules/acr/connected_registry.py | GalGrinblat/azure-cli | b30b9cf9f90d01b9b6708cc56b82e32cd7182dae | [
"MIT"
] | 2 | 2021-07-07T12:43:11.000Z | 2021-07-09T19:30:53.000Z | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 48.887439 | 118 | 0.636145 |
16e40931d0f9a9aaa0a7932a7f394d650fa00740 | 1,173 | py | Python | language/google/cloud/language_v1/types.py | bomboradata/bombora-google-cloud-python | 255bbebe6c50490f40fcc3eed40bae1e77e03859 | [
"Apache-2.0"
] | 1 | 2021-01-04T11:40:17.000Z | 2021-01-04T11:40:17.000Z | language/google/cloud/language_v1/types.py | bomboradata/bombora-google-cloud-python | 255bbebe6c50490f40fcc3eed40bae1e77e03859 | [
"Apache-2.0"
] | null | null | null | language/google/cloud/language_v1/types.py | bomboradata/bombora-google-cloud-python | 255bbebe6c50490f40fcc3eed40bae1e77e03859 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017, Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | 33.514286 | 74 | 0.750213 |
91f1f3033034c49d015dc00ab84e293fc758b1b9 | 928 | py | Python | main.py | whiteparrot-pentester-programmer/story-by-whiteparrot | 72e9e0f515dcd78447dedfba2e2bf2db8b98f351 | [
"CC0-1.0"
] | null | null | null | main.py | whiteparrot-pentester-programmer/story-by-whiteparrot | 72e9e0f515dcd78447dedfba2e2bf2db8b98f351 | [
"CC0-1.0"
] | null | null | null | main.py | whiteparrot-pentester-programmer/story-by-whiteparrot | 72e9e0f515dcd78447dedfba2e2bf2db8b98f351 | [
"CC0-1.0"
] | null | null | null | # Importing random module
import random
# Defining list of phrases which will help to build a story
Sentence_starter = ['About 150 years ago', ' In the 10 EC', 'Once upon a time']
character = [' there lived a king.',' there was a woman named Alexia.',
' there lived a farmer.']
time = [' One day', ' One full-moon n... | 44.190476 | 81 | 0.71444 |
8648845d39f0aae5a1e1ed189f6ec3d69b1f1acc | 7,510 | py | Python | airflow/operators/hive_stats_operator.py | shrutimantri/airflow | 61eaaacd20ab0f743786df895cf8f232b3b2a48c | [
"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 | airflow/operators/hive_stats_operator.py | shrutimantri/airflow | 61eaaacd20ab0f743786df895cf8f232b3b2a48c | [
"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 | airflow/operators/hive_stats_operator.py | shrutimantri/airflow | 61eaaacd20ab0f743786df895cf8f232b3b2a48c | [
"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
#... | 38.512821 | 102 | 0.598668 |
ae154216af3d6eb029b058603d2a891fd0f21401 | 12,688 | py | Python | utils/dict_utils.py | NSO-developer/nfvo-converter-tosca-sol6 | 2c43900b0e96927e23c668a4c67e09d0b13f55d7 | [
"Apache-2.0"
] | 9 | 2019-06-03T07:50:37.000Z | 2021-03-26T00:25:19.000Z | utils/dict_utils.py | NSO-developer/nfvo-converter-tosca-sol6 | 2c43900b0e96927e23c668a4c67e09d0b13f55d7 | [
"Apache-2.0"
] | null | null | null | utils/dict_utils.py | NSO-developer/nfvo-converter-tosca-sol6 | 2c43900b0e96927e23c668a4c67e09d0b13f55d7 | [
"Apache-2.0"
] | 4 | 2020-03-06T16:16:28.000Z | 2020-09-30T06:13:56.000Z | import logging
log = logging.getLogger(__name__)
SPLIT_CHAR = ";"
def get_path_value(path, cur_dict, must_exist=True, ensure_dict=False, no_msg=False):
"""
topology_template.node_templates.vnf.properties.descriptor_id
Pass in a path and a dict the path applies to and get the value of the key
"""
... | 36.045455 | 99 | 0.57314 |
54213225d0efc6dc5f0a5c511b2f302ad3fbf651 | 6,518 | py | Python | my_animations/onevar.py | safinsingh/manim-old | ba403c02853118a7fbb3f17852a158ebef95a97a | [
"MIT"
] | null | null | null | my_animations/onevar.py | safinsingh/manim-old | ba403c02853118a7fbb3f17852a158ebef95a97a | [
"MIT"
] | null | null | null | my_animations/onevar.py | safinsingh/manim-old | ba403c02853118a7fbb3f17852a158ebef95a97a | [
"MIT"
] | null | null | null | from manimlib.imports import *
import typing
import itertools
import collections
import math
def set_colors(object: typing.Union[Mobject, Group, typing.Sequence], colors: typing.List[str]) -> object:
[object[i].set_color(color) for i, color in enumerate(colors)]
return object
def ReplacementMultiIndex(
... | 35.813187 | 116 | 0.620436 |
295447ffc3f7780a809b804ba221de6d274ae2fb | 882 | py | Python | mzazagram/migrations/0001_initial.py | mzazakeith/instagram-clone | f2fffc42e7054a74bed54b886c2b3ea03476e5ba | [
"MIT"
] | null | null | null | mzazagram/migrations/0001_initial.py | mzazakeith/instagram-clone | f2fffc42e7054a74bed54b886c2b3ea03476e5ba | [
"MIT"
] | 5 | 2020-06-05T18:45:55.000Z | 2021-09-07T23:59:07.000Z | mzazagram/migrations/0001_initial.py | mzazakeith/instagram-clone | f2fffc42e7054a74bed54b886c2b3ea03476e5ba | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2018-07-21 09:50
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations... | 30.413793 | 118 | 0.64059 |
79389b3339e56b48926d1060fbdf2d419e42f2dd | 2,554 | py | Python | 2_pytorch/models/twolayernn.py | DarseZ/DL_hw1 | f6b86e3e51996acf17b8ff93a828e104539729f3 | [
"MIT"
] | null | null | null | 2_pytorch/models/twolayernn.py | DarseZ/DL_hw1 | f6b86e3e51996acf17b8ff93a828e104539729f3 | [
"MIT"
] | null | null | null | 2_pytorch/models/twolayernn.py | DarseZ/DL_hw1 | f6b86e3e51996acf17b8ff93a828e104539729f3 | [
"MIT"
] | null | null | null | import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
class TwoLayerNN(nn.Module):
def __init__(self, im_size, hidden_dim, n_classes):
'''
Create components of a two layer neural net classifier (often
referred to as an MLP... | 43.288136 | 85 | 0.411511 |
265b4b941d629761a178c376f092045f213280f1 | 20,673 | py | Python | airflow/models/dagbag.py | suensummit/airflow | 37a342d0e96a91ce2d34085e225a4e86f54c4e21 | [
"Apache-2.0"
] | 1 | 2021-11-04T20:11:58.000Z | 2021-11-04T20:11:58.000Z | airflow/models/dagbag.py | suensummit/airflow | 37a342d0e96a91ce2d34085e225a4e86f54c4e21 | [
"Apache-2.0"
] | 3 | 2020-07-07T20:39:24.000Z | 2021-09-29T17:34:46.000Z | airflow/models/dagbag.py | suensummit/airflow | 37a342d0e96a91ce2d34085e225a4e86f54c4e21 | [
"Apache-2.0"
] | 1 | 2020-11-04T03:17:51.000Z | 2020-11-04T03:17: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
#... | 42.71281 | 97 | 0.585498 |
75410cfd04675148aa9876996918b1859c453529 | 13,342 | py | Python | src/rlai/runners/trainer.py | MatthewGerber/rlai | f390433c3adc285e1e9cc113deed7009b2e6dd5a | [
"MIT"
] | 9 | 2021-05-09T22:30:42.000Z | 2021-12-27T19:42:56.000Z | src/rlai/runners/trainer.py | MatthewGerber/rlai | f390433c3adc285e1e9cc113deed7009b2e6dd5a | [
"MIT"
] | 13 | 2020-11-18T03:30:39.000Z | 2021-12-12T04:19:16.000Z | src/rlai/runners/trainer.py | MatthewGerber/rlai | f390433c3adc285e1e9cc113deed7009b2e6dd5a | [
"MIT"
] | 1 | 2021-06-24T16:48:59.000Z | 2021-06-24T16:48:59.000Z | import logging
import os
import pickle
import sys
import warnings
from argparse import ArgumentParser
from typing import List, Tuple, Optional, Callable, Dict
from numpy.random import RandomState
from rlai.gpi.utils import resume_from_checkpoint
from rlai.meta import rl_text
from rlai.policies.parameterized import Pa... | 32.94321 | 137 | 0.673887 |
4c6d783502d08d2b473a760d30ac81f01e4eb4ed | 1,630 | py | Python | data_tracker/tracker/migrations/backup_migrations/0011_auto_20160209_1955.py | ahl54/Tracker | 7128aa54ea4180f8bff2500d13d2995bf7f81810 | [
"MIT"
] | null | null | null | data_tracker/tracker/migrations/backup_migrations/0011_auto_20160209_1955.py | ahl54/Tracker | 7128aa54ea4180f8bff2500d13d2995bf7f81810 | [
"MIT"
] | null | null | null | data_tracker/tracker/migrations/backup_migrations/0011_auto_20160209_1955.py | ahl54/Tracker | 7128aa54ea4180f8bff2500d13d2995bf7f81810 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-02-09 19:55
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('tracker', '0010_auto_20160209_1947'),
]
operations = [
migrations.AlterField... | 39.756098 | 211 | 0.568712 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.