hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | 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 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | 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 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | 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 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
040ec0ccdf61414a7290565dafc84865457813a0 | 1,586 | py | Python | tests/conftest.py | coiled/dd-trace-py | e1cd930026816c215df4cffc5bfef361479479fe | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | tests/conftest.py | coiled/dd-trace-py | e1cd930026816c215df4cffc5bfef361479479fe | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | tests/conftest.py | coiled/dd-trace-py | e1cd930026816c215df4cffc5bfef361479479fe | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | import sys
import pytest
from tests.utils import DummyTracer
from tests.utils import TracerSpanContainer
from tests.utils import call_program
from tests.utils import snapshot_context
def pytest_configure(config):
config.addinivalue_line(
"markers", "snapshot(*args, **kwargs): mark test to run as a snaps... | 25.174603 | 120 | 0.679067 |
07da35940434ef0e346cb9e602ba4d740ad886b3 | 418 | py | Python | is_subsequence.py | ChiragSaini/June-LeetCoding-Challenge | 8e3192c7c4cfbd5cf8718bdb1b041871585a0c69 | [
"MIT"
] | null | null | null | is_subsequence.py | ChiragSaini/June-LeetCoding-Challenge | 8e3192c7c4cfbd5cf8718bdb1b041871585a0c69 | [
"MIT"
] | null | null | null | is_subsequence.py | ChiragSaini/June-LeetCoding-Challenge | 8e3192c7c4cfbd5cf8718bdb1b041871585a0c69 | [
"MIT"
] | null | null | null | from collections import defaultdict
class Solution:
def isSubsequence(self, s: str, t: str) -> bool:
for c in s:
index = -1
tmp = len(t)
for i in range(tmp):
if t[i] == c:
index = i
break
if index == -1:
... | 27.866667 | 52 | 0.401914 |
00902b4048d9fdc921dcc019c0072f09062747a1 | 485 | py | Python | setup.py | 20chan/aheuithon | d0095df4b842e95ed7eb167d4b972de122c3b0de | [
"MIT"
] | 4 | 2020-02-06T03:56:18.000Z | 2020-02-08T08:09:24.000Z | setup.py | 20chan/aheuithon | d0095df4b842e95ed7eb167d4b972de122c3b0de | [
"MIT"
] | null | null | null | setup.py | 20chan/aheuithon | d0095df4b842e95ed7eb167d4b972de122c3b0de | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
from distutils.sysconfig import get_python_lib
with open("Readme.md") as f:
readme = f.read()
with open("LICENSE") as f:
liccense = f.read()
setup(
name="aheuithon",
version="0.0.1",
description="Write inline aheui function",
long_description=readme... | 24.25 | 46 | 0.68866 |
9d2906b144eb78d14e6dc8f33ed78e69c14723a5 | 2,382 | py | Python | zerver/management/commands/convert_mattermost_data.py | alexandraciobica/zulip | f3753504469070bfccc73f22f933c87bee7d1852 | [
"Apache-2.0"
] | 4 | 2019-06-04T09:06:53.000Z | 2019-06-04T09:07:47.000Z | zerver/management/commands/convert_mattermost_data.py | 991rajat/zulip | 648a60baf63f9afade83148bd9ae1fc480510178 | [
"Apache-2.0"
] | 3 | 2020-06-05T22:30:24.000Z | 2022-02-10T19:04:47.000Z | zerver/management/commands/convert_mattermost_data.py | 991rajat/zulip | 648a60baf63f9afade83148bd9ae1fc480510178 | [
"Apache-2.0"
] | 1 | 2020-02-06T13:56:40.000Z | 2020-02-06T13:56:40.000Z | import argparse
import os
from typing import Any
'''
Example usage for testing purposes. For testing data see the mattermost_fixtures
in zerver/tests/.
./manage.py convert_mattermost_data mattermost_fixtures --output mm_export
./manage.py import --destroy-rebuild-database mattermost mm_export/gryffindor
Test... | 36.646154 | 101 | 0.646935 |
6701678407acbb8af541abb17694e83c2d75f35f | 4,710 | py | Python | test/python/transpiler/test_passmanager.py | gadial/qiskit-terra | 0fc83f44a6e80969875c738b2cee7bc33223e45f | [
"Apache-2.0"
] | 1 | 2021-10-05T11:56:53.000Z | 2021-10-05T11:56:53.000Z | test/python/transpiler/test_passmanager.py | gadial/qiskit-terra | 0fc83f44a6e80969875c738b2cee7bc33223e45f | [
"Apache-2.0"
] | 24 | 2021-01-27T08:20:27.000Z | 2021-07-06T09:42:28.000Z | test/python/transpiler/test_passmanager.py | gadial/qiskit-terra | 0fc83f44a6e80969875c738b2cee7bc33223e45f | [
"Apache-2.0"
] | 4 | 2021-10-05T12:07:27.000Z | 2022-01-28T18:37:28.000Z | # This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2018.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... | 40.25641 | 89 | 0.655839 |
f14a73ac6bb684a65dc5778aa48824fc445dd013 | 1,162 | py | Python | vote/app.py | tomp736/example-voting-app | cca3c06a1a3583e20c40e1081e31f2a423887651 | [
"Apache-2.0"
] | null | null | null | vote/app.py | tomp736/example-voting-app | cca3c06a1a3583e20c40e1081e31f2a423887651 | [
"Apache-2.0"
] | null | null | null | vote/app.py | tomp736/example-voting-app | cca3c06a1a3583e20c40e1081e31f2a423887651 | [
"Apache-2.0"
] | null | null | null | from flask import Flask, render_template, request, make_response, g
from redis import Redis
import os
import socket
import random
import json
option_a = os.getenv('OPTION_A', "Buy")
option_b = os.getenv('OPTION_B', "Rent")
hostname = socket.gethostname()
version = 'v5'
app = Flask(__name__)
def get_redis():
if n... | 24.208333 | 67 | 0.634251 |
561fd938c8fdd8b137c0db1859bf94a909fa885e | 200 | py | Python | CIS41B/Parallel/p6.py | jackh423/python | 4187c16a1d6c1269d188a4a039e0a16020de51d0 | [
"Apache-2.0"
] | 1 | 2021-09-08T18:34:56.000Z | 2021-09-08T18:34:56.000Z | CIS41B/Parallel/p6.py | jackh423/python | 4187c16a1d6c1269d188a4a039e0a16020de51d0 | [
"Apache-2.0"
] | null | null | null | CIS41B/Parallel/p6.py | jackh423/python | 4187c16a1d6c1269d188a4a039e0a16020de51d0 | [
"Apache-2.0"
] | null | null | null | from multiprocessing import Pool
def square(x):
return x*x
if __name__ == '__main__':
with Pool(5) as pool:
print(pool.map(square, [1, 2, 3, 4, 5]))
print("Exiting main") | 22.222222 | 49 | 0.595 |
1b06598f92bfbb9fdc17e549b8a5425fb732ee8a | 614 | py | Python | data/generateJson.py | Zeyu-Li/climate-change-visualization | 3404290e56ca06dfeec3ca50c29ff6f18bbee7d8 | [
"MIT"
] | 3 | 2021-08-21T02:30:40.000Z | 2021-08-30T02:41:30.000Z | data/generateJson.py | Zeyu-Li/climate-change-visualization | 3404290e56ca06dfeec3ca50c29ff6f18bbee7d8 | [
"MIT"
] | 9 | 2021-08-21T20:42:19.000Z | 2021-08-22T02:57:05.000Z | data/generateJson.py | Zeyu-Li/climate-change-visualization | 3404290e56ca06dfeec3ca50c29ff6f18bbee7d8 | [
"MIT"
] | 3 | 2021-08-21T16:52:24.000Z | 2021-11-07T06:19:01.000Z | import sqlite3
import json
def main():
db = sqlite3.connect('climatedata.db')
cur = db.cursor()
data = cur.execute('SELECT * FROM CLIMATE_DATA;').fetchall()
print(data[0])
cur.close()
ans = []
for row in data:
ans.append({
'latitude': row[0],
'longitude': r... | 20.466667 | 64 | 0.493485 |
a4d5dcae3ff1e6b43cb7e472bafbb60372caf271 | 1,483 | py | Python | archive/thingspeak.py | jayagascon/pos-chair | a5eefdb23df97e21bbc72e3f84711c2ab6377357 | [
"CC0-1.0"
] | null | null | null | archive/thingspeak.py | jayagascon/pos-chair | a5eefdb23df97e21bbc72e3f84711c2ab6377357 | [
"CC0-1.0"
] | null | null | null | archive/thingspeak.py | jayagascon/pos-chair | a5eefdb23df97e21bbc72e3f84711c2ab6377357 | [
"CC0-1.0"
] | null | null | null | from time import time, sleep
import main2
from urllib.request import urlopen
import sys
WRITE_API = 'AUBE7IRHIFKUN4RZ' # PUT YOUR WRITE KEY HERE
BASE_URL = 'https://api.thingspeak.com/update?api_key={}'.format(WRITE_API)
SensorPrevSec = 0
SensorInterval = 16 # print data every 16 seconds
ThingSpeakPrevSec = 0
Thing... | 36.170732 | 203 | 0.585974 |
fc7b3ccd33361da6671609293f87a2b659d7bf1b | 1,667 | py | Python | scoring.py | niketanpansare/bc_weights | e65210042e943fe88a9eb55fc03ddff26fb77e74 | [
"Apache-2.0"
] | 2 | 2017-05-23T22:00:56.000Z | 2020-09-02T07:32:28.000Z | scoring.py | niketanpansare/bc_weights | e65210042e943fe88a9eb55fc03ddff26fb77e74 | [
"Apache-2.0"
] | null | null | null | scoring.py | niketanpansare/bc_weights | e65210042e943fe88a9eb55fc03ddff26fb77e74 | [
"Apache-2.0"
] | null | null | null | import os
import numpy as np
from pyspark.sql.functions import col, max
import systemml # pip3 install systemml
from systemml import MLContext, dml
from pyspark.context import SparkContext
from pyspark.sql import SQLContext
sc = SparkContext()
sqlContext = SQLContext(sc)
ml = MLContext(sc)
# train_df = sqlContext.rea... | 32.686275 | 111 | 0.676665 |
acb8d2f878e7b3bad917fbd9e2ce1a9faa76586c | 165 | py | Python | Curso em Vídeo/Mundo 1 Fundamentos/Desafios/desafio015.py | henriqueumeda/-Estudo-python | 28e93a377afa4732037a29eb74d4bc7c9e24b62f | [
"MIT"
] | null | null | null | Curso em Vídeo/Mundo 1 Fundamentos/Desafios/desafio015.py | henriqueumeda/-Estudo-python | 28e93a377afa4732037a29eb74d4bc7c9e24b62f | [
"MIT"
] | null | null | null | Curso em Vídeo/Mundo 1 Fundamentos/Desafios/desafio015.py | henriqueumeda/-Estudo-python | 28e93a377afa4732037a29eb74d4bc7c9e24b62f | [
"MIT"
] | null | null | null | dias = int(input('Quantos dias alugados? '))
km = float(input('Quantos Km rodados? '))
total = 60*dias + 0.15*km
print('O total a pagar é de R${:.2f}'.format(total)) | 41.25 | 52 | 0.660606 |
600bc2c5d1ebb9dcdbcf0e0cb7a55a6ecab9488d | 3,082 | py | Python | titanic/refs/first_titanic_submission.py | hkhpub/kagglepy | 003ce3046b13931a301c3503077f502317542975 | [
"MIT"
] | null | null | null | titanic/refs/first_titanic_submission.py | hkhpub/kagglepy | 003ce3046b13931a301c3503077f502317542975 | [
"MIT"
] | null | null | null | titanic/refs/first_titanic_submission.py | hkhpub/kagglepy | 003ce3046b13931a301c3503077f502317542975 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import random
import ticart
import pandas as pd
import cleantitanic as ct
def cross_validate(no_folds, data, resample=False):
rows = list(data.index)
random.shuffle(rows)
N=len(data)
len_fold = int(N/no_folds)
start=0
for i in range(no_folds):
if i... | 39.012658 | 141 | 0.616483 |
a85652310f899f8819ad285db8b124fca148d135 | 4,642 | py | Python | 3.7.0/lldb-3.7.0.src/test/lang/cpp/breakpoints/TestCPPBreakpoints.py | androm3da/clang_sles | 2ba6d0711546ad681883c42dfb8661b842806695 | [
"MIT"
] | 3 | 2016-02-10T14:18:40.000Z | 2018-02-05T03:15:56.000Z | 3.7.0/lldb-3.7.0.src/test/lang/cpp/breakpoints/TestCPPBreakpoints.py | androm3da/clang_sles | 2ba6d0711546ad681883c42dfb8661b842806695 | [
"MIT"
] | 1 | 2016-02-10T15:40:03.000Z | 2016-02-10T15:40:03.000Z | 3.7.0/lldb-3.7.0.src/test/lang/cpp/breakpoints/TestCPPBreakpoints.py | androm3da/clang_sles | 2ba6d0711546ad681883c42dfb8661b842806695 | [
"MIT"
] | null | null | null | """
Test lldb breakpoint command for CPP methods & functions in a namespace.
"""
import os, time
import unittest2
import lldb
from lldbtest import *
class CPPBreakpointTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@skipUnlessDarwin
@dsym_test
def test_with_dsym(self):
"""Test ... | 44.209524 | 93 | 0.5 |
d7ef020f0c8a83ab3e9748351b7371c02d4d8376 | 2,075 | py | Python | unity_build_pipeline/Modes/modes_base/base_modes.py | MadCoder39/UnityBuildPipelineiOS | 71d6424bea31c3df458fba29b670ced2ac6fe7f2 | [
"MIT"
] | 2 | 2021-03-29T17:23:51.000Z | 2021-03-31T12:20:39.000Z | unity_build_pipeline/Modes/modes_base/base_modes.py | MadCoder39/UnityBuildPipelineiOS | 71d6424bea31c3df458fba29b670ced2ac6fe7f2 | [
"MIT"
] | null | null | null | unity_build_pipeline/Modes/modes_base/base_modes.py | MadCoder39/UnityBuildPipelineiOS | 71d6424bea31c3df458fba29b670ced2ac6fe7f2 | [
"MIT"
] | 2 | 2021-03-05T10:35:46.000Z | 2021-03-29T17:24:43.000Z | class BaseParser:
_parser_name = ''
@property
def parser_name(self) -> str:
if self._parser_name:
return self._parser_name
raise NotImplementedError(f"{self.__class__.__name__}: parser_name not set")
def run(self, kwargs):
raise NotImplementedError
class ParserNode... | 29.642857 | 92 | 0.666024 |
898892ed769e2c488508f55c3d95ba42fbe5dc55 | 4,211 | py | Python | saleor/dashboard/templatetags/utils.py | BiaoLiu/saleor | d3de4d8ee69208d73539194b71449498f8e5e81f | [
"BSD-3-Clause"
] | null | null | null | saleor/dashboard/templatetags/utils.py | BiaoLiu/saleor | d3de4d8ee69208d73539194b71449498f8e5e81f | [
"BSD-3-Clause"
] | 1 | 2022-02-10T08:53:52.000Z | 2022-02-10T08:53:52.000Z | saleor/dashboard/templatetags/utils.py | BiaoLiu/saleor | d3de4d8ee69208d73539194b71449498f8e5e81f | [
"BSD-3-Clause"
] | null | null | null | from __future__ import unicode_literals
from json import dumps
from urllib.parse import urlencode
from django import forms
from django.template import Library
from django_filters.fields import RangeField
from versatileimagefield.widgets import VersatileImagePPOIClickWidget
from ...product.utils import get_margin_for_... | 35.686441 | 79 | 0.71337 |
c0abff14050396404de52dd3f2780f207f4b15f4 | 119,710 | py | Python | tests/integration/claims/test_claim_commands.py | vertbyqb/lbry-sdk | 8076000c2761d7ca077049f1e9e1de177553d6f0 | [
"MIT"
] | 4,996 | 2019-06-21T04:44:34.000Z | 2022-03-31T14:24:52.000Z | tests/integration/claims/test_claim_commands.py | vertbyqb/lbry-sdk | 8076000c2761d7ca077049f1e9e1de177553d6f0 | [
"MIT"
] | 1,103 | 2019-06-21T06:28:42.000Z | 2022-03-28T20:50:25.000Z | tests/integration/claims/test_claim_commands.py | vertbyqb/lbry-sdk | 8076000c2761d7ca077049f1e9e1de177553d6f0 | [
"MIT"
] | 244 | 2019-06-24T08:32:32.000Z | 2022-03-12T17:42:02.000Z | import os.path
import tempfile
import logging
import asyncio
from binascii import unhexlify
from unittest import skip
from urllib.request import urlopen
import ecdsa
from lbry.error import InsufficientFundsError
from lbry.extras.daemon.daemon import DEFAULT_PAGE_SIZE
from lbry.testcase import CommandTestCase
from lbr... | 51.576907 | 144 | 0.647632 |
d090cb07162017df350bfb79ad88cb1cdaa9d947 | 50,398 | py | Python | gcloud/bigtable/row.py | ROZ32/gcloud_test | ade172493a8babae3d9dc93f92e15f0f9ea91aa9 | [
"Apache-2.0"
] | null | null | null | gcloud/bigtable/row.py | ROZ32/gcloud_test | ade172493a8babae3d9dc93f92e15f0f9ea91aa9 | [
"Apache-2.0"
] | null | null | null | gcloud/bigtable/row.py | ROZ32/gcloud_test | ade172493a8babae3d9dc93f92e15f0f9ea91aa9 | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 37.751311 | 79 | 0.609052 |
2e9d768d58dbe38db308339b6304eb64ced1cdf3 | 38,315 | py | Python | nova/tests/unit/test_block_device.py | adallaway/nova | e73000e9e0699f9396bba3c7e87789d85ca59a2d | [
"Apache-2.0"
] | 1 | 2021-06-10T17:08:14.000Z | 2021-06-10T17:08:14.000Z | nova/tests/unit/test_block_device.py | adallaway/nova | e73000e9e0699f9396bba3c7e87789d85ca59a2d | [
"Apache-2.0"
] | 1 | 2021-02-16T10:17:26.000Z | 2021-02-17T17:44:15.000Z | nova/tests/unit/test_block_device.py | wmousa/nova | a7dd1f8881484ba0bf4270dd48109c2be142c333 | [
"Apache-2.0"
] | null | null | null | # Copyright 2011 Isaku Yamahata
# 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 b... | 42.38385 | 79 | 0.575571 |
0fc3462102209c4fa4efe14daeadbc49223d1d44 | 998 | py | Python | scripts/code_stats.py | gina102hsu/openpilot | b3e7d94303e505917e0079f559cdd0319cd0ecbf | [
"MIT"
] | 2 | 2019-03-23T22:20:54.000Z | 2019-08-24T23:10:58.000Z | scripts/code_stats.py | PacHyChris/openpilot | 41b4f6f52efb9a53669a0e9839ebcf6335e957d6 | [
"MIT"
] | null | null | null | scripts/code_stats.py | PacHyChris/openpilot | 41b4f6f52efb9a53669a0e9839ebcf6335e957d6 | [
"MIT"
] | 1 | 2021-05-09T11:43:01.000Z | 2021-05-09T11:43:01.000Z | #!/usr/bin/env python3
import os, glob
import ast
import stat
import subprocess
fouts = set([x.decode('utf-8') for x in subprocess.check_output(['git', 'ls-files']).strip().split()])
pyf = []
for d in ["cereal", "common", "scripts", "selfdrive", "tools"]:
for root, dirs, files in os.walk(d):
for f in files:
... | 23.761905 | 102 | 0.642285 |
ce00f0c6f69f255690f1ab9528bea6cee184a73e | 30,047 | py | Python | ambari-common/src/main/python/resource_management/libraries/functions/conf_select.py | panfeiyy/ambari | 24077510723ede93d3024784f0b04422adaf56d6 | [
"Apache-2.0"
] | 16 | 2018-05-24T10:28:24.000Z | 2021-08-05T03:13:26.000Z | ambari-common/src/main/python/resource_management/libraries/functions/conf_select.py | panfeiyy/ambari | 24077510723ede93d3024784f0b04422adaf56d6 | [
"Apache-2.0"
] | 3 | 2021-05-09T12:37:16.000Z | 2022-03-02T10:13:24.000Z | ambari-common/src/main/python/resource_management/libraries/functions/conf_select.py | panfeiyy/ambari | 24077510723ede93d3024784f0b04422adaf56d6 | [
"Apache-2.0"
] | 17 | 2018-07-06T08:57:00.000Z | 2021-11-04T11:00:36.000Z | #!/usr/bin/env python
"""
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License");... | 42.801994 | 176 | 0.688654 |
b7d552138d2417a1ae48960a6ffb1f52a0fe2ed8 | 357 | py | Python | t-11/t-11.py | ShaliniAnandaPhD/image-3 | c579f4cfad4dfb881b38ac834cee5aaf29ced4a8 | [
"Apache-2.0"
] | null | null | null | t-11/t-11.py | ShaliniAnandaPhD/image-3 | c579f4cfad4dfb881b38ac834cee5aaf29ced4a8 | [
"Apache-2.0"
] | null | null | null | t-11/t-11.py | ShaliniAnandaPhD/image-3 | c579f4cfad4dfb881b38ac834cee5aaf29ced4a8 | [
"Apache-2.0"
] | null | null | null | import cv2 as cv
import numpy as np
## teste.jpg -- 18x17 pixels
img = cv.imread('teste.jpg',0)
QtyRows, QtyCols = img.shape
#matrix = np.zeros(img.shape,np.uint8)
#for i in range(QtyRows):
# for j in range(QtyCols):
# matrix[i,j] = img[i,j]
img[8][8] = 255
print(img)
cv.imshow('centroide',img)
cv.imwri... | 17.85 | 38 | 0.661064 |
c5a5d02ba1923244692b2cf22cf973ca7c297faa | 8,349 | py | Python | aiokts/store/store.py | ktsstudio/aiokts | 3bf642c2d316632a9d4665239a74d13a2e2bbf74 | [
"MIT"
] | 6 | 2017-09-23T15:24:06.000Z | 2018-08-08T19:31:41.000Z | aiokts/store/store.py | ktsstudio/aiokts | 3bf642c2d316632a9d4665239a74d13a2e2bbf74 | [
"MIT"
] | 1 | 2018-08-08T19:30:55.000Z | 2018-08-08T19:30:55.000Z | aiokts/store/store.py | ktsstudio/aiokts | 3bf642c2d316632a9d4665239a74d13a2e2bbf74 | [
"MIT"
] | null | null | null | import asyncio
import logging
class StoreException(Exception):
pass
class Store(object):
def __init__(self, config, need=None, debug=False, loop=None):
if loop is None:
loop = asyncio.get_event_loop()
self.loop = loop
self.logger = logging.getLogger('store')
self... | 34.933054 | 79 | 0.492275 |
4b96ebdf2258b171de8b00366bbe7b1b5b2b3ffa | 490 | py | Python | idservice/api/__init__.py | tommyxu/idservice | 7b916969af9defd34a87288245bb771849a61ab0 | [
"MIT"
] | 1 | 2021-04-18T15:41:57.000Z | 2021-04-18T15:41:57.000Z | idservice/api/__init__.py | tommyxu/idservice | 7b916969af9defd34a87288245bb771849a61ab0 | [
"MIT"
] | null | null | null | idservice/api/__init__.py | tommyxu/idservice | 7b916969af9defd34a87288245bb771849a61ab0 | [
"MIT"
] | null | null | null | from fastapi import FastAPI
from idservice.api.service import generate_uuid, generate_snowflake, generate_random
app = FastAPI()
@app.get("/api/version")
async def get_version():
return {"version": "1.0"}
@app.get("/api/uuid")
async def gen_uuid():
return await generate_uuid()
@app.get("/api/snowflake")
... | 19.6 | 84 | 0.722449 |
d6bbbdbb0c9e3aeb308bcb47bd07e71cbb875c5b | 6,027 | py | Python | mlsummary/classification/_xgboostClass.py | serafinialessio/mlsummary | c7f6d047fbedf182571f595f7aa59a4652df4229 | [
"BSD-3-Clause"
] | null | null | null | mlsummary/classification/_xgboostClass.py | serafinialessio/mlsummary | c7f6d047fbedf182571f595f7aa59a4652df4229 | [
"BSD-3-Clause"
] | null | null | null | mlsummary/classification/_xgboostClass.py | serafinialessio/mlsummary | c7f6d047fbedf182571f595f7aa59a4652df4229 | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
from sklearn.tree import plot_tree
from mlsummary.classification._classification_functions import _class_pred, _store_X, _scatter_class, \
_features_important, _prior, _cv_results, _important_plot
class xgboostClassSummary:
def __init__(self, obj, X=None, X_train = None, y_pred=None, y_tru... | 48.604839 | 132 | 0.630164 |
caea320ec7facacac48a72f578df1941df2a0cef | 527 | py | Python | python-programming/unit49-2.py | s05252/course-2018-2 | 4695bf1556603fc2549464512afc96765f45132e | [
"Apache-2.0"
] | 1 | 2018-12-13T02:43:25.000Z | 2018-12-13T02:43:25.000Z | python-programming/unit49-2.py | s05252/course-2018-2 | 4695bf1556603fc2549464512afc96765f45132e | [
"Apache-2.0"
] | null | null | null | python-programming/unit49-2.py | s05252/course-2018-2 | 4695bf1556603fc2549464512afc96765f45132e | [
"Apache-2.0"
] | null | null | null | import pandas as pd
from sklearn.metrics import confusion_matrix
import sklearn.linear_model as lm
clf = lm.LogisticRegression(C = 10.0)
grades = pd.read_table("grades.csv")
labels = ('F', 'D', 'C', 'B', 'A')
grades["Letter"] = pd.cut(grades["Final score"], [0, 60, 70, 80, 90, 100], labels=labels)
X = grades[["Quiz 1... | 32.9375 | 89 | 0.681214 |
37142f25e1cf7729706d8b00400c19a96d45fc13 | 4,186 | py | Python | tests/animation/generator/test_unweighted_sequence_to_animation.py | OrangeUtan/MCMetagen | 0293ea14bf1c6b1bae58741f9876ba662930b43d | [
"MIT"
] | null | null | null | tests/animation/generator/test_unweighted_sequence_to_animation.py | OrangeUtan/MCMetagen | 0293ea14bf1c6b1bae58741f9876ba662930b43d | [
"MIT"
] | null | null | null | tests/animation/generator/test_unweighted_sequence_to_animation.py | OrangeUtan/MCMetagen | 0293ea14bf1c6b1bae58741f9876ba662930b43d | [
"MIT"
] | null | null | null | import pytest
from mcanitexgen.animation import generator
from mcanitexgen.animation.generator import Animation, GeneratorError
from mcanitexgen.animation.parser import (
Duration,
Sequence,
SequenceAction,
State,
StateAction,
Timeframe,
)
def frame(index: int, time: int):
return {"index"... | 32.2 | 89 | 0.546584 |
3f03a0829dc99074c22ee7af832c923a10d78c14 | 11,084 | py | Python | tf_slim/layers/utils_test.py | ShanuDey/tf-slim | 19c840abfa6de567d760254c42ea68760cf5d9f0 | [
"Apache-2.0"
] | 1 | 2020-10-01T23:37:41.000Z | 2020-10-01T23:37:41.000Z | tf_slim/layers/utils_test.py | ShanuDey/tf-slim | 19c840abfa6de567d760254c42ea68760cf5d9f0 | [
"Apache-2.0"
] | null | null | null | tf_slim/layers/utils_test.py | ShanuDey/tf-slim | 19c840abfa6de567d760254c42ea68760cf5d9f0 | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 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... | 36.460526 | 80 | 0.673313 |
72a3c591efa51de730b3b7387c344c33834a42ea | 363 | py | Python | rest_api/migrations/0004_auto_20201111_0925.py | InspectorIncognito/gtfs-editor | 4e3245f44ec44aeb2d28aa25786dc95a3193fb81 | [
"MIT"
] | 2 | 2021-10-01T16:11:20.000Z | 2022-01-15T10:55:40.000Z | rest_api/migrations/0004_auto_20201111_0925.py | InspectorIncognito/gtfs-editor | 4e3245f44ec44aeb2d28aa25786dc95a3193fb81 | [
"MIT"
] | 3 | 2021-06-10T19:17:55.000Z | 2022-03-05T08:37:46.000Z | rest_api/migrations/0004_auto_20201111_0925.py | InspectorIncognito/gtfs-editor | 4e3245f44ec44aeb2d28aa25786dc95a3193fb81 | [
"MIT"
] | 1 | 2022-03-05T08:37:53.000Z | 2022-03-05T08:37:53.000Z | # Generated by Django 3.0.7 on 2020-11-11 12:25
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('rest_api', '0003_auto_20201110_1656'),
]
operations = [
migrations.RenameField(
model_name='stop',
old_name='level_id',
... | 19.105263 | 48 | 0.584022 |
7f42f62ebd726273e7c65c2f20b1e120a9ce09f9 | 2,075 | py | Python | Regression/LinearRegression_sklearn.py | CuiZhengliang/Machine_Learning_algorithm_by_Python | 7df62a3050126d92218571e73d6bb7fa261f7af1 | [
"MIT"
] | 1 | 2018-12-18T14:49:13.000Z | 2018-12-18T14:49:13.000Z | Regression/LinearRegression_sklearn.py | CuiZhengliang/Machine_Learning_algorithm_by_Python | 7df62a3050126d92218571e73d6bb7fa261f7af1 | [
"MIT"
] | null | null | null | Regression/LinearRegression_sklearn.py | CuiZhengliang/Machine_Learning_algorithm_by_Python | 7df62a3050126d92218571e73d6bb7fa261f7af1 | [
"MIT"
] | null | null | null | # -- encoding:utf8 --
"""
Learning Regression base on sklearn
Created by CZL on 2012/12/22
"""
import numpy as np
import pandas as pd
import matplotlib as mpl
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LinearRegression
from sklearn.preprocessi... | 24.411765 | 89 | 0.735904 |
691687419f97dac42f83e9d88f88d7faa64b8612 | 4,214 | py | Python | casbin_redis_watcher/watcher.py | ffyuanda/redis-watcher | dfc9cd7841ccd5c4a65e539cd4ad0c26deffa290 | [
"Apache-2.0"
] | null | null | null | casbin_redis_watcher/watcher.py | ffyuanda/redis-watcher | dfc9cd7841ccd5c4a65e539cd4ad0c26deffa290 | [
"Apache-2.0"
] | null | null | null | casbin_redis_watcher/watcher.py | ffyuanda/redis-watcher | dfc9cd7841ccd5c4a65e539cd4ad0c26deffa290 | [
"Apache-2.0"
] | null | null | null | from redis.client import Redis, PubSub
from options import WatcherOptions
from casbin.persist.watcher import Watcher as Casbin_Watcher
from casbin.model import Model
import asyncio
import json
class WatcherError(Exception):
pass
class Watcher:
def __init__(self):
self.mutex: asyncio.Lock = asyncio... | 28.281879 | 102 | 0.6056 |
df55226dbffb5bb930c44ff3625f0d6a6d75bf99 | 12,535 | py | Python | pyx12/x12metadata.py | arenius/pyx12 | 537493deaa0b8e18a3fa72eb1b3eeae9ef043b11 | [
"BSD-3-Clause"
] | 120 | 2015-01-30T07:17:26.000Z | 2022-03-25T16:42:15.000Z | pyx12/x12metadata.py | arenius/pyx12 | 537493deaa0b8e18a3fa72eb1b3eeae9ef043b11 | [
"BSD-3-Clause"
] | 43 | 2015-02-12T18:42:26.000Z | 2021-12-12T22:22:20.000Z | pyx12/x12metadata.py | arenius/pyx12 | 537493deaa0b8e18a3fa72eb1b3eeae9ef043b11 | [
"BSD-3-Clause"
] | 85 | 2015-02-12T16:44:28.000Z | 2022-03-24T20:20:46.000Z | import sys
import os
import os.path
import logging
libpath = os.path.abspath(os.path.join(os.path.dirname(__file__), '../..'))
if os.path.isdir(libpath):
sys.path.insert(0, libpath)
# Intrapackage imports
import pyx12.error_handler
import pyx12.errors
import pyx12.map_index
import pyx12.map_if
import pyx12.params... | 47.481061 | 134 | 0.566653 |
f4bb09bd035e78ae3ace251529d5af628354bdeb | 3,473 | py | Python | bin/dump_isystem.py | sebastiannowicki/isystem-to-mqtt | a3025bfca369d11f740b004605c368bbb8d933a5 | [
"MIT"
] | 10 | 2016-07-03T13:43:04.000Z | 2020-11-08T15:30:09.000Z | bin/dump_isystem.py | sebastiannowicki/isystem-to-mqtt | a3025bfca369d11f740b004605c368bbb8d933a5 | [
"MIT"
] | 5 | 2016-08-05T10:41:56.000Z | 2022-01-09T22:28:15.000Z | bin/dump_isystem.py | sebastiannowicki/isystem-to-mqtt | a3025bfca369d11f740b004605c368bbb8d933a5 | [
"MIT"
] | 13 | 2016-08-03T08:01:14.000Z | 2020-11-11T22:49:30.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import logging
import time
import minimalmodbus
import isystem_to_mqtt.isystem_modbus
import isystem_to_mqtt.tables
parser = argparse.ArgumentPa... | 35.804124 | 107 | 0.659372 |
15aa053d2e9cd20e272ad537cb7e9e935cf4980e | 7,489 | py | Python | src/syft/core/node/common/action/get_or_set_property_action.py | aeroaks/PySyft | 88220c38faf3cd72ddc63c73f3c0533695df53c9 | [
"Apache-2.0"
] | null | null | null | src/syft/core/node/common/action/get_or_set_property_action.py | aeroaks/PySyft | 88220c38faf3cd72ddc63c73f3c0533695df53c9 | [
"Apache-2.0"
] | null | null | null | src/syft/core/node/common/action/get_or_set_property_action.py | aeroaks/PySyft | 88220c38faf3cd72ddc63c73f3c0533695df53c9 | [
"Apache-2.0"
] | null | null | null | # stdlib
from enum import Enum
import inspect
from typing import Any
from typing import Dict
from typing import List
from typing import Optional
from typing import Tuple
from typing import Union
# third party
from google.protobuf.reflection import GeneratedProtocolMessageType
from nacl.signing import VerifyKey
# syft... | 38.803109 | 95 | 0.650154 |
9b8536a39551239fdda2bc13114e937640662c1c | 7,009 | py | Python | docker_services_cli/env.py | wgresshoff/docker-services-cli | b030ceec96720802f6fc77940646c0670ad285bf | [
"MIT"
] | null | null | null | docker_services_cli/env.py | wgresshoff/docker-services-cli | b030ceec96720802f6fc77940646c0670ad285bf | [
"MIT"
] | 16 | 2020-08-26T08:31:53.000Z | 2021-02-25T09:54:12.000Z | docker_services_cli/env.py | wgresshoff/docker-services-cli | b030ceec96720802f6fc77940646c0670ad285bf | [
"MIT"
] | 7 | 2020-08-25T14:37:21.000Z | 2022-03-19T22:13:13.000Z | # -*- coding: utf-8 -*-
#
# Copyright (C) 2020 CERN.
#
# Docker-Services-CLI is free software; you can redistribute it and/or modify
# it under the terms of the MIT License; see LICENSE file for more details.
"""Environment module."""
import logging
import os
import sys
from distutils.version import StrictVersion
im... | 36.696335 | 79 | 0.599087 |
83f0945d1dd2bb17aaafdc8ecc4b7c65c1bb8507 | 864 | py | Python | rotkehlchen/db/upgrades/v29_v30.py | rotkehlchenio/rotkehlchen | 98f49cd3ed26c641fec03b78eff9fe1872385fbf | [
"BSD-3-Clause"
] | 137 | 2018-03-05T11:53:29.000Z | 2019-11-03T16:38:42.000Z | rotkehlchen/db/upgrades/v29_v30.py | rotkehlchenio/rotkehlchen | 98f49cd3ed26c641fec03b78eff9fe1872385fbf | [
"BSD-3-Clause"
] | 385 | 2018-03-08T12:43:41.000Z | 2019-11-10T09:15:36.000Z | rotkehlchen/db/upgrades/v29_v30.py | rotkehlchenio/rotkehlchen | 98f49cd3ed26c641fec03b78eff9fe1872385fbf | [
"BSD-3-Clause"
] | 59 | 2018-03-08T10:08:27.000Z | 2019-10-26T11:30:44.000Z | from typing import TYPE_CHECKING
if TYPE_CHECKING:
from rotkehlchen.db.dbhandler import DBHandler
def upgrade_v29_to_v30(db: 'DBHandler') -> None:
"""Upgrades the DB from v29 to v30
- Add category table to manually_tracked_balances
"""
cursor = db.conn.cursor()
# We need to disable foreign_k... | 34.56 | 85 | 0.704861 |
be66f0ce1b01c4f80748721cfe5aa2b80767a0d8 | 3,240 | py | Python | apivoid_handler.py | justinforbes/Harvis | 70b5126e19f15b291cabc113acac75a114c6b46b | [
"BSD-3-Clause"
] | null | null | null | apivoid_handler.py | justinforbes/Harvis | 70b5126e19f15b291cabc113acac75a114c6b46b | [
"BSD-3-Clause"
] | null | null | null | apivoid_handler.py | justinforbes/Harvis | 70b5126e19f15b291cabc113acac75a114c6b46b | [
"BSD-3-Clause"
] | null | null | null | import config
import requests
import json
estimated_queries = None
#TODOS: make every requst handle in case of no credits/HTTP error
def get_estimated_queries():
global estimated_queries
r = requests.get(
"https://endpoint.apivoid.com/threatlog/v1/pay-as-you-go/?key=" + config.apivoid_key + "&host=ww... | 36 | 146 | 0.621296 |
3623647e9ef83521661985a95143444a935d8892 | 5,289 | py | Python | python/pandas_util.py | gavinln/db-metadata | efa1dcd96171c93527e7bb45b1ce6229820170ea | [
"Apache-2.0"
] | null | null | null | python/pandas_util.py | gavinln/db-metadata | efa1dcd96171c93527e7bb45b1ce6229820170ea | [
"Apache-2.0"
] | null | null | null | python/pandas_util.py | gavinln/db-metadata | efa1dcd96171c93527e7bb45b1ce6229820170ea | [
"Apache-2.0"
] | 1 | 2020-05-11T14:43:22.000Z | 2020-05-11T14:43:22.000Z | '''
Handling large data in Pandas 10 million to 100 million Pandas is built on
numpy. Numpy can work with numeric data like integers and floats very
efficiently. Pandas can store a much wider range of objects than numpy which
include numeric data, strings, dates and times. However the non-numpy types are
not stored ver... | 25.427885 | 79 | 0.630743 |
43cbce05ee93ebb662d2e9c4c905c0a0712144e6 | 58,642 | py | Python | ginga/misc/plugins/Pick.py | eteq/ginga | 4a9b9bc05c8bb212a3fb90e077ca20c6bee1ffd9 | [
"BSD-3-Clause"
] | null | null | null | ginga/misc/plugins/Pick.py | eteq/ginga | 4a9b9bc05c8bb212a3fb90e077ca20c6bee1ffd9 | [
"BSD-3-Clause"
] | null | null | null | ginga/misc/plugins/Pick.py | eteq/ginga | 4a9b9bc05c8bb212a3fb90e077ca20c6bee1ffd9 | [
"BSD-3-Clause"
] | null | null | null | #
# Pick.py -- Pick plugin for Ginga fits viewer
#
# Eric Jeschke (eric@naoj.org)
#
# Copyright (c) Eric R. Jeschke. All rights reserved.
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
import threading
import numpy
import time
import os.path
from ginga.gw... | 36.674171 | 236 | 0.538795 |
193c89e48350e48596e6ab877f163cc2f54155f4 | 694 | py | Python | scripts/05_bulk_image_downloader.py | jajukajulz/scripts | 141bb6e051e006b4bceacdd0ac1dc3d5213fcb3a | [
"MIT"
] | null | null | null | scripts/05_bulk_image_downloader.py | jajukajulz/scripts | 141bb6e051e006b4bceacdd0ac1dc3d5213fcb3a | [
"MIT"
] | null | null | null | scripts/05_bulk_image_downloader.py | jajukajulz/scripts | 141bb6e051e006b4bceacdd0ac1dc3d5213fcb3a | [
"MIT"
] | null | null | null | from random import randint
import os
import csv
import urllib.request as req
import time
#read list of urls rom csv
images_csv = '<filename>'
#directory to download to
file_path = '<download_directory>'
with open(images_csv, 'r') as f:
reader = csv.reader(f)
images_urls_list = list(reader)
n_images = 0
for ima... | 22.387097 | 60 | 0.716138 |
96c1cfd79bbe0c258d997a9aa80096d79760406a | 9,062 | py | Python | sdk/python/pulumi_azure_native/hybridcompute/v20200730preview/get_machine_extension.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/hybridcompute/v20200730preview/get_machine_extension.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/hybridcompute/v20200730preview/get_machine_extension.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... | 40.097345 | 268 | 0.670492 |
715548a1923a989aadb869b5f82a3196957d443b | 2,645 | py | Python | tests/engine/cloud/test_utilities.py | elenapalesis/prefect | 424be6b5ed8d3be85064de4b95b5c3d7cb665510 | [
"Apache-2.0"
] | null | null | null | tests/engine/cloud/test_utilities.py | elenapalesis/prefect | 424be6b5ed8d3be85064de4b95b5c3d7cb665510 | [
"Apache-2.0"
] | null | null | null | tests/engine/cloud/test_utilities.py | elenapalesis/prefect | 424be6b5ed8d3be85064de4b95b5c3d7cb665510 | [
"Apache-2.0"
] | null | null | null | import pytest
import prefect
from prefect.engine.cloud.utilities import prepare_state_for_cloud
from prefect.engine.result import NoResult, Result, SafeResult
from prefect.engine.result_handlers import JSONResultHandler, ResultHandler
from prefect.engine.state import Cached, Failed, Pending, Success, _MetaState
all_s... | 32.654321 | 86 | 0.743667 |
32c1638ade08c5bf82b86204e9fed469abd6a2ad | 282 | py | Python | file_cache.py | lorengordon/terraform-external-file-cache | aa0699becb46143a77b368a98478a6b8c79181f6 | [
"Apache-2.0"
] | 1 | 2018-12-15T20:53:06.000Z | 2018-12-15T20:53:06.000Z | file_cache.py | lorengordon/terraform-external-file-cache | aa0699becb46143a77b368a98478a6b8c79181f6 | [
"Apache-2.0"
] | 66 | 2021-02-16T07:15:06.000Z | 2022-03-03T04:07:13.000Z | file_cache.py | kbalk/terraform-external-file-cache | 3781253aac58ec4bbc80d5773c5142418210796a | [
"Apache-2.0"
] | 9 | 2018-03-14T19:34:05.000Z | 2022-02-21T22:55:24.000Z | # -*- coding: utf-8 -*-
"""Wraps py_getter with a terraform external interface."""
import sys
import py_getter
import tf_external
if __name__ == "__main__":
tfe = tf_external.TfExternal()
args = tfe.query_args(sys.stdin)
sys.exit(tfe.out_json(py_getter.main(**args)))
| 23.5 | 58 | 0.702128 |
7e0bfec53befc8906a31a40382952dc326829c24 | 4,274 | py | Python | tensorflow_checkpoint_reader/pb/tensorflow/core/framework/tensor_description_pb2.py | shawwn/tensorflow-checkpoint-reader | f0e65548411e3bd66a07e36bb1850907a05952d0 | [
"MIT"
] | 1 | 2021-12-02T15:06:09.000Z | 2021-12-02T15:06:09.000Z | tensorflow_checkpoint_reader/pb/tensorflow/core/framework/tensor_description_pb2.py | shawwn/tensorflow-checkpoint-reader | f0e65548411e3bd66a07e36bb1850907a05952d0 | [
"MIT"
] | null | null | null | tensorflow_checkpoint_reader/pb/tensorflow/core/framework/tensor_description_pb2.py | shawwn/tensorflow-checkpoint-reader | f0e65548411e3bd66a07e36bb1850907a05952d0 | [
"MIT"
] | null | null | null |
'Generated protocol buffer code.'
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
_sym_db = _symbol_database.Default()
from ....tensorflow.core.fra... | 203.52381 | 1,549 | 0.86453 |
071e6c0f3c7b160d064fc21a082948d6e78553d5 | 9,109 | py | Python | terminal.py | HarshCasper/GamestonkTerminal | f8f25d1ede5dd4e5c9b60fecdc1361d9eba769dd | [
"MIT"
] | null | null | null | terminal.py | HarshCasper/GamestonkTerminal | f8f25d1ede5dd4e5c9b60fecdc1361d9eba769dd | [
"MIT"
] | null | null | null | terminal.py | HarshCasper/GamestonkTerminal | f8f25d1ede5dd4e5c9b60fecdc1361d9eba769dd | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import argparse
import sys
import os
from datetime import datetime, timedelta
import pandas as pd
from alpha_vantage.timeseries import TimeSeries
from prompt_toolkit.completion import NestedCompleter
from gamestonk_terminal import config_terminal as cfg
from gamestonk_terminal import feature_fl... | 33.003623 | 100 | 0.586563 |
86c3c26ab0be4bb6b6df91848bfdf83519acbca4 | 948 | py | Python | DailyByte/4.py | anuragpatil94/dailycoding | 468fccc97ab1534a0898b09090574ec72ba033a1 | [
"MIT"
] | null | null | null | DailyByte/4.py | anuragpatil94/dailycoding | 468fccc97ab1534a0898b09090574ec72ba033a1 | [
"MIT"
] | null | null | null | DailyByte/4.py | anuragpatil94/dailycoding | 468fccc97ab1534a0898b09090574ec72ba033a1 | [
"MIT"
] | null | null | null | """
No: 4
Date: 11-07-2020
Problem:
isCapitalized
Given a string, return whether or not it uses capitalization correctly.
A string correctly uses capitalization if all letters are capitalized,
no letters are capitalized, or only the first letter is capitalized.
TestCases:
Ex: Given the following... | 21.066667 | 80 | 0.631857 |
31ed2ade20af9027231470a15b7ddadc32efc750 | 128 | py | Python | lib/JumpScale/grid/grid/__init__.py | Jumpscale/jumpscale6_core | 0502ddc1abab3c37ed982c142d21ea3955d471d3 | [
"BSD-2-Clause"
] | 1 | 2015-10-26T10:38:13.000Z | 2015-10-26T10:38:13.000Z | lib/JumpScale/grid/grid/__init__.py | Jumpscale/jumpscale6_core | 0502ddc1abab3c37ed982c142d21ea3955d471d3 | [
"BSD-2-Clause"
] | null | null | null | lib/JumpScale/grid/grid/__init__.py | Jumpscale/jumpscale6_core | 0502ddc1abab3c37ed982c142d21ea3955d471d3 | [
"BSD-2-Clause"
] | null | null | null | from JumpScale import j
from .GridFactory import GridFactory
j.base.loader.makeAvailable(j, 'core')
j.core.grid = GridFactory()
| 25.6 | 38 | 0.789063 |
c141e75a5fa5d32c8f6b405da5821bf3f86e8b1a | 3,381 | py | Python | tests/fullscale/poroelasticity/mandel/mandel_gendb.py | Grant-Block/pylith | f6338261b17551eba879da998a5aaf2d91f5f658 | [
"MIT"
] | null | null | null | tests/fullscale/poroelasticity/mandel/mandel_gendb.py | Grant-Block/pylith | f6338261b17551eba879da998a5aaf2d91f5f658 | [
"MIT"
] | null | null | null | tests/fullscale/poroelasticity/mandel/mandel_gendb.py | Grant-Block/pylith | f6338261b17551eba879da998a5aaf2d91f5f658 | [
"MIT"
] | null | null | null | #!/usr/bin/env nemesis
#
# ----------------------------------------------------------------------
#
# Brad T. Aagaard, U.S. Geological Survey
# Charles A. Williams, GNS Science
# Matthew G. Knepley, University of Chicago
#
# This code was developed as part of the Computational Infrastructure
# for Geodynamics (http://g... | 31.598131 | 73 | 0.474712 |
89dfbb6a33a6c40182fa66a1392dcba827a2cd21 | 1,328 | py | Python | farmingPestDetection/urls.py | jushukran/farmingPestDetection | 567e276809eb14d62017dc834b802370c039d98d | [
"MIT"
] | null | null | null | farmingPestDetection/urls.py | jushukran/farmingPestDetection | 567e276809eb14d62017dc834b802370c039d98d | [
"MIT"
] | null | null | null | farmingPestDetection/urls.py | jushukran/farmingPestDetection | 567e276809eb14d62017dc834b802370c039d98d | [
"MIT"
] | null | null | null | """farmingPestDetection URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='ho... | 39.058824 | 92 | 0.724398 |
268700e6436a1f4eff9850151007903e948f6ecf | 488 | py | Python | TKINTER/Udemy/tests/Test installer.py | Advik-B/Learn-Python | 66ac57259764e8f2c3c6513a8de6c106800d8abe | [
"MIT"
] | 6 | 2021-07-26T14:21:25.000Z | 2021-07-26T14:32:01.000Z | TKINTER/Udemy/tests/Test installer.py | Advik-B/Learn-Python | 66ac57259764e8f2c3c6513a8de6c106800d8abe | [
"MIT"
] | 2 | 2021-12-10T10:25:19.000Z | 2021-12-10T10:27:15.000Z | TKINTER/Udemy/tests/Test installer.py | Advik-B/Learn-Python | 66ac57259764e8f2c3c6513a8de6c106800d8abe | [
"MIT"
] | null | null | null | from tkinter import *
from tkinter import ttk
import subprocess
root = Tk()
root.geometry('700x650')
def install(mode:str , path:str) -> None:
"""
This function will install the server\
on the specified path based on the mode given.\n
The avalable modes are:\n
`bukkit`\n
`fabr... | 20.333333 | 52 | 0.534836 |
7d87ed0dc0281fa081da8815ab48741bd8736993 | 791 | py | Python | test/programytest/storage/asserts/store/assert_twitter.py | cdoebler1/AIML2 | ee692ec5ea3794cd1bc4cc8ec2a6b5e5c20a0d6a | [
"MIT"
] | 345 | 2016-11-23T22:37:04.000Z | 2022-03-30T20:44:44.000Z | test/programytest/storage/asserts/store/assert_twitter.py | MikeyBeez/program-y | 00d7a0c7d50062f18f0ab6f4a041068e119ef7f0 | [
"MIT"
] | 275 | 2016-12-07T10:30:28.000Z | 2022-02-08T21:28:33.000Z | test/programytest/storage/asserts/store/assert_twitter.py | VProgramMist/modified-program-y | f32efcafafd773683b3fe30054d5485fe9002b7d | [
"MIT"
] | 159 | 2016-11-28T18:59:30.000Z | 2022-03-20T18:02:44.000Z | import unittest
class TwitterStoreAsserts(unittest.TestCase):
def assert_twitter_storage(self, store):
store.empty()
last_direct_message_id, last_status_id = store.load_last_message_ids()
self.assertEqual(last_direct_message_id, "-1")
self.assertEqual(last_status_id, "-1")
... | 29.296296 | 78 | 0.713021 |
0a53e0a52d99ded48d231a5a7e375c70b192f0f7 | 5,488 | py | Python | BotPreferences.py | ipatrol/pineapple | 0eebbf978c921a1c865632622d6acf160d526b48 | [
"MIT"
] | null | null | null | BotPreferences.py | ipatrol/pineapple | 0eebbf978c921a1c865632622d6acf160d526b48 | [
"MIT"
] | null | null | null | BotPreferences.py | ipatrol/pineapple | 0eebbf978c921a1c865632622d6acf160d526b48 | [
"MIT"
] | null | null | null | from configparser import ConfigParser, NoSectionError, NoOptionError
import os
import sqlite3
from util import Ranks
class BotPreferences(object):
"""
The BotPreferences class manages access to the config.ini file. Plugins can access these settings,
but new settings have to be added to the file manually.
... | 37.848276 | 115 | 0.58965 |
a81d1b36ce68ae859f4ce75411f215448d69f953 | 4,939 | py | Python | libraryfree/venv/lib/python3.6/site-packages/bson/dbref.py | matheuscr30/Flask | 673531f866406b1d9c9f8eba65893a817781ed30 | [
"MIT"
] | 1 | 2019-03-27T18:49:14.000Z | 2019-03-27T18:49:14.000Z | libraryfree/venv/lib/python3.6/site-packages/bson/dbref.py | matheuscr30/Flask | 673531f866406b1d9c9f8eba65893a817781ed30 | [
"MIT"
] | null | null | null | libraryfree/venv/lib/python3.6/site-packages/bson/dbref.py | matheuscr30/Flask | 673531f866406b1d9c9f8eba65893a817781ed30 | [
"MIT"
] | null | null | null | # Copyright 2009-2014 MongoDB, 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 writin... | 33.371622 | 79 | 0.595262 |
98ae26077f15385df54b5c8a2b715e4804bec221 | 338 | py | Python | VTK/vtk_7.1.1_x64_Release/lib/python2.7/site-packages/vtk/vtkFiltersHyperTree.py | jiaguobing/FastCAE | 2348ab87e83fe5c704e4c998cf391229c25ac5d5 | [
"BSD-3-Clause"
] | 2 | 2020-02-21T01:04:35.000Z | 2020-02-21T03:35:37.000Z | VTK/vtk_7.1.1_x64_Release/lib/python2.7/site-packages/vtk/vtkFiltersHyperTree.py | Sunqia/FastCAE | cbc023fe07b6e306ceefae8b8bd7c12bc1562acb | [
"BSD-3-Clause"
] | 1 | 2020-03-06T04:49:42.000Z | 2020-03-06T04:49:42.000Z | VTK/vtk_7.1.1_x64_Release/lib/python2.7/site-packages/vtk/vtkFiltersHyperTree.py | Sunqia/FastCAE | cbc023fe07b6e306ceefae8b8bd7c12bc1562acb | [
"BSD-3-Clause"
] | 1 | 2021-11-21T13:03:26.000Z | 2021-11-21T13:03:26.000Z | from __future__ import absolute_import
try:
# use relative import for installed modules
from .vtkFiltersHyperTreePython import *
except ImportError:
# during build and testing, the modules will be elsewhere,
# e.g. in lib directory or Release/Debug config directories
from vtkFiltersHyperTre... | 33.8 | 64 | 0.751479 |
554c4e81a50cec7e1add86e7787f9059987d3650 | 8,993 | py | Python | src/edge/south_migrations/0008_auto__add_field_fragment_active__add_field_genome_active.py | pflans/edge | d84de02bd9b334212b7405ecc4e68d3a209add99 | [
"MIT"
] | 32 | 2017-05-15T06:03:46.000Z | 2022-02-18T08:30:19.000Z | src/edge/south_migrations/0008_auto__add_field_fragment_active__add_field_genome_active.py | pflans/edge | d84de02bd9b334212b7405ecc4e68d3a209add99 | [
"MIT"
] | 36 | 2017-05-11T01:29:14.000Z | 2022-02-10T07:31:24.000Z | src/edge/south_migrations/0008_auto__add_field_fragment_active__add_field_genome_active.py | pflans/edge | d84de02bd9b334212b7405ecc4e68d3a209add99 | [
"MIT"
] | 4 | 2017-09-19T18:10:45.000Z | 2019-11-29T03:38:08.000Z | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Fragment.active'
db.add_column(
u"edge_fragmen... | 37.627615 | 92 | 0.42711 |
7e01af130d97f056a57798d53dff0becdb268993 | 4,173 | py | Python | twitter_bot/twitter_data/migrations/0001_initial.py | HectorPulido/Awesome-twitter-bot | 483d26b62b46816b741f99c7641beb5cc8f000a0 | [
"MIT"
] | 13 | 2021-04-05T20:25:09.000Z | 2022-01-14T17:03:04.000Z | twitter_bot/twitter_data/migrations/0001_initial.py | HectorPulido/twitter_bot | 483d26b62b46816b741f99c7641beb5cc8f000a0 | [
"MIT"
] | null | null | null | twitter_bot/twitter_data/migrations/0001_initial.py | HectorPulido/twitter_bot | 483d26b62b46816b741f99c7641beb5cc8f000a0 | [
"MIT"
] | 2 | 2021-04-28T04:32:05.000Z | 2021-11-03T23:04:30.000Z | # Generated by Django 3.1.1 on 2021-04-08 23:45
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = []
operations = [
migrations.CreateModel(
name="Feature",
fields=[
... | 34.487603 | 87 | 0.412653 |
0aa48769d00e673cf0e881e153d4b4e2647259be | 605 | py | Python | apps/resnet_50_blockwise/run_torch_resnet.py | Neo-Vincent/Halide | 50c40dc185b040b93f1a90b6373a82744312cfd6 | [
"MIT"
] | null | null | null | apps/resnet_50_blockwise/run_torch_resnet.py | Neo-Vincent/Halide | 50c40dc185b040b93f1a90b6373a82744312cfd6 | [
"MIT"
] | 1 | 2020-05-20T08:42:26.000Z | 2020-05-20T08:42:26.000Z | apps/resnet_50_blockwise/run_torch_resnet.py | Neo-Vincent/Halide | 50c40dc185b040b93f1a90b6373a82744312cfd6 | [
"MIT"
] | 3 | 2020-03-27T02:05:13.000Z | 2021-01-06T03:05:29.000Z | from PIL import Image
import torch
from torch_resnet import resnet50
import torchvision.transforms as transforms
def image_loader(image_name, size):
loader = transforms.Compose([transforms.Scale(size), transforms.ToTensor()])
image = Image.open(image_name)
image = loader(image).float()
return image
... | 22.407407 | 80 | 0.710744 |
fa7756f53331e4fb4cfcfc9d60cbbeee70f0c73f | 7,950 | py | Python | tests/contrib/sensors/test_emr_step_sensor.py | suensummit/airflow | 37a342d0e96a91ce2d34085e225a4e86f54c4e21 | [
"Apache-2.0"
] | 1 | 2021-11-04T20:11:58.000Z | 2021-11-04T20:11:58.000Z | tests/contrib/sensors/test_emr_step_sensor.py | suensummit/airflow | 37a342d0e96a91ce2d34085e225a4e86f54c4e21 | [
"Apache-2.0"
] | 3 | 2020-07-07T20:39:24.000Z | 2021-09-29T17:34:46.000Z | tests/contrib/sensors/test_emr_step_sensor.py | suensummit/airflow | 37a342d0e96a91ce2d34085e225a4e86f54c4e21 | [
"Apache-2.0"
] | 1 | 2020-11-04T03:17:51.000Z | 2020-11-04T03:17:51.000Z | # -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... | 32.056452 | 92 | 0.566164 |
52c57e37cbaaebb6b9e9eb4e871c37145b733855 | 5,621 | py | Python | pythonoid.py | patrykvan/pythonoid | 021c15752f39c0a486c5313f370adbb86f9d3c19 | [
"MIT"
] | null | null | null | pythonoid.py | patrykvan/pythonoid | 021c15752f39c0a486c5313f370adbb86f9d3c19 | [
"MIT"
] | 1 | 2019-01-11T16:30:24.000Z | 2019-01-11T16:30:58.000Z | pythonoid.py | patrykvan/pythonoid | 021c15752f39c0a486c5313f370adbb86f9d3c19 | [
"MIT"
] | null | null | null | import time as time_sleep
import pygame
from pygame.locals import *
import settings
import soundmixer as soundmixer
from player_screen import PlayerScreen
from settings import WIDTH_RES, HEIGHT_RES, MAX_FPS, PLAYER_CONTROLS, BACKGROUND_COLOR
from text_surface import TextSurface
def start_screen():
width, height... | 36.264516 | 119 | 0.582459 |
6c42ce1ccc9a50f460333683cfd20b17def5da7d | 56,821 | py | Python | src/transformers/models/layoutlmv2/modeling_layoutlmv2.py | cnarte/transformers | fa7a69f9375c710911df01b9a11a234d1828b74e | [
"Apache-2.0"
] | 50,404 | 2019-09-26T09:55:55.000Z | 2022-03-31T23:07:49.000Z | src/transformers/models/layoutlmv2/modeling_layoutlmv2.py | cnarte/transformers | fa7a69f9375c710911df01b9a11a234d1828b74e | [
"Apache-2.0"
] | 13,179 | 2019-09-26T10:10:57.000Z | 2022-03-31T23:17:08.000Z | src/transformers/models/layoutlmv2/modeling_layoutlmv2.py | cnarte/transformers | fa7a69f9375c710911df01b9a11a234d1828b74e | [
"Apache-2.0"
] | 13,337 | 2019-09-26T10:49:38.000Z | 2022-03-31T23:06:17.000Z | # coding=utf-8
# Copyright 2021 Microsoft Research 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/LICEN... | 42.21471 | 222 | 0.66222 |
e3581ddeeab56580a9ec47375804dc45715f80dd | 487 | py | Python | PyFin/PricingEngines/GediFormula.py | rpatil524/Finance-Python | 687538015eb597575b872cd652aada5047e84ef3 | [
"MIT"
] | 325 | 2017-11-02T19:08:46.000Z | 2022-03-22T21:00:45.000Z | PyFin/PricingEngines/GediFormula.py | smileboy510/Finance-Python | 96d9984f1a9bb7b02c057c8e056a993b1c211945 | [
"MIT"
] | 6 | 2019-05-22T07:23:02.000Z | 2021-06-23T11:27:57.000Z | PyFin/PricingEngines/GediFormula.py | smileboy510/Finance-Python | 96d9984f1a9bb7b02c057c8e056a993b1c211945 | [
"MIT"
] | 78 | 2017-11-27T01:27:48.000Z | 2022-03-26T15:34:09.000Z | # -*- coding: utf-8 -*-
u"""
Created on 2017-1-17
@author: cheng.li
"""
import math
import numpy as np
def gediVolatility(strike, forward, expiry, atmVol, skew, kurt):
moneyness = math.log(strike / forward) / math.sqrt(expiry)
s = math.atan(moneyness)
return atmVol + s * skew + kurt * (s ** 2)
def g... | 23.190476 | 104 | 0.677618 |
b4bd5f28a56e2826e778d06ea97cbd4232a8b6f0 | 1,403 | py | Python | submission/sword_utils.py | rpatil524/COPO | cc54a6cfac61584cc97a17073d3837a5820a8b95 | [
"MIT"
] | 16 | 2017-02-20T16:20:02.000Z | 2021-08-30T04:35:30.000Z | submission/sword_utils.py | rpatil524/COPO | cc54a6cfac61584cc97a17073d3837a5820a8b95 | [
"MIT"
] | 29 | 2017-12-08T11:49:44.000Z | 2020-10-15T07:19:34.000Z | submission/sword_utils.py | rpatil524/COPO | cc54a6cfac61584cc97a17073d3837a5820a8b95 | [
"MIT"
] | 4 | 2015-10-22T19:06:37.000Z | 2020-08-13T20:00:52.000Z | # COPO python file created 20/04/2017 by fshaw
"""
Utils for accepting and depositing data and metadata to and from services adhering to the SWORD protocol
https://en.wikipedia.org/wiki/SWORD_(protocol)
"""
import requests
from django.conf import settings
import os
from django.http import HttpResponse
from su... | 26.471698 | 108 | 0.687099 |
d6fdb6d1424b7321836bdcea6c65432f74d62109 | 427 | py | Python | project/processors.py | andywar65/rp_repo | 726c1426d738b962cabeabd8995aa35767df0c41 | [
"BSD-2-Clause"
] | null | null | null | project/processors.py | andywar65/rp_repo | 726c1426d738b962cabeabd8995aa35767df0c41 | [
"BSD-2-Clause"
] | null | null | null | project/processors.py | andywar65/rp_repo | 726c1426d738b962cabeabd8995aa35767df0c41 | [
"BSD-2-Clause"
] | null | null | null | from django.conf import settings
def get_global_settings(request):
website = {'name': settings.WEBSITE_NAME,
'acro': settings.WEBSITE_ACRO,
'facebook': settings.FB_LINK,
'insta': settings.INSTA_LINK,
'twitter': settings.TWIT_LINK,
'linked': settings.IN_LINK,
'github'... | 30.5 | 45 | 0.637002 |
c15dfae0355c3fc90d75d356f51600d63ab24f17 | 254 | py | Python | pack/__init__.py | yippp/SY-GNN | 65a1e2566dce549724cef080dfac7efc00fbe91b | [
"MIT"
] | 6 | 2020-05-04T03:37:24.000Z | 2021-04-21T15:15:54.000Z | pack/__init__.py | yippp/SY-GNN | 65a1e2566dce549724cef080dfac7efc00fbe91b | [
"MIT"
] | null | null | null | pack/__init__.py | yippp/SY-GNN | 65a1e2566dce549724cef080dfac7efc00fbe91b | [
"MIT"
] | null | null | null | from pack import data
from pack import datasets
from pack import nn
from pack import representation
from pack import train
from pack import atomistic
from pack import environment
from pack import metrics
from pack import utils
from pack import train_func | 25.4 | 31 | 0.846457 |
30b089904bda20a35953d83b7ba15a2681969047 | 1,321 | py | Python | Part_2_intermediate/mod_2/lesson_3/homework_4/shop/order.py | Mikma03/InfoShareacademy_Python_Courses | 3df1008c8c92831bebf1625f960f25b39d6987e6 | [
"MIT"
] | null | null | null | Part_2_intermediate/mod_2/lesson_3/homework_4/shop/order.py | Mikma03/InfoShareacademy_Python_Courses | 3df1008c8c92831bebf1625f960f25b39d6987e6 | [
"MIT"
] | null | null | null | Part_2_intermediate/mod_2/lesson_3/homework_4/shop/order.py | Mikma03/InfoShareacademy_Python_Courses | 3df1008c8c92831bebf1625f960f25b39d6987e6 | [
"MIT"
] | null | null | null | import random
from shop.product import Product, print_product
class Order:
def __init__(self, client_first_name, client_last_name, products=None):
self.client_first_name = client_first_name
self.client_last_name = client_last_name
if products is None:
products = []
se... | 29.355556 | 97 | 0.671461 |
d0b4a790c1b5c7685f355955d277ad6c4086cf2d | 3,905 | py | Python | tests/test_funcutils_fb_py3.py | bogdan-kulynych/boltons | a065dc576c1dc01e9539d973dfb961591ecee427 | [
"BSD-3-Clause"
] | null | null | null | tests/test_funcutils_fb_py3.py | bogdan-kulynych/boltons | a065dc576c1dc01e9539d973dfb961591ecee427 | [
"BSD-3-Clause"
] | null | null | null | tests/test_funcutils_fb_py3.py | bogdan-kulynych/boltons | a065dc576c1dc01e9539d973dfb961591ecee427 | [
"BSD-3-Clause"
] | null | null | null |
import inspect
from collections import defaultdict
import pytest
from boltons.funcutils import wraps, FunctionBuilder
def pita_wrap(flag=False):
def cedar_dec(func):
@wraps(func)
def cedar_wrapper(*a, **kw):
return (flag, func.__name__, func(*a, **kw))
return cedar_wrapper
... | 30.271318 | 79 | 0.579257 |
d2b934bed8ecf08be3f552a58d6f64fa6c8bc500 | 1,825 | py | Python | code-nautilus.py | Gyro7/codium-nautilus | 5d9c7f71388a356a600db1f21f185814f1764d1c | [
"Unlicense"
] | 1 | 2022-01-21T18:19:52.000Z | 2022-01-21T18:19:52.000Z | code-nautilus.py | Gyro7/codium-nautilus | 5d9c7f71388a356a600db1f21f185814f1764d1c | [
"Unlicense"
] | null | null | null | code-nautilus.py | Gyro7/codium-nautilus | 5d9c7f71388a356a600db1f21f185814f1764d1c | [
"Unlicense"
] | null | null | null | # VSCode Nautilus Extension
#
# Place me in ~/.local/share/nautilus-python/extensions/,
# ensure you have python-nautilus package, restart Nautilus, and enjoy :)
#
# This script was written by cra0zy and is released to the public domain
from gi import require_version
require_version('Gtk', '3.0')
require_version('Naut... | 28.515625 | 73 | 0.62411 |
c2baa32f099f726fb2ea013a75d15990abf49398 | 2,468 | py | Python | CybORG/CybORG/Shared/Actions/VelociraptorActionsFolder/GetUserInfo.py | rafvasq/cage-challenge-1 | 95affdfa38afc1124f1a1a09c92fbc0ed5b96318 | [
"MIT"
] | 18 | 2021-08-20T15:07:55.000Z | 2022-03-11T12:05:15.000Z | CybORG/CybORG/Shared/Actions/VelociraptorActionsFolder/GetUserInfo.py | rafvasq/cage-challenge-1 | 95affdfa38afc1124f1a1a09c92fbc0ed5b96318 | [
"MIT"
] | 7 | 2021-11-09T06:46:58.000Z | 2022-03-31T12:35:06.000Z | CybORG/CybORG/Shared/Actions/VelociraptorActionsFolder/GetUserInfo.py | rafvasq/cage-challenge-1 | 95affdfa38afc1124f1a1a09c92fbc0ed5b96318 | [
"MIT"
] | 13 | 2021-08-17T00:26:31.000Z | 2022-03-29T20:06:45.000Z | # Copyright DST Group. Licensed under the MIT license.
from CybORG.Shared.Enums import QueryType
from CybORG.Shared.Observation import Observation
from .VelociraptorAction import VelociraptorAction
class GetUserInfo(VelociraptorAction):
"""Gets information about a user"""
def __init__(self, session: int, a... | 32.906667 | 79 | 0.534441 |
03a36f29f0b2580857912d8ef22b80c24dc444d0 | 1,383 | py | Python | users/forms.py | RossBrunton/BMAT | 5e102935cc6166f4d8ea13051769787c47303153 | [
"MIT"
] | null | null | null | users/forms.py | RossBrunton/BMAT | 5e102935cc6166f4d8ea13051769787c47303153 | [
"MIT"
] | 47 | 2015-09-02T10:22:41.000Z | 2021-06-10T19:15:00.000Z | users/forms.py | RossBrunton/BMAT | 5e102935cc6166f4d8ea13051769787c47303153 | [
"MIT"
] | null | null | null | """ Forms for user management """
from django import forms
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User
from users.models import Settings
class ThemeSelect(forms.widgets.ChoiceWidget):
input_type = "input"
template_name = "users/forms/themeSelect.html"
... | 32.162791 | 81 | 0.704266 |
fb9b71f933bd7a200949fcfd7622b7186336aca7 | 4,078 | py | Python | Tests/functional_tests/test_return_json.py | florpor/opentaba-server | 7a332dd2b03900bd2688e0f7159c640058660774 | [
"BSD-3-Clause"
] | null | null | null | Tests/functional_tests/test_return_json.py | florpor/opentaba-server | 7a332dd2b03900bd2688e0f7159c640058660774 | [
"BSD-3-Clause"
] | null | null | null | Tests/functional_tests/test_return_json.py | florpor/opentaba-server | 7a332dd2b03900bd2688e0f7159c640058660774 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
from flask import *
from app import app
from nose.tools import eq_, assert_true
import json
# get the test client for communicating with our flask app
testapp = app.test_client()
def setup_module(module):
app.config['TESTING'] = True
def teardown_module(module):
... | 31.129771 | 107 | 0.553458 |
9f985521b03e31006f5d968325b5b765d80e6b44 | 3,716 | py | Python | model_zoo/official/nlp/cpm/export.py | Vincent34/mindspore | a39a60878a46e7e9cb02db788c0bca478f2fa6e5 | [
"Apache-2.0"
] | 1 | 2021-07-03T06:52:20.000Z | 2021-07-03T06:52:20.000Z | model_zoo/official/nlp/cpm/export.py | Vincent34/mindspore | a39a60878a46e7e9cb02db788c0bca478f2fa6e5 | [
"Apache-2.0"
] | null | null | null | model_zoo/official/nlp/cpm/export.py | Vincent34/mindspore | a39a60878a46e7e9cb02db788c0bca478f2fa6e5 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 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 a... | 42.227273 | 117 | 0.663886 |
e1e17aa2f030a742977f5151eb00689e42a1a954 | 7,764 | py | Python | tianshou/policy/modelfree/ppo.py | bladesaber/tianshou | c7ac98c2c1f430b33a0dc14cdb501591a564718b | [
"MIT"
] | 1 | 2021-09-05T01:09:23.000Z | 2021-09-05T01:09:23.000Z | tianshou/policy/modelfree/ppo.py | bladesaber/tianshou | c7ac98c2c1f430b33a0dc14cdb501591a564718b | [
"MIT"
] | null | null | null | tianshou/policy/modelfree/ppo.py | bladesaber/tianshou | c7ac98c2c1f430b33a0dc14cdb501591a564718b | [
"MIT"
] | 2 | 2021-09-23T15:56:37.000Z | 2021-12-14T03:33:25.000Z | from typing import Any, Dict, List, Optional, Type
import numpy as np
import torch
from torch import nn
from tianshou.data import Batch, ReplayBuffer, to_torch_as
from tianshou.policy import A2CPolicy
class PPOPolicy(A2CPolicy):
r"""Implementation of Proximal Policy Optimization. arXiv:1707.06347.
:param t... | 48.223602 | 87 | 0.611025 |
be34b2f6725b4026191ec6d44d61d6e827d6e6d7 | 14,644 | py | Python | auto_machine_learning/ensembling/super_learner.py | mihir2510/SuperML | e2c236a3a1e64c4bc480ba853e61b14349bd4b6f | [
"MIT"
] | 1 | 2021-06-12T15:17:34.000Z | 2021-06-12T15:17:34.000Z | auto_machine_learning/ensembling/super_learner.py | mihir2510/SuperML | e2c236a3a1e64c4bc480ba853e61b14349bd4b6f | [
"MIT"
] | 1 | 2022-02-20T06:45:12.000Z | 2022-02-20T06:45:12.000Z | auto_machine_learning/ensembling/super_learner.py | mihir2510/SuperML | e2c236a3a1e64c4bc480ba853e61b14349bd4b6f | [
"MIT"
] | 1 | 2021-05-31T15:44:25.000Z | 2021-05-31T15:44:25.000Z | from auto_machine_learning.utils import get_model
from sklearn.model_selection import train_test_split, KFold, StratifiedKFold, cross_val_score, cross_validate
from auto_machine_learning.data_preprocessing.preprocessing import dataset_split
from auto_machine_learning.hyperparameter_optimization.hpo_methods import bayes... | 37.167513 | 192 | 0.532232 |
b8cb6679a9562f2b9bd592406f9caf983e3d226c | 33,793 | py | Python | pandas/io/html.py | donehower/pandas | ed20822a54e3863b393554ecca801654af105555 | [
"BSD-3-Clause"
] | 2 | 2019-12-03T15:35:09.000Z | 2019-12-04T03:28:42.000Z | pandas/io/html.py | donehower/pandas | ed20822a54e3863b393554ecca801654af105555 | [
"BSD-3-Clause"
] | null | null | null | pandas/io/html.py | donehower/pandas | ed20822a54e3863b393554ecca801654af105555 | [
"BSD-3-Clause"
] | null | null | null | """
:mod:`pandas.io.html` is a module containing functionality for dealing with
HTML IO.
"""
from collections import abc
import numbers
import os
import re
from pandas.compat._optional import import_optional_dependency
from pandas.errors import AbstractMethodError, EmptyDataError
from pandas.core.dtypes.common impo... | 30.748863 | 88 | 0.593703 |
0a427f663c4eb3d68457156416d2ce2558a540f9 | 11,204 | py | Python | chb/elfformat/ELFSection.py | psifertex/CodeHawk-Binary | 1711d7b16d32a2e9ffa9d22af483182b3f9ded77 | [
"MIT"
] | null | null | null | chb/elfformat/ELFSection.py | psifertex/CodeHawk-Binary | 1711d7b16d32a2e9ffa9d22af483182b3f9ded77 | [
"MIT"
] | null | null | null | chb/elfformat/ELFSection.py | psifertex/CodeHawk-Binary | 1711d7b16d32a2e9ffa9d22af483182b3f9ded77 | [
"MIT"
] | null | null | null | # ------------------------------------------------------------------------------
# Access to the CodeHawk Binary Analyzer Analysis Results
# Author: Henny Sipma
# ------------------------------------------------------------------------------
# The MIT License (MIT)
#
# Copyright (c) 2016-2020 Kestrel Technology LLC
#
#... | 30.199461 | 80 | 0.590057 |
e1eebb5ac2e8c6058df88eb4f96db81aa639011e | 1,070 | py | Python | Lib/encodings/iso2022_jp_3.py | sireliah/polish-python | 605df4944c2d3bc25f8bf6964b274c0a0d297cc3 | [
"PSF-2.0"
] | 1 | 2018-06-21T18:21:24.000Z | 2018-06-21T18:21:24.000Z | Lib/encodings/iso2022_jp_3.py | sireliah/polish-python | 605df4944c2d3bc25f8bf6964b274c0a0d297cc3 | [
"PSF-2.0"
] | null | null | null | Lib/encodings/iso2022_jp_3.py | sireliah/polish-python | 605df4944c2d3bc25f8bf6964b274c0a0d297cc3 | [
"PSF-2.0"
] | null | null | null | #
# iso2022_jp_3.py: Python Unicode Codec dla ISO2022_JP_3
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
zaimportuj _codecs_iso2022, codecs
zaimportuj _multibytecodec jako mbc
codec = _codecs_iso2022.getcodec('iso2022_jp_3')
klasa Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
klasa ... | 26.75 | 74 | 0.716822 |
7de8b2dba9c116b7b0958bdc7fae7d518729ac59 | 1,394 | py | Python | OpenGLWrapper_JE/venv/Lib/site-packages/OpenGL/GL/ATI/texture_mirror_once.py | JE-Chen/je_old_repo | a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5 | [
"MIT"
] | null | null | null | OpenGLWrapper_JE/venv/Lib/site-packages/OpenGL/GL/ATI/texture_mirror_once.py | JE-Chen/je_old_repo | a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5 | [
"MIT"
] | null | null | null | OpenGLWrapper_JE/venv/Lib/site-packages/OpenGL/GL/ATI/texture_mirror_once.py | JE-Chen/je_old_repo | a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5 | [
"MIT"
] | null | null | null | '''OpenGL extension ATI.texture_mirror_once
This module customises the behaviour of the
OpenGL.raw.GL.ATI.texture_mirror_once to provide a more
Python-friendly API
Overview (from the spec)
ATI_texture_mirror_once extends the set of texture wrap modes to
include two modes (GL_MIRROR_CLAMP_ATI, GL_MIRRO... | 38.722222 | 74 | 0.783357 |
e8ead1a623cd41d41285d2f17efc0773d47cf575 | 8,658 | py | Python | codes/test_Vid4_REDS4_with_GT.py | evggenshch/EDVR | ffcf0ca6b9f6f526c35b1d59dfdc75eb1757e2ec | [
"Apache-2.0"
] | null | null | null | codes/test_Vid4_REDS4_with_GT.py | evggenshch/EDVR | ffcf0ca6b9f6f526c35b1d59dfdc75eb1757e2ec | [
"Apache-2.0"
] | null | null | null | codes/test_Vid4_REDS4_with_GT.py | evggenshch/EDVR | ffcf0ca6b9f6f526c35b1d59dfdc75eb1757e2ec | [
"Apache-2.0"
] | null | null | null | '''
Test Vid4 (SR) and REDS4 (SR-clean, SR-blur, deblur-clean, deblur-compression) datasets
'''
import os
import os.path as osp
import glob
import logging
import numpy as np
import cv2
import torch
import utils.util as util
import data.util as data_util
import models.archs.EDVR_arch as EDVR_arch
def main():
###... | 41.425837 | 100 | 0.588704 |
36489d44f30e577b85aacf2982683f756c3b98c1 | 441 | py | Python | basic/Pyshop/venv/Scripts/easy_install-3.8-script.py | IsAlbertLiu/Python-basics | 49c0c93fb7d1abb70548854b69346eb5837ba00d | [
"MIT"
] | null | null | null | basic/Pyshop/venv/Scripts/easy_install-3.8-script.py | IsAlbertLiu/Python-basics | 49c0c93fb7d1abb70548854b69346eb5837ba00d | [
"MIT"
] | null | null | null | basic/Pyshop/venv/Scripts/easy_install-3.8-script.py | IsAlbertLiu/Python-basics | 49c0c93fb7d1abb70548854b69346eb5837ba00d | [
"MIT"
] | null | null | null | #!E:\Python-Demo\Pyshop\venv\Scripts\python.exe
# EASY-INSTALL-ENTRY-SCRIPT: 'setuptools==40.8.0','console_scripts','easy_install-3.8'
__requires__ = 'setuptools==40.8.0'
import re
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', ... | 33.923077 | 87 | 0.684807 |
9c58f7c7ae39aefebb352373441f8d71ce911a18 | 1,373 | py | Python | ext/grib_api/examples/python/keys_iterator_gts.py | Jojas/GribApi.NET | 9c5cce0df0fa323e35946105ef05b9b871090693 | [
"Apache-2.0"
] | 1 | 2021-02-02T00:36:17.000Z | 2021-02-02T00:36:17.000Z | ext/grib_api/examples/python/keys_iterator_gts.py | Jojas/GribApi.NET | 9c5cce0df0fa323e35946105ef05b9b871090693 | [
"Apache-2.0"
] | null | null | null | ext/grib_api/examples/python/keys_iterator_gts.py | Jojas/GribApi.NET | 9c5cce0df0fa323e35946105ef05b9b871090693 | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2005-2016 ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
#
# In applying this licence, ECMWF does not waive the privileges and immunities granted to it by
# virtue of its status as an intergovern... | 24.517857 | 99 | 0.656227 |
42430810c7501214c15df3809e43aa01fea44f0f | 7,059 | py | Python | openstack_dashboard/dashboards/project/volumes/backups/tests.py | ankur-gupta91/horizoncinder | 860e77bbc9dc47c0e63e0ef4b8103274952e2f3e | [
"Apache-2.0"
] | null | null | null | openstack_dashboard/dashboards/project/volumes/backups/tests.py | ankur-gupta91/horizoncinder | 860e77bbc9dc47c0e63e0ef4b8103274952e2f3e | [
"Apache-2.0"
] | null | null | null | openstack_dashboard/dashboards/project/volumes/backups/tests.py | ankur-gupta91/horizoncinder | 860e77bbc9dc47c0e63e0ef4b8103274952e2f3e | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | 41.769231 | 75 | 0.618218 |
40f7617fc05e563db31e4eadd36265a7fadce378 | 6,475 | py | Python | robot_control/scripts/robot_controller.py | Cavalletta98/Behavioral-Architecture-with-Real-Simulation | ffd488badfe0344e09a769e8a54dd9dfeb2c44ea | [
"Apache-2.0"
] | 1 | 2021-03-27T15:35:24.000Z | 2021-03-27T15:35:24.000Z | robot_control/scripts/robot_controller.py | Cavalletta98/Behavioral-Architecture-with-Real-Simulation | ffd488badfe0344e09a769e8a54dd9dfeb2c44ea | [
"Apache-2.0"
] | null | null | null | robot_control/scripts/robot_controller.py | Cavalletta98/Behavioral-Architecture-with-Real-Simulation | ffd488badfe0344e09a769e8a54dd9dfeb2c44ea | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
"""
ROS action server that moves the robot
toward a target position
"""
# Import of libraries
import rospy
from geometry_msgs.msg import Twist, Point, Pose
from nav_msgs.msg import Odometry
from tf import transformations
import math
import actionlib
import actionlib.msg
import robot_con... | 23.981481 | 131 | 0.631042 |
af682e8a365a70e0ff756b634668e48f44ad8362 | 14,950 | py | Python | neo/VM/InteropService.py | Sindbag/neo-python | f570ce99302033b6276e338ee5043449b118ba70 | [
"MIT"
] | 1 | 2021-06-19T04:06:56.000Z | 2021-06-19T04:06:56.000Z | neo/VM/InteropService.py | igormcoelho/neo-python | f570ce99302033b6276e338ee5043449b118ba70 | [
"MIT"
] | null | null | null | neo/VM/InteropService.py | igormcoelho/neo-python | f570ce99302033b6276e338ee5043449b118ba70 | [
"MIT"
] | null | null | null |
from logzero import logger
from neo.VM.Mixins import EquatableMixin
from neocore.BigInteger import BigInteger
from neo.SmartContract import StackItemType
class CollectionMixin:
IsSynchronized = False
SyncRoot = None
@property
def Count(self):
return 0
def Contains(self, item):
... | 25.12605 | 112 | 0.601605 |
893b30db258ac6b03f296e39dbb12b381c66a637 | 8,826 | py | Python | qa/rpc-tests/import-rescan.py | FusionEnergyX/FusionX | c8d72602f2050b5940fb182f9645cd0712cd2784 | [
"MIT"
] | 1 | 2019-03-20T20:33:48.000Z | 2019-03-20T20:33:48.000Z | qa/rpc-tests/import-rescan.py | FusionEnerqyX/FusionX | 4e0d6bd3964f3961a16fc8ea8e8f749bb5c61d6a | [
"MIT"
] | null | null | null | qa/rpc-tests/import-rescan.py | FusionEnerqyX/FusionX | 4e0d6bd3964f3961a16fc8ea8e8f749bb5c61d6a | [
"MIT"
] | 2 | 2019-05-23T15:09:41.000Z | 2019-07-15T13:02: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 rescan behavior of importaddress, importpubkey, importprivkey, and
importmulti RPCs with different... | 47.197861 | 116 | 0.65375 |
da1c289b5eb32deaafa80bd2f7ee66472d09a252 | 2,671 | py | Python | asr/logger/wandb.py | khaykingleb/Automatic-Speech-Recognition | 3f9b89f882a029769a15e6ca7427424fea4a87f9 | [
"MIT"
] | 5 | 2021-12-14T00:11:58.000Z | 2022-01-25T07:07:24.000Z | asr/logger/wandb.py | khaykingleb/Automatic-Speech-Recognition | 3f9b89f882a029769a15e6ca7427424fea4a87f9 | [
"MIT"
] | null | null | null | asr/logger/wandb.py | khaykingleb/Automatic-Speech-Recognition | 3f9b89f882a029769a15e6ca7427424fea4a87f9 | [
"MIT"
] | null | null | null | from datetime import datetime
import numpy as np
class WanDBWriter:
def __init__(self, config, logger):
self.writer = None
self.selected_module = ""
try:
import wandb
wandb.login()
if config['trainer'].get('wandb_project') is None:
rai... | 33.810127 | 116 | 0.611382 |
d5a52ba628a8169e619bfb3aeec38a65a3c48089 | 49,070 | py | Python | Lib/test/test_syntax.py | zhiburt/cpython | 3875a6954741065b136650db67ac533bc70a3eac | [
"0BSD"
] | 1 | 2022-02-11T07:46:02.000Z | 2022-02-11T07:46:02.000Z | Lib/test/test_syntax.py | cmaureir/cpython | 977d99d1cca6ddd87fe6f218bca46e7ef105bd72 | [
"0BSD"
] | 4 | 2022-02-06T16:30:59.000Z | 2022-03-01T21:08:53.000Z | Lib/test/test_syntax.py | cmaureir/cpython | 977d99d1cca6ddd87fe6f218bca46e7ef105bd72 | [
"0BSD"
] | null | null | null | """This module tests SyntaxErrors.
Here's an example of the sort of thing that is tested.
>>> def f(x):
... global x
Traceback (most recent call last):
SyntaxError: name 'x' is parameter and global
The tests are all raise SyntaxErrors. They were created by checking
each C call that raises SyntaxError. There ar... | 31.822309 | 98 | 0.615794 |
b59124f1690dc5d997f28cfdf934a7e9b53ec327 | 2,482 | py | Python | listen/events/event_instance_update.py | korenlev/calipso-cvim | 39278a5cf09c40b26a8a143ccc0c8d437961abc2 | [
"Apache-2.0"
] | null | null | null | listen/events/event_instance_update.py | korenlev/calipso-cvim | 39278a5cf09c40b26a8a143ccc0c8d437961abc2 | [
"Apache-2.0"
] | null | null | null | listen/events/event_instance_update.py | korenlev/calipso-cvim | 39278a5cf09c40b26a8a143ccc0c8d437961abc2 | [
"Apache-2.0"
] | null | null | null | ###############################################################################
# Copyright (c) 2017-2020 Koren Lev (Cisco Systems), #
# Yaron Yogev (Cisco Systems), Ilia Abashin (Cisco Systems) and others #
# #
... | 44.321429 | 82 | 0.551571 |
3ef3fbb454a9d73a8a8618f791c167827a7224d0 | 3,055 | py | Python | enumeration/brute_pwd.py | galletitaoreo/PythonPentest | abd46cc251abfc3fba02d7f03ddd049803dc6047 | [
"MIT"
] | 5 | 2019-08-07T08:59:53.000Z | 2021-05-14T19:35:57.000Z | enumeration/brute_pwd.py | Harusenpai/PythonPentest | abd46cc251abfc3fba02d7f03ddd049803dc6047 | [
"MIT"
] | null | null | null | enumeration/brute_pwd.py | Harusenpai/PythonPentest | abd46cc251abfc3fba02d7f03ddd049803dc6047 | [
"MIT"
] | 2 | 2021-03-31T21:20:19.000Z | 2021-08-28T04:21:12.000Z | #!/usr/bin/env python
import subprocess
import multiprocessing
from multiprocessing import *
import os
import sys
import re
import reconf
from reconf import *
import time
from functools import wraps
import argparse
import ipaddr
import nmapxml
from nmapxml import *
import threading
from easyprocess import EasyProcess
... | 40.733333 | 398 | 0.656628 |
af07871efc7b845e5ffab3590c93a1a19e71bf89 | 8,831 | py | Python | homeassistant/components/firmata/pin.py | basicpail/core | 5cc54618c5af3f75c08314bf2375cc7ac40d2b7e | [
"Apache-2.0"
] | 11 | 2018-02-16T15:35:47.000Z | 2020-01-14T15:20:00.000Z | homeassistant/components/firmata/pin.py | basicpail/core | 5cc54618c5af3f75c08314bf2375cc7ac40d2b7e | [
"Apache-2.0"
] | 79 | 2020-07-23T07:13:37.000Z | 2022-03-22T06:02:37.000Z | homeassistant/components/firmata/pin.py | Vaarlion/core | f3de8b9f28de01abf72c0f5bb0b457eb1841f201 | [
"Apache-2.0"
] | 11 | 2020-12-16T13:48:14.000Z | 2022-02-01T00:28:05.000Z | """Code to handle pins on a Firmata board."""
import logging
from typing import Callable
from .board import FirmataBoard, FirmataPinType
from .const import PIN_MODE_INPUT, PIN_MODE_PULLUP, PIN_TYPE_ANALOG
_LOGGER = logging.getLogger(__name__)
class FirmataPinUsedException(Exception):
"""Represents an exception ... | 33.450758 | 88 | 0.612501 |
1391b4a77786c395d6494f73a035e6b159d66cc6 | 1,158 | py | Python | data/p2DJ/New/program/pyquil/startPyquil195.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p2DJ/New/program/pyquil/startPyquil195.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p2DJ/New/program/pyquil/startPyquil195.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=2
# total number=11
import pyquil
from pyquil.api import local_forest_runtime, QVMConnection
from pyquil import Program, get_qc
from pyquil.gates import *
import numpy as np
conn = QVMConnection()
def make_circuit()-> Program:
prog = Program() # circuit begin
prog += H(0) # number=1
pr... | 22.269231 | 64 | 0.603627 |
c8a0d3d89b599806d44cb97b6f0da72056a6cb16 | 289 | py | Python | plugins/exporter.py | Soldie/Photon-python | 0c5e563eb46b53c817c6baecdf7e89a67a2e7bd4 | [
"Intel"
] | 5 | 2020-01-23T08:35:22.000Z | 2021-12-25T14:11:14.000Z | plugins/exporter.py | Soldie/Photon-python | 0c5e563eb46b53c817c6baecdf7e89a67a2e7bd4 | [
"Intel"
] | null | null | null | plugins/exporter.py | Soldie/Photon-python | 0c5e563eb46b53c817c6baecdf7e89a67a2e7bd4 | [
"Intel"
] | 1 | 2020-01-22T17:43:55.000Z | 2020-01-22T17:43:55.000Z | import json
def exporter(directory, method, datasets):
if method.lower() == 'json':
json_string = json.dumps(datasets, indent=4) # convert json_dict to a json styled string
savefile = open('%s/exported.json' % directory, 'w+') # save
savefile.write(json_string)
savefile.close()
| 32.111111 | 90 | 0.716263 |
f76b80d02fa3f71f0d8ad7f3140fe69d16f0c180 | 1,558 | py | Python | Template/GenerateDocs.py | BriTang1997/ACM | 66cc774aae8e5fd92c02cd93fbdae1c56d53ceb3 | [
"MIT"
] | null | null | null | Template/GenerateDocs.py | BriTang1997/ACM | 66cc774aae8e5fd92c02cd93fbdae1c56d53ceb3 | [
"MIT"
] | null | null | null | Template/GenerateDocs.py | BriTang1997/ACM | 66cc774aae8e5fd92c02cd93fbdae1c56d53ceb3 | [
"MIT"
] | 1 | 2021-05-08T09:35:20.000Z | 2021-05-08T09:35:20.000Z | # -*- coding: utf-8 -*-
#请在python3下的环境编译
#安装依赖pip3 install python-docx
from docx import Document
from docx.shared import Pt
from docx.enum.text import WD_ALIGN_PARAGRAPH
import os
document = Document()
document.add_heading('HHU ACM Template', 0)
p = document.add_paragraph('Writter ')
p.add_run('Luo Longjun, ')... | 33.148936 | 91 | 0.624519 |
f56e19e45c580c4beae0859fcb318ac5f229a777 | 24,943 | py | Python | tests/data/tag_windows.py | cugu-stars/plaso | a205f8e52dfe4c239aeae5558d572806b7b00e81 | [
"Apache-2.0"
] | 2 | 2021-05-31T17:16:48.000Z | 2022-02-01T16:59:12.000Z | tests/data/tag_windows.py | cugu-stars/plaso | a205f8e52dfe4c239aeae5558d572806b7b00e81 | [
"Apache-2.0"
] | null | null | null | tests/data/tag_windows.py | cugu-stars/plaso | a205f8e52dfe4c239aeae5558d572806b7b00e81 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Tests for the tag_windows.txt tagging file."""
import unittest
from plaso.containers import events
from plaso.lib import definitions
from plaso.parsers import filestat
from plaso.parsers import winevt
from plaso.parsers import winevtx
from plaso.parsers import winlnk
... | 39.404423 | 80 | 0.702883 |
508a0c359af348f3c8d124e41e178b51f3d64bab | 3,355 | py | Python | app/request.py | Roseoketch/News-Highligts | a29e3697e6d283711a3f72742bf669664651e197 | [
"MIT"
] | null | null | null | app/request.py | Roseoketch/News-Highligts | a29e3697e6d283711a3f72742bf669664651e197 | [
"MIT"
] | null | null | null | app/request.py | Roseoketch/News-Highligts | a29e3697e6d283711a3f72742bf669664651e197 | [
"MIT"
] | null | null | null | import urllib.request
import json
from .models import Source,Article
import ssl
ssl._create_default_https_context = ssl._create_unverified_context
url = urllib.request.urlopen("http://google.com")
print(url.read())
#getting api key
api_key = None
#getting news base url
base_url = None
article_url = None
def con... | 29.955357 | 97 | 0.684352 |
4b094efe4b5708133f7975457f8f5b02dc76c2af | 440 | py | Python | WizardWars/Content/Scripts/cantrip.py | minalear/WizardWarsCCG | 18cddc979ac9777e5a77e0e129a78e46984fa01c | [
"MIT"
] | null | null | null | WizardWars/Content/Scripts/cantrip.py | minalear/WizardWarsCCG | 18cddc979ac9777e5a77e0e129a78e46984fa01c | [
"MIT"
] | null | null | null | WizardWars/Content/Scripts/cantrip.py | minalear/WizardWarsCCG | 18cddc979ac9777e5a77e0e129a78e46984fa01c | [
"MIT"
] | null | null | null | import System
from WizardWars import *
class DrawCard(Ability):
def __init__(self):
self.Type = AbilityTypes.Cast
def Execute(self, gameState, card):
card.Controller.DrawCards(1)
card = CardInfo("Cantrip", "cantrip.png", 1)
card.RulesText = "Draw a card."
card.FlavorText = "Even the most powerful mages still r... | 29.333333 | 81 | 0.765909 |
64973ae8eef9624cdcd1d59ec5b20daa58ec9e3a | 1,342 | py | Python | jp.atcoder/agc036/agc036_b/28051611.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | 1 | 2022-02-09T03:06:25.000Z | 2022-02-09T03:06:25.000Z | jp.atcoder/agc036/agc036_b/28051611.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | 1 | 2022-02-05T22:53:18.000Z | 2022-02-09T01:29:30.000Z | jp.atcoder/agc036/agc036_b/28051611.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | null | null | null | import bisect
import typing
def main() -> typing.NoReturn:
n, k = map(int, input().split())
a = list(map(int, input().split()))
if n == 1:
if k & 1:
print(a[0])
else:
print()
return
m = 1 << 18
nxt = [-1] * m
for i in range(n):
... | 20.646154 | 40 | 0.359165 |
0df077233d1c57f3f16d5daf656d5672ed415182 | 388 | py | Python | csv2ofx/mappings/starling.py | snmishra/csv2ofx | 41f8bca9cc1782b8a977e43eda995a74b10ec1bb | [
"MIT"
] | null | null | null | csv2ofx/mappings/starling.py | snmishra/csv2ofx | 41f8bca9cc1782b8a977e43eda995a74b10ec1bb | [
"MIT"
] | null | null | null | csv2ofx/mappings/starling.py | snmishra/csv2ofx | 41f8bca9cc1782b8a977e43eda995a74b10ec1bb | [
"MIT"
] | null | null | null | from operator import itemgetter
def fixdate(ds):
dmy = ds.split("/")
# BUG (!?): don't understand but stolen from ubs-ch-fr.py
return ".".join((dmy[1], dmy[0], dmy[2]))
mapping = {
"has_header": True,
"date": lambda tr: fixdate(tr["Date"]),
"amount": itemgetter("Amount (GBP)"),
"desc": i... | 22.823529 | 61 | 0.597938 |
c713978a1870ed4ed04bcae26d55b22b91815445 | 13,322 | py | Python | coverage/debug.py | simonw/coveragepy | 694435b844760ca0443cf87bf73a537f06c37d7d | [
"Apache-2.0"
] | null | null | null | coverage/debug.py | simonw/coveragepy | 694435b844760ca0443cf87bf73a537f06c37d7d | [
"Apache-2.0"
] | null | null | null | coverage/debug.py | simonw/coveragepy | 694435b844760ca0443cf87bf73a537f06c37d7d | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt
"""Control of and utilities for debugging."""
import contextlib
import functools
import inspect
import itertools
import os
import pprint
import sys
try:
import... | 33.984694 | 98 | 0.597658 |
400ea15983e2a6dd70a7d1270ce1b5738f63b9dd | 5,243 | py | Python | analysis/compile_results.py | MengXia97/Mod-Demod | 353e187ea1537f37a87855cd27e1e66bd46c2c48 | [
"MIT"
] | null | null | null | analysis/compile_results.py | MengXia97/Mod-Demod | 353e187ea1537f37a87855cd27e1e66bd46c2c48 | [
"MIT"
] | null | null | null | analysis/compile_results.py | MengXia97/Mod-Demod | 353e187ea1537f37a87855cd27e1e66bd46c2c48 | [
"MIT"
] | null | null | null | # To get directory structure working
import os
import sys
import numpy as np
ANALYSIS_DIR = os.path.dirname(os.path.realpath(__file__))
sys.path.append("%s/../utils" % ANALYSIS_DIR)
sys.path.append("%s/../" % ANALYSIS_DIR)
def process_experiment(results_dir):
if not os.path.isdir(results_dir):
return
... | 50.902913 | 114 | 0.591837 |
4529f96fa670b55a7beb72d7b7c2aa897910de26 | 3,073 | py | Python | sent2vec/splitter.py | pdrm83/sent2vec | 4748d79f1de585ba884f4641cd1a012b8b6535f9 | [
"MIT"
] | 99 | 2020-10-09T08:51:22.000Z | 2022-03-26T22:29:39.000Z | sent2vec/splitter.py | pdrm83/sent2vec | 4748d79f1de585ba884f4641cd1a012b8b6535f9 | [
"MIT"
] | 11 | 2020-10-08T15:53:15.000Z | 2022-02-17T21:35:40.000Z | sent2vec/splitter.py | pdrm83/sent2vec | 4748d79f1de585ba884f4641cd1a012b8b6535f9 | [
"MIT"
] | 8 | 2020-11-11T14:46:41.000Z | 2022-03-27T11:53:30.000Z | import os
import re
import spacy
os.environ['LANGUAGE_MODEL_SPACY'] = "en_core_web_md"
nlp = spacy.load(os.environ['LANGUAGE_MODEL_SPACY'])
sentencizer = nlp.create_pipe("sentencizer")
nlp.add_pipe(sentencizer)
class Splitter:
def __init__(self):
self.words = []
self.sentences = []
def sent... | 34.52809 | 113 | 0.537911 |
85fd4ae2e2eb596845cbb0d6da8ea8c6963901c4 | 14,160 | py | Python | gcft_ui/j3d_tab.py | LagoLunatic/GCFT | d838614804058c7b7ea5c62b37251a2795f5c791 | [
"MIT"
] | 38 | 2020-01-14T01:20:15.000Z | 2022-02-15T00:03:33.000Z | gcft_ui/j3d_tab.py | LagoLunatic/GCFT | d838614804058c7b7ea5c62b37251a2795f5c791 | [
"MIT"
] | 7 | 2020-01-13T18:08:07.000Z | 2022-01-13T02:20:30.000Z | gcft_ui/j3d_tab.py | LagoLunatic/GCFT | d838614804058c7b7ea5c62b37251a2795f5c791 | [
"MIT"
] | 1 | 2021-09-23T19:30:55.000Z | 2021-09-23T19:30:55.000Z |
import os
import re
import traceback
from io import BytesIO
from fs_helpers import *
from PySide2.QtGui import *
from PySide2.QtCore import *
from PySide2.QtWidgets import *
from wwlib.j3d import J3DFile, BPRegister, XFRegister
from gcft_ui.uic.ui_j3d_tab import Ui_J3DTab
class J3DTab(QWidget):
def __init__(self):... | 38.27027 | 122 | 0.682839 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.