id stringlengths 1 8 | text stringlengths 6 1.05M | dataset_id stringclasses 1
value |
|---|---|---|
9746057 | <reponame>spaceone/circuits<filename>docs/source/tutorials/telnet/telnet.py
#!/usr/bin/env python
import sys
from circuits import Component, handler
from circuits.io import File
from circuits.net.events import connect, write
from circuits.net.sockets import TCPClient
class Telnet(Component):
channel = "telnet"... | StarcoderdataPython |
11303549 | <reponame>code-review-doctor/project-application<filename>ProjectApplication/project_core/migrations/0105_project_projectpartner.py
# Generated by Django 3.0.3 on 2020-02-19 14:33
from django.conf import settings
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
im... | StarcoderdataPython |
12819566 | <reponame>paiuolo/django-sso-app
import logging
from django.dispatch import receiver
from django.db.models.signals import post_save
from django.contrib.auth import get_user_model
from ..utils import get_or_create_user_profile
logger = logging.getLogger('django_sso_app')
User = get_user_model()
@receiver(post_save... | StarcoderdataPython |
267824 | <reponame>jonico/pacbot<filename>installer/core/terraform/resources/aws/ecs.py
from core.terraform.resources import TerraformResource
from core.config import Settings
from core.providers.aws.boto3 import ecs
class ECSClusterResource(TerraformResource):
"""
Base resource class for Terraform AWS ECS cluster res... | StarcoderdataPython |
1968984 | import unittest
import puzzle8
import search
import random
import time
class TestMethods(unittest.TestCase):
offTwoPuzzle = puzzle8.state([3,4,5,2,0,6,1,8,7])
gradePuzzle1 = puzzle8.state([8,7,6,5,4,3,2,1,0])
gradePuzzle2 = puzzle8.state([1,2,3,4,5,6,7,8,0])
def setUp(self):
self.gradeP... | StarcoderdataPython |
1724429 | # coding=UTF-8
import json
import unittest
import requests
from jsonpath import jsonpath
class TaskControllerTest(unittest.TestCase):
def test_spi_integration(self):
headers = {'Content-type': 'application/x-www-form-urlencoded'}
payload = {'username': 'dev', 'password': '<PASSWORD>', 'tenentCo... | StarcoderdataPython |
6577320 | <reponame>wangao0824/Intelligent-Door-Lock
from upspackv2 import *
def sys_get_battery():
test = UPS2("/dev/ttyAMA0")
version,vin,batcap,vout = test.decode_uart()
return batcap
def sys_get_voltage():
test = UPS2("/dev/ttyAMA0")
version,vin,batcap,vout = test.decode_uart()
return float(vout)/10... | StarcoderdataPython |
6604857 | <gh_stars>1-10
def recuring_fractionto_decimal(divident: int, diviser: int) -> float:
c, q, r = 0.0, 0, 0
if(diviser%10 == 9):
diviser= diviser
elif(diviser%10 == 3):
diviser= 3*diviser
divident= 3*divident
elif(diviser%10 == 7):
diviser= 7*diviser
divident= 7*di... | StarcoderdataPython |
9745718 | from __future__ import absolute_import
from __future__ import print_function
import torch
import torch.nn as nn
import torch.nn.functional as F
from model.crf import CRF
from .wordsequence import WordSequence
class SeqModel(nn.Module):
def __init__(self, data):
super(SeqModel, self).__init__()
s... | StarcoderdataPython |
5037559 | from __future__ import print_function
import re
import os
import sys
import time
import json
import glob
import Queue
import pickle
import anydbm
import argparse
import traceback
import functools
import threading
# import subprocess
import contextlib
import collections
from datetime import datetime
from ceph_daemon i... | StarcoderdataPython |
184247 | from django.conf.urls import url
from . import views
from django.conf.urls import url, include
app_name = 'Article'
urlpatterns = [
url (r'^create/',views.CreateArticle,name="CreateArticle"),
url (r'^home/',views.home ,name="Home"),
url (r'^(?P<pk>[0-9]+)/addLike/',views.AddLike ,name="AddLike"),
url (... | StarcoderdataPython |
4975248 | from protocol import JsonReceiver
from twisted.internet import reactor
from twisted.internet import protocol, stdio
validClients = []
class verifyClientProtocol(JsonReceiver):
def __init__(self):
self.debug_enabled = False
def out(self, *messages):
for message in messages:
... | StarcoderdataPython |
4960440 | from prefect import task, Flow
from prefect.engine.executors import DaskExecutor
import numpy as np
@task
def generate_diag(n):
eigvals = np.arange(0, n, dtype=float)
D = np.diag(eigvals)
return D
@task
def generate_random(n):
A = np.random.random((n, n))
return A
@task
def qr(A):
Q, R = np.... | StarcoderdataPython |
1798882 | import numpy as np
import pandas as pd
import os
import random
from textblob import TextBlob
from googleapiclient.discovery import build
api_key = os.environ.get("API_KEY")
def related_ids(url):
api_key = os.environ.get("API_KEY")
# get video ID
vid = url.split('=')[-1]
# build youtube object to ac... | StarcoderdataPython |
4946176 | from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets("MNIST_data/", one_hot=True)
print(mnist.train.images.shape, mnist.train.labels.shape)
print(mnist.test.images.shape, mnist.test.labels.shape)
print(mnist.validation.images.shape,mnist.validation.labels.shape)
# Load data
... | StarcoderdataPython |
70710 | <gh_stars>1-10
from test import helpers
from passlib.hash import bcrypt
from flaskeddit import db
from flaskeddit.models import AppUser
class TestAuth:
def test_get_register(self, test_client):
"""
Tests GET request to the /register route to assert the registration page is
returned.
... | StarcoderdataPython |
3590693 | <filename>camera_state_predict/data_collect_haar.py
#!/usr/bin/env python3
# coding=utf-8
import cv2
import numpy as np
import csv
import time
from multiprocessing import Process
# 在中断后重新识别人脸会导致突然的速度变化,因为是和之前的有图速度进行运算
# 两边判断现在基本不起作用
class DataCollect(object):
def __init__(self, cam_id, video_name):
self.... | StarcoderdataPython |
1695383 | # Copyright 2010 New Relic, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | StarcoderdataPython |
5089546 | <reponame>limetoad/pyqualtrics<filename>pyqualtrics/__init__.py
# -*- coding: utf-8 -*-
#
# This file is part of the pyqualtrics package.
# For copyright and licensing information about this package, see the
# NOTICE.txt and LICENSE.txt files in its top-level directory; they are
# available at https://github.com/Baguag... | StarcoderdataPython |
4934757 | <reponame>aslemen/Keyaki.vim
import sys
is_syntag = False
tags = set()
for line in sys.stdin:
items = line.split()
if len(items) > 1:
if items[1] == "__syntags__":
is_syntag = True
elif items[1] == "__tagtab__":
tags.add(
(items[0], is_syntag)
... | StarcoderdataPython |
5015579 | import os
import pathlib
DIR_ROOT = pathlib.Path(__file__).parents[1] # If source...
if os.path.exists(os.path.abspath('./shard_projector.exe')): # If binary bundle...
DIR_ROOT = os.path.dirname(pathlib.Path(__file__))
DIR_INI = os.path.join(DIR_ROOT, "ini")
DIR_TEMP = os.path.join(DIR_ROOT, "temp")
DIR_EXT = os... | StarcoderdataPython |
208948 | from django.shortcuts import render
from hello.apidata import NewsNasaApi, ImageDayApi
def index(request):
return render(request, "index.html")
def home(request):
return render(request, "home.html")
def news(request):
context = {"ListNews": NewsNasaApi()}
return render(request, "news.html", contex... | StarcoderdataPython |
5143437 | import matplotlib.pyplot as plt
import numpy as np
import torch
import pickle
from tqdm import tqdm
from boneik import kinematics, solvers, utils, draw, criteria, io
from boneik import bvh
def create_human_body() -> kinematics.Body:
b = kinematics.BodyBuilder()
b.add_bone(
"torso",
"chest",
... | StarcoderdataPython |
3574829 | <filename>annealing/typesys/tools.py
import typed_ast.ast3 as ast
import util.error as err
import util.asttools as asttools
from typesys.mytypes import *
### Tools to manage type conversion ###
def width_max(ty1, ty2):
wd1 = ty1.width if isinstance(ty1, NumType) else -1
if isinstance(ty1, ComplexType):
... | StarcoderdataPython |
141744 | <reponame>samlet/stack<gh_stars>1-10
meta_pickups={
'aux_domains': lambda r, common, data: {
'pos': r['head_pos'], 'head': r['head'], 'head_word': r['head_word'],
**common, **data},
'root_domains': lambda r, common, data: {'pos': r['upos'], 'rel': r['rel'], **common, **data},
'verb_domains':... | StarcoderdataPython |
6625597 | import os
import utils
from SCons.Environment import Environment
from SCons.Script import Exit
def wii(env):
bin_path = "%s/bin" % os.environ['DEVKITPPC']
ogc_bin_path = "%s/libogc/bin" % os.environ['DEVKITPRO']
prefix = 'powerpc-eabi-'
def setup(x):
return '%s%s' % (prefix, x)
env['CC'] = ... | StarcoderdataPython |
3305872 | <filename>src/Game.py<gh_stars>1-10
from __future__ import annotations
from src.Player import Player
class Game:
"""
This class represents a game of ShootyBoats.
=== Public Attributes ===
player1:
The player that goes first; is a human player.
player2:
The player that goes second;... | StarcoderdataPython |
3487819 | '''
Created on Apr 28, 2020
@author: ballance
'''
from vsc.model.field_composite_model import FieldCompositeModel
'''
Created on Apr 28, 2020
@author: ballance
'''
from _io import StringIO
import vsc.model as vm
from vsc.model.constraint_dist_model import ConstraintDistModel
from vsc.model.constraint_expr_model imp... | StarcoderdataPython |
3454045 | <gh_stars>1-10
from keras.models import Model, load_model
from keras.layers import Dense, Dropout, BatchNormalization
from keras.metrics import top_k_categorical_accuracy
from keras.utils import to_categorical
from misc.AttentionWeightedAverage import *
from misc.funcs import *
from textgenrnn import textgenrnn
from ... | StarcoderdataPython |
1919078 | <gh_stars>0
from __future__ import absolute_import
from __future__ import unicode_literals
from mock import patch
from custom.icds_reports.ucr.tests.test_base_form_ucr import BaseFormsTest
class TestAWCMgtForms(BaseFormsTest):
ucr_name = "static-icds-cas-static-ls_home_visit_forms_filled"
@patch('custom.ic... | StarcoderdataPython |
5156405 | import sys
from pprint import pprint
# read apk
#import androguard.core.bytecodes.apk as apk
#a = apk.APK(sys.argv[1])
import androguard.core.bytecodes.dvm as dvm
from androguard.core.analysis.analysis import *
import inflection
import executor
import descriptors
# XXX must be library for this
def has_field_name(s... | StarcoderdataPython |
3255449 | <gh_stars>1-10
import torch.nn as nn
import torch.nn.functional as F
from tkdet.layers import get_norm
from tkdet.layers import make_divisible
from .base import Backbone
from .build import BACKBONE_REGISTRY
__all__ = [
"MobileNetV2",
"mobilenetv2_1_0",
"mobilenetv2_0_75",
"mobilenetv2_0_5",
"mobil... | StarcoderdataPython |
4961504 | <filename>features/pages/main_page.py
from selenium.webdriver.common.by import By
from features.pages.base_page import Page
def compare_data_with_expected(expected, real):
assert expected == real, "Expected '{}', but got '{}'".format(expected, real)
class MainPage(Page):
USER_ICON_LIST = (By.ID, "com.insta... | StarcoderdataPython |
11226349 | '''Module for executable menu.'''
from collections import deque
import re
import webbrowser
from config import CMD_PROMPTS, OUTPUTS, YES, NO, HEADERS
class Action:
'''Superclass for menu actions'''
def __init__(self, io, item_service, action=None):
self._io = io
self._item_service = item_servi... | StarcoderdataPython |
11321206 | <gh_stars>0
import numpy as np
import pickle
import tensorflow as tf
#init random seed
np.random.seed(5)
print(tf.__version__)
print("#### load matrix from pickle")
print()
print("#### build item information matrix of citeulike-a by bag of word")
# find vocabulary_size = 8000
tag_id_to_index = {}
with open(r"last.fm/t... | StarcoderdataPython |
5084453 | #!/usr/bin/env python
# Copyright (c) 2013, <NAME>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that
# the following conditions are met:
#
# Redistributions of source code must retain the aframeve copyright notice, this list of con... | StarcoderdataPython |
9601825 | <filename>fn_pagerduty/tests/test_resilient_common.py
# (c) Copyright IBM Corp. 2010, 2021. All Rights Reserved.
import pytest
from fn_pagerduty.lib import resilient_common
def test_merge_two_dicts():
a = {"k1": "v1"}
b = {"k2": "v2"}
expected_result = {
"k1": "v1",
"k2": "v2"
}
... | StarcoderdataPython |
1702217 | <gh_stars>0
# This script will query Twitter for the latest tweets using a given hashtag
# Based on each run it will commit the last analyzed tweet to disk, so we
# can look for all newer tweets after that.
# GOTCHAS: If 150 new tweets come in since the last analyzed tweet, we may
# have a gap in tweets we can review... | StarcoderdataPython |
3289390 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from flask.ext.wtf import Form
from wtforms import StringField, BooleanField, SubmitField
from wtforms.validators import Required, Length, EqualTo
from wtforms import ValidationError
from flask.ext.babel import lazy_gettext as _
| StarcoderdataPython |
6446985 | <gh_stars>1-10
__all__ = []
from .resnet import ResNetTorch
from .vgg import VGGTorch
from .alexnet import AlexNetTorch
from .squeezenet import SqueezeNetTorch
from .densenet import DenseNetTorch
from .mobilenet import MobileNetV2Torch
from .resnext import ResNeXtTorch
from .seblocks import SEBasicBlockTorch, SEBottle... | StarcoderdataPython |
2432 | <filename>yue/core/explorer/ftpsource.py
from ftplib import FTP,error_perm, all_errors
import posixpath
from io import BytesIO,SEEK_SET
from .source import DataSource
import sys
import re
reftp = re.compile('(ssh|ftp)\:\/\/(([^@:]+)?:?([^@]+)?@)?([^:]+)(:[0-9]+)?\/(.*)')
def parseFTPurl( url ):
m = reftp.match(... | StarcoderdataPython |
4882085 | from DSAE import Discriminative_SAE
import DSAE.Pre_process as Pre_process
import DSAE.To_full as To_full
import DSAE.Dropout as Dropout
import pandas as pd
import numpy as np
from sklearn.metrics import mean_absolute_error, mean_squared_error
from scipy.stats import pearsonr
from sklearn.metrics.pairwise import cosin... | StarcoderdataPython |
3366675 | """ Takes user input and prints results """
import getpass
from apscheduler.schedulers.background import BackgroundScheduler
import boiling
import consomme
def bool_to_private_text(private_bool):
""" If is_name_private returns false, return 'public', if true return 'public' """
if private_bool:
return... | StarcoderdataPython |
4847467 | <reponame>lchx1010/pxf
import os
import shutil
import unittest2 as unittest
from tinctest.lib.system import TINCSystem, TINCSystemException
class TINCSystemTests(unittest.TestCase):
def test_make_dirs(self):
test_dir = os.path.join(os.path.dirname(__file__), 'test_mkdirs')
if os.path.exists(... | StarcoderdataPython |
3266524 | <reponame>pashakondratyev/ParseBook<filename>parse.py<gh_stars>1-10
import sys
from threads.threads import Threads, Thread, Message
import json, html
THREAD_TAG = '<div class="thread">'
MESSAGE_TAG = '<div class="message">'
def main(messages_path, out_path):
with open(messages_path) as fp:
messages_html = fp.r... | StarcoderdataPython |
1753272 | <reponame>godsgift/gdohs<gh_stars>0
##########################################################################
#
# IMPORTS
#
##########################################################################
import unittest
import re
import time
import app
from pymongo import MongoClient
######... | StarcoderdataPython |
3499082 | """
Encoding and decoding classes for Python 2 client/server communication.
This module is used by both the Python 2 server and the Python 3 client, with
some modification to handle object references.
The encoding supports basic types and data structures. Everything else will
be encoded as an opaque object reference... | StarcoderdataPython |
6405235 | <reponame>gaufung/CodeBase
import time
import threading
def consumer(cond):
t = threading.current_thread()
with cond:
cond.wait()
print('{}: resource is avaiable to the consumer'.format(t.name))
return
def producer(cond):
t = threading.current_thread()
with cond:
print('{}:... | StarcoderdataPython |
9749635 | <filename>logger/asynx.py
from functools import wraps
from multiprocessing import Process, get_context
from multiprocessing.queues import Queue
from threading import Thread
import time
from multiprocessing import Lock
class BlockedQueue(Queue):
def __init__(self, maxsize=-1, block=True, timeout=None):
se... | StarcoderdataPython |
11305687 | from src.gtk_helper import GtkHelper
class InfobarWarningsViewModel:
def __init__(self, infobar, message):
self._infobar = infobar
self._message = message
@property
@GtkHelper.invoke_func_sync
def message(self):
return self._message.get_text()
@message.setter
@GtkHelp... | StarcoderdataPython |
11372802 | <filename>tfsrep/lib/assets.py
import plotly.graph_objs as go
import plotly.offline as offline
from tfsrep.lib.template import Template
class Assets:
def __init__(self, config, logger, data):
self.config = config
self.logger = logger
self.data = data
def generate(self):... | StarcoderdataPython |
11351228 | <gh_stars>1-10
import unittest
from htmlcomp import *
from htmlcomp.elements import *
@component
def RedBox(*children, **attributes):
return div(*children, style="background-color: red;", **attributes)
class OrderedList(Element):
def parse_items(items):
return items.split(",")
def default_attr... | StarcoderdataPython |
6641366 | <filename>api/tests/namespaces/v1/test_tags.py<gh_stars>1-10
"""This module contains unit tests for tag resource."""
from functools import partial
import json
import pytest
from pipwatch_api.namespaces.v1.tags import tag_representation_structure
from tests.namespaces.v1.conftest import get_model_repr
from tests.util... | StarcoderdataPython |
382520 | """Module for working with Illumina FASTQ files."""
import os
import gzip
from dtoolsid.utils import is_file_extension_in_list
def parse_fastq_title_line(fastq_title_line):
def illumina_bool(x):
if x == "Y":
return True
if x == "N":
return False
raise(ValueError)... | StarcoderdataPython |
180529 | <reponame>omk42/a<filename>Arrays/find_triplets.py
# Python3 program to count triplets with
# sum smaller than a given value
# Function to count triplets with sum smaller
# than a given value
def countTriplets(arr, n, sum):
# Sort input array
arr.sort()
# Initialize result
ans = 0
# Every iterat... | StarcoderdataPython |
4935255 | <reponame>ztang4/codetest
import plotly.graph_objects as go
import numpy as np
import dash_html_components as html
import dash_core_components as dcc
import plotly.graph_objects as go
import dash
BODY_COLOR = "#8e44ad"
BODY_OUTLINE_WIDTH = 10
AXIS_ZERO_LINE_COLOR = "#ffa801"
GROUND_COLOR = "rgb(240, 240, 240)"
PAPER_B... | StarcoderdataPython |
6419066 | <reponame>DomGonthier/PecheFantome
import GGlib
import mysql.connector
import gpxpy
#import gpxpy.gpx # needed if installed via : apt install python3-gpxpy
from xml.etree import ElementTree as ET
#############################################################
# ****** ******* ** ****** **** ** ****... | StarcoderdataPython |
1794160 | # -*- coding: utf-8 -*-
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softw... | StarcoderdataPython |
6520341 | <reponame>bbrzycki/evolution-project
import uuid
import math
def pure_replication(organism, population_dict, world, position_hash_table=None):
"""
Replace organism with two organism with similar parameters.
Essentially, only differences in parameters are organism id,
ancestry, age, and water / food le... | StarcoderdataPython |
11252350 | <filename>Cours-4/Programmes-Python/M3-6.py
maliste = [2, 1, -5, 8, 7, 3, 4]
i = 0
somme = 0 # commence à 0
while i < len(maliste):
somme = somme + maliste[i]
i = i + 1
print("La somme des éléments de ma liste est", somme)
# ici 2 + 1 + (-5) + 8 + 7 + 3 + 4 = 20
| StarcoderdataPython |
5005484 | import pytest
from iocage.lib.ioc_destroy import IOCDestroy
from iocage.lib.ioc_list import IOCList
require_root = pytest.mark.require_root
require_zpool = pytest.mark.require_zpool
@require_root
@require_zpool
def test_destroy():
jails, paths = IOCList("uuid").list_datasets()
uuid = jails["newtest"]
uu... | StarcoderdataPython |
1646442 | """
Copyright 2019 <NAME>
ARIN
REST API Documentation
https://www.arin.net/resources/whoisrws/whois_api.html
Web Query
https://whois.arin.net/ui/advanced.jsp
"""
| StarcoderdataPython |
5099563 | class AttachedPropertyBrowsableForTypeAttribute(AttachedPropertyBrowsableAttribute,_Attribute):
"""
Specifies that an attached property is browsable only for elements that derive from a specified type.
AttachedPropertyBrowsableForTypeAttribute(targetType: Type)
"""
def Equals(self,obj):
"""
Equals(... | StarcoderdataPython |
1784847 | from . import good, fail
# dummy
good('*', 0)
good('*', [1])
good('*', None)
fail('#', None)
good('*|#', None)
fail('*,#', None)
| StarcoderdataPython |
328870 | from .anagram import Anagram | StarcoderdataPython |
1771470 | from numpy import *
from matplotlib.pyplot import *
x=loadtxt('cluster_test.txt')
N=x.shape[0]
M=zeros((N,N))
# critical distance
dc=7
for i in range(N):
for j in range(i+1, N):
M[j, i] = M[i, j] = (sum((x[i, :]-x[j, :])**2))**0.5
print('matrix of distances is ready')
l1=[]
l2=[]
l3=[]
res... | StarcoderdataPython |
1623255 | # modified according to https://github.com/zhixuhao/unet
import keras
import numpy as np
import os
# import glob
import skimage.io as io
import skimage.transform as trans
from keras import backend as K
from keras.applications.vgg19 import VGG19
from keras.preprocessing import image
from keras.applications.vgg19 import... | StarcoderdataPython |
4881310 | import speech_recognition as sr
from TTSEngine import TTSEngine
def listen():
rec = sr.Recognizer()
mic = sr.Microphone()
rec.pause_threshold = 2
with mic as source:
print('Listening...')
audio = rec.listen(source)
try:
res = rec.recognize_google(audio, language='en-us')
... | StarcoderdataPython |
1994695 | import re
from datetime import datetime
def parameters_in_request_json(request_json, parameter_list):
for parameter in parameter_list:
if parameter not in request_json:
return False
return True
def valid_user_params(request_json):
email_regex = re.compile("[^@]+@[^@]+\\.[^@]+")
p... | StarcoderdataPython |
4939657 | <reponame>check-spelling/drizzlepac
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4 ai :
"""
Functions to compute and apply infinitesimal rotations to correct small shifts
and rotations in spherical coordinates
Uses formulae from `Budavari & Lubow (2012, ApJ, 761, 188) <http://adsabs.harvard.edu/abs/2012ApJ...76... | StarcoderdataPython |
6667805 | # -*- coding: utf-8 -*-
import re
import time
__all__ = [
'EventPredictor'
]
class EventPredictor:
"""
Class to classify a new audio signal and determine if it's a baby cry
"""
def __init__(self, model):
self.model = model
def classify(self, new_signal):
"""
Make pr... | StarcoderdataPython |
9613340 | metros = float(input('Digite um valor em metros: '))
centimetros = metros * 100
milimetros = metros * 1000
decimetros = metros * 10
decametro = metros / 10
hectometro = metros / 100
kilometro = metros / 1000
print('A conversão de metro para CM foi {} \n e MM foi {} \n em DM foi {} \n em DAM foi {} \n em HM {} \n e ... | StarcoderdataPython |
5054401 |
import numpy as np
import matplotlib.pyplot as plt
from scipy.io import wavfile
from scipy.fftpack import dct
import warnings
warnings.filterwarnings('ignore')
import matplotlib.pyplot as plt
import librosa
import pickle
from PixelShift.explore_data import PixelShiftSound
# SVM libraies
from sklearn import svm
from sk... | StarcoderdataPython |
4986206 | <gh_stars>0
import logging
from typing import Tuple
import sqlalchemy as sa
from aiohttp import web
from psycopg2 import Error as DbApiError
from tenacity import retry
from servicelib.aiopg_utils import PostgresRetryPolicyUponOperation
from .models import tokens
from .settings import APP_CONFIG_KEY, APP_DB_ENGINE_KE... | StarcoderdataPython |
1692589 | <filename>example/diff_imports/import_from_module.py
import time
def do_some_stuff():
time.sleep(1)
| StarcoderdataPython |
5095814 | import time
import collections
import Qt
from Qt import QtWidgets, QtCore, QtGui
import qtawesome
from openpype.style import (
get_objected_colors,
get_default_tools_icon_color,
)
from openpype.tools.flickcharm import FlickCharm
from .views import (
TreeViewSpinner,
DeselectableTreeView
)
from .widge... | StarcoderdataPython |
21063 | import numpy as np
import pandas as pd
import warnings
warnings.simplefilter(action='ignore', category=FutureWarning)
from sklearn.model_selection import train_test_split, cross_validate
from sklearn.preprocessing import OneHotEncoder, StandardScaler, OrdinalEncoder
from sklearn.impute import SimpleImputer
from sklearn... | StarcoderdataPython |
1977653 | from scipy.io import loadmat
import numpy as np
from matplotlib import pyplot as plt
# This script prints selected frames of the stored escalator video sequence
data = loadmat('escalator_130p.mat')
X = data["X"]
dimensions = data["dimensions"][0]
framenumbers = [1806, 1813, 1820]
for framenumber in framenumbers:
... | StarcoderdataPython |
5048158 | <gh_stars>0
import numpy as np
class Optimizer_Adam:
def __init__(
self, learning_rate=0.001, decay=0.0, epsilon=1e-7, beta_1=0.9, beta_2=0.999
):
self.learning_rate = learning_rate
self.current_learning_rate = learning_rate
self.decay = decay
self.iterations = 0
... | StarcoderdataPython |
6414782 | <filename>eff_word_net/__init__.py<gh_stars>10-100
"""
.. include:: ../README.md
"""
import os
RATE=16000
samples_loc = os.path.join(os.path.dirname(os.path.realpath(__file__)),"sample_refs")
from eff_word_net.package_installation_scripts import check_install_tflite
check_install_tflite()
| StarcoderdataPython |
1746453 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @File : model.py
# @Author: zixiao
# @Date : 2019-04-07
# @Desc :
from torch import nn
import torch.nn.functional as F
import torch
class CNN(nn.Module):
def __init__(self, in_channels, num_action):
super(CNN, self).__init__()
self.conv1 = nn.Sequ... | StarcoderdataPython |
3436084 | import daskutils.math
import daskutils.base
import daskutils.io.msgpack
import dask.bag
import dask.distributed
import os.path
import uuid
import msgpack
import itertools
import contextlib
import socket
import subprocess
import base64
@contextlib.contextmanager
def worker_client(*arg, **kw):
started = False
tr... | StarcoderdataPython |
6405210 | #!/usr/bin/python
from flask import Flask, request, Response, jsonify, abort
from functools import wraps
import ssl
import logging, sys
import json
app = Flask(__name__)
app.config['DEBUG'] = True
import jwt
HMAC_SECRET='secret'
@app.route('/', methods = ['GET'])
def Default():
resp = Response()
resp.heade... | StarcoderdataPython |
277951 | <reponame>anugrah86/datacatalog-connectors-bi
#!/usr/bin/python
#
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2... | StarcoderdataPython |
1865732 | <gh_stars>0
# This file is part of the Open Data Cube, see https://opendatacube.org for more information
#
# Copyright (c) 2015-2020 ODC Contributors
# SPDX-License-Identifier: Apache-2.0
import pytest
import moto
from pathlib import Path
import dask
import dask.delayed
from datacube.utils.io import slurp
from datacu... | StarcoderdataPython |
5154566 | <reponame>aarongreig/sycl-blas
#/***************************************************************************
# *
# * @license
# * Copyright (C) Codeplay Software Limited
# * Licensed under the Apache License, Version 2.0 (the "License");
# * you may not use this file except in compliance with the License.
# * You ... | StarcoderdataPython |
6493277 | <reponame>PdxCodeGuild/FlaskApp-Tutorial<gh_stars>10-100
import re
from flask import current_app
from flask_wtf import FlaskForm
from wtforms import BooleanField, DecimalField, FloatField, IntegerField, \
DateTimeField, DateField, \
FileField, PasswordField, StringField, TextAreaField, \
RadioField, Select... | StarcoderdataPython |
5067730 | from collections import namedtuple
Token = namedtuple('Token', ['type', 'value'])
Elements = 'Number Variable Parenthesis Operator EOF'.split()
transition_mat = [
# Space Digit Letter Hashtag Parens Operator EOF
[0, 1, None, 3, 102, 103, 104], # State 0
[-1, 1, None, -1, -1, -1, -1], # State 1: Number
... | StarcoderdataPython |
6590252 | import sys,os,lldb
def check_has_dir_in_path(dirname):
return sys.path.__contains__(dirname);
def ensure_has_dir_in_path(dirname):
dirname = os.path.abspath(dirname)
if not (check_has_dir_in_path(dirname)):
sys.path.append(dirname);
def do_import(debugger,modname):
if (len(modname) > 4 and modname[-4:] == '.py... | StarcoderdataPython |
3415947 | <filename>pms7003.py
"""
PMS7003 datasheet
http://eleparts.co.kr/data/_gextends/good-pdf/201803/good-pdf-4208690-1.pdf
"""
from dataclasses import dataclass
import glob
import logging
import os
import serial
from serial.tools.list_ports import comports
import struct
import time
from typing import Any, Dict, NamedTuple... | StarcoderdataPython |
3489078 | <reponame>vanitas-vanitatum/swarm-intelligence
from abc import ABC, abstractmethod
class Drawable(ABC):
@abstractmethod
def get_patch(self, **kwargs):
pass
def draw(self, ax, **kwargs):
patch = self.get_patch(**kwargs)
if isinstance(patch, list) or isinstance(patch, tuple):
... | StarcoderdataPython |
9657045 | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""
.. _sdc_pepolar :
Phase Encoding POLARity (*PEPOLAR*) techniques
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"""
import pkg_resources as pkgr
from nipype.pipeline import engine as pe
from nipype.... | StarcoderdataPython |
4983953 | <gh_stars>0
# Given an array nums of integers, return how many of them contain an even number of digits.
# Example 1:
# Input: nums = [12,345,2,6,7896]
# Output: 2
# Explanation:
# 12 contains 2 digits (even number of digits).
# 345 contains 3 digits (odd number of digits).
# 2 contains 1 digit (odd number of digits)... | StarcoderdataPython |
5108059 | <reponame>C0mpy/Soft-Computing<gh_stars>0
import HogDescriptor as h
from sklearn.svm import SVC
from skimage.io import imread
import time
import numpy as np
import os
from sklearn.metrics import accuracy_score
if __name__ == "__main__":
start = time.time()
descriptor = h.HOGDescriptor((5, 5))
pos_imgs = ... | StarcoderdataPython |
6600089 | # %% [markdown]
# # Training a binary classifier to identify accounts that are likely
# commercial business vs those that are likely real human users
#
# The goal of this file is to be able to identify which of the followers that I
# selected are commercial followers or otherwise small businesses. This
# corrupts m... | StarcoderdataPython |
1746978 | <filename>models/Global-Flow-Local-Attention/data/hmubi_dataset.py
import os.path
from data.base_dataset import BaseDataset
from data.image_folder import make_dataset
import pandas as pd
from util import pose_utils
import numpy as np
import torch
from tqdm import tqdm
class HMUBIDataset(BaseDataset):
@staticmeth... | StarcoderdataPython |
3281004 | <gh_stars>10-100
import numpy as np
from evo_gym.spaces import Tuple, Dict
from evo_gym.vector.utils.spaces import _BaseGymSpaces
from collections import OrderedDict
__all__ = ['concatenate', 'create_empty_array']
def concatenate(items, out, space):
"""Concatenate multiple samples from space into a single object... | StarcoderdataPython |
6633938 | #!/usr/bin/env python
# Copyright 2018-2019 <NAME> & Contributors. All rights reserved.
#
# Use of this source code is governed by a MIT-style
# license that can be found in the LICENSE file.
import datetime
import re
import sys
re_copyright = re.compile(rf"{datetime.datetime.now().year} <NAME>")
re_copyright_bad_ye... | StarcoderdataPython |
3575812 | # Generated by Django 2.2.3 on 2021-10-20 15:34
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('proyectos', '0001_initial'),
]
operations = [
migrations.RenameModel(
old_name='galeria',
new_name='Proyecto',
),
... | StarcoderdataPython |
194939 | <gh_stars>1-10
from django.db import models
from phonenumber_field.modelfields import PhoneNumberField
from recurrence.fields import RecurrenceField
# from schedule.models import Event
from datetime import datetime
GATHERING_TYPES = [
# ('BS', 'Bible Study'),
# ('SR', 'Sex and Relationships'),
# ('ME', 'M... | StarcoderdataPython |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.