max_stars_repo_path stringlengths 3 269 | max_stars_repo_name stringlengths 4 119 | max_stars_count int64 0 191k | id stringlengths 1 7 | content stringlengths 6 1.05M | score float64 0.23 5.13 | int_score int64 0 5 |
|---|---|---|---|---|---|---|
TimeSeriesAnalysisWithPython-master/SciPyTimeSeries/snippets/custom_rolling.py | sunny2309/scipy_conf_notebooks | 2 | 35800 | df.rolling(window = 10, center = False).apply(lambda x: x[1]/x[2])[1:10] | 2.28125 | 2 |
CovarianceMatrix.py | Roundthecorner/CovarianceMatrix | 0 | 35801 | # -*- coding: utf-8 -*-
"""
Created on Sat May 23 11:28:30 2020
@author: rener
"""
import numpy as np
import pandas as pd
import os
from datetime import date
import time
import sys
dir_path = os.path.dirname(os.path.realpath(__file__))
os.chdir(dir_path)
#%% For the various companies we have data going back differen... | 3.09375 | 3 |
source/online_catalog_scraper/online_scraper.py | kevinliang43/ProjectDB | 0 | 35802 | import bs4
import urllib
from base_online_scraper import base_online_scraper as scraper
BASE_URL = 'http://catalog.northeastern.edu'
INITIAL_PATH = '/course-descriptions/'
fp = urllib.urlopen(BASE_URL + INITIAL_PATH)
soup = bs4.BeautifulSoup(fp, 'lxml')
nav_menu = soup.find("div", {"id": "atozindex"}).find_all('a', h... | 3.109375 | 3 |
dummyapi/prediction.py | BW-Saltiest-Hacker-News-Trolls/flask_backend | 0 | 35803 | import pandas as pd
import numpy as np
import re
import spacy
import string
import sklearn
from html.parser import HTMLParser
from joblib import load
import tensorflow as tf
nlp = spacy.load('en_core_web_sm')
tfidf = load('tfidf.joblib')
wordlist = load('wordlist.joblib')
tf.keras.backend.clear_session()
model = tf... | 2.578125 | 3 |
lit/fields/text.py | velvetkeyboard/py-lit | 0 | 35804 | from lit.fields.base import Field
from lit.fields.base import TextType
class TextField(Field):
sql_type = TextType()
py_type = str
| 1.875 | 2 |
src/evidently/model_profile/sections/cat_target_drift_profile_section.py | jenoOvchi/evidently | 0 | 35805 | from datetime import datetime
from typing import Any
from typing import Dict
from typing import Iterable
from typing import Optional
from typing import Type
from evidently.analyzers.base_analyzer import Analyzer
from evidently.analyzers.cat_target_drift_analyzer import CatTargetDriftAnalyzer
from evidently.model_profi... | 2.109375 | 2 |
stores/apps/preferences/forms.py | diassor/CollectorCity-Market-Place | 135 | 35806 | import re, logging
from django import forms
from django.forms import ModelForm
from django.utils.translation import ugettext as _
from django.contrib.localflavor.us.forms import USStateSelect,\
USPhoneNumberField
from models import Preference, ShippingWeight, ShippingPrice, ShippingItem, TaxState, DnsShop, EmailNo... | 2.28125 | 2 |
cmake_tidy/utils/app_configuration/__init__.py | MaciejPatro/cmake-tidy | 16 | 35807 | ###############################################################################
# Copyright <NAME> (<EMAIL>)
# MIT License
###############################################################################
from cmake_tidy.utils.app_configuration.configuration import ConfigurationError
| 1.296875 | 1 |
testing/logging_tests.py | nanome-ai/nanome-plugin-api | 0 | 35808 | <filename>testing/logging_tests.py
import logging
import sys
import unittest
from nanome import Plugin, PluginInstance
from nanome.util import Logs
if sys.version_info.major >= 3:
from unittest.mock import MagicMock, patch
else:
# Python 2.7 way of getting magicmock. Requires pip install mock
f... | 2.28125 | 2 |
pytest_timeout.py | big91987/pytest-timeout | 0 | 35809 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://www.mozilla.org/en-US/MPL/2.0/.
import warnings
from unittest import TestCase
import pytest
def pytest_addoption(parser):
parser.addop... | 2.234375 | 2 |
examples/test_Confined.py | pompiduskus/pybox2d | 0 | 35810 | <reponame>pompiduskus/pybox2d
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# C++ version Copyright (c) 2006-2007 <NAME> http://www.box2d.org
# Python version by <NAME> / sirkne at gmail dot com
#
# This software is provided 'as-is', without any express or implied
# warranty. In no event will the authors be ... | 2.953125 | 3 |
pystella/step.py | zachjweiner/pystella | 14 | 35811 | __copyright__ = "Copyright (C) 2019 <NAME>"
__license__ = """
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modif... | 1.5625 | 2 |
identity-mapper.py | jamesbak/databox-adls-loader | 2 | 35812 | <filename>identity-mapper.py
#!/usr/bin/env python
import requests
import sys, subprocess, datetime, json, itertools, os.path, threading, argparse, logging
from adls_copy_utils import AdlsCopyUtils
log = logging.getLogger(__name__)
def update_files_owners(account, container, sas_token, work_queue):
log = logging... | 2.171875 | 2 |
code2.0/models.py | Mulns/Whale-Identification | 2 | 35813 | <reponame>Mulns/Whale-Identification<filename>code2.0/models.py<gh_stars>1-10
from tensorflow import keras
from util import ArcfaceLoss, inference_loss, identity_loss
import numpy as np
import os
import wn
weight_decay = 5e-4
H, W, C = (150, 300, 3)
nb_classes = 5004
lambda_c = 0.2
lr = 6e-4
feature_size = 512
final_a... | 2.015625 | 2 |
esercizi/stringaWhile.py | gdv/python-alfabetizzazione | 0 | 35814 | <filename>esercizi/stringaWhile.py
stringa = 'corso di Informatica'
i = 0
while (i < len(stringa)):
print stringa[i]
i = i + 1
| 2.765625 | 3 |
usbmon/capture/tests/test_usbpcap.py | Flameeyes/usbmon-tools | 17 | 35815 | # python
#
# Copyright 2020 The usbmon-tools Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 2.15625 | 2 |
10 - SQLAlchemy/app.py | cce24/Homework | 0 | 35816 | <filename>10 - SQLAlchemy/app.py
#Import Dependencies
import numpy as np
import pandas as pd
import datetime as dt
import sqlalchemy
from sqlalchemy.ext.automap import automap_base
from sqlalchemy.orm import Session
from sqlalchemy import create_engine, func
from flask import Flask, jsonify
#Set Engine
engine = create... | 3.015625 | 3 |
DLmodules/usermessage.py | egg0001/telegram-e-hentaiDL-bot | 7 | 35817 | #!/usr/bin/python3
#-----------------bot session-------------------
UserCancel = 'You have cancel the process.'
welcomeMessage = ('User identity conformed, please input gallery urls ' +
'and use space to separate them'
)
denyMessage = 'You are not the admin of this bot, conversatio... | 2.140625 | 2 |
ver1/cnn_crawler.py | euihyeonmoon/RiskManagement | 0 | 35818 | <gh_stars>0
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
import pandas as pd
url_list = []
title_list = []
summary_list = []
date_list = []
# source_list = []
url = 'https://edition.cnn.com/search?size=30&q=terror&sort=newest'
# keyword_list = ['terror']
# ... | 3.09375 | 3 |
tests/ec2/test_ec2_clients.py | paulhutchings/beartype-boto3-example | 3 | 35819 | <filename>tests/ec2/test_ec2_clients.py
import pytest
from bearboto3.ec2 import (
EC2Client,
EC2ServiceResource,
)
from beartype import beartype
from beartype.roar import (
BeartypeCallHintPepParamException,
BeartypeCallHintPepReturnException,
BeartypeDecorHintPep484585Exception,
)
# =============... | 2.1875 | 2 |
solutions/130_solution_05.py | UFResearchComputing/py4ai | 0 | 35820 | def first_negative(values):
for v in values:
if v<0:
return v
# If an empty list is passed to this function, it returns `None`:
my_list = []
print(first_negative(my_list)
| 3.609375 | 4 |
.config/qtile/modules/core/screens.py | jx11r/dotfiles | 7 | 35821 | # --==[ Screens ]==--
from libqtile import bar
from libqtile.config import Screen
from ..utils.settings import wallpaper
from ..extras.widgets import widgets
screens = [
Screen(
wallpaper = wallpaper,
wallpaper_mode = 'fill',
top = bar.Bar(
# Source in widgets.py
w... | 1.890625 | 2 |
MovieSerieTorrent/renamer.py | JonathanPetit/Parser-Renamer-torrentfile | 7 | 35822 | <reponame>JonathanPetit/Parser-Renamer-torrentfile
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Usage:
>>> from renamer import Renamer
>>> Renamer().rename(file)
"""
import os
from fuzzywuzzy import fuzz
try:
from parser import Parser
except:
from .parser import Parser
class Renamer:
... | 2.9375 | 3 |
tensorflow_transform/beam/tft_beam_io/beam_metadata_io_test.py | sswapnil2/transform | 0 | 35823 | # Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 1.9375 | 2 |
intermol/forces/torsion_torsion_CMAP.py | jpthompson17/InterMol | 0 | 35824 | from intermol.decorators import *
class TorsionTorsionCMAP(object):
@accepts_compatible_units(None, None, None, None, None, None, None, None,
None, None)
def __init__(self, atom1, atom2, atom3, atom4, atom5, atom6, atom7, atom8, type, chart):
"""
"""
self.type = type
... | 2.671875 | 3 |
opentech/apply/review/tests/test_models.py | JakabGy/hypha | 0 | 35825 | from django.test import TestCase
from opentech.apply.funds.tests.factories import ApplicationSubmissionFactory
from .factories import ReviewFactory, ReviewOpinionFactory
from ..options import MAYBE, NO, YES
class TestReviewQueryset(TestCase):
def test_reviews_yes(self):
submission = ApplicationSubmission... | 2.109375 | 2 |
FPLbot/starting_eleven.py | amosbastian/FantasyPL_bot | 54 | 35826 | import asyncio
import json
import os
from datetime import datetime, timedelta
import aiohttp
import tweepy
from dateutil.parser import parse
from fpl import FPL, utils
from pymongo import MongoClient
from constants import lineup_markers, twitter_usernames
dirname = os.path.dirname(os.path.realpath(__file__))
client =... | 2.421875 | 2 |
inputoutput/getters.py | den1den/web-inf-ret-ml | 0 | 35827 | <reponame>den1den/web-inf-ret-ml
import os
from datetime import date, timedelta
from config import config
from inputoutput.readers import CSVInputReader, InputReader, Input2000Reader
from models.article import Article
from models.tuser import TUser
from models.tweet import Tweet
TWEETS_DIR = os.path.join(config.PCLOU... | 2.421875 | 2 |
src/Config.py | jthomas03/gpSTS | 0 | 35828 | # -*- coding: utf-8 -*-
#
# <NAME> 2021 gpSTS
###########################################
###Configuration File######################
###for gpSTS steering of experiments######
###########################################
import os
import numpy as np
from gpsts.NanonisInterface.nanonis_interface import Nanonis
from gps... | 1.8125 | 2 |
src/basic/check_type.py | xxzhwx/hello-python | 0 | 35829 | <reponame>xxzhwx/hello-python<filename>src/basic/check_type.py
# -*- coding: utf-8 -*-
'''
@author: xxzhwx
'''
from types import IntType
def is_int_type(num):
# 对象身份比较
if type(num) is IntType:
return True
return False
def is_int_typeX(num):
if isinstance(num, int):
retur... | 3.46875 | 3 |
hwtLib/handshaked/ramAsHs_test.py | optical-o/hwtLib | 0 | 35830 | <filename>hwtLib/handshaked/ramAsHs_test.py<gh_stars>0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from hwt.hdl.constants import NOP, READ, WRITE
from hwt.interfaces.utils import addClkRstn, propagateClkRstn
from hwt.simulator.simTestCase import SingleUnitSimTestCase
from hwtLib.common_nonstd_interfaces.addr_data_h... | 2.046875 | 2 |
src/zenml/integrations/vertex/constants.py | dumpmemory/zenml | 0 | 35831 | # Copyright (c) ZenML GmbH 2022. 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:
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | 1.273438 | 1 |
backend/src/controllers/base_controller.py | tmdt-buw/gideon-ts | 0 | 35832 | <gh_stars>0
from typing import Generic, List, Optional, Type, TypeVar, Union, Dict, Any
from uuid import UUID
from fastapi import HTTPException
from fastapi.encoders import jsonable_encoder
from pydantic import BaseModel
from sqlalchemy.orm import Session
from src.db.sqlalchemy.database import Base
ModelType = TypeV... | 2.40625 | 2 |
models/squeezenet.py | LEE-SEON-WOO/network-slimming | 0 | 35833 | """squeezenet in pytorch
[1] <NAME>, <NAME>, <NAME>, <NAME>
squeezenet: Learning both Weights and Connections for Efficient Neural Networks
https://arxiv.org/abs/1506.02626
"""
import torch
import torch.nn as nn
from .channel_selection import channel_selection
class Fire(nn.Module):
def __init__(self... | 3.390625 | 3 |
mrjob/yelp_ratings_per_business.py | davelester/Yelp-Rating-and-Review-Trends | 1 | 35834 | <reponame>davelester/Yelp-Rating-and-Review-Trends<gh_stars>1-10
"""
Output a list of star ratings for each business ID
"""
from mrjob.job import MRJob
from mrjob.protocol import JSONValueProtocol
from itertools import izip
class MRRatingsPerBusinesses(MRJob):
INPUT_PROTOCOL = JSONValueProtocol
def mapper(self, _... | 2.84375 | 3 |
web/datasets/tasks.py | andressadotpy/maria-quiteria | 151 | 35835 | <filename>web/datasets/tasks.py
from datetime import datetime
from logging import info
from pathlib import Path
from typing import List
import requests
from celery import shared_task
from django.conf import settings
from django.contrib.admin.options import get_content_type_for_model
from requests import HTTPError
from... | 2 | 2 |
stubbs/defs/ustr.py | holy-crust/reclaimer | 0 | 35836 | from ...hek.defs.ustr import *
| 1.3125 | 1 |
src/json_helper/json_to_pandas.py | AidanFarhi/PythonFundamentals.Labs.PipModule | 0 | 35837 | <reponame>AidanFarhi/PythonFundamentals.Labs.PipModule<gh_stars>0
import json
import pandas as pd
import os
def read_json(file_path):
file = open(file_path, 'r')
data = json.load(file)
file.close()
return data
def read_all_json_files(JSON_ROOT):
df = pd.DataFrame() # create empty data frame
... | 3.5 | 4 |
shrike/pipeline/telemetry_utils.py | Anbang-Hu/shrike | 27 | 35838 | <filename>shrike/pipeline/telemetry_utils.py
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import logging
from opencensus.ext.azure.log_exporter import AzureLogHandler
log = logging.getLogger(__name__)
class TelemetryLogger:
"""Utils class for opencensus azure monitor"""
def __in... | 2.078125 | 2 |
langsense/core.py | sneub/langsense | 0 | 35839 | # -*- coding: utf-8 -*-
from . import ruleset
import re
import operator
class LangSense(object):
def detect(self, string, country_hint=None):
if type(string) == str:
text = string.decode('utf-8').lower()
else:
text = string.lower()
shortlist_char = self._char_shortlist(text)
shortlist_... | 2.84375 | 3 |
preprocess.py | sdc17/NaivePinYin | 0 | 35840 | #-*- coding : utf-8-*-
import os
import json
import yaml
import glob
import jieba
import pickle
import datetime
import argparse
from collections import Counter
from concurrent.futures import ProcessPoolExecutor, Executor, as_completed
def task_one_gram(news):
gram1 = {}
with open('./training/pinyin_table/一二... | 2.421875 | 2 |
src/testMultiRootWkspc/workspace5/remoteDebugger-start.py | ChaseKnowlden/vscode-jupyter | 2,461 | 35841 | <reponame>ChaseKnowlden/vscode-jupyter<filename>src/testMultiRootWkspc/workspace5/remoteDebugger-start.py
import sys
import time
def main():
sys.stdout.write('this is stdout')
sys.stdout.flush()
sys.stderr.write('this is stderr')
sys.stderr.flush()
# Give the debugger some time to add a breakpoint.... | 2.484375 | 2 |
rbb_tools/src/rbb_tools/simenvs/test.py | SK4P3/rbb_core | 55 | 35842 | # AMZ-Driverless
# Copyright (c) 2019 Authors:
# - <NAME> <<EMAIL>>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use,... | 2.140625 | 2 |
tests/test_data_models.py | haihabi/GenerativeCRB | 0 | 35843 | import unittest
import torch
import data_model as dm
import normflowpy as nf
from experiments import constants
def generate_model_dict():
return {constants.DIM: 4,
constants.THETA_MIN: 0.3,
constants.THETA_MAX: 10,
constants.SIGMA_N: 0.1,
}
class FlowToCRBTest(uni... | 2.640625 | 3 |
neutronclient/tests/unit/test_auth.py | asadoughi/python-neutronclient | 1 | 35844 | <reponame>asadoughi/python-neutronclient
# Copyright 2012 NEC Corporation
# All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/lice... | 1.804688 | 2 |
src/airobot/ee_tool/robotiq2f140_pybullet.py | weiqiao/airobot | 0 | 35845 | <reponame>weiqiao/airobot
import threading
import time
import airobot.utils.common as arutil
from airobot.ee_tool.ee import EndEffectorTool
from airobot.utils.arm_util import wait_to_reach_jnt_goal
class Robotiq2F140Pybullet(EndEffectorTool):
"""
Class for interfacing with a Robotiq 2F140 gripper when
it... | 2.34375 | 2 |
schrodinger2D.py | frostburn/quantum-pde | 0 | 35846 | <reponame>frostburn/quantum-pde
# coding: utf-8
from __future__ import division
import argparse
import os
import sys
from matplotlib.animation import FuncAnimation
from pylab import *
from flow import schrodinger_flow_2D
from util import normalize_2D, advance_pde
from lattice import make_lattice_2D, make_border_wal... | 2.46875 | 2 |
tests/numpy_unit_testing/test_function_binary_operator_true_divide.py | jiajiaxu123/Orca | 20 | 35847 | <reponame>jiajiaxu123/Orca
import unittest
from setup.settings import *
from numpy.testing import *
from pandas.util.testing import *
import numpy as np
import dolphindb_numpy as dnp
import pandas as pd
import orca
class FunctionTruedivideTest(unittest.TestCase):
@classmethod
def setUpClass(cls):
# co... | 2.765625 | 3 |
apps/loader/utils.py | PremierLangage/premierlangage | 8 | 35848 | import os
from django.conf import settings
def get_location(directory, path, current="", parser=None):
"""Returns a tuple (directory, path)
params:
- directory: [Directory] Directory containing the currently parsed file
- path: [str] Path to the file needed
... | 2.5 | 2 |
backend/venv/Lib/site-packages/github/tools/template.py | analurandis/Tur | 0 | 35849 | """
:Description: PasteScript Template to generate a GitHub hosted python package.
Let you set the package name, a one line description, the Licence (support
GPL, LGPL, AGPL and BSD - GPLv3 by default) and the author name, email and
organisation variables::
paster create -t gh_package <project name>
.. note::
... | 1.796875 | 2 |
app.py | cwh32/DiffCapAnalyzer | 0 | 35850 | <filename>app.py
import ast
import base64
import dash
import dash_core_components as dcc
from dash.dependencies import Input, Output, State
import dash_html_components as html
import dash_table as dt
import io
import json
from lmfit.model import load_modelresult
from lmfit.model import save_modelresult
import numpy as ... | 2.078125 | 2 |
Python_Advanced_Softuni/Tuples_And_Sets_Excercise/venv/sets_of_elements.py | borisboychev/SoftUni | 1 | 35851 | <gh_stars>1-10
(n,m) = [int(x) for x in input().split()]
loop_range = n + m
set_m = set()
set_n = set()
for _ in range(n):
set_n.add(int(input()))
for _ in range(m):
set_m.add(int(input()))
uniques = set_n.intersection(set_m)
[print(x) for x in (uniques)]
| 2.5625 | 3 |
netconf-cisco.py | Raul-Flores/Network-programmability-examples | 2 | 35852 | from ncclient import manager
from xml.dom import minidom
import xmltodict
huaweiautomation = {'address':'ios-xe-mgmt-latest.cisco.com',
'netconf_port': 10000, 'username': 'developer', 'password': '<PASSWORD>'}
huawei_manager = manager.connect(host = huaweiautomation["address"], port = huaweiautomation["netconf_port"... | 2.46875 | 2 |
pizza.py | purplefrizzel/PizzaTill | 0 | 35853 | <reponame>purplefrizzel/PizzaTill<filename>pizza.py
#!/usr/bin/python
# <NAME>
# <NAME>
import os
import sys
import time
import re
isProgramRuning = True
welcomeMessageDisplay = False
lastShownMenu = 0
order = { "pizzas": [] }
customer = { "customerName": None, "customerPhoneNumber": None, "customerAddress": { "pos... | 3.65625 | 4 |
code/lib.py | Pendra89/geom2020 | 1 | 35854 | import numpy as np
from numpy import array
from numpy.linalg import det
from numpy.linalg import matrix_rank
from numpy.linalg import solve
"""
*** remember the following useful tools***
from numpy import transpose
from numpy import dot
from numpy import argmax
from numpy import abs
from numpy.linalg import eig
fr... | 3.765625 | 4 |
text/symbols.py | roedoejet/FastSpeech2 | 7 | 35855 | <filename>text/symbols.py
""" from https://github.com/keithito/tacotron """
"""
Defines the set of symbols used in text input to the model.
The default is a set of ASCII characters that works well for English or text that has been run through Unidecode. For other data, you can modify _characters. See TRAINING_DATA.md... | 2.6875 | 3 |
11.Introduction to Databases in Python/Chapter 4 - Creating and Manipulating your own Databases.py | prakashcc/datacamp-python-data-science-track | 1 | 35856 | #Chapter 4 - Creating and Manipulating your own Databases
#*******************************************************************************************#
#Creating Tables with SQLAlchemy
# Import Table, Column, String, Integer, Float, Boolean from sqlalchemy
fr... | 3.875 | 4 |
archived-stock-trading-bot-v1/yf_extender.py | Allcallofduty10/stock-trading-bot | 101 | 35857 | <reponame>Allcallofduty10/stock-trading-bot
import sys
from datetime import datetime
import yfinance as yf
def get_ticker_symbol(ticker: yf.Ticker) -> str:
try:
return ticker.get_info()['symbol']
except ImportError:
return ""
def get_stock_state(ticker: yf.Ticker) -> {}:
stock_info = ti... | 2.9375 | 3 |
bill_backend/remedi_backend_processor.py | sarahjliu/remedi | 0 | 35858 | <gh_stars>0
# _____ _ _
# | __ \ | (_)
# | |__) |___ _ __ ___ ___ __| |_
# | _ // _ \ '_ ` _ \ / _ \/ _` | |
# | | \ \ __/ | | | | | __/ (_| | |
# |_| \_\___|_| |_| |_|\___|\__,_|_|
# Azure Vision API Key 1: 8ce845a5fcb44327aeed5dbd0debc2c0
# Azure ... | 2.34375 | 2 |
Level1/Lessons64061/minari.py | StudyForCoding/ProgrammersLevel | 0 | 35859 | <reponame>StudyForCoding/ProgrammersLevel
```python
def solution(board,moves):
basket=[]
answer=[]
for move in moves:
for i in range(len(board)): # range(len(board)) 에 있는 인형갯수만큼 반복
if board[i][move-1]>0: # board[][] 안에 인형이 존재할 때에만 실행하도록
basket.append(board[i][move-1])
... | 3.53125 | 4 |
Physics250-ME29/peakOutputVoltageGenerator.py | illusion173/Physics250 | 0 | 35860 | import numpy as np
import math
extraNumber = 4 * math.pi * pow(10,-7)
def introducedEMF():
freq = input("Input the frequency (Hz): ")
turns = input("Input how many turns of the squrare frame: ")
area = input("Input the area (m) (ignore the 10^-2): ")
magField = input("Input magnetic Field Ma... | 3.3125 | 3 |
functions/helpers/pagination.py | haynieresearch/unusual_options_activity | 0 | 35861 | <reponame>haynieresearch/unusual_options_activity
#**********************************************************
#* CATEGORY SOFTWARE
#* GROUP MARKET DATA
#* AUTHOR <NAME> <<EMAIL>>
#* DATE 2020-10-20
#* PURPOSE UNUSUAL OPTIONS ACTIVITY
#* FILE PAGINATION.PY
#**********************************************************
#*... | 2.125 | 2 |
glhooks/mailer/messages.py | miso-belica/gitlab-webhooks | 13 | 35862 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division, print_function, unicode_literals
from time import strftime, gmtime
from email.header import make_header
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
from .utils import strip_tags, for... | 2.625 | 3 |
network/LeNet.py | cersar/BasicNetwork | 4 | 35863 | <filename>network/LeNet.py
import tensorflow as tf
import numpy as np
from model.train import fit
from keras.datasets import mnist
def LeNet(input_shape):
iw,ih,c = input_shape
net = tf.Graph()
with net.as_default():
x = tf.placeholder(tf.float32,shape=(None,iw,ih,c),name='x')
y = tf.place... | 2.65625 | 3 |
_filament/__init__.py | comstud/filament | 2 | 35864 | <filename>_filament/__init__.py
from _filament.core import *
| 1.054688 | 1 |
modules/simulation/simulation.py | LHcau/scheduling-shared-passenger-and-freight-transport-on-a-fixed-infrastructure | 0 | 35865 | """
Module to execute the simulation for a given instance.
"""
""" import packages """
import logging
from importlib import import_module
import numpy.random as rdm
import copy
import numpy as np
""" import project configurations """
import configurations.settings_simulation as config
""" import project librar... | 3.1875 | 3 |
looking_for_group/discord/views.py | andrlik/looking-for-group | 0 | 35866 | <reponame>andrlik/looking-for-group
import requests
from allauth.socialaccount.providers.discord.views import DiscordOAuth2Adapter
from allauth.socialaccount.providers.oauth2.views import OAuth2CallbackView, OAuth2LoginView
from .permissions import Permissions
from .provider import DiscordProviderWithGuilds
# Create ... | 2.546875 | 3 |
src/page/rebasetrackingreview.py | darobin/critic | 1 | 35867 | # -*- mode: python; encoding: utf-8 -*-
#
# Copyright 2012 <NAME>, Opera Software ASA
#
# 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
#
# Unl... | 1.6875 | 2 |
parser.py | bitounu/startupy | 0 | 35868 | <reponame>bitounu/startupy<gh_stars>0
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# zależności Pythona: BeatifulSoup
# instalacja z pakietu
# Debian /Ubuntu: apt-get install python-bs4
# albo
# easy_install beautifulsoup4
# lub
# pip install beautifulsoup4
# skrypt robi spis firm ze stron mambiznes.pl
# i wypluwa C... | 2.4375 | 2 |
utils/checks.py | WJxReloaded/pkbt2 | 4 | 35869 | <filename>utils/checks.py
def no_delete(cmd):
cmd._delete_ctx = False
return cmd
| 1.289063 | 1 |
contratospr/contracts/manager.py | jycordero/contratospr-api | 15 | 35870 | <filename>contratospr/contracts/manager.py
from django.db import models
from .queryset import ContractQuerySet
class BaseContractManager(models.Manager):
def get_queryset(self):
return super().get_queryset().defer("search_vector")
ContractManager = BaseContractManager.from_queryset(ContractQuerySet)
| 2.046875 | 2 |
tests/integration/test_integration_article.py | pwitab/visma | 5 | 35871 | <reponame>pwitab/visma<filename>tests/integration/test_integration_article.py
import pytest
from visma.api import VismaClientException
from visma.models import Article, ArticleAccountCoding, Unit
class TestCRUDArticle:
@pytest.fixture()
def article(self):
article = Article.objects.all()[0]
y... | 2.3125 | 2 |
zdata.py | streemline/zmap-tools | 2 | 35872 | #!/usr/bin/env python3
import sys
import ujson as json
import json as json_orig
import traceback
import re
import argparse
import os.path
import operator
import requests
from threading import Thread
from queue import Queue
from requests.packages.urllib3.exceptions import InsecureRequestWarning
requests.packages.urllib... | 2.34375 | 2 |
tests/test_debianpkg.py | trathborne/nvchecker | 320 | 35873 | # MIT licensed
# Copyright (c) 2020 lilydjwg <<EMAIL>>, et al.
# Copyright (c) 2017 <NAME> <<EMAIL>>, et al.
from flaky import flaky
import pytest
pytestmark = [pytest.mark.asyncio, pytest.mark.needs_net]
@flaky(max_runs=10)
async def test_debianpkg(get_version):
assert await get_version("sigrok-firmware-fx2lafw"... | 1.828125 | 2 |
Post-Exploitation/LaZagne/Linux/lazagne/config/color.py | FOGSEC/TID3xploits | 5 | 35874 |
class bcolors():
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OK = '\033[92m'
WARNING = '\033[96m'
FAIL = '\033[91m'
TITLE = '\033[93m'
ENDC = '\033[0m'
| 1.9375 | 2 |
src/commands/trajectories.py | SpookyWoogin/robot2018 | 1 | 35875 | <reponame>SpookyWoogin/robot2018
import csv
import math
from wpilib import Timer
from wpilib.command import Command
from commands.statespace import StateSpaceDriveController
from data_logger import DataLogger
from pidcontroller import PIDController
from drivecontroller import DriveController
def read_trajectories(f... | 2.65625 | 3 |
yateto/codegen/test_framework.py | PhuNH/yateto | 0 | 35876 | <filename>yateto/codegen/test_framework.py
from abc import ABC, abstractmethod
class TestFramework(ABC):
@abstractmethod
def functionArgs(self, testName):
"""functionArgs.
:param testName: Name of test
"""
pass
@abstractmethod
def assertLessThan(self, x, y):
""... | 2.671875 | 3 |
shop_thienhi/utils/format_time.py | Lesson-ThienHi/thienhi_shop | 0 | 35877 | <reponame>Lesson-ThienHi/thienhi_shop
from datetime import datetime
def format_time_filter():
start_time = datetime.now().utcnow().replace(hour=0, minute=0, second=0, microsecond=0).timestamp()
end_time = datetime.utcnow().replace(second=0, microsecond=0).timestamp()
data = {
"start_time": start_ti... | 3.03125 | 3 |
Algorithms/PCA/solutions.py | lcbendall/numerical_computing | 0 | 35878 | import numpy as np
import matplotlib.pyplot as plt
from scipy import linalg as la
def PCA(dat, center=False, percentage=0.8):
M, N = dat.shape
if center:
mu = np.mean(dat,0)
dat -= mu
U, L, Vh = la.svd(dat, full_matrices=False)
V = Vh.T.conjugate()
SIGMA = np.diag(L)
X = U... | 3.046875 | 3 |
core/agent.py | liruiw/HCG | 3 | 35879 | # --------------------------------------------------------
# Licensed under The MIT License [see LICENSE for details]
# --------------------------------------------------------
import os
import torch
import torch.nn.functional as F
import numpy as np
from core import networks
from core.utils import *
from core.loss i... | 1.835938 | 2 |
environment.py | CorodescuMihnea/NnProject | 0 | 35880 | import gym
import datetime
import os
import numpy as np
from agent import DeepQAgent
def main():
env = gym.make("LunarLander-v2")
timestamp = '{:%Y-%m-%d-%H:%M}'.format(datetime.datetime.now())
o_dir = "LunarLander-v2/{}/models".format(timestamp)
if not os.path.exists(o_dir):
os.makedirs(o_d... | 2.625 | 3 |
tests/serialization/test_deserialization/flows/flow_template.py | dazzag24/prefect | 0 | 35881 | <reponame>dazzag24/prefect
import datetime
from prefect import task, Flow, Parameter
from prefect.engine.cache_validators import partial_parameters_only
from prefect.environments.execution import RemoteEnvironment
from prefect.environments.storage import Docker
from prefect.engine.result_handlers import JSONResultHand... | 2.0625 | 2 |
blog/models.py | wjhgg/DBlog | 0 | 35882 | <reponame>wjhgg/DBlog<filename>blog/models.py
# -*- coding: utf-8 -*-
import os
from django.contrib.auth.models import AbstractUser
from django.db import models
from django.conf import settings
# Create your models here.
# 用户
# class User(AbstractUser):
# u_name = models.CharField(max_length=20, verbose_name='昵称... | 2.21875 | 2 |
update_supply_chain_information/supply_chains/test/test_extract_csv.py | uktrade/update-supply-chain-information | 0 | 35883 | from io import StringIO
from typing import List
import os
import csv
import re
import pytest
from django.core.management import call_command
from django.core.management.base import CommandError
from django.core.files.temp import NamedTemporaryFile
import accounts.models
from supply_chains.management.commands.ingest_c... | 2.171875 | 2 |
8_1_error.py | stnguyenn/learnpy | 0 | 35884 | <reponame>stnguyenn/learnpy<filename>8_1_error.py
while True:
try:
x = int(input("Please enter a number: "))
break
except ValueError:
print("Oops! That was no valid number. Try again...")
class B(Exception):
pass
class C(B):
pass
class D(C):
pass
for cls in [B, C, D]:
... | 3.46875 | 3 |
TORS/visualizer/__init__.py | AlgTUDelft/cTORS | 5 | 35885 | <filename>TORS/visualizer/__init__.py<gh_stars>1-10
# This program has been developed by students from the bachelor Computer Science
# at Utrecht University within the Software and Game project course in 2019
# (c) Copyright Utrecht University (Department of Information and Computing Sciences)
# NOQA
| 1.296875 | 1 |
donkeycar/parts/lidar.py | bo-rc/donkeycar | 0 | 35886 | <filename>donkeycar/parts/lidar.py
"""
Lidar
"""
import time
import math
import pickle
import serial
import logging
import numpy as np
from donkeycar.utils import norm_deg, dist, deg2rad, arr_to_img
from PIL import Image, ImageDraw
class YdLidar(object):
'''
https://pypi.org/project/PyLidar3/
'''
def ... | 2.53125 | 3 |
engines/factory.py | valeoai/BEEF | 4 | 35887 | from bootstrap.lib.options import Options
from bootstrap.lib.logger import Logger
from .extract_engine import ExtractEngine
from .predict_engine import PredictEngine
def factory():
if Options()['engine']['name'] == 'extract':
engine = ExtractEngine()
elif Options()['engine']['name'] == 'predict... | 2.375 | 2 |
src/daipecore/decorator/tests/notebook_function_fixture.py | daipe-ai/daipe-core | 1 | 35888 | <filename>src/daipecore/decorator/tests/notebook_function_fixture.py
from daipecore.decorator.notebook_function import notebook_function
@notebook_function
def load_data():
return 155
| 1.273438 | 1 |
SNLI/encap_snli_bert.py | jind11/SememePSO-Attack | 74 | 35889 | <gh_stars>10-100
from SNLI_BERT import ModelTrainer
from SNLI_BERT import adjustBatchInputLen
from pytorch_transformers import BertTokenizer, BertModel, AdamW, WarmupLinearSchedule
from torch import nn
import torch
import config
class Model(nn.Module):
def __init__(self, inv_dict):
super(Model, self).__init... | 2.15625 | 2 |
learn/ML/tensor_flow/cifar_animals.py | nvkhedkar/python-code | 0 | 35890 | <reponame>nvkhedkar/python-code<filename>learn/ML/tensor_flow/cifar_animals.py
import tensorflow as tf
from tensorflow.keras import datasets, layers, models
import matplotlib.pyplot as plt
import sys
num_classes = 10
print("Num GPUs Available: ", len(tf.config.list_physical_devices('GPU')))
print("Num CPUs Available: ... | 3.234375 | 3 |
day-02/part-2/jules.py | lypnol/adventofcode-2017 | 16 | 35891 | from submission import Submission
class JulesSubmission(Submission):
def run(self, s):
# :param s: input in string format
# :return: solution flag
# your solution code goes here
def find_for_row(row):
for fi in range(len(row)):
for si in range(fi + 1, l... | 3.25 | 3 |
nrw/aachen.py | risklayer/corona-landkreis-crawler | 12 | 35892 | #!/usr/bin/python3
## Tommy
from botbase import *
_aachen_c = re.compile(r"eit Ende Februar 2020 (?:wurden beim Robert.Koch.Institut \(RKI\) )?insgesamt ([0-9.]+)")
_aachen_d = re.compile(r"Die Zahl der gemeldeten Todesfälle liegt bei ([0-9.]+)")
_aachen_a = re.compile(r"Aktuell sind ([0-9.]+) Menschen nachgewiesen")
... | 2.6875 | 3 |
src/evaluate_massive.py | jamescporter/MACH-Pytorch | 1 | 35893 | from mach_utils import *
import logging
from argparse import ArgumentParser
from fc_network import FCNetwork
import tqdm
from dataset import XCDataset,XCDataset_massive
import json
from typing import Dict, List
from trim_labels import get_discard_set
from xclib.evaluation import xc_metrics
from xclib.data import data_u... | 2.15625 | 2 |
src/predict.py | cdc08x/automated-flight-diversion-detection | 0 | 35894 | <reponame>cdc08x/automated-flight-diversion-detection
import logging
predictLogger = logging.getLogger(__name__)
def predictDiversion(trajectory, classification, decfunout, threshold):
severities = computeSeverities(trajectory, decfunout, threshold)
(diversionDetections, firstDetectionIndex) = catchDive... | 2.875 | 3 |
data_collection/gazette/spiders/sc_chapeco.py | kaiocp/querido-diario | 454 | 35895 | from gazette.spiders.base.fecam import FecamGazetteSpider
class ScChapecoSpider(FecamGazetteSpider):
name = "sc_chapeco"
FECAM_QUERY = "cod_entidade:71"
TERRITORY_ID = "4204202"
| 1.40625 | 1 |
ros/src/tl_detector/light_classification/tl_classifier.py | bogdan-kovalchuk/CarND-Capstone | 0 | 35896 | <reponame>bogdan-kovalchuk/CarND-Capstone<filename>ros/src/tl_detector/light_classification/tl_classifier.py
from styx_msgs.msg import TrafficLight
import cv2
import numpy as np
import tensorflow as tf
from keras.models import load_model
import os
class TLClassifier(object):
def __init__(self):
s... | 2.828125 | 3 |
engine/src/hopeit/server/api.py | leosmerling/hopeit.engine | 0 | 35897 | <reponame>leosmerling/hopeit.engine
"""
Open API spec creation and server helpers
"""
import json
import re
from copy import deepcopy
from functools import partial
from pathlib import Path
from typing import Dict, List, Tuple, Type, Optional, Callable, Awaitable, Union
from datetime import date, datetime
from aiohttp ... | 1.601563 | 2 |
testing/nxtpython_x_motion.py | ArVID220u/lego3dcopier | 0 | 35898 | <reponame>ArVID220u/lego3dcopier<gh_stars>0
#!/usr/bin/env python3
from xmovement import XMovement
import nxt
brick = nxt.locator.find_one_brick(debug=True)
realport = nxt.motor.PORT_A
print("START")
#motor.debug_info()
xmovement = XMovement(realport, brick)
try:
while True:
position = int(input(... | 2.75 | 3 |
appreview/migrations/0001_initial.py | IsaiahKe/awward-mimic | 0 | 35899 | <reponame>IsaiahKe/awward-mimic
# Generated by Django 3.2.7 on 2021-09-22 09:28
import cloudinary.models
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import phonenumber_field.modelfields
class Migration(migrations.Migration):
initial = True
depe... | 1.867188 | 2 |