hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f73705d5d78315808f4d74a40540e894170a1775 | 476 | py | Python | main.py | ram-nad/autodiff | a4ea49d15ae730ddfa79c3615807285006d5e7d7 | [
"MIT"
] | 2 | 2020-09-21T04:02:37.000Z | 2020-09-21T04:02:38.000Z | main.py | gayatri-a-b/autodiff | 98bdfea087cb67dd6e2a1a399e90bbd7ac4eb326 | [
"MIT"
] | 1 | 2020-06-22T07:15:49.000Z | 2020-06-22T07:15:49.000Z | main.py | gayatri-a-b/autodiff | 98bdfea087cb67dd6e2a1a399e90bbd7ac4eb326 | [
"MIT"
] | 3 | 2020-02-26T13:14:42.000Z | 2020-05-25T03:52:45.000Z | def declare_variables(variables, macro):
"""
This is the hook for the functions
- variables: the dictionary that contains the variables
- macro: a decorator function, to declare a macro.
"""
@macro
def inputcode(filename, language):
f = open(filename, 'r')
text = f.read()
... | 25.052632 | 59 | 0.611345 | def declare_variables(variables, macro):
@macro
def inputcode(filename, language):
f = open(filename, 'r')
text = f.read()
textblock = f'```{language}\n{text}\n```'
return textblock
@macro
def inputcpp(filename):
return inputcode(filename, 'cpp')
| true | true |
f73705f5af8b25d3b769ff5aa372f92b61fbe44e | 951 | py | Python | app/celery/broadcast_message_tasks.py | caduvieira/notifications-api | ae3bf624e67be25fcab97aa0427749e5671bba3d | [
"MIT"
] | null | null | null | app/celery/broadcast_message_tasks.py | caduvieira/notifications-api | ae3bf624e67be25fcab97aa0427749e5671bba3d | [
"MIT"
] | null | null | null | app/celery/broadcast_message_tasks.py | caduvieira/notifications-api | ae3bf624e67be25fcab97aa0427749e5671bba3d | [
"MIT"
] | null | null | null | import requests
from flask import current_app
from notifications_utils.statsd_decorators import statsd
from app import notify_celery
from app.dao.broadcast_message_dao import dao_get_broadcast_event_by_id
@notify_celery.task(name="send-broadcast-event")
@statsd(namespace="tasks")
def send_broadcast_event(broadcast_... | 29.71875 | 78 | 0.75184 | import requests
from flask import current_app
from notifications_utils.statsd_decorators import statsd
from app import notify_celery
from app.dao.broadcast_message_dao import dao_get_broadcast_event_by_id
@notify_celery.task(name="send-broadcast-event")
@statsd(namespace="tasks")
def send_broadcast_event(broadcast_... | true | true |
f737062a090b27a72610975252e5a63c44b8cc09 | 4,549 | py | Python | Machine Learning Prediction Software Based on Classification and Regression Based on Processor [CPU] Specifications.py | emirhanai/Machine-Learning-Prediction-Software-Based-on-Classification-and-Regression-Based-on-Processor-CPU- | 051be998eb9195dccf28c2e7607ead0812c79cf1 | [
"MIT"
] | 5 | 2021-09-08T20:47:10.000Z | 2021-11-24T08:51:45.000Z | Machine Learning Prediction Software Based on Classification and Regression Based on Processor [CPU] Specifications.py | emirhanai/Machine-Learning-Prediction-Software-Based-on-Classification-and-Regression-Based-on-Processor-CPU | 051be998eb9195dccf28c2e7607ead0812c79cf1 | [
"MIT"
] | null | null | null | Machine Learning Prediction Software Based on Classification and Regression Based on Processor [CPU] Specifications.py | emirhanai/Machine-Learning-Prediction-Software-Based-on-Classification-and-Regression-Based-on-Processor-CPU | 051be998eb9195dccf28c2e7607ead0812c79cf1 | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
from sklearn.tree import *
from sklearn.ensemble import *
from sklearn.preprocessing import *
from sklearn.model_selection import *
from sklearn.metrics import *
data = pd.read_csv('data.csv')
X = data.drop(['Company','Processor Name'],axis='columns')
y = data.drop(... | 37.595041 | 144 | 0.729171 | import pandas as pd
import numpy as np
from sklearn.tree import *
from sklearn.ensemble import *
from sklearn.preprocessing import *
from sklearn.model_selection import *
from sklearn.metrics import *
data = pd.read_csv('data.csv')
X = data.drop(['Company','Processor Name'],axis='columns')
y = data.drop(... | true | true |
f737068faf59526a08f6a390982dde3033bd0fc4 | 3,907 | py | Python | src/core/tests/frontend/paddlepaddle/test_models/gen_scripts/generate_yolo_box.py | ytorzuk-altran/openvino | 68d460a3bb578a738ba0e4d0e1f2e321afa73ab0 | [
"Apache-2.0"
] | 2,406 | 2020-04-22T15:47:54.000Z | 2022-03-31T10:27:37.000Z | ngraph/test/frontend/paddlepaddle/test_models/gen_scripts/generate_yolo_box.py | thomas-yanxin/openvino | 031e998a15ec738c64cc2379d7f30fb73087c272 | [
"Apache-2.0"
] | 4,948 | 2020-04-22T15:12:39.000Z | 2022-03-31T18:45:42.000Z | ngraph/test/frontend/paddlepaddle/test_models/gen_scripts/generate_yolo_box.py | thomas-yanxin/openvino | 031e998a15ec738c64cc2379d7f30fb73087c272 | [
"Apache-2.0"
] | 991 | 2020-04-23T18:21:09.000Z | 2022-03-31T18:40:57.000Z | #
# pool2d paddle model generator
#
import numpy as np
from save_model import saveModel
import sys
def yolo_box(name : str, x, img_size, attrs : dict):
import paddle as pdpd
pdpd.enable_static()
with pdpd.static.program_guard(pdpd.static.Program(), pdpd.static.Program()):
node_x = pdpd.static.... | 34.27193 | 101 | 0.545175 |
import numpy as np
from save_model import saveModel
import sys
def yolo_box(name : str, x, img_size, attrs : dict):
import paddle as pdpd
pdpd.enable_static()
with pdpd.static.program_guard(pdpd.static.Program(), pdpd.static.Program()):
node_x = pdpd.static.data(name='x', shape=x.shape, dty... | true | true |
f73706a6fea89b94319fbeef53c5b69ad611d050 | 4,078 | py | Python | examples/DeepQNetwork/common.py | Sangyeob-Kim/tensorpack_rev | bf4020892edc123a09e08de784da0448464529b2 | [
"Apache-2.0"
] | 5 | 2018-05-04T02:04:15.000Z | 2020-04-02T05:38:48.000Z | examples/DeepQNetwork/common.py | Sangyeob-Kim/tensorpack_rev | bf4020892edc123a09e08de784da0448464529b2 | [
"Apache-2.0"
] | null | null | null | examples/DeepQNetwork/common.py | Sangyeob-Kim/tensorpack_rev | bf4020892edc123a09e08de784da0448464529b2 | [
"Apache-2.0"
] | 2 | 2018-04-23T13:43:10.000Z | 2019-10-30T09:56:54.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# File: common.py
# Author: Yuxin Wu <ppwwyyxxc@gmail.com>
import random
import time
import multiprocessing
from tqdm import tqdm
from six.moves import queue
from tensorpack.utils.concurrency import StoppableThread, ShareSessionThread
from tensorpack.callbacks import Callb... | 29.766423 | 76 | 0.590976 |
import random
import time
import multiprocessing
from tqdm import tqdm
from six.moves import queue
from tensorpack.utils.concurrency import StoppableThread, ShareSessionThread
from tensorpack.callbacks import Callback
from tensorpack.utils import logger
from tensorpack.utils.stats import StatCounter
from tensorpac... | true | true |
f737072d2a3c2c849c28edc97c05c1834c6a7b1f | 1,016 | py | Python | ava_connect_clouds.py | TotallyAProgrammer/ava | e1e0f332f6278cd41d68d48a12e88190c73cd8f6 | [
"Apache-2.0"
] | null | null | null | ava_connect_clouds.py | TotallyAProgrammer/ava | e1e0f332f6278cd41d68d48a12e88190c73cd8f6 | [
"Apache-2.0"
] | 2 | 2021-04-06T18:23:11.000Z | 2021-06-02T03:38:46.000Z | ava_connect_clouds.py | TotallyAProgrammer/ava | e1e0f332f6278cd41d68d48a12e88190c73cd8f6 | [
"Apache-2.0"
] | 1 | 2020-12-12T04:51:56.000Z | 2020-12-12T04:51:56.000Z | import socket
from cmd_functions import is_ip_valid, is_port_valid
'''
A library that allows AVA to connect to various cloud services
'''
def send_to_cloud(socket, data):
"""
Send data over the specified socket to the associated cloud
socket = any socket object
data = a string or int to be sent over t... | 28.222222 | 65 | 0.637795 | import socket
from cmd_functions import is_ip_valid, is_port_valid
def send_to_cloud(socket, data):
try:
data = data.encode()
socket.send((str(data) +"\n").encode())
return True
except Exception as exp:
print("Exception: " + str(exp))
return False
def connect_ava_cloud... | true | true |
f737075279a0091da91a94dafc37152943b3a225 | 16,846 | py | Python | blackbox/test_docs.py | infoverload/crate | 31233d1a4a65cfaa50f319e1ca707a9e643e6072 | [
"Apache-2.0"
] | null | null | null | blackbox/test_docs.py | infoverload/crate | 31233d1a4a65cfaa50f319e1ca707a9e643e6072 | [
"Apache-2.0"
] | null | null | null | blackbox/test_docs.py | infoverload/crate | 31233d1a4a65cfaa50f319e1ca707a9e643e6072 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8; -*-
#
# Licensed to CRATE Technology GmbH ("Crate") under one or more contributor
# license agreements. See the NOTICE file distributed with this work for
# additional information regarding copyright ownership. Crate licenses
# this file to you under the Apache License, Version 2.0 (the "License"... | 32.774319 | 101 | 0.604595 |
import doctest
import zc.customdoctests
from cr8.run_crate import CrateNode
import os
import time
import shutil
import json
import re
import random
import tempfile
import subprocess
import unittest
from functools import partial
from testutils.paths import crate_path, project_path
from crate.crash.c... | true | true |
f7370875a57284055f7aabb5f9047486b7ba55a3 | 8,303 | py | Python | tests/test_assignment.py | PennState/canvasapi | 077cbd51516484a5c44834c8aa3d0c4425e4ffcf | [
"MIT"
] | 1 | 2019-07-08T14:04:45.000Z | 2019-07-08T14:04:45.000Z | tests/test_assignment.py | PennState/canvasapi | 077cbd51516484a5c44834c8aa3d0c4425e4ffcf | [
"MIT"
] | null | null | null | tests/test_assignment.py | PennState/canvasapi | 077cbd51516484a5c44834c8aa3d0c4425e4ffcf | [
"MIT"
] | null | null | null | from __future__ import absolute_import, division, print_function, unicode_literals
import unittest
import uuid
import requests_mock
from canvasapi import Canvas
from canvasapi.assignment import Assignment, AssignmentGroup
from canvasapi.exceptions import CanvasException, RequiredFieldMissing
from canvasapi.progress i... | 34.740586 | 82 | 0.65386 | from __future__ import absolute_import, division, print_function, unicode_literals
import unittest
import uuid
import requests_mock
from canvasapi import Canvas
from canvasapi.assignment import Assignment, AssignmentGroup
from canvasapi.exceptions import CanvasException, RequiredFieldMissing
from canvasapi.progress i... | true | true |
f7370ac2fcd22d48c14bbb5915a279a965212500 | 9,348 | py | Python | make_tests.py | guidefloripa/kerasify | cbb2ea6cae61ccd551b0f5327433d23e8e8050ee | [
"MIT"
] | 185 | 2016-11-08T11:45:35.000Z | 2022-03-30T12:53:30.000Z | make_tests.py | guidefloripa/kerasify | cbb2ea6cae61ccd551b0f5327433d23e8e8050ee | [
"MIT"
] | 12 | 2016-12-25T00:25:52.000Z | 2021-05-07T04:02:26.000Z | make_tests.py | guidefloripa/kerasify | cbb2ea6cae61ccd551b0f5327433d23e8e8050ee | [
"MIT"
] | 61 | 2016-11-16T19:15:34.000Z | 2021-11-05T19:33:59.000Z | import numpy as np
import pprint
from keras.models import Sequential
from keras.layers import Convolution2D, Dense, Flatten, Activation, MaxPooling2D, Dropout
from keras.layers.recurrent import LSTM
from keras.layers.advanced_activations import ELU
from keras.layers.embeddings import Embedding
from kerasify import ex... | 28.587156 | 115 | 0.674476 | import numpy as np
import pprint
from keras.models import Sequential
from keras.layers import Convolution2D, Dense, Flatten, Activation, MaxPooling2D, Dropout
from keras.layers.recurrent import LSTM
from keras.layers.advanced_activations import ELU
from keras.layers.embeddings import Embedding
from kerasify import ex... | true | true |
f7370d3a7ba6b398302266319fded87169772eec | 1,227 | py | Python | marqeta/response_models/address_verification_model.py | marqeta/marqeta-python | 66fa690eb910825c510a391720b0fe717fac0234 | [
"MIT"
] | 21 | 2019-04-12T09:02:17.000Z | 2022-02-18T11:39:06.000Z | marqeta/response_models/address_verification_model.py | marqeta/marqeta-python | 66fa690eb910825c510a391720b0fe717fac0234 | [
"MIT"
] | 1 | 2020-07-22T21:27:40.000Z | 2020-07-23T17:38:43.000Z | marqeta/response_models/address_verification_model.py | marqeta/marqeta-python | 66fa690eb910825c510a391720b0fe717fac0234 | [
"MIT"
] | 10 | 2019-05-08T14:20:37.000Z | 2021-09-20T18:09:26.000Z | from datetime import datetime, date
from marqeta.response_models.avs_information import AvsInformation
from marqeta.response_models.avs_information import AvsInformation
from marqeta.response_models.response import Response
from marqeta.response_models import datetime_object
import json
import re
class AddressVerifica... | 31.461538 | 112 | 0.723716 | from datetime import datetime, date
from marqeta.response_models.avs_information import AvsInformation
from marqeta.response_models.avs_information import AvsInformation
from marqeta.response_models.response import Response
from marqeta.response_models import datetime_object
import json
import re
class AddressVerifica... | true | true |
f7370e0352afbfdab72ada882dad548f334521bd | 6,015 | py | Python | sanic_thumbnails/thumbnail.py | q8977452/sanic-thumbnails | 75a9e9aab4918a47162b80af8eb41fe30ad64742 | [
"MIT"
] | null | null | null | sanic_thumbnails/thumbnail.py | q8977452/sanic-thumbnails | 75a9e9aab4918a47162b80af8eb41fe30ad64742 | [
"MIT"
] | null | null | null | sanic_thumbnails/thumbnail.py | q8977452/sanic-thumbnails | 75a9e9aab4918a47162b80af8eb41fe30ad64742 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
import os
from io import BytesIO
try:
from PIL import Image, ImageOps
except ImportError:
raise RuntimeError('Get Pillow at https://pypi.python.org/pypi/Pillow '
'or run command "pip install Pillow".')
from .utils import import_from_string, gene... | 33.983051 | 116 | 0.644888 | from __future__ import unicode_literals
import os
from io import BytesIO
try:
from PIL import Image, ImageOps
except ImportError:
raise RuntimeError('Get Pillow at https://pypi.python.org/pypi/Pillow '
'or run command "pip install Pillow".')
from .utils import import_from_string, gene... | true | true |
f7370e1afaa6e24e00c83149ce63506f03dc9fa0 | 222,734 | py | Python | hydrus/client/gui/ClientGUIScrolledPanelsManagement.py | SiNevesh/hydrus | 39f3a0589e5d9fe665babb7dc7535cf69d4bc582 | [
"WTFPL"
] | null | null | null | hydrus/client/gui/ClientGUIScrolledPanelsManagement.py | SiNevesh/hydrus | 39f3a0589e5d9fe665babb7dc7535cf69d4bc582 | [
"WTFPL"
] | null | null | null | hydrus/client/gui/ClientGUIScrolledPanelsManagement.py | SiNevesh/hydrus | 39f3a0589e5d9fe665babb7dc7535cf69d4bc582 | [
"WTFPL"
] | null | null | null | import collections
import os
import random
import re
import traceback
from qtpy import QtCore as QC
from qtpy import QtWidgets as QW
from qtpy import QtGui as QG
from hydrus.core import HydrusConstants as HC
from hydrus.core import HydrusData
from hydrus.core import HydrusExceptions
from hydrus.core import HydrusGlob... | 51.109224 | 396 | 0.61604 | import collections
import os
import random
import re
import traceback
from qtpy import QtCore as QC
from qtpy import QtWidgets as QW
from qtpy import QtGui as QG
from hydrus.core import HydrusConstants as HC
from hydrus.core import HydrusData
from hydrus.core import HydrusExceptions
from hydrus.core import HydrusGlob... | true | true |
f7370f304d2f3d2c71675dfd32940ea74d4f55c8 | 1,146 | py | Python | parallelbar/tools.py | dubovikmaster/parallelbar | 9ae8aa51c8ea89e3842cc3428aa488cf37066338 | [
"MIT"
] | 4 | 2021-08-05T11:45:20.000Z | 2021-12-26T15:19:16.000Z | parallelbar/tools.py | dubovikmaster/parallelbar | 9ae8aa51c8ea89e3842cc3428aa488cf37066338 | [
"MIT"
] | null | null | null | parallelbar/tools.py | dubovikmaster/parallelbar | 9ae8aa51c8ea89e3842cc3428aa488cf37066338 | [
"MIT"
] | 1 | 2022-01-26T17:49:22.000Z | 2022-01-26T17:49:22.000Z | from math import sin, cos, radians
def func_args_unpack(func, args):
return func(*args)
def get_len(iterable, total):
try:
length = iterable.__len__()
except AttributeError:
length = total
return length
def cpu_bench(number):
product = 1.0
for elem in range(number):
... | 21.222222 | 60 | 0.596859 | from math import sin, cos, radians
def func_args_unpack(func, args):
return func(*args)
def get_len(iterable, total):
try:
length = iterable.__len__()
except AttributeError:
length = total
return length
def cpu_bench(number):
product = 1.0
for elem in range(number):
... | true | true |
f73711d86f4b2d494a534b3efcb1258c44779b25 | 1,366 | py | Python | Code/scripts/select_user.py | Alerovere/WALIS | ddd9ea65055f2849ee59e7be7d39629218ff14e4 | [
"MIT"
] | null | null | null | Code/scripts/select_user.py | Alerovere/WALIS | ddd9ea65055f2849ee59e7be7d39629218ff14e4 | [
"MIT"
] | null | null | null | Code/scripts/select_user.py | Alerovere/WALIS | ddd9ea65055f2849ee59e7be7d39629218ff14e4 | [
"MIT"
] | null | null | null | ## From the dictionary in connection.py, extract the dataframes
rsl=walis_dict[0].copy()
countries=walis_dict[1].copy()
regions=walis_dict[2].copy()
MIS_ages=walis_dict[3].copy()
references=walis_dict[4].copy()
hrzpos=walis_dict[5].copy()
rslind=walis_dict[6].copy()
sldatum=walis_dict[7].copy()
vrt_meas=walis_dict[8].c... | 35.947368 | 106 | 0.762079 | ns=walis_dict[2].copy()
MIS_ages=walis_dict[3].copy()
references=walis_dict[4].copy()
hrzpos=walis_dict[5].copy()
rslind=walis_dict[6].copy()
sldatum=walis_dict[7].copy()
vrt_meas=walis_dict[8].copy()
useries=walis_dict[9].copy()
aar=walis_dict[10].copy()
luminescence=walis_dict[11].copy()
esr=walis_dict[12].copy()
str... | true | true |
f7371207afddb1e5f2666d504ad248b681b95ded | 513 | py | Python | Bio/PDB/PDBExceptions.py | sbassi/biopython | b41975bb8363171add80d19903861f3d8cffe405 | [
"PostgreSQL"
] | 1 | 2019-08-05T08:39:27.000Z | 2019-08-05T08:39:27.000Z | Bio/PDB/PDBExceptions.py | sbassi/biopython | b41975bb8363171add80d19903861f3d8cffe405 | [
"PostgreSQL"
] | null | null | null | Bio/PDB/PDBExceptions.py | sbassi/biopython | b41975bb8363171add80d19903861f3d8cffe405 | [
"PostgreSQL"
] | null | null | null | # Copyright (C) 2002, Thomas Hamelryck (thamelry@binf.ku.dk)
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
"""Some Bio.PDB-specific exceptions."""
# General error
class PDBException(Exception):
... | 27 | 70 | 0.762183 |
class PDBException(Exception):
pass
class PDBConstructionException(Exception):
pass
class PDBConstructionWarning(Warning):
pass
| true | true |
f7371517b360fd9b2af5fd089b116986f003ead3 | 794 | py | Python | handlers/user/delivery_status.py | ndoubleu/telegram | 64bd05ac5b84e5d34b8583d2dbfe7a6fdf5c485d | [
"MIT"
] | null | null | null | handlers/user/delivery_status.py | ndoubleu/telegram | 64bd05ac5b84e5d34b8583d2dbfe7a6fdf5c485d | [
"MIT"
] | null | null | null | handlers/user/delivery_status.py | ndoubleu/telegram | 64bd05ac5b84e5d34b8583d2dbfe7a6fdf5c485d | [
"MIT"
] | null | null | null |
from aiogram.types import Message
from loader import dp, db
from .menu import delivery_status
from filters import IsUser
@dp.message_handler(IsUser(), text=delivery_status)
async def process_delivery_status(message: Message):
orders = db.fetchall('SELECT * FROM orders WHERE cid=?', (message.chat.id,))
... | 25.612903 | 80 | 0.625945 |
from aiogram.types import Message
from loader import dp, db
from .menu import delivery_status
from filters import IsUser
@dp.message_handler(IsUser(), text=delivery_status)
async def process_delivery_status(message: Message):
orders = db.fetchall('SELECT * FROM orders WHERE cid=?', (message.chat.id,))
... | true | true |
f73715de65315cedc09bbca8f2fcb037fe388093 | 5,046 | py | Python | dbutils/sqlite2del.py | faisalthaheem/deep-learning-scripts | 7b44e8520f59c63bca18f00e8916d76ee22bd193 | [
"Apache-2.0"
] | null | null | null | dbutils/sqlite2del.py | faisalthaheem/deep-learning-scripts | 7b44e8520f59c63bca18f00e8916d76ee22bd193 | [
"Apache-2.0"
] | 10 | 2019-10-30T15:33:44.000Z | 2022-03-11T23:50:31.000Z | dbutils/sqlite2del.py | faisalthaheem/deep-learning-scripts | 7b44e8520f59c63bca18f00e8916d76ee22bd193 | [
"Apache-2.0"
] | null | null | null | """
Copyright 2019 Faisal Thaheem
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agr... | 31.148148 | 160 | 0.632382 |
import argparse
import os
import sys
import sqlite3
import time
import pprint
import traceback
import logging
import csv
import cv2
from objclass import getObjectClass
from tqdm import tqdm
ap = argparse.ArgumentParser()
ap.add_argument("-ln", "--lite.names", required=True,
help="comma seperated... | true | true |
f737167f5cb0343d0bb7de5e095eb6dd3de5d4f2 | 20,744 | py | Python | apps/portalftpgateway/asyncore.py | Jumpscale/jumpscale6_core | 0502ddc1abab3c37ed982c142d21ea3955d471d3 | [
"BSD-2-Clause"
] | 1 | 2015-10-26T10:38:13.000Z | 2015-10-26T10:38:13.000Z | apps/portalftpgateway/asyncore.py | Jumpscale/jumpscale6_core | 0502ddc1abab3c37ed982c142d21ea3955d471d3 | [
"BSD-2-Clause"
] | null | null | null | apps/portalftpgateway/asyncore.py | Jumpscale/jumpscale6_core | 0502ddc1abab3c37ed982c142d21ea3955d471d3 | [
"BSD-2-Clause"
] | null | null | null | # -*- Mode: Python -*-
# Id: asyncore.py,v 2.51 2000/09/07 22:29:26 rushing Exp
# Author: Sam Rushing <rushing@nightmare.com>
# ======================================================================
# Copyright 1996 by Sam Rushing
#
# All Rights Reserved
#
# Permission to use, copy, modify,... | 30.915052 | 82 | 0.555004 |
"""Basic infrastructure for asynchronous socket service clients and servers.
There are only two ways to have a program on a single processor do "more
than one thing at a time". Multi-threaded programming is the simplest and
most popular way to do it, but there is another very different techn... | false | true |
f7371720556a549f75162cd9c52d4b42d0aff5f5 | 2,660 | py | Python | openmdao/surrogate_models/tests/test_map.py | gjkennedy/OpenMDAO | 06897b584403cce34bc106dd2840aa07eea69e96 | [
"Apache-2.0"
] | null | null | null | openmdao/surrogate_models/tests/test_map.py | gjkennedy/OpenMDAO | 06897b584403cce34bc106dd2840aa07eea69e96 | [
"Apache-2.0"
] | 1 | 2015-08-12T17:58:18.000Z | 2015-08-12T17:58:18.000Z | openmdao/surrogate_models/tests/test_map.py | gjkennedy/OpenMDAO | 06897b584403cce34bc106dd2840aa07eea69e96 | [
"Apache-2.0"
] | 1 | 2021-01-17T14:03:48.000Z | 2021-01-17T14:03:48.000Z | from openmdao.api import Group, Problem, MetaModelUnStructuredComp, NearestNeighbor
from openmdao.utils.assert_utils import assert_near_equal
import numpy as np
import unittest
class CompressorMap(MetaModelUnStructuredComp):
def __init__(self):
super(CompressorMap, self).__init__()
self.add_inp... | 37.464789 | 108 | 0.605263 | from openmdao.api import Group, Problem, MetaModelUnStructuredComp, NearestNeighbor
from openmdao.utils.assert_utils import assert_near_equal
import numpy as np
import unittest
class CompressorMap(MetaModelUnStructuredComp):
def __init__(self):
super(CompressorMap, self).__init__()
self.add_inp... | true | true |
f737179ac7bc892cee2bb77d3de95f7641166dcf | 15,543 | py | Python | BA_MDI1.py | acadianshadow237/BA_MDI1 | 73e0e87c15ff083ce860f7a09fa2de3a3c71c215 | [
"MIT"
] | null | null | null | BA_MDI1.py | acadianshadow237/BA_MDI1 | 73e0e87c15ff083ce860f7a09fa2de3a3c71c215 | [
"MIT"
] | null | null | null | BA_MDI1.py | acadianshadow237/BA_MDI1 | 73e0e87c15ff083ce860f7a09fa2de3a3c71c215 | [
"MIT"
] | null | null | null |
from PySide6 import QtCore
from PySide6 import QtGui
from PySide6 import QtWidgets
import argparse
import sys, os
from Models.login_model import login_stuff, url_builder
from helpers.helpers1 import db_tables
from Views.sample_login import LoginForm
from Views.all_view import VAS_view,VCRH_view ,VCCP_view,VCRH_Edit... | 31.785276 | 148 | 0.57505 |
from PySide6 import QtCore
from PySide6 import QtGui
from PySide6 import QtWidgets
import argparse
import sys, os
from Models.login_model import login_stuff, url_builder
from helpers.helpers1 import db_tables
from Views.sample_login import LoginForm
from Views.all_view import VAS_view,VCRH_view ,VCCP_view,VCRH_Edit... | true | true |
f73717b813f198b4b9298a72667370e86930923f | 3,695 | py | Python | plot_signals_weighted_depth.py | pyensemble/wildwood | b261cbd7d0b425b50647f719ab99c1d89f477d5c | [
"BSD-3-Clause"
] | 22 | 2021-06-24T11:30:03.000Z | 2022-03-09T00:59:30.000Z | plot_signals_weighted_depth.py | pyensemble/wildwood | b261cbd7d0b425b50647f719ab99c1d89f477d5c | [
"BSD-3-Clause"
] | 65 | 2021-03-13T17:50:03.000Z | 2022-02-22T16:50:02.000Z | plot_signals_weighted_depth.py | pyensemble/wildwood | b261cbd7d0b425b50647f719ab99c1d89f477d5c | [
"BSD-3-Clause"
] | 3 | 2021-03-04T18:44:10.000Z | 2022-01-26T17:28:35.000Z |
import logging
from matplotlib.cm import get_cmap
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from wildwood.datasets import get_signal, make_regression
from wildwood.forest import ForestRegressor
from wildwood._binning import Binner
pd.set_option("display.max_columns", 20)
pd.set_option(... | 24.309211 | 88 | 0.637618 |
import logging
from matplotlib.cm import get_cmap
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from wildwood.datasets import get_signal, make_regression
from wildwood.forest import ForestRegressor
from wildwood._binning import Binner
pd.set_option("display.max_columns", 20)
pd.set_option(... | true | true |
f737183680b786d27cc2fd5efe9c5e2fe75626a8 | 2,520 | py | Python | setup.py | JarnoHerr/AnaFlow | a7c56cdadf90d652f80bc1e1d38d3687d0365a63 | [
"MIT"
] | null | null | null | setup.py | JarnoHerr/AnaFlow | a7c56cdadf90d652f80bc1e1d38d3687d0365a63 | [
"MIT"
] | null | null | null | setup.py | JarnoHerr/AnaFlow | a7c56cdadf90d652f80bc1e1d38d3687d0365a63 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""AnaFlow - analytical solutions for the groundwater-flow equation."""
import os
from setuptools import setup, find_packages
HERE = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(HERE, "README.md"), encoding="utf-8") as f:
README = f.read()
with open(os.path.join(HERE... | 34.054054 | 79 | 0.659524 |
import os
from setuptools import setup, find_packages
HERE = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(HERE, "README.md"), encoding="utf-8") as f:
README = f.read()
with open(os.path.join(HERE, "requirements.txt"), encoding="utf-8") as f:
REQ = f.read().splitlines()
with open(os.pat... | true | true |
f73718f2e536fcce88e31006128c63e2fafa2f68 | 989 | py | Python | mayan/apps/templating/forms.py | darrenflexxu/Mayan-EDMS | 6707365bfacd137e625ddc1b990168012246fa07 | [
"Apache-2.0"
] | null | null | null | mayan/apps/templating/forms.py | darrenflexxu/Mayan-EDMS | 6707365bfacd137e625ddc1b990168012246fa07 | [
"Apache-2.0"
] | 5 | 2021-03-19T22:59:52.000Z | 2022-03-12T00:13:16.000Z | mayan/apps/templating/forms.py | Sumit-Kumar-Jha/mayan | 5b7ddeccf080b9e41cc1074c70e27dfe447be19f | [
"Apache-2.0"
] | 1 | 2020-07-29T21:03:27.000Z | 2020-07-29T21:03:27.000Z | from __future__ import absolute_import, unicode_literals
from django import forms
from django.utils.translation import ugettext_lazy as _
from .fields import TemplateField
class DocumentTemplateSandboxForm(forms.Form):
result = forms.CharField(
help_text=_('Resulting text from the evaluated template.'),... | 36.62963 | 74 | 0.676441 | from __future__ import absolute_import, unicode_literals
from django import forms
from django.utils.translation import ugettext_lazy as _
from .fields import TemplateField
class DocumentTemplateSandboxForm(forms.Form):
result = forms.CharField(
help_text=_('Resulting text from the evaluated template.'),... | true | true |
f73719671222a3d63128620021ee5f964d29f3b8 | 1,541 | py | Python | test/e2e/tests/aws/test_autoscaling.py | BlueWhaleKo/cortex | a60b9f3adf593ef27c234b9622f2516ebd17ce6c | [
"Apache-2.0"
] | null | null | null | test/e2e/tests/aws/test_autoscaling.py | BlueWhaleKo/cortex | a60b9f3adf593ef27c234b9622f2516ebd17ce6c | [
"Apache-2.0"
] | null | null | null | test/e2e/tests/aws/test_autoscaling.py | BlueWhaleKo/cortex | a60b9f3adf593ef27c234b9622f2516ebd17ce6c | [
"Apache-2.0"
] | null | null | null | # Copyright 2022 Cortex Labs, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 32.104167 | 95 | 0.695003 |
from typing import Any, Callable, Dict
import cortex as cx
import pytest
import e2e.tests
TEST_APIS = [
{
"primary": "realtime/sleep",
"dummy": ["realtime/prime-generator"],
"query_params": {
"sleep": "1.0",
},
}
]
@pytest.mark.usefixtures("client")... | true | true |
f737197aefec12c6b11fc71158604b87f0617b80 | 11,519 | py | Python | intersight/model/hyperflex_local_credential_policy_list.py | CiscoDevNet/intersight-python | 04b721f37c3044646a91c185c7259edfb991557a | [
"Apache-2.0"
] | 5 | 2021-12-16T15:13:32.000Z | 2022-03-29T16:09:54.000Z | intersight/model/hyperflex_local_credential_policy_list.py | CiscoDevNet/intersight-python | 04b721f37c3044646a91c185c7259edfb991557a | [
"Apache-2.0"
] | 4 | 2022-01-25T19:05:51.000Z | 2022-03-29T20:18:37.000Z | intersight/model/hyperflex_local_credential_policy_list.py | CiscoDevNet/intersight-python | 04b721f37c3044646a91c185c7259edfb991557a | [
"Apache-2.0"
] | 2 | 2020-07-07T15:01:08.000Z | 2022-01-31T04:27:35.000Z | """
Cisco Intersight
Cisco Intersight is a management platform delivered as a service with embedded analytics for your Cisco and 3rd party IT infrastructure. This platform offers an intelligent level of management that enables IT organizations to analyze, simplify, and automate their environments in more advan... | 48.196653 | 1,678 | 0.643285 |
import re
import sys
from intersight.model_utils import (
ApiTypeError,
ModelComposed,
ModelNormal,
ModelSimple,
cached_property,
change_keys_js_to_python,
convert_js_args_to_python_args,
date,
datetime,
file_type,
none_type,
validate_get_composed_info,
)
def la... | true | true |
f73719b8ddd6e7b96a87fa9b7d8a5b4f930cd798 | 60,481 | py | Python | jax/_src/random.py | obkyrush/jax | 8662c5f660678b6320a1a8fc46e917e97c399b57 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2021-12-25T01:12:42.000Z | 2021-12-25T01:12:42.000Z | jax/_src/random.py | obkyrush/jax | 8662c5f660678b6320a1a8fc46e917e97c399b57 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | jax/_src/random.py | obkyrush/jax | 8662c5f660678b6320a1a8fc46e917e97c399b57 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 37.895363 | 121 | 0.675286 |
from functools import partial
from typing import Any, Optional, Sequence, Union
import warnings
import numpy as np
from jax import lax
from jax import core
from jax import numpy as jnp
from jax._src import dtypes
from jax.core import NamedShape
from jax._src.api import jit, vmap
from jax._src.numpy.lax... | true | true |
f7371b5b2a5e5017c741a7f83e5e0f886f7ce7f7 | 1,772 | py | Python | app/models/m2m.py | zhangadrian/mini-shop-server | 3a1f29784b707d14f2435322cdc2efdaab4ec85e | [
"MIT"
] | 1 | 2020-09-25T09:23:06.000Z | 2020-09-25T09:23:06.000Z | app/models/m2m.py | zhangadrian/mini-shop-server | 3a1f29784b707d14f2435322cdc2efdaab4ec85e | [
"MIT"
] | null | null | null | app/models/m2m.py | zhangadrian/mini-shop-server | 3a1f29784b707d14f2435322cdc2efdaab4ec85e | [
"MIT"
] | null | null | null | # _*_ coding: utf-8 _*_
"""
Created by Allen7D on 2018/6/17.
"""
from sqlalchemy import Column, Integer, String, ForeignKey
from app.models.base import Base
from app.models.image import Image
__author__ = 'Allen7D'
class Theme2Product(Base):
__tablename__ = 'theme_product'
theme_id = Column(Integer, ForeignKey(... | 32.814815 | 91 | 0.744921 |
from sqlalchemy import Column, Integer, String, ForeignKey
from app.models.base import Base
from app.models.image import Image
__author__ = 'Allen7D'
class Theme2Product(Base):
__tablename__ = 'theme_product'
theme_id = Column(Integer, ForeignKey('theme.id'), primary_key=True, comment='主题外键')
product_id = Colum... | true | true |
f7371ccf38a7e9235c8bc7e0fc8da0c8f2647d3a | 8,520 | py | Python | tests/test_generic.py | kevinlai219/Mezzanine-Django | a92cde236448e19cdbf853b5cb34f99a60972147 | [
"BSD-2-Clause"
] | 3,053 | 2015-01-01T08:16:01.000Z | 2022-03-31T12:06:03.000Z | tests/test_generic.py | kevinlai219/Mezzanine-Django | a92cde236448e19cdbf853b5cb34f99a60972147 | [
"BSD-2-Clause"
] | 818 | 2015-01-03T05:44:45.000Z | 2022-03-08T00:06:23.000Z | tests/test_generic.py | kevinlai219/Mezzanine-Django | a92cde236448e19cdbf853b5cb34f99a60972147 | [
"BSD-2-Clause"
] | 1,352 | 2015-01-01T06:17:14.000Z | 2022-03-26T16:21:54.000Z | from unittest import skipUnless
from django.contrib.contenttypes.models import ContentType
from django.template import Context, Template
from django.urls import reverse
from mezzanine.blog.models import BlogPost
from mezzanine.conf import settings
from mezzanine.core.models import CONTENT_STATUS_PUBLISHED
from mezzan... | 40.571429 | 88 | 0.653404 | from unittest import skipUnless
from django.contrib.contenttypes.models import ContentType
from django.template import Context, Template
from django.urls import reverse
from mezzanine.blog.models import BlogPost
from mezzanine.conf import settings
from mezzanine.core.models import CONTENT_STATUS_PUBLISHED
from mezzan... | true | true |
f7371d98ef6f603bc1192d540e496dcf869ac1ed | 4,335 | py | Python | experiments/ashvin/icml2020/hand/adaptive/clamp_easy1.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | experiments/ashvin/icml2020/hand/adaptive/clamp_easy1.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | experiments/ashvin/icml2020/hand/adaptive/clamp_easy1.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | """
AWR + SAC from demo experiment
"""
from rlkit.demos.source.dict_to_mdp_path_loader import DictToMDPPathLoader
from rlkit.launchers.experiments.awac.awac_rl import experiment, process_args
import rlkit.misc.hyperparameter as hyp
from rlkit.launchers.arglauncher import run_variants
from rlkit.torch.sac.policies im... | 30.528169 | 77 | 0.570934 |
from rlkit.demos.source.dict_to_mdp_path_loader import DictToMDPPathLoader
from rlkit.launchers.experiments.awac.awac_rl import experiment, process_args
import rlkit.misc.hyperparameter as hyp
from rlkit.launchers.arglauncher import run_variants
from rlkit.torch.sac.policies import GaussianPolicy
from rlkit.torch.ne... | true | true |
f7371e7a24db2a163c30e05bd54a1875e8e24373 | 5,655 | py | Python | kernel/base_kernel.py | omarsou/kernel_method_kaggle_challenge | 0f2e85166112b231699d9c9f7e3ae894e5ff7766 | [
"Apache-2.0"
] | 1 | 2021-03-26T08:40:07.000Z | 2021-03-26T08:40:07.000Z | kernel/base_kernel.py | omarsou/kernel_method_kaggle_challenge | 0f2e85166112b231699d9c9f7e3ae894e5ff7766 | [
"Apache-2.0"
] | null | null | null | kernel/base_kernel.py | omarsou/kernel_method_kaggle_challenge | 0f2e85166112b231699d9c9f7e3ae894e5ff7766 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import pickle
class Kernel:
def __init__(self):
self.train_phi = None
self.K_matrix = None
self.test_phi = None
self.X_train = None
pass
def build_gram_matrix(self, X):
raise NotImplementedError("Method build_gram_matrix not implemented.")
... | 30.567568 | 116 | 0.589036 | import numpy as np
import pickle
class Kernel:
def __init__(self):
self.train_phi = None
self.K_matrix = None
self.test_phi = None
self.X_train = None
pass
def build_gram_matrix(self, X):
raise NotImplementedError("Method build_gram_matrix not implemented.")
... | true | true |
f7371ec75a914d7e5a9387e66d158edac391f0f3 | 89 | py | Python | app/main.py | dimigor/musicQuest | 60580ee9b5d95dfe17bf4a9d0c8cb1dad2877605 | [
"MIT"
] | null | null | null | app/main.py | dimigor/musicQuest | 60580ee9b5d95dfe17bf4a9d0c8cb1dad2877605 | [
"MIT"
] | 7 | 2019-02-19T18:34:26.000Z | 2021-06-01T23:24:39.000Z | app/main.py | dimigor/musicQuest | 60580ee9b5d95dfe17bf4a9d0c8cb1dad2877605 | [
"MIT"
] | null | null | null | """Main module"""
def main():
"""Main app"""
if __name__ == '__main__':
main()
| 11.125 | 26 | 0.516854 |
def main():
if __name__ == '__main__':
main()
| true | true |
f7371eebe3802355cc2ccb6ed6ade7e8b307e78a | 7,641 | py | Python | data_voc.py | Nebula4869/real-time-object-detection-YOLOv4 | a7b692999210747fd49cec2c35f2b7d8d5b7eecc | [
"MIT"
] | 2 | 2020-06-19T07:15:45.000Z | 2020-10-25T15:31:55.000Z | data_voc.py | Nebula4869/TensorFlow_YOLOv4 | a7b692999210747fd49cec2c35f2b7d8d5b7eecc | [
"MIT"
] | null | null | null | data_voc.py | Nebula4869/TensorFlow_YOLOv4 | a7b692999210747fd49cec2c35f2b7d8d5b7eecc | [
"MIT"
] | 2 | 2020-08-13T09:20:36.000Z | 2020-10-10T11:51:11.000Z | import numpy as np
import random
import xml
import cv2
import os
def read_file(file_name):
"""
读取 file_name 文件全部内容
return:文件内容list
"""
if not os.path.isfile(file_name):
return None
result = []
with open(file_name, 'r') as f:
for line in f.readlines():
# 去掉换行符和空格... | 33.366812 | 137 | 0.55477 | import numpy as np
import random
import xml
import cv2
import os
def read_file(file_name):
if not os.path.isfile(file_name):
return None
result = []
with open(file_name, 'r') as f:
for line in f.readlines():
line = line.strip('\n').strip()
if len(line) ... | true | true |
f7371f829f82414f3de9e91c766e37ed961a216c | 9,605 | py | Python | pennylane/__init__.py | gtr8/pennylane | fd055108ac73f02e55a44d19a62891dcd7726d4a | [
"Apache-2.0"
] | null | null | null | pennylane/__init__.py | gtr8/pennylane | fd055108ac73f02e55a44d19a62891dcd7726d4a | [
"Apache-2.0"
] | null | null | null | pennylane/__init__.py | gtr8/pennylane | fd055108ac73f02e55a44d19a62891dcd7726d4a | [
"Apache-2.0"
] | null | null | null | # Copyright 2018-2021 Xanadu Quantum Technologies Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or... | 36.109023 | 107 | 0.705778 |
from importlib import reload
import numpy as _np
import pkg_resources
from semantic_version import Spec, Version
import pennylane.init
import pennylane.fourier
import pennylane.kernels
import pennylane.math
import pennylane.operation
import pennylane.qaoa as qaoa
import pennylane.qnn
import pennylane.tem... | true | true |
f7372048e09ce1663e14828ff0ae6631ff232e70 | 7,984 | py | Python | mlrun/frameworks/onnx/model_handler.py | hayesgb/mlrun | 9a8b469b37d7d74f2d04dc956b2966f88fe4e890 | [
"Apache-2.0"
] | null | null | null | mlrun/frameworks/onnx/model_handler.py | hayesgb/mlrun | 9a8b469b37d7d74f2d04dc956b2966f88fe4e890 | [
"Apache-2.0"
] | null | null | null | mlrun/frameworks/onnx/model_handler.py | hayesgb/mlrun | 9a8b469b37d7d74f2d04dc956b2966f88fe4e890 | [
"Apache-2.0"
] | null | null | null | import os
from typing import Any, Dict, List, Union
import onnx
import onnxoptimizer
import mlrun
from mlrun.artifacts import Artifact
from mlrun.frameworks._common import ModelHandler
class ONNXModelHandler(ModelHandler):
"""
Class for handling an ONNX model, enabling loading and saving it during runs.
... | 39.330049 | 120 | 0.626628 | import os
from typing import Any, Dict, List, Union
import onnx
import onnxoptimizer
import mlrun
from mlrun.artifacts import Artifact
from mlrun.frameworks._common import ModelHandler
class ONNXModelHandler(ModelHandler):
def __init__(
self,
model_name: str,
model_path: str = None,
... | true | true |
f73720a8ba08ff93f66d33a63fc95d8dff2faeef | 2,623 | py | Python | jsonHelpers.py | Multifactored/6447FuzzerProject | f94094223813606121dc71b4d3b2c477e8b3a1bf | [
"MIT"
] | 1 | 2020-12-17T10:06:14.000Z | 2020-12-17T10:06:14.000Z | jsonHelpers.py | Multifactored/6447FuzzerProject | f94094223813606121dc71b4d3b2c477e8b3a1bf | [
"MIT"
] | null | null | null | jsonHelpers.py | Multifactored/6447FuzzerProject | f94094223813606121dc71b4d3b2c477e8b3a1bf | [
"MIT"
] | 1 | 2021-01-13T11:42:21.000Z | 2021-01-13T11:42:21.000Z | # pylint: disable=W0614
import sys
import json
import random
from helper import *
from itertools import combinations
import copy
def brokenJson(jsonInput: dict, key_set: list, maxPower: int):
''' similar to generateStr() except this has a higher chance of having the characters {}" '''
choices = r'abcdefghijkl... | 32.382716 | 157 | 0.627144 |
import sys
import json
import random
from helper import *
from itertools import combinations
import copy
def brokenJson(jsonInput: dict, key_set: list, maxPower: int):
choices = r'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890::::::{}"{}"{}"{}"{}"{}"{}"{}"{}"{}"{}"{}"{}"{}"{}"{}"{}"{}"{}"{}"{}"{}... | true | true |
f7372209f7ffe645807e944b391334e5a5b29271 | 222 | py | Python | csf_tz/fleet_management/doctype/vehicle_checklist/test_vehicle_checklist.py | Craftint/CSF_TZ | b5cb2d59d8f4e958ad7d4cb89421cfbec992abc5 | [
"MIT"
] | 4 | 2021-09-24T12:30:32.000Z | 2022-03-19T14:55:34.000Z | csf_tz/fleet_management/doctype/vehicle_checklist/test_vehicle_checklist.py | Craftint/CSF_TZ | b5cb2d59d8f4e958ad7d4cb89421cfbec992abc5 | [
"MIT"
] | null | null | null | csf_tz/fleet_management/doctype/vehicle_checklist/test_vehicle_checklist.py | Craftint/CSF_TZ | b5cb2d59d8f4e958ad7d4cb89421cfbec992abc5 | [
"MIT"
] | 7 | 2021-09-24T12:30:33.000Z | 2022-03-21T11:34:02.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2019, Bravo Logistics and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
class TestVehicleChecklist(unittest.TestCase):
pass
| 20.181818 | 54 | 0.779279 |
from __future__ import unicode_literals
import frappe
import unittest
class TestVehicleChecklist(unittest.TestCase):
pass
| true | true |
f7372291bf9ae614b10a1fd0a65f34965b237e12 | 5,996 | py | Python | baleen/utils/logger.py | ByteCubed/baleen | bb2ae323a3ab3a066a4a289401847e1251abc55d | [
"MIT"
] | 79 | 2016-05-31T00:33:07.000Z | 2022-01-17T07:33:41.000Z | baleen/utils/logger.py | ByteCubed/baleen | bb2ae323a3ab3a066a4a289401847e1251abc55d | [
"MIT"
] | 73 | 2016-02-18T19:52:42.000Z | 2016-10-08T21:48:55.000Z | baleen/utils/logger.py | ByteCubed/baleen | bb2ae323a3ab3a066a4a289401847e1251abc55d | [
"MIT"
] | 24 | 2015-11-18T11:38:30.000Z | 2017-05-19T14:07:18.000Z | # baleen.utils.logger
# Logging utility for Baleen
#
# Author: Benjamin Bengfort <benjamin@bengfort.com>
# Created: Mon Sep 22 15:47:34 2014 -0400
#
# Copyright (C) 2014 Bengfort.com
# For license information, see LICENSE.txt
#
# ID: logger.py [caaaaca] benjamin@bengfort.com $
"""
Logging utility for Baleen
"""
##... | 29.24878 | 77 | 0.518012 | true | true | |
f73722ddcc2a5d42d935ea244ae58c6bc70ef916 | 3,302 | py | Python | fuzzers/005-tilegrid/cfg_int/top.py | rw1nkler/prjxray | aff076b47dcf6d653eb3ce791b41fd6cf4343edd | [
"ISC"
] | 583 | 2017-12-21T11:06:13.000Z | 2022-02-20T21:27:33.000Z | fuzzers/005-tilegrid/cfg_int/top.py | rw1nkler/prjxray | aff076b47dcf6d653eb3ce791b41fd6cf4343edd | [
"ISC"
] | 1,212 | 2017-12-22T15:05:06.000Z | 2022-02-19T13:04:59.000Z | fuzzers/005-tilegrid/cfg_int/top.py | mfkiwl/prjxray-xilinx-7-bitstream-fortmat | 5349556bc2c230801d6df0cf11bccb9cfd171639 | [
"ISC"
] | 134 | 2017-12-21T10:16:50.000Z | 2022-02-16T06:42:04.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017-2020 The Project X-Ray Authors.
#
# Use of this source code is governed by a ISC-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/ISC
#
# SPDX-License-Identifier: ISC
import os
import random
random.seed(i... | 25.596899 | 69 | 0.596002 |
import os
import random
random.seed(int(os.getenv("SEED"), 16))
from prjxray import util
from prjxray.db import Database
def gen_sites():
db = Database(util.get_db_root(), util.get_part())
grid = db.grid()
for tile_name in sorted(grid.tiles()):
loc = grid.loc_of_tilename(tile_name)
... | true | true |
f737232add2a5c701632a80d4ddc36d3b29a7376 | 1,755 | py | Python | paper1_examples/tsunami_Alaska/compare/compare_methods.py | rjleveque/adjoint | 4f3e0b89b8eb994b6f8ccbbfff33de91f6efac1a | [
"BSD-2-Clause"
] | 3 | 2017-03-03T21:27:33.000Z | 2018-04-04T10:13:40.000Z | paper1_examples/tsunami_Alaska/compare/compare_methods.py | rjleveque/adjoint | 4f3e0b89b8eb994b6f8ccbbfff33de91f6efac1a | [
"BSD-2-Clause"
] | null | null | null | paper1_examples/tsunami_Alaska/compare/compare_methods.py | rjleveque/adjoint | 4f3e0b89b8eb994b6f8ccbbfff33de91f6efac1a | [
"BSD-2-Clause"
] | 3 | 2015-10-16T16:35:17.000Z | 2017-03-03T21:06:51.000Z | """
Comparing refinement with adjoint-flagging vs refinement using
surface-flagging by running the full code for all three runs.
"""
import os
currentdir = os.getcwd()
adjointdir = currentdir + '/../adjoint'
forwarddir = currentdir + '/..'
#-------------------------------------------
# Compute solution for a... | 29.745763 | 97 | 0.645014 | """
Comparing refinement with adjoint-flagging vs refinement using
surface-flagging by running the full code for all three runs.
"""
import os
currentdir = os.getcwd()
adjointdir = currentdir + '/../adjoint'
forwarddir = currentdir + '/..'
os.chdir(adjointdir)
os.system('python maketopo.py')
os.system('m... | false | true |
f7372330a1b687246159fe0e9fb2a671ee65fb4d | 5,350 | py | Python | anthemtool/io/writer.py | xyrin88/anthemtool | a2fec1ac0b596765c9d1f620d9167353a1b39582 | [
"MIT"
] | 14 | 2019-04-01T03:30:33.000Z | 2022-01-14T22:17:11.000Z | anthemtool/io/writer.py | NicknineTheEagle/anthemtool | a2fec1ac0b596765c9d1f620d9167353a1b39582 | [
"MIT"
] | 6 | 2019-04-14T07:01:09.000Z | 2021-11-25T18:58:40.000Z | anthemtool/io/writer.py | NicknineTheEagle/anthemtool | a2fec1ac0b596765c9d1f620d9167353a1b39582 | [
"MIT"
] | 4 | 2019-09-13T20:03:18.000Z | 2021-07-21T11:02:06.000Z | import logging
from struct import unpack
from typing import Optional, Dict
from anthemtool.cas.cas import Cas
from anthemtool.io.providers.base import Decompressor
from anthemtool.util import PathUtil
LOG = logging.getLogger(__name__)
class CasWriter:
"""
Writer for CAS file entries.
"""
DECOMPRE... | 36.394558 | 100 | 0.538505 | import logging
from struct import unpack
from typing import Optional, Dict
from anthemtool.cas.cas import Cas
from anthemtool.io.providers.base import Decompressor
from anthemtool.util import PathUtil
LOG = logging.getLogger(__name__)
class CasWriter:
DECOMPRESSION_LOOKUP = {
0x70: 'null',
0x... | true | true |
f73725366c46e1b0dca88e3d1b09147a23966eaf | 10,354 | py | Python | tensorflow/python/data/experimental/kernel_tests/prefetch_to_device_test.py | knightvishal/tensorflow | 5d3dd19b7146d954fc1b4e9e44e9881e75d363c1 | [
"Apache-2.0"
] | 52 | 2018-11-12T06:39:35.000Z | 2022-03-08T05:31:27.000Z | tensorflow/python/data/experimental/kernel_tests/prefetch_to_device_test.py | knightvishal/tensorflow | 5d3dd19b7146d954fc1b4e9e44e9881e75d363c1 | [
"Apache-2.0"
] | 2 | 2018-12-04T08:35:40.000Z | 2020-10-22T16:17:39.000Z | tensorflow/python/data/experimental/kernel_tests/prefetch_to_device_test.py | knightvishal/tensorflow | 5d3dd19b7146d954fc1b4e9e44e9881e75d363c1 | [
"Apache-2.0"
] | 17 | 2019-03-11T01:17:16.000Z | 2022-02-21T00:44:47.000Z | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 44.059574 | 80 | 0.745026 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.core.protobuf import config_pb2
from tensorflow.python.data.experimental.ops import prefetching_ops
from tensorflow.python.data.kernel_tests import test_base
from tensorflow.python... | true | true |
f737255c92e3fa92498148c274c10a991fa13458 | 319 | py | Python | tuna_service_sdk/client.py | easyopsapis/easyops-api-python | adf6e3bad33fa6266b5fa0a449dd4ac42f8447d0 | [
"Apache-2.0"
] | 5 | 2019-07-31T04:11:05.000Z | 2021-01-07T03:23:20.000Z | tuna_service_sdk/client.py | easyopsapis/easyops-api-python | adf6e3bad33fa6266b5fa0a449dd4ac42f8447d0 | [
"Apache-2.0"
] | null | null | null | tuna_service_sdk/client.py | easyopsapis/easyops-api-python | adf6e3bad33fa6266b5fa0a449dd4ac42f8447d0 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import tuna_service_sdk.api.test_plan.test_plan_client
class Client(object):
def __init__(self, server_ip="", server_port=0, service_name=""):
self.test_plan = tuna_service_sdk.api.test_plan.test_plan_client.TestPlanClient(server_ip, server_port, service_name)
| 26.583333 | 125 | 0.714734 |
import tuna_service_sdk.api.test_plan.test_plan_client
class Client(object):
def __init__(self, server_ip="", server_port=0, service_name=""):
self.test_plan = tuna_service_sdk.api.test_plan.test_plan_client.TestPlanClient(server_ip, server_port, service_name)
| true | true |
f737263703d80fae6b4fd80e4e96de3d1c6c3b3e | 20 | py | Python | go/dlgo/mcts/__init__.py | huynq55/alpha-zero-general | 7c7b8a9a09b79178157ec6b6d379a071c9f0994a | [
"MIT"
] | 1 | 2021-04-20T23:01:22.000Z | 2021-04-20T23:01:22.000Z | go/dlgo/mcts/__init__.py | huynq55/alpha-zero-general | 7c7b8a9a09b79178157ec6b6d379a071c9f0994a | [
"MIT"
] | null | null | null | go/dlgo/mcts/__init__.py | huynq55/alpha-zero-general | 7c7b8a9a09b79178157ec6b6d379a071c9f0994a | [
"MIT"
] | 1 | 2020-06-11T21:55:31.000Z | 2020-06-11T21:55:31.000Z | from .mcts import *
| 10 | 19 | 0.7 | from .mcts import *
| true | true |
f73726db5f586c778ad0f7586b07281ffda1c0db | 3,676 | py | Python | sdks/python/apache_beam/examples/cookbook/group_with_coder_test.py | kjmrknsn/beam | 6a6adc8433deff10a5594bbf77cc9148ce0a951a | [
"Apache-2.0"
] | null | null | null | sdks/python/apache_beam/examples/cookbook/group_with_coder_test.py | kjmrknsn/beam | 6a6adc8433deff10a5594bbf77cc9148ce0a951a | [
"Apache-2.0"
] | null | null | null | sdks/python/apache_beam/examples/cookbook/group_with_coder_test.py | kjmrknsn/beam | 6a6adc8433deff10a5594bbf77cc9148ce0a951a | [
"Apache-2.0"
] | null | null | null | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 37.896907 | 106 | 0.691785 |
from __future__ import absolute_import
import logging
import tempfile
import unittest
from apache_beam.examples.cookbook import group_with_coder
from apache_beam.testing.util import open_shards
group_with_coder.PlayerCoder.decode = lambda self, s: group_with_coder.Player(
s.decode('utf-8'... | true | true |
f73729af353c6576a883d5caa43c247c40fa9b99 | 302 | py | Python | h2o-py/tests/testdir_misc/pyunit_https_import.py | PawarPawan/h2o-v3 | cf569a538c9e2ec16ba9fc1a75d14beda8f40c18 | [
"Apache-2.0"
] | null | null | null | h2o-py/tests/testdir_misc/pyunit_https_import.py | PawarPawan/h2o-v3 | cf569a538c9e2ec16ba9fc1a75d14beda8f40c18 | [
"Apache-2.0"
] | null | null | null | h2o-py/tests/testdir_misc/pyunit_https_import.py | PawarPawan/h2o-v3 | cf569a538c9e2ec16ba9fc1a75d14beda8f40c18 | [
"Apache-2.0"
] | null | null | null | import sys
sys.path.insert(1, "../../")
import h2o
def https_import(ip,port):
url = "https://s3.amazonaws.com/h2o-public-test-data/smalldata/prostate/prostate.csv.zip"
aa = h2o.import_file(path=url)
aa.show()
if __name__ == "__main__":
h2o.run_test(sys.argv, https_import)
| 20.133333 | 93 | 0.662252 | import sys
sys.path.insert(1, "../../")
import h2o
def https_import(ip,port):
url = "https://s3.amazonaws.com/h2o-public-test-data/smalldata/prostate/prostate.csv.zip"
aa = h2o.import_file(path=url)
aa.show()
if __name__ == "__main__":
h2o.run_test(sys.argv, https_import)
| true | true |
f73729b48f8dc18cff3a5092348a5588e7113e79 | 635 | py | Python | bin/rst2xml.py | ammarkhann/FinalSeniorCode | cd9a7ff34fc43f230bf1f3631115fe00e57ec98a | [
"MIT"
] | null | null | null | bin/rst2xml.py | ammarkhann/FinalSeniorCode | cd9a7ff34fc43f230bf1f3631115fe00e57ec98a | [
"MIT"
] | null | null | null | bin/rst2xml.py | ammarkhann/FinalSeniorCode | cd9a7ff34fc43f230bf1f3631115fe00e57ec98a | [
"MIT"
] | null | null | null | #!/Users/ammarkhan/Desktop/seniorproject/bin/python
# $Id: rst2xml.py 4564 2006-05-21 20:44:42Z wiemann $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
A minimal front end to the Docutils Publisher, producing Docutils XML.
"""
try:
import locale
... | 26.458333 | 70 | 0.744882 |
try:
import locale
locale.setlocale(locale.LC_ALL, '')
except:
pass
from docutils.core import publish_cmdline, default_description
description = ('Generates Docutils-native XML from standalone '
'reStructuredText sources. ' + default_description)
publish_cmdline(writer_name='xml',... | true | true |
f7372b8d838f5df538e72c052a6c4aaac3a98b94 | 2,181 | py | Python | hacker/qqpy/bin/painter.py | sanyueyuxincao/web-crawling | dc134bd6e23572a3ebfd851d0ffb6dd84cb16c1f | [
"MIT"
] | null | null | null | hacker/qqpy/bin/painter.py | sanyueyuxincao/web-crawling | dc134bd6e23572a3ebfd851d0ffb6dd84cb16c1f | [
"MIT"
] | null | null | null | hacker/qqpy/bin/painter.py | sanyueyuxincao/web-crawling | dc134bd6e23572a3ebfd851d0ffb6dd84cb16c1f | [
"MIT"
] | 2 | 2019-05-19T08:12:45.000Z | 2021-08-28T07:16:42.000Z | #!/Users/het/Desktop/hacker/qqpy/bin/python3.6
#
# The Python Imaging Library
# $Id$
#
# this demo script illustrates pasting into an already displayed
# photoimage. note that the current version of Tk updates the whole
# image every time we paste, so to get decent performance, we split
# the image into a set of tiles... | 25.658824 | 74 | 0.573132 |
import sys
if sys.version_info[0] > 2:
import tkinter
else:
import Tkinter as tkinter
from PIL import Image, ImageTk
class PaintCanvas(tkinter.Canvas):
def __init__(self, master, image):
tkinter.Canvas.__init__(self, master,
width=image.size[0], heig... | true | true |
f7372c03657c52d022a2eeeff1c08b2ab274c993 | 829 | py | Python | squirrely_feed/aggregor/migrations/0001_initial.py | Circles24/squirrely-feed | 7de0504b39ffb937af4a653a64b8b0df98f2a75d | [
"MIT"
] | 4 | 2020-07-13T08:24:02.000Z | 2022-03-26T10:21:48.000Z | squirrely_feed/aggregor/migrations/0001_initial.py | Circles24/squirrely-feed | 7de0504b39ffb937af4a653a64b8b0df98f2a75d | [
"MIT"
] | null | null | null | squirrely_feed/aggregor/migrations/0001_initial.py | Circles24/squirrely-feed | 7de0504b39ffb937af4a653a64b8b0df98f2a75d | [
"MIT"
] | null | null | null | # Generated by Django 3.1.3 on 2020-11-18 06:50
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Article',
fields=[
('id', m... | 29.607143 | 114 | 0.574186 |
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Article',
fields=[
('id', models.AutoField(auto_created=True, primary_key=... | true | true |
f7372c26e075cc73dcde9614e08d881c17b7d965 | 57,288 | py | Python | page.py | Alekseybykov126/newtest | 1fab9756609bbb496ed2cd2363941f8039b27711 | [
"Apache-2.0"
] | null | null | null | page.py | Alekseybykov126/newtest | 1fab9756609bbb496ed2cd2363941f8039b27711 | [
"Apache-2.0"
] | null | null | null | page.py | Alekseybykov126/newtest | 1fab9756609bbb496ed2cd2363941f8039b27711 | [
"Apache-2.0"
] | null | null | null | from lib2to3.pgen2 import driver
#import requests
#import self as self
from selenium.webdriver.chrome import options
from selenium.webdriver.common.action_chains import ActionChains
from selenium import webdriver
from bs4 import BeautifulSoup
from selenium import webdriver
#from selenium.webdriver.firefox.webdriver im... | 53.892756 | 323 | 0.614788 | from lib2to3.pgen2 import driver
from selenium.webdriver.chrome import options
from selenium.webdriver.common.action_chains import ActionChains
from selenium import webdriver
from bs4 import BeautifulSoup
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.... | true | true |
f7372d0c1d753f3bbf5cda998c2c4fa9a7597570 | 601 | py | Python | mundo1/D28.py | KayanOkagawa/Cursoemvideo-Python3-Exercicios | 10c8386102cc0928f8f090070eb3218deb3d60fe | [
"MIT"
] | null | null | null | mundo1/D28.py | KayanOkagawa/Cursoemvideo-Python3-Exercicios | 10c8386102cc0928f8f090070eb3218deb3d60fe | [
"MIT"
] | null | null | null | mundo1/D28.py | KayanOkagawa/Cursoemvideo-Python3-Exercicios | 10c8386102cc0928f8f090070eb3218deb3d60fe | [
"MIT"
] | null | null | null | #-*-coding:utf8;-*-
#qpy:console
from random import randint
print('\n')
print('-' * 5, 'ADIVINHE O NÚMERO', '-' * 5)
print('\n')
opção = input('Quer jogar comigo: ').lower().strip()
print('\n')
if opção == 'sim':
print('Muito bom! Adivinhe o número que estou pensando entre 0 a 5')
print('\n')
n = randint(0... | 21.464286 | 72 | 0.565724 |
from random import randint
print('\n')
print('-' * 5, 'ADIVINHE O NÚMERO', '-' * 5)
print('\n')
opção = input('Quer jogar comigo: ').lower().strip()
print('\n')
if opção == 'sim':
print('Muito bom! Adivinhe o número que estou pensando entre 0 a 5')
print('\n')
n = randint(0,5)
resposta = int(input('D... | true | true |
f7372d11ca4f9fc3c017bb0e2c0de8bfc43a8138 | 173 | py | Python | mydjango_env/news/nip_site/polls/models.py | fuandenghuo/100-days-of-python | 50f3263b0984bb6690e565d58604c1882aaf465e | [
"MIT"
] | null | null | null | mydjango_env/news/nip_site/polls/models.py | fuandenghuo/100-days-of-python | 50f3263b0984bb6690e565d58604c1882aaf465e | [
"MIT"
] | null | null | null | mydjango_env/news/nip_site/polls/models.py | fuandenghuo/100-days-of-python | 50f3263b0984bb6690e565d58604c1882aaf465e | [
"MIT"
] | null | null | null | from django.db import models
# Create your models here.
class Question(models.Model):
question_text = models.CharField(max_length = 200)
pub_date = models.DateTime | 24.714286 | 54 | 0.757225 | from django.db import models
class Question(models.Model):
question_text = models.CharField(max_length = 200)
pub_date = models.DateTime | true | true |
f7372e132c093972530f907f1052f0b5f02603b5 | 1,109 | py | Python | test/test_text_to_speech_request.py | Cloudmersive/Cloudmersive.APIClient.Python.VoiceRecognition | ab03179bd3449dc54d33ebbeabe00fcc45960335 | [
"Apache-2.0"
] | null | null | null | test/test_text_to_speech_request.py | Cloudmersive/Cloudmersive.APIClient.Python.VoiceRecognition | ab03179bd3449dc54d33ebbeabe00fcc45960335 | [
"Apache-2.0"
] | null | null | null | test/test_text_to_speech_request.py | Cloudmersive/Cloudmersive.APIClient.Python.VoiceRecognition | ab03179bd3449dc54d33ebbeabe00fcc45960335 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
speechapi
Speech APIs enable you to recognize speech and convert it to text using advanced machine learning, and also to convert text to speech. # noqa: E501
OpenAPI spec version: v1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ impor... | 27.04878 | 152 | 0.751127 |
from __future__ import absolute_import
import unittest
import cloudmersive_voicerecognition_api_client
from cloudmersive_voicerecognition_api_client.models.text_to_speech_request import TextToSpeechRequest
from cloudmersive_voicerecognition_api_client.rest import ApiException
class TestTextToSpeechRequest(uni... | true | true |
f7372fa08a96b90691f0888b248e42aa64165f17 | 26,737 | py | Python | gamestonk_terminal/cryptocurrency/defi/defi_controller.py | JakubPluta/GamestonkTerminal | 3eb200fbea467d808ab401962e1d62022b7a2338 | [
"MIT"
] | null | null | null | gamestonk_terminal/cryptocurrency/defi/defi_controller.py | JakubPluta/GamestonkTerminal | 3eb200fbea467d808ab401962e1d62022b7a2338 | [
"MIT"
] | null | null | null | gamestonk_terminal/cryptocurrency/defi/defi_controller.py | JakubPluta/GamestonkTerminal | 3eb200fbea467d808ab401962e1d62022b7a2338 | [
"MIT"
] | null | null | null | """Defi Controller Module"""
__docformat__ = "numpy"
import argparse
from typing import List
from prompt_toolkit.completion import NestedCompleter
from gamestonk_terminal.rich_config import console
from gamestonk_terminal.cryptocurrency.defi import (
graph_model,
coindix_model,
terraengineer_model,
te... | 30.909827 | 113 | 0.533717 | __docformat__ = "numpy"
import argparse
from typing import List
from prompt_toolkit.completion import NestedCompleter
from gamestonk_terminal.rich_config import console
from gamestonk_terminal.cryptocurrency.defi import (
graph_model,
coindix_model,
terraengineer_model,
terraengineer_view,
)
from game... | true | true |
f73730188d31b22bc56c053057c20a1fbf903e08 | 23,260 | py | Python | sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_operation_policy_operations.py | adewaleo/azure-sdk-for-python | 169457edbea5e3c5557246cfcf8bd635d528bae4 | [
"MIT"
] | 1 | 2020-03-05T18:10:35.000Z | 2020-03-05T18:10:35.000Z | sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_operation_policy_operations.py | adewaleo/azure-sdk-for-python | 169457edbea5e3c5557246cfcf8bd635d528bae4 | [
"MIT"
] | 2 | 2020-03-03T23:11:13.000Z | 2020-03-30T18:50:55.000Z | sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_operation_policy_operations.py | adewaleo/azure-sdk-for-python | 169457edbea5e3c5557246cfcf8bd635d528bae4 | [
"MIT"
] | null | null | null | # 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) AutoRest Code Generator.
# Changes may ... | 52.984055 | 239 | 0.670765 |
from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union
import warnings
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport impo... | true | true |
f737306d0d56ed2ac43898c329dd2edc390a5c98 | 4,679 | py | Python | src/api/dataflow/batch/settings.py | Chromico/bk-base | be822d9bbee544a958bed4831348185a75604791 | [
"MIT"
] | 84 | 2021-06-30T06:20:23.000Z | 2022-03-22T03:05:49.000Z | src/api/dataflow/batch/settings.py | Chromico/bk-base | be822d9bbee544a958bed4831348185a75604791 | [
"MIT"
] | 7 | 2021-06-30T06:21:16.000Z | 2022-03-29T07:36:13.000Z | src/api/dataflow/batch/settings.py | Chromico/bk-base | be822d9bbee544a958bed4831348185a75604791 | [
"MIT"
] | 40 | 2021-06-30T06:21:26.000Z | 2022-03-29T12:42:26.000Z | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making BK-BASE 蓝鲸基础平台 available.
Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
BK-BASE 蓝鲸基础平台 is licensed under the MIT License.
License for BK-BASE 蓝鲸基础平台:
------------------------------------------... | 40.686957 | 111 | 0.808934 |
from conf import dataapi_settings
from pizza import settings_default
from dataflow import pizza_settings
DATA_TIME_ZONE = dataapi_settings.DATA_TIME_ZONE
CODE_VERSION_DEFAULT = "0.1.0"
CLUSTER_GROUP_DEFAULT = "default"
CLUSTER_NAME_DEFAULT = "root.dataflow.batch.default"
DEBUG_QUEUE = "root.dataflow.batch.debug"
... | true | true |
f737318c35ed85e43b12dfe585edb3c6820f83b5 | 4,696 | py | Python | sensor/GY271.py | Smart4L/embedded-server | cf10ebb1ccc3002b45c20315ec521eaf1a9e7f10 | [
"MIT"
] | null | null | null | sensor/GY271.py | Smart4L/embedded-server | cf10ebb1ccc3002b45c20315ec521eaf1a9e7f10 | [
"MIT"
] | null | null | null | sensor/GY271.py | Smart4L/embedded-server | cf10ebb1ccc3002b45c20315ec521eaf1a9e7f10 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Enabe I2C
# sudo apt-get update
# sudo apt-get install -y git python3-smbus i2c-tools
# pip3 install smbus2
# i2cdetect -y 1 # expect 0x0d
import smbus2
from time import sleep
import math
C_REG_A = 0x09 # Address of Configuration register A
C_REG_B = 0x0a # Address o... | 29.910828 | 105 | 0.689097 |
s2
from time import sleep
import math
C_REG_A = 0x09
C_REG_B = 0x0a
SR_period_REG = 0x0b
MODE_STBY = 0x00
MODE_CONT = 0x01
ODR_10Hz = 0x00
ODR_50Hz = 0x01
ODR_100Hz = 0x10
ODR_200Hz = 0x11
SENS_2G = 0x00
SENS_8G = 0x01
OSR_512 = 0x00
OSR_256 = 0x01
OSR_128 = 0x10
OSR_64 = 0x11
X_axis_H = 0x... | true | true |
f737318c397372cc579cd36ff1c6f24edbe46b51 | 44,261 | py | Python | lib/network.py | BTCPrime/electrum | 62f266921bce1622976fb73f277e5254a7e914e8 | [
"MIT"
] | null | null | null | lib/network.py | BTCPrime/electrum | 62f266921bce1622976fb73f277e5254a7e914e8 | [
"MIT"
] | 2 | 2018-06-06T08:28:58.000Z | 2018-08-17T02:08:43.000Z | lib/network.py | BTCPrime/electrum | 62f266921bce1622976fb73f277e5254a7e914e8 | [
"MIT"
] | 5 | 2018-05-24T21:57:12.000Z | 2018-11-19T10:38:19.000Z | # Electrum - Lightweight Bitcoin Client
# Copyright (c) 2011-2016 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 limitation the rig... | 40.237273 | 138 | 0.588938 |
import time
import queue
import os
import stat
import errno
import random
import re
import select
from collections import defaultdict
import threading
import socket
import json
import socks
from . import util
from . import bitcoin
from .bitcoin import *
from . import constants
from .interface imp... | true | true |
f737321bbe218ac9a83cdad1ebea220e180cae0f | 913 | py | Python | engineered_features.py | carlos-alcan/network_app_classification | faa19842ed17b277259dd64e14c7133ce6a61e56 | [
"MIT"
] | null | null | null | engineered_features.py | carlos-alcan/network_app_classification | faa19842ed17b277259dd64e14c7133ce6a61e56 | [
"MIT"
] | null | null | null | engineered_features.py | carlos-alcan/network_app_classification | faa19842ed17b277259dd64e14c7133ce6a61e56 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Apr 16 12:14:37 2019
@author: carlosalcantara
"""
'''
Expand data with engineered features using the feature_engineering_function.py
Saves new csv file with specified name, overwriting input file if no save file
name is given.
Usage: engineered_featur... | 24.675676 | 78 | 0.748083 |
import pandas as pd
import sys
import feature_engineering_function
if len(sys.argv) < 1:
print('Usage: engineered_features.py csvfile [savefile=csvfile]')
sys.exit(-1)
file = sys.argv[1]
if len(sys.argv) > 2:
savefile = sys.argv[2]
else:
savefile = file
df = pd.read_csv(file)
df = feature_engi... | true | true |
f737324f44c17fa1f6e877198d987bbc244bf54b | 3,178 | py | Python | msticpy/datamodel/entities/host_logon_session.py | 2xyo/msticpy | 17f6a25ea82d85632e0c52a60e20626e9621d3b0 | [
"MIT"
] | 1 | 2021-07-29T16:04:08.000Z | 2021-07-29T16:04:08.000Z | msticpy/datamodel/entities/host_logon_session.py | QPC-database/msticpy | 54c6d74e0bb25528dd0347edb40c693dd7b1eac7 | [
"MIT"
] | 3 | 2021-05-15T02:16:39.000Z | 2022-01-19T13:13:25.000Z | msticpy/datamodel/entities/host_logon_session.py | QPC-database/msticpy | 54c6d74e0bb25528dd0347edb40c693dd7b1eac7 | [
"MIT"
] | null | null | null | # -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
"""HostLog... | 29.425926 | 84 | 0.581812 |
from datetime import datetime
from typing import Any, Mapping, Optional
from ..._version import VERSION
from ...common.utility import export
from .entity import Entity
from .account import Account
from .host import Host
__version__ = VERSION
__author__ = "Ian Hellen"
@export
class HostLogonSession(Entity):
... | true | true |
f73732e27bc370111d4d7024fed2a8f1e3597cd9 | 2,676 | py | Python | examples/diff/diff_test.py | adamruth/python-fire | 6912ccd56f50e0f4bb30a0725d95858ef29f3bde | [
"Apache-2.0"
] | 1 | 2020-02-05T04:43:03.000Z | 2020-02-05T04:43:03.000Z | examples/diff/diff_test.py | chesnjak/python-fire | 72604f40314008e562ba47936dcc183b51166b72 | [
"Apache-2.0"
] | null | null | null | examples/diff/diff_test.py | chesnjak/python-fire | 72604f40314008e562ba47936dcc183b51166b72 | [
"Apache-2.0"
] | 1 | 2020-02-05T04:44:05.000Z | 2020-02-05T04:44:05.000Z | # Copyright (C) 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 27.875 | 79 | 0.626682 |
import tempfile
from fire import testutils
from examples.diff import diff
from examples.diff import difffull
class DiffTest(testutils.BaseTestCase):
def setUp(self):
self.file1 = file1 = tempfile.NamedTemporaryFile()
self.file2 = file2 = tempfile.NamedTemporaryFile()
file1.write(b'tes... | true | true |
f7373392e3a8c483544fcb2bc60bfaa7bc7a3472 | 1,127 | py | Python | utils.py | grevych/graphparser | 67b7036ac3974d69616bc3765483968b797ed031 | [
"MIT"
] | null | null | null | utils.py | grevych/graphparser | 67b7036ac3974d69616bc3765483968b797ed031 | [
"MIT"
] | null | null | null | utils.py | grevych/graphparser | 67b7036ac3974d69616bc3765483968b797ed031 | [
"MIT"
] | null | null | null | # -*- encoding:utf-8 -*-
SETS = {
'D': '01234456789',
'L': 'abcdefghijklmnñopqrstuvwxyzABCDEFGHIJKLMNÑOPQRSTUVWXYZ',
'C': '01234456789abcdefghijklmnñopqrstuvwxyzABCDEFGHIJKLMNÑOPQRSTUVWXYZ!"·#$%&/()=?¿¡ºª*+^`[]´Ç¨{}-_:.;,<>\'\\\t '
}
AUTOMATAS = (
{'name': 'comment',
'states': (
((('#',... | 24.5 | 118 | 0.377107 |
SETS = {
'D': '01234456789',
'L': 'abcdefghijklmnñopqrstuvwxyzABCDEFGHIJKLMNÑOPQRSTUVWXYZ',
'C': '01234456789abcdefghijklmnñopqrstuvwxyzABCDEFGHIJKLMNÑOPQRSTUVWXYZ!"·#$%&/()=?¿¡ºª*+^`[]´Ç¨{}-_:.;,<>\'\\\t '
}
AUTOMATAS = (
{'name': 'comment',
'states': (
((('#', 1, ), ), False, ),
... | true | true |
f7373463128f4034161b82321034c6345197ba26 | 492 | py | Python | pyphys/pipette.py | Sepidak/spikeGUI | 25ae60160308c0a34e7180f3e39a1c4dc6aad708 | [
"MIT"
] | null | null | null | pyphys/pipette.py | Sepidak/spikeGUI | 25ae60160308c0a34e7180f3e39a1c4dc6aad708 | [
"MIT"
] | 3 | 2021-08-09T21:51:41.000Z | 2021-08-09T21:51:45.000Z | pyphys/pipette.py | Sepidak/spikeGUI | 25ae60160308c0a34e7180f3e39a1c4dc6aad708 | [
"MIT"
] | 3 | 2021-10-16T14:07:59.000Z | 2021-10-16T17:09:03.000Z | # -*- coding: utf-8 -*-
"""
Created on Fri Jul 18 14:03:19 2014
@author: crousse
"""
class Pipette(object):
def __init__(self):
self.resistance = 0
self.internal = ""
self.id = 0 # which pipette number
self.depth = 0.0
self.hitQuality = 0 # 0 to 5
self... | 24.6 | 62 | 0.53252 |
class Pipette(object):
def __init__(self):
self.resistance = 0
self.internal = ""
self.id = 0
self.depth = 0.0
self.hitQuality = 0
self.sealQuality = 0
self.seriesResistance = 0
self.vm = 0
self.pullOff = 0
self.remark = '... | true | true |
f73734f7e14d978b1c19eb89fa4dba6f52a4689d | 1,072 | py | Python | groupdocs/models/UserPasswordInfo.py | groupdocs-legacy-sdk/python | 80e5ef5a9a14ac4a7815c6cf933b5b2997381455 | [
"Apache-2.0"
] | null | null | null | groupdocs/models/UserPasswordInfo.py | groupdocs-legacy-sdk/python | 80e5ef5a9a14ac4a7815c6cf933b5b2997381455 | [
"Apache-2.0"
] | null | null | null | groupdocs/models/UserPasswordInfo.py | groupdocs-legacy-sdk/python | 80e5ef5a9a14ac4a7815c6cf933b5b2997381455 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""
Copyright 2012 GroupDocs.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable... | 28.972973 | 77 | 0.658582 |
class UserPasswordInfo:
def __init__(self):
self.swaggerTypes = {
'old_pswd_salt': 'str',
'new_pswd_salt': 'str',
'reset_token': 'str'
}
self.old_pswd_salt = None
self.new_pswd_salt = None
self.reset_token = None
| true | true |
f737359bfe01ddeb28c94cc3cf8c3c60c38ca264 | 14,647 | py | Python | scripts/run_token_classification.py | CAMeL-Lab/CAMeLBERT_morphosyntactic_tagger | 5bea542c2e731d263281d0ab16ba9c065f602f94 | [
"MIT"
] | null | null | null | scripts/run_token_classification.py | CAMeL-Lab/CAMeLBERT_morphosyntactic_tagger | 5bea542c2e731d263281d0ab16ba9c065f602f94 | [
"MIT"
] | null | null | null | scripts/run_token_classification.py | CAMeL-Lab/CAMeLBERT_morphosyntactic_tagger | 5bea542c2e731d263281d0ab16ba9c065f602f94 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# MIT License
#
# Copyright 2018-2021 New York University Abu Dhabi
#
# 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 limitatio... | 37.75 | 97 | 0.590428 |
import logging
import os
import sys
from dataclasses import dataclass, field
from typing import Dict, List, Optional, Tuple
import numpy as np
from seqeval.metrics import (
accuracy_score as seq_accuracy_score,
f1_score as seq_f1_score,
precision_score as seq_precision_score,
... | true | true |
f7373644759d17c45cf3ae146fedf1c85f452b87 | 251 | py | Python | manage.py | octaflop/geovinci | 928917e23ee480b12f8b250ee58ba1a3701eee6a | [
"MIT"
] | 4 | 2015-08-06T01:20:17.000Z | 2019-09-10T22:36:25.000Z | manage.py | octaflop/geovinci | 928917e23ee480b12f8b250ee58ba1a3701eee6a | [
"MIT"
] | 4 | 2020-02-11T22:51:53.000Z | 2021-06-10T17:50:46.000Z | manage.py | octaflop/geovinci | 928917e23ee480b12f8b250ee58ba1a3701eee6a | [
"MIT"
] | 3 | 2015-08-06T01:22:04.000Z | 2017-12-11T16:28:11.000Z | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "geovinci.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| 22.818182 | 72 | 0.772908 |
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "geovinci.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| true | true |
f73737e1efa9ce37f0808baedac2ae44ce769e5c | 1,997 | py | Python | python/phonenumbers/data/region_MU.py | ageron/python-phonenumbers | ebfa84db04e4eefc67f33eed9ff2bb62203c9f11 | [
"Apache-2.0"
] | 2 | 2019-03-30T02:12:54.000Z | 2021-03-08T18:59:40.000Z | python/phonenumbers/data/region_MU.py | ageron/python-phonenumbers | ebfa84db04e4eefc67f33eed9ff2bb62203c9f11 | [
"Apache-2.0"
] | null | null | null | python/phonenumbers/data/region_MU.py | ageron/python-phonenumbers | ebfa84db04e4eefc67f33eed9ff2bb62203c9f11 | [
"Apache-2.0"
] | 1 | 2018-11-10T03:47:34.000Z | 2018-11-10T03:47:34.000Z | """Auto-generated file, do not edit by hand. MU metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_MU = PhoneMetadata(id='MU', country_code=230, international_prefix='0(?:0|[2-7]0|33)',
general_desc=PhoneNumberDesc(national_number_pattern='[2-9]\\d{6,7}', possible_n... | 99.85 | 221 | 0.723085 | from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_MU = PhoneMetadata(id='MU', country_code=230, international_prefix='0(?:0|[2-7]0|33)',
general_desc=PhoneNumberDesc(national_number_pattern='[2-9]\\d{6,7}', possible_number_pattern='\\d{7,8}'),
fixed_line=PhoneNumberDesc(na... | true | true |
f73739152499a56e209e5514a9685cce0e6593cc | 10,419 | py | Python | benchmarks/f3_wrong_hints_permutations/scaling_ltl_infinite_state/18-extending_bound_23.py | EnricoMagnago/F3 | c863215c318d7d5f258eb9be38c6962cf6863b52 | [
"MIT"
] | 3 | 2021-04-23T23:29:26.000Z | 2022-03-23T10:00:30.000Z | benchmarks/f3_wrong_hints_permutations/scaling_ltl_infinite_state/18-extending_bound_23.py | EnricoMagnago/F3 | c863215c318d7d5f258eb9be38c6962cf6863b52 | [
"MIT"
] | null | null | null | benchmarks/f3_wrong_hints_permutations/scaling_ltl_infinite_state/18-extending_bound_23.py | EnricoMagnago/F3 | c863215c318d7d5f258eb9be38c6962cf6863b52 | [
"MIT"
] | 1 | 2021-11-17T22:02:56.000Z | 2021-11-17T22:02:56.000Z | from typing import Tuple, FrozenSet
from collections import Iterable
from mathsat import msat_term, msat_env
from mathsat import msat_make_constant, msat_declare_function
from mathsat import msat_get_integer_type, msat_get_rational_type, msat_get_bool_type
from mathsat import msat_make_and, msat_make_not, msat_mak... | 35.318644 | 89 | 0.624628 | from typing import Tuple, FrozenSet
from collections import Iterable
from mathsat import msat_term, msat_env
from mathsat import msat_make_constant, msat_declare_function
from mathsat import msat_get_integer_type, msat_get_rational_type, msat_get_bool_type
from mathsat import msat_make_and, msat_make_not, msat_mak... | true | true |
f737396bc186d22fcdc75c3467ac9bfc7555f47b | 300 | py | Python | blogcookiecutter/conftest.py | saaddine/blogcookiecutt | 95fbf4e8d1bdfb74abda344d883a4db3c2c88108 | [
"MIT"
] | null | null | null | blogcookiecutter/conftest.py | saaddine/blogcookiecutt | 95fbf4e8d1bdfb74abda344d883a4db3c2c88108 | [
"MIT"
] | 4 | 2022-02-02T05:26:44.000Z | 2022-03-02T05:35:46.000Z | blogcookiecutter/conftest.py | saaddine/blogcookiecutt | 95fbf4e8d1bdfb74abda344d883a4db3c2c88108 | [
"MIT"
] | null | null | null | import pytest
#from blogcookiecutter.users.models import User
#from blogcookiecutter.users.tests.factories import UserFactory
@pytest.fixture(autouse=True)
def media_storage(settings, tmpdir):
settings.MEDIA_ROOT = tmpdir.strpath
@pytest.fixture
def user() -> User:
return UserFactory()
| 20 | 63 | 0.783333 | import pytest
@pytest.fixture(autouse=True)
def media_storage(settings, tmpdir):
settings.MEDIA_ROOT = tmpdir.strpath
@pytest.fixture
def user() -> User:
return UserFactory()
| true | true |
f7373b3ae985e25e1e77bf7a2341a5af803f701e | 1,947 | py | Python | artificial_intelligence/qsvm_kernel_multiclass.py | chunfuchen/qiskit-acqua-tutorials | 74b0bcaac1678fc6c0de5be13e99d7ecd11b3075 | [
"Apache-2.0"
] | null | null | null | artificial_intelligence/qsvm_kernel_multiclass.py | chunfuchen/qiskit-acqua-tutorials | 74b0bcaac1678fc6c0de5be13e99d7ecd11b3075 | [
"Apache-2.0"
] | null | null | null | artificial_intelligence/qsvm_kernel_multiclass.py | chunfuchen/qiskit-acqua-tutorials | 74b0bcaac1678fc6c0de5be13e99d7ecd11b3075 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2018 IBM.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | 38.176471 | 104 | 0.648177 |
from datasets import *
from qiskit_aqua.utils import split_dataset_to_data_and_labels
from qiskit_aqua.input import get_input_instance
from qiskit_aqua import run_algorithm
import numpy as np
n = 2
sample_Total, training_input, test_input, class_labels = Wine(training_size=40,
... | true | true |
f7373bf86a03f8bad6b826d01fd916279dff7f92 | 731 | py | Python | core/etl/loader/administrativedomain.py | prorevizor/noc | 37e44b8afc64318b10699c06a1138eee9e7d6a4e | [
"BSD-3-Clause"
] | 84 | 2017-10-22T11:01:39.000Z | 2022-02-27T03:43:48.000Z | core/etl/loader/administrativedomain.py | prorevizor/noc | 37e44b8afc64318b10699c06a1138eee9e7d6a4e | [
"BSD-3-Clause"
] | 22 | 2017-12-11T07:21:56.000Z | 2021-09-23T02:53:50.000Z | core/etl/loader/administrativedomain.py | prorevizor/noc | 37e44b8afc64318b10699c06a1138eee9e7d6a4e | [
"BSD-3-Clause"
] | 23 | 2017-12-06T06:59:52.000Z | 2022-02-24T00:02:25.000Z | # ----------------------------------------------------------------------
# Administrative Domain loader
# ----------------------------------------------------------------------
# Copyright (C) 2007-2015 The NOC Project
# See LICENSE for details
# ----------------------------------------------------------------------
#... | 33.227273 | 96 | 0.556772 |
from .base import BaseLoader
from ..models.administrativedomain import AdministrativeDomain
from noc.sa.models.administrativedomain import AdministrativeDomain as AdministrativeDomainModel
class AdminitstrativeDomainLoader(BaseLoader):
name = "administrativedomain"
model = AdministrativeDomainModel
... | true | true |
f7373c5b1e66a26a8bb8d95c6e73d3dc64396078 | 11,973 | py | Python | scripts/parse_weather.py | danielbee/PracticalIntroDataSci | feecd7d1b18ba44fb3ea59d7709c2ff493c0c79f | [
"Apache-2.0"
] | null | null | null | scripts/parse_weather.py | danielbee/PracticalIntroDataSci | feecd7d1b18ba44fb3ea59d7709c2ff493c0c79f | [
"Apache-2.0"
] | null | null | null | scripts/parse_weather.py | danielbee/PracticalIntroDataSci | feecd7d1b18ba44fb3ea59d7709c2ff493c0c79f | [
"Apache-2.0"
] | null | null | null | # The purpose of this script is to collect all the station data into a single data structure.
# This will require regular expressions to find things like station changes.
#the hope is that we can simply export this single data structure to a single file is whatever format we want.
# Need to figure out how to deal ... | 48.278226 | 155 | 0.542805 |
import re
import pandas as pd
def main():
dataPath = '../data/weather/'
dataStationPath = dataPath+'stations/'
with open(dataPath+'stations.txt') as f:
stations = f.read().splitlines()
bigFrame = []
stationDataRaw = {}
for station in stations:
print(station)
st... | true | true |
f7373e258f6d142eea5a5fc642e8f1ef4d215a05 | 483 | py | Python | ethgreen/wallet/cc_wallet/cc_info.py | ethgreen/ethgreen-blockchain | 8f1a450897ab7a82326aea7e57e18ac2c03a9e83 | [
"Apache-2.0"
] | 11 | 2021-11-10T19:30:12.000Z | 2022-02-09T04:30:29.000Z | ethgreen/wallet/cc_wallet/cc_info.py | ethgreen/ethgreen-blockchain | 8f1a450897ab7a82326aea7e57e18ac2c03a9e83 | [
"Apache-2.0"
] | 6 | 2021-11-16T17:11:03.000Z | 2021-12-28T17:11:20.000Z | ethgreen/wallet/cc_wallet/cc_info.py | ethgreen/ethgreen-blockchain | 8f1a450897ab7a82326aea7e57e18ac2c03a9e83 | [
"Apache-2.0"
] | 3 | 2021-11-21T02:27:10.000Z | 2022-03-15T08:34:47.000Z | from dataclasses import dataclass
from typing import List, Optional, Tuple
from ethgreen.types.blockchain_format.program import Program
from ethgreen.types.blockchain_format.sized_bytes import bytes32
from ethgreen.util.streamable import Streamable, streamable
@dataclass(frozen=True)
@streamable
class CCInfo(Streama... | 34.5 | 91 | 0.811594 | from dataclasses import dataclass
from typing import List, Optional, Tuple
from ethgreen.types.blockchain_format.program import Program
from ethgreen.types.blockchain_format.sized_bytes import bytes32
from ethgreen.util.streamable import Streamable, streamable
@dataclass(frozen=True)
@streamable
class CCInfo(Streama... | true | true |
f7373ec8bfcd49ac886a396c63a0eefc6d457cd9 | 3,295 | py | Python | system_hotkey/util.py | timeyyy/system_wide_hotkeys | 37073bb04bdf78f8d3af909a9da3d3c30c7b8854 | [
"BSD-3-Clause"
] | 35 | 2016-01-12T13:58:54.000Z | 2022-03-21T05:39:55.000Z | system_hotkey/util.py | timeyyy/system_wide_hotkeys | 37073bb04bdf78f8d3af909a9da3d3c30c7b8854 | [
"BSD-3-Clause"
] | 23 | 2016-02-26T17:32:15.000Z | 2022-03-09T04:01:44.000Z | system_hotkey/util.py | timeyyy/system_wide_hotkeys | 37073bb04bdf78f8d3af909a9da3d3c30c7b8854 | [
"BSD-3-Clause"
] | 20 | 2015-08-30T12:56:01.000Z | 2022-01-22T05:42:41.000Z | '''
system_hotkey.util
general utilites..
'''
import _thread as thread
import threading
from queue import Queue
import queue
from functools import wraps
import time
def unique_int(values):
'''
returns the first lowest integer
that is not in the sequence passed in
if a list looks like 3,6
... | 27.008197 | 70 | 0.584825 | import _thread as thread
import threading
from queue import Queue
import queue
from functools import wraps
import time
def unique_int(values):
last = 0
for num in values:
if last not in values:
break
else:
last += 1
return last
class ExceptionSerializer():
def... | true | true |
f7373efd98c5fe1a0c9ae908ccb6abf32ccc6dbc | 6,917 | py | Python | src/olympia/amo/monitors.py | gijsk/addons-server | 7c38f379e3a0b4a5ca231f98ac0c049450c224bd | [
"BSD-3-Clause"
] | null | null | null | src/olympia/amo/monitors.py | gijsk/addons-server | 7c38f379e3a0b4a5ca231f98ac0c049450c224bd | [
"BSD-3-Clause"
] | null | null | null | src/olympia/amo/monitors.py | gijsk/addons-server | 7c38f379e3a0b4a5ca231f98ac0c049450c224bd | [
"BSD-3-Clause"
] | null | null | null | import os
import socket
import StringIO
import traceback
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
import redis as redislib
import requests
from kombu import Connection
from PIL import Image
import olympia.core.logger
from olympia.amo import search
from olympia.amo.te... | 31.875576 | 78 | 0.600983 | import os
import socket
import StringIO
import traceback
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
import redis as redislib
import requests
from kombu import Connection
from PIL import Image
import olympia.core.logger
from olympia.amo import search
from olympia.amo.te... | false | true |
f7373fcb933e047ac9a8d19a7111d3bc61c11d23 | 7,346 | py | Python | data/dataloader.py | 51N84D/Virtual-Try-On | 3b3d4f6066885446e2a6eadb6c2668237e62e03b | [
"MIT"
] | 6 | 2020-11-19T06:00:47.000Z | 2022-01-07T13:44:11.000Z | data/dataloader.py | 51N84D/Virtual-Try-On | 3b3d4f6066885446e2a6eadb6c2668237e62e03b | [
"MIT"
] | 5 | 2020-09-13T03:22:38.000Z | 2022-02-21T09:01:14.000Z | data/dataloader.py | 51N84D/Virtual-Try-On | 3b3d4f6066885446e2a6eadb6c2668237e62e03b | [
"MIT"
] | 4 | 2020-07-21T09:13:48.000Z | 2020-11-19T06:02:20.000Z | # coding=utf-8
import torch
import torch.utils.data as data
import torchvision.transforms as transforms
from torch.utils.data import DataLoader, Dataset
from PIL import Image
from PIL import ImageDraw
from addict import Dict
import os.path as osp
import numpy as np
import argparse
import matplotlib.pyplot as plt
import... | 32.941704 | 99 | 0.58508 |
import torch
import torch.utils.data as data
import torchvision.transforms as transforms
from torch.utils.data import DataLoader, Dataset
from PIL import Image
from PIL import ImageDraw
from addict import Dict
import os.path as osp
import numpy as np
import argparse
import matplotlib.pyplot as plt
import sys
import cv... | true | true |
f7373ffef1fa0c2e51d262561fbc288db2280ed0 | 145 | py | Python | tests/test_api.py | gargii/python-skytools | 8b75647e03809f3ceb98cd614e868393f3262e6a | [
"ISC"
] | 7 | 2019-11-17T01:59:41.000Z | 2021-04-23T15:01:03.000Z | tests/test_api.py | gargii/python-skytools | 8b75647e03809f3ceb98cd614e868393f3262e6a | [
"ISC"
] | 2 | 2019-09-15T16:38:02.000Z | 2022-02-07T07:35:28.000Z | tests/test_api.py | gargii/python-skytools | 8b75647e03809f3ceb98cd614e868393f3262e6a | [
"ISC"
] | 4 | 2017-11-18T16:49:26.000Z | 2021-11-15T15:19:33.000Z |
import skytools
def test_version():
a = skytools.natsort_key(skytools.__version__)
b = skytools.natsort_key('3.3')
assert a >= b
| 14.5 | 50 | 0.675862 |
import skytools
def test_version():
a = skytools.natsort_key(skytools.__version__)
b = skytools.natsort_key('3.3')
assert a >= b
| true | true |
f7374068d77ef31e22dfe3771bbaa614973ffe29 | 14,203 | py | Python | tests/unit/test_expression_tree/test_operations/test_jac.py | pmohtat/PyBaMM | 8f0a6d82e26c19f5735ed81b55671574af29eb16 | [
"BSD-3-Clause"
] | null | null | null | tests/unit/test_expression_tree/test_operations/test_jac.py | pmohtat/PyBaMM | 8f0a6d82e26c19f5735ed81b55671574af29eb16 | [
"BSD-3-Clause"
] | null | null | null | tests/unit/test_expression_tree/test_operations/test_jac.py | pmohtat/PyBaMM | 8f0a6d82e26c19f5735ed81b55671574af29eb16 | [
"BSD-3-Clause"
] | null | null | null | #
# Tests for the jacobian methods
#
import pybamm
import numpy as np
import unittest
from scipy.sparse import eye
from tests import get_mesh_for_testing
def test_multi_var_function(arg1, arg2):
return arg1 + arg2
class TestJacobian(unittest.TestCase):
def test_variable_is_statevector(self):
a = py... | 35.866162 | 87 | 0.558403 |
import pybamm
import numpy as np
import unittest
from scipy.sparse import eye
from tests import get_mesh_for_testing
def test_multi_var_function(arg1, arg2):
return arg1 + arg2
class TestJacobian(unittest.TestCase):
def test_variable_is_statevector(self):
a = pybamm.Symbol("a")
with self... | true | true |
f73740f023ab34c3fce503fa5857fc4349b078d8 | 8,293 | py | Python | tern/analyze/default/command_lib/command_lib.py | ReconPangolin/tern | ed8b2b721397358f5ff8c4253aa4f0aa70a55afe | [
"BSD-2-Clause"
] | 2 | 2020-05-21T00:00:36.000Z | 2020-12-28T20:43:25.000Z | tern/analyze/default/command_lib/command_lib.py | JamieMagee/tern | 230d6d812d6a74e084c6d3d9d9396f2c716254b7 | [
"BSD-2-Clause"
] | null | null | null | tern/analyze/default/command_lib/command_lib.py | JamieMagee/tern | 230d6d812d6a74e084c6d3d9d9396f2c716254b7 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (c) 2017-2020 VMware, Inc. All Rights Reserved.
# SPDX-License-Identifier: BSD-2-Clause
"""
Invoking commands in the command library
"""
import logging
import os
import yaml
import copy
import pkg_resources
from tern.utils import constants
from tern.report import errors
# base... | 36.857778 | 78 | 0.669721 |
import logging
import os
import yaml
import copy
import pkg_resources
from tern.utils import constants
from tern.report import errors
base_file = pkg_resources.resource_filename(
'tern', 'analyze/default/command_lib/base.yml')
snippet_file = pkg_resources.resource_filename(
'tern', 'analyze/default/c... | true | true |
f73741dd958e866559e2c020134efd449df74c19 | 33,925 | py | Python | pyrosetta/models/_models.py | blockjoe/rosetta-api-client-python | 707f325f7560ffa6d5dfe361aff4779cc0b7182f | [
"Apache-2.0"
] | null | null | null | pyrosetta/models/_models.py | blockjoe/rosetta-api-client-python | 707f325f7560ffa6d5dfe361aff4779cc0b7182f | [
"Apache-2.0"
] | null | null | null | pyrosetta/models/_models.py | blockjoe/rosetta-api-client-python | 707f325f7560ffa6d5dfe361aff4779cc0b7182f | [
"Apache-2.0"
] | null | null | null | # generated by datamodel-codegen:
# filename: api.json
# timestamp: 2021-01-16T01:13:01+00:00
from __future__ import annotations
from enum import Enum
from typing import Any, Dict, List, Optional
from pydantic import BaseModel, Field
class SubNetworkIdentifier(BaseModel):
network: str = Field(..., example... | 43.774194 | 798 | 0.724687 |
from __future__ import annotations
from enum import Enum
from typing import Any, Dict, List, Optional
from pydantic import BaseModel, Field
class SubNetworkIdentifier(BaseModel):
network: str = Field(..., example='shard 1')
metadata: Optional[Dict[str, Any]] = Field(
None, example={'producer': '... | true | true |
f73741f6d33de3f69a119c74600af379993fdf34 | 9,003 | py | Python | samples_validator/utils.py | PlatformOfTrust/code-samples-validator | 75fa24d93ccafaa51f7e1c0ebae447ac2bf933e0 | [
"MIT"
] | null | null | null | samples_validator/utils.py | PlatformOfTrust/code-samples-validator | 75fa24d93ccafaa51f7e1c0ebae447ac2bf933e0 | [
"MIT"
] | null | null | null | samples_validator/utils.py | PlatformOfTrust/code-samples-validator | 75fa24d93ccafaa51f7e1c0ebae447ac2bf933e0 | [
"MIT"
] | 1 | 2020-04-28T09:54:33.000Z | 2020-04-28T09:54:33.000Z | import ast
from collections import defaultdict
from pathlib import Path
from typing import List, Optional
from samples_validator.base import ApiTestResult, CodeSample, HttpMethod
class TestExecutionResultMap:
"""
Data structure for storing results of test runs for each code sample
based on its HTTP resou... | 36.156627 | 79 | 0.608908 | import ast
from collections import defaultdict
from pathlib import Path
from typing import List, Optional
from samples_validator.base import ApiTestResult, CodeSample, HttpMethod
class TestExecutionResultMap:
def __init__(self):
self._map = {}
def put(self,
test_result: ApiTestResult,
... | true | true |
f737422821f3088bf2c40b3a202a363213f9441e | 5,683 | py | Python | capa/features/extractors/viv/indirect_calls.py | evandowning/capa | 03b15ce28977ffcc617d3c67c9dff20de7ee6196 | [
"Apache-2.0"
] | 1 | 2020-07-16T20:04:55.000Z | 2020-07-16T20:04:55.000Z | capa/features/extractors/viv/indirect_calls.py | evandowning/capa | 03b15ce28977ffcc617d3c67c9dff20de7ee6196 | [
"Apache-2.0"
] | 47 | 2021-03-17T10:41:44.000Z | 2022-03-28T04:03:01.000Z | capa/features/extractors/viv/indirect_calls.py | LaudateCorpus1/capa | ccf39334cecec4b8bfda5607f1d899822c59c72c | [
"Apache-2.0"
] | 3 | 2021-05-19T20:18:35.000Z | 2021-05-19T21:02:18.000Z | # Copyright (C) 2020 FireEye, Inc. All Rights Reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at: [package root]/LICENSE.txt
# Unless required by applicable law or agreed to in writing,... | 34.02994 | 111 | 0.664614 |
import collections
from typing import TYPE_CHECKING, Set, List, Deque, Tuple, Union, Optional
import envi
import vivisect.const
import envi.archs.i386.disasm
import envi.archs.amd64.disasm
from vivisect import VivWorkspace
if TYPE_CHECKING:
from capa.features.extractors.viv.extractor import InstructionHan... | true | true |
f73745513c10c7524fe40f28d9f4a8a7f35bd720 | 32,215 | py | Python | 3rdparty/pytorch/caffe2/python/checkpoint.py | WoodoLee/TorchCraft | 999f68aab9e7d50ed3ae138297226dc95fefc458 | [
"MIT"
] | 15 | 2019-08-10T02:36:38.000Z | 2021-07-14T13:45:32.000Z | 3rdparty/pytorch/caffe2/python/checkpoint.py | WoodoLee/TorchCraft | 999f68aab9e7d50ed3ae138297226dc95fefc458 | [
"MIT"
] | 7 | 2019-10-21T03:08:51.000Z | 2022-03-11T23:54:28.000Z | 3rdparty/pytorch/caffe2/python/checkpoint.py | WoodoLee/TorchCraft | 999f68aab9e7d50ed3ae138297226dc95fefc458 | [
"MIT"
] | 6 | 2020-10-16T13:28:31.000Z | 2021-08-25T12:08:34.000Z | ## @package checkpoint
# Module caffe2.python.checkpoint
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import os
import logging
from caffe2.python import core, context
from caffe2.python.net_builder import ops
from c... | 38.627098 | 87 | 0.629738 | ort absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import os
import logging
from caffe2.python import core, context
from caffe2.python.net_builder import ops
from caffe2.python.task import (
final_output,
Node,
Task,
TaskGro... | true | true |
f7374780616c1f3cf09837fafb1bf02cbaaf38cb | 13,335 | py | Python | pC2DMStools.py | TaranDriver/2D-PC-MS | b466b4afd9c088ba4e7d76e94f513d19e2a8416d | [
"Apache-2.0"
] | null | null | null | pC2DMStools.py | TaranDriver/2D-PC-MS | b466b4afd9c088ba4e7d76e94f513d19e2a8416d | [
"Apache-2.0"
] | null | null | null | pC2DMStools.py | TaranDriver/2D-PC-MS | b466b4afd9c088ba4e7d76e94f513d19e2a8416d | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
@author: Taran Driver
This module holds useful functions for pC-2DMS analysis
"""
import numpy as np
import scipy.io
def circList(r):
'Returns all indices within circle of radius r'
return [[x, y] for x in range(r+1) for y in range(r+1) if x**2+y**2<=r**2]
def c... | 42.333333 | 81 | 0.582452 |
"""
@author: Taran Driver
This module holds useful functions for pC-2DMS analysis
"""
import numpy as np
import scipy.io
def circList(r):
'Returns all indices within circle of radius r'
return [[x, y] for x in range(r+1) for y in range(r+1) if x**2+y**2<=r**2]
def clearCirc(array, r, c, ci... | false | true |
f737482e1e85deb52326908d600926e4fd080cc0 | 2,415 | py | Python | open this for text file manipulation/splitFileAndPerformAnalysis.py | ayandeephazra/Natural_Language_Processing_Research | affe0bfe59f3a861c67e37cbd29d50b4d04e43b6 | [
"MIT"
] | null | null | null | open this for text file manipulation/splitFileAndPerformAnalysis.py | ayandeephazra/Natural_Language_Processing_Research | affe0bfe59f3a861c67e37cbd29d50b4d04e43b6 | [
"MIT"
] | null | null | null | open this for text file manipulation/splitFileAndPerformAnalysis.py | ayandeephazra/Natural_Language_Processing_Research | affe0bfe59f3a861c67e37cbd29d50b4d04e43b6 | [
"MIT"
] | null | null | null | # f = open("file.txt", "r", encoding="utf-8")
# content = f.readLines()
# f.close()
# content_list = content.split(". ")
# i = 0
# for sentence in content:
# print("i", sentence)
# //f2 = open("FILE" + str(i) + ".txt", "w+", encoding="utf-8")
# / i = i + 1
# f2.write(sentence)
# f2.close()
# print(content_list)
# ... | 27.134831 | 124 | 0.438509 |
import csv
i = 0
folder_path = "C:\\Users\\Ayan Deep Hazra\\Desktop\\Repos\\Natural_Language_Processing_Research\\open this for text file " \
"manipulation\\labeled_papers_in_txt(w_crystals).csv"
file = open(folder_path, encoding="cp1252")
csvreader = csv.reader(file)
rows = []
stat... | true | true |
f73748404c294e89740bbf1ee0a0e5ac227efb1b | 9,731 | py | Python | isitphishing_connector.py | shiyingtu/isitphishing | 191172484ec7093364adfbde9a651253ebf2c57a | [
"Apache-2.0"
] | null | null | null | isitphishing_connector.py | shiyingtu/isitphishing | 191172484ec7093364adfbde9a651253ebf2c57a | [
"Apache-2.0"
] | null | null | null | isitphishing_connector.py | shiyingtu/isitphishing | 191172484ec7093364adfbde9a651253ebf2c57a | [
"Apache-2.0"
] | null | null | null | # File: isitphishing_connector.py
#
# Copyright (c) 2017-2021 Splunk Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | 37.141221 | 141 | 0.658206 |
import phantom.app as phantom
from phantom.base_connector import BaseConnector
from phantom.action_result import ActionResult
import requests
import json
from bs4 import BeautifulSoup
class RetVal(tuple):
def __new__(cls, val1, val2):
return tuple.__new__(RetVal, (val1, val2))
class Isi... | true | true |
f737486a3c82737b2cf0ca3c559eb6dd39b06bd3 | 5,304 | py | Python | proglearn/transformers.py | KhelmholtzR/ProgLearn | f5177c720e53d2f5936272998b94e0746135a3b9 | [
"MIT"
] | 18 | 2020-05-17T21:56:36.000Z | 2020-09-18T17:39:26.000Z | proglearn/transformers.py | KhelmholtzR/ProgLearn | f5177c720e53d2f5936272998b94e0746135a3b9 | [
"MIT"
] | 209 | 2020-06-05T19:08:51.000Z | 2020-10-03T16:49:39.000Z | proglearn/transformers.py | KhelmholtzR/ProgLearn | f5177c720e53d2f5936272998b94e0746135a3b9 | [
"MIT"
] | 33 | 2020-06-10T23:12:09.000Z | 2020-09-28T05:09:44.000Z | """
Main Author: Will LeVine
Corresponding Email: levinewill@icloud.com
"""
from tensorflow import keras
import numpy as np
from sklearn.tree import DecisionTreeClassifier
from sklearn.utils.validation import check_array, check_is_fitted, check_X_y
from .base import BaseTransformer
class NeuralClassificationTransfor... | 27.481865 | 94 | 0.59276 | from tensorflow import keras
import numpy as np
from sklearn.tree import DecisionTreeClassifier
from sklearn.utils.validation import check_array, check_is_fitted, check_X_y
from .base import BaseTransformer
class NeuralClassificationTransformer(BaseTransformer):
def __init__(
self,
network,
... | true | true |
f73748716bfeaea7b22165f703b95e1d7a8d55fb | 2,824 | py | Python | azure/durable_functions/tasks/call_activity_with_retry.py | asedighi/azure-functions-durable-python | ad2da30060f5ce7188da3a61dadbbaad5784f842 | [
"MIT"
] | null | null | null | azure/durable_functions/tasks/call_activity_with_retry.py | asedighi/azure-functions-durable-python | ad2da30060f5ce7188da3a61dadbbaad5784f842 | [
"MIT"
] | null | null | null | azure/durable_functions/tasks/call_activity_with_retry.py | asedighi/azure-functions-durable-python | ad2da30060f5ce7188da3a61dadbbaad5784f842 | [
"MIT"
] | null | null | null | from typing import List, Any
from .task_utilities import find_task_scheduled, \
find_task_retry_timer_created, set_processed, parse_history_event, \
find_task_completed, find_task_failed, find_task_retry_timer_fired
from ..models.RetryOptions import RetryOptions
from ..models.Task import (
Task)
from ..mod... | 37.653333 | 92 | 0.669972 | from typing import List, Any
from .task_utilities import find_task_scheduled, \
find_task_retry_timer_created, set_processed, parse_history_event, \
find_task_completed, find_task_failed, find_task_retry_timer_fired
from ..models.RetryOptions import RetryOptions
from ..models.Task import (
Task)
from ..mod... | true | true |
f73749784992082837d34a09b1edff318dd51abd | 2,851 | py | Python | Book_fetch.py | Karthik4293/Book-Finder | 2bbe93b797a3d429f3dd36dd4911debf4a571163 | [
"Apache-2.0"
] | null | null | null | Book_fetch.py | Karthik4293/Book-Finder | 2bbe93b797a3d429f3dd36dd4911debf4a571163 | [
"Apache-2.0"
] | null | null | null | Book_fetch.py | Karthik4293/Book-Finder | 2bbe93b797a3d429f3dd36dd4911debf4a571163 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Spyder Editor
This is a temporary script file.
"""
import requests
import cloudsight
from goodreads import client
import goodreads
import os
import sys
import re
import subprocess
from googlesearch import *
print("Welcome to the simple book-review tool")
print("--------------------------... | 26.155963 | 177 | 0.635566 |
import requests
import cloudsight
from goodreads import client
import goodreads
import os
import sys
import re
import subprocess
from googlesearch import *
print("Welcome to the simple book-review tool")
print("--------------------------------------------")
print("Authentication for cloud services in progress")
gc ... | true | true |
f73749b19a84005c51f69cae1bf1b3e5111fa3dc | 1,930 | py | Python | tests/integration/tree/test_total_tree_length_integration.py | yuzhenpeng/PhyKIT | 167b9dfe0dd0bddd4b23492d9a3dc34e56debbd7 | [
"MIT"
] | 26 | 2020-10-28T10:33:33.000Z | 2022-02-04T14:59:22.000Z | tests/integration/tree/test_total_tree_length_integration.py | yuzhenpeng/PhyKIT | 167b9dfe0dd0bddd4b23492d9a3dc34e56debbd7 | [
"MIT"
] | 4 | 2021-03-28T22:05:39.000Z | 2022-03-22T00:33:01.000Z | tests/integration/tree/test_total_tree_length_integration.py | JLSteenwyk/PhyKIT | 0b3194d1bb5c189993b256fe96011cce48b9bbb4 | [
"MIT"
] | 4 | 2020-11-06T11:58:25.000Z | 2021-08-17T16:57:51.000Z | import pytest
import sys
from math import isclose
from mock import patch, call
from pathlib import Path
from textwrap import dedent
from phykit.phykit import Phykit
here = Path(__file__)
@pytest.mark.integration
class TestTotalTreeLength(object):
@patch("builtins.print")
def test_total_tree_length0(self, mo... | 30.15625 | 83 | 0.627979 | import pytest
import sys
from math import isclose
from mock import patch, call
from pathlib import Path
from textwrap import dedent
from phykit.phykit import Phykit
here = Path(__file__)
@pytest.mark.integration
class TestTotalTreeLength(object):
@patch("builtins.print")
def test_total_tree_length0(self, mo... | true | true |
f73749d457ba15d6489c64897e21070a672f8706 | 8,578 | py | Python | ai/oldai/base.py | JackieChiles/Cinch | f8b9e8c073f555ff827fa7887153e82b263a8aab | [
"MIT"
] | null | null | null | ai/oldai/base.py | JackieChiles/Cinch | f8b9e8c073f555ff827fa7887153e82b263a8aab | [
"MIT"
] | 5 | 2015-01-10T02:18:54.000Z | 2015-12-07T02:07:28.000Z | ai/oldai/base.py | JackieChiles/Cinch | f8b9e8c073f555ff827fa7887153e82b263a8aab | [
"MIT"
] | null | null | null | #!/usr/bin/python3
"""Base functionality for Cinch AI agents.
Method reference:
class AIBase
--send_data(data)
--handle_daemon_command(raw_msg)
--run()
--start()
--stop()
--bid(bid)
--chat(chat_msg)
--play(card_val)
--is_legal_bid(bid)
--is_legal_play(card)
--act()
TODO:
- have 'thinking' timeout value (hal... | 29.993007 | 90 | 0.547214 |
from multiprocessing import Pipe
import logging
log = logging.getLogger(__name__)
from core.cards import RANKS_SHORT, SUITS_SHORT, NUM_RANKS
SERVER_HOST = "localhost"
SERVER_PORT = 2424
SERVER_URL = "{0}:{1}".format(SERVER_HOST, SERVER_PORT)
THINKING_TIMEOUT = 10.0
EVENT_NEW_GAME = 0
EVENT_JOIN_GAME = 1... | true | true |
f7374b0c917bfd4ed66b10c34f9763a55f8aa4fc | 2,840 | py | Python | test/functional/interface_rpc.py | rojarsmith/eleccoin | 2f1bb02eb75f244fe9f1b46a91ee72b756d85912 | [
"MIT"
] | null | null | null | test/functional/interface_rpc.py | rojarsmith/eleccoin | 2f1bb02eb75f244fe9f1b46a91ee72b756d85912 | [
"MIT"
] | null | null | null | test/functional/interface_rpc.py | rojarsmith/eleccoin | 2f1bb02eb75f244fe9f1b46a91ee72b756d85912 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2020-2021 The Eleccoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Tests some generic aspects of the RPC interface."""
import os
from test_framework.authproxy import JS... | 36.410256 | 99 | 0.659507 |
import os
from test_framework.authproxy import JSONRPCException
from test_framework.test_framework import EleccoinTestFramework
from test_framework.util import assert_equal, assert_greater_than_or_equal
def expect_http_status(expected_http_status, expected_rpc_code,
fcn, *args):
try:
... | true | true |
f7374ec9a59d2f83495606d1f9acaf052e81adbc | 1,759 | py | Python | src/bripy/bllb/q.py | brl0/bripy | 3754b5db651180d58645bd7d32c3d5d12528ebde | [
"MIT"
] | null | null | null | src/bripy/bllb/q.py | brl0/bripy | 3754b5db651180d58645bd7d32c3d5d12528ebde | [
"MIT"
] | null | null | null | src/bripy/bllb/q.py | brl0/bripy | 3754b5db651180d58645bd7d32c3d5d12528ebde | [
"MIT"
] | null | null | null | from queue import Queue
from threading import Thread
from time import sleep
from bripy.bllb.logging import logger, DBG
def unloadq(q, stop, limit=2000, rest=.1, check=100):
i = limit
loops = 0
results = []
while True and ((i and not stop()) or q.qsize()):
loops += 1
if loops % check ==... | 20.940476 | 67 | 0.503695 | from queue import Queue
from threading import Thread
from time import sleep
from bripy.bllb.logging import logger, DBG
def unloadq(q, stop, limit=2000, rest=.1, check=100):
i = limit
loops = 0
results = []
while True and ((i and not stop()) or q.qsize()):
loops += 1
if loops % check ==... | true | true |
f7375389767f10b8cf95526e94fdc87ce6010f53 | 10,482 | py | Python | flexget/plugins/input/next_series_seasons.py | viggy96/Flexget | 464becced8f0e0e6c94b8a2f865c50f0305d2b81 | [
"MIT"
] | 1 | 2021-03-16T18:41:47.000Z | 2021-03-16T18:41:47.000Z | flexget/plugins/input/next_series_seasons.py | viggy96/Flexget | 464becced8f0e0e6c94b8a2f865c50f0305d2b81 | [
"MIT"
] | null | null | null | flexget/plugins/input/next_series_seasons.py | viggy96/Flexget | 464becced8f0e0e6c94b8a2f865c50f0305d2b81 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals, division, absolute_import
from builtins import * # noqa pylint: disable=unused-import, redefined-builtin
import logging
import re
from flexget import plugin
from flexget.event import event
from flexget.entry import Entry
from flexget.manager import Session
from flexget.plugin... | 51.131707 | 240 | 0.565159 | from __future__ import unicode_literals, division, absolute_import
from builtins import *
import logging
import re
from flexget import plugin
from flexget.event import event
from flexget.entry import Entry
from flexget.manager import Session
from flexget.plugins.filter.series import SeriesTask, Series, get_latest_r... | true | true |
f73753ddcd8c27c3d3d95ab7faea324198795791 | 1,195 | py | Python | api/generated/python/azure-iiot-opc-history/models/replace_events_details_api_model.py | benjguin/Industrial-IoT | 1bc68a62383f0849bbb18f373c9566d8d30c1d68 | [
"MIT"
] | 2 | 2021-08-06T19:40:53.000Z | 2021-08-07T05:21:24.000Z | api/generated/python/azure-iiot-opc-history/models/replace_events_details_api_model.py | benjguin/Industrial-IoT | 1bc68a62383f0849bbb18f373c9566d8d30c1d68 | [
"MIT"
] | null | null | null | api/generated/python/azure-iiot-opc-history/models/replace_events_details_api_model.py | benjguin/Industrial-IoT | 1bc68a62383f0849bbb18f373c9566d8d30c1d68 | [
"MIT"
] | null | null | null | # 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) AutoRest Code Generator 2.3.33.0
# ... | 32.297297 | 76 | 0.591632 |
from msrest.serialization import Model
class ReplaceEventsDetailsApiModel(Model):
_validation = {
'events': {'required': True},
}
_attribute_map = {
'filter': {'key': 'filter', 'type': 'object'},
'events': {'key': 'events', 'type': '[HistoricEventApiModel]'},
}
... | true | true |
f737549106aae46c5f3c52680763d4c20159508b | 3,717 | py | Python | openstack-congress-9.0.0/congress/tests/fake_datasource.py | scottwedge/OpenStack-Stein | 7077d1f602031dace92916f14e36b124f474de15 | [
"Apache-2.0"
] | 50 | 2015-04-21T14:12:01.000Z | 2020-06-01T06:23:13.000Z | congress/tests/fake_datasource.py | openstack-archive/congress | 85243abf63dfc7c086e28e9bdb3fb0b7c9d2ad94 | [
"Apache-2.0"
] | 5 | 2019-08-14T06:46:03.000Z | 2021-12-13T20:01:25.000Z | congress/tests/fake_datasource.py | openstack-archive/congress | 85243abf63dfc7c086e28e9bdb3fb0b7c9d2ad94 | [
"Apache-2.0"
] | 25 | 2015-05-22T04:02:33.000Z | 2020-01-14T12:15:12.000Z | # Copyright (c) 2015 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | 34.416667 | 78 | 0.633844 |
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
import mock
from oslo_log import log as logging
from congress.datasources import datasource_driver
from congress.datasources import datasource_utils
from congress.datasources.json_ingester impor... | true | true |
f737559513a040db065959a55138db2b5eb5bdf7 | 1,577 | py | Python | objets/piles_exceptions.py | houahidi/exos-python | 60055ff2933a07876213aa8e5f03c9388f628b99 | [
"Apache-2.0"
] | null | null | null | objets/piles_exceptions.py | houahidi/exos-python | 60055ff2933a07876213aa8e5f03c9388f628b99 | [
"Apache-2.0"
] | null | null | null | objets/piles_exceptions.py | houahidi/exos-python | 60055ff2933a07876213aa8e5f03c9388f628b99 | [
"Apache-2.0"
] | null | null | null | """Exemple Pile"""
class PilePleineException(Exception):
def __init__(self, message="Erreur : Pile pleine"):
Exception.__init__(self,message)
def __str__(self):
return "PilePleine(message:{0})".format(self.args)
class Pile(object):
"""Pile de type FILO"""
def __init__(self, taille=10... | 29.203704 | 100 | 0.583386 | """Exemple Pile"""
class PilePleineException(Exception):
def __init__(self, message="Erreur : Pile pleine"):
Exception.__init__(self,message)
def __str__(self):
return "PilePleine(message:{0})".format(self.args)
class Pile(object):
"""Pile de type FILO"""
def __init__(self, taille=10... | false | true |
f737562ba8c10007ccc61b1746ce27337d0a99dc | 499 | py | Python | data/scripts/templates/object/tangible/ship/components/shield_generator/shared_shd_incom_rayshield_z7.py | obi-two/GameServer | 7d37024e2291a97d49522610cd8f1dbe5666afc2 | [
"MIT"
] | 20 | 2015-02-23T15:11:56.000Z | 2022-03-18T20:56:48.000Z | data/scripts/templates/object/tangible/ship/components/shield_generator/shared_shd_incom_rayshield_z7.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | null | null | null | data/scripts/templates/object/tangible/ship/components/shield_generator/shared_shd_incom_rayshield_z7.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | 20 | 2015-04-04T16:35:59.000Z | 2022-03-24T14:54:37.000Z | #### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/ship/components/shield_generator/shared_shd_incom_rayshield_z7.iff"
... | 29.352941 | 103 | 0.751503 | true | true | |
f73758045548673b3de3df3b8adcc5cdff011f1a | 324 | py | Python | models/utils/FileMgmt.py | GabrielAmare/Models | 7e2ec367faf360fd0e294a17e4e2b33cae71124a | [
"MIT"
] | null | null | null | models/utils/FileMgmt.py | GabrielAmare/Models | 7e2ec367faf360fd0e294a17e4e2b33cae71124a | [
"MIT"
] | null | null | null | models/utils/FileMgmt.py | GabrielAmare/Models | 7e2ec367faf360fd0e294a17e4e2b33cae71124a | [
"MIT"
] | null | null | null | import json
class FileMgmt:
@classmethod
def save_json(cls, fp: str, data):
with open(fp, mode='w', encoding='utf-8') as file:
json.dump(data, file)
@classmethod
def load_json(cls, fp: str):
with open(fp, mode='r', encoding='utf-8') as file:
return json.load(fi... | 23.142857 | 58 | 0.583333 | import json
class FileMgmt:
@classmethod
def save_json(cls, fp: str, data):
with open(fp, mode='w', encoding='utf-8') as file:
json.dump(data, file)
@classmethod
def load_json(cls, fp: str):
with open(fp, mode='r', encoding='utf-8') as file:
return json.load(fi... | true | true |
f737591b84805072b3e43ea08c16281438208dc1 | 709 | py | Python | authentication/migrations/0002_token.py | Mangeneh/akkaskhooneh-backend | 2a81e73fbe0d55d5821ba1670a997bd8851c4af6 | [
"MIT"
] | 7 | 2018-09-17T18:34:49.000Z | 2019-09-15T11:39:15.000Z | authentication/migrations/0002_token.py | Mangeneh/akkaskhooneh-backend | 2a81e73fbe0d55d5821ba1670a997bd8851c4af6 | [
"MIT"
] | 9 | 2019-10-21T17:12:21.000Z | 2022-03-11T23:28:14.000Z | authentication/migrations/0002_token.py | Mangeneh/akkaskhooneh-backend | 2a81e73fbe0d55d5821ba1670a997bd8851c4af6 | [
"MIT"
] | 1 | 2019-11-29T16:12:12.000Z | 2019-11-29T16:12:12.000Z | # Generated by Django 2.1 on 2018-09-08 08:56
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('authentication', '0001_initial'),
]
operations = [
migrations.CreateModel(
... | 29.541667 | 143 | 0.631876 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('authentication', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Token',
fields=[... | true | true |
f7375a746b79c9c9e49edccf57c7c0994c8f0a23 | 195 | py | Python | wechat-demo/main.py | l2m2/dirty-projects | e3bff1f829e20b78462e3e91ab094cfad2f1a692 | [
"MIT"
] | 1 | 2020-06-04T00:54:00.000Z | 2020-06-04T00:54:00.000Z | wechat-demo/main.py | l2m2/dirty-projects | e3bff1f829e20b78462e3e91ab094cfad2f1a692 | [
"MIT"
] | null | null | null | wechat-demo/main.py | l2m2/dirty-projects | e3bff1f829e20b78462e3e91ab094cfad2f1a692 | [
"MIT"
] | null | null | null | # -*- coding utf-8 -*-
# filename: main.py
import web
from handle import Handle
urls = (
'/wx', 'Handle',
)
if __name__ == '__main__':
app = web.application(urls, globals())
app.run()
| 13 | 40 | 0.610256 |
import web
from handle import Handle
urls = (
'/wx', 'Handle',
)
if __name__ == '__main__':
app = web.application(urls, globals())
app.run()
| true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.