hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
08fd6875a98fcc3719700ec0a78c80fdcc1898e0 | 37,373 | py | Python | tests/hwsim/wpasupplicant.py | tizenorg/platform.upstream.wpa_supplicant | 1efa1fc6a78653c6767714de8fd6253890622e30 | [
"BSD-3-Clause"
] | null | null | null | tests/hwsim/wpasupplicant.py | tizenorg/platform.upstream.wpa_supplicant | 1efa1fc6a78653c6767714de8fd6253890622e30 | [
"BSD-3-Clause"
] | null | null | null | tests/hwsim/wpasupplicant.py | tizenorg/platform.upstream.wpa_supplicant | 1efa1fc6a78653c6767714de8fd6253890622e30 | [
"BSD-3-Clause"
] | null | null | null | # Python class for controlling wpa_supplicant
# Copyright (c) 2013-2014, Jouni Malinen <j@w1.fi>
#
# This software may be distributed under the terms of the BSD license.
# See README for more details.
import os
import time
import logging
import binascii
import re
import struct
import subprocess
import wpaspy
logger =... | 36.17909 | 196 | 0.533621 |
import os
import time
import logging
import binascii
import re
import struct
import subprocess
import wpaspy
logger = logging.getLogger()
wpas_ctrl = '/var/run/wpa_supplicant'
class WpaSupplicant:
def __init__(self, ifname=None, global_iface=None):
self.group_ifname = None
self.gctrl_mon = None
... | false | true |
08fd6965f122c319cfcd58a622c7fc6e60dbd79e | 42,522 | py | Python | Lib/test/test_smtpd.py | Krrishdhaneja/cpython | 9ae9ad8ba35cdcece7ded73cd2207e4f8cb85578 | [
"0BSD"
] | 1 | 2020-10-25T16:33:22.000Z | 2020-10-25T16:33:22.000Z | Lib/test/test_smtpd.py | Krrishdhaneja/cpython | 9ae9ad8ba35cdcece7ded73cd2207e4f8cb85578 | [
"0BSD"
] | null | null | null | Lib/test/test_smtpd.py | Krrishdhaneja/cpython | 9ae9ad8ba35cdcece7ded73cd2207e4f8cb85578 | [
"0BSD"
] | null | null | null | import unittest
import textwrap
from test import support, mock_socket
from test.support import socket_helper
from test.support import warnings_helper
import socket
import io
import smtpd
import asyncore
class DummyServer(smtpd.SMTPServer):
def __init__(self, *args, **kwargs):
smtpd.SMTPServer... | 41.893596 | 88 | 0.605334 | import unittest
import textwrap
from test import support, mock_socket
from test.support import socket_helper
from test.support import warnings_helper
import socket
import io
import smtpd
import asyncore
class DummyServer(smtpd.SMTPServer):
def __init__(self, *args, **kwargs):
smtpd.SMTPServer... | true | true |
08fd6a3ec163c69cb339fb2984de68c11d51ee56 | 7,096 | py | Python | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/decent_q/python/graphsurgeon/node_manipulation.py | hito0512/Vitis-AI | 996459fb96cb077ed2f7e789d515893b1cccbc95 | [
"Apache-2.0"
] | 1 | 2022-02-17T22:13:23.000Z | 2022-02-17T22:13:23.000Z | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/decent_q/python/graphsurgeon/node_manipulation.py | hito0512/Vitis-AI | 996459fb96cb077ed2f7e789d515893b1cccbc95 | [
"Apache-2.0"
] | null | null | null | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/decent_q/python/graphsurgeon/node_manipulation.py | hito0512/Vitis-AI | 996459fb96cb077ed2f7e789d515893b1cccbc95 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Xilinx 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 writing, ... | 46.379085 | 345 | 0.668264 |
from tensorflow.python.framework import dtypes
from tensorflow.core.framework import node_def_pb2
from tensorflow.python.framework import tensor_shape
import numpy as np
try:
basestring
except NameError:
basestring = str
def shape(node):
return tuple(int(dim.size) for dim in node.attr["shape"].shape.dim)
... | true | true |
08fd6ad2e291f200a9b47ee43767ec559979a156 | 3,631 | py | Python | pawncc/builder.py | udan11/samp-anticheat | 1d5b99f588ef8447f3dbdf64165d043d3832acea | [
"BSD-2-Clause"
] | 7 | 2016-12-19T21:13:00.000Z | 2021-09-19T05:12:07.000Z | pawncc/builder.py | udan11/samp-anticheat | 1d5b99f588ef8447f3dbdf64165d043d3832acea | [
"BSD-2-Clause"
] | null | null | null | pawncc/builder.py | udan11/samp-anticheat | 1d5b99f588ef8447f3dbdf64165d043d3832acea | [
"BSD-2-Clause"
] | 4 | 2016-04-20T22:11:01.000Z | 2022-01-07T20:56:22.000Z | #!/usr/bin/env python
#
# Copyright (c) 2013, Dan
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of c... | 34.913462 | 81 | 0.724043 |
import os
import sys
import time
start = time.clock()
def is_wc_match(string, pattern):
string += '\1'
pattern += '\1'
last_idx = -1
for i in pattern.split('*'):
if (len(i) > 0):
last_idx = string.find(i, last_idx + 1)
if (last_idx == -1):
return 0
return 1
def join_path(a, b):
return os.pat... | true | true |
08fd6af439f1c5ee57210b136c465916575c1d9f | 6,734 | py | Python | cap2/extensions/experimental/covid/cli.py | nanusefue/CAP2-1 | 670b343ac7629fe0e64e86263ae420b01952f427 | [
"MIT"
] | 9 | 2020-07-10T15:45:12.000Z | 2022-01-19T10:44:13.000Z | cap2/extensions/experimental/covid/cli.py | nanusefue/CAP2-1 | 670b343ac7629fe0e64e86263ae420b01952f427 | [
"MIT"
] | 14 | 2020-06-15T16:04:54.000Z | 2022-03-12T01:05:47.000Z | cap2/extensions/experimental/covid/cli.py | nanusefue/CAP2-1 | 670b343ac7629fe0e64e86263ae420b01952f427 | [
"MIT"
] | 5 | 2021-01-05T01:26:48.000Z | 2022-01-23T11:20:49.000Z |
import click
import luigi
import time
import logging
from .fast_detect import Kraken2FastDetectCovid
from .align_to_covid_genome import AlignReadsToCovidGenome
from .genome_coverage import CovidGenomeCoverage
from .make_pileup import MakeCovidPileup
from .make_covid_consensus_seq import MakeCovidConsensusSeq
from .ca... | 38.045198 | 132 | 0.689486 |
import click
import luigi
import time
import logging
from .fast_detect import Kraken2FastDetectCovid
from .align_to_covid_genome import AlignReadsToCovidGenome
from .genome_coverage import CovidGenomeCoverage
from .make_pileup import MakeCovidPileup
from .make_covid_consensus_seq import MakeCovidConsensusSeq
from .ca... | true | true |
08fd6c75bcab87e071d8d6cd4e5ab57c5f913c80 | 48 | py | Python | flightsystem/__init__.py | mossyegghead01/PTFS-Flight-System | 32936191344c6f04bf94a7681d2bd7b10b9c32b0 | [
"MIT"
] | null | null | null | flightsystem/__init__.py | mossyegghead01/PTFS-Flight-System | 32936191344c6f04bf94a7681d2bd7b10b9c32b0 | [
"MIT"
] | null | null | null | flightsystem/__init__.py | mossyegghead01/PTFS-Flight-System | 32936191344c6f04bf94a7681d2bd7b10b9c32b0 | [
"MIT"
] | null | null | null | __version__="1.0.0"
__name__="BA Flight System"
| 16 | 27 | 0.75 | __version__="1.0.0"
__name__="BA Flight System"
| true | true |
08fd6cf6fb9314b063eea08f30f7e9b50a374459 | 2,980 | py | Python | scripts/watchlist.py | sauravsrijan/pywikibot | 3d42e7c4de7ee96cda7d6dd9f95fe7c6d3c37484 | [
"MIT"
] | null | null | null | scripts/watchlist.py | sauravsrijan/pywikibot | 3d42e7c4de7ee96cda7d6dd9f95fe7c6d3c37484 | [
"MIT"
] | null | null | null | scripts/watchlist.py | sauravsrijan/pywikibot | 3d42e7c4de7ee96cda7d6dd9f95fe7c6d3c37484 | [
"MIT"
] | 1 | 2020-04-14T14:52:24.000Z | 2020-04-14T14:52:24.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Allows access to the bot account's watchlist.
The watchlist can be updated manually by running this script.
Syntax:
python pwb.py watchlist [-all | -new]
Command line options:
-all Reloads watchlists for all wikis where a watchlist is already
p... | 26.371681 | 79 | 0.64396 | from __future__ import absolute_import, division, unicode_literals
import os
import pywikibot
from pywikibot import config
from pywikibot.data.api import CachedRequest
from scripts.maintenance.cache import CacheEntry
def get(site=None):
if site is None:
site = pywikibot.Site()
watchlist = [p.title()... | true | true |
08fd6dafd0baabb8f93b887c7d5dda14264faa75 | 110,043 | py | Python | WS2012R2/lisa/tools/middleware_bench/report/results_parser.py | lubaihua33/lis-test | bb96420521ca2613781603166f84407bccb99e81 | [
"Apache-2.0"
] | null | null | null | WS2012R2/lisa/tools/middleware_bench/report/results_parser.py | lubaihua33/lis-test | bb96420521ca2613781603166f84407bccb99e81 | [
"Apache-2.0"
] | null | null | null | WS2012R2/lisa/tools/middleware_bench/report/results_parser.py | lubaihua33/lis-test | bb96420521ca2613781603166f84407bccb99e81 | [
"Apache-2.0"
] | 1 | 2020-06-24T02:50:51.000Z | 2020-06-24T02:50:51.000Z | """
Linux on Hyper-V and Azure Test Code, ver. 1.0.0
Copyright (c) Microsoft 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 copy of the License at
http://www.apache.org/licenses/LICEN... | 49.170241 | 152 | 0.540616 | from __future__ import print_function
import logging
import re
import os
import time
import zipfile
import shutil
import csv
import decimal
from datetime import datetime
logging.basicConfig(format='%(asctime)s %(levelname)s: %(message)s',
datefmt='%y/%m/%d %H:%M:%S', level=logging.INFO)
log = logg... | true | true |
08fd6e5a8da7e9ac0a17597d3b4b1129f6e18c88 | 61,319 | py | Python | tests/test_indicators.py | jhonore/jesse | 5b54e7abd20e3d5d5461dc0714e00bd64da468ac | [
"MIT"
] | null | null | null | tests/test_indicators.py | jhonore/jesse | 5b54e7abd20e3d5d5461dc0714e00bd64da468ac | [
"MIT"
] | null | null | null | tests/test_indicators.py | jhonore/jesse | 5b54e7abd20e3d5d5461dc0714e00bd64da468ac | [
"MIT"
] | null | null | null | import numpy as np
import jesse.indicators as ta
from jesse.factories import fake_range_candle_from_range_prices
from .data.test_candles_indicators import *
def test_acosc():
candles = np.array(test_candles_19)
single = ta.acosc(candles)
seq = ta.acosc(candles, sequential=True)
assert type(single)._... | 26.882508 | 120 | 0.651821 | import numpy as np
import jesse.indicators as ta
from jesse.factories import fake_range_candle_from_range_prices
from .data.test_candles_indicators import *
def test_acosc():
candles = np.array(test_candles_19)
single = ta.acosc(candles)
seq = ta.acosc(candles, sequential=True)
assert type(single)._... | true | true |
08fd6f055a3449459172371688abd33b6c44a0a2 | 1,050 | py | Python | pythran/tests/rosetta/prime_decomposition.py | artas360/pythran | 66dad52d52be71693043e9a7d7578cfb9cb3d1da | [
"BSD-3-Clause"
] | null | null | null | pythran/tests/rosetta/prime_decomposition.py | artas360/pythran | 66dad52d52be71693043e9a7d7578cfb9cb3d1da | [
"BSD-3-Clause"
] | null | null | null | pythran/tests/rosetta/prime_decomposition.py | artas360/pythran | 66dad52d52be71693043e9a7d7578cfb9cb3d1da | [
"BSD-3-Clause"
] | 1 | 2017-03-12T20:32:36.000Z | 2017-03-12T20:32:36.000Z | #from http://rosettacode.org/wiki/Prime_decomposition#Python
#pythran export fac(int)
#runas fac(2**59 - 1)
#pythran export test_decompose(int)
#runas test_decompose(2**59 - 1)
import math
def decompose(n):
primelist = [2, 3]
for p in primes(primelist):
if p*p > n: break
while n % p == 0:
... | 21.875 | 60 | 0.504762 | import math
def decompose(n):
primelist = [2, 3]
for p in primes(primelist):
if p*p > n: break
while n % p == 0:
yield p
n /=p
if n > 1:
yield n
def test_decompose(to):
return [i for i in decompose(to)]
def primes(primelist):
for n in primelist: yie... | true | true |
08fd6f49998769bfe456650e7420592643f7be55 | 4,277 | py | Python | stancode_projects/add2.py | she12306/stancode_prjects | 374cca15e5aead0864d30206fbf84b5a79b8d19b | [
"MIT"
] | null | null | null | stancode_projects/add2.py | she12306/stancode_prjects | 374cca15e5aead0864d30206fbf84b5a79b8d19b | [
"MIT"
] | null | null | null | stancode_projects/add2.py | she12306/stancode_prjects | 374cca15e5aead0864d30206fbf84b5a79b8d19b | [
"MIT"
] | null | null | null | """
File: add2.py
Name: Heather Ou
------------------------
No data structure.
"""
import sys
class ListNode:
def __init__(self, data=0, pointer=None):
self.val = data
self.next = pointer
def add_2_numbers(l1: ListNode, l2: ListNode) -> ListNode:
#######################
# Determine the ... | 29.294521 | 81 | 0.489362 |
import sys
class ListNode:
def __init__(self, data=0, pointer=None):
self.val = data
self.next = pointer
def add_2_numbers(l1: ListNode, l2: ListNode) -> ListNode:
l1_len = count_linked_list_len(l1)
l2_len = count_linked_list_len(l2)
ans_len = max(l1_len, l2_len)
an... | true | true |
08fd6ff69dd3d52534f18830cba4efedfc5a1a36 | 13,118 | py | Python | tests/test_account.py | dnordio/saleor | 323963748e6a2702265ec6635b930a234abde4f5 | [
"BSD-3-Clause"
] | 1 | 2019-05-02T17:24:05.000Z | 2019-05-02T17:24:05.000Z | tests/test_account.py | valentine217/saleor | 323963748e6a2702265ec6635b930a234abde4f5 | [
"BSD-3-Clause"
] | null | null | null | tests/test_account.py | valentine217/saleor | 323963748e6a2702265ec6635b930a234abde4f5 | [
"BSD-3-Clause"
] | 1 | 2019-05-02T17:24:11.000Z | 2019-05-02T17:24:11.000Z | import os
import re
import uuid
from unittest.mock import patch
from urllib.parse import urlencode
import i18naddress
import pytest
from captcha import constants as recaptcha_constants
from captcha.client import RecaptchaResponse
from django.core.exceptions import ValidationError
from django.core.files import File
fro... | 33.722365 | 78 | 0.685852 | import os
import re
import uuid
from unittest.mock import patch
from urllib.parse import urlencode
import i18naddress
import pytest
from captcha import constants as recaptcha_constants
from captcha.client import RecaptchaResponse
from django.core.exceptions import ValidationError
from django.core.files import File
fro... | true | true |
08fd70a0c7a7b869b92a0fa4aa8359e44814fb21 | 990 | py | Python | actions/cluster_sdn_controllers_controller_delete.py | nzlosh/stackstorm-proxmox | fc4388f0b62dd1d4a360e9542eb55dea387149f4 | [
"Apache-2.0"
] | null | null | null | actions/cluster_sdn_controllers_controller_delete.py | nzlosh/stackstorm-proxmox | fc4388f0b62dd1d4a360e9542eb55dea387149f4 | [
"Apache-2.0"
] | null | null | null | actions/cluster_sdn_controllers_controller_delete.py | nzlosh/stackstorm-proxmox | fc4388f0b62dd1d4a360e9542eb55dea387149f4 | [
"Apache-2.0"
] | null | null | null | import json
from packlib.base import ProxmoxAction
class ClusterSdnControllersControllerDeleteAction(ProxmoxAction):
"""
Delete sdn controller object configuration.
"""
def run(self, controller, profile_name=None):
super().run(profile_name)
# Only include non None arguments to pass t... | 33 | 93 | 0.570707 | import json
from packlib.base import ProxmoxAction
class ClusterSdnControllersControllerDeleteAction(ProxmoxAction):
def run(self, controller, profile_name=None):
super().run(profile_name)
proxmox_kwargs = {}
for api_arg in [
["controller", controller, "string"],
... | true | true |
08fd7117dfa3710d9f2ab4348668f6915c6b3d9c | 12,742 | py | Python | demo/sprites.py | KyleHutchinson/demo | bcf639b8592f829d5ee2026bfdbee8a8dbc7ffc9 | [
"MIT"
] | null | null | null | demo/sprites.py | KyleHutchinson/demo | bcf639b8592f829d5ee2026bfdbee8a8dbc7ffc9 | [
"MIT"
] | null | null | null | demo/sprites.py | KyleHutchinson/demo | bcf639b8592f829d5ee2026bfdbee8a8dbc7ffc9 | [
"MIT"
] | null | null | null | # sprite classes for game
# i used some ideas from CodePylet https://www.youtube.com/watch?v=osDofIdja6s&t=1038s
# i also borrowed pretty much all of this from kids can code - thanks!
# on acceleration https://www.khanacademy.org/science/physics/one-dimensional-motion/kinematic-formulas/v/average-velocity-for-constant-... | 43.047297 | 149 | 0.598964 |
import pygame as pg
from pygame.sprite import Sprite
import random
from random import randint, randrange, choice
from settings import *
vec = pg.math.Vector2
class Spritesheet:
def __init__(self, filename):
self.spritesheet = pg.image.load(filename).convert()
def get_image(self, x, y, width, heig... | true | true |
08fd71216af281fc75b1574e09e0cc1d0fcc2051 | 732 | py | Python | gan/transGAN/metrics/__init__.py | no-name-xiaosheng/PaddleViT | 50226a3be5095b3727d3c62d2eab23ef1e9612ec | [
"Apache-2.0"
] | 993 | 2021-08-30T01:58:57.000Z | 2022-03-31T14:03:07.000Z | gan/transGAN/metrics/__init__.py | Dongsheng-Bi/PaddleViT | c90a6c8dc3787e69cef3a37b9a260bd59eeff1f7 | [
"Apache-2.0"
] | 120 | 2021-09-03T13:05:32.000Z | 2022-03-29T02:08:22.000Z | gan/transGAN/metrics/__init__.py | Dongsheng-Bi/PaddleViT | c90a6c8dc3787e69cef3a37b9a260bd59eeff1f7 | [
"Apache-2.0"
] | 253 | 2021-08-30T08:50:27.000Z | 2022-03-26T09:21:08.000Z | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve.
#
# 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 appl... | 38.526316 | 74 | 0.769126 |
from .psnr_ssim import PSNR, SSIM
from .fid import FID
from .builder import build_metric
from .Registry import Registry
| true | true |
08fd7154e0e9283c6c072eb114ea21da3e41fac3 | 1,911 | py | Python | docsim/elas/models.py | tarohi24/docsim | 4879bcc889c32470a27094eb183c2ce15ae2f1fb | [
"MIT"
] | 1 | 2020-04-29T13:52:29.000Z | 2020-04-29T13:52:29.000Z | docsim/elas/models.py | tarohi24/docsim | 4879bcc889c32470a27094eb183c2ce15ae2f1fb | [
"MIT"
] | 136 | 2019-09-19T03:36:21.000Z | 2019-11-28T08:50:45.000Z | docsim/elas/models.py | tarohi24/docsim | 4879bcc889c32470a27094eb183c2ce15ae2f1fb | [
"MIT"
] | null | null | null | from dataclasses import dataclass
from typing import Any, Dict, List
import numpy as np
class Field:
@classmethod
def mapping(cls) -> Dict:
raise NotImplementedError('This is an abstract class.')
def to_elas_value(self) -> Any:
raise NotImplementedError('This is an abstract class.')
... | 18.375 | 63 | 0.588174 | from dataclasses import dataclass
from typing import Any, Dict, List
import numpy as np
class Field:
@classmethod
def mapping(cls) -> Dict:
raise NotImplementedError('This is an abstract class.')
def to_elas_value(self) -> Any:
raise NotImplementedError('This is an abstract class.')
... | true | true |
08fd7176433c9ca6f5ade81cc10b89f513feda60 | 2,387 | py | Python | util/util.py | AnimatedRNG/nerf-jax | c940bcfbb986623691aff7a4e28bf8273ea70147 | [
"Apache-2.0"
] | 5 | 2020-10-22T07:27:15.000Z | 2022-02-25T02:54:39.000Z | util/util.py | AnimatedRNG/nerf-jax | c940bcfbb986623691aff7a4e28bf8273ea70147 | [
"Apache-2.0"
] | 11 | 2021-01-27T01:52:38.000Z | 2021-02-03T06:35:34.000Z | util/util.py | AnimatedRNG/nerf-jax | c940bcfbb986623691aff7a4e28bf8273ea70147 | [
"Apache-2.0"
] | 2 | 2020-12-15T14:44:07.000Z | 2021-01-27T03:39:01.000Z | import functools
import numpy as np
import jax
import jax.numpy as jnp
from jax import jit, vmap
from jax.ops import index, index_update
def get_ray_bundle(height, width, focal_length, tfrom_cam2world):
ii, jj = jnp.meshgrid(
jnp.arange(width, dtype=jnp.float32,),
jnp.arange(height, dtype=jnp.floa... | 32.256757 | 86 | 0.601592 | import functools
import numpy as np
import jax
import jax.numpy as jnp
from jax import jit, vmap
from jax.ops import index, index_update
def get_ray_bundle(height, width, focal_length, tfrom_cam2world):
ii, jj = jnp.meshgrid(
jnp.arange(width, dtype=jnp.float32,),
jnp.arange(height, dtype=jnp.floa... | true | true |
08fd7206bf943a59c7af551a4d10a275d45f3e06 | 7,598 | py | Python | indico/modules/events/registration/fields/base.py | sms77io/indico | 1579ea16235bbe5f22a308b79c5902c85374721f | [
"MIT"
] | 1 | 2021-06-11T20:02:10.000Z | 2021-06-11T20:02:10.000Z | indico/modules/events/registration/fields/base.py | sms77io/indico | 1579ea16235bbe5f22a308b79c5902c85374721f | [
"MIT"
] | null | null | null | indico/modules/events/registration/fields/base.py | sms77io/indico | 1579ea16235bbe5f22a308b79c5902c85374721f | [
"MIT"
] | null | null | null | # This file is part of Indico.
# Copyright (C) 2002 - 2022 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from copy import deepcopy
from marshmallow import fields, pre_load, validate
from wtforms.validators impo... | 37.428571 | 120 | 0.687155 |
from copy import deepcopy
from marshmallow import fields, pre_load, validate
from wtforms.validators import DataRequired, Optional
from indico.core.marshmallow import mm
from indico.modules.events.registration.models.registrations import RegistrationData
class BillableFieldDataSchema(mm.Schema):
price = fields... | true | true |
08fd723cbe26b33c67c96a6290990d96dc8efe4a | 3,526 | py | Python | bindings/python/ensmallen/datasets/string/halolactibacillusalkaliphilus.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 5 | 2021-02-17T00:44:45.000Z | 2021-08-09T16:41:47.000Z | bindings/python/ensmallen/datasets/string/halolactibacillusalkaliphilus.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 18 | 2021-01-07T16:47:39.000Z | 2021-08-12T21:51:32.000Z | bindings/python/ensmallen/datasets/string/halolactibacillusalkaliphilus.py | AnacletoLAB/ensmallen | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 3 | 2021-01-14T02:20:59.000Z | 2021-08-04T19:09:52.000Z | """
This file offers the methods to automatically retrieve the graph Halolactibacillus alkaliphilus.
The graph is automatically retrieved from the STRING repository.
References
---------------------
Please cite the following if you use the data:
```bib
@article{szklarczyk2019string,
title={STRING v11: protein-... | 33.580952 | 223 | 0.682643 | from typing import Dict
from ..automatic_graph_retrieval import AutomaticallyRetrievedGraph
from ...ensmallen import Graph
def HalolactibacillusAlkaliphilus(
directed: bool = False,
preprocess: bool = True,
load_nodes: bool = True,
verbose: int = 2,
cache: bool = True,
cache_path: str = "gra... | true | true |
08fd7392b8e96db18825493ebc269cf25e1f98d9 | 449 | py | Python | test/test1004.py | letolabs/fontforge | 719e5b5fab1384ce625306146daf5c709d625d30 | [
"BSD-3-Clause"
] | 2 | 2015-05-15T16:19:41.000Z | 2017-09-26T10:21:41.000Z | test/test1004.py | Distrotech/fontforge | dc5514f4d56ea523d0677cc77d0ad6ff822363f8 | [
"BSD-3-Clause"
] | null | null | null | test/test1004.py | Distrotech/fontforge | dc5514f4d56ea523d0677cc77d0ad6ff822363f8 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/local/bin/fontforge
#Needs: fonts/DirectionTest.sfd
import fontforge;
font=fontforge.open("fonts/DirectionTest.sfd");
font.selection.all();
font.selection.select(("less",),"K");
dir=True;
for g in font.selection.byGlyphs :
c = g.foreground[0];
if ( dir != c.isClockwise() ) :
raise ValueError, "Wrong d... | 21.380952 | 47 | 0.674833 |
import fontforge;
font=fontforge.open("fonts/DirectionTest.sfd");
font.selection.all();
font.selection.select(("less",),"K");
dir=True;
for g in font.selection.byGlyphs :
c = g.foreground[0];
if ( dir != c.isClockwise() ) :
raise ValueError, "Wrong direction";
dir = not dir;
c = font["K"].foreground[0];
i... | false | true |
08fd7408b9932a98e2cf69e9895d85b38659e98b | 782 | py | Python | profitroll/core/grid.py | Pablitorichard/PROFITROLL-Master | 5607a8e4dc1a4b84050b3e2b12ae0022bdbc5a67 | [
"MIT"
] | null | null | null | profitroll/core/grid.py | Pablitorichard/PROFITROLL-Master | 5607a8e4dc1a4b84050b3e2b12ae0022bdbc5a67 | [
"MIT"
] | null | null | null | profitroll/core/grid.py | Pablitorichard/PROFITROLL-Master | 5607a8e4dc1a4b84050b3e2b12ae0022bdbc5a67 | [
"MIT"
] | null | null | null | import numpy as np
class Grid():
""" This class encodes the 2D spatial grid used for the whole simulation.
:param Lx: Length (in m) of the x-axis of the rectangle grid
:type Lx: float
:param Ly: Length (in m) of the y-axis of the rectangle grid
:type Ly: float
:param Nx: Number of subdivisions of the x-axis o... | 26.965517 | 74 | 0.639386 | import numpy as np
class Grid():
def __init__(self, Lx, Ly, Nx, Ny, **kwargs):
self.Lx = Lx
self.Ly = Ly
self.Nx = Nx
self.Ny = Ny
self.dx = self.Lx / self.Nx
self.dy = self.Ly / self.Ny
grid = np.mgrid[0:self.Lx:self.dx, 0:self.Ly:self.dy]
self.x_grid = grid[0,:,:]
self.y_gri... | true | true |
08fd7431cc69cfb3fac3eb151fb941e469c5cf27 | 7,171 | py | Python | klazor/models.py | GtPsSd/klazor-heroku | 7d284a1f15216a8da2da4ca6772b0dfda7715e5e | [
"MIT"
] | null | null | null | klazor/models.py | GtPsSd/klazor-heroku | 7d284a1f15216a8da2da4ca6772b0dfda7715e5e | [
"MIT"
] | 8 | 2020-02-12T00:31:24.000Z | 2022-02-10T08:41:34.000Z | klazor/models.py | GtPsSd/klazor-heroku | 7d284a1f15216a8da2da4ca6772b0dfda7715e5e | [
"MIT"
] | 1 | 2019-07-15T01:33:27.000Z | 2019-07-15T01:33:27.000Z | # This is an auto-generated Django model module.
# You'll have to do the following manually to clean this up:
# * Rearrange models' order
# * Make sure each model has one field with primary_key=True
# * Make sure each ForeignKey has `on_delete` set to the desired behavior.
# * Remove `managed = False` lines if ... | 24.391156 | 134 | 0.669363 | # * Rearrange models' order
from django.db import models
from django.contrib.auth.models import User
from polymorphic.models import PolymorphicModel
class Tag(models.Model):
name = models.CharField(max_length=64, blank=True, null=True)
def __str__(self):
return self.name
class Meta:
db... | true | true |
08fd74a621d6f8ce262009e78e939792657c6b36 | 2,281 | py | Python | selfdrive/test/process_replay/inject_model.py | pevdh/openpilot | fca82ba503a663ec97b7ba89c2c3da80aef739b2 | [
"MIT"
] | 14 | 2019-05-20T13:20:12.000Z | 2020-10-10T07:55:20.000Z | selfdrive/test/process_replay/inject_model.py | pevdh/openpilot | fca82ba503a663ec97b7ba89c2c3da80aef739b2 | [
"MIT"
] | 4 | 2020-04-12T21:34:03.000Z | 2020-04-15T22:22:15.000Z | selfdrive/test/process_replay/inject_model.py | pevdh/openpilot | fca82ba503a663ec97b7ba89c2c3da80aef739b2 | [
"MIT"
] | 3 | 2019-03-06T20:58:50.000Z | 2019-05-21T01:01:37.000Z | #!/usr/bin/env python3
import os
import time
from tqdm import tqdm
from cereal.messaging import PubMaster, recv_one, sub_sock
from tools.lib.framereader import FrameReader
import subprocess
import selfdrive.manager as manager
def rreplace(s, old, new, occurrence):
li = s.rsplit(old, occurrence)
return new.join... | 24.526882 | 85 | 0.672512 |
import os
import time
from tqdm import tqdm
from cereal.messaging import PubMaster, recv_one, sub_sock
from tools.lib.framereader import FrameReader
import subprocess
import selfdrive.manager as manager
def rreplace(s, old, new, occurrence):
li = s.rsplit(old, occurrence)
return new.join(li)
def regen_model(... | true | true |
08fd75e4b6a5cd36218fa945cb7b5994fa5bdfaa | 14,727 | py | Python | tests/test_views_login.py | Temeez/django-two-factor-auth | 7726e12937ef84f792c82d908ae32b627ffa6ebe | [
"MIT"
] | null | null | null | tests/test_views_login.py | Temeez/django-two-factor-auth | 7726e12937ef84f792c82d908ae32b627ffa6ebe | [
"MIT"
] | 2 | 2018-03-06T21:37:48.000Z | 2018-07-31T23:41:08.000Z | tests/test_views_login.py | Temeez/django-two-factor-auth | 7726e12937ef84f792c82d908ae32b627ffa6ebe | [
"MIT"
] | 1 | 2020-02-24T15:33:20.000Z | 2020-02-24T15:33:20.000Z | from unittest import mock
from django.conf import settings
from django.shortcuts import resolve_url
from django.test import TestCase
from django.test.utils import override_settings
from django.urls import reverse
from django_otp import DEVICE_ID_SESSION_KEY
from django_otp.oath import totp
from two_factor.models impo... | 45.736025 | 103 | 0.586678 | from unittest import mock
from django.conf import settings
from django.shortcuts import resolve_url
from django.test import TestCase
from django.test.utils import override_settings
from django.urls import reverse
from django_otp import DEVICE_ID_SESSION_KEY
from django_otp.oath import totp
from two_factor.models impo... | true | true |
08fd76c5719f6ed85edac33f0b5bf43d85be3864 | 10,260 | py | Python | chrome/test/functional/databases.py | Gitman1989/chromium | 2b1cceae1075ef012fb225deec8b4c8bbe4bc897 | [
"BSD-3-Clause"
] | 2 | 2017-09-02T19:08:28.000Z | 2021-11-15T15:15:14.000Z | chrome/test/functional/databases.py | meego-tablet-ux/meego-app-browser | 0f4ef17bd4b399c9c990a2f6ca939099495c2b9c | [
"BSD-3-Clause"
] | null | null | null | chrome/test/functional/databases.py | meego-tablet-ux/meego-app-browser | 0f4ef17bd4b399c9c990a2f6ca939099495c2b9c | [
"BSD-3-Clause"
] | 1 | 2020-11-04T07:22:28.000Z | 2020-11-04T07:22:28.000Z | #!/usr/bin/python
# Copyright (c) 2010 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import simplejson
import os
import pyauto_functional
import pyauto
class SQLExecutionError(RuntimeError):
"""Represents an error t... | 34.42953 | 80 | 0.706433 |
import simplejson
import os
import pyauto_functional
import pyauto
class SQLExecutionError(RuntimeError):
pass
class DatabasesTest(pyauto.PyUITest):
def __init__(self, methodName='runTest'):
super(DatabasesTest, self).__init__(methodName)
self.TEST_PAGE_URL = self.GetFileURLForDataPath(
o... | true | true |
08fd784305ce85ce11a27e8e3602411f7909e665 | 1,007 | py | Python | Activity327Folder/327 q2.py | expeditiona/expeditiona.github.io | 85c6cbddf724d87ab1c7f924d717a6aadc23286e | [
"MIT"
] | null | null | null | Activity327Folder/327 q2.py | expeditiona/expeditiona.github.io | 85c6cbddf724d87ab1c7f924d717a6aadc23286e | [
"MIT"
] | null | null | null | Activity327Folder/327 q2.py | expeditiona/expeditiona.github.io | 85c6cbddf724d87ab1c7f924d717a6aadc23286e | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
f = open("3.2.7 Investigating Data - Ques 2.csv", 'r') #Open file
spot = [] #Create empty lists
pct = []
shotpct = []
combined = []
lineNumber = 1
for line in f: #Iterate through lines of file
line = line.strip()
if lineNumber > 1 and lineNumber < 9:
spot.append(line... | 27.216216 | 101 | 0.636544 | import matplotlib.pyplot as plt
f = open("3.2.7 Investigating Data - Ques 2.csv", 'r')
spot = [] pct = []
shotpct = []
combined = []
lineNumber = 1
for line in f: line = line.strip()
if lineNumber > 1 and lineNumber < 9:
spot.append(line.split(",")[0]) pct.append(line.split(",")[1])
... | true | true |
08fd788594b6f07ba41ebbf10c600451d19800fb | 959 | py | Python | RPI/Wifi_old/WiFi_Socket.py | sguertl/Flying_Raspberry | d4f4ec82c4ceab7560d00265d7214aff84cbffd7 | [
"Apache-2.0"
] | 1 | 2018-03-10T10:50:29.000Z | 2018-03-10T10:50:29.000Z | RPI/Wifi_old/WiFi_Socket.py | sguertl/Flying_Pi | d4f4ec82c4ceab7560d00265d7214aff84cbffd7 | [
"Apache-2.0"
] | null | null | null | RPI/Wifi_old/WiFi_Socket.py | sguertl/Flying_Pi | d4f4ec82c4ceab7560d00265d7214aff84cbffd7 | [
"Apache-2.0"
] | null | null | null | import socket
import sys
from thread import *
HOST = '' # Symbolic name meaning all available interfaces
PORT = 5050 # Abritray non-privileged port
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
print('Socket created')
# Bind socket to local host and port
try:
s.bind((HOST, PORT))
except socket.error as... | 24.589744 | 74 | 0.665276 | import socket
import sys
from thread import *
HOST = '' PORT = 5050
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
print('Socket created')
try:
s.bind((HOST, PORT))
except socket.error as msg:
print('Bind failed. Error code: ' + str(msg[0]) + ' Message: ' msg[1])
sys.exit()
print('Socket bind c... | false | true |
08fd78b97941cbd67e8b5d189db109afcb9a2e98 | 1,455 | py | Python | flask_blog/__init__.py | dmitriyvek/flask-blog | 86e94f9a9bdae682061bb26662da9649f6a4e6ab | [
"MIT"
] | null | null | null | flask_blog/__init__.py | dmitriyvek/flask-blog | 86e94f9a9bdae682061bb26662da9649f6a4e6ab | [
"MIT"
] | null | null | null | flask_blog/__init__.py | dmitriyvek/flask-blog | 86e94f9a9bdae682061bb26662da9649f6a4e6ab | [
"MIT"
] | null | null | null | from flask import Flask
from flasgger import Swagger
from flask_debugtoolbar import DebugToolbarExtension
from flask_debug_api import DebugAPIExtension
from flask_marshmallow import Marshmallow
from flask_mail import Mail
from flask_migrate import Migrate
from config.settings import app_config
from config.swagger_conf... | 27.980769 | 57 | 0.767698 | from flask import Flask
from flasgger import Swagger
from flask_debugtoolbar import DebugToolbarExtension
from flask_debug_api import DebugAPIExtension
from flask_marshmallow import Marshmallow
from flask_mail import Mail
from flask_migrate import Migrate
from config.settings import app_config
from config.swagger_conf... | true | true |
08fd79cc93ade19591256645eacf3e93bb1f5bf9 | 1,555 | py | Python | goodwe/xs.py | ziporah/goodwe | 70eb0b05219d96aa6aa77ba666c28e59e7f448ba | [
"MIT"
] | 16 | 2021-08-22T13:17:56.000Z | 2022-03-19T11:48:09.000Z | goodwe/xs.py | ziporah/goodwe | 70eb0b05219d96aa6aa77ba666c28e59e7f448ba | [
"MIT"
] | 8 | 2021-08-18T12:05:51.000Z | 2022-03-27T13:36:41.000Z | goodwe/xs.py | ziporah/goodwe | 70eb0b05219d96aa6aa77ba666c28e59e7f448ba | [
"MIT"
] | 10 | 2021-08-24T09:21:44.000Z | 2022-03-08T18:20:57.000Z | import logging
from .dt import DT
from .processor import ProcessorResult, AbstractDataProcessor
from .protocol import ProtocolCommand
from .sensor import *
logger = logging.getLogger(__name__)
class GoodWeXSProcessor(AbstractDataProcessor):
def __init__(self):
self.dummy_inverter = DT("localhost")
... | 35.340909 | 94 | 0.658521 | import logging
from .dt import DT
from .processor import ProcessorResult, AbstractDataProcessor
from .protocol import ProtocolCommand
from .sensor import *
logger = logging.getLogger(__name__)
class GoodWeXSProcessor(AbstractDataProcessor):
def __init__(self):
self.dummy_inverter = DT("localhost")
... | true | true |
08fd7a8dec445e17090b796401b47bc2a2e9c56c | 9,971 | py | Python | pgu/gui/button.py | danomagnum/fallingsand | b2b16637e85f9e4b0c0acd67f4be3ac504d8fd00 | [
"MIT"
] | null | null | null | pgu/gui/button.py | danomagnum/fallingsand | b2b16637e85f9e4b0c0acd67f4be3ac504d8fd00 | [
"MIT"
] | null | null | null | pgu/gui/button.py | danomagnum/fallingsand | b2b16637e85f9e4b0c0acd67f4be3ac504d8fd00 | [
"MIT"
] | null | null | null | """Contains various types of button widgets."""
from pygame.locals import *
from .const import *
from . import widget, surface
from . import basic
class _button(widget.Widget):
# The underlying 'value' accessed by the getter and setters below
_value = None
def __init__(self,**params):
widget.Wid... | 29.240469 | 121 | 0.554608 |
from pygame.locals import *
from .const import *
from . import widget, surface
from . import basic
class _button(widget.Widget):
_value = None
def __init__(self,**params):
widget.Widget.__init__(self,**params)
self.state = 0
def event(self,e):
if e.type == ENTER: self.re... | true | true |
08fd7abf1320f200f49bcb05109111f0ac45bee7 | 537 | py | Python | invitation/admin.py | mentionllc/django-invitation | af2adf734bb354ae1aadc4dd85b8fb98c6bcd14e | [
"BSD-3-Clause"
] | 2 | 2015-02-28T11:03:29.000Z | 2018-05-24T16:39:59.000Z | invitation/admin.py | mentionllc/django-invitation | af2adf734bb354ae1aadc4dd85b8fb98c6bcd14e | [
"BSD-3-Clause"
] | null | null | null | invitation/admin.py | mentionllc/django-invitation | af2adf734bb354ae1aadc4dd85b8fb98c6bcd14e | [
"BSD-3-Clause"
] | null | null | null | from django.contrib import admin
from invitation.models import InvitationKey, InvitationUser
class InvitationKeyAdmin(admin.ModelAdmin):
list_display = ('__unicode__', 'from_user', 'recipient', 'date_invited', 'uses_left', 'key_expired' )
filter_horizontal = ('registrant',)
readonly_fields = ('registrant',... | 38.357143 | 105 | 0.783985 | from django.contrib import admin
from invitation.models import InvitationKey, InvitationUser
class InvitationKeyAdmin(admin.ModelAdmin):
list_display = ('__unicode__', 'from_user', 'recipient', 'date_invited', 'uses_left', 'key_expired' )
filter_horizontal = ('registrant',)
readonly_fields = ('registrant',... | true | true |
08fd7b2d891efe3a1c52993025d4ce1a12a78f3a | 1,370 | py | Python | scripts/spreadsheet_to_resource_mds/update_curations.py | alonshvartsman/bitcoin-resources.github.io | 11dc1e61b70f14f85124b8a938e345ae6b953bb4 | [
"MIT"
] | 32 | 2019-08-31T15:12:39.000Z | 2021-12-28T09:21:31.000Z | scripts/spreadsheet_to_resource_mds/update_curations.py | alonshvartsman/bitcoin-resources.github.io | 11dc1e61b70f14f85124b8a938e345ae6b953bb4 | [
"MIT"
] | 106 | 2019-10-27T07:30:44.000Z | 2022-03-15T14:43:50.000Z | scripts/spreadsheet_to_resource_mds/update_curations.py | alonshvartsman/bitcoin-resources.github.io | 11dc1e61b70f14f85124b8a938e345ae6b953bb4 | [
"MIT"
] | 14 | 2019-10-29T19:31:21.000Z | 2022-01-31T22:44:47.000Z | #! /usr/bin/python3
import gspread
import json
import os
import re
from oauth2client.service_account import ServiceAccountCredentials
from util import author_to_file_path, get_excerpt_from_page, get_valid_author_slug, title_to_file_path
scope = ['https://spreadsheets.google.com/feeds',
'https://www.googleapi... | 31.136364 | 102 | 0.634307 | import gspread
import json
import os
import re
from oauth2client.service_account import ServiceAccountCredentials
from util import author_to_file_path, get_excerpt_from_page, get_valid_author_slug, title_to_file_path
scope = ['https://spreadsheets.google.com/feeds',
'https://www.googleapis.com/auth/drive']
c... | true | true |
08fd7c61022f58aba5e7141f57373aa721ddf1a5 | 5,428 | py | Python | sharpy/postproc/stallcheck.py | ostodieck/sharpy | b85aa1c001a0ec851af4eb259cce7c01dfa68b9e | [
"BSD-3-Clause"
] | 1 | 2020-07-27T05:15:35.000Z | 2020-07-27T05:15:35.000Z | sharpy/postproc/stallcheck.py | briandesilva/sharpy | aed86428ff88fd14d36cabd91cf7e04b5fc9a39a | [
"BSD-3-Clause"
] | null | null | null | sharpy/postproc/stallcheck.py | briandesilva/sharpy | aed86428ff88fd14d36cabd91cf7e04b5fc9a39a | [
"BSD-3-Clause"
] | 1 | 2021-01-27T17:57:40.000Z | 2021-01-27T17:57:40.000Z | import os
import numpy as np
from tvtk.api import tvtk, write_data
import sharpy.utils.algebra as algebra
import sharpy.utils.cout_utils as cout
from sharpy.utils.settings import str2bool
from sharpy.utils.solver_interface import solver, BaseSolver
import sharpy.utils.settings as settings
from sharpy.utils.datastruct... | 42.740157 | 115 | 0.630803 | import os
import numpy as np
from tvtk.api import tvtk, write_data
import sharpy.utils.algebra as algebra
import sharpy.utils.cout_utils as cout
from sharpy.utils.settings import str2bool
from sharpy.utils.solver_interface import solver, BaseSolver
import sharpy.utils.settings as settings
from sharpy.utils.datastruct... | true | true |
08fd7cf3bb6264837509d31d9a9e38186dfa4426 | 1,358 | py | Python | kb/vote/utils.py | movermeyer/django-kb | 3c3246761f4f6d60221049f46ce9702fd56384a8 | [
"BSD-3-Clause"
] | 7 | 2015-04-17T12:01:29.000Z | 2021-06-21T01:54:15.000Z | kb/vote/utils.py | movermeyer/django-kb | 3c3246761f4f6d60221049f46ce9702fd56384a8 | [
"BSD-3-Clause"
] | null | null | null | kb/vote/utils.py | movermeyer/django-kb | 3c3246761f4f6d60221049f46ce9702fd56384a8 | [
"BSD-3-Clause"
] | 3 | 2015-04-17T16:21:42.000Z | 2018-06-06T13:34:03.000Z | from __future__ import unicode_literals
from .models import Vote
from ..base.choices import VoteChoice
class Votes(object):
def contribute_to_class(self, cls, name):
setattr(cls, name, _VoteDescriptor())
class _VoteDescriptor(object):
def __get__(self, instance, owner):
if instance is Non... | 27.16 | 74 | 0.553756 | from __future__ import unicode_literals
from .models import Vote
from ..base.choices import VoteChoice
class Votes(object):
def contribute_to_class(self, cls, name):
setattr(cls, name, _VoteDescriptor())
class _VoteDescriptor(object):
def __get__(self, instance, owner):
if instance is Non... | true | true |
08fd7d3c10bbd6037ad6f017cf6f13749ca91be0 | 607 | py | Python | Training/Greed_id_Good.py | Mayner0220/Programmers | 42e4783a526506fb7d8208841a76201909ed5c5c | [
"Apache-2.0"
] | 1 | 2021-04-01T06:19:02.000Z | 2021-04-01T06:19:02.000Z | Training/Greed_id_Good.py | Mayner0220/Programmers | 42e4783a526506fb7d8208841a76201909ed5c5c | [
"Apache-2.0"
] | null | null | null | Training/Greed_id_Good.py | Mayner0220/Programmers | 42e4783a526506fb7d8208841a76201909ed5c5c | [
"Apache-2.0"
] | null | null | null | # https://www.codewars.com/kata/5270d0d18625160ada0000e4/train/python
def score(dice):
score = 0
for eye in range(6):
count = dice.count(eye+1)
if count>=3:
if eye+1==1:
score += 1000
else:
score += (eye+1) * 100
count -= 3
... | 22.481481 | 69 | 0.453048 |
def score(dice):
score = 0
for eye in range(6):
count = dice.count(eye+1)
if count>=3:
if eye+1==1:
score += 1000
else:
score += (eye+1) * 100
count -= 3
if eye+1==1 or eye+1==5:
if eye+1==1:
... | true | true |
08fd7d3e2d065f85e08f02d867d9e76adff16c05 | 68,247 | py | Python | src/transformers/models/rembert/modeling_rembert.py | bugface/transformers | ba286fe7d51db12ad663effac83bed8199dd7141 | [
"Apache-2.0"
] | 5 | 2020-09-01T09:15:48.000Z | 2020-09-15T03:25:05.000Z | src/transformers/models/rembert/modeling_rembert.py | bugface/transformers | ba286fe7d51db12ad663effac83bed8199dd7141 | [
"Apache-2.0"
] | 2 | 2022-03-08T04:58:59.000Z | 2022-03-19T03:45:14.000Z | src/transformers/models/rembert/modeling_rembert.py | bugface/transformers | ba286fe7d51db12ad663effac83bed8199dd7141 | [
"Apache-2.0"
] | 3 | 2020-08-20T04:46:25.000Z | 2020-10-14T08:39:13.000Z | # coding=utf-8
# Copyright 2021 The HuggingFace Team The HuggingFace Inc. team. 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/LIC... | 44.518591 | 198 | 0.668674 |
import math
import os
from typing import Optional, Tuple, Union
import torch
import torch.utils.checkpoint
from torch import nn
from torch.nn import BCEWithLogitsLoss, CrossEntropyLoss, MSELoss
from ...activations import ACT2FN
from ...modeling_outputs import (
BaseModelOutputWithPastAndCrossAttentions,
Bas... | true | true |
08fd7d8dde9dd1d04f55866d4bbc3a7e5072cb46 | 626 | py | Python | data_augmentation/eda/image/transforms/shear_x.py | vishalbelsare/emmental-tutorials | 5920cb71de07bfdb717e46ddfbe76457e8868fa7 | [
"MIT"
] | 16 | 2019-06-20T08:54:53.000Z | 2021-03-02T02:50:47.000Z | data_augmentation/eda/image/transforms/shear_x.py | vishalbelsare/emmental-tutorials | 5920cb71de07bfdb717e46ddfbe76457e8868fa7 | [
"MIT"
] | 1 | 2019-10-01T10:07:53.000Z | 2019-10-08T20:15:45.000Z | data_augmentation/eda/image/transforms/shear_x.py | vishalbelsare/emmental-tutorials | 5920cb71de07bfdb717e46ddfbe76457e8868fa7 | [
"MIT"
] | 9 | 2019-06-28T17:33:36.000Z | 2020-12-21T08:50:56.000Z | import random
from eda.image.transforms.transform import EdaTransform
from eda.image.transforms.utils import categorize_value
from PIL import Image
class ShearX(EdaTransform):
value_range = (0.0, 0.3)
def __init__(self, name=None, prob=1.0, level=0):
super().__init__(name, prob, level)
def tra... | 27.217391 | 83 | 0.638978 | import random
from eda.image.transforms.transform import EdaTransform
from eda.image.transforms.utils import categorize_value
from PIL import Image
class ShearX(EdaTransform):
value_range = (0.0, 0.3)
def __init__(self, name=None, prob=1.0, level=0):
super().__init__(name, prob, level)
def tra... | true | true |
08fd7e33479b331454f63f05f6240dd221591ee9 | 4,097 | py | Python | python/paddle/utils/deprecated.py | ZHUI/Paddle | 32ae8e81322ed380a89157fcb632c229e2c64979 | [
"Apache-2.0"
] | null | null | null | python/paddle/utils/deprecated.py | ZHUI/Paddle | 32ae8e81322ed380a89157fcb632c229e2c64979 | [
"Apache-2.0"
] | null | null | null | python/paddle/utils/deprecated.py | ZHUI/Paddle | 32ae8e81322ed380a89157fcb632c229e2c64979 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2018 PaddlePaddle 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 appli... | 45.522222 | 131 | 0.651208 |
import warnings
import functools
import paddle
warnings.simplefilter('default', DeprecationWarning)
def deprecated(update_to="", since="", reason=""):
def decorator(func):
return func
assert isinstance(update_to, str), 'type of "update_to" must be str.'
assert isinstance(since, ... | true | true |
08fd80f03ed0830e0a3cd34d2382d4b1f9f4c25e | 4,789 | py | Python | testproject/testapp/tests/test_set_password.py | alexseitsinger/djoser | de199e9997bb59cc0df09de8b09d0af40be408bb | [
"MIT"
] | 1 | 2020-01-13T15:32:27.000Z | 2020-01-13T15:32:27.000Z | testproject/testapp/tests/test_set_password.py | alexseitsinger/djoser | de199e9997bb59cc0df09de8b09d0af40be408bb | [
"MIT"
] | null | null | null | testproject/testapp/tests/test_set_password.py | alexseitsinger/djoser | de199e9997bb59cc0df09de8b09d0af40be408bb | [
"MIT"
] | 1 | 2020-01-13T15:32:38.000Z | 2020-01-13T15:32:38.000Z | from django.conf import settings
from django.test.utils import override_settings
from djet import assertions
from rest_framework import status
from rest_framework.reverse import reverse
from rest_framework.test import APITestCase
from djoser.conf import settings as djoser_settings
from testapp.tests.common import crea... | 36.007519 | 86 | 0.680935 | from django.conf import settings
from django.test.utils import override_settings
from djet import assertions
from rest_framework import status
from rest_framework.reverse import reverse
from rest_framework.test import APITestCase
from djoser.conf import settings as djoser_settings
from testapp.tests.common import crea... | true | true |
08fd81126a5dde55c322aa2ec29a25e3029f2dbd | 4,420 | py | Python | senpy/logistic_funcs.py | ACasey13/senpy | 00b5403dc95a0741abfc56c3a3e2a1e6247f15d4 | [
"MIT"
] | null | null | null | senpy/logistic_funcs.py | ACasey13/senpy | 00b5403dc95a0741abfc56c3a3e2a1e6247f15d4 | [
"MIT"
] | 3 | 2021-06-08T21:07:58.000Z | 2022-01-13T02:25:11.000Z | senpy/logistic_funcs.py | ACasey13/senpy | 00b5403dc95a0741abfc56c3a3e2a1e6247f15d4 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Fri Feb 28 15:29:17 2020
@author: alexc
"""
import numpy as np
from scipy.special import expit
STABILITY = 1E-8
def z(x, mu, sigma):
"""
Returns the z-location of the given stimulus levels
"""
return (x - mu) / sigma
def prob(z):
"""
Cumulative dis... | 25.697674 | 104 | 0.567195 |
import numpy as np
from scipy.special import expit
STABILITY = 1E-8
def z(x, mu, sigma):
return (x - mu) / sigma
def prob(z):
return expit(z)
def pred(pts, theta, inverted):
mu, sigma = theta
P = prob(z(pts, mu, sigma))
if inverted:
return np.maximum(1-P, 0.0)
else:
... | true | true |
08fd81e86dcbb820e642ffe5d9e022c44b41741d | 24,306 | py | Python | ansible/venv/lib/python2.7/site-packages/ansible/modules/cloud/smartos/vmadm.py | gvashchenkolineate/gvashchenkolineate_infra_trytravis | 0fb18850afe0d8609693ba4b23f29c7cda17d97f | [
"MIT"
] | 17 | 2017-06-07T23:15:01.000Z | 2021-08-30T14:32:36.000Z | ansible/ansible/modules/cloud/smartos/vmadm.py | SergeyCherepanov/ansible | 875711cd2fd6b783c812241c2ed7a954bf6f670f | [
"MIT"
] | 9 | 2017-06-25T03:31:52.000Z | 2021-05-17T23:43:12.000Z | ansible/ansible/modules/cloud/smartos/vmadm.py | SergeyCherepanov/ansible | 875711cd2fd6b783c812241c2ed7a954bf6f670f | [
"MIT"
] | 3 | 2018-05-26T21:31:22.000Z | 2019-09-28T17:00:45.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Jasper Lievisse Adriaanse <j@jasper.la>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.... | 32.364847 | 120 | 0.641405 |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = '''
---
module: vmadm
short_description: Manage SmartOS virtual machines ... | true | true |
08fd821a53b856a5d6c29d9a71346c2a909aa44e | 2,176 | py | Python | mjolnir/cli/make_folds.py | wikimedia/search-MjoLniR | 5ab0e1d590cbbed5d5dd775c62f9b97f8b71a54d | [
"MIT"
] | 48 | 2017-10-27T14:47:06.000Z | 2022-03-27T08:04:37.000Z | mjolnir/cli/make_folds.py | wikimedia/search-MjoLniR | 5ab0e1d590cbbed5d5dd775c62f9b97f8b71a54d | [
"MIT"
] | null | null | null | mjolnir/cli/make_folds.py | wikimedia/search-MjoLniR | 5ab0e1d590cbbed5d5dd775c62f9b97f8b71a54d | [
"MIT"
] | 8 | 2018-03-16T05:06:51.000Z | 2022-01-23T11:42:07.000Z | from argparse import ArgumentParser
from typing import Callable, List, Mapping
from mjolnir.cli.helpers import Cli, HivePartition
import mjolnir.transform as mt
from mjolnir.transformations import make_folds
def transform(
date: str,
output_path: str,
feature_vectors: HivePartition,
labeled_query_pag... | 36.881356 | 83 | 0.690257 | from argparse import ArgumentParser
from typing import Callable, List, Mapping
from mjolnir.cli.helpers import Cli, HivePartition
import mjolnir.transform as mt
from mjolnir.transformations import make_folds
def transform(
date: str,
output_path: str,
feature_vectors: HivePartition,
labeled_query_pag... | true | true |
08fd83a6bfe596aa21ef31a54885d6cca1d50f29 | 1,946 | py | Python | src/train.py | GT-AcerZhang/paddle-voice | b243144a86e9d34cabe8a5def9e8a2dae013b3fa | [
"Apache-2.0"
] | 2 | 2020-12-20T16:42:57.000Z | 2021-02-27T16:35:38.000Z | src/train.py | GT-AcerZhang/paddle-voice | b243144a86e9d34cabe8a5def9e8a2dae013b3fa | [
"Apache-2.0"
] | null | null | null | src/train.py | GT-AcerZhang/paddle-voice | b243144a86e9d34cabe8a5def9e8a2dae013b3fa | [
"Apache-2.0"
] | 1 | 2021-03-05T10:38:02.000Z | 2021-03-05T10:38:02.000Z | get_ipython().system('pip install paddlex -i https://mirror.baidu.com/pypi/simple')
#开始模型的训练
# 设置使用0号GPU卡
import os
os.environ['CUDA_VISIBLE_DEVICES'] = '0'
import paddlex as pdx
# 图像预处理+数据增强
from paddlex.det import transforms
train_transforms = transforms.Compose([
transforms.MixupImage(mixup_epoch=250),
tr... | 26.297297 | 83 | 0.737924 | get_ipython().system('pip install paddlex -i https://mirror.baidu.com/pypi/simple')
import os
os.environ['CUDA_VISIBLE_DEVICES'] = '0'
import paddlex as pdx
from paddlex.det import transforms
train_transforms = transforms.Compose([
transforms.MixupImage(mixup_epoch=250),
transforms.RandomDistort(),
trans... | true | true |
08fd8514c7b9ddfc9558667879efa1b985fe8af7 | 4,405 | py | Python | tensorboard/tools/mat_bundle_icon_svg_test.py | Digitaltransform/tensorboard | 75a3c4a8edaa64860951b5fec830accf53993510 | [
"Apache-2.0"
] | 6,139 | 2017-06-13T02:43:20.000Z | 2022-03-30T23:56:28.000Z | tensorboard/tools/mat_bundle_icon_svg_test.py | Digitaltransform/tensorboard | 75a3c4a8edaa64860951b5fec830accf53993510 | [
"Apache-2.0"
] | 3,239 | 2017-06-14T15:49:50.000Z | 2022-03-31T23:43:15.000Z | tensorboard/tools/mat_bundle_icon_svg_test.py | admariner/tensorboard | 931fdb84ed125efe5ef6cb0bad869c52da73e18f | [
"Apache-2.0"
] | 1,882 | 2017-06-15T01:33:54.000Z | 2022-03-30T15:27:25.000Z | # Copyright 2021 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.241135 | 80 | 0.62815 |
import collections
import os
from tensorboard import test
from tensorboard.tools import mat_bundle_icon_svg
_TestableSvg = collections.namedtuple(
"_TestableSvg",
(
"basename",
"svg_content",
"expected_content",
),
)
TEST_SVG_A = _TestableSvg(
"a.svg",
'<svg><path d="M1... | true | true |
08fd860f075e12b5c4c78929234c76a1ff520682 | 4,782 | py | Python | test/functional/httpbasics.py | xagau/placeh | bd10a67a39dca5b7d1619c29267b291a410b30ac | [
"MIT"
] | 2 | 2018-11-16T18:21:38.000Z | 2020-12-06T15:23:42.000Z | test/functional/httpbasics.py | xagau/placeh | bd10a67a39dca5b7d1619c29267b291a410b30ac | [
"MIT"
] | null | null | null | test/functional/httpbasics.py | xagau/placeh | bd10a67a39dca5b7d1619c29267b291a410b30ac | [
"MIT"
] | 1 | 2018-12-10T18:41:56.000Z | 2018-12-10T18:41:56.000Z | #!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the RPC HTTP basics."""
from test_framework.test_framework import placehTestFramework
from test_f... | 43.87156 | 107 | 0.632999 |
from test_framework.test_framework import placehTestFramework
from test_framework.util import *
import http.client
import urllib.parse
class HTTPBasicsTest (placehTestFramework):
def set_test_params(self):
self.num_nodes = 3
def setup_network(self):
self.setup_nodes()
def run_test(self)... | true | true |
08fd89444a77f493416a05955bf38d1f55a9c232 | 4,583 | py | Python | src/oci/database/models/peer_autonomous_container_database_backup_config.py | Manny27nyc/oci-python-sdk | de60b04e07a99826254f7255e992f41772902df7 | [
"Apache-2.0",
"BSD-3-Clause"
] | 249 | 2017-09-11T22:06:05.000Z | 2022-03-04T17:09:29.000Z | src/oci/database/models/peer_autonomous_container_database_backup_config.py | Manny27nyc/oci-python-sdk | de60b04e07a99826254f7255e992f41772902df7 | [
"Apache-2.0",
"BSD-3-Clause"
] | 228 | 2017-09-11T23:07:26.000Z | 2022-03-23T10:58:50.000Z | src/oci/database/models/peer_autonomous_container_database_backup_config.py | Manny27nyc/oci-python-sdk | de60b04e07a99826254f7255e992f41772902df7 | [
"Apache-2.0",
"BSD-3-Clause"
] | 224 | 2017-09-27T07:32:43.000Z | 2022-03-25T16:55:42.000Z | # coding: utf-8
# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 43.235849 | 245 | 0.73969 |
from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel from oci.decorators import init_model_state_from_kwargs
@init_model_state_from_kwargs
class PeerAutonomousContainerDatabaseBackupConfig(object):
def __init__(self, **kwargs):
self.swagger_types = {
... | true | true |
08fd8980d494d23d37217d91e93d60291a350fc2 | 28,849 | py | Python | src/click/termui.py | ltbam/click | e8e4b32f5034b8e6df9f4d5ba7ed952da9394a76 | [
"BSD-3-Clause"
] | null | null | null | src/click/termui.py | ltbam/click | e8e4b32f5034b8e6df9f4d5ba7ed952da9394a76 | [
"BSD-3-Clause"
] | null | null | null | src/click/termui.py | ltbam/click | e8e4b32f5034b8e6df9f4d5ba7ed952da9394a76 | [
"BSD-3-Clause"
] | null | null | null | import inspect
import io
import itertools
import os
import sys
import typing
import typing as t
from gettext import gettext as _
from ._compat import isatty
from ._compat import strip_ansi
from ._compat import WIN
from .exceptions import Abort
from .exceptions import UsageError
from .globals import resolve_color_defau... | 35.704208 | 87 | 0.635689 | import inspect
import io
import itertools
import os
import sys
import typing
import typing as t
from gettext import gettext as _
from ._compat import isatty
from ._compat import strip_ansi
from ._compat import WIN
from .exceptions import Abort
from .exceptions import UsageError
from .globals import resolve_color_defau... | true | true |
08fd8aadc5725d501d2dc9a4bb7cf7a5f2c12973 | 777 | py | Python | apps/links/migrations/0003_auto_20171213_0936.py | iamjdcollins/districtwebsite | 89e2aea47ca3d221665bc23586a4374421be5800 | [
"MIT"
] | null | null | null | apps/links/migrations/0003_auto_20171213_0936.py | iamjdcollins/districtwebsite | 89e2aea47ca3d221665bc23586a4374421be5800 | [
"MIT"
] | null | null | null | apps/links/migrations/0003_auto_20171213_0936.py | iamjdcollins/districtwebsite | 89e2aea47ca3d221665bc23586a4374421be5800 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2017-12-13 16:36
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('links', '0002_actionbutton'),
]
operations = [
migrations.AlterModelOptions(
... | 31.08 | 291 | 0.631918 | from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('links', '0002_actionbutton'),
]
operations = [
migrations.AlterModelOptions(
name='actionbutton',
options={'default_manager_name': '... | true | true |
08fd8b505170beb71ff3a444a9b2f2cc34fe541e | 564 | py | Python | Kattis/mirror.py | ruidazeng/online-judge | 6bdf8bbf1af885637dab474d0ccb58aff22a0933 | [
"MIT"
] | null | null | null | Kattis/mirror.py | ruidazeng/online-judge | 6bdf8bbf1af885637dab474d0ccb58aff22a0933 | [
"MIT"
] | null | null | null | Kattis/mirror.py | ruidazeng/online-judge | 6bdf8bbf1af885637dab474d0ccb58aff22a0933 | [
"MIT"
] | 1 | 2020-06-22T21:07:24.000Z | 2020-06-22T21:07:24.000Z | from array import *
N = int(input())
for i in range(1, N + 1):
# print test number
print("Test", i)
m, n = map(int, input().split())
# input array
T = []
for _ in range(m):
T.append(list(input()))
# output array
P = [[0 for i in range(n)] for j in range(m)]
... | 21.692308 | 49 | 0.445035 | from array import *
N = int(input())
for i in range(1, N + 1):
print("Test", i)
m, n = map(int, input().split())
T = []
for _ in range(m):
T.append(list(input()))
P = [[0 for i in range(n)] for j in range(m)]
for i in range(m):
for j in range(n... | true | true |
08fd8cb744a97c5f00d259c8d9615d868c9a510d | 29,768 | py | Python | networking_odl/tests/unit/ml2/test_pseudo_agentdb_binding.py | starlingx-staging/stx-networking-odl | ea8f4536aa28adbb762913b5353f7de5e6c31ce3 | [
"Apache-2.0"
] | null | null | null | networking_odl/tests/unit/ml2/test_pseudo_agentdb_binding.py | starlingx-staging/stx-networking-odl | ea8f4536aa28adbb762913b5353f7de5e6c31ce3 | [
"Apache-2.0"
] | null | null | null | networking_odl/tests/unit/ml2/test_pseudo_agentdb_binding.py | starlingx-staging/stx-networking-odl | ea8f4536aa28adbb762913b5353f7de5e6c31ce3 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2016 OpenStack Foundation
# 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 ... | 42.284091 | 79 | 0.647608 |
from copy import deepcopy
from os import path as os_path
from string import Template
import fixtures
import mock
from oslo_config import cfg
from oslo_serialization import jsonutils
from requests.exceptions import HTTPError
from neutron.db import provisioning_blocks
from neutron.plugins.ml2 import driver_api as api
... | true | true |
08fd8d334e7069d1e7badd2f2aff24cb0c0de926 | 15,789 | py | Python | util/o3-pipeview.py | shantanu-gupta/gem5 | 94af1a6531c5a14da0d67c0c1f5abd8e22e6e514 | [
"BSD-3-Clause"
] | 30 | 2019-07-12T02:35:33.000Z | 2022-02-22T03:34:35.000Z | util/o3-pipeview.py | shantanu-gupta/gem5 | 94af1a6531c5a14da0d67c0c1f5abd8e22e6e514 | [
"BSD-3-Clause"
] | 8 | 2020-02-05T17:47:10.000Z | 2021-09-06T03:58:56.000Z | util/o3-pipeview.py | shantanu-gupta/gem5 | 94af1a6531c5a14da0d67c0c1f5abd8e22e6e514 | [
"BSD-3-Clause"
] | 25 | 2017-12-02T00:46:04.000Z | 2022-02-18T19:28:53.000Z | #! /usr/bin/env python2
# Copyright (c) 2011 ARM Limited
# All rights reserved
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementati... | 41.769841 | 109 | 0.599151 |
import optparse
import os
import sys
import copy
insts = {
'queue': [] , 'max_threshold':2000, 'min_threshold':1000, 'sn_start':0, 'sn_stop':0, 'tick_start':0, 'tick_stop':0, 'tick_drift':2000, ... | false | true |
08fd8da45e42fad2b47f0a9535f38625e3ea4175 | 3,502 | py | Python | src/cfnlint/rules/conditions/Not.py | kbcaleb/cfn-python-lint | 58568ca1cbab3a6cb810564e3af72162cb13b48f | [
"MIT-0"
] | null | null | null | src/cfnlint/rules/conditions/Not.py | kbcaleb/cfn-python-lint | 58568ca1cbab3a6cb810564e3af72162cb13b48f | [
"MIT-0"
] | null | null | null | src/cfnlint/rules/conditions/Not.py | kbcaleb/cfn-python-lint | 58568ca1cbab3a6cb810564e3af72162cb13b48f | [
"MIT-0"
] | null | null | null | """
Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy of this
software and associated documentation files (the "Software"), to deal in the Software
without restriction, including without limitation the rights to ... | 46.078947 | 170 | 0.552541 | from cfnlint import CloudFormationLintRule
from cfnlint import RuleMatch
class Not(CloudFormationLintRule):
id = 'E8005'
shortdesc = 'Check Fn::Not structure for validity'
description = 'Check Fn::Not is a list of two elements'
source_url = 'https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGui... | true | true |
08fd8dc5a2c9457a0b15a8f5f560ba721cf25b9e | 739 | py | Python | tests/test_ghdl.py | getziadz/edalize | eb9a591417b091a30d95b638ad498e56ee361785 | [
"BSD-2-Clause"
] | 1 | 2022-01-25T23:47:24.000Z | 2022-01-25T23:47:24.000Z | tests/test_ghdl.py | getziadz/edalize | eb9a591417b091a30d95b638ad498e56ee361785 | [
"BSD-2-Clause"
] | null | null | null | tests/test_ghdl.py | getziadz/edalize | eb9a591417b091a30d95b638ad498e56ee361785 | [
"BSD-2-Clause"
] | null | null | null | import pytest
def test_ghdl():
import os
import shutil
from edalize_common import compare_files, setup_backend, tests_dir
ref_dir = os.path.join(tests_dir, __name__)
paramtypes = ['vlogparam']
name = 'test_ghdl'
tool = 'ghdl'
tool_options = {'analyze_options' : [... | 29.56 | 84 | 0.640054 | import pytest
def test_ghdl():
import os
import shutil
from edalize_common import compare_files, setup_backend, tests_dir
ref_dir = os.path.join(tests_dir, __name__)
paramtypes = ['vlogparam']
name = 'test_ghdl'
tool = 'ghdl'
tool_options = {'analyze_options' : [... | true | true |
08fd8ed8daefe5b9433ec83f291168147b222a85 | 6,383 | py | Python | data_pre.py | shizhouxing/DialogueDiscourseParsing | c2f1c43dfb07b62decd8ab8bd05466f46167aed4 | [
"BSD-2-Clause"
] | 54 | 2019-01-15T14:44:16.000Z | 2022-03-24T07:39:04.000Z | data_pre.py | shizhouxing/DialogueDiscourseParsing | c2f1c43dfb07b62decd8ab8bd05466f46167aed4 | [
"BSD-2-Clause"
] | 12 | 2019-04-13T19:04:35.000Z | 2021-06-20T17:21:29.000Z | data_pre.py | shizhouxing/DialogueDiscourseParsing | c2f1c43dfb07b62decd8ab8bd05466f46167aed4 | [
"BSD-2-Clause"
] | 4 | 2020-10-07T13:15:49.000Z | 2022-02-21T05:45:29.000Z | import xmltodict, json, os, re, sys
import numpy as np
dialogues = []
def process_file(id, filename_prefix):
print(filename_prefix)
f_annotation = open("%s.aa" % filename_prefix)
annotations = xmltodict.parse(''.join(f_annotation.readlines()))["annotations"]
units = annotations["unit"]
if not... | 34.13369 | 87 | 0.525928 | import xmltodict, json, os, re, sys
import numpy as np
dialogues = []
def process_file(id, filename_prefix):
print(filename_prefix)
f_annotation = open("%s.aa" % filename_prefix)
annotations = xmltodict.parse(''.join(f_annotation.readlines()))["annotations"]
units = annotations["unit"]
if not... | true | true |
08fd91444b39e4112e16312c933da85f826cdde6 | 20,247 | py | Python | ecsclient/schemas.py | vgupta-mickey/python-ecsclient | 0888e61a08e1b1a569fcb6d0126357c7d5f978f1 | [
"Apache-2.0"
] | null | null | null | ecsclient/schemas.py | vgupta-mickey/python-ecsclient | 0888e61a08e1b1a569fcb6d0126357c7d5f978f1 | [
"Apache-2.0"
] | 3 | 2020-05-21T19:22:42.000Z | 2022-03-02T21:30:57.000Z | ecsclient/schemas.py | vgupta-mickey/python-ecsclient | 0888e61a08e1b1a569fcb6d0126357c7d5f978f1 | [
"Apache-2.0"
] | null | null | null | WHOAMI = {
"type": "object",
"properties": {
"namespace": {"type": "string"},
"last_time_password_changed": {
"type": "string",
"format": "date-time"
},
"distinguished_name": {"type": "string"},
"common_name": {"type": "string"},
"roles": {... | 23.543023 | 116 | 0.395515 | WHOAMI = {
"type": "object",
"properties": {
"namespace": {"type": "string"},
"last_time_password_changed": {
"type": "string",
"format": "date-time"
},
"distinguished_name": {"type": "string"},
"common_name": {"type": "string"},
"roles": {... | true | true |
08fd933cf76a8e7509053d9ca77e4895f9809329 | 342 | py | Python | Exercicios mundo 1/ex090.py | prc3333/Exercicios--de-Phyton- | a4b54af45f6bb3a89a205b570e1cf1164e505e29 | [
"MIT"
] | null | null | null | Exercicios mundo 1/ex090.py | prc3333/Exercicios--de-Phyton- | a4b54af45f6bb3a89a205b570e1cf1164e505e29 | [
"MIT"
] | null | null | null | Exercicios mundo 1/ex090.py | prc3333/Exercicios--de-Phyton- | a4b54af45f6bb3a89a205b570e1cf1164e505e29 | [
"MIT"
] | null | null | null | aluno = dict()
aluno['nome'] = str(input('nome: '))
aluno['media'] = float(input(f'Media de {aluno["nome"]}: '))
if aluno['media'] >= 7:
aluno['situação'] = 'Aprovado'
elif 5 <= aluno['media'] < 7:
aluno['situação'] = 'recuperação'
else:
aluno['situação'] = 'reprovado'
for k, v in aluno.items():
print(f... | 26.307692 | 60 | 0.581871 | aluno = dict()
aluno['nome'] = str(input('nome: '))
aluno['media'] = float(input(f'Media de {aluno["nome"]}: '))
if aluno['media'] >= 7:
aluno['situação'] = 'Aprovado'
elif 5 <= aluno['media'] < 7:
aluno['situação'] = 'recuperação'
else:
aluno['situação'] = 'reprovado'
for k, v in aluno.items():
print(f... | true | true |
08fd94187a77532d594f1803c185304529f5b7e3 | 1,201 | py | Python | test_system_preferences.py | JasonMFry/macprefs | 503b0083d38ae8678c305c0fc0ef833610b09812 | [
"MIT"
] | 1 | 2021-09-01T01:55:49.000Z | 2021-09-01T01:55:49.000Z | test_system_preferences.py | marcomc/macprefs | 503b0083d38ae8678c305c0fc0ef833610b09812 | [
"MIT"
] | null | null | null | test_system_preferences.py | marcomc/macprefs | 503b0083d38ae8678c305c0fc0ef833610b09812 | [
"MIT"
] | null | null | null | from os import path
from mock import patch
import system_preferences
from config import get_sys_preferences_backup_dir
@patch('system_preferences.copy_dir')
def test_backup(copy_dir_mock):
source = system_preferences.get_pm_path()
dest = system_preferences.get_pm_backup_path()
system_preferences.backup()
... | 31.605263 | 97 | 0.772689 | from os import path
from mock import patch
import system_preferences
from config import get_sys_preferences_backup_dir
@patch('system_preferences.copy_dir')
def test_backup(copy_dir_mock):
source = system_preferences.get_pm_path()
dest = system_preferences.get_pm_backup_path()
system_preferences.backup()
... | true | true |
08fd944434f304e4a2da3f25f1dbbb00b1719fdd | 1,350 | py | Python | meetings/urls.py | nicliuqi/app-meeting-server-1 | c99cf5fbe3e1c57932f33481310495aa541bb779 | [
"Apache-2.0"
] | null | null | null | meetings/urls.py | nicliuqi/app-meeting-server-1 | c99cf5fbe3e1c57932f33481310495aa541bb779 | [
"Apache-2.0"
] | null | null | null | meetings/urls.py | nicliuqi/app-meeting-server-1 | c99cf5fbe3e1c57932f33481310495aa541bb779 | [
"Apache-2.0"
] | null | null | null | from django.urls import path
from meetings.views import LoginView, GroupView, GroupsView, MeetingView, MeetingsView, UsersExcludeView, UserView, \
GroupUserAddView, MeetingDelView, MeetingsWeeklyView, MeetingsDailyView, \
UsersIncludeView, UserGroupView, MeetingsInGroupView, GroupUserDelView
urlpatterns = [
... | 58.695652 | 117 | 0.711111 | from django.urls import path
from meetings.views import LoginView, GroupView, GroupsView, MeetingView, MeetingsView, UsersExcludeView, UserView, \
GroupUserAddView, MeetingDelView, MeetingsWeeklyView, MeetingsDailyView, \
UsersIncludeView, UserGroupView, MeetingsInGroupView, GroupUserDelView
urlpatterns = [
... | true | true |
08fd945d58e4a230f5d8386226e65ce70467dc5f | 4,641 | py | Python | learn2learn/gym/envs/mujoco/ant_direction.py | Brikwerk/learn2learn | 7997c13c26ec627d13ce77ba98427260df78ada8 | [
"MIT"
] | 1,774 | 2019-09-05T20:41:16.000Z | 2022-03-30T09:49:02.000Z | learn2learn/gym/envs/mujoco/ant_direction.py | Kostis-S-Z/learn2learn | c0b7c088f15986880b136ec27059644ac513db60 | [
"MIT"
] | 196 | 2019-09-05T08:11:31.000Z | 2022-03-31T12:08:25.000Z | learn2learn/gym/envs/mujoco/ant_direction.py | Kostis-S-Z/learn2learn | c0b7c088f15986880b136ec27059644ac513db60 | [
"MIT"
] | 266 | 2019-09-13T10:17:54.000Z | 2022-03-28T07:17:21.000Z | #!/usr/bin/env python3
import gym
import numpy as np
from gym.error import DependencyNotInstalled
try:
from gym.envs.mujoco.mujoco_env import MujocoEnv
except DependencyNotInstalled:
from learn2learn.gym.envs.mujoco.dummy_mujoco_env import MujocoEnv
from learn2learn.gym.envs.meta_env import MetaEnv
class A... | 37.427419 | 114 | 0.628097 |
import gym
import numpy as np
from gym.error import DependencyNotInstalled
try:
from gym.envs.mujoco.mujoco_env import MujocoEnv
except DependencyNotInstalled:
from learn2learn.gym.envs.mujoco.dummy_mujoco_env import MujocoEnv
from learn2learn.gym.envs.meta_env import MetaEnv
class AntDirectionEnv(MetaEnv,... | true | true |
08fd94b81217d52183e111ecc6c85d6061dc34c0 | 10,461 | py | Python | recodex/plugins/exercises/cli.py | ReCodEx/cli | 8bc92c3bac2dc823a1c5f1a99ff2e252cc8578e6 | [
"MIT"
] | 4 | 2018-03-13T22:34:08.000Z | 2021-02-02T03:43:22.000Z | recodex/plugins/exercises/cli.py | ReCodEx/cli | 8bc92c3bac2dc823a1c5f1a99ff2e252cc8578e6 | [
"MIT"
] | 1 | 2019-03-20T16:23:55.000Z | 2019-03-20T21:15:18.000Z | recodex/plugins/exercises/cli.py | ReCodEx/cli | 8bc92c3bac2dc823a1c5f1a99ff2e252cc8578e6 | [
"MIT"
] | null | null | null | import json
from ruamel import yaml
import logging
import sys
import io
from datetime import datetime, timedelta
import click
from recodex.api import ApiClient
from recodex.decorators import pass_api_client
@click.group()
def cli():
"""
Tools for working with exercises
"""
@cli.command()
@click.option... | 32.287037 | 115 | 0.658828 | import json
from ruamel import yaml
import logging
import sys
import io
from datetime import datetime, timedelta
import click
from recodex.api import ApiClient
from recodex.decorators import pass_api_client
@click.group()
def cli():
@cli.command()
@click.option("--json/--yaml", "useJson", default=None)
@click.opt... | true | true |
08fd958a5ad0cfae8d31a9dce1c8493471655bb5 | 5,935 | py | Python | django/asset-registry/asset_registry/views.py | Group2-WSO2/Group2-WSO2-FinalProject | 2d20e90009ee06a499a9ff997244a2fda7944782 | [
"MIT"
] | 1 | 2022-03-19T11:18:46.000Z | 2022-03-19T11:18:46.000Z | django/asset-registry/asset_registry/views.py | Group2-WSO2/Group2-WSO2-FinalProject | 2d20e90009ee06a499a9ff997244a2fda7944782 | [
"MIT"
] | null | null | null | django/asset-registry/asset_registry/views.py | Group2-WSO2/Group2-WSO2-FinalProject | 2d20e90009ee06a499a9ff997244a2fda7944782 | [
"MIT"
] | null | null | null | # Create your views here.
from django.shortcuts import render, redirect
from django.db.models.query_utils import Q
from .forms import AssetForm, NewUserForm
from .models import Asset
from django.contrib.auth import login, authenticate, logout
from django.contrib import messages
from .utils import render_to_pdf
from dja... | 35.327381 | 128 | 0.702275 | from django.shortcuts import render, redirect
from django.db.models.query_utils import Q
from .forms import AssetForm, NewUserForm
from .models import Asset
from django.contrib.auth import login, authenticate, logout
from django.contrib import messages
from .utils import render_to_pdf
from django.contrib.auth.forms imp... | true | true |
08fd95d80822cc48134ea4086524daf768cf3604 | 7,636 | py | Python | ndac/predict.py | anotherjoshsmith/NovoNordisk_Capstone | a39adb2ae68f001bdf0e4b2200d7b8f923f27c2f | [
"MIT"
] | 1 | 2019-05-16T02:16:23.000Z | 2019-05-16T02:16:23.000Z | ndac/predict.py | anotherjoshsmith/NovoNordisk_Capstone | a39adb2ae68f001bdf0e4b2200d7b8f923f27c2f | [
"MIT"
] | 10 | 2020-01-28T22:23:44.000Z | 2022-02-09T23:39:01.000Z | ndac/predict.py | anotherjoshsmith/NovoNordisk_Capstone | a39adb2ae68f001bdf0e4b2200d7b8f923f27c2f | [
"MIT"
] | 2 | 2018-04-17T20:15:24.000Z | 2018-04-19T17:14:38.000Z | import numpy as np
import pandas as pd
from keras.models import Sequential
from keras.layers import Dense
from keras.layers import LSTM
from keras.layers import Flatten
from keras.layers import Dropout
from keras.layers.embeddings import Embedding
from keras.layers.convolutional import Conv1D
from keras.layers.convolu... | 36.018868 | 84 | 0.621661 | import numpy as np
import pandas as pd
from keras.models import Sequential
from keras.layers import Dense
from keras.layers import LSTM
from keras.layers import Flatten
from keras.layers import Dropout
from keras.layers.embeddings import Embedding
from keras.layers.convolutional import Conv1D
from keras.layers.convolu... | true | true |
08fd974540b902c1a9a406e1afeb064c368a3a0a | 6,676 | py | Python | tests/api/v1_2_10/test_task.py | wastorga/dnacentersdk | 1a25aaef2eaa016fe54ebebbd7448919e0effa3f | [
"MIT"
] | null | null | null | tests/api/v1_2_10/test_task.py | wastorga/dnacentersdk | 1a25aaef2eaa016fe54ebebbd7448919e0effa3f | [
"MIT"
] | null | null | null | tests/api/v1_2_10/test_task.py | wastorga/dnacentersdk | 1a25aaef2eaa016fe54ebebbd7448919e0effa3f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""DNACenterAPI task API fixtures and tests.
Copyright (c) 2019 Cisco and/or its affiliates.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including... | 25.38403 | 96 | 0.691432 | import pytest
from tests.environment import DNA_CENTER_VERSION
from tests.models.schema_validator import json_schema_validate
pytestmark = pytest.mark.skipif(DNA_CENTER_VERSION != '1.2.10', reason='version does not match')
def is_valid_get_task_count(obj):
json_schema_validate('jsd_26b44ab04649a183_v1_2_10').va... | true | true |
08fd97f988403bab85cb963489b24777d7cd37c0 | 29,103 | py | Python | src/nti/schema/tests/test_field.py | NextThought/nti.schema | a6defc2eee2853755df1384eea4e1f7caf9e0935 | [
"Apache-2.0"
] | null | null | null | src/nti/schema/tests/test_field.py | NextThought/nti.schema | a6defc2eee2853755df1384eea4e1f7caf9e0935 | [
"Apache-2.0"
] | 49 | 2016-07-29T12:49:11.000Z | 2021-05-08T11:14:55.000Z | src/nti/schema/tests/test_field.py | NextThought/nti.schema | a6defc2eee2853755df1384eea4e1f7caf9e0935 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Tests for field.py
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
# stdlib imports
import unittest
import warnings
from zope.component import eventtesting
from zope.interface.common import interfaces ... | 33.413318 | 98 | 0.647871 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import unittest
import warnings
from zope.component import eventtesting
from zope.interface.common import interfaces as cmn_interfaces
from zope.schema import Dict
from zope.schema.fieldproperty import Fiel... | true | true |
08fd993f66a44d8cbcda4dd450b789e421282dc7 | 8,266 | py | Python | openmoc/options.py | theshuo/OpenMOC | 4c8172e3d4427f9144f6a8a4b4ee4c0ce042eb64 | [
"MIT"
] | null | null | null | openmoc/options.py | theshuo/OpenMOC | 4c8172e3d4427f9144f6a8a4b4ee4c0ce042eb64 | [
"MIT"
] | null | null | null | openmoc/options.py | theshuo/OpenMOC | 4c8172e3d4427f9144f6a8a4b4ee4c0ce042eb64 | [
"MIT"
] | null | null | null | ##
# @file options.py
# @package openmoc.options
# @brief The options module provides the Options class to parse, interpret
# and encapsulate command line arguments for OpenMOC runtime options.
# @author William Boyd (wboyd@mit.edu)
# @date July 24, 2013
import getopt, sys
# For Python 2.X.X
if (sys.version_in... | 30.278388 | 77 | 0.608396 |
import getopt, sys
if (sys.version_info[0] == 2):
from log import *
else:
from openmoc.log import *
class Options:
def __init__(self):
self._num_azim = 4
self._track_spacing = 0.1
self._max_iters = 1000
self._tolerance = 1E-5
self._num_omp_threads = 1... | true | true |
08fd9998a042608fd8407db5af32cb2031fc455a | 440 | py | Python | python/pip_package/__init__.py | jkulhanek/lab | 2e1e959eb0ef2af65c315bf677ebb01ad319b6f2 | [
"CC-BY-4.0"
] | 1 | 2022-01-31T06:09:34.000Z | 2022-01-31T06:09:34.000Z | python/pip_package/__init__.py | jkulhanek/lab | 2e1e959eb0ef2af65c315bf677ebb01ad319b6f2 | [
"CC-BY-4.0"
] | null | null | null | python/pip_package/__init__.py | jkulhanek/lab | 2e1e959eb0ef2af65c315bf677ebb01ad319b6f2 | [
"CC-BY-4.0"
] | 2 | 2021-02-25T03:20:13.000Z | 2022-01-13T05:47:45.000Z | """Loads deepmind_lab.so."""
import imp
import pkg_resources
from dmhouse._dmhouse import DMHouseGoalEnv, DMHouseGoalNaturalEnv, generate_images # noqa: F401
imp.load_dynamic(__name__, pkg_resources.resource_filename(
__name__, 'deepmind_lab.so'))
import dmhouse
setattr(dmhouse, 'DMHouseGoalEnv', DMHouseGoalEnv... | 31.428571 | 97 | 0.818182 |
import imp
import pkg_resources
from dmhouse._dmhouse import DMHouseGoalEnv, DMHouseGoalNaturalEnv, generate_images
imp.load_dynamic(__name__, pkg_resources.resource_filename(
__name__, 'deepmind_lab.so'))
import dmhouse
setattr(dmhouse, 'DMHouseGoalEnv', DMHouseGoalEnv)
setattr(dmhouse, 'DMHouseGoalNaturalEnv'... | true | true |
08fd9a7df42952384c85b69fd05bc1bb1892271f | 3,639 | py | Python | example_scripts/arm_nn/yolov2.py | alexjones85/aXeleRate | 52437fc0b1d6cd9de2ccd6071f5fb489dc84e99d | [
"MIT"
] | null | null | null | example_scripts/arm_nn/yolov2.py | alexjones85/aXeleRate | 52437fc0b1d6cd9de2ccd6071f5fb489dc84e99d | [
"MIT"
] | null | null | null | example_scripts/arm_nn/yolov2.py | alexjones85/aXeleRate | 52437fc0b1d6cd9de2ccd6071f5fb489dc84e99d | [
"MIT"
] | null | null | null | # Copyright © 2020 Arm Ltd and Contributors. All rights reserved.
# SPDX-License-Identifier: MIT
"""
Contains functions specific to decoding and processing inference results for YOLO V3 Tiny models.
"""
import cv2
import numpy as np
from box import BoundBox, nms_boxes, boxes_to_array, to_minmax, draw_boxes
... | 36.39 | 102 | 0.57983 |
import cv2
import numpy as np
from box import BoundBox, nms_boxes, boxes_to_array, to_minmax, draw_boxes
def yolo_processing(netout):
anchors = [1.889, 2.5245, 2.9465, 3.94056, 3.99987, 5.3658, 5.155437, 6.92275, 6.718375, 9.01025]
nms_threshold=0.2
netout = netout[0].reshape(7,7,5,6)
gri... | true | true |
08fd9b47675527345eeba51048fecba94232d075 | 59 | py | Python | tests/conftest.py | Apkawa/django-rest-framework-jwt-oauth2 | e99ace46cb316c7e3ef80c74bc9b8a8f1d9cb702 | [
"MIT"
] | 1 | 2018-08-01T02:09:35.000Z | 2018-08-01T02:09:35.000Z | tests/conftest.py | Apkawa/django-rest-framework-jwt-oauth2 | e99ace46cb316c7e3ef80c74bc9b8a8f1d9cb702 | [
"MIT"
] | 2 | 2019-04-09T16:51:22.000Z | 2019-12-15T18:12:14.000Z | tests/conftest.py | Apkawa/django-rest-framework-jwt-oauth2 | e99ace46cb316c7e3ef80c74bc9b8a8f1d9cb702 | [
"MIT"
] | 1 | 2019-01-16T23:31:41.000Z | 2019-01-16T23:31:41.000Z | from rest_framework_jwt_oauth2.tests.api_fixtures import *
| 29.5 | 58 | 0.881356 | from rest_framework_jwt_oauth2.tests.api_fixtures import *
| true | true |
08fd9e0cf1c639c8e03174bc91d1d626e7e5c2dd | 4,709 | py | Python | test/fuzz/test_runner.py | TON-beta/TelegramOpenNetwork | cb773a5a792e4b97d77d643189edd35da52e1a79 | [
"MIT"
] | 15 | 2019-08-06T18:24:25.000Z | 2021-01-04T18:29:43.000Z | test/fuzz/test_runner.py | TON-beta/TelegramNetwork | cb773a5a792e4b97d77d643189edd35da52e1a79 | [
"MIT"
] | null | null | null | test/fuzz/test_runner.py | TON-beta/TelegramNetwork | cb773a5a792e4b97d77d643189edd35da52e1a79 | [
"MIT"
] | 6 | 2019-07-30T14:34:23.000Z | 2019-08-02T15:08:38.000Z | #!/usr/bin/env python3
# Copyright (c) 2019 The ton Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Run fuzz test targets.
"""
import argparse
import configparser
import os
import sys
import subprocess
import lo... | 33.397163 | 180 | 0.618603 |
import argparse
import configparser
import os
import sys
import subprocess
import logging
def main():
parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument(
"-l",
"--loglevel",
dest="loglevel",
default="INFO",
help... | true | true |
08fd9e230f30a988bdaf76592c2f9808ec8e4d64 | 6,701 | py | Python | applications/DamApplication/python_scripts/dam_UP_thermo_mechanic_solver.py | lcirrott/Kratos | 8406e73e0ad214c4f89df4e75e9b29d0eb4a47ea | [
"BSD-4-Clause"
] | 2 | 2019-10-25T09:28:10.000Z | 2019-11-21T12:51:46.000Z | applications/DamApplication/python_scripts/dam_UP_thermo_mechanic_solver.py | lcirrott/Kratos | 8406e73e0ad214c4f89df4e75e9b29d0eb4a47ea | [
"BSD-4-Clause"
] | 13 | 2019-10-07T12:06:51.000Z | 2020-02-18T08:48:33.000Z | applications/DamApplication/python_scripts/dam_UP_thermo_mechanic_solver.py | lcirrott/Kratos | 8406e73e0ad214c4f89df4e75e9b29d0eb4a47ea | [
"BSD-4-Clause"
] | null | null | null | from __future__ import print_function, absolute_import, division # makes KratosMultiphysics backward compatible with python 2.6 and 2.7
#import kratos core and applications
import KratosMultiphysics
import KratosMultiphysics.ConvectionDiffusionApplication as KratosConvDiff
import KratosMultiphysics.SolidMechanicsApplic... | 42.411392 | 148 | 0.613192 | from __future__ import print_function, absolute_import, division import KratosMultiphysics
import KratosMultiphysics.ConvectionDiffusionApplication as KratosConvDiff
import KratosMultiphysics.SolidMechanicsApplication as KratosSolid
import KratosMultiphysics.PoromechanicsApplication as KratosPoro
import KratosMultiphys... | true | true |
08fd9e2b2e61bf677dabaa34d3da8c811ca3da4e | 18,656 | py | Python | cifar/soft-filter-pruning/pruning_cifar10_pretrain.py | fangyuchu/rethinking-network-pruning | 3d3726e1277b5d9bd12b2b26d3c9bf1730709a42 | [
"MIT"
] | null | null | null | cifar/soft-filter-pruning/pruning_cifar10_pretrain.py | fangyuchu/rethinking-network-pruning | 3d3726e1277b5d9bd12b2b26d3c9bf1730709a42 | [
"MIT"
] | null | null | null | cifar/soft-filter-pruning/pruning_cifar10_pretrain.py | fangyuchu/rethinking-network-pruning | 3d3726e1277b5d9bd12b2b26d3c9bf1730709a42 | [
"MIT"
] | null | null | null | from __future__ import division
import os, sys, shutil, time, random
import argparse
import torch
import torch.backends.cudnn as cudnn
import torchvision.datasets as dset
import torchvision.transforms as transforms
from utils import AverageMeter, RecorderMeter, time_string, convert_secs2time
import models
import numpy... | 43.285383 | 172 | 0.632504 | from __future__ import division
import os, sys, shutil, time, random
import argparse
import torch
import torch.backends.cudnn as cudnn
import torchvision.datasets as dset
import torchvision.transforms as transforms
from utils import AverageMeter, RecorderMeter, time_string, convert_secs2time
import models
import numpy... | true | true |
08fd9e72abe2320f69b07ee542e54a7ee3f63e92 | 56,399 | py | Python | samples/openapi3/client/petstore/python-experimental/petstore_api/model_utils.py | adg-mh/openapi-generator | 4488db60b3e752c42e21c3392948091dc9e51fa8 | [
"Apache-2.0"
] | null | null | null | samples/openapi3/client/petstore/python-experimental/petstore_api/model_utils.py | adg-mh/openapi-generator | 4488db60b3e752c42e21c3392948091dc9e51fa8 | [
"Apache-2.0"
] | null | null | null | samples/openapi3/client/petstore/python-experimental/petstore_api/model_utils.py | adg-mh/openapi-generator | 4488db60b3e752c42e21c3392948091dc9e51fa8 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
OpenAPI Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
... | 37.202507 | 174 | 0.617405 |
from datetime import date, datetime import inspect
import os
import pprint
import re
import tempfile
from dateutil.parser import parse
import six
from petstore_api.exceptions import (
ApiKeyError,
ApiAttributeError,
ApiTypeError,
ApiValueError,
)
none_type = type(None)
if six.PY3:
import io
... | true | true |
08fd9ebb39e9e9b0a338bb0b98e76183b52363ec | 22,185 | py | Python | lib/galaxy/tools/test.py | hidelab/galaxy-central-hpc | 75539db90abe90377db95718f83cafa7cfa43301 | [
"CC-BY-3.0"
] | null | null | null | lib/galaxy/tools/test.py | hidelab/galaxy-central-hpc | 75539db90abe90377db95718f83cafa7cfa43301 | [
"CC-BY-3.0"
] | null | null | null | lib/galaxy/tools/test.py | hidelab/galaxy-central-hpc | 75539db90abe90377db95718f83cafa7cfa43301 | [
"CC-BY-3.0"
] | null | null | null | import os
import os.path
import uuid
from parameters import basic
from parameters import grouping
from galaxy.util import string_as_bool
try:
from nose.tools import nottest
except ImportError:
nottest = lambda x: x
import logging
log = logging.getLogger( __name__ )
DEFAULT_FTYPE = 'auto'
DEFAULT_DBKEY = 'hg17... | 42.581574 | 169 | 0.615281 | import os
import os.path
import uuid
from parameters import basic
from parameters import grouping
from galaxy.util import string_as_bool
try:
from nose.tools import nottest
except ImportError:
nottest = lambda x: x
import logging
log = logging.getLogger( __name__ )
DEFAULT_FTYPE = 'auto'
DEFAULT_DBKEY = 'hg17... | false | true |
08fd9eddadf0f6d204d35e4a6bf6a6aa9d4b717d | 2,202 | py | Python | pgnumbra/PGPoolAccProvider.py | The-Real-Ketchum-Dev/PGNumbra | bc37703abdca75691024c71590d139d6bd471b3b | [
"Apache-2.0"
] | 4 | 2018-01-18T18:27:29.000Z | 2018-03-20T22:49:23.000Z | pgnumbra/PGPoolAccProvider.py | The-Real-Ketchum-Dev/PGNumbra | bc37703abdca75691024c71590d139d6bd471b3b | [
"Apache-2.0"
] | 1 | 2018-01-21T23:22:33.000Z | 2018-01-21T23:22:33.000Z | pgnumbra/PGPoolAccProvider.py | SenorKarlos/PGNumbra | bc37703abdca75691024c71590d139d6bd471b3b | [
"Apache-2.0"
] | 11 | 2018-01-19T06:41:48.000Z | 2018-03-20T19:40:39.000Z | import json
import threading
import logging
import requests
from pgnumbra.AccProvider import AccProvider
from pgnumbra.config import cfg_get
from pgnumbra.utils import pgpool_load_accounts
log = logging.getLogger(__name__)
class PGPoolAccProvider(AccProvider):
def __init__(self):
self.num_provided = ... | 31.913043 | 119 | 0.537239 | import json
import threading
import logging
import requests
from pgnumbra.AccProvider import AccProvider
from pgnumbra.config import cfg_get
from pgnumbra.utils import pgpool_load_accounts
log = logging.getLogger(__name__)
class PGPoolAccProvider(AccProvider):
def __init__(self):
self.num_provided = ... | true | true |
08fd9f7ab3c71344e11589cee3c694ec396fef54 | 4,130 | py | Python | constraint_generation/python/spice_parse/netlist.py | rbarzic/MAGICAL | 0510550b263913f8c62f46662a9dfa2ae94d2386 | [
"BSD-3-Clause"
] | null | null | null | constraint_generation/python/spice_parse/netlist.py | rbarzic/MAGICAL | 0510550b263913f8c62f46662a9dfa2ae94d2386 | [
"BSD-3-Clause"
] | null | null | null | constraint_generation/python/spice_parse/netlist.py | rbarzic/MAGICAL | 0510550b263913f8c62f46662a9dfa2ae94d2386 | [
"BSD-3-Clause"
] | null | null | null | class netlist_element():
def __init__(self,typeof):
self.typeof = typeof
self.parent = False
def __str__(self):
return(self.typeof)
class subcircuit(netlist_element):
def __init__(self, name, nets, instances):
self.name = name;
self.labels = {}
self.power_net... | 31.769231 | 167 | 0.575787 | class netlist_element():
def __init__(self,typeof):
self.typeof = typeof
self.parent = False
def __str__(self):
return(self.typeof)
class subcircuit(netlist_element):
def __init__(self, name, nets, instances):
self.name = name;
self.labels = {}
self.power_net... | true | true |
08fd9f8c695cf37943cf323140d0bce87dfa0353 | 712 | py | Python | clothes/migrations/0010_shop.py | daikikuchi/Personal-closet | 88cb67a2f9c1ff3e572ec22f4d217449f1c4c816 | [
"MIT"
] | null | null | null | clothes/migrations/0010_shop.py | daikikuchi/Personal-closet | 88cb67a2f9c1ff3e572ec22f4d217449f1c4c816 | [
"MIT"
] | 3 | 2021-03-30T13:12:42.000Z | 2021-04-13T00:45:25.000Z | clothes/migrations/0010_shop.py | daikikuchi/Personal-closet | 88cb67a2f9c1ff3e572ec22f4d217449f1c4c816 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.7 on 2021-04-05 04:50
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('clothes', '0009_subcategory'),
]
operations = [
migrations.CreateModel(
name='Shop',
fields=[
('id',... | 27.384615 | 114 | 0.533708 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('clothes', '0009_subcategory'),
]
operations = [
migrations.CreateModel(
name='Shop',
fields=[
('id', models.AutoField(auto_created=True, primary_key... | true | true |
08fda00344f3f730d6c3b1cd638bfb5858b9ff85 | 747 | py | Python | mindinsight/datavisual/common/__init__.py | fapbatista/mindinsight | db5769eb80cbd13a2a9af7682c11f5667d8bf141 | [
"Apache-2.0"
] | 216 | 2020-03-28T02:11:56.000Z | 2022-03-31T06:20:09.000Z | mindinsight/datavisual/common/__init__.py | fapbatista/mindinsight | db5769eb80cbd13a2a9af7682c11f5667d8bf141 | [
"Apache-2.0"
] | 13 | 2020-03-31T03:00:12.000Z | 2021-01-03T13:01:06.000Z | mindinsight/datavisual/common/__init__.py | fapbatista/mindinsight | db5769eb80cbd13a2a9af7682c11f5667d8bf141 | [
"Apache-2.0"
] | 21 | 2020-03-28T02:41:06.000Z | 2021-11-24T12:20:25.000Z | # Copyright 2019 Huawei Technologies Co., Ltd
#
# 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... | 46.6875 | 79 | 0.686747 | true | true | |
08fda04a25f210864354b6aabc3d36290a6af22f | 2,706 | py | Python | Firmware/Raspberry Pi/connectArduino.py | plertvilai/IPAX | 700646daedbb67d554cc94b78a58eda275a54802 | [
"MIT"
] | 3 | 2020-05-07T20:58:33.000Z | 2022-01-13T04:04:37.000Z | Firmware/Raspberry Pi/connectArduino.py | plertvilai/IPAX | 700646daedbb67d554cc94b78a58eda275a54802 | [
"MIT"
] | 3 | 2021-03-10T14:45:36.000Z | 2021-09-02T09:49:44.000Z | Firmware/Raspberry Pi/connectArduino.py | plertvilai/IPAX | 700646daedbb67d554cc94b78a58eda275a54802 | [
"MIT"
] | 2 | 2020-04-21T00:12:51.000Z | 2022-01-13T04:04:57.000Z | #!/usr/bin/env python
import serial
import time
import RPi.GPIO as GPIO
import subprocess
led_pin = 21 #LED indicator pin for pressure status
hall_pin = 11
GPIO.setmode(GPIO.BCM)
GPIO.setup(led_pin, GPIO.OUT)
GPIO.output(led_pin, GPIO.HIGH) #default is ON
GPIO.setup(hall_pin, GPIO.IN)
ser = serial.Serial('/dev/ttyAM... | 28.787234 | 96 | 0.725425 |
import serial
import time
import RPi.GPIO as GPIO
import subprocess
led_pin = 21 hall_pin = 11
GPIO.setmode(GPIO.BCM)
GPIO.setup(led_pin, GPIO.OUT)
GPIO.output(led_pin, GPIO.HIGH) GPIO.setup(hall_pin, GPIO.IN)
ser = serial.Serial('/dev/ttyAMA0',9600)
ser.reset_input_buffer()
read_serial=ser.readline()
time.sleep(... | true | true |
08fda05b0c4d330d8b5331de69564212954db0f3 | 2,347 | py | Python | shared/directorutil/ssl_context.py | darius-kia/director4 | 1d2c2c4c3ec12cc9b7f846d5dc075ea3bbef36f9 | [
"MIT"
] | 7 | 2020-08-23T23:08:34.000Z | 2021-12-02T04:17:37.000Z | shared/directorutil/ssl_context.py | darius-kia/director4 | 1d2c2c4c3ec12cc9b7f846d5dc075ea3bbef36f9 | [
"MIT"
] | 43 | 2020-08-24T16:48:29.000Z | 2022-03-02T19:45:54.000Z | shared/directorutil/ssl_context.py | darius-kia/director4 | 1d2c2c4c3ec12cc9b7f846d5dc075ea3bbef36f9 | [
"MIT"
] | 10 | 2020-08-17T20:42:52.000Z | 2021-07-16T03:46:51.000Z | # SPDX-License-Identifier: MIT
# (c) 2019 The TJHSST Director 4.0 Development Team & Contributors
import ssl
from typing import TYPE_CHECKING, Any, Dict, Optional
def create_internal_client_ssl_context(
ssl_settings: Optional[Dict[str, Any]],
) -> Optional[ssl.SSLContext]:
"""Create an SSL context based on t... | 37.253968 | 96 | 0.674478 |
import ssl
from typing import TYPE_CHECKING, Any, Dict, Optional
def create_internal_client_ssl_context(
ssl_settings: Optional[Dict[str, Any]],
) -> Optional[ssl.SSLContext]:
if ssl_settings is None:
return None
context = ssl.create_default_context(
purpose=ssl.Purpose.SERVER_AUTH,
... | true | true |
08fda279f17820072193b405d3693ed81ba48188 | 1,321 | py | Python | onnx_tf/common/data_type.py | devenxu1985/onnx-tensorflow | 4fe611422ad3236973c498c5bff51fdd55657a4e | [
"Apache-2.0"
] | 1 | 2018-10-16T08:38:37.000Z | 2018-10-16T08:38:37.000Z | onnx_tf/common/data_type.py | devenxu1985/onnx-tensorflow | 4fe611422ad3236973c498c5bff51fdd55657a4e | [
"Apache-2.0"
] | null | null | null | onnx_tf/common/data_type.py | devenxu1985/onnx-tensorflow | 4fe611422ad3236973c498c5bff51fdd55657a4e | [
"Apache-2.0"
] | null | null | null | from numbers import Number
import numpy as np
from onnx import mapping
from onnx import TensorProto
import tensorflow as tf
def tf2onnx(dtype):
if isinstance(dtype, Number):
tf_dype = tf.as_dtype(dtype)
elif isinstance(dtype, tf.DType):
tf_dype = dtype
elif isinstance(dtype, list):
return [tf2onnx(... | 28.106383 | 73 | 0.747918 | from numbers import Number
import numpy as np
from onnx import mapping
from onnx import TensorProto
import tensorflow as tf
def tf2onnx(dtype):
if isinstance(dtype, Number):
tf_dype = tf.as_dtype(dtype)
elif isinstance(dtype, tf.DType):
tf_dype = dtype
elif isinstance(dtype, list):
return [tf2onnx(... | true | true |
08fda3d2dcf18f41a2c4340a5106a75d75041add | 2,297 | py | Python | app/process/log.py | HansBug/dgdvapp | f3142d2c265afda427bbeee46c8073e1126eeef5 | [
"Apache-2.0"
] | null | null | null | app/process/log.py | HansBug/dgdvapp | f3142d2c265afda427bbeee46c8073e1126eeef5 | [
"Apache-2.0"
] | null | null | null | app/process/log.py | HansBug/dgdvapp | f3142d2c265afda427bbeee46c8073e1126eeef5 | [
"Apache-2.0"
] | null | null | null | import os
from operator import itemgetter
from typing import Tuple, Iterator
import numpy as np
import pandas as pd
from .exp_center import find_expdata_in_directory, exp_center_file_in_directory, exp_center_trans
from .simudata import find_simudata_in_directory, simudata_file_in_directory, simudata_trans
def is_lo... | 31.902778 | 97 | 0.680017 | import os
from operator import itemgetter
from typing import Tuple, Iterator
import numpy as np
import pandas as pd
from .exp_center import find_expdata_in_directory, exp_center_file_in_directory, exp_center_trans
from .simudata import find_simudata_in_directory, simudata_file_in_directory, simudata_trans
def is_lo... | true | true |
08fda43707e1d524f0ca09dba43c5536099be662 | 12,300 | py | Python | neural_structured_learning/tools/pack_nbrs.py | aspratyush/neural-structured-learning | 320918ca97763b8bb2ce7b1aa2073266c164b982 | [
"Apache-2.0"
] | 1 | 2020-09-23T03:43:32.000Z | 2020-09-23T03:43:32.000Z | neural_structured_learning/tools/pack_nbrs.py | awesomemachinelearning/neural-structured-learning | 6cb6b22174ba5f5d6b621443eb2b147831be320d | [
"Apache-2.0"
] | null | null | null | neural_structured_learning/tools/pack_nbrs.py | awesomemachinelearning/neural-structured-learning | 6cb6b22174ba5f5d6b621443eb2b147831be320d | [
"Apache-2.0"
] | 1 | 2019-10-04T05:17:37.000Z | 2019-10-04T05:17:37.000Z | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 43.006993 | 80 | 0.728211 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import time
from absl import app
from absl import flags
from absl import logging
from neural_structured_learning.tools import graph_utils
import six
import tensorflow as tf
def _read_tfr... | true | true |
08fda4840bb3a400ddd4698acf5e584523dcf13f | 216 | py | Python | problem_solving/warmup/07-staircase.py | xurvan/hackerrank | 55bc983e0bb81583c11ff275e1400078c3d13b33 | [
"Apache-2.0"
] | null | null | null | problem_solving/warmup/07-staircase.py | xurvan/hackerrank | 55bc983e0bb81583c11ff275e1400078c3d13b33 | [
"Apache-2.0"
] | null | null | null | problem_solving/warmup/07-staircase.py | xurvan/hackerrank | 55bc983e0bb81583c11ff275e1400078c3d13b33 | [
"Apache-2.0"
] | null | null | null | #!/bin/python3
def staircase(n):
for i in range(n):
pad = n - 1 - i
print(' ' * pad + '#' * (i + 1))
def main():
n = int(input())
staircase(n)
if __name__ == '__main__':
main()
| 12 | 40 | 0.458333 |
def staircase(n):
for i in range(n):
pad = n - 1 - i
print(' ' * pad + '#' * (i + 1))
def main():
n = int(input())
staircase(n)
if __name__ == '__main__':
main()
| true | true |
08fda4faa6c5e3d12535138878feda503ff582b5 | 1,479 | py | Python | allennlp_models/lm/modules/language_model_heads/gpt2.py | shunk031/allennlp-models | d37c5fadeef9326808a84dda0bcfd210a078d6b1 | [
"Apache-2.0"
] | 1 | 2022-02-10T22:19:55.000Z | 2022-02-10T22:19:55.000Z | allennlp_models/lm/modules/language_model_heads/gpt2.py | staceywhitmore-inl/allennlp-models | 1e89d5e51cb45f3e77a48d4983bf980088334fac | [
"Apache-2.0"
] | null | null | null | allennlp_models/lm/modules/language_model_heads/gpt2.py | staceywhitmore-inl/allennlp-models | 1e89d5e51cb45f3e77a48d4983bf980088334fac | [
"Apache-2.0"
] | null | null | null | from transformers.models.gpt2.modeling_gpt2 import GPT2Config, GPT2LMHeadModel
import torch
from .language_model_head import LanguageModelHead
@LanguageModelHead.register("gpt2")
class Gpt2LanguageModelHead(LanguageModelHead):
"""
Loads just the LM head from `transformers.GPT2LMHeadModel`. It was easiest to... | 41.083333 | 99 | 0.717377 | from transformers.models.gpt2.modeling_gpt2 import GPT2Config, GPT2LMHeadModel
import torch
from .language_model_head import LanguageModelHead
@LanguageModelHead.register("gpt2")
class Gpt2LanguageModelHead(LanguageModelHead):
def __init__(self, model_name: str) -> None:
super().__init__()
confi... | true | true |
08fda6245f3d5372da3e0f9d8d3a624858ada619 | 2,789 | py | Python | core/domain/translation_services.py | nbaddam/oppia | e58b81e57007f25537ba8ed71b42bfd9ae661799 | [
"Apache-2.0"
] | 5,422 | 2015-08-14T01:56:44.000Z | 2022-03-31T23:31:56.000Z | core/domain/translation_services.py | nbaddam/oppia | e58b81e57007f25537ba8ed71b42bfd9ae661799 | [
"Apache-2.0"
] | 14,178 | 2015-08-14T05:21:45.000Z | 2022-03-31T23:54:10.000Z | core/domain/translation_services.py | nbaddam/oppia | e58b81e57007f25537ba8ed71b42bfd9ae661799 | [
"Apache-2.0"
] | 3,574 | 2015-08-14T04:20:06.000Z | 2022-03-29T01:52:37.000Z | # coding: utf-8
#
# Copyright 2021 The Oppia 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 requi... | 36.220779 | 79 | 0.735748 |
from __future__ import annotations
import logging
from core.domain import translation_fetchers
from core.platform import models
translate_services = models.Registry.import_translate_services()
(translation_models,) = models.Registry.import_models([
models.NAMES.translation])
def get_and_cache_machine_transl... | true | true |
08fda6e5f2b73c386d242b292ac739deeae22830 | 736 | py | Python | daal4py/__init__.py | amgrigoriev/daal4py | 97fbe7a9181410dac348dc724178e8605492e3c4 | [
"Apache-2.0"
] | null | null | null | daal4py/__init__.py | amgrigoriev/daal4py | 97fbe7a9181410dac348dc724178e8605492e3c4 | [
"Apache-2.0"
] | null | null | null | daal4py/__init__.py | amgrigoriev/daal4py | 97fbe7a9181410dac348dc724178e8605492e3c4 | [
"Apache-2.0"
] | null | null | null | try:
from _daal4py import *
from _daal4py import __version__, __daal_link_version__, __daal_run_version__, __has_dist__
except ImportError as e:
s = str(e)
if 'libfabric' in s:
raise ImportError(s + '\n\nActivating your conda environment or sourcing mpivars.[c]sh/psxevars.[c]sh may solve the iss... | 35.047619 | 134 | 0.682065 | try:
from _daal4py import *
from _daal4py import __version__, __daal_link_version__, __daal_run_version__, __has_dist__
except ImportError as e:
s = str(e)
if 'libfabric' in s:
raise ImportError(s + '\n\nActivating your conda environment or sourcing mpivars.[c]sh/psxevars.[c]sh may solve the iss... | true | true |
08fda75035cde71ab101c4537321443b7df1e8f4 | 519 | py | Python | output/models/nist_data/list_pkg/g_day/schema_instance/nistschema_sv_iv_list_g_day_max_length_3_xsd/nistschema_sv_iv_list_g_day_max_length_3.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 1 | 2021-08-14T17:59:21.000Z | 2021-08-14T17:59:21.000Z | output/models/nist_data/list_pkg/g_day/schema_instance/nistschema_sv_iv_list_g_day_max_length_3_xsd/nistschema_sv_iv_list_g_day_max_length_3.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 4 | 2020-02-12T21:30:44.000Z | 2020-04-15T20:06:46.000Z | output/models/nist_data/list_pkg/g_day/schema_instance/nistschema_sv_iv_list_g_day_max_length_3_xsd/nistschema_sv_iv_list_g_day_max_length_3.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | null | null | null | from dataclasses import dataclass, field
from typing import List
from xsdata.models.datatype import XmlPeriod
__NAMESPACE__ = "NISTSchema-SV-IV-list-gDay-maxLength-3-NS"
@dataclass
class NistschemaSvIvListGDayMaxLength3:
class Meta:
name = "NISTSchema-SV-IV-list-gDay-maxLength-3"
namespace = "NIS... | 24.714286 | 63 | 0.666667 | from dataclasses import dataclass, field
from typing import List
from xsdata.models.datatype import XmlPeriod
__NAMESPACE__ = "NISTSchema-SV-IV-list-gDay-maxLength-3-NS"
@dataclass
class NistschemaSvIvListGDayMaxLength3:
class Meta:
name = "NISTSchema-SV-IV-list-gDay-maxLength-3"
namespace = "NIS... | true | true |
08fda7bb3418011f3177a984a6d16adac18f8212 | 11,014 | py | Python | plugins/modules/oci_database_backup_destination_facts.py | hanielburton/oci-ansible-collection | dfdffde637f746d346ba35569be8c3a3407022f2 | [
"Apache-2.0"
] | null | null | null | plugins/modules/oci_database_backup_destination_facts.py | hanielburton/oci-ansible-collection | dfdffde637f746d346ba35569be8c3a3407022f2 | [
"Apache-2.0"
] | null | null | null | plugins/modules/oci_database_backup_destination_facts.py | hanielburton/oci-ansible-collection | dfdffde637f746d346ba35569be8c3a3407022f2 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# Copyright (c) 2017, 2021 Oracle and/or its affiliates.
# This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Apache License v2.0
# See LICENSE.TXT for d... | 36.349835 | 154 | 0.632468 |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {
"metadata_version": "1.1",
"status": ["preview"],
"supported_by": "community",
}
DOCUMENTATION = """
---
module: oci_database_backup_destination_facts
short_description: Fetches details about one ... | true | true |
08fda8997f5cc648d34273e622059f0dbe37116d | 14,982 | py | Python | gui/qt/installwizard.py | Andymeows/electrum-doge | e5e8c8e3e301cccb53de58445445e9e7fd0e9665 | [
"MIT"
] | 1 | 2017-02-21T17:52:54.000Z | 2017-02-21T17:52:54.000Z | gui/qt/installwizard.py | Andymeows/electrum-doge | e5e8c8e3e301cccb53de58445445e9e7fd0e9665 | [
"MIT"
] | null | null | null | gui/qt/installwizard.py | Andymeows/electrum-doge | e5e8c8e3e301cccb53de58445445e9e7fd0e9665 | [
"MIT"
] | null | null | null | import sys
from PyQt4.QtGui import *
from PyQt4.QtCore import *
import PyQt4.QtCore as QtCore
import electrum_ltc as electrum
from electrum_ltc.i18n import _
from seed_dialog import SeedDisplayLayout, SeedWarningLayout, SeedInputLayout
from network_dialog import NetworkChoiceLayout
from util import *
from password_d... | 38.122137 | 80 | 0.622681 | import sys
from PyQt4.QtGui import *
from PyQt4.QtCore import *
import PyQt4.QtCore as QtCore
import electrum_ltc as electrum
from electrum_ltc.i18n import _
from seed_dialog import SeedDisplayLayout, SeedWarningLayout, SeedInputLayout
from network_dialog import NetworkChoiceLayout
from util import *
from password_d... | true | true |
08fda9629fb6300653bb32ec9e540a1ccc0f1de4 | 1,462 | py | Python | pymc3/vartypes.py | cowirihy/pymc3 | f0b95773047af12f3c0ded04d707f02ddc4d4f6b | [
"Apache-2.0"
] | null | null | null | pymc3/vartypes.py | cowirihy/pymc3 | f0b95773047af12f3c0ded04d707f02ddc4d4f6b | [
"Apache-2.0"
] | null | null | null | pymc3/vartypes.py | cowirihy/pymc3 | f0b95773047af12f3c0ded04d707f02ddc4d4f6b | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 The PyMC Developers
#
# 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 ag... | 27.074074 | 76 | 0.712038 |
from theano.tensor import Constant as tensor_constant
from theano.gof.graph import Constant as graph_constant
__all__ = [
"bool_types",
"int_types",
"float_types",
"complex_types",
"continuous_types",
"discrete_types",
"typefilter",
"isgenerator",
"theano_constant",
]
bool_types ... | true | true |
08fda96446f3e3e9d13fd6ffcf851d1bd68497b5 | 5,832 | py | Python | tests/test_build_gettext.py | ravwojdyla/sphinx | a7e10c1d36007650b5e3948021d4aa90d78127d4 | [
"BSD-2-Clause"
] | 8 | 2021-01-29T23:28:16.000Z | 2021-06-04T07:12:32.000Z | tests/test_build_gettext.py | ravwojdyla/sphinx | a7e10c1d36007650b5e3948021d4aa90d78127d4 | [
"BSD-2-Clause"
] | null | null | null | tests/test_build_gettext.py | ravwojdyla/sphinx | a7e10c1d36007650b5e3948021d4aa90d78127d4 | [
"BSD-2-Clause"
] | 2 | 2019-11-03T19:02:59.000Z | 2021-03-05T12:10:47.000Z | """
test_build_gettext
~~~~~~~~~~~~~~~~~~
Test the build process with gettext builder with the test root.
:copyright: Copyright 2007-2020 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import gettext
import os
import re
import subprocess
from subprocess import PIPE, ... | 29.907692 | 90 | 0.613683 |
import gettext
import os
import re
import subprocess
from subprocess import PIPE, CalledProcessError
import pytest
from sphinx.util.osutil import cd
@pytest.mark.sphinx('gettext', srcdir='root-gettext')
def test_build_gettext(app):
app.builder.build_all()
assert (app.outdir / 'extapi.pot').isf... | true | true |
08fda9be0699c1e139b0d29fba2a39ba4674f76c | 2,558 | py | Python | pbgpp/BGP/Update/PathAttributes/Communities.py | antoine-blin/pbgp-parser | 592e26a9066e64cc11ec4812c050fcf5eeab2c3f | [
"Apache-2.0"
] | 73 | 2016-10-27T10:12:42.000Z | 2020-10-08T09:17:40.000Z | pbgpp/BGP/Update/PathAttributes/Communities.py | antoine-blin/pbgp-parser | 592e26a9066e64cc11ec4812c050fcf5eeab2c3f | [
"Apache-2.0"
] | 26 | 2016-10-29T12:26:27.000Z | 2020-10-26T09:27:43.000Z | pbgpp/BGP/Update/PathAttributes/Communities.py | antoine-blin/pbgp-parser | 592e26a9066e64cc11ec4812c050fcf5eeab2c3f | [
"Apache-2.0"
] | 18 | 2016-10-27T10:12:20.000Z | 2020-07-27T09:11:07.000Z | #
# This file is part of PCAP BGP Parser (pbgpp)
#
# Copyright 2016-2017 DE-CIX Management GmbH
# Author: Tobias Hannaske <tobias.hannaske@de-cix.net>
#
# 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 Lic... | 30.094118 | 108 | 0.636435 |
import struct
from pbgpp.BGP.Statics import BGPStatics
from pbgpp.BGP.Translation import BGPTranslation
from pbgpp.BGP.Update.Community import BGPUpdateCommunity
from pbgpp.BGP.Update.PathAttribute import BGPPathAttribute
class PathAttributeCommunities(BGPPathAttribute):
def __init__(self, payload):
BGP... | true | true |
08fda9de4c3bd24eb7ef10e66f59d3f42ce8264b | 30,058 | py | Python | openaerostruct/examples/run_aerostruct_uCRM_multipoint.py | carlosferpereira/OpenAeroStruct | 35e1ff8aac5c67e40b1925829cfbc203ba1b2f2d | [
"Apache-2.0"
] | null | null | null | openaerostruct/examples/run_aerostruct_uCRM_multipoint.py | carlosferpereira/OpenAeroStruct | 35e1ff8aac5c67e40b1925829cfbc203ba1b2f2d | [
"Apache-2.0"
] | null | null | null | openaerostruct/examples/run_aerostruct_uCRM_multipoint.py | carlosferpereira/OpenAeroStruct | 35e1ff8aac5c67e40b1925829cfbc203ba1b2f2d | [
"Apache-2.0"
] | 1 | 2021-04-09T16:45:27.000Z | 2021-04-09T16:45:27.000Z | """
This script can be used to reproduce the multipoint aerostructural optimization
cases in the 'Low-fidelity aerostructural optimization of aircraft wings with
a simplified wingbox model using OpenAeroStruct' conference paper by Chauhan
and Martins.
The fuel burn from the cruise case is the objective function and the... | 51.824138 | 497 | 0.627387 |
import numpy as np
from openaerostruct.geometry.utils import generate_mesh
from openaerostruct.integration.aerostruct_groups import AerostructGeometry, AerostructPoint
import openmdao.api as om
from openaerostruct.structures.wingbox_fuel_vol_delta import WingboxFuelVolDelta
from openaerostruct.utils.constants import... | true | true |
08fdaa02a37dced277f2d864da1c235dc269fbd3 | 218 | py | Python | src/introductoryproblems/tests/test_two_sets.py | seahrh/cses-problem-set-python | 53e8dba200893cc13a0f7b66fc18e55fa0af137a | [
"MIT"
] | null | null | null | src/introductoryproblems/tests/test_two_sets.py | seahrh/cses-problem-set-python | 53e8dba200893cc13a0f7b66fc18e55fa0af137a | [
"MIT"
] | null | null | null | src/introductoryproblems/tests/test_two_sets.py | seahrh/cses-problem-set-python | 53e8dba200893cc13a0f7b66fc18e55fa0af137a | [
"MIT"
] | null | null | null | from introductoryproblems.two_sets import *
class TestTwoSets:
def test_case_1(self):
assert solve(7) == ([7, 6, 1], [5, 4, 3, 2])
def test_case_2(self):
assert solve(6) == ([], [])
| 21.8 | 53 | 0.555046 | from introductoryproblems.two_sets import *
class TestTwoSets:
def test_case_1(self):
assert solve(7) == ([7, 6, 1], [5, 4, 3, 2])
def test_case_2(self):
assert solve(6) == ([], [])
| true | true |
08fdaa930383ecbd53e6b828bd9524ca12800261 | 6,292 | py | Python | tests/unit/physics/GenericPhysicsTest.py | halotudio/openPNM-copy2 | d400ec65e9421256a531f6d22a38255b002d5dcb | [
"MIT"
] | 1 | 2021-05-01T11:10:43.000Z | 2021-05-01T11:10:43.000Z | tests/unit/physics/GenericPhysicsTest.py | halotudio/openPNM-copy2 | d400ec65e9421256a531f6d22a38255b002d5dcb | [
"MIT"
] | null | null | null | tests/unit/physics/GenericPhysicsTest.py | halotudio/openPNM-copy2 | d400ec65e9421256a531f6d22a38255b002d5dcb | [
"MIT"
] | null | null | null | import openpnm as op
import pytest
class GenericPhysicsTest:
def setup_class(self):
self.net = op.network.Cubic(shape=[3, 3, 3])
self.geo = op.geometry.StickAndBall(network=self.net,
pores=self.net.Ps,
throats... | 40.593548 | 71 | 0.580896 | import openpnm as op
import pytest
class GenericPhysicsTest:
def setup_class(self):
self.net = op.network.Cubic(shape=[3, 3, 3])
self.geo = op.geometry.StickAndBall(network=self.net,
pores=self.net.Ps,
throats... | true | true |
08fdaaa6393b4620c568d655aabc6fb76ab411c5 | 972 | py | Python | src/fintrist/notify.py | tristanbrown/fintrist | 38875e4f2c3ab4db31195c798c4262a2f51e4a22 | [
"MIT"
] | null | null | null | src/fintrist/notify.py | tristanbrown/fintrist | 38875e4f2c3ab4db31195c798c4262a2f51e4a22 | [
"MIT"
] | null | null | null | src/fintrist/notify.py | tristanbrown/fintrist | 38875e4f2c3ab4db31195c798c4262a2f51e4a22 | [
"MIT"
] | 1 | 2022-01-21T21:10:38.000Z | 2022-01-21T21:10:38.000Z | """Notifications"""
class Notification():
def __init__(self, actions, **kwargs):
for action in actions:
getattr(self, action)(**kwargs)
def printhead(self, study, alerts, **kwargs):
"""Print the head of the study's data."""
print(study.data.head(5))
def log(self, study... | 31.354839 | 54 | 0.584362 |
class Notification():
def __init__(self, actions, **kwargs):
for action in actions:
getattr(self, action)(**kwargs)
def printhead(self, study, alerts, **kwargs):
print(study.data.head(5))
def log(self, study, alerts, **kwargs):
print("'log' not implemented")
def e... | true | true |
08fdaaefb4e41503d0f3da47d0eb00d19924e1fa | 382 | py | Python | TimeWrapper_JE/venv/Lib/site-packages/pip/__init__.py | JE-Chen/je_old_repo | a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5 | [
"MIT"
] | null | null | null | TimeWrapper_JE/venv/Lib/site-packages/pip/__init__.py | JE-Chen/je_old_repo | a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5 | [
"MIT"
] | null | null | null | TimeWrapper_JE/venv/Lib/site-packages/pip/__init__.py | JE-Chen/je_old_repo | a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5 | [
"MIT"
] | null | null | null | from typing import List, Optional
__version__ = "21.1.1"
def main(args=None):
# type: (Optional[List[str]]) -> int
"""This is an internal API only meant for use by pip's own console scripts.
For additional details, see https://github.com/pypa/pip/issues/7498.
"""
from pip._internal.ut... | 25.466667 | 80 | 0.667539 | from typing import List, Optional
__version__ = "21.1.1"
def main(args=None):
from pip._internal.utils.entrypoints import _wrapper
return _wrapper(args)
| true | true |
08fdabd5e8b3e67683d583d5572f0fd9b842ef21 | 4,593 | py | Python | trainer/trainer.py | mhd53/ssd-from-torch | 1ae6eaab87afd6ef243b2fe444cbb5b15a12cfc7 | [
"MIT"
] | null | null | null | trainer/trainer.py | mhd53/ssd-from-torch | 1ae6eaab87afd6ef243b2fe444cbb5b15a12cfc7 | [
"MIT"
] | null | null | null | trainer/trainer.py | mhd53/ssd-from-torch | 1ae6eaab87afd6ef243b2fe444cbb5b15a12cfc7 | [
"MIT"
] | null | null | null | import numpy as np
import torch
from torchvision.utils import make_grid
from base import BaseTrainer
from utils import inf_loop, MetricTracker
class Trainer(BaseTrainer):
"""
Trainer class
"""
def __init__(
self,
model,
criterion,
metric_ftns,
optimizer,
... | 34.795455 | 87 | 0.571957 | import numpy as np
import torch
from torchvision.utils import make_grid
from base import BaseTrainer
from utils import inf_loop, MetricTracker
class Trainer(BaseTrainer):
def __init__(
self,
model,
criterion,
metric_ftns,
optimizer,
config,
data_loader,
... | true | true |
08fdabdddf6f929d36e5c1ff673ba5600a4a8430 | 46,494 | py | Python | ProgettoLube/WebInspector/venv/Lib/site-packages/tensorboard/uploader/uploader.py | Lube-Project/ProgettoLube | cbf33971e2c2e865783ec1a2302625539186a338 | [
"MIT"
] | 353 | 2020-12-10T10:47:17.000Z | 2022-03-31T23:08:29.000Z | ProgettoLube/WebInspector/venv/Lib/site-packages/tensorboard/uploader/uploader.py | Lube-Project/ProgettoLube | cbf33971e2c2e865783ec1a2302625539186a338 | [
"MIT"
] | 80 | 2020-12-10T09:54:22.000Z | 2022-03-30T22:08:45.000Z | ProgettoLube/WebInspector/venv/Lib/site-packages/tensorboard/uploader/uploader.py | Lube-Project/ProgettoLube | cbf33971e2c2e865783ec1a2302625539186a338 | [
"MIT"
] | 63 | 2020-12-10T17:10:34.000Z | 2022-03-28T16:27:07.000Z | # Copyright 2019 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... | 38.047463 | 106 | 0.633673 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import contextlib
import functools
import time
import grpc
import six
from google.protobuf import message
from tensorboard.compat.proto import graph_pb2
from tensorboard.compat.proto import summary_pb2
from ... | true | true |
08fdac407d4472553ea50deab73ee787dddf7e69 | 642 | py | Python | house/tools.py | hombit/house | 844df43d830ea961c47938a683ecba76f542c63d | [
"MIT"
] | 1 | 2018-06-08T18:03:04.000Z | 2018-06-08T18:03:04.000Z | house/tools.py | hombit/house | 844df43d830ea961c47938a683ecba76f542c63d | [
"MIT"
] | null | null | null | house/tools.py | hombit/house | 844df43d830ea961c47938a683ecba76f542c63d | [
"MIT"
] | null | null | null | from cachetools.func import ttl_cache
class ApiBasic:
def __init__(self, cache_size:int, cache_ttl:int, **kwargs) -> None:
self._cache_size = cache_size
self._cache_ttl = cache_ttl
self._call_kwargs = kwargs
self._cache_decorator = ttl_cache(maxsize=cache_size, ttl=cache_ttl)
... | 33.789474 | 84 | 0.676012 | from cachetools.func import ttl_cache
class ApiBasic:
def __init__(self, cache_size:int, cache_ttl:int, **kwargs) -> None:
self._cache_size = cache_size
self._cache_ttl = cache_ttl
self._call_kwargs = kwargs
self._cache_decorator = ttl_cache(maxsize=cache_size, ttl=cache_ttl)
... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.