hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f731fb3d75d9b93685c1d1a5612a918a4923c2b5 | 3,402 | py | Python | cogs/Member_Log.py | yutarou12/keibot-python | 4a7e869bf3fc43d5cc3eddd442a3318e7cb98a7f | [
"MIT"
] | 1 | 2021-06-12T23:21:52.000Z | 2021-06-12T23:21:52.000Z | cogs/Member_Log.py | yutarou12/keibot-python | 4a7e869bf3fc43d5cc3eddd442a3318e7cb98a7f | [
"MIT"
] | null | null | null | cogs/Member_Log.py | yutarou12/keibot-python | 4a7e869bf3fc43d5cc3eddd442a3318e7cb98a7f | [
"MIT"
] | null | null | null | from datetime import datetime, timedelta
import sqlite3
from discord import Embed, AllowedMentions
from discord.ext import commands
from pytz import timezone
class Member_Log(commands.Cog):
"""メンバー用のログ機能関連のコマンドがあります。"""
def __init__(self, bot):
self.bot = bot
self.welcome_notice = []
... | 45.972973 | 103 | 0.61699 | from datetime import datetime, timedelta
import sqlite3
from discord import Embed, AllowedMentions
from discord.ext import commands
from pytz import timezone
class Member_Log(commands.Cog):
def __init__(self, bot):
self.bot = bot
self.welcome_notice = []
self.bot.loop.create_task(self.set... | true | true |
f731fb8e98454206f951ad629d427c908be3673f | 20,599 | py | Python | dnsuptools/dnsuptools.py | TheTesla/dnsupdate | 1be992718c5e678a750b4f69bf94706583408365 | [
"MIT"
] | 1 | 2019-06-04T18:46:00.000Z | 2019-06-04T18:46:00.000Z | dnsuptools/dnsuptools.py | TheTesla/dnsupdate | 1be992718c5e678a750b4f69bf94706583408365 | [
"MIT"
] | null | null | null | dnsuptools/dnsuptools.py | TheTesla/dnsupdate | 1be992718c5e678a750b4f69bf94706583408365 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- encoding: UTF8 -*-
from dnsuptools.dnsupdate import defaultDictList, MatchUpperLabels, DNSUpdate
from dnsuptools.tlsarecgen import tlsaRecordsFromCertFile, tlsaFromFile
from dnsuptools.dkimrecgen import dkimFromFile
from simpleloggerplus import simpleloggerplus as log
import re
import pyc... | 34.047934 | 223 | 0.572455 |
from dnsuptools.dnsupdate import defaultDictList, MatchUpperLabels, DNSUpdate
from dnsuptools.tlsarecgen import tlsaRecordsFromCertFile, tlsaFromFile
from dnsuptools.dkimrecgen import dkimFromFile
from simpleloggerplus import simpleloggerplus as log
import re
import pycurl
from io import BytesIO
import socket
import... | true | true |
f731fb916b3a3a9052f6cc548e01758b391e942f | 1,647 | py | Python | curriculum/03_functions_02_numbers/03_02_02_number_cruncher.py | google/teknowledge | aa55aa59c287f5fe3052e89d539f44252eee41a8 | [
"Apache-2.0"
] | 31 | 2017-11-11T09:10:57.000Z | 2021-10-13T22:53:57.000Z | curriculum/03_functions_02_numbers/03_02_02_number_cruncher.py | google/teknowledge | aa55aa59c287f5fe3052e89d539f44252eee41a8 | [
"Apache-2.0"
] | null | null | null | curriculum/03_functions_02_numbers/03_02_02_number_cruncher.py | google/teknowledge | aa55aa59c287f5fe3052e89d539f44252eee41a8 | [
"Apache-2.0"
] | 14 | 2017-11-10T02:19:42.000Z | 2021-10-13T22:53:47.000Z | def add(x, y):
return x + y
def crunchNumbers():
print("How do you want me to crunch two numbers? ")
crunchFunction = input("Type add or something else: ")
num1 = input('First number: ')
num2 = input('Second number: ')
if crunchFunction == "add":
answer = add(num1, num2)
... | 35.042553 | 80 | 0.621736 | def add(x, y):
return x + y
def crunchNumbers():
print("How do you want me to crunch two numbers? ")
crunchFunction = input("Type add or something else: ")
num1 = input('First number: ')
num2 = input('Second number: ')
if crunchFunction == "add":
answer = add(num1, num2)
... | true | true |
f731fb9fe546857a3efba23ec45fc75883cfbe59 | 2,382 | py | Python | jogoteca/jogoteca.py | SkiereszDiego/Cursos_Alura | 8cebcfa317c47871a698e4328a3851c404d2267b | [
"MIT"
] | null | null | null | jogoteca/jogoteca.py | SkiereszDiego/Cursos_Alura | 8cebcfa317c47871a698e4328a3851c404d2267b | [
"MIT"
] | null | null | null | jogoteca/jogoteca.py | SkiereszDiego/Cursos_Alura | 8cebcfa317c47871a698e4328a3851c404d2267b | [
"MIT"
] | null | null | null | from flask import Flask, render_template, request, redirect, session, flash, url_for
app = Flask(__name__)
app.secret_key = 'alura'
class Jogo:
def __init__(self, nome, categoria, console):
self.nome = nome
self.categoria = categoria
self.console = console
class Usuario:
... | 29.775 | 85 | 0.612091 | from flask import Flask, render_template, request, redirect, session, flash, url_for
app = Flask(__name__)
app.secret_key = 'alura'
class Jogo:
def __init__(self, nome, categoria, console):
self.nome = nome
self.categoria = categoria
self.console = console
class Usuario:
... | true | true |
f731fc41c567abb5f04fc347849d441eeca55453 | 11,732 | py | Python | deepmap_cli/cli.py | yim-deepmap/cli | bf5fd3afe4d94c70f0b37111be2f749572b53ec7 | [
"Apache-2.0"
] | null | null | null | deepmap_cli/cli.py | yim-deepmap/cli | bf5fd3afe4d94c70f0b37111be2f749572b53ec7 | [
"Apache-2.0"
] | null | null | null | deepmap_cli/cli.py | yim-deepmap/cli | bf5fd3afe4d94c70f0b37111be2f749572b53ec7 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
""" A command line interface for the Deepmap API. """
import argparse
import sys
import os
from deepmap_cli.constants import USER_CONFIG_PATH
from deepmap_cli.cli_requests import make_request
def init_cli():
""" Initializes the CLI. """
parser = argparse.ArgumentParser(
prog='... | 36.434783 | 96 | 0.670389 |
import argparse
import sys
import os
from deepmap_cli.constants import USER_CONFIG_PATH
from deepmap_cli.cli_requests import make_request
def init_cli():
parser = argparse.ArgumentParser(
prog='deepmap',
formatter_class=argparse.RawDescriptionHelpFormatter,
description="Possible commands... | true | true |
f731fcf55c0b961d14a2de8a323e7d7f817e7911 | 657 | py | Python | from_python_community/get_century.py | ZaytsevNS/python_practice | 109e14923a2ddeacc5360fd72947275afd2159e3 | [
"MIT"
] | null | null | null | from_python_community/get_century.py | ZaytsevNS/python_practice | 109e14923a2ddeacc5360fd72947275afd2159e3 | [
"MIT"
] | null | null | null | from_python_community/get_century.py | ZaytsevNS/python_practice | 109e14923a2ddeacc5360fd72947275afd2159e3 | [
"MIT"
] | null | null | null | # Условие:
# Написать простую функцию, которая будет возвращать век, на основе года.
# Пример:
# get_century(2021) -> 21
# get_century(1999) -> 20
# get_century(2000) -> 20
# get_century(101) -> 2
import unittest
def get_century(n: int) -> int:
a, b = divmod(n, 100)
return a + 1 if b > 0 else a
class Tes... | 22.655172 | 73 | 0.649924 |
import unittest
def get_century(n: int) -> int:
a, b = divmod(n, 100)
return a + 1 if b > 0 else a
class TestGetCentury(unittest.TestCase):
def test_one(self):
self.assertEqual(21, get_century(2021))
self.assertEqual(20, get_century(1999))
self.assertEqual(20, get_century(2000... | true | true |
f731fe0518ecc272120697d6ea77fda740bb2ada | 2,565 | py | Python | tests/test_app.py | mogul/github-issue-lifecycle | c31a753b904799c57a7468bf590a280e8be3bb6f | [
"CC0-1.0"
] | 1 | 2017-06-08T11:37:21.000Z | 2017-06-08T11:37:21.000Z | tests/test_app.py | mogul/github-issue-lifecycle | c31a753b904799c57a7468bf590a280e8be3bb6f | [
"CC0-1.0"
] | 2 | 2016-10-20T20:39:17.000Z | 2016-10-20T20:45:50.000Z | tests/test_app.py | mogul/github-issue-lifecycle | c31a753b904799c57a7468bf590a280e8be3bb6f | [
"CC0-1.0"
] | 3 | 2016-10-20T20:32:06.000Z | 2021-02-15T10:00:02.000Z | import unittest
from unittest import mock
import requests
from flask.ext.testing import TestCase
from app import db, models
from app.app import app
from config import config
from .mock_github import requests_get_stub
app.config.from_object(config['testing'])
class AppTestCase(TestCase):
def create_app(self):
... | 31.666667 | 79 | 0.62768 | import unittest
from unittest import mock
import requests
from flask.ext.testing import TestCase
from app import db, models
from app.app import app
from config import config
from .mock_github import requests_get_stub
app.config.from_object(config['testing'])
class AppTestCase(TestCase):
def create_app(self):
... | true | true |
f731ff23a6b491175ed0b509bddbf9dfdcfb99b4 | 12,069 | py | Python | yolov3_tiny_deer_detection/evaluate_mAP.py | Pradeep-Gopal/yolo_deer_people_final_project | 2337e8cbb88f467a6d19ab9cdb14abbf2ba04bc2 | [
"MIT"
] | null | null | null | yolov3_tiny_deer_detection/evaluate_mAP.py | Pradeep-Gopal/yolo_deer_people_final_project | 2337e8cbb88f467a6d19ab9cdb14abbf2ba04bc2 | [
"MIT"
] | null | null | null | yolov3_tiny_deer_detection/evaluate_mAP.py | Pradeep-Gopal/yolo_deer_people_final_project | 2337e8cbb88f467a6d19ab9cdb14abbf2ba04bc2 | [
"MIT"
] | null | null | null |
import os
os.environ['CUDA_VISIBLE_DEVICES'] = '0'
import cv2
import numpy as np
import tensorflow as tf
from tensorflow.python.saved_model import tag_constants
from yolov3.dataset import Dataset
from yolov3.yolov4 import Create_Yolo
from yolov3.utils import load_yolo_weights, detect_image, image_preprocess, postproce... | 41.761246 | 128 | 0.567653 |
import os
os.environ['CUDA_VISIBLE_DEVICES'] = '0'
import cv2
import numpy as np
import tensorflow as tf
from tensorflow.python.saved_model import tag_constants
from yolov3.dataset import Dataset
from yolov3.yolov4 import Create_Yolo
from yolov3.utils import load_yolo_weights, detect_image, image_preprocess, postproce... | true | true |
f731ff9471a2cbbe6e265123faf63ee9b93f92f6 | 33,241 | py | Python | frappe/database/database.py | rizkiheryandi/frappe | 1767d87dfd90be4f8b62e85af53f1ebc74dec370 | [
"MIT"
] | 1 | 2021-04-02T15:23:12.000Z | 2021-04-02T15:23:12.000Z | frappe/database/database.py | rizkiheryandi/frappe | 1767d87dfd90be4f8b62e85af53f1ebc74dec370 | [
"MIT"
] | null | null | null | frappe/database/database.py | rizkiheryandi/frappe | 1767d87dfd90be4f8b62e85af53f1ebc74dec370 | [
"MIT"
] | null | null | null | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
# Database Module
# --------------------
from __future__ import unicode_literals
import re
import time
import frappe
import datetime
import frappe.defaults
import frappe.model.meta
from frappe import _
from time impo... | 31.182927 | 122 | 0.686682 |
from __future__ import unicode_literals
import re
import time
import frappe
import datetime
import frappe.defaults
import frappe.model.meta
from frappe import _
from time import time
from frappe.utils import now, getdate, cast_fieldtype, get_datetime
from frappe.model.utils.link_count import flush_local_link_count
... | true | true |
f731ffc418c409ea5c8ec121e5505721921146e2 | 164 | py | Python | natwork/chats/admin.py | Potisin/Natwork | a42b89f18fdd8f8ac69e56cb7184696d6883a9f7 | [
"BSD-3-Clause"
] | null | null | null | natwork/chats/admin.py | Potisin/Natwork | a42b89f18fdd8f8ac69e56cb7184696d6883a9f7 | [
"BSD-3-Clause"
] | null | null | null | natwork/chats/admin.py | Potisin/Natwork | a42b89f18fdd8f8ac69e56cb7184696d6883a9f7 | [
"BSD-3-Clause"
] | null | null | null | from django.contrib import admin
from .models import Chat
class ChatAdmin(admin.ModelAdmin):
list_display = ("pk",)
admin.site.register(Chat, ChatAdmin)
| 12.615385 | 36 | 0.737805 | from django.contrib import admin
from .models import Chat
class ChatAdmin(admin.ModelAdmin):
list_display = ("pk",)
admin.site.register(Chat, ChatAdmin)
| true | true |
f73201674c64269afedc778a05e242056dcf0449 | 2,282 | py | Python | tests/models/symbol/ioc_dump_retrieve_start_details_test.py | NetApp/santricity-webapi-pythonsdk | 1d3df4a00561192f4cdcdd1890f4d27547ed2de2 | [
"BSD-3-Clause-Clear"
] | 5 | 2016-08-23T17:52:22.000Z | 2019-05-16T08:45:30.000Z | tests/models/symbol/ioc_dump_retrieve_start_details_test.py | NetApp/santricity-webapi-pythonsdk | 1d3df4a00561192f4cdcdd1890f4d27547ed2de2 | [
"BSD-3-Clause-Clear"
] | 2 | 2016-11-10T05:30:21.000Z | 2019-04-05T15:03:37.000Z | tests/models/symbol/ioc_dump_retrieve_start_details_test.py | NetApp/santricity-webapi-pythonsdk | 1d3df4a00561192f4cdcdd1890f4d27547ed2de2 | [
"BSD-3-Clause-Clear"
] | 7 | 2016-08-25T16:11:44.000Z | 2021-02-22T05:31:25.000Z | #!/usr/bin/env python
# coding: utf-8
"""
The Clear BSD License
Copyright (c) – 2016, NetApp, Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted (subject to the limitations in the disclaimer below) provided that the following conditions... | 60.052632 | 845 | 0.783523 |
import unittest
from netapp.santricity.models.symbol.ioc_dump_retrieve_start_details import IOCDumpRetrieveStartDetails
class IOCDumpRetrieveStartDetailsTest(unittest.TestCase):
def test_ioc_dump_retrieve_start_details(self):
ioc_dump_retrieve_start_details_obj = IOCDumpRetrieveStart... | true | true |
f73201bccc5b600843b87458b521f0313fadcc75 | 355 | py | Python | tests/mssql_test.py | technetbytes/ModelService | 5268d53b4bedb400d8ba4a326297fa7f6b8bc666 | [
"Apache-2.0"
] | 2 | 2020-04-06T07:59:02.000Z | 2020-04-06T07:59:04.000Z | tests/mssql_test.py | technetbytes/ModelService | 5268d53b4bedb400d8ba4a326297fa7f6b8bc666 | [
"Apache-2.0"
] | 2 | 2020-04-06T12:13:34.000Z | 2020-04-06T13:49:29.000Z | tests/mssql_test.py | technetbytes/Pythonic-Template | 78b565359d640b208ed6189ebefc5760751c16d7 | [
"Apache-2.0"
] | null | null | null | import unittest
from db import mssql
def connect_mssql():
obj_sql = mssql.MsSqlDb(None)
conn = obj_sql.get_connection
if conn is None:
return False
else:
return True
class MyTest(unittest.TestCase):
def test(self):
self.assertTrue(connect_mssql(), True)
if __name__... | 20.882353 | 46 | 0.650704 | import unittest
from db import mssql
def connect_mssql():
obj_sql = mssql.MsSqlDb(None)
conn = obj_sql.get_connection
if conn is None:
return False
else:
return True
class MyTest(unittest.TestCase):
def test(self):
self.assertTrue(connect_mssql(), True)
if __name__... | true | true |
f732029a686f8b8f4cf7e9bb74a3d607318b643a | 1,396 | py | Python | client/main.py | naoki-sawada/m5stack-ble | 57b464cfbbf60bf232ac3a8480499890a07a2d8e | [
"MIT"
] | 37 | 2018-08-08T11:10:45.000Z | 2022-02-21T12:19:13.000Z | client/main.py | naoki-sawada/m5stack-ble | 57b464cfbbf60bf232ac3a8480499890a07a2d8e | [
"MIT"
] | 2 | 2020-08-30T02:44:16.000Z | 2021-11-29T10:12:57.000Z | client/main.py | naoki-sawada/m5stack-ble | 57b464cfbbf60bf232ac3a8480499890a07a2d8e | [
"MIT"
] | 7 | 2019-08-17T15:37:30.000Z | 2021-03-14T15:43:22.000Z | #!/usr/bin/env python3
import asyncio
import logging
import uuid
from bleak import BleakScanner, BleakClient
# Enable debug output
# logging.basicConfig(level=logging.DEBUG)
DEVICE_NAME = "m5-stack"
SERVICE_UUID = uuid.UUID("4fafc201-1fb5-459e-8fcc-c5c9c331914b")
CHAR_UUID = uuid.UUID("beb5483e-36e1-4688-b7f5-ea0736... | 29.702128 | 75 | 0.68553 | import asyncio
import logging
import uuid
from bleak import BleakScanner, BleakClient
DEVICE_NAME = "m5-stack"
SERVICE_UUID = uuid.UUID("4fafc201-1fb5-459e-8fcc-c5c9c331914b")
CHAR_UUID = uuid.UUID("beb5483e-36e1-4688-b7f5-ea07361b26a8")
async def run(loop):
print("Searching devices...")
devices = await Bl... | true | true |
f732040accb451226761ed261b82111127e933b2 | 1,220 | py | Python | 4. Data Warehousing with AWS Redshift/redshift_cluster_teardown.py | jrderek/Data-Engineering-projects | c4903b28fcf6ec2d78e8543ec490b9be6d0c35ad | [
"MIT"
] | null | null | null | 4. Data Warehousing with AWS Redshift/redshift_cluster_teardown.py | jrderek/Data-Engineering-projects | c4903b28fcf6ec2d78e8543ec490b9be6d0c35ad | [
"MIT"
] | null | null | null | 4. Data Warehousing with AWS Redshift/redshift_cluster_teardown.py | jrderek/Data-Engineering-projects | c4903b28fcf6ec2d78e8543ec490b9be6d0c35ad | [
"MIT"
] | null | null | null | import boto3
import configparser
def main():
"""
Description:
- Sets up a Redshift cluster on AWS
Returns:
None
"""
KEY = config.get('AWS','KEY')
SECRET = config.get('AWS','SECRET')
DWH_CLUSTER_IDENTIFIER = config.get("DWH","DWH_CLUSTE... | 32.972973 | 86 | 0.568852 | import boto3
import configparser
def main():
KEY = config.get('AWS','KEY')
SECRET = config.get('AWS','SECRET')
DWH_CLUSTER_IDENTIFIER = config.get("DWH","DWH_CLUSTER_IDENTIFIER")
DWH_IAM_ROLE_NAME = config.get("DWH", "DWH_IAM_ROLE_NAME")
redshift = boto3.cli... | true | true |
f7320490c051b51caf2f1913b631c004f6196e85 | 5,301 | py | Python | create_json.py | rakaar/Narmada-server | 2d241bf6205332534abd2bd75f3283781564106a | [
"MIT"
] | 2 | 2021-05-28T01:37:04.000Z | 2021-09-20T14:51:42.000Z | create_json.py | rakaar/Narmada-server | 2d241bf6205332534abd2bd75f3283781564106a | [
"MIT"
] | 3 | 2021-05-12T18:15:54.000Z | 2022-03-12T00:58:06.000Z | create_json.py | rakaar/Narmada-server | 2d241bf6205332534abd2bd75f3283781564106a | [
"MIT"
] | 2 | 2021-05-12T18:41:02.000Z | 2021-12-08T22:13:11.000Z | import pickle
import sys
import ast
import re
import json
from word2number import w2n
import os, sys
try:
location=sys.argv[1]
except Exception as e:
location='roma'
try:
type_=sys.argv[2]
except Exception as e:
type_='needs'
with open('OUTPUT/'+location+'_'+type_+'.p','rb') as handle:
need_dict=pickle.load(h... | 23.7713 | 179 | 0.660253 | import pickle
import sys
import ast
import re
import json
from word2number import w2n
import os, sys
try:
location=sys.argv[1]
except Exception as e:
location='roma'
try:
type_=sys.argv[2]
except Exception as e:
type_='needs'
with open('OUTPUT/'+location+'_'+type_+'.p','rb') as handle:
need_dict=pickle.load(h... | true | true |
f73207fe8f7010c1550988d7636a3f322d128758 | 20,293 | py | Python | svca_limix/limix/core/mean/mean.py | DenisSch/svca | bd029c120ca8310f43311253e4d7ce19bc08350c | [
"Apache-2.0"
] | 65 | 2015-01-20T20:46:26.000Z | 2021-06-27T14:40:35.000Z | svca_limix/limix/core/mean/mean.py | DenisSch/svca | bd029c120ca8310f43311253e4d7ce19bc08350c | [
"Apache-2.0"
] | 29 | 2015-02-01T22:35:17.000Z | 2017-08-07T08:18:23.000Z | svca_limix/limix/core/mean/mean.py | DenisSch/svca | bd029c120ca8310f43311253e4d7ce19bc08350c | [
"Apache-2.0"
] | 35 | 2015-02-01T17:26:50.000Z | 2019-09-13T07:06:16.000Z | import sys
from limix.core.old.cobj import *
from limix.utils.preprocess import regressOut
import numpy as np
import scipy.linalg as LA
import copy
def compute_X1KX2(Y, D, X1, X2, A1=None, A2=None):
R,C = Y.shape
if A1 is None:
nW_A1 = Y.shape[1]
#A1 = np.eye(Y.shape[1]) #for now this creates... | 33.158497 | 184 | 0.525206 | import sys
from limix.core.old.cobj import *
from limix.utils.preprocess import regressOut
import numpy as np
import scipy.linalg as LA
import copy
def compute_X1KX2(Y, D, X1, X2, A1=None, A2=None):
R,C = Y.shape
if A1 is None:
nW_A1 = Y.shape[1]
else:
nW_A1 = A1.shape[0]
if ... | true | true |
f73208d87a7c1b01380a02572131d5fffaf76eab | 3,888 | py | Python | app/capture.py | karanveersingh5623/EdgeRealtimeVideoAnalytics | 0765ff9145c2163f9e361495fbb0bda147e536cc | [
"Apache-2.0"
] | 22 | 2020-10-31T05:13:37.000Z | 2021-11-17T23:18:29.000Z | app/capture.py | karanveersingh5623/EdgeRealtimeVideoAnalytics | 0765ff9145c2163f9e361495fbb0bda147e536cc | [
"Apache-2.0"
] | null | null | null | app/capture.py | karanveersingh5623/EdgeRealtimeVideoAnalytics | 0765ff9145c2163f9e361495fbb0bda147e536cc | [
"Apache-2.0"
] | 4 | 2021-02-06T11:14:29.000Z | 2021-07-21T23:40:06.000Z | # RedisEdge realtime video analytics video capture script
import argparse
import cv2
import redis
import time
from urllib.parse import urlparse
class SimpleMovingAverage(object):
''' Simple moving average '''
def __init__(self, value=0.0, count=7):
self.count = int(count)
self.current = float(v... | 36 | 115 | 0.608282 | import argparse
import cv2
import redis
import time
from urllib.parse import urlparse
class SimpleMovingAverage(object):
def __init__(self, value=0.0, count=7):
self.count = int(count)
self.current = float(value)
self.samples = [self.current] * self.count
def __str__(self):
ret... | true | true |
f7320a0309d437c0bb2ee152a0442a5a71c318f3 | 13,419 | py | Python | eppy/client.py | infonetworks-global/eppy | d16d796a532455f8aca21c09ff0d0aef3293d806 | [
"MIT"
] | null | null | null | eppy/client.py | infonetworks-global/eppy | d16d796a532455f8aca21c09ff0d0aef3293d806 | [
"MIT"
] | null | null | null | eppy/client.py | infonetworks-global/eppy | d16d796a532455f8aca21c09ff0d0aef3293d806 | [
"MIT"
] | null | null | null | """
Module that implements the EppClient class
"""
try:
# use gevent if available
import gevent.socket as socket
import gevent.ssl as ssl
except ImportError:
import socket
import ssl
import struct
from collections import deque
import logging
from six import PY2, PY3
from past.builtins import xrang... | 36.865385 | 95 | 0.577539 |
try:
import gevent.socket as socket
import gevent.ssl as ssl
except ImportError:
import socket
import ssl
import struct
from collections import deque
import logging
from six import PY2, PY3
from past.builtins import xrange from .exceptions import EppLoginError, EppConnectionError
from .doc import ... | true | true |
f7320a3608ba6d9708669c62e3c8029585363f25 | 604 | py | Python | Twitter Streaming/spark_app.py | simranjeet97/PySpark_Practice | 7dfb77a5c3e1b632007a32b47ff921972e9ecf87 | [
"Apache-2.0"
] | null | null | null | Twitter Streaming/spark_app.py | simranjeet97/PySpark_Practice | 7dfb77a5c3e1b632007a32b47ff921972e9ecf87 | [
"Apache-2.0"
] | null | null | null | Twitter Streaming/spark_app.py | simranjeet97/PySpark_Practice | 7dfb77a5c3e1b632007a32b47ff921972e9ecf87 | [
"Apache-2.0"
] | null | null | null | import findspark
findspark.init()
from pyspark import SparkContext
from pyspark.streaming import StreamingContext
sc = SparkContext(appName="tweetStream")
# Create a local StreamingContext with batch interval of 1 second
ssc = StreamingContext(sc, 1)
# Create a DStream that conencts to hostname:port
lines = ssc.socketT... | 27.454545 | 65 | 0.764901 | import findspark
findspark.init()
from pyspark import SparkContext
from pyspark.streaming import StreamingContext
sc = SparkContext(appName="tweetStream")
ssc = StreamingContext(sc, 1)
lines = ssc.socketTextStream("127.0.0.1", 9009)
words = lines.flatMap(lambda s: s.lower().split("__end"))
print(type(words))
words.sa... | true | true |
f7320b011accc73b2cbaaaa931708ad6886faa27 | 263,215 | py | Python | ptracer/ptrace/_gen_defs_linux_64.py | fakeNetflix/pinterest-repo-ptracer | 9f9d11403ec50f5e26ed2e8c5633fbb54813415a | [
"Apache-2.0"
] | 147 | 2017-10-24T19:48:49.000Z | 2022-02-12T21:02:07.000Z | ptracer/ptrace/_gen_defs_linux_64.py | sthagen/ptracer | b5019bc977c7c16b0b2713242d017b0ae72b4948 | [
"Apache-2.0"
] | 4 | 2021-02-03T14:23:58.000Z | 2022-02-24T18:19:20.000Z | ptracer/ptrace/_gen_defs_linux_64.py | sthagen/ptracer | b5019bc977c7c16b0b2713242d017b0ae72b4948 | [
"Apache-2.0"
] | 20 | 2017-10-24T19:48:35.000Z | 2022-03-17T01:04:24.000Z | # Automatically generated from system headers.
# DO NOT EDIT.
import ctypes
from .syscalldef import CType, SysCallSig, SysCallParamSig
PTRACE_TRACEME = 0
PTRACE_PEEKTEXT = 1
PTRACE_PEEKDATA = 2
PTRACE_PEEKUSER = 3
PTRACE_POKETEXT = 4
PTRACE_POKEDATA = 5
PTRACE_POKEUSER = 6
PTRACE_CONT = 7
PTRACE_KILL = 8
PTRACE_SIN... | 24.733603 | 61 | 0.283909 |
import ctypes
from .syscalldef import CType, SysCallSig, SysCallParamSig
PTRACE_TRACEME = 0
PTRACE_PEEKTEXT = 1
PTRACE_PEEKDATA = 2
PTRACE_PEEKUSER = 3
PTRACE_POKETEXT = 4
PTRACE_POKEDATA = 5
PTRACE_POKEUSER = 6
PTRACE_CONT = 7
PTRACE_KILL = 8
PTRACE_SINGLESTEP = 9
PTRACE_GETREGS = 12
PTRACE_SETREGS = 13
PTRACE_GET... | true | true |
f7320d9878bc5a4f10abe988b97f5db2d9d49e64 | 6,985 | py | Python | test/drivers/gaussiand/test_driver_gaussian_log.py | renier/qiskit-nature | a06f378a219d650d96e16db96d763ea4aec9cfc2 | [
"Apache-2.0"
] | null | null | null | test/drivers/gaussiand/test_driver_gaussian_log.py | renier/qiskit-nature | a06f378a219d650d96e16db96d763ea4aec9cfc2 | [
"Apache-2.0"
] | null | null | null | test/drivers/gaussiand/test_driver_gaussian_log.py | renier/qiskit-nature | a06f378a219d650d96e16db96d763ea4aec9cfc2 | [
"Apache-2.0"
] | null | null | null | # This code is part of Qiskit.
#
# (C) Copyright IBM 2020, 2021.
#
# 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... | 39.6875 | 95 | 0.534001 |
import unittest
from test import QiskitNatureTestCase
from qiskit_nature.drivers import GaussianLogDriver, GaussianLogResult
from qiskit_nature import QiskitNatureError
class TestDriverGaussianLog(QiskitNatureTestCase):
def setUp(self):
super().setUp()
self.logfile = self.get_resource_path(
... | true | true |
f7320db42cd644873d257e35043851fb92abef28 | 62,440 | py | Python | lib/wallet.py | Skirmant/electrum-trump | 9b0d4e6dd3317900f3d81dec8924f07ffa60e8b5 | [
"MIT"
] | null | null | null | lib/wallet.py | Skirmant/electrum-trump | 9b0d4e6dd3317900f3d81dec8924f07ffa60e8b5 | [
"MIT"
] | null | null | null | lib/wallet.py | Skirmant/electrum-trump | 9b0d4e6dd3317900f3d81dec8924f07ffa60e8b5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2015 Thomas Voegtlin
#
# 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... | 35.947035 | 126 | 0.575801 |
import os
import hashlib
import ast
import threading
import random
import time
import json
import copy
import re
import stat
from functools import partial
from collections import namedtuple, defaultdict
from i18n import _
from util import NotEnoughFunds, PrintError, UserCancelled, profiler
from bitcoin import *
fro... | true | true |
f7320dd67249784102fd2dc4e3484ed2393a91cc | 1,593 | py | Python | kf_cavatica/files.py | kids-first/kf-cavatica-python-tools | 5f821511685dc63df8785a54c1ac31caebc2cba2 | [
"Apache-2.0"
] | null | null | null | kf_cavatica/files.py | kids-first/kf-cavatica-python-tools | 5f821511685dc63df8785a54c1ac31caebc2cba2 | [
"Apache-2.0"
] | 10 | 2021-03-30T13:16:34.000Z | 2021-08-10T19:17:29.000Z | kf_cavatica/files.py | kids-first/kf-cavatica-python-tools | 5f821511685dc63df8785a54c1ac31caebc2cba2 | [
"Apache-2.0"
] | 1 | 2022-02-04T04:13:48.000Z | 2022-02-04T04:13:48.000Z | import sevenbridges as sbg
from pathlib import Path
# generate the list of files
def list_files_recursively(
api,
query,
parent,
files=[],
folder_name="",
):
"""List all the files in a project.
:param api: API object generated by sevenbridges.Api()
:type api: Sevenbridges API Object
... | 31.235294 | 77 | 0.638418 | import sevenbridges as sbg
from pathlib import Path
def list_files_recursively(
api,
query,
parent,
files=[],
folder_name="",
):
if isinstance(parent, sbg.models.project.Project):
parent_id = parent.root_folder
elif isinstance(parent, sbg.models.file.File):
parent_id = ... | true | true |
f7320eb4b502e470801de71bcd1debc943db995d | 1,075 | py | Python | alfred_wrapper.py | fur6y/timely-alfred-workflow | 4ddfd2bd2f37becc78c45c6c07664d44fec5ccde | [
"MIT"
] | 1 | 2018-10-24T20:09:46.000Z | 2018-10-24T20:09:46.000Z | alfred_wrapper.py | fabianfetting/timely-alfred-workflow | 4ddfd2bd2f37becc78c45c6c07664d44fec5ccde | [
"MIT"
] | null | null | null | alfred_wrapper.py | fabianfetting/timely-alfred-workflow | 4ddfd2bd2f37becc78c45c6c07664d44fec5ccde | [
"MIT"
] | null | null | null | import subprocess
import sys
import json
def print_time(t):
output = {
'items': [
{
'uid': 'result',
'type': 'file',
'title': t,
'subtitle': sys.argv[1],
'arg': sys.argv[1],
'icon': {
... | 20.673077 | 68 | 0.413953 | import subprocess
import sys
import json
def print_time(t):
output = {
'items': [
{
'uid': 'result',
'type': 'file',
'title': t,
'subtitle': sys.argv[1],
'arg': sys.argv[1],
'icon': {
... | true | true |
f7320f0efd80d6927395a59cc57e82be5509efc8 | 594 | py | Python | Vivy/setup.py | yametetomete/EncodeScripts | 925c175b56cdbe1251cf7978620808b01cfca4e5 | [
"MIT"
] | 3 | 2020-08-01T09:39:37.000Z | 2021-12-05T07:31:34.000Z | Vivy/setup.py | yametetomete/EncodeScripts | 925c175b56cdbe1251cf7978620808b01cfca4e5 | [
"MIT"
] | null | null | null | Vivy/setup.py | yametetomete/EncodeScripts | 925c175b56cdbe1251cf7978620808b01cfca4e5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import setuptools
name = "vivy_common"
version = "0.0.0"
release = "0.0.0"
setuptools.setup(
name=name,
version=release,
author="louis",
author_email="louis@poweris.moe",
description="yametetomete vivy common module",
packages=["vivy_common"],
classifiers=[
... | 22.846154 | 74 | 0.619529 |
import setuptools
name = "vivy_common"
version = "0.0.0"
release = "0.0.0"
setuptools.setup(
name=name,
version=release,
author="louis",
author_email="louis@poweris.moe",
description="yametetomete vivy common module",
packages=["vivy_common"],
classifiers=[
"Programming Language :... | true | true |
f73210129a2c3754a07a4faf0ce894d3104d954c | 5,446 | py | Python | losses.py | koba35/retinanet | 99820cde438a2fc14e38973437766de6fe6a94a3 | [
"Apache-2.0"
] | null | null | null | losses.py | koba35/retinanet | 99820cde438a2fc14e38973437766de6fe6a94a3 | [
"Apache-2.0"
] | null | null | null | losses.py | koba35/retinanet | 99820cde438a2fc14e38973437766de6fe6a94a3 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import torch
import torch.nn as nn
def calc_iou(a, b):
area = (b[:, 2] - b[:, 0]) * (b[:, 3] - b[:, 1])
iw = torch.min(torch.unsqueeze(a[:, 2], dim=1), b[:, 2]) - torch.max(torch.unsqueeze(a[:, 0], 1), b[:, 0])
ih = torch.min(torch.unsqueeze(a[:, 3], dim=1), b[:, 3]) - torch.max(torch.... | 38.9 | 126 | 0.57051 | import numpy as np
import torch
import torch.nn as nn
def calc_iou(a, b):
area = (b[:, 2] - b[:, 0]) * (b[:, 3] - b[:, 1])
iw = torch.min(torch.unsqueeze(a[:, 2], dim=1), b[:, 2]) - torch.max(torch.unsqueeze(a[:, 0], 1), b[:, 0])
ih = torch.min(torch.unsqueeze(a[:, 3], dim=1), b[:, 3]) - torch.max(torch.... | true | true |
f73211257b07190070fdd8e364260ba0efeb2273 | 922 | py | Python | test/testCommentOptions.py | apiiro/lizard | 083c3a023559ddc9be44581a207bf5e16ce7e16b | [
"MIT"
] | null | null | null | test/testCommentOptions.py | apiiro/lizard | 083c3a023559ddc9be44581a207bf5e16ce7e16b | [
"MIT"
] | null | null | null | test/testCommentOptions.py | apiiro/lizard | 083c3a023559ddc9be44581a207bf5e16ce7e16b | [
"MIT"
] | null | null | null | import unittest
from .testHelpers import get_cpp_function_list
class TestCommentOptions(unittest.TestCase):
def test_function_with_comment_option_should_be_forgiven(self):
function_list = get_cpp_function_list("void foo(){/* #lizard forgives*/}")
self.assertEqual(0, len(function_list))
def ... | 40.086957 | 94 | 0.74295 | import unittest
from .testHelpers import get_cpp_function_list
class TestCommentOptions(unittest.TestCase):
def test_function_with_comment_option_should_be_forgiven(self):
function_list = get_cpp_function_list("void foo(){/* #lizard forgives*/}")
self.assertEqual(0, len(function_list))
def ... | true | true |
f7321235fc8b743ae4d4140233e088137b8036ee | 14,754 | py | Python | contextual_lenses/train_utils.py | googleinterns/protein-embedding-retrieval | be198b5f95d7b97a06ed04a6b131fc10573365fb | [
"Apache-2.0"
] | 31 | 2020-10-29T13:59:18.000Z | 2021-09-13T08:37:31.000Z | contextual_lenses/train_utils.py | amirshane/protein-embedding-retrieval | 388563d3206e1486fe5dbcfd8326be6f1185a00e | [
"Apache-2.0"
] | 7 | 2020-06-01T20:42:12.000Z | 2021-05-31T10:48:10.000Z | contextual_lenses/train_utils.py | amirshane/protein-embedding-retrieval | 388563d3206e1486fe5dbcfd8326be6f1185a00e | [
"Apache-2.0"
] | 7 | 2020-05-18T21:07:23.000Z | 2020-11-23T11:46:23.000Z | """Train utils
General tools for instantiating and training models.
"""
import flax
from flax import nn
from flax import optim
from flax.training import checkpoints
from flax.training import common_utils
import jax
from jax import random
import jax.nn
import jax.numpy as jnp
from jax.config import config
config.enab... | 34.232019 | 89 | 0.560729 |
import flax
from flax import nn
from flax import optim
from flax.training import checkpoints
from flax.training import common_utils
import jax
from jax import random
import jax.nn
import jax.numpy as jnp
from jax.config import config
config.enable_omnistaging()
import tensorflow as tf
import numpy as np
import fun... | true | true |
f73212a4f983365554182ac75a527d12007f372c | 130 | py | Python | DappurMake/core/__init__.py | DapperX/DappurMake | 48a9559e891890a3b797fdf8f51cc17d6daf56d3 | [
"BSD-2-Clause"
] | null | null | null | DappurMake/core/__init__.py | DapperX/DappurMake | 48a9559e891890a3b797fdf8f51cc17d6daf56d3 | [
"BSD-2-Clause"
] | null | null | null | DappurMake/core/__init__.py | DapperX/DappurMake | 48a9559e891890a3b797fdf8f51cc17d6daf56d3 | [
"BSD-2-Clause"
] | null | null | null | from .variable import variable
from .make import make
from .rule import rule
__all__ = ["variable", "make", "rule"]
print(dir()) | 18.571429 | 38 | 0.715385 | from .variable import variable
from .make import make
from .rule import rule
__all__ = ["variable", "make", "rule"]
print(dir()) | true | true |
f73212cf0f4772ea728789c0c196c35ce4427f28 | 6,015 | py | Python | tests/test_30_store.py | arista-netdevops-community/runAM | c461b0fada8ddb22ed1607eb5773cd6aef43dbf9 | [
"BSD-3-Clause"
] | null | null | null | tests/test_30_store.py | arista-netdevops-community/runAM | c461b0fada8ddb22ed1607eb5773cd6aef43dbf9 | [
"BSD-3-Clause"
] | 3 | 2021-01-15T08:06:41.000Z | 2021-02-17T13:23:11.000Z | tests/test_30_store.py | arista-netdevops-community/runAM | c461b0fada8ddb22ed1607eb5773cd6aef43dbf9 | [
"BSD-3-Clause"
] | null | null | null | import pytest
import os
import sys
import runAM
import json
# insert project directory to $PATH for imports to work
test_file = os.path.realpath(__file__)
test_dir = os.path.dirname(test_file)
project_dir = os.path.dirname(test_dir)
sys.path.append(project_dir)
bookstore_json = {"store": {
"book": [
{
... | 33.232044 | 103 | 0.556608 | import pytest
import os
import sys
import runAM
import json
test_file = os.path.realpath(__file__)
test_dir = os.path.dirname(test_file)
project_dir = os.path.dirname(test_dir)
sys.path.append(project_dir)
bookstore_json = {"store": {
"book": [
{
"category": "reference",
"author": ... | true | true |
f732135ed8fd5cb28d543d0c92d4201d25d4de6a | 5,547 | py | Python | algorand/TmplSig.py | cryptorites-scotti/wormhole | 2e220a6f76a1ec03364fa2fac2e571b9824744f8 | [
"Apache-2.0"
] | null | null | null | algorand/TmplSig.py | cryptorites-scotti/wormhole | 2e220a6f76a1ec03364fa2fac2e571b9824744f8 | [
"Apache-2.0"
] | 36 | 2022-02-21T13:31:14.000Z | 2022-03-28T04:47:23.000Z | algorand/TmplSig.py | cryptorites-scotti/wormhole | 2e220a6f76a1ec03364fa2fac2e571b9824744f8 | [
"Apache-2.0"
] | null | null | null | from time import time, sleep
from typing import List, Tuple, Dict, Any, Optional, Union
from base64 import b64decode
import base64
import random
import hashlib
import uuid
import sys
import json
import uvarint
import pprint
from local_blob import LocalBlob
from algosdk.v2client.algod import AlgodClient
from algosdk.k... | 38.520833 | 149 | 0.589508 | from time import time, sleep
from typing import List, Tuple, Dict, Any, Optional, Union
from base64 import b64decode
import base64
import random
import hashlib
import uuid
import sys
import json
import uvarint
import pprint
from local_blob import LocalBlob
from algosdk.v2client.algod import AlgodClient
from algosdk.k... | true | true |
f7321391696b0402752b89e18571a7b90492e6b0 | 1,713 | py | Python | date_sniff/tests.py | nanvel/date-sniff | 5a142861656b985fdbb9029cdf4a541455e16b9a | [
"MIT"
] | null | null | null | date_sniff/tests.py | nanvel/date-sniff | 5a142861656b985fdbb9029cdf4a541455e16b9a | [
"MIT"
] | null | null | null | date_sniff/tests.py | nanvel/date-sniff | 5a142861656b985fdbb9029cdf4a541455e16b9a | [
"MIT"
] | null | null | null | from date_sniff.sniffer import DateSniffer
def test_years_separation():
sniffer = DateSniffer(year=2019)
assert sniffer.sniff('2019') == {'2019': []}
assert sniffer.sniff('prefix 2019 and long text') == {'prefix 2019 and long text': []}
res = {'prefix 2019 and long text another 2019': []}
assert s... | 39.837209 | 114 | 0.663164 | from date_sniff.sniffer import DateSniffer
def test_years_separation():
sniffer = DateSniffer(year=2019)
assert sniffer.sniff('2019') == {'2019': []}
assert sniffer.sniff('prefix 2019 and long text') == {'prefix 2019 and long text': []}
res = {'prefix 2019 and long text another 2019': []}
assert s... | true | true |
f73216568bc0065366c2d6d33f8c92b81662b090 | 6,286 | py | Python | lte/gateway/python/scripts/config_stateless_agw.py | saurabhsoni88/magma | 4236c9d8edb7bd203707ff7e861b1f7c12fb84c7 | [
"BSD-3-Clause"
] | null | null | null | lte/gateway/python/scripts/config_stateless_agw.py | saurabhsoni88/magma | 4236c9d8edb7bd203707ff7e861b1f7c12fb84c7 | [
"BSD-3-Clause"
] | null | null | null | lte/gateway/python/scripts/config_stateless_agw.py | saurabhsoni88/magma | 4236c9d8edb7bd203707ff7e861b1f7c12fb84c7 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
"""
Copyright 2020 The Magma Authors.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BAS... | 28.703196 | 77 | 0.685173 |
import argparse
import os
import subprocess
import sys
import shlex
import time
from enum import Enum
from magma.configuration.service_configs import (
load_override_config,
load_service_config,
save_override_config,
)
return_codes = Enum(
"return_codes", "STATELESS STATEFUL CORRUPT INVALID", start... | true | true |
f732168707cd1e2c13f9b34495a0213b31ec4c9d | 2,164 | py | Python | flow/benchmarks/rllib/ars_runner.py | berkeleyflow/flow | bed5ec959aaf0eaa8dbc7fa03f0c3fd3f0184b80 | [
"MIT"
] | 16 | 2018-05-25T06:30:28.000Z | 2020-08-08T00:03:47.000Z | flow/benchmarks/rllib/ars_runner.py | berkeleyflow/flow | bed5ec959aaf0eaa8dbc7fa03f0c3fd3f0184b80 | [
"MIT"
] | 46 | 2018-05-22T21:32:55.000Z | 2019-06-12T13:10:02.000Z | flow/benchmarks/rllib/ars_runner.py | berkeleyflow/flow | bed5ec959aaf0eaa8dbc7fa03f0c3fd3f0184b80 | [
"MIT"
] | 6 | 2018-06-22T14:59:14.000Z | 2019-08-29T06:00:34.000Z | """
Runner script for environments located in flow/benchmarks.
The environment file can be modified in the imports to change the environment
this runner script is executed on. Furthermore, the rllib specific algorithm/
parameters can be specified here once and used on multiple environments.
"""
import json
import ray... | 30.914286 | 78 | 0.657116 | import json
import ray
import ray.rllib.ars as ars
from ray.tune import run_experiments, grid_search
from ray.tune.registry import register_env
from flow.utils.registry import make_create_env
from flow.utils.rllib import FlowParamsEncoder
from flow.benchmarks.figureeight2 import flow_params
N_ROLLOUTS = 25
PARALLEL... | true | true |
f732169581c39351b8a2047a34b4fbc17e58829f | 1,325 | py | Python | test/integration/modules/test_sfp_comodo.py | khiemtq-cyber/spiderfoot | 66e671918853b0334931fd2fbabad0096d506726 | [
"MIT"
] | null | null | null | test/integration/modules/test_sfp_comodo.py | khiemtq-cyber/spiderfoot | 66e671918853b0334931fd2fbabad0096d506726 | [
"MIT"
] | null | null | null | test/integration/modules/test_sfp_comodo.py | khiemtq-cyber/spiderfoot | 66e671918853b0334931fd2fbabad0096d506726 | [
"MIT"
] | null | null | null | import pytest
import unittest
from modules.sfp_comodo import sfp_comodo
from sflib import SpiderFoot
from spiderfoot import SpiderFootEvent, SpiderFootTarget
@pytest.mark.usefixtures
class TestModuleIntegrationcomodo(unittest.TestCase):
def test_handleEvent_event_data_safe_internet_name_not_blocked_should_not_r... | 30.813953 | 97 | 0.703396 | import pytest
import unittest
from modules.sfp_comodo import sfp_comodo
from sflib import SpiderFoot
from spiderfoot import SpiderFootEvent, SpiderFootTarget
@pytest.mark.usefixtures
class TestModuleIntegrationcomodo(unittest.TestCase):
def test_handleEvent_event_data_safe_internet_name_not_blocked_should_not_r... | true | true |
f7321779e9a3a21168aeabf948fff5b7c3a72cf1 | 4,197 | py | Python | python/ray/serve/tests/test_router.py | yuanchi2807/ray | cf512254bb4bcd71ff1818dff5c868ab10c5f620 | [
"Apache-2.0"
] | 1 | 2021-09-20T15:45:59.000Z | 2021-09-20T15:45:59.000Z | python/ray/serve/tests/test_router.py | yuanchi2807/ray | cf512254bb4bcd71ff1818dff5c868ab10c5f620 | [
"Apache-2.0"
] | 53 | 2021-10-06T20:08:04.000Z | 2022-03-21T20:17:25.000Z | python/ray/serve/tests/test_router.py | yuanchi2807/ray | cf512254bb4bcd71ff1818dff5c868ab10c5f620 | [
"Apache-2.0"
] | 1 | 2022-03-27T09:01:59.000Z | 2022-03-27T09:01:59.000Z | """
Unit tests for the router class. Please don't add any test that will involve
controller or the actual replica wrapper, use mock if necessary.
"""
import asyncio
import pytest
import ray
from ray.serve.common import RunningReplicaInfo
from ray.serve.router import Query, ReplicaSet, RequestMetadata
from ray._privat... | 29.145833 | 81 | 0.65928 | import asyncio
import pytest
import ray
from ray.serve.common import RunningReplicaInfo
from ray.serve.router import Query, ReplicaSet, RequestMetadata
from ray._private.test_utils import SignalActor
pytestmark = pytest.mark.asyncio
@pytest.fixture
def ray_instance():
ray.init(num_cpus=... | true | true |
f73217e8aa5f2356b52094b22ac6b982820b535f | 1,605 | py | Python | module-3/app/service/mythicalMysfitsService.py | kpiljoong/aws-modern-application-workshop | 9eb05451ecb28d01fbcf875d1fd9432c4e3aa8d5 | [
"Apache-2.0"
] | 17 | 2019-11-05T05:30:16.000Z | 2021-11-25T01:20:16.000Z | module-3/app/service/mythicalMysfitsService.py | kpiljoong/aws-modern-application-workshop | 9eb05451ecb28d01fbcf875d1fd9432c4e3aa8d5 | [
"Apache-2.0"
] | null | null | null | module-3/app/service/mythicalMysfitsService.py | kpiljoong/aws-modern-application-workshop | 9eb05451ecb28d01fbcf875d1fd9432c4e3aa8d5 | [
"Apache-2.0"
] | 17 | 2019-11-04T12:27:17.000Z | 2021-12-13T05:41:12.000Z | from flask import Flask, jsonify, json, Response, request
from flask_cors import CORS
import mysfitsTableClient
# A very basic API created using Flask that has two possible routes for requests.
app = Flask(__name__)
app.config['JSONIFY_PRETTYPRINT_REGULAR'] = False
CORS(app)
# The service basepath has a short respon... | 35.666667 | 94 | 0.720249 | from flask import Flask, jsonify, json, Response, request
from flask_cors import CORS
import mysfitsTableClient
app = Flask(__name__)
app.config['JSONIFY_PRETTYPRINT_REGULAR'] = False
CORS(app)
@app.route("/")
def healthCheckResponse():
return jsonify({"message" : "Nothing here, used for health check. Try /mysfi... | true | true |
f73218bda9737f9a09039fb3e086c4956b2a87d2 | 1,903 | py | Python | get_url.py | tracysmith/RGAPepPipe | f334c2a58f41d0b38c0d5884a430e24a21788304 | [
"MIT"
] | 3 | 2017-08-06T18:01:43.000Z | 2018-06-20T04:54:49.000Z | get_url.py | tracysmith/RGAPepPipe | f334c2a58f41d0b38c0d5884a430e24a21788304 | [
"MIT"
] | 28 | 2015-01-05T18:00:48.000Z | 2016-09-06T18:30:29.000Z | otherScripts/get_url.py | pepperell-lab/RGAPepPipe | 0122dca9aca75756ad412599c7922bf08edc7f6d | [
"MIT"
] | 2 | 2017-07-27T14:07:51.000Z | 2018-07-25T15:00:05.000Z | #!/usr/bin/python
import sys, argparse, os
from subprocess import call
from multiprocessing.dummy import Pool as ThreadPool
###################################################################
#This is a phython script to download fastq files from ENA
#You can use this directly with the enaFileParser output
##########... | 31.716667 | 115 | 0.636889 |
import sys, argparse, os
from subprocess import call
from multiprocessing.dummy import Pool as ThreadPool
class FullPaths(argparse.Action):
def __call__(self, parser, namespace, values, option_string=None):
setattr(namespace, self.dest,
os.path.abspath(os.path.expanduser(values)))
def is_file(fi... | true | true |
f73218c79517c1e795e724cc6b80bf59bad88d37 | 1,586 | py | Python | tempest/api/compute/servers/test_virtual_interfaces_negative.py | BeenzSyed/tempest | 7a64ee1216d844f6b99928b53f5c665b84cb8719 | [
"Apache-2.0"
] | null | null | null | tempest/api/compute/servers/test_virtual_interfaces_negative.py | BeenzSyed/tempest | 7a64ee1216d844f6b99928b53f5c665b84cb8719 | [
"Apache-2.0"
] | null | null | null | tempest/api/compute/servers/test_virtual_interfaces_negative.py | BeenzSyed/tempest | 7a64ee1216d844f6b99928b53f5c665b84cb8719 | [
"Apache-2.0"
] | null | null | null | # Copyright 2013 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 requ... | 35.244444 | 78 | 0.716267 |
import uuid
from tempest.api.compute import base
from tempest import exceptions
from tempest import test
class VirtualInterfacesNegativeTestJSON(base.BaseV2ComputeTest):
_interface = 'json'
@classmethod
def setUpClass(cls):
cls.set_network_resources()
super(VirtualInterfacesNega... | true | true |
f7321a754102fe3085336a9211af18b93a46aa05 | 49,633 | py | Python | geetools/ui/ipymap.py | guy1ziv2/gee_tools | 22a0fabe0be4f0a206a0c09e28638562bb36055f | [
"MIT"
] | null | null | null | geetools/ui/ipymap.py | guy1ziv2/gee_tools | 22a0fabe0be4f0a206a0c09e28638562bb36055f | [
"MIT"
] | null | null | null | geetools/ui/ipymap.py | guy1ziv2/gee_tools | 22a0fabe0be4f0a206a0c09e28638562bb36055f | [
"MIT"
] | null | null | null | # coding=utf-8
""" This module is designed to use ONLY in the Jupyter Notebook. It is
inspired on Tyler Erickson's contribution on
https://github.com/gee-community/ee-jupyter-contrib/blob/master/examples/getting-started/display-interactive-map.ipynb
"""
import ipyleaflet
from ipywidgets import HTML, Tab, Accordion, HB... | 39.611333 | 118 | 0.499829 | import ipyleaflet
from ipywidgets import HTML, Tab, Accordion, HBox, SelectMultiple, Select,\
Button, VBox, RadioButtons, Dropdown, Layout, \
FloatRangeSlider
from IPython.display import display
from traitlets import Dict, observe
import ee
if not ee.data._initialized: ee.I... | true | true |
f7321a82ba7c73b42aae51ba6c7f94a79eb940ad | 7,521 | py | Python | src/scanoss/cyclonedx.py | tardyp/scanoss.py | 88ad27e36dd00f420fed08a240f5bbd62169778c | [
"MIT"
] | 8 | 2021-08-19T12:35:58.000Z | 2022-03-23T02:44:36.000Z | src/scanoss/cyclonedx.py | tardyp/scanoss.py | 88ad27e36dd00f420fed08a240f5bbd62169778c | [
"MIT"
] | 4 | 2021-10-31T10:21:11.000Z | 2022-03-24T15:24:54.000Z | src/scanoss/cyclonedx.py | tardyp/scanoss.py | 88ad27e36dd00f420fed08a240f5bbd62169778c | [
"MIT"
] | 1 | 2021-08-19T12:36:02.000Z | 2021-08-19T12:36:02.000Z | """
SPDX-License-Identifier: MIT
Copyright (c) 2021, SCANOSS
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, c... | 36.867647 | 106 | 0.550725 | import json
import os.path
import sys
import hashlib
import time
class CycloneDx:
def __init__(self, debug: bool = False, output_file: str = None):
self.output_file = output_file
self.debug = debug
@staticmethod
def print_stderr(*args, **kwargs):
print(*args, file=sys.stderr, **kw... | true | true |
f7321afb7e4193fbb1ac06c566dac390abb97b12 | 8,689 | py | Python | keras/applications/vgg16.py | asanoboy/keras | e467ee5a1a00afdfa1cb7f5508fdbfd2c5eab1e5 | [
"MIT"
] | 7 | 2017-06-02T19:07:36.000Z | 2021-07-23T21:01:44.000Z | keras/applications/vgg16.py | EnjoyLifeFund/Debian_py36_packages | 1985d4c73fabd5f08f54b922e73a9306e09c77a5 | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | null | null | null | keras/applications/vgg16.py | EnjoyLifeFund/Debian_py36_packages | 1985d4c73fabd5f08f54b922e73a9306e09c77a5 | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | 4 | 2017-05-27T02:37:54.000Z | 2017-08-05T16:01:31.000Z | # -*- coding: utf-8 -*-
"""VGG16 model for Keras.
# Reference
- [Very Deep Convolutional Networks for Large-Scale Image Recognition](https://arxiv.org/abs/1409.1556)
"""
from __future__ import print_function
from __future__ import absolute_import
import os
import warnings
from ..models import Model
from ..layers i... | 43.663317 | 145 | 0.605478 | from __future__ import print_function
from __future__ import absolute_import
import os
import warnings
from ..models import Model
from ..layers import Flatten
from ..layers import Dense
from ..layers import Input
from ..layers import Conv2D
from ..layers import MaxPooling2D
from ..layers import GlobalAveragePooling2D... | true | true |
f7321b2a7c56ae6bf342d7170057105d25b67432 | 166 | py | Python | demo/demo1.py | sharangdhar/Testit | e0be60933144beb20a728df807e7c60f77917a2c | [
"MIT"
] | null | null | null | demo/demo1.py | sharangdhar/Testit | e0be60933144beb20a728df807e7c60f77917a2c | [
"MIT"
] | null | null | null | demo/demo1.py | sharangdhar/Testit | e0be60933144beb20a728df807e7c60f77917a2c | [
"MIT"
] | null | null | null | # true if n is prime
def isPrime(n):
if n <= 1 or int(n) != n:
return False
for x in range(2, int(n*.5)+1):
if n%x == 0:
return False
return True
| 18.444444 | 33 | 0.548193 | def isPrime(n):
if n <= 1 or int(n) != n:
return False
for x in range(2, int(n*.5)+1):
if n%x == 0:
return False
return True
| true | true |
f7321b5ba3eb4d439f4753d430002c7a1fb1a908 | 216 | py | Python | Codechef/helping_chef.py | Ritz2626/Hacktoberfest-2 | a2c48a23c62532227b0b4cd88783dcddaca98519 | [
"MIT"
] | null | null | null | Codechef/helping_chef.py | Ritz2626/Hacktoberfest-2 | a2c48a23c62532227b0b4cd88783dcddaca98519 | [
"MIT"
] | null | null | null | Codechef/helping_chef.py | Ritz2626/Hacktoberfest-2 | a2c48a23c62532227b0b4cd88783dcddaca98519 | [
"MIT"
] | null | null | null | try:
t=int(input(''))
while t>0:
n=int(input(''))
if n<10:
print('What an obedient servant you are!')
else:
print('-1')
t=t-1
except Exception as e:
pass
| 18 | 51 | 0.462963 | try:
t=int(input(''))
while t>0:
n=int(input(''))
if n<10:
print('What an obedient servant you are!')
else:
print('-1')
t=t-1
except Exception as e:
pass
| true | true |
f7321c7afea8a5dc0c9d73994a9d89d4dc165398 | 2,158 | py | Python | phonemeconversion.py | AustinCasteel/pocketsphinx_kws | ae0067e9a728e7e48a5153b9272cb8c52bcb20e6 | [
"MIT"
] | 194 | 2018-07-28T14:54:35.000Z | 2022-03-18T12:40:10.000Z | plugins/stt/pocketsphinx-stt/phonemeconversion.py | HoltTechnologyCorporation/Naomi | 16d5f6ba03ea96c3fa13ed4e2c1f082041d9de31 | [
"MIT"
] | 239 | 2018-07-13T16:15:25.000Z | 2022-03-31T17:55:01.000Z | plugins/stt/pocketsphinx-stt/phonemeconversion.py | Longshotpro2/Naomi | 9330c63fe24606dc45194d297c665f37a4ec10f7 | [
"MIT"
] | 64 | 2018-07-26T02:18:33.000Z | 2022-01-07T06:53:01.000Z | # -*- coding: utf-8 -*-
import logging
XSAMPA_TO_ARPABET_MAPPING = {
# stop
'p': 'P',
'b': 'B',
't': 'T',
'd': 'D',
'k': 'K',
'g': 'G',
'?': 'Q',
# 2 consonants
'pf': 'PF',
'ts': 'TS',
'tS': 'CH',
'dZ': 'JH',
# fricative
'f': 'F',
'v': 'V',
'T': 'TH... | 17.544715 | 74 | 0.376738 | import logging
XSAMPA_TO_ARPABET_MAPPING = {
'p': 'P',
'b': 'B',
't': 'T',
'd': 'D',
'k': 'K',
'g': 'G',
'?': 'Q',
'pf': 'PF',
'ts': 'TS',
'tS': 'CH',
'dZ': 'JH',
'f': 'F',
'v': 'V',
'T': 'TH',
'D': 'DH',
's': 'S',
'z': 'Z',
'S': 'SH... | true | true |
f7321d390042f6c5d74c536e7d5991129b32374f | 19,784 | py | Python | kplr/mast.py | danielrios12/kplr---acesso-a-dados-do-kepler | 4c6a823ad6a88ccd2d5cf8d9eed912a1e57489a2 | [
"MIT"
] | 35 | 2015-01-21T22:38:12.000Z | 2020-08-05T21:15:19.000Z | kplr/mast.py | danielrios12/kplr---acesso-a-dados-do-kepler | 4c6a823ad6a88ccd2d5cf8d9eed912a1e57489a2 | [
"MIT"
] | 12 | 2015-03-17T18:54:15.000Z | 2021-08-06T18:19:13.000Z | kplr/mast.py | danielrios12/kplr---acesso-a-dados-do-kepler | 4c6a823ad6a88ccd2d5cf8d9eed912a1e57489a2 | [
"MIT"
] | 17 | 2015-02-11T19:49:00.000Z | 2019-10-15T18:06:28.000Z | # -*- coding: utf-8 -*-
"""
Adapters for the field names/types returned by the MAST API.
"""
from __future__ import (division, print_function, absolute_import,
unicode_literals)
__all__ = ["koi_adapter", "planet_adapter", "star_adapter", "dataset_adapter",
"epic_adapter"]
import l... | 38.19305 | 78 | 0.584361 |
from __future__ import (division, print_function, absolute_import,
unicode_literals)
__all__ = ["koi_adapter", "planet_adapter", "star_adapter", "dataset_adapter",
"epic_adapter"]
import logging
import six
try:
unicode
except NameError:
unicode = str
class Adapter(objec... | true | true |
f7321eca94435f51e5be0a02668db295e22b7a07 | 5,713 | py | Python | mavsim_python/chap3/mav_dynamics.py | sethmnielsen/mavsim_template_files | 453ec4f7d38fc2d1162198b554834b5bdb7de96f | [
"MIT"
] | null | null | null | mavsim_python/chap3/mav_dynamics.py | sethmnielsen/mavsim_template_files | 453ec4f7d38fc2d1162198b554834b5bdb7de96f | [
"MIT"
] | null | null | null | mavsim_python/chap3/mav_dynamics.py | sethmnielsen/mavsim_template_files | 453ec4f7d38fc2d1162198b554834b5bdb7de96f | [
"MIT"
] | null | null | null | """
mav_dynamics
- this file implements the dynamic equations of motion for MAV
- use unit quaternion for the attitude state
part of mavsimPy
- Beard & McLain, PUP, 2012
- Update history:
12/17/2018 - RWB
1/14/2019 - RWB
"""
import sys
sys.path.append('..')
import numpy as np
# load me... | 35.70625 | 87 | 0.514266 | import sys
sys.path.append('..')
import numpy as np
from message_types.msg_state import msg_state
import parameters.aerosonde_parameters as MAV
from tools.rotations import Quaternion2Euler
from IPython.core.debugger import Pdb
class mav_dynamics:
def __init__(self, Ts):
self.ts_simulation = Ts
... | true | true |
f7321f3d1f5fe29a720bf5116f40781e9a3db6af | 6,868 | py | Python | docs/conf.py | VictorCoCo/flask-ask | 526b3a272fdd6e1438e2191c5ab08ff20853817d | [
"Apache-2.0"
] | null | null | null | docs/conf.py | VictorCoCo/flask-ask | 526b3a272fdd6e1438e2191c5ab08ff20853817d | [
"Apache-2.0"
] | null | null | null | docs/conf.py | VictorCoCo/flask-ask | 526b3a272fdd6e1438e2191c5ab08ff20853817d | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Flask documentation build configuration file, created by
# sphinx-quickstart on Tue Apr 6 15:24:58 2010.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All c... | 34.512563 | 84 | 0.71491 | from __future__ import print_function
import sys, os
sys.path.append(os.path.abspath("_themes"))
sys.path.append(os.path.abspath("."))
extensions = ["sphinx.ext.autodoc", "sphinx.ext.intersphinx", "flaskdocext"]
templates_path = ["_templates"]
source_suffix = ".rst"
master_doc = "index"
project = u"Flask-Ask"
... | true | true |
f7321f77d6d135374ca6addceb6958ab720ca656 | 1,435 | py | Python | solutions/previous_solution_python/leetcode_210.py | YuhanShi53/Leetcode_solutions | cdcad34656d25d6af09b226e17250c6070305ab0 | [
"MIT"
] | null | null | null | solutions/previous_solution_python/leetcode_210.py | YuhanShi53/Leetcode_solutions | cdcad34656d25d6af09b226e17250c6070305ab0 | [
"MIT"
] | null | null | null | solutions/previous_solution_python/leetcode_210.py | YuhanShi53/Leetcode_solutions | cdcad34656d25d6af09b226e17250c6070305ab0 | [
"MIT"
] | null | null | null | """ Leetcode 210 - Course Schedule II
https://leetcode.com/problems/course-schedule-ii/
1. Topological-Sorting & BFS: Time: O(E+V) Space: O(E+V)
"""
from typing import List
class Solution1:
""" 1. Topological Sorting & BFS """
def find_order(self, numCourses: int,
prerequisites: List[L... | 25.625 | 64 | 0.531707 |
from typing import List
class Solution1:
def find_order(self, numCourses: int,
prerequisites: List[List[int]]) -> List[int]:
if numCourses == 1:
return [0]
out_dict = {}
in_dict = {}
for x in range(numCourses):
in_dict[x] = 0
... | true | true |
f7321f8b7e649e817c57077e164139a3d84e2925 | 1,003 | py | Python | users/models.py | Sundaybrian/hood-watch | 728283260336bf164d66832dd6b8fe4aa3e60a33 | [
"MIT"
] | null | null | null | users/models.py | Sundaybrian/hood-watch | 728283260336bf164d66832dd6b8fe4aa3e60a33 | [
"MIT"
] | 11 | 2020-06-05T22:55:53.000Z | 2022-03-11T23:59:17.000Z | users/models.py | Sundaybrian/hood-watch | 728283260336bf164d66832dd6b8fe4aa3e60a33 | [
"MIT"
] | null | null | null | from django.db import models
from django.contrib.auth.models import User
from hood.models import NeighbourHood,Business,Location
from PIL import Image
# Create your models here.
class Profile(models.Model):
user=models.OneToOneField(User,on_delete=models.CASCADE)
image=models.ImageField(default='naomi.jpg',up... | 31.34375 | 88 | 0.698903 | from django.db import models
from django.contrib.auth.models import User
from hood.models import NeighbourHood,Business,Location
from PIL import Image
class Profile(models.Model):
user=models.OneToOneField(User,on_delete=models.CASCADE)
image=models.ImageField(default='naomi.jpg',upload_to='profile_pics')
... | true | true |
f732221b585588f0d4ac5cd124691e264ed6d756 | 179 | py | Python | apps/node/src/app/main/routes/__init__.py | next-fernandocerezal/PyGrid | b82793b0beecd26338c102573a9891c2e86707c8 | [
"Apache-2.0"
] | 1 | 2021-10-05T18:57:02.000Z | 2021-10-05T18:57:02.000Z | apps/node/src/app/main/routes/__init__.py | next-fernandocerezal/PyGrid | b82793b0beecd26338c102573a9891c2e86707c8 | [
"Apache-2.0"
] | null | null | null | apps/node/src/app/main/routes/__init__.py | next-fernandocerezal/PyGrid | b82793b0beecd26338c102573a9891c2e86707c8 | [
"Apache-2.0"
] | null | null | null | from .data_centric.routes import *
from .general import *
from .model_centric.routes import *
from .user_related import *
from .role_related import *
from .group_related import *
| 25.571429 | 35 | 0.787709 | from .data_centric.routes import *
from .general import *
from .model_centric.routes import *
from .user_related import *
from .role_related import *
from .group_related import *
| true | true |
f7322312f3d2f82f8c036e5d17590635e08e0c15 | 1,784 | py | Python | unrecognized.py | timvandermeij/sentiment-analysis | 39a1bdbe56248c9dbbc25107ed339621ef0d65df | [
"MIT"
] | 12 | 2015-06-04T10:33:22.000Z | 2021-07-25T07:49:04.000Z | unrecognized.py | timvandermeij/sentiment-analysis | 39a1bdbe56248c9dbbc25107ed339621ef0d65df | [
"MIT"
] | null | null | null | unrecognized.py | timvandermeij/sentiment-analysis | 39a1bdbe56248c9dbbc25107ed339621ef0d65df | [
"MIT"
] | 3 | 2015-06-17T08:28:04.000Z | 2020-01-16T00:21:30.000Z | import sys
import linecache
from analyze import Analyzer
from classify import Classifier
from utils import Utilities
from sklearn.ensemble import RandomForestRegressor
def main(argv):
# Constants for the analyzer and the classifier
dataset = 'commit_comments-dump.2015-01-29.json'
group = 'id'
model_fil... | 29.733333 | 100 | 0.640695 | import sys
import linecache
from analyze import Analyzer
from classify import Classifier
from utils import Utilities
from sklearn.ensemble import RandomForestRegressor
def main(argv):
dataset = 'commit_comments-dump.2015-01-29.json'
group = 'id'
model_file = 'model.pickle'
analyzer = Analy... | true | true |
f732239fbe0f1f3f991aa2396e2c32ab3b933115 | 13,202 | py | Python | pipelines/ASR/opts.py | csalt-research/OpenASR-py | 9aea6753689d87d321260d7eb0ea0544e1b3403a | [
"MIT"
] | 2 | 2019-11-29T15:46:14.000Z | 2021-05-28T06:54:41.000Z | pipelines/DAT/opts.py | csalt-research/OpenASR-py | 9aea6753689d87d321260d7eb0ea0544e1b3403a | [
"MIT"
] | null | null | null | pipelines/DAT/opts.py | csalt-research/OpenASR-py | 9aea6753689d87d321260d7eb0ea0544e1b3403a | [
"MIT"
] | null | null | null | def build_preprocess_parser(parser):
preprocess_opts(parser)
return parser
def build_train_parser(parser):
model_opts(parser)
general_opts(parser)
train_opts(parser)
translate_opts(parser)
return parser
def build_test_parser(parser):
general_opts(parser)
translate_opts(parser)
... | 50.197719 | 82 | 0.604302 | def build_preprocess_parser(parser):
preprocess_opts(parser)
return parser
def build_train_parser(parser):
model_opts(parser)
general_opts(parser)
train_opts(parser)
translate_opts(parser)
return parser
def build_test_parser(parser):
general_opts(parser)
translate_opts(parser)
... | true | true |
f73225b22c2dc40bcb99cfec0c85cf7a9faf4caa | 276 | py | Python | src/main.py | Hudson-Newey/Global-Search | 3095b0002e44994142fa4b815cf8e56b05f012e2 | [
"MIT"
] | 1 | 2020-09-25T05:38:11.000Z | 2020-09-25T05:38:11.000Z | src/main.py | Grathium-Industries/Global-Search | 3095b0002e44994142fa4b815cf8e56b05f012e2 | [
"MIT"
] | null | null | null | src/main.py | Grathium-Industries/Global-Search | 3095b0002e44994142fa4b815cf8e56b05f012e2 | [
"MIT"
] | null | null | null | # readfile "rf()" function
def rf(filename):
return open(filename, "r").read()
# import external files
exec(rf("translate.py"))
exec(rf("parse.py"))
exec(rf("fileServer.py"))
# main body
# arg1 defines live server port
# main calling point of program
startServer(8080)
| 18.4 | 37 | 0.702899 | def rf(filename):
return open(filename, "r").read()
exec(rf("translate.py"))
exec(rf("parse.py"))
exec(rf("fileServer.py"))
startServer(8080)
| true | true |
f73226da285f8746d282b6368e6dadea4572096c | 4,050 | py | Python | tyrant/cogs/fruit_vs_vegetables.py | AadilVarsh/tyrant | f4a5cebf09cd217b89823ca28180cb434c009b12 | [
"MIT"
] | 1 | 2021-10-12T05:10:04.000Z | 2021-10-12T05:10:04.000Z | tyrant/cogs/fruit_vs_vegetables.py | AadilVarsh/tyrant | f4a5cebf09cd217b89823ca28180cb434c009b12 | [
"MIT"
] | null | null | null | tyrant/cogs/fruit_vs_vegetables.py | AadilVarsh/tyrant | f4a5cebf09cd217b89823ca28180cb434c009b12 | [
"MIT"
] | null | null | null | import asyncio
from disnake.ext.commands import Bot, Cog
from tyrant import constants
class FruitVsVegetables(Cog):
"""Assign fruit and vegetable roles."""
def __init__(self, bot: Bot):
"""Initialize this cog with the Bot instance."""
self.bot = bot
self.locks = {}
@Cog.listene... | 41.326531 | 123 | 0.589383 | import asyncio
from disnake.ext.commands import Bot, Cog
from tyrant import constants
class FruitVsVegetables(Cog):
def __init__(self, bot: Bot):
self.bot = bot
self.locks = {}
@Cog.listener()
async def on_raw_reaction_add(self, payload):
if payload.channel_id == constants.Chan... | true | true |
f732285ceeeaed769e47aab9658083e763fee6e4 | 2,947 | py | Python | tests/legacy/test_cross_cov.py | EEmGuzman/orphics | f8f25f9db7c9104dba5cbeaac0b4924bf4f6920e | [
"BSD-2-Clause"
] | 10 | 2018-01-12T16:12:11.000Z | 2021-02-11T18:46:47.000Z | tests/legacy/test_cross_cov.py | EEmGuzman/orphics | f8f25f9db7c9104dba5cbeaac0b4924bf4f6920e | [
"BSD-2-Clause"
] | 20 | 2016-11-17T20:20:53.000Z | 2021-02-02T10:08:38.000Z | tests/legacy/test_cross_cov.py | EEmGuzman/orphics | f8f25f9db7c9104dba5cbeaac0b4924bf4f6920e | [
"BSD-2-Clause"
] | 17 | 2017-04-28T23:28:16.000Z | 2021-08-15T20:28:25.000Z | from __future__ import print_function
from orphics import maps,io,cosmology,symcoupling as sc,stats,lensing
from enlib import enmap,bench
import numpy as np
import os,sys
cache = True
hdv = False
deg = 5
px = 1.5
shape,wcs = maps.rect_geometry(width_deg = deg,px_res_arcmin=px)
mc = sc.LensingModeCoupling(shape,wcs)
... | 33.488636 | 98 | 0.650153 | from __future__ import print_function
from orphics import maps,io,cosmology,symcoupling as sc,stats,lensing
from enlib import enmap,bench
import numpy as np
import os,sys
cache = True
hdv = False
deg = 5
px = 1.5
shape,wcs = maps.rect_geometry(width_deg = deg,px_res_arcmin=px)
mc = sc.LensingModeCoupling(shape,wcs)
... | true | true |
f73229b10a319926c7005288cb0476184c0feb80 | 952 | py | Python | twitterBot.py | f0xHiero/Learning_Still | 53721c0da1e2d280433e68979dbf5a4d692bd955 | [
"CC0-1.0"
] | null | null | null | twitterBot.py | f0xHiero/Learning_Still | 53721c0da1e2d280433e68979dbf5a4d692bd955 | [
"CC0-1.0"
] | null | null | null | twitterBot.py | f0xHiero/Learning_Still | 53721c0da1e2d280433e68979dbf5a4d692bd955 | [
"CC0-1.0"
] | null | null | null | #!/usr/bin/python3
import tweepy
import time, datetime
consumer_key = 'REDACTED'
consumer_secret = 'REDACTED'
key = 'REDACTED'
secret = 'REDACTED'
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(key, secret)
api = tweepy.API(auth)
def twitter_bot(hashtag, delay):
while True... | 21.636364 | 78 | 0.594538 |
import tweepy
import time, datetime
consumer_key = 'REDACTED'
consumer_secret = 'REDACTED'
key = 'REDACTED'
secret = 'REDACTED'
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(key, secret)
api = tweepy.API(auth)
def twitter_bot(hashtag, delay):
while True:
print(f"\... | true | true |
f73229f61512eeeef654392625e73b17e8a5aff6 | 19,243 | py | Python | tests/extensions/test_version.py | jisantuc/pystac | 12eff70f9423d642c9909c92b4ba228bf97bef0e | [
"Apache-2.0"
] | 130 | 2020-09-08T08:30:23.000Z | 2022-03-29T19:38:26.000Z | tests/extensions/test_version.py | jisantuc/pystac | 12eff70f9423d642c9909c92b4ba228bf97bef0e | [
"Apache-2.0"
] | 536 | 2020-08-20T17:24:49.000Z | 2022-03-31T23:49:37.000Z | tests/extensions/test_version.py | jisantuc/pystac | 12eff70f9423d642c9909c92b4ba228bf97bef0e | [
"Apache-2.0"
] | 42 | 2020-08-20T09:08:11.000Z | 2022-03-08T07:44:12.000Z | """Tests for pystac.extensions.version."""
import datetime
import unittest
from typing import List, Optional
import pystac
from pystac import ExtensionTypeError
from pystac.extensions import version
from pystac.extensions.version import VersionExtension, VersionRelType
from tests.utils import TestCases
URL_TEMPLATE:... | 40.426471 | 87 | 0.693187 |
import datetime
import unittest
from typing import List, Optional
import pystac
from pystac import ExtensionTypeError
from pystac.extensions import version
from pystac.extensions.version import VersionExtension, VersionRelType
from tests.utils import TestCases
URL_TEMPLATE: str = "http://example.com/catalog/%s.json"... | true | true |
f7322b5afc332aa2306c32d240c945d3ffe9d0d3 | 2,660 | py | Python | prepare_data/preparing_faces_parallel.py | yuval-alaluf/stylegan3-editing | ab01a5d90b8ba67e0da0e1388f0931482601006c | [
"MIT"
] | 347 | 2022-01-31T18:36:35.000Z | 2022-03-31T08:08:39.000Z | prepare_data/preparing_faces_parallel.py | yuval-alaluf/stylegan3-editing | ab01a5d90b8ba67e0da0e1388f0931482601006c | [
"MIT"
] | 11 | 2022-02-13T20:21:53.000Z | 2022-03-29T12:20:57.000Z | prepare_data/preparing_faces_parallel.py | yuval-alaluf/stylegan3-editing | ab01a5d90b8ba67e0da0e1388f0931482601006c | [
"MIT"
] | 24 | 2022-02-02T23:18:15.000Z | 2022-03-23T02:16:26.000Z | import math
import multiprocessing as mp
import sys
import time
from functools import partial
from pathlib import Path
import pyrallis
import dlib
from dataclasses import dataclass
sys.path.append(".")
sys.path.append("..")
from configs.paths_config import model_paths
from utils.alignment_utils import align_face, c... | 28.913043 | 101 | 0.659398 | import math
import multiprocessing as mp
import sys
import time
from functools import partial
from pathlib import Path
import pyrallis
import dlib
from dataclasses import dataclass
sys.path.append(".")
sys.path.append("..")
from configs.paths_config import model_paths
from utils.alignment_utils import align_face, c... | true | true |
f7322d56ef9db59648ac91a2cf2ff4d481a60519 | 13,087 | py | Python | models/data/issue_submission_data.py | 0xNuggan/commons-config-backend | e462e9c1625eef0c44f21685f171782aedc56316 | [
"MIT"
] | 1 | 2021-11-03T18:26:12.000Z | 2021-11-03T18:26:12.000Z | models/data/issue_submission_data.py | 0xNuggan/commons-config-backend | e462e9c1625eef0c44f21685f171782aedc56316 | [
"MIT"
] | 36 | 2021-10-06T17:14:04.000Z | 2021-12-21T12:22:00.000Z | models/data/issue_submission_data.py | 0xNuggan/commons-config-backend | e462e9c1625eef0c44f21685f171782aedc56316 | [
"MIT"
] | 3 | 2021-08-19T22:21:02.000Z | 2021-11-30T15:49:20.000Z | advanced_settings_data = """
### *Advanced Settings
>This will be empty or non-existent if the user did not change any advanced settings from their default. Any settings changed from default will show up here
| Parameter | Value |
|:-----------------------:|:----------------------... | 61.731132 | 301 | 0.589058 | advanced_settings_data = """
### *Advanced Settings
>This will be empty or non-existent if the user did not change any advanced settings from their default. Any settings changed from default will show up here
| Parameter | Value |
|:-----------------------:|:----------------------... | true | true |
f7322d6acf0bb63777abeccc59db6c90f96b1fe9 | 2,443 | py | Python | Python/phonenumbers/data/region_GR.py | skykisl/uberbruns2 | 26933efce04dba700d93cc75c7b74e069fb02d26 | [
"Unlicense"
] | 5 | 2015-04-27T20:10:56.000Z | 2018-06-14T18:19:09.000Z | python/phonenumbers/data/region_GR.py | vemel/python-phonenumbers | 595c322bf12106a3b95e3f202e948a7c6b6c15b8 | [
"Apache-2.0"
] | 2 | 2017-06-08T16:11:13.000Z | 2018-05-07T11:50:13.000Z | python/phonenumbers/data/region_GR.py | vemel/python-phonenumbers | 595c322bf12106a3b95e3f202e948a7c6b6c15b8 | [
"Apache-2.0"
] | 6 | 2015-02-19T11:11:04.000Z | 2022-03-15T19:38:31.000Z | """Auto-generated file, do not edit by hand. GR metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_GR = PhoneMetadata(id='GR', country_code=30, international_prefix='00',
general_desc=PhoneNumberDesc(national_number_pattern='[26-9]\\d{9}', possible_number_pattern='\... | 116.333333 | 482 | 0.693819 | from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_GR = PhoneMetadata(id='GR', country_code=30, international_prefix='00',
general_desc=PhoneNumberDesc(national_number_pattern='[26-9]\\d{9}', possible_number_pattern='\\d{10}'),
fixed_line=PhoneNumberDesc(national_number_pat... | true | true |
f7322f621bf5191e1411b871cefba6a1f2f1057f | 9,058 | py | Python | tests/test_0022-number-of-branches.py | nikoladze/uproot4 | 57fafcfd73c40aea21dd19a439c76c79fd370768 | [
"BSD-3-Clause"
] | null | null | null | tests/test_0022-number-of-branches.py | nikoladze/uproot4 | 57fafcfd73c40aea21dd19a439c76c79fd370768 | [
"BSD-3-Clause"
] | null | null | null | tests/test_0022-number-of-branches.py | nikoladze/uproot4 | 57fafcfd73c40aea21dd19a439c76c79fd370768 | [
"BSD-3-Clause"
] | null | null | null | # BSD 3-Clause License; see https://github.com/scikit-hep/uproot4/blob/master/LICENSE
from __future__ import absolute_import
import sys
import json
import numpy
import pytest
import skhep_testdata
import uproot4
import uproot4.interpretation.library
import uproot4.interpretation.jagged
import uproot4.interpretation... | 39.212121 | 88 | 0.520534 |
from __future__ import absolute_import
import sys
import json
import numpy
import pytest
import skhep_testdata
import uproot4
import uproot4.interpretation.library
import uproot4.interpretation.jagged
import uproot4.interpretation.numerical
def test_branchname():
with uproot4.open(
skhep_testdata.data... | true | true |
f7322f73d610fd86e37f5dd2157b9b28bca8a8f7 | 43 | py | Python | msg.py | AlexCustodio1801099/alexcustodio1801099 | 96a4d45585b46087b78498f79d23b98f00b80a0c | [
"Apache-2.0"
] | null | null | null | msg.py | AlexCustodio1801099/alexcustodio1801099 | 96a4d45585b46087b78498f79d23b98f00b80a0c | [
"Apache-2.0"
] | null | null | null | msg.py | AlexCustodio1801099/alexcustodio1801099 | 96a4d45585b46087b78498f79d23b98f00b80a0c | [
"Apache-2.0"
] | null | null | null | def mensagem():
print("olá mundo!!!")
| 10.75 | 25 | 0.55814 | def mensagem():
print("olá mundo!!!")
| true | true |
f7322f82e6e309e3b1e8ce6dc31cde69ea6df68e | 1,018 | py | Python | app/forms.py | ssloat/wheatonultimate-www | 9ea27dc03adfbe63dccb404f621f9e5fa83def6b | [
"MIT"
] | null | null | null | app/forms.py | ssloat/wheatonultimate-www | 9ea27dc03adfbe63dccb404f621f9e5fa83def6b | [
"MIT"
] | null | null | null | app/forms.py | ssloat/wheatonultimate-www | 9ea27dc03adfbe63dccb404f621f9e5fa83def6b | [
"MIT"
] | null | null | null | from flask_wtf import FlaskForm
from wtforms import RadioField, SelectMultipleField, widgets
class MultiCheckBoxField(SelectMultipleField):
widget = widgets.ListWidget(prefix_label=False)
option_widget = widgets.CheckboxInput()
class GoogleGroupsSubscribe(FlaskForm):
group = MultiCheckBoxField(
'... | 33.933333 | 67 | 0.639489 | from flask_wtf import FlaskForm
from wtforms import RadioField, SelectMultipleField, widgets
class MultiCheckBoxField(SelectMultipleField):
widget = widgets.ListWidget(prefix_label=False)
option_widget = widgets.CheckboxInput()
class GoogleGroupsSubscribe(FlaskForm):
group = MultiCheckBoxField(
'... | true | true |
f7322f8996b9015fbab55e9d33bd023ad461052d | 15,526 | py | Python | spirl/data/block_stacking/src/demo_gen/block_demo_policy.py | kouroshHakha/fist | 328c098789239fd892e17edefd799fc1957ab637 | [
"BSD-3-Clause"
] | 8 | 2021-10-14T03:14:23.000Z | 2022-03-15T21:31:17.000Z | spirl/data/block_stacking/src/demo_gen/block_demo_policy.py | kouroshHakha/fist | 328c098789239fd892e17edefd799fc1957ab637 | [
"BSD-3-Clause"
] | null | null | null | spirl/data/block_stacking/src/demo_gen/block_demo_policy.py | kouroshHakha/fist | 328c098789239fd892e17edefd799fc1957ab637 | [
"BSD-3-Clause"
] | 1 | 2021-09-13T20:42:28.000Z | 2021-09-13T20:42:28.000Z | import numpy as np
from collections import deque
import copy
from spirl.utils.general_utils import AttrDict, split_along_axis
from spirl.data.block_stacking.src.utils.utils import quat2euler
from spirl.data.block_stacking.src.block_stacking_env import BlockStackEnv
class BlockStackDemoPolicy:
"""Follows plan on ... | 45.002899 | 135 | 0.631972 | import numpy as np
from collections import deque
import copy
from spirl.utils.general_utils import AttrDict, split_along_axis
from spirl.data.block_stacking.src.utils.utils import quat2euler
from spirl.data.block_stacking.src.block_stacking_env import BlockStackEnv
class BlockStackDemoPolicy:
GRASP_OFFSET = 0.08... | true | true |
f7323123b654734d406913c73fe56a176996774e | 1,456 | py | Python | packages/merlin/cli/About.py | PyreFramework/pyre | 345c7449a3416eea1c1affa74fb32faff30a6aaa | [
"BSD-3-Clause"
] | null | null | null | packages/merlin/cli/About.py | PyreFramework/pyre | 345c7449a3416eea1c1affa74fb32faff30a6aaa | [
"BSD-3-Clause"
] | null | null | null | packages/merlin/cli/About.py | PyreFramework/pyre | 345c7449a3416eea1c1affa74fb32faff30a6aaa | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# michael a.g. aïvázis <michael.aivazis@para-sim.com>
# (c) 1998-2022 all rights reserved
# externals
import merlin
# declaration
class About(merlin.shells.command, family='merlin.cli.about'):
"""
Display information about this application
"""
@merlin.export(tip="print th... | 23.111111 | 68 | 0.592033 |
import merlin
class About(merlin.shells.command, family='merlin.cli.about'):
@merlin.export(tip="print the copyright note")
def copyright(self, plexus, **kwds):
plexus.info.log(merlin.meta.copyright)
return
@merlin.export(tip="print out the acknowledgments")
def c... | true | true |
f732324215dffd9d37733babb43056a844a03632 | 140,440 | py | Python | python/paddle/fluid/layers/control_flow.py | grasswolfs/Paddle | 0c2fff447c7d5b0bbad473a1590872c5343e1e56 | [
"Apache-2.0"
] | null | null | null | python/paddle/fluid/layers/control_flow.py | grasswolfs/Paddle | 0c2fff447c7d5b0bbad473a1590872c5343e1e56 | [
"Apache-2.0"
] | null | null | null | python/paddle/fluid/layers/control_flow.py | grasswolfs/Paddle | 0c2fff447c7d5b0bbad473a1590872c5343e1e56 | [
"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... | 40.944606 | 449 | 0.592815 |
from __future__ import print_function
from ..wrapped_decorator import signature_safe_contextmanager
from .layer_function_generator import autodoc, templatedoc
from .tensor import assign, cast, fill_constant
from .. import core
from ..framework import Program, Variable, Operator
from ..layer_helper import LayerHelper,... | true | true |
f73237cb25ef0fec908c5cdf07d7c7b7b9907d50 | 332 | py | Python | ogreserver/forms/search.py | oii/ogreserver | 942d8ee612206fb094f04b3ff976187abebf3069 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | ogreserver/forms/search.py | oii/ogreserver | 942d8ee612206fb094f04b3ff976187abebf3069 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | ogreserver/forms/search.py | oii/ogreserver | 942d8ee612206fb094f04b3ff976187abebf3069 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | from __future__ import absolute_import
from __future__ import unicode_literals
from flask_wtf import FlaskForm
from wtforms import TextField, BooleanField
class SearchForm(FlaskForm):
s = TextField('s')
is_curated = BooleanField('Curated Only?', default=True)
is_fiction = BooleanField('Fiction Only?', de... | 27.666667 | 60 | 0.783133 | from __future__ import absolute_import
from __future__ import unicode_literals
from flask_wtf import FlaskForm
from wtforms import TextField, BooleanField
class SearchForm(FlaskForm):
s = TextField('s')
is_curated = BooleanField('Curated Only?', default=True)
is_fiction = BooleanField('Fiction Only?', de... | true | true |
f732394175903cc275173763bb703893ecd75976 | 369 | py | Python | tests/test_initial_data.py | luiscberrocal/django-acp-calendar | 7251d7cbb1ba16983bbc3ba9af6178eb31408bee | [
"BSD-3-Clause"
] | 1 | 2016-10-05T05:17:35.000Z | 2016-10-05T05:17:35.000Z | tests/test_initial_data.py | luiscberrocal/django-acp-calendar | 7251d7cbb1ba16983bbc3ba9af6178eb31408bee | [
"BSD-3-Clause"
] | 17 | 2016-09-30T13:43:20.000Z | 2021-06-10T20:44:40.000Z | tests/test_initial_data.py | luiscberrocal/django-acp-calendar | 7251d7cbb1ba16983bbc3ba9af6178eb31408bee | [
"BSD-3-Clause"
] | 6 | 2016-04-11T14:41:44.000Z | 2017-10-20T21:16:39.000Z | from django.test import TestCase
from acp_calendar.initial_data import get_holidays_list
class TestInitialData(TestCase):
def test_get_holidays_list(self):
holidays = get_holidays_list()
self.assertEqual(144, len(holidays))
self.assertEqual('2006-01-01', holidays[0]['date'])
self... | 28.384615 | 60 | 0.710027 | from django.test import TestCase
from acp_calendar.initial_data import get_holidays_list
class TestInitialData(TestCase):
def test_get_holidays_list(self):
holidays = get_holidays_list()
self.assertEqual(144, len(holidays))
self.assertEqual('2006-01-01', holidays[0]['date'])
self... | true | true |
f73239a9d45e6658e36f048b96ff430af7d2667e | 7,748 | py | Python | ironicclient/tests/unit/v1/test_driver_shell.py | sapcc/python-ironicclient | 8dcbf5b6d0bc2c2dc3881dbc557e2e403e2fe2b4 | [
"Apache-2.0"
] | null | null | null | ironicclient/tests/unit/v1/test_driver_shell.py | sapcc/python-ironicclient | 8dcbf5b6d0bc2c2dc3881dbc557e2e403e2fe2b4 | [
"Apache-2.0"
] | null | null | null | ironicclient/tests/unit/v1/test_driver_shell.py | sapcc/python-ironicclient | 8dcbf5b6d0bc2c2dc3881dbc557e2e403e2fe2b4 | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 Hewlett-Packard Development Company, L.P.
#
# 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 ... | 39.329949 | 78 | 0.657073 |
import mock
from ironicclient.common import cliutils
from ironicclient.tests.unit import utils
import ironicclient.v1.driver as v1_driver
import ironicclient.v1.driver_shell as d_shell
class DriverShellTest(utils.BaseTestCase):
def setUp(self):
super(DriverShellTest, self).setUp()
client_mock = ... | true | true |
f73239b4487781d61b40f39c0bd8795ca4336a53 | 484 | py | Python | json_encoder.py | luksurious/faster-teaching | 1493311d5b723ca3f216f537bda8db5907196443 | [
"MIT"
] | 2 | 2020-08-06T13:21:51.000Z | 2021-04-15T04:29:03.000Z | json_encoder.py | luksurious/faster-teaching | 1493311d5b723ca3f216f537bda8db5907196443 | [
"MIT"
] | null | null | null | json_encoder.py | luksurious/faster-teaching | 1493311d5b723ca3f216f537bda8db5907196443 | [
"MIT"
] | null | null | null | import json
import numpy as np
from actions import Actions
class CustomEncoder(json.JSONEncoder):
def default(self, obj):
if isinstance(obj, np.integer):
return int(obj)
elif isinstance(obj, np.floating):
return float(obj)
elif isinstance(obj, np.ndarray):
... | 25.473684 | 58 | 0.609504 | import json
import numpy as np
from actions import Actions
class CustomEncoder(json.JSONEncoder):
def default(self, obj):
if isinstance(obj, np.integer):
return int(obj)
elif isinstance(obj, np.floating):
return float(obj)
elif isinstance(obj, np.ndarray):
... | true | true |
f73239bc46550b56b6efc3d11e7395420f4d3bb7 | 1,554 | py | Python | src/fonduer/utils/utils_parser.py | SenWu/fonduer | c4f8d95cec97552b34412c6787eb7370ae17424f | [
"MIT"
] | 1 | 2018-11-02T06:02:13.000Z | 2018-11-02T06:02:13.000Z | src/fonduer/utils/utils_parser.py | SenWu/fonduer | c4f8d95cec97552b34412c6787eb7370ae17424f | [
"MIT"
] | null | null | null | src/fonduer/utils/utils_parser.py | SenWu/fonduer | c4f8d95cec97552b34412c6787eb7370ae17424f | [
"MIT"
] | 1 | 2018-09-24T03:27:04.000Z | 2018-09-24T03:27:04.000Z | from typing import List, Optional, Tuple
def build_node(type: str, name: str, content: str) -> str:
"""
Wrap up content in to a html node.
:param type: content type (e.g., doc, section, text, figure)
:type path: str
:param name: content name (e.g., the name of the section)
:type path: str
... | 30.470588 | 79 | 0.611326 | from typing import List, Optional, Tuple
def build_node(type: str, name: str, content: str) -> str:
if type == "doc":
return f"<html>{content}</html>"
if type == "section":
return f"<section name='{name}'>{content}</section>"
if type == "text":
return f"<p name='{name}'>{content}</... | true | true |
f7323bb40b17dc7bb6c240025103a25a642c8bc1 | 259 | py | Python | ecdc_status/crime_scene/urls.py | ess-dmsc/ecdc-status | 8057b2995f2404b6eac6b6a723f8776137a71328 | [
"BSD-2-Clause"
] | null | null | null | ecdc_status/crime_scene/urls.py | ess-dmsc/ecdc-status | 8057b2995f2404b6eac6b6a723f8776137a71328 | [
"BSD-2-Clause"
] | null | null | null | ecdc_status/crime_scene/urls.py | ess-dmsc/ecdc-status | 8057b2995f2404b6eac6b6a723f8776137a71328 | [
"BSD-2-Clause"
] | null | null | null | from django.urls import path
from . import views
urlpatterns = [
path('', views.list),
path('random/', views.random_crime_scene),
path('<int:id>/', views.crime_scene),
path('data/<int:id>', views.crime_scene_data, name="crime_scene_data"),
] | 25.9 | 75 | 0.675676 | from django.urls import path
from . import views
urlpatterns = [
path('', views.list),
path('random/', views.random_crime_scene),
path('<int:id>/', views.crime_scene),
path('data/<int:id>', views.crime_scene_data, name="crime_scene_data"),
] | true | true |
f7323bfabed34ca36a6d78e1a86dbd6f1606129a | 1,888 | py | Python | handlers/message.py | cvatricks/VoiceChatPyroBot | 4f45b2d75027e652fe1992369eaec4a7bf925b85 | [
"MIT"
] | 3 | 2021-01-23T07:33:43.000Z | 2021-02-05T18:21:06.000Z | handlers/message.py | Vivektp/VoiceChatPyroBot-1 | e3fda36ee0267a271d79938048a60d7d9ffeb383 | [
"MIT"
] | null | null | null | handlers/message.py | Vivektp/VoiceChatPyroBot-1 | e3fda36ee0267a271d79938048a60d7d9ffeb383 | [
"MIT"
] | 3 | 2020-12-31T12:06:28.000Z | 2021-03-23T16:32:39.000Z | from pyrogram import filters
from pyrogram.handlers import MessageHandler
from helpers import is_youtube
from ytdl import download
import player
from config import LOG_GROUP
async def message(client, message):
if message.text.startswith("/"):
return
if not is_youtube(message.text):
... | 26.222222 | 87 | 0.423729 | from pyrogram import filters
from pyrogram.handlers import MessageHandler
from helpers import is_youtube
from ytdl import download
import player
from config import LOG_GROUP
async def message(client, message):
if message.text.startswith("/"):
return
if not is_youtube(message.text):
... | true | true |
f7323c1c4fea94b6dad136f49474d89ef42d1a21 | 1,459 | py | Python | utils/test/testapi/opnfv_testapi/resources/project_models.py | kkltcjk/reporting | 460731b8b2da037159649b02ffed798656dad8a9 | [
"Apache-2.0"
] | null | null | null | utils/test/testapi/opnfv_testapi/resources/project_models.py | kkltcjk/reporting | 460731b8b2da037159649b02ffed798656dad8a9 | [
"Apache-2.0"
] | null | null | null | utils/test/testapi/opnfv_testapi/resources/project_models.py | kkltcjk/reporting | 460731b8b2da037159649b02ffed798656dad8a9 | [
"Apache-2.0"
] | null | null | null | ##############################################################################
# Copyright (c) 2015 Orange
# guyrodrigue.koffi@orange.com / koffirodrigue@gmail.com
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompani... | 29.77551 | 78 | 0.611378 | import models
from opnfv_testapi.tornado_swagger import swagger
@swagger.model()
class ProjectCreateRequest(models.ModelBase):
def __init__(self, name, description=''):
self.name = name
self.description = description
@swagger.model()
class ProjectUpdateRequest(models.ModelBase):
def __init__... | true | true |
f7323c996636da5b03b4665b07a0e5c0fa576a77 | 274 | py | Python | alert_rules/alr_get.py | PaloAltoNetworks/pcs-migration-management | 766c8c861befa92e593b23ad6d248e33f62054bb | [
"ISC"
] | 1 | 2022-03-17T12:51:45.000Z | 2022-03-17T12:51:45.000Z | alert_rules/alr_get.py | PaloAltoNetworks/pcs-migration-management | 766c8c861befa92e593b23ad6d248e33f62054bb | [
"ISC"
] | 2 | 2021-11-03T15:34:40.000Z | 2021-12-14T19:50:20.000Z | alert_rules/alr_get.py | PaloAltoNetworks/pcs-migration-management | 766c8c861befa92e593b23ad6d248e33f62054bb | [
"ISC"
] | 4 | 2021-11-09T17:57:01.000Z | 2022-01-24T17:41:21.000Z | def get_alert_rules(session: object, logger):
'''
Accepts a tenant session object.
Gets all alert rules from a tenant
'''
logger.debug('API - Getting Alert Rules')
res = session.request("GET", "/v2/alert/rule")
data = res.json()
return data | 24.909091 | 50 | 0.638686 | def get_alert_rules(session: object, logger):
logger.debug('API - Getting Alert Rules')
res = session.request("GET", "/v2/alert/rule")
data = res.json()
return data | true | true |
f7323d4c992046056cb702fd74ddd0fe7f0a0f02 | 6,820 | py | Python | CornerNetEngine.py | gordonjun2/CornerNet | d1a8d87903433ddbe0fa8b96c7388b955021e53c | [
"BSD-3-Clause"
] | 2 | 2020-01-22T06:22:16.000Z | 2020-02-10T08:47:20.000Z | CornerNetEngine.py | gordonjun2/CornerNet | d1a8d87903433ddbe0fa8b96c7388b955021e53c | [
"BSD-3-Clause"
] | null | null | null | CornerNetEngine.py | gordonjun2/CornerNet | d1a8d87903433ddbe0fa8b96c7388b955021e53c | [
"BSD-3-Clause"
] | null | null | null | import argparse
import time
import cv2
from config import system_configs
from utils.drawer import Drawer # Import Drawer to add bboxes
import os
import torch
import pprint
import json
import importlib
import numpy as np
import matplotlib
from test.coco_video import kp_detection
from nnet.py_fa... | 42.098765 | 164 | 0.533871 | import argparse
import time
import cv2
from config import system_configs
from utils.drawer import Drawer
import os
import torch
import pprint
import json
import importlib
import numpy as np
import matplotlib
from test.coco_video import kp_detection
from nnet.py_factory_video import NetworkFact... | true | true |
f7323d86d734c82e47f24220097e9e149b478eae | 2,663 | py | Python | tests/trees.py | andrewguy9/farmfs | 1cad69237ace53869b044afcb322773acf9bf447 | [
"MIT"
] | 5 | 2015-01-28T19:09:33.000Z | 2022-03-01T07:35:02.000Z | tests/trees.py | andrewguy9/farmfs | 1cad69237ace53869b044afcb322773acf9bf447 | [
"MIT"
] | 22 | 2015-01-01T19:10:28.000Z | 2022-01-18T21:52:39.000Z | tests/trees.py | andrewguy9/farmfs | 1cad69237ace53869b044afcb322773acf9bf447 | [
"MIT"
] | 1 | 2021-05-06T03:39:34.000Z | 2021-05-06T03:39:34.000Z | from farmfs.fs import sep, ROOT, Path, LINK, DIR
from itertools import permutations, combinations, chain, product
from collections import defaultdict
def permute_deep(options):
options = [permutations(options, pick) for pick in range(1,1+len(options))]
return list(chain.from_iterable(options))
def combine_dee... | 30.965116 | 97 | 0.699211 | from farmfs.fs import sep, ROOT, Path, LINK, DIR
from itertools import permutations, combinations, chain, product
from collections import defaultdict
def permute_deep(options):
options = [permutations(options, pick) for pick in range(1,1+len(options))]
return list(chain.from_iterable(options))
def combine_dee... | true | true |
f7323e093756717649d847aad33677262eb94277 | 12,590 | py | Python | cirq/google/devices/serializable_device.py | abhik-99/Cirq | d244bf71ba78cee461bfd83a5edcf62dbbc5b3ca | [
"Apache-2.0"
] | null | null | null | cirq/google/devices/serializable_device.py | abhik-99/Cirq | d244bf71ba78cee461bfd83a5edcf62dbbc5b3ca | [
"Apache-2.0"
] | null | null | null | cirq/google/devices/serializable_device.py | abhik-99/Cirq | d244bf71ba78cee461bfd83a5edcf62dbbc5b3ca | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 The Cirq 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 40.876623 | 80 | 0.608261 |
from typing import (Any, Callable, cast, Dict, Iterable, Optional, List, Set,
Tuple, Type, TYPE_CHECKING, FrozenSet)
from cirq import circuits, devices
from cirq.google import serializable_gate_set
from cirq.google.api import v2
from cirq.value import Duration
if TYPE_CHECKING:
import cirq
... | true | true |
f7323e47ca19d683e6fb6a280cc58c5744dc8f71 | 124 | py | Python | output_test.py | AnkurDesai11/PY4E | bfd185ef89d4b054a2286ca8a6eae476c086b782 | [
"BSD-3-Clause"
] | null | null | null | output_test.py | AnkurDesai11/PY4E | bfd185ef89d4b054a2286ca8a6eae476c086b782 | [
"BSD-3-Clause"
] | null | null | null | output_test.py | AnkurDesai11/PY4E | bfd185ef89d4b054a2286ca8a6eae476c086b782 | [
"BSD-3-Clause"
] | null | null | null | '''
Created on 30 Aug, 2020
@author: ABD
'''
#total = 0
#for abc in range(5):
# total = total + abc
#print(total) | 13.777778 | 24 | 0.564516 | true | true | |
f7323f11dbc39df24cc3c39879fb06935d88ff17 | 2,454 | py | Python | fixtures/createJson.py | AKSHANSH47/crowdsource-platform2 | a31446d44bc10dca56a0d534cab226947a6bbb4e | [
"MIT"
] | null | null | null | fixtures/createJson.py | AKSHANSH47/crowdsource-platform2 | a31446d44bc10dca56a0d534cab226947a6bbb4e | [
"MIT"
] | null | null | null | fixtures/createJson.py | AKSHANSH47/crowdsource-platform2 | a31446d44bc10dca56a0d534cab226947a6bbb4e | [
"MIT"
] | 2 | 2020-01-27T05:35:50.000Z | 2020-02-29T12:55:39.000Z | __author__ = 'Megha'
# Script to transfer csv containing data about various models to json
# Input csv file constituting of the model data
# Output json file representing the csv data as json object
# Assumes model name to be first line
# Field names of the model on the second line
# Data seperated by __DELIM__
# Examp... | 37.181818 | 106 | 0.707416 | __author__ = 'Megha'
import numpy as np
import pandas as pd
import json as json
__MODULE_NAME__ = 7 __INPUT_FILE__ = 'meghaWorkerData.csv'
__OUTPUT_FILE__ = 'meghaWorkerData.json'
__NEWLINE__ = '\n'
__KEY1__ = 0
__KEY2__ = 0
__DELIM__ = ','
__APPEND__ = 'crowdsourcing.'
__KEY_MODEL__ = 'model'
__KEY_FIELDS__ = 'fiel... | true | true |
f73241d287661520cf1d7ff6db55cdc259ea7d50 | 1,170 | py | Python | python_modules/supersense_list.py | cltl/MFS_classifier | ef3ea52f23aebe798241057046d4b49f181328f3 | [
"Apache-2.0"
] | 2 | 2016-08-12T05:11:36.000Z | 2020-09-20T09:23:28.000Z | python_modules/supersense_list.py | cltl/MFS_classifier | ef3ea52f23aebe798241057046d4b49f181328f3 | [
"Apache-2.0"
] | null | null | null | python_modules/supersense_list.py | cltl/MFS_classifier | ef3ea52f23aebe798241057046d4b49f181328f3 | [
"Apache-2.0"
] | null | null | null | SS = {}
SS['00'] = 'adj.all'
SS['01'] = 'adj.pert'
SS['02'] = 'adv.all'
SS['03'] = 'noun.Tops'
SS['04'] = 'noun.act'
SS['05'] = 'noun.animal'
SS['06'] = 'noun.artifact'
SS['07'] = 'noun.attribute'
SS['08'] = 'noun.body'
SS['09'] = 'noun.cognition'
SS['10'] = 'noun.communication'
SS['11'] = 'noun.event'
SS['12'] = 'noun... | 23.877551 | 31 | 0.570085 | SS = {}
SS['00'] = 'adj.all'
SS['01'] = 'adj.pert'
SS['02'] = 'adv.all'
SS['03'] = 'noun.Tops'
SS['04'] = 'noun.act'
SS['05'] = 'noun.animal'
SS['06'] = 'noun.artifact'
SS['07'] = 'noun.attribute'
SS['08'] = 'noun.body'
SS['09'] = 'noun.cognition'
SS['10'] = 'noun.communication'
SS['11'] = 'noun.event'
SS['12'] = 'noun... | true | true |
f73242295fa78051db57900a4402d3561b804f9b | 3,229 | py | Python | sport/solutions/cf/1196 div3/1196B-4.py | Epikem/dev-tips | ed5a258334dd18ef505f51e320f7a9f5ee535cf9 | [
"MIT"
] | null | null | null | sport/solutions/cf/1196 div3/1196B-4.py | Epikem/dev-tips | ed5a258334dd18ef505f51e320f7a9f5ee535cf9 | [
"MIT"
] | 8 | 2020-04-03T15:33:54.000Z | 2022-03-02T10:24:22.000Z | sport/solutions/cf/1196 div3/1196B-4.py | Epikem/dev-tips | ed5a258334dd18ef505f51e320f7a9f5ee535cf9 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#!/usr/bin/python
false = False
true = True
null = None
# import math
TEST = false
try:
import sys
for arg in sys.argv:
if(arg == 'test'):
print('test mode')
TEST = True
pass
except:
pass
def AddImports(libraryNames):
for... | 23.918519 | 175 | 0.482502 |
false = False
true = True
null = None
TEST = false
try:
import sys
for arg in sys.argv:
if(arg == 'test'):
print('test mode')
TEST = True
pass
except:
pass
def AddImports(libraryNames):
for libname in libraryNames:
if (type(libname) == typ... | true | true |
f7324374f56ad89ad7d856e2040b3f5fad0425c3 | 46,804 | py | Python | venv/lib/python3.7/site-packages/ccxt/okcoinusd.py | balibou/ccxt-ohlcv-fetcher | a64cd43cbfd3fe09de34d8a66416ecc6c10d3b2f | [
"MIT"
] | 2 | 2020-12-17T16:07:27.000Z | 2021-02-10T18:25:41.000Z | venv/lib/python3.7/site-packages/ccxt/okcoinusd.py | balibou/ccxt-ohlcv-fetcher | a64cd43cbfd3fe09de34d8a66416ecc6c10d3b2f | [
"MIT"
] | null | null | null | venv/lib/python3.7/site-packages/ccxt/okcoinusd.py | balibou/ccxt-ohlcv-fetcher | a64cd43cbfd3fe09de34d8a66416ecc6c10d3b2f | [
"MIT"
] | 1 | 2020-03-29T02:05:41.000Z | 2020-03-29T02:05:41.000Z | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.base.exchange import Exchange
import math
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import AuthenticationE... | 45.396702 | 381 | 0.510512 |
from ccxt.base.exchange import Exchange
import math
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import AuthenticationError
from ccxt.base.errors import ArgumentsRequired
from ccxt.base.errors import BadRequest
from ccxt.base.errors import InsufficientFunds
from ccxt.base.errors import InvalidOrde... | true | true |
f73244177849f7ecbf3d99cbfddf1b55449d8ed5 | 1,805 | py | Python | days/day8.py | vanHavel/AdventOfCode2021 | a83ee21cffff56ba3f49de7af5113bf0b11fea7a | [
"MIT"
] | null | null | null | days/day8.py | vanHavel/AdventOfCode2021 | a83ee21cffff56ba3f49de7af5113bf0b11fea7a | [
"MIT"
] | null | null | null | days/day8.py | vanHavel/AdventOfCode2021 | a83ee21cffff56ba3f49de7af5113bf0b11fea7a | [
"MIT"
] | null | null | null | import itertools
from aocd import get_data, submit
DAY = 8
YEAR = 2021
def part1(data: str) -> str:
lines = data.splitlines()
ans = 0
for line in lines:
left, right = line.split('|')
segments = left.split(' ')
code = right.split(' ')
for item in code:
if len(it... | 30.59322 | 152 | 0.491967 | import itertools
from aocd import get_data, submit
DAY = 8
YEAR = 2021
def part1(data: str) -> str:
lines = data.splitlines()
ans = 0
for line in lines:
left, right = line.split('|')
segments = left.split(' ')
code = right.split(' ')
for item in code:
if len(it... | true | true |
f7324580edafa22a20c02c94b053cf9a702a9918 | 6,782 | py | Python | src/network-manager/azext_network_manager/vendored_sdks/operations/_network_manager_deployment_status_operations.py | haroonf/azure-cli-extensions | 61c044d34c224372f186934fa7c9313f1cd3a525 | [
"MIT"
] | null | null | null | src/network-manager/azext_network_manager/vendored_sdks/operations/_network_manager_deployment_status_operations.py | haroonf/azure-cli-extensions | 61c044d34c224372f186934fa7c9313f1cd3a525 | [
"MIT"
] | 9 | 2022-03-25T19:35:49.000Z | 2022-03-31T06:09:47.000Z | src/network-manager/azext_network_manager/vendored_sdks/operations/_network_manager_deployment_status_operations.py | haroonf/azure-cli-extensions | 61c044d34c224372f186934fa7c9313f1cd3a525 | [
"MIT"
] | 1 | 2022-03-10T22:13:02.000Z | 2022-03-10T22:13:02.000Z | # pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRe... | 43.197452 | 226 | 0.69537 | from typing import Any, Callable, Dict, Optional, TypeVar
from msrest import Serializer
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import HttpR... | true | true |
f732469f36d304c9834025f63e03b387b2c8a05a | 4,386 | py | Python | src/train.py | convergence-lab/covid19-detection | 6a57e87ec1d8688712e6170a4c3aafb6e113ca73 | [
"Apache-2.0"
] | 3 | 2020-04-24T12:55:58.000Z | 2020-07-05T22:02:36.000Z | src/train.py | convergence-lab/covid19-detection | 6a57e87ec1d8688712e6170a4c3aafb6e113ca73 | [
"Apache-2.0"
] | null | null | null | src/train.py | convergence-lab/covid19-detection | 6a57e87ec1d8688712e6170a4c3aafb6e113ca73 | [
"Apache-2.0"
] | null | null | null | import toml
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score, f1_score, roc_auc_score
from logzero import logger
import torch
from torch import nn, optim
from torch.utils.data import DataLoader
from torchvision import transforms
from model import Model
from data import l... | 37.810345 | 168 | 0.628363 | import toml
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score, f1_score, roc_auc_score
from logzero import logger
import torch
from torch import nn, optim
from torch.utils.data import DataLoader
from torchvision import transforms
from model import Model
from data import l... | true | true |
f73246b8b79ad99643dd8a62e8dbfdb9e865ba77 | 2,837 | py | Python | tests/test_cli.py | dewancse/csimpy | 58c32e40e5d991b4ca98df05e6f61020def475a9 | [
"Apache-2.0"
] | null | null | null | tests/test_cli.py | dewancse/csimpy | 58c32e40e5d991b4ca98df05e6f61020def475a9 | [
"Apache-2.0"
] | null | null | null | tests/test_cli.py | dewancse/csimpy | 58c32e40e5d991b4ca98df05e6f61020def475a9 | [
"Apache-2.0"
] | 1 | 2020-08-21T02:32:57.000Z | 2020-08-21T02:32:57.000Z | from csimpy import __main__
import csimpy
import os
import shutil
import tempfile
import unittest
class CliTestCase(unittest.TestCase):
EXAMPLE_SEDML_FILENAME = 'tests/fixtures/sine_imports.xml'
def setUp(self):
self.dirname = tempfile.mkdtemp()
def tearDown(self):
shutil.rmtree(self.dir... | 42.343284 | 137 | 0.621431 | from csimpy import __main__
import csimpy
import os
import shutil
import tempfile
import unittest
class CliTestCase(unittest.TestCase):
EXAMPLE_SEDML_FILENAME = 'tests/fixtures/sine_imports.xml'
def setUp(self):
self.dirname = tempfile.mkdtemp()
def tearDown(self):
shutil.rmtree(self.dir... | true | true |
f73247e50e5c0c5c07af1f4e8737b690accc78c9 | 8,242 | py | Python | contrib/devtools/security-check.py | PaulieD/dash | 5be0935889a4faadf12793bb81f4da05eee9818f | [
"MIT"
] | null | null | null | contrib/devtools/security-check.py | PaulieD/dash | 5be0935889a4faadf12793bb81f4da05eee9818f | [
"MIT"
] | 14 | 2021-07-16T00:54:07.000Z | 2022-01-04T20:56:20.000Z | contrib/devtools/security-check.py | PaulieD/dash | 5be0935889a4faadf12793bb81f4da05eee9818f | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2015-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.
'''
Perform basic ELF security checks on a series of executables.
Exit status will be 0 if successful, and... | 38.157407 | 167 | 0.639044 | import subprocess
import sys
import os
READELF_CMD = os.getenv('READELF', '/usr/bin/readelf')
OBJDUMP_CMD = os.getenv('OBJDUMP', '/usr/bin/objdump')
NONFATAL = {}
def check_ELF_PIE(executable):
p = subprocess.Popen([READELF_CMD, '-h', '-W', executable], stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subpro... | true | true |
f7324802c626b3c05b5f37a799a82b7a683fbb30 | 919 | py | Python | soupy/utils/vector2function.py | cpempire/soupy | 9f65e3329fa126619c893daa4cd80478d83f840c | [
"MIT"
] | 1 | 2021-12-07T15:22:23.000Z | 2021-12-07T15:22:23.000Z | soupy/utils/vector2function.py | cpempire/soupy | 9f65e3329fa126619c893daa4cd80478d83f840c | [
"MIT"
] | null | null | null | soupy/utils/vector2function.py | cpempire/soupy | 9f65e3329fa126619c893daa4cd80478d83f840c | [
"MIT"
] | null | null | null | # Copyright (c) 2016, The University of Texas at Austin & University of
# California, Merced.
#
# All Rights reserved.
# See file COPYRIGHT for details.
#
# This file is part of the hIPPYlib library. For more information and source code
# availability see https://hippylib.github.io.
#
# hIPPYlib is free software; you c... | 32.821429 | 95 | 0.733406 |
from __future__ import absolute_import, division, print_function
from dolfin import Function
def vector2Function(x,Vh, **kwargs):
fun = Function(Vh,**kwargs)
fun.vector().zero()
fun.vector().axpy(1., x)
return fun
| true | true |
f732485708d463cf7bbae78662a8c0acf679efce | 1,010 | py | Python | testing/CinemaRenderTest.py | JonasLukasczyk/workbench | 4a59faeb181185bc57d8bce605bdd1f0bfe4fe42 | [
"BSD-3-Clause"
] | null | null | null | testing/CinemaRenderTest.py | JonasLukasczyk/workbench | 4a59faeb181185bc57d8bce605bdd1f0bfe4fe42 | [
"BSD-3-Clause"
] | null | null | null | testing/CinemaRenderTest.py | JonasLukasczyk/workbench | 4a59faeb181185bc57d8bce605bdd1f0bfe4fe42 | [
"BSD-3-Clause"
] | null | null | null | import pytest
import pytest_xvfb
import os
import cinemasci
@pytest.fixture(autouse=True, scope='session')
def ensure_xvfb():
if not pytest_xvfb.xvfb_available():
raise Exception("Tests need Xvfb to run.")
def test_render():
# create a test database
os.system("./bin/create-database --database scratch/cine... | 28.055556 | 74 | 0.723762 | import pytest
import pytest_xvfb
import os
import cinemasci
@pytest.fixture(autouse=True, scope='session')
def ensure_xvfb():
if not pytest_xvfb.xvfb_available():
raise Exception("Tests need Xvfb to run.")
def test_render():
os.system("./bin/create-database --database scratch/cinema.cdb")
cdb = cinem... | true | true |
f73248e41a1991164ec0c0c4fe0a9e0935251679 | 2,181 | py | Python | tests/test_local_storage.py | parikshitsaikia1619/pqai-db | bf550448fee3c2ca766cbdaf6ef8a1ccb613004e | [
"MIT"
] | 3 | 2022-01-18T04:44:13.000Z | 2022-03-29T19:10:48.000Z | tests/test_local_storage.py | parikshitsaikia1619/pqai-db | bf550448fee3c2ca766cbdaf6ef8a1ccb613004e | [
"MIT"
] | 4 | 2022-01-14T19:32:24.000Z | 2022-03-28T15:15:32.000Z | tests/test_local_storage.py | parikshitsaikia1619/pqai-db | bf550448fee3c2ca766cbdaf6ef8a1ccb613004e | [
"MIT"
] | 2 | 2022-01-31T18:54:37.000Z | 2022-03-25T14:42:43.000Z | """
Unit test for custom wrapper around local storage
"""
import unittest
import sys
import json
from pathlib import Path
BASE_DIR = Path(__file__).parent.parent
sys.path.append(str(BASE_DIR.resolve()))
#pylint: disable=wrong-import-position
from core.local_storage_wrapper import LocalStorage
import testutil
class ... | 27.961538 | 79 | 0.657038 | import unittest
import sys
import json
from pathlib import Path
BASE_DIR = Path(__file__).parent.parent
sys.path.append(str(BASE_DIR.resolve()))
from core.local_storage_wrapper import LocalStorage
import testutil
class TestLocalStorage(unittest.TestCase):
def setUp(self):
root = testutil.set_up_test_l... | true | true |
f7324aefd9332ce661a8bd4ef6f4f2249ee510e7 | 13,225 | py | Python | trains/backend_config/config.py | MatthewYee92/trains | f5f13658c335250165d9c57c0ba30abffdda4171 | [
"Apache-2.0"
] | 1 | 2021-05-06T13:33:36.000Z | 2021-05-06T13:33:36.000Z | trains/backend_config/config.py | iridiumblue/trains | 101e5393d1ba73462a6a85df55a2dfb4b629cb0d | [
"Apache-2.0"
] | 4 | 2020-09-26T00:55:57.000Z | 2022-02-10T01:18:20.000Z | trains/backend_config/config.py | iridiumblue/trains | 101e5393d1ba73462a6a85df55a2dfb4b629cb0d | [
"Apache-2.0"
] | null | null | null | from __future__ import print_function
import functools
import json
import os
import sys
import warnings
from fnmatch import fnmatch
from os.path import expanduser
from typing import Any
import six
from pathlib2 import Path
from ..utilities.pyhocon import ConfigTree, ConfigFactory
from pyparsing import (
ParseFata... | 32.256098 | 123 | 0.569603 | from __future__ import print_function
import functools
import json
import os
import sys
import warnings
from fnmatch import fnmatch
from os.path import expanduser
from typing import Any
import six
from pathlib2 import Path
from ..utilities.pyhocon import ConfigTree, ConfigFactory
from pyparsing import (
ParseFata... | true | true |
f7324e9d85c6b26f3d0e35e8b0a6ac93397d49bb | 1,086 | py | Python | alipay/aop/api/response/AlipayMsaasMediarecogAftscvpayTransactionInitializeResponse.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/response/AlipayMsaasMediarecogAftscvpayTransactionInitializeResponse.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/response/AlipayMsaasMediarecogAftscvpayTransactionInitializeResponse.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
class AlipayMsaasMediarecogAftscvpayTransactionInitializeResponse(AlipayResponse):
def __init__(self):
super(AlipayMsaasMediarecogAftscvpayTransactionInitializeResponse, self).__in... | 30.166667 | 132 | 0.713628 | import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
class AlipayMsaasMediarecogAftscvpayTransactionInitializeResponse(AlipayResponse):
def __init__(self):
super(AlipayMsaasMediarecogAftscvpayTransactionInitializeResponse, self).__init__()
self._result = None
sel... | true | true |
f7324ff40cd974939b80147b034871e58952ecc3 | 1,329 | py | Python | dvd540crop.py | tai271828/session-video-publisher | 7c3ea170759e53b94345e655a1299ba9ab32158c | [
"0BSD"
] | null | null | null | dvd540crop.py | tai271828/session-video-publisher | 7c3ea170759e53b94345e655a1299ba9ab32158c | [
"0BSD"
] | 5 | 2020-11-15T12:45:03.000Z | 2021-12-07T08:29:40.000Z | dvd540crop.py | tai271828/session-video-publisher | 7c3ea170759e53b94345e655a1299ba9ab32158c | [
"0BSD"
] | 4 | 2018-06-23T16:48:03.000Z | 2021-04-18T09:51:29.000Z | """Crop letterbox from videos fixed by dvd540fix.
This assumes the input video is of dimension 720x540.
Example usage:
python dvd540crop.py 自製高擴充性機器學習系統 --height=480 --top=40
"""
import argparse
import os
import pathlib
import subprocess
i_dir = pathlib.Path(os.environ["VIDEO_ROOT"], "in")
o_dir = pathlib.Pat... | 23.732143 | 71 | 0.696764 |
import argparse
import os
import pathlib
import subprocess
i_dir = pathlib.Path(os.environ["VIDEO_ROOT"], "in")
o_dir = pathlib.Path(os.environ["VIDEO_ROOT"], "out")
o_dir.mkdir(parents=True, exist_ok=True)
input_mapping = {i_path.stem: i_path for i_path in i_dir.glob("*.avi")}
parser = argparse.ArgumentParser()... | true | true |
f73250a01c56694962e8ffc0fb3a96d714bf4401 | 1,598 | py | Python | mytreeview.py | xiaoyaofe/bale-backstage | 6d1955e7a6038c9588f86530cd4519e0f719f285 | [
"MIT"
] | null | null | null | mytreeview.py | xiaoyaofe/bale-backstage | 6d1955e7a6038c9588f86530cd4519e0f719f285 | [
"MIT"
] | null | null | null | mytreeview.py | xiaoyaofe/bale-backstage | 6d1955e7a6038c9588f86530cd4519e0f719f285 | [
"MIT"
] | null | null | null | from tkinter import *
from tkinter import ttk
class MyTreeview(Frame):
def __init__(self, master):
super().__init__(master)
self.treeview = ttk.Treeview(self)
# attach a vertical scrollbar to the frame
verbar = ttk.Scrollbar(self, orient='vertical')
verbar.pack(side = 'righ... | 36.318182 | 99 | 0.614518 | from tkinter import *
from tkinter import ttk
class MyTreeview(Frame):
def __init__(self, master):
super().__init__(master)
self.treeview = ttk.Treeview(self)
verbar = ttk.Scrollbar(self, orient='vertical')
verbar.pack(side = 'right', fill = 'y')
verbar.configure(co... | true | true |
f73251238eb97dd177c8621e70d07e8df4721a2a | 629 | py | Python | dashboard/manage.py | hebergui/webtrade | 338fbf334b6ba173296635b380b53b088a87bb95 | [
"Apache-2.0"
] | 9 | 2019-11-13T18:05:51.000Z | 2021-05-05T16:04:35.000Z | dashboard/manage.py | hebergui/webtrade | 338fbf334b6ba173296635b380b53b088a87bb95 | [
"Apache-2.0"
] | 9 | 2019-12-04T23:50:52.000Z | 2022-02-10T12:02:50.000Z | dashboard/manage.py | hebergui/webtrade | 338fbf334b6ba173296635b380b53b088a87bb95 | [
"Apache-2.0"
] | 7 | 2020-04-19T17:34:58.000Z | 2021-12-25T22:09:33.000Z | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'dashboard.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise Impo... | 28.590909 | 73 | 0.683625 | import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'dashboard.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
... | true | true |
f73251bfb4f2a7f1536890502a96d262792a3c60 | 602 | py | Python | baseline/baseline_classifier.py | HLTCHKUST/emotion-dialogue | 0d58b339134dd9a2f386948ae474b270a77370f9 | [
"MIT"
] | 40 | 2019-04-29T09:17:48.000Z | 2021-11-19T06:32:02.000Z | baseline/baseline_classifier.py | HLTCHKUST/emotion-dialogue | 0d58b339134dd9a2f386948ae474b270a77370f9 | [
"MIT"
] | null | null | null | baseline/baseline_classifier.py | HLTCHKUST/emotion-dialogue | 0d58b339134dd9a2f386948ae474b270a77370f9 | [
"MIT"
] | 4 | 2019-09-01T10:00:56.000Z | 2020-03-08T16:00:22.000Z | from utils import constant
from sklearn import svm
from sklearn.svm import SVC
from sklearn.linear_model import LogisticRegression
from xgboost import XGBClassifier
def get_classifier(ty="LR", c=1.0, max_depth=5, n_estimators=300, gamma=0):
if(ty=="LR"):
classifier = LogisticRegression(solver='lbfgs',mult... | 40.133333 | 148 | 0.727575 | from utils import constant
from sklearn import svm
from sklearn.svm import SVC
from sklearn.linear_model import LogisticRegression
from xgboost import XGBClassifier
def get_classifier(ty="LR", c=1.0, max_depth=5, n_estimators=300, gamma=0):
if(ty=="LR"):
classifier = LogisticRegression(solver='lbfgs',mult... | true | true |
f732535face63b7bf467ecb42cb63a898b1c32f2 | 446 | py | Python | SideProjectsPython/quadratic.py | EthanLawr/ComputerScience | 5edb37c05023f3cd0d4160bcc480c3d2fdabc3a8 | [
"Apache-2.0"
] | 2 | 2021-08-21T17:40:07.000Z | 2021-11-08T10:37:25.000Z | SideProjectsPython/quadratic.py | EthanLawr/ComputerScience | 5edb37c05023f3cd0d4160bcc480c3d2fdabc3a8 | [
"Apache-2.0"
] | 1 | 2017-12-11T16:08:15.000Z | 2017-12-11T16:08:15.000Z | SideProjectsPython/quadratic.py | EthanLawr/ComputerScience | 5edb37c05023f3cd0d4160bcc480c3d2fdabc3a8 | [
"Apache-2.0"
] | null | null | null | import math
num1 = int(input("Enter a:"))
num2 = int(input("Enter b:"))
num3 = int(input("Enter c:"))
result1 = (-num2 + math.sqrt(num2**2 - 4 * (num1) * (num3)))
result2 = (result1 / (2 * num1))
print("Positive: ")
print(result2)
print("-------------------------------------------------------------")
print("Ne... | 29.733333 | 71 | 0.5 | import math
num1 = int(input("Enter a:"))
num2 = int(input("Enter b:"))
num3 = int(input("Enter c:"))
result1 = (-num2 + math.sqrt(num2**2 - 4 * (num1) * (num3)))
result2 = (result1 / (2 * num1))
print("Positive: ")
print(result2)
print("-------------------------------------------------------------")
print("Ne... | true | true |
f73253d8f8ec0e7ce8cc0868d1b80b62f06e7512 | 3,697 | py | Python | apps/portalbase/system/system__usermanager/methodclass/system_usermanager.gen.py | jumpscale7/jumpscale_portal | 8c99265e48f85643f8a52bc40a23f5266fb09231 | [
"Apache-2.0"
] | 2 | 2016-04-14T14:05:01.000Z | 2016-04-21T07:20:36.000Z | apps/portalbase/system/system__usermanager/methodclass/system_usermanager.gen.py | jumpscale7/jumpscale_portal | 8c99265e48f85643f8a52bc40a23f5266fb09231 | [
"Apache-2.0"
] | 13 | 2016-03-07T12:07:15.000Z | 2018-02-28T13:11:59.000Z | apps/portalbase/system/system__usermanager/methodclass/system_usermanager.gen.py | jumpscale7/jumpscale_portal | 8c99265e48f85643f8a52bc40a23f5266fb09231 | [
"Apache-2.0"
] | 5 | 2016-03-08T07:49:51.000Z | 2018-10-19T13:57:04.000Z | from JumpScale import j
class system_usermanager(j.code.classGetBase()):
"""
get a user
"""
def __init__(self):
pass
self._te={}
self.actorname="usermanager"
self.appname="system"
#system_usermanager_osis.__init__(self)
def authenticate(self, name,... | 32.147826 | 85 | 0.621315 | from JumpScale import j
class system_usermanager(j.code.classGetBase()):
def __init__(self):
pass
self._te={}
self.actorname="usermanager"
self.appname="system"
def authenticate(self, name, secret, **kwargs):
raise NotImplementedError ("not imp... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.