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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
16177933588 | import serial.tools.list_ports
import time
import datetime
import info_multicont
from helpers import helper
import sqlite3
from services import sqlite_service
def query_probes():
#store all connected ports in a list
portsInfo = serial.tools.list_ports.comports()
ComPorts = []
for i in range(len(portsInfo)... | Paulsustain/Smartfuel | data/probe/main_multicont_old.py | main_multicont_old.py | py | 2,728 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "serial.tools.list_ports.tools.list_ports.comports",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "serial.tools.list_ports.tools",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "serial.tools.list_ports",
"line_number": 11,
"usage_... |
3980147422 | import argparse
import csv
import uuid
import hashlib
import itertools
import pathlib
import json
import random
import copy
import requests
import traceback
import xml
import xml.etree.ElementTree as ET
import collections
from folioclient.FolioClient import FolioClient
from faker import Faker
from datetime import datet... | FOLIO-FSE/FOLIO-backup-and-restore | service_requests_tools/give_users_permissions.py | give_users_permissions.py | py | 4,406 | python | en | code | 2 | github-code | 71 | [
{
"api_name": "csv.register_dialect",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "csv.DictReader",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "json.loads",
"li... |
34566848908 | import random
from copy import deepcopy
from typing import List
from behaviors import common_behaviors
class BehaviorLists():
"""A list of all the available nodes."""
def __init__(
self,
fallback_nodes: List[str] = None,
sequence_nodes: List[str] = None,
condition_nodes: List... | jstyrud/BeBOP | behaviors/behavior_lists.py | behavior_lists.py | py | 8,274 | python | en | code | 1 | github-code | 71 | [
{
"api_name": "typing.List",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": ... |
70335084070 | # -*- coding: utf-8 -*-
import random
from typing import TYPE_CHECKING, Any, List, Optional
import jaconv
if TYPE_CHECKING:
from .bot import Bot
class CaseInsensitiveDict(dict):
def __init__(self, v=None, **kwarg):
super().__init__(self.casefold(v, **kwarg))
def casefold(self, v, ... | BayGamerYT/Fortnite-LobbyBot-v2 | modules/cosmetics.py | cosmetics.py | py | 7,052 | python | en | code | 13 | github-code | 71 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 80,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_number": 80,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
... |
32074321903 | import numpy
import matplotlib.pyplot as plt
import math
import random
# Helper function to xor two characters
def xor_c(a, b):
return '0' if(a == b) else '1';
# Helper function to flip the bit
def flip(c):
return '1' if(c == '0') else '0';
def graytoBinary(gray):
binary = "";
# MSB of binary... | Ziaad-Khaled/genetic-algorithm | genetic_algorithm.py | genetic_algorithm.py | py | 10,204 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "math.sin",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "math.pi",
"line_number": 45,
"usage_type": "attribute"
},
{
"api_name": "math.sin",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "numpy.append",
"line_number": 54,
... |
13530895666 | import tkinter as tk
import base64
import requests
import shutil
import card_fetcher
import card_helper
import re
from datetime import datetime as dt
from PIL import ImageTk, Image
from pokemontcgsdk import Card
from pokemontcgsdk import Set
from pokemontcgsdk import Type
from pokemontcgsdk import Supertype
from pokemo... | zturchan/prizecam | prizecam/main.py | main.py | py | 7,272 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "enum.Enum",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "enum.Enum",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "requests.get",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "shutil.copyfileobj",
"line_numbe... |
9718057297 | '''
this is a skeleton code to integrate OpenGL and OpenCV in python
it is a translation (with minor modifications) of the cpp code found here:
http://www.cs.ucsb.edu/~holl/CS291A/opengl_cv.cpp
installation of related libraries:
pip install opencv-contrib-python
pip install PyOpenGL PyOpenGL_accelerate
you can invok... | codesavory/mixed_and_augmented_reality | opencv_opengl/OpenGL_CV.py | OpenGL_CV.py | py | 12,056 | python | en | code | 1 | github-code | 71 | [
{
"api_name": "numpy.zeros",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "numpy.float32",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "numpy.mgrid",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "cv2.TERM_CRITERIA_EPS... |
6604460398 | from typing import Optional, Callable, List
from constrained_decoding.dfa import DFA
from constrained_decoding.autoregressive_dfa_constraining.dfa_constrained_beam_search import dfa_constrained_beam_search
from constrained_decoding.autoregressive_dfa_constraining.dfa_constrained_generate import dfa_constrained_generat... | kleinay/seq2seq_constrained_decoding | src/constrained_decoding/autoregressive_dfa_constraining/api.py | api.py | py | 3,438 | python | en | code | 15 | github-code | 71 | [
{
"api_name": "typing.Optional",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "constrained_decoding.dfa.DFA",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "typing.Call... |
44664995983 | import requests
import pickle
from bs4 import BeautifulSoup, Comment
import re
characters = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u',
'v', 'w', 'x', 'y', 'z']
big_characters = [c.upper() for c in characters]
characters += big_characters
reg ... | livington/pythonchallenge | 5.py | 5.py | py | 729 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "requests.get",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 22,
"usage_type": "call"
}
] |
3742292223 | from __future__ import print_function
import sys
from optparse import OptionParser
from androguard.cli import androdis_main
option_0 = {
'name': ('-i', '--input'),
'help': 'file : use this filename (DEX/ODEX)',
'nargs': 1
}
option_1 = {
'name': ('-o', '--offset'),
'help': 'offset to disassemble',... | hhhaiai/decompile | bin/androguard/androdis.py | androdis.py | py | 952 | python | en | code | 31 | github-code | 70 | [
{
"api_name": "androguard.cli.androdis_main",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "optparse.OptionParser",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 38,
"usage_type": "attribute"
}
] |
43193356002 | from dataclasses import dataclass, field
from typing import List
from .blacklist import Blacklist
from .blacklist_ref import BlacklistRef
from .containment_aggregation_structure import ContainmentAggregationStructure
__NAMESPACE__ = "http://www.netex.org.uk/netex"
@dataclass
class BlacklistsRelStructure(ContainmentA... | tefra/xsdata-samples | netex/models/blacklists_rel_structure.py | blacklists_rel_structure.py | py | 963 | python | en | code | 7 | github-code | 70 | [
{
"api_name": "containment_aggregation_structure.ContainmentAggregationStructure",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "dataclasses.field",
"line_number": 15,
"usage_type": "call"... |
20804695909 | import logging
import functools
import os
from progressbar import (
Bar,
Percentage,
ProgressBar,
)
from requests_toolbelt import (MultipartEncoder, MultipartEncoderMonitor)
logger = logging.getLogger(__name__)
def _update_progress_bar(progress_bar, maximum_value, monitor):
if monitor.bytes_read <=... | mbruzek/snapcraft | snapcraft/storeapi/_upload.py | _upload.py | py | 2,598 | python | en | code | null | github-code | 70 | [
{
"api_name": "logging.getLogger",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path.getsize",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "requests_toolbelt.Mult... |
4611552190 | from dblur.testers.base_tester import BaseTester
from dblur.data.dataset import ImageDataset
from dblur.models.fnafnet import FNAFNet
from dblur.losses.fnafnet import FNAFNetLoss
import torch
import torch.nn as nn
import os
from torch.utils.data import DataLoader
class FNAFNetTester(BaseTester):
"""FNAFNet tester... | Jishnu8/DBlur-An-Image-Deblurring-Toolkit | src/dblur/testers/fnafnet.py | fnafnet.py | py | 4,767 | python | en | code | 3 | github-code | 70 | [
{
"api_name": "dblur.testers.base_tester.BaseTester",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "dblur.data.dataset.ImageDataset",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "torch.utils.data.DataLoader",
"line_number": 22,
"usage_type": "call... |
9415833090 | # python -m pip install selenium
# python -m pip install webdriver-manager
# python -m pip install beautifulsoup4
# python -m pip install Pillow
import os
from io import BytesIO
from PIL import Image
from base64 import b64decode
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from ... | gabrieljsp/manga-scraper | mgsc.py | mgsc.py | py | 4,147 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "selenium.webdriver.chrome.options.Options",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 32,
"usage_type": "name"
},
{... |
21558689457 | from tqdm import tqdm
import torch
from torch import nn
import torchvision
import torchvision.transforms as T
from lightly.models.modules import BarlowTwinsProjectionHead
from lightly.loss import BarlowTwinsLoss
from short_video_dataset import ShortVideoDataset
from augmentation import apply_transforms
class Barlo... | myasincifci/bachelor_thesis | barlow_twins.py | barlow_twins.py | py | 2,143 | python | en | code | 1 | github-code | 70 | [
{
"api_name": "torch.nn.Module",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "lightly.models.modules.BarlowTwinsProjectionHead",
"line_number": 19,
"usage_type": "call"
},
{
"ap... |
17590839847 | from tkinter import *
from tkinter.ttk import *
from tkinter import messagebox
from tkinter.ttk import Progressbar
from tkinter import filedialog
from PIL import Image, ImageTk
import zad
def resizeForBlackBg(imageName):
global pathV
pathV = imageName
resizedImage = Image.open(imageName)
resizedImage ... | bartekx43/Projekt_AO | GUI.py | GUI.py | py | 2,600 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "PIL.Image.open",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "PIL.ImageTk.PhotoImage",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "PIL.ImageTk",
"li... |
70751655586 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('flad', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='allele',
name='locus',
... | beukueb/myflq | src/MyFLsite/flad/migrations/0002_auto_20150119_1408.py | 0002_auto_20150119_1408.py | py | 436 | python | en | code | 4 | github-code | 70 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.AlterField",
"line_number": 14,
"usage_type": "call"
},
{... |
26509225579 | from flask import Flask, render_template, request
import mlab
mlab.connect()
app = Flask(__name__)
@app.route("/search", methods=['GET', 'POST'])
def home():
if request.method == 'GET':
return render_template("project.html")
elif render_template == 'POST':
form = request.form
food_nam... | VanNguyen1102/nguyenhongvan-fundamental-c4e24 | Project/app.py | app.py | py | 579 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "mlab.connect",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "flask.request.method",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
... |
9030651986 | from Positioning import positioning_MTP, homing_MTP
from Siemens_PLC import fire_signal, sensor1, sensor2, switch, IP, RACK, SLOT
from Snapshot import snapshot
import snap7
horizontal = 95
vertical = 0
sample_distance = 42
nikon_distance = 457
for i in range(10000): # for test measurement runs, we chose to try 100... | selinasuzeroglu/Material-Discovery-UV-Vis-Stage | Routine_Siemens.py | Routine_Siemens.py | py | 1,581 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "snap7.client.Client",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "snap7.client",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "Siemens_PLC.IP",
"line_number": 15,
"usage_type": "argument"
},
{
"api_name": "Siemens_PLC.... |
19287503645 | import numpy as np
import pytest
from numpy.testing import assert_allclose, assert_array_equal
from mne import Annotations, events_from_annotations
from mne.chpi import read_head_pos
from mne.datasets import testing
from mne.io import read_raw_fif
from mne.preprocessing import (
annotate_break,
annotate_moveme... | mne-tools/mne-python | mne/preprocessing/tests/test_artifact_detection.py | test_artifact_detection.py | py | 9,743 | python | en | code | 2,405 | github-code | 71 | [
{
"api_name": "mne.datasets.testing.data_path",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "mne.datasets.testing",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "mne.io.read_raw_fif",
"line_number": 27,
"usage_type": "call"
},
{
"api_name"... |
6341257153 | import unittest
from pathlib import Path
from gute.source import SourceNode
from gute.template import Template
class TemplateTest(unittest.TestCase):
def test_bulk_constructor(self):
nodes = ["<div>Hello</div>", "<div>World</div>"]
templates = Template.from_nodes(nodes, None)
self.assertE... | phantummm/gute | tests/template_tests.py | template_tests.py | py | 1,405 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "unittest.TestCase",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "gute.template.Template.from_nodes",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "gute.template.Template",
"line_number": 11,
"usage_type": "name"
},
{
"ap... |
14291474338 | #!/usr/bin/env python
# coding=utf-8
from __future__ import print_function
import sys
# Tricks to handle Python3
PY3 = sys.version_info.major > 2
if PY3:
basestring = str
from types import *
import itertools
import random
import math
import bisect
from functools import reduce
from collections import Iterable
__v... | iherman/underscore_py | underscore.py | underscore.py | py | 60,141 | python | en | code | 1 | github-code | 71 | [
{
"api_name": "sys.version_info",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "functools.reduce",
"line_number": 230,
"usage_type": "call"
},
{
"api_name": "functools.reduce",
"line_number": 232,
"usage_type": "call"
},
{
"api_name": "functools.re... |
16054325454 | from datetime import datetime
strkun = str(input('Birinchi sana: (yyyy-mm-dd): '))
strkun2 = str(input('Ikkinchi sana: (yyyy-mm-dd): '))
kundate = datetime.strptime(strkun, "%Y-%m-%d")
kundate2 = datetime.strptime(strkun2, "%Y-%m-%d")
print (f"Birinchi sanadan ikkinchi sanagacha {kundate2-kundate} kun o'tdi")... | sadriddin1708/imtihon1_masala1 | masala5.py | masala5.py | py | 329 | python | az | code | 0 | github-code | 70 | [
{
"api_name": "datetime.datetime.strptime",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "... |
23179861074 | '''
PAL 5/21/2012
read field calibration data between new HOBOs and Kevin's sensors
#
HLM 10/15/2012
changed path for variable calnew and paths in filesK and filesnew, minor modifications to plotting for legibility
'''
import numpy as np
from matplotlib.pyplot import plot,scatter,savefig,figure,colorbar,suptitle,close... | tebilir/CZO | HOBO analysis/Percy_HOBO files/crosscal_Kevinsensors.py | crosscal_Kevinsensors.py | py | 6,451 | python | en | code | 1 | github-code | 70 | [
{
"api_name": "matplotlib.mlab.csv2rec",
"line_number": 67,
"usage_type": "call"
},
{
"api_name": "matplotlib.mlab.csv2rec",
"line_number": 84,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 98,
"usage_type": "call"
},
{
"api_name": "numpy.nan... |
31503745966 | import datetime
import json
import os
import requests
bearer_token = os.environ.get("BEARER_TOKEN")
player = ""
# Gets time for search parameter
startTime = datetime.datetime.utcnow() - datetime.timedelta(hours=2)
startTime = startTime.isoformat() + "z"
search_url = "https://api.twitter.com/2/tweets/search/recent"... | plee30/CQBot | twitterSearch.py | twitterSearch.py | py | 1,498 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "os.environ.get",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime.utcnow",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "datetime.dateti... |
5474566144 | # Python Warm Up
# Some practice coding problems in Python. Done in collaboration with Alexia Filler (github: afiller1)
import math
import random
import requests
from cryptography.fernet import Fernet
# 1
def change(number):
if number < 0:
raise ValueError('amount cannot be negative')
quarters = math.... | szafiris/Portfolio | Python/warmup.py | warmup.py | py | 3,976 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "math.floor",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "math.floor",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "math.floor",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": ... |
71447191266 | import datetime
import numpy as np
import random
import logging
import QNet
# Basic sanity check/corrections for mutated candidates
def correct_candidate(candidate, all, expansion):
# Every candidate should have at least one recurrent layer
has_recurrent = False
layers = candidate['layers']
for layer... | jwknaup/GATecq | src/correct.py | correct.py | py | 2,211 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "random.random",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "logging.debug",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "QNet.dim_for_convolution",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "random.randrange... |
25762199046 | #!/usr/bin/env python
# coding: utf-8
# In[24]:
## Loading similarity pairing
import pandas as pd
df = pd.read_excel(r'C:\Users\dinos\Desktop\Python Project\Similarity Rating.xlsx')
print(df)
# In[25]:
## Creating historgram for rating distribution
import matplotlib.pyplot as plt
n, bins, patches = plt.hist(x=... | dinoskos/Item-Generation | Item Generation.py | Item Generation.py | py | 9,663 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "pandas.read_excel",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.hist",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "matplotlib... |
5424752795 | from django.utils.decorators import method_decorator
from drf_yasg.utils import swagger_auto_schema
from rest_framework.mixins import (
DestroyModelMixin,
RetrieveModelMixin,
UpdateModelMixin,
)
from rest_framework.viewsets import GenericViewSet
from api.permissions import OwnerOrReadOnly
from api.serializ... | PavelIgin/easy_flat | api/views/rating.py | rating.py | py | 1,357 | python | en | code | 1 | github-code | 70 | [
{
"api_name": "rest_framework.mixins.RetrieveModelMixin",
"line_number": 49,
"usage_type": "name"
},
{
"api_name": "rest_framework.mixins.UpdateModelMixin",
"line_number": 50,
"usage_type": "name"
},
{
"api_name": "rest_framework.mixins.DestroyModelMixin",
"line_number": 51,
... |
23143373916 | import numpy as np
import matplotlib.pyplot as plt
g = 10
T = np.linspace(0,10,1000)
def equation_trajectoire(x,Vx,Vz):
return -5*x*x/(Vx*Vx) + (x*Vz)/Vx
def creer_trajectoire(angle,vi):
vx = np.cos(angle) * vi
vz = np.sin(angle) * vi
impact = 0.2 * vx * vz
print(impact)
Lx = np.linspace(0,i... | 18tbr/machine_learning | create_plots.py | create_plots.py | py | 966 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "numpy.linspace",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "numpy.cos",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.sin",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_number":... |
10877111033 | import tensorflow as tf
import pandas as pd
from tensorflow import keras
import numpy as np
from sklearn.model_selection import train_test_split
import matplotlib.pyplot as plt
data = pd.read_csv('normout.csv')
x = data[['Time','Source','Destination','Length','CIP','CIP CM','CIP I/O','ENIP','GVCP','NBNS','... | Born-Decoder/Intelligent-network-intrusion-detection-system | nn.py | nn.py | py | 1,159 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "pandas.read_csv",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras.Sequential",
"line_number": 16,
"usage_type": "call"
},
{
... |
3427462612 | import logging
import six
from copy import deepcopy
from .connectors import get_connector
from user_sync.error import AssertionException
class PostSyncManager:
def __init__(self, post_sync_config, test_mode):
self.config = post_sync_config
self.logger = logging.getLogger("post-sync")
self.... | vossen-adobe/user-sync-fork | user_sync/post_sync/manager.py | manager.py | py | 3,439 | python | en | code | null | github-code | 70 | [
{
"api_name": "logging.getLogger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "connectors.get_connector",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "six.iteritems",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "user_sync.er... |
454708834 | import random as rnd
from gameBoard import GameBoard
from ships import Ship
from dot import Dot
from user import User
from ai import AI
from gameExceptions import *
from colorama import Back
class Game:
def __init__(self, size=6, hide=True):
rnd.seed()
self.size = size
self.hide = hide
... | fotolx/SeaBattle | game.py | game.py | py | 3,667 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "random.seed",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "gameBoard.GameBoard",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "ships.Ship",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "dot.Dot",
"line_number... |
4061918092 | import albumentations as alb
import pandas as pd
from pytube import YouTube
import pathlib
from moviepy.video.io.ffmpeg_tools import ffmpeg_extract_subclip
import os
import cv2
import numpy as np
import time
import random
class Utils():
def __init__(self, labels):
self.transform_pipeline = alb.Compose([
... | iMashiro/ActionRecognition | src/scripts/utils.py | utils.py | py | 5,115 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "albumentations.Compose",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "albumentations.Resize",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "albumentations.CenterCrop",
"line_number": 16,
"usage_type": "call"
},
{
"api_name":... |
37089060209 | import pygame as pg
import sys
import random
import time
pg.init()#初始化
#设置窗口
game_window = pg.display.set_mode((600,500))
#设置窗口标题
pg.display.set_caption('jieqiu')
#设置窗口颜色
window_color = (0,255,255)
#设置球体颜色 接球板颜色
ball_color = (255,255,0)
rect_color = (255,0,0)
#初始化球的位置
ball_x = random.randint(10,590)
ball_y = 10
move_x ... | chizer/pro_and_note | mygame.py | mygame.py | py | 1,953 | python | zh | code | 0 | github-code | 70 | [
{
"api_name": "pygame.init",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "pygame.display.s... |
70413950946 | # Author: Jakub Szwedowicz
# Date: 09.06.2022
# e-mail: kuba.szwedowicz@gmail.com
from PyQt6.QtWidgets import QWidget, QGridLayout, QPushButton
from PyQt6.QtGui import QCursor
from PyQt6.QtCore import Qt
from typing import Dict
def create_button(text: str) -> QPushButton:
button = QPushButton(text)
button.se... | JakubSzwedowicz/Scripting-Languages | Project/game_ui.py | game_ui.py | py | 1,454 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "PyQt6.QtWidgets.QPushButton",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "PyQt6.QtGui.QCursor",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "PyQt6.QtCore.Qt.CursorShape",
"line_number": 13,
"usage_type": "attribute"
},
{
"... |
42531317572 | import torch
from torch import nn
from main_code.model.layer.MoGLayer import MoGLayer
from main_code.model.discrim import DISCRIM_RGB
def gen_noise(noise_dim):
return torch.rand(noise_dim)
class GENERATOR_RGB(nn.Module):
def __init__(self, noise_dim, features_dim):
super(GENERATOR_RGB, self).__init_... | nopphonyel/EEG2Audio | main_code/model/generator.py | generator.py | py | 2,833 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "torch.rand",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "torch.nn.Module",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "main_code.model.layer.MoGLaye... |
25747183622 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu May 24 16:20:00 2018
@authors: olivierm, BlanchonMarc
Tools to read and import data from Polarcam
"""
from enum import Enum
import numpy as np
from scipy.signal import convolve2d
import matplotlib.pyplot as pl
from matplotlib.colors import hsv_to_rgb
... | BlanchonMarc/InterPol | polarcam.py | polarcam.py | py | 15,244 | python | en | code | 2 | github-code | 70 | [
{
"api_name": "enum.Enum",
"line_number": 55,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.imread",
"line_number": 85,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 85,
"usage_type": "name"
},
{
"api_name": "numpy.array",
... |
9053137808 | ##
## Developed for the University of Nottingham G52GRP module
##
## Written by: Marcus Whybrow (mxw18u)
## Group: gp09-drm
##
from BeautifulSoup import BeautifulStoneSoup
from urllib2 import urlopen, HTTPError, URLError
import httplib
import re
from base import utils
from django.db.models import Q
from volumes.mod... | marcuswhybrow/autolib | autolib/volumes/utils.py | utils.py | py | 10,788 | python | en | code | 2 | github-code | 71 | [
{
"api_name": "BeautifulSoup.BeautifulStoneSoup",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "urllib2.urlopen",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "urllib2.HTTPError",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "ur... |
19108392672 | from tf.transformations import euler_from_quaternion
import rospy
from gazebo_msgs.srv import GetModelState
from std_msgs.msg import Float32
_model_state = rospy.ServiceProxy('/gazebo/get_model_state', GetModelState)
def get_model_state():
rospy.wait_for_service("/gazebo/get_model_state")
try:
return ... | lwt104/github | leader_follower_simulation-main/src/transform.py | transform.py | py | 856 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "rospy.ServiceProxy",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "gazebo_msgs.srv.GetModelState",
"line_number": 6,
"usage_type": "argument"
},
{
"api_name": "rospy.wait_for_service",
"line_number": 9,
"usage_type": "call"
},
{
"api_name... |
30236578427 | from edgetpu.detection.engine import DetectionEngine
from imutils.video import VideoStream
from PIL import Image
import argparse
import imutils
import time
import cv2
import random
import numpy as np
def dialogBox(title, text, width=200, height=130):
img = np.zeros((height, width, 3), np.uint8)
img[:,0:width] ... | wyldewill/image-recognition- | Not Required/detect_video.py | detect_video.py | py | 3,939 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "numpy.zeros",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.uint8",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "cv2.putText",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "cv2.FONT_HERSHEY_SIMPLEX",
... |
6945611473 | from safetensors import safe_open
from diffusers import StableDiffusionPipeline
import torch
from diffusers import DiffusionPipeline, DPMSolverMultistepScheduler
from diffusers.models import AutoencoderKL
import os
def mix_pipeline_safetensors():
pipeline_1_path = "/share/wangqixun/workspace/github_project/diffus... | yonghenglh6/redpy | redpy/diffusers_custom/merge_model.py | merge_model.py | py | 10,532 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "diffusers.DiffusionPipeline.from_pretrained",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "diffusers.DiffusionPipeline",
"line_number": 36,
"usage_type": "name"
},
{
"api_name": "safetensors.safe_open",
"line_number": 50,
"usage_type": "call"
... |
39839794964 | import requests
from bs4 import BeautifulSoup
url="https://search.naver.com/search.naver?where=nexearch&sm=tab_jum&query=%EC%BD%94%EB%A1%9C%EB%82%98"
r=requests.get(url)
soup=BeautifulSoup(r.text, "html.parser")
data=soup.select("a.news_tit")
for i in data:
print(i.get_text()) | Cheolyong-Kim/Data-Analysis-Data-Visualization | day2/q2.py | q2.py | py | 284 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "requests.get",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 7,
"usage_type": "call"
}
] |
30267047905 | from PyQt5.QtWidgets import QApplication
from PyQt5.QtGui import *
import pygame
import sys
import os
from PyQt5.QtCore import *
from PyQt5.QtWebEngineWidgets import *
from PyQt5 import QtWidgets
from PyQt5.QtWidgets import QApplication, QMainWindow
import sys, time
class MyWindow(QMainWindow):
def __init__(... | codingWithAndy/Thesis_Project | Additional Content/Exploring/pyqt exploring.py | pyqt exploring.py | py | 7,401 | python | en | code | 2 | github-code | 71 | [
{
"api_name": "PyQt5.QtWidgets.QMainWindow",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtWidgets.QLabel",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtWidgets",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "Py... |
9684733481 | import random
import torch
import torch.nn as nn
from .ffjord.train_misc import standard_normal_logprob, set_cnf_options, create_regularization_fns
from .ffjord.train_misc import get_regularization, build_model_tabular
class argument:
def __init__(self, args, data_dims):
assert args['layer_type'] in ["igno... | leejaehoon2016/ITGAN | synthesizers/GeneratorModel.py | GeneratorModel.py | py | 6,423 | python | en | code | 1 | github-code | 70 | [
{
"api_name": "torch.nn.Module",
"line_number": 89,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 89,
"usage_type": "name"
},
{
"api_name": "ffjord.train_misc.create_regularization_fns",
"line_number": 102,
"usage_type": "call"
},
{
"api_na... |
10678373743 | import dash
import dash_daq as daq
import sys
import pandas as pd
from dash import html
import dash_bootstrap_components as dbc
import datetime
import plotly
sys.path.insert(1,'./pages')
import utilidadesVarias as uv
dash.register_page(__name__)
layout = html.Div(children=[
html.H1(children='MME Page'),
html... | juansamuelperez/wind-core-dashboard | pages/MME.py | MME.py | py | 16,267 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "sys.path.insert",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "dash.register_page",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "dash.html.Div",
... |
15320329309 | import requests
from urllib.request import Request, urlopen
from bs4 import BeautifulSoup
from csv import writer
def append_list_as_row(file_name, list_of_elem):
# Open file in append mode
with open(file_name, 'a+', newline='') as write_obj:
# Create a writer object from csv module
... | aditya899/Knimbus | knimbus_oxford.py | knimbus_oxford.py | py | 1,746 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "csv.writer",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "urllib.request.Request",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "urllib.request.urlopen",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "bs4.Beautifu... |
23480958151 | import torch.nn as nn
from utils import ConvolutionalBlock, Downscaling, Upscaling
class UNet(nn.Module):
"""
Implementation of the UNet network architecture. This is a modification of the
network proposed https://arxiv.org/pdf/1505.04597.pdf in the context of
semantic segmentation.
This impleme... | pwswierczynski/flowfusic_airfoil_cnn | src/networks.py | networks.py | py | 1,802 | python | en | code | 2 | github-code | 70 | [
{
"api_name": "torch.nn.Module",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "utils.ConvolutionalBlock",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "utils.Downscalin... |
4715657876 | from typing import List
class Solution:
def removeCoveredIntervals(self, intervals: List[List[int]]) -> int:
# sort the list by start time
# then traverse linearly
intervals = sorted(intervals, key=lambda s: (s[0], -s[1]))
print(intervals)
count = 0
prev = -1
... | jameszhang-a/DSA | problems/LC/medium/python/1288_remove_covered_intervals.py | 1288_remove_covered_intervals.py | py | 862 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "typing.List",
"line_number": 5,
"usage_type": "name"
}
] |
34325854399 | import sys
from scipy.ndimage import gaussian_filter1d
num_1 = sys.argv[1]
num_2 = sys.argv[2]
num_3 = sys.argv[3]
out_1 = gaussian_filter1d([1, 2, 3], 3)
print(out_1)
| jinbeomjeong/boom_monitoring | gaussian_filter.py | gaussian_filter.py | py | 172 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "sys.argv",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "scipy.ndimage.gaussian_filter1... |
39010416769 | from django.urls import path, include
from django.conf.urls import url
from rest_framework.routers import DefaultRouter
from .views import *
router = DefaultRouter()
router.register('', ProductViewSet)
# router.register('', CreateComment)
urlpatterns = [
path('categories/', CategoriesList.as_view()),
path... | 3000ikk/Aprillia | product/urls.py | urls.py | py | 577 | python | en | code | 1 | github-code | 70 | [
{
"api_name": "rest_framework.routers.DefaultRouter",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": ... |
24333938169 | #!/usr/bin/env python
from Bio import SeqIO
import sys
import os
import csv
usage = 'python filter_by_b6.py align_R1.b6 align_R2.b6 orig_R1.fastq orig_R2.fastq filtered_prefix'
# Will add '_R1' and '_R2' to the end of the filtered prefix
if len(sys.argv) < 5:
print('You must supply the R1 and R2 alignment files, o... | shields-cutler-lab/filter-fastqs | filter_pe_fq_b6.py | filter_pe_fq_b6.py | py | 2,023 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "sys.argv",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "sys.exit",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 17... |
3357482254 | import os
import sys
import barcode
from barcode.writer import ImageWriter
# Importing inner modules, so that it works as a module and as a program
try:
from . import LogProvider as log_provider
except:
import LogProvider as log_provider
def __create(barcode_type, data, file_path):
"""__create is a p... | ISabariRajan/Python-reusable-codes | Barcode/BarcodeWriter.py | BarcodeWriter.py | py | 4,298 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "barcode.get_barcode_class",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "barcode.writer.ImageWriter",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "LogProvider.insert_error_log",
"line_number": 29,
"usage_type": "call"
},
{
... |
27733538803 | import numpy as np
import os
from sklearn.datasets import fetch_openml
import matplotlib.pyplot as plt
# Create the directory for output images
directory = './fig/'
if not os.path.isdir(directory):
os.makedirs(directory)
# Fetch the datasets from openml
mnist = fetch_openml('mnist_784')
"""
Part1: PCA
Q2. ~ Q4.
... | ncku-yee/DSP2021 | PHW1/run.py | run.py | py | 6,839 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "os.path.isdir",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sklearn.datasets.fetch_openml",
... |
36131140451 | import cv2, os
folder_name = 'frames'
image_paths= sorted([f'{folder_name}/{x}' for x in os.listdir(f'./{folder_name}')])
print(image_paths)
imgs = []
for i in range(len(image_paths)):
imgs.append(cv2.imread(image_paths[i]))
imgs[i]=cv2.resize(imgs[i],(0,0),fx=0.4,fy=0.4)
stitchy=cv2.Stitcher.create()
# stitchy.... | biplob004/ImageStitchingPython | cv2_stitching.py | cv2_stitching.py | py | 641 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "os.listdir",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "cv2.resize",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cv2.Stitcher.create",
"line_number... |
5650126215 | import copy
import os.path
import numpy as np
import torch
import torch.nn.functional as F
from networks import Actor, Critic_MATD3
class Coach_MATD3(object):
def __init__(self, args, agent_id, writer):
self.agent_id = agent_id
self.max_action = args.coach_max_action
self.a... | dynamicDr/HRL | coach_matd3.py | coach_matd3.py | py | 4,765 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "networks.Actor",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "networks.Critic_MATD3",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "copy.deepcopy",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "copy.deepcopy",
... |
6079541688 | import torch
import numpy as np
import multiprocessing
from cosypose.lib3d.transform_ops import invert_T
from .bullet_scene_renderer import BulletSceneRenderer
def init_renderer(urdf_ds, preload=True):
renderer = BulletSceneRenderer(urdf_ds=urdf_ds,
preload_cache=preload,
... | ylabbe/cosypose | cosypose/rendering/bullet_batch_renderer.py | bullet_batch_renderer.py | py | 4,804 | python | en | code | 276 | github-code | 71 | [
{
"api_name": "bullet_scene_renderer.BulletSceneRenderer",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.isfinite",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.isfinite",
"line_number": 26,
"usage_type": "call"
},
{
"api_name"... |
3495517114 | from config import config # config.py中包含了redis的一些信息,比如host, port, 数据库名称
from flask import current_app
import redis
class Redis(object):
"""
redis数据库操作
"""
@staticmethod
def _get_r():
# 当Redis类作为一个appAPI使用时,例如在redisdbOperationAPI.py中调用,会被注册进蓝本,因此可直接从current_app中获取配置信息
# host = cur... | qiushenjie/FlaskModel | app/database/redis_db.py | redis_db.py | py | 2,934 | python | en | code | 5 | github-code | 71 | [
{
"api_name": "config.config.redis_map",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "config.config",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "config.config.redis_map",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name"... |
34149949995 | from const import *
from test_cases import *
from pycrate_asn1dir import RRCLTE
from pycrate_mobile.NAS import *
from pycrate_asn1rt.codecs import _with_json
from pycrate_asn1rt.asnobj_ext import *
from CryptoMobile import CM
import json
class Pdu:
sep_char = "| "
... | andreapaci/f4g-uzzer | pdu.py | pdu.py | py | 10,767 | python | en | code | 1 | github-code | 70 | [
{
"api_name": "pycrate_asn1dir.RRCLTE.EUTRA_RRC_Definitions",
"line_number": 39,
"usage_type": "attribute"
},
{
"api_name": "pycrate_asn1dir.RRCLTE",
"line_number": 39,
"usage_type": "name"
},
{
"api_name": "pycrate_asn1dir.RRCLTE.EUTRA_RRC_Definitions",
"line_number": 41,
... |
40323669469 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Jun 21 18:34:51 2018
@author: tomtop
"""
import sys, os;
from natsort import natsorted;
from PyQt5.QtWidgets import QApplication, QWidget, QPushButton,\
QGroupBox, QDialog,\
QVBoxLayout, QGridLa... | Tom-top/clearmap_trailmap_gui | ClearMap/GUI_Clearmap.py | GUI_Clearmap.py | py | 11,326 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "PyQt5.QtWidgets.QDialog",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtWidgets.QVBoxLayout",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtWidgets.QTabWidget",
"line_number": 54,
"usage_type": "call"
},
{
"ap... |
37833213668 | # import numpy as np
import torch as T
import torch.nn as nn
import torch.nn.functional as F
# import torch.distributions as D
# from .Optimizer import RAdam
from adabelief_pytorch import AdaBelief
from torch.optim.lr_scheduler import MultiStepLR
from app.APN.model.aux.attention import attention
from app.APN.model.aux.... | jahanpd/UAN | app/APN/model/ConcreteNetwork.py | ConcreteNetwork.py | py | 9,991 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "torch.nn.Module",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "torch.nn.BCELoss",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_n... |
17461757516 | import numpy as np
from sklearn.linear_model import RidgeCV, LassoCV
from utils import twoD_gather
class BaseEstimator(object):
def __init__(self):
pass
def train(self, context=None, action=None, reward=None):
""" (Optional) Training the estimator
:param context: (num_sample, num_fe... | Rowing0914/offline_policy_evaluation | estimator.py | estimator.py | py | 13,580 | python | en | code | 5 | github-code | 71 | [
{
"api_name": "numpy.logspace",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "utils.twoD_gather",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "sklearn.linear_model.RidgeCV",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "sklearn... |
37096019083 | # Script extracting data from yahoo finances
# Requirements:
# - pip3 install yfinance
# - pip3 install yahoo_fin
# - pip3 install requests_html
# - pip3 install django
def ExtractStocksData():
import yfinance as yf1
from multiprocessing import Process, Manager
# import yahoo_fin.stock_info as yf2
... | PenkoMlakar/StockChecker1700 | yf1.py | yf1.py | py | 20,017 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "yfinance.download",
"line_number": 203,
"usage_type": "call"
},
{
"api_name": "yfinance.Ticker",
"line_number": 206,
"usage_type": "call"
},
{
"api_name": "multiprocessing.Manager",
"line_number": 217,
"usage_type": "call"
},
{
"api_name": "multipro... |
27320586001 | import data.Point as Point
import data.Square as Square
class Cipher:
def __init__(self):
self.square = Square.Square()
def encode_v3(self, text):
# 4. Jeśli ciąg znaków zawierać będzie nieparzystą liczbę znaków, należy uzupełnić go literą X.
if len(text) % 2 == 1:
text = ... | kkosiorowska/lib-square-cipher | cryptography/Cipher.py | Cipher.py | py | 2,419 | python | pl | code | 0 | github-code | 71 | [
{
"api_name": "data.Square.Square",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "data.Square",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "data.Point.Point",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "data.Point",
"line_... |
41819898688 | import pytest
import numpy as np
from impression.collaborative_filtering import ItemMemoryModel
@pytest.fixture
def ratings() -> np.ndarray:
return np.array([
[np.nan, 2, 0, np.nan, 1, -1],
[-2, np.nan, np.nan, 0, np.nan, 1],
[1, -1, np.nan, np.nan, 0, np.nan],
[1, 0, -1, np.nan, 2... | olekssy/impression | tests/test_item_memory_model.py | test_item_memory_model.py | py | 1,464 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "numpy.array",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.nan",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "numpy.nan",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "numpy.nan",
"line_number"... |
31216133887 | from pwn import *
import json
#context.log_level = 'debug'
p = remote('124.71.194.126','9999')
#p = process('./SPN_ENC')
elf = ELF('./SPN_ENC')
libc = ELF('/lib/x86_64-linux-gnu/libc.so.6')
def malloc(idx,size):
p.recvuntil('0.exit\n')
p.sendline(str(1))
p.sendlineafter('Size:',str(size))
p.sendline... | suvii22/CTF | L3HCTF2021/PWN/spn/attachment_spn/exp.py | exp.py | py | 1,680 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "json.loads",
"line_number": 61,
"usage_type": "call"
}
] |
32494593865 | import json
import os
from tkinter import messagebox as MessageBox
StopWord = "desea"
final_lexema = ""
Ind_StopWord = False
finalizar = "Si, muchas gracias"
menu = "Si"
adicion = "Si, Gracias"
table = "Respuestas.json"
def search_size_domain(word_pass):
global table
size = 0
with open(table, "r") as j:
... | DanielHernandez627/TM | Procesador.py | Procesador.py | py | 2,550 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "json.load",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "os.path.abspath",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 42,
... |
13790303092 | from keras.metrics import BinaryCrossentropy
from keras.losses import MeanSquaredError
from keras.optimizers import adam_v2
from keras.layers import Dense, Flatten, Conv1D, Conv2D, Input, Conv1DTranspose, Conv2DTranspose, Concatenate, MaxPool1D, Dropout, Reshape, Lambda, InputLayer, LeakyReLU, BatchNormalization
fr... | lucascbarbosa/INT | Manufatura Aditiva/Simulacao-GAN/pipeline/3- Machine_learning/GAN/GAN.py | GAN.py | py | 19,431 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "tensorflow.config.list_physical_devices",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "tensorflow.config",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.config.experimental.set_memory_growth",
"line_number": 35,
"usa... |
72972188391 | import numpy as np
from model import Agent
from car_game import CarGame
import pygame
import torch
import torch.optim as optim
from torch.autograd import Variable
from torch.distributions import Categorical
import matplotlib.pyplot as plt
GREEN = (20, 255, 140)
GREY = (210, 210, 210)
WHITE = (255, 255, 255)
SCREENWID... | guillaume-guerdoux/RL-simple-car-game | main.py | main.py | py | 3,821 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "pygame.display.set_mode",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "pygame.display.set_caption",
"line_number": 20,
"usage_type": "call"
},
{
"api_name":... |
17073281164 | import json
from django.http.response import HttpResponse
from django.shortcuts import render
from CRM.Core.BaseCrmManager import RequestProcessException
from CRM.Core.SystemGroupManagement import VIPGroupManagement
from CRM.Decorators.Permission import multi_check
from CRM.context_processors.Utils import che... | sauditore/FCRM | CRM/Processors/VIPGroup/VIPGroupManagement.py | VIPGroupManagement.py | py | 1,771 | python | en | code | 2 | github-code | 71 | [
{
"api_name": "CRM.context_processors.Utils.check_ajax",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "CRM.models.ServiceGroups.objects.filter",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "CRM.models.ServiceGroups.objects",
"line_number": 18,
"us... |
71696206630 | from flask import Flask, Response, request
import pymongo
import json
from user import User, Rating
## ===============================================================================
## Connect to Database
## ===============================================================================
# Get the database password
... | jelloh/group-music-recommender | backend/apis.py | apis.py | py | 6,435 | python | en | code | 1 | github-code | 71 | [
{
"api_name": "flask.Flask",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pymongo.MongoClient",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "flask.Response",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line... |
35728912769 | import cv2
import gym
import numpy as np
from gym import spaces
class LocoTransformerEnv(gym.Env):
def __init__(self, env: gym.Env):
super(LocoTransformerEnv, self).__init__()
self._env = env # (BaseDisplacement[3], Depth[4096], IMU[4], Motor[12])
self.proprio_history = []
self.d... | kywind/Robotics-Project | utils/env.py | env.py | py | 2,846 | python | en | code | 1 | github-code | 71 | [
{
"api_name": "gym.Env",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "gym.Env",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "numpy.concatenate",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.concatenate",
"l... |
17382009777 | import os
import yaml
from typing import Any
from prefect.tasks.shell import ShellTask
from prefect.utilities.tasks import defaults_from_attrs
class DbtShellTask(ShellTask):
"""
Task for running dbt commands. It will create a profiles.yml file prior to running dbt commands.
This task inherits all config... | safinayah/Final_bundles_code | main/Lib/site-packages/prefect/tasks/dbt/dbt.py | dbt.py | py | 7,745 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "prefect.tasks.shell.ShellTask",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_number": 81,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"line_number": 136,
"usage_type": "call"
},
{
"api_name": "os.path",
"... |
37007674300 | import requests
import utils.tool as tool
import time, json, csv, re
import ssl
from datetime import datetime
from dateutil import parser
import pytz
utc=pytz.UTC
REST_URL = "https://bugzilla.redhat.com/"
# REST API methods
REST_VERSION = 'rest/version'
REST_BUG = 'rest/bug'
REST_BUG_COMMENT = 'rest/bug/{0}/comment'... | SAILResearch/suppmaterial-20-justina-upstream_bug_linux | suppmaterial/fedora/bugzilla_helper.py | bugzilla_helper.py | py | 6,948 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "pytz.UTC",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "utils.tool.url_param_From_dict",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "utils.tool",
"line_number": 54,
"usage_type": "name"
},
{
"api_name": "ssl._create_de... |
35075853403 | # -*- coding: utf-8 -*-
import glob
import os
import re
import sys
import typing
from psed.logger import Logger
class Psed:
"""Main class for psed"""
def __init__(
self,
input: str = "",
find: typing.List[str] = None,
replace: str = None,
inplace: bool = False,
):... | aklajnert/psed | psed/psed.py | psed.py | py | 4,018 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "typing.List",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "typing.List",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "typing.Pattern",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "typing.Optional... |
23157477509 | import requests
from flask import Flask, Response, request
from bot_parser import parse_message
app = Flask(__name__)
TOKEN = '1023120359:AAHSXx5ayrjLbJRehpozKJSECOBV4ZQNTzI'
@app.route('/sanity')
def sanity():
return "Server is running YAZAN ;)"
def establish_connection():
TELEGRAM_INIT_WEBHOOK_URL = 'htt... | Elevationacademy/telegram-bot-MalekImam | server.py | server.py | py | 1,002 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "flask.Flask",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "flask.request.get_json",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "flask.request",
"l... |
38173579293 | from collections import OrderedDict
import networkx as nx
import dwave_networkx as dnx
from neal import SimulatedAnnealingSampler
from dwave.system.composites import EmbeddingComposite
from dwave.system.samplers import DWaveSampler
import dwave.cloud.exceptions
from dwave_structural_imbalance_demo.mmp_network impor... | robstraker/quantum-computing-d-wave | D-Wave Demos/structural-imbalance-demo-master/dwave_structural_imbalance_demo/interfaces.py | interfaces.py | py | 8,720 | python | en | code | 1 | github-code | 71 | [
{
"api_name": "dwave_networkx._PY2",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "dwave_structural_imbalance_demo.mmp_network.global_signed_social_network",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "dwave.system.composites.EmbeddingComposite",
... |
86284885044 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from astropy import units
from astropy.io import fits
import numpy as np
import pytest
from sofia_redux.scan.configuration.configuration import Configuration
from sofia_redux.scan.flags.mounts import Mount
from sofia_redux.scan.info.instrument import Ins... | SOFIA-USRA/sofia_redux | sofia_redux/scan/info/tests/test_instrument.py | test_instrument.py | py | 5,961 | python | en | code | 9 | github-code | 71 | [
{
"api_name": "sofia_redux.scan.info.instrument.InstrumentInfo",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sofia_redux.scan.flags.mounts.Mount.UNKNOWN",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "sofia_redux.scan.flags.mounts.Mount",
"line_... |
16155762517 | import os, pickle, sys, pydicom
import csv
from tqdm import tqdm
import pandas as pd
import numpy as np
import sys
from PIL import Image
from tqdm import tqdm
import torch
from torch import optim, nn
import torch.nn.functional as F
from torch.utils.data import DataLoader
from torchvision import transforms
from colle... | Hong-Jeongmin/KTL_Medical_Hackathon | Final_TEST/final_utils.py | final_utils.py | py | 9,173 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "tqdm.tqdm",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "numpy.hstack",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "numpy.hstack",
"line_number": ... |
27972972960 | import torch
import torch.nn as nn
from src.utils.torch_utils import FLOAT
class BaseCNN(nn.Module):
def __init__(self, price_features, num_stocks, window_length):
super().__init__()
self.conv1 = nn.Conv2d(price_features, 2, kernel_size=(1,3))
self.conv2 = nn.Conv2d(in_channels=2, out_ch... | ChenYiYuIvan/rl_portfolio_management | src/models/cnn_models.py | cnn_models.py | py | 3,698 | python | en | code | 2 | github-code | 71 | [
{
"api_name": "torch.nn.Module",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "torch.nn.Conv2d",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_numb... |
10334118498 | import asyncio
import hci_packets as hci
import link_layer_packets as ll
import math
import random
import unittest
from dataclasses import dataclass
from hci_packets import ErrorCode, FragmentPreference
from py.bluetooth import Address
from py.controller import ControllerTest
from typing import List
def make_advertis... | google/rootcanal | test/LL/DDI/ADV/BV_47_C.py | BV_47_C.py | py | 14,679 | python | en | code | 6 | github-code | 71 | [
{
"api_name": "hci_packets.AdvertisingEventProperties",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "hci_packets.AdvertisingEventProperties",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "hci_packets.FragmentPreference",
"line_number": 28,
"u... |
42557332506 | import json
import definition
class ChannelPermission:
channels = None
def __init__(self):
f = open(definition.get_path("assets/permission.json"), "r", encoding="utf8")
self.channels = json.load(f)
f.close()
def can_use_command(self, channel_id, command):
channel_id_str =... | qvanphong/tlln-discord-bot | src/utils/channel_permission.py | channel_permission.py | py | 1,086 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "definition.get_path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 10,
"usage_type": "call"
}
] |
30517468256 | from pathlib import Path
image_file_extensions = {
'.jpg', '.jpeg', '.png', '.webp', '.gif', '.webm', '.svg', '.mkv', '.mp4', '.avif', '.y4m', '.jxl'
}
SRS_SHEET = ".srs"
def get_image_files(directory_path):
""" @:param directory_path must be str or Path object
@:returns list of Path file objects ""... | mfg637/imgViewer | filesystem/filesystem.py | filesystem.py | py | 1,457 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "pathlib.Path",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 17,
"usage_type": "argument"
},
{
"api_name": "pathlib.Path",
"line_number": 34,
"usage_type": "call"
}
] |
30200473095 | from logging.handlers import SMTPHandler
import logging
from config import config
logger = logging.getLogger(__name__)
logger.setLevel('DEBUG')
# Handlers
stream_handler = logging.StreamHandler()
file_handler = logging.FileHandler(filename='log.log', mode='a', encoding='utf-8')
email_handler = SMTPHandler(
mailho... | IlyaBulatau/Yandex-API-music-downloader-tgBot | src/logger/logger.py | logger.py | py | 950 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "logging.getLogger",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "logging.StreamHandler",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "logging.FileHandler",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "logging.han... |
73381874785 | from __future__ import absolute_import, division, print_function
import numbers
from abc import ABCMeta, abstractmethod
from collections import OrderedDict, defaultdict
from six import add_metaclass
import torch
import pyro.poutine as poutine
from pyro.distributions import Categorical, Empirical
from pyro.ops.stats ... | deoxyribose/compositions_mixtures_factors | tracepredictive.py | tracepredictive.py | py | 3,971 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "pyro.poutine.trace",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "pyro.poutine",
"line_number": 38,
"usage_type": "name"
},
{
"api_name": "pyro.poutine.trace",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "pyro.poutine",
... |
39527902829 | import tensorflow as tf
from tensorflow import keras
from tensorflow.keras.models import Model
from tensorflow.keras.layers import Input, Conv2D, MaxPooling2D, UpSampling2D, concatenate, Conv2DTranspose, \
BatchNormalization, Dropout, Lambda
from matplotlib import pyplot as plt
from src.image_loading import sample... | Rechargeable22/mrz-text-detection | src/model_unet.py | model_unet.py | py | 5,854 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "tensorflow.keras.layers.Conv2D",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras.layers.Conv2D",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras.layers.MaxPooling2D",
"line_number": 17,
"usage_type": "ca... |
40322090356 | import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from sklearn.decomposition import PCA
from sklearn.pipeline import Pipeline
from sklearn.preprocessing import PolynomialFeatures
from sklearn.linear_model import LinearRegression
from random import randint, choice
from sklearn.preprocessing ... | slwlrn/Aletia5 | RETOTRES.py | RETOTRES.py | py | 6,787 | python | es | code | 0 | github-code | 70 | [
{
"api_name": "numpy.random.seed",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "numpy.cos",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"line_nu... |
20144365393 | import torch
from argparse import ArgumentParser
class Model(torch.nn.Module):
@staticmethod
def add_model_specific_args(parent_parser):
parser = ArgumentParser(parents=[parent_parser], add_help=False)
parser.add_argument('--lr', type=float, default=0.001,
help='Lea... | wzf2000/THUCS | 大二下/人工智能导论/情感分析/wzf2000/SentimentAnalysis/src/models/Model.py | Model.py | py | 1,848 | python | en | code | 42 | github-code | 71 | [
{
"api_name": "torch.nn",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "torch.nn.init.normal_",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "torch.nn",
... |
24122504251 | import logging
import math
import re
import time
import uuid
from decimal import Decimal
import yaml
def load_config(file_path: str) -> dict:
"""
Load config file and return the content as a dictionary.
"""
with open(file_path, "r") as file:
config = yaml.safe_load(file)
return config
d... | binance/ai-trading-prototype | aitradingprototype/common/utils.py | utils.py | py | 2,057 | python | en | code | 16 | github-code | 70 | [
{
"api_name": "yaml.safe_load",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "logging.Formatter",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "time.gmtime",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "logging.basicC... |
5194265558 | import os.path
import re
import time
import urllib.request
import pandas as pd
from selenium.webdriver.common.by import By
from Crawling._001_extract_numbers._001_sm3.v1.BrowserModule import Browser, user_path
from Crawling._001_extract_numbers._001_sm3.v1._001_setup_train_6_numbers import CaptchaModelSix
service = ... | wiv33/A-Learning-python | Crawling/_001_extract_numbers/_001_sm3/v1/_002_access.py | _002_access.py | py | 1,967 | python | en | code | 2 | github-code | 71 | [
{
"api_name": "Crawling._001_extract_numbers._001_sm3.v1.BrowserModule.Browser",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "Crawling._001_extract_numbers._001_sm3.v1.BrowserModule.user_path... |
41645602651 | """Grid generators for calendars"""
import math
from dataclasses import dataclass
from datetime import date, timedelta
import calendar
from typing import Optional, List, Set, Dict
HEADERMAPPING = {
0: "Monday",
1: "Tuesday",
2: "Wednesday",
3: "Thursday",
4: "Friday",
5: "Saturday",
6: "Su... | rectory-school/rectory-apps-updated | calendar_generator/grids.py | grids.py | py | 5,415 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "datetime.date",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "dataclasses.dataclass",... |
36455484462 | import sys
from PyQt5 import QtWidgets
from client_ui import Ui_Form
import ct
import os
import re
import clock
import threading
import time
class MyPyQT_Form(QtWidgets.QWidget, Ui_Form):
def __init__(self):
super(MyPyQT_Form, self).__init__()
self.setupUi(self)
self.btn_start_test.clicked... | wlyylw/pythonnetwork | main_client.py | main_client.py | py | 15,455 | python | en | code | 1 | github-code | 71 | [
{
"api_name": "PyQt5.QtWidgets.QWidget",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "PyQt5.QtWidgets",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "client_ui.Ui_Form",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "ct.Cli... |
38745416987 | import inspect
import re
import types
import numpy as np
from sklearn.pipeline import Pipeline
from sklearn.utils.validation import check_is_fitted
from . import funcs
__all__ = ['strip', 'AVAILABLE_MODELS']
class Func:
def __init__(self, name, code):
self.name = name
self.code = code
... | MaxHalford/naked | naked/__init__.py | __init__.py | py | 4,294 | python | en | code | 23 | github-code | 71 | [
{
"api_name": "types.FunctionType",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "inspect.getsource",
"line_number": 72,
"usage_type": "call"
},
{
"api_name": "inspect.getsource",
"line_number": 82,
"usage_type": "call"
},
{
"api_name": "sklearn.utils.... |
35436461255 | import time
from PIL import Image
import numpy as np
import datetime
IS_RASPI = False
try:
import spidev
import RPi.GPIO as GPIO
IS_RASPI = True
except:
pass
print("SPI LOAD:", IS_RASPI)
print("##### PYTHON NIL #####")
DISP = 27
SCS = 23 #22
VCOMSEL = 17
BACKLIGHT = 4 #if GPIO 4(pin7) is already used ... | hishizuka/py_mip_sample | mip_test.py | mip_test.py | py | 6,384 | python | en | code | 4 | github-code | 71 | [
{
"api_name": "spidev.SpiDev",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "RPi.GPIO.setmode",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "RPi.GPIO",
"line_number... |
38792658679 | """
brief:
- post-processes and plots the results of the training using PPO, either for MF-DRL or MB-DRL
- plots the results of the controlled case using the best policy in comparison to the uncontrolled case
dependencies:
- 'ppo_data_loader.py' for handling the loading, sorting and mer... | JanisGeise/robust_MB_DRL_for_flow_control | scripts_py_plots/plot_ppo_results.py | plot_ppo_results.py | py | 33,846 | python | en | code | 1 | github-code | 71 | [
{
"api_name": "typing.Union",
"line_number": 36,
"usage_type": "name"
},
{
"api_name": "typing.Union",
"line_number": 37,
"usage_type": "name"
},
{
"api_name": "typing.Union",
"line_number": 38,
"usage_type": "name"
},
{
"api_name": "typing.Union",
"line_numbe... |
40322671497 | from pycocotools.coco import COCO
import numpy as np
import cv2
import mediapipe as mp
import os, time
import com_detection as comm
import com_files as comf
#pip install pycocotools
COCO_PATH = "/home/leo/coco"
COCO_TYPE='train2017'
#COCO_TYPE='val2017'
annFile='{}/annotations/instances_{}.json'.format... | milliyang/hand | mediapipe/coco_01_to_yolo.py | coco_01_to_yolo.py | py | 6,714 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "pycocotools.coco.COCO",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "com_detection.read_filelist",
"line_number": 72,
"usage_type": "call"
},
{
"api_name": "com_detection.YOLO_FACE_MIN_SIZE",
"line_number": 90,
"usage_type": "attribute"
},
... |
37332217417 | # -*- coding: utf-8 -*-
import json
import re
import os
DEFULT_WORD_FILES = [r"./he-data/nouns.txt", r"./he-data/verbs.txt"]
def create_dict(files):
word_dict = {}
key_words = set()
CHARS_PATTERN = re.compile(r"""[^אבגדהוזחטיכלמנסעפצקרשתןףץםך"]""")
for file_name in files:
with open(file_name, ... | omeriss/Simantic | SemanticServer/HebrewProcessor.py | HebrewProcessor.py | py | 1,793 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "re.compile",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 31,
"usage_type": "call"
}
] |
23919196850 | import json
import os
import tempfile
import datasets
# dd = datasets.load_dataset(path="/home/roberta/loko/projects/sentence_transformer/apps",data_files="example_data.json")
# print(dd.data)
example = {
"idx": [
32326,
27449,
60108,
23141,
35226,
66852,
65093,
47847,
39440,
... | loko-ai/loko-sentence-transformer | apps/datasets_prove.py | datasets_prove.py | py | 1,817 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "tempfile.NamedTemporaryFile",
"line_number": 68,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 69,
"usage_type": "call"
},
{
"api_name": "datasets.load_dataset",
"line_number": 74,
"usage_type": "call"
},
{
"api_name": "datasets.... |
36071890549 | from django.contrib import messages
from django.core.paginator import Paginator, PageNotAnInteger, EmptyPage
from django.shortcuts import render, redirect
from .forms import UnitCreateForm
from .models import Unit
# Create your views here.
def create(request):
form = UnitCreateForm(request.POST or None)
conte... | nirazanmandal-zz/transcation | unit/views.py | views.py | py | 2,106 | python | en | code | 2 | github-code | 71 | [
{
"api_name": "forms.UnitCreateForm",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.redirect",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 18,
"usage_type": "call"
},
{
"api_name":... |
18129496214 | import numpy as np
import cv2
import matplotlib.pyplot as plt
import helpers
import time
def detect_face(img):
# img = img.copy()
face_cas = cv2.CascadeClassifier('data/haarcascades/haarcascade_frontalface_default.xml')
face_recs = face_cas.detectMultiScale(img, scaleFactor=1.2 , minNeighbors=9)
for (x,y,w,... | zarev/cv-course | cv-course/api.py | api.py | py | 1,997 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "cv2.CascadeClassifier",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cv2.TrackerTLD_create",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "cv2.sele... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.