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 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f74409ceb124263d8cbc927eb7a26197d8950d81 | 62 | py | Python | python/mpm_sample.py | smiletechnologyunited/maya_package_sample | 9ea698baa952a2ba054925946c8aea6eaf77170c | [
"MIT"
] | 1 | 2015-01-27T03:13:34.000Z | 2015-01-27T03:13:34.000Z | python/mpm_sample.py | smiletechnologyunited/maya_package_sample | 9ea698baa952a2ba054925946c8aea6eaf77170c | [
"MIT"
] | null | null | null | python/mpm_sample.py | smiletechnologyunited/maya_package_sample | 9ea698baa952a2ba054925946c8aea6eaf77170c | [
"MIT"
] | null | null | null |
def mpm_sample():
print("hello, I am 'mpm_sample.py'.")
| 12.4 | 41 | 0.612903 |
def mpm_sample():
print("hello, I am 'mpm_sample.py'.")
| true | true |
f7440b54f07400600b7e9f4aa354b476b45d0cd7 | 498 | py | Python | Online-Judges/DimikOJ/Python/66-replacement-cipher.py | shihab4t/Competitive-Programming | e8eec7d4f7d86bfa1c00b7fbbedfd6a1518f19be | [
"Unlicense"
] | 3 | 2021-06-15T01:19:23.000Z | 2022-03-16T18:23:53.000Z | Online-Judges/DimikOJ/Python/66-replacement-cipher.py | shihab4t/Competitive-Programming | e8eec7d4f7d86bfa1c00b7fbbedfd6a1518f19be | [
"Unlicense"
] | null | null | null | Online-Judges/DimikOJ/Python/66-replacement-cipher.py | shihab4t/Competitive-Programming | e8eec7d4f7d86bfa1c00b7fbbedfd6a1518f19be | [
"Unlicense"
] | null | null | null | def encryped_text(first_text, second_text, third_text):
encryped_text = ""
for i in third_text:
if i in first_text:
encryped_text += second_text[first_text.index(i)]
else:
encryped_text += i
return encryped_text
first_text = input()
second_text = input()
print(seco... | 22.636364 | 65 | 0.65261 | def encryped_text(first_text, second_text, third_text):
encryped_text = ""
for i in third_text:
if i in first_text:
encryped_text += second_text[first_text.index(i)]
else:
encryped_text += i
return encryped_text
first_text = input()
second_text = input()
print(seco... | true | true |
f7440b975e3ce9e160d1cfbd06f273d2e55aa60a | 34,446 | py | Python | tensorboard/loader.py | lgeiger/tensorboard | 6b012202689ae3c55e27c3690455e47f8d18c54d | [
"Apache-2.0"
] | 1 | 2018-10-16T08:38:49.000Z | 2018-10-16T08:38:49.000Z | tensorboard/loader.py | lgeiger/tensorboard | 6b012202689ae3c55e27c3690455e47f8d18c54d | [
"Apache-2.0"
] | 2 | 2018-05-16T23:33:55.000Z | 2018-05-24T00:09:29.000Z | tensorboard/loader.py | lgeiger/tensorboard | 6b012202689ae3c55e27c3690455e47f8d18c54d | [
"Apache-2.0"
] | 2 | 2018-11-25T19:35:01.000Z | 2019-10-07T16:19:40.000Z | # Copyright 2017 The TensorFlow 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 applica... | 31.088448 | 99 | 0.668118 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import contextlib
import functools
import inspect
import locale
import logging
import os
import re
import sys
import threading
import time
import types
import six
import ten... | true | true |
f7440bba1b5833c90ba50daa335452ac2e95a3fe | 1,721 | py | Python | src/sim_msb_gps.py | flucto-gmbh/msb_gps | caaed598dc4e191d685f4766928f6dd6622a3312 | [
"MIT"
] | null | null | null | src/sim_msb_gps.py | flucto-gmbh/msb_gps | caaed598dc4e191d685f4766928f6dd6622a3312 | [
"MIT"
] | null | null | null | src/sim_msb_gps.py | flucto-gmbh/msb_gps | caaed598dc4e191d685f4766928f6dd6622a3312 | [
"MIT"
] | null | null | null | import logging
import zmq
import sys
import time
import uptime
import pickle
from datetime import datetime
from os import path
try:
from gps_config import (init, GPS_TOPIC)
except ImportError:
raise Exception('failed to import init method')
sys.exit(-1)
def gen_gps_message():
return [
time.t... | 21.246914 | 67 | 0.532249 | import logging
import zmq
import sys
import time
import uptime
import pickle
from datetime import datetime
from os import path
try:
from gps_config import (init, GPS_TOPIC)
except ImportError:
raise Exception('failed to import init method')
sys.exit(-1)
def gen_gps_message():
return [
time.t... | true | true |
f7440cda604d7b00103ac918e531be4e45fc2dfc | 3,740 | py | Python | test.py | jw9730/clova-speech-hackathon | 72cc2e31b0ec18a6486ddc746835a472bf6577fe | [
"Apache-2.0"
] | 8 | 2020-02-10T05:17:02.000Z | 2020-06-04T05:50:21.000Z | test.py | bugkjw/clova_speech_hackathon | 72cc2e31b0ec18a6486ddc746835a472bf6577fe | [
"Apache-2.0"
] | null | null | null | test.py | bugkjw/clova_speech_hackathon | 72cc2e31b0ec18a6486ddc746835a472bf6577fe | [
"Apache-2.0"
] | 1 | 2020-06-04T05:50:24.000Z | 2020-06-04T05:50:24.000Z | import wavio
import torch
import numpy as np
from specaugment import spec_augment_pytorch, melscale_pytorch
import matplotlib.pyplot as plt
PAD = 0
N_FFT = 512
SAMPLE_RATE = 16000
def trim(data, threshold_attack=0.01, threshold_release=0.05, attack_margin=5000, release_margin=5000):
data_size = len(data)
cut_... | 30.16129 | 116 | 0.647059 | import wavio
import torch
import numpy as np
from specaugment import spec_augment_pytorch, melscale_pytorch
import matplotlib.pyplot as plt
PAD = 0
N_FFT = 512
SAMPLE_RATE = 16000
def trim(data, threshold_attack=0.01, threshold_release=0.05, attack_margin=5000, release_margin=5000):
data_size = len(data)
cut_... | true | true |
f7440cf6afa06acd3df24b3a909a4c3ada5c8b19 | 191 | py | Python | Python/LearnPythonTheHardWay/ex1.py | kevindeng123/Programming | a06e9f7773fc083bcb153af21e6e9942a4114b4a | [
"MIT"
] | null | null | null | Python/LearnPythonTheHardWay/ex1.py | kevindeng123/Programming | a06e9f7773fc083bcb153af21e6e9942a4114b4a | [
"MIT"
] | null | null | null | Python/LearnPythonTheHardWay/ex1.py | kevindeng123/Programming | a06e9f7773fc083bcb153af21e6e9942a4114b4a | [
"MIT"
] | null | null | null | print("Hello World!")
print("Hello Again")
print("I like typing this.")
print("This is fun.")
print("Yay! Printing.")
print("I'd much rather you 'not'.")
print('I "said" do not touch this.')
| 23.875 | 36 | 0.664921 | print("Hello World!")
print("Hello Again")
print("I like typing this.")
print("This is fun.")
print("Yay! Printing.")
print("I'd much rather you 'not'.")
print('I "said" do not touch this.')
| true | true |
f7440d7a9cb07259ed54d658e6ef7addf3815138 | 13,296 | py | Python | pythran/tests/test_itertools.py | SylvainCorlay/pythran | 908ec070d837baf77d828d01c3e35e2f4bfa2bfa | [
"BSD-3-Clause"
] | null | null | null | pythran/tests/test_itertools.py | SylvainCorlay/pythran | 908ec070d837baf77d828d01c3e35e2f4bfa2bfa | [
"BSD-3-Clause"
] | null | null | null | pythran/tests/test_itertools.py | SylvainCorlay/pythran | 908ec070d837baf77d828d01c3e35e2f4bfa2bfa | [
"BSD-3-Clause"
] | null | null | null | from test_env import TestEnv
import sys
import unittest
from pythran.typing import List
@TestEnv.module
class TestItertools(TestEnv):
@unittest.skipIf(sys.version_info.major == 3, "not supported in pythran3")
def test_imap(self):
self.run_test("def imap_(l0,v): from itertools import imap; return su... | 50.942529 | 278 | 0.620262 | from test_env import TestEnv
import sys
import unittest
from pythran.typing import List
@TestEnv.module
class TestItertools(TestEnv):
@unittest.skipIf(sys.version_info.major == 3, "not supported in pythran3")
def test_imap(self):
self.run_test("def imap_(l0,v): from itertools import imap; return su... | true | true |
f7440ddfd5e675b3e260741f7c1436aaad5573d1 | 14,155 | py | Python | test/functional/wallet_bumpfee.py | ogfuncoin/ogfuncoin | 18d00bc1d93335c86ae6f2971321e93e627ae570 | [
"MIT"
] | null | null | null | test/functional/wallet_bumpfee.py | ogfuncoin/ogfuncoin | 18d00bc1d93335c86ae6f2971321e93e627ae570 | [
"MIT"
] | null | null | null | test/functional/wallet_bumpfee.py | ogfuncoin/ogfuncoin | 18d00bc1d93335c86ae6f2971321e93e627ae570 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2016-2018 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 the bumpfee RPC.
Verifies that the bumpfee RPC creates replacement transactions successfully when... | 45.66129 | 159 | 0.729071 |
from decimal import Decimal
from test_framework.blocktools import add_witness_commitment, create_block, create_coinbase, send_to_witness
from test_framework.messages import BIP125_SEQUENCE_NUMBER, CTransaction
from test_framework.test_framework import ogfuncoinTestFramework
from test_framework.util import assert_... | true | true |
f7440df7d696f1384a6345f23f9504df9e10ad2b | 1,112 | py | Python | tf_quat2rot/check.py | risteon/tf_quat2rot | f308cab83e552300c274b733dd6cc5609269feb4 | [
"MIT"
] | 1 | 2020-10-04T14:08:59.000Z | 2020-10-04T14:08:59.000Z | tf_quat2rot/check.py | risteon/tf_quat2rot | f308cab83e552300c274b733dd6cc5609269feb4 | [
"MIT"
] | null | null | null | tf_quat2rot/check.py | risteon/tf_quat2rot | f308cab83e552300c274b733dd6cc5609269feb4 | [
"MIT"
] | 1 | 2020-10-04T11:28:21.000Z | 2020-10-04T11:28:21.000Z | # -*- coding: utf-8 -*-
__author__ = """Christoph Rist"""
__email__ = "c.rist@posteo.de"
import tensorflow as tf
def assert_normalized_quaternion(quaternion: tf.Tensor):
with tf.control_dependencies(
[
tf.debugging.assert_near(
tf.ones_like(quaternion[..., 0]),
... | 28.512821 | 71 | 0.552158 |
__author__ = """Christoph Rist"""
__email__ = "c.rist@posteo.de"
import tensorflow as tf
def assert_normalized_quaternion(quaternion: tf.Tensor):
with tf.control_dependencies(
[
tf.debugging.assert_near(
tf.ones_like(quaternion[..., 0]),
tf.linalg.norm(quater... | true | true |
f7440ed3737331dc5c345a7be4509b5e5f68ebce | 27,429 | py | Python | frag_pele/Growing/template_fragmenter.py | AspirinCode/frag_pele | 9ed076a2788564d306fea747318954a726ff1ea7 | [
"MIT"
] | null | null | null | frag_pele/Growing/template_fragmenter.py | AspirinCode/frag_pele | 9ed076a2788564d306fea747318954a726ff1ea7 | [
"MIT"
] | null | null | null | frag_pele/Growing/template_fragmenter.py | AspirinCode/frag_pele | 9ed076a2788564d306fea747318954a726ff1ea7 | [
"MIT"
] | 1 | 2020-01-29T01:01:43.000Z | 2020-01-29T01:01:43.000Z | import logging
# Getting the name of the module for the log system
logger = logging.getLogger(__name__)
# Definition of reggex patterns
HEADER_OPLS2005 = "* LIGAND DATABASE FILE (OPLS2005)\n*\n"
PATTERN_OPLS2005_RESX_HEADER = "{:5} {:6d} {:6d} {:7d} {:7d} {:8d} \n"
PATTERN_OPLS2005_RESX_LINE = "{:5d} {:5d} {:1} {:4... | 46.489831 | 123 | 0.640271 | import logging
logger = logging.getLogger(__name__)
HEADER_OPLS2005 = "* LIGAND DATABASE FILE (OPLS2005)\n*\n"
PATTERN_OPLS2005_RESX_HEADER = "{:5} {:6d} {:6d} {:7d} {:7d} {:8d} \n"
PATTERN_OPLS2005_RESX_LINE = "{:5d} {:5d} {:1} {:4} {:4} {:5d} {: >11.5f} {: >11.5f} {: >11.5f}\n"
PATTERN_OPLS2005_NBON = "{:5d} {:... | true | true |
f74410e38b72052a3df0250de0cae39cd69eae75 | 29,985 | py | Python | wodoo/tools.py | mt-software-de/wodoo | 251d33b4bde69c6f7a0f4b4b83933f59c276b861 | [
"MIT"
] | null | null | null | wodoo/tools.py | mt-software-de/wodoo | 251d33b4bde69c6f7a0f4b4b83933f59c276b861 | [
"MIT"
] | null | null | null | wodoo/tools.py | mt-software-de/wodoo | 251d33b4bde69c6f7a0f4b4b83933f59c276b861 | [
"MIT"
] | null | null | null | import platform
import hashlib
import requests
import stat
from contextlib import contextmanager
import re
import docker
try:
import arrow
except ImportError: pass
from pathlib import Path
import io
import traceback
import json
import pipes
import tempfile
from datetime import datetime
try:
from retrying import... | 31.898936 | 146 | 0.589161 | import platform
import hashlib
import requests
import stat
from contextlib import contextmanager
import re
import docker
try:
import arrow
except ImportError: pass
from pathlib import Path
import io
import traceback
import json
import pipes
import tempfile
from datetime import datetime
try:
from retrying import... | true | true |
f74411071faa5488d7d6379254144325ec9dc72f | 236 | py | Python | count number of digit in an entered number.py | deepaksingh4520/python-code- | a873c44706b68ffc8221dd1dec13833cfb06621a | [
"MIT"
] | null | null | null | count number of digit in an entered number.py | deepaksingh4520/python-code- | a873c44706b68ffc8221dd1dec13833cfb06621a | [
"MIT"
] | null | null | null | count number of digit in an entered number.py | deepaksingh4520/python-code- | a873c44706b68ffc8221dd1dec13833cfb06621a | [
"MIT"
] | null | null | null | n=int(input("enter a number"))
count=0
sum=0
while(n>0):
count=count+1
d=n%10
sum=sum+d
n=n//10
print("sum of number of digit of entered number is",sum)
print("the number of digit in the number are",count)
| 21.454545 | 57 | 0.622881 | n=int(input("enter a number"))
count=0
sum=0
while(n>0):
count=count+1
d=n%10
sum=sum+d
n=n//10
print("sum of number of digit of entered number is",sum)
print("the number of digit in the number are",count)
| true | true |
f7441267c2f28d1e916a869a8224dd7af8eadbf3 | 655 | py | Python | http/sunrise-sunset.py | mc-b/iotkitmp | a526617c3f5347d1ae607063ae8c759a46b4715d | [
"MIT"
] | null | null | null | http/sunrise-sunset.py | mc-b/iotkitmp | a526617c3f5347d1ae607063ae8c759a46b4715d | [
"MIT"
] | null | null | null | http/sunrise-sunset.py | mc-b/iotkitmp | a526617c3f5347d1ae607063ae8c759a46b4715d | [
"MIT"
] | 1 | 2022-03-04T09:38:26.000Z | 2022-03-04T09:38:26.000Z | from machine import Pin, SoftI2C
from lib.config import *
from lib.oled.ssd1306 import SSD1306_I2C
import urequests
import json
# Oled Display
i2c = SoftI2C(sda=Pin(DEFAULT_IOTKIT_I2C_SDA), scl=Pin(DEFAULT_IOTKIT_I2C_SCL))
display = SSD1306_I2C(128, 64, i2c)
###
# Verbindung zum Cloud Dienst
#
req = urequests.request... | 24.259259 | 108 | 0.723664 | from machine import Pin, SoftI2C
from lib.config import *
from lib.oled.ssd1306 import SSD1306_I2C
import urequests
import json
i2c = SoftI2C(sda=Pin(DEFAULT_IOTKIT_I2C_SDA), scl=Pin(DEFAULT_IOTKIT_I2C_SCL))
display = SSD1306_I2C(128, 64, i2c)
req = urequests.request(method='GET', url='http://api.sunrise-sunset.org/... | true | true |
f74413eee5cce34d917060b6d2488856e7914143 | 24,295 | py | Python | snowdialect.py | ihor-mozil-by/snowflake-sqlalchemy | d3f72bccbb49f8c17fcb4fa4605bda31b50ac139 | [
"Apache-2.0"
] | null | null | null | snowdialect.py | ihor-mozil-by/snowflake-sqlalchemy | d3f72bccbb49f8c17fcb4fa4605bda31b50ac139 | [
"Apache-2.0"
] | null | null | null | snowdialect.py | ihor-mozil-by/snowflake-sqlalchemy | d3f72bccbb49f8c17fcb4fa4605bda31b50ac139 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2012-2019 Snowflake Computing Inc. All right reserved.
#
import operator
from functools import reduce
import sqlalchemy.types as sqltypes
from six import iteritems
from six.moves.urllib_parse import unquote_plus
from snowflake.connector import errors as ... | 38.079937 | 135 | 0.599465 |
import operator
from functools import reduce
import sqlalchemy.types as sqltypes
from six import iteritems
from six.moves.urllib_parse import unquote_plus
from snowflake.connector import errors as sf_errors
from snowflake.connector.constants import UTF8
from sqlalchemy import event as sa_vnt
from sqlalchemy impo... | true | true |
f7441464b1d9086113c428a7dd78c8aec7164d2f | 2,285 | py | Python | sims-g2/euler-g1-g2-cmp/s3/plot-riem-3d.py | ammarhakim/ammar-simjournal | 85b64ddc9556f01a4fab37977864a7d878eac637 | [
"MIT",
"Unlicense"
] | 1 | 2019-12-19T16:21:13.000Z | 2019-12-19T16:21:13.000Z | sims-g2/euler-g1-g2-cmp/s3/plot-riem-3d.py | ammarhakim/ammar-simjournal | 85b64ddc9556f01a4fab37977864a7d878eac637 | [
"MIT",
"Unlicense"
] | null | null | null | sims-g2/euler-g1-g2-cmp/s3/plot-riem-3d.py | ammarhakim/ammar-simjournal | 85b64ddc9556f01a4fab37977864a7d878eac637 | [
"MIT",
"Unlicense"
] | 2 | 2020-01-08T06:23:33.000Z | 2020-01-08T07:06:50.000Z | from pylab import *
import tables
import pylab
from matplotlib import rcParams
import matplotlib.pyplot as plt
# customization for figure
#rcParams['lines.linewidth'] = 2
rcParams['font.size'] = 18
#rcParams['xtick.major.size'] = 8 # default is 4
#rcParams['xtick.major.width'] ... | 28.209877 | 107 | 0.63326 | from pylab import *
import tables
import pylab
from matplotlib import rcParams
import matplotlib.pyplot as plt
rcParams['font.size'] = 18
e'
rcParams['image.origin'] = 'lower'
rcParams['contour.negative_linestyle'] = 'solid'
rcParams['mathtext.default'] = 'regular'
from optpar... | true | true |
f744154f010a7e14fc8b2467e849f89c2f8b44a6 | 2,581 | py | Python | scons/templates/buster_py2_options.py | markendr/esys-escript.github.io | 0023eab09cd71f830ab098cb3a468e6139191e8d | [
"Apache-2.0"
] | null | null | null | scons/templates/buster_py2_options.py | markendr/esys-escript.github.io | 0023eab09cd71f830ab098cb3a468e6139191e8d | [
"Apache-2.0"
] | null | null | null | scons/templates/buster_py2_options.py | markendr/esys-escript.github.io | 0023eab09cd71f830ab098cb3a468e6139191e8d | [
"Apache-2.0"
] | null | null | null |
##############################################################################
#
# Copyright (c) 2003-2020 by The University of Queensland
# http://www.uq.edu.au
#
# Primary Business: Queensland, Australia
# Licensed under the Apache License, version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
#
# Development unt... | 30.72619 | 83 | 0.667183 | true | true | |
f7441602c73a268dd40291e6397b91ed0f1027f6 | 3,185 | py | Python | seq2seq-chatbot/chat_web.py | rohitkujur1997/chatbot | 76cd460b09f75532a7259d783114d8cf3dda246f | [
"MIT"
] | 104 | 2018-03-28T20:30:25.000Z | 2022-02-18T19:43:21.000Z | seq2seq-chatbot/chat_web.py | rohitkujur1997/chatbot | 76cd460b09f75532a7259d783114d8cf3dda246f | [
"MIT"
] | 37 | 2018-04-16T15:39:17.000Z | 2021-05-29T11:28:26.000Z | seq2seq-chatbot/chat_web.py | rohitkujur1997/chatbot | 76cd460b09f75532a7259d783114d8cf3dda246f | [
"MIT"
] | 63 | 2018-05-18T09:52:20.000Z | 2021-07-26T08:11:17.000Z | """
Script for serving a trained chatbot model over http
"""
import datetime
import click
from os import path
from flask import Flask, request, send_from_directory
from flask_cors import CORS
from flask_restful import Resource, Api
import general_utils
import chat_command_handler
from chat_settings import ChatSettings... | 37.916667 | 141 | 0.661538 | import datetime
import click
from os import path
from flask import Flask, request, send_from_directory
from flask_cors import CORS
from flask_restful import Resource, Api
import general_utils
import chat_command_handler
from chat_settings import ChatSettings
from chatbot_model import ChatbotModel
from vocabulary impor... | true | true |
f7441726dde71fb499287d3136e855d103b71b48 | 9,354 | py | Python | testing/scripts/test_benchmark.py | MichaelXcc/seldon-core | e304ba28b9ef14bbda4f357bb145db2732a9e0a5 | [
"Apache-2.0"
] | 3,049 | 2017-12-21T14:50:09.000Z | 2022-03-30T18:14:15.000Z | testing/scripts/test_benchmark.py | MichaelXcc/seldon-core | e304ba28b9ef14bbda4f357bb145db2732a9e0a5 | [
"Apache-2.0"
] | 3,678 | 2017-12-22T16:21:30.000Z | 2022-03-31T20:32:31.000Z | testing/scripts/test_benchmark.py | MichaelXcc/seldon-core | e304ba28b9ef14bbda4f357bb145db2732a9e0a5 | [
"Apache-2.0"
] | 714 | 2018-01-03T11:29:49.000Z | 2022-03-31T03:49:59.000Z | import json
import numpy as np
import pytest
import tensorflow as tf
from google.protobuf import json_format
from seldon_e2e_utils import post_comment_in_pr, run_benchmark_and_capture_results
@pytest.mark.benchmark
@pytest.mark.usefixtures("argo_worfklows")
def test_service_orchestrator():
sort_by = ["apiType"... | 34.138686 | 88 | 0.640047 | import json
import numpy as np
import pytest
import tensorflow as tf
from google.protobuf import json_format
from seldon_e2e_utils import post_comment_in_pr, run_benchmark_and_capture_results
@pytest.mark.benchmark
@pytest.mark.usefixtures("argo_worfklows")
def test_service_orchestrator():
sort_by = ["apiType"... | true | true |
f74417ca6221ba7a0135b159e1ef84401f82e714 | 10,533 | py | Python | attention_guidance/examples/language-modeling/run_language_modeling.py | ameet-1997/AttentionGuidance | 3b4a1dec750048c434ea7429f6b80adb34b98cc2 | [
"MIT"
] | 6 | 2020-10-07T02:03:27.000Z | 2021-07-22T02:35:13.000Z | attention_guidance/examples/language-modeling/run_language_modeling.py | ameet-1997/AttentionGuidance | 3b4a1dec750048c434ea7429f6b80adb34b98cc2 | [
"MIT"
] | null | null | null | attention_guidance/examples/language-modeling/run_language_modeling.py | ameet-1997/AttentionGuidance | 3b4a1dec750048c434ea7429f6b80adb34b98cc2 | [
"MIT"
] | null | null | null | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. 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 cop... | 37.219081 | 138 | 0.685085 |
import logging
import math
import os
from dataclasses import dataclass, field
from typing import Optional
from transformers import (
CONFIG_MAPPING,
MODEL_WITH_LM_HEAD_MAPPING,
AutoConfig,
AutoModelWithLMHead,
AutoTokenizer,
DataCollatorForLanguageModeling,
HfArgumentParser... | true | true |
f74417ce67e0ae53ab742512fb5eb471f5a8f864 | 739 | py | Python | run_VAP_remove.py | wxr007/media-tools-by-ffmpeg | a3f615daf3b9a0530123d0222400d4e5744621c4 | [
"MIT"
] | null | null | null | run_VAP_remove.py | wxr007/media-tools-by-ffmpeg | a3f615daf3b9a0530123d0222400d4e5744621c4 | [
"MIT"
] | null | null | null | run_VAP_remove.py | wxr007/media-tools-by-ffmpeg | a3f615daf3b9a0530123d0222400d4e5744621c4 | [
"MIT"
] | null | null | null | # encoding:utf-8
'''Remove audio from video with FFmpeg (4.1.x).
从视频中删除音频
Author: He Zhang @ University of Exeter
Date: 16th April 2019 (Update: 18th April 2019)
Contact: hz298@exeter.ac.uk zhangheupc@126.com
Copyright (c) 2019 He Zhang
'''
# Python 3.7
import os
import subprocess
# Set the path of input and outp... | 24.633333 | 72 | 0.733424 |
import os
import subprocess
INPUT_VIDEO = "Media/Demo_360P.mp4"
OUTPUT_FILE = "Media/Demo_360P_noS.mp4"
if os.path.isfile(OUTPUT_FILE) is True:
os.remove(OUTPUT_FILE)
cmd = "ffmpeg -y -i " + INPUT_VIDEO + " -an -vcodec copy " + OUTPUT_FILE
subprocess.call(cmd, shell=True)
| true | true |
f744185299b8f7a8f882c924bc954feac7a5d7d0 | 5,393 | py | Python | lib/matsuba/config.py | Storlek/matsuba | 01f26503c050257d793c14b5d656a147b62d1744 | [
"Artistic-2.0"
] | 3 | 2015-08-21T05:49:19.000Z | 2021-08-07T23:43:15.000Z | lib/matsuba/config.py | Storlek/matsuba | 01f26503c050257d793c14b5d656a147b62d1744 | [
"Artistic-2.0"
] | null | null | null | lib/matsuba/config.py | Storlek/matsuba | 01f26503c050257d793c14b5d656a147b62d1744 | [
"Artistic-2.0"
] | null | null | null | # ------------------------------------------------------------------------------
# Path setup
# Variables ending in _PATH are used as URL paths; those ending with _FSPATH
# are filesystem paths.
# For a single board setup (wakaba style), set SITE_PATH to / and point
# MATSUBA_PATH to /boardname/matsuba.py
# The base... | 33.70625 | 108 | 0.701279 |
SITE_BASEURL = 'http://127.0.0.1/'
SITE_PATH = '/'
MATSUBA_PATH = '/matsuba.py'
CSS_PATH = '/css'
JS_PATH = '/js'
IMG_PATH = '/img'
SITE_FSPATH = '/home/you/public_html'
CSS_FSPATH = SITE_FSPATH + CSS_PATH
IMG_FSPATH = SITE_FSPATH + IMG_PATH
PRIVATE_FSPATH = '/home/you/matsuba/priv'
DB_DATABA... | true | true |
f744185554c965a641c5c7d6f851b7c1122d6135 | 92 | py | Python | python/arduino_termpoint/comm_app/message_receiver.py | ZaoLahma/ArduinoStuff | 9f02ce2fed1163b66c35fb01448212824f64caf8 | [
"MIT"
] | null | null | null | python/arduino_termpoint/comm_app/message_receiver.py | ZaoLahma/ArduinoStuff | 9f02ce2fed1163b66c35fb01448212824f64caf8 | [
"MIT"
] | null | null | null | python/arduino_termpoint/comm_app/message_receiver.py | ZaoLahma/ArduinoStuff | 9f02ce2fed1163b66c35fb01448212824f64caf8 | [
"MIT"
] | null | null | null | class MessageReceiver:
def receive_msg(self, message):
raise NotImplementedError | 30.666667 | 35 | 0.75 | class MessageReceiver:
def receive_msg(self, message):
raise NotImplementedError | true | true |
f74419180ada0c289c6345da3cfc611fe0573b35 | 285 | py | Python | LSsurf/matlab_to_year.py | SmithB/LSsurf | 1ce78d5d97c45082dfcfc0c013fce590947f0c0a | [
"MIT"
] | 1 | 2019-12-25T09:46:08.000Z | 2019-12-25T09:46:08.000Z | LSsurf/matlab_to_year.py | tsutterley/LSsurf | 6333e70f33b7d9fed25fbfe4c45b9d5a8e2ef488 | [
"MIT"
] | 5 | 2019-08-08T20:07:05.000Z | 2020-05-07T18:43:04.000Z | LSsurf/matlab_to_year.py | tsutterley/LSsurf | 6333e70f33b7d9fed25fbfe4c45b9d5a8e2ef488 | [
"MIT"
] | 2 | 2019-05-29T11:53:52.000Z | 2019-06-12T20:28:39.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Jan 30 20:12:44 2019
@author: ben
"""
def matlab_to_year(t):
# approximate conversion of matlab date to year. Uses the matlab conversion
# datestr('jan 1 2000') -> 730486
return (t-730486.)/365.25+2000.
| 20.357143 | 80 | 0.649123 |
def matlab_to_year(t):
return (t-730486.)/365.25+2000.
| true | true |
f74419351c9e531a2c5e193441006a9e78442905 | 5,053 | py | Python | backend/project/settings.py | Pachwenko/ember-django-example | cfed8a4519e307ea72a097336f9b07bfa5ee576f | [
"MIT"
] | null | null | null | backend/project/settings.py | Pachwenko/ember-django-example | cfed8a4519e307ea72a097336f9b07bfa5ee576f | [
"MIT"
] | 1 | 2022-01-17T00:51:15.000Z | 2022-01-17T00:51:15.000Z | backend/project/settings.py | Pachwenko/ember-django-example | cfed8a4519e307ea72a097336f9b07bfa5ee576f | [
"MIT"
] | null | null | null | """
Django settings for backend project.
Generated by 'django-admin startproject' using Django 3.2.6.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.2/ref/settings/
"""
from pathlib... | 29.899408 | 99 | 0.708886 |
from pathlib import Path
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = 'django-insecure-)tg)%he#a4ovp3%@4#m*u7m_#s%sni6npd+m&n(zt#zh_ti%!h'
DEBUG = True
CORS_ALLOWED_ORIGINS = [
"http://localhost:8000",
"http://localhost:4200",
]
# Application definition
INSTALLED_APPS = [
'... | true | true |
f74419d29824f103711e979256d5dda0f65762b6 | 34,285 | py | Python | rhyme_init_tc.py | yuxiqian/ping-shui-rhymes | a22bf76c2690c6b0b482934c46e3df329dbe9197 | [
"MIT"
] | 1 | 2019-02-08T13:59:09.000Z | 2019-02-08T13:59:09.000Z | rhyme_init_tc.py | yuxiqian/ping-shui-rhymes | a22bf76c2690c6b0b482934c46e3df329dbe9197 | [
"MIT"
] | null | null | null | rhyme_init_tc.py | yuxiqian/ping-shui-rhymes | a22bf76c2690c6b0b482934c46e3df329dbe9197 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import rhyme_words_tc as rhyme_words
def PingShuiYunInit(sheet, mainIndex, secondIndex, Chars):
i = 0
while i < len(Chars):
oneChar = Chars[i]
if oneChar in "[]":
i += 1
continue
if i != len(Chars) - 1:
if Chars[i + 1] == '['... | 157.995392 | 1,350 | 0.865218 |
import rhyme_words_tc as rhyme_words
def PingShuiYunInit(sheet, mainIndex, secondIndex, Chars):
i = 0
while i < len(Chars):
oneChar = Chars[i]
if oneChar in "[]":
i += 1
continue
if i != len(Chars) - 1:
if Chars[i + 1] == '[':
polyD... | true | true |
f7441a595132086ded1443ca27a7caa4bc7cb89e | 6,421 | py | Python | NN_segmentation/tst_dataset.py | MATHplus-Young-Academy/P2-Cardiac-Motion | 844995e8e5760f981c425d13c0bd7f2f3bb8baec | [
"Apache-2.0"
] | 1 | 2022-03-24T11:07:19.000Z | 2022-03-24T11:07:19.000Z | NN_segmentation/tst_dataset.py | MATHplus-Young-Academy/P2-Cardiac-Motion | 844995e8e5760f981c425d13c0bd7f2f3bb8baec | [
"Apache-2.0"
] | null | null | null | NN_segmentation/tst_dataset.py | MATHplus-Young-Academy/P2-Cardiac-Motion | 844995e8e5760f981c425d13c0bd7f2f3bb8baec | [
"Apache-2.0"
] | 1 | 2022-03-17T08:55:56.000Z | 2022-03-17T08:55:56.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Nov 3 17:32:08 2020
@author: apramanik
"""
import numpy as np
import SimpleITK as sitk
import torch
from torch.utils.data import Dataset, DataLoader
import matplotlib.pyplot as plt
#%% Functions
def normalize_img(img):
img = img.copy().astyp... | 32.105 | 154 | 0.592898 |
import numpy as np
import SimpleITK as sitk
import torch
from torch.utils.data import Dataset, DataLoader
import matplotlib.pyplot as plt
def normalize_img(img):
img = img.copy().astype(np.float32)
img -= np.mean(img)
img /= np.std(img)
return img
def crop_img(img):
sizex = 144
sizey ... | true | true |
f7441ac3ae35041e05a3a09af434ac4ff4a7576e | 1,356 | py | Python | opencell/database/tests/test_utils.py | czbiohub/opencell-portal-pub | 2b056924e4f55490b16349ff0dcf3e719ab516c7 | [
"Unlicense"
] | 2 | 2022-02-17T16:24:49.000Z | 2022-03-02T22:26:48.000Z | opencell/database/tests/test_utils.py | czbiohub/opencell-portal-pub | 2b056924e4f55490b16349ff0dcf3e719ab516c7 | [
"Unlicense"
] | null | null | null | opencell/database/tests/test_utils.py | czbiohub/opencell-portal-pub | 2b056924e4f55490b16349ff0dcf3e719ab516c7 | [
"Unlicense"
] | null | null | null | import os
import pytest
import opencell.database.utils as db_utils
def test_format_plate_design_id():
valid_plate_ids = [123, 'plate123', 'Plate 123', '0123']
for plate_id in valid_plate_ids:
assert db_utils.format_plate_design_id(plate_id) == 'P0123'
# plate number can be zero
valid_plate_i... | 30.818182 | 87 | 0.64233 | import os
import pytest
import opencell.database.utils as db_utils
def test_format_plate_design_id():
valid_plate_ids = [123, 'plate123', 'Plate 123', '0123']
for plate_id in valid_plate_ids:
assert db_utils.format_plate_design_id(plate_id) == 'P0123'
valid_plate_ids = [0, '0', 'Plate 0', '... | true | true |
f7441aea57b5b04193d96cda20bc87ae4b848158 | 3,022 | py | Python | tpv_for_eetop/valle_libs/components/vteclado.py | vallemrv/tpvB3 | 9988a528b32692b01bd042cc6486188c4dc2109b | [
"Apache-2.0"
] | 3 | 2017-07-16T09:31:56.000Z | 2019-03-20T11:11:24.000Z | tpv_for_eetop/valle_libs/components/vteclado.py | ljimaz33/tpvB3 | 9988a528b32692b01bd042cc6486188c4dc2109b | [
"Apache-2.0"
] | null | null | null | tpv_for_eetop/valle_libs/components/vteclado.py | ljimaz33/tpvB3 | 9988a528b32692b01bd042cc6486188c4dc2109b | [
"Apache-2.0"
] | 1 | 2022-01-02T11:22:45.000Z | 2022-01-02T11:22:45.000Z | # @Author: Manuel Rodriguez <valle>
# @Date: 10-May-2017
# @Email: valle.mrv@gmail.com
# @Last modified by: valle
# @Last modified time: 11-Jul-2017
# @License: Apache license vesion 2.0
from kivy.uix.anchorlayout import AnchorLayout
from kivy.uix.boxlayout import BoxLayout
from kivy.storage.jsonstore import Jso... | 31.810526 | 73 | 0.554931 |
from kivy.uix.anchorlayout import AnchorLayout
from kivy.uix.boxlayout import BoxLayout
from kivy.storage.jsonstore import JsonStore
from kivy.properties import (StringProperty, NumericProperty,
ObjectProperty)
from kivy.lang import Builder
from components.botoncolor import ButtonCo... | true | true |
f7441b211a9169beb4538cc1c558565abff15473 | 1,427 | py | Python | scripts/pendulum_lqr_control.py | MatthiasDR96/inverted_pendulum_simulator | c13314b625445c13a4225b88480e2bed772fe466 | [
"MIT"
] | null | null | null | scripts/pendulum_lqr_control.py | MatthiasDR96/inverted_pendulum_simulator | c13314b625445c13a4225b88480e2bed772fe466 | [
"MIT"
] | null | null | null | scripts/pendulum_lqr_control.py | MatthiasDR96/inverted_pendulum_simulator | c13314b625445c13a4225b88480e2bed772fe466 | [
"MIT"
] | null | null | null | from src.InvertedPendulum import *
from src.Simulator import *
from src.controllers.LQRController import *
# This script shows the behavior of the pendulum controlled by an LQR controller
if __name__ == "__main__":
# Import model
model = InvertedPendulum()
# Set initial state [m, m/s, rad, rad/s... | 25.482143 | 80 | 0.606167 | from src.InvertedPendulum import *
from src.Simulator import *
from src.controllers.LQRController import *
if __name__ == "__main__":
model = InvertedPendulum()
model.set_state(np.mat([[-0.3], [0.0], [0.1], [0.0]]))
controller = Control(model)
controller.set_de... | true | true |
f7441b69e3cb5f03e6109a401ddb519f08789147 | 797 | py | Python | tests/test_sm4.py | huangbaoliu/sm2_sm3_sm4_tools | 6fc015ab0d639347d6029b5a589a44f61c0569e2 | [
"MIT"
] | 16 | 2019-11-15T12:01:37.000Z | 2022-01-21T09:16:47.000Z | tests/test_sm4.py | huangbaoliu/sm-tools | 6fc015ab0d639347d6029b5a589a44f61c0569e2 | [
"MIT"
] | 3 | 2020-04-16T06:43:28.000Z | 2022-03-09T07:19:55.000Z | tests/test_sm4.py | huangbaoliu/sm-tools | 6fc015ab0d639347d6029b5a589a44f61c0569e2 | [
"MIT"
] | 3 | 2020-01-02T06:58:08.000Z | 2021-03-19T07:25:32.000Z | from gmssl.sm4 import CryptSM4, SM4_ENCRYPT, SM4_DECRYPT
key = b'1234567891234567'
value = b'1234567'
value1 = b'1234567812345678'
iv = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
crypt_sm4 = CryptSM4()
crypt_sm4.set_key(key, SM4_ENCRYPT)
encrypt_value = crypt_sm4.crypt_ecb(value)
crypt_sm4.se... | 31.88 | 72 | 0.784191 | from gmssl.sm4 import CryptSM4, SM4_ENCRYPT, SM4_DECRYPT
key = b'1234567891234567'
value = b'1234567'
value1 = b'1234567812345678'
iv = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
crypt_sm4 = CryptSM4()
crypt_sm4.set_key(key, SM4_ENCRYPT)
encrypt_value = crypt_sm4.crypt_ecb(value)
crypt_sm4.se... | true | true |
f7441c0b8f36a2b8c4fea524fb201c4bb5434159 | 2,006 | py | Python | gokart/slack/slack_api.py | skmatz/gokart | ba1dc497dca1c7901bc861f49b1f081adc2a1888 | [
"MIT"
] | null | null | null | gokart/slack/slack_api.py | skmatz/gokart | ba1dc497dca1c7901bc861f49b1f081adc2a1888 | [
"MIT"
] | null | null | null | gokart/slack/slack_api.py | skmatz/gokart | ba1dc497dca1c7901bc861f49b1f081adc2a1888 | [
"MIT"
] | null | null | null | from logging import getLogger
import slack
logger = getLogger(__name__)
class ChannelListNotLoadedError(RuntimeError):
pass
class ChannelNotFoundError(RuntimeError):
pass
class FileNotUploadedError(RuntimeError):
pass
class SlackAPI(object):
def __init__(self, token, channel: str, to_user: st... | 35.192982 | 120 | 0.653539 | from logging import getLogger
import slack
logger = getLogger(__name__)
class ChannelListNotLoadedError(RuntimeError):
pass
class ChannelNotFoundError(RuntimeError):
pass
class FileNotUploadedError(RuntimeError):
pass
class SlackAPI(object):
def __init__(self, token, channel: str, to_user: st... | true | true |
f7441e5310ab0a958ac934c6fcc8198fb0c61d64 | 301 | py | Python | battleforcastile/utils/display_power.py | battleforcastile/battleforcastile | 65223fcb56ecc550f1a7c7b70beadff22c866d85 | [
"MIT"
] | null | null | null | battleforcastile/utils/display_power.py | battleforcastile/battleforcastile | 65223fcb56ecc550f1a7c7b70beadff22c866d85 | [
"MIT"
] | 1 | 2021-08-21T10:16:03.000Z | 2021-08-21T10:16:03.000Z | battleforcastile/utils/display_power.py | battleforcastile/battleforcastile | 65223fcb56ecc550f1a7c7b70beadff22c866d85 | [
"MIT"
] | null | null | null | def display_power(power: dict) -> str:
name = power['name']
invocation_unit = power['invocation']['card_name']
invocation_instances = power['invocation']['num_instances']
cost = power['cost']
return f'{name} (Invocation: {invocation_instances} {invocation_unit}) - Cost: {cost}'
| 33.444444 | 90 | 0.681063 | def display_power(power: dict) -> str:
name = power['name']
invocation_unit = power['invocation']['card_name']
invocation_instances = power['invocation']['num_instances']
cost = power['cost']
return f'{name} (Invocation: {invocation_instances} {invocation_unit}) - Cost: {cost}'
| true | true |
f7441f99256df929187eddf92840e6000dbee3ae | 851 | py | Python | test.py | yiluheihei/pascal-voc-writer | 07426ebda82b4e9bddd95131cf7d2352f7f92f92 | [
"MIT"
] | 2 | 2018-03-03T23:51:06.000Z | 2019-01-29T07:34:05.000Z | test.py | yiluheihei/pascal-voc-writer | 07426ebda82b4e9bddd95131cf7d2352f7f92f92 | [
"MIT"
] | null | null | null | test.py | yiluheihei/pascal-voc-writer | 07426ebda82b4e9bddd95131cf7d2352f7f92f92 | [
"MIT"
] | 3 | 2018-08-03T15:32:54.000Z | 2020-03-03T01:18:39.000Z | import os
from pascal_voc_writer import Writer as PascalWriter
def test_1(results_dir):
pascal_writer = PascalWriter('test-image.png', 100, 100)
pascal_writer.addObject(name='triangle', xy_coords=[5, 5, 95, 5, 50, 95])
pascal_writer.save(os.path.join(results_dir,
'test-... | 34.04 | 79 | 0.670975 | import os
from pascal_voc_writer import Writer as PascalWriter
def test_1(results_dir):
pascal_writer = PascalWriter('test-image.png', 100, 100)
pascal_writer.addObject(name='triangle', xy_coords=[5, 5, 95, 5, 50, 95])
pascal_writer.save(os.path.join(results_dir,
'test-... | true | true |
f74422f188a37ec850a907f032a4da2495e95f54 | 68 | py | Python | run.py | Sigmanificient/Tequila-bot | 3ef6bd7f813fb43c951c04d226a46d650b347746 | [
"MIT"
] | null | null | null | run.py | Sigmanificient/Tequila-bot | 3ef6bd7f813fb43c951c04d226a46d650b347746 | [
"MIT"
] | null | null | null | run.py | Sigmanificient/Tequila-bot | 3ef6bd7f813fb43c951c04d226a46d650b347746 | [
"MIT"
] | null | null | null | from app.bot import Bot
if __name__ == '__main__':
Bot().run()
| 13.6 | 26 | 0.632353 | from app.bot import Bot
if __name__ == '__main__':
Bot().run()
| true | true |
f744240cfcbadeb364e5d418b224733d162d1c51 | 263 | py | Python | aiida/orm/nodes/data/remote/stash/__init__.py | louisponet/aiida-core | 3214236df66a3792ee57fe38a06c0c3bb65861ab | [
"MIT",
"BSD-3-Clause"
] | 1 | 2016-09-12T10:51:00.000Z | 2016-09-12T10:51:00.000Z | aiida/orm/nodes/data/remote/stash/__init__.py | louisponet/aiida-core | 3214236df66a3792ee57fe38a06c0c3bb65861ab | [
"MIT",
"BSD-3-Clause"
] | null | null | null | aiida/orm/nodes/data/remote/stash/__init__.py | louisponet/aiida-core | 3214236df66a3792ee57fe38a06c0c3bb65861ab | [
"MIT",
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""Module with data plugins that represent files of completed calculations jobs that have been stashed."""
from .base import RemoteStashData
from .folder import RemoteStashFolderData
__all__ = ('RemoteStashData', 'RemoteStashFolderData')
| 37.571429 | 106 | 0.775665 |
from .base import RemoteStashData
from .folder import RemoteStashFolderData
__all__ = ('RemoteStashData', 'RemoteStashFolderData')
| true | true |
f74425d2da38a341b96cb6aa9098ad7113121edc | 23,507 | py | Python | clutils/datasets/QuickDraw.py | AndreaCossu/ContinualLearning_RecurrentNetworks | 8cbc247f1f660f7acb94868696d128e538ad72f4 | [
"MIT"
] | 2 | 2021-05-27T14:43:11.000Z | 2021-05-28T00:47:05.000Z | clutils/datasets/QuickDraw.py | AndreaCossu/ContinualLearning_RecurrentNetworks | 8cbc247f1f660f7acb94868696d128e538ad72f4 | [
"MIT"
] | null | null | null | clutils/datasets/QuickDraw.py | AndreaCossu/ContinualLearning_RecurrentNetworks | 8cbc247f1f660f7acb94868696d128e538ad72f4 | [
"MIT"
] | null | null | null | import torch
import numpy as np
import os
from torch.utils.data import TensorDataset, DataLoader
from .utils import collate_sequences
NORMALIZER = { # (mu, std) per class computed on the concatenation of both features (discarding the binary feature)
'hot dog': (1.3554527691145501, 55.15028414343622),
'palm tr... | 51.550439 | 115 | 0.695495 | import torch
import numpy as np
import os
from torch.utils.data import TensorDataset, DataLoader
from .utils import collate_sequences
NORMALIZER = {
'hot dog': (1.3554527691145501, 55.15028414343622),
'palm tree': (-0.7063322505461493, 49.02700047706162),
'moon': (0.8036297226693486, 41.345375756324735),... | true | true |
f74427467e3cfa5640c7cb252774015cf1cbff4e | 3,052 | py | Python | neutronclient/tests/unit/test_cli20_agents.py | zoomis/python-neutronclient | 2fa6faaa9b67c0783c502d2b56bfbacc23ecfe64 | [
"Apache-2.0"
] | null | null | null | neutronclient/tests/unit/test_cli20_agents.py | zoomis/python-neutronclient | 2fa6faaa9b67c0783c502d2b56bfbacc23ecfe64 | [
"Apache-2.0"
] | null | null | null | neutronclient/tests/unit/test_cli20_agents.py | zoomis/python-neutronclient | 2fa6faaa9b67c0783c502d2b56bfbacc23ecfe64 | [
"Apache-2.0"
] | null | null | null | # 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 agreed to in ... | 37.219512 | 78 | 0.624836 |
import sys
from oslo.serialization import jsonutils
from neutronclient.neutron.v2_0 import agent
from neutronclient.tests.unit import test_cli20
class CLITestV20Agent(test_cli20.CLITestV20Base):
def test_list_agents(self):
contents = {'agents': [{'id': 'myname', 'agent_type': 'mytype',
... | true | true |
f744293d2883b7e19ed2728d0209ffef1529c9c2 | 13,259 | py | Python | NeurIPS_2021/Figure_1/DER_cubic/trainers/bbbp.py | streeve/PI3NN | f7f08a195096e0388bb9230bc67c6acd6f41581a | [
"Apache-2.0"
] | 11 | 2021-11-08T20:38:50.000Z | 2022-01-30T02:46:39.000Z | NeurIPS_2021/Figure_1/DER_cubic/trainers/bbbp.py | streeve/PI3NN | f7f08a195096e0388bb9230bc67c6acd6f41581a | [
"Apache-2.0"
] | 1 | 2022-01-13T19:46:32.000Z | 2022-02-09T16:23:56.000Z | NeurIPS_2021/Figure_1/DER_cubic/trainers/bbbp.py | streeve/PI3NN | f7f08a195096e0388bb9230bc67c6acd6f41581a | [
"Apache-2.0"
] | 1 | 2021-12-17T18:38:26.000Z | 2021-12-17T18:38:26.000Z | import numpy as np
import tensorflow as tf
import tensorflow_probability as tfp
import time
import datetime
import os
import sys
import h5py
from pathlib import Path
import pandas as pd
import matplotlib.pyplot as plt
import evidential_deep_learning as edl
from .util import normalize, gallery
class BBBP:
def __in... | 51.19305 | 216 | 0.590014 | import numpy as np
import tensorflow as tf
import tensorflow_probability as tfp
import time
import datetime
import os
import sys
import h5py
from pathlib import Path
import pandas as pd
import matplotlib.pyplot as plt
import evidential_deep_learning as edl
from .util import normalize, gallery
class BBBP:
def __in... | true | true |
f744298b5fcc622abdc79dfd4b9236f0aa195e94 | 1,548 | py | Python | seabus/.venv-seabus/lib/python2.7/site-packages/meld3/example.py | hsiboy/seabus | b025655588c8d85ceacff3eeceb374093f035425 | [
"MIT"
] | null | null | null | seabus/.venv-seabus/lib/python2.7/site-packages/meld3/example.py | hsiboy/seabus | b025655588c8d85ceacff3eeceb374093f035425 | [
"MIT"
] | null | null | null | seabus/.venv-seabus/lib/python2.7/site-packages/meld3/example.py | hsiboy/seabus | b025655588c8d85ceacff3eeceb374093f035425 | [
"MIT"
] | null | null | null | xml = """<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:meld="http://www.plope.com/software/meld3"
xmlns:bar="http://foo/bar">
<head>
<meta content="text/html; charset=ISO-8859-1... | 29.769231 | 130 | 0.596253 | xml = """<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:meld="http://www.plope.com/software/meld3"
xmlns:bar="http://foo/bar">
<head>
<meta content="text/html; charset=ISO-8859-1... | true | true |
f74429c16b33677c7cd1aec859255259d96e3c39 | 6,933 | py | Python | grr/lib/aff4_objects/queue_test.py | mikecb/grr | 52fdd977729af2a09a147301c55b8b7f1eccfa67 | [
"Apache-2.0"
] | 5 | 2017-03-17T08:25:09.000Z | 2022-02-22T05:28:14.000Z | grr/lib/aff4_objects/queue_test.py | mikecb/grr | 52fdd977729af2a09a147301c55b8b7f1eccfa67 | [
"Apache-2.0"
] | null | null | null | grr/lib/aff4_objects/queue_test.py | mikecb/grr | 52fdd977729af2a09a147301c55b8b7f1eccfa67 | [
"Apache-2.0"
] | 3 | 2018-12-07T07:04:37.000Z | 2022-02-22T05:28:16.000Z | #!/usr/bin/env python
"""Tests for Queue."""
from grr.lib import aff4
from grr.lib import data_store
from grr.lib import flags
from grr.lib import rdfvalue
from grr.lib import test_lib
from grr.lib.aff4_objects import queue as aff4_queue
class TestQueue(aff4_queue.Queue):
rdf_type = rdfvalue.RDFInteger
class Que... | 33.172249 | 80 | 0.686139 |
from grr.lib import aff4
from grr.lib import data_store
from grr.lib import flags
from grr.lib import rdfvalue
from grr.lib import test_lib
from grr.lib.aff4_objects import queue as aff4_queue
class TestQueue(aff4_queue.Queue):
rdf_type = rdfvalue.RDFInteger
class QueueTest(test_lib.AFF4ObjectTest):
def test... | true | true |
f7442a0136631a46b54a4a364362ae3e5fcc356a | 985 | py | Python | isi_sdk_9_0_0/test/test_result_directories_extended.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 24 | 2018-06-22T14:13:23.000Z | 2022-03-23T01:21:26.000Z | isi_sdk_9_0_0/test/test_result_directories_extended.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 46 | 2018-04-30T13:28:22.000Z | 2022-03-21T21:11:07.000Z | isi_sdk_9_0_0/test/test_result_directories_extended.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: 10
Contact: sdk@isilon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import isi_sdk_9_0_0
from ... | 24.02439 | 108 | 0.729949 |
from __future__ import absolute_import
import unittest
import isi_sdk_9_0_0
from isi_sdk_9_0_0.models.result_directories_extended import ResultDirectoriesExtended
from isi_sdk_9_0_0.rest import ApiException
class TestResultDirectoriesExtended(unittest.TestCase):
def setUp(self):
pass
def tea... | true | true |
f7442aeb241f8ecea51a39d764d8fd0424e5f0d3 | 2,769 | py | Python | dataset.py | zawecha1/arXiv2020-RIFE | 8eb622a150bd3bf0e773033cbba4728e64340ba1 | [
"MIT"
] | null | null | null | dataset.py | zawecha1/arXiv2020-RIFE | 8eb622a150bd3bf0e773033cbba4728e64340ba1 | [
"MIT"
] | null | null | null | dataset.py | zawecha1/arXiv2020-RIFE | 8eb622a150bd3bf0e773033cbba4728e64340ba1 | [
"MIT"
] | null | null | null | import cv2
import ast
import torch
import numpy as np
import random
from torch.utils.data import DataLoader, Dataset
cv2.setNumThreads(1)
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
class VimeoDataset(Dataset):
def __init__(self, dataset_name, batch_size=32):
self.batch_size = bat... | 35.5 | 101 | 0.509931 | import cv2
import ast
import torch
import numpy as np
import random
from torch.utils.data import DataLoader, Dataset
cv2.setNumThreads(1)
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
class VimeoDataset(Dataset):
def __init__(self, dataset_name, batch_size=32):
self.batch_size = bat... | true | true |
f7442af2994d6070c5c59e19219c911d83c2b299 | 1,003 | py | Python | tests/test_positional_list.py | dataloudlabs/dloud-ads | d0ad3f169c2384292db4097e00ba7858f37a8198 | [
"MIT"
] | null | null | null | tests/test_positional_list.py | dataloudlabs/dloud-ads | d0ad3f169c2384292db4097e00ba7858f37a8198 | [
"MIT"
] | null | null | null | tests/test_positional_list.py | dataloudlabs/dloud-ads | d0ad3f169c2384292db4097e00ba7858f37a8198 | [
"MIT"
] | null | null | null | """ Unit tests for positional_list.PositionalList """
from dloud_ads import positional_list
def test_dummy():
"""Test definition"""
the_list = positional_list.PositionalList()
pos8 = the_list.add_last(8)
assert pos8.element() == 8
assert the_list.first().element() == pos8.element()
pos5 = the... | 31.34375 | 55 | 0.649053 |
from dloud_ads import positional_list
def test_dummy():
the_list = positional_list.PositionalList()
pos8 = the_list.add_last(8)
assert pos8.element() == 8
assert the_list.first().element() == pos8.element()
pos5 = the_list.add_after(pos8, 5)
assert pos5.element() == 5
assert the_list.firs... | true | true |
f7442d32d395eb28329137b64b34cbd32564fb9f | 1,223 | py | Python | code/src/main/python/expt/test_R.py | anonfse/COSAL_Anonymized | 709906294fd775131f3e019862bbdd554d83773d | [
"Unlicense"
] | null | null | null | code/src/main/python/expt/test_R.py | anonfse/COSAL_Anonymized | 709906294fd775131f3e019862bbdd554d83773d | [
"Unlicense"
] | 1 | 2021-11-03T08:28:31.000Z | 2021-11-03T08:28:31.000Z | code/src/main/python/expt/test_R.py | anonfse/COSAL_Anonymized | 709906294fd775131f3e019862bbdd554d83773d | [
"Unlicense"
] | 1 | 2022-03-22T14:24:13.000Z | 2022-03-22T14:24:13.000Z | import sys
import os
sys.path.append(os.path.abspath("."))
sys.dont_write_bytecode = True
__author__ = "COSAL"
from misconceptions.rUtils import functions
def process_file(file_path):
r_functions = functions.get_r_functions(file_path)
n_valid = 0
print("Processing %d functions from '%s' ... " % (len(r_funct... | 33.054054 | 115 | 0.757972 | import sys
import os
sys.path.append(os.path.abspath("."))
sys.dont_write_bytecode = True
__author__ = "COSAL"
from misconceptions.rUtils import functions
def process_file(file_path):
r_functions = functions.get_r_functions(file_path)
n_valid = 0
print("Processing %d functions from '%s' ... " % (len(r_funct... | true | true |
f7442d6684a35462ec4d53e12ecc7ad1ada2e640 | 473 | py | Python | test/resources/inspectors/python/case2_boolean_expressions.py | nihalshetty-boop/hyperstyle | 9a6d53cd1ca220d97d296c0087056b5885b26281 | [
"Apache-2.0"
] | 18 | 2020-10-05T16:48:11.000Z | 2022-03-22T04:15:38.000Z | test/resources/inspectors/python/case2_boolean_expressions.py | nihalshetty-boop/hyperstyle | 9a6d53cd1ca220d97d296c0087056b5885b26281 | [
"Apache-2.0"
] | 60 | 2020-10-05T17:01:05.000Z | 2022-01-27T12:46:14.000Z | test/resources/inspectors/python/case2_boolean_expressions.py | nihalshetty-boop/hyperstyle | 9a6d53cd1ca220d97d296c0087056b5885b26281 | [
"Apache-2.0"
] | 6 | 2021-02-09T09:31:19.000Z | 2021-08-13T07:45:51.000Z |
a = int(input())
b = int(input())
c = int(input())
d = int(input())
if a > b:
print('a > b')
if a > b and a > b:
print('a > b again')
if a > b and a < d:
print('b < a < d')
if not a > b:
print('not a > b')
if b < a < d:
print('b < a < d again')
if a > b == True:
print('a > b and True')
i... | 15.258065 | 50 | 0.501057 |
a = int(input())
b = int(input())
c = int(input())
d = int(input())
if a > b:
print('a > b')
if a > b and a > b:
print('a > b again')
if a > b and a < d:
print('b < a < d')
if not a > b:
print('not a > b')
if b < a < d:
print('b < a < d again')
if a > b == True:
print('a > b and True')
i... | true | true |
f7442d6d0576b34ebfc39a603b0adfe04d63b4f5 | 9,903 | py | Python | Scripts/extract_features.py | vessemer/LungCancerDetection | b1810c608896406abf8964298c0dd9ccf4816008 | [
"MIT"
] | 18 | 2017-05-08T23:50:53.000Z | 2020-12-10T19:34:42.000Z | Scripts/extract_features.py | vessemer/LungCancerDetection | b1810c608896406abf8964298c0dd9ccf4816008 | [
"MIT"
] | 1 | 2018-09-03T08:15:22.000Z | 2019-04-02T12:38:26.000Z | Scripts/extract_features.py | vessemer/LungCancerDetection | b1810c608896406abf8964298c0dd9ccf4816008 | [
"MIT"
] | 13 | 2017-05-08T23:51:10.000Z | 2021-09-27T05:44:36.000Z | import sys
sys.path.append('../')
sys.path.append('../support/')
from scipy.ndimage.measurements import label
from scipy.ndimage import interpolation
from time import time
from glob import glob
import timeit
from os.path import join, basename, isfile
from tqdm import tqdm
from paths import *
from ct_reader import *
imp... | 34.266436 | 107 | 0.597799 | import sys
sys.path.append('../')
sys.path.append('../support/')
from scipy.ndimage.measurements import label
from scipy.ndimage import interpolation
from time import time
from glob import glob
import timeit
from os.path import join, basename, isfile
from tqdm import tqdm
from paths import *
from ct_reader import *
imp... | true | true |
f7442d8bd9f66af52e33eeab82962866f27372e2 | 1,992 | py | Python | pdb2pqr-1.9.0/scons/scons-local-2.3.0/SCons/Tool/suncc.py | Acpharis/protein_prep | 8cc2f0caedefd5a3fdaa764ed013c2660a4df1b8 | [
"BSD-3-Clause"
] | 9 | 2016-08-17T06:52:10.000Z | 2020-04-28T04:20:07.000Z | pdb2pqr-1.9.0/scons/scons-local-2.3.0/SCons/Tool/suncc.py | Acpharis/protein_prep | 8cc2f0caedefd5a3fdaa764ed013c2660a4df1b8 | [
"BSD-3-Clause"
] | null | null | null | pdb2pqr-1.9.0/scons/scons-local-2.3.0/SCons/Tool/suncc.py | Acpharis/protein_prep | 8cc2f0caedefd5a3fdaa764ed013c2660a4df1b8 | [
"BSD-3-Clause"
] | 1 | 2021-03-03T23:20:25.000Z | 2021-03-03T23:20:25.000Z | """SCons.Tool.suncc
Tool-specific initialization for Sun Solaris (Forte) CC and cc.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010... | 33.762712 | 113 | 0.730924 |
__revision__ = "src/engine/SCons/Tool/suncc.py 2013/03/03 09:48:35 garyo"
import SCons.Util
import cc
def generate(env):
cc.generate(env)
env['CXX'] = 'CC'
env['SHCCFLAGS'] = SCons.Util.CLVar('$CCFLAGS -KPIC')
env['SHOBJPREFIX'] = 'so_'
env['SHOBJSUFFIX'] =... | true | true |
f744309ab0811f5c32c26fb1ee6c3f6b280ee80a | 316 | py | Python | intuition/__main__.py | sirjamesmeddel-gitty/intuition | cd517e6b3b315a743eb4d0d0dc294e264ab913ce | [
"Apache-2.0"
] | 81 | 2015-01-13T15:16:43.000Z | 2021-11-12T20:51:56.000Z | intuition/__main__.py | sirjamesmeddel-gitty/intuition | cd517e6b3b315a743eb4d0d0dc294e264ab913ce | [
"Apache-2.0"
] | 1 | 2015-07-30T06:17:55.000Z | 2015-07-30T08:09:14.000Z | intuition/__main__.py | sirjamesmeddel-gitty/intuition | cd517e6b3b315a743eb4d0d0dc294e264ab913ce | [
"Apache-2.0"
] | 30 | 2015-03-26T11:55:46.000Z | 2021-07-22T22:16:39.000Z | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
'''
Intuition app entry point
--------------------------
:copyright (c) 2014 Xavier Bruhiere
:license: Apache 2.0, see LICENSE for more details.
'''
import sys
from intuition.cli import main
if __name__ == '__main__':
sys.exit(main())
| 16.631579 | 53 | 0.598101 |
import sys
from intuition.cli import main
if __name__ == '__main__':
sys.exit(main())
| true | true |
f744319fea8e3b1370f1bbbc5f1c14a17a7329b3 | 218 | py | Python | devito/ir/iet/__init__.py | reguly/devito | 543b7be41ddbf1faa90224cca3824767756c9390 | [
"MIT"
] | 204 | 2020-01-09T11:27:58.000Z | 2022-03-20T22:53:37.000Z | devito/ir/iet/__init__.py | reguly/devito | 543b7be41ddbf1faa90224cca3824767756c9390 | [
"MIT"
] | 949 | 2016-04-25T11:41:34.000Z | 2019-12-27T10:43:40.000Z | devito/ir/iet/__init__.py | reguly/devito | 543b7be41ddbf1faa90224cca3824767756c9390 | [
"MIT"
] | 131 | 2020-01-08T17:43:13.000Z | 2022-03-27T11:36:47.000Z | from devito.ir.iet.nodes import * # noqa
from devito.ir.iet.visitors import * # noqa
from devito.ir.iet.utils import * # noqa
from devito.ir.iet.efunc import * # noqa
from devito.ir.iet.algorithms import * # noqa
| 36.333333 | 46 | 0.724771 | from devito.ir.iet.nodes import *
from devito.ir.iet.visitors import *
from devito.ir.iet.utils import *
from devito.ir.iet.efunc import *
from devito.ir.iet.algorithms import *
| true | true |
f74431a2e304800785db7025dcd388a35ea0235a | 601 | py | Python | example/APIDef.py | eddiedb6/w3 | e8723ade738a3e501bab18316591c7727e2bd4de | [
"MIT"
] | null | null | null | example/APIDef.py | eddiedb6/w3 | e8723ade738a3e501bab18316591c7727e2bd4de | [
"MIT"
] | 1 | 2019-11-07T06:15:44.000Z | 2019-11-07T06:15:44.000Z | example/APIDef.py | eddiedb6/w3 | e8723ade738a3e501bab18316591c7727e2bd4de | [
"MIT"
] | null | null | null | {
###################################
# User data should be added below #
###################################
# e.g. "aidPage" is default function in W3 and do not need to specify here #
#"aidPage": {
# W3Const.w3ElementType: W3Const.w3TypeApi,
# W3Const.w3ApiName: "page",
# W3... | 28.619048 | 80 | 0.427621 | {
| true | true |
f7443285e55b759c4bd6e6479fddf6d687ddf333 | 22,066 | py | Python | suzieq/poller/services/svcparser.py | ewlumpkin/suzieq | 9d55a46a631f01535d5b8ab1c0b870f840bbc526 | [
"Apache-2.0"
] | null | null | null | suzieq/poller/services/svcparser.py | ewlumpkin/suzieq | 9d55a46a631f01535d5b8ab1c0b870f840bbc526 | [
"Apache-2.0"
] | null | null | null | suzieq/poller/services/svcparser.py | ewlumpkin/suzieq | 9d55a46a631f01535d5b8ab1c0b870f840bbc526 | [
"Apache-2.0"
] | null | null | null | import re
import ast
import logging
import operator as op
def _stepdown_rest(entry) -> list:
'''move the elements one level down into the existing JSON hierarchy.
if `entry` has the structure {'vrfs': {'routes'...} on invocation,
it'll be {'routes'...} on exit. It makes no sense to move down them
hie... | 41.633962 | 84 | 0.467053 | import re
import ast
import logging
import operator as op
def _stepdown_rest(entry) -> list:
if isinstance(entry["rest"], dict):
keylist = list(entry["rest"].keys())
data = entry["rest"]
entry = []
for key in keylist:
entry += [{"rest": data[key]}]
else:
ent... | true | true |
f744333c9073b4f2a19fa9a197395880267a2670 | 1,380 | py | Python | analyze/ruby-dic3_ana.py | takkii/Pylean | d51595e2788e946d9a2492bbe7131e4ada19062f | [
"MIT"
] | 1 | 2020-06-22T10:05:23.000Z | 2020-06-22T10:05:23.000Z | analyze/ruby-dic3_ana.py | takkii/Pylean | d51595e2788e946d9a2492bbe7131e4ada19062f | [
"MIT"
] | null | null | null | analyze/ruby-dic3_ana.py | takkii/Pylean | d51595e2788e946d9a2492bbe7131e4ada19062f | [
"MIT"
] | null | null | null | from os.path import expanduser
import dask.dataframe as dd
import os
import pandas as pd
from pandas import DataFrame
# ------------------------------- KEYWORD -------------------------------------------------------------------------
home = expanduser("~")
d1 = os.path.expanduser("~/.cache/dein/repos/github.com/ta... | 35.384615 | 115 | 0.621014 | from os.path import expanduser
import dask.dataframe as dd
import os
import pandas as pd
from pandas import DataFrame
home = expanduser("~")
d1 = os.path.expanduser("~/.cache/dein/repos/github.com/takkii/go_straight/dict/")
d2 = os.path.expanduser("~/.config/nvim/.cache/dein/repos/github.com/takkii/go_straight/di... | true | true |
f7443550c00996127d9d65b6ed2b1e31e9653a95 | 11,416 | py | Python | tensorflow/python/ops/ragged/ragged_where_op.py | vixadd/tensorflow | 8c624204eb686a91779149dc500e6c8c60096074 | [
"Apache-2.0"
] | 3 | 2019-11-19T14:07:27.000Z | 2020-10-04T12:57:40.000Z | tensorflow/python/ops/ragged/ragged_where_op.py | vixadd/tensorflow | 8c624204eb686a91779149dc500e6c8c60096074 | [
"Apache-2.0"
] | 4 | 2020-04-09T16:22:20.000Z | 2021-12-15T13:57:36.000Z | tensorflow/python/ops/ragged/ragged_where_op.py | vixadd/tensorflow | 8c624204eb686a91779149dc500e6c8c60096074 | [
"Apache-2.0"
] | 4 | 2022-01-13T11:23:44.000Z | 2022-03-02T11:11:42.000Z | # Copyright 2018 The TensorFlow 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 applica... | 43.242424 | 80 | 0.683252 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import typing
from tensorflow.python.framework import ops
from tensorflow.python.ops import array_ops
from tensorflow.python.ops import math_ops
from tensorflow.python.ops.ragged import ragged_c... | true | true |
f744358e01f6ad039125da21db7108ea56570b63 | 15,073 | py | Python | sklearn_classifier/sklearn_classifier.py | zilbermanor/functions | a1ef1411089314b8a264a70077a64ea77ccc0558 | [
"Apache-2.0"
] | null | null | null | sklearn_classifier/sklearn_classifier.py | zilbermanor/functions | a1ef1411089314b8a264a70077a64ea77ccc0558 | [
"Apache-2.0"
] | null | null | null | sklearn_classifier/sklearn_classifier.py | zilbermanor/functions | a1ef1411089314b8a264a70077a64ea77ccc0558 | [
"Apache-2.0"
] | null | null | null | import json
import os
from importlib import import_module
from inspect import getfullargspec, FullArgSpec
from cloudpickle import dump, load
import itertools
import sklearn
import pandas as pd
import pyarrow as pa
import pyarrow.parquet as pq
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
fr... | 36.763415 | 123 | 0.639753 | import json
import os
from importlib import import_module
from inspect import getfullargspec, FullArgSpec
from cloudpickle import dump, load
import itertools
import sklearn
import pandas as pd
import pyarrow as pa
import pyarrow.parquet as pq
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
fr... | true | true |
f74435ed63fb52dc6c30589b7916c8e692c5d616 | 10,929 | py | Python | app/ch15_deploy/flasktut/pypi_org/bin/load_data.py | jfcorbett/data-driven-web-apps-with-flask | e0fbf17d8f0b22120f79bafe960677c7d3fa4f21 | [
"MIT"
] | null | null | null | app/ch15_deploy/flasktut/pypi_org/bin/load_data.py | jfcorbett/data-driven-web-apps-with-flask | e0fbf17d8f0b22120f79bafe960677c7d3fa4f21 | [
"MIT"
] | null | null | null | app/ch15_deploy/flasktut/pypi_org/bin/load_data.py | jfcorbett/data-driven-web-apps-with-flask | e0fbf17d8f0b22120f79bafe960677c7d3fa4f21 | [
"MIT"
] | null | null | null | import json
import os
import sys
import time
from typing import List, Optional, Dict
import progressbar
from dateutil.parser import parse
sys.path.insert(0, os.path.abspath(os.path.join(
os.path.dirname(__file__), "..", "..")))
import pypi_org.data.db_session as db_session
from pypi_org.data.languages import Pro... | 28.98939 | 99 | 0.585323 | import json
import os
import sys
import time
from typing import List, Optional, Dict
import progressbar
from dateutil.parser import parse
sys.path.insert(0, os.path.abspath(os.path.join(
os.path.dirname(__file__), "..", "..")))
import pypi_org.data.db_session as db_session
from pypi_org.data.languages import Pro... | true | true |
f74436a9a94f666dc9bacb3f25ac589122b071d6 | 2,454 | py | Python | library/tests/test_features.py | pimoroni/bh1745-python | 95c9b9c440907597680b896c5f92830e526b3db8 | [
"MIT"
] | 8 | 2018-09-20T14:44:23.000Z | 2021-01-27T14:46:22.000Z | library/tests/test_features.py | aejb/bh1745-python | 10edb1cfba9d3c01abcc885a201409a928f9af78 | [
"MIT"
] | 5 | 2018-10-30T08:56:09.000Z | 2021-11-08T14:12:18.000Z | library/tests/test_features.py | aejb/bh1745-python | 10edb1cfba9d3c01abcc885a201409a928f9af78 | [
"MIT"
] | 2 | 2018-10-30T08:52:51.000Z | 2019-06-14T09:21:55.000Z | # noqa D100
import sys
import mock
def _setup():
global bh1745
from tools import SMBusFakeDeviceNoTimeout
smbus = mock.Mock()
smbus.SMBus = SMBusFakeDeviceNoTimeout
sys.modules['smbus'] = smbus
from bh1745 import BH1745
bh1745 = BH1745()
def test_set_adc_gain_x():
"""Test setting adc... | 26.673913 | 98 | 0.712714 |
import sys
import mock
def _setup():
global bh1745
from tools import SMBusFakeDeviceNoTimeout
smbus = mock.Mock()
smbus.SMBus = SMBusFakeDeviceNoTimeout
sys.modules['smbus'] = smbus
from bh1745 import BH1745
bh1745 = BH1745()
def test_set_adc_gain_x():
_setup()
bh1745.setup(time... | true | true |
f744377257c267de9a541d46d57e721046e3b68d | 4,691 | py | Python | train/train_trade.py | ByungKwanLee/AdversarialMemory | d4cccfec4d370f975dffc826346b1a1a28916444 | [
"MIT"
] | 3 | 2021-01-21T10:05:10.000Z | 2021-02-02T06:28:07.000Z | train/train_trade.py | ByungKwanLee/AdversarialMemory | d4cccfec4d370f975dffc826346b1a1a28916444 | [
"MIT"
] | null | null | null | train/train_trade.py | ByungKwanLee/AdversarialMemory | d4cccfec4d370f975dffc826346b1a1a28916444 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# numpy package
import numpy as np
# torch package
import torch
import torchvision
from torch.nn.functional import cross_entropy, softmax, log_softmax
# basic package
import os
import sys
sys.path.append('.')
import argparse
from tqdm import tqdm
from datetime import datetime
# custom package
... | 32.804196 | 153 | 0.655084 |
import numpy as np
import torch
import torchvision
from torch.nn.functional import cross_entropy, softmax, log_softmax
import os
import sys
sys.path.append('.')
import argparse
from tqdm import tqdm
from datetime import datetime
from loader.argument_print import argument_print
from loader.loader import dataset... | true | true |
f744381112b719468ef00038b0bd22ddee4d9558 | 797 | py | Python | project/urls.py | CoopG/clinical-data-dashboard | bac14448015d355faeb880b757a1b19b83ac853e | [
"MIT"
] | null | null | null | project/urls.py | CoopG/clinical-data-dashboard | bac14448015d355faeb880b757a1b19b83ac853e | [
"MIT"
] | null | null | null | project/urls.py | CoopG/clinical-data-dashboard | bac14448015d355faeb880b757a1b19b83ac853e | [
"MIT"
] | null | null | null | """project URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based... | 34.652174 | 77 | 0.70138 | from django.contrib import admin
from django.urls import include, path
urlpatterns = [
path('cdd/', include('cdd.urls')),
path('admin/', admin.site.urls),
]
| true | true |
f7443995cbd89b0fa91a2056e397c2590b46b55d | 583 | py | Python | utils/Exceptions.py | EddyAnalytics/eddy-automl-backend | 5f90da1cac8b343eacee21748bde80f04660f5ca | [
"Apache-2.0"
] | 2 | 2021-09-24T07:52:05.000Z | 2022-01-26T17:02:59.000Z | utils/Exceptions.py | EddyAnalytics/eddy-automl-backend | 5f90da1cac8b343eacee21748bde80f04660f5ca | [
"Apache-2.0"
] | 19 | 2020-06-21T19:00:31.000Z | 2022-02-10T11:34:47.000Z | utils/Exceptions.py | EddyAnalytics/eddy-automl-backend | 5f90da1cac8b343eacee21748bde80f04660f5ca | [
"Apache-2.0"
] | null | null | null | class UnauthorizedException(Exception):
def __init__(self):
super(UnauthorizedException, self).__init__('User not authenticated.')
class ForbiddenException(Exception):
def __init__(self):
super(ForbiddenException, self).__init__('User not authorized.')
class ConflictException(Exception):
... | 30.684211 | 102 | 0.73928 | class UnauthorizedException(Exception):
def __init__(self):
super(UnauthorizedException, self).__init__('User not authenticated.')
class ForbiddenException(Exception):
def __init__(self):
super(ForbiddenException, self).__init__('User not authorized.')
class ConflictException(Exception):
... | true | true |
f74439dbe39e79c8a62008c0c2bc9cc0965f3204 | 863 | py | Python | CAIL2021/slsb/selftest.py | ShenDezhou/CAIL | c4cfa98ab4ecedbce34a7a5a186830486047540c | [
"Apache-2.0"
] | 71 | 2020-07-16T01:49:27.000Z | 2022-03-27T16:55:00.000Z | CAIL2020/sfzyzc/sfzyzb/selftest.py | ShenDezhou/CAIL | c4cfa98ab4ecedbce34a7a5a186830486047540c | [
"Apache-2.0"
] | 11 | 2020-09-18T14:26:25.000Z | 2022-02-09T23:49:33.000Z | CAIL2020/sfzyzb/selftest.py | ShenDezhou/CAIL | c4cfa98ab4ecedbce34a7a5a186830486047540c | [
"Apache-2.0"
] | 16 | 2020-07-15T07:24:30.000Z | 2022-03-19T05:41:11.000Z | import json
import pandas
import urllib3
from classmerge import match
from dataclean import cleanall
df = pandas.read_csv("dataset/valid-phase1.csv")
http = urllib3.PoolManager()
correct = 0
for index, row in df.iterrows():
label = row[0]
title = row[1].replace(".doc","").replace(".docx","")
content = cle... | 30.821429 | 73 | 0.636153 | import json
import pandas
import urllib3
from classmerge import match
from dataclean import cleanall
df = pandas.read_csv("dataset/valid-phase1.csv")
http = urllib3.PoolManager()
correct = 0
for index, row in df.iterrows():
label = row[0]
title = row[1].replace(".doc","").replace(".docx","")
content = cle... | true | true |
f7443b7168540fda84fe88957e81cfbd5d939e33 | 1,162 | py | Python | chapters/chap04.py | DatHydroGuy/RayTracer | f870d3eb0408e52b92ee528bb6615187b762bede | [
"MIT"
] | null | null | null | chapters/chap04.py | DatHydroGuy/RayTracer | f870d3eb0408e52b92ee528bb6615187b762bede | [
"MIT"
] | null | null | null | chapters/chap04.py | DatHydroGuy/RayTracer | f870d3eb0408e52b92ee528bb6615187b762bede | [
"MIT"
] | null | null | null | from matrices import Matrix
from tuples import Point
from canvas import Canvas
from colours import Colour
from math import pi
def run():
# our clock face will be drawn in the x-y plane, so z-components will always be 0
WIDTH = 500
HEIGHT = 500
c = Canvas(WIDTH, HEIGHT)
for i in range(12):
... | 30.578947 | 93 | 0.570568 | from matrices import Matrix
from tuples import Point
from canvas import Canvas
from colours import Colour
from math import pi
def run():
WIDTH = 500
HEIGHT = 500
c = Canvas(WIDTH, HEIGHT)
for i in range(12):
p = Point(0, 0, 0)
t = Matrix.translation(0, 200, 0)
p12... | true | true |
f7443b97c2e5dc3f61f83293927f9752d2476b4b | 549 | py | Python | examples/schedule/schedule_scripts.py | timgates42/plan | 1e976dcfd7cbe4ae7f95a4ff48f7e40a369ca8ee | [
"BSD-3-Clause"
] | 553 | 2015-01-04T08:41:44.000Z | 2022-02-26T03:11:26.000Z | examples/schedule/schedule_scripts.py | jcao1022/plan | 1e976dcfd7cbe4ae7f95a4ff48f7e40a369ca8ee | [
"BSD-3-Clause"
] | 5 | 2015-01-03T14:55:41.000Z | 2020-05-14T03:02:38.000Z | examples/schedule/schedule_scripts.py | jcao1022/plan | 1e976dcfd7cbe4ae7f95a4ff48f7e40a369ca8ee | [
"BSD-3-Clause"
] | 71 | 2015-01-17T19:52:23.000Z | 2020-04-30T14:11:38.000Z | # -*- coding: utf-8 -*-
# Use this file to easily define all of your cron jobs.
#
# It's helpful to understand cron before proceeding.
# http://en.wikipedia.org/wiki/Cron
#
# Learn more: http://github.com/fengsp/plan
from plan import Plan
cron = Plan("scripts", path='/web/yourproject/scripts',
... | 26.142857 | 71 | 0.657559 |
# http://en.wikipedia.org/wiki/Cron
#
# Learn more: http://github.com/fengsp/plan
from plan import Plan
cron = Plan("scripts", path='/web/yourproject/scripts',
environment={'YOURAPP_ENV': 'production'})
cron.script('script.py', every='1.day')
cron.script('script_2.py', every='1.mont... | true | true |
f7443be820bc4d643480b3f59a82f6a9867f9c1e | 833 | py | Python | dashboard/migrations/0001_initial.py | lkmtraining/de-backup-dashboard | 2a3381cc932c20462ba21d9313be6398e4865405 | [
"MIT"
] | null | null | null | dashboard/migrations/0001_initial.py | lkmtraining/de-backup-dashboard | 2a3381cc932c20462ba21d9313be6398e4865405 | [
"MIT"
] | 4 | 2020-02-11T23:33:41.000Z | 2021-06-10T21:03:23.000Z | dashboard/migrations/0001_initial.py | lkmtraining/de-backup-dashboard | 2a3381cc932c20462ba21d9313be6398e4865405 | [
"MIT"
] | null | null | null | # Generated by Django 2.1.3 on 2018-12-03 15:22
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Host',
fields=[
('id', models.AutoField(aut... | 30.851852 | 114 | 0.559424 |
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Host',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=Fal... | true | true |
f7443c5c8fb0ca3a0be6e4a04c7a2c246d7b0cea | 29,352 | py | Python | Apps/phrequesttracker/requesttracker_connector.py | ryanbsaunders/phantom-apps | 1befda793a08d366fbd443894f993efb1baf9635 | [
"Apache-2.0"
] | 1 | 2021-09-17T23:25:01.000Z | 2021-09-17T23:25:01.000Z | Apps/phrequesttracker/requesttracker_connector.py | ryanbsaunders/phantom-apps | 1befda793a08d366fbd443894f993efb1baf9635 | [
"Apache-2.0"
] | 4 | 2021-10-04T09:22:02.000Z | 2021-11-01T12:00:04.000Z | Apps/phrequesttracker/requesttracker_connector.py | ryanbsaunders/phantom-apps | 1befda793a08d366fbd443894f993efb1baf9635 | [
"Apache-2.0"
] | 1 | 2021-09-17T06:42:35.000Z | 2021-09-17T06:42:35.000Z | # File: rt_connector.py
# Copyright (c) 2021 Splunk Inc.
#
# SPLUNK CONFIDENTIAL - Use or disclosure of this material in whole or in part
# without a valid written license from Splunk Inc. is PROHIBITED.
# Phantom imports
import phantom.app as phantom
from phantom.base_connector import BaseConnector
from phantom.actio... | 37.824742 | 147 | 0.638525 |
import phantom.app as phantom
from phantom.base_connector import BaseConnector
from phantom.action_result import ActionResult
from phantom.rules import vault_info
from phantom.vault import Vault
from requesttracker_consts import *
import requests
import json
import re
class RetVal(tuple):
def __new__(c... | true | true |
f7443c5e54ef89397198c23512ec79183255e053 | 1,792 | py | Python | ExtraModules/phonenumbers/data/region_WS.py | chirantana-trust/web-chirantana | 18e2fb105fc5a9f55586c55096780c062ad9f2bc | [
"Unlicense"
] | 1 | 2015-01-31T01:17:14.000Z | 2015-01-31T01:17:14.000Z | ExtraModules/phonenumbers/data/region_WS.py | chirantana-trust/web-chirantana | 18e2fb105fc5a9f55586c55096780c062ad9f2bc | [
"Unlicense"
] | null | null | null | ExtraModules/phonenumbers/data/region_WS.py | chirantana-trust/web-chirantana | 18e2fb105fc5a9f55586c55096780c062ad9f2bc | [
"Unlicense"
] | null | null | null | """Auto-generated file, do not edit by hand. WS metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_WS = PhoneMetadata(id='WS', country_code=685, international_prefix='0',
general_desc=PhoneNumberDesc(national_number_pattern='[2-8]\\d{4,6}', possible_number_pattern='... | 89.6 | 153 | 0.745536 | from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_WS = PhoneMetadata(id='WS', country_code=685, international_prefix='0',
general_desc=PhoneNumberDesc(national_number_pattern='[2-8]\\d{4,6}', possible_number_pattern='\\d{5,7}'),
fixed_line=PhoneNumberDesc(national_number_p... | true | true |
f7443c6b71fbe38497973674d1dbade93d23b606 | 24,770 | py | Python | fluffypancakes/handler.py | suhasrsharma/FluffyPancakes | 3fb039f331dd3de120a1ad70f15d3bbad91df1ce | [
"MIT"
] | 6 | 2020-06-06T04:06:23.000Z | 2021-01-26T23:21:41.000Z | fluffypancakes/handler.py | suhasrsharma/FluffyPancakes | 3fb039f331dd3de120a1ad70f15d3bbad91df1ce | [
"MIT"
] | 1 | 2020-06-05T17:11:27.000Z | 2020-06-05T17:43:38.000Z | fluffypancakes/handler.py | suhasrsharma/FluffyPancakes | 3fb039f331dd3de120a1ad70f15d3bbad91df1ce | [
"MIT"
] | 2 | 2020-06-16T14:43:56.000Z | 2021-01-26T23:21:53.000Z | # -*- coding: utf-8 -*-
"""
@authors: Suhas Sharma and Rahul P
"""
"""
Error codes can be found at the end of this file
"""
import ipaddress as ip
import urllib.parse as urlparse
import ssl
import socket
import requests
from bs4 import BeautifulSoup as bs
from ast import literal_eval
import urllib
import re
from dat... | 31.11809 | 115 | 0.45866 |
import ipaddress as ip
import urllib.parse as urlparse
import ssl
import socket
import requests
from bs4 import BeautifulSoup as bs
from ast import literal_eval
import urllib
import re
from datetime import datetime
from selenium import webdriver
from selenium.webdriver import ActionChains
from selenium.webdriver.ch... | true | true |
f7443cb0292a34d3436afe0e0e054f9e30d776ef | 111,706 | py | Python | Cython/Compiler/Symtab.py | iqxd/cython | a63b5ff11a5bc9479e39830fb7d3f75d24e0b3e3 | [
"Apache-2.0"
] | 1 | 2019-12-11T13:10:59.000Z | 2019-12-11T13:10:59.000Z | Cython/Compiler/Symtab.py | iqxd/cython | a63b5ff11a5bc9479e39830fb7d3f75d24e0b3e3 | [
"Apache-2.0"
] | null | null | null | Cython/Compiler/Symtab.py | iqxd/cython | a63b5ff11a5bc9479e39830fb7d3f75d24e0b3e3 | [
"Apache-2.0"
] | null | null | null | #
# Symbol Table
#
from __future__ import absolute_import
import re
import copy
import operator
try:
import __builtin__ as builtins
except ImportError: # Py3
import builtins
from .Errors import warning, error, InternalError
from .StringEncoding import EncodedString
from . import Options, Naming
from . im... | 43.686351 | 134 | 0.593478 |
from __future__ import absolute_import
import re
import copy
import operator
try:
import __builtin__ as builtins
except ImportError:
import builtins
from .Errors import warning, error, InternalError
from .StringEncoding import EncodedString
from . import Options, Naming
from . import PyrexTypes
from .P... | true | true |
f7443ddaa1c18cf884dc4909bc8e94a01ad4b7b5 | 10,035 | py | Python | buscaMinas.py | programingfrik/randomPython | 7faba7c721e0fb88e6593c7e6c4ad16e45261233 | [
"MIT"
] | null | null | null | buscaMinas.py | programingfrik/randomPython | 7faba7c721e0fb88e6593c7e6c4ad16e45261233 | [
"MIT"
] | 1 | 2017-02-23T21:07:56.000Z | 2017-03-12T02:02:29.000Z | buscaMinas.py | programingfrik/randomPython | 7faba7c721e0fb88e6593c7e6c4ad16e45261233 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
# -*- coding: utf-8 -*-
# Imitando el buscaminas de windows, esto es un tributo al juego ese
# en el que perdimos tanto tiempo, pero hecho en python3/tkinter
# La idea de hacer esto surgió en casa de Julio, pc nueva, sin juegos,
# un tonto propuso "hagamos el buscaminas en python", y bueno no se
# ... | 35.459364 | 76 | 0.504833 |
from tkinter import *
from tkinter.messagebox import *
from tkinter.font import *
import random
import datetime
class BuscaMinas(Frame):
def __init__(self, master = None):
Frame.__init__(self, master)
self.cantx = 10
self.canty = 10
self.cantm = 25
self.minas = ... | true | true |
f7443f3ec244153a1a0cbdd459a73c4a7aebf224 | 1,379 | py | Python | ooobuild/dyn/sheet/x_sheet_condition2.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | ooobuild/dyn/sheet/x_sheet_condition2.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | ooobuild/dyn/sheet/x_sheet_condition2.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
#
# Copyright 2022 :Barry-Thomas-Paul: Moss
#
# 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 applicab... | 37.27027 | 87 | 0.771574 |
from typing import TYPE_CHECKING
from ooo.oenv.env_const import UNO_ENVIRONMENT, UNO_RUNTIME
_DYNAMIC = False
if (not TYPE_CHECKING) and UNO_RUNTIME and UNO_ENVIRONMENT:
_DYNAMIC = True
if not TYPE_CHECKING and _DYNAMIC:
from com.sun.star.sheet import XSheetCondition2 as XSheetCondition2
... | true | true |
f7443fff4ef24544650fa24961dd4acd4adbfc96 | 1,087 | py | Python | HTTPrequests/HTTPrequests/HTTPrequests.py | Jhoneagle/RandomProducts | 1b4dcdb45cec5eee120e60c2e422f7569fa67dfb | [
"MIT"
] | null | null | null | HTTPrequests/HTTPrequests/HTTPrequests.py | Jhoneagle/RandomProducts | 1b4dcdb45cec5eee120e60c2e422f7569fa67dfb | [
"MIT"
] | 3 | 2021-03-31T18:53:52.000Z | 2021-12-13T19:54:49.000Z | HTTPrequests/HTTPrequests/HTTPrequests.py | Jhoneagle/PythonCollection | 1b4dcdb45cec5eee120e60c2e422f7569fa67dfb | [
"MIT"
] | null | null | null | import requests
import sys, os
import json
def main():
if (len(sys.argv) < 3):
print('you need to give atleast url and HTTP-reguest type!')
return
url = sys.argv[1]
type = sys.argv[2]
if (type == 'POST' or type == 'PUT'):
if (len(sys.argv) < 4):
print('you also nee... | 25.27907 | 74 | 0.50966 | import requests
import sys, os
import json
def main():
if (len(sys.argv) < 3):
print('you need to give atleast url and HTTP-reguest type!')
return
url = sys.argv[1]
type = sys.argv[2]
if (type == 'POST' or type == 'PUT'):
if (len(sys.argv) < 4):
print('you also nee... | true | true |
f7444009f88f790522c4b5f064bfced500920819 | 1,456 | py | Python | src/exec/co2_data.py | leonardbj/AIMS | 7f8f484ab829f15366cb04ab37f799ad88edd29a | [
"MIT"
] | null | null | null | src/exec/co2_data.py | leonardbj/AIMS | 7f8f484ab829f15366cb04ab37f799ad88edd29a | [
"MIT"
] | null | null | null | src/exec/co2_data.py | leonardbj/AIMS | 7f8f484ab829f15366cb04ab37f799ad88edd29a | [
"MIT"
] | null | null | null | """ Description here
Author: Leonard Berrada
Date: 5 Nov 2015
"""
import sys
sys.path.append("../")
import matplotlib.pyplot as plt
from Regression import AutoRegressive, AutoCorrelation, GaussianProcess, KalmanFilter
from process_data import data_from_file
file_name = "co2.mat"
data_dict = data_from_file(file_... | 21.411765 | 85 | 0.613324 |
import sys
sys.path.append("../")
import matplotlib.pyplot as plt
from Regression import AutoRegressive, AutoCorrelation, GaussianProcess, KalmanFilter
from process_data import data_from_file
file_name = "co2.mat"
data_dict = data_from_file(file_name)
model = "AR"
if model.lower() == 'kf':
p = 25
k... | true | true |
f74440192f378d55dc332864d56835ca0993edb0 | 20,425 | py | Python | bubbob/ext2/__init__.py | fpiesche/bub-n-bros | 29f6b77a125aa4ac071f470607c268fcd210a6fb | [
"MIT"
] | 1 | 2021-01-16T22:00:06.000Z | 2021-01-16T22:00:06.000Z | bubbob/ext2/__init__.py | fpiesche/bub-n-bros | 29f6b77a125aa4ac071f470607c268fcd210a6fb | [
"MIT"
] | 2 | 2022-03-18T09:46:12.000Z | 2022-03-25T09:36:42.000Z | bubbob/ext2/__init__.py | fpiesche/bub-n-bros | 29f6b77a125aa4ac071f470607c268fcd210a6fb | [
"MIT"
] | null | null | null | from __future__ import generators
import os, math, random
import gamesrv
from bubbob import images
from bubbob.images import ActiveSprite
from bubbob.boards import CELL, HALFCELL, bget
from bubbob.mnstrmap import GreenAndBlue, Ghost
from bubbob.bonuses import Bonus
from bubbob.bubbles import Bubble
LocalDir = os.path.... | 35.215517 | 80 | 0.425361 | from __future__ import generators
import os, math, random
import gamesrv
from bubbob import images
from bubbob.images import ActiveSprite
from bubbob.boards import CELL, HALFCELL, bget
from bubbob.mnstrmap import GreenAndBlue, Ghost
from bubbob.bonuses import Bonus
from bubbob.bubbles import Bubble
LocalDir = os.path.... | true | true |
f7444032f5d5416d4f7d761e85b2c89421ff9ce1 | 2,133 | py | Python | misc/traceplusunittest.py | gungnir888/transitfeed3 | 406e7ca3fe274521ef5dbf9277c729182b5183cb | [
"Apache-2.0"
] | null | null | null | misc/traceplusunittest.py | gungnir888/transitfeed3 | 406e7ca3fe274521ef5dbf9277c729182b5183cb | [
"Apache-2.0"
] | null | null | null | misc/traceplusunittest.py | gungnir888/transitfeed3 | 406e7ca3fe274521ef5dbf9277c729182b5183cb | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2018 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | 31.835821 | 85 | 0.712611 |
import unittest
from . import traceplus
import traceback
import inspect
class TextBigStackTestRunner(unittest.TextTestRunner):
def _makeResult(self):
return TextBigStackTestResult(self.stream, self.descriptions, self.verbosity)
class TextBigStackTestResult(unittest.TextTestResu... | true | true |
f74440a0f1dbd5f22746398c4ac445a56172a024 | 7,094 | py | Python | tests/integration/management/test_compaction_settings.py | reddit/cqlmapper | c5cfce4bc1fcda1562780133b4ff9407e071b0f8 | [
"Apache-2.0"
] | 11 | 2017-09-02T07:37:25.000Z | 2021-04-19T03:30:59.000Z | tests/integration/management/test_compaction_settings.py | Seanpm2001-reddit/cqlmapper | c5cfce4bc1fcda1562780133b4ff9407e071b0f8 | [
"Apache-2.0"
] | 5 | 2018-02-15T06:40:16.000Z | 2021-12-13T20:05:16.000Z | tests/integration/management/test_compaction_settings.py | Seanpm2001-reddit/cqlmapper | c5cfce4bc1fcda1562780133b4ff9407e071b0f8 | [
"Apache-2.0"
] | 15 | 2017-05-10T20:51:27.000Z | 2021-04-19T03:31:10.000Z | # Modifications Copyright 2016-2017 Reddit, Inc.
#
# Copyright 2013-2016 DataStax, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unle... | 38.554348 | 100 | 0.629828 |
import copy
from unittest.mock import patch
import six
from cqlmapper import columns
from cqlmapper.management import _get_table_metadata
from cqlmapper.management import _update_options
from cqlmapper.management import drop_table
from cqlmapper.management import sync_table
from cqlmapper.models impor... | true | true |
f744416658fc7240107cbb1227f2668b504e3019 | 6,665 | py | Python | bloomberg-api.py | embryologit/bloomberg-api-py | 147308c8c353ae9c65b57c22a76169c8f1efff6b | [
"MIT"
] | null | null | null | bloomberg-api.py | embryologit/bloomberg-api-py | 147308c8c353ae9c65b57c22a76169c8f1efff6b | [
"MIT"
] | null | null | null | bloomberg-api.py | embryologit/bloomberg-api-py | 147308c8c353ae9c65b57c22a76169c8f1efff6b | [
"MIT"
] | null | null | null | import requests
import json
from datetime import datetime
import os
REQUEST_HEADERS = {
'authority': 'www.bloomberg.com',
'cache-control': 'max-age=0',
'upgrade-insecure-requests': '1',
'user-agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.... | 67.323232 | 2,567 | 0.765641 | import requests
import json
from datetime import datetime
import os
REQUEST_HEADERS = {
'authority': 'www.bloomberg.com',
'cache-control': 'max-age=0',
'upgrade-insecure-requests': '1',
'user-agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.... | true | true |
f74441bc65e922141c6dabe0ed79b441368a4468 | 4,649 | py | Python | multi-job_mpi_Sim_tf_v2.py | virthead/COMPASS-multijob-pilot | beac49ec432d24382d4d23aacfe6c9674a59e118 | [
"Apache-2.0"
] | null | null | null | multi-job_mpi_Sim_tf_v2.py | virthead/COMPASS-multijob-pilot | beac49ec432d24382d4d23aacfe6c9674a59e118 | [
"Apache-2.0"
] | null | null | null | multi-job_mpi_Sim_tf_v2.py | virthead/COMPASS-multijob-pilot | beac49ec432d24382d4d23aacfe6c9674a59e118 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import sys
import os
import subprocess
import time
from os.path import abspath as _abspath, join as _join
from mpi4py import MPI
import random
#---------------------------------------------
# Main start here
#---------------------------------------------
# Obtain MPI rank
def main():
start_g... | 36.320313 | 175 | 0.608303 |
import sys
import os
import subprocess
import time
from os.path import abspath as _abspath, join as _join
from mpi4py import MPI
import random
def main():
start_g = time.time()
start_g_str = time.asctime(time.localtime(start_g))
comm = MPI.COMM_WORLD
rank = comm.Get_rank()
max_rank = comm.Get... | true | true |
f74441db2773a5a826056f981dd9aed9b7cc6d50 | 14,337 | py | Python | openrl/algorithms/imitation/imitation_learning.py | natetsang/open-rl | 426723d0d6759672ce77e02afeb55cbeb68fcfb0 | [
"MIT"
] | 2 | 2021-09-10T18:52:35.000Z | 2022-01-03T19:48:06.000Z | openrl/algorithms/imitation/imitation_learning.py | natetsang/open-rl | 426723d0d6759672ce77e02afeb55cbeb68fcfb0 | [
"MIT"
] | 1 | 2021-12-28T17:42:23.000Z | 2021-12-28T17:42:23.000Z | openrl/algorithms/imitation/imitation_learning.py | natetsang/open-rl | 426723d0d6759672ce77e02afeb55cbeb68fcfb0 | [
"MIT"
] | null | null | null | import gym
import time
import pickle
import argparse
import numpy as np
import tensorflow as tf
from typing import Callable, Union, Tuple, List
from models.models import actor_fc_discrete_network, actor_critic_fc_discrete_network
from algorithms.imitation.utils import plot_training_results
from util.replay_buffer impor... | 43.054054 | 121 | 0.625584 | import gym
import time
import pickle
import argparse
import numpy as np
import tensorflow as tf
from typing import Callable, Union, Tuple, List
from models.models import actor_fc_discrete_network, actor_critic_fc_discrete_network
from algorithms.imitation.utils import plot_training_results
from util.replay_buffer impor... | true | true |
f74441eff49b7f1e90d7f6695dd620b3aafecd23 | 144 | py | Python | exercises/exc_01_03_01.py | rongpenl/spacy-course | e1228321257f70de94ab98ca3f0fec7e95952a86 | [
"MIT"
] | 1 | 2019-07-08T17:32:42.000Z | 2019-07-08T17:32:42.000Z | exercises/exc_01_03_01.py | rongpenl/k16math-course | e1228321257f70de94ab98ca3f0fec7e95952a86 | [
"MIT"
] | null | null | null | exercises/exc_01_03_01.py | rongpenl/k16math-course | e1228321257f70de94ab98ca3f0fec7e95952a86 | [
"MIT"
] | null | null | null | # Calculate the amount of money for certain number of bananas
bananaPrice = 1
numberOfBanana = 3
cost = bananaPrice * replaceMe
print(cost)
| 14.4 | 61 | 0.763889 |
bananaPrice = 1
numberOfBanana = 3
cost = bananaPrice * replaceMe
print(cost)
| true | true |
f744438a335c36deba5b38ae161c8097eea8ad7a | 245 | py | Python | Print Function.py | antofurna/ADM-HW | 851359a70720057bca0c7fb748ae5461b3e86148 | [
"MIT"
] | 1 | 2019-10-14T16:18:35.000Z | 2019-10-14T16:18:35.000Z | Print Function.py | antofurna/ADM-HW | 851359a70720057bca0c7fb748ae5461b3e86148 | [
"MIT"
] | null | null | null | Print Function.py | antofurna/ADM-HW | 851359a70720057bca0c7fb748ae5461b3e86148 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Sun Oct 13 12:08:46 2019
@author: antonio.furnari
"""
from __future__ import print_function
if __name__ == '__main__':
n = int(raw_input())
for i in range(1, n+1):
print (i, end='') | 17.5 | 38 | 0.591837 |
from __future__ import print_function
if __name__ == '__main__':
n = int(raw_input())
for i in range(1, n+1):
print (i, end='') | true | true |
f74443bf29054d3dc116f67dc95213833c73687d | 881 | py | Python | NewsPaper/news/admin.py | VladimirKupriyanov/news-paper | 4cd4fc72d2c2c56684556012221f6b95d8c6d1b5 | [
"MIT"
] | null | null | null | NewsPaper/news/admin.py | VladimirKupriyanov/news-paper | 4cd4fc72d2c2c56684556012221f6b95d8c6d1b5 | [
"MIT"
] | null | null | null | NewsPaper/news/admin.py | VladimirKupriyanov/news-paper | 4cd4fc72d2c2c56684556012221f6b95d8c6d1b5 | [
"MIT"
] | null | null | null | from django.contrib import admin
from django.contrib.flatpages.admin import FlatPageAdmin
from django.contrib.flatpages.models import FlatPage
from django.utils.translation import gettext_lazy as _
from .models import Author, Category, Post, PostCategory, Comment
# class FlatPageAdmin(FlatPageAdmin):
# fieldsets ... | 29.366667 | 67 | 0.643587 | from django.contrib import admin
from django.contrib.flatpages.admin import FlatPageAdmin
from django.contrib.flatpages.models import FlatPage
from django.utils.translation import gettext_lazy as _
from .models import Author, Category, Post, PostCategory, Comment
admin.site.register(Author)
admin.sit... | true | true |
f74443ebe5fd883ff88852f1ab85a07f100f3962 | 2,214 | py | Python | tests/mem/test_llsc_span.py | CTSRD-CHERI/cheritest | bcf7628a3d83ea8773ab32455e05784549b345fa | [
"Apache-2.0"
] | null | null | null | tests/mem/test_llsc_span.py | CTSRD-CHERI/cheritest | bcf7628a3d83ea8773ab32455e05784549b345fa | [
"Apache-2.0"
] | 2 | 2020-06-02T13:44:55.000Z | 2020-06-02T14:06:29.000Z | tests/mem/test_llsc_span.py | CTSRD-CHERI/cheritest | bcf7628a3d83ea8773ab32455e05784549b345fa | [
"Apache-2.0"
] | null | null | null | #-
# Copyright (c) 2011 Robert N. M. Watson
# All rights reserved.
#
# This software was developed by SRI International and the University of
# Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237
# ("CTSRD"), as part of the DARPA CRASH research programme.
#
# @BERI_LICENSE_HEADER_START@
#
# License... | 37.525424 | 79 | 0.724932 |
from beritest_tools import BaseBERITestCase
from beritest_tools import attr
class test_llsc_span(BaseBERITestCase):
@attr('llsc')
@attr('cached')
@attr('llscspan')
def test_ll_ld_sc_success(self):
self.assertRegisterEqual(self.MIPS.a2, 1, "ll+ld+sc failed")
... | true | true |
f7444582dafcce2354b0ba27be77592b2c082f86 | 1,282 | py | Python | xvfbmagic.py | arokem/xvfbmagic | ed82d11b472e2e79ac68b54ecc7cd73f6d96a7ec | [
"BSD-3-Clause"
] | 2 | 2015-12-19T06:06:54.000Z | 2019-04-02T21:23:20.000Z | xvfbmagic.py | arokem/xvfbmagic | ed82d11b472e2e79ac68b54ecc7cd73f6d96a7ec | [
"BSD-3-Clause"
] | null | null | null | xvfbmagic.py | arokem/xvfbmagic | ed82d11b472e2e79ac68b54ecc7cd73f6d96a7ec | [
"BSD-3-Clause"
] | null | null | null | from __future__ import print_function
from IPython.core.magic import (Magics, magics_class, line_magic,
cell_magic, line_cell_magic)
from xvfbwrapper import Xvfb
@magics_class
class XvfbMagics(Magics):
def __init__(self, shell, **xvfb_kwargs):
"""
Initialize the Xv... | 26.708333 | 65 | 0.620905 | from __future__ import print_function
from IPython.core.magic import (Magics, magics_class, line_magic,
cell_magic, line_cell_magic)
from xvfbwrapper import Xvfb
@magics_class
class XvfbMagics(Magics):
def __init__(self, shell, **xvfb_kwargs):
super(XvfbMagics, self).__ini... | true | true |
f74445b9cfed15e09d045ec81d565f311e4c5117 | 7,347 | py | Python | finrl/commands/data_commands.py | solazu/FinRL-Library | 6cfe00933c16fc8a74efc9fb3d9cfa1b3bf296ea | [
"MIT"
] | 1 | 2021-07-18T13:31:55.000Z | 2021-07-18T13:31:55.000Z | finrl/commands/data_commands.py | solazu/FinRL-Library | 6cfe00933c16fc8a74efc9fb3d9cfa1b3bf296ea | [
"MIT"
] | null | null | null | finrl/commands/data_commands.py | solazu/FinRL-Library | 6cfe00933c16fc8a74efc9fb3d9cfa1b3bf296ea | [
"MIT"
] | null | null | null | import logging
import sys
import yfinance
import pandas as pd
import yfinance as yf
import os
from collections import defaultdict
from datetime import datetime, timedelta
from typing import Any, Dict, List
from finrl.config import TimeRange, setup_utils_configuration
from finrl.data.converter import convert_ohlcv_fo... | 38.067358 | 99 | 0.625017 | import logging
import sys
import yfinance
import pandas as pd
import yfinance as yf
import os
from collections import defaultdict
from datetime import datetime, timedelta
from typing import Any, Dict, List
from finrl.config import TimeRange, setup_utils_configuration
from finrl.data.converter import convert_ohlcv_fo... | true | true |
f744477ba71d66c6e1236374bd6315e77f34fde2 | 15,990 | py | Python | sdk/python/pulumi_azure_nextgen/network/v20190601/express_route_circuit.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 31 | 2020-09-21T09:41:01.000Z | 2021-02-26T13:21:59.000Z | sdk/python/pulumi_azure_nextgen/network/v20190601/express_route_circuit.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 231 | 2020-09-21T09:38:45.000Z | 2021-03-01T11:16:03.000Z | sdk/python/pulumi_azure_nextgen/network/v20190601/express_route_circuit.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 4 | 2020-09-29T14:14:59.000Z | 2021-02-10T20:38:16.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... | 52.94702 | 2,747 | 0.693684 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from . import outputs
from ._enums import *
from ._inputs import *
__all__ = ['ExpressRouteCircuit']
class ExpressRouteCircuit(pulumi.CustomResource):
def __init_... | true | true |
f744478711045eb0a25c67c256d48a360a6dba8b | 1,345 | py | Python | surface/misc.py | megodoonch/birdsong | 582e7ddecf6c9c1b75f17418097f7bcbf6784d31 | [
"BSD-3-Clause-Clear"
] | null | null | null | surface/misc.py | megodoonch/birdsong | 582e7ddecf6c9c1b75f17418097f7bcbf6784d31 | [
"BSD-3-Clause-Clear"
] | null | null | null | surface/misc.py | megodoonch/birdsong | 582e7ddecf6c9c1b75f17418097f7bcbf6784d31 | [
"BSD-3-Clause-Clear"
] | null | null | null | import numpy as np
# Generate some n number of colours, hopefully maximally different
# source: http://stackoverflow.com/questions/470690/how-to-automatically-generate-n-distinct-colors
import colorsys
def get_colors(num_colors):
colors=[]
for i in np.arange(0., 360., 360. / num_colors):
hue = i/360... | 25.865385 | 99 | 0.594796 | import numpy as np
import colorsys
def get_colors(num_colors):
colors=[]
for i in np.arange(0., 360., 360. / num_colors):
hue = i/360.
lightness = (20 + np.random.rand() * 10)/100.
saturation = (90 + np.random.rand() * 10)/100.
colors.append(colorsys.hls_to_rgb(hue, lightne... | true | true |
f744488b0acb7a3da6caee5b3de972f56dbefe78 | 3,292 | py | Python | utils/fairseq_mod/fairseq_mod/criterions/cross_entropy.py | saidineshpola/Knowledge-Distillation-Toolkit | b05ebc28ae1385c9caa1c4c1c93db2d67356e85f | [
"MIT"
] | 69 | 2021-03-27T10:28:27.000Z | 2022-03-29T07:32:02.000Z | utils/fairseq_mod/fairseq_mod/criterions/cross_entropy.py | saidineshpola/Knowledge-Distillation-Toolkit | b05ebc28ae1385c9caa1c4c1c93db2d67356e85f | [
"MIT"
] | 5 | 2021-05-24T08:56:59.000Z | 2021-11-19T09:21:31.000Z | utils/fairseq_mod/fairseq_mod/criterions/cross_entropy.py | saidineshpola/Knowledge-Distillation-Toolkit | b05ebc28ae1385c9caa1c4c1c93db2d67356e85f | [
"MIT"
] | 20 | 2021-03-27T10:30:32.000Z | 2022-03-17T17:13:41.000Z | # 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.
import math
from dataclasses import dataclass
import torch.nn.functional as F
from fairseq_mod import metrics, utils
from fairseq_mod.criteri... | 36.577778 | 82 | 0.646112 |
import math
from dataclasses import dataclass
import torch.nn.functional as F
from fairseq_mod import metrics, utils
from fairseq_mod.criterions import FairseqCriterion, register_criterion
from fairseq_mod.dataclass import FairseqDataclass
from omegaconf import II
@dataclass
class CrossEntropyCriterionConfig(Fa... | true | true |
f744496f32b4f3a25f3cffb415cdc2b68c943f9c | 2,364 | py | Python | scripts/create_ai_profiles.py | desophos/gorgonwikibot | 5196bd8966ca304668bd26026ee92a8161b1c873 | [
"MIT"
] | 1 | 2021-02-24T05:35:38.000Z | 2021-02-24T05:35:38.000Z | scripts/create_ai_profiles.py | desophos/gorgonwikibot | 5196bd8966ca304668bd26026ee92a8161b1c873 | [
"MIT"
] | null | null | null | scripts/create_ai_profiles.py | desophos/gorgonwikibot | 5196bd8966ca304668bd26026ee92a8161b1c873 | [
"MIT"
] | null | null | null | import sys
import pywikibot
from gorgonwikibot.content import (Ability, Ai, get_all_content,
get_content_by_iname)
from gorgonwikibot.entrypoint import entrypoint
def get_abilities(validator=lambda _: True, include=[]):
return {
a.iname: {
"Description": a.d... | 30.701299 | 71 | 0.568951 | import sys
import pywikibot
from gorgonwikibot.content import (Ability, Ai, get_all_content,
get_content_by_iname)
from gorgonwikibot.entrypoint import entrypoint
def get_abilities(validator=lambda _: True, include=[]):
return {
a.iname: {
"Description": a.d... | true | true |
f7444996ccd1243a9ee9d344ccc0a3b0df89fb91 | 1,428 | py | Python | project/apps/core/tests/conftest.py | barberscore/archive-api | 206dff719ba6f868dda0da64cc217b1ed8208d26 | [
"BSD-2-Clause"
] | null | null | null | project/apps/core/tests/conftest.py | barberscore/archive-api | 206dff719ba6f868dda0da64cc217b1ed8208d26 | [
"BSD-2-Clause"
] | 18 | 2020-06-05T23:18:53.000Z | 2022-01-14T20:36:08.000Z | project/apps/core/tests/conftest.py | barberscore/archive-api | 206dff719ba6f868dda0da64cc217b1ed8208d26 | [
"BSD-2-Clause"
] | null | null | null |
# Third-Party
import pytest
from rest_framework.test import APIClient
# from rest_framework.test import RequestsClient
# Django
from django.test.client import Client
# First-Party
from .factories import AwardFactory
from .factories import ChartFactory
from .factories import ConventionFactory
from .factories import ... | 16.227273 | 48 | 0.714286 |
import pytest
from rest_framework.test import APIClient
from django.test.client import Client
from .factories import AwardFactory
from .factories import ChartFactory
from .factories import ConventionFactory
from .factories import GroupFactory
from .factories import PersonFactory
from .factories import UserFacto... | true | true |
f74449e948464d6fe130d1738d722d5d282f776c | 9,235 | py | Python | deprecated/converters/gdb8_15_converter.py | materials-data-facility/connect | 9ec5b61750bf6fa579bf3ec122f31880d3c049b8 | [
"Apache-2.0"
] | 1 | 2019-09-13T18:35:56.000Z | 2019-09-13T18:35:56.000Z | deprecated/converters/gdb8_15_converter.py | materials-data-facility/connect_server | 9ec5b61750bf6fa579bf3ec122f31880d3c049b8 | [
"Apache-2.0"
] | 15 | 2018-11-01T18:08:11.000Z | 2021-12-06T17:55:03.000Z | deprecated/converters/gdb8_15_converter.py | materials-data-facility/connect | 9ec5b61750bf6fa579bf3ec122f31880d3c049b8 | [
"Apache-2.0"
] | 1 | 2020-11-30T17:02:41.000Z | 2020-11-30T17:02:41.000Z | import json
import sys
import os
from tqdm import tqdm
from mdf_refinery.parsers.tab_parser import parse_tab
from mdf_refinery.validator import Validator
# VERSION 0.3.0
# This is the gdb8-15 dataset: Electronic Spectra from TDDFT and Machine Learning in Chemical Space
"""If feedstock path gets changed in an mdf vers... | 41.412556 | 660 | 0.527017 | import json
import sys
import os
from tqdm import tqdm
from mdf_refinery.parsers.tab_parser import parse_tab
from mdf_refinery.validator import Validator
def convert(input_path, metadata=None, verbose=False):
if verbose:
print("Begin converting")
if not metadata:
dataset_metadata... | true | true |
f7444aec6a68bd48d1ee193ccf5374fcff780151 | 189 | py | Python | RootObjectUD.py | MangoDeveloper/panda3d-networking-test | ff9a0c0406bc8238b8646a1a137033ee85323336 | [
"MIT"
] | 1 | 2021-04-25T21:23:31.000Z | 2021-04-25T21:23:31.000Z | RootObjectUD.py | MangoDeveloper/panda3d-networking-test | ff9a0c0406bc8238b8646a1a137033ee85323336 | [
"MIT"
] | null | null | null | RootObjectUD.py | MangoDeveloper/panda3d-networking-test | ff9a0c0406bc8238b8646a1a137033ee85323336 | [
"MIT"
] | 1 | 2017-06-07T10:48:16.000Z | 2017-06-07T10:48:16.000Z | from direct.distributed.DistributedObjectUD import DistributedObjectUD
class RootObjectUD(DistributedObjectUD):
def __init__(self, air):
DistributedObjectUD.__init__(self, air) | 37.8 | 70 | 0.809524 | from direct.distributed.DistributedObjectUD import DistributedObjectUD
class RootObjectUD(DistributedObjectUD):
def __init__(self, air):
DistributedObjectUD.__init__(self, air) | true | true |
f7444b346f76ba12029be901ebd265e137f6e885 | 663 | py | Python | setup.py | dstdnk/SIMple-PHOto-LIBrary | 854fb8ae0254d7a0aa515b4a9db817f3b34eb38d | [
"MIT"
] | 1 | 2021-04-07T16:11:27.000Z | 2021-04-07T16:11:27.000Z | setup.py | dstdnk/SIMple-PHOto-LIBrary | 854fb8ae0254d7a0aa515b4a9db817f3b34eb38d | [
"MIT"
] | null | null | null | setup.py | dstdnk/SIMple-PHOto-LIBrary | 854fb8ae0254d7a0aa515b4a9db817f3b34eb38d | [
"MIT"
] | 1 | 2015-06-01T06:18:11.000Z | 2015-06-01T06:18:11.000Z | from setuptools import setup
setup(name='simpholib',
version='1.0b1',
description='Simple Photo Library',
long_description='Tool for ordering unsorted photos and arrange them in a directories by dates.',
url='https://github.com/dstdnk/simple-photo-library',
download_url='https://github.co... | 36.833333 | 103 | 0.669683 | from setuptools import setup
setup(name='simpholib',
version='1.0b1',
description='Simple Photo Library',
long_description='Tool for ordering unsorted photos and arrange them in a directories by dates.',
url='https://github.com/dstdnk/simple-photo-library',
download_url='https://github.co... | true | true |
f7444cad8565f0b87b3328a72db8464d36f68c7d | 765 | py | Python | conanfile.py | PaladinAI/aws-sdk-cpp | 8f1ace035adf6117f59b535a81de72756e6203e8 | [
"Apache-2.0"
] | null | null | null | conanfile.py | PaladinAI/aws-sdk-cpp | 8f1ace035adf6117f59b535a81de72756e6203e8 | [
"Apache-2.0"
] | null | null | null | conanfile.py | PaladinAI/aws-sdk-cpp | 8f1ace035adf6117f59b535a81de72756e6203e8 | [
"Apache-2.0"
] | null | null | null | from conans import ConanFile, CMake
class AwsConan(ConanFile):
name = "aws-sdk-cpp"
version = "1.3.21"
license = "Apache License 2.0"
description = "AWS SDK for C++"
url = "https://github.com/aws/aws-sdk-cpp"
settings = "arch", "build_type", "compiler", "os"
generators = "cmake"
def p... | 36.428571 | 92 | 0.606536 | from conans import ConanFile, CMake
class AwsConan(ConanFile):
name = "aws-sdk-cpp"
version = "1.3.21"
license = "Apache License 2.0"
description = "AWS SDK for C++"
url = "https://github.com/aws/aws-sdk-cpp"
settings = "arch", "build_type", "compiler", "os"
generators = "cmake"
def p... | true | true |
f7444d70f05804ca94685965bf9fc47a4297e63b | 339 | py | Python | yatube/posts/migrations/0004_auto_20211126_1224.py | JaSlava/yatube_project | eaa7db7af4630030f1d31c8d6b7b7ac851d30259 | [
"MIT"
] | null | null | null | yatube/posts/migrations/0004_auto_20211126_1224.py | JaSlava/yatube_project | eaa7db7af4630030f1d31c8d6b7b7ac851d30259 | [
"MIT"
] | null | null | null | yatube/posts/migrations/0004_auto_20211126_1224.py | JaSlava/yatube_project | eaa7db7af4630030f1d31c8d6b7b7ac851d30259 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.19 on 2021-11-26 12:24
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('posts', '0003_post_group'),
]
operations = [
migrations.AlterModelOptions(
name='post',
options={'ordering': ['-pub_date']}... | 18.833333 | 48 | 0.578171 |
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('posts', '0003_post_group'),
]
operations = [
migrations.AlterModelOptions(
name='post',
options={'ordering': ['-pub_date']},
),
]
| true | true |
f7444d760cea1e24921be97e7fa429c4327af8d6 | 2,570 | py | Python | maml_rl/sampler.py | henryzxu/pytorch-hsml-rl | 3b36f29cf91f3ca68820ea124a2ee7a75327b94f | [
"MIT"
] | null | null | null | maml_rl/sampler.py | henryzxu/pytorch-hsml-rl | 3b36f29cf91f3ca68820ea124a2ee7a75327b94f | [
"MIT"
] | null | null | null | maml_rl/sampler.py | henryzxu/pytorch-hsml-rl | 3b36f29cf91f3ca68820ea124a2ee7a75327b94f | [
"MIT"
] | null | null | null | import gym
import torch
import multiprocessing as mp
import numpy as np
from maml_rl.envs.subproc_vec_env import SubprocVecEnv
from maml_rl.episode import BatchEpisodes
def make_env(env_name):
def _make_env():
return gym.make(env_name)
return _make_env
class BatchSampler(object):
def __init__(sel... | 41.451613 | 135 | 0.633074 | import gym
import torch
import multiprocessing as mp
import numpy as np
from maml_rl.envs.subproc_vec_env import SubprocVecEnv
from maml_rl.episode import BatchEpisodes
def make_env(env_name):
def _make_env():
return gym.make(env_name)
return _make_env
class BatchSampler(object):
def __init__(sel... | true | true |
f7444da9d492a6acb8a22dacd80eb39f4257b11b | 22,884 | py | Python | theano/sandbox/gpuarray/type.py | moslemk/Theano | 8d3a67b73fda49350d9944c9a24fc9660131861c | [
"BSD-3-Clause"
] | null | null | null | theano/sandbox/gpuarray/type.py | moslemk/Theano | 8d3a67b73fda49350d9944c9a24fc9660131861c | [
"BSD-3-Clause"
] | null | null | null | theano/sandbox/gpuarray/type.py | moslemk/Theano | 8d3a67b73fda49350d9944c9a24fc9660131861c | [
"BSD-3-Clause"
] | null | null | null | import numpy
import theano
from theano.tensor.var import _tensor_py_operators
from theano import Type, Variable, Constant, tensor, config, scalar
from theano.compile import SharedVariable
# Make sure this is importable even if pygpu is absent
# (it will not work though)
try:
import pygpu
from pygpu import gpu... | 35.47907 | 85 | 0.565592 | import numpy
import theano
from theano.tensor.var import _tensor_py_operators
from theano import Type, Variable, Constant, tensor, config, scalar
from theano.compile import SharedVariable
try:
import pygpu
from pygpu import gpuarray
from pygpu.elemwise import compare, elemwise2
except ImportError:
p... | true | true |
f7444eead711d689ec8a0c51b3bcc7ca6a4d5915 | 1,889 | py | Python | cosmos/torch_model/inference/data_layer/inference_loader.py | hadarohana/myCosmos | 6e4682a2af822eb828180658aaa6d3e304cc85bf | [
"Apache-2.0"
] | null | null | null | cosmos/torch_model/inference/data_layer/inference_loader.py | hadarohana/myCosmos | 6e4682a2af822eb828180658aaa6d3e304cc85bf | [
"Apache-2.0"
] | 5 | 2020-01-28T23:13:10.000Z | 2022-02-10T00:28:15.000Z | cosmos/torch_model/inference/data_layer/inference_loader.py | hadarohana/myCosmos | 6e4682a2af822eb828180658aaa6d3e304cc85bf | [
"Apache-2.0"
] | 1 | 2021-03-10T19:25:44.000Z | 2021-03-10T19:25:44.000Z | """
Utilities for loading inference data into the model
"""
# TODO refactor so xml_loader and inference_loader import from a utilities directory
from ingestion.ingest_images import load_image, load_proposal, get_example_for_uuid
from torch.utils.data import Dataset
import torch
import os
from os.path import splitext
fr... | 32.568966 | 117 | 0.679195 |
from ingestion.ingest_images import load_image, load_proposal, get_example_for_uuid
from torch.utils.data import Dataset
import torch
import os
from os.path import splitext
from torch_model.train.data_layer.xml_loader import XMLLoader
from torchvision.transforms import ToTensor
from torch_model.train.data_layer.transf... | true | true |
f7444f7ed3d4544cdf7248264f67e7a6b92c6abf | 10,697 | py | Python | dql_grasping/kuka.py | yick2232/google-research | 99021ebda945e232abdcc592f2cea1375b3c84f7 | [
"Apache-2.0"
] | 11 | 2020-01-29T07:25:04.000Z | 2022-03-05T16:01:21.000Z | dql_grasping/kuka.py | RubensZimbres/google-research | 562c7c6ef959cb3cb382b1b660ccc45e8f5289c4 | [
"Apache-2.0"
] | 11 | 2019-12-16T20:51:44.000Z | 2022-02-10T01:53:56.000Z | dql_grasping/kuka.py | RubensZimbres/google-research | 562c7c6ef959cb3cb382b1b660ccc45e8f5289c4 | [
"Apache-2.0"
] | 2 | 2020-02-27T11:09:49.000Z | 2021-08-25T07:32:15.000Z | # coding=utf-8
# Copyright 2019 The Google Research 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 applicab... | 38.617329 | 81 | 0.644293 |
import pybullet
from absl import logging
import numpy as np
import os
import copy
import math
class Kuka:
def __init__(self, urdfRootPath='', timeStep=0.01, clientId=0, ikFix=False,
returnPos=True):
self.cid = clientId
self.urdfRootPath = urdfRootPath
self.timeStep = ti... | true | true |
f744503ab8e5af66a2f54d9790a00e2fafbaee64 | 15,399 | py | Python | pyro/distributions/transforms/affine_coupling.py | futurewarning/pyro | 005032f10099188fea86f63b6baa46a27867983f | [
"Apache-2.0"
] | null | null | null | pyro/distributions/transforms/affine_coupling.py | futurewarning/pyro | 005032f10099188fea86f63b6baa46a27867983f | [
"Apache-2.0"
] | null | null | null | pyro/distributions/transforms/affine_coupling.py | futurewarning/pyro | 005032f10099188fea86f63b6baa46a27867983f | [
"Apache-2.0"
] | 1 | 2021-04-11T21:37:25.000Z | 2021-04-11T21:37:25.000Z | # Copyright (c) 2017-2019 Uber Technologies, Inc.
# SPDX-License-Identifier: Apache-2.0
import operator
from functools import partial, reduce
import torch
from torch.distributions.utils import _sum_rightmost
from pyro.nn import ConditionalDenseNN, DenseNN
from .. import constraints
from ..conditional import Conditi... | 43.377465 | 119 | 0.688551 |
import operator
from functools import partial, reduce
import torch
from torch.distributions.utils import _sum_rightmost
from pyro.nn import ConditionalDenseNN, DenseNN
from .. import constraints
from ..conditional import ConditionalTransformModule
from ..torch_transform import TransformModule
from ..transforms.ut... | true | true |
f74450a20ec49c3918fc354a9ef26d252c7a66f8 | 329 | py | Python | main.py | amyxie361/neural-question-generation | ce27d2fc107ed412b23e173607cd428a051c82f7 | [
"MIT"
] | null | null | null | main.py | amyxie361/neural-question-generation | ce27d2fc107ed412b23e173607cd428a051c82f7 | [
"MIT"
] | null | null | null | main.py | amyxie361/neural-question-generation | ce27d2fc107ed412b23e173607cd428a051c82f7 | [
"MIT"
] | null | null | null | from trainer import Trainer
from infenrence import BeamSearcher
import config
def main():
if config.train:
trainer = Trainer()
trainer.train()
if config.test:
beamsearcher = BeamSearcher(config.model_path, config.output_dir)
beamsearcher.decode()
if __name__ == "__main__":
... | 19.352941 | 73 | 0.674772 | from trainer import Trainer
from infenrence import BeamSearcher
import config
def main():
if config.train:
trainer = Trainer()
trainer.train()
if config.test:
beamsearcher = BeamSearcher(config.model_path, config.output_dir)
beamsearcher.decode()
if __name__ == "__main__":
... | true | true |
f74451751805bace06484342526dd58e1fdcc09d | 7,045 | py | Python | train.py | BXuan694/SOLO-pytorch | aef0ac47ce6989f6633fe4f71070bd6944c39abb | [
"Apache-2.0"
] | 2 | 2022-03-19T12:58:58.000Z | 2022-03-19T15:01:02.000Z | train.py | BXuan694/SOLO-pytorch | aef0ac47ce6989f6633fe4f71070bd6944c39abb | [
"Apache-2.0"
] | 1 | 2022-03-19T15:06:25.000Z | 2022-03-23T01:48:58.000Z | train.py | BXuan694/SOLO-pytorch | aef0ac47ce6989f6633fe4f71070bd6944c39abb | [
"Apache-2.0"
] | null | null | null | from data.config import cfg, process_funcs_dict
from data.coco import CocoDataset
from data.loader import build_dataloader
#from modules.solov1 import SOLOV1 as solo
# from modules.solov2 import SOLOV2 as solo
from modules.solov1d import SOLOV1 as solo
import time
import torch
import numpy as np
# 梯度均衡
def clip_grads(... | 37.673797 | 198 | 0.60582 | from data.config import cfg, process_funcs_dict
from data.coco import CocoDataset
from data.loader import build_dataloader
from modules.solov1d import SOLOV1 as solo
import time
import torch
import numpy as np
def clip_grads(params_):
params_ = list(filter(lambda p: p.requires_grad and p.grad is not None, param... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.