seq_id
string
text
string
repo_name
string
sub_path
string
file_name
string
file_ext
string
file_size_in_byte
int64
program_lang
string
lang
string
doc_type
string
stars
int64
dataset
string
pt
string
api
list
33110564706
# -*- coding: utf-8 -*- """Methods for expression module The expression parser will look up functions on the ExpressionMethods class here so long as the function name is prefixed with f_, e.g. f_ceil for the ceil() function. Use the @coerce decorator to cause type coercion based on the signature to take place. If t...
ThreatConnect-Inc/threatconnect-playbooks
apps/TCPB_-_Expressions/src/methods.py
methods.py
py
58,991
python
en
code
66
github-code
21
[ { "api_name": "tcex.utils.date_utils.DatetimeUtils", "line_number": 64, "usage_type": "call" }, { "api_name": "inspect.signature", "line_number": 98, "usage_type": "call" }, { "api_name": "typing.get_args", "line_number": 117, "usage_type": "call" }, { "api_name":...
38951256888
# -*- coding: utf-8 -*- import os import sys import numpy as np import time import pickle import networkx as nx from collections import defaultdict import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt sys.path.append('.') from .tools import pklLoad def load_graph(dataset_name, graph_datadir, self...
zcrwind/tgg-pytorch
utils/graph_utils.py
graph_utils.py
py
2,608
python
en
code
23
github-code
21
[ { "api_name": "matplotlib.use", "line_number": 11, "usage_type": "call" }, { "api_name": "sys.path.append", "line_number": 14, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 14, "usage_type": "attribute" }, { "api_name": "os.path.join", "line...
34233844149
import urllib.request, urllib.parse, urllib.error from bs4 import BeautifulSoup # Get the URL from the user url = input("Enter URL: ") # Read the HTML from the URL html = urllib.request.urlopen(url).read() # Parse the HTML using BeautifulSoup soup = BeautifulSoup(html, 'html.parser') # Find all span tags tags = sou...
rabayarabu/python-programming-coursera
scrappingnumbers.py
scrappingnumbers.py
py
722
python
en
code
0
github-code
21
[ { "api_name": "urllib.request.request.urlopen", "line_number": 8, "usage_type": "call" }, { "api_name": "urllib.request.request", "line_number": 8, "usage_type": "attribute" }, { "api_name": "urllib.request", "line_number": 8, "usage_type": "name" }, { "api_name":...
20825313193
import typing as tp from aiohttp import web from app.api.v1 import currency_codes from app.api.v1 import currency_rate_difference from app.api.v1 import ping from app.context import AppContext def wrap_handler( handler: tp.Callable[[web.Request, AppContext], tp.Awaitable[web.Response]], context: App...
sabsubsib/curr_diff_api
app/routes.py
routes.py
py
907
python
en
code
1
github-code
21
[ { "api_name": "typing.Callable", "line_number": 12, "usage_type": "attribute" }, { "api_name": "aiohttp.web.Request", "line_number": 12, "usage_type": "attribute" }, { "api_name": "aiohttp.web", "line_number": 12, "usage_type": "name" }, { "api_name": "app.context...
39950591802
import sys, re import numpy as np from collections import Counter, defaultdict from functools import lru_cache def ints(inp: str = None): return map(int, re.findall(r"-?\d+", inp or sys.stdin.read())) def floats(inp: str = None): return map(float, re.findall(r"-?\d+(?:\.\d*)?", inp or sys.stdin.read())) AMIN...
theevann/advent-of-code
2021/day_22/sol.py
sol.py
py
5,523
python
en
code
1
github-code
21
[ { "api_name": "re.findall", "line_number": 7, "usage_type": "call" }, { "api_name": "sys.stdin.read", "line_number": 7, "usage_type": "call" }, { "api_name": "sys.stdin", "line_number": 7, "usage_type": "attribute" }, { "api_name": "re.findall", "line_number":...
72729413172
from bs4 import BeautifulSoup import nltk nltk.download('punkt') import numpy as np import pickle from nltk.util import ngrams from collections import Counter INDEX="./pickles/" file_content = open("wiki_47",encoding="utf8").read() all_docs = file_content.split("</doc>") #Soup was originally utilised to re...
darkknight314/Vector-Based-IR-system
Part 2 Improvement 2/index_creation.py
index_creation.py
py
5,720
python
en
code
0
github-code
21
[ { "api_name": "nltk.download", "line_number": 3, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 13, "usage_type": "call" }, { "api_name": "nltk.word_tokenize", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.log10", "...
22599664171
from django.contrib.gis import admin from django import forms from django.contrib.admin import TabularInline,StackedInline, ModelAdmin from models import * from auxilliaryModels import * from forms import MflcForm class LanguageAdmin(admin.OSMGeoAdmin): pass class EtymologyInline(StackedInline): model...
kingsdigitallab/aema-django
aema_db/admin.py
admin.py
py
22,408
python
en
code
0
github-code
21
[ { "api_name": "django.contrib.gis.admin.OSMGeoAdmin", "line_number": 10, "usage_type": "attribute" }, { "api_name": "django.contrib.gis.admin", "line_number": 10, "usage_type": "name" }, { "api_name": "django.contrib.admin.StackedInline", "line_number": 14, "usage_type": ...
23388356037
# -*- coding: utf-8 -*- """ Created on Fri Aug 12 11:19:34 2016 @author: raul """ import matplotlib.pyplot as plt import xpol_tta_analysis as xta from rvtools import discrete_cmap import numpy as np from matplotlib import rcParams rcParams['xtick.labelsize'] = 15 rcParams['ytick.labelsize'] = 15 rcParams['axes.labelsi...
rvalenzuelar/xpol_vis
figure_paper_za_distributions_4x2.py
figure_paper_za_distributions_4x2.py
py
4,082
python
en
code
0
github-code
21
[ { "api_name": "matplotlib.rcParams", "line_number": 12, "usage_type": "name" }, { "api_name": "matplotlib.rcParams", "line_number": 13, "usage_type": "name" }, { "api_name": "matplotlib.rcParams", "line_number": 14, "usage_type": "name" }, { "api_name": "xpol_tta_...
33471554727
import json from collections import OrderedDict as ODict if __name__ == '__main__': new_jsons = { 'title': '', 'events': [] } keys = { "start_date": [ "year", "month", "day", "hour", "minute", "second", "millisecond", "format", ...
0xyd/VisualJusticeTW
scripts/pyscripts/json2TimlineJson.py
json2TimlineJson.py
py
2,630
python
en
code
65
github-code
21
[ { "api_name": "json.load", "line_number": 58, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 133, "usage_type": "call" } ]
40754945013
import json import requests from devices.base import Device class Notifier(Device): def __init__(self, name, key): super(Notifier, self).__init__(name) self.id = id self.key = key def notify(self, msg): res = requests.post("https://api.parse.com/1/functions/notify", ...
whouweling/yelena
devices/notifier.py
notifier.py
py
944
python
en
code
1
github-code
21
[ { "api_name": "devices.base.Device", "line_number": 7, "usage_type": "name" }, { "api_name": "requests.post", "line_number": 15, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 16, "usage_type": "call" } ]
1734364533
import os import logging import splunklib.client as client import splunklib.results as results from splunklib.binding import handler as base_handler import random import time import threading import re from urllib.parse import urlparse splunk = None def connect(): global splunk if not splunk: app_nam...
splunk/deep-learning-toolkit
app/bin/dltk/test/splunk_api.py
splunk_api.py
py
5,361
python
en
code
15
github-code
21
[ { "api_name": "os.getenv", "line_number": 18, "usage_type": "call" }, { "api_name": "splunklib.binding.handler", "line_number": 20, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 21, "usage_type": "call" }, { "api_name": "urllib.parse.urlparse",...
79621793
from enum import Enum import collections from random import shuffle, choice class Action: # type: FOLD, CHECK_OR_CALL, CALL_AND_RAISE def __init__(self, type="FOLD", money=0): self.type = type self.money = money def is_FOLD(self): return self.type == "FOLD" def is_CHECK_OR_CA...
sjyjytu/Holdem
NetworkVersion/utils.py
utils.py
py
5,514
python
en
code
3
github-code
21
[ { "api_name": "enum.Enum", "line_number": 22, "usage_type": "name" }, { "api_name": "collections.namedtuple", "line_number": 29, "usage_type": "call" }, { "api_name": "collections.namedtuple", "line_number": 69, "usage_type": "call" }, { "api_name": "random.shuffl...
14367914471
import argparse import json import logging import os import random import math import multiprocessing import trimesh import torch import numpy as np from collections import defaultdict import core STATUS_INDICATOR = None def reconstruct( decoder, num_iterations, latent_size, break_latent_size, ...
Terascale-All-sensing-Research-Studio/DeepJoin
deepjoin/python/reconstruct_single.py
reconstruct_single.py
py
16,497
python
en
code
9
github-code
21
[ { "api_name": "torch.ones", "line_number": 49, "usage_type": "call" }, { "api_name": "torch.ones", "line_number": 50, "usage_type": "call" }, { "api_name": "torch.normal", "line_number": 52, "usage_type": "call" }, { "api_name": "torch.normal", "line_number": ...
18750190695
from typing import Dict, List, Optional, TYPE_CHECKING import logging import os import sys import yaml sys.path.insert(0, os.path.dirname(__file__)) import __meta__ # noqa # isort: skip # pylint: disable AIU_PACKAGE_DIR = os.path.abspath(os.path.dirname(__file__)) AIU_ROOT_DIR = os.path.dirname(AIU_PACKAGE_DIR) A...
fmigneault/aiu
aiu/__init__.py
__init__.py
py
2,264
python
en
code
2
github-code
21
[ { "api_name": "sys.path.insert", "line_number": 7, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 7, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path", "line_number...
21829506507
from collections import defaultdict from copy import deepcopy import cPickle import datetime import operator import os import random import sys import time class Dim(): """ A dimension object has dimensions in tuple, list of diameter in each dimension. diam is the diameter of the network, which is the sho...
yulunli/COMP432
src/NetworkSimulation/network_model.py
network_model.py
py
13,369
python
en
code
0
github-code
21
[ { "api_name": "copy.deepcopy", "line_number": 44, "usage_type": "call" }, { "api_name": "operator.mul", "line_number": 96, "usage_type": "attribute" }, { "api_name": "random.random", "line_number": 138, "usage_type": "call" }, { "api_name": "collections.defaultdic...
17325929849
from django.conf.urls import patterns, include, url from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', # On include() Django will forward the url to the URLConf object chopping # the part that matched initially. So for example in this case won't send # /polls/<whatever>, but...
guillermo-carrasco/django-tutorial
django_tutorial/urls.py
urls.py
py
463
python
en
code
0
github-code
21
[ { "api_name": "django.contrib.admin.autodiscover", "line_number": 4, "usage_type": "call" }, { "api_name": "django.contrib.admin", "line_number": 4, "usage_type": "name" }, { "api_name": "django.conf.urls.patterns", "line_number": 6, "usage_type": "call" }, { "api...
33225532707
import cv2 import face_recognition import pickle from datetime import datetime import streamlit as st import pandas as pd import time from streamlit.components.v1 import html import os import cv2 import dlib import imutils import streamlit as st from imutils import face_utils import math from sklearn imp...
aniket-aggarwal/face_recognition-
newu.py
newu.py
py
9,312
python
en
code
1
github-code
21
[ { "api_name": "dlib.get_frontal_face_detector", "line_number": 29, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 34, "usage_type": "call" }, { "api_name": "os.path", "line_number": 34, "usage_type": "attribute" }, { "api_name": "streamlit....
25535487137
import requests import base64 import time import hmac import os import hashlib import pandas as pd import json from requests.exceptions import HTTPError from datetime import datetime import math def write_to_log(*data): if data: dt_string = datetime.now().strftime("%d/%m/%Y %H:%M:%S") with open("t...
cryptomilk2021/kucoin-lending
loan.py
loan.py
py
13,881
python
en
code
0
github-code
21
[ { "api_name": "datetime.datetime.now", "line_number": 16, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 16, "usage_type": "name" }, { "api_name": "math.floor", "line_number": 26, "usage_type": "call" }, { "api_name": "pandas.DataFrame",...
2095079991
import torch import torch.nn as nn from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence import pickle HIDDENSIZE = 256 DEVICE = torch.device("cuda") def get_vocab_size(): token_maps = pickle.load(open("../data/token_map.pk", "rb")) return {'chinese': len(token_maps[0]), 'english': len(tok...
xiaozhouwang/attent2translate
seq2seq.py
seq2seq.py
py
9,211
python
en
code
1
github-code
21
[ { "api_name": "torch.device", "line_number": 8, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": 11, "usage_type": "call" }, { "api_name": "torch.nn.Module", "line_number": 15, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_num...
22950706481
import base64 from subprocess import CalledProcessError from threading import Event, Thread import src.contracts.ethereum.message as message from src.contracts.ethereum.multisig_wallet import MultisigWallet from src.contracts.secret.secret_contract import swap_query_res from src.db.collections.management import Manage...
levackt/EthereumBridge
src/leader/eth/leader.py
leader.py
py
3,190
python
en
code
0
github-code
21
[ { "api_name": "threading.Thread", "line_number": 14, "usage_type": "name" }, { "api_name": "src.contracts.ethereum.multisig_wallet.MultisigWallet", "line_number": 24, "usage_type": "name" }, { "api_name": "src.util.config.Config", "line_number": 24, "usage_type": "name" ...
36051170487
import discord from discord import app_commands from discord.ext import commands from spacecat.helpers import constants from spacecat.helpers import perms class Dad(commands.Cog): """A minor annoyance and a pinch of fun""" def __init__(self, bot): self.bot = bot self.toggle = True @comma...
mizarc/spacecat-discord-bot
spacecat/modules/dad.py
dad.py
py
1,725
python
en
code
1
github-code
21
[ { "api_name": "discord.ext.commands.Cog", "line_number": 9, "usage_type": "attribute" }, { "api_name": "discord.ext.commands", "line_number": 9, "usage_type": "name" }, { "api_name": "discord.ext.commands.Cog.listener", "line_number": 15, "usage_type": "call" }, { ...
17056894963
import logging import shlex import uuid from flask import Flask, jsonify, request, send_from_directory, send_file, abort from werkzeug.exceptions import HTTPException from flask_cors import CORS from flask_api import FlaskAPI from functools import wraps from threading_more import intercept_exit_signal """ Serves the...
autopi-io/autopi-core
src/salt/base/ext/_engines/api_service.py
api_service.py
py
6,163
python
en
code
142
github-code
21
[ { "api_name": "logging.getLogger", "line_number": 18, "usage_type": "call" }, { "api_name": "flask_api.FlaskAPI", "line_number": 20, "usage_type": "call" }, { "api_name": "flask_cors.CORS", "line_number": 23, "usage_type": "call" }, { "api_name": "werkzeug.excepti...
31165538866
""" Implements the cli definition, which at the moment is just returning a parser. """ import argparse from .utils_pkg import list_names def get_parser(): """ Get an argument parser instance with all subparsers set up :return: and argument parser :rtype: argparse.ArgumentParser """ ...
nfrancque/Constraint-Manager
constraint_manager/cli.py
cli.py
py
3,565
python
en
code
0
github-code
21
[ { "api_name": "argparse.ArgumentParser", "line_number": 18, "usage_type": "call" }, { "api_name": "utils_pkg.list_names", "line_number": 39, "usage_type": "call" } ]
10955216304
import numpy as np import mediapipe as mp import cv2 ############################ Func ############################ def GetPoint(landmarks): arr = np.zeros((21, 3)) for ind, mark in enumerate(landmarks.landmark): arr[ind, 0] = mark.x arr[ind, 1] = mark.y arr[ind, 2] = mark.z retu...
sppool/Wolverine
Wolverine.py
Wolverine.py
py
2,887
python
en
code
6
github-code
21
[ { "api_name": "numpy.zeros", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 22, "usage_type": "call" }, { "api_name": "cv2.line", "line_number": 56, "usage_type": "call" }, { "api_name": "cv2.line", "line_number": 58, ...
27493231470
import random import nltk nltk.download('reuters') nltk.download('punkt') nltk.download('stopwords') nltk.download('wordnet') nltk.download('omw-1.4') from nltk.corpus import reuters from nltk import word_tokenize from nltk.corpus import stopwords from nltk import WordNetLemmatizer import sklearn from sklearn.featu...
emilienGallet/TextMining
main.py
main.py
py
1,737
python
en
code
0
github-code
21
[ { "api_name": "nltk.download", "line_number": 5, "usage_type": "call" }, { "api_name": "nltk.download", "line_number": 6, "usage_type": "call" }, { "api_name": "nltk.download", "line_number": 7, "usage_type": "call" }, { "api_name": "nltk.download", "line_numb...
6400360526
from __future__ import print_function from collections import defaultdict from glob import glob #truth_by_sample = {} entries_by_sample = defaultdict(dict) samples = set() transcript_list = ''' ENST00000270310 ENST00000588265 ENST00000586063 ENST00000380346 ENST00000380347 ENST00000375825 ENST00000375824 ENST0000047...
smc-rna-challenge/SMC-RNA-Eval
isoform-robustness/do.py
do.py
py
4,126
python
en
code
0
github-code
21
[ { "api_name": "collections.defaultdict", "line_number": 6, "usage_type": "call" }, { "api_name": "glob.glob", "line_number": 38, "usage_type": "call" }, { "api_name": "itertools.combinations", "line_number": 88, "usage_type": "call" }, { "api_name": "random.shuffl...
13047853375
import numpy as np import pandas as pd import scipy import tensorflow as tf from cavachon.utils.DataFrameUtils import DataFrameUtils from sklearn.preprocessing import LabelEncoder from typing import Dict, Iterable, List, Optional, Tuple class TensorUtils: """TensorUtils Class containing multiple util...
dn070017/CAVACHON
cavachon/utils/TensorUtils.py
TensorUtils.py
py
8,661
python
en
code
0
github-code
21
[ { "api_name": "typing.Iterable", "line_number": 17, "usage_type": "name" }, { "api_name": "tensorflow.keras", "line_number": 17, "usage_type": "attribute" }, { "api_name": "tensorflow.keras", "line_number": 35, "usage_type": "attribute" }, { "api_name": "typing.Li...
33106328045
from django.db.models.signals import pre_delete, pre_save from django.dispatch import receiver from django.conf import settings import os from .models import Product def remove_images(image_path: str) -> None: """Remove the old product images""" try: image_name = os.path.splitext(os.path.basename(imag...
hamk-webdev-intip21a6/lainakoodarit_project
borrow/signals.py
signals.py
py
1,592
python
en
code
1
github-code
21
[ { "api_name": "os.path.splitext", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.path.basename", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path.join", "li...
22548683299
from stegano import * import base64 import os from datetime import datetime from os.path import exists def encode_file_into_picture(): filename = input("\n[->] Enter file: ") if not exists(filename): print("\n[+][" + datetime.now().strftime("%H:%M:%S") + "] File was not found!") return imag...
OliverVranak/BP
tools/encode_file.py
encode_file.py
py
1,534
python
en
code
0
github-code
21
[ { "api_name": "os.path.exists", "line_number": 9, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 10, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 10, "usage_type": "name" }, { "api_name": "os.path.exists"...
70737463414
import pyzbar.pyzbar as pyzbar import cv2 import argparse class Detector_image: def scan(self,address): image = cv2.imread(address) bars = pyzbar.decode(image) for bar in bars: (x,y,w,h) = bar.rect cv2.rectangle(image,(x,y),(x+w,y+h),(0,0,255),2)...
Anmol-tech/Barcode-Scanner-with-Gui
barcode_image/barcode_image.py
barcode_image.py
py
732
python
en
code
0
github-code
21
[ { "api_name": "cv2.imread", "line_number": 10, "usage_type": "call" }, { "api_name": "pyzbar.pyzbar.decode", "line_number": 12, "usage_type": "call" }, { "api_name": "pyzbar.pyzbar", "line_number": 12, "usage_type": "name" }, { "api_name": "cv2.rectangle", "li...
17452039743
from django.contrib import admin from django.contrib.auth.admin import UserAdmin from django.utils.safestring import mark_safe from users.models import Users, Departments, Avatars, JobTitles class UsersAdmin(UserAdmin): """ Класс содержит аргументы, которые будут влиять на форму отображения таблицы в адм...
isv160179/CorpWeb
users/admin.py
admin.py
py
2,699
python
en
code
0
github-code
21
[ { "api_name": "django.contrib.auth.admin.UserAdmin", "line_number": 8, "usage_type": "name" }, { "api_name": "users.models.Users", "line_number": 13, "usage_type": "name" }, { "api_name": "django.utils.safestring.mark_safe", "line_number": 66, "usage_type": "call" }, ...
34854930182
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sat Feb 8 01:41:28 2020 @author: laura """ import numpy as np import matplotlib.pyplot as plt global p0,q0,r0,s,m,gama,alfa,beta,delta,xi,b,d,mi #####parametros###### p0,q0,r0,s,m,gama=.20,.30,0.0001,10.,1.,0.01 ##s=10. ou 0.01 alfa,beta,delta,teta=0.052...
Arualriel/Controle-Otimo-para-Tratamentos-de-cancer
semcontrole.py
semcontrole.py
py
2,320
python
en
code
0
github-code
21
[ { "api_name": "numpy.log", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.matrix", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 29, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 3...
41000783940
""" Normalization layers. """ import torch from torch import nn import torch.nn.functional as F from ..utils import get_num_channels, get_num_dims class LayerNorm(nn.Module): """ Layer normalization layer. Works with both `channels_first` and `channels_last` format. """ def __init__(self, num_features=None,...
analysiscenter/batchflow
batchflow/models/torch/layers/normalization.py
normalization.py
py
2,511
python
en
code
194
github-code
21
[ { "api_name": "torch.nn.Module", "line_number": 10, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 10, "usage_type": "name" }, { "api_name": "torch.nn.Parameter", "line_number": 17, "usage_type": "call" }, { "api_name": "torch.nn", "line...
13306340944
from selenium import webdriver from webdriver_manager.chrome import ChromeDriverManager driver = webdriver.Chrome(ChromeDriverManager().install()) #instaluje sterownik (potrzebne doinstalowanie menagera) driver.get("https://demos.telerik.com/kendo-ui/dragdrop/index") driver.maximize_window() small_element = ...
pawrol/test_exercises
drag_and_drop.py
drag_and_drop.py
py
509
python
en
code
0
github-code
21
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 4, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 4, "usage_type": "name" }, { "api_name": "webdriver_manager.chrome.ChromeDriverManager", "line_number": 4, "usage_type": "call" }, {...
24959579567
import matplotlib.pyplot as plt import numpy as np #%% sleeping = [6,5,7,6,8,7,9] playing = [2,2,2,2,3,3,3] eating = [2,2,2,2,2,2,2] studying = [11,13,12,11,12,9,11] my_activities = ['sleeping','playing','eating','studying'] slides = [sum(sleeping),sum(playing),sum(eating),sum(studying)] plt.pie(slides,labels=my_a...
srimani-programmer/Data-Visualization
Basics/PieCharts.py
PieCharts.py
py
397
python
en
code
0
github-code
21
[ { "api_name": "matplotlib.pyplot.pie", "line_number": 12, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 12, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.axis", "line_number": 13, "usage_type": "call" }, { "api_name": "matplo...
27291521742
import cv2 cap= cv2.VideoCapture('Video/outfile.mp4') cap.set(3, 50) cap.set(4, 30) while True: success, frame = cap.read() #_, frame = vs.read() (w, h, c) = frame.shape #syntax: cv2.resize(img, (width, height)) img = cv2.resize(frame,(800, 600)) grey= cv2.cvtColor(img,cv2.COLOR_BGR2GRAY) p...
klyuevaa/Trinity
video.py
video.py
py
826
python
en
code
0
github-code
21
[ { "api_name": "cv2.VideoCapture", "line_number": 3, "usage_type": "call" }, { "api_name": "cv2.resize", "line_number": 15, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 16, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRAY", "lin...
39648222
import os import numpy as np import matplotlib.pyplot as plt import imageio def saveGif(matrixList,gifFileName,clearFrames=True): filenames=[] for i,m in enumerate(matrixList): # plot the line chart #plt.plot(y[:i]) plt.imshow(np.squeeze(m), extent=[-180,180,-90,90]) #minx maxx miny m...
mauriciodev/tec_forecast
extra/plot_time_series.py
plot_time_series.py
py
1,253
python
en
code
8
github-code
21
[ { "api_name": "matplotlib.pyplot.imshow", "line_number": 13, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 13, "usage_type": "name" }, { "api_name": "numpy.squeeze", "line_number": 13, "usage_type": "call" }, { "api_name": "matplotlib.p...
40960329115
import web import test from todo_app import todo from blog_app import blog import os # 指定模板目录 render = web.template.render('templates') # 连接数据库 db = web.database(dbn='mysql', user='root', pw='123456', db='test',host='90b514053e09c9c7.c.cloudtogo.cn',port=38008) # 定义网页的所有地址 urls = ( '/','Index', '/test',test.a...
redisread/webpy
main.py
main.py
py
954
python
en
code
0
github-code
21
[ { "api_name": "web.template.render", "line_number": 8, "usage_type": "call" }, { "api_name": "web.template", "line_number": 8, "usage_type": "attribute" }, { "api_name": "web.database", "line_number": 10, "usage_type": "call" }, { "api_name": "test.app_test", ...
1689110489
import numpy as np import pandas as pd import random import pickle import os.path import threading import tensorflow as tf import os from utils import ParamsBase from multiprocessing import Lock from utils import EmptyLock # dqn params class DQN_PARAMS(ParamsBase): def __init__(self, stateSize, numActions, laye...
natangold85/IAIAI_RL_vizdoom
utils_dqn.py
utils_dqn.py
py
21,207
python
en
code
0
github-code
21
[ { "api_name": "utils.ParamsBase", "line_number": 17, "usage_type": "name" }, { "api_name": "numpy.exp", "line_number": 53, "usage_type": "call" }, { "api_name": "tensorflow.variable_scope", "line_number": 74, "usage_type": "call" }, { "api_name": "tensorflow.place...
38720847716
import pandas as pd import sklearn import math from sklearn import preprocessing from sklearn.linear_model import LinearRegression import numpy as np from sklearn.model_selection import train_test_split import matplotlib.pyplot as plt import pickle all_data = pd.read_csv('Apple.csv', sep=',', header=0) all_data = al...
marcolau68/Python_Stock_Price_Predictor
Apple_Stock_Price_Short.py
Apple_Stock_Price_Short.py
py
3,954
python
en
code
0
github-code
21
[ { "api_name": "pandas.read_csv", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 29, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.scale", "line_number": 30, "usage_type": "call" }, { "api_name": "sklearn.prepr...
72909405172
from functools import wraps # import json # from simplejson import JSONDecodeError import colander from flask import request # from zvooq.web.response import BadParams # from zvooq.range import RangeInfo, PageBasedRangeInfo class TopLevelMapping(colander.Mapping): def _impl(self, node, value, callback): ...
dnox/simplevalidator
validator.py
validator.py
py
8,290
python
en
code
0
github-code
21
[ { "api_name": "colander.Mapping", "line_number": 12, "usage_type": "attribute" }, { "api_name": "colander.null", "line_number": 23, "usage_type": "attribute" }, { "api_name": "colander.Invalid", "line_number": 27, "usage_type": "attribute" }, { "api_name": "coland...
36148368260
import requests, traceback from datetime import datetime, timedelta from flask import Blueprint, request, current_app, jsonify blueprint = Blueprint('api', __name__, url_prefix='/api') @blueprint.route('/get_weather', methods=['GET']) def get_weather(): # Get the city from the query parameters city = request....
NikitaPatel29/WeatherAPP_SCP
weather/api.py
api.py
py
4,326
python
en
code
0
github-code
21
[ { "api_name": "flask.Blueprint", "line_number": 5, "usage_type": "call" }, { "api_name": "flask.request.args.get", "line_number": 10, "usage_type": "call" }, { "api_name": "flask.request.args", "line_number": 10, "usage_type": "attribute" }, { "api_name": "flask.r...
30762450347
from tkinter import * from tkinter.colorchooser import askcolor import sys, os, string, time from PIL import Image, ImageDraw import tkinter tk = tkinter class Paint(): DEFAULT_PEN_SIZE = 5.0 DEFAULT_COLOR = 'black' def __init__(self): self.root = Tk() self.root.title("Simple Gui") ...
Angelvicks/Final-yr-project
software/project.py
project.py
py
7,189
python
en
code
0
github-code
21
[ { "api_name": "PIL.Image.new", "line_number": 93, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 93, "usage_type": "name" }, { "api_name": "PIL.ImageDraw.Draw", "line_number": 94, "usage_type": "call" }, { "api_name": "PIL.ImageDraw", "line_...
12126854041
from fastapi import FastAPI, Request from fastapi.middleware.gzip import GZipMiddleware from fastapi.staticfiles import StaticFiles from fastapi.templating import Jinja2Templates from fastapi.responses import HTMLResponse, RedirectResponse from starlette.exceptions import HTTPException as StarletteHTTPException a...
wwalterr/dailly-interface
source/application.py
application.py
py
1,331
python
en
code
0
github-code
21
[ { "api_name": "fastapi.FastAPI", "line_number": 13, "usage_type": "call" }, { "api_name": "fastapi.staticfiles.StaticFiles", "line_number": 18, "usage_type": "call" }, { "api_name": "fastapi.middleware.gzip.GZipMiddleware", "line_number": 20, "usage_type": "argument" },...
2428341490
""" Downloads all archive files for stackexchange from: https://archive.org/download/stackexchange Requires: pip install sentence-transformers for the download """ from sentence_transformers import util import os with open('download_archive_file_list.tsv') as fIn: for line in fIn: name = line.strip().sp...
nreimers/flax-sentence-embeddings
dataset_list/stackexchange/download_archive.py
download_archive.py
py
644
python
en
code
26
github-code
21
[ { "api_name": "os.path.join", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path", "line_number": 16, "usage_type": "attribute" }, { "api_name": "os.path.exists", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path", "line_number":...
36065040130
from pycparser.c_ast import For, If, Switch, While from checks._check import Check from utils.error_handling import BuErrors sub_stmt = [For, If, Switch, While] class IndentLevels(Check): tc = None flag_lines = [] line = 0 def __init__(self, file_name, path, header_lines): self.message = s...
aureliancnx/Bubulle-Norminette
bubulle-py/checks/indent_levels.py
indent_levels.py
py
5,676
python
en
code
54
github-code
21
[ { "api_name": "pycparser.c_ast.For", "line_number": 6, "usage_type": "name" }, { "api_name": "pycparser.c_ast.If", "line_number": 6, "usage_type": "name" }, { "api_name": "pycparser.c_ast.Switch", "line_number": 6, "usage_type": "name" }, { "api_name": "pycparser....
28794529735
""" Файл с описанием базы данных, всех сущностей и их поведений """ import enum import json import os import secrets import sys from datetime import datetime, timedelta from inspect import isclass from pathlib import Path from typing import List, Union, Dict, Any, Type, Callable, Set from warnings import warn from mat...
merdovash/VisitCount
DataBase2/__init__.py
__init__.py
py
58,539
python
en
code
0
github-code
21
[ { "api_name": "sys.modules", "line_number": 42, "usage_type": "attribute" }, { "api_name": "os.path.basename", "line_number": 46, "usage_type": "call" }, { "api_name": "os.path", "line_number": 46, "usage_type": "attribute" }, { "api_name": "pathlib.Path", "li...
74508843894
import datetime from apscheduler.schedulers.background import BackgroundScheduler import tzlocal from project.models import Book, Log from project import db, app # a method which runs both on startup and at 12am, ensures the overdue logs are updated as such def check_if_overdue(): with app.app_context(): a...
DannGlenn/Library-Management-Website
project/scheduler.py
scheduler.py
py
1,058
python
en
code
1
github-code
21
[ { "api_name": "project.app.app_context", "line_number": 9, "usage_type": "call" }, { "api_name": "project.app", "line_number": 9, "usage_type": "name" }, { "api_name": "project.models.Book", "line_number": 10, "usage_type": "argument" }, { "api_name": "project.db....
33827199623
import threading import serial import time import iCOMOX_messages import helpers import common class class_iCOMOX_Communication: def __init__(self, comm_port, callback_get_msg_size, callback_process_message, baudrate=115200, callback_open=None, callback_close=None, duration_of_break_us=0,...
ambith/comoxgui
iCOMOX_communication.py
iCOMOX_communication.py
py
9,006
python
en
code
0
github-code
21
[ { "api_name": "serial.Serial", "line_number": 12, "usage_type": "call" }, { "api_name": "serial.EIGHTBITS", "line_number": 15, "usage_type": "attribute" }, { "api_name": "serial.PARITY_NONE", "line_number": 16, "usage_type": "attribute" }, { "api_name": "serial.ST...
30349400840
import numpy as np from pyzbar.pyzbar import decode import cv2 import time #import rclpy import pickle import os from CBRbase.crossdetection import aply_filters, find_potentials, verify ARUCO_DICT = { "DICT_5X5_50": cv2.aruco.DICT_5X5_50, "DICT_5X5_100": cv2.aruco.DICT_5X5_100, "DICT_5X5_250": cv2.aruco.DICT_5...
SkyRats/marker_detection
scripts/markerdetection.py
markerdetection.py
py
12,431
python
en
code
0
github-code
21
[ { "api_name": "cv2.aruco", "line_number": 13, "usage_type": "attribute" }, { "api_name": "cv2.aruco", "line_number": 14, "usage_type": "attribute" }, { "api_name": "cv2.aruco", "line_number": 15, "usage_type": "attribute" }, { "api_name": "cv2.aruco", "line_nu...
9647569637
import requests import newspaper from newspaper import Article from newspaper.network import multithread_request import xml.etree.ElementTree as ET import json import re from multiprocessing.dummy import Pool as ThreadPool import time import random def GetTxt(url,language ='ru'): """! Парсер новостей для форм...
theisub/SmartFeed
Back/working_with_news/NewsFetch.py
NewsFetch.py
py
2,553
python
ru
code
1
github-code
21
[ { "api_name": "newspaper.Article", "line_number": 23, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 35, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 55, "usage_type": "call" }, { "api_name": "xml.etree.ElementTree.fromstrin...
3567257907
# ------------------------------------------------------------------------------ # Functions for registering and processing tags. # ------------------------------------------------------------------------------ import html import re from . import nodes from . import parsers from . import utils # Use the Pygments mo...
dmulholl/syntext
syntext/tags.py
tags.py
py
9,220
python
en
code
50
github-code
21
[ { "api_name": "re.fullmatch", "line_number": 41, "usage_type": "call" }, { "api_name": "html.escape", "line_number": 110, "usage_type": "call" }, { "api_name": "pygments.lexers.get_lexer_by_name", "line_number": 155, "usage_type": "call" }, { "api_name": "pygments...
4656239847
#!/usr/bin/env python # coding: utf-8 # pylint: disable=C0413 #^^Disables import order warnings because i cannot get rid of them # pylint: disable=W0105 #^^ Disables "Pointless" String Statements Warning ''' GRaSS: GESDISC Regridding and Subsetting System Previously: LRS-8/ MEDSAR Updated 02-23-2022 Developer: Maggie...
mtrimp2/GDDS_regridder
grass/grass.py
grass.py
py
19,229
python
en
code
0
github-code
21
[ { "api_name": "warnings.filterwarnings", "line_number": 16, "usage_type": "call" }, { "api_name": "sys.dont_write_bytecode", "line_number": 28, "usage_type": "attribute" }, { "api_name": "json.load", "line_number": 46, "usage_type": "call" }, { "api_name": "xarray...
40245157648
# initi script to load all configuration and set application parameters from flask import Flask from flask_cors import CORS from flask_restplus import Api import logging import logging.config import yaml import json import os import pymongo def load_json_file(file_path): # load credentials with open(file_pat...
kplecko/ucd_msc_project
analyticsAI/__init__.py
__init__.py
py
2,032
python
en
code
0
github-code
21
[ { "api_name": "json.load", "line_number": 17, "usage_type": "call" }, { "api_name": "pymongo.MongoClient", "line_number": 23, "usage_type": "call" }, { "api_name": "logging.error", "line_number": 26, "usage_type": "call" }, { "api_name": "os.path.dirname", "li...
13167566445
import pandas as pd import numpy as np from tqdm import tqdm # df_nor = pd.read_csv('newdata/normal-SchedIoMemoryOom.csv', low_memory=False)[:10000] # # 加上一列,全部为0 # df_nor['label'] = 0 # df_oom = pd.read_csv('newdata/H-IO-SchedIoMemoryOom.csv', low_memory=False)[:10000] # # 加上一列,全部为0 # df_oom['label'] = 1 # df_io = ...
JiaHuann/openEuler-ECS-proj
src/ML/xgboost/train.py
train.py
py
3,800
python
en
code
0
github-code
21
[ { "api_name": "pandas.read_csv", "line_number": 22, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 26, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 30, "usage_type": "call" }, { "api_name": "pandas.read_csv", ...
2920164780
import time from pathlib import Path from telegram.ext import Application from telegram_bot.all_handler import AllHandler from telegram_bot.bot_instance import BOT_TOKEN from telegram_bot.callbacks.main_callback.main_dispatcher_callback import ( dispatcher_callback, ) def create_volume_folders(): volume_pat...
chemradio/cta-gfx-helper
bot_engine/main.py
main.py
py
1,091
python
en
code
2
github-code
21
[ { "api_name": "pathlib.Path", "line_number": 14, "usage_type": "call" }, { "api_name": "telegram_bot.bot_instance.BOT_TOKEN", "line_number": 33, "usage_type": "name" }, { "api_name": "telegram_bot.bot_instance.BOT_TOKEN", "line_number": 35, "usage_type": "argument" }, ...
41606504689
import os import sys import pickle import glob import numpy as np import matplotlib.pyplot as plt import cv2 from common import num_from_byte_array, mkdir, f2s, FOCAL_S import struct from focal import focal_to_spike try: x = xrange(1) except: xrange = range def read_img_file(filename, start_idx = 0, max_num_i...
chanokin/convert_to_roc
mnist_convert.py
mnist_convert.py
py
6,010
python
en
code
0
github-code
21
[ { "api_name": "common.num_from_byte_array", "line_number": 28, "usage_type": "call" }, { "api_name": "common.num_from_byte_array", "line_number": 35, "usage_type": "call" }, { "api_name": "common.num_from_byte_array", "line_number": 41, "usage_type": "call" }, { "...
31071469393
# -*- coding: utf-8 -*- import string import itertools from math import sqrt import numpy as np LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' def roaming(): #reading file fin = open('C:/Users/Vamp/myceaser/message.txt', 'r') fout = open('C:/Users/Vamp/myceaser/cipher.txt', 'w') fout.write('thanks for...
vampvaibhav/advance-cryptography
bifid.py
bifid.py
py
3,158
python
en
code
0
github-code
21
[ { "api_name": "itertools.islice", "line_number": 59, "usage_type": "call" }, { "api_name": "time.clock", "line_number": 67, "usage_type": "call" }, { "api_name": "time.clock", "line_number": 82, "usage_type": "call" }, { "api_name": "time.clock", "line_number"...
34845905233
from django.conf.urls import url from . import views app_name = "moonstuff" urlpatterns = [ url(r'^$', views.dashboard, name='dashboard'), url(r'^scan/$', views.add_scan, name='add_scan'), url(r'^track/$', views.add_character, name='add_character'), url(r'^info/(?P<moon_id>[0-9]+)/$', views.moon_info...
staropera/aa-moonstuff
moonstuff/urls.py
urls.py
py
342
python
en
code
0
github-code
21
[ { "api_name": "django.conf.urls.url", "line_number": 8, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 9, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 10, "usage_type": "call" }, { "api_name": "django.c...
34582828610
import jieba import jieba.analyse jieba.initialize() jieba.load_userdict('models/dicts/stocks.txt') jieba.load_userdict('models/dicts/finance_terms.txt') def tfidf(sent, model='default'): if not hasattr(tfidf, 'models'): tfidf.models = {} if model not in tfidf.models: if model in ['news']: tfidf.mo...
zhulux/nlpservice
algorithm/docsim/__init__.py
__init__.py
py
637
python
en
code
2
github-code
21
[ { "api_name": "jieba.initialize", "line_number": 4, "usage_type": "call" }, { "api_name": "jieba.load_userdict", "line_number": 5, "usage_type": "call" }, { "api_name": "jieba.load_userdict", "line_number": 6, "usage_type": "call" }, { "api_name": "jieba.analyse.T...
28403341861
#Inteligencia que dados unos numeros hechos a mano, los reconozca y los vaya arrastrando # a la caja de numeros que le corresponde sean un 5 o un 3 #Vamos a hacer un reconocimiento de numeros import pyautogui import time import pyperclip time.sleep(2) #1.---->Reconocimiento de pantalla<--- #captura de pantalla pya...
IkerKa/PythonProjects
Others/recognizer.py
recognizer.py
py
1,911
python
es
code
0
github-code
21
[ { "api_name": "time.sleep", "line_number": 11, "usage_type": "call" }, { "api_name": "pyautogui.screenshot", "line_number": 15, "usage_type": "call" }, { "api_name": "pyautogui.locateOnScreen", "line_number": 28, "usage_type": "call" }, { "api_name": "pyautogui.lo...
7996743542
from django.test import TestCase, Client from model_bakery import baker class BaseTestSpecViewTestCase(TestCase): """A base test case for the test spec views.""" def setUp(self): """Create/force login a dummy manager user in order to access the view.""" self.manager_user = baker.make("User") ...
plomgrading/plom
plom_server/SpecCreator/tests/views/base_view_test_case.py
base_view_test_case.py
py
550
python
en
code
10
github-code
21
[ { "api_name": "django.test.TestCase", "line_number": 5, "usage_type": "name" }, { "api_name": "model_bakery.baker.make", "line_number": 10, "usage_type": "call" }, { "api_name": "model_bakery.baker", "line_number": 10, "usage_type": "name" }, { "api_name": "model_...
42954315740
from langchain.document_loaders import TextLoader from langchain.prompts import PromptTemplate from langchain.vectorstores import AwaDB from langchain.text_splitter import RecursiveCharacterTextSplitter from langchain.llms import LlamaCpp from langchain.chains import RetrievalQA import time # 1: 加载本地关于《流浪地球2》的电影介绍文章...
awa-ai/awadb
examples/llama.cpp/test_retrieval_qa.py
test_retrieval_qa.py
py
3,043
python
en
code
136
github-code
21
[ { "api_name": "langchain.document_loaders.TextLoader", "line_number": 12, "usage_type": "call" }, { "api_name": "langchain.vectorstores.AwaDB.from_documents", "line_number": 15, "usage_type": "call" }, { "api_name": "langchain.vectorstores.AwaDB", "line_number": 15, "usag...
42992637481
# -*- coding: utf-8 -*- """ # Exercicio 1 A proposta do exercício é coletar os dados dos sorteios da Lotofácil disponibilizados pela CEF e responder as seguintes perguntas: - Qual o número mais sorteado e o menos sorteado? - Quais combinações de números Pares(p), Impares(i) e Primos(np) saem por sorteio? """ # Import...
agails/How-Bootcamp-Engenharia-de-Dados
Module 1/module1.py
module1.py
py
6,087
python
pt
code
2
github-code
21
[ { "api_name": "requests.get", "line_number": 19, "usage_type": "call" }, { "api_name": "pandas.read_html", "line_number": 22, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 184, "usage_type": "call" }, { "api_name": "pandas.DataFrame",...
42122056638
import sys import docx import xlrd, xlwt from PyQt5.QtWidgets import QApplication, QWidget, QVBoxLayout, QPushButton, QLabel, QFileDialog, QTextEdit class FileDialogDemo(QWidget): def __init__(self): super().__init__() self.setWindowTitle("File Dialog demo") self.setGeometry(300, 300, 300, ...
YuanXianguo/Python-Project-ITC
GUI学习/01PyQt5快速开发与实战/ch04基本窗口控件/_422QFileDialog_office.py
_422QFileDialog_office.py
py
3,746
python
en
code
1
github-code
21
[ { "api_name": "PyQt5.QtWidgets.QWidget", "line_number": 6, "usage_type": "name" }, { "api_name": "PyQt5.QtWidgets.QVBoxLayout", "line_number": 11, "usage_type": "call" }, { "api_name": "PyQt5.QtWidgets.QPushButton", "line_number": 13, "usage_type": "call" }, { "ap...
12751665548
from telegram import KeyboardButton, ReplyKeyboardMarkup from eusoffbot.response import Response from eusoffbot.mealbot import MealBot from eusoffbot.eventbot import EventBot from eusoffbot.publicationbot import PublicationBot eventBot = EventBot() publicationBot = PublicationBot() mealBot = MealBot() def getRespo...
isbobby/eusofftelebot
eusoffbot/mastermind.py
mastermind.py
py
3,521
python
en
code
1
github-code
21
[ { "api_name": "eusoffbot.eventbot.EventBot", "line_number": 9, "usage_type": "call" }, { "api_name": "eusoffbot.publicationbot.PublicationBot", "line_number": 10, "usage_type": "call" }, { "api_name": "eusoffbot.mealbot.MealBot", "line_number": 11, "usage_type": "call" ...
18285789099
import pandas as pd import regex as re import matplotlib matplotlib.use('pdf') from matplotlib import pyplot as plt def sample_label(unit, change=False): ''' 将输入的表格做成dataframe mouths越大越接近死亡 :param unit: :return: ''' mouths = unit.columns.size unit = unit.dropna(axis=0, h...
ms201420201029/good_scripts
good_script/py/plot_useful_species.py
plot_useful_species.py
py
6,683
python
en
code
1
github-code
21
[ { "api_name": "matplotlib.use", "line_number": 4, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 30, "usage_type": "call" }, { "api_name": "regex.compile", "line_number": 72, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.style....
73034142133
#!/usr/bin/python3 import os, os.path, re, json, time import subprocess from functools import wraps from flask import Flask, request, render_template, abort, Response, send_from_directory, make_response import auth, utils, multiprocessing.pool from mailconfig import get_mail_users, get_mail_users_ex, get_admins, ad...
LiuFang816/SALSTM_py_data
python/mail-in-a-box_mailinabox/mailinabox-master/management/daemon.py
daemon.py
py
21,105
python
en
code
9
github-code
21
[ { "api_name": "utils.load_environment", "line_number": 15, "usage_type": "call" }, { "api_name": "auth.KeyAuthService", "line_number": 17, "usage_type": "call" }, { "api_name": "os.readlink", "line_number": 22, "usage_type": "call" }, { "api_name": "os.path.join",...
70505940852
# -*- coding: utf-8 -*- """ Created on Thu Jan 23 22:51:23 2020 @author: Ben """ import numpy as np import band_fitting_routines as bandfitr import plotting_routines as plotr import matplotlib.pyplot as plt n_charges = 2 f0_bare = 5.757E9 fc = 54.8E9 fj = 14.9E9 phizp = 0.0878776 ng0 = 0.65 phi0 = np.pi/2.0 n_point...
RimbergLab-Dartmouth/Python-codebase
Ben_code/theory/simulate_6th_order_nonlinearity.py
simulate_6th_order_nonlinearity.py
py
1,098
python
en
code
0
github-code
21
[ { "api_name": "numpy.pi", "line_number": 20, "usage_type": "attribute" }, { "api_name": "numpy.linspace", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 23, "usage_type": "call" }, { "api_name": "band_fitting_routines.dfC...
921306653
from psrdada import Reader import h5py import numpy as np import sysv_ipc import struct def unpack_message(dat): """ Takes candidate metadata sent via System V IPC message queue from heimdall and decodes it to be used in python. """ first_idx = struct.unpack('Q', dat[0][:8])[0] snr = struct.unpack('f', dat[0]...
dsa110/dsa110-pyutils
dsautils/dada_h5pyfile.py
dada_h5pyfile.py
py
3,547
python
en
code
2
github-code
21
[ { "api_name": "struct.unpack", "line_number": 14, "usage_type": "call" }, { "api_name": "struct.unpack", "line_number": 15, "usage_type": "call" }, { "api_name": "struct.unpack", "line_number": 16, "usage_type": "call" }, { "api_name": "struct.unpack", "line_n...
27037055813
import re from nltk.corpus import stopwords from konlpy.tag import Okt sentences = [] f = open('./ko_novel', encoding='utf-8-sig') f = f.readlines() for s in f: sentences.append(s.strip()) sentences[:5] okt = Okt() stop_words=['은','는','이','가', '하','아','것','들','의','있','되','수','보','주','등','한','그', '나'] def preproces...
dobbytk/NLP_study
Multicampus/NLP/day19/ko_novel.py
ko_novel.py
py
2,004
python
en
code
0
github-code
21
[ { "api_name": "konlpy.tag.Okt", "line_number": 12, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 18, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 58, "usage_type": "call" } ]
70309685174
import matplotlib.pyplot as plt from . import backend_kwarg_defaults, backend_show, create_axes_grid, matplotlib_kwarg_dealiaser from ...distplot import plot_dist from ...plot_utils import _scale_fig_size def plot_bf( ax, bf_10, bf_01, prior, posterior, ref_val, prior_at_ref_val, post...
arviz-devs/arviz
arviz/plots/backends/matplotlib/bfplot.py
bfplot.py
py
1,829
python
en
code
1,461
github-code
21
[ { "api_name": "plot_utils._scale_fig_size", "line_number": 39, "usage_type": "call" }, { "api_name": "distplot.plot_dist", "line_number": 51, "usage_type": "call" }, { "api_name": "distplot.plot_dist", "line_number": 59, "usage_type": "call" }, { "api_name": "matp...
26189724816
import socket import time from GlobalVar import globalVar import logging logging.basicConfig(level=logging.DEBUG) UDP_PORT = 11451 globalVar.init() def get_host_ip(): so = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) so.connect(("10.255.255.255", 1)) return str(so.getsockname()[0]) def make_broadca...
orthogonalkk/MaixBoard
BroadcastControl/broadcast_process.py
broadcast_process.py
py
1,224
python
en
code
1
github-code
21
[ { "api_name": "logging.basicConfig", "line_number": 6, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 6, "usage_type": "attribute" }, { "api_name": "GlobalVar.globalVar.init", "line_number": 9, "usage_type": "call" }, { "api_name": "GlobalVa...
33339830894
from universal_sentence_vectorizer import ContentVectorizer from sklearn.metrics.pairwise import cosine_similarity from tf_idf_vectorizer import tf_idf_model import pandas as pd import json from sqlalchemy import create_engine class project_sim(object): def __init__(self): with open('project_list.json') a...
GRMDS/Project_Recommender
project_sim.py
project_sim.py
py
3,332
python
en
code
0
github-code
21
[ { "api_name": "json.load", "line_number": 12, "usage_type": "call" }, { "api_name": "json.load", "line_number": 14, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 15, "usage_type": "call" }, { "api_name": "universal_sentence_vectorizer.Co...
14460719478
import matplotlib import numpy as np import pandas as pd import matplotlib.pyplot as plt from matplotlib.colors import ListedColormap from sklearn import neighbors from sklearn import metrics from sklearn.model_selection import train_test_split import progressbar as pb import joblib class clsKNN: def visualizeData(...
iamanuj03/AnomalyDetectionSystemWithML
AnomalyDetectionSystemWithML/Anomaly detection in road traffic/MLScripts/clsKNN.py
clsKNN.py
py
6,359
python
en
code
0
github-code
21
[ { "api_name": "pandas.read_csv", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.meshgrid", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 24, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure"...
71383327732
import configparser import logging import json import datetime import evelink from flask import Flask, render_template, request, redirect, url_for from flask.ext.cache import Cache from libs.utils import Utils, format_currency from libs.pi_utils import PiUtils from libs.losses_utils import LossesUtils from libs.a...
Cightline/evemint
main.py
main.py
py
6,742
python
en
code
0
github-code
21
[ { "api_name": "json.load", "line_number": 20, "usage_type": "call" }, { "api_name": "evelink.eve.EVE", "line_number": 23, "usage_type": "call" }, { "api_name": "evelink.eve", "line_number": 23, "usage_type": "attribute" }, { "api_name": "flask.Flask", "line_nu...
34116232051
from __future__ import annotations import os from textwrap import dedent import flake8 from pytest_flake8_path import Flake8Result # Prevent Flake8 from running in dev mode because it returns some problems os.environ.pop("PYTHONDEVMODE", None) def test_windows_path_normalization(): result = Flake8Result( ...
adamchainz/pytest-flake8-path
tests/test_pytest_flake8_path.py
test_pytest_flake8_path.py
py
3,396
python
en
code
3
github-code
21
[ { "api_name": "os.environ.pop", "line_number": 11, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 11, "usage_type": "attribute" }, { "api_name": "pytest_flake8_path.Flake8Result", "line_number": 15, "usage_type": "call" }, { "api_name": "textwr...
19026537086
from ..flock import Flock from ..boid import Boid from nose.tools import assert_equal from mock import patch, call def test_constructor(): num_boids=50 test_flock=Flock(num_boids) assert_equal(num_boids,test_flock.num_boids) assert_equal(num_boids,len(test_flock.boids)) def test_updateBoids(): nu...
samstern/Boids
Boids/tests/test_flock.py
test_flock.py
py
2,133
python
en
code
0
github-code
21
[ { "api_name": "flock.Flock", "line_number": 8, "usage_type": "call" }, { "api_name": "nose.tools.assert_equal", "line_number": 9, "usage_type": "call" }, { "api_name": "nose.tools.assert_equal", "line_number": 10, "usage_type": "call" }, { "api_name": "mock.patch....
31189366887
# # @lc app=leetcode.cn id=207 lang=python3 # # [207] 课程表 # # @lc code=start # 超时了 # class Solution: # def canFinish(self, numCourses: int, prerequisites) -> bool: # if not prerequisites: # return True # from collections import defaultdict # graph = defaultdict(list) # m...
Interesting6/FuckLeetCode
207.课程表.py
207.课程表.py
py
4,282
python
en
code
0
github-code
21
[ { "api_name": "collections.defaultdict", "line_number": 52, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 93, "usage_type": "call" }, { "api_name": "collections.deque", "line_number": 99, "usage_type": "call" } ]
72512175093
from django.contrib import admin from .models import DynamicConfig # Register your models here. @admin.register(DynamicConfig) class DynamicConfigAdmin(admin.ModelAdmin): list_display = ("id", 'key', 'value', 'value_type', "is_show", "desc") list_filter = ('value_type', "is_show") search_fields = ('key',...
aansheng/django-dynamic-config
django_dynamic_config/admin.py
admin.py
py
322
python
en
code
1
github-code
21
[ { "api_name": "django.contrib.admin.ModelAdmin", "line_number": 8, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 8, "usage_type": "name" }, { "api_name": "django.contrib.admin.register", "line_number": 7, "usage_type": "call" }, { ...
22037698881
import json import requests import time base_url='https://wolfesneck.farmos.net/farm/sensor/listener/' public_key='PUBLIC_KEY' private_key='PRIVATE_KEY' url=base_url+public_key+'?private_key='+private_key headers = {'Content-type':'application/json', 'Accept':'application/json'} payload ={"switch_0...
p-v-o-s/farmos-sensors
python/push_code.py
push_code.py
py
489
python
en
code
0
github-code
21
[ { "api_name": "requests.post", "line_number": 16, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 16, "usage_type": "call" } ]
4980188474
from django import template from django.forms import BoundField from utils.utils import get_logger register = template.Library() @register.inclusion_tag(filename='fields/field.html') def field_group(bound_field: BoundField, label: str = None, required: bool = None, **kwargs): """ Группа для поля ...
AlexanderMelory/Hodor-doors-shop
utils/templatetags/fields.py
fields.py
py
1,175
python
en
code
0
github-code
21
[ { "api_name": "django.template.Library", "line_number": 6, "usage_type": "call" }, { "api_name": "django.template", "line_number": 6, "usage_type": "name" }, { "api_name": "django.forms.BoundField", "line_number": 10, "usage_type": "name" }, { "api_name": "utils.u...
18627908852
from dm_control import composer from dm_control.composer.observation import observable from dm_control import mjcf from dm_control.rl.control import Environment from math import sqrt, pi, sin, cos import matplotlib.pyplot as plt from random import randint import numpy as np class FallingPolygonTask(composer.NullTask)...
ishank-juneja/Online-Model-Selection
src/pymjcf/regular_polygons.py
regular_polygons.py
py
7,430
python
en
code
2
github-code
21
[ { "api_name": "dm_control.composer.NullTask", "line_number": 11, "usage_type": "attribute" }, { "api_name": "dm_control.composer", "line_number": 11, "usage_type": "name" }, { "api_name": "dm_control.composer.Entity", "line_number": 21, "usage_type": "attribute" }, { ...
30544772858
import discord from replit import db import os import giphy_client from giphy_client.rest import ApiException import random import asyncio import csv intents = discord.Intents(messages=True, guilds=True, members=True) prayer=False client=discord.Client(intents=intents) participants=[] players =[] battleon=False partc...
appezi/DavoBot
Functions/battle.py
battle.py
py
2,582
python
en
code
0
github-code
21
[ { "api_name": "discord.Intents", "line_number": 10, "usage_type": "call" }, { "api_name": "discord.Client", "line_number": 13, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 19, "usage_type": "attribute" }, { "api_name": "replit.db.keys", "...
32594749140
import json from odoo import exceptions from odoo.tools import mute_logger from odoo.addons.website.tools import MockRequest from .common import CommonCase class DBLoggingCaseBase(CommonCase): @classmethod def setUpClassVars(cls, *args, **kwargs): super().setUpClassVars(*args, **kwargs) cls...
nguyenductamlhp/servermns
addons/wms/shopfloor/tests/test_db_logging.py
test_db_logging.py
py
9,341
python
en
code
0
github-code
21
[ { "api_name": "common.CommonCase", "line_number": 11, "usage_type": "name" }, { "api_name": "odoo.addons.website.tools.MockRequest", "line_number": 32, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 117, "usage_type": "call" }, { "api_name": "o...
1359181986
""" Run unbiased evaluation of neural models Run Lambdamart model training, testing, and unbiased evaluation """ import os import sys import argparse import gzip import random import glob import numpy as np from collections import defaultdict def str2bool(val): ''' parse bool type input parameters ''' if v...
kepingbi/EmailSearch
preprocess/lambdamart_unbiased_eval.py
lambdamart_unbiased_eval.py
py
14,787
python
en
code
0
github-code
21
[ { "api_name": "argparse.ArgumentTypeError", "line_number": 22, "usage_type": "call" }, { "api_name": "os.system", "line_number": 59, "usage_type": "call" }, { "api_name": "os.system", "line_number": 61, "usage_type": "call" }, { "api_name": "os.system", "line_...
28470753175
import struct import binascii import dns.rdata import dns.rdatatype class DSBase(dns.rdata.Rdata): """Base class for rdata that is like a DS record @ivar key_tag: the key tag @type key_tag: int @ivar algorithm: the algorithm @type algorithm: int @ivar digest_type: the digest type @type...
nophora/Datasets
datasets/dsbase.py
dsbase.py
py
2,304
python
en
code
9
github-code
21
[ { "api_name": "dns.rdata.rdata", "line_number": 9, "usage_type": "attribute" }, { "api_name": "dns.rdata", "line_number": 9, "usage_type": "name" }, { "api_name": "dns.rdata.rdata._hexify", "line_number": 36, "usage_type": "call" }, { "api_name": "dns.rdata.rdata"...
24713170193
import matplotlib.gridspec as gridspec from matplotlib import pyplot as plt import source_manager import sql_persister def show_person_faces(persister, person_id): faces = persister.get_person_faces(person_id) num_images = min((16, len(faces))) rows = 4 cols = max(int(num_images / rows),1) num_...
etashkinov/lifemile
extractor/displayer.py
displayer.py
py
1,503
python
en
code
0
github-code
21
[ { "api_name": "matplotlib.pyplot.title", "line_number": 17, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 17, "usage_type": "name" }, { "api_name": "matplotlib.gridspec.GridSpec", "line_number": 18, "usage_type": "call" }, { "api_name":...
31418705350
''' source: http://www.djangosnippets.org/snippets/1033/ A minor remix of simon's debug footer: http://www.djangosnippets.org/snippets/766/ Adds a hidden footer to the bottom of every text/html page containing a list of SQL queries executed and templates that were loaded (including their full filesystem path to he...
ramalho/pizza
debug_middleware.py
debug_middleware.py
py
5,795
python
en
code
9
github-code
21
[ { "api_name": "django.template.Template.render", "line_number": 94, "usage_type": "attribute" }, { "api_name": "django.template.Template", "line_number": 94, "usage_type": "name" }, { "api_name": "django.test.utils.instrumented_test_render", "line_number": 94, "usage_type...
70537494773
''' *** Deprecated *** Image transformation routines ''' from functools import partial import numpy as np import torch from torchvision import transforms as torch_transforms from PIL import Image class Transform: """Base transformation class. All other transformations should subclass this one. The number of ...
chcomin/torchtrainer
torchtrainer/transforms.py
transforms.py
py
22,587
python
en
code
1
github-code
21
[ { "api_name": "functools.partial", "line_number": 95, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 95, "usage_type": "attribute" }, { "api_name": "functools.partial", "line_number": 163, "usage_type": "call" }, { "api_name": "numpy.array", ...
19963754694
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models from goods.models import Stock def insertDefaultStockIDs(apps, schema_editor): """inserts the default stock IDs for the newly created OneToOneField""" Colony = apps.get_model("colony", "Colony") for co...
ross128/stg
colony/migrations/0002_colony_stock.py
0002_colony_stock.py
py
1,147
python
en
code
0
github-code
21
[ { "api_name": "goods.models.Stock.objects.create", "line_number": 11, "usage_type": "call" }, { "api_name": "goods.models.Stock.objects", "line_number": 11, "usage_type": "attribute" }, { "api_name": "goods.models.Stock", "line_number": 11, "usage_type": "name" }, { ...
25330659691
from collections import deque # Definition for a binary tree node. class TreeNode(object): def __init__(self, x): self.val = x self.left = None self.right = None def __str__(self): toReturn = '' stack = [self] while(len(stack) > 0): curr = stack.pop() t...
lydiacupery/leet-code
binary-tree-from-preorder-and-inorder/python/solution.py
solution.py
py
1,086
python
en
code
0
github-code
21
[ { "api_name": "collections.deque", "line_number": 24, "usage_type": "call" } ]
14215152150
""" @author: lenjin @date:2019/06/22 @common: load foot match data from www.okooo.com save into mongdb """ import pymongo import datetime import time from pyquery import PyQuery as pq from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support impo...
ibornJoy/drawmepy
loaddata.py
loaddata.py
py
4,898
python
en
code
0
github-code
21
[ { "api_name": "pymongo.MongoClient", "line_number": 41, "usage_type": "call" }, { "api_name": "selenium.webdriver.ChromeOptions", "line_number": 49, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 49, "usage_type": "name" }, { "api_name"...
17320961415
import discord import json def HasAdmin(author, server): adminRole = discord.utils.get(server.roles,name="Admin") for r in author.roles: if r == adminRole: return True return False def GetMember(id, server): #.fetchUser(id)? for member in server.members: if memb...
TheSquidBorn/Discord-Bots
S.A.M.RPI/sam_util.py
sam_util.py
py
701
python
en
code
0
github-code
21
[ { "api_name": "discord.utils.get", "line_number": 5, "usage_type": "call" }, { "api_name": "discord.utils", "line_number": 5, "usage_type": "attribute" }, { "api_name": "json.load", "line_number": 18, "usage_type": "call" }, { "api_name": "json.dump", "line_nu...
19737773175
import matplotlib.pyplot as plt import numpy as np import cv2 import sys def decodeImage(encoded_img): f = open(encoded_img, 'r') all_lines = f.readlines() img = [] for row in all_lines: row = row.split(',') rowDecoded = [] for i in range(0, len(row), 2): ...
Arajinzz/CompressionTechniques
CompressionTechniques/RLE/imageDecoder.py
imageDecoder.py
py
647
python
en
code
0
github-code
21
[ { "api_name": "numpy.array", "line_number": 23, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 28, "usage_type": "attribute" }, { "api_name": "cv2.imshow", "line_number": 29, "usage_type": "call" }, { "api_name": "cv2.waitKey", "line_number":...
71922360373
from appium.webdriver import WebElement from appium.webdriver.webdriver import WebDriver from selenium.webdriver.common.by import By from UI自动化框架2.page1.wrapper import handle_black class BasePage: _driver: WebDriver _black_list = [(By.ID, "iv_close")] def __init__(self, driver: WebDriver = None): ...
dingyuanxia/appiumxueqiu
page1/basepage1.py
basepage1.py
py
1,323
python
en
code
0
github-code
21
[ { "api_name": "appium.webdriver.webdriver.WebDriver", "line_number": 9, "usage_type": "name" }, { "api_name": "selenium.webdriver.common.by.By.ID", "line_number": 10, "usage_type": "attribute" }, { "api_name": "selenium.webdriver.common.by.By", "line_number": 10, "usage_t...
15535428273
# running text to speech through GTTS import gtts from playsound import playsound def ConvertToAudio(text): tts = gtts.gTTS(text, lang='en', tld='co.uk') tts.save("GTTSDEMO.mp3") playsound("GTTSDEMO.mp3") Text = "Hi, I m calling from Future Connect Training and Recruitment. Can I have your na...
wackyabhi/ComputingMSC_SalesBot
Application Scripts/TextToSpeech.py
TextToSpeech.py
py
357
python
en
code
0
github-code
21
[ { "api_name": "gtts.gTTS", "line_number": 7, "usage_type": "call" }, { "api_name": "playsound.playsound", "line_number": 9, "usage_type": "call" } ]
15593295554
from flask import Flask, request, jsonify import normas as nm import json import send_queue as sq import gpi_financeiro as gf import integracao_bi as ib app = Flask(__name__) @app.route('/api/normas/inserir', methods=['POST']) def normas_inserir(): content = request.get_json(silent=True) data_j = ...
daniloof/sigo
app/app.py
app.py
py
5,015
python
pt
code
0
github-code
21
[ { "api_name": "flask.Flask", "line_number": 8, "usage_type": "call" }, { "api_name": "flask.request.get_json", "line_number": 12, "usage_type": "call" }, { "api_name": "flask.request", "line_number": 12, "usage_type": "name" }, { "api_name": "json.dumps", "lin...
32971895213
from datetime import datetime from django.db import connection, transaction from domain_schema.celery import app from .models import Migration TRIGGER_TEMPL = """ CREATE TRIGGER save_{entity}_history BEFORE UPDATE ON {schema}.{table} FOR EACH ROW EXECUTE PROCEDURE {schema}.save_history();...
Forked-ONS/domain_schema
core/tasks.py
tasks.py
py
1,184
python
en
code
0
github-code
21
[ { "api_name": "models.Migration.objects.get", "line_number": 18, "usage_type": "call" }, { "api_name": "models.Migration.objects", "line_number": 18, "usage_type": "attribute" }, { "api_name": "models.Migration", "line_number": 18, "usage_type": "name" }, { "api_n...
3972933939
"""hangman game that will teach users a new word each game (with definitions). User can look at game history to check on words learned""" import random, json from tkinter import * # load dictionary.json into a python dict with open('dictionary.json') as file: dictionary = json.load(file) dictKeys = list(dictionary...
kevincheng96/hangman
hangman.py
hangman.py
py
7,291
python
en
code
0
github-code
21
[ { "api_name": "json.load", "line_number": 8, "usage_type": "call" }, { "api_name": "random.choice", "line_number": 118, "usage_type": "call" }, { "api_name": "random.choice", "line_number": 120, "usage_type": "call" } ]